mirror of
https://github.com/kevinpapst/kimai2.git
synced 2024-12-22 12:18:29 +00:00
17a815e5a9
* do not rely on node_modules path * bump eslint to v9, run eslint via npm task, remove from build task * loosen dependencies and update all packages * rebuild assets with latest frontend packages * bump webpack encore and dependencies * bump to latest stable yarn * explicitly mention dependencies
2 lines
332 KiB
JavaScript
2 lines
332 KiB
JavaScript
/*! For license information please see app.ea4d46bf.js.LICENSE.txt */
|
||
(self.webpackChunkkimai2=self.webpackChunkkimai2||[]).push([[524],{4028:function(t,e,n){n(4975),n(9828),n.g.KimaiPaginatedBoxWidget=n(4100).A,n.g.KimaiReloadPageWidget=n(5170).A,n.g.KimaiColor=n(9997).A,n.g.KimaiStorage=n(5247).A},9828:function(t,e,n){"use strict";class i extends Error{}class s extends i{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class r extends i{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class o extends i{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class a extends i{}class l extends i{constructor(t){super(`Invalid unit ${t}`)}}class c extends i{}class u extends i{constructor(){super("Zone is an abstract class")}}const d="numeric",h="short",p="long",m={year:d,month:d,day:d},f={year:d,month:h,day:d},g={year:d,month:h,day:d,weekday:h},v={year:d,month:p,day:d},y={year:d,month:p,day:d,weekday:p},b={hour:d,minute:d},_={hour:d,minute:d,second:d},w={hour:d,minute:d,second:d,timeZoneName:h},k={hour:d,minute:d,second:d,timeZoneName:p},T={hour:d,minute:d,hourCycle:"h23"},x={hour:d,minute:d,second:d,hourCycle:"h23"},E={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:h},D={hour:d,minute:d,second:d,hourCycle:"h23",timeZoneName:p},S={year:d,month:d,day:d,hour:d,minute:d},O={year:d,month:d,day:d,hour:d,minute:d,second:d},L={year:d,month:h,day:d,hour:d,minute:d},C={year:d,month:h,day:d,hour:d,minute:d,second:d},M={year:d,month:h,day:d,weekday:h,hour:d,minute:d},A={year:d,month:p,day:d,hour:d,minute:d,timeZoneName:h},I={year:d,month:p,day:d,hour:d,minute:d,second:d,timeZoneName:h},N={year:d,month:p,day:d,weekday:p,hour:d,minute:d,timeZoneName:p},F={year:d,month:p,day:d,weekday:p,hour:d,minute:d,second:d,timeZoneName:p};class P{get type(){throw new u}get name(){throw new u}get ianaName(){return this.name}get isUniversal(){throw new u}offsetName(t,e){throw new u}formatOffset(t,e){throw new u}offset(t){throw new u}equals(t){throw new u}get isValid(){throw new u}}let j=null;class q extends P{static get instance(){return null===j&&(j=new q),j}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:e,locale:n}){return ne(t,e,n)}formatOffset(t,e){return oe(this.offset(t),e)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return"system"===t.type}get isValid(){return!0}}let H={};const V={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let $={};class R extends P{static create(t){return $[t]||($[t]=new R(t)),$[t]}static resetCache(){$={},H={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}}constructor(t){super(),this.zoneName=t,this.valid=R.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:e,locale:n}){return ne(t,e,n,this.name)}formatOffset(t,e){return oe(this.offset(t),e)}offset(t){const e=new Date(t);if(isNaN(e))return NaN;const n=(i=this.name,H[i]||(H[i]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:i,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),H[i]);var i;let[s,r,o,a,l,c,u]=n.formatToParts?function(t,e){const n=t.formatToParts(e),i=[];for(let t=0;t<n.length;t++){const{type:e,value:s}=n[t],r=V[e];"era"===e?i[r]=s:Ft(r)||(i[r]=parseInt(s,10))}return i}(n,e):function(t,e){const n=t.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,s,r,o,a,l,c,u]=i;return[o,s,r,a,l,c,u]}(n,e);"BC"===a&&(s=1-Math.abs(s));let d=+e;const h=d%1e3;return d-=h>=0?h:1e3+h,(Qt({year:s,month:r,day:o,hour:24===l?0:l,minute:c,second:u,millisecond:0})-d)/6e4}equals(t){return"iana"===t.type&&t.name===this.name}get isValid(){return this.valid}}let W={};let B={};function z(t,e={}){const n=JSON.stringify([t,e]);let i=B[n];return i||(i=new Intl.DateTimeFormat(t,e),B[n]=i),i}let Y={};let U={};let Z=null;let J={};function K(t,e,n,i){const s=t.listingMode();return"error"===s?null:"en"===s?n(e):i(e)}class G{constructor(t,e,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:i,floor:s,...r}=n;if(!e||Object.keys(r).length>0){const e={useGrouping:!1,...n};n.padTo>0&&(e.minimumIntegerDigits=n.padTo),this.inf=function(t,e={}){const n=JSON.stringify([t,e]);let i=Y[n];return i||(i=new Intl.NumberFormat(t,e),Y[n]=i),i}(t,e)}}format(t){if(this.inf){const e=this.floor?Math.floor(t):t;return this.inf.format(e)}return Bt(this.floor?Math.floor(t):Zt(t,3),this.padTo)}}class Q{constructor(t,e,n){let i;if(this.opts=n,this.originalZone=void 0,this.opts.timeZone)this.dt=t;else if("fixed"===t.zone.type){const e=t.offset/60*-1,n=e>=0?`Etc/GMT+${e}`:`Etc/GMT${e}`;0!==t.offset&&R.create(n).valid?(i=n,this.dt=t):(i="UTC",this.dt=0===t.offset?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else"system"===t.zone.type?this.dt=t:"iana"===t.zone.type?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const s={...this.opts};s.timeZone=s.timeZone||i,this.dtf=z(e,s)}format(){return this.originalZone?this.formatToParts().map((({value:t})=>t)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((t=>{if("timeZoneName"===t.type){const e=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:e}}return t})):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class X{constructor(t,e,n){this.opts={style:"long",...n},!e&&qt()&&(this.rtf=function(t,e={}){const{base:n,...i}=e,s=JSON.stringify([t,i]);let r=U[s];return r||(r=new Intl.RelativeTimeFormat(t,e),U[s]=r),r}(t,n))}format(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,n="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},r=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===n&&r){const n="days"===t;switch(e){case 1:return n?"tomorrow":`next ${s[t][0]}`;case-1:return n?"yesterday":`last ${s[t][0]}`;case 0:return n?"today":`this ${s[t][0]}`}}const o=Object.is(e,-0)||e<0,a=Math.abs(e),l=1===a,c=s[t],u=i?l?c[1]:c[2]||c[1]:l?s[t][0]:t;return o?`${a} ${u} ago`:`in ${a} ${u}`}(e,t,this.opts.numeric,"long"!==this.opts.style)}formatToParts(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]}}const tt={firstDay:1,minimalDays:4,weekend:[6,7]};class et{static fromOpts(t){return et.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,e,n,i,s=!1){const r=t||bt.defaultLocale,o=r||(s?"en-US":Z||(Z=(new Intl.DateTimeFormat).resolvedOptions().locale,Z)),a=e||bt.defaultNumberingSystem,l=n||bt.defaultOutputCalendar,c=Rt(i)||bt.defaultWeekSettings;return new et(o,a,l,c,r)}static resetCache(){Z=null,B={},Y={},U={}}static fromObject({locale:t,numberingSystem:e,outputCalendar:n,weekSettings:i}={}){return et.create(t,e,n,i)}constructor(t,e,n,i,s){const[r,o,a]=function(t){const e=t.indexOf("-x-");-1!==e&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(-1===n)return[t];{let e,i;try{e=z(t).resolvedOptions(),i=t}catch(s){const r=t.substring(0,n);e=z(r).resolvedOptions(),i=r}const{numberingSystem:s,calendar:r}=e;return[i,s,r]}}(t);this.locale=r,this.numberingSystem=e||o||null,this.outputCalendar=n||a||null,this.weekSettings=i,this.intl=function(t,e,n){return n||e?(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`),t):t}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),e=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return t&&e?"en":"intl"}clone(t){return t&&0!==Object.getOwnPropertyNames(t).length?et.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Rt(t.weekSettings)||this.weekSettings,t.defaultToEN||!1):this}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,e=!1){return K(this,t,de,(()=>{const n=e?{month:t,day:"numeric"}:{month:t},i=e?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=function(t){const e=[];for(let n=1;n<=12;n++){const i=fi.utc(2009,n,1);e.push(t(i))}return e}((t=>this.extract(t,n,"month")))),this.monthsCache[i][t]}))}weekdays(t,e=!1){return K(this,t,fe,(()=>{const n=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=e?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=function(t){const e=[];for(let n=1;n<=7;n++){const i=fi.utc(2016,11,13+n);e.push(t(i))}return e}((t=>this.extract(t,n,"weekday")))),this.weekdaysCache[i][t]}))}meridiems(){return K(this,void 0,(()=>ge),(()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[fi.utc(2016,11,13,9),fi.utc(2016,11,13,19)].map((e=>this.extract(e,t,"dayperiod")))}return this.meridiemCache}))}eras(t){return K(this,t,_e,(()=>{const e={era:t};return this.eraCache[t]||(this.eraCache[t]=[fi.utc(-40,1,1),fi.utc(2017,1,1)].map((t=>this.extract(t,e,"era")))),this.eraCache[t]}))}extract(t,e,n){const i=this.dtFormatter(t,e).formatToParts().find((t=>t.type.toLowerCase()===n));return i?i.value:null}numberFormatter(t={}){return new G(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,e={}){return new Q(t,this.intl,e)}relFormatter(t={}){return new X(this.intl,this.isEnglish(),t)}listFormatter(t={}){return function(t,e={}){const n=JSON.stringify([t,e]);let i=W[n];return i||(i=new Intl.ListFormat(t,e),W[n]=i),i}(this.intl,t)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Ht()?function(t){let e=J[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,J[t]=e}return e}(this.locale):tt}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let nt=null;class it extends P{static get utcInstance(){return null===nt&&(nt=new it(0)),nt}static instance(t){return 0===t?it.utcInstance:new it(t)}static parseSpecifier(t){if(t){const e=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new it(ie(e[1],e[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${oe(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${oe(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,e){return oe(this.fixed,e)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return"fixed"===t.type&&t.fixed===this.fixed}get isValid(){return!0}}class st extends P{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function rt(t,e){if(Ft(t)||null===t)return e;if(t instanceof P)return t;if("string"==typeof t){const n=t.toLowerCase();return"default"===n?e:"local"===n||"system"===n?q.instance:"utc"===n||"gmt"===n?it.utcInstance:it.parseSpecifier(n)||R.create(t)}return Pt(t)?it.instance(t):"object"==typeof t&&"offset"in t&&"function"==typeof t.offset?t:new st(t)}const ot={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},at={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},lt=ot.hanidec.replace(/[\[|\]]/g,"").split("");let ct={};function ut({numberingSystem:t},e=""){const n=t||"latn";return ct[n]||(ct[n]={}),ct[n][e]||(ct[n][e]=new RegExp(`${ot[n]}${e}`)),ct[n][e]}let dt,ht=()=>Date.now(),pt="system",mt=null,ft=null,gt=null,vt=60,yt=null;class bt{static get now(){return ht}static set now(t){ht=t}static set defaultZone(t){pt=t}static get defaultZone(){return rt(pt,q.instance)}static get defaultLocale(){return mt}static set defaultLocale(t){mt=t}static get defaultNumberingSystem(){return ft}static set defaultNumberingSystem(t){ft=t}static get defaultOutputCalendar(){return gt}static set defaultOutputCalendar(t){gt=t}static get defaultWeekSettings(){return yt}static set defaultWeekSettings(t){yt=Rt(t)}static get twoDigitCutoffYear(){return vt}static set twoDigitCutoffYear(t){vt=t%100}static get throwOnInvalid(){return dt}static set throwOnInvalid(t){dt=t}static resetCaches(){et.resetCache(),R.resetCache(),fi.resetCache(),ct={}}}class _t{constructor(t,e){this.reason=t,this.explanation=e}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const wt=[0,31,59,90,120,151,181,212,243,273,304,334],kt=[0,31,60,91,121,152,182,213,244,274,305,335];function Tt(t,e){return new _t("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function xt(t,e,n){const i=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return 0===s?7:s}function Et(t,e,n){return n+(Jt(t)?kt:wt)[e-1]}function Dt(t,e){const n=Jt(t)?kt:wt,i=n.findIndex((t=>t<e));return{month:i+1,day:e-n[i]}}function St(t,e){return(t-e+7)%7+1}function Ot(t,e=4,n=1){const{year:i,month:s,day:r}=t,o=Et(i,s,r),a=St(xt(i,s,r),n);let l,c=Math.floor((o-a+14-e)/7);return c<1?(l=i-1,c=te(l,e,n)):c>te(i,e,n)?(l=i+1,c=1):l=i,{weekYear:l,weekNumber:c,weekday:a,...ae(t)}}function Lt(t,e=4,n=1){const{weekYear:i,weekNumber:s,weekday:r}=t,o=St(xt(i,1,e),n),a=Kt(i);let l,c=7*s+r-o-7+e;c<1?(l=i-1,c+=Kt(l)):c>a?(l=i+1,c-=Kt(i)):l=i;const{month:u,day:d}=Dt(l,c);return{year:l,month:u,day:d,...ae(t)}}function Ct(t){const{year:e,month:n,day:i}=t;return{year:e,ordinal:Et(e,n,i),...ae(t)}}function Mt(t){const{year:e,ordinal:n}=t,{month:i,day:s}=Dt(e,n);return{year:e,month:i,day:s,...ae(t)}}function At(t,e){if(!Ft(t.localWeekday)||!Ft(t.localWeekNumber)||!Ft(t.localWeekYear)){if(!Ft(t.weekday)||!Ft(t.weekNumber)||!Ft(t.weekYear))throw new a("Cannot mix locale-based week fields with ISO-based week fields");return Ft(t.localWeekday)||(t.weekday=t.localWeekday),Ft(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Ft(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function It(t){const e=jt(t.year),n=Wt(t.month,1,12),i=Wt(t.day,1,Gt(t.year,t.month));return e?n?!i&&Tt("day",t.day):Tt("month",t.month):Tt("year",t.year)}function Nt(t){const{hour:e,minute:n,second:i,millisecond:s}=t,r=Wt(e,0,23)||24===e&&0===n&&0===i&&0===s,o=Wt(n,0,59),a=Wt(i,0,59),l=Wt(s,0,999);return r?o?a?!l&&Tt("millisecond",s):Tt("second",i):Tt("minute",n):Tt("hour",e)}function Ft(t){return void 0===t}function Pt(t){return"number"==typeof t}function jt(t){return"number"==typeof t&&t%1==0}function qt(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function Ht(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(t){return!1}}function Vt(t,e,n){if(0!==t.length)return t.reduce(((t,i)=>{const s=[e(i),i];return t&&n(t[0],s[0])===t[0]?t:s}),null)[1]}function $t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Rt(t){if(null==t)return null;if("object"!=typeof t)throw new c("Week settings must be an object");if(!Wt(t.firstDay,1,7)||!Wt(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some((t=>!Wt(t,1,7))))throw new c("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Wt(t,e,n){return jt(t)&&t>=e&&t<=n}function Bt(t,e=2){let n;return n=t<0?"-"+(""+-t).padStart(e,"0"):(""+t).padStart(e,"0"),n}function zt(t){return Ft(t)||null===t||""===t?void 0:parseInt(t,10)}function Yt(t){return Ft(t)||null===t||""===t?void 0:parseFloat(t)}function Ut(t){if(!Ft(t)&&null!==t&&""!==t){const e=1e3*parseFloat("0."+t);return Math.floor(e)}}function Zt(t,e,n=!1){const i=10**e;return(n?Math.trunc:Math.round)(t*i)/i}function Jt(t){return t%4==0&&(t%100!=0||t%400==0)}function Kt(t){return Jt(t)?366:365}function Gt(t,e){const n=function(t,e){return t-e*Math.floor(t/e)}(e-1,12)+1;return 2===n?Jt(t+(e-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Qt(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Xt(t,e,n){return-St(xt(t,1,e),n)+e-1}function te(t,e=4,n=1){const i=Xt(t,e,n),s=Xt(t+1,e,n);return(Kt(t)-i+s)/7}function ee(t){return t>99?t:t>bt.twoDigitCutoffYear?1900+t:2e3+t}function ne(t,e,n,i=null){const s=new Date(t),r={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(r.timeZone=i);const o={timeZoneName:e,...r},a=new Intl.DateTimeFormat(n,o).formatToParts(s).find((t=>"timezonename"===t.type.toLowerCase()));return a?a.value:null}function ie(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const i=parseInt(e,10)||0;return 60*n+(n<0||Object.is(n,-0)?-i:i)}function se(t){const e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new c(`Invalid unit value ${t}`);return e}function re(t,e){const n={};for(const i in t)if($t(t,i)){const s=t[i];if(null==s)continue;n[e(i)]=se(s)}return n}function oe(t,e){const n=Math.trunc(Math.abs(t/60)),i=Math.trunc(Math.abs(t%60)),s=t>=0?"+":"-";switch(e){case"short":return`${s}${Bt(n,2)}:${Bt(i,2)}`;case"narrow":return`${s}${n}${i>0?`:${i}`:""}`;case"techie":return`${s}${Bt(n,2)}${Bt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function ae(t){return function(t,e){return e.reduce(((e,n)=>(e[n]=t[n],e)),{})}(t,["hour","minute","second","millisecond"])}const le=["January","February","March","April","May","June","July","August","September","October","November","December"],ce=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ue=["J","F","M","A","M","J","J","A","S","O","N","D"];function de(t){switch(t){case"narrow":return[...ue];case"short":return[...ce];case"long":return[...le];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const he=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],pe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],me=["M","T","W","T","F","S","S"];function fe(t){switch(t){case"narrow":return[...me];case"short":return[...pe];case"long":return[...he];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const ge=["AM","PM"],ve=["Before Christ","Anno Domini"],ye=["BC","AD"],be=["B","A"];function _e(t){switch(t){case"narrow":return[...be];case"short":return[...ye];case"long":return[...ve];default:return null}}function we(t,e){let n="";for(const i of t)i.literal?n+=i.val:n+=e(i.val);return n}const ke={D:m,DD:f,DDD:v,DDDD:y,t:b,tt:_,ttt:w,tttt:k,T:T,TT:x,TTT:E,TTTT:D,f:S,ff:L,fff:A,ffff:N,F:O,FF:C,FFF:I,FFFF:F};class Te{static create(t,e={}){return new Te(t,e)}static parseFormat(t){let e=null,n="",i=!1;const s=[];for(let r=0;r<t.length;r++){const o=t.charAt(r);"'"===o?(n.length>0&&s.push({literal:i||/^\s+$/.test(n),val:n}),e=null,n="",i=!i):i||o===e?n+=o:(n.length>0&&s.push({literal:/^\s+$/.test(n),val:n}),n=o,e=o)}return n.length>0&&s.push({literal:i||/^\s+$/.test(n),val:n}),s}static macroTokenToFormatOpts(t){return ke[t]}constructor(t,e){this.opts=e,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,e){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(t,{...this.opts,...e}).format()}dtFormatter(t,e={}){return this.loc.dtFormatter(t,{...this.opts,...e})}formatDateTime(t,e){return this.dtFormatter(t,e).format()}formatDateTimeParts(t,e){return this.dtFormatter(t,e).formatToParts()}formatInterval(t,e){return this.dtFormatter(t.start,e).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,e){return this.dtFormatter(t,e).resolvedOptions()}num(t,e=0){if(this.opts.forceSimple)return Bt(t,e);const n={...this.opts};return e>0&&(n.padTo=e),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,e){const n="en"===this.loc.listingMode(),i=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=(e,n)=>this.loc.extract(t,e,n),r=e=>t.isOffsetFixed&&0===t.offset&&e.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,e.format):"",o=()=>n?function(t){return ge[t.hour<12?0:1]}(t):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(e,i)=>n?function(t,e){return de(e)[t.month-1]}(t,e):s(i?{month:e}:{month:e,day:"numeric"},"month"),l=(e,i)=>n?function(t,e){return fe(e)[t.weekday-1]}(t,e):s(i?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday"),c=e=>{const n=Te.macroTokenToFormatOpts(e);return n?this.formatWithSystemDefault(t,n):e},u=e=>n?function(t,e){return _e(e)[t.year<0?0:1]}(t,e):s({era:e},"era");return we(Te.parseFormat(e),(e=>{switch(e){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12==0?12:t.hour%12);case"hh":return this.num(t.hour%12==0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return r({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return r({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return r({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return o();case"d":return i?s({day:"numeric"},"day"):this.num(t.day);case"dd":return i?s({day:"2-digit"},"day"):this.num(t.day,2);case"c":case"E":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?s({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?s({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return i?s({month:"numeric"},"month"):this.num(t.month);case"MM":return i?s({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return i?s({year:"numeric"},"year"):this.num(t.year);case"yy":return i?s({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?s({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?s({year:"numeric"},"year"):this.num(t.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(e)}}))}formatDurationFromString(t,e){const n=t=>{switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=Te.parseFormat(e),s=i.reduce(((t,{literal:e,val:n})=>e?t:t.concat(n)),[]);return we(i,(t=>e=>{const i=n(e);return i?this.num(t.get(i),e.length):e})(t.shiftTo(...s.map(n).filter((t=>t)))))}}const xe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ee(...t){const e=t.reduce(((t,e)=>t+e.source),"");return RegExp(`^${e}$`)}function De(...t){return e=>t.reduce((([t,n,i],s)=>{const[r,o,a]=s(e,i);return[{...t,...r},o||n,a]}),[{},null,1]).slice(0,2)}function Se(t,...e){if(null==t)return[null,null];for(const[n,i]of e){const e=n.exec(t);if(e)return i(e)}return[null,null]}function Oe(...t){return(e,n)=>{const i={};let s;for(s=0;s<t.length;s++)i[t[s]]=zt(e[n+s]);return[i,null,n+s]}}const Le=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Ce=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Me=RegExp(`${Ce.source}${`(?:${Le.source}?(?:\\[(${xe.source})\\])?)?`}`),Ae=RegExp(`(?:T${Me.source})?`),Ie=Oe("weekYear","weekNumber","weekDay"),Ne=Oe("year","ordinal"),Fe=RegExp(`${Ce.source} ?(?:${Le.source}|(${xe.source}))?`),Pe=RegExp(`(?: ${Fe.source})?`);function je(t,e,n){const i=t[e];return Ft(i)?n:zt(i)}function qe(t,e){return[{hours:je(t,e,0),minutes:je(t,e+1,0),seconds:je(t,e+2,0),milliseconds:Ut(t[e+3])},null,e+4]}function He(t,e){const n=!t[e]&&!t[e+1],i=ie(t[e+1],t[e+2]);return[{},n?null:it.instance(i),e+3]}function Ve(t,e){return[{},t[e]?R.create(t[e]):null,e+1]}const $e=RegExp(`^T?${Ce.source}$`),Re=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function We(t){const[e,n,i,s,r,o,a,l,c]=t,u="-"===e[0],d=l&&"-"===l[0],h=(t,e=!1)=>void 0!==t&&(e||t&&u)?-t:t;return[{years:h(Yt(n)),months:h(Yt(i)),weeks:h(Yt(s)),days:h(Yt(r)),hours:h(Yt(o)),minutes:h(Yt(a)),seconds:h(Yt(l),"-0"===l),milliseconds:h(Ut(c),d)}]}const Be={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function ze(t,e,n,i,s,r,o){const a={year:2===e.length?ee(zt(e)):zt(e),month:ce.indexOf(n)+1,day:zt(i),hour:zt(s),minute:zt(r)};return o&&(a.second=zt(o)),t&&(a.weekday=t.length>3?he.indexOf(t)+1:pe.indexOf(t)+1),a}const Ye=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Ue(t){const[,e,n,i,s,r,o,a,l,c,u,d]=t,h=ze(e,s,i,n,r,o,a);let p;return p=l?Be[l]:c?0:ie(u,d),[h,new it(p)]}const Ze=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Je=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Ke=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ge(t){const[,e,n,i,s,r,o,a]=t;return[ze(e,s,i,n,r,o,a),it.utcInstance]}function Qe(t){const[,e,n,i,s,r,o,a]=t;return[ze(e,a,n,i,s,r,o),it.utcInstance]}const Xe=Ee(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ae),tn=Ee(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ae),en=Ee(/(\d{4})-?(\d{3})/,Ae),nn=Ee(Me),sn=De((function(t,e){return[{year:je(t,e),month:je(t,e+1,1),day:je(t,e+2,1)},null,e+3]}),qe,He,Ve),rn=De(Ie,qe,He,Ve),on=De(Ne,qe,He,Ve),an=De(qe,He,Ve);const ln=De(qe);const cn=Ee(/(\d{4})-(\d\d)-(\d\d)/,Pe),un=Ee(Fe),dn=De(qe,He,Ve);const hn="Invalid Duration",pn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},mn={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...pn},fn=365.2425,gn=30.436875,vn={years:{quarters:4,months:12,weeks:52.1775,days:fn,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:gn,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...pn},yn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],bn=yn.slice(0).reverse();function _n(t,e,n=!1){const i={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Tn(i)}function wn(t,e){let n=e.milliseconds??0;for(const i of bn.slice(1))e[i]&&(n+=e[i]*t[i].milliseconds);return n}function kn(t,e){const n=wn(t,e)<0?-1:1;yn.reduceRight(((i,s)=>{if(Ft(e[s]))return i;if(i){const r=e[i]*n,o=t[s][i],a=Math.floor(r/o);e[s]+=a*n,e[i]-=a*o*n}return s}),null),yn.reduce(((n,i)=>{if(Ft(e[i]))return n;if(n){const s=e[n]%1;e[n]-=s,e[i]+=s*t[n][i]}return i}),null)}class Tn{constructor(t){const e="longterm"===t.conversionAccuracy||!1;let n=e?vn:mn;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||et.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,e){return Tn.fromObject({milliseconds:t},e)}static fromObject(t,e={}){if(null==t||"object"!=typeof t)throw new c("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new Tn({values:re(t,Tn.normalizeUnit),loc:et.fromObject(e),conversionAccuracy:e.conversionAccuracy,matrix:e.matrix})}static fromDurationLike(t){if(Pt(t))return Tn.fromMillis(t);if(Tn.isDuration(t))return t;if("object"==typeof t)return Tn.fromObject(t);throw new c(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,e){const[n]=function(t){return Se(t,[Re,We])}(t);return n?Tn.fromObject(n,e):Tn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,e){const[n]=function(t){return Se(t,[$e,ln])}(t);return n?Tn.fromObject(n,e):Tn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,e=null){if(!t)throw new c("need to specify a reason the Duration is invalid");const n=t instanceof _t?t:new _t(t,e);if(bt.throwOnInvalid)throw new o(n);return new Tn({invalid:n})}static normalizeUnit(t){const e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new l(t);return e}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,e={}){const n={...e,floor:!1!==e.round&&!1!==e.floor};return this.isValid?Te.create(this.loc,n).formatDurationFromString(this,t):hn}toHuman(t={}){if(!this.isValid)return hn;const e=yn.map((e=>{const n=this.values[e];return Ft(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:e.slice(0,-1)}).format(n)})).filter((t=>t));return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(e)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=Zt(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const e=this.toMillis();if(e<0||e>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1};return fi.fromMillis(e,{zone:"UTC"}).toISOTime(t)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?wn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const e=Tn.fromDurationLike(t),n={};for(const t of yn)($t(e.values,t)||$t(this.values,t))&&(n[t]=e.get(t)+this.get(t));return _n(this,{values:n},!0)}minus(t){if(!this.isValid)return this;const e=Tn.fromDurationLike(t);return this.plus(e.negate())}mapUnits(t){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=se(t(this.values[n],n));return _n(this,{values:e},!0)}get(t){return this[Tn.normalizeUnit(t)]}set(t){if(!this.isValid)return this;return _n(this,{values:{...this.values,...re(t,Tn.normalizeUnit)}})}reconfigure({locale:t,numberingSystem:e,conversionAccuracy:n,matrix:i}={}){return _n(this,{loc:this.loc.clone({locale:t,numberingSystem:e}),matrix:i,conversionAccuracy:n})}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return kn(this.matrix,t),_n(this,{values:t},!0)}rescale(){if(!this.isValid)return this;return _n(this,{values:function(t){const e={};for(const[n,i]of Object.entries(t))0!==i&&(e[n]=i);return e}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...t){if(!this.isValid)return this;if(0===t.length)return this;t=t.map((t=>Tn.normalizeUnit(t)));const e={},n={},i=this.toObject();let s;for(const r of yn)if(t.indexOf(r)>=0){s=r;let t=0;for(const e in n)t+=this.matrix[e][r]*n[e],n[e]=0;Pt(i[r])&&(t+=i[r]);const o=Math.trunc(t);e[r]=o,n[r]=(1e3*t-1e3*o)/1e3}else Pt(i[r])&&(n[r]=i[r]);for(const t in n)0!==n[t]&&(e[s]+=t===s?n[t]:n[t]/this.matrix[s][t]);return kn(this.matrix,e),_n(this,{values:e},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const e of Object.keys(this.values))t[e]=0===this.values[e]?0:-this.values[e];return _n(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid)return!1;if(!this.loc.equals(t.loc))return!1;for(const i of yn)if(e=this.values[i],n=t.values[i],!(void 0===e||0===e?void 0===n||0===n:e===n))return!1;var e,n;return!0}}const xn="Invalid Interval";class En{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,e=null){if(!t)throw new c("need to specify a reason the Interval is invalid");const n=t instanceof _t?t:new _t(t,e);if(bt.throwOnInvalid)throw new r(n);return new En({invalid:n})}static fromDateTimes(t,e){const n=gi(t),i=gi(e),s=function(t,e){return t&&t.isValid?e&&e.isValid?e<t?En.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null:En.invalid("missing or invalid end"):En.invalid("missing or invalid start")}(n,i);return null==s?new En({start:n,end:i}):s}static after(t,e){const n=Tn.fromDurationLike(e),i=gi(t);return En.fromDateTimes(i,i.plus(n))}static before(t,e){const n=Tn.fromDurationLike(e),i=gi(t);return En.fromDateTimes(i.minus(n),i)}static fromISO(t,e){const[n,i]=(t||"").split("/",2);if(n&&i){let t,s,r,o;try{t=fi.fromISO(n,e),s=t.isValid}catch(i){s=!1}try{r=fi.fromISO(i,e),o=r.isValid}catch(i){o=!1}if(s&&o)return En.fromDateTimes(t,r);if(s){const n=Tn.fromISO(i,e);if(n.isValid)return En.after(t,n)}else if(o){const t=Tn.fromISO(n,e);if(t.isValid)return En.before(r,t)}}return En.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",e){if(!this.isValid)return NaN;const n=this.start.startOf(t,e);let i;return i=e?.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,i=i.startOf(t,e),Math.floor(i.diff(n,t).get(t))+(i.valueOf()!==this.end.valueOf())}hasSame(t){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,t))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return!!this.isValid&&this.s>t}isBefore(t){return!!this.isValid&&this.e<=t}contains(t){return!!this.isValid&&(this.s<=t&&this.e>t)}set({start:t,end:e}={}){return this.isValid?En.fromDateTimes(t||this.s,e||this.e):this}splitAt(...t){if(!this.isValid)return[];const e=t.map(gi).filter((t=>this.contains(t))).sort(((t,e)=>t.toMillis()-e.toMillis())),n=[];let{s:i}=this,s=0;for(;i<this.e;){const t=e[s]||this.e,r=+t>+this.e?this.e:t;n.push(En.fromDateTimes(i,r)),i=r,s+=1}return n}splitBy(t){const e=Tn.fromDurationLike(t);if(!this.isValid||!e.isValid||0===e.as("milliseconds"))return[];let n,{s:i}=this,s=1;const r=[];for(;i<this.e;){const t=this.start.plus(e.mapUnits((t=>t*s)));n=+t>+this.e?this.e:t,r.push(En.fromDateTimes(i,n)),i=n,s+=1}return r}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return!!this.isValid&&+this.e==+t.s}abutsEnd(t){return!!this.isValid&&+t.e==+this.s}engulfs(t){return!!this.isValid&&(this.s<=t.s&&this.e>=t.e)}equals(t){return!(!this.isValid||!t.isValid)&&(this.s.equals(t.s)&&this.e.equals(t.e))}intersection(t){if(!this.isValid)return this;const e=this.s>t.s?this.s:t.s,n=this.e<t.e?this.e:t.e;return e>=n?null:En.fromDateTimes(e,n)}union(t){if(!this.isValid)return this;const e=this.s<t.s?this.s:t.s,n=this.e>t.e?this.e:t.e;return En.fromDateTimes(e,n)}static merge(t){const[e,n]=t.sort(((t,e)=>t.s-e.s)).reduce((([t,e],n)=>e?e.overlaps(n)||e.abutsStart(n)?[t,e.union(n)]:[t.concat([e]),n]:[t,n]),[[],null]);return n&&e.push(n),e}static xor(t){let e=null,n=0;const i=[],s=t.map((t=>[{time:t.s,type:"s"},{time:t.e,type:"e"}])),r=Array.prototype.concat(...s).sort(((t,e)=>t.time-e.time));for(const t of r)n+="s"===t.type?1:-1,1===n?e=t.time:(e&&+e!=+t.time&&i.push(En.fromDateTimes(e,t.time)),e=null);return En.merge(i)}difference(...t){return En.xor([this].concat(t)).map((t=>this.intersection(t))).filter((t=>t&&!t.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:xn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=m,e={}){return this.isValid?Te.create(this.s.loc.clone(e),t).formatInterval(this):xn}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:xn}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:xn}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:xn}toFormat(t,{separator:e=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${e}${this.e.toFormat(t)}`:xn}toDuration(t,e){return this.isValid?this.e.diff(this.s,t,e):Tn.invalid(this.invalidReason)}mapEndpoints(t){return En.fromDateTimes(t(this.s),t(this.e))}}class Dn{static hasDST(t=bt.defaultZone){const e=fi.now().setZone(t).set({month:12});return!t.isUniversal&&e.offset!==e.set({month:6}).offset}static isValidIANAZone(t){return R.isValidZone(t)}static normalizeZone(t){return rt(t,bt.defaultZone)}static getStartOfWeek({locale:t=null,locObj:e=null}={}){return(e||et.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:e=null}={}){return(e||et.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:e=null}={}){return(e||et.create(t)).getWeekendDays().slice()}static months(t="long",{locale:e=null,numberingSystem:n=null,locObj:i=null,outputCalendar:s="gregory"}={}){return(i||et.create(e,n,s)).months(t)}static monthsFormat(t="long",{locale:e=null,numberingSystem:n=null,locObj:i=null,outputCalendar:s="gregory"}={}){return(i||et.create(e,n,s)).months(t,!0)}static weekdays(t="long",{locale:e=null,numberingSystem:n=null,locObj:i=null}={}){return(i||et.create(e,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:e=null,numberingSystem:n=null,locObj:i=null}={}){return(i||et.create(e,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return et.create(t).meridiems()}static eras(t="short",{locale:e=null}={}){return et.create(e,null,"gregory").eras(t)}static features(){return{relative:qt(),localeWeek:Ht()}}}function Sn(t,e){const n=t=>t.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=n(e)-n(t);return Math.floor(Tn.fromMillis(i).as("days"))}function On(t,e,n,i){let[s,r,o,a]=function(t,e,n){const i=[["years",(t,e)=>e.year-t.year],["quarters",(t,e)=>e.quarter-t.quarter+4*(e.year-t.year)],["months",(t,e)=>e.month-t.month+12*(e.year-t.year)],["weeks",(t,e)=>{const n=Sn(t,e);return(n-n%7)/7}],["days",Sn]],s={},r=t;let o,a;for(const[l,c]of i)n.indexOf(l)>=0&&(o=l,s[l]=c(t,e),a=r.plus(s),a>e?(s[l]--,(t=r.plus(s))>e&&(a=t,s[l]--,t=r.plus(s))):t=a);return[t,s,a,o]}(t,e,n);const l=e-s,c=n.filter((t=>["hours","minutes","seconds","milliseconds"].indexOf(t)>=0));0===c.length&&(o<e&&(o=s.plus({[a]:1})),o!==s&&(r[a]=(r[a]||0)+l/(o-s)));const u=Tn.fromObject(r,i);return c.length>0?Tn.fromMillis(l,i).shiftTo(...c).plus(u):u}function Ln(t,e=(t=>t)){return{regex:t,deser:([t])=>e(function(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(-1!==t[n].search(ot.hanidec))e+=lt.indexOf(t[n]);else for(const t in at){const[n,s]=at[t];i>=n&&i<=s&&(e+=i-n)}}return parseInt(e,10)}return e}(t))}}const Cn=`[ ${String.fromCharCode(160)}]`,Mn=new RegExp(Cn,"g");function An(t){return t.replace(/\./g,"\\.?").replace(Mn,Cn)}function In(t){return t.replace(/\./g,"").replace(Mn," ").toLowerCase()}function Nn(t,e){return null===t?null:{regex:RegExp(t.map(An).join("|")),deser:([n])=>t.findIndex((t=>In(n)===In(t)))+e}}function Fn(t,e){return{regex:t,deser:([,t,e])=>ie(t,e),groups:e}}function Pn(t){return{regex:t,deser:([t])=>t}}const jn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let qn=null;function Hn(t,e){return Array.prototype.concat(...t.map((t=>function(t,e){if(t.literal)return t;const n=Rn(Te.macroTokenToFormatOpts(t.val),e);return null==n||n.includes(void 0)?t:n}(t,e))))}class Vn{constructor(t,e){if(this.locale=t,this.format=e,this.tokens=Hn(Te.parseFormat(e),t),this.units=this.tokens.map((e=>function(t,e){const n=ut(e),i=ut(e,"{2}"),s=ut(e,"{3}"),r=ut(e,"{4}"),o=ut(e,"{6}"),a=ut(e,"{1,2}"),l=ut(e,"{1,3}"),c=ut(e,"{1,6}"),u=ut(e,"{1,9}"),d=ut(e,"{2,4}"),h=ut(e,"{4,6}"),p=t=>{return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([t])=>t,literal:!0};var e},m=(m=>{if(t.literal)return p(m);switch(m.val){case"G":return Nn(e.eras("short"),0);case"GG":return Nn(e.eras("long"),0);case"y":return Ln(c);case"yy":case"kk":return Ln(d,ee);case"yyyy":case"kkkk":return Ln(r);case"yyyyy":return Ln(h);case"yyyyyy":return Ln(o);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Ln(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Ln(i);case"MMM":return Nn(e.months("short",!0),1);case"MMMM":return Nn(e.months("long",!0),1);case"LLL":return Nn(e.months("short",!1),1);case"LLLL":return Nn(e.months("long",!1),1);case"o":case"S":return Ln(l);case"ooo":case"SSS":return Ln(s);case"u":return Pn(u);case"uu":return Pn(a);case"uuu":case"E":case"c":return Ln(n);case"a":return Nn(e.meridiems(),0);case"EEE":return Nn(e.weekdays("short",!1),1);case"EEEE":return Nn(e.weekdays("long",!1),1);case"ccc":return Nn(e.weekdays("short",!0),1);case"cccc":return Nn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Fn(new RegExp(`([+-]${a.source})(?::(${i.source}))?`),2);case"ZZZ":return Fn(new RegExp(`([+-]${a.source})(${i.source})?`),2);case"z":return Pn(/[a-z_+-/]{1,256}?/i);case" ":return Pn(/[^\S\n\r]/);default:return p(m)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=t,m}(e,t))),this.disqualifyingUnit=this.units.find((t=>t.invalidReason)),!this.disqualifyingUnit){const[t,e]=[`^${(n=this.units).map((t=>t.regex)).reduce(((t,e)=>`${t}(${e.source})`),"")}$`,n];this.regex=RegExp(t,"i"),this.handlers=e}var n}explainFromTokens(t){if(this.isValid){const[e,n]=function(t,e,n){const i=t.match(e);if(i){const t={};let e=1;for(const s in n)if($t(n,s)){const r=n[s],o=r.groups?r.groups+1:1;!r.literal&&r.token&&(t[r.token.val[0]]=r.deser(i.slice(e,e+o))),e+=o}return[i,t]}return[i,{}]}(t,this.regex,this.handlers),[i,s,r]=n?function(t){let e,n=null;return Ft(t.z)||(n=R.create(t.z)),Ft(t.Z)||(n||(n=new it(t.Z)),e=t.Z),Ft(t.q)||(t.M=3*(t.q-1)+1),Ft(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),Ft(t.u)||(t.S=Ut(t.u)),[Object.keys(t).reduce(((e,n)=>{const i=(t=>{switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return i&&(e[i]=t[n]),e}),{}),n,e]}(n):[null,null,void 0];if($t(n,"a")&&$t(n,"H"))throw new a("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:e,matches:n,result:i,zone:s,specificOffset:r}}return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function $n(t,e,n){return new Vn(t,n).explainFromTokens(e)}function Rn(t,e){if(!t)return null;const n=Te.create(e,t).dtFormatter((qn||(qn=fi.fromMillis(1555555555555)),qn)),i=n.formatToParts(),s=n.resolvedOptions();return i.map((e=>function(t,e,n){const{type:i,value:s}=t;if("literal"===i){const t=/^\s+$/.test(s);return{literal:!t,val:t?" ":s}}const r=e[i];let o=i;"hour"===i&&(o=null!=e.hour12?e.hour12?"hour12":"hour24":null!=e.hourCycle?"h11"===e.hourCycle||"h12"===e.hourCycle?"hour12":"hour24":n.hour12?"hour12":"hour24");let a=jn[o];if("object"==typeof a&&(a=a[r]),a)return{literal:!1,val:a}}(e,t,s)))}const Wn="Invalid DateTime",Bn=864e13;function zn(t){return new _t("unsupported zone",`the zone "${t.name}" is not supported`)}function Yn(t){return null===t.weekData&&(t.weekData=Ot(t.c)),t.weekData}function Un(t){return null===t.localWeekData&&(t.localWeekData=Ot(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function Zn(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new fi({...n,...e,old:n})}function Jn(t,e,n){let i=t-60*e*1e3;const s=n.offset(i);if(e===s)return[i,e];i-=60*(s-e)*1e3;const r=n.offset(i);return s===r?[i,s]:[t-60*Math.min(s,r)*1e3,Math.max(s,r)]}function Kn(t,e){const n=new Date(t+=60*e*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Gn(t,e,n){return Jn(Qt(t),e,n)}function Qn(t,e){const n=t.o,i=t.c.year+Math.trunc(e.years),s=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),r={...t.c,year:i,month:s,day:Math.min(t.c.day,Gt(i,s))+Math.trunc(e.days)+7*Math.trunc(e.weeks)},o=Tn.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=Qt(r);let[l,c]=Jn(a,n,t.zone);return 0!==o&&(l+=o,c=t.zone.offset(l)),{ts:l,o:c}}function Xn(t,e,n,i,s,r){const{setZone:o,zone:a}=n;if(t&&0!==Object.keys(t).length||e){const i=e||a,s=fi.fromObject(t,{...n,zone:i,specificOffset:r});return o?s:s.setZone(a)}return fi.invalid(new _t("unparsable",`the input "${s}" can't be parsed as ${i}`))}function ti(t,e,n=!0){return t.isValid?Te.create(et.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function ei(t,e){const n=t.c.year>9999||t.c.year<0;let i="";return n&&t.c.year>=0&&(i+="+"),i+=Bt(t.c.year,n?6:4),e?(i+="-",i+=Bt(t.c.month),i+="-",i+=Bt(t.c.day)):(i+=Bt(t.c.month),i+=Bt(t.c.day)),i}function ni(t,e,n,i,s,r){let o=Bt(t.c.hour);return e?(o+=":",o+=Bt(t.c.minute),0===t.c.millisecond&&0===t.c.second&&n||(o+=":")):o+=Bt(t.c.minute),0===t.c.millisecond&&0===t.c.second&&n||(o+=Bt(t.c.second),0===t.c.millisecond&&i||(o+=".",o+=Bt(t.c.millisecond,3))),s&&(t.isOffsetFixed&&0===t.offset&&!r?o+="Z":t.o<0?(o+="-",o+=Bt(Math.trunc(-t.o/60)),o+=":",o+=Bt(Math.trunc(-t.o%60))):(o+="+",o+=Bt(Math.trunc(t.o/60)),o+=":",o+=Bt(Math.trunc(t.o%60)))),r&&(o+="["+t.zone.ianaName+"]"),o}const ii={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},si={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ri={ordinal:1,hour:0,minute:0,second:0,millisecond:0},oi=["year","month","day","hour","minute","second","millisecond"],ai=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],li=["year","ordinal","hour","minute","second","millisecond"];function ci(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new l(t);return e}(t)}}function ui(t,e){const n=rt(e.zone,bt.defaultZone);if(!n.isValid)return fi.invalid(zn(n));const i=et.fromObject(e);let s,r;if(Ft(t.year))s=bt.now();else{for(const e of oi)Ft(t[e])&&(t[e]=ii[e]);const e=It(t)||Nt(t);if(e)return fi.invalid(e);const i=function(t){return mi[t]||(void 0===pi&&(pi=bt.now()),mi[t]=t.offset(pi)),mi[t]}(n);[s,r]=Gn(t,i,n)}return new fi({ts:s,zone:n,loc:i,o:r})}function di(t,e,n){const i=!!Ft(n.round)||n.round,s=(t,s)=>{t=Zt(t,i||n.calendary?0:2,!0);return e.loc.clone(n).relFormatter(n).format(t,s)},r=i=>n.calendary?e.hasSame(t,i)?0:e.startOf(i).diff(t.startOf(i),i).get(i):e.diff(t,i).get(i);if(n.unit)return s(r(n.unit),n.unit);for(const t of n.units){const e=r(t);if(Math.abs(e)>=1)return s(e,t)}return s(t>e?-0:0,n.units[n.units.length-1])}function hi(t){let e,n={};return t.length>0&&"object"==typeof t[t.length-1]?(n=t[t.length-1],e=Array.from(t).slice(0,t.length-1)):e=Array.from(t),[n,e]}let pi,mi={};class fi{constructor(t){const e=t.zone||bt.defaultZone;let n=t.invalid||(Number.isNaN(t.ts)?new _t("invalid input"):null)||(e.isValid?null:zn(e));this.ts=Ft(t.ts)?bt.now():t.ts;let i=null,s=null;if(!n){if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e))[i,s]=[t.old.c,t.old.o];else{const r=Pt(t.o)&&!t.old?t.o:e.offset(this.ts);i=Kn(this.ts,r),n=Number.isNaN(i.year)?new _t("invalid input"):null,i=n?null:i,s=n?null:r}}this._zone=e,this.loc=t.loc||et.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=i,this.o=s,this.isLuxonDateTime=!0}static now(){return new fi({})}static local(){const[t,e]=hi(arguments),[n,i,s,r,o,a,l]=e;return ui({year:n,month:i,day:s,hour:r,minute:o,second:a,millisecond:l},t)}static utc(){const[t,e]=hi(arguments),[n,i,s,r,o,a,l]=e;return t.zone=it.utcInstance,ui({year:n,month:i,day:s,hour:r,minute:o,second:a,millisecond:l},t)}static fromJSDate(t,e={}){const n=(i=t,"[object Date]"===Object.prototype.toString.call(i)?t.valueOf():NaN);var i;if(Number.isNaN(n))return fi.invalid("invalid input");const s=rt(e.zone,bt.defaultZone);return s.isValid?new fi({ts:n,zone:s,loc:et.fromObject(e)}):fi.invalid(zn(s))}static fromMillis(t,e={}){if(Pt(t))return t<-Bn||t>Bn?fi.invalid("Timestamp out of range"):new fi({ts:t,zone:rt(e.zone,bt.defaultZone),loc:et.fromObject(e)});throw new c(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,e={}){if(Pt(t))return new fi({ts:1e3*t,zone:rt(e.zone,bt.defaultZone),loc:et.fromObject(e)});throw new c("fromSeconds requires a numerical input")}static fromObject(t,e={}){t=t||{};const n=rt(e.zone,bt.defaultZone);if(!n.isValid)return fi.invalid(zn(n));const i=et.fromObject(e),s=re(t,ci),{minDaysInFirstWeek:r,startOfWeek:o}=At(s,i),l=bt.now(),c=Ft(e.specificOffset)?n.offset(l):e.specificOffset,u=!Ft(s.ordinal),d=!Ft(s.year),h=!Ft(s.month)||!Ft(s.day),p=d||h,m=s.weekYear||s.weekNumber;if((p||u)&&m)throw new a("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&u)throw new a("Can't mix ordinal dates with month/day");const f=m||s.weekday&&!p;let g,v,y=Kn(l,c);f?(g=ai,v=si,y=Ot(y,r,o)):u?(g=li,v=ri,y=Ct(y)):(g=oi,v=ii);let b=!1;for(const t of g){Ft(s[t])?s[t]=b?v[t]:y[t]:b=!0}const _=f?function(t,e=4,n=1){const i=jt(t.weekYear),s=Wt(t.weekNumber,1,te(t.weekYear,e,n)),r=Wt(t.weekday,1,7);return i?s?!r&&Tt("weekday",t.weekday):Tt("week",t.weekNumber):Tt("weekYear",t.weekYear)}(s,r,o):u?function(t){const e=jt(t.year),n=Wt(t.ordinal,1,Kt(t.year));return e?!n&&Tt("ordinal",t.ordinal):Tt("year",t.year)}(s):It(s),w=_||Nt(s);if(w)return fi.invalid(w);const k=f?Lt(s,r,o):u?Mt(s):s,[T,x]=Gn(k,c,n),E=new fi({ts:T,zone:n,o:x,loc:i});return s.weekday&&p&&t.weekday!==E.weekday?fi.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${E.toISO()}`):E.isValid?E:fi.invalid(E.invalid)}static fromISO(t,e={}){const[n,i]=function(t){return Se(t,[Xe,sn],[tn,rn],[en,on],[nn,an])}(t);return Xn(n,i,e,"ISO 8601",t)}static fromRFC2822(t,e={}){const[n,i]=function(t){return Se(function(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[Ye,Ue])}(t);return Xn(n,i,e,"RFC 2822",t)}static fromHTTP(t,e={}){const[n,i]=function(t){return Se(t,[Ze,Ge],[Je,Ge],[Ke,Qe])}(t);return Xn(n,i,e,"HTTP",e)}static fromFormat(t,e,n={}){if(Ft(t)||Ft(e))throw new c("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:s=null}=n,r=et.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0}),[o,a,l,u]=function(t,e,n){const{result:i,zone:s,specificOffset:r,invalidReason:o}=$n(t,e,n);return[i,s,r,o]}(r,t,e);return u?fi.invalid(u):Xn(o,a,n,`format ${e}`,t,l)}static fromString(t,e,n={}){return fi.fromFormat(t,e,n)}static fromSQL(t,e={}){const[n,i]=function(t){return Se(t,[cn,sn],[un,dn])}(t);return Xn(n,i,e,"SQL",t)}static invalid(t,e=null){if(!t)throw new c("need to specify a reason the DateTime is invalid");const n=t instanceof _t?t:new _t(t,e);if(bt.throwOnInvalid)throw new s(n);return new fi({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,e={}){const n=Rn(t,et.fromObject(e));return n?n.map((t=>t?t.val:null)).join(""):null}static expandFormat(t,e={}){return Hn(Te.parseFormat(t),et.fromObject(e)).map((t=>t.val)).join("")}static resetCache(){pi=void 0,mi={}}get(t){return this[t]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Yn(this).weekYear:NaN}get weekNumber(){return this.isValid?Yn(this).weekNumber:NaN}get weekday(){return this.isValid?Yn(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Un(this).weekday:NaN}get localWeekNumber(){return this.isValid?Un(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Un(this).weekYear:NaN}get ordinal(){return this.isValid?Ct(this.c).ordinal:NaN}get monthShort(){return this.isValid?Dn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Dn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Dn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Dn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,e=6e4,n=Qt(this.c),i=this.zone.offset(n-t),s=this.zone.offset(n+t),r=this.zone.offset(n-i*e),o=this.zone.offset(n-s*e);if(r===o)return[this];const a=n-r*e,l=n-o*e,c=Kn(a,r),u=Kn(l,o);return c.hour===u.hour&&c.minute===u.minute&&c.second===u.second&&c.millisecond===u.millisecond?[Zn(this,{ts:a}),Zn(this,{ts:l})]:[this]}get isInLeapYear(){return Jt(this.year)}get daysInMonth(){return Gt(this.year,this.month)}get daysInYear(){return this.isValid?Kt(this.year):NaN}get weeksInWeekYear(){return this.isValid?te(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?te(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:e,numberingSystem:n,calendar:i}=Te.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e,numberingSystem:n,outputCalendar:i}}toUTC(t=0,e={}){return this.setZone(it.instance(t),e)}toLocal(){return this.setZone(bt.defaultZone)}setZone(t,{keepLocalTime:e=!1,keepCalendarTime:n=!1}={}){if((t=rt(t,bt.defaultZone)).equals(this.zone))return this;if(t.isValid){let i=this.ts;if(e||n){const e=t.offset(this.ts),n=this.toObject();[i]=Gn(n,e,t)}return Zn(this,{ts:i,zone:t})}return fi.invalid(zn(t))}reconfigure({locale:t,numberingSystem:e,outputCalendar:n}={}){return Zn(this,{loc:this.loc.clone({locale:t,numberingSystem:e,outputCalendar:n})})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const e=re(t,ci),{minDaysInFirstWeek:n,startOfWeek:i}=At(e,this.loc),s=!Ft(e.weekYear)||!Ft(e.weekNumber)||!Ft(e.weekday),r=!Ft(e.ordinal),o=!Ft(e.year),l=!Ft(e.month)||!Ft(e.day),c=o||l,u=e.weekYear||e.weekNumber;if((c||r)&&u)throw new a("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&r)throw new a("Can't mix ordinal dates with month/day");let d;s?d=Lt({...Ot(this.c,n,i),...e},n,i):Ft(e.ordinal)?(d={...this.toObject(),...e},Ft(e.day)&&(d.day=Math.min(Gt(d.year,d.month),d.day))):d=Mt({...Ct(this.c),...e});const[h,p]=Gn(d,this.o,this.zone);return Zn(this,{ts:h,o:p})}plus(t){if(!this.isValid)return this;return Zn(this,Qn(this,Tn.fromDurationLike(t)))}minus(t){if(!this.isValid)return this;return Zn(this,Qn(this,Tn.fromDurationLike(t).negate()))}startOf(t,{useLocaleWeeks:e=!1}={}){if(!this.isValid)return this;const n={},i=Tn.normalizeUnit(t);switch(i){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0}if("weeks"===i)if(e){const t=this.loc.getStartOfWeek(),{weekday:e}=this;e<t&&(n.weekNumber=this.weekNumber-1),n.weekday=t}else n.weekday=1;if("quarters"===i){const t=Math.ceil(this.month/3);n.month=3*(t-1)+1}return this.set(n)}endOf(t,e){return this.isValid?this.plus({[t]:1}).startOf(t,e).minus(1):this}toFormat(t,e={}){return this.isValid?Te.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):Wn}toLocaleString(t=m,e={}){return this.isValid?Te.create(this.loc.clone(e),t).formatDateTime(this):Wn}toLocaleParts(t={}){return this.isValid?Te.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:e=!1,suppressMilliseconds:n=!1,includeOffset:i=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const r="extended"===t;let o=ei(this,r);return o+="T",o+=ni(this,r,e,n,i,s),o}toISODate({format:t="extended"}={}){return this.isValid?ei(this,"extended"===t):null}toISOWeekDate(){return ti(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:e=!1,includeOffset:n=!0,includePrefix:i=!1,extendedZone:s=!1,format:r="extended"}={}){if(!this.isValid)return null;return(i?"T":"")+ni(this,"extended"===r,e,t,n,s)}toRFC2822(){return ti(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ti(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ei(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:e=!1,includeOffsetSpace:n=!0}={}){let i="HH:mm:ss.SSS";return(e||t)&&(n&&(i+=" "),e?i+="z":t&&(i+="ZZ")),ti(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Wn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const e={...this.c};return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,e="milliseconds",n={}){if(!this.isValid||!t.isValid)return Tn.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...n},s=(a=e,Array.isArray(a)?a:[a]).map(Tn.normalizeUnit),r=t.valueOf()>this.valueOf(),o=On(r?this:t,r?t:this,s,i);var a;return r?o.negate():o}diffNow(t="milliseconds",e={}){return this.diff(fi.now(),t,e)}until(t){return this.isValid?En.fromDateTimes(this,t):this}hasSame(t,e,n){if(!this.isValid)return!1;const i=t.valueOf(),s=this.setZone(t.zone,{keepLocalTime:!0});return s.startOf(e,n)<=i&&i<=s.endOf(e,n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const e=t.base||fi.fromObject({},{zone:this.zone}),n=t.padding?this<e?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],s=t.unit;return Array.isArray(t.unit)&&(i=t.unit,s=void 0),di(e,this.plus(n),{...t,numeric:"always",units:i,unit:s})}toRelativeCalendar(t={}){return this.isValid?di(t.base||fi.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(fi.isDateTime))throw new c("min requires all arguments be DateTimes");return Vt(t,(t=>t.valueOf()),Math.min)}static max(...t){if(!t.every(fi.isDateTime))throw new c("max requires all arguments be DateTimes");return Vt(t,(t=>t.valueOf()),Math.max)}static fromFormatExplain(t,e,n={}){const{locale:i=null,numberingSystem:s=null}=n;return $n(et.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0}),t,e)}static fromStringExplain(t,e,n={}){return fi.fromFormatExplain(t,e,n)}static buildFormatParser(t,e={}){const{locale:n=null,numberingSystem:i=null}=e,s=et.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});return new Vn(s,t)}static fromFormatParser(t,e,n={}){if(Ft(t)||Ft(e))throw new c("fromFormatParser requires an input string and a format parser");const{locale:i=null,numberingSystem:s=null}=n,r=et.fromOpts({locale:i,numberingSystem:s,defaultToEN:!0});if(!r.equals(e.locale))throw new c(`fromFormatParser called with a locale of ${r}, but the format parser was created for ${e.locale}`);const{result:o,zone:a,specificOffset:l,invalidReason:u}=e.explainFromTokens(t);return u?fi.invalid(u):Xn(o,a,n,`format ${e.format}`,t,l)}static get DATE_SHORT(){return m}static get DATE_MED(){return f}static get DATE_MED_WITH_WEEKDAY(){return g}static get DATE_FULL(){return v}static get DATE_HUGE(){return y}static get TIME_SIMPLE(){return b}static get TIME_WITH_SECONDS(){return _}static get TIME_WITH_SHORT_OFFSET(){return w}static get TIME_WITH_LONG_OFFSET(){return k}static get TIME_24_SIMPLE(){return T}static get TIME_24_WITH_SECONDS(){return x}static get TIME_24_WITH_SHORT_OFFSET(){return E}static get TIME_24_WITH_LONG_OFFSET(){return D}static get DATETIME_SHORT(){return S}static get DATETIME_SHORT_WITH_SECONDS(){return O}static get DATETIME_MED(){return L}static get DATETIME_MED_WITH_SECONDS(){return C}static get DATETIME_MED_WITH_WEEKDAY(){return M}static get DATETIME_FULL(){return A}static get DATETIME_FULL_WITH_SECONDS(){return I}static get DATETIME_HUGE(){return N}static get DATETIME_HUGE_WITH_SECONDS(){return F}}function gi(t){if(fi.isDateTime(t))return t;if(t&&t.valueOf&&Pt(t.valueOf()))return fi.fromJSDate(t);if(t&&"object"==typeof t)return fi.fromObject(t);throw new c(`Unknown datetime argument: ${t}, of type ${typeof t}`)}class vi{constructor(t){this._translations=t}get(t){return this._translations[t]}has(t){return t in this._translations}}class yi{constructor(t){this._configurations=t}get(t){return this._configurations[t]}has(t){return t in this._configurations}isRTL(){return"rtl"===this.get("direction")}getLanguage(){return this.get("locale").replace("_","-")}is24Hours(){return!!this.get("twentyFourHours")}getFirstDayOfWeek(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];void 0===t&&(t=!0);let e=this.get("first_dow_iso");return t||(e%=7),e}}class bi{init(){}getId(){return null}setContainer(t){if(!(t instanceof _i))throw new Error("Plugin was given an invalid KimaiContainer");this._core=t}getContainer(){return this._core}getConfiguration(t){return this.getContainer().getConfiguration().get(t)}getConfigurations(){return this.getContainer().getConfiguration()}getDateUtils(){return this.getPlugin("date")}getPlugin(t){return this.getContainer().getPlugin(t)}getTranslation(){return this.getContainer().getTranslation()}translate(t){return this.getTranslation().get(t)}escape(t){return this.getPlugin("escape").escapeForHtml(t)}trigger(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.getPlugin("event").trigger(t,e)}fetch(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getPlugin("fetch").fetch(t,e)}fetchForm(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;n=n||t.getAttribute("action");const i=t.getAttribute("method").toUpperCase();if("GET"===i){const i=this.getPlugin("form").convertFormDataToQueryString(t,{},!0);n=n+(n.includes("?")?"&":"?")+i,e={method:"GET",...e}}else"POST"===i&&(e={method:"POST",body:new FormData(t),...e});return this.fetch(n,e)}isMobile(){return Math.max(document.documentElement.clientWidth,window.innerWidth||0)<576}}class _i{constructor(t,e){if(!(t instanceof yi))throw new Error("Configuration needs to a KimaiConfiguration instance");if(this._configuration=t,!(e instanceof vi))throw new Error("Configuration needs to a KimaiTranslation instance");this._translation=e,this._plugins=[]}registerPlugin(t){if(!(t instanceof bi))throw new Error("Invalid plugin given, needs to be a KimaiPlugin instance");return t.setContainer(this),this._plugins.push(t),t}getPlugin(t){for(let e of this._plugins)if(null!==e.getId()&&e.getId()===t)return e;throw new Error("Unknown plugin: "+t)}getPlugins(){return this._plugins}getTranslation(){return this._translation}getConfiguration(){return this._configuration}getUser(){return this.getPlugin("user")}}class wi extends bi{constructor(t){super(),this.dataAttribute=t}getId(){return"datatable-column-visibility"}init(){let t=document.querySelector("["+this.dataAttribute+"]");if(null!==t){this._id=t.getAttribute(this.dataAttribute),this._modal=document.getElementById("modal_"+this._id),this._modal.addEventListener("show.bs.modal",(()=>{this._evaluateCheckboxes()})),this._modal.querySelector("button[data-type=save]").addEventListener("click",(()=>{this._saveVisibility()})),this._modal.querySelector("button[data-type=reset]").addEventListener("click",(t=>{this._resetVisibility(t.currentTarget)})),this._modal.querySelectorAll("input[name=datatable_profile]").forEach((t=>{t.addEventListener("change",(()=>{const e=this._modal.getElementsByTagName("form")[0];this.fetchForm(e,{},t.getAttribute("data-href")).then((()=>{localStorage.setItem("kimai_profile",t.getAttribute("value")),document.location.reload()})).catch((()=>{e.setAttribute("action",t.getAttribute("data-href")),e.submit()}))}))}));for(let t of this._modal.querySelectorAll("form input[type=checkbox]"))t.addEventListener("change",(()=>{this._changeVisibility(t.getAttribute("name"),t.checked)}))}}_evaluateCheckboxes(){const t=this._modal.getElementsByTagName("form")[0],e=document.getElementsByClassName("datatable_"+this._id)[0];for(let n of e.getElementsByTagName("th")){const e=n.getAttribute("data-field");if(null===e)continue;const i=t.querySelector("input[name="+e+"]");null!==i&&(i.checked="none"!==window.getComputedStyle(n).display)}}_saveVisibility(){const t=this._modal.getElementsByTagName("form")[0];this.fetchForm(t).then((()=>{document.location.reload()})).catch((()=>{t.submit()}))}_resetVisibility(t){const e=this._modal.getElementsByTagName("form")[0];this.fetchForm(e,{},t.getAttribute("formaction")).then((()=>{document.location.reload()})).catch((()=>{e.setAttribute("action",t.getAttribute("formaction")),e.submit()}))}_changeVisibility(t,e){for(const n of document.getElementsByClassName("datatable_"+this._id)){let i=null;for(let s of n.getElementsByClassName("col_"+t)){if(null===i){let t="-none",n="d-table-cell";e||(t="-table-cell",n="d-none"),i="",s.classList.forEach((function(e,n,s){-1===e.indexOf(t)&&(i+=" "+e)})),-1===i.indexOf(n)&&(i+=" "+n)}s.className=i}}}}var ki=n(9336);class Ti extends bi{init(){[].slice.call(document.querySelectorAll('[data-toggle="tooltip"]')).map((function(t){return new ki.m_(t)}));[...document.querySelectorAll(".offcanvas")].map((t=>new ki.go(t)));this.getContainer().getPlugin("form").activateForm("div.page-wrapper form"),this._registerModalAutofocus("#remote_form_modal"),this.overlay=null,document.addEventListener("kimai.reloadContent",(t=>{if(null!==this.overlay)return;let e="body";void 0!==t.detail&&null!==t.detail&&(e=t.detail);const n=document.createElement("div");n.innerHTML='<div class="overlay"><div class="fas fa-sync fa-spin"></div></div>',this.overlay=n.firstElementChild,document.querySelector(e).append(this.overlay)})),document.addEventListener("kimai.reloadedContent",(()=>{null!==this.overlay&&(this.overlay.remove(),this.overlay=null)}))}_registerModalAutofocus(t){if(this.isMobile())return;const e=document.querySelector(t);null!==e&&e.addEventListener("shown.bs.modal",(()=>{const t=e.querySelector("form");let n=t.querySelectorAll("[autofocus]");n.length<1&&(n=t.querySelectorAll("input[type=text],input[type=date],textarea,select")),n.length>0&&n[0].focus()}))}}var xi=n(424);n(8214);class Ei extends bi{supportsForm(t){return!1}activateForm(t){}destroyForm(t){}}class Di extends Ei{constructor(t){super(),this._selector=t}init(){window.disableLitepickerStyles=!0,this._pickers=[]}supportsForm(t){return!0}activateForm(t){const e=this.getConfigurations().getFirstDayOfWeek(!1),n=this.getConfigurations().getLanguage();let i={buttonText:{previousMonth:'<i class="fas fa-chevron-left"></i>',nextMonth:'<i class="fas fa-chevron-right"></i>',apply:this.translate("confirm"),cancel:this.translate("cancel")}};const s=[].slice.call(t.querySelectorAll(this._selector)).map((t=>(void 0===t.dataset.format&&console.log("Trying to bind litepicker to an element without data-format attribute"),void 0!==t.hasAttribute("min")&&(i={...i,minDate:t.getAttribute("min")}),void 0!==t.hasAttribute("max")&&(i={...i,maxDate:t.getAttribute("max")}),i={...i,format:t.dataset.format,showTooltip:!1,element:t,lang:n,autoRefresh:!0,firstDay:e,setup:e=>{e.on("preselect",((t,n)=>{e._wasPreselected=!0})),e.on("selected",((n,i)=>{void 0!==e._wasPreselected&&(t.dispatchEvent(new Event("change",{bubbles:!0})),delete e._wasPreselected)})),void 0!==e.backdrop&&document.body.appendChild(e.backdrop)}},[t,new xi.Litepicker(this.prepareOptions(i))])));this._pickers=this._pickers.concat(s)}prepareOptions(t){return{...t,plugins:["mobilefriendly"]}}destroyForm(t){[].slice.call(t.querySelectorAll(this._selector)).map((t=>{for(let e=0;e<this._pickers.length;e++)this._pickers[e][0]===t&&(this._pickers[e][1].destroy(),this._pickers.splice(e,1))}))}}class Si extends Di{prepareOptions(t){return{...t,plugins:["mobilefriendly"],singleMode:!1,autoRefresh:!0}}}var Oi=n(2758);class Li extends bi{constructor(t,e){super(),this._contentArea=t,this._selector=e}getId(){return"datatable"}init(){const t=document.querySelector(this._selector);if(null===t)return;this.registerContextMenu(this._selector);const e=t.dataset.reloadEvent;if(void 0===e)return;const n=()=>{this.reloadDatatable()};for(let t of e.split(" "))document.addEventListener(t,n);document.addEventListener("pagination-change",n),document.addEventListener("filter-change",n)}registerContextMenu(t){Oi.A.createForDataTable(t)}reloadDatatable(){const t=this.getContainer().getPlugin("toolbar").getSelector(),e=document.querySelector(t),n=t=>{const e=document.createElement("div");e.innerHTML=t;const n=e.querySelector(this._contentArea);document.querySelector(this._contentArea).replaceWith(n),this.registerContextMenu(this._selector),document.dispatchEvent(new Event("kimai.reloadedContent"))};document.dispatchEvent(new CustomEvent("kimai.reloadContent",{detail:this._contentArea})),null!==e?this.fetchForm(e).then((t=>{t.text().then(n)})).catch((()=>{e.submit()})):this.fetch(document.location).then((t=>{t.text().then(n)})).catch((()=>{document.location.reload()}))}}class Ci extends bi{constructor(t,e){super(),this._formSelector=t,this._actionClass=e}getId(){return"toolbar"}init(){const t=this.getSelector();this._registerPagination(t),this._registerSortableTables(t),this._registerAlternativeSubmitActions(t,this._actionClass),[].slice.call(document.querySelectorAll(t+" input")).map((e=>{e.addEventListener("change",(e=>{switch(e.target.id){case"order":case"orderBy":case"page":break;default:document.querySelector(t+" input#page").value=1}})),this.triggerChange()})),[].slice.call(document.querySelectorAll(t+" select")).map((e=>{e.addEventListener("change",(e=>{let n=!0;switch(e.target.id){case"customer":null!==document.querySelector(t+" select#project")&&(n=!1);break;case"project":null!==document.querySelector(t+" select#activity")&&(n=!1)}document.querySelector(t+" input#page").value=1,n&&this.triggerChange()}))}))}_registerAlternativeSubmitActions(t,e){document.addEventListener("click",(function(n){let i=n.target;for(;null!==i&&"function"==typeof i.matches&&!i.matches("body");){if(i.classList.contains(e)){const e=document.querySelector(t);if(null===e)return;const s=e.getAttribute("action"),r=e.getAttribute("method");void 0!==i.dataset.target&&(e.target=i.dataset.target),e.action=i.href,void 0!==i.dataset.method&&(e.method=i.dataset.method),e.submit(),e.target="",e.action=s,e.method=r,n.preventDefault(),n.stopPropagation()}i=i.parentNode}}))}_registerSortableTables(t){document.body.addEventListener("click",(e=>{if(!e.target.matches("th.sortable"))return;let n="DESC",i=e.target.dataset.order;e.target.classList.contains("sorting_desc")&&(n="ASC"),document.querySelector(t+" #orderBy").value=i,document.querySelector(t+" #order").value=n,document.querySelector(t+" #orderBy").dispatchEvent(new Event("change")),document.querySelector(t+" #order").dispatchEvent(new Event("change")),document.dispatchEvent(new Event("filter-change"))}))}_registerPagination(t){document.body.addEventListener("click",(e=>{if(!(e.target.matches("ul.pagination li a")||null!==e.target.parentNode&&e.target.parentNode.matches("ul.pagination li a")))return;let n=document.querySelector(t+" input#page");if(null===n)return;let i=e.target;i.matches("a")||(i=i.parentNode),e.preventDefault(),e.stopPropagation();let s=i.href.split("/"),r=s[s.length-1];return/\d/.test(r)||(r=1),n.value=r,n.dispatchEvent(new Event("change")),document.dispatchEvent(new Event("pagination-change")),!1}))}triggerChange(){document.dispatchEvent(new Event("toolbar-change"))}getSelector(){return this._formSelector}}class Mi extends bi{getId(){return"api"}_headers(){const t=new Headers;return t.append("Content-Type","application/json"),t}get(t,e,n,i){if(void 0!==e){const n=new URLSearchParams(e).toString();""!==n&&(t=t+(t.includes("?")?"&":"?")+n)}void 0===i&&(i=t=>{this.handleError("An error occurred",t)}),this.fetch(t,{method:"GET",headers:this._headers()}).then((t=>{t.json().then((t=>{n(t)}))})).catch((t=>{i(t)}))}post(t,e,n,i){void 0===i&&(i=t=>{this.handleError("action.update.error",t)}),this.fetch(t,{method:"POST",body:this._parseData(e),headers:this._headers()}).then((t=>{t.json().then((t=>{n(t)}))})).catch((t=>{i(t)}))}patch(t,e,n,i){void 0===i&&(i=t=>{this.handleError("action.update.error",t)}),this.fetch(t,{method:"PATCH",body:this._parseData(e),headers:this._headers()}).then((t=>{204===t.statusCode?n():t.json().then((t=>{n(t)}))})).catch((t=>{i(t)}))}delete(t,e,n){void 0===n&&(n=t=>{this.handleError("action.delete.error",t)}),this.fetch(t,{method:"DELETE",headers:this._headers()}).then((()=>{e()})).catch((t=>{n(t)}))}_parseData(t){return"object"==typeof t?JSON.stringify(t):t}handleError(t,e){if(void 0===e.headers)return;const n=e.headers.get("content-type");n&&-1!==n.indexOf("application/json")?e.json().then((n=>{let i=n.message;if(400===e.status&&n.errors){let t=["<u>"+i+"</u>"];if(n.errors.errors)for(let e of n.errors.errors)t.push(e);if(n.errors.children)for(let e in n.errors.children){let i=n.errors.children[e];if(void 0!==i.errors&&i.errors.length>0)for(let e of i.errors)t.push(e)}t.length>0&&(i=t)}this.getPlugin("alert").error(t,i)})):e.text().then((()=>{const n="["+e.statusCode+"] "+e.statusText;this.getPlugin("alert").error(t,n)}))}}class Ai extends bi{addClickHandler(t,e,n){document.body.addEventListener("click",(i=>{let s=i.target;for(;null!==s;){const e=s.tagName.toUpperCase();if("BODY"===e)return;if(s.matches(t))break;if("A"===e||"BUTTON"===e||"INPUT"===e||"LABEL"===e)return;for(let t of n)if(s.matches(t))return;s=s.parentNode}if(null===s)return;if(s.isContentEditable||s.parentNode.isContentEditable)return;if(!s.matches(t))return;for(let t of n)if(s.matches(t))return;i.preventDefault(),i.stopPropagation();let r=s.dataset.href;null==r&&(r=s.href),null!=r&&""!==r&&e(r)}))}}class Ii extends Ai{constructor(t){super(),this._selector=t}init(){this.addClickHandler(this._selector,(function(t){window.location=t}),[])}}class Ni extends Ai{constructor(t,e){super(),this._selector=t,this._stopSelector=e}getId(){return"modal"}init(){this._isDirty=!1;const t=this._getModalElement();null!==t&&(t.addEventListener("hide.bs.modal",(e=>{if(this._isDirty){if(null===t.querySelector(".modal-body .remote_modal_is_dirty_warning")){const e=this.translate("modal.dirty"),n=document.createElement("div");n.innerHTML='<p class="text-danger small remote_modal_is_dirty_warning">'+e+"</p>",t.querySelector(".modal-body").prepend(n.firstElementChild)}e.preventDefault()}else this._isDirty=!1,document.dispatchEvent(new Event("modal-hide"))})),t.addEventListener("hidden.bs.modal",(()=>{this.getContainer().getPlugin("form").destroyForm(this._getFormIdentifier()),t.querySelector(".modal-body").replaceWith("")})),t.addEventListener("show.bs.modal",(()=>{document.dispatchEvent(new Event("modal-show"))})),this.addClickHandler(this._selector,(t=>{this.openUrlInModal(t)}),this._stopSelector))}_getModal(){return ki.aF.getOrCreateInstance(this._getModalElement())}openUrlInModal(t,e){const n=new Headers;n.append("X-Requested-With","Kimai-Modal"),this.fetch(t,{method:"GET",redirect:"follow",headers:n}).then((e=>{if(e.ok)return e.text().then((t=>{this._openFormInModal(t)}));window.location=t})).catch((n=>{null==e?window.location=t:e(n)}))}_getFormIdentifier(){return"#remote_form_modal .modal-content form"}_getModalElement(){return document.getElementById("remote_form_modal")}_makeScriptExecutable(t){if(void 0!==t.tagName&&"SCRIPT"===t.tagName){const e=document.createElement("script");e.text=t.innerHTML,t.parentNode.replaceChild(e,t)}else for(const e of t.childNodes)this._makeScriptExecutable(e);return t}_openFormInModal(t){const e=this._getFormIdentifier();let n=this._getModalElement();const i=document.createElement("div");i.innerHTML=t;const s=this._makeScriptExecutable(i.querySelector("#form_modal .modal-content"));if(null!==s){let t=n.querySelector(".modal-dialog"),r=i.querySelector(".modal-dialog").classList.contains("modal-lg");r&&!t.classList.contains("modal-lg")&&t.classList.toggle("modal-lg"),!r&&t.classList.contains("modal-lg")&&t.classList.toggle("modal-lg"),n.querySelector(".modal-content").replaceWith(s),[].slice.call(n.querySelectorAll('[data-bs-dismiss="modal"]')).map((t=>{t.addEventListener("click",(()=>{this._isDirty=!1,this._getModal().hide()}))})),this.getContainer().getPlugin("form").activateForm(e)}let r=i.querySelector("div.alert");null!==r&&n.querySelector(".modal-body").prepend(r);const o=document.querySelector(e);o.addEventListener("change",(()=>{this._isDirty=!0})),o.addEventListener("submit",this._getEventHandler()),this._getModal().show()}_getEventHandler(){return void 0===this.eventHandler&&(this.eventHandler=t=>{const e=t.target;if(void 0!==e.target&&""!==e.target)return!0;const n=document.querySelector(this._getFormIdentifier()+" button[type=submit]");n.textContent=n.textContent+" …",n.disabled=!0;const i=e.dataset.formEvent,s=this.getContainer().getPlugin("event"),r=this.getContainer().getPlugin("alert");t.preventDefault(),t.stopPropagation();const o=new Headers;o.append("X-Requested-With","Kimai-Modal");const a={headers:o};this.fetchForm(e,a).then((t=>{t.text().then((t=>{const o=document.createElement("div");o.innerHTML=t;let a=!1,l=!1,c=!1;n.textContent=n.textContent.replace(" …",""),n.disabled=!1;const u=o.querySelector("#form_modal .modal-content");if(null!==u&&(a=null!==u.querySelector(".is-invalid"),a||(a=null!==u.querySelector(".invalid-feedback")),l=null!==u.querySelector("ul.list-unstyled li.text-danger"),c=null!==o.querySelector("div.alert-danger")),a||l||c)this._openFormInModal(t);else{s.trigger(i);let t=e.dataset.msgSuccess;null!=t&&""!==t||(t="action.update.success"),this._isDirty=!1,this._getModal().hide(),r.success(t)}}))})).catch((t=>{let i=e.dataset.msgError;null!=i&&""!==i||(i="action.update.error"),r.error(i,t.message),setTimeout((()=>{n.textContent=n.textContent.replace(" …",""),n.disabled=!1}),1500)}))}),this.eventHandler}}class Fi extends bi{constructor(){super(),this._selector=".ticktac-menu",this._selectorEmpty=".ticktac-menu-empty",this._favIconUrl=null}getId(){return"active-records"}init(){if(null===document.querySelector(this._selector))return;const t=()=>{this.reloadActiveRecords()};document.addEventListener("kimai.timesheetUpdate",t),document.addEventListener("kimai.timesheetDelete",t),document.addEventListener("kimai.activityUpdate",t),document.addEventListener("kimai.activityDelete",t),document.addEventListener("kimai.projectUpdate",t),document.addEventListener("kimai.projectDelete",t),document.addEventListener("kimai.customerUpdate",t),document.addEventListener("kimai.customerDelete",t),this._updateBrowserTitle=!!this.getConfiguration("updateBrowserTitle");const e=()=>{this._updateDuration()};this._updatesHandler=setInterval(e,1e4),document.addEventListener("kimai.timesheetUpdate",e),document.addEventListener("kimai.reloadedContent",e)}_updateDuration(){const t=document.querySelectorAll('[data-since]:not([data-since=""])');if(this._updateBrowserTitle&&this._changeFavicon(t.length>0),0===t.length)return void(this._updateBrowserTitle&&(void 0===document.body.dataset.title?this._updateBrowserTitle=!1:document.title=document.body.dataset.title));const e=this.getDateUtils();let n=[];for(const i of t){const t=e.formatDuration(i.dataset.since);void 0!==i.dataset.replacer&&null!==i.dataset.title&&"?"!==t&&n.push(t),i.textContent=t}0!==n.length&&this._updateBrowserTitle&&(document.title=n.shift())}_setEntries(t){const e=t.length>0;for(let t of document.querySelectorAll(this._selectorEmpty))t.style.display=e?"none":"inline-block";for(let n of document.querySelectorAll(this._selector)){if(n.style.display=e?"inline-block":"none",!e)for(let t of n.querySelectorAll("[data-since]"))t.dataset.since="";const i=n.querySelector(".ticktac-stop");e?(i&&(i.accesskey="s"),this._replaceInNode(n,t[0])):i&&(i.accesskey=null)}this._updateDuration()}_replaceInNode(t,e){const n=this.getDateUtils(),i=t.querySelectorAll("[data-replacer]");for(let s of i){const i=s.dataset.replacer;"url"===i?s.dataset.href=t.dataset.href.replace("000",e.id):"activity"===i?s.innerText=e.activity.name:"project"===i?s.innerText=e.project.name:"customer"===i?s.innerText=e.project.customer.name:"duration"===i&&(s.dataset.since=e.begin,s.innerText=n.formatDuration(e.duration))}}reloadActiveRecords(){const t=this.getContainer().getPlugin("api"),e=document.querySelector(this._selector).dataset.api;t.get(e,{},(t=>{this._setEntries(t)}))}_changeFavicon(t){const e=document.createElement("canvas"),n=document.getElementById("favicon");null===this._favIconUrl&&(this._favIconUrl=n.href);const i=n.cloneNode(!0);if(e.getContext&&i){const s=window.devicePixelRatio,r=document.createElement("img");e.height=e.width=16*s,r.onload=function(){const r=e.getContext("2d");if(r.drawImage(this,0,0,e.width,e.height),t){const t=5.5*s;r.fillStyle="rgb(182,57,57)",r.fillRect(e.width/2-t/2,e.height/2-t/2,t,t)}i.href=e.toDataURL("image/png"),n.remove(),document.head.appendChild(i)},r.src=this._favIconUrl}}}class Pi extends bi{getId(){return"event"}trigger(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(""!==t)for(const n of t.split(" ")){let t=new Event(n);null!==e&&(t=new CustomEvent(n,{detail:e})),document.dispatchEvent(t)}}}class ji extends bi{constructor(t){super(),this._selector=t}init(){document.addEventListener("click",(t=>{let e=t.target;for(;null!==e&&"function"==typeof e.matches&&!e.matches("body");){if(e.classList.contains(this._selector)){const n=e.dataset;let i=n.href;i||(i=e.getAttribute("href")),void 0!==n.question?this.getContainer().getPlugin("alert").question(n.question,(t=>{t&&this._callApi(i,n)})):this._callApi(i,n),t.preventDefault(),t.stopPropagation()}e=e.parentNode}}))}_callApi(t,e){const n=e.method,i=e.event,s=this.getContainer().getPlugin("api"),r=this.getContainer().getPlugin("event"),o=this.getContainer().getPlugin("alert"),a=()=>{r.trigger(i),void 0!==e.msgSuccess&&o.success(e.msgSuccess)},l=t=>{let n="action.update.error";void 0!==e.msgError&&(n=e.msgError),s.handleError(n,t)};let c={};if(void 0!==e.payload&&(c=e.payload),"PATCH"===n)s.patch(t,c,a,l);else if("POST"===n){let e={};s.post(t,e,a,l)}else"DELETE"===n?s.delete(t,a,l):"GET"===n&&s.get(t,c,a,l)}}class qi extends bi{getId(){return"alert"}error(t,e){const n=this.getTranslation();n.has(t)&&(t=n.get(t)),t=t.replace("%reason%",""),void 0===e&&(e=null),null!==e&&(n.has(e)&&(e=n.get(e)),Array.isArray(e)&&(e=e.join("<br>")));const i="alert_global_error",s=document.getElementById(i);null!==s&&ki.aF.getOrCreateInstance(s).hide();const r='\n <div class="modal" id="'+i+'" tabindex="-1" role="dialog">\n <div class="modal-dialog modal-sm modal-dialog-centered" role="document">\n <div class="modal-content">\n <div class="modal-status bg-'+this._mapClass("danger")+'"></div>\n <div class="modal-body text-center py-4">\n <i class="fas fa-exclamation-circle fa-3x mb-3 text-danger"></i>\n <h2>'+t+"</h2>\n "+(null!==e?'<div class="text-muted">'+e+"</div>":"")+'\n </div>\n <div class="modal-footer">\n <div class="w-100">\n <div class="row">\n <div class="col text-center"><a href="#" class="btn btn-primary" data-bs-dismiss="modal">'+n.get("close")+"</a></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n ";this._showModal(r)}warning(t){this._show("warning",t)}success(t){this._toast("success",t)}info(t){this._show("info",t)}_showModal(t){const e=document.body,n=document.createElement("template");n.innerHTML=t.trim();const i=n.content.firstChild;e.appendChild(i);const s=new ki.aF(i);i.addEventListener("hidden.bs.modal",(function(){e.removeChild(i)})),s.show()}_show(t,e){const n=this.getTranslation();n.has(e)&&(e=n.get(e));const i='\n <div class="modal fade" tabindex="-1" role="dialog">\n <div class="modal-dialog modal-sm modal-dialog-centered" role="document">\n <div class="modal-content">\n <div class="modal-status bg-'+this._mapClass(t)+'"></div>\n <div class="modal-body text-center py-4">\n <i class="fas fa-exclamation-circle fa-3x mb-3 text-'+this._mapClass(t)+'"></i>\n <h2>'+e+'</h2>\n </div>\n <div class="modal-footer">\n <div class="w-100">\n <div class="row">\n <div class="col text-center"><a href="#" class="btn btn-primary" data-bs-dismiss="modal">'+n.get("close")+"</a></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n ";this._showModal(i)}_mapClass(t){return"info"===t||"success"===t||"warning"===t||"danger"===t?t:"error"===t?"danger":"primary"}_toast(t,e){const n=this.getTranslation();n.has(e)&&(e=n.get(e));let i='<i class="fas fa-info me-2"></i>';"success"===t?i='<i class="fas fa-check me-2"></i>':"warning"===t?i='<i class="fas fa-exclamation me-2"></i>':"danger"!==t&&"error"!==t||(i='<i class="fas fa-exclamation-circle me-2"></i>');const s='<div class="toast align-items-center text-white bg-'+this._mapClass(t)+' border-0" data-bs-delay="2000" role="alert" aria-live="assertive" aria-atomic="true">\n <div class="d-flex">\n <div class="toast-body">\n '+i+" "+e+'\n </div>\n <button type="button" class="btn-close me-2 m-auto" data-bs-dismiss="toast" aria-label="'+n.get("close")+'"></button>\n </div>\n </div>',r=document.getElementById("toast-container"),o=document.createElement("template");o.innerHTML=s.trim();const a=o.content.firstChild;r.appendChild(a);const l=new ki.y8(a);a.addEventListener("hidden.bs.toast",(function(){r.removeChild(a)})),l.show()}question(t,e){const n=this.getTranslation();n.has(t)&&(t=n.get(t));const i=this._mapClass("info"),s='\n <div class="modal fade" tabindex="-1" role="dialog" data-bs-backdrop="static">\n <div class="modal-dialog modal-sm modal-dialog-centered" role="document">\n <div class="modal-content">\n <div class="modal-status bg-'+i+'"></div>\n <div class="modal-body text-center py-4">\n <i class="fas fa-question fa-3x mb-3 text-'+i+'"></i>\n <h2>'+t+'</h2>\n </div>\n <div class="modal-footer">\n <div class="w-100">\n <div class="row">\n <div class="col"><a href="#" class="question-confirm btn btn-primary w-100" data-bs-dismiss="modal">'+n.get("confirm")+'</a></div>\n <div class="col"><a href="#" class="question-cancel btn w-100" data-bs-dismiss="modal">'+n.get("cancel")+"</a></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n ",r=document.body,o=document.createElement("template");o.innerHTML=s.trim();const a=o.content.firstChild;r.appendChild(a),a.querySelector(".question-confirm").addEventListener("click",(()=>{e(!0)})),a.querySelector(".question-cancel").addEventListener("click",(()=>{e(!1)}));const l=new ki.aF(a);a.addEventListener("hidden.bs.modal",(()=>{r.removeChild(a)})),l.show()}}function Hi(t,e){t.split(/\s+/).forEach((t=>{e(t)}))}class Vi{constructor(){this._events={}}on(t,e){Hi(t,(t=>{const n=this._events[t]||[];n.push(e),this._events[t]=n}))}off(t,e){var n=arguments.length;0!==n?Hi(t,(t=>{if(1===n)return void delete this._events[t];const i=this._events[t];void 0!==i&&(i.splice(i.indexOf(e),1),this._events[t]=i)})):this._events={}}trigger(t,...e){var n=this;Hi(t,(t=>{const i=n._events[t];void 0!==i&&i.forEach((t=>{t.apply(n,e)}))}))}}const $i=t=>(t=t.filter(Boolean)).length<2?t[0]||"":1==Yi(t)?"["+t.join("")+"]":"(?:"+t.join("|")+")",Ri=t=>{if(!Bi(t))return t.join("");let e="",n=0;const i=()=>{n>1&&(e+="{"+n+"}")};return t.forEach(((s,r)=>{s!==t[r-1]?(i(),e+=s,n=1):n++})),i(),e},Wi=t=>{let e=Array.from(t);return $i(e)},Bi=t=>new Set(t).size!==t.length,zi=t=>(t+"").replace(/([\$\(\)\*\+\.\?\[\]\^\{\|\}\\])/gu,"\\$1"),Yi=t=>t.reduce(((t,e)=>Math.max(t,Ui(e))),0),Ui=t=>Array.from(t).length,Zi=t=>{if(1===t.length)return[[t]];let e=[];const n=t.substring(1);return Zi(n).forEach((function(n){let i=n.slice(0);i[0]=t.charAt(0)+i[0],e.push(i),i=n.slice(0),i.unshift(t.charAt(0)),e.push(i)})),e},Ji=[[0,65535]];let Ki,Gi;const Qi={},Xi={"/":"⁄∕",0:"߀",a:"ⱥɐɑ",aa:"ꜳ",ae:"æǽǣ",ao:"ꜵ",au:"ꜷ",av:"ꜹꜻ",ay:"ꜽ",b:"ƀɓƃ",c:"ꜿƈȼↄ",d:"đɗɖᴅƌꮷԁɦ",e:"ɛǝᴇɇ",f:"ꝼƒ",g:"ǥɠꞡᵹꝿɢ",h:"ħⱨⱶɥ",i:"ɨı",j:"ɉȷ",k:"ƙⱪꝁꝃꝅꞣ",l:"łƚɫⱡꝉꝇꞁɭ",m:"ɱɯϻ",n:"ꞥƞɲꞑᴎлԉ",o:"øǿɔɵꝋꝍᴑ",oe:"œ",oi:"ƣ",oo:"ꝏ",ou:"ȣ",p:"ƥᵽꝑꝓꝕρ",q:"ꝗꝙɋ",r:"ɍɽꝛꞧꞃ",s:"ßȿꞩꞅʂ",t:"ŧƭʈⱦꞇ",th:"þ",tz:"ꜩ",u:"ʉ",v:"ʋꝟʌ",vy:"ꝡ",w:"ⱳ",y:"ƴɏỿ",z:"ƶȥɀⱬꝣ",hv:"ƕ"};for(let t in Xi){let e=Xi[t]||"";for(let n=0;n<e.length;n++){let i=e.substring(n,n+1);Qi[i]=t}}const ts=new RegExp(Object.keys(Qi).join("|")+"|[̀-ͯ·ʾʼ]","gu"),es=(t,e="NFKD")=>t.normalize(e),ns=t=>Array.from(t).reduce(((t,e)=>t+is(e)),""),is=t=>(t=es(t).toLowerCase().replace(ts,(t=>Qi[t]||"")),es(t,"NFC"));const ss=t=>{const e={},n=(t,n)=>{const i=e[t]||new Set,s=new RegExp("^"+Wi(i)+"$","iu");n.match(s)||(i.add(zi(n)),e[t]=i)};for(let e of function*(t){for(const[e,n]of t)for(let t=e;t<=n;t++){let e=String.fromCharCode(t),n=ns(e);n!=e.toLowerCase()&&(n.length>3||0!=n.length&&(yield{folded:n,composed:e,code_point:t}))}}(t))n(e.folded,e.folded),n(e.folded,e.composed);return e},rs=t=>{const e=ss(t),n={};let i=[];for(let t in e){let s=e[t];s&&(n[t]=Wi(s)),t.length>1&&i.push(zi(t))}i.sort(((t,e)=>e.length-t.length));const s=$i(i);return Gi=new RegExp("^"+s,"u"),n},os=(t,e=1)=>(e=Math.max(e,t.length-1),$i(Zi(t).map((t=>((t,e=1)=>{let n=0;return t=t.map((t=>(Ki[t]&&(n+=t.length),Ki[t]||t))),n>=e?Ri(t):""})(t,e))))),as=(t,e=!0)=>{let n=t.length>1?1:0;return $i(t.map((t=>{let i=[];const s=e?t.length():t.length()-1;for(let e=0;e<s;e++)i.push(os(t.substrs[e]||"",n));return Ri(i)})))},ls=(t,e)=>{for(const n of e){if(n.start!=t.start||n.end!=t.end)continue;if(n.substrs.join("")!==t.substrs.join(""))continue;let e=t.parts;const i=t=>{for(const n of e){if(n.start===t.start&&n.substr===t.substr)return!1;if(1!=t.length&&1!=n.length){if(t.start<n.start&&t.end>n.start)return!0;if(n.start<t.start&&n.end>t.start)return!0}}return!1};if(!(n.parts.filter(i).length>0))return!0}return!1};class cs{parts;substrs;start;end;constructor(){this.parts=[],this.substrs=[],this.start=0,this.end=0}add(t){t&&(this.parts.push(t),this.substrs.push(t.substr),this.start=Math.min(t.start,this.start),this.end=Math.max(t.end,this.end))}last(){return this.parts[this.parts.length-1]}length(){return this.parts.length}clone(t,e){let n=new cs,i=JSON.parse(JSON.stringify(this.parts)),s=i.pop();for(const t of i)n.add(t);let r=e.substr.substring(0,t-s.start),o=r.length;return n.add({start:s.start,end:s.start+o,length:o,substr:r}),n}}const us=t=>{var e;void 0===Ki&&(Ki=rs(e||Ji)),t=ns(t);let n="",i=[new cs];for(let e=0;e<t.length;e++){let s=t.substring(e).match(Gi);const r=t.substring(e,e+1),o=s?s[0]:null;let a=[],l=new Set;for(const t of i){const n=t.last();if(!n||1==n.length||n.end<=e)if(o){const n=o.length;t.add({start:e,end:e+n,length:n,substr:o}),l.add("1")}else t.add({start:e,end:e+1,length:1,substr:r}),l.add("2");else if(o){let i=t.clone(e,n);const s=o.length;i.add({start:e,end:e+s,length:s,substr:o}),a.push(i)}else l.add("3")}if(a.length>0){a=a.sort(((t,e)=>t.length()-e.length()));for(let t of a)ls(t,i)||i.push(t)}else if(e>0&&1==l.size&&!l.has("3")){n+=as(i,!1);let t=new cs;const e=i[0];e&&t.add(e.last()),i=[t]}}return n+=as(i,!0),n},ds=(t,e)=>{if(t)return t[e]},hs=(t,e)=>{if(t){for(var n,i=e.split(".");(n=i.shift())&&(t=t[n]););return t}},ps=(t,e,n)=>{var i,s;return t?(t+="",null==e.regex||-1===(s=t.search(e.regex))?0:(i=e.string.length/t.length,0===s&&(i+=.5),i*n)):0},ms=(t,e)=>{var n=t[e];if("function"==typeof n)return n;n&&!Array.isArray(n)&&(t[e]=[n])},fs=(t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},gs=(t,e)=>"number"==typeof t&&"number"==typeof e?t>e?1:t<e?-1:0:(t=ns(t+"").toLowerCase())>(e=ns(e+"").toLowerCase())?1:e>t?-1:0;class vs{items;settings;constructor(t,e){this.items=t,this.settings=e||{diacritics:!0}}tokenize(t,e,n){if(!t||!t.length)return[];const i=[],s=t.split(/\s+/);var r;return n&&(r=new RegExp("^("+Object.keys(n).map(zi).join("|")+"):(.*)$")),s.forEach((t=>{let n,s=null,o=null;r&&(n=t.match(r))&&(s=n[1],t=n[2]),t.length>0&&(o=this.settings.diacritics?us(t)||null:zi(t),o&&e&&(o="\\b"+o)),i.push({string:t,regex:o?new RegExp(o,"iu"):null,field:s})})),i}getScoreFunction(t,e){var n=this.prepareSearch(t,e);return this._getScoreFunction(n)}_getScoreFunction(t){const e=t.tokens,n=e.length;if(!n)return function(){return 0};const i=t.options.fields,s=t.weights,r=i.length,o=t.getAttrFn;if(!r)return function(){return 1};const a=1===r?function(t,e){const n=i[0].field;return ps(o(e,n),t,s[n]||1)}:function(t,e){var n=0;if(t.field){const i=o(e,t.field);!t.regex&&i?n+=1/r:n+=ps(i,t,1)}else fs(s,((i,s)=>{n+=ps(o(e,s),t,i)}));return n/r};return 1===n?function(t){return a(e[0],t)}:"and"===t.options.conjunction?function(t){var i,s=0;for(let n of e){if((i=a(n,t))<=0)return 0;s+=i}return s/n}:function(t){var i=0;return fs(e,(e=>{i+=a(e,t)})),i/n}}getSortFunction(t,e){var n=this.prepareSearch(t,e);return this._getSortFunction(n)}_getSortFunction(t){var e,n=[];const i=this,s=t.options,r=!t.query&&s.sort_empty?s.sort_empty:s.sort;if("function"==typeof r)return r.bind(this);const o=function(e,n){return"$score"===e?n.score:t.getAttrFn(i.items[n.id],e)};if(r)for(let e of r)(t.query||"$score"!==e.field)&&n.push(e);if(t.query){e=!0;for(let t of n)if("$score"===t.field){e=!1;break}e&&n.unshift({field:"$score",direction:"desc"})}else n=n.filter((t=>"$score"!==t.field));return n.length?function(t,e){var i,s;for(let r of n){if(s=r.field,i=("desc"===r.direction?-1:1)*gs(o(s,t),o(s,e)))return i}return 0}:null}prepareSearch(t,e){const n={};var i=Object.assign({},e);if(ms(i,"sort"),ms(i,"sort_empty"),i.fields){ms(i,"fields");const t=[];i.fields.forEach((e=>{"string"==typeof e&&(e={field:e,weight:1}),t.push(e),n[e.field]="weight"in e?e.weight:1})),i.fields=t}return{options:i,query:t.toLowerCase().trim(),tokens:this.tokenize(t,i.respect_word_boundaries,n),total:0,items:[],weights:n,getAttrFn:i.nesting?hs:ds}}search(t,e){var n,i,s=this;i=this.prepareSearch(t,e),e=i.options,t=i.query;const r=e.score||s._getScoreFunction(i);t.length?fs(s.items,((t,s)=>{n=r(t),(!1===e.filter||n>0)&&i.items.push({score:n,id:s})})):fs(s.items,((t,e)=>{i.items.push({score:1,id:e})}));const o=s._getSortFunction(i);return o&&i.items.sort(o),i.total=i.items.length,"number"==typeof e.limit&&(i.items=i.items.slice(0,e.limit)),i}}const ys=t=>null==t?null:bs(t),bs=t=>"boolean"==typeof t?t?"1":"0":t+"",_s=t=>(t+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),ws=(t,e)=>{var n;return function(i,s){var r=this;n&&(r.loading=Math.max(r.loading-1,0),clearTimeout(n)),n=setTimeout((function(){n=null,r.loadedSearches[i]=!0,t.call(r,i,s)}),e)}},ks=(t,e,n)=>{var i,s=t.trigger,r={};for(i of(t.trigger=function(){var n=arguments[0];if(-1===e.indexOf(n))return s.apply(t,arguments);r[n]=arguments},n.apply(t,[]),t.trigger=s,e))i in r&&s.apply(t,r[i])},Ts=(t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())},xs=(t,e,n,i)=>{t.addEventListener(e,n,i)},Es=(t,e)=>!!e&&(!!e[t]&&1===(e.altKey?1:0)+(e.ctrlKey?1:0)+(e.shiftKey?1:0)+(e.metaKey?1:0)),Ds=(t,e)=>{const n=t.getAttribute("id");return n||(t.setAttribute("id",e),e)},Ss=t=>t.replace(/[\\"']/g,"\\$&"),Os=(t,e)=>{e&&t.append(e)},Ls=(t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},Cs=t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(Ms(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)},Ms=t=>"string"==typeof t&&t.indexOf("<")>-1,As=(t,e)=>{var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!1),t.dispatchEvent(n)},Is=(t,e)=>{Object.assign(t.style,e)},Ns=(t,...e)=>{var n=Ps(e);(t=js(t)).map((t=>{n.map((e=>{t.classList.add(e)}))}))},Fs=(t,...e)=>{var n=Ps(e);(t=js(t)).map((t=>{n.map((e=>{t.classList.remove(e)}))}))},Ps=t=>{var e=[];return Ls(t,(t=>{"string"==typeof t&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))})),e.filter(Boolean)},js=t=>(Array.isArray(t)||(t=[t]),t),qs=(t,e,n)=>{if(!n||n.contains(t))for(;t&&t.matches;){if(t.matches(e))return t;t=t.parentNode}},Hs=(t,e=0)=>e>0?t[t.length-1]:t[0],Vs=(t,e)=>{if(!t)return-1;e=e||t.nodeName;for(var n=0;t=t.previousElementSibling;)t.matches(e)&&n++;return n},$s=(t,e)=>{Ls(e,((e,n)=>{null==e?t.removeAttribute(n):t.setAttribute(n,""+e)}))},Rs=(t,e)=>{t.parentNode&&t.parentNode.replaceChild(e,t)},Ws=(t,e)=>{if(null===e)return;if("string"==typeof e){if(!e.length)return;e=new RegExp(e,"i")}const n=t=>3===t.nodeType?(t=>{var n=t.data.match(e);if(n&&t.data.length>0){var i=document.createElement("span");i.className="highlight";var s=t.splitText(n.index);s.splitText(n[0].length);var r=s.cloneNode(!0);return i.appendChild(r),Rs(s,i),1}return 0})(t):((t=>{1!==t.nodeType||!t.childNodes||/(script|style)/i.test(t.tagName)||"highlight"===t.className&&"SPAN"===t.tagName||Array.from(t.childNodes).forEach((t=>{n(t)}))})(t),0);n(t)},Bs="undefined"!=typeof navigator&&/Mac/.test(navigator.userAgent)?"metaKey":"ctrlKey";var zs={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:null,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,shouldOpen:null,maxOptions:50,maxItems:null,hideSelected:null,duplicates:!1,addPrecedence:!1,selectOnTab:!1,preload:null,allowEmptyOption:!1,refreshThrottle:300,loadThrottle:300,loadingClass:"loading",dataAttr:null,optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"ts-wrapper",controlClass:"ts-control",dropdownClass:"ts-dropdown",dropdownContentClass:"ts-dropdown-content",itemClass:"item",optionClass:"option",dropdownParent:null,controlInput:'<input type="text" autocomplete="off" size="1" />',copyClassesToDropdown:!1,placeholder:null,hidePlaceholder:null,shouldLoad:function(t){return t.length>0},render:{}};function Ys(t,e){var n=Object.assign({},zs,e),i=n.dataAttr,s=n.labelField,r=n.valueField,o=n.disabledField,a=n.optgroupField,l=n.optgroupLabelField,c=n.optgroupValueField,u=t.tagName.toLowerCase(),d=t.getAttribute("placeholder")||t.getAttribute("data-placeholder");if(!d&&!n.allowEmptyOption){let e=t.querySelector('option[value=""]');e&&(d=e.textContent)}var h={placeholder:d,options:[],optgroups:[],items:[],maxItems:null};return"select"===u?(()=>{var e,u=h.options,d={},p=1;let m=0;var f=t=>{var e=Object.assign({},t.dataset),n=i&&e[i];return"string"==typeof n&&n.length&&(e=Object.assign(e,JSON.parse(n))),e},g=(t,e)=>{var i=ys(t.value);if(null!=i&&(i||n.allowEmptyOption)){if(d.hasOwnProperty(i)){if(e){var l=d[i][a];l?Array.isArray(l)?l.push(e):d[i][a]=[l,e]:d[i][a]=e}}else{var c=f(t);c[s]=c[s]||t.textContent,c[r]=c[r]||i,c[o]=c[o]||t.disabled,c[a]=c[a]||e,c.$option=t,c.$order=c.$order||++m,d[i]=c,u.push(c)}t.selected&&h.items.push(i)}};h.maxItems=t.hasAttribute("multiple")?null:1,Ls(t.children,(t=>{var n,i,s;"optgroup"===(e=t.tagName.toLowerCase())?((s=f(n=t))[l]=s[l]||n.getAttribute("label")||"",s[c]=s[c]||p++,s[o]=s[o]||n.disabled,s.$order=s.$order||++m,h.optgroups.push(s),i=s[c],Ls(n.children,(t=>{g(t,i)}))):"option"===e&&g(t)}))})():(()=>{const e=t.getAttribute(i);if(e)h.options=JSON.parse(e),Ls(h.options,(t=>{h.items.push(t[r])}));else{var o=t.value.trim()||"";if(!n.allowEmptyOption&&!o.length)return;const e=o.split(n.delimiter);Ls(e,(t=>{const e={};e[s]=t,e[r]=t,h.options.push(e)})),h.items=e}})(),Object.assign({},zs,h,e)}var Us=0;class Zs extends(function(t){return t.plugins={},class extends t{constructor(){super(...arguments),this.plugins={names:[],settings:{},requested:{},loaded:{}}}static define(e,n){t.plugins[e]={name:e,fn:n}}initializePlugins(t){var e,n;const i=this,s=[];if(Array.isArray(t))t.forEach((t=>{"string"==typeof t?s.push(t):(i.plugins.settings[t.name]=t.options,s.push(t.name))}));else if(t)for(e in t)t.hasOwnProperty(e)&&(i.plugins.settings[e]=t[e],s.push(e));for(;n=s.shift();)i.require(n)}loadPlugin(e){var n=this,i=n.plugins,s=t.plugins[e];if(!t.plugins.hasOwnProperty(e))throw new Error('Unable to find "'+e+'" plugin');i.requested[e]=!0,i.loaded[e]=s.fn.apply(n,[n.plugins.settings[e]||{}]),i.names.push(e)}require(t){var e=this,n=e.plugins;if(!e.plugins.loaded.hasOwnProperty(t)){if(n.requested[t])throw new Error('Plugin has circular dependency ("'+t+'")');e.loadPlugin(t)}return n.loaded[t]}}}(Vi)){constructor(t,e){var n;super(),this.order=0,this.isOpen=!1,this.isDisabled=!1,this.isReadOnly=!1,this.isInvalid=!1,this.isValid=!0,this.isLocked=!1,this.isFocused=!1,this.isInputHidden=!1,this.isSetup=!1,this.ignoreFocus=!1,this.ignoreHover=!1,this.hasOptions=!1,this.lastValue="",this.caretPos=0,this.loading=0,this.loadedSearches={},this.activeOption=null,this.activeItems=[],this.optgroups={},this.options={},this.userOptions={},this.items=[],this.refreshTimeout=null,Us++;var i=Cs(t);if(i.tomselect)throw new Error("Tom Select already initialized on this element");i.tomselect=this,n=(window.getComputedStyle&&window.getComputedStyle(i,null)).getPropertyValue("direction");const s=Ys(i,e);this.settings=s,this.input=i,this.tabIndex=i.tabIndex||0,this.is_select_tag="select"===i.tagName.toLowerCase(),this.rtl=/rtl/i.test(n),this.inputId=Ds(i,"tomselect-"+Us),this.isRequired=i.required,this.sifter=new vs(this.options,{diacritics:s.diacritics}),s.mode=s.mode||(1===s.maxItems?"single":"multi"),"boolean"!=typeof s.hideSelected&&(s.hideSelected="multi"===s.mode),"boolean"!=typeof s.hidePlaceholder&&(s.hidePlaceholder="multi"!==s.mode);var r=s.createFilter;"function"!=typeof r&&("string"==typeof r&&(r=new RegExp(r)),r instanceof RegExp?s.createFilter=t=>r.test(t):s.createFilter=t=>this.settings.duplicates||!this.options[t]),this.initializePlugins(s.plugins),this.setupCallbacks(),this.setupTemplates();const o=Cs("<div>"),a=Cs("<div>"),l=this._render("dropdown"),c=Cs('<div role="listbox" tabindex="-1">'),u=this.input.getAttribute("class")||"",d=s.mode;var h;if(Ns(o,s.wrapperClass,u,d),Ns(a,s.controlClass),Os(o,a),Ns(l,s.dropdownClass,d),s.copyClassesToDropdown&&Ns(l,u),Ns(c,s.dropdownContentClass),Os(l,c),Cs(s.dropdownParent||o).appendChild(l),Ms(s.controlInput)){h=Cs(s.controlInput);Ls(["autocorrect","autocapitalize","autocomplete","spellcheck"],(t=>{i.getAttribute(t)&&$s(h,{[t]:i.getAttribute(t)})})),h.tabIndex=-1,a.appendChild(h),this.focus_node=h}else s.controlInput?(h=Cs(s.controlInput),this.focus_node=h):(h=Cs("<input/>"),this.focus_node=a);this.wrapper=o,this.dropdown=l,this.dropdown_content=c,this.control=a,this.control_input=h,this.setup()}setup(){const t=this,e=t.settings,n=t.control_input,i=t.dropdown,s=t.dropdown_content,r=t.wrapper,o=t.control,a=t.input,l=t.focus_node,c={passive:!0},u=t.inputId+"-ts-dropdown";$s(s,{id:u}),$s(l,{role:"combobox","aria-haspopup":"listbox","aria-expanded":"false","aria-controls":u});const d=Ds(l,t.inputId+"-ts-control"),h="label[for='"+(t=>t.replace(/['"\\]/g,"\\$&"))(t.inputId)+"']",p=document.querySelector(h),m=t.focus.bind(t);if(p){xs(p,"click",m),$s(p,{for:d});const e=Ds(p,t.inputId+"-ts-label");$s(l,{"aria-labelledby":e}),$s(s,{"aria-labelledby":e})}if(r.style.width=a.style.width,t.plugins.names.length){const e="plugin-"+t.plugins.names.join(" plugin-");Ns([r,i],e)}(null===e.maxItems||e.maxItems>1)&&t.is_select_tag&&$s(a,{multiple:"multiple"}),e.placeholder&&$s(n,{placeholder:e.placeholder}),!e.splitOn&&e.delimiter&&(e.splitOn=new RegExp("\\s*"+zi(e.delimiter)+"+\\s*")),e.load&&e.loadThrottle&&(e.load=ws(e.load,e.loadThrottle)),xs(i,"mousemove",(()=>{t.ignoreHover=!1})),xs(i,"mouseenter",(e=>{var n=qs(e.target,"[data-selectable]",i);n&&t.onOptionHover(e,n)}),{capture:!0}),xs(i,"click",(e=>{const n=qs(e.target,"[data-selectable]");n&&(t.onOptionSelect(e,n),Ts(e,!0))})),xs(o,"click",(e=>{var i=qs(e.target,"[data-ts-item]",o);i&&t.onItemSelect(e,i)?Ts(e,!0):""==n.value&&(t.onClick(),Ts(e,!0))})),xs(l,"keydown",(e=>t.onKeyDown(e))),xs(n,"keypress",(e=>t.onKeyPress(e))),xs(n,"input",(e=>t.onInput(e))),xs(l,"blur",(e=>t.onBlur(e))),xs(l,"focus",(e=>t.onFocus(e))),xs(n,"paste",(e=>t.onPaste(e)));const f=e=>{const s=e.composedPath()[0];if(!r.contains(s)&&!i.contains(s))return t.isFocused&&t.blur(),void t.inputState();s==n&&t.isOpen?e.stopPropagation():Ts(e,!0)},g=()=>{t.isOpen&&t.positionDropdown()};xs(document,"mousedown",f),xs(window,"scroll",g,c),xs(window,"resize",g,c),this._destroy=()=>{document.removeEventListener("mousedown",f),window.removeEventListener("scroll",g),window.removeEventListener("resize",g),p&&p.removeEventListener("click",m)},this.revertSettings={innerHTML:a.innerHTML,tabIndex:a.tabIndex},a.tabIndex=-1,a.insertAdjacentElement("afterend",t.wrapper),t.sync(!1),e.items=[],delete e.optgroups,delete e.options,xs(a,"invalid",(()=>{t.isValid&&(t.isValid=!1,t.isInvalid=!0,t.refreshState())})),t.updateOriginalInput(),t.refreshItems(),t.close(!1),t.inputState(),t.isSetup=!0,a.disabled?t.disable():a.readOnly?t.setReadOnly(!0):t.enable(),t.on("change",this.onChange),Ns(a,"tomselected","ts-hidden-accessible"),t.trigger("initialize"),!0===e.preload&&t.preload()}setupOptions(t=[],e=[]){this.addOptions(t),Ls(e,(t=>{this.registerOptionGroup(t)}))}setupTemplates(){var t=this,e=t.settings.labelField,n=t.settings.optgroupLabelField,i={optgroup:t=>{let e=document.createElement("div");return e.className="optgroup",e.appendChild(t.options),e},optgroup_header:(t,e)=>'<div class="optgroup-header">'+e(t[n])+"</div>",option:(t,n)=>"<div>"+n(t[e])+"</div>",item:(t,n)=>"<div>"+n(t[e])+"</div>",option_create:(t,e)=>'<div class="create">Add <strong>'+e(t.input)+"</strong>…</div>",no_results:()=>'<div class="no-results">No results found</div>',loading:()=>'<div class="spinner"></div>',not_loading:()=>{},dropdown:()=>"<div></div>"};t.settings.render=Object.assign({},i,t.settings.render)}setupCallbacks(){var t,e,n={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",item_select:"onItemSelect",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(t in n)(e=this.settings[n[t]])&&this.on(t,e)}sync(t=!0){const e=this,n=t?Ys(e.input,{delimiter:e.settings.delimiter}):e.settings;e.setupOptions(n.options,n.optgroups),e.setValue(n.items||[],!0),e.lastQuery=null}onClick(){var t=this;if(t.activeItems.length>0)return t.clearActiveItems(),void t.focus();t.isFocused&&t.isOpen?t.blur():t.focus()}onMouseDown(){}onChange(){As(this.input,"input"),As(this.input,"change")}onPaste(t){var e=this;e.isInputHidden||e.isLocked?Ts(t):e.settings.splitOn&&setTimeout((()=>{var t=e.inputValue();if(t.match(e.settings.splitOn)){var n=t.trim().split(e.settings.splitOn);Ls(n,(t=>{ys(t)&&(this.options[t]?e.addItem(t):e.createItem(t))}))}}),0)}onKeyPress(t){var e=this;if(!e.isLocked){var n=String.fromCharCode(t.keyCode||t.which);return e.settings.create&&"multi"===e.settings.mode&&n===e.settings.delimiter?(e.createItem(),void Ts(t)):void 0}Ts(t)}onKeyDown(t){var e=this;if(e.ignoreHover=!0,e.isLocked)9!==t.keyCode&&Ts(t);else{switch(t.keyCode){case 65:if(Es(Bs,t)&&""==e.control_input.value)return Ts(t),void e.selectAll();break;case 27:return e.isOpen&&(Ts(t,!0),e.close()),void e.clearActiveItems();case 40:if(!e.isOpen&&e.hasOptions)e.open();else if(e.activeOption){let t=e.getAdjacent(e.activeOption,1);t&&e.setActiveOption(t)}return void Ts(t);case 38:if(e.activeOption){let t=e.getAdjacent(e.activeOption,-1);t&&e.setActiveOption(t)}return void Ts(t);case 13:return void(e.canSelect(e.activeOption)?(e.onOptionSelect(t,e.activeOption),Ts(t)):(e.settings.create&&e.createItem()||document.activeElement==e.control_input&&e.isOpen)&&Ts(t));case 37:return void e.advanceSelection(-1,t);case 39:return void e.advanceSelection(1,t);case 9:return void(e.settings.selectOnTab&&(e.canSelect(e.activeOption)&&(e.onOptionSelect(t,e.activeOption),Ts(t)),e.settings.create&&e.createItem()&&Ts(t)));case 8:case 46:return void e.deleteSelection(t)}e.isInputHidden&&!Es(Bs,t)&&Ts(t)}}onInput(t){if(this.isLocked)return;const e=this.inputValue();this.lastValue!==e&&(this.lastValue=e,""!=e?(this.refreshTimeout&&window.clearTimeout(this.refreshTimeout),this.refreshTimeout=((t,e)=>e>0?window.setTimeout(t,e):(t.call(null),null))((()=>{this.refreshTimeout=null,this._onInput()}),this.settings.refreshThrottle)):this._onInput())}_onInput(){const t=this.lastValue;this.settings.shouldLoad.call(this,t)&&this.load(t),this.refreshOptions(),this.trigger("type",t)}onOptionHover(t,e){this.ignoreHover||this.setActiveOption(e,!1)}onFocus(t){var e=this,n=e.isFocused;if(e.isDisabled||e.isReadOnly)return e.blur(),void Ts(t);e.ignoreFocus||(e.isFocused=!0,"focus"===e.settings.preload&&e.preload(),n||e.trigger("focus"),e.activeItems.length||(e.inputState(),e.refreshOptions(!!e.settings.openOnFocus)),e.refreshState())}onBlur(t){if(!1!==document.hasFocus()){var e=this;if(e.isFocused){e.isFocused=!1,e.ignoreFocus=!1;var n=()=>{e.close(),e.setActiveItem(),e.setCaret(e.items.length),e.trigger("blur")};e.settings.create&&e.settings.createOnBlur?e.createItem(null,n):n()}}}onOptionSelect(t,e){var n,i=this;e.parentElement&&e.parentElement.matches("[data-disabled]")||(e.classList.contains("create")?i.createItem(null,(()=>{i.settings.closeAfterSelect&&i.close()})):void 0!==(n=e.dataset.value)&&(i.lastQuery=null,i.addItem(n),i.settings.closeAfterSelect&&i.close(),!i.settings.hideSelected&&t.type&&/click/.test(t.type)&&i.setActiveOption(e)))}canSelect(t){return!!(this.isOpen&&t&&this.dropdown_content.contains(t))}onItemSelect(t,e){var n=this;return!n.isLocked&&"multi"===n.settings.mode&&(Ts(t),n.setActiveItem(e,t),!0)}canLoad(t){return!!this.settings.load&&!this.loadedSearches.hasOwnProperty(t)}load(t){const e=this;if(!e.canLoad(t))return;Ns(e.wrapper,e.settings.loadingClass),e.loading++;const n=e.loadCallback.bind(e);e.settings.load.call(e,t,n)}loadCallback(t,e){const n=this;n.loading=Math.max(n.loading-1,0),n.lastQuery=null,n.clearActiveOption(),n.setupOptions(t,e),n.refreshOptions(n.isFocused&&!n.isInputHidden),n.loading||Fs(n.wrapper,n.settings.loadingClass),n.trigger("load",t,e)}preload(){var t=this.wrapper.classList;t.contains("preloaded")||(t.add("preloaded"),this.load(""))}setTextboxValue(t=""){var e=this.control_input;e.value!==t&&(e.value=t,As(e,"update"),this.lastValue=t)}getValue(){return this.is_select_tag&&this.input.hasAttribute("multiple")?this.items:this.items.join(this.settings.delimiter)}setValue(t,e){ks(this,e?[]:["change"],(()=>{this.clear(e),this.addItems(t,e)}))}setMaxItems(t){0===t&&(t=null),this.settings.maxItems=t,this.refreshState()}setActiveItem(t,e){var n,i,s,r,o,a,l=this;if("single"!==l.settings.mode){if(!t)return l.clearActiveItems(),void(l.isFocused&&l.inputState());if("click"===(n=e&&e.type.toLowerCase())&&Es("shiftKey",e)&&l.activeItems.length){for(a=l.getLastActive(),(s=Array.prototype.indexOf.call(l.control.children,a))>(r=Array.prototype.indexOf.call(l.control.children,t))&&(o=s,s=r,r=o),i=s;i<=r;i++)t=l.control.children[i],-1===l.activeItems.indexOf(t)&&l.setActiveItemClass(t);Ts(e)}else"click"===n&&Es(Bs,e)||"keydown"===n&&Es("shiftKey",e)?t.classList.contains("active")?l.removeActiveItem(t):l.setActiveItemClass(t):(l.clearActiveItems(),l.setActiveItemClass(t));l.inputState(),l.isFocused||l.focus()}}setActiveItemClass(t){const e=this,n=e.control.querySelector(".last-active");n&&Fs(n,"last-active"),Ns(t,"active last-active"),e.trigger("item_select",t),-1==e.activeItems.indexOf(t)&&e.activeItems.push(t)}removeActiveItem(t){var e=this.activeItems.indexOf(t);this.activeItems.splice(e,1),Fs(t,"active")}clearActiveItems(){Fs(this.activeItems,"active"),this.activeItems=[]}setActiveOption(t,e=!0){t!==this.activeOption&&(this.clearActiveOption(),t&&(this.activeOption=t,$s(this.focus_node,{"aria-activedescendant":t.getAttribute("id")}),$s(t,{"aria-selected":"true"}),Ns(t,"active"),e&&this.scrollToOption(t)))}scrollToOption(t,e){if(!t)return;const n=this.dropdown_content,i=n.clientHeight,s=n.scrollTop||0,r=t.offsetHeight,o=t.getBoundingClientRect().top-n.getBoundingClientRect().top+s;o+r>i+s?this.scroll(o-i+r,e):o<s&&this.scroll(o,e)}scroll(t,e){const n=this.dropdown_content;e&&(n.style.scrollBehavior=e),n.scrollTop=t,n.style.scrollBehavior=""}clearActiveOption(){this.activeOption&&(Fs(this.activeOption,"active"),$s(this.activeOption,{"aria-selected":null})),this.activeOption=null,$s(this.focus_node,{"aria-activedescendant":null})}selectAll(){const t=this;if("single"===t.settings.mode)return;const e=t.controlChildren();e.length&&(t.inputState(),t.close(),t.activeItems=e,Ls(e,(e=>{t.setActiveItemClass(e)})))}inputState(){var t=this;t.control.contains(t.control_input)&&($s(t.control_input,{placeholder:t.settings.placeholder}),t.activeItems.length>0||!t.isFocused&&t.settings.hidePlaceholder&&t.items.length>0?(t.setTextboxValue(),t.isInputHidden=!0):(t.settings.hidePlaceholder&&t.items.length>0&&$s(t.control_input,{placeholder:""}),t.isInputHidden=!1),t.wrapper.classList.toggle("input-hidden",t.isInputHidden))}inputValue(){return this.control_input.value.trim()}focus(){var t=this;t.isDisabled||t.isReadOnly||(t.ignoreFocus=!0,t.control_input.offsetWidth?t.control_input.focus():t.focus_node.focus(),setTimeout((()=>{t.ignoreFocus=!1,t.onFocus()}),0))}blur(){this.focus_node.blur(),this.onBlur()}getScoreFunction(t){return this.sifter.getScoreFunction(t,this.getSearchOptions())}getSearchOptions(){var t=this.settings,e=t.sortField;return"string"==typeof t.sortField&&(e=[{field:t.sortField}]),{fields:t.searchField,conjunction:t.searchConjunction,sort:e,nesting:t.nesting}}search(t){var e,n,i=this,s=this.getSearchOptions();if(i.settings.score&&"function"!=typeof(n=i.settings.score.call(i,t)))throw new Error('Tom Select "score" setting must be a function that returns a function');return t!==i.lastQuery?(i.lastQuery=t,e=i.sifter.search(t,Object.assign(s,{score:n})),i.currentResults=e):e=Object.assign({},i.currentResults),i.settings.hideSelected&&(e.items=e.items.filter((t=>{let e=ys(t.id);return!(e&&-1!==i.items.indexOf(e))}))),e}refreshOptions(t=!0){var e,n,i,s,r,o,a,l,c,u;const d={},h=[];var p=this,m=p.inputValue();const f=m===p.lastQuery||""==m&&null==p.lastQuery;var g=p.search(m),v=null,y=p.settings.shouldOpen||!1,b=p.dropdown_content;f&&(v=p.activeOption)&&(c=v.closest("[data-group]")),s=g.items.length,"number"==typeof p.settings.maxOptions&&(s=Math.min(s,p.settings.maxOptions)),s>0&&(y=!0);const _=(t,e)=>{let n=d[t];if(void 0!==n){let t=h[n];if(void 0!==t)return[n,t.fragment]}let i=document.createDocumentFragment();return n=h.length,h.push({fragment:i,order:e,optgroup:t}),[n,i]};for(e=0;e<s;e++){let t=g.items[e];if(!t)continue;let s=t.id,a=p.options[s];if(void 0===a)continue;let l=bs(s),u=p.getOption(l,!0);for(p.settings.hideSelected||u.classList.toggle("selected",p.items.includes(l)),r=a[p.settings.optgroupField]||"",n=0,i=(o=Array.isArray(r)?r:[r])&&o.length;n<i;n++){r=o[n];let t=a.$order,e=p.optgroups[r];void 0===e?r="":t=e.$order;const[i,l]=_(r,t);n>0&&(u=u.cloneNode(!0),$s(u,{id:a.$id+"-clone-"+n,"aria-selected":null}),u.classList.add("ts-cloned"),Fs(u,"active"),p.activeOption&&p.activeOption.dataset.value==s&&c&&c.dataset.group===r.toString()&&(v=u)),l.appendChild(u),""!=r&&(d[r]=i)}}var w;p.settings.lockOptgroupOrder&&h.sort(((t,e)=>t.order-e.order)),a=document.createDocumentFragment(),Ls(h,(t=>{let e=t.fragment,n=t.optgroup;if(!e||!e.children.length)return;let i=p.optgroups[n];if(void 0!==i){let t=document.createDocumentFragment(),n=p.render("optgroup_header",i);Os(t,n),Os(t,e);let s=p.render("optgroup",{group:i,options:t});Os(a,s)}else Os(a,e)})),b.innerHTML="",Os(b,a),p.settings.highlight&&(w=b.querySelectorAll("span.highlight"),Array.prototype.forEach.call(w,(function(t){var e=t.parentNode;e.replaceChild(t.firstChild,t),e.normalize()})),g.query.length&&g.tokens.length&&Ls(g.tokens,(t=>{Ws(b,t.regex)})));var k=t=>{let e=p.render(t,{input:m});return e&&(y=!0,b.insertBefore(e,b.firstChild)),e};if(p.loading?k("loading"):p.settings.shouldLoad.call(p,m)?0===g.items.length&&k("no_results"):k("not_loading"),(l=p.canCreate(m))&&(u=k("option_create")),p.hasOptions=g.items.length>0||l,y){if(g.items.length>0){if(v||"single"!==p.settings.mode||null==p.items[0]||(v=p.getOption(p.items[0])),!b.contains(v)){let t=0;u&&!p.settings.addPrecedence&&(t=1),v=p.selectable()[t]}}else u&&(v=u);t&&!p.isOpen&&(p.open(),p.scrollToOption(v,"auto")),p.setActiveOption(v)}else p.clearActiveOption(),t&&p.isOpen&&p.close(!1)}selectable(){return this.dropdown_content.querySelectorAll("[data-selectable]")}addOption(t,e=!1){const n=this;if(Array.isArray(t))return n.addOptions(t,e),!1;const i=ys(t[n.settings.valueField]);return null!==i&&!n.options.hasOwnProperty(i)&&(t.$order=t.$order||++n.order,t.$id=n.inputId+"-opt-"+t.$order,n.options[i]=t,n.lastQuery=null,e&&(n.userOptions[i]=e,n.trigger("option_add",i,t)),i)}addOptions(t,e=!1){Ls(t,(t=>{this.addOption(t,e)}))}registerOption(t){return this.addOption(t)}registerOptionGroup(t){var e=ys(t[this.settings.optgroupValueField]);return null!==e&&(t.$order=t.$order||++this.order,this.optgroups[e]=t,e)}addOptionGroup(t,e){var n;e[this.settings.optgroupValueField]=t,(n=this.registerOptionGroup(e))&&this.trigger("optgroup_add",n,e)}removeOptionGroup(t){this.optgroups.hasOwnProperty(t)&&(delete this.optgroups[t],this.clearCache(),this.trigger("optgroup_remove",t))}clearOptionGroups(){this.optgroups={},this.clearCache(),this.trigger("optgroup_clear")}updateOption(t,e){const n=this;var i,s;const r=ys(t),o=ys(e[n.settings.valueField]);if(null===r)return;const a=n.options[r];if(null==a)return;if("string"!=typeof o)throw new Error("Value must be set in option data");const l=n.getOption(r),c=n.getItem(r);if(e.$order=e.$order||a.$order,delete n.options[r],n.uncacheValue(o),n.options[o]=e,l){if(n.dropdown_content.contains(l)){const t=n._render("option",e);Rs(l,t),n.activeOption===l&&n.setActiveOption(t)}l.remove()}c&&(-1!==(s=n.items.indexOf(r))&&n.items.splice(s,1,o),i=n._render("item",e),c.classList.contains("active")&&Ns(i,"active"),Rs(c,i)),n.lastQuery=null}removeOption(t,e){const n=this;t=bs(t),n.uncacheValue(t),delete n.userOptions[t],delete n.options[t],n.lastQuery=null,n.trigger("option_remove",t),n.removeItem(t,e)}clearOptions(t){const e=(t||this.clearFilter).bind(this);this.loadedSearches={},this.userOptions={},this.clearCache();const n={};Ls(this.options,((t,i)=>{e(t,i)&&(n[i]=t)})),this.options=this.sifter.items=n,this.lastQuery=null,this.trigger("option_clear")}clearFilter(t,e){return this.items.indexOf(e)>=0}getOption(t,e=!1){const n=ys(t);if(null===n)return null;const i=this.options[n];if(null!=i){if(i.$div)return i.$div;if(e)return this._render("option",i)}return null}getAdjacent(t,e,n="option"){var i;if(!t)return null;i="item"==n?this.controlChildren():this.dropdown_content.querySelectorAll("[data-selectable]");for(let n=0;n<i.length;n++)if(i[n]==t)return e>0?i[n+1]:i[n-1];return null}getItem(t){if("object"==typeof t)return t;var e=ys(t);return null!==e?this.control.querySelector(`[data-value="${Ss(e)}"]`):null}addItems(t,e){var n=this,i=Array.isArray(t)?t:[t];const s=(i=i.filter((t=>-1===n.items.indexOf(t))))[i.length-1];i.forEach((t=>{n.isPending=t!==s,n.addItem(t,e)}))}addItem(t,e){ks(this,e?[]:["change","dropdown_close"],(()=>{var n,i;const s=this,r=s.settings.mode,o=ys(t);if((!o||-1===s.items.indexOf(o)||("single"===r&&s.close(),"single"!==r&&s.settings.duplicates))&&null!==o&&s.options.hasOwnProperty(o)&&("single"===r&&s.clear(e),"multi"!==r||!s.isFull())){if(n=s._render("item",s.options[o]),s.control.contains(n)&&(n=n.cloneNode(!0)),i=s.isFull(),s.items.splice(s.caretPos,0,o),s.insertAtCaret(n),s.isSetup){if(!s.isPending&&s.settings.hideSelected){let t=s.getOption(o),e=s.getAdjacent(t,1);e&&s.setActiveOption(e)}s.isPending||s.settings.closeAfterSelect||s.refreshOptions(s.isFocused&&"single"!==r),0!=s.settings.closeAfterSelect&&s.isFull()?s.close():s.isPending||s.positionDropdown(),s.trigger("item_add",o,n),s.isPending||s.updateOriginalInput({silent:e})}(!s.isPending||!i&&s.isFull())&&(s.inputState(),s.refreshState())}}))}removeItem(t=null,e){const n=this;if(!(t=n.getItem(t)))return;var i,s;const r=t.dataset.value;i=Vs(t),t.remove(),t.classList.contains("active")&&(s=n.activeItems.indexOf(t),n.activeItems.splice(s,1),Fs(t,"active")),n.items.splice(i,1),n.lastQuery=null,!n.settings.persist&&n.userOptions.hasOwnProperty(r)&&n.removeOption(r,e),i<n.caretPos&&n.setCaret(n.caretPos-1),n.updateOriginalInput({silent:e}),n.refreshState(),n.positionDropdown(),n.trigger("item_remove",r,t)}createItem(t=null,e=(()=>{})){3===arguments.length&&(e=arguments[2]),"function"!=typeof e&&(e=()=>{});var n,i=this,s=i.caretPos;if(t=t||i.inputValue(),!i.canCreate(t))return e(),!1;i.lock();var r=!1,o=t=>{if(i.unlock(),!t||"object"!=typeof t)return e();var n=ys(t[i.settings.valueField]);if("string"!=typeof n)return e();i.setTextboxValue(),i.addOption(t,!0),i.setCaret(s),i.addItem(n),e(t),r=!0};return n="function"==typeof i.settings.create?i.settings.create.call(this,t,o):{[i.settings.labelField]:t,[i.settings.valueField]:t},r||o(n),!0}refreshItems(){var t=this;t.lastQuery=null,t.isSetup&&t.addItems(t.items),t.updateOriginalInput(),t.refreshState()}refreshState(){const t=this;t.refreshValidityState();const e=t.isFull(),n=t.isLocked;t.wrapper.classList.toggle("rtl",t.rtl);const i=t.wrapper.classList;var s;i.toggle("focus",t.isFocused),i.toggle("disabled",t.isDisabled),i.toggle("readonly",t.isReadOnly),i.toggle("required",t.isRequired),i.toggle("invalid",!t.isValid),i.toggle("locked",n),i.toggle("full",e),i.toggle("input-active",t.isFocused&&!t.isInputHidden),i.toggle("dropdown-active",t.isOpen),i.toggle("has-options",(s=t.options,0===Object.keys(s).length)),i.toggle("has-items",t.items.length>0)}refreshValidityState(){var t=this;t.input.validity&&(t.isValid=t.input.validity.valid,t.isInvalid=!t.isValid)}isFull(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems}updateOriginalInput(t={}){const e=this;var n,i;const s=e.input.querySelector('option[value=""]');if(e.is_select_tag){const r=[],o=e.input.querySelectorAll("option:checked").length;function a(t,n,i){return t||(t=Cs('<option value="'+_s(n)+'">'+_s(i)+"</option>")),t!=s&&e.input.append(t),r.push(t),(t!=s||o>0)&&(t.selected=!0),t}e.input.querySelectorAll("option:checked").forEach((t=>{t.selected=!1})),0==e.items.length&&"single"==e.settings.mode?a(s,"",""):e.items.forEach((t=>{if(n=e.options[t],i=n[e.settings.labelField]||"",r.includes(n.$option)){a(e.input.querySelector(`option[value="${Ss(t)}"]:not(:checked)`),t,i)}else n.$option=a(n.$option,t,i)}))}else e.input.value=e.getValue();e.isSetup&&(t.silent||e.trigger("change",e.getValue()))}open(){var t=this;t.isLocked||t.isOpen||"multi"===t.settings.mode&&t.isFull()||(t.isOpen=!0,$s(t.focus_node,{"aria-expanded":"true"}),t.refreshState(),Is(t.dropdown,{visibility:"hidden",display:"block"}),t.positionDropdown(),Is(t.dropdown,{visibility:"visible",display:"block"}),t.focus(),t.trigger("dropdown_open",t.dropdown))}close(t=!0){var e=this,n=e.isOpen;t&&(e.setTextboxValue(),"single"===e.settings.mode&&e.items.length&&e.inputState()),e.isOpen=!1,$s(e.focus_node,{"aria-expanded":"false"}),Is(e.dropdown,{display:"none"}),e.settings.hideSelected&&e.clearActiveOption(),e.refreshState(),n&&e.trigger("dropdown_close",e.dropdown)}positionDropdown(){if("body"===this.settings.dropdownParent){var t=this.control,e=t.getBoundingClientRect(),n=t.offsetHeight+e.top+window.scrollY,i=e.left+window.scrollX;Is(this.dropdown,{width:e.width+"px",top:n+"px",left:i+"px"})}}clear(t){var e=this;if(e.items.length){var n=e.controlChildren();Ls(n,(t=>{e.removeItem(t,!0)})),e.inputState(),t||e.updateOriginalInput(),e.trigger("clear")}}insertAtCaret(t){const e=this,n=e.caretPos,i=e.control;i.insertBefore(t,i.children[n]||null),e.setCaret(n+1)}deleteSelection(t){var e,n,i,s,r,o=this;e=t&&8===t.keyCode?-1:1,n={start:(r=o.control_input).selectionStart||0,length:(r.selectionEnd||0)-(r.selectionStart||0)};const a=[];if(o.activeItems.length)s=Hs(o.activeItems,e),i=Vs(s),e>0&&i++,Ls(o.activeItems,(t=>a.push(t)));else if((o.isFocused||"single"===o.settings.mode)&&o.items.length){const t=o.controlChildren();let i;e<0&&0===n.start&&0===n.length?i=t[o.caretPos-1]:e>0&&n.start===o.inputValue().length&&(i=t[o.caretPos]),void 0!==i&&a.push(i)}if(!o.shouldDelete(a,t))return!1;for(Ts(t,!0),void 0!==i&&o.setCaret(i);a.length;)o.removeItem(a.pop());return o.inputState(),o.positionDropdown(),o.refreshOptions(!1),!0}shouldDelete(t,e){const n=t.map((t=>t.dataset.value));return!(!n.length||"function"==typeof this.settings.onDelete&&!1===this.settings.onDelete(n,e))}advanceSelection(t,e){var n,i,s=this;s.rtl&&(t*=-1),s.inputValue().length||(Es(Bs,e)||Es("shiftKey",e)?(i=(n=s.getLastActive(t))?n.classList.contains("active")?s.getAdjacent(n,t,"item"):n:t>0?s.control_input.nextElementSibling:s.control_input.previousElementSibling)&&(i.classList.contains("active")&&s.removeActiveItem(n),s.setActiveItemClass(i)):s.moveCaret(t))}moveCaret(t){}getLastActive(t){let e=this.control.querySelector(".last-active");if(e)return e;var n=this.control.querySelectorAll(".active");return n?Hs(n,t):void 0}setCaret(t){this.caretPos=this.items.length}controlChildren(){return Array.from(this.control.querySelectorAll("[data-ts-item]"))}lock(){this.setLocked(!0)}unlock(){this.setLocked(!1)}setLocked(t=this.isReadOnly||this.isDisabled){this.isLocked=t,this.refreshState()}disable(){this.setDisabled(!0),this.close()}enable(){this.setDisabled(!1)}setDisabled(t){this.focus_node.tabIndex=t?-1:this.tabIndex,this.isDisabled=t,this.input.disabled=t,this.control_input.disabled=t,this.setLocked()}setReadOnly(t){this.isReadOnly=t,this.input.readOnly=t,this.control_input.readOnly=t,this.setLocked()}destroy(){var t=this,e=t.revertSettings;t.trigger("destroy"),t.off(),t.wrapper.remove(),t.dropdown.remove(),t.input.innerHTML=e.innerHTML,t.input.tabIndex=e.tabIndex,Fs(t.input,"tomselected","ts-hidden-accessible"),t._destroy(),delete t.input.tomselect}render(t,e){var n,i;const s=this;if("function"!=typeof this.settings.render[t])return null;if(!(i=s.settings.render[t].call(this,e,_s)))return null;if(i=Cs(i),"option"===t||"option_create"===t?e[s.settings.disabledField]?$s(i,{"aria-disabled":"true"}):$s(i,{"data-selectable":""}):"optgroup"===t&&(n=e.group[s.settings.optgroupValueField],$s(i,{"data-group":n}),e.group[s.settings.disabledField]&&$s(i,{"data-disabled":""})),"option"===t||"item"===t){const n=bs(e[s.settings.valueField]);$s(i,{"data-value":n}),"item"===t?(Ns(i,s.settings.itemClass),$s(i,{"data-ts-item":""})):(Ns(i,s.settings.optionClass),$s(i,{role:"option",id:e.$id}),e.$div=i,s.options[n]=e)}return i}_render(t,e){const n=this.render(t,e);if(null==n)throw"HTMLElement expected";return n}clearCache(){Ls(this.options,(t=>{t.$div&&(t.$div.remove(),delete t.$div)}))}uncacheValue(t){const e=this.getOption(t);e&&e.remove()}canCreate(t){return this.settings.create&&t.length>0&&this.settings.createFilter.call(this,t)}hook(t,e,n){var i=this,s=i[e];i[e]=function(){var e,r;return"after"===t&&(e=s.apply(i,arguments)),r=n.apply(i,arguments),"instead"===t?r:("before"===t&&(e=s.apply(i,arguments)),e)}}}const Js=t=>"boolean"==typeof t?t?"1":"0":t+"",Ks=(t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())},Gs=t=>"string"==typeof t&&t.indexOf("<")>-1;const Qs=t=>"string"==typeof t&&t.indexOf("<")>-1;const Xs=(t,e,n,i)=>{t.addEventListener(e,n,i)},tr=t=>"string"==typeof t&&t.indexOf("<")>-1,er=(t,e)=>{((t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)})(e,((e,n)=>{null==e?t.removeAttribute(n):t.setAttribute(n,""+e)}))};const nr=t=>"string"==typeof t&&t.indexOf("<")>-1;const ir=t=>{var e=[];return((t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)})(t,(t=>{"string"==typeof t&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))})),e.filter(Boolean)},sr=t=>(Array.isArray(t)||(t=[t]),t);const rr=t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(or(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)},or=t=>"string"==typeof t&&t.indexOf("<")>-1,ar=t=>{var e=[];return((t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)})(t,(t=>{"string"==typeof t&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))})),e.filter(Boolean)},lr=t=>(Array.isArray(t)||(t=[t]),t);const cr=(t,e,n,i)=>{t.addEventListener(e,n,i)};const ur=(t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())},dr=(t,e,n,i)=>{t.addEventListener(e,n,i)},hr=t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(pr(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)},pr=t=>"string"==typeof t&&t.indexOf("<")>-1;const mr=t=>{var e=[];return((t,e)=>{if(Array.isArray(t))t.forEach(e);else for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)})(t,(t=>{"string"==typeof t&&(t=t.trim().split(/[\t\n\f\r\s]/)),Array.isArray(t)&&(e=e.concat(t))})),e.filter(Boolean)},fr=t=>(Array.isArray(t)||(t=[t]),t);Zs.define("change_listener",(function(){var t,e,n,i;t=this.input,e="change",n=()=>{this.sync()},t.addEventListener(e,n,i)})),Zs.define("checkbox_options",(function(t){var e=this,n=e.onOptionSelect;e.settings.hideSelected=!1;const i=Object.assign({className:"tomselect-checkbox",checkedClassNames:void 0,uncheckedClassNames:void 0},t);var s=function(t,e){e?(t.checked=!0,i.uncheckedClassNames&&t.classList.remove(...i.uncheckedClassNames),i.checkedClassNames&&t.classList.add(...i.checkedClassNames)):(t.checked=!1,i.checkedClassNames&&t.classList.remove(...i.checkedClassNames),i.uncheckedClassNames&&t.classList.add(...i.uncheckedClassNames))},r=function(t){setTimeout((()=>{var e=t.querySelector("input."+i.className);e instanceof HTMLInputElement&&s(e,t.classList.contains("selected"))}),1)};e.hook("after","setupTemplates",(()=>{var t=e.settings.render.option;e.settings.render.option=(n,r)=>{var o=(t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(Gs(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)})(t.call(e,n,r)),a=document.createElement("input");i.className&&a.classList.add(i.className),a.addEventListener("click",(function(t){Ks(t)})),a.type="checkbox";const l=null==(c=n[e.settings.valueField])?null:Js(c);var c;return s(a,!!(l&&e.items.indexOf(l)>-1)),o.prepend(a),o}})),e.on("item_remove",(t=>{var n=e.getOption(t);n&&(n.classList.remove("selected"),r(n))})),e.on("item_add",(t=>{var n=e.getOption(t);n&&r(n)})),e.hook("instead","onOptionSelect",((t,i)=>{if(i.classList.contains("selected"))return i.classList.remove("selected"),e.removeItem(i.dataset.value),e.refreshOptions(),void Ks(t,!0);n.call(e,t,i),r(i)}))})),Zs.define("clear_button",(function(t){const e=this,n=Object.assign({className:"clear-button",title:"Clear All",html:t=>`<div class="${t.className}" title="${t.title}">⨯</div>`},t);e.on("initialize",(()=>{var t=(t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(Qs(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)})(n.html(n));t.addEventListener("click",(t=>{e.isLocked||(e.clear(),"single"===e.settings.mode&&e.settings.allowEmptyOption&&e.addItem(""),t.preventDefault(),t.stopPropagation())})),e.control.appendChild(t)}))})),Zs.define("drag_drop",(function(){var t=this;if("multi"!==t.settings.mode)return;var e=t.lock,n=t.unlock;let i,s=!0;t.hook("after","setupTemplates",(()=>{var e=t.settings.render.item;t.settings.render.item=(n,r)=>{const o=(t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(tr(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)})(e.call(t,n,r));er(o,{draggable:"true"});const a=t=>{t.preventDefault(),o.classList.add("ts-drag-over"),l(o,i)},l=(t,e)=>{var n,i,s;void 0!==e&&(((t,e)=>{do{var n;if(t==(e=null==(n=e)?void 0:n.previousElementSibling))return!0}while(e&&e.previousElementSibling);return!1})(e,o)?(i=e,null==(s=(n=t).parentNode)||s.insertBefore(i,n.nextSibling)):((t,e)=>{var n;null==(n=t.parentNode)||n.insertBefore(e,t)})(t,e))};return Xs(o,"mousedown",(t=>{s||((t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())})(t),t.stopPropagation()})),Xs(o,"dragstart",(t=>{i=o,setTimeout((()=>{o.classList.add("ts-dragging")}),0)})),Xs(o,"dragenter",a),Xs(o,"dragover",a),Xs(o,"dragleave",(()=>{o.classList.remove("ts-drag-over")})),Xs(o,"dragend",(()=>{var e;document.querySelectorAll(".ts-drag-over").forEach((t=>t.classList.remove("ts-drag-over"))),null==(e=i)||e.classList.remove("ts-dragging"),i=void 0;var n=[];t.control.querySelectorAll("[data-value]").forEach((t=>{if(t.dataset.value){let e=t.dataset.value;e&&n.push(e)}})),t.setValue(n)})),o}})),t.hook("instead","lock",(()=>(s=!1,e.call(t)))),t.hook("instead","unlock",(()=>(s=!0,n.call(t))))})),Zs.define("dropdown_header",(function(t){const e=this,n=Object.assign({title:"Untitled",headerClass:"dropdown-header",titleRowClass:"dropdown-header-title",labelClass:"dropdown-header-label",closeClass:"dropdown-header-close",html:t=>'<div class="'+t.headerClass+'"><div class="'+t.titleRowClass+'"><span class="'+t.labelClass+'">'+t.title+'</span><a class="'+t.closeClass+'">×</a></div></div>'},t);e.on("initialize",(()=>{var t=(t=>{if(t.jquery)return t[0];if(t instanceof HTMLElement)return t;if(nr(t)){var e=document.createElement("template");return e.innerHTML=t.trim(),e.content.firstChild}return document.querySelector(t)})(n.html(n)),i=t.querySelector("."+n.closeClass);i&&i.addEventListener("click",(t=>{((t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())})(t,!0),e.close()})),e.dropdown.insertBefore(t,e.dropdown.firstChild)}))})),Zs.define("caret_position",(function(){var t=this;t.hook("instead","setCaret",(e=>{"single"!==t.settings.mode&&t.control.contains(t.control_input)?(e=Math.max(0,Math.min(t.items.length,e)))==t.caretPos||t.isPending||t.controlChildren().forEach(((n,i)=>{i<e?t.control_input.insertAdjacentElement("beforebegin",n):t.control.appendChild(n)})):e=t.items.length,t.caretPos=e})),t.hook("instead","moveCaret",(e=>{if(!t.isFocused)return;const n=t.getLastActive(e);if(n){const i=((t,e)=>{if(!t)return-1;e=e||t.nodeName;for(var n=0;t=t.previousElementSibling;)t.matches(e)&&n++;return n})(n);t.setCaret(e>0?i+1:i),t.setActiveItem(),((t,...e)=>{var n=ir(e);(t=sr(t)).map((t=>{n.map((e=>{t.classList.remove(e)}))}))})(n,"last-active")}else t.setCaret(t.caretPos+e)}))})),Zs.define("dropdown_input",(function(){const t=this;t.settings.shouldOpen=!0,t.hook("before","setup",(()=>{t.focus_node=t.control,((t,...e)=>{var n=ar(e);(t=lr(t)).map((t=>{n.map((e=>{t.classList.add(e)}))}))})(t.control_input,"dropdown-input");const e=rr('<div class="dropdown-input-wrap">');e.append(t.control_input),t.dropdown.insertBefore(e,t.dropdown.firstChild);const n=rr('<input class="items-placeholder" tabindex="-1" />');n.placeholder=t.settings.placeholder||"",t.control.append(n)})),t.on("initialize",(()=>{t.control_input.addEventListener("keydown",(e=>{switch(e.keyCode){case 27:return t.isOpen&&(((t,e=!1)=>{t&&(t.preventDefault(),e&&t.stopPropagation())})(e,!0),t.close()),void t.clearActiveItems();case 9:t.focus_node.tabIndex=-1}return t.onKeyDown.call(t,e)})),t.on("blur",(()=>{t.focus_node.tabIndex=t.isDisabled?-1:t.tabIndex})),t.on("dropdown_open",(()=>{t.control_input.focus()}));const e=t.onBlur;var n,i,s,r;t.hook("instead","onBlur",(n=>{if(!n||n.relatedTarget!=t.control_input)return e.call(t)})),n=t.control_input,i="blur",s=()=>t.onBlur(),n.addEventListener(i,s,r),t.hook("before","close",(()=>{t.isOpen&&t.focus_node.focus({preventScroll:!0})}))}))})),Zs.define("input_autogrow",(function(){var t=this;t.on("initialize",(()=>{var e=document.createElement("span"),n=t.control_input;e.style.cssText="position:absolute; top:-99999px; left:-99999px; width:auto; padding:0; white-space:pre; ",t.wrapper.appendChild(e);for(const t of["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"])e.style[t]=n.style[t];var i=()=>{e.textContent=n.value,n.style.width=e.clientWidth+"px"};i(),t.on("update item_add item_remove",i),cr(n,"input",i),cr(n,"keyup",i),cr(n,"blur",i),cr(n,"update",i)}))})),Zs.define("no_backspace_delete",(function(){var t=this,e=t.deleteSelection;this.hook("instead","deleteSelection",(n=>!!t.activeItems.length&&e.call(t,n)))})),Zs.define("no_active_items",(function(){this.hook("instead","setActiveItem",(()=>{})),this.hook("instead","selectAll",(()=>{}))})),Zs.define("optgroup_columns",(function(){var t=this,e=t.onKeyDown;t.hook("instead","onKeyDown",(n=>{var i,s,r,o;if(!t.isOpen||37!==n.keyCode&&39!==n.keyCode)return e.call(t,n);t.ignoreHover=!0,o=((t,e,n)=>{for(;t&&t.matches;){if(t.matches(e))return t;t=t.parentNode}})(t.activeOption,"[data-group]"),i=((t,e)=>{if(!t)return-1;e=e||t.nodeName;for(var n=0;t=t.previousElementSibling;)t.matches(e)&&n++;return n})(t.activeOption,"[data-selectable]"),o&&(o=37===n.keyCode?o.previousSibling:o.nextSibling)&&(s=(r=o.querySelectorAll("[data-selectable]"))[Math.min(r.length-1,i)])&&t.setActiveOption(s)}))})),Zs.define("remove_button",(function(t){const e=Object.assign({label:"×",title:"Remove",className:"remove",append:!0},t);var n=this;if(e.append){var i='<a href="javascript:void(0)" class="'+e.className+'" tabindex="-1" title="'+((e.title+"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")+'">')+e.label+"</a>";n.hook("after","setupTemplates",(()=>{var t=n.settings.render.item;n.settings.render.item=(e,s)=>{var r=hr(t.call(n,e,s)),o=hr(i);return r.appendChild(o),dr(o,"mousedown",(t=>{ur(t,!0)})),dr(o,"click",(t=>{n.isLocked||(ur(t,!0),n.isLocked||n.shouldDelete([r],t)&&(n.removeItem(r),n.refreshOptions(!1),n.inputState()))})),r}}))}})),Zs.define("restore_on_backspace",(function(t){const e=this,n=Object.assign({text:t=>t[e.settings.labelField]},t);e.on("item_remove",(function(t){if(e.isFocused&&""===e.control_input.value.trim()){var i=e.options[t];i&&e.setTextboxValue(n.text.call(e,i))}}))})),Zs.define("virtual_scroll",(function(){const t=this,e=t.canLoad,n=t.clearActiveOption,i=t.loadCallback;var s,r,o={},a=!1,l=[];if(t.settings.shouldLoadMore||(t.settings.shouldLoadMore=()=>{if(s.clientHeight/(s.scrollHeight-s.scrollTop)>.9)return!0;if(t.activeOption){var e=t.selectable();if(Array.from(e).indexOf(t.activeOption)>=e.length-2)return!0}return!1}),!t.settings.firstUrl)throw"virtual_scroll plugin requires a firstUrl() method";t.settings.sortField=[{field:"$order"},{field:"$score"}];const c=e=>!("number"==typeof t.settings.maxOptions&&s.children.length>=t.settings.maxOptions)&&!(!(e in o)||!o[e]),u=(e,n)=>t.items.indexOf(n)>=0||l.indexOf(n)>=0;t.setNextUrl=(t,e)=>{o[t]=e},t.getUrl=e=>{if(e in o){const t=o[e];return o[e]=!1,t}return t.clearPagination(),t.settings.firstUrl.call(t,e)},t.clearPagination=()=>{o={}},t.hook("instead","clearActiveOption",(()=>{if(!a)return n.call(t)})),t.hook("instead","canLoad",(n=>n in o?c(n):e.call(t,n))),t.hook("instead","loadCallback",((e,n)=>{if(a){if(r){const n=e[0];void 0!==n&&(r.dataset.value=n[t.settings.valueField])}}else t.clearOptions(u);i.call(t,e,n),a=!1})),t.hook("after","refreshOptions",(()=>{const e=t.lastValue;var n;c(e)?(n=t.render("loading_more",{query:e}))&&(n.setAttribute("data-selectable",""),r=n):e in o&&!s.querySelector(".no-results")&&(n=t.render("no_more_results",{query:e})),n&&(((t,...e)=>{var n=mr(e);(t=fr(t)).map((t=>{n.map((e=>{t.classList.add(e)}))}))})(n,t.settings.optionClass),s.append(n))})),t.on("initialize",(()=>{l=Object.keys(t.options),s=t.dropdown_content,t.settings.render=Object.assign({},{loading_more:()=>'<div class="loading-more-results">Loading more results ... </div>',no_more_results:()=>'<div class="no-more-results">No more results</div>'},t.settings.render),s.addEventListener("scroll",(()=>{t.settings.shouldLoadMore.call(t)&&c(t.lastValue)&&(a||(a=!0,t.load.call(t,t.lastValue)))}))}))}));var gr=Zs;class vr extends Ei{getRenderer(t){let e={option_create:(t,e)=>{const n=e(t.input);if(n.length<3)return null;return'<div class="create">'+this.translate("select.search.create").replace("%input%","<strong>"+n+"</strong>")+"</div>"},no_results:(t,e)=>'<div class="no-results">'+this.translate("select.search.notfound").replace("%input%","<strong>"+e(t.input)+"</strong>")+"</div>"};return e="color"===t?{...e,option:function(t,e){let n='<div class="list-group-item border-0 p-1 ps-2 text-nowrap">';return void 0!==t.color&&(n+='<span style="background-color:'+t.color+'" class="color-choice-item me-2"> </span>'),n+=e(t.text)+"</div>",n},item:function(t,e){let n='<div class="text-nowrap">';return void 0!==t.color&&(n+='<span style="background-color:'+t.color+'" class="color-choice-item me-2"> </span>'),n+=e(t.text)+"</div>",n}}:{...e,option:function(t,e){let n=t.text;return n=null===n||""===n.trim()?" ":e(n),"<div>"+n+"</div>"}},e}}class yr extends vr{init(){this.selector='[data-form-widget="autocomplete"]'}supportsForm(t){return!0}loadData(t,e,n){this.getContainer().getPlugin("api").get(t,{name:e},(t=>{let e=[];for(let n of t)e.push({text:n.name,value:n.name});n(e)}),(()=>{n()}))}activateForm(t){[].slice.call(t.querySelectorAll(this.selector)).map((t=>{const e=t.dataset.autocompleteUrl;let n=3;void 0!==t.dataset.minimumCharacter&&(n=parseInt(t.dataset.minimumCharacter));let i={onItemAdd:function(){this.setTextboxValue("")},maxOptions:500,create:void 0!==t.dataset.create,onOptionAdd:e=>{t.dispatchEvent(new CustomEvent("create",{detail:{value:e}}))},plugins:["remove_button"],shouldLoad:function(t){return t.length>=n},load:(t,n)=>{this.loadData(e,t,n)}};const s=void 0!==t.dataset.renderer?t.dataset.renderer:"default";i.render={not_loading:(t,e)=>{},...this.getRenderer(s)},new gr(t,i)}))}destroyForm(t){[].slice.call(t.querySelectorAll(this.selector)).map((t=>{t.tomselect&&t.tomselect.destroy()}))}}class br extends vr{constructor(t,e){super(),this._selector=t,this._apiSelects=e}getId(){return"form-select"}init(){document.addEventListener("reset",(t=>{"FORM"===t.target.tagName.toUpperCase()&&setTimeout((()=>{const e=t.target.querySelectorAll(this._selector);for(let t of e)"SELECT"===t.tagName.toUpperCase()&&t.dispatchEvent(new Event("data-reloaded"))}),10)}))}activateSelectPickerByElement(t){let e=["change_listener"];const n=void 0!==t.multiple&&!0===t.multiple,i=void 0!==t.required&&!0===t.required;i&&e.push("no_backspace_delete"),n&&e.push("remove_button");let s={onItemAdd:function(){this.setTextboxValue("")},lockOptgroupOrder:!0,allowEmptyOption:!i,hidePlaceholder:!1,plugins:e,maxOptions:500,sortField:[{field:"$order"},{field:"$score"}]},r={onOptionAdd:e=>{t.dispatchEvent(new CustomEvent("create",{detail:{value:e}}))}};const o=void 0!==t.dataset.renderer?t.dataset.renderer:"default";s.render={...r,...this.getRenderer(o)},s=void 0!==t.dataset.create?{...s,persist:!0,create:!0}:{...s,persist:!1,create:!1},void 0!==t.dataset.disableSearch&&(s={...s,controlInput:null});const a=new gr(t,s);t.addEventListener("data-reloaded",(t=>{a.clear(!0),a.clearOptionGroups(),a.clearOptions(),a.sync(),a.setValue(t.detail),a.refreshItems(),a.refreshOptions(!1)})),void 0!==t.dataset.reload&&t.addEventListener("reload",(()=>{a.disable(),t.disabled=!0;this.getContainer().getPlugin("api").get(t.dataset.reload,{},(e=>{this._updateSelect(t,e),a.enable(),t.disabled=!1})),t.dispatchEvent(new Event("change"))}))}supportsForm(t){return!0}activateForm(t){[].slice.call(t.querySelectorAll(this._selector)).map((t=>{this.activateSelectPickerByElement(t)})),this._activateApiSelects(this._apiSelects)}destroyForm(t){[].slice.call(t.querySelectorAll(this._selector)).map((t=>{t.tomselect&&t.tomselect.destroy()}))}_updateOptions(t,e){let n=null,i=null;if(i=t instanceof Element?t:document.querySelector(t),null===i)return void console.log("Missing select: "+t);const s=i.value;for(let t=0;t<i.options.length;t++)""===i.options[t].value&&(n=i.options[t]);i.options.length=0,null!==n&&i.appendChild(this._createOption(n.text,""));let r=[],o=[],a=null;void 0!==i.dataset&&void 0!==i.dataset.optionPattern&&(a=i.dataset.optionPattern),null!==a&&""!==a||(a="{name}");for(const[t,n]of Object.entries(e)){if("__empty__"===t){for(const t of n)r.push(this._createOption(this._getTitleFromPattern(a,t),t.id));continue}let e=this._createOptgroup(t);for(const t of n)e.appendChild(this._createOption(this._getTitleFromPattern(a,t),t.id));o.push(e)}o.forEach((t=>i.appendChild(t)));const l=this._createOptgroup("");if(r.forEach((t=>l.appendChild(t))),i.appendChild(l),i.value=s,""===i.value||null===i.value){const t=i.options,e=t.length;let s="";1===e&&void 0===i.dataset.autoselect?s=t[0].value:2===e&&null!==n&&(s=t[1].value),""!==s&&(i.value=s)}i.dispatchEvent(new CustomEvent("data-reloaded",{detail:i.value})),i.dispatchEvent(new Event("change"))}_getTitleFromPattern(t,e){const n=this.getDateUtils(),i=new RegExp("{[^}]*?}","g");let s=t,r=null;for(;null!==(r=i.exec(t));){const t=r[0].slice(1,-1);let i=void 0===e[t]?null:e[t];"start"!==t&&"end"!==t||(i=null===i?"?":n.getFormattedDate(i)),s=s.replace(new RegExp("{"+t+"}","g"),i??"")}s=s.replace(/- \?-\?/,""),s=s.replace(/\r\n|\r|\n/g," "),s=s.substring(0,110);let o=0,a=s.length;for(;o<a&&"- ".indexOf(s[o])>=0;)++o;for(;a>o&&"- ".indexOf(s[a-1])>=0;)--a;let l=o>0||a<s.length?s.substring(o,a):s;return""===l&&void 0!==e.name?e.name:l}addOption(t,e,n,i){const s=this._createOption(e,n);for(const t in i)s.dataset[t]=i[t];t.options.add(s),void 0!==t.tomselect&&t.tomselect.sync()}removeOption(t,e){e.remove(),void 0!==t.tomselect&&(t.tomselect.removeOption(e.value,!0),t.tomselect.clear(!0))}_createOption(t,e){let n=document.createElement("option");return n.innerText=t,n.value=e,n}_createOptgroup(t){let e=document.createElement("optgroup");return e.label=t,e}_activateApiSelects(t){void 0===this._eventHandlerApiSelects&&(this._eventHandlerApiSelects=e=>{if(null===e.target||!e.target.matches(t))return;const n=e.target,i="#"+n.dataset.relatedSelect,s=document.getElementById(n.dataset.relatedSelect);if(null===s||"1"===s.dataset.reloading)return;s.dataset.reloading="1",void 0!==s.tomselect&&s.tomselect.disable(),s.disabled=!0;let r=n.dataset.formPrefix;null==r?r="":r.length>0&&(r+="_");let o=this._buildUrlWithFormFields(n.dataset.apiUrl,r);const a=n.value;if(null==a||""===a||Array.isArray(a)&&0===a.length){if(void 0===n.dataset.emptyUrl)return this._updateSelect(i,{}),void(s.dataset.reloading="0");o=this._buildUrlWithFormFields(n.dataset.emptyUrl,r)}this.getContainer().getPlugin("api").get(o,{},(t=>{this._updateSelect(i,t),void 0!==s.tomselect&&s.tomselect.enable(),s.dataset.reloading="0",s.disabled=!1}))},document.addEventListener("change",this._eventHandlerApiSelects))}_buildUrlWithFormFields(t,e){let n=t;return t.split("?")[1].split("&").forEach((t=>{const[i,s]=t.split("="),r=decodeURIComponent(s).match(/%(.*)%/);if(null!==r){const i=r[1],o=(e+i).replace(/\[/,"").replace(/]/,""),a=document.getElementById(o);let l="";if(null===a);else if(null!==a.value)if(l=a.value,"SELECT"===a.tagName&&a.multiple)l=[...a.selectedOptions].map((t=>t.value));else if(""!==l)if("date"===a.type){const t=a.id.replace("_date","_time"),e=document.getElementById(t),n=null===e?"12:00:00":e.value,i=this.getDateUtils().fromHtml5Input(l,n);l=this.getDateUtils().formatForAPI(i,!1)}else if("text"===a.type&&a.name.includes("date")){const t=a.id.replace("_date","_time"),e=document.getElementById(t);let n="12:00:00",i="HH:mm";null!==e&&(n=e.value,i=e.dataset.format);const s=this.getDateUtils().fromFormat(l.trim()+" "+n.trim(),a.dataset.format+" "+i);l=this.getDateUtils().formatForAPI(s,!1)}else void 0!==a.dataset.format&&this.getDateUtils().isValidDateTime(l,a.dataset.format)&&(l=this.getDateUtils().format(a.dataset.format,l));if(Array.isArray(l)){let e=[];for(let t of l)null===t&&(t=""),e.push(i+"="+t);n=n.replace(t,e.join("&"))}else null===l&&(l=""),n=n.replace(s,l)}})),n}_updateSelect(t,e){const n={};for(const t of e){let e="__empty__";void 0!==t.parentTitle&&null!==t.parentTitle&&(e=t.parentTitle),void 0===n[e]&&(n[e]=[]),n[e].push(t)}const i={};Object.keys(n).sort().forEach((function(t){i[t]=n[t]})),this._updateOptions(t,i)}}class _r extends bi{getId(){return"form"}activateForm(t){[].slice.call(document.querySelectorAll(t)).map((t=>{for(const e of this.getContainer().getPlugins())e instanceof Ei&&e.supportsForm(t)&&e.activateForm(t)}))}destroyForm(t){[].slice.call(document.querySelectorAll(t)).map((t=>{for(const e of this.getContainer().getPlugins())e instanceof Ei&&e.supportsForm(t)&&e.destroyForm(t)}))}convertFormDataToQueryString(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[],s=new FormData(t);for(const t in e)s.set(t,e[t]);for(let t of s)n&&""===t[1]||i.push(encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]));return i.join("&")}}class wr extends bi{constructor(t){super(),this._selector=t}init(){document.addEventListener("click",(t=>{let e=t.target;for(;null!==e&&"function"==typeof e.matches&&!e.matches("body");){if(e.classList.contains(this._selector)){const n=e.dataset;let i=n.href;i||(i=e.getAttribute("href"));let s=null;"submit"===e.type&&void 0!==e.form&&(s=e.form),void 0!==n.question&&this.getContainer().getPlugin("alert").question(n.question,(function(t){t&&(null===s?document.location=i:(null!==i&&(s.action=i),s.submit()))})),t.preventDefault(),t.stopPropagation()}e=e.parentNode}}))}}class kr extends bi{init(){if(0===document.getElementsByClassName("multi_update_all").length)return;const t=document.querySelector("div.page-body");t.addEventListener("change",(t=>{if(t.target.matches(".multi_update_all")){const e=t.target.checked,n=t.target.closest("table");for(const t of n.querySelectorAll(".multi_update_single"))t.checked=e;this._toggleForm(n),t.stopPropagation()}else t.target.matches(".multi_update_single")&&(this._toggleForm(t.target.closest("table")),t.stopPropagation())})),t.addEventListener("click",(t=>{if(t.target.matches(".multi_update_table_action")){const e=t.target,n=e.form,i=n.querySelector(".multi_update_ids").value.split(","),s=n.dataset.question.replace(/%action%/,e.textContent).replace(/%count%/,i.length.toString());this.getPlugin("alert").question(s,(function(t){t&&(n.action=e.dataset.href,n.submit())}))}}))}_toggleForm(t){const e=t.closest("div.card.data_table");let n=[];for(const e of t.querySelectorAll("input.multi_update_single:checked"))n.push(e.value);if(e.querySelector(".multi_update_ids").value=n.join(","),n.length>0){for(const t of e.querySelectorAll(".multi_update_form_hide"))t.style.setProperty("display","none","important");e.querySelector("form.multi_update_form").style.display=null}else{e.querySelector("form.multi_update_form").style.setProperty("display","none","important");for(const t of e.querySelectorAll(".multi_update_form_hide"))t.style.display=null}}}class Tr extends bi{getId(){return"date"}init(){this.getConfigurations().is24Hours()?this.timeFormat="HH:mm":this.timeFormat="hh:mm a",this.durationFormat=this.getConfiguration("formatDuration"),this.dateFormat=this.getConfiguration("formatDate")}_parseFormat(t){return t=(t=(t=(t=(t=(t=(t=t.replace("DD","dd")).replace("D","d")).replace("MM","LL")).replace("M","L")).replace("YYYY","yyyy")).replace("YY","yy")).replace("A","a")}format(t,e){let n=null;return n=null==e?fi.now():e instanceof Date?fi.fromJSDate(e):fi.fromISO(e),n.toFormat(this._parseFormat(t),{locale:"en-us"})}getFormattedDate(t){return this.format(this._parseFormat(this.dateFormat),t)}formatForAPI(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t instanceof Date&&(t=fi.fromJSDate(t)),void 0!==e&&e||(t=t.toUTC()),t.toISO({includeOffset:!1,suppressMilliseconds:!0})}fromFormat(t,e){return fi.fromFormat(t,this._parseFormat(e),{locale:"en-us"})}fromHtml5Input(t,e){return e=e??"",""===(t=t??"")&&""===e?fi.invalid("Empty date and time given"):(""!==t&&""!==e&&(t=t+"T"+e),fi.fromISO(t))}isValidDateTime(t,e){return this.fromFormat(t,e).isValid}addHumanDuration(t,e){let n=null;if(t instanceof Date)n=fi.fromJSDate(t);else{if(!(t instanceof fi))throw"addHumanDuration() needs a JS Date";n=t}const i=fi.fromISO(e),s=fi.now().startOf("day"),r=i.diff(s);return n.plus(r).toJSDate()}formatDuration(t){let e=null;return e="string"==typeof t?fi.now().diff(fi.fromISO(t)):Tn.fromISO("PT"+(null===t?0:t)+"S"),this.formatLuxonDuration(e)}formatSeconds(t){return this.formatLuxonDuration(Tn.fromObject({seconds:t}))}formatLuxonDuration(t){return t=t.shiftTo("hours","minutes","seconds"),this.formatAsDuration(t.hours,t.minutes)}formatTime(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=fi.fromJSDate(t);return void 0!==e&&e||(n=n.toUTC()),n.toFormat(this.timeFormat)}formatAsDuration(t,e){let n=this.durationFormat;return(t<0||e<0)&&(t=Math.abs(t),e=Math.abs(e),n="-"+n),n.replace("%h",t.toString()).replace("%m",("0"+e).slice(-2))}getSecondsFromDurationString(t){const e=this.parseDuration(t);return null!==e&&e.isValid?e.as("seconds"):0}parseDuration(t){if(null==t||""===t)return new Tn({seconds:0});let e=null;if(-1!==(t=t.trim().toUpperCase()).indexOf(":")){const[,n,i,s]=t.match(/(\d+):(\d+)(?::(\d+))*/);e=Tn.fromObject({hours:n,minutes:i,seconds:s})}else if(-1!==t.indexOf(".")||-1!==t.indexOf(","))t=t.replace(/,/,"."),t=(3600*parseFloat(t)).toString(),e=Tn.fromISO("PT"+t+"S");else if(-1!==t.indexOf("H")||-1!==t.indexOf("M")||-1!==t.indexOf("S"))e=Tn.fromISO("PT"+t);else{let n=parseInt(t);const i=parseInt(t).toFixed();isNaN(n)||t!==i||(t=(3600*n).toString(),e=Tn.fromISO("PT"+t+"S"))}return null!==e&&e.isValid?"-"===t[0]&&e.valueOf()>0?e.negate():e:new Tn({seconds:0})}}class xr extends bi{getId(){return"escape"}escapeForHtml(t){if(null==t)return"";const e={"&":"&","<":"<",">":">"};return t.replace(/[&<>]/g,(function(t){return e[t]||t}))}}class Er extends bi{getId(){return"fetch"}fetch(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return void 0===e.headers&&(e.headers=new Headers),e.headers.append("X-Requested-With","Kimai"),e={redirect:"follow",...e},new Promise(((n,i)=>{fetch(t,e).then((t=>{if(t.ok)return 201===t.status&&t.headers.has("x-modal-redirect")?void(window.location=t.headers.get("x-modal-redirect")):void n(t);let e=!1;if(403===t.status){if(t.headers.has("login-required")){const t=this.getConfiguration("login").toString();this.getContainer().getPlugin("alert").question(this.translate("login.required"),(e=>{!0===e&&window.location.replace(t)})),e=!0}}else console.log("Some error occurred");e||i(t)})).catch((t=>{console.log("Error occurred while talking to Kimai backend",t),i(t)}))}))}}class Dr extends Ei{supportsForm(t){return"timesheet_edit_form"===t.name||"timesheet_admin_edit_form"===t.name||"timesheet_multi_user_edit_form"===t.name}destroyForm(t){this.supportsForm(t)&&(void 0!==this._beginDate&&(this._beginDate.removeEventListener("change",this._beginListener),delete this._beginListener,delete this._beginDate),void 0!==this._beginTime&&(this._beginTime.removeEventListener("change",this._beginListener),delete this._beginTime),void 0!==this._endTime&&(this._endTime.removeEventListener("change",this._endListener),delete this._endTime),void 0!==this._duration&&(this._duration.removeEventListener("change",this._durationListener),delete this._durationListener,delete this._duration),void 0!==this._durationToggle&&null!==this._durationToggle&&(this._durationToggle.removeEventListener("change",this._durationToggleListener),delete this._durationToggleListener,delete this._durationToggle),void 0!==this._activity&&(this._activity.removeEventListener("create",this._activityListener),delete this._activityListener,delete this._activity),void 0!==this._project&&delete this._project)}activateForm(t){if(!this.supportsForm(t))return;const e=t.name;this._activity=document.getElementById(e+"_activity"),this._project=document.getElementById(e+"_project"),this._activityListener=t=>{const e=this._project.value;this.getContainer().getPlugin("api").post(this._activity.dataset.create,{name:t.detail.value,project:""===e?null:e,visible:!0},(()=>{this._project.dispatchEvent(new Event("change"))}))},this._activity.addEventListener("create",this._activityListener),this._beginDate=document.getElementById(e+"_begin_date"),this._beginTime=document.getElementById(e+"_begin_time"),this._endTime=document.getElementById(e+"_end_time"),this._duration=document.getElementById(e+"_duration"),this._durationToggle=document.getElementById(e+"_duration_toggle"),null!==this._beginDate&&null!==this._beginTime&&null!==this._endTime&&null!==this._duration&&(this._beginListener=()=>this._changedBegin(),this._endListener=()=>this._changedEnd(),this._durationListener=()=>this._changedDuration(),this._beginDate.addEventListener("change",this._beginListener),this._beginTime.addEventListener("change",this._beginListener),this._endTime.addEventListener("change",this._endListener),this._duration.addEventListener("change",this._durationListener),null!==this._duration&&null!==this._durationToggle&&(this._durationToggleListener=()=>{this._durationToggle.classList.toggle("text-success")},this._durationToggle.addEventListener("click",this._durationToggleListener)))}_isDurationConnected(){return(null!==this._duration||null!==this._durationToggle)&&(null===this._durationToggle||this._durationToggle.classList.contains("text-success"))}_getBegin(){if(""===this._beginDate.value||""===this._beginTime.value)return null;let t=this._parseBegin(this._beginTime.dataset.format);return t.invalid&&(t=this._parseBegin(this._fixTimeFormat(this._beginTime.dataset.format)),t.invalid)?null:t}_parseBegin(t){return this.getDateUtils().fromFormat(this._beginDate.value+" "+this._beginTime.value,this._beginDate.dataset.format+" "+t)}_parseEnd(t,e){let n=this.getDateUtils().fromFormat(t.toFormat("yyyy-LL-dd")+" "+this._endTime.value,"yyyy-LL-dd "+e);return n.invalid&&(n=this.getDateUtils().fromFormat(t.toFormat("yyyy-LL-dd")+" "+this._endTime.value,"yyyy-LL-dd "+this._fixTimeFormat(e))),n}_fixTimeFormat(t){return t.replace("HH","H").replace("hh","h")}_getEnd(){if(""===this._endTime.value)return null;let t=this._parseEnd(fi.now(),this._endTime.dataset.format);const e=this._getBegin();return null!==e&&(t=this._parseEnd(e,this._endTime.dataset.format),t<e&&(t=t.plus({days:1}))),t.invalid?null:t}_changedBegin(){const t=this._getBegin();if(null===t)return;const e=this._getParsedDuration(),n=e.as("seconds")>0;null===this._getEnd()&&n?this._applyDateToField(t.plus(e),null,this._endTime):this._updateDuration()}_changedEnd(){const t=this._getEnd();if(null===t)return;const e=this._getParsedDuration(),n=e.as("seconds")>0;null===this._getBegin()&&n?this._applyDateToField(t.minus(e),this._beginDate,this._beginTime):this._updateDuration()}_updateDuration(){const t=this._getBegin(),e=this._getEnd();let n=null;null!==t&&null!==e&&(n=e.diff(t)),this._setDurationAsString(n)}_changedDuration(){if(!this._isDurationConnected())return;const t=this._getParsedDuration();if(!t.isValid)return void this._setDurationAsString(null);const e=this._getBegin();let n=this._getEnd();const i=t.as("seconds");if(i<0&&(n=null),null===e&&null===n){const t=fi.now();this._applyDateToField(t,this._beginDate,this._beginTime),this._applyDateToField(t.plus({seconds:i}),null,this._endTime)}else null===e&&null!==n?this._applyDateToField(n.minus({seconds:i}),this._beginDate,this._beginTime):null!==e&&i>=0&&this._applyDateToField(e.plus({seconds:i}),null,this._endTime)}_setDurationAsString(t){if(!this._isDurationConnected())return;if(null===t)return void(this._duration.value="");if(!t.isValid)return;const e=t.as("seconds");if(e<0)return void(this._duration.value="");const n=Math.floor(e/3600);let i=Math.floor((e-3600*n)/60);i<10&&(i="0"+i),this._duration.value=n+":"+i}_getParsedDuration(){return this.getDateUtils().parseDuration(this._duration.value.toUpperCase())}_applyDateToField(t,e,n){if(null===t||t.invalid)return e.value="",void(n.value="");null!==e&&(e.value=this.getDateUtils().format(e.dataset.format,t)),n.value=this.getDateUtils().format(n.dataset.format,t)}}var Sr,Or,Lr=n(9997);class Cr extends Ei{init(){this.usersId="team_edit_form_users"}supportsForm(t){return"team_edit_form"===t.name}_getPrototype(){return document.getElementById("team_edit_form_members")}activateForm(t){this.supportsForm(t)&&(t.addEventListener("click",(t=>this._removeMember(t))),document.getElementById(this.usersId).addEventListener("change",(t=>{const e=t.target,n=e.options[e.selectedIndex],i=this._createMember(n);this._getPrototype().append(i),this.getPlugin("form-select").removeOption(e,n)})))}_createMember(t){const e=this.getPlugin("escape"),n=this._getPrototype();let i=n.dataset.widgetCounter||n.childNodes.length,s=n.dataset.prototype;s=s.replace(/__name__/g,i),s=s.replace(/#000000/g,Lr.A.calculateContrastColor(t.dataset.color)),s=s.replace(/__DISPLAY__/g,e.escapeForHtml(t.dataset.display)),s=s.replace(/__COLOR__/g,t.dataset.color),s=s.replace(/__INITIALS__/g,e.escapeForHtml(t.dataset.initials)),s=s.replace(/__TITLE__/g,e.escapeForHtml(t.dataset.title)),s=s.replace(/__USERNAME__/g,e.escapeForHtml(t.text)),n.dataset.widgetCounter=(++i).toString();const r=document.createElement("div");r.innerHTML=s,r.querySelector("input[type=hidden]").value=t.value;const o=r.firstElementChild;for(const e in t.dataset)o.dataset[e]=t.dataset[e];return o}_removeMember(t){let e=t.target;if(e.parentNode.matches(".remove-member")&&(e=e.parentNode),e.matches(".remove-member")){e.parentNode.parentNode.parentNode.parentNode.parentNode.remove(),t.stopPropagation(),t.preventDefault()}}destroyForm(t){this.supportsForm(t)&&t.removeEventListener("click",this._removeMember)}}class Mr extends Ei{supportsForm(t){return!0}activateForm(t){void 0===this._eventHandler&&(this._eventHandler=t=>{let e=t.target;if(e.matches('a[data-form-widget="copy-data"]')||(e=e.parentNode),!e.matches('a[data-form-widget="copy-data"]')||void 0===e.dataset.target)return;const n=document.querySelector(e.dataset.target);if(null!==n){if(n.value=e.dataset.value,void 0!==e.dataset.event)for(const t of e.dataset.event.split(" ")){n.dispatchEvent(new Event(t));const e=n.closest("form");null!==e&&e.dispatchEvent(new Event(t))}t.preventDefault()}}),t.addEventListener("click",this._eventHandler)}destroyForm(t){t.removeEventListener("click",this._eventHandler)}}class Ar extends Ei{init(){this.selector='a[data-form-widget="date-now"]'}supportsForm(t){return!0}activateForm(t){[].slice.call(t.querySelectorAll(this.selector)).map((t=>{void 0!==t.dataset.format&&void 0!==t.dataset.target&&(void 0===this._eventHandler&&(this._eventHandler=t=>{const e=t.currentTarget,n=document.getElementById(e.dataset.target);n.disabled||(n.value=this.getDateUtils().format(e.dataset.format,null),n.dispatchEvent(new Event("change",{bubbles:!0}))),t.preventDefault()}),t.addEventListener("click",this._eventHandler))}))}destroyForm(t){[].slice.call(t.querySelectorAll(this.selector)).map((t=>{void 0!==t.dataset.format&&void 0!==t.dataset.target&&t.removeEventListener("click",this._eventHandler)}))}}class Ir extends bi{getId(){return"notification"}isSupported(){return!!window.Notification&&("denied"!==Notification.permission&&"granted"===Notification.permission)}request(t){try{Notification.requestPermission().then((e=>{t("granted"===e||"default"===e&&null)}))}catch(e){Notification.requestPermission((e=>{t("granted"===e||"default"===e&&null)}))}}notify(t,e,n,i){this.request((s=>{if(!0!==s){this.getPlugin("alert").info(e)}let r={body:e,dir:this.getConfigurations().isRTL()?"rtl":"ltr"};null!=n&&(r.icon=n);let o="Kimai";null!==t&&(o=o+": "+t),null!=i&&(r={...r,...i});const a=new window.Notification(o,r);a.onclick=function(){window.focus(),a.close()}}))}}class Nr extends bi{getId(){return"hotkeys"}init(){window.addEventListener("keyup",(t=>{if(t.ctrlKey&&"Enter"===t.key){const e=[...document.querySelectorAll('[data-hotkey="ctrl+Enter"]')].filter((t=>this.isVisible(t)));e.length>1&&console.warn("KimaiHotkeys: More than one visible element matches ${selector}. No action triggered."),1===e.length&&(t.stopPropagation(),t.preventDefault(),e[0].click())}}))}isVisible(t){return!(!t||0===t.getClientRects().length)&&"visible"===getComputedStyle(t).getPropertyValue("visibility")}}class Fr extends bi{constructor(){super(),this._selector="a.remote-modal-load"}getId(){return"remote-modal"}init(){this.handle=t=>{this._showModal(t.currentTarget),t.stopPropagation(),t.preventDefault()};for(let t of document.querySelectorAll(this._selector))t.addEventListener("click",this.handle);document.addEventListener("kimai.closeRemoteModal",(()=>{this._hide()}))}_initElement(t){for(let e of t.querySelectorAll("a.remote-modal-reload"))e.addEventListener("click",this.handle)}_hide(){this._getModal().hide()}_getModalElement(){return document.getElementById("remote_modal")}_getModal(){return ki.aF.getOrCreateInstance(this._getModalElement())}_showModal(t){this.fetch(t.href,{method:"GET"}).then((e=>{if(e.ok)return e.text().then((e=>{const n=document.createElement("div");n.classList.add("modal-body"),n.classList.add("p-0"),n.innerHTML=e,this._initElement(n);const i=this._getModalElement();i.querySelector(".modal-body").replaceWith(n),void 0!==t.dataset.modalTitle&&(i.querySelector(".modal-title").textContent=t.dataset.modalTitle),this._getModal().show()}))})).catch((t=>{console.log("Failed to load remote modal",t)}))}}class Pr extends bi{getId(){return"user"}init(){this.user=this.getConfigurations().get("user")}getUserId(){return this.user.id}getName(){return this.user.name}isAdmin(){return this.user.admin}isSuperAdmin(){return this.user.superAdmin}}class jr extends yr{init(){this.selector='[data-form-widget="tags"]'}loadData(t,e,n){this.getContainer().getPlugin("api").get(t,{name:e},(t=>{let e=[];for(let n of t)e.push({text:n.name,value:n.name,color:n["color-safe"]});n(e)}),(()=>{n()}))}}t=n.hmd(t),Sr="undefined"!=typeof self?self:void 0,Or=function(){return class extends class{constructor(t,e){bt.defaultLocale=t.locale.replace("_","-").toLowerCase(),bt.defaultZone=t.timezone;const n=new _i(new yi(t),new vi(e));n.registerPlugin(new Pr),n.registerPlugin(new xr),n.registerPlugin(new Pi),n.registerPlugin(new Mi),n.registerPlugin(new qi),n.registerPlugin(new Er),n.registerPlugin(new Tr),n.registerPlugin(new Ir),n.registerPlugin(new br(".selectpicker","select[data-related-select]")),n.registerPlugin(new Si('input[data-daterangepicker="on"]')),n.registerPlugin(new Di('input[data-datepicker="on"]')),n.registerPlugin(new yr),n.registerPlugin(new jr),n.registerPlugin(new Dr),n.registerPlugin(new Cr),n.registerPlugin(new Mr),n.registerPlugin(new Ar),n.registerPlugin(new _r),n.registerPlugin(new Nr),n.registerPlugin(new wr("confirmation-link")),n.registerPlugin(new wi("data-column-visibility")),n.registerPlugin(new Li("section.content","table.dataTable")),n.registerPlugin(new Ci("form.searchform","toolbar-action")),n.registerPlugin(new Ii(".alternative-link")),n.registerPlugin(new Ni(".modal-ajax-form",["td.multiCheckbox","td.actions"])),n.registerPlugin(new Fr),n.registerPlugin(new Fi),n.registerPlugin(new ji("api-link")),n.registerPlugin(new kr),n.registerPlugin(new Ti),document.dispatchEvent(new CustomEvent("kimai.pluginRegister",{detail:{kimai:n}})),n.getPlugins().map((t=>{t.init()})),document.dispatchEvent(new CustomEvent("kimai.initialized",{detail:{kimai:n}})),this.kimai=n}getKimai(){return this.kimai}}{}},"function"==typeof define&&n.amdO?define([],(function(){return Sr.KimaiWebLoader=Or()})):t.exports?t.exports=Or():Sr.KimaiWebLoader=Or()},9997:function(t,e,n){"use strict";n.d(e,{A:function(){return i}});class i{static calculateContrastColor(t){"#"===t.slice(0,1)&&(t=t.slice(1)),3===t.length&&(t=t.split("").map((function(t){return t+t})).join(""));return(299*parseInt(t.substring(0,2),16)+587*parseInt(t.substring(2,4),16)+114*parseInt(t.substring(4,6),16))/1e3>=128?"#000000":"#ffffff"}}},2758:function(t,e,n){"use strict";n.d(e,{A:function(){return i}});class i{constructor(t){this.id=t}getContextMenuElement(){if(null===document.getElementById(this.id)){const t=document.createElement("div");t.id=this.id,t.classList.add("dropdown-menu","d-none"),document.body.appendChild(t)}return document.getElementById(this.id)}createFromApi(t,e){let n="";for(const t of e)if(!0===t.divider&&(n+='<div class="dropdown-divider"></div>'),null!==t.url){if(n+='<a class="dropdown-item '+(null!==t.class?t.class:"")+'" href="'+t.url+'"',void 0!==t.attr)for(const e in t.attr)n+=" "+e+'="'+t.attr[e].replaceAll('"',""")+'"';n+=">"+t.title+"</a>"}this.createFromClickEvent(t,n)}createFromClickEvent(t,e){const n=this.getContextMenuElement();n.classList.contains("action-dropdown")||n.classList.add("action-dropdown"),n.innerHTML=e,n.style.position="fixed",n.style.top=t.clientY+"px",n.style.left=t.clientX+"px";const i=t=>{t.target.classList.contains("dropdown-toggle")||t.target.classList.contains("dropdown-divider")||(n.classList.remove("d-block"),n.classList.contains("d-none")||n.classList.add("d-none"),n.removeEventListener("click",i),document.removeEventListener("click",i))};n.addEventListener("click",i),document.addEventListener("click",i),n.classList.remove("d-none"),n.classList.contains("d-block")||n.classList.add("d-block")}static createForDataTable(t){[].slice.call(document.querySelectorAll(t)).map((t=>{null!==t.querySelector("td.actions div.dropdown-menu")&&t.addEventListener("contextmenu",(e=>{let n=e.target;for(;null!==n;){const t=n.tagName.toUpperCase();if("TH"===t||"TABLE"===t||"BODY"===t)return;if("TR"===t)break;n=n.parentNode}if(null===n||!n.matches("table.dataTable tbody tr"))return;const s=n.querySelector("td.actions div.dropdown-menu");if(null===s)return;e.preventDefault();new i(t.dataset.contextMenu).createFromClickEvent(e,s.innerHTML)}))}))}}},4100:function(t,e,n){"use strict";n.d(e,{A:function(){return s}});var i=n(2758);class s{constructor(t){this.selector=t;const e=document.querySelector(this.selector);if(this.href=e.dataset.href,void 0!==e.dataset.reload){this.events=e.dataset.reload.split(" ");const t=()=>{let t=null;t=void 0!==document.querySelector(this.selector).dataset.reloadHref?document.querySelector(this.selector).dataset.reloadHref:document.querySelector(this.selector+" ul.pagination li.active a").href,this.loadPage(t)};for(const e of this.events)document.addEventListener(e,t)}document.body.addEventListener("click",(t=>{let e=t.target;e.matches(this.selector+" a.pagination-link")||(e=e.parentNode),e.matches(this.selector+" a.pagination-link")&&(t.preventDefault(),this.loadPage(e.href))}))}static create(t){return new s(t)}loadPage(t){const e=this.selector;document.dispatchEvent(new CustomEvent("kimai.reloadContent",{detail:this.selector}));const n=()=>{document.dispatchEvent(new Event("kimai.reloadedContent"))};window.kimai.getPlugin("fetch").fetch(t).then((t=>{t.text().then((t=>{const s=document.createElement("div");s.innerHTML=t,document.querySelector(e).replaceWith(this._makeScriptExecutable(s.firstElementChild)),i.A.createForDataTable(e+" table.dataTable"),n()}))})).catch((()=>{window.kimai.getPlugin("alert").error("Failed loading selected page"),n()}))}_makeScriptExecutable(t){if(void 0!==t.tagName&&"SCRIPT"===t.tagName){const e=document.createElement("script");e.text=t.innerHTML,t.parentNode.replaceChild(e,t)}else for(const e of t.childNodes)this._makeScriptExecutable(e);return t}}},5170:function(t,e,n){"use strict";n.d(e,{A:function(){return i}});class i{constructor(t,e){const n=()=>{e?document.location.reload():this._loadPage(document.location)};for(const e of t.split(" "))document.addEventListener(e,n)}static create(t,e){return null==e&&(e=!1),new i(t,e)}_showOverlay(){document.dispatchEvent(new CustomEvent("kimai.reloadContent",{detail:"div.page-wrapper"}))}_hideOverlay(){document.dispatchEvent(new Event("kimai.reloadedContent"))}_loadPage(t){this._showOverlay(),window.kimai.getPlugin("fetch").fetch(t).then((t=>{t.text().then((t=>{const e=document.createElement("div");e.innerHTML=t;const n=e.querySelector("section.content");document.querySelector("section.content").replaceWith(n),document.dispatchEvent(new Event("kimai.reloadPage")),this._hideOverlay()}))})).catch((()=>{this._hideOverlay(),document.location=t}))}}},5247:function(t,e,n){"use strict";n.d(e,{A:function(){return i}});class i{static set(t,e){window.localStorage.setItem(t,JSON.stringify(e))}static get(t){let e=window.localStorage.getItem(t);return null==e?null:JSON.parse(e)}static remove(t){window.localStorage.removeItem(t)}}},9336:function(t,e,n){"use strict";n.d(e,{aF:function(){return $n},go:function(){return Kn},AM:function(){return yi},y8:function(){return Wi},m_:function(){return fi}});var i={};n.r(i),n.d(i,{afterMain:function(){return T},afterRead:function(){return _},afterWrite:function(){return D},applyStyles:function(){return I},arrow:function(){return X},auto:function(){return l},basePlacements:function(){return c},beforeMain:function(){return w},beforeRead:function(){return y},beforeWrite:function(){return x},bottom:function(){return r},clippingParents:function(){return h},computeStyles:function(){return it},createPopper:function(){return It},createPopperBase:function(){return At},createPopperLite:function(){return Nt},detectOverflow:function(){return bt},end:function(){return d},eventListeners:function(){return rt},flip:function(){return _t},hide:function(){return Tt},left:function(){return a},main:function(){return k},modifierPhases:function(){return S},offset:function(){return xt},placements:function(){return v},popper:function(){return m},popperGenerator:function(){return Mt},popperOffsets:function(){return Et},preventOverflow:function(){return Dt},read:function(){return b},reference:function(){return f},right:function(){return o},start:function(){return u},top:function(){return s},variationPlacements:function(){return g},viewport:function(){return p},write:function(){return E}});var s="top",r="bottom",o="right",a="left",l="auto",c=[s,r,o,a],u="start",d="end",h="clippingParents",p="viewport",m="popper",f="reference",g=c.reduce((function(t,e){return t.concat([e+"-"+u,e+"-"+d])}),[]),v=[].concat(c,[l]).reduce((function(t,e){return t.concat([e,e+"-"+u,e+"-"+d])}),[]),y="beforeRead",b="read",_="afterRead",w="beforeMain",k="main",T="afterMain",x="beforeWrite",E="write",D="afterWrite",S=[y,b,_,w,k,T,x,E,D];function O(t){return t?(t.nodeName||"").toLowerCase():null}function L(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function C(t){return t instanceof L(t).Element||t instanceof Element}function M(t){return t instanceof L(t).HTMLElement||t instanceof HTMLElement}function A(t){return"undefined"!=typeof ShadowRoot&&(t instanceof L(t).ShadowRoot||t instanceof ShadowRoot)}var I={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},s=e.elements[t];M(s)&&O(s)&&(Object.assign(s.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],s=e.attributes[t]||{},r=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});M(i)&&O(i)&&(Object.assign(i.style,r),Object.keys(s).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]};function N(t){return t.split("-")[0]}var F=Math.max,P=Math.min,j=Math.round;function q(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function H(){return!/^((?!chrome|android).)*safari/i.test(q())}function V(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),s=1,r=1;e&&M(t)&&(s=t.offsetWidth>0&&j(i.width)/t.offsetWidth||1,r=t.offsetHeight>0&&j(i.height)/t.offsetHeight||1);var o=(C(t)?L(t):window).visualViewport,a=!H()&&n,l=(i.left+(a&&o?o.offsetLeft:0))/s,c=(i.top+(a&&o?o.offsetTop:0))/r,u=i.width/s,d=i.height/r;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l,x:l,y:c}}function $(t){var e=V(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function R(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&A(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function W(t){return L(t).getComputedStyle(t)}function B(t){return["table","td","th"].indexOf(O(t))>=0}function z(t){return((C(t)?t.ownerDocument:t.document)||window.document).documentElement}function Y(t){return"html"===O(t)?t:t.assignedSlot||t.parentNode||(A(t)?t.host:null)||z(t)}function U(t){return M(t)&&"fixed"!==W(t).position?t.offsetParent:null}function Z(t){for(var e=L(t),n=U(t);n&&B(n)&&"static"===W(n).position;)n=U(n);return n&&("html"===O(n)||"body"===O(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test(q());if(/Trident/i.test(q())&&M(t)&&"fixed"===W(t).position)return null;var n=Y(t);for(A(n)&&(n=n.host);M(n)&&["html","body"].indexOf(O(n))<0;){var i=W(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function J(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function K(t,e,n){return F(t,P(e,n))}function G(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Q(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var X={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,l=t.options,u=n.elements.arrow,d=n.modifiersData.popperOffsets,h=N(n.placement),p=J(h),m=[a,o].indexOf(h)>=0?"height":"width";if(u&&d){var f=function(t,e){return G("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Q(t,c))}(l.padding,n),g=$(u),v="y"===p?s:a,y="y"===p?r:o,b=n.rects.reference[m]+n.rects.reference[p]-d[p]-n.rects.popper[m],_=d[p]-n.rects.reference[p],w=Z(u),k=w?"y"===p?w.clientHeight||0:w.clientWidth||0:0,T=b/2-_/2,x=f[v],E=k-g[m]-f[y],D=k/2-g[m]/2+T,S=K(x,D,E),O=p;n.modifiersData[i]=((e={})[O]=S,e.centerOffset=S-D,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&R(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function tt(t){return t.split("-")[1]}var et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nt(t){var e,n=t.popper,i=t.popperRect,l=t.placement,c=t.variation,u=t.offsets,h=t.position,p=t.gpuAcceleration,m=t.adaptive,f=t.roundOffsets,g=t.isFixed,v=u.x,y=void 0===v?0:v,b=u.y,_=void 0===b?0:b,w="function"==typeof f?f({x:y,y:_}):{x:y,y:_};y=w.x,_=w.y;var k=u.hasOwnProperty("x"),T=u.hasOwnProperty("y"),x=a,E=s,D=window;if(m){var S=Z(n),O="clientHeight",C="clientWidth";if(S===L(n)&&"static"!==W(S=z(n)).position&&"absolute"===h&&(O="scrollHeight",C="scrollWidth"),l===s||(l===a||l===o)&&c===d)E=r,_-=(g&&S===D&&D.visualViewport?D.visualViewport.height:S[O])-i.height,_*=p?1:-1;if(l===a||(l===s||l===r)&&c===d)x=o,y-=(g&&S===D&&D.visualViewport?D.visualViewport.width:S[C])-i.width,y*=p?1:-1}var M,A=Object.assign({position:h},m&&et),I=!0===f?function(t,e){var n=t.x,i=t.y,s=e.devicePixelRatio||1;return{x:j(n*s)/s||0,y:j(i*s)/s||0}}({x:y,y:_},L(n)):{x:y,y:_};return y=I.x,_=I.y,p?Object.assign({},A,((M={})[E]=T?"0":"",M[x]=k?"0":"",M.transform=(D.devicePixelRatio||1)<=1?"translate("+y+"px, "+_+"px)":"translate3d("+y+"px, "+_+"px, 0)",M)):Object.assign({},A,((e={})[E]=T?_+"px":"",e[x]=k?y+"px":"",e.transform="",e))}var it={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,s=void 0===i||i,r=n.adaptive,o=void 0===r||r,a=n.roundOffsets,l=void 0===a||a,c={placement:N(e.placement),variation:tt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,nt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,nt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},st={passive:!0};var rt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,s=i.scroll,r=void 0===s||s,o=i.resize,a=void 0===o||o,l=L(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return r&&c.forEach((function(t){t.addEventListener("scroll",n.update,st)})),a&&l.addEventListener("resize",n.update,st),function(){r&&c.forEach((function(t){t.removeEventListener("scroll",n.update,st)})),a&&l.removeEventListener("resize",n.update,st)}},data:{}},ot={left:"right",right:"left",bottom:"top",top:"bottom"};function at(t){return t.replace(/left|right|bottom|top/g,(function(t){return ot[t]}))}var lt={start:"end",end:"start"};function ct(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ut(t){var e=L(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dt(t){return V(z(t)).left+ut(t).scrollLeft}function ht(t){var e=W(t),n=e.overflow,i=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+i)}function pt(t){return["html","body","#document"].indexOf(O(t))>=0?t.ownerDocument.body:M(t)&&ht(t)?t:pt(Y(t))}function mt(t,e){var n;void 0===e&&(e=[]);var i=pt(t),s=i===(null==(n=t.ownerDocument)?void 0:n.body),r=L(i),o=s?[r].concat(r.visualViewport||[],ht(i)?i:[]):i,a=e.concat(o);return s?a:a.concat(mt(Y(o)))}function ft(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function gt(t,e,n){return e===p?ft(function(t,e){var n=L(t),i=z(t),s=n.visualViewport,r=i.clientWidth,o=i.clientHeight,a=0,l=0;if(s){r=s.width,o=s.height;var c=H();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:r,height:o,x:a+dt(t),y:l}}(t,n)):C(e)?function(t,e){var n=V(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):ft(function(t){var e,n=z(t),i=ut(t),s=null==(e=t.ownerDocument)?void 0:e.body,r=F(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=F(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-i.scrollLeft+dt(t),l=-i.scrollTop;return"rtl"===W(s||n).direction&&(a+=F(n.clientWidth,s?s.clientWidth:0)-r),{width:r,height:o,x:a,y:l}}(z(t)))}function vt(t,e,n,i){var s="clippingParents"===e?function(t){var e=mt(Y(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&M(t)?Z(t):t;return C(n)?e.filter((function(t){return C(t)&&R(t,n)&&"body"!==O(t)})):[]}(t):[].concat(e),r=[].concat(s,[n]),o=r[0],a=r.reduce((function(e,n){var s=gt(t,n,i);return e.top=F(s.top,e.top),e.right=P(s.right,e.right),e.bottom=P(s.bottom,e.bottom),e.left=F(s.left,e.left),e}),gt(t,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function yt(t){var e,n=t.reference,i=t.element,l=t.placement,c=l?N(l):null,h=l?tt(l):null,p=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2;switch(c){case s:e={x:p,y:n.y-i.height};break;case r:e={x:p,y:n.y+n.height};break;case o:e={x:n.x+n.width,y:m};break;case a:e={x:n.x-i.width,y:m};break;default:e={x:n.x,y:n.y}}var f=c?J(c):null;if(null!=f){var g="y"===f?"height":"width";switch(h){case u:e[f]=e[f]-(n[g]/2-i[g]/2);break;case d:e[f]=e[f]+(n[g]/2-i[g]/2)}}return e}function bt(t,e){void 0===e&&(e={});var n=e,i=n.placement,a=void 0===i?t.placement:i,l=n.strategy,u=void 0===l?t.strategy:l,d=n.boundary,g=void 0===d?h:d,v=n.rootBoundary,y=void 0===v?p:v,b=n.elementContext,_=void 0===b?m:b,w=n.altBoundary,k=void 0!==w&&w,T=n.padding,x=void 0===T?0:T,E=G("number"!=typeof x?x:Q(x,c)),D=_===m?f:m,S=t.rects.popper,O=t.elements[k?D:_],L=vt(C(O)?O:O.contextElement||z(t.elements.popper),g,y,u),M=V(t.elements.reference),A=yt({reference:M,element:S,strategy:"absolute",placement:a}),I=ft(Object.assign({},S,A)),N=_===m?I:M,F={top:L.top-N.top+E.top,bottom:N.bottom-L.bottom+E.bottom,left:L.left-N.left+E.left,right:N.right-L.right+E.right},P=t.modifiersData.offset;if(_===m&&P){var j=P[a];Object.keys(F).forEach((function(t){var e=[o,r].indexOf(t)>=0?1:-1,n=[s,r].indexOf(t)>=0?"y":"x";F[t]+=j[n]*e}))}return F}var _t={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var d=n.mainAxis,h=void 0===d||d,p=n.altAxis,m=void 0===p||p,f=n.fallbackPlacements,y=n.padding,b=n.boundary,_=n.rootBoundary,w=n.altBoundary,k=n.flipVariations,T=void 0===k||k,x=n.allowedAutoPlacements,E=e.options.placement,D=N(E),S=f||(D===E||!T?[at(E)]:function(t){if(N(t)===l)return[];var e=at(t);return[ct(t),e,ct(e)]}(E)),O=[E].concat(S).reduce((function(t,n){return t.concat(N(n)===l?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,s=n.boundary,r=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?v:l,d=tt(i),h=d?a?g:g.filter((function(t){return tt(t)===d})):c,p=h.filter((function(t){return u.indexOf(t)>=0}));0===p.length&&(p=h);var m=p.reduce((function(e,n){return e[n]=bt(t,{placement:n,boundary:s,rootBoundary:r,padding:o})[N(n)],e}),{});return Object.keys(m).sort((function(t,e){return m[t]-m[e]}))}(e,{placement:n,boundary:b,rootBoundary:_,padding:y,flipVariations:T,allowedAutoPlacements:x}):n)}),[]),L=e.rects.reference,C=e.rects.popper,M=new Map,A=!0,I=O[0],F=0;F<O.length;F++){var P=O[F],j=N(P),q=tt(P)===u,H=[s,r].indexOf(j)>=0,V=H?"width":"height",$=bt(e,{placement:P,boundary:b,rootBoundary:_,altBoundary:w,padding:y}),R=H?q?o:a:q?r:s;L[V]>C[V]&&(R=at(R));var W=at(R),B=[];if(h&&B.push($[j]<=0),m&&B.push($[R]<=0,$[W]<=0),B.every((function(t){return t}))){I=P,A=!1;break}M.set(P,B)}if(A)for(var z=function(t){var e=O.find((function(e){var n=M.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return I=e,"break"},Y=T?3:1;Y>0;Y--){if("break"===z(Y))break}e.placement!==I&&(e.modifiersData[i]._skip=!0,e.placement=I,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function wt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function kt(t){return[s,o,r,a].some((function(e){return t[e]>=0}))}var Tt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,s=e.rects.popper,r=e.modifiersData.preventOverflow,o=bt(e,{elementContext:"reference"}),a=bt(e,{altBoundary:!0}),l=wt(o,i),c=wt(a,s,r),u=kt(l),d=kt(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}};var xt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.offset,l=void 0===r?[0,0]:r,c=v.reduce((function(t,n){return t[n]=function(t,e,n){var i=N(t),r=[a,s].indexOf(i)>=0?-1:1,l="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=l[0],u=l[1];return c=c||0,u=(u||0)*r,[a,o].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,l),t}),{}),u=c[e.placement],d=u.x,h=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=h),e.modifiersData[i]=c}};var Et={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=yt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};var Dt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.mainAxis,c=void 0===l||l,d=n.altAxis,h=void 0!==d&&d,p=n.boundary,m=n.rootBoundary,f=n.altBoundary,g=n.padding,v=n.tether,y=void 0===v||v,b=n.tetherOffset,_=void 0===b?0:b,w=bt(e,{boundary:p,rootBoundary:m,padding:g,altBoundary:f}),k=N(e.placement),T=tt(e.placement),x=!T,E=J(k),D="x"===E?"y":"x",S=e.modifiersData.popperOffsets,O=e.rects.reference,L=e.rects.popper,C="function"==typeof _?_(Object.assign({},e.rects,{placement:e.placement})):_,M="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),A=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,I={x:0,y:0};if(S){if(c){var j,q="y"===E?s:a,H="y"===E?r:o,V="y"===E?"height":"width",R=S[E],W=R+w[q],B=R-w[H],z=y?-L[V]/2:0,Y=T===u?O[V]:L[V],U=T===u?-L[V]:-O[V],G=e.elements.arrow,Q=y&&G?$(G):{width:0,height:0},X=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=X[q],nt=X[H],it=K(0,O[V],Q[V]),st=x?O[V]/2-z-it-et-M.mainAxis:Y-it-et-M.mainAxis,rt=x?-O[V]/2+z+it+nt+M.mainAxis:U+it+nt+M.mainAxis,ot=e.elements.arrow&&Z(e.elements.arrow),at=ot?"y"===E?ot.clientTop||0:ot.clientLeft||0:0,lt=null!=(j=null==A?void 0:A[E])?j:0,ct=R+rt-lt,ut=K(y?P(W,R+st-lt-at):W,R,y?F(B,ct):B);S[E]=ut,I[E]=ut-R}if(h){var dt,ht="x"===E?s:a,pt="x"===E?r:o,mt=S[D],ft="y"===D?"height":"width",gt=mt+w[ht],vt=mt-w[pt],yt=-1!==[s,a].indexOf(k),_t=null!=(dt=null==A?void 0:A[D])?dt:0,wt=yt?gt:mt-O[ft]-L[ft]-_t+M.altAxis,kt=yt?mt+O[ft]+L[ft]-_t-M.altAxis:vt,Tt=y&&yt?function(t,e,n){var i=K(t,e,n);return i>n?n:i}(wt,mt,kt):K(y?wt:gt,mt,y?kt:vt);S[D]=Tt,I[D]=Tt-mt}e.modifiersData[i]=I}},requiresIfExists:["offset"]};function St(t,e,n){void 0===n&&(n=!1);var i,s,r=M(e),o=M(e)&&function(t){var e=t.getBoundingClientRect(),n=j(e.width)/t.offsetWidth||1,i=j(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),a=z(e),l=V(t,o,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(("body"!==O(e)||ht(a))&&(c=(i=e)!==L(i)&&M(i)?{scrollLeft:(s=i).scrollLeft,scrollTop:s.scrollTop}:ut(i)),M(e)?((u=V(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=dt(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Ot(t){var e=new Map,n=new Set,i=[];function s(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&s(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||s(t)})),i}var Lt={placement:"bottom",modifiers:[],strategy:"absolute"};function Ct(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function Mt(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,s=e.defaultOptions,r=void 0===s?Lt:s;return function(t,e,n){void 0===n&&(n=r);var s,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Lt,r),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},l=[],c=!1,u={state:a,setOptions:function(n){var s="function"==typeof n?n(a.options):n;d(),a.options=Object.assign({},r,a.options,s),a.scrollParents={reference:C(t)?mt(t):t.contextElement?mt(t.contextElement):[],popper:mt(e)};var o,c,h=function(t){var e=Ot(t);return S.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((o=[].concat(i,a.options.modifiers),c=o.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return a.orderedModifiers=h.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,s=t.effect;if("function"==typeof s){var r=s({state:a,name:e,instance:u,options:i}),o=function(){};l.push(r||o)}})),u.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(Ct(e,n)){a.rects={reference:St(e,Z(n),"fixed"===a.options.strategy),popper:$(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var s=a.orderedModifiers[i],r=s.fn,o=s.options,l=void 0===o?{}:o,d=s.name;"function"==typeof r&&(a=r({state:a,options:l,name:d,instance:u})||a)}else a.reset=!1,i=-1}}},update:(s=function(){return new Promise((function(t){u.forceUpdate(),t(a)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(s())}))}))),o}),destroy:function(){d(),c=!0}};if(!Ct(t,e))return u;function d(){l.forEach((function(t){return t()})),l=[]}return u.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),u}}var At=Mt(),It=Mt({defaultModifiers:[rt,Et,it,I,xt,_t,Dt,X,Tt]}),Nt=Mt({defaultModifiers:[rt,Et,it,I]});const Ft=new Map,Pt={set(t,e,n){Ft.has(t)||Ft.set(t,new Map);const i=Ft.get(t);i.has(e)||0===i.size?i.set(e,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`)},get:(t,e)=>Ft.has(t)&&Ft.get(t).get(e)||null,remove(t,e){if(!Ft.has(t))return;const n=Ft.get(t);n.delete(e),0===n.size&&Ft.delete(t)}},jt="transitionend",qt=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),Ht=t=>{t.dispatchEvent(new Event(jt))},Vt=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),$t=t=>Vt(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(qt(t)):null,Rt=t=>{if(!Vt(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),n=t.closest("details:not([open])");if(!n)return e;if(n!==t){const e=t.closest("summary");if(e&&e.parentNode!==n)return!1;if(null===e)return!1}return e},Wt=t=>!t||t.nodeType!==Node.ELEMENT_NODE||(!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled"))),Bt=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?Bt(t.parentNode):null},zt=()=>{},Yt=t=>{t.offsetHeight},Ut=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Zt=[],Jt=()=>"rtl"===document.documentElement.dir,Kt=t=>{var e;e=()=>{const e=Ut();if(e){const n=t.NAME,i=e.fn[n];e.fn[n]=t.jQueryInterface,e.fn[n].Constructor=t,e.fn[n].noConflict=()=>(e.fn[n]=i,t.jQueryInterface)}},"loading"===document.readyState?(Zt.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of Zt)t()})),Zt.push(e)):e()},Gt=(t,e=[],n=t)=>"function"==typeof t?t(...e):n,Qt=(t,e,n=!0)=>{if(!n)return void Gt(t);const i=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:n}=window.getComputedStyle(t);const i=Number.parseFloat(e),s=Number.parseFloat(n);return i||s?(e=e.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(n))):0})(e)+5;let s=!1;const r=({target:n})=>{n===e&&(s=!0,e.removeEventListener(jt,r),Gt(t))};e.addEventListener(jt,r),setTimeout((()=>{s||Ht(e)}),i)},Xt=(t,e,n,i)=>{const s=t.length;let r=t.indexOf(e);return-1===r?!n&&i?t[s-1]:t[0]:(r+=n?1:-1,i&&(r=(r+s)%s),t[Math.max(0,Math.min(r,s-1))])},te=/[^.]*(?=\..*)\.|.*/,ee=/\..*/,ne=/::\d+$/,ie={};let se=1;const re={mouseenter:"mouseover",mouseleave:"mouseout"},oe=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function ae(t,e){return e&&`${e}::${se++}`||t.uidEvent||se++}function le(t){const e=ae(t);return t.uidEvent=e,ie[e]=ie[e]||{},ie[e]}function ce(t,e,n=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===n))}function ue(t,e,n){const i="string"==typeof e,s=i?n:e||n;let r=me(t);return oe.has(r)||(r=t),[i,s,r]}function de(t,e,n,i,s){if("string"!=typeof e||!t)return;let[r,o,a]=ue(e,n,i);if(e in re){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};o=t(o)}const l=le(t),c=l[a]||(l[a]={}),u=ce(c,o,r?n:null);if(u)return void(u.oneOff=u.oneOff&&s);const d=ae(o,e.replace(te,"")),h=r?function(t,e,n){return function i(s){const r=t.querySelectorAll(e);for(let{target:o}=s;o&&o!==this;o=o.parentNode)for(const a of r)if(a===o)return ge(s,{delegateTarget:o}),i.oneOff&&fe.off(t,s.type,e,n),n.apply(o,[s])}}(t,n,o):function(t,e){return function n(i){return ge(i,{delegateTarget:t}),n.oneOff&&fe.off(t,i.type,e),e.apply(t,[i])}}(t,o);h.delegationSelector=r?n:null,h.callable=o,h.oneOff=s,h.uidEvent=d,c[d]=h,t.addEventListener(a,h,r)}function he(t,e,n,i,s){const r=ce(e[n],i,s);r&&(t.removeEventListener(n,r,Boolean(s)),delete e[n][r.uidEvent])}function pe(t,e,n,i){const s=e[n]||{};for(const[r,o]of Object.entries(s))r.includes(i)&&he(t,e,n,o.callable,o.delegationSelector)}function me(t){return t=t.replace(ee,""),re[t]||t}const fe={on(t,e,n,i){de(t,e,n,i,!1)},one(t,e,n,i){de(t,e,n,i,!0)},off(t,e,n,i){if("string"!=typeof e||!t)return;const[s,r,o]=ue(e,n,i),a=o!==e,l=le(t),c=l[o]||{},u=e.startsWith(".");if(void 0===r){if(u)for(const n of Object.keys(l))pe(t,l,n,e.slice(1));for(const[n,i]of Object.entries(c)){const s=n.replace(ne,"");a&&!e.includes(s)||he(t,l,o,i.callable,i.delegationSelector)}}else{if(!Object.keys(c).length)return;he(t,l,o,r,s?n:null)}},trigger(t,e,n){if("string"!=typeof e||!t)return null;const i=Ut();let s=null,r=!0,o=!0,a=!1;e!==me(e)&&i&&(s=i.Event(e,n),i(t).trigger(s),r=!s.isPropagationStopped(),o=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=ge(new Event(e,{bubbles:r,cancelable:!0}),n);return a&&l.preventDefault(),o&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function ge(t,e={}){for(const[n,i]of Object.entries(e))try{t[n]=i}catch(e){Object.defineProperty(t,n,{configurable:!0,get:()=>i})}return t}function ve(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function ye(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const be={setDataAttribute(t,e,n){t.setAttribute(`data-bs-${ye(e)}`,n)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${ye(e)}`)},getDataAttributes(t){if(!t)return{};const e={},n=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),e[n]=ve(t.dataset[i])}return e},getDataAttribute:(t,e)=>ve(t.getAttribute(`data-bs-${ye(e)}`))};class _e{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const n=Vt(e)?be.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...Vt(e)?be.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[i,s]of Object.entries(e)){const e=t[i],r=Vt(e)?"element":null==(n=e)?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${r}" but expected type "${s}".`)}var n}}class we extends _e{constructor(t,e){super(),(t=$t(t))&&(this._element=t,this._config=this._getConfig(e),Pt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Pt.remove(this._element,this.constructor.DATA_KEY),fe.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,n=!0){Qt(t,e,n)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return Pt.get($t(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const ke=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let n=t.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),e=n&&"#"!==n?n.trim():null}return e?e.split(",").map((t=>qt(t))).join(","):null},Te={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const n=[];let i=t.parentNode.closest(e);for(;i;)n.push(i),i=i.parentNode.closest(e);return n},prev(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return[n];n=n.previousElementSibling}return[]},next(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return[n];n=n.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!Wt(t)&&Rt(t)))},getSelectorFromElement(t){const e=ke(t);return e&&Te.findOne(e)?e:null},getElementFromSelector(t){const e=ke(t);return e?Te.findOne(e):null},getMultipleElementsFromSelector(t){const e=ke(t);return e?Te.find(e):[]}},xe=(t,e="hide")=>{const n=`click.dismiss${t.EVENT_KEY}`,i=t.NAME;fe.on(document,n,`[data-bs-dismiss="${i}"]`,(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Wt(this))return;const s=Te.getElementFromSelector(this)||this.closest(`.${i}`);t.getOrCreateInstance(s)[e]()}))};class Ee extends we{static get NAME(){return"alert"}close(){if(fe.trigger(this._element,"close.bs.alert").defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),fe.trigger(this._element,"closed.bs.alert"),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=Ee.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}xe(Ee,"close"),Kt(Ee);const De='[data-bs-toggle="button"]';class Se extends we{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=Se.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}fe.on(document,"click.bs.button.data-api",De,(t=>{t.preventDefault();const e=t.target.closest(De);Se.getOrCreateInstance(e).toggle()})),Kt(Se);const Oe=".bs.swipe",Le={endCallback:null,leftCallback:null,rightCallback:null},Ce={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Me extends _e{constructor(t,e){super(),this._element=t,t&&Me.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Le}static get DefaultType(){return Ce}static get NAME(){return"swipe"}dispose(){fe.off(this._element,Oe)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),Gt(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&Gt(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(fe.on(this._element,"pointerdown.bs.swipe",(t=>this._start(t))),fe.on(this._element,"pointerup.bs.swipe",(t=>this._end(t))),this._element.classList.add("pointer-event")):(fe.on(this._element,"touchstart.bs.swipe",(t=>this._start(t))),fe.on(this._element,"touchmove.bs.swipe",(t=>this._move(t))),fe.on(this._element,"touchend.bs.swipe",(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Ae="next",Ie="prev",Ne="left",Fe="right",Pe="slid.bs.carousel",je="carousel",qe="active",He=".active",Ve=".carousel-item",$e={ArrowLeft:Fe,ArrowRight:Ne},Re={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},We={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Be extends we{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Te.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===je&&this.cycle()}static get Default(){return Re}static get DefaultType(){return We}static get NAME(){return"carousel"}next(){this._slide(Ae)}nextWhenVisible(){!document.hidden&&Rt(this._element)&&this.next()}prev(){this._slide(Ie)}pause(){this._isSliding&&Ht(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?fe.one(this._element,Pe,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void fe.one(this._element,Pe,(()=>this.to(t)));const n=this._getItemIndex(this._getActive());if(n===t)return;const i=t>n?Ae:Ie;this._slide(i,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&fe.on(this._element,"keydown.bs.carousel",(t=>this._keydown(t))),"hover"===this._config.pause&&(fe.on(this._element,"mouseenter.bs.carousel",(()=>this.pause())),fe.on(this._element,"mouseleave.bs.carousel",(()=>this._maybeEnableCycle()))),this._config.touch&&Me.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of Te.find(".carousel-item img",this._element))fe.on(t,"dragstart.bs.carousel",(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(Ne)),rightCallback:()=>this._slide(this._directionToOrder(Fe)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new Me(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=$e[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=Te.findOne(He,this._indicatorsElement);e.classList.remove(qe),e.removeAttribute("aria-current");const n=Te.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);n&&(n.classList.add(qe),n.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const n=this._getActive(),i=t===Ae,s=e||Xt(this._getItems(),n,i,this._config.wrap);if(s===n)return;const r=this._getItemIndex(s),o=e=>fe.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(n),to:r});if(o("slide.bs.carousel").defaultPrevented)return;if(!n||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(r),this._activeElement=s;const l=i?"carousel-item-start":"carousel-item-end",c=i?"carousel-item-next":"carousel-item-prev";s.classList.add(c),Yt(s),n.classList.add(l),s.classList.add(l);this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add(qe),n.classList.remove(qe,c,l),this._isSliding=!1,o(Pe)}),n,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return Te.findOne(".active.carousel-item",this._element)}_getItems(){return Te.find(Ve,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return Jt()?t===Ne?Ie:Ae:t===Ne?Ae:Ie}_orderToDirection(t){return Jt()?t===Ie?Ne:Fe:t===Ie?Fe:Ne}static jQueryInterface(t){return this.each((function(){const e=Be.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}fe.on(document,"click.bs.carousel.data-api","[data-bs-slide], [data-bs-slide-to]",(function(t){const e=Te.getElementFromSelector(this);if(!e||!e.classList.contains(je))return;t.preventDefault();const n=Be.getOrCreateInstance(e),i=this.getAttribute("data-bs-slide-to");return i?(n.to(i),void n._maybeEnableCycle()):"next"===be.getDataAttribute(this,"slide")?(n.next(),void n._maybeEnableCycle()):(n.prev(),void n._maybeEnableCycle())})),fe.on(window,"load.bs.carousel.data-api",(()=>{const t=Te.find('[data-bs-ride="carousel"]');for(const e of t)Be.getOrCreateInstance(e)})),Kt(Be);const ze="show",Ye="collapse",Ue="collapsing",Ze='[data-bs-toggle="collapse"]',Je={parent:null,toggle:!0},Ke={parent:"(null|element)",toggle:"boolean"};class Ge extends we{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const n=Te.find(Ze);for(const t of n){const e=Te.getSelectorFromElement(t),n=Te.find(e).filter((t=>t===this._element));null!==e&&n.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Je}static get DefaultType(){return Ke}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>Ge.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(fe.trigger(this._element,"show.bs.collapse").defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(Ye),this._element.classList.add(Ue),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Ue),this._element.classList.add(Ye,ze),this._element.style[e]="",fe.trigger(this._element,"shown.bs.collapse")}),this._element,!0),this._element.style[e]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(fe.trigger(this._element,"hide.bs.collapse").defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,Yt(this._element),this._element.classList.add(Ue),this._element.classList.remove(Ye,ze);for(const t of this._triggerArray){const e=Te.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(Ue),this._element.classList.add(Ye),fe.trigger(this._element,"hidden.bs.collapse")}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(ze)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=$t(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Ze);for(const e of t){const t=Te.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=Te.find(":scope .collapse .collapse",this._config.parent);return Te.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const n of t)n.classList.toggle("collapsed",!e),n.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const n=Ge.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===n[t])throw new TypeError(`No method named "${t}"`);n[t]()}}))}}fe.on(document,"click.bs.collapse.data-api",Ze,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of Te.getMultipleElementsFromSelector(this))Ge.getOrCreateInstance(t,{toggle:!1}).toggle()})),Kt(Ge);const Qe="dropdown",Xe="ArrowUp",tn="ArrowDown",en="click.bs.dropdown.data-api",nn="keydown.bs.dropdown.data-api",sn="show",rn='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',on=`${rn}.show`,an=".dropdown-menu",ln=Jt()?"top-end":"top-start",cn=Jt()?"top-start":"top-end",un=Jt()?"bottom-end":"bottom-start",dn=Jt()?"bottom-start":"bottom-end",hn=Jt()?"left-start":"right-start",pn=Jt()?"right-start":"left-start",mn={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},fn={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class gn extends we{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=Te.next(this._element,an)[0]||Te.prev(this._element,an)[0]||Te.findOne(an,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return mn}static get DefaultType(){return fn}static get NAME(){return Qe}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Wt(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!fe.trigger(this._element,"show.bs.dropdown",t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))fe.on(t,"mouseover",zt);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(sn),this._element.classList.add(sn),fe.trigger(this._element,"shown.bs.dropdown",t)}}hide(){if(Wt(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!fe.trigger(this._element,"hide.bs.dropdown",t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))fe.off(t,"mouseover",zt);this._popper&&this._popper.destroy(),this._menu.classList.remove(sn),this._element.classList.remove(sn),this._element.setAttribute("aria-expanded","false"),be.removeDataAttribute(this._menu,"popper"),fe.trigger(this._element,"hidden.bs.dropdown",t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!Vt(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Qe.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===i)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=this._parent:Vt(this._config.reference)?t=$t(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=It(t,this._menu,e)}_isShown(){return this._menu.classList.contains(sn)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return hn;if(t.classList.contains("dropstart"))return pn;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?cn:ln:e?dn:un}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(be.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...Gt(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const n=Te.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>Rt(t)));n.length&&Xt(n,e,t===tn,!n.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=gn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=Te.find(on);for(const n of e){const e=gn.getInstance(n);if(!e||!1===e._config.autoClose)continue;const i=t.composedPath(),s=i.includes(e._menu);if(i.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const r={relatedTarget:e._element};"click"===t.type&&(r.clickEvent=t),e._completeHide(r)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),n="Escape"===t.key,i=[Xe,tn].includes(t.key);if(!i&&!n)return;if(e&&!n)return;t.preventDefault();const s=this.matches(rn)?this:Te.prev(this,rn)[0]||Te.next(this,rn)[0]||Te.findOne(rn,t.delegateTarget.parentNode),r=gn.getOrCreateInstance(s);if(i)return t.stopPropagation(),r.show(),void r._selectMenuItem(t);r._isShown()&&(t.stopPropagation(),r.hide(),s.focus())}}fe.on(document,nn,rn,gn.dataApiKeydownHandler),fe.on(document,nn,an,gn.dataApiKeydownHandler),fe.on(document,en,gn.clearMenus),fe.on(document,"keyup.bs.dropdown.data-api",gn.clearMenus),fe.on(document,en,rn,(function(t){t.preventDefault(),gn.getOrCreateInstance(this).toggle()})),Kt(gn);const vn="backdrop",yn="show",bn="mousedown.bs.backdrop",_n={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},wn={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class kn extends _e{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return _n}static get DefaultType(){return wn}static get NAME(){return vn}show(t){if(!this._config.isVisible)return void Gt(t);this._append();const e=this._getElement();this._config.isAnimated&&Yt(e),e.classList.add(yn),this._emulateAnimation((()=>{Gt(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(yn),this._emulateAnimation((()=>{this.dispose(),Gt(t)}))):Gt(t)}dispose(){this._isAppended&&(fe.off(this._element,bn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=$t(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),fe.on(t,bn,(()=>{Gt(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){Qt(t,this._getElement(),this._config.isAnimated)}}const Tn=".bs.focustrap",xn="backward",En={autofocus:!0,trapElement:null},Dn={autofocus:"boolean",trapElement:"element"};class Sn extends _e{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return En}static get DefaultType(){return Dn}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),fe.off(document,Tn),fe.on(document,"focusin.bs.focustrap",(t=>this._handleFocusin(t))),fe.on(document,"keydown.tab.bs.focustrap",(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,fe.off(document,Tn))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const n=Te.focusableChildren(e);0===n.length?e.focus():this._lastTabNavDirection===xn?n[n.length-1].focus():n[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?xn:"forward")}}const On=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Ln=".sticky-top",Cn="padding-right",Mn="margin-right";class An{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Cn,(e=>e+t)),this._setElementAttributes(On,Cn,(e=>e+t)),this._setElementAttributes(Ln,Mn,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Cn),this._resetElementAttributes(On,Cn),this._resetElementAttributes(Ln,Mn)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,n){const i=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+i)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${n(Number.parseFloat(s))}px`)}))}_saveInitialAttribute(t,e){const n=t.style.getPropertyValue(e);n&&be.setDataAttribute(t,e,n)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const n=be.getDataAttribute(t,e);null!==n?(be.removeDataAttribute(t,e),t.style.setProperty(e,n)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if(Vt(t))e(t);else for(const n of Te.find(t,this._element))e(n)}}const In=".bs.modal",Nn="hidden.bs.modal",Fn="show.bs.modal",Pn="modal-open",jn="show",qn="modal-static",Hn={backdrop:!0,focus:!0,keyboard:!0},Vn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class $n extends we{constructor(t,e){super(t,e),this._dialog=Te.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new An,this._addEventListeners()}static get Default(){return Hn}static get DefaultType(){return Vn}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown||this._isTransitioning)return;fe.trigger(this._element,Fn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Pn),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){if(!this._isShown||this._isTransitioning)return;fe.trigger(this._element,"hide.bs.modal").defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(jn),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()))}dispose(){fe.off(window,In),fe.off(this._dialog,In),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new kn({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Sn({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=Te.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),Yt(this._element),this._element.classList.add(jn);this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,fe.trigger(this._element,"shown.bs.modal",{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){fe.on(this._element,"keydown.dismiss.bs.modal",(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),fe.on(window,"resize.bs.modal",(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),fe.on(this._element,"mousedown.dismiss.bs.modal",(t=>{fe.one(this._element,"click.dismiss.bs.modal",(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(Pn),this._resetAdjustments(),this._scrollBar.reset(),fe.trigger(this._element,Nn)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(fe.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(qn)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(qn),this._queueCallback((()=>{this._element.classList.remove(qn),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),n=e>0;if(n&&!t){const t=Jt()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!n&&t){const t=Jt()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const n=$n.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===n[t])throw new TypeError(`No method named "${t}"`);n[t](e)}}))}}fe.on(document,"click.bs.modal.data-api",'[data-bs-toggle="modal"]',(function(t){const e=Te.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),fe.one(e,Fn,(t=>{t.defaultPrevented||fe.one(e,Nn,(()=>{Rt(this)&&this.focus()}))}));const n=Te.findOne(".modal.show");n&&$n.getInstance(n).hide();$n.getOrCreateInstance(e).toggle(this)})),xe($n),Kt($n);const Rn="show",Wn="showing",Bn="hiding",zn=".offcanvas.show",Yn="hidePrevented.bs.offcanvas",Un="hidden.bs.offcanvas",Zn={backdrop:!0,keyboard:!0,scroll:!1},Jn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Kn extends we{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Zn}static get DefaultType(){return Jn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown)return;if(fe.trigger(this._element,"show.bs.offcanvas",{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new An).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Wn);this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Rn),this._element.classList.remove(Wn),fe.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:t})}),this._element,!0)}hide(){if(!this._isShown)return;if(fe.trigger(this._element,"hide.bs.offcanvas").defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Bn),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove(Rn,Bn),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new An).reset(),fe.trigger(this._element,Un)}),this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new kn({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():fe.trigger(this._element,Yn)}:null})}_initializeFocusTrap(){return new Sn({trapElement:this._element})}_addEventListeners(){fe.on(this._element,"keydown.dismiss.bs.offcanvas",(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():fe.trigger(this._element,Yn))}))}static jQueryInterface(t){return this.each((function(){const e=Kn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}fe.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',(function(t){const e=Te.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),Wt(this))return;fe.one(e,Un,(()=>{Rt(this)&&this.focus()}));const n=Te.findOne(zn);n&&n!==e&&Kn.getInstance(n).hide();Kn.getOrCreateInstance(e).toggle(this)})),fe.on(window,"load.bs.offcanvas.data-api",(()=>{for(const t of Te.find(zn))Kn.getOrCreateInstance(t).show()})),fe.on(window,"resize.bs.offcanvas",(()=>{for(const t of Te.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Kn.getOrCreateInstance(t).hide()})),xe(Kn),Kt(Kn);const Gn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Qn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Xn=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,ti=(t,e)=>{const n=t.nodeName.toLowerCase();return e.includes(n)?!Qn.has(n)||Boolean(Xn.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(n)))};const ei={allowList:Gn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},ni={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},ii={entry:"(string|element|function|null)",selector:"(string|element)"};class si extends _e{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return ei}static get DefaultType(){return ni}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,n]of Object.entries(this._config.content))this._setContent(t,n,e);const e=t.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&e.classList.add(...n.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,n]of Object.entries(t))super._typeCheckConfig({selector:e,entry:n},ii)}_setContent(t,e,n){const i=Te.findOne(n,t);i&&((e=this._resolvePossibleFunction(e))?Vt(e)?this._putElementInTemplate($t(e),i):this._config.html?i.innerHTML=this._maybeSanitize(e):i.textContent=e:i.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,n){if(!t.length)return t;if(n&&"function"==typeof n)return n(t);const i=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...i.body.querySelectorAll("*"));for(const t of s){const n=t.nodeName.toLowerCase();if(!Object.keys(e).includes(n)){t.remove();continue}const i=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[n]||[]);for(const e of i)ti(e,s)||t.removeAttribute(e.nodeName)}return i.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return Gt(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const ri=new Set(["sanitize","allowList","sanitizeFn"]),oi="fade",ai="show",li=".modal",ci="hide.bs.modal",ui="hover",di="focus",hi={AUTO:"auto",TOP:"top",RIGHT:Jt()?"left":"right",BOTTOM:"bottom",LEFT:Jt()?"right":"left"},pi={allowList:Gn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},mi={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class fi extends we{constructor(t,e){if(void 0===i)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return pi}static get DefaultType(){return mi}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),fe.off(this._element.closest(li),ci,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=fe.trigger(this._element,this.constructor.eventName("show")),e=(Bt(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(n),fe.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add(ai),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))fe.on(t,"mouseover",zt);this._queueCallback((()=>{fe.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(fe.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(ai),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))fe.off(t,"mouseover",zt);this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),fe.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(oi,ai),e.classList.add(`bs-${this.constructor.NAME}-auto`);const n=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",n),this._isAnimated()&&e.classList.add(oi),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new si({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(oi)}_isShown(){return this.tip&&this.tip.classList.contains(ai)}_createPopper(t){const e=Gt(this._config.placement,[this,t,this._element]),n=hi[e.toUpperCase()];return It(this._element,t,this._getPopperConfig(n))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return Gt(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...Gt(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)fe.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===ui?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),n=e===ui?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");fe.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?di:ui]=!0,e._enter()})),fe.on(this._element,n,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?di:ui]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},fe.on(this._element.closest(li),ci,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=be.getDataAttributes(this._element);for(const t of Object.keys(e))ri.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:$t(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,n]of Object.entries(this._config))this.constructor.Default[e]!==n&&(t[e]=n);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=fi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}Kt(fi);const gi={...fi.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},vi={...fi.DefaultType,content:"(null|string|element|function)"};class yi extends fi{static get Default(){return gi}static get DefaultType(){return vi}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=yi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}Kt(yi);const bi="click.bs.scrollspy",_i="active",wi="[href]",ki={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ti={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class xi extends we{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return ki}static get DefaultType(){return Ti}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=$t(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(fe.off(this._config.target,bi),fe.on(this._config.target,bi,wi,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const n=this._rootElement||window,i=e.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:i,behavior:"smooth"});n.scrollTop=i}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),n=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},i=(this._rootElement||document.documentElement).scrollTop,s=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const r of t){if(!r.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(r));continue}const t=r.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(n(r),!i)return}else s||t||n(r)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=Te.find(wi,this._config.target);for(const e of t){if(!e.hash||Wt(e))continue;const t=Te.findOne(decodeURI(e.hash),this._element);Rt(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(_i),this._activateParents(t),fe.trigger(this._element,"activate.bs.scrollspy",{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))Te.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(_i);else for(const e of Te.parents(t,".nav, .list-group"))for(const t of Te.prev(e,".nav-link, .nav-item > .nav-link, .list-group-item"))t.classList.add(_i)}_clearActiveClass(t){t.classList.remove(_i);const e=Te.find("[href].active",t);for(const t of e)t.classList.remove(_i)}static jQueryInterface(t){return this.each((function(){const e=xi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}fe.on(window,"load.bs.scrollspy.data-api",(()=>{for(const t of Te.find('[data-bs-spy="scroll"]'))xi.getOrCreateInstance(t)})),Kt(xi);const Ei="ArrowLeft",Di="ArrowRight",Si="ArrowUp",Oi="ArrowDown",Li="Home",Ci="End",Mi="active",Ai="fade",Ii="show",Ni=".dropdown-toggle",Fi='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Pi=`.nav-link:not(.dropdown-toggle), .list-group-item:not(.dropdown-toggle), [role="tab"]:not(.dropdown-toggle), ${Fi}`;class ji extends we{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),fe.on(this._element,"keydown.bs.tab",(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),n=e?fe.trigger(e,"hide.bs.tab",{relatedTarget:t}):null;fe.trigger(t,"show.bs.tab",{relatedTarget:e}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){if(!t)return;t.classList.add(Mi),this._activate(Te.getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),fe.trigger(t,"shown.bs.tab",{relatedTarget:e})):t.classList.add(Ii)}),t,t.classList.contains(Ai))}_deactivate(t,e){if(!t)return;t.classList.remove(Mi),t.blur(),this._deactivate(Te.getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),fe.trigger(t,"hidden.bs.tab",{relatedTarget:e})):t.classList.remove(Ii)}),t,t.classList.contains(Ai))}_keydown(t){if(![Ei,Di,Si,Oi,Li,Ci].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!Wt(t)));let n;if([Li,Ci].includes(t.key))n=e[t.key===Li?0:e.length-1];else{const i=[Di,Oi].includes(t.key);n=Xt(e,t.target,i,!0)}n&&(n.focus({preventScroll:!0}),ji.getOrCreateInstance(n).show())}_getChildren(){return Te.find(Pi,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),n=this._getOuterElement(t);t.setAttribute("aria-selected",e),n!==t&&this._setAttributeIfNotExists(n,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=Te.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const n=this._getOuterElement(t);if(!n.classList.contains("dropdown"))return;const i=(t,i)=>{const s=Te.findOne(t,n);s&&s.classList.toggle(i,e)};i(Ni,Mi),i(".dropdown-menu",Ii),n.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,n){t.hasAttribute(e)||t.setAttribute(e,n)}_elemIsActive(t){return t.classList.contains(Mi)}_getInnerElement(t){return t.matches(Pi)?t:Te.findOne(Pi,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=ji.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}fe.on(document,"click.bs.tab",Fi,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),Wt(this)||ji.getOrCreateInstance(this).show()})),fe.on(window,"load.bs.tab",(()=>{for(const t of Te.find('.active[data-bs-toggle="tab"], .active[data-bs-toggle="pill"], .active[data-bs-toggle="list"]'))ji.getOrCreateInstance(t)})),Kt(ji);const qi="hide",Hi="show",Vi="showing",$i={animation:"boolean",autohide:"boolean",delay:"number"},Ri={animation:!0,autohide:!0,delay:5e3};class Wi extends we{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Ri}static get DefaultType(){return $i}static get NAME(){return"toast"}show(){if(fe.trigger(this._element,"show.bs.toast").defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(qi),Yt(this._element),this._element.classList.add(Hi,Vi),this._queueCallback((()=>{this._element.classList.remove(Vi),fe.trigger(this._element,"shown.bs.toast"),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this.isShown())return;if(fe.trigger(this._element,"hide.bs.toast").defaultPrevented)return;this._element.classList.add(Vi),this._queueCallback((()=>{this._element.classList.add(qi),this._element.classList.remove(Vi,Hi),fe.trigger(this._element,"hidden.bs.toast")}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Hi),super.dispose()}isShown(){return this._element.classList.contains(Hi)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const n=t.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){fe.on(this._element,"mouseover.bs.toast",(t=>this._onInteraction(t,!0))),fe.on(this._element,"mouseout.bs.toast",(t=>this._onInteraction(t,!1))),fe.on(this._element,"focusin.bs.toast",(t=>this._onInteraction(t,!0))),fe.on(this._element,"focusout.bs.toast",(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=Wi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}xe(Wi),Kt(Wi)},424:function(t){window,t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(e,n,i){void 0===e&&(e=null),void 0===n&&(n=null),void 0===i&&(i="en-US"),this.dateInstance="object"==typeof n&&null!==n?n.parse(e instanceof t?e.clone().toJSDate():e):"string"==typeof n?t.parseDateTime(e,n,i):e?t.parseDateTime(e):t.parseDateTime(new Date),this.lang=i}return t.parseDateTime=function(e,n,i){if(void 0===n&&(n="YYYY-MM-DD"),void 0===i&&(i="en-US"),!e)return new Date(NaN);if(e instanceof Date)return new Date(e);if(e instanceof t)return e.clone().toJSDate();if(/^-?\d{10,}$/.test(e))return t.getDateZeroTime(new Date(Number(e)));if("string"==typeof e){for(var s=[],r=null;null!=(r=t.regex.exec(n));)"\\"!==r[1]&&s.push(r);if(s.length){var o={year:null,month:null,shortMonth:null,longMonth:null,day:null,value:""};s[0].index>0&&(o.value+=".*?");for(var a=0,l=Object.entries(s);a<l.length;a++){var c=l[a],u=c[0],d=c[1],h=Number(u),p=t.formatPatterns(d[0],i),m=p.group,f=p.pattern;o[m]=h+1,o.value+=f,o.value+=".*?"}var g=new RegExp("^"+o.value+"$");if(g.test(e)){var v=g.exec(e),y=Number(v[o.year]),b=null;o.month?b=Number(v[o.month])-1:o.shortMonth?b=t.shortMonths(i).indexOf(v[o.shortMonth]):o.longMonth&&(b=t.longMonths(i).indexOf(v[o.longMonth]));var _=Number(v[o.day])||1;return new Date(y,b,_,0,0,0,0)}}}return t.getDateZeroTime(new Date(e))},t.convertArray=function(e,n){return e.map((function(e){return e instanceof Array?e.map((function(e){return new t(e,n)})):new t(e,n)}))},t.getDateZeroTime=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)},t.shortMonths=function(e){return t.MONTH_JS.map((function(t){return new Date(2019,t).toLocaleString(e,{month:"short"})}))},t.longMonths=function(e){return t.MONTH_JS.map((function(t){return new Date(2019,t).toLocaleString(e,{month:"long"})}))},t.formatPatterns=function(e,n){switch(e){case"YY":case"YYYY":return{group:"year",pattern:"(\\d{"+e.length+"})"};case"M":return{group:"month",pattern:"(\\d{1,2})"};case"MM":return{group:"month",pattern:"(\\d{2})"};case"MMM":return{group:"shortMonth",pattern:"("+t.shortMonths(n).join("|")+")"};case"MMMM":return{group:"longMonth",pattern:"("+t.longMonths(n).join("|")+")"};case"D":return{group:"day",pattern:"(\\d{1,2})"};case"DD":return{group:"day",pattern:"(\\d{2})"}}},t.prototype.toJSDate=function(){return this.dateInstance},t.prototype.toLocaleString=function(t,e){return this.dateInstance.toLocaleString(t,e)},t.prototype.toDateString=function(){return this.dateInstance.toDateString()},t.prototype.getSeconds=function(){return this.dateInstance.getSeconds()},t.prototype.getDay=function(){return this.dateInstance.getDay()},t.prototype.getTime=function(){return this.dateInstance.getTime()},t.prototype.getDate=function(){return this.dateInstance.getDate()},t.prototype.getMonth=function(){return this.dateInstance.getMonth()},t.prototype.getFullYear=function(){return this.dateInstance.getFullYear()},t.prototype.setMonth=function(t){return this.dateInstance.setMonth(t)},t.prototype.setHours=function(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.dateInstance.setHours(t,e,n,i)},t.prototype.setSeconds=function(t){return this.dateInstance.setSeconds(t)},t.prototype.setDate=function(t){return this.dateInstance.setDate(t)},t.prototype.setFullYear=function(t){return this.dateInstance.setFullYear(t)},t.prototype.getWeek=function(t){var e=new Date(this.timestamp()),n=(this.getDay()+(7-t))%7;e.setDate(e.getDate()-n);var i=e.getTime();return e.setMonth(0,1),e.getDay()!==t&&e.setMonth(0,1+(4-e.getDay()+7)%7),1+Math.ceil((i-e.getTime())/6048e5)},t.prototype.clone=function(){return new t(this.toJSDate())},t.prototype.isBetween=function(t,e,n){switch(void 0===n&&(n="()"),n){default:case"()":return this.timestamp()>t.getTime()&&this.timestamp()<e.getTime();case"[)":return this.timestamp()>=t.getTime()&&this.timestamp()<e.getTime();case"(]":return this.timestamp()>t.getTime()&&this.timestamp()<=e.getTime();case"[]":return this.timestamp()>=t.getTime()&&this.timestamp()<=e.getTime()}},t.prototype.isBefore=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return t.getTime()>this.getTime();case"day":case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(t.getFullYear(),t.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case"year":case"years":return t.getFullYear()>this.getFullYear()}throw new Error("isBefore: Invalid unit!")},t.prototype.isSameOrBefore=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return t.getTime()>=this.getTime();case"day":case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(t.getFullYear(),t.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error("isSameOrBefore: Invalid unit!")},t.prototype.isAfter=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return this.getTime()>t.getTime();case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(t.getFullYear(),t.getMonth(),1).getTime();case"year":case"years":return this.getFullYear()>t.getFullYear()}throw new Error("isAfter: Invalid unit!")},t.prototype.isSameOrAfter=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return this.getTime()>=t.getTime();case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(t.getFullYear(),t.getMonth(),1).getTime()}throw new Error("isSameOrAfter: Invalid unit!")},t.prototype.isSame=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":return this.getTime()===t.getTime();case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(t.getFullYear(),t.getMonth(),1).getTime()}throw new Error("isSame: Invalid unit!")},t.prototype.add=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":this.setSeconds(this.getSeconds()+t);break;case"day":case"days":this.setDate(this.getDate()+t);break;case"month":case"months":this.setMonth(this.getMonth()+t)}return this},t.prototype.subtract=function(t,e){switch(void 0===e&&(e="seconds"),e){case"second":case"seconds":this.setSeconds(this.getSeconds()-t);break;case"day":case"days":this.setDate(this.getDate()-t);break;case"month":case"months":this.setMonth(this.getMonth()-t)}return this},t.prototype.diff=function(t,e){switch(void 0===e&&(e="seconds"),e){default:case"second":case"seconds":return this.getTime()-t.getTime();case"day":case"days":return Math.round((this.timestamp()-t.getTime())/864e5);case"month":case"months":}},t.prototype.format=function(e,n){if(void 0===n&&(n="en-US"),"object"==typeof e)return e.output(this.clone().toJSDate());for(var i="",s=[],r=null;null!=(r=t.regex.exec(e));)"\\"!==r[1]&&s.push(r);if(s.length){s[0].index>0&&(i+=e.substring(0,s[0].index));for(var o=0,a=Object.entries(s);o<a.length;o++){var l=a[o],c=l[0],u=l[1],d=Number(c);i+=this.formatTokens(u[0],n),s[d+1]&&(i+=e.substring(u.index+u[0].length,s[d+1].index)),d===s.length-1&&(i+=e.substring(u.index+u[0].length))}}return i.replace(/\\/g,"")},t.prototype.timestamp=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0).getTime()},t.prototype.formatTokens=function(e,n){switch(e){case"YY":return String(this.getFullYear()).slice(-2);case"YYYY":return String(this.getFullYear());case"M":return String(this.getMonth()+1);case"MM":return("0"+(this.getMonth()+1)).slice(-2);case"MMM":return t.shortMonths(n)[this.getMonth()];case"MMMM":return t.longMonths(n)[this.getMonth()];case"D":return String(this.getDate());case"DD":return("0"+this.getDate()).slice(-2);default:return""}},t.regex=/(\\)?(Y{2,4}|M{1,4}|D{1,2}|d{1,4})/g,t.MONTH_JS=[0,1,2,3,4,5,6,7,8,9,10,11],t}();e.DateTime=i},function(t,e,n){"use strict";var i,s=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),s=0;for(e=0;e<n;e++)for(var r=arguments[e],o=0,a=r.length;o<a;o++,s++)i[s]=r[o];return i};Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),a=n(0),l=n(3),c=n(2),u=function(t){function e(e){var n=t.call(this,e)||this;return n.preventClick=!1,n.bindEvents(),n}return s(e,t),e.prototype.scrollToDate=function(t){if(this.options.scrollToDate){var e=this.options.startDate instanceof a.DateTime?this.options.startDate.clone():null,n=this.options.endDate instanceof a.DateTime?this.options.endDate.clone():null;!this.options.startDate||t&&t!==this.options.element?t&&this.options.endDate&&t===this.options.elementEnd&&(n.setDate(1),this.options.numberOfMonths>1&&n.isAfter(e)&&n.setMonth(n.getMonth()-(this.options.numberOfMonths-1)),this.calendars[0]=n.clone()):(e.setDate(1),this.calendars[0]=e.clone())}},e.prototype.bindEvents=function(){document.addEventListener("click",this.onClick.bind(this),!0),this.ui=document.createElement("div"),this.ui.className=l.litepicker,this.ui.style.display="none",this.ui.addEventListener("mouseenter",this.onMouseEnter.bind(this),!0),this.ui.addEventListener("mouseleave",this.onMouseLeave.bind(this),!1),this.options.autoRefresh?(this.options.element instanceof HTMLElement&&this.options.element.addEventListener("keyup",this.onInput.bind(this),!0),this.options.elementEnd instanceof HTMLElement&&this.options.elementEnd.addEventListener("keyup",this.onInput.bind(this),!0)):(this.options.element instanceof HTMLElement&&this.options.element.addEventListener("change",this.onInput.bind(this),!0),this.options.elementEnd instanceof HTMLElement&&this.options.elementEnd.addEventListener("change",this.onInput.bind(this),!0)),this.options.parentEl?this.options.parentEl instanceof HTMLElement?this.options.parentEl.appendChild(this.ui):document.querySelector(this.options.parentEl).appendChild(this.ui):this.options.inlineMode?this.options.element instanceof HTMLInputElement?this.options.element.parentNode.appendChild(this.ui):this.options.element.appendChild(this.ui):document.body.appendChild(this.ui),this.updateInput(),this.init(),"function"==typeof this.options.setup&&this.options.setup.call(this,this),this.render(),this.options.inlineMode&&this.show()},e.prototype.updateInput=function(){if(this.options.element instanceof HTMLInputElement){var t=this.options.startDate,e=this.options.endDate;if(this.options.singleMode&&t)this.options.element.value=t.format(this.options.format,this.options.lang);else if(!this.options.singleMode&&t&&e){var n=t.format(this.options.format,this.options.lang),i=e.format(this.options.format,this.options.lang);this.options.elementEnd instanceof HTMLInputElement?(this.options.element.value=n,this.options.elementEnd.value=i):this.options.element.value=""+n+this.options.delimiter+i}t||e||(this.options.element.value="",this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.value=""))}},e.prototype.isSamePicker=function(t){return t.closest("."+l.litepicker)===this.ui},e.prototype.shouldShown=function(t){return!t.disabled&&(t===this.options.element||this.options.elementEnd&&t===this.options.elementEnd)},e.prototype.shouldResetDatePicked=function(){return this.options.singleMode||2===this.datePicked.length},e.prototype.shouldSwapDatePicked=function(){return 2===this.datePicked.length&&this.datePicked[0].getTime()>this.datePicked[1].getTime()},e.prototype.shouldCheckLockDays=function(){return this.options.disallowLockDaysInRange&&2===this.datePicked.length},e.prototype.onClick=function(t){var e=t.target;if(t.target.shadowRoot&&(e=t.composedPath()[0]),e&&this.ui)if(this.shouldShown(e))this.show(e);else if(e.closest("."+l.litepicker)||!this.isShowning()){if(this.isSamePicker(e))if(this.emit("before:click",e),this.preventClick)this.preventClick=!1;else{if(e.classList.contains(l.dayItem)){if(t.preventDefault(),e.classList.contains(l.isLocked))return;if(this.shouldResetDatePicked()&&(this.datePicked.length=0),this.datePicked[this.datePicked.length]=new a.DateTime(e.dataset.time),this.shouldSwapDatePicked()){var n=this.datePicked[1].clone();this.datePicked[1]=this.datePicked[0].clone(),this.datePicked[0]=n.clone()}return this.shouldCheckLockDays()&&c.rangeIsLocked(this.datePicked,this.options)&&(this.emit("error:range",this.datePicked),this.datePicked.length=0),this.render(),this.emit.apply(this,r(["preselect"],r(this.datePicked).map((function(t){return t.clone()})))),void(this.options.autoApply&&(this.options.singleMode&&this.datePicked.length?(this.setDate(this.datePicked[0]),this.hide()):this.options.singleMode||2!==this.datePicked.length||(this.setDateRange(this.datePicked[0],this.datePicked[1]),this.hide())))}if(e.classList.contains(l.buttonPreviousMonth)){t.preventDefault();var i=0,s=this.options.switchingMonths||this.options.numberOfMonths;if(this.options.splitView){var o=e.closest("."+l.monthItem);i=c.findNestedMonthItem(o),s=1}return this.calendars[i].setMonth(this.calendars[i].getMonth()-s),this.gotoDate(this.calendars[i],i),void this.emit("change:month",this.calendars[i],i)}if(e.classList.contains(l.buttonNextMonth))return t.preventDefault(),i=0,s=this.options.switchingMonths||this.options.numberOfMonths,this.options.splitView&&(o=e.closest("."+l.monthItem),i=c.findNestedMonthItem(o),s=1),this.calendars[i].setMonth(this.calendars[i].getMonth()+s),this.gotoDate(this.calendars[i],i),void this.emit("change:month",this.calendars[i],i);e.classList.contains(l.buttonCancel)&&(t.preventDefault(),this.hide(),this.emit("button:cancel")),e.classList.contains(l.buttonApply)&&(t.preventDefault(),this.options.singleMode&&this.datePicked.length?this.setDate(this.datePicked[0]):this.options.singleMode||2!==this.datePicked.length||this.setDateRange(this.datePicked[0],this.datePicked[1]),this.hide(),this.emit("button:apply",this.options.startDate,this.options.endDate))}}else this.hide()},e.prototype.showTooltip=function(t,e){var n=this.ui.querySelector("."+l.containerTooltip);n.style.visibility="visible",n.innerHTML=e;var i=this.ui.getBoundingClientRect(),s=n.getBoundingClientRect(),r=t.getBoundingClientRect(),o=r.top,a=r.left;if(this.options.inlineMode&&this.options.parentEl){var c=this.ui.parentNode.getBoundingClientRect();o-=c.top,a-=c.left}else o-=i.top,a-=i.left;o-=s.height,a-=s.width/2,a+=r.width/2,n.style.top=o+"px",n.style.left=a+"px",this.emit("tooltip",n,t)},e.prototype.hideTooltip=function(){this.ui.querySelector("."+l.containerTooltip).style.visibility="hidden"},e.prototype.shouldAllowMouseEnter=function(t){return!this.options.singleMode&&!t.classList.contains(l.isLocked)},e.prototype.shouldAllowRepick=function(){return this.options.elementEnd&&this.options.allowRepick&&this.options.startDate&&this.options.endDate},e.prototype.isDayItem=function(t){return t.classList.contains(l.dayItem)},e.prototype.onMouseEnter=function(t){var e=this,n=t.target;if(this.isDayItem(n)&&this.shouldAllowMouseEnter(n)){if(this.shouldAllowRepick()&&(this.triggerElement===this.options.element?this.datePicked[0]=this.options.endDate.clone():this.triggerElement===this.options.elementEnd&&(this.datePicked[0]=this.options.startDate.clone())),1!==this.datePicked.length)return;var i=this.ui.querySelector("."+l.dayItem+'[data-time="'+this.datePicked[0].getTime()+'"]'),s=this.datePicked[0].clone(),r=new a.DateTime(n.dataset.time),o=!1;if(s.getTime()>r.getTime()){var c=s.clone();s=r.clone(),r=c.clone(),o=!0}if(Array.prototype.slice.call(this.ui.querySelectorAll("."+l.dayItem)).forEach((function(t){var n=new a.DateTime(t.dataset.time),i=e.renderDay(n);n.isBetween(s,r)&&i.classList.add(l.isInRange),t.className=i.className})),n.classList.add(l.isEndDate),o?(i&&i.classList.add(l.isFlipped),n.classList.add(l.isFlipped)):(i&&i.classList.remove(l.isFlipped),n.classList.remove(l.isFlipped)),this.options.showTooltip){var u=r.diff(s,"day")+1;if("function"==typeof this.options.tooltipNumber&&(u=this.options.tooltipNumber.call(this,u)),u>0){var d=this.pluralSelector(u),h=u+" "+(this.options.tooltipText[d]?this.options.tooltipText[d]:"["+d+"]");this.showTooltip(n,h);var p=window.navigator.userAgent,m=/(iphone|ipad)/i.test(p),f=/OS 1([0-2])/i.test(p);m&&f&&n.dispatchEvent(new Event("click"))}else this.hideTooltip()}}},e.prototype.onMouseLeave=function(t){t.target,this.options.allowRepick&&(!this.options.allowRepick||this.options.startDate||this.options.endDate)&&(this.datePicked.length=0,this.render())},e.prototype.onInput=function(t){var e=this.parseInput(),n=e[0],i=e[1],s=this.options.format;if(this.options.elementEnd?n instanceof a.DateTime&&i instanceof a.DateTime&&n.format(s)===this.options.element.value&&i.format(s)===this.options.elementEnd.value:this.options.singleMode?n instanceof a.DateTime&&n.format(s)===this.options.element.value:n instanceof a.DateTime&&i instanceof a.DateTime&&""+n.format(s)+this.options.delimiter+i.format(s)===this.options.element.value){if(i&&n.getTime()>i.getTime()){var r=n.clone();n=i.clone(),i=r.clone()}this.options.startDate=new a.DateTime(n,this.options.format,this.options.lang),i&&(this.options.endDate=new a.DateTime(i,this.options.format,this.options.lang)),this.updateInput(),this.render();var o=n.clone(),l=0;(this.options.elementEnd?n.format(s)===t.target.value:t.target.value.startsWith(n.format(s)))||(o=i.clone(),l=this.options.numberOfMonths-1),this.emit("selected",this.getStartDate(),this.getEndDate()),this.gotoDate(o,l)}},e}(o.Calendar);e.Litepicker=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findNestedMonthItem=function(t){for(var e=t.parentNode.childNodes,n=0;n<e.length;n+=1)if(e.item(n)===t)return n;return 0},e.dateIsLocked=function(t,e,n){var i=!1;return e.lockDays.length&&(i=e.lockDays.filter((function(n){return n instanceof Array?t.isBetween(n[0],n[1],e.lockDaysInclusivity):n.isSame(t,"day")})).length),i||"function"!=typeof e.lockDaysFilter||(i=e.lockDaysFilter.call(this,t.clone(),null,n)),i},e.rangeIsLocked=function(t,e){var n=!1;return e.lockDays.length&&(n=e.lockDays.filter((function(n){if(n instanceof Array){var i=t[0].toDateString()===n[0].toDateString()&&t[1].toDateString()===n[1].toDateString();return n[0].isBetween(t[0],t[1],e.lockDaysInclusivity)||n[1].isBetween(t[0],t[1],e.lockDaysInclusivity)||i}return n.isBetween(t[0],t[1],e.lockDaysInclusivity)})).length),n||"function"!=typeof e.lockDaysFilter||(n=e.lockDaysFilter.call(this,t[0].clone(),t[1].clone(),t)),n}},function(t,e,n){var i=n(8);"string"==typeof i&&(i=[[t.i,i,""]]);var s={insert:function(t){var e=document.querySelector("head"),n=window._lastElementInsertedByStyleLoader;window.disableLitepickerStyles||(n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.insertBefore(t,e.firstChild),window._lastElementInsertedByStyleLoader=t)},singleton:!1};n(10)(i,s),i.locals&&(t.exports=i.locals)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1);e.Litepicker=i.Litepicker,n(11),window.Litepicker=i.Litepicker,e.default=i.Litepicker},function(t,e,n){"use strict";var i,s=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),o=n(0),a=n(3),l=n(2),c=function(t){function e(e){return t.call(this,e)||this}return s(e,t),e.prototype.render=function(){var t=this;this.emit("before:render",this.ui);var e=document.createElement("div");e.className=a.containerMain;var n=document.createElement("div");n.className=a.containerMonths,a["columns"+this.options.numberOfColumns]&&(n.classList.remove(a.columns2,a.columns3,a.columns4),n.classList.add(a["columns"+this.options.numberOfColumns])),this.options.splitView&&n.classList.add(a.splitView),this.options.showWeekNumbers&&n.classList.add(a.showWeekNumbers);for(var i=this.calendars[0].clone(),s=i.getMonth(),r=i.getMonth()+this.options.numberOfMonths,o=0,l=s;l<r;l+=1){var c=i.clone();c.setDate(1),c.setHours(0,0,0,0),this.options.splitView?c=this.calendars[o].clone():c.setMonth(l),n.appendChild(this.renderMonth(c,o)),o+=1}if(this.ui.innerHTML="",e.appendChild(n),this.options.resetButton){var u=void 0;"function"==typeof this.options.resetButton?u=this.options.resetButton.call(this):((u=document.createElement("button")).type="button",u.className=a.resetButton,u.innerHTML=this.options.buttonText.reset),u.addEventListener("click",(function(e){e.preventDefault(),t.clearSelection()})),e.querySelector("."+a.monthItem+":last-child").querySelector("."+a.monthItemHeader).appendChild(u)}this.ui.appendChild(e),this.options.autoApply&&!this.options.footerHTML||this.ui.appendChild(this.renderFooter()),this.options.showTooltip&&this.ui.appendChild(this.renderTooltip()),this.ui.dataset.plugins=(this.options.plugins||[]).join("|"),this.emit("render",this.ui)},e.prototype.renderMonth=function(t,e){var n=this,i=t.clone(),s=32-new Date(i.getFullYear(),i.getMonth(),32).getDate(),r=document.createElement("div");r.className=a.monthItem;var c=document.createElement("div");c.className=a.monthItemHeader;var u=document.createElement("div");if(this.options.dropdowns.months){var d=document.createElement("select");d.className=a.monthItemName;for(var h=0;h<12;h+=1){var p=document.createElement("option"),m=new o.DateTime(new Date(t.getFullYear(),h,2,0,0,0)),f=new o.DateTime(new Date(t.getFullYear(),h,1,0,0,0));p.value=String(h),p.text=m.toLocaleString(this.options.lang,{month:"long"}),p.disabled=this.options.minDate&&f.isBefore(new o.DateTime(this.options.minDate),"month")||this.options.maxDate&&f.isAfter(new o.DateTime(this.options.maxDate),"month"),p.selected=f.getMonth()===t.getMonth(),d.appendChild(p)}d.addEventListener("change",(function(t){var e=t.target,i=0;if(n.options.splitView){var s=e.closest("."+a.monthItem);i=l.findNestedMonthItem(s)}n.calendars[i].setMonth(Number(e.value)),n.render(),n.emit("change:month",n.calendars[i],i,t)})),u.appendChild(d)}else(m=document.createElement("strong")).className=a.monthItemName,m.innerHTML=t.toLocaleString(this.options.lang,{month:"long"}),u.appendChild(m);if(this.options.dropdowns.years){var g=document.createElement("select");g.className=a.monthItemYear;var v=this.options.dropdowns.minYear,y=this.options.dropdowns.maxYear?this.options.dropdowns.maxYear:(new Date).getFullYear();for(t.getFullYear()>y&&((p=document.createElement("option")).value=String(t.getFullYear()),p.text=String(t.getFullYear()),p.selected=!0,p.disabled=!0,g.appendChild(p)),h=y;h>=v;h-=1){p=document.createElement("option");var b=new o.DateTime(new Date(h,0,1,0,0,0));p.value=String(h),p.text=String(h),p.disabled=this.options.minDate&&b.isBefore(new o.DateTime(this.options.minDate),"year")||this.options.maxDate&&b.isAfter(new o.DateTime(this.options.maxDate),"year"),p.selected=t.getFullYear()===h,g.appendChild(p)}if(t.getFullYear()<v&&((p=document.createElement("option")).value=String(t.getFullYear()),p.text=String(t.getFullYear()),p.selected=!0,p.disabled=!0,g.appendChild(p)),"asc"===this.options.dropdowns.years){var _=Array.prototype.slice.call(g.childNodes).reverse();g.innerHTML="",_.forEach((function(t){t.innerHTML=t.value,g.appendChild(t)}))}g.addEventListener("change",(function(t){var e=t.target,i=0;if(n.options.splitView){var s=e.closest("."+a.monthItem);i=l.findNestedMonthItem(s)}n.calendars[i].setFullYear(Number(e.value)),n.render(),n.emit("change:year",n.calendars[i],i,t)})),u.appendChild(g)}else{var w=document.createElement("span");w.className=a.monthItemYear,w.innerHTML=String(t.getFullYear()),u.appendChild(w)}var k=document.createElement("button");k.type="button",k.className=a.buttonPreviousMonth,k.innerHTML=this.options.buttonText.previousMonth;var T=document.createElement("button");T.type="button",T.className=a.buttonNextMonth,T.innerHTML=this.options.buttonText.nextMonth,c.appendChild(k),c.appendChild(u),c.appendChild(T),this.options.minDate&&i.isSameOrBefore(new o.DateTime(this.options.minDate),"month")&&r.classList.add(a.noPreviousMonth),this.options.maxDate&&i.isSameOrAfter(new o.DateTime(this.options.maxDate),"month")&&r.classList.add(a.noNextMonth);var x=document.createElement("div");x.className=a.monthItemWeekdaysRow,this.options.showWeekNumbers&&(x.innerHTML="<div>W</div>");for(var E=1;E<=7;E+=1){var D=3+this.options.firstDay+E,S=document.createElement("div");S.innerHTML=this.weekdayName(D),S.title=this.weekdayName(D,"long"),x.appendChild(S)}var O=document.createElement("div");O.className=a.containerDays;var L=this.calcSkipDays(i);this.options.showWeekNumbers&&L&&O.appendChild(this.renderWeekNumber(i));for(var C=0;C<L;C+=1){var M=document.createElement("div");O.appendChild(M)}for(C=1;C<=s;C+=1)i.setDate(C),this.options.showWeekNumbers&&i.getDay()===this.options.firstDay&&O.appendChild(this.renderWeekNumber(i)),O.appendChild(this.renderDay(i));return r.appendChild(c),r.appendChild(x),r.appendChild(O),this.emit("render:month",r,t),r},e.prototype.renderDay=function(t){t.setHours();var e=document.createElement("div");if(e.className=a.dayItem,e.innerHTML=String(t.getDate()),e.dataset.time=String(t.getTime()),t.toDateString()===(new Date).toDateString()&&e.classList.add(a.isToday),this.datePicked.length)this.datePicked[0].toDateString()===t.toDateString()&&(e.classList.add(a.isStartDate),this.options.singleMode&&e.classList.add(a.isEndDate)),2===this.datePicked.length&&this.datePicked[1].toDateString()===t.toDateString()&&e.classList.add(a.isEndDate),2===this.datePicked.length&&t.isBetween(this.datePicked[0],this.datePicked[1])&&e.classList.add(a.isInRange);else if(this.options.startDate){var n=this.options.startDate,i=this.options.endDate;n.toDateString()===t.toDateString()&&(e.classList.add(a.isStartDate),this.options.singleMode&&e.classList.add(a.isEndDate)),i&&i.toDateString()===t.toDateString()&&e.classList.add(a.isEndDate),n&&i&&t.isBetween(n,i)&&e.classList.add(a.isInRange)}if(this.options.minDate&&t.isBefore(new o.DateTime(this.options.minDate))&&e.classList.add(a.isLocked),this.options.maxDate&&t.isAfter(new o.DateTime(this.options.maxDate))&&e.classList.add(a.isLocked),this.options.minDays>1&&1===this.datePicked.length){var s=this.options.minDays-1,r=this.datePicked[0].clone().subtract(s,"day"),c=this.datePicked[0].clone().add(s,"day");t.isBetween(r,this.datePicked[0],"(]")&&e.classList.add(a.isLocked),t.isBetween(this.datePicked[0],c,"[)")&&e.classList.add(a.isLocked)}if(this.options.maxDays&&1===this.datePicked.length){var u=this.options.maxDays;r=this.datePicked[0].clone().subtract(u,"day"),c=this.datePicked[0].clone().add(u,"day"),t.isSameOrBefore(r)&&e.classList.add(a.isLocked),t.isSameOrAfter(c)&&e.classList.add(a.isLocked)}return this.options.selectForward&&1===this.datePicked.length&&t.isBefore(this.datePicked[0])&&e.classList.add(a.isLocked),this.options.selectBackward&&1===this.datePicked.length&&t.isAfter(this.datePicked[0])&&e.classList.add(a.isLocked),l.dateIsLocked(t,this.options,this.datePicked)&&e.classList.add(a.isLocked),this.options.highlightedDays.length&&this.options.highlightedDays.filter((function(e){return e instanceof Array?t.isBetween(e[0],e[1],"[]"):e.isSame(t,"day")})).length&&e.classList.add(a.isHighlighted),e.tabIndex=e.classList.contains("is-locked")?-1:0,this.emit("render:day",e,t),e},e.prototype.renderFooter=function(){var t=document.createElement("div");if(t.className=a.containerFooter,this.options.footerHTML?t.innerHTML=this.options.footerHTML:t.innerHTML='\n <span class="'+a.previewDateRange+'"></span>\n <button type="button" class="'+a.buttonCancel+'">'+this.options.buttonText.cancel+'</button>\n <button type="button" class="'+a.buttonApply+'">'+this.options.buttonText.apply+"</button>\n ",this.options.singleMode){if(1===this.datePicked.length){var e=this.datePicked[0].format(this.options.format,this.options.lang);t.querySelector("."+a.previewDateRange).innerHTML=e}}else if(1===this.datePicked.length&&t.querySelector("."+a.buttonApply).setAttribute("disabled",""),2===this.datePicked.length){e=this.datePicked[0].format(this.options.format,this.options.lang);var n=this.datePicked[1].format(this.options.format,this.options.lang);t.querySelector("."+a.previewDateRange).innerHTML=""+e+this.options.delimiter+n}return this.emit("render:footer",t),t},e.prototype.renderWeekNumber=function(t){var e=document.createElement("div"),n=t.getWeek(this.options.firstDay);return e.className=a.weekNumber,e.innerHTML=53===n&&0===t.getMonth()?"53 / 1":n,e},e.prototype.renderTooltip=function(){var t=document.createElement("div");return t.className=a.containerTooltip,t},e.prototype.weekdayName=function(t,e){return void 0===e&&(e="short"),new Date(1970,0,t,12,0,0,0).toLocaleString(this.options.lang,{weekday:e})},e.prototype.calcSkipDays=function(t){var e=t.getDay()-this.options.firstDay;return e<0&&(e+=7),e},e}(r.LPCore);e.Calendar=c},function(t,e,n){"use strict";var i,s=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=n(7),a=n(0),l=n(1),c=function(t){function e(e){var n=t.call(this)||this;n.datePicked=[],n.calendars=[],n.options={element:null,elementEnd:null,parentEl:null,firstDay:1,format:"YYYY-MM-DD",lang:"en-US",delimiter:" - ",numberOfMonths:1,numberOfColumns:1,startDate:null,endDate:null,zIndex:9999,position:"auto",selectForward:!1,selectBackward:!1,splitView:!1,inlineMode:!1,singleMode:!0,autoApply:!0,allowRepick:!1,showWeekNumbers:!1,showTooltip:!0,scrollToDate:!0,mobileFriendly:!0,resetButton:!1,autoRefresh:!1,lockDaysFormat:"YYYY-MM-DD",lockDays:[],disallowLockDaysInRange:!1,lockDaysInclusivity:"[]",highlightedDaysFormat:"YYYY-MM-DD",highlightedDays:[],dropdowns:{minYear:1990,maxYear:null,months:!1,years:!1},buttonText:{apply:"Apply",cancel:"Cancel",previousMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>',nextMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>',reset:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">\n <path d="M0 0h24v24H0z" fill="none"/>\n <path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/>\n </svg>'},tooltipText:{one:"day",other:"days"}},n.options=r(r({},n.options),e.element.dataset),Object.keys(n.options).forEach((function(t){"true"!==n.options[t]&&"false"!==n.options[t]||(n.options[t]="true"===n.options[t])}));var i=r(r({},n.options.dropdowns),e.dropdowns),s=r(r({},n.options.buttonText),e.buttonText),o=r(r({},n.options.tooltipText),e.tooltipText);n.options=r(r({},n.options),e),n.options.dropdowns=r({},i),n.options.buttonText=r({},s),n.options.tooltipText=r({},o),n.options.elementEnd||(n.options.allowRepick=!1),n.options.lockDays.length&&(n.options.lockDays=a.DateTime.convertArray(n.options.lockDays,n.options.lockDaysFormat)),n.options.highlightedDays.length&&(n.options.highlightedDays=a.DateTime.convertArray(n.options.highlightedDays,n.options.highlightedDaysFormat));var l=n.parseInput(),c=l[0],u=l[1];n.options.startDate&&(n.options.singleMode||n.options.endDate)&&(c=new a.DateTime(n.options.startDate,n.options.format,n.options.lang)),c&&n.options.endDate&&(u=new a.DateTime(n.options.endDate,n.options.format,n.options.lang)),c instanceof a.DateTime&&!isNaN(c.getTime())&&(n.options.startDate=c),n.options.startDate&&u instanceof a.DateTime&&!isNaN(u.getTime())&&(n.options.endDate=u),!n.options.singleMode||n.options.startDate instanceof a.DateTime||(n.options.startDate=null),n.options.singleMode||n.options.startDate instanceof a.DateTime&&n.options.endDate instanceof a.DateTime||(n.options.startDate=null,n.options.endDate=null);for(var d=0;d<n.options.numberOfMonths;d+=1){var h=n.options.startDate instanceof a.DateTime?n.options.startDate.clone():new a.DateTime;if(!n.options.startDate&&(0===d||n.options.splitView)){var p=n.options.maxDate?new a.DateTime(n.options.maxDate):null,m=n.options.minDate?new a.DateTime(n.options.minDate):null,f=n.options.numberOfMonths-1;m&&p&&h.isAfter(p)?(h=m.clone()).setDate(1):!m&&p&&h.isAfter(p)&&((h=p.clone()).setDate(1),h.setMonth(h.getMonth()-f))}h.setDate(1),h.setMonth(h.getMonth()+d),n.calendars[d]=h}if(n.options.showTooltip)if(n.options.tooltipPluralSelector)n.pluralSelector=n.options.tooltipPluralSelector;else try{var g=new Intl.PluralRules(n.options.lang);n.pluralSelector=g.select.bind(g)}catch(t){n.pluralSelector=function(t){return 0===Math.abs(t)?"one":"other"}}return n}return s(e,t),e.add=function(t,e){l.Litepicker.prototype[t]=e},e.prototype.DateTime=function(t,e){return t?new a.DateTime(t,e):new a.DateTime},e.prototype.init=function(){var t=this;this.options.plugins&&this.options.plugins.length&&this.options.plugins.forEach((function(e){l.Litepicker.prototype.hasOwnProperty(e)?l.Litepicker.prototype[e].init.call(t,t):console.warn("Litepicker: plugin «"+e+"» not found.")}))},e.prototype.parseInput=function(){var t=this.options.delimiter,e=new RegExp(""+t),n=this.options.element instanceof HTMLInputElement?this.options.element.value.split(t):[];if(this.options.elementEnd){if(this.options.element instanceof HTMLInputElement&&this.options.element.value.length&&this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length)return[new a.DateTime(this.options.element.value,this.options.format),new a.DateTime(this.options.elementEnd.value,this.options.format)]}else if(this.options.singleMode){if(this.options.element instanceof HTMLInputElement&&this.options.element.value.length)return[new a.DateTime(this.options.element.value,this.options.format)]}else if(this.options.element instanceof HTMLInputElement&&e.test(this.options.element.value)&&n.length&&n.length%2==0){var i=n.slice(0,n.length/2).join(t),s=n.slice(n.length/2).join(t);return[new a.DateTime(i,this.options.format),new a.DateTime(s,this.options.format)]}return[]},e.prototype.isShowning=function(){return this.ui&&"none"!==this.ui.style.display},e.prototype.findPosition=function(t){var e=t.getBoundingClientRect(),n=this.ui.getBoundingClientRect(),i=this.options.position.split(" "),s=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,o=0,a=0;if("auto"!==i[0]&&/top|bottom/.test(i[0]))o=e[i[0]]+r,"top"===i[0]&&(o-=n.height);else{o=e.bottom+r;var l=e.bottom+n.height>window.innerHeight,c=e.top+r-n.height>=n.height;l&&c&&(o=e.top+r-n.height)}if(/left|right/.test(i[0])||i[1]&&"auto"!==i[1]&&/left|right/.test(i[1]))a=/left|right/.test(i[0])?e[i[0]]+s:e[i[1]]+s,"right"!==i[0]&&"right"!==i[1]||(a-=n.width);else{a=e.left+s,l=e.left+n.width>window.innerWidth;var u=e.right+s-n.width>=0;l&&u&&(a=e.right+s-n.width)}return{left:a,top:o}},e}(o.EventEmitter);e.LPCore=c},function(t,e,n){"use strict";var i,s="object"==typeof Reflect?Reflect:null,r=s&&"function"==typeof s.apply?s.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};i=s&&"function"==typeof s.ownKeys?s.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function u(t,e,n,i){var s,r,o,a;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(r=t._events)?(r=t._events=Object.create(null),t._eventsCount=0):(void 0!==r.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),r=t._events),o=r[e]),void 0===o)o=r[e]=n,++t._eventsCount;else if("function"==typeof o?o=r[e]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(s=c(t))>0&&o.length>s&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,a=l,console&&console.warn&&console.warn(a)}return t}function d(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,r(this.listener,this.target,t))}function h(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},s=d.bind(i);return s.listener=n,i.wrapFn=s,s}function p(t,e,n){var i=t._events;if(void 0===i)return[];var s=i[e];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(s):f(s,s.length)}function m(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");l=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var i="error"===t,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[t];if(void 0===l)return!1;if("function"==typeof l)r(l,this,e);else{var c=l.length,u=f(l,c);for(n=0;n<c;++n)r(u[n],this,e)}return!0},a.prototype.addListener=function(t,e){return u(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return u(this,t,e,!0)},a.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,h(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,h(this,t,e)),this},a.prototype.removeListener=function(t,e){var n,i,s,r,o;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(s=-1,r=n.length-1;r>=0;r--)if(n[r]===e||n[r].listener===e){o=n[r].listener,s=r;break}if(s<0)return this;0===s?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,s),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,o||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var s,r=Object.keys(n);for(i=0;i<r.length;++i)"removeListener"!==(s=r[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,n){(e=n(9)(!1)).push([t.i,':root{--litepicker-container-months-color-bg: #fff;--litepicker-container-months-box-shadow-color: #ddd;--litepicker-footer-color-bg: #fafafa;--litepicker-footer-box-shadow-color: #ddd;--litepicker-tooltip-color-bg: #fff;--litepicker-month-header-color: #333;--litepicker-button-prev-month-color: #9e9e9e;--litepicker-button-next-month-color: #9e9e9e;--litepicker-button-prev-month-color-hover: #2196f3;--litepicker-button-next-month-color-hover: #2196f3;--litepicker-month-width: calc(var(--litepicker-day-width) * 7);--litepicker-month-weekday-color: #9e9e9e;--litepicker-month-week-number-color: #9e9e9e;--litepicker-day-width: 38px;--litepicker-day-color: #333;--litepicker-day-color-hover: #2196f3;--litepicker-is-today-color: #f44336;--litepicker-is-in-range-color: #bbdefb;--litepicker-is-locked-color: #9e9e9e;--litepicker-is-start-color: #fff;--litepicker-is-start-color-bg: #2196f3;--litepicker-is-end-color: #fff;--litepicker-is-end-color-bg: #2196f3;--litepicker-button-cancel-color: #fff;--litepicker-button-cancel-color-bg: #9e9e9e;--litepicker-button-apply-color: #fff;--litepicker-button-apply-color-bg: #2196f3;--litepicker-button-reset-color: #909090;--litepicker-button-reset-color-hover: #2196f3;--litepicker-highlighted-day-color: #333;--litepicker-highlighted-day-color-bg: #ffeb3b}.show-week-numbers{--litepicker-month-width: calc(var(--litepicker-day-width) * 8)}.litepicker{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-size:0.8em;display:none}.litepicker button{border:none;background:none}.litepicker .container__main{display:-webkit-box;display:-ms-flexbox;display:flex}.litepicker .container__months{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;background-color:var(--litepicker-container-months-color-bg);border-radius:5px;-webkit-box-shadow:0 0 5px var(--litepicker-container-months-box-shadow-color);box-shadow:0 0 5px var(--litepicker-container-months-box-shadow-color);width:calc(var(--litepicker-month-width) + 10px);-webkit-box-sizing:content-box;box-sizing:content-box}.litepicker .container__months.columns-2{width:calc((var(--litepicker-month-width) * 2) + 20px)}.litepicker .container__months.columns-3{width:calc((var(--litepicker-month-width) * 3) + 30px)}.litepicker .container__months.columns-4{width:calc((var(--litepicker-month-width) * 4) + 40px)}.litepicker .container__months.split-view .month-item-header .button-previous-month,.litepicker .container__months.split-view .month-item-header .button-next-month{visibility:visible}.litepicker .container__months .month-item{padding:5px;width:var(--litepicker-month-width);-webkit-box-sizing:content-box;box-sizing:content-box}.litepicker .container__months .month-item-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;font-weight:500;padding:10px 5px;text-align:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--litepicker-month-header-color)}.litepicker .container__months .month-item-header div{-webkit-box-flex:1;-ms-flex:1;flex:1}.litepicker .container__months .month-item-header div>.month-item-name{margin-right:5px}.litepicker .container__months .month-item-header div>.month-item-year{padding:0}.litepicker .container__months .month-item-header .reset-button{color:var(--litepicker-button-reset-color)}.litepicker .container__months .month-item-header .reset-button>svg{fill:var(--litepicker-button-reset-color)}.litepicker .container__months .month-item-header .reset-button *{pointer-events:none}.litepicker .container__months .month-item-header .reset-button:hover{color:var(--litepicker-button-reset-color-hover)}.litepicker .container__months .month-item-header .reset-button:hover>svg{fill:var(--litepicker-button-reset-color-hover)}.litepicker .container__months .month-item-header .button-previous-month,.litepicker .container__months .month-item-header .button-next-month{visibility:hidden;text-decoration:none;padding:3px 5px;border-radius:3px;-webkit-transition:color 0.3s, border 0.3s;transition:color 0.3s, border 0.3s;cursor:default}.litepicker .container__months .month-item-header .button-previous-month *,.litepicker .container__months .month-item-header .button-next-month *{pointer-events:none}.litepicker .container__months .month-item-header .button-previous-month{color:var(--litepicker-button-prev-month-color)}.litepicker .container__months .month-item-header .button-previous-month>svg,.litepicker .container__months .month-item-header .button-previous-month>img{fill:var(--litepicker-button-prev-month-color)}.litepicker .container__months .month-item-header .button-previous-month:hover{color:var(--litepicker-button-prev-month-color-hover)}.litepicker .container__months .month-item-header .button-previous-month:hover>svg{fill:var(--litepicker-button-prev-month-color-hover)}.litepicker .container__months .month-item-header .button-next-month{color:var(--litepicker-button-next-month-color)}.litepicker .container__months .month-item-header .button-next-month>svg,.litepicker .container__months .month-item-header .button-next-month>img{fill:var(--litepicker-button-next-month-color)}.litepicker .container__months .month-item-header .button-next-month:hover{color:var(--litepicker-button-next-month-color-hover)}.litepicker .container__months .month-item-header .button-next-month:hover>svg{fill:var(--litepicker-button-next-month-color-hover)}.litepicker .container__months .month-item-weekdays-row{display:-webkit-box;display:-ms-flexbox;display:flex;justify-self:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;color:var(--litepicker-month-weekday-color)}.litepicker .container__months .month-item-weekdays-row>div{padding:5px 0;font-size:85%;-webkit-box-flex:1;-ms-flex:1;flex:1;width:var(--litepicker-day-width);text-align:center}.litepicker .container__months .month-item:first-child .button-previous-month{visibility:visible}.litepicker .container__months .month-item:last-child .button-next-month{visibility:visible}.litepicker .container__months .month-item.no-previous-month .button-previous-month{visibility:hidden}.litepicker .container__months .month-item.no-next-month .button-next-month{visibility:hidden}.litepicker .container__days{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;justify-self:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:center;-webkit-box-sizing:content-box;box-sizing:content-box}.litepicker .container__days>div,.litepicker .container__days>a{padding:5px 0;width:var(--litepicker-day-width)}.litepicker .container__days .day-item{color:var(--litepicker-day-color);text-align:center;text-decoration:none;border-radius:3px;-webkit-transition:color 0.3s, border 0.3s;transition:color 0.3s, border 0.3s;cursor:default}.litepicker .container__days .day-item:hover{color:var(--litepicker-day-color-hover);-webkit-box-shadow:inset 0 0 0 1px var(--litepicker-day-color-hover);box-shadow:inset 0 0 0 1px var(--litepicker-day-color-hover)}.litepicker .container__days .day-item.is-today{color:var(--litepicker-is-today-color)}.litepicker .container__days .day-item.is-locked{color:var(--litepicker-is-locked-color)}.litepicker .container__days .day-item.is-locked:hover{color:var(--litepicker-is-locked-color);-webkit-box-shadow:none;box-shadow:none;cursor:default}.litepicker .container__days .day-item.is-in-range{background-color:var(--litepicker-is-in-range-color);border-radius:0}.litepicker .container__days .day-item.is-start-date{color:var(--litepicker-is-start-color);background-color:var(--litepicker-is-start-color-bg);border-top-left-radius:5px;border-bottom-left-radius:5px;border-top-right-radius:0;border-bottom-right-radius:0}.litepicker .container__days .day-item.is-start-date.is-flipped{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:5px;border-bottom-right-radius:5px}.litepicker .container__days .day-item.is-end-date{color:var(--litepicker-is-end-color);background-color:var(--litepicker-is-end-color-bg);border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:5px;border-bottom-right-radius:5px}.litepicker .container__days .day-item.is-end-date.is-flipped{border-top-left-radius:5px;border-bottom-left-radius:5px;border-top-right-radius:0;border-bottom-right-radius:0}.litepicker .container__days .day-item.is-start-date.is-end-date{border-top-left-radius:5px;border-bottom-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px}.litepicker .container__days .day-item.is-highlighted{color:var(--litepicker-highlighted-day-color);background-color:var(--litepicker-highlighted-day-color-bg)}.litepicker .container__days .week-number{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:var(--litepicker-month-week-number-color);font-size:85%}.litepicker .container__footer{text-align:right;padding:10px 5px;margin:0 5px;background-color:var(--litepicker-footer-color-bg);-webkit-box-shadow:inset 0px 3px 3px 0px var(--litepicker-footer-box-shadow-color);box-shadow:inset 0px 3px 3px 0px var(--litepicker-footer-box-shadow-color);border-bottom-left-radius:5px;border-bottom-right-radius:5px}.litepicker .container__footer .preview-date-range{margin-right:10px;font-size:90%}.litepicker .container__footer .button-cancel{background-color:var(--litepicker-button-cancel-color-bg);color:var(--litepicker-button-cancel-color);border:0;padding:3px 7px 4px;border-radius:3px}.litepicker .container__footer .button-cancel *{pointer-events:none}.litepicker .container__footer .button-apply{background-color:var(--litepicker-button-apply-color-bg);color:var(--litepicker-button-apply-color);border:0;padding:3px 7px 4px;border-radius:3px;margin-left:10px;margin-right:10px}.litepicker .container__footer .button-apply:disabled{opacity:0.7}.litepicker .container__footer .button-apply *{pointer-events:none}.litepicker .container__tooltip{position:absolute;margin-top:-4px;padding:4px 8px;border-radius:4px;background-color:var(--litepicker-tooltip-color-bg);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.25);box-shadow:0 1px 3px rgba(0,0,0,0.25);white-space:nowrap;font-size:11px;pointer-events:none;visibility:hidden}.litepicker .container__tooltip:before{position:absolute;bottom:-5px;left:calc(50% - 5px);border-top:5px solid rgba(0,0,0,0.12);border-right:5px solid transparent;border-left:5px solid transparent;content:""}.litepicker .container__tooltip:after{position:absolute;bottom:-4px;left:calc(50% - 4px);border-top:4px solid var(--litepicker-tooltip-color-bg);border-right:4px solid transparent;border-left:4px solid transparent;content:""}\n',""]),e.locals={showWeekNumbers:"show-week-numbers",litepicker:"litepicker",containerMain:"container__main",containerMonths:"container__months",columns2:"columns-2",columns3:"columns-3",columns4:"columns-4",splitView:"split-view",monthItemHeader:"month-item-header",buttonPreviousMonth:"button-previous-month",buttonNextMonth:"button-next-month",monthItem:"month-item",monthItemName:"month-item-name",monthItemYear:"month-item-year",resetButton:"reset-button",monthItemWeekdaysRow:"month-item-weekdays-row",noPreviousMonth:"no-previous-month",noNextMonth:"no-next-month",containerDays:"container__days",dayItem:"day-item",isToday:"is-today",isLocked:"is-locked",isInRange:"is-in-range",isStartDate:"is-start-date",isFlipped:"is-flipped",isEndDate:"is-end-date",isHighlighted:"is-highlighted",weekNumber:"week-number",containerFooter:"container__footer",previewDateRange:"preview-date-range",buttonCancel:"button-cancel",buttonApply:"button-apply",containerTooltip:"container__tooltip"},t.exports=e},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n,i,s,r=t[1]||"",o=t[3];if(!o)return r;if(e&&"function"==typeof btoa){var a=(n=o,i=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),"/*# ".concat(s," */")),l=o.sources.map((function(t){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(t," */")}));return[r].concat(l).concat([a]).join("\n")}return[r].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var s={};if(i)for(var r=0;r<this.length;r++){var o=this[r][0];null!=o&&(s[o]=!0)}for(var a=0;a<t.length;a++){var l=[].concat(t[a]);i&&s[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";var i,s={},r=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}();function a(t,e){for(var n=[],i={},s=0;s<t.length;s++){var r=t[s],o=e.base?r[0]+e.base:r[0],a={css:r[1],media:r[2],sourceMap:r[3]};i[o]?i[o].parts.push(a):n.push(i[o]={id:o,parts:[a]})}return n}function l(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=s[i.id],o=0;if(r){for(r.refs++;o<r.parts.length;o++)r.parts[o](i.parts[o]);for(;o<i.parts.length;o++)r.parts.push(g(i.parts[o],e))}else{for(var a=[];o<i.parts.length;o++)a.push(g(i.parts[o],e));s[i.id]={id:i.id,refs:1,parts:a}}}}function c(t){var e=document.createElement("style");if(void 0===t.attributes.nonce){var i=n.nc;i&&(t.attributes.nonce=i)}if(Object.keys(t.attributes).forEach((function(n){e.setAttribute(n,t.attributes[n])})),"function"==typeof t.insert)t.insert(e);else{var s=o(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,i){var s=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=d(e,s);else{var r=document.createTextNode(s),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(r,o[e]):t.appendChild(r)}}function p(t,e,n){var i=n.css,s=n.media,r=n.sourceMap;if(s&&t.setAttribute("media",s),r&&btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var m=null,f=0;function g(t,e){var n,i,s;if(e.singleton){var r=f++;n=m||(m=c(e)),i=h.bind(null,n,r,!1),s=h.bind(null,n,r,!0)}else n=c(e),i=p.bind(null,n,e),s=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else s()}}t.exports=function(t,e){(e=e||{}).attributes="object"==typeof e.attributes?e.attributes:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r());var n=a(t,e);return l(n,e),function(t){for(var i=[],r=0;r<n.length;r++){var o=n[r],c=s[o.id];c&&(c.refs--,i.push(c))}t&&l(a(t,e),e);for(var u=0;u<i.length;u++){var d=i[u];if(0===d.refs){for(var h=0;h<d.parts.length;h++)d.parts[h]();delete s[d.id]}}}}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),r=n(1),o=n(2);r.Litepicker.prototype.show=function(t){void 0===t&&(t=null),this.emit("before:show",t);var e=t||this.options.element;if(this.triggerElement=e,!this.isShowning()){if(this.options.inlineMode)return this.ui.style.position="relative",this.ui.style.display="inline-block",this.ui.style.top=null,this.ui.style.left=null,this.ui.style.bottom=null,void(this.ui.style.right=null);this.scrollToDate(t),this.render(),this.ui.style.position="absolute",this.ui.style.display="block",this.ui.style.zIndex=this.options.zIndex;var n=this.findPosition(e);this.ui.style.top=n.top+"px",this.ui.style.left=n.left+"px",this.ui.style.right=null,this.ui.style.bottom=null,this.emit("show",t)}},r.Litepicker.prototype.hide=function(){this.isShowning()&&(this.datePicked.length=0,this.updateInput(),this.options.inlineMode?this.render():(this.ui.style.display="none",this.emit("hide")))},r.Litepicker.prototype.getDate=function(){return this.getStartDate()},r.Litepicker.prototype.getStartDate=function(){return this.options.startDate?this.options.startDate.clone():null},r.Litepicker.prototype.getEndDate=function(){return this.options.endDate?this.options.endDate.clone():null},r.Litepicker.prototype.setDate=function(t,e){void 0===e&&(e=!1);var n=new s.DateTime(t,this.options.format,this.options.lang);o.dateIsLocked(n,this.options,[n])&&!e?this.emit("error:date",n):(this.setStartDate(t),this.options.inlineMode&&this.render(),this.emit("selected",this.getDate()))},r.Litepicker.prototype.setStartDate=function(t){t&&(this.options.startDate=new s.DateTime(t,this.options.format,this.options.lang),this.updateInput())},r.Litepicker.prototype.setEndDate=function(t){t&&(this.options.endDate=new s.DateTime(t,this.options.format,this.options.lang),this.options.startDate.getTime()>this.options.endDate.getTime()&&(this.options.endDate=this.options.startDate.clone(),this.options.startDate=new s.DateTime(t,this.options.format,this.options.lang)),this.updateInput())},r.Litepicker.prototype.setDateRange=function(t,e,n){void 0===n&&(n=!1),this.triggerElement=void 0;var i=new s.DateTime(t,this.options.format,this.options.lang),r=new s.DateTime(e,this.options.format,this.options.lang);(this.options.disallowLockDaysInRange?o.rangeIsLocked([i,r],this.options):o.dateIsLocked(i,this.options,[i,r])||o.dateIsLocked(r,this.options,[i,r]))&&!n?this.emit("error:range",[i,r]):(this.setStartDate(i),this.setEndDate(r),this.options.inlineMode&&this.render(),this.updateInput(),this.emit("selected",this.getStartDate(),this.getEndDate()))},r.Litepicker.prototype.gotoDate=function(t,e){void 0===e&&(e=0);var n=new s.DateTime(t);n.setDate(1),this.calendars[e]=n.clone(),this.render()},r.Litepicker.prototype.setLockDays=function(t){this.options.lockDays=s.DateTime.convertArray(t,this.options.lockDaysFormat),this.render()},r.Litepicker.prototype.setHighlightedDays=function(t){this.options.highlightedDays=s.DateTime.convertArray(t,this.options.highlightedDaysFormat),this.render()},r.Litepicker.prototype.setOptions=function(t){delete t.element,delete t.elementEnd,delete t.parentEl,t.startDate&&(t.startDate=new s.DateTime(t.startDate,this.options.format,this.options.lang)),t.endDate&&(t.endDate=new s.DateTime(t.endDate,this.options.format,this.options.lang));var e=i(i({},this.options.dropdowns),t.dropdowns),n=i(i({},this.options.buttonText),t.buttonText),r=i(i({},this.options.tooltipText),t.tooltipText);this.options=i(i({},this.options),t),this.options.dropdowns=i({},e),this.options.buttonText=i({},n),this.options.tooltipText=i({},r),!this.options.singleMode||this.options.startDate instanceof s.DateTime||(this.options.startDate=null,this.options.endDate=null),this.options.singleMode||this.options.startDate instanceof s.DateTime&&this.options.endDate instanceof s.DateTime||(this.options.startDate=null,this.options.endDate=null);for(var o=0;o<this.options.numberOfMonths;o+=1){var a=this.options.startDate?this.options.startDate.clone():new s.DateTime;a.setDate(1),a.setMonth(a.getMonth()+o),this.calendars[o]=a}this.options.lockDays.length&&(this.options.lockDays=s.DateTime.convertArray(this.options.lockDays,this.options.lockDaysFormat)),this.options.highlightedDays.length&&(this.options.highlightedDays=s.DateTime.convertArray(this.options.highlightedDays,this.options.highlightedDaysFormat)),this.render(),this.options.inlineMode&&this.show(),this.updateInput()},r.Litepicker.prototype.clearSelection=function(){this.options.startDate=null,this.options.endDate=null,this.datePicked.length=0,this.updateInput(),this.isShowning()&&this.render(),this.emit("clear:selection")},r.Litepicker.prototype.destroy=function(){this.ui&&this.ui.parentNode&&(this.ui.parentNode.removeChild(this.ui),this.ui=null),this.emit("destroy")}}])},8214:function(){!function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n,i,s,r=t[1]||"",o=t[3];if(!o)return r;if(e&&"function"==typeof btoa){var a=(n=o,i=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(i),"/*# ".concat(s," */")),l=o.sources.map((function(t){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(t," */")}));return[r].concat(l).concat([a]).join("\n")}return[r].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var s={};if(i)for(var r=0;r<this.length;r++){var o=this[r][0];null!=o&&(s[o]=!0)}for(var a=0;a<t.length;a++){var l=[].concat(t[a]);i&&s[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";var i,s={},r=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}();function o(t,e){for(var n=[],i={},s=0;s<t.length;s++){var r=t[s],o=e.base?r[0]+e.base:r[0],a={css:r[1],media:r[2],sourceMap:r[3]};i[o]?i[o].parts.push(a):n.push(i[o]={id:o,parts:[a]})}return n}function a(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=s[i.id],o=0;if(r){for(r.refs++;o<r.parts.length;o++)r.parts[o](i.parts[o]);for(;o<i.parts.length;o++)r.parts.push(f(i.parts[o],e))}else{for(var a=[];o<i.parts.length;o++)a.push(f(i.parts[o],e));s[i.id]={id:i.id,refs:1,parts:a}}}}function l(t){var e=document.createElement("style");if(void 0===t.attributes.nonce){var i=n.nc;i&&(t.attributes.nonce=i)}if(Object.keys(t.attributes).forEach((function(n){e.setAttribute(n,t.attributes[n])})),"function"==typeof t.insert)t.insert(e);else{var s=r(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var c,u=(c=[],function(t,e){return c[t]=e,c.filter(Boolean).join("\n")});function d(t,e,n,i){var s=n?"":i.css;if(t.styleSheet)t.styleSheet.cssText=u(e,s);else{var r=document.createTextNode(s),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(r,o[e]):t.appendChild(r)}}function h(t,e,n){var i=n.css,s=n.media,r=n.sourceMap;if(s&&t.setAttribute("media",s),r&&btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var p=null,m=0;function f(t,e){var n,i,s;if(e.singleton){var r=m++;n=p||(p=l(e)),i=d.bind(null,n,r,!1),s=d.bind(null,n,r,!0)}else n=l(e),i=h.bind(null,n,e),s=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else s()}}t.exports=function(t,e){(e=e||{}).attributes="object"==typeof e.attributes?e.attributes:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=(void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i));var n=o(t,e);return a(n,e),function(t){for(var i=[],r=0;r<n.length;r++){var l=n[r],c=s[l.id];c&&(c.refs--,i.push(c))}t&&a(o(t,e),e);for(var u=0;u<i.length;u++){var d=i[u];if(0===d.refs){for(var h=0;h<d.parts.length;h++)d.parts[h]();delete s[d.id]}}}}},,,,function(t,e,n){"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.r(e),n(6),Litepicker.add("mobilefriendly",{init:function(t){var e=t.options;t.options.mobilefriendly=s(s({},{breakpoint:480}),e.mobilefriendly),Object.defineProperties(t,{xTouchDown:{value:null,writable:!0},yTouchDown:{value:null,writable:!0},touchTargetMonth:{value:null,writable:!0}});var n=!1;try{var i=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("testPassive",null,i),window.removeEventListener("testPassive",null,i)}catch(t){}function r(){var e="portrait"===o();return window.matchMedia("(max-device-".concat(e?"width":"height",": ").concat(t.options.mobilefriendly.breakpoint,"px)")).matches}function o(){return"orientation"in window.screen&&"type"in window.screen.orientation?window.screen.orientation.type.replace(/\-\w+$/,""):window.matchMedia("(orientation: portrait)").matches?"portrait":"landscape"}function a(){"portrait"===o()?(t.options.numberOfMonths=1,t.options.numberOfColumns=1):(t.options.numberOfMonths=2,t.options.numberOfColumns=2)}t.backdrop=document.createElement("div"),t.backdrop.className="litepicker-backdrop",t.backdrop.addEventListener("click",t.hide()),e.element&&e.element.parentNode&&e.element.parentNode.appendChild(t.backdrop),window.addEventListener("orientationchange",(function(n){window.addEventListener("resize",(function n(){if(r()&&t.isShowning()){var i=o();if("landscape"===i)e.numberOfMonths=2,e.numberOfColumns=2;else e.numberOfMonths=1,e.numberOfColumns=1;t.ui.classList.toggle("mobilefriendly-portrait","portrait"===i),t.ui.classList.toggle("mobilefriendly-landscape","landscape"===i),t.render()}window.removeEventListener("resize",n)}))})),e.inlineMode&&r()&&(window.dispatchEvent(new Event("orientationchange")),window.dispatchEvent(new Event("resize"))),t.on("before:show",(function(e){if(t.triggerElement=e,!t.options.inlineMode&&r()){t.emit("mobilefriendly.before:show",e),t.ui.style.position="fixed",t.ui.style.display="block",a(),t.scrollToDate(e),t.render();var n=o();t.ui.classList.add("mobilefriendly"),t.ui.classList.toggle("mobilefriendly-portrait","portrait"===n),t.ui.classList.toggle("mobilefriendly-landscape","landscape"===n),t.ui.style.top="50%",t.ui.style.left="50%",t.ui.style.right=null,t.ui.style.bottom=null,t.ui.style.zIndex=t.options.zIndex,t.backdrop.style.display="block",t.backdrop.style.zIndex=t.options.zIndex-1,document.body.classList.add("litepicker-open"),(e||t.options.element).blur(),t.emit("mobilefriendly.show",e)}else r()&&(a(),t.render())})),t.on("render",(function(e){t.touchTargetMonth&&Array.from(t.ui.querySelectorAll(".month-item")).map((function(e){return e.classList.add("touch-target-".concat(t.touchTargetMonth))})),t.touchTargetMonth=null})),t.on("hide",(function(){document.body.classList.remove("litepicker-open"),t.backdrop.style.display="none",t.ui.classList.remove("mobilefriendly","mobilefriendly-portrait","mobilefriendly-landscape")})),t.on("destroy",(function(){t.backdrop&&t.backdrop.parentNode&&t.backdrop.parentNode.removeChild(t.backdrop)})),t.ui.addEventListener("touchstart",(function(e){var n=e.touches[0];t.xTouchDown=n.clientX,t.yTouchDown=n.clientY}),!!n&&{passive:!0}),t.ui.addEventListener("touchmove",(function(e){if(t.xTouchDown&&t.yTouchDown){var n=e.touches[0].clientX,i=e.touches[0].clientY,s=t.xTouchDown-n,r=t.yTouchDown-i,o=Math.abs(s)>Math.abs(r),a=t.options.numberOfMonths,l=null,c=!1,u="",d=Array.from(t.ui.querySelectorAll(".month-item"));if(o){var h=t.DateTime(t.ui.querySelector(".day-item").dataset.time),p=Number("".concat(1-Math.abs(s)/100)),m=0;if(s>0){m=-Math.abs(s),l=h.clone().add(a,"month");var f=t.options.maxDate;c=!f||l.isSameOrBefore(t.DateTime(f),"month"),u="next"}else{m=Math.abs(s),l=h.clone().subtract(a,"month");var g=t.options.minDate;c=!g||l.isSameOrAfter(t.DateTime(g),"month"),u="prev"}c&&d.map((function(t){t.style.opacity=p,t.style.transform="translateX(".concat(m,"px)")}))}Math.abs(s)+Math.abs(r)>100&&o&&l&&c&&(t.touchTargetMonth=u,t.gotoDate(l))}}),!!n&&{passive:!0}),t.ui.addEventListener("touchend",(function(e){t.touchTargetMonth||Array.from(t.ui.querySelectorAll(".month-item")).map((function(t){t.style.transform="translateX(0px)",t.style.opacity=1})),t.xTouchDown=null,t.yTouchDown=null}),!!n&&{passive:!0})}})},function(t,e,n){var i=n(7);"string"==typeof i&&(i=[[t.i,i,""]]);var s={insert:function(t){var e=document.querySelector("head"),n=window._lastElementInsertedByStyleLoader;window.disableLitepickerStyles||(n?n.nextSibling?e.insertBefore(t,n.nextSibling):e.appendChild(t):e.insertBefore(t,e.firstChild),window._lastElementInsertedByStyleLoader=t)},singleton:!1};n(1)(i,s),i.locals&&(t.exports=i.locals)},function(t,e,n){(e=n(0)(!1)).push([t.i,':root {\n --litepicker-mobilefriendly-backdrop-color-bg: #000;\n}\n\n.litepicker-backdrop {\n display: none;\n background-color: var(--litepicker-mobilefriendly-backdrop-color-bg);\n opacity: 0.3;\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n.litepicker-open {\n overflow: hidden;\n}\n\n.litepicker.mobilefriendly[data-plugins*="mobilefriendly"] {\n transform: translate(-50%, -50%);\n font-size: 1.1rem;\n --litepicker-container-months-box-shadow-color: #616161;\n}\n.litepicker.mobilefriendly-portrait {\n --litepicker-day-width: 13.5vw;\n --litepicker-month-width: calc(var(--litepicker-day-width) * 7);\n}\n.litepicker.mobilefriendly-landscape {\n --litepicker-day-width: 5.5vw;\n --litepicker-month-width: calc(var(--litepicker-day-width) * 7);\n}\n\n.litepicker[data-plugins*="mobilefriendly"] .container__months {\n overflow: hidden;\n}\n\n.litepicker.mobilefriendly[data-plugins*="mobilefriendly"] .container__months .month-item-header {\n height: var(--litepicker-day-width);\n}\n\n.litepicker.mobilefriendly[data-plugins*="mobilefriendly"] .container__days > div {\n height: var(--litepicker-day-width);\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n\n.litepicker[data-plugins*="mobilefriendly"] .container__months .month-item {\n transform-origin: center;\n}\n\n.litepicker[data-plugins*="mobilefriendly"] .container__months .month-item.touch-target-next {\n animation-name: lp-bounce-target-next;\n animation-duration: .5s;\n animation-timing-function: ease;\n}\n\n.litepicker[data-plugins*="mobilefriendly"] .container__months .month-item.touch-target-prev {\n animation-name: lp-bounce-target-prev;\n animation-duration: .5s;\n animation-timing-function: ease;\n}\n\n@keyframes lp-bounce-target-next {\n from {\n transform: translateX(100px) scale(0.5);\n }\n to {\n transform: translateX(0px) scale(1);\n }\n}\n\n@keyframes lp-bounce-target-prev {\n from {\n transform: translateX(-100px) scale(0.5);\n }\n to {\n transform: translateX(0px) scale(1);\n }\n}',""]),t.exports=e}])},4975:function(t,e,n){"use strict";n.r(e)}},function(t){var e;e=4028,t(t.s=e)}]); |