@opencitylabs/formio-custom-components 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`@formio/js`),u=require(`react-dom/client`),d=require(`react`);d=c(d);let f=require(`react/jsx-runtime`),p=require(`@formio/react`),m=require(`react-day-picker`),h=require(`react-countdown`);h=c(h);let g=require(`moment`);g=c(g);let _=require(`design-react-kit`),v=require(`sweetalert2`);v=c(v),require(`i18next`);let y=require(`dayjs`);y=c(y);let b=require(`@event-calendar/core`),x=require(`react-dropzone`),S=require(`axios`);S=c(S);let C=require(`mime`);C=c(C);let w=require(`dompurify`);w=c(w);let T=require(`jwt-decode`),E=require(`leaflet`);E=c(E);let D=require(`lodash`);D=c(D);var O=l.Formio.Components.components.field,k=e=>(0,f.jsx)(`div`,{ref:(0,d.useRef)(),className:`row page-break-before pagebreak-container border border-info p-2 mb-2`,children:(0,f.jsx)(`div`,{className:`col-12 text-center pagebreak-component`,children:`Page break`})}),A=class e extends O{constructor(e,t,n){super(e,t,n)}static schema(){return O.schema({type:`pagebreak`})}static builderInfo={title:`PageBreak`,group:`basic`,icon:`bi bi-file-break`,weight:70,schema:e.schema()};render(){return super.render(`<div ref="react-${this.id}"></div>`)}attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,u.createRoot)(e),this.rootComponent.render((0,f.jsx)(k,{...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}getValue(){return``}setValue(e){}},j=()=>{let e=window.location,t=RegExp(`qa.bugliano.pi.it|localhost|opencity-labs.gitlab.io|form-builder-qa.stanzadelcittadino.it`,`g`),n=null;if(t.test(e.hostname))n=`https://servizi.comune-qa.bugliano.pi.it/lang`;else if(window.BASE_URL)n=window.BASE_URL;else{let t=e.pathname.split(`/`);n=e.origin+`/`+t[1]}return n},M=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{type:`select`,label:`Nome Calendario`,key:`calendarId`,input:!0,weight:1,placeholder:`Nome Calendario`,tooltip:`Inserisci il nome del calendario`,dataSrc:`url`,defaultValue:``,data:{url:j()+`/api/calendars?type=time_variable_slots`},valueProperty:`id`,template:`<span>{{ item.title }}</span>`,selectValues:`Results`},{type:`checkbox`,label:`Seleziona orari di apertura`,key:`select_opening_hours`,input:!0,weight:1,tooltip:`Abilita per selezionare i singoli orari di apertura`,defaultValue:!1},{label:`Base url`,calculateValue:`let url = '`+j()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{type:`select`,label:`Orari di apertura`,key:`opening_hours`,input:!0,weight:1,placeholder:`Seleziona gli orari di apertura`,tooltip:`Seleziona gli orari di apertura`,multiple:!0,dataSrc:`url`,defaultValue:``,data:{url:j()+`/api/calendars/{{data.calendarId}}/opening-hours`},valueProperty:`id`,template:`<span>{{ item.name }}</span>`,selectValues:`results`,conditional:{show:!0,when:`select_opening_hours`,eq:`true`}},{label:`Api Url`,redrawOn:`data`,calculateValue:`if (data.calendarId) {
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`@formio/js`),u=require(`react-dom/client`),d=require(`react`);d=c(d);let f=require(`react/jsx-runtime`),p=require(`@formio/react`),m=require(`react-day-picker`),h=require(`react-countdown`);h=c(h);let g=require(`moment`);g=c(g);let _=require(`design-react-kit`),v=require(`sweetalert2`);v=c(v),require(`i18next`);let y=require(`dayjs`);y=c(y);let b=require(`@event-calendar/core`),x=require(`react-dropzone`),S=require(`axios`);S=c(S);let C=require(`mime`);C=c(C);let w=require(`dompurify`);w=c(w);let T=require(`jwt-decode`),E=require(`accessible-autocomplete/react`);E=c(E);let D=require(`leaflet`);D=c(D);let O=require(`lodash`);O=c(O);var ee=l.Formio.Components.components.field,k=e=>(0,f.jsx)(`div`,{ref:(0,d.useRef)(),className:`row page-break-before pagebreak-container border border-info p-2 mb-2`,children:(0,f.jsx)(`div`,{className:`col-12 text-center pagebreak-component`,children:`Page break`})}),A=class e extends ee{constructor(e,t,n){super(e,t,n)}static schema(){return ee.schema({type:`pagebreak`})}static builderInfo={title:`PageBreak`,group:`basic`,icon:`bi bi-file-break`,weight:70,schema:e.schema()};render(){return super.render(`<div ref="react-${this.id}"></div>`)}attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,u.createRoot)(e),this.rootComponent.render((0,f.jsx)(k,{...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}getValue(){return``}setValue(e){}},j=()=>{let e=window.location,t=RegExp(`qa.bugliano.pi.it|localhost|opencity-labs.gitlab.io|form-builder-qa.stanzadelcittadino.it`,`g`),n=null;if(t.test(e.hostname))n=`https://servizi.comune-qa.bugliano.pi.it/lang`;else if(window.BASE_URL)n=window.BASE_URL;else{let t=e.pathname.split(`/`);n=e.origin+`/`+t[1]}return n},M=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{type:`select`,label:`Nome Calendario`,key:`calendarId`,input:!0,weight:1,placeholder:`Nome Calendario`,tooltip:`Inserisci il nome del calendario`,dataSrc:`url`,defaultValue:``,data:{url:j()+`/api/calendars?type=time_variable_slots`},valueProperty:`id`,template:`<span>{{ item.title }}</span>`,selectValues:`Results`},{type:`checkbox`,label:`Seleziona orari di apertura`,key:`select_opening_hours`,input:!0,weight:1,tooltip:`Abilita per selezionare i singoli orari di apertura`,defaultValue:!1},{label:`Base url`,calculateValue:`let url = '`+j()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{type:`select`,label:`Orari di apertura`,key:`opening_hours`,input:!0,weight:1,placeholder:`Seleziona gli orari di apertura`,tooltip:`Seleziona gli orari di apertura`,multiple:!0,dataSrc:`url`,defaultValue:``,data:{url:j()+`/api/calendars/{{data.calendarId}}/opening-hours`},valueProperty:`id`,template:`<span>{{ item.name }}</span>`,selectValues:`results`,conditional:{show:!0,when:`select_opening_hours`,eq:`true`}},{label:`Api Url`,redrawOn:`data`,calculateValue:`if (data.calendarId) {
2
2
  let url = data.url + '/api/calendars/' + data.calendarId + '/overlaps';
3
3
  if (data.select_opening_hours && data.opening_hours.length > 0) {
4
4
  let qs = "?opening_hours=" + data.opening_hours.join();
@@ -29,10 +29,10 @@ if(data.calendarId && data.api_url){
29
29
  data.overlaps_validation = -1; document.querySelector("input[name^='data[overlaps_validation]']").value = -1;
30
30
  }
31
31
  );
32
- }`,validateOn:`change`,validate:{customMessage:`Vi sono sovrapposizioni negli orari di apertura`,custom:`if (document.querySelector("input[name^='data[overlaps_validation]']").value === '0') {valid=true} else {valid = 'Sovrapposizione';}`},key:`overlaps_validation`,attributes:{readonly:`true`},required:!0,type:`number`,input:!0,weight:1},{label:`Precisione minima (minuti)`,defaultValue:1,required:!0,inputFormat:`plain`,key:`range_step`,type:`number`,input:!0,weight:1}];function N(...e){return p.Components.baseEditForm([{key:`display`,components:M}],...e)}function P(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function F(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function I(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?R(s,e=>e.test(o)):L(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function L(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function R(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function z(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var B=365.2425,ee=3600*24;ee*7,ee*B/12*3;var te=Symbol.for(`constructDateFrom`);function ne(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&te in e?e[te](t):e instanceof Date?new e.constructor(t):new Date(t)}function re(e,...t){let n=ne.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}var ie={};function ae(){return ie}function oe(e,t){return ne(t||e,e)}function se(e,t){let n=ae(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=oe(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function ce(e,t,n){let[r,i]=re(n?.in,e,t);return+se(r,n)==+se(i,n)}var le={lessThanXSeconds:{standalone:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`},withPreposition:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`}},xSeconds:{standalone:{one:`1 Sekunde`,other:`{{count}} Sekunden`},withPreposition:{one:`1 Sekunde`,other:`{{count}} Sekunden`}},halfAMinute:{standalone:`eine halbe Minute`,withPreposition:`einer halben Minute`},lessThanXMinutes:{standalone:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`},withPreposition:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`}},xMinutes:{standalone:{one:`1 Minute`,other:`{{count}} Minuten`},withPreposition:{one:`1 Minute`,other:`{{count}} Minuten`}},aboutXHours:{standalone:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`},withPreposition:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`}},xHours:{standalone:{one:`1 Stunde`,other:`{{count}} Stunden`},withPreposition:{one:`1 Stunde`,other:`{{count}} Stunden`}},xDays:{standalone:{one:`1 Tag`,other:`{{count}} Tage`},withPreposition:{one:`1 Tag`,other:`{{count}} Tagen`}},aboutXWeeks:{standalone:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`},withPreposition:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`}},xWeeks:{standalone:{one:`1 Woche`,other:`{{count}} Wochen`},withPreposition:{one:`1 Woche`,other:`{{count}} Wochen`}},aboutXMonths:{standalone:{one:`etwa 1 Monat`,other:`etwa {{count}} Monate`},withPreposition:{one:`etwa 1 Monat`,other:`etwa {{count}} Monaten`}},xMonths:{standalone:{one:`1 Monat`,other:`{{count}} Monate`},withPreposition:{one:`1 Monat`,other:`{{count}} Monaten`}},aboutXYears:{standalone:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahre`},withPreposition:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahren`}},xYears:{standalone:{one:`1 Jahr`,other:`{{count}} Jahre`},withPreposition:{one:`1 Jahr`,other:`{{count}} Jahren`}},overXYears:{standalone:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahre`},withPreposition:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahren`}},almostXYears:{standalone:{one:`fast 1 Jahr`,other:`fast {{count}} Jahre`},withPreposition:{one:`fast 1 Jahr`,other:`fast {{count}} Jahren`}}},ue=(e,t,n)=>{let r,i=n?.addSuffix?le[e].withPreposition:le[e].standalone;return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:`vor `+r:r},de={date:P({formats:{full:`EEEE, do MMMM y`,long:`do MMMM y`,medium:`do MMM y`,short:`dd.MM.y`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} 'um' {{time}}`,long:`{{date}} 'um' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},fe={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},pe=(e,t,n,r)=>fe[e],me={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},V={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},he={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],wide:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`]},ge={narrow:he.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:he.wide},_e={code:`de`,formatDistance:ue,formatLong:de,formatRelative:pe,localize:{ordinalNumber:e=>Number(e)+`.`,era:F({values:me,defaultWidth:`wide`}),quarter:F({values:V,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({values:he,formattingValues:ge,defaultWidth:`wide`}),day:F({values:{narrow:[`S`,`M`,`D`,`M`,`D`,`F`,`S`],short:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],abbreviated:[`So.`,`Mo.`,`Di.`,`Mi.`,`Do.`,`Fr.`,`Sa.`],wide:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`]},defaultWidth:`wide`}),dayPeriod:F({values:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachm.`,evening:`Abend`,night:`Nacht`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachm.`,evening:`abends`,night:`nachts`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:z({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:I({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:`any`}),quarter:I({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:I({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:I({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:I({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:`wide`,parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},ve={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},ye=(e,t,n)=>{let r,i=ve[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},be={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},xe=(e,t,n,r)=>be[e],Se={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:F({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:F({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:F({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:F({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})},H={ordinalNumber:z({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:I({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:I({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:I({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:I({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:I({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},Ce={code:`en-GB`,formatDistance:ye,formatLong:{date:P({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:xe,localize:Se,match:H,options:{weekStartsOn:1,firstWeekContainsDate:4}},we={lessThanXSeconds:{one:`meno di un secondo`,other:`meno di {{count}} secondi`},xSeconds:{one:`un secondo`,other:`{{count}} secondi`},halfAMinute:`alcuni secondi`,lessThanXMinutes:{one:`meno di un minuto`,other:`meno di {{count}} minuti`},xMinutes:{one:`un minuto`,other:`{{count}} minuti`},aboutXHours:{one:`circa un'ora`,other:`circa {{count}} ore`},xHours:{one:`un'ora`,other:`{{count}} ore`},xDays:{one:`un giorno`,other:`{{count}} giorni`},aboutXWeeks:{one:`circa una settimana`,other:`circa {{count}} settimane`},xWeeks:{one:`una settimana`,other:`{{count}} settimane`},aboutXMonths:{one:`circa un mese`,other:`circa {{count}} mesi`},xMonths:{one:`un mese`,other:`{{count}} mesi`},aboutXYears:{one:`circa un anno`,other:`circa {{count}} anni`},xYears:{one:`un anno`,other:`{{count}} anni`},overXYears:{one:`più di un anno`,other:`più di {{count}} anni`},almostXYears:{one:`quasi un anno`,other:`quasi {{count}} anni`}},Te=(e,t,n)=>{let r,i=we[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`tra `+r:r+` fa`:r},Ee={date:P({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} {{time}}`,long:`{{date}} {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},De=[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`];function Oe(e){switch(e){case 0:return`'domenica scorsa alle' p`;default:return`'`+De[e]+` scorso alle' p`}}function ke(e){return`'`+De[e]+` alle' p`}function Ae(e){switch(e){case 0:return`'domenica prossima alle' p`;default:return`'`+De[e]+` prossimo alle' p`}}var je={lastWeek:(e,t,n)=>{let r=e.getDay();return ce(e,t,n)?ke(r):Oe(r)},yesterday:`'ieri alle' p`,today:`'oggi alle' p`,tomorrow:`'domani alle' p`,nextWeek:(e,t,n)=>{let r=e.getDay();return ce(e,t,n)?ke(r):Ae(r)},other:`P`},Me={code:`it`,formatDistance:Te,formatLong:Ee,formatRelative:(e,t,n,r)=>{let i=je[e];return typeof i==`function`?i(t,n,r):i},localize:{ordinalNumber:(e,t)=>{let n=Number(e);return String(n)},era:F({values:{narrow:[`aC`,`dC`],abbreviated:[`a.C.`,`d.C.`],wide:[`avanti Cristo`,`dopo Cristo`]},defaultWidth:`wide`}),quarter:F({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({values:{narrow:[`G`,`F`,`M`,`A`,`M`,`G`,`L`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`gen`,`feb`,`mar`,`apr`,`mag`,`giu`,`lug`,`ago`,`set`,`ott`,`nov`,`dic`],wide:[`gennaio`,`febbraio`,`marzo`,`aprile`,`maggio`,`giugno`,`luglio`,`agosto`,`settembre`,`ottobre`,`novembre`,`dicembre`]},defaultWidth:`wide`}),day:F({values:{narrow:[`D`,`L`,`M`,`M`,`G`,`V`,`S`],short:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],abbreviated:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],wide:[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`]},defaultWidth:`wide`}),dayPeriod:F({values:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:z({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:I({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:`any`}),quarter:I({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:I({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:I({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:`any`}),dayPeriod:I({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Ne=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.moment=r()})(e,(function(){"use strict";var e;function n(){return e.apply(null,arguments)}function r(t){e=t}function i(e){return e instanceof Array||Object.prototype.toString.call(e)===`[object Array]`}function a(e){return e!=null&&Object.prototype.toString.call(e)===`[object Object]`}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;for(var t in e)if(o(e,t))return!1;return!0}function c(e){return e===void 0}function l(e){return typeof e==`number`||Object.prototype.toString.call(e)===`[object Number]`}function u(e){return e instanceof Date||Object.prototype.toString.call(e)===`[object Date]`}function d(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function f(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,`toString`)&&(e.toString=t.toString),o(t,`valueOf`)&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Qn(e,t,n,r,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return e._pf??=m(),e._pf}var g=Array.prototype.some?Array.prototype.some:function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function _(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=h(e),n=g.call(t.parsedDateParts,function(e){return e!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function v(e){var t=p(NaN);return e==null?h(t).userInvalidated=!0:f(h(t),e),t}var y=n.momentProperties=[],b=!1;function x(e,t){var n,r,i,a=y.length;if(c(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),c(t._i)||(e._i=t._i),c(t._f)||(e._f=t._f),c(t._l)||(e._l=t._l),c(t._strict)||(e._strict=t._strict),c(t._tzm)||(e._tzm=t._tzm),c(t._isUTC)||(e._isUTC=t._isUTC),c(t._offset)||(e._offset=t._offset),c(t._pf)||(e._pf=h(t)),c(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=y[n],i=t[r],c(i)||(e[r]=i);return e}function S(e){x(this,e),this._d=new Date(e._d==null?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),b===!1&&(b=!0,n.updateOffset(this),b=!1)}function C(e){return e instanceof S||e!=null&&e._isAMomentObject!=null}function w(e){n.suppressDeprecationWarnings===!1&&typeof console<`u`&&console.warn&&console.warn(`Deprecation warning: `+e)}function T(e,t){var r=!0;return f(function(){if(n.deprecationHandler!=null&&n.deprecationHandler(null,e),r){var i=[],a,s,c,l=arguments.length;for(s=0;s<l;s++){if(a=``,typeof arguments[s]==`object`){for(c in a+=`
32
+ }`,validateOn:`change`,validate:{customMessage:`Vi sono sovrapposizioni negli orari di apertura`,custom:`if (document.querySelector("input[name^='data[overlaps_validation]']").value === '0') {valid=true} else {valid = 'Sovrapposizione';}`},key:`overlaps_validation`,attributes:{readonly:`true`},required:!0,type:`number`,input:!0,weight:1},{label:`Precisione minima (minuti)`,defaultValue:1,required:!0,inputFormat:`plain`,key:`range_step`,type:`number`,input:!0,weight:1}];function te(...e){return p.Components.baseEditForm([{key:`display`,components:M}],...e)}function N(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function P(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function F(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?L(s,e=>e.test(o)):I(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function I(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function L(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function R(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var ne=365.2425,z=3600*24;z*7,z*ne/12*3;var B=Symbol.for(`constructDateFrom`);function re(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&B in e?e[B](t):e instanceof Date?new e.constructor(t):new Date(t)}function ie(e,...t){let n=re.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}var ae={};function oe(){return ae}function se(e,t){return re(t||e,e)}function ce(e,t){let n=oe(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=se(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function le(e,t,n){let[r,i]=ie(n?.in,e,t);return+ce(r,n)==+ce(i,n)}var ue={lessThanXSeconds:{standalone:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`},withPreposition:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`}},xSeconds:{standalone:{one:`1 Sekunde`,other:`{{count}} Sekunden`},withPreposition:{one:`1 Sekunde`,other:`{{count}} Sekunden`}},halfAMinute:{standalone:`eine halbe Minute`,withPreposition:`einer halben Minute`},lessThanXMinutes:{standalone:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`},withPreposition:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`}},xMinutes:{standalone:{one:`1 Minute`,other:`{{count}} Minuten`},withPreposition:{one:`1 Minute`,other:`{{count}} Minuten`}},aboutXHours:{standalone:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`},withPreposition:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`}},xHours:{standalone:{one:`1 Stunde`,other:`{{count}} Stunden`},withPreposition:{one:`1 Stunde`,other:`{{count}} Stunden`}},xDays:{standalone:{one:`1 Tag`,other:`{{count}} Tage`},withPreposition:{one:`1 Tag`,other:`{{count}} Tagen`}},aboutXWeeks:{standalone:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`},withPreposition:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`}},xWeeks:{standalone:{one:`1 Woche`,other:`{{count}} Wochen`},withPreposition:{one:`1 Woche`,other:`{{count}} Wochen`}},aboutXMonths:{standalone:{one:`etwa 1 Monat`,other:`etwa {{count}} Monate`},withPreposition:{one:`etwa 1 Monat`,other:`etwa {{count}} Monaten`}},xMonths:{standalone:{one:`1 Monat`,other:`{{count}} Monate`},withPreposition:{one:`1 Monat`,other:`{{count}} Monaten`}},aboutXYears:{standalone:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahre`},withPreposition:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahren`}},xYears:{standalone:{one:`1 Jahr`,other:`{{count}} Jahre`},withPreposition:{one:`1 Jahr`,other:`{{count}} Jahren`}},overXYears:{standalone:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahre`},withPreposition:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahren`}},almostXYears:{standalone:{one:`fast 1 Jahr`,other:`fast {{count}} Jahre`},withPreposition:{one:`fast 1 Jahr`,other:`fast {{count}} Jahren`}}},de=(e,t,n)=>{let r,i=n?.addSuffix?ue[e].withPreposition:ue[e].standalone;return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:`vor `+r:r},fe={date:N({formats:{full:`EEEE, do MMMM y`,long:`do MMMM y`,medium:`do MMM y`,short:`dd.MM.y`},defaultWidth:`full`}),time:N({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:N({formats:{full:`{{date}} 'um' {{time}}`,long:`{{date}} 'um' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},pe={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},me=(e,t,n,r)=>pe[e],V={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},he={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},ge={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],wide:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`]},_e={narrow:ge.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:ge.wide},ve={code:`de`,formatDistance:de,formatLong:fe,formatRelative:me,localize:{ordinalNumber:e=>Number(e)+`.`,era:P({values:V,defaultWidth:`wide`}),quarter:P({values:he,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:P({values:ge,formattingValues:_e,defaultWidth:`wide`}),day:P({values:{narrow:[`S`,`M`,`D`,`M`,`D`,`F`,`S`],short:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],abbreviated:[`So.`,`Mo.`,`Di.`,`Mi.`,`Do.`,`Fr.`,`Sa.`],wide:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`]},defaultWidth:`wide`}),dayPeriod:P({values:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachm.`,evening:`Abend`,night:`Nacht`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachm.`,evening:`abends`,night:`nachts`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:R({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:F({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:`any`}),quarter:F({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:F({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:F({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:F({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:`wide`,parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},ye={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},be=(e,t,n)=>{let r,i=ye[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},xe={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Se=(e,t,n,r)=>xe[e],H={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:P({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:P({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:P({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:P({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:P({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})},Ce={ordinalNumber:R({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:F({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:F({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:F({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:F({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:F({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},we={code:`en-GB`,formatDistance:be,formatLong:{date:N({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:N({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:N({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:Se,localize:H,match:Ce,options:{weekStartsOn:1,firstWeekContainsDate:4}},Te={lessThanXSeconds:{one:`meno di un secondo`,other:`meno di {{count}} secondi`},xSeconds:{one:`un secondo`,other:`{{count}} secondi`},halfAMinute:`alcuni secondi`,lessThanXMinutes:{one:`meno di un minuto`,other:`meno di {{count}} minuti`},xMinutes:{one:`un minuto`,other:`{{count}} minuti`},aboutXHours:{one:`circa un'ora`,other:`circa {{count}} ore`},xHours:{one:`un'ora`,other:`{{count}} ore`},xDays:{one:`un giorno`,other:`{{count}} giorni`},aboutXWeeks:{one:`circa una settimana`,other:`circa {{count}} settimane`},xWeeks:{one:`una settimana`,other:`{{count}} settimane`},aboutXMonths:{one:`circa un mese`,other:`circa {{count}} mesi`},xMonths:{one:`un mese`,other:`{{count}} mesi`},aboutXYears:{one:`circa un anno`,other:`circa {{count}} anni`},xYears:{one:`un anno`,other:`{{count}} anni`},overXYears:{one:`più di un anno`,other:`più di {{count}} anni`},almostXYears:{one:`quasi un anno`,other:`quasi {{count}} anni`}},Ee=(e,t,n)=>{let r,i=Te[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`tra `+r:r+` fa`:r},De={date:N({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:N({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:N({formats:{full:`{{date}} {{time}}`,long:`{{date}} {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},Oe=[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`];function ke(e){switch(e){case 0:return`'domenica scorsa alle' p`;default:return`'`+Oe[e]+` scorso alle' p`}}function Ae(e){return`'`+Oe[e]+` alle' p`}function je(e){switch(e){case 0:return`'domenica prossima alle' p`;default:return`'`+Oe[e]+` prossimo alle' p`}}var Me={lastWeek:(e,t,n)=>{let r=e.getDay();return le(e,t,n)?Ae(r):ke(r)},yesterday:`'ieri alle' p`,today:`'oggi alle' p`,tomorrow:`'domani alle' p`,nextWeek:(e,t,n)=>{let r=e.getDay();return le(e,t,n)?Ae(r):je(r)},other:`P`},Ne={code:`it`,formatDistance:Ee,formatLong:De,formatRelative:(e,t,n,r)=>{let i=Me[e];return typeof i==`function`?i(t,n,r):i},localize:{ordinalNumber:(e,t)=>{let n=Number(e);return String(n)},era:P({values:{narrow:[`aC`,`dC`],abbreviated:[`a.C.`,`d.C.`],wide:[`avanti Cristo`,`dopo Cristo`]},defaultWidth:`wide`}),quarter:P({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:P({values:{narrow:[`G`,`F`,`M`,`A`,`M`,`G`,`L`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`gen`,`feb`,`mar`,`apr`,`mag`,`giu`,`lug`,`ago`,`set`,`ott`,`nov`,`dic`],wide:[`gennaio`,`febbraio`,`marzo`,`aprile`,`maggio`,`giugno`,`luglio`,`agosto`,`settembre`,`ottobre`,`novembre`,`dicembre`]},defaultWidth:`wide`}),day:P({values:{narrow:[`D`,`L`,`M`,`M`,`G`,`V`,`S`],short:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],abbreviated:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],wide:[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`]},defaultWidth:`wide`}),dayPeriod:P({values:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:R({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:F({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:`any`}),quarter:F({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:F({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:F({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:`any`}),dayPeriod:F({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Pe=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.moment=r()})(e,(function(){"use strict";var e;function n(){return e.apply(null,arguments)}function r(t){e=t}function i(e){return e instanceof Array||Object.prototype.toString.call(e)===`[object Array]`}function a(e){return e!=null&&Object.prototype.toString.call(e)===`[object Object]`}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;for(var t in e)if(o(e,t))return!1;return!0}function c(e){return e===void 0}function l(e){return typeof e==`number`||Object.prototype.toString.call(e)===`[object Number]`}function u(e){return e instanceof Date||Object.prototype.toString.call(e)===`[object Date]`}function d(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function f(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,`toString`)&&(e.toString=t.toString),o(t,`valueOf`)&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Qn(e,t,n,r,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return e._pf??=m(),e._pf}var g=Array.prototype.some?Array.prototype.some:function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function _(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=h(e),n=g.call(t.parsedDateParts,function(e){return e!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function v(e){var t=p(NaN);return e==null?h(t).userInvalidated=!0:f(h(t),e),t}var y=n.momentProperties=[],b=!1;function x(e,t){var n,r,i,a=y.length;if(c(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),c(t._i)||(e._i=t._i),c(t._f)||(e._f=t._f),c(t._l)||(e._l=t._l),c(t._strict)||(e._strict=t._strict),c(t._tzm)||(e._tzm=t._tzm),c(t._isUTC)||(e._isUTC=t._isUTC),c(t._offset)||(e._offset=t._offset),c(t._pf)||(e._pf=h(t)),c(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=y[n],i=t[r],c(i)||(e[r]=i);return e}function S(e){x(this,e),this._d=new Date(e._d==null?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),b===!1&&(b=!0,n.updateOffset(this),b=!1)}function C(e){return e instanceof S||e!=null&&e._isAMomentObject!=null}function w(e){n.suppressDeprecationWarnings===!1&&typeof console<`u`&&console.warn&&console.warn(`Deprecation warning: `+e)}function T(e,t){var r=!0;return f(function(){if(n.deprecationHandler!=null&&n.deprecationHandler(null,e),r){var i=[],a,s,c,l=arguments.length;for(s=0;s<l;s++){if(a=``,typeof arguments[s]==`object`){for(c in a+=`
33
33
  [`+s+`] `,arguments[0])o(arguments[0],c)&&(a+=c+`: `+arguments[0][c]+`, `);a=a.slice(0,-2)}else a=arguments[s];i.push(a)}w(e+`
34
34
  Arguments: `+Array.prototype.slice.call(i).join(``)+`
35
- `+Error().stack),r=!1}return t.apply(this,arguments)},t)}var E={};function D(e,t){n.deprecationHandler!=null&&n.deprecationHandler(e,t),E[e]||(w(t),E[e]=!0)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;function O(e){return typeof Function<`u`&&e instanceof Function||Object.prototype.toString.call(e)===`[object Function]`}function k(e){var t,n;for(n in e)o(e,n)&&(t=e[n],O(t)?this[n]=t:this[`_`+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+`|\\d{1,2}`)}function A(e,t){var n=f({},e),r;for(r in t)o(t,r)&&(a(e[r])&&a(t[r])?(n[r]={},f(n[r],e[r]),f(n[r],t[r])):t[r]==null?delete n[r]:n[r]=t[r]);for(r in e)o(e,r)&&!o(t,r)&&a(e[r])&&(n[r]=f({},n[r]));return n}function j(e){e!=null&&this.set(e)}var M=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)o(e,t)&&n.push(t);return n},N={sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`};function P(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return O(r)?r.call(t,n):r}function F(e,t,n){var r=``+Math.abs(e),i=t-r.length;return(e>=0?n?`+`:``:`-`)+(10**Math.max(0,i)).toString().substr(1)+r}var I=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,L=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},z={};function B(e,t,n,r){var i=r;typeof r==`string`&&(i=function(){return this[r]()}),e&&(z[e]=i),t&&(z[t[0]]=function(){return F(i.apply(this,arguments),t[1],t[2])}),n&&(z[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function ee(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,``):e.replace(/\\/g,``)}function te(e){var t=e.match(I),n,r;for(n=0,r=t.length;n<r;n++)z[t[n]]?t[n]=z[t[n]]:t[n]=ee(t[n]);return function(n){var i=``,a;for(a=0;a<r;a++)i+=O(t[a])?t[a].call(n,e):t[a];return i}}function ne(e,t){return e.isValid()?(t=re(t,e.localeData()),R[t]=R[t]||te(t),R[t](e)):e.localeData().invalidDate()}function re(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(L.lastIndex=0;n>=0&&L.test(e);)e=e.replace(L,r),L.lastIndex=0,--n;return e}var ie={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};function ae(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(I).map(function(e){return e===`MMMM`||e===`MM`||e===`DD`||e===`dddd`?e.slice(1):e}).join(``),this._longDateFormat[e])}var oe=`Invalid date`;function se(){return this._invalidDate}var ce=`%d`,le=/\d{1,2}/;function ue(e){return this._ordinal.replace(`%d`,e)}var de={future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,w:`a week`,ww:`%d weeks`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function fe(e,t,n,r){var i=this._relativeTime[n];return O(i)?i(e,t,n,r):i.replace(/%d/i,e)}function pe(e,t){var n=this._relativeTime[e>0?`future`:`past`];return O(n)?n(t):n.replace(/%s/i,t)}var me={D:`date`,dates:`date`,date:`date`,d:`day`,days:`day`,day:`day`,e:`weekday`,weekdays:`weekday`,weekday:`weekday`,E:`isoWeekday`,isoweekdays:`isoWeekday`,isoweekday:`isoWeekday`,DDD:`dayOfYear`,dayofyears:`dayOfYear`,dayofyear:`dayOfYear`,h:`hour`,hours:`hour`,hour:`hour`,ms:`millisecond`,milliseconds:`millisecond`,millisecond:`millisecond`,m:`minute`,minutes:`minute`,minute:`minute`,M:`month`,months:`month`,month:`month`,Q:`quarter`,quarters:`quarter`,quarter:`quarter`,s:`second`,seconds:`second`,second:`second`,gg:`weekYear`,weekyears:`weekYear`,weekyear:`weekYear`,GG:`isoWeekYear`,isoweekyears:`isoWeekYear`,isoweekyear:`isoWeekYear`,w:`week`,weeks:`week`,week:`week`,W:`isoWeek`,isoweeks:`isoWeek`,isoweek:`isoWeek`,y:`year`,years:`year`,year:`year`};function V(e){return typeof e==`string`?me[e]||me[e.toLowerCase()]:void 0}function he(e){var t={},n,r;for(r in e)o(e,r)&&(n=V(r),n&&(t[n]=e[r]));return t}var ge={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function _e(e){var t=[],n;for(n in e)o(e,n)&&t.push({unit:n,priority:ge[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}var ve=/\d/,ye=/\d\d/,be=/\d{3}/,xe=/\d{4}/,Se=/[+-]?\d{6}/,H=/\d\d?/,Ce=/\d\d\d\d?/,we=/\d\d\d\d\d\d?/,Te=/\d{1,3}/,Ee=/\d{1,4}/,De=/[+-]?\d{1,6}/,Oe=/\d+/,ke=/[+-]?\d+/,Ae=/Z|[+-]\d\d:?\d\d/gi,je=/Z|[+-]\d\d(?::?\d\d)?/gi,Me=/[+-]?\d+(\.\d{1,3})?/,Ne=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Pe=/^[1-9]\d?/,Fe=/^([1-9]\d|\d)/,Ie={};function U(e,t,n){Ie[e]=O(t)?t:function(e,r){return e&&n?n:t}}function Le(e,t){return o(Ie,e)?Ie[e](t._strict,t._locale):new RegExp(Re(e))}function Re(e){return ze(e.replace(`\\`,``).replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i}))}function ze(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)}function Be(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function W(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=Be(t)),n}var Ve={};function G(e,t){var n,r=t,i;for(typeof e==`string`&&(e=[e]),l(t)&&(r=function(e,n){n[t]=W(e)}),i=e.length,n=0;n<i;n++)Ve[e[n]]=r}function He(e,t){G(e,function(e,n,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function Ue(e,t,n){t!=null&&o(Ve,e)&&Ve[e](t,n._a,n,e)}function We(e){return e%4==0&&e%100!=0||e%400==0}var K=0,Ge=1,Ke=2,q=3,qe=4,Je=5,Ye=6,Xe=7,Ze=8;B(`Y`,0,0,function(){var e=this.year();return e<=9999?F(e,4):`+`+e}),B(0,[`YY`,2],0,function(){return this.year()%100}),B(0,[`YYYY`,4],0,`year`),B(0,[`YYYYY`,5],0,`year`),B(0,[`YYYYYY`,6,!0],0,`year`),U(`Y`,ke),U(`YY`,H,ye),U(`YYYY`,Ee,xe),U(`YYYYY`,De,Se),U(`YYYYYY`,De,Se),G([`YYYYY`,`YYYYYY`],K),G(`YYYY`,function(e,t){t[K]=e.length===2?n.parseTwoDigitYear(e):W(e)}),G(`YY`,function(e,t){t[K]=n.parseTwoDigitYear(e)}),G(`Y`,function(e,t){t[K]=parseInt(e,10)});function Qe(e){return We(e)?366:365}n.parseTwoDigitYear=function(e){return W(e)+(W(e)>68?1900:2e3)};var $e=tt(`FullYear`,!0);function et(){return We(this.year())}function tt(e,t){return function(r){return r==null?nt(this,e):(rt(this,e,r),n.updateOffset(this,t),this)}}function nt(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case`Milliseconds`:return r?n.getUTCMilliseconds():n.getMilliseconds();case`Seconds`:return r?n.getUTCSeconds():n.getSeconds();case`Minutes`:return r?n.getUTCMinutes():n.getMinutes();case`Hours`:return r?n.getUTCHours():n.getHours();case`Date`:return r?n.getUTCDate():n.getDate();case`Day`:return r?n.getUTCDay():n.getDay();case`Month`:return r?n.getUTCMonth():n.getMonth();case`FullYear`:return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function rt(e,t,n){var r,i,a,o,s;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case`Milliseconds`:i?r.setUTCMilliseconds(n):r.setMilliseconds(n);return;case`Seconds`:i?r.setUTCSeconds(n):r.setSeconds(n);return;case`Minutes`:i?r.setUTCMinutes(n):r.setMinutes(n);return;case`Hours`:i?r.setUTCHours(n):r.setHours(n);return;case`Date`:i?r.setUTCDate(n):r.setDate(n);return;case`FullYear`:break;default:return}a=n,o=e.month(),s=e.date(),s=s===29&&o===1&&!We(a)?28:s,i?r.setUTCFullYear(a,o,s):r.setFullYear(a,o,s)}}function it(e){return e=V(e),O(this[e])?this[e]():this}function at(e,t){if(typeof e==`object`){e=he(e);var n=_e(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=V(e),O(this[e]))return this[e](t);return this}function ot(e,t){return(e%t+t)%t}var J=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function st(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ot(t,12);return e+=(t-n)/12,n===1?We(e)?29:28:31-n%7%2}B(`M`,[`MM`,2],`Mo`,function(){return this.month()+1}),B(`MMM`,0,0,function(e){return this.localeData().monthsShort(this,e)}),B(`MMMM`,0,0,function(e){return this.localeData().months(this,e)}),U(`M`,H,Pe),U(`MM`,H,ye),U(`MMM`,function(e,t){return t.monthsShortRegex(e)}),U(`MMMM`,function(e,t){return t.monthsRegex(e)}),G([`M`,`MM`],function(e,t){t[Ge]=W(e)-1}),G([`MMM`,`MMMM`],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i==null?h(n).invalidMonth=e:t[Ge]=i});var ct=`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),lt=`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),ut=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,dt=Ne,ft=Ne;function pt(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ut).test(t)?`format`:`standalone`][e.month()]:i(this._months)?this._months:this._months.standalone}function mt(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ut.test(t)?`format`:`standalone`][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ht(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,``).toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,``).toLocaleLowerCase();return n?t===`MMM`?(i=J.call(this._shortMonthsParse,o),i===-1?null:i):(i=J.call(this._longMonthsParse,o),i===-1?null:i):t===`MMM`?(i=J.call(this._shortMonthsParse,o),i===-1?(i=J.call(this._longMonthsParse,o),i===-1?null:i):i):(i=J.call(this._longMonthsParse,o),i===-1?(i=J.call(this._shortMonthsParse,o),i===-1?null:i):i)}function gt(e,t,n){var r,i,a;if(this._monthsParseExact)return ht.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if(i=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=RegExp(`^`+this.months(i,``).replace(`.`,``)+`$`,`i`),this._shortMonthsParse[r]=RegExp(`^`+this.monthsShort(i,``).replace(`.`,``)+`$`,`i`)),!n&&!this._monthsParse[r]&&(a=`^`+this.months(i,``)+`|^`+this.monthsShort(i,``),this._monthsParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`MMMM`&&this._longMonthsParse[r].test(e)||n&&t===`MMM`&&this._shortMonthsParse[r].test(e)||!n&&this._monthsParse[r].test(e))return r}function _t(e,t){if(!e.isValid())return e;if(typeof t==`string`){if(/^\d+$/.test(t))t=W(t);else if(t=e.localeData().monthsParse(t),!l(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,st(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function vt(e){return e==null?nt(this,`Month`):(_t(this,e),n.updateOffset(this,!0),this)}function yt(){return st(this.year(),this.month())}function bt(e){return this._monthsParseExact?(o(this,`_monthsRegex`)||St.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,`_monthsShortRegex`)||(this._monthsShortRegex=dt),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function xt(e){return this._monthsParseExact?(o(this,`_monthsRegex`)||St.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,`_monthsRegex`)||(this._monthsRegex=ft),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function St(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i,a,o,s;for(i=0;i<12;i++)a=p([2e3,i]),o=ze(this.monthsShort(a,``)),s=ze(this.months(a,``)),t.push(o),n.push(s),r.push(s),r.push(o);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._monthsShortStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function Ct(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function wt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Tt(e,t,n){var r=7+t-n;return-((7+wt(e,0,r).getUTCDay()-t)%7)+r-1}function Et(e,t,n,r,i){var a=(7+n-r)%7,o=Tt(e,r,i),s=1+7*(t-1)+a+o,c,l;return s<=0?(c=e-1,l=Qe(c)+s):s>Qe(e)?(c=e+1,l=s-Qe(e)):(c=e,l=s),{year:c,dayOfYear:l}}function Dt(e,t,n){var r=Tt(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,o;return i<1?(o=e.year()-1,a=i+Ot(o,t,n)):i>Ot(e.year(),t,n)?(a=i-Ot(e.year(),t,n),o=e.year()+1):(o=e.year(),a=i),{week:a,year:o}}function Ot(e,t,n){var r=Tt(e,t,n),i=Tt(e+1,t,n);return(Qe(e)-r+i)/7}B(`w`,[`ww`,2],`wo`,`week`),B(`W`,[`WW`,2],`Wo`,`isoWeek`),U(`w`,H,Pe),U(`ww`,H,ye),U(`W`,H,Pe),U(`WW`,H,ye),He([`w`,`ww`,`W`,`WW`],function(e,t,n,r){t[r.substr(0,1)]=W(e)});function kt(e){return Dt(e,this._week.dow,this._week.doy).week}var At={dow:0,doy:6};function jt(){return this._week.dow}function Mt(){return this._week.doy}function Nt(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,`d`)}function Pt(e){var t=Dt(this,1,4).week;return e==null?t:this.add((e-t)*7,`d`)}B(`d`,0,`do`,`day`),B(`dd`,0,0,function(e){return this.localeData().weekdaysMin(this,e)}),B(`ddd`,0,0,function(e){return this.localeData().weekdaysShort(this,e)}),B(`dddd`,0,0,function(e){return this.localeData().weekdays(this,e)}),B(`e`,0,0,`weekday`),B(`E`,0,0,`isoWeekday`),U(`d`,H),U(`e`,H),U(`E`,H),U(`dd`,function(e,t){return t.weekdaysMinRegex(e)}),U(`ddd`,function(e,t){return t.weekdaysShortRegex(e)}),U(`dddd`,function(e,t){return t.weekdaysRegex(e)}),He([`dd`,`ddd`,`dddd`],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i==null?h(n).invalidWeekday=e:t.d=i}),He([`d`,`e`,`E`],function(e,t,n,r){t[r]=W(e)});function Ft(e,t){return typeof e==`string`?isNaN(e)?(e=t.weekdaysParse(e),typeof e==`number`?e:null):parseInt(e,10):e}function It(e,t){return typeof e==`string`?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Lt(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Rt=`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),zt=`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),Bt=`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),Vt=Ne,Ht=Ne,Ut=Ne;function Wt(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?`format`:`standalone`];return e===!0?Lt(n,this._week.dow):e?n[e.day()]:n}function Gt(e){return e===!0?Lt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Kt(e){return e===!0?Lt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function qt(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,``).toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,``).toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,``).toLocaleLowerCase();return n?t===`dddd`?(i=J.call(this._weekdaysParse,o),i===-1?null:i):t===`ddd`?(i=J.call(this._shortWeekdaysParse,o),i===-1?null:i):(i=J.call(this._minWeekdaysParse,o),i===-1?null:i):t===`dddd`?(i=J.call(this._weekdaysParse,o),i!==-1||(i=J.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=J.call(this._minWeekdaysParse,o),i===-1?null:i)):t===`ddd`?(i=J.call(this._shortWeekdaysParse,o),i!==-1||(i=J.call(this._weekdaysParse,o),i!==-1)?i:(i=J.call(this._minWeekdaysParse,o),i===-1?null:i)):(i=J.call(this._minWeekdaysParse,o),i!==-1||(i=J.call(this._weekdaysParse,o),i!==-1)?i:(i=J.call(this._shortWeekdaysParse,o),i===-1?null:i))}function Jt(e,t,n){var r,i,a;if(this._weekdaysParseExact)return qt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=RegExp(`^`+this.weekdays(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._shortWeekdaysParse[r]=RegExp(`^`+this.weekdaysShort(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._minWeekdaysParse[r]=RegExp(`^`+this.weekdaysMin(i,``).replace(`.`,`\\.?`)+`$`,`i`)),this._weekdaysParse[r]||(a=`^`+this.weekdays(i,``)+`|^`+this.weekdaysShort(i,``)+`|^`+this.weekdaysMin(i,``),this._weekdaysParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`dddd`&&this._fullWeekdaysParse[r].test(e)||n&&t===`ddd`&&this._shortWeekdaysParse[r].test(e)||n&&t===`dd`&&this._minWeekdaysParse[r].test(e)||!n&&this._weekdaysParse[r].test(e))return r}function Yt(e){if(!this.isValid())return e==null?NaN:this;var t=nt(this,`Day`);return e==null?t:(e=Ft(e,this.localeData()),this.add(e-t,`d`))}function Xt(e){if(!this.isValid())return e==null?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,`d`)}function Zt(e){if(!this.isValid())return e==null?NaN:this;if(e!=null){var t=It(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Qt(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,`_weekdaysRegex`)||(this._weekdaysRegex=Vt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function $t(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,`_weekdaysShortRegex`)||(this._weekdaysShortRegex=Ht),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function en(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,`_weekdaysMinRegex`)||(this._weekdaysMinRegex=Ut),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function tn(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i=[],a,o,s,c,l;for(a=0;a<7;a++)o=p([2e3,1]).day(a),s=ze(this.weekdaysMin(o,``)),c=ze(this.weekdaysShort(o,``)),l=ze(this.weekdays(o,``)),t.push(s),n.push(c),r.push(l),i.push(s),i.push(c),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=RegExp(`^(`+i.join(`|`)+`)`,`i`),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._weekdaysShortStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._weekdaysMinStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function nn(){return this.hours()%12||12}function rn(){return this.hours()||24}B(`H`,[`HH`,2],0,`hour`),B(`h`,[`hh`,2],0,nn),B(`k`,[`kk`,2],0,rn),B(`hmm`,0,0,function(){return``+nn.apply(this)+F(this.minutes(),2)}),B(`hmmss`,0,0,function(){return``+nn.apply(this)+F(this.minutes(),2)+F(this.seconds(),2)}),B(`Hmm`,0,0,function(){return``+this.hours()+F(this.minutes(),2)}),B(`Hmmss`,0,0,function(){return``+this.hours()+F(this.minutes(),2)+F(this.seconds(),2)});function an(e,t){B(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}an(`a`,!0),an(`A`,!1);function on(e,t){return t._meridiemParse}U(`a`,on),U(`A`,on),U(`H`,H,Fe),U(`h`,H,Pe),U(`k`,H,Pe),U(`HH`,H,ye),U(`hh`,H,ye),U(`kk`,H,ye),U(`hmm`,Ce),U(`hmmss`,we),U(`Hmm`,Ce),U(`Hmmss`,we),G([`H`,`HH`],q),G([`k`,`kk`],function(e,t,n){var r=W(e);t[q]=r===24?0:r}),G([`a`,`A`],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),G([`h`,`hh`],function(e,t,n){t[q]=W(e),h(n).bigHour=!0}),G(`hmm`,function(e,t,n){var r=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r)),h(n).bigHour=!0}),G(`hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r,2)),t[Je]=W(e.substr(i)),h(n).bigHour=!0}),G(`Hmm`,function(e,t,n){var r=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r))}),G(`Hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r,2)),t[Je]=W(e.substr(i))});function sn(e){return(e+``).toLowerCase().charAt(0)===`p`}var cn=/[ap]\.?m?\.?/i,ln=tt(`Hours`,!0);function un(e,t,n){return e>11?n?`pm`:`PM`:n?`am`:`AM`}var dn={calendar:N,longDateFormat:ie,invalidDate:oe,ordinal:ce,dayOfMonthOrdinalParse:le,relativeTime:de,months:ct,monthsShort:lt,week:At,weekdays:Rt,weekdaysMin:Bt,weekdaysShort:zt,meridiemParse:cn},Y={},fn={},pn;function mn(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function hn(e){return e&&e.toLowerCase().replace(`_`,`-`)}function gn(e){for(var t=0,n,r,i,a;t<e.length;){for(a=hn(e[t]).split(`-`),n=a.length,r=hn(e[t+1]),r=r?r.split(`-`):null;n>0;){if(i=vn(a.slice(0,n).join(`-`)),i)return i;if(r&&r.length>=n&&mn(a,r)>=n-1)break;n--}t++}return pn}function _n(e){return!!(e&&e.match(`^[^/\\\\]*$`))}function vn(e){var n=null,r;if(Y[e]===void 0&&t!==void 0&&t&&t.exports&&_n(e))try{n=pn._abbr,r=require,r(`./locale/`+e),yn(n)}catch{Y[e]=null}return Y[e]}function yn(e,t){var n;return e&&(n=c(t)?Sn(e):bn(e,t),n?pn=n:typeof console<`u`&&console.warn&&console.warn(`Locale `+e+` not found. Did you forget to load it?`)),pn._abbr}function bn(e,t){if(t!==null){var n,r=dn;if(t.abbr=e,Y[e]!=null)D(`defineLocaleOverride`,`use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.`),r=Y[e]._config;else if(t.parentLocale!=null)if(Y[t.parentLocale]!=null)r=Y[t.parentLocale]._config;else if(n=vn(t.parentLocale),n!=null)r=n._config;else return fn[t.parentLocale]||(fn[t.parentLocale]=[]),fn[t.parentLocale].push({name:e,config:t}),null;return Y[e]=new j(A(r,t)),fn[e]&&fn[e].forEach(function(e){bn(e.name,e.config)}),yn(e),Y[e]}else return delete Y[e],null}function xn(e,t){if(t!=null){var n,r,i=dn;Y[e]!=null&&Y[e].parentLocale!=null?Y[e].set(A(Y[e]._config,t)):(r=vn(e),r!=null&&(i=r._config),t=A(i,t),r??(t.abbr=e),n=new j(t),n.parentLocale=Y[e],Y[e]=n),yn(e)}else Y[e]!=null&&(Y[e].parentLocale==null?Y[e]!=null&&delete Y[e]:(Y[e]=Y[e].parentLocale,e===yn()&&yn(e)));return Y[e]}function Sn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return pn;if(!i(e)){if(t=vn(e),t)return t;e=[e]}return gn(e)}function Cn(){return M(Y)}function wn(e){var t,n=e._a;return n&&h(e).overflow===-2&&(t=n[Ge]<0||n[Ge]>11?Ge:n[Ke]<1||n[Ke]>st(n[K],n[Ge])?Ke:n[q]<0||n[q]>24||n[q]===24&&(n[qe]!==0||n[Je]!==0||n[Ye]!==0)?q:n[qe]<0||n[qe]>59?qe:n[Je]<0||n[Je]>59?Je:n[Ye]<0||n[Ye]>999?Ye:-1,h(e)._overflowDayOfYear&&(t<K||t>Ke)&&(t=Ke),h(e)._overflowWeeks&&t===-1&&(t=Xe),h(e)._overflowWeekday&&t===-1&&(t=Ze),h(e).overflow=t),e}var Tn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,En=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dn=/Z|[+-]\d\d(?::?\d\d)?/,On=[[`YYYYYY-MM-DD`,/[+-]\d{6}-\d\d-\d\d/],[`YYYY-MM-DD`,/\d{4}-\d\d-\d\d/],[`GGGG-[W]WW-E`,/\d{4}-W\d\d-\d/],[`GGGG-[W]WW`,/\d{4}-W\d\d/,!1],[`YYYY-DDD`,/\d{4}-\d{3}/],[`YYYY-MM`,/\d{4}-\d\d/,!1],[`YYYYYYMMDD`,/[+-]\d{10}/],[`YYYYMMDD`,/\d{8}/],[`GGGG[W]WWE`,/\d{4}W\d{3}/],[`GGGG[W]WW`,/\d{4}W\d{2}/,!1],[`YYYYDDD`,/\d{7}/],[`YYYYMM`,/\d{6}/,!1],[`YYYY`,/\d{4}/,!1]],kn=[[`HH:mm:ss.SSSS`,/\d\d:\d\d:\d\d\.\d+/],[`HH:mm:ss,SSSS`,/\d\d:\d\d:\d\d,\d+/],[`HH:mm:ss`,/\d\d:\d\d:\d\d/],[`HH:mm`,/\d\d:\d\d/],[`HHmmss.SSSS`,/\d\d\d\d\d\d\.\d+/],[`HHmmss,SSSS`,/\d\d\d\d\d\d,\d+/],[`HHmmss`,/\d\d\d\d\d\d/],[`HHmm`,/\d\d\d\d/],[`HH`,/\d\d/]],An=/^\/?Date\((-?\d+)/i,jn=/^(?:(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{4}))$/,Mn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Nn(e){var t,n,r=e._i,i=Tn.exec(r)||En.exec(r),a,o,s,c,l=On.length,u=kn.length;if(i){for(h(e).iso=!0,t=0,n=l;t<n;t++)if(On[t][1].exec(i[1])){o=On[t][0],a=On[t][2]!==!1;break}if(o==null){e._isValid=!1;return}if(i[3]){for(t=0,n=u;t<n;t++)if(kn[t][1].exec(i[3])){s=(i[2]||` `)+kn[t][0];break}if(s==null){e._isValid=!1;return}}if(!a&&s!=null){e._isValid=!1;return}if(i[4])if(Dn.exec(i[4]))c=`Z`;else{e._isValid=!1;return}e._f=o+(s||``)+(c||``),Gn(e)}else e._isValid=!1}function Pn(e,t,n,r,i,a){var o=[Fn(e),lt.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&o.push(parseInt(a,10)),o}function Fn(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function In(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).replace(/^\s\s*/,``).replace(/\s\s*$/,``)}function Ln(e,t,n){return e&&zt.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay()?(h(n).weekdayMismatch=!0,n._isValid=!1,!1):!0}function Rn(e,t,n){if(e)return Mn[e];if(t)return 0;var r=parseInt(n,10),i=r%100;return(r-i)/100*60+i}function zn(e){var t=jn.exec(In(e._i)),n;if(t){if(n=Pn(t[4],t[3],t[2],t[5],t[6],t[7]),!Ln(t[1],n,e))return;e._a=n,e._tzm=Rn(t[8],t[9],t[10]),e._d=wt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function Bn(e){var t=An.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Nn(e),e._isValid===!1)delete e._isValid;else return;if(zn(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:n.createFromInputFallback(e)}n.createFromInputFallback=T(`value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.`,function(e){e._d=new Date(e._i+(e._useUTC?` UTC`:``))});function Vn(e,t,n){return e??t??n}function Hn(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Un(e){var t,n,r=[],i,a,o;if(!e._d){for(i=Hn(e),e._w&&e._a[Ke]==null&&e._a[Ge]==null&&Wn(e),e._dayOfYear!=null&&(o=Vn(e._a[K],i[K]),(e._dayOfYear>Qe(o)||e._dayOfYear===0)&&(h(e)._overflowDayOfYear=!0),n=wt(o,0,e._dayOfYear),e._a[Ge]=n.getUTCMonth(),e._a[Ke]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[q]===24&&e._a[qe]===0&&e._a[Je]===0&&e._a[Ye]===0&&(e._nextDay=!0,e._a[q]=0),e._d=(e._useUTC?wt:Ct).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[q]=24),e._w&&e._w.d!==void 0&&e._w.d!==a&&(h(e).weekdayMismatch=!0)}}function Wn(e){var t=e._w,n,r,i,a,o,s,c,l;t.GG!=null||t.W!=null||t.E!=null?(a=1,o=4,n=Vn(t.GG,e._a[K],Dt(X(),1,4).year),r=Vn(t.W,1),i=Vn(t.E,1),(i<1||i>7)&&(c=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,l=Dt(X(),a,o),n=Vn(t.gg,e._a[K],l.year),r=Vn(t.w,l.week),t.d==null?t.e==null?i=a:(i=t.e+a,(t.e<0||t.e>6)&&(c=!0)):(i=t.d,(i<0||i>6)&&(c=!0))),r<1||r>Ot(n,a,o)?h(e)._overflowWeeks=!0:c==null?(s=Et(n,r,i,a,o),e._a[K]=s.year,e._dayOfYear=s.dayOfYear):h(e)._overflowWeekday=!0}n.ISO_8601=function(){},n.RFC_2822=function(){};function Gn(e){if(e._f===n.ISO_8601){Nn(e);return}if(e._f===n.RFC_2822){zn(e);return}e._a=[],h(e).empty=!0;var t=``+e._i,r,i,a,o,s,c=t.length,l=0,u,d;for(a=re(e._f,e._locale).match(I)||[],d=a.length,r=0;r<d;r++)o=a[r],i=(t.match(Le(o,e))||[])[0],i&&(s=t.substr(0,t.indexOf(i)),s.length>0&&h(e).unusedInput.push(s),t=t.slice(t.indexOf(i)+i.length),l+=i.length),z[o]?(i?h(e).empty=!1:h(e).unusedTokens.push(o),Ue(o,i,e)):e._strict&&!i&&h(e).unusedTokens.push(o);h(e).charsLeftOver=c-l,t.length>0&&h(e).unusedInput.push(t),e._a[q]<=12&&h(e).bigHour===!0&&e._a[q]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[q]=Kn(e._locale,e._a[q],e._meridiem),u=h(e).era,u!==null&&(e._a[K]=e._locale.erasConvertYear(u,e._a[K])),Un(e),wn(e)}function Kn(e,t,n){var r;return n==null?t:e.meridiemHour==null?e.isPM==null?t:(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0),t):e.meridiemHour(t,n)}function qn(e){var t,n,r,i,a,o,s=!1,c=e._f.length;if(c===0){h(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<c;i++)a=0,o=!1,t=x({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Gn(t),_(t)&&(o=!0),a+=h(t).charsLeftOver,a+=h(t).unusedTokens.length*10,h(t).score=a,s?a<r&&(r=a,n=t):(r==null||a<r||o)&&(r=a,n=t,o&&(s=!0));f(e,n||t)}function Jn(e){if(!e._d){var t=he(e._i),n=t.day===void 0?t.date:t.day;e._a=d([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Un(e)}}function Yn(e){var t=new S(wn(Xn(e)));return t._nextDay&&=(t.add(1,`d`),void 0),t}function Xn(e){var t=e._i,n=e._f;return e._locale=e._locale||Sn(e._l),t===null||n===void 0&&t===``?v({nullInput:!0}):(typeof t==`string`&&(e._i=t=e._locale.preparse(t)),C(t)?new S(wn(t)):(u(t)?e._d=t:i(n)?qn(e):n?Gn(e):Zn(e),_(e)||(e._d=null),e))}function Zn(e){var t=e._i;c(t)?e._d=new Date(n.now()):u(t)?e._d=new Date(t.valueOf()):typeof t==`string`?Bn(e):i(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),Un(e)):a(t)?Jn(e):l(t)?e._d=new Date(t):n.createFromInputFallback(e)}function Qn(e,t,n,r,o){var c={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(a(e)&&s(e)||i(e)&&e.length===0)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=o,c._l=n,c._i=e,c._f=t,c._strict=r,Yn(c)}function X(e,t,n,r){return Qn(e,t,n,r,!1)}var $n=T(`moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=X.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),er=T(`moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=X.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:v()});function tr(e,t){var n,r;if(t.length===1&&i(t[0])&&(t=t[0]),!t.length)return X();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function nr(){return tr(`isBefore`,[].slice.call(arguments,0))}function rr(){return tr(`isAfter`,[].slice.call(arguments,0))}var ir=function(){return Date.now?Date.now():+new Date},ar=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`,`millisecond`];function or(e){var t,n=!1,r,i=ar.length;for(t in e)if(o(e,t)&&!(J.call(ar,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[ar[r]]){if(n)return!1;parseFloat(e[ar[r]])!==W(e[ar[r]])&&(n=!0)}return!0}function sr(){return this._isValid}function cr(){return jr(NaN)}function lr(e){var t=he(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,s=t.hour||0,c=t.minute||0,l=t.second||0,u=t.millisecond||0;this._isValid=or(t),this._milliseconds=+u+l*1e3+c*6e4+s*1e3*60*60,this._days=+o+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=Sn(),this._bubble()}function ur(e){return e instanceof lr}function dr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function fr(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,o;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&W(e[o])!==W(t[o]))&&a++;return a+i}function pr(e,t){B(e,0,0,function(){var e=this.utcOffset(),n=`+`;return e<0&&(e=-e,n=`-`),n+F(~~(e/60),2)+t+F(~~e%60,2)})}pr(`Z`,`:`),pr(`ZZ`,``),U(`Z`,je),U(`ZZ`,je),G([`Z`,`ZZ`],function(e,t,n){n._useUTC=!0,n._tzm=hr(je,e)});var mr=/([\+\-]|\d\d)/gi;function hr(e,t){var n=(t||``).match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+``).match(mr)||[`-`,0,0],a=+(i[1]*60)+W(i[2]),a===0?0:i[0]===`+`?a:-a)}function gr(e,t){var r,i;return t._isUTC?(r=t.clone(),i=(C(e)||u(e)?e.valueOf():X(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+i),n.updateOffset(r,!1),r):X(e).local()}function _r(e){return-Math.round(e._d.getTimezoneOffset())}n.updateOffset=function(){};function vr(e,t,r){var i=this._offset||0,a;if(!this.isValid())return e==null?NaN:this;if(e!=null){if(typeof e==`string`){if(e=hr(je,e),e===null)return this}else Math.abs(e)<16&&!r&&(e*=60);return!this._isUTC&&t&&(a=_r(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,`m`),i!==e&&(!t||this._changeInProgress?Ir(this,jr(e-i,`m`),1,!1):this._changeInProgress||=(this._changeInProgress=!0,n.updateOffset(this,!0),null)),this}else return this._isUTC?i:_r(this)}function yr(e,t){return e==null?-this.utcOffset():(typeof e!=`string`&&(e=-e),this.utcOffset(e,t),this)}function br(e){return this.utcOffset(0,e)}function xr(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(_r(this),`m`)),this}function Sr(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i==`string`){var e=hr(Ae,this._i);e==null?this.utcOffset(0,!0):this.utcOffset(e)}return this}function Cr(e){return this.isValid()?(e=e?X(e).utcOffset():0,(this.utcOffset()-e)%60==0):!1}function wr(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Tr(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e={},t;return x(e,this),e=Xn(e),e._a?(t=e._isUTC?p(e._a):X(e._a),this._isDSTShifted=this.isValid()&&fr(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Er(){return this.isValid()?!this._isUTC:!1}function Dr(){return this.isValid()?this._isUTC:!1}function Or(){return this.isValid()?this._isUTC&&this._offset===0:!1}var kr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ar=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jr(e,t){var n=e,r=null,i,a,s;return ur(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=kr.exec(e))?(i=r[1]===`-`?-1:1,n={y:0,d:W(r[Ke])*i,h:W(r[q])*i,m:W(r[qe])*i,s:W(r[Je])*i,ms:W(dr(r[Ye]*1e3))*i}):(r=Ar.exec(e))?(i=r[1]===`-`?-1:1,n={y:Mr(r[2],i),M:Mr(r[3],i),w:Mr(r[4],i),d:Mr(r[5],i),h:Mr(r[6],i),m:Mr(r[7],i),s:Mr(r[8],i)}):n==null?n={}:typeof n==`object`&&(`from`in n||`to`in n)&&(s=Pr(X(n.from),X(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),a=new lr(n),ur(e)&&o(e,`_locale`)&&(a._locale=e._locale),ur(e)&&o(e,`_isValid`)&&(a._isValid=e._isValid),a}jr.fn=lr.prototype,jr.invalid=cr;function Mr(e,t){var n=e&&parseFloat(e.replace(`,`,`.`));return(isNaN(n)?0:n)*t}function Nr(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,`M`).isAfter(t)&&--n.months,n.milliseconds=t-+e.clone().add(n.months,`M`),n}function Pr(e,t){var n;return e.isValid()&&t.isValid()?(t=gr(t,e),e.isBefore(t)?n=Nr(e,t):(n=Nr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Fr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(D(t,`moment().`+t+`(period, number) is deprecated. Please use moment().`+t+`(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.`),a=n,n=r,r=a),i=jr(n,r),Ir(this,i,e),this}}function Ir(e,t,r,i){var a=t._milliseconds,o=dr(t._days),s=dr(t._months);e.isValid()&&(i??=!0,s&&_t(e,nt(e,`Month`)+s*r),o&&rt(e,`Date`,nt(e,`Date`)+o*r),a&&e._d.setTime(e._d.valueOf()+a*r),i&&n.updateOffset(e,o||s))}var Lr=Fr(1,`add`),Rr=Fr(-1,`subtract`);function zr(e){return typeof e==`string`||e instanceof String}function Br(e){return C(e)||u(e)||zr(e)||l(e)||Hr(e)||Vr(e)||e==null}function Vr(e){var t=a(e)&&!s(e),n=!1,r=[`years`,`year`,`y`,`months`,`month`,`M`,`days`,`day`,`d`,`dates`,`date`,`D`,`hours`,`hour`,`h`,`minutes`,`minute`,`m`,`seconds`,`second`,`s`,`milliseconds`,`millisecond`,`ms`],i,c,l=r.length;for(i=0;i<l;i+=1)c=r[i],n||=o(e,c);return t&&n}function Hr(e){var t=i(e),n=!1;return t&&(n=e.filter(function(t){return!l(t)&&zr(e)}).length===0),t&&n}function Ur(e){var t=a(e)&&!s(e),n=!1,r=[`sameDay`,`nextDay`,`lastDay`,`nextWeek`,`lastWeek`,`sameElse`],i,c;for(i=0;i<r.length;i+=1)c=r[i],n||=o(e,c);return t&&n}function Wr(e,t){var n=e.diff(t,`days`,!0);return n<-6?`sameElse`:n<-1?`lastWeek`:n<0?`lastDay`:n<1?`sameDay`:n<2?`nextDay`:n<7?`nextWeek`:`sameElse`}function Gr(e,t){arguments.length===1&&(arguments[0]?Br(arguments[0])?(e=arguments[0],t=void 0):Ur(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var r=e||X(),i=gr(r,this).startOf(`day`),a=n.calendarFormat(this,i)||`sameElse`,o=t&&(O(t[a])?t[a].call(this,r):t[a]);return this.format(o||this.localeData().calendar(a,this,X(r)))}function Kr(){return new S(this)}function qr(e,t){var n=C(e)?e:X(e);return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Jr(e,t){var n=C(e)?e:X(e);return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Yr(e,t,n,r){var i=C(e)?e:X(e),a=C(t)?t:X(t);return this.isValid()&&i.isValid()&&a.isValid()?(r||=`()`,(r[0]===`(`?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===`)`?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Xr(e,t){var n=C(e)?e:X(e),r;return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Zr(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Qr(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function $r(e,t,n){var r,i,a;if(!this.isValid()||(r=gr(e,this),!r.isValid()))return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=V(t),t){case`year`:a=ei(this,r)/12;break;case`month`:a=ei(this,r);break;case`quarter`:a=ei(this,r)/3;break;case`second`:a=(this-r)/1e3;break;case`minute`:a=(this-r)/6e4;break;case`hour`:a=(this-r)/36e5;break;case`day`:a=(this-r-i)/864e5;break;case`week`:a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:Be(a)}function ei(e,t){if(e.date()<t.date())return-ei(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,`months`),i,a;return t-r<0?(i=e.clone().add(n-1,`months`),a=(t-r)/(r-i)):(i=e.clone().add(n+1,`months`),a=(t-r)/(i-r)),-(n+a)||0}n.defaultFormat=`YYYY-MM-DDTHH:mm:ssZ`,n.defaultFormatUtc=`YYYY-MM-DDTHH:mm:ss[Z]`;function ti(){return this.clone().locale(`en`).format(`ddd MMM DD YYYY HH:mm:ss [GMT]ZZ`)}function ni(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?ne(n,t?`YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYYYY-MM-DD[T]HH:mm:ss.SSSZ`):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace(`Z`,ne(n,`Z`)):ne(n,t?`YYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYY-MM-DD[T]HH:mm:ss.SSSZ`)}function ri(){if(!this.isValid())return`moment.invalid(/* `+this._i+` */)`;var e=`moment`,t=``,n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?`moment.utc`:`moment.parseZone`,t=`Z`),n=`[`+e+`("]`,r=0<=this.year()&&this.year()<=9999?`YYYY`:`YYYYYY`,i=`-MM-DD[T]HH:mm:ss.SSS`,a=t+`[")]`,this.format(n+r+i+a)}function ii(e){e||=this.isUtc()?n.defaultFormatUtc:n.defaultFormat;var t=ne(this,e);return this.localeData().postformat(t)}function ai(e,t){return this.isValid()&&(C(e)&&e.isValid()||X(e).isValid())?jr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oi(e){return this.from(X(),e)}function si(e,t){return this.isValid()&&(C(e)&&e.isValid()||X(e).isValid())?jr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ci(e){return this.to(X(),e)}function li(e){var t;return e===void 0?this._locale._abbr:(t=Sn(e),t!=null&&(this._locale=t),this)}var ui=T(`moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.`,function(e){return e===void 0?this.localeData():this.locale(e)});function di(){return this._locale}var fi=1e3,pi=60*fi,mi=60*pi,hi=146097*24*mi;function gi(e,t){return(e%t+t)%t}function _i(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-hi:new Date(e,t,n).valueOf()}function vi(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hi:Date.UTC(e,t,n)}function yi(e){var t,r;if(e=V(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(r=this._isUTC?vi:_i,e){case`year`:t=r(this.year(),0,1);break;case`quarter`:t=r(this.year(),this.month()-this.month()%3,1);break;case`month`:t=r(this.year(),this.month(),1);break;case`week`:t=r(this.year(),this.month(),this.date()-this.weekday());break;case`isoWeek`:t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case`day`:case`date`:t=r(this.year(),this.month(),this.date());break;case`hour`:t=this._d.valueOf(),t-=gi(t+(this._isUTC?0:this.utcOffset()*pi),mi);break;case`minute`:t=this._d.valueOf(),t-=gi(t,pi);break;case`second`:t=this._d.valueOf(),t-=gi(t,fi);break}return this._d.setTime(t),n.updateOffset(this,!0),this}function bi(e){var t,r;if(e=V(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(r=this._isUTC?vi:_i,e){case`year`:t=r(this.year()+1,0,1)-1;break;case`quarter`:t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case`month`:t=r(this.year(),this.month()+1,1)-1;break;case`week`:t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case`isoWeek`:t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case`day`:case`date`:t=r(this.year(),this.month(),this.date()+1)-1;break;case`hour`:t=this._d.valueOf(),t+=mi-gi(t+(this._isUTC?0:this.utcOffset()*pi),mi)-1;break;case`minute`:t=this._d.valueOf(),t+=pi-gi(t,pi)-1;break;case`second`:t=this._d.valueOf(),t+=fi-gi(t,fi)-1;break}return this._d.setTime(t),n.updateOffset(this,!0),this}function xi(){return this._d.valueOf()-(this._offset||0)*6e4}function Si(){return Math.floor(this.valueOf()/1e3)}function Ci(){return new Date(this.valueOf())}function wi(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ti(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ei(){return this.isValid()?this.toISOString():null}function Di(){return _(this)}function Oi(){return f({},h(this))}function ki(){return h(this).overflow}function Ai(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}B(`N`,0,0,`eraAbbr`),B(`NN`,0,0,`eraAbbr`),B(`NNN`,0,0,`eraAbbr`),B(`NNNN`,0,0,`eraName`),B(`NNNNN`,0,0,`eraNarrow`),B(`y`,[`y`,1],`yo`,`eraYear`),B(`y`,[`yy`,2],0,`eraYear`),B(`y`,[`yyy`,3],0,`eraYear`),B(`y`,[`yyyy`,4],0,`eraYear`),U(`N`,Vi),U(`NN`,Vi),U(`NNN`,Vi),U(`NNNN`,Hi),U(`NNNNN`,Ui),G([`N`,`NN`,`NNN`,`NNNN`,`NNNNN`],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?h(n).era=i:h(n).invalidEra=e}),U(`y`,Oe),U(`yy`,Oe),U(`yyy`,Oe),U(`yyyy`,Oe),U(`yo`,Wi),G([`y`,`yy`,`yyy`,`yyyy`],K),G([`yo`],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[K]=n._locale.eraYearOrdinalParse(e,i):t[K]=parseInt(e,10)});function ji(e,t){var r,i,a,o=this._eras||Sn(`en`)._eras;for(r=0,i=o.length;r<i;++r){switch(typeof o[r].since){case`string`:a=n(o[r].since).startOf(`day`),o[r].since=a.valueOf();break}switch(typeof o[r].until){case`undefined`:o[r].until=1/0;break;case`string`:a=n(o[r].until).startOf(`day`).valueOf(),o[r].until=a.valueOf();break}}return o}function Mi(e,t,n){var r,i,a=this.eras(),o,s,c;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(o=a[r].name.toUpperCase(),s=a[r].abbr.toUpperCase(),c=a[r].narrow.toUpperCase(),n)switch(t){case`N`:case`NN`:case`NNN`:if(s===e)return a[r];break;case`NNNN`:if(o===e)return a[r];break;case`NNNNN`:if(c===e)return a[r];break}else if([o,s,c].indexOf(e)>=0)return a[r]}function Ni(e,t){var r=e.since<=e.until?1:-1;return t===void 0?n(e.since).year():n(e.since).year()+(t-e.offset)*r}function Pi(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return``}function Fi(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return``}function Ii(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return``}function Li(){var e,t,r,i,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(r=a[e].since<=a[e].until?1:-1,i=this.clone().startOf(`day`).valueOf(),a[e].since<=i&&i<=a[e].until||a[e].until<=i&&i<=a[e].since)return(this.year()-n(a[e].since).year())*r+a[e].offset;return this.year()}function Ri(e){return o(this,`_erasNameRegex`)||Gi.call(this),e?this._erasNameRegex:this._erasRegex}function zi(e){return o(this,`_erasAbbrRegex`)||Gi.call(this),e?this._erasAbbrRegex:this._erasRegex}function Bi(e){return o(this,`_erasNarrowRegex`)||Gi.call(this),e?this._erasNarrowRegex:this._erasRegex}function Vi(e,t){return t.erasAbbrRegex(e)}function Hi(e,t){return t.erasNameRegex(e)}function Ui(e,t){return t.erasNarrowRegex(e)}function Wi(e,t){return t._eraYearOrdinalRegex||Oe}function Gi(){var e=[],t=[],n=[],r=[],i,a,o,s,c,l=this.eras();for(i=0,a=l.length;i<a;++i)o=ze(l[i].name),s=ze(l[i].abbr),c=ze(l[i].narrow),t.push(o),e.push(s),n.push(c),r.push(o),r.push(s),r.push(c);this._erasRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._erasNameRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`),this._erasAbbrRegex=RegExp(`^(`+e.join(`|`)+`)`,`i`),this._erasNarrowRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`)}B(0,[`gg`,2],0,function(){return this.weekYear()%100}),B(0,[`GG`,2],0,function(){return this.isoWeekYear()%100});function Ki(e,t){B(0,[e,e.length],0,t)}Ki(`gggg`,`weekYear`),Ki(`ggggg`,`weekYear`),Ki(`GGGG`,`isoWeekYear`),Ki(`GGGGG`,`isoWeekYear`),U(`G`,ke),U(`g`,ke),U(`GG`,H,ye),U(`gg`,H,ye),U(`GGGG`,Ee,xe),U(`gggg`,Ee,xe),U(`GGGGG`,De,Se),U(`ggggg`,De,Se),He([`gggg`,`ggggg`,`GGGG`,`GGGGG`],function(e,t,n,r){t[r.substr(0,2)]=W(e)}),He([`gg`,`GG`],function(e,t,r,i){t[i]=n.parseTwoDigitYear(e)});function qi(e){return $i.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Ji(e){return $i.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Yi(){return Ot(this.year(),1,4)}function Xi(){return Ot(this.isoWeekYear(),1,4)}function Zi(){var e=this.localeData()._week;return Ot(this.year(),e.dow,e.doy)}function Qi(){var e=this.localeData()._week;return Ot(this.weekYear(),e.dow,e.doy)}function $i(e,t,n,r,i){var a;return e==null?Dt(this,r,i).year:(a=Ot(e,r,i),t>a&&(t=a),ea.call(this,e,t,n,r,i))}function ea(e,t,n,r,i){var a=Et(e,t,n,r,i),o=wt(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}B(`Q`,0,`Qo`,`quarter`),U(`Q`,ve),G(`Q`,function(e,t){t[Ge]=(W(e)-1)*3});function ta(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}B(`D`,[`DD`,2],`Do`,`date`),U(`D`,H,Pe),U(`DD`,H,ye),U(`Do`,function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),G([`D`,`DD`],Ke),G(`Do`,function(e,t){t[Ke]=W(e.match(H)[0])});var na=tt(`Date`,!0);B(`DDD`,[`DDDD`,3],`DDDo`,`dayOfYear`),U(`DDD`,Te),U(`DDDD`,be),G([`DDD`,`DDDD`],function(e,t,n){n._dayOfYear=W(e)});function ra(e){var t=Math.round((this.clone().startOf(`day`)-this.clone().startOf(`year`))/864e5)+1;return e==null?t:this.add(e-t,`d`)}B(`m`,[`mm`,2],0,`minute`),U(`m`,H,Fe),U(`mm`,H,ye),G([`m`,`mm`],qe);var ia=tt(`Minutes`,!1);B(`s`,[`ss`,2],0,`second`),U(`s`,H,Fe),U(`ss`,H,ye),G([`s`,`ss`],Je);var aa=tt(`Seconds`,!1);B(`S`,0,0,function(){return~~(this.millisecond()/100)}),B(0,[`SS`,2],0,function(){return~~(this.millisecond()/10)}),B(0,[`SSS`,3],0,`millisecond`),B(0,[`SSSS`,4],0,function(){return this.millisecond()*10}),B(0,[`SSSSS`,5],0,function(){return this.millisecond()*100}),B(0,[`SSSSSS`,6],0,function(){return this.millisecond()*1e3}),B(0,[`SSSSSSS`,7],0,function(){return this.millisecond()*1e4}),B(0,[`SSSSSSSS`,8],0,function(){return this.millisecond()*1e5}),B(0,[`SSSSSSSSS`,9],0,function(){return this.millisecond()*1e6}),U(`S`,Te,ve),U(`SS`,Te,ye),U(`SSS`,Te,be);var oa,sa;for(oa=`SSSS`;oa.length<=9;oa+=`S`)U(oa,Oe);function ca(e,t){t[Ye]=W((`0.`+e)*1e3)}for(oa=`S`;oa.length<=9;oa+=`S`)G(oa,ca);sa=tt(`Milliseconds`,!1),B(`z`,0,0,`zoneAbbr`),B(`zz`,0,0,`zoneName`);function la(){return this._isUTC?`UTC`:``}function ua(){return this._isUTC?`Coordinated Universal Time`:``}var Z=S.prototype;Z.add=Lr,Z.calendar=Gr,Z.clone=Kr,Z.diff=$r,Z.endOf=bi,Z.format=ii,Z.from=ai,Z.fromNow=oi,Z.to=si,Z.toNow=ci,Z.get=it,Z.invalidAt=ki,Z.isAfter=qr,Z.isBefore=Jr,Z.isBetween=Yr,Z.isSame=Xr,Z.isSameOrAfter=Zr,Z.isSameOrBefore=Qr,Z.isValid=Di,Z.lang=ui,Z.locale=li,Z.localeData=di,Z.max=er,Z.min=$n,Z.parsingFlags=Oi,Z.set=at,Z.startOf=yi,Z.subtract=Rr,Z.toArray=wi,Z.toObject=Ti,Z.toDate=Ci,Z.toISOString=ni,Z.inspect=ri,typeof Symbol<`u`&&Symbol.for!=null&&(Z[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return`Moment<`+this.format()+`>`}),Z.toJSON=Ei,Z.toString=ti,Z.unix=Si,Z.valueOf=xi,Z.creationData=Ai,Z.eraName=Pi,Z.eraNarrow=Fi,Z.eraAbbr=Ii,Z.eraYear=Li,Z.year=$e,Z.isLeapYear=et,Z.weekYear=qi,Z.isoWeekYear=Ji,Z.quarter=Z.quarters=ta,Z.month=vt,Z.daysInMonth=yt,Z.week=Z.weeks=Nt,Z.isoWeek=Z.isoWeeks=Pt,Z.weeksInYear=Zi,Z.weeksInWeekYear=Qi,Z.isoWeeksInYear=Yi,Z.isoWeeksInISOWeekYear=Xi,Z.date=na,Z.day=Z.days=Yt,Z.weekday=Xt,Z.isoWeekday=Zt,Z.dayOfYear=ra,Z.hour=Z.hours=ln,Z.minute=Z.minutes=ia,Z.second=Z.seconds=aa,Z.millisecond=Z.milliseconds=sa,Z.utcOffset=vr,Z.utc=br,Z.local=xr,Z.parseZone=Sr,Z.hasAlignedHourOffset=Cr,Z.isDST=wr,Z.isLocal=Er,Z.isUtcOffset=Dr,Z.isUtc=Or,Z.isUTC=Or,Z.zoneAbbr=la,Z.zoneName=ua,Z.dates=T(`dates accessor is deprecated. Use date instead.`,na),Z.months=T(`months accessor is deprecated. Use month instead`,vt),Z.years=T(`years accessor is deprecated. Use year instead`,$e),Z.zone=T(`moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/`,yr),Z.isDSTShifted=T(`isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information`,Tr);function da(e){return X(e*1e3)}function fa(){return X.apply(null,arguments).parseZone()}function pa(e){return e}var Q=j.prototype;Q.calendar=P,Q.longDateFormat=ae,Q.invalidDate=se,Q.ordinal=ue,Q.preparse=pa,Q.postformat=pa,Q.relativeTime=fe,Q.pastFuture=pe,Q.set=k,Q.eras=ji,Q.erasParse=Mi,Q.erasConvertYear=Ni,Q.erasAbbrRegex=zi,Q.erasNameRegex=Ri,Q.erasNarrowRegex=Bi,Q.months=pt,Q.monthsShort=mt,Q.monthsParse=gt,Q.monthsRegex=xt,Q.monthsShortRegex=bt,Q.week=kt,Q.firstDayOfYear=Mt,Q.firstDayOfWeek=jt,Q.weekdays=Wt,Q.weekdaysMin=Kt,Q.weekdaysShort=Gt,Q.weekdaysParse=Jt,Q.weekdaysRegex=Qt,Q.weekdaysShortRegex=$t,Q.weekdaysMinRegex=en,Q.isPM=sn,Q.meridiem=un;function ma(e,t,n,r){var i=Sn(),a=p().set(r,t);return i[n](a,e)}function ha(e,t,n){if(l(e)&&(t=e,e=void 0),e||=``,t!=null)return ma(e,t,n,`month`);var r,i=[];for(r=0;r<12;r++)i[r]=ma(e,r,n,`month`);return i}function ga(e,t,n,r){typeof e==`boolean`?(l(t)&&(n=t,t=void 0),t||=``):(t=e,n=t,e=!1,l(t)&&(n=t,t=void 0),t||=``);var i=Sn(),a=e?i._week.dow:0,o,s=[];if(n!=null)return ma(t,(n+a)%7,r,`day`);for(o=0;o<7;o++)s[o]=ma(t,(o+a)%7,r,`day`);return s}function _a(e,t){return ha(e,t,`months`)}function va(e,t){return ha(e,t,`monthsShort`)}function ya(e,t,n){return ga(e,t,n,`weekdays`)}function ba(e,t,n){return ga(e,t,n,`weekdaysShort`)}function xa(e,t,n){return ga(e,t,n,`weekdaysMin`)}yn(`en`,{eras:[{since:`0001-01-01`,until:1/0,offset:1,name:`Anno Domini`,narrow:`AD`,abbr:`AD`},{since:`0000-12-31`,until:-1/0,offset:1,name:`Before Christ`,narrow:`BC`,abbr:`BC`}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(W(e%100/10)===1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)}}),n.lang=T(`moment.lang is deprecated. Use moment.locale instead.`,yn),n.langData=T(`moment.langData is deprecated. Use moment.localeData instead.`,Sn);var Sa=Math.abs;function Ca(){var e=this._data;return this._milliseconds=Sa(this._milliseconds),this._days=Sa(this._days),this._months=Sa(this._months),e.milliseconds=Sa(e.milliseconds),e.seconds=Sa(e.seconds),e.minutes=Sa(e.minutes),e.hours=Sa(e.hours),e.months=Sa(e.months),e.years=Sa(e.years),this}function wa(e,t,n,r){var i=jr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Ta(e,t){return wa(this,e,t,1)}function Ea(e,t){return wa(this,e,t,-1)}function Da(e){return e<0?Math.floor(e):Math.ceil(e)}function Oa(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,o,s,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Da(Aa(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=Be(e/1e3),r.seconds=i%60,a=Be(i/60),r.minutes=a%60,o=Be(a/60),r.hours=o%24,t+=Be(o/24),c=Be(ka(t)),n+=c,t-=Da(Aa(c)),s=Be(n/12),n%=12,r.days=t,r.months=n,r.years=s,this}function ka(e){return e*4800/146097}function Aa(e){return e*146097/4800}function ja(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=V(e),e===`month`||e===`quarter`||e===`year`)switch(t=this._days+r/864e5,n=this._months+ka(t),e){case`month`:return n;case`quarter`:return n/3;case`year`:return n/12}else switch(t=this._days+Math.round(Aa(this._months)),e){case`week`:return t/7+r/6048e5;case`day`:return t+r/864e5;case`hour`:return t*24+r/36e5;case`minute`:return t*1440+r/6e4;case`second`:return t*86400+r/1e3;case`millisecond`:return Math.floor(t*864e5)+r;default:throw Error(`Unknown unit `+e)}}function Ma(e){return function(){return this.as(e)}}var Na=Ma(`ms`),Pa=Ma(`s`),Fa=Ma(`m`),Ia=Ma(`h`),La=Ma(`d`),Ra=Ma(`w`),za=Ma(`M`),Ba=Ma(`Q`),Va=Ma(`y`),Ha=Na;function Ua(){return jr(this)}function Wa(e){return e=V(e),this.isValid()?this[e+`s`]():NaN}function Ga(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ka=Ga(`milliseconds`),qa=Ga(`seconds`),Ja=Ga(`minutes`),Ya=Ga(`hours`),Xa=Ga(`days`),Za=Ga(`months`),Qa=Ga(`years`);function $a(){return Be(this.days()/7)}var eo=Math.round,to={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function no(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ro(e,t,n,r){var i=jr(e).abs(),a=eo(i.as(`s`)),o=eo(i.as(`m`)),s=eo(i.as(`h`)),c=eo(i.as(`d`)),l=eo(i.as(`M`)),u=eo(i.as(`w`)),d=eo(i.as(`y`)),f=a<=n.ss&&[`s`,a]||a<n.s&&[`ss`,a]||o<=1&&[`m`]||o<n.m&&[`mm`,o]||s<=1&&[`h`]||s<n.h&&[`hh`,s]||c<=1&&[`d`]||c<n.d&&[`dd`,c];return n.w!=null&&(f=f||u<=1&&[`w`]||u<n.w&&[`ww`,u]),f=f||l<=1&&[`M`]||l<n.M&&[`MM`,l]||d<=1&&[`y`]||[`yy`,d],f[2]=t,f[3]=+e>0,f[4]=r,no.apply(null,f)}function io(e){return e===void 0?eo:typeof e==`function`?(eo=e,!0):!1}function ao(e,t){return to[e]===void 0?!1:t===void 0?to[e]:(to[e]=t,e===`s`&&(to.ss=t-1),!0)}function oo(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=to,i,a;return typeof e==`object`&&(t=e,e=!1),typeof e==`boolean`&&(n=e),typeof t==`object`&&(r=Object.assign({},to,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=ro(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var so=Math.abs;function co(e){return(e>0)-(e<0)||+e}function lo(){if(!this.isValid())return this.localeData().invalidDate();var e=so(this._milliseconds)/1e3,t=so(this._days),n=so(this._months),r,i,a,o,s=this.asSeconds(),c,l,u,d;return s?(r=Be(e/60),i=Be(r/60),e%=60,r%=60,a=Be(n/12),n%=12,o=e?e.toFixed(3).replace(/\.?0+$/,``):``,c=s<0?`-`:``,l=co(this._months)===co(s)?``:`-`,u=co(this._days)===co(s)?``:`-`,d=co(this._milliseconds)===co(s)?``:`-`,c+`P`+(a?l+a+`Y`:``)+(n?l+n+`M`:``)+(t?u+t+`D`:``)+(i||r||e?`T`:``)+(i?d+i+`H`:``)+(r?d+r+`M`:``)+(e?d+o+`S`:``)):`P0D`}var $=lr.prototype;return $.isValid=sr,$.abs=Ca,$.add=Ta,$.subtract=Ea,$.as=ja,$.asMilliseconds=Na,$.asSeconds=Pa,$.asMinutes=Fa,$.asHours=Ia,$.asDays=La,$.asWeeks=Ra,$.asMonths=za,$.asQuarters=Ba,$.asYears=Va,$.valueOf=Ha,$._bubble=Oa,$.clone=Ua,$.get=Wa,$.milliseconds=Ka,$.seconds=qa,$.minutes=Ja,$.hours=Ya,$.days=Xa,$.weeks=$a,$.months=Za,$.years=Qa,$.humanize=oo,$.toISOString=lo,$.toString=lo,$.toJSON=lo,$.locale=li,$.localeData=di,$.toIsoString=T(`toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)`,lo),$.lang=ui,B(`X`,0,0,`unix`),B(`x`,0,0,`valueOf`),U(`x`,ke),U(`X`,Me),G(`X`,function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),G(`x`,function(e,t,n){n._d=new Date(W(e))}),n.version=`2.30.1`,r(X),n.fn=Z,n.min=nr,n.max=rr,n.now=ir,n.utc=p,n.unix=da,n.months=_a,n.isDate=u,n.locale=yn,n.invalid=v,n.duration=jr,n.isMoment=C,n.weekdays=ya,n.parseZone=fa,n.localeData=Sn,n.isDuration=ur,n.monthsShort=va,n.weekdaysMin=xa,n.defineLocale=bn,n.updateLocale=xn,n.locales=Cn,n.weekdaysShort=ba,n.normalizeUnits=V,n.relativeTimeRounding=io,n.relativeTimeThreshold=ao,n.calendarFormat=Wr,n.prototype=Z,n.HTML5_FMT={DATETIME_LOCAL:`YYYY-MM-DDTHH:mm`,DATETIME_LOCAL_SECONDS:`YYYY-MM-DDTHH:mm:ss`,DATETIME_LOCAL_MS:`YYYY-MM-DDTHH:mm:ss.SSS`,DATE:`YYYY-MM-DD`,TIME:`HH:mm`,TIME_SECONDS:`HH:mm:ss`,TIME_MS:`HH:mm:ss.SSS`,WEEK:`GGGG-[W]WW`,MONTH:`YYYY-MM`},n}))})),Pe=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Ne()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";return e.defineLocale(`it`,{months:`gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre`.split(`_`),monthsShort:`gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic`.split(`_`),weekdays:`domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato`.split(`_`),weekdaysShort:`dom_lun_mar_mer_gio_ven_sab`.split(`_`),weekdaysMin:`do_lu_ma_me_gi_ve_sa`.split(`_`),longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd D MMMM YYYY HH:mm`},calendar:{sameDay:function(){return`[Oggi a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},nextDay:function(){return`[Domani a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},nextWeek:function(){return`dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},lastDay:function(){return`[Ieri a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},lastWeek:function(){switch(this.day()){case 0:return`[La scorsa] dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`;default:return`[Lo scorso] dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`}},sameElse:`L`},relativeTime:{future:`tra %s`,past:`%s fa`,s:`alcuni secondi`,ss:`%d secondi`,m:`un minuto`,mm:`%d minuti`,h:`un'ora`,hh:`%d ore`,d:`un giorno`,dd:`%d giorni`,w:`una settimana`,ww:`%d settimane`,M:`un mese`,MM:`%d mesi`,y:`un anno`,yy:`%d anni`},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:`%dº`,week:{dow:1,doy:4}})}))})),Fe=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Ne()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";return e.defineLocale(`en-gb`,{months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),monthsShort:`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),weekdaysShort:`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),weekdaysMin:`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd, D MMMM YYYY HH:mm`},calendar:{sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`},relativeTime:{future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(~~(e%100/10)==1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)},week:{dow:1,doy:4}})}))}));o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Ne()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";function t(e,t,n,r){var i={m:[`eine Minute`,`einer Minute`],h:[`eine Stunde`,`einer Stunde`],d:[`ein Tag`,`einem Tag`],dd:[e+` Tage`,e+` Tagen`],w:[`eine Woche`,`einer Woche`],M:[`ein Monat`,`einem Monat`],MM:[e+` Monate`,e+` Monaten`],y:[`ein Jahr`,`einem Jahr`],yy:[e+` Jahre`,e+` Jahren`]};return t?i[n][0]:i[n][1]}return e.defineLocale(`de`,{months:`Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember`.split(`_`),monthsShort:`Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.`.split(`_`),monthsParseExact:!0,weekdays:`Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag`.split(`_`),weekdaysShort:`So._Mo._Di._Mi._Do._Fr._Sa.`.split(`_`),weekdaysMin:`So_Mo_Di_Mi_Do_Fr_Sa`.split(`_`),weekdaysParseExact:!0,longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD.MM.YYYY`,LL:`D. MMMM YYYY`,LLL:`D. MMMM YYYY HH:mm`,LLLL:`dddd, D. MMMM YYYY HH:mm`},calendar:{sameDay:`[heute um] LT [Uhr]`,sameElse:`L`,nextDay:`[morgen um] LT [Uhr]`,nextWeek:`dddd [um] LT [Uhr]`,lastDay:`[gestern um] LT [Uhr]`,lastWeek:`[letzten] dddd [um] LT [Uhr]`},relativeTime:{future:`in %s`,past:`vor %s`,s:`ein paar Sekunden`,ss:`%d Sekunden`,m:t,mm:`%d Minuten`,h:t,hh:`%d Stunden`,d:t,dd:t,w:t,ww:`%d Wochen`,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:`%d.`,week:{dow:1,doy:4}})}))}))(),Fe(),Pe();var Ie=e=>{let t=``;return e.split(`:`).forEach(e=>{t+=e}),parseInt(t)},U=e=>e.toString().padStart(4,`0`).match(/.{1,2}/g).join(`:`),Le=e=>{let t=e.address;if(e.addresstype===`county`&&t.country)return t.county;if(e.addresstype===`village`&&t.village)return t.village;let n=[];return[`emergency`,`historic`,`military`,`natural`,`landuse`,`place`,`railway`,`man_made`,`aerialway`,`boundary`,`amenity`,`aeroway`,`club`,`craft`,`leisure`,`office`,`mountain_pass`,`shop`,`tourism`,`bridge`,`tunnel`,`waterway`,`name`].forEach(e=>{t.hasOwnProperty(e)&&t[e]&&n.push(t[e])}),t.road?n.push(t.road):t.pedestrian?n.push(t.pedestrian):t.suburb?n.push(t.suburb):t.square?n.push(t.square):(t.neighbourhood&&n.push(t.neighbourhood),t.hamlet?n.push(t.hamlet):t.isolated_dwelling?n.push(t.isolated_dwelling):t.locality?n.push(t.locality):t.croft&&n.push(t.croft)),t.house_number&&n.push(t.house_number),t.postcode&&n.push(t.postcode),t.village&&n.push(t.village),t.town?n.push(t.town):t.city&&n.push(t.city),n.join(`, `).substr(0,150)};function Re(e){let t=window.sessionStorage.getItem(e);if(t!==null){let n=JSON.parse(t);if(new Date(n.expirationDate)>new Date)return n.value;window.sessionStorage.removeItem(e)}return null}function ze(e,t,n){let r=n?new Date(n*1e3):null;if(r){let n={value:t,expirationDate:r.toISOString()};window.sessionStorage.setItem(e,JSON.stringify(n))}}function Be({day:e,slot:t,i18next:n}){return(0,f.jsx)(`li`,{className:`it-list-item`,children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsx)(`div`,{className:`it-right-zone`,children:(0,f.jsxs)(`span`,{className:`text pl-4`,children:[(0,f.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,f.jsx)(`b`,{children:t})]})})})})}function W(){return typeof document>`u`?void 0:document.activeElement?.closest?.(`[data-formio-widget-scope]`)||document.querySelector(`[data-formio-widget-scope]`)||document.querySelector(`widget-formio`)||document.body}var Ve=l.Formio.Components.components.field,G=({component:e,current:t,onChange:n,i18next:r})=>{let[i,a]=(0,d.useState)(),[o,s]=(0,d.useState)([]),[c,l]=(0,d.useState)([]),[u,p]=(0,d.useState)(!1),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),[E,D]=(0,d.useState)(null),[O,k]=(0,d.useState)({}),[A,M]=(0,d.useState)(null),[N,P]=(0,d.useState)(!1),[F,I]=(0,d.useState)([]),[L,R]=(0,d.useState)(!1),z=(0,d.useRef)(),B=e.calendarId;g.default.locale(r.language),y.default.locale(r.language);let ee=e=>{let t=(0,g.default)(e).format(`YYYY-MM-DD`);fetch(ie(t)).then(e=>e.json()).then(t=>{let n=re(e||new Date),r=t.filter(e=>e.available==1);r.length===0&&he();let i=[];n.forEach(e=>{t.some(t=>t.date===e&&t.available==1)?i.push({available:!0,date:e}):i.push({available:!1,date:e})}),s(i.map(e=>{if(e.available===!1)return(0,g.default)(e.date,`YYYY-MM-DD`).toDate()})),te(r.length?r[0].date:e)}).catch(e=>console.error(e))},te=e=>{D(null),T(null),l([]);let t=(0,g.default)(e).format(`YYYY-MM-DD`);fetch(ae(t)).then(e=>e.json()).then(t=>{let n=t.filter(e=>e.availability==1);k(n[0]),n.length>0?(l(t),p(!1),T((0,g.default)(e).format(`L`)),a((0,g.default)(e,`YYYY-MM-DD`).toDate())):(t.length>0&&a((0,g.default)(t[0].date,`YYYY-MM-DD`).toDate()),l([]),he())})},ne=()=>{if(B!==``&&B!=null)if(!t.dataValue)ee(new Date);else if(e.multiple&&Array.isArray(t.dataValue)){if(t.dataValue.length>0){M(t.dataValue);let e=[];t.dataValue.map(t=>{e.push({...t,date:(0,g.default)(t.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)})}),I(e)}}else if(!e.multiple&&typeof t.dataValue==`object`){let e={date:t.dataValue.date,slot:t.dataValue.slot};I([{...t.dataValue,date:(0,g.default)(t.dataValue.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)}]),M(e)}else{let r=t.dataValue.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),i=r[2].split(`#`),a={date:(0,g.default)(r[0],`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:r[1]};e.multiple?(n([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}]),I([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])):(n({date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}),I([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])),M(a)}};(0,d.useEffect)(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{ne()},1e3)})},[]);let re=e=>{let t=(0,g.default)(e,`YYYY-MM`).daysInMonth(),n=[];for(;t;){let r=(0,g.default)(e).date(t);n.push(r.format(`YYYY-MM-DD`)),t--}return n},ie=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=`${j()}/api/calendars/${r}/availabilities`,s=[`from_time=${(0,g.default)(t).startOf(`month`).format(`YYYY-MM-DD`)}`,`to_time=${(0,g.default)(t).endOf(`month`).format(`YYYY-MM-DD`)}`];return n&&s.push(`available=${n}`),i&&a&&s.push(`opening_hours=${a.join()}`),`${o}?${s.join(`&`)}`},ae=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=(0,g.default)(t).format(`YYYY-MM-DD`),s=`${j()}/api/calendars/${r}/availabilities/${o}`,c=[];return n&&c.push(`available=${n}`),i&&a&&c.push(`opening_hours=${a.join()}`),c&&(s=`${s}?${c.join(`&`)}`),s},oe=e=>{ee(e)},se=e=>{setTimeout(()=>{P(!N)},1e3),te(e)},ce=e=>{D(null),setTimeout(()=>{e&&(C(e.target.dataset),D(e.target.id))},300)},le=t=>{x(null);let n=`${j()}/it/meetings/new-draft`,i={date:S?.date?(0,g.default)(S?.date).format(`DD-MM-YYYY`):(0,g.default)(t.target.dataset.date).format(`DD-MM-YYYY`),slot:S?.value_start&&S?.value_end?S.value_start+`-`+S.value_end:t.target.dataset.slots,calendar:e.calendarId,opening_hour:S?.opening_hour?S?.opening_hour:t.target.dataset.opening_hour,meeting:b?b.id:``,first_available_date:O.date,first_available_start_time:O.start_time,first_available_end_time:O.end_time,first_availability_updated_at:(0,g.default)().format()};fetch(n,{method:`POST`,body:JSON.stringify(i),headers:{"Content-Type":`application/json; charset=utf-8`},strictErrors:!0}).then(e=>{if(!e.ok)throw Error(r.t(`Intervallo selezionato non disponibile!`));return e.json()}).then(e=>{x(e);let t={date:i.date,slot:i.slot,calendar_id:i.calendar[0],opening_hour_id:i.opening_hour||i.opening_hour_id,meeting_id:e.id};I([...F,t])}).catch(e=>{console.log(e),v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},ue=()=>{S&&(le(),P(!N))},de=()=>(0,f.jsx)(`span`,{children:r.t(`Tempo prenotazione scaduto!`)}),fe=({minutes:e,seconds:t,completed:n})=>n?(0,f.jsx)(de,{}):(0,f.jsx)(`div`,{children:(0,f.jsxs)(`div`,{children:[` `,(0,f.jsxs)(`span`,{children:[` `,(0,f.jsxs)(`i`,{children:[r.t(`Per confermare la prenotazione che ti abbiamo riservato procedi con l’invio di questa pratica e con il pagamento (se richiesto) di quanto previsto entro`),`:`]}),` `,(0,f.jsxs)(`b`,{children:[e,` `,r.t(`minuti`),` `,t,` `,r.t(`secondi`)]})]})]})}),pe=e=>{let t=Ie(e.target.value),n=Ie(e.target.min),i=Ie(e.target.max);t<n||t>i||t>Ie(S.end)?(v.default.fire({title:``,html:`<p>${r.t(`l'orario`)} <b>${U(t)}</b> ${r.t(`non è valido`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),V(``)):C({...S,value_start:e.target.value})},me=e=>{let t=Ie(e.target.value),n=Ie(e.target.min),i=Ie(e.target.max);t<n||t>i||t<Ie(S.start)?(v.default.fire({title:``,html:`<p>${r.t(`l'orario`)} <b>${U(t)}</b> ${r.t(`non è valido`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),V(``)):C({...S,value_end:e.target.value})},V=t=>{if(t===null||t===``)n(``);else if(Array.isArray(t)&&t.length>0){let t=[];F.map(e=>{t.push({date:(0,g.default)(e.date,`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:e.slot,calendar_id:e.calendar_id||e.calendar[0],meeting_id:e.meeting_id,opening_hour_id:e.opening_hour||e.opening_hour_id})}),e.multiple?n(t):n(t[0])}else n(``)},he=()=>{p(!0),x(null),T(null),V(null)},ge=()=>{if(r.language===`it`)return Me;if(r.language===`en`)return Ce;if(r.language===`de`)return _e};(0,d.useEffect)(()=>{V(F)},[F]),(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&L===!1?(R(!0),setTimeout(()=>{ne()},1e3)):(R(!1),setTimeout(()=>{ne()},1e3))},[]);let ve=(e,t)=>{let n=`${j()}/api/meetings/${t.meeting_id}`;fetch(n,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${Re(`auth-token`)}`},strictErrors:!0}).then(t=>{t&&t.status>400?v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori durante la cancellazione dello slot`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):(I([...F.slice(0,e),...F.slice(e+1)]),ee(new Date))})};return(0,f.jsxs)(f.Fragment,{children:[L&&A?(0,f.jsxs)(`div`,{className:`my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none`,children:[(0,f.jsxs)(`b`,{children:[Array.isArray(A)&&A.length>1?r.t(`Giorni selezionati per la prenotazione`):r.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,f.jsx)(`div`,{className:`mb-5`,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:Array.isArray(A)?A.map(e=>(0,f.jsx)(Be,{day:(0,g.default)(e.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:r,slot:e.slot})):(0,f.jsx)(Be,{day:(0,g.default)(A.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:r,slot:A.slot})})})})]}):(0,f.jsx)(`div`,{className:`slot-calendar `,children:(0,f.jsxs)(`div`,{className:`row`,children:[e.multiple?(0,f.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,f.jsxs)(`div`,{className:`m-2`,children:[(0,f.jsx)(`h6`,{children:r.t(e.label)}),(0,f.jsx)(m.DayPicker,{mode:`single`,selected:i,locale:ge(),disabled:o,onMonthChange:oe,onDayClick:se}),(0,f.jsx)(`p`,{children:r.t(`Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione`)})]})}):F.length===1?null:(0,f.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,f.jsxs)(`div`,{className:`m-2`,children:[(0,f.jsx)(`h6`,{children:r.t(e.label)}),(0,f.jsx)(m.DayPicker,{mode:`single`,selected:i,locale:ge(),disabled:o,onMonthChange:oe,onDayClick:se}),(0,f.jsxs)(`p`,{children:[` `,r.t(`Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione`)]})]})}),(0,f.jsx)(`div`,{className:`col-12`,children:F.length?(0,f.jsx)(`div`,{className:`row m-2`,children:(0,f.jsxs)(`div`,{className:`col-12 mb-4`,children:[(0,f.jsxs)(`b`,{children:[F.length>1?r.t(`Giorni selezionati per la prenotazione`):r.t(`Giorno selezionato per la prenotazione`),`:`,` `]}),(0,f.jsx)(`div`,{className:`mb-5`,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:F.map((e,t)=>(0,f.jsx)(`li`,{children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsxs)(`div`,{className:`it-right-zone`,children:[(0,f.jsxs)(`span`,{className:`text pl-4`,children:[e.date,` `,S||e.slot?`${r.t(`alle`)} ${e.slot}`:``]}),(0,f.jsx)(_.Icon,{icon:`it-delete`,onClick:()=>ve(t,e),role:`button`})]})})},`li`+t))})})}),b?(0,f.jsx)(_.Alert,{color:`info`,defaultValue:`string`,className:`d-print-none d-preview-calendar-none`,children:(0,f.jsx)(h.default,{date:b.expiration_time,renderer:fe})}):null]})}):null})]})}),(0,f.jsxs)(_.Modal,{isOpen:N,toggle:()=>P(!N),labelledBy:`daySelected`,size:`lg`,centered:!0,container:W(),children:[(0,f.jsx)(_.ModalHeader,{toggle:()=>P(!N),id:`daySelected`,children:r.t(`Seleziona una fascia oraria`)}),u?null:(0,f.jsxs)(`div`,{className:`title-xsmall u-grey-dark px-4`,children:[` `,r.t(`Seleziona una fascia oraria e, se necessario, utilizza l'apposito controllo per accorciare la durata della prenotazione, Poi clicca su Conferma`)]}),(0,f.jsx)(_.ModalBody,{children:(0,f.jsxs)(`div`,{className:`row`,children:[F.length>=1?(0,f.jsxs)(`div`,{children:[w&&!u?(0,f.jsxs)(`h6`,{children:[r.t(`Orari disponibili del`),` `,(0,y.default)(w).format(`DD/MM/YYYY`)]}):null,(0,f.jsxs)(`div`,{className:`calendar-last-selection col-12 pt-2 mb-5`,children:[(0,f.jsx)(`small`,{className:`pl-2 mb-2 d-flex px-2`,children:(0,f.jsxs)(`b`,{children:[(0,f.jsx)(_.Icon,{icon:`it-clock`,className:`mr-1`,size:`sm`}),` `,r.t(`Ultimo orario selezionato`)]})}),(0,f.jsx)(`div`,{className:`col-6 px-2`,children:(0,f.jsx)(`button`,{type:`button`,id:`slot-last-selection`,onClick:ce,tabIndex:`1`,className:E===`slot-last-selection`?`active btn btn-slot p-0`:`btn btn-slot p-0`,"data-date":(0,g.default)(w,`DD/MM/YYYY`).format(`YYYY-MM-DD`),"data-slots":F[F.length-1].slot,"data-opening_hour":F[F.length-1].opening_hour_id,"data-start":F[F.length-1].slot.split(`-`)[0],"data-end":F[F.length-1].slot.split(`-`)[1],"data-value_start":F[F.length-1].slot.split(`-`)[0],"data-value_end":F[F.length-1].slot.split(`-`)[1],disabled:u,children:F[F.length-1].slot})})]})]}):null,(0,f.jsx)(`div`,{children:w&&F.length>=1?(0,f.jsx)(`h6`,{children:r.t(`Seleziona altri orari`)}):u?null:(0,f.jsxs)(`h6`,{children:[r.t(`Orari disponibili del`),` `,(0,y.default)(w).format(`DD/MM/YYYY`)]})}),c.map((e,t)=>(0,f.jsx)(`div`,{className:`col-6`,children:(0,f.jsxs)(`button`,{type:`button`,id:`slot-`+t,onClick:ce,ref:z,className:E===`slot-`+t?`active btn btn-slot p-0`:`btn btn-slot p-0`,tabIndex:`1`,"data-date":e.date,"data-start":e.start_time,"data-end":e.end_time,"data-value_start":e.start_time,"data-value_end":e.end_time,"data-slots":e.start_time+`-`+e.end_time,"data-opening_hour":e.opening_hour,"data-min_duration":e.min_duration,disabled:e.slots_available==0,children:[e.start_time,` - `,e.end_time]})},`slot-`+t)),u?(0,f.jsxs)(`div`,{className:`callout callout-highlight warning`,children:[(0,f.jsxs)(`div`,{className:`callout-title`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":!0,icon:`it-help-circle`}),r.t(`Attenzione`)]}),(0,f.jsxs)(`p`,{children:[` `,r.t(`Non è possibile prenotare per la data selezionata`),`.`]})]}):null,(0,f.jsx)(`div`,{className:`col-12`,children:S?.value_start&&E?(0,f.jsxs)(`div`,{className:`row`,children:[(0,f.jsx)(`div`,{className:`col-12 mb-3`,children:(0,f.jsx)(`p`,{className:`mb-3`,children:(0,f.jsx)(`b`,{children:r.t(`Se necessario, utilizza il controllo che segue per accorciare la durata della prenotazione`)})})}),(0,f.jsx)(`div`,{className:`col-12 col-md-6 mb-4`,children:(0,f.jsx)(_.Input,{type:`time`,label:r.t(`Dalle`),className:`active`,defaultValue:S.value_start||S.start,min:S.start,max:S.end,onBlur:pe})}),(0,f.jsx)(`div`,{className:`col-12 col-md-6 mb-4`,children:(0,f.jsx)(_.Input,{type:`time`,label:r.t(`alle`),className:`active`,defaultValue:S.value_end||S.end,onBlur:me,min:S.start,max:S.end})})]}):null})]})}),(0,f.jsx)(_.ModalFooter,{children:(0,f.jsx)(_.Button,{color:`primary`,onClick:()=>ue(),disabled:!w||!S?.value_start,children:r.t(`Conferma`)})})]})]})},He=class e extends Ve{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Dynamic Calendar`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Ve.schema({type:`dynamic_calendar`})}static editForm=N;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,u.createRoot)(e),this.rootComponent.render((0,f.jsx)(G,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){if(e)if(Array.isArray(e))this.selectedNextSlots=e,this.updateValue(e),this.shouldSetValue=!0;else if(typeof e==`object`)this.date=e.date,this.slot=e.slot,this.meeting=e.meeting_id,this.meeting_expiration_time=null,this.opening_hour=e.opening_hour_id,this.calendar_id=e.calendar_id,this.updateValue(e),this.shouldSetValue=!0;else{let t=e.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),n=t[2].split(`#`);this.date=t[0],this.slot=t[1],this.meeting=n[1],this.meeting_expiration_time=null,this.opening_hour=n.length===3?n[2]:``,this.updateValue({date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:this.meeting,opening_hour_id:this.opening_hour})}}getValue(){if(!(this.date&&this.slot&&this.meeting&&this.opening_hour)&&!(this.selectedNextSlots&&this.selectedNextSlots.length>0))return null;let e=this.meeting?this.meeting:``,t=this.opening_hour?this.opening_hour:``;return this.component.multiple?this.selectedNextSlots:{date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:e,opening_hour_id:t}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Ue=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{type:`select`,label:`Nome Calendario`,key:`calendarId`,input:!0,weight:1,placeholder:`Nome Calendario`,tooltip:`Inserisci il nome del calendario`,dataSrc:`url`,defaultValue:``,data:{url:j()+`/api/calendars?type=time_fixed_slots`},valueProperty:`id`,template:`<span>{{ item.title }}</span>`,selectValues:`Results`},{type:`checkbox`,label:`Seleziona orari di apertura`,key:`select_opening_hours`,input:!0,weight:1,tooltip:`Abilita per selezionare i singoli orari di apertura`,defaultValue:!1},{label:`Base url`,calculateValue:`let url = '`+j()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{type:`select`,label:`Orari di apertura`,key:`opening_hours`,input:!0,weight:1,placeholder:`Seleziona gli orari di apertura`,tooltip:`Seleziona gli orari di apertura`,multiple:!0,dataSrc:`url`,defaultValue:``,data:{url:j()+`/api/calendars/{{data.calendarId}}/opening-hours`},valueProperty:`id`,template:`<span>{{ item.name }}</span>`,selectValues:`results`,conditional:{show:!0,when:`select_opening_hours`,eq:`true`}},{label:`Api Url`,redrawOn:`data`,calculateValue:`if (data.calendarId) {
35
+ `+Error().stack),r=!1}return t.apply(this,arguments)},t)}var E={};function D(e,t){n.deprecationHandler!=null&&n.deprecationHandler(e,t),E[e]||(w(t),E[e]=!0)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;function O(e){return typeof Function<`u`&&e instanceof Function||Object.prototype.toString.call(e)===`[object Function]`}function ee(e){var t,n;for(n in e)o(e,n)&&(t=e[n],O(t)?this[n]=t:this[`_`+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+`|\\d{1,2}`)}function k(e,t){var n=f({},e),r;for(r in t)o(t,r)&&(a(e[r])&&a(t[r])?(n[r]={},f(n[r],e[r]),f(n[r],t[r])):t[r]==null?delete n[r]:n[r]=t[r]);for(r in e)o(e,r)&&!o(t,r)&&a(e[r])&&(n[r]=f({},n[r]));return n}function A(e){e!=null&&this.set(e)}var j=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)o(e,t)&&n.push(t);return n},M={sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`};function te(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return O(r)?r.call(t,n):r}function N(e,t,n){var r=``+Math.abs(e),i=t-r.length;return(e>=0?n?`+`:``:`-`)+(10**Math.max(0,i)).toString().substr(1)+r}var P=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},L={};function R(e,t,n,r){var i=r;typeof r==`string`&&(i=function(){return this[r]()}),e&&(L[e]=i),t&&(L[t[0]]=function(){return N(i.apply(this,arguments),t[1],t[2])}),n&&(L[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function ne(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,``):e.replace(/\\/g,``)}function z(e){var t=e.match(P),n,r;for(n=0,r=t.length;n<r;n++)L[t[n]]?t[n]=L[t[n]]:t[n]=ne(t[n]);return function(n){var i=``,a;for(a=0;a<r;a++)i+=O(t[a])?t[a].call(n,e):t[a];return i}}function B(e,t){return e.isValid()?(t=re(t,e.localeData()),I[t]=I[t]||z(t),I[t](e)):e.localeData().invalidDate()}function re(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(F.lastIndex=0;n>=0&&F.test(e);)e=e.replace(F,r),F.lastIndex=0,--n;return e}var ie={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};function ae(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(P).map(function(e){return e===`MMMM`||e===`MM`||e===`DD`||e===`dddd`?e.slice(1):e}).join(``),this._longDateFormat[e])}var oe=`Invalid date`;function se(){return this._invalidDate}var ce=`%d`,le=/\d{1,2}/;function ue(e){return this._ordinal.replace(`%d`,e)}var de={future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,w:`a week`,ww:`%d weeks`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function fe(e,t,n,r){var i=this._relativeTime[n];return O(i)?i(e,t,n,r):i.replace(/%d/i,e)}function pe(e,t){var n=this._relativeTime[e>0?`future`:`past`];return O(n)?n(t):n.replace(/%s/i,t)}var me={D:`date`,dates:`date`,date:`date`,d:`day`,days:`day`,day:`day`,e:`weekday`,weekdays:`weekday`,weekday:`weekday`,E:`isoWeekday`,isoweekdays:`isoWeekday`,isoweekday:`isoWeekday`,DDD:`dayOfYear`,dayofyears:`dayOfYear`,dayofyear:`dayOfYear`,h:`hour`,hours:`hour`,hour:`hour`,ms:`millisecond`,milliseconds:`millisecond`,millisecond:`millisecond`,m:`minute`,minutes:`minute`,minute:`minute`,M:`month`,months:`month`,month:`month`,Q:`quarter`,quarters:`quarter`,quarter:`quarter`,s:`second`,seconds:`second`,second:`second`,gg:`weekYear`,weekyears:`weekYear`,weekyear:`weekYear`,GG:`isoWeekYear`,isoweekyears:`isoWeekYear`,isoweekyear:`isoWeekYear`,w:`week`,weeks:`week`,week:`week`,W:`isoWeek`,isoweeks:`isoWeek`,isoweek:`isoWeek`,y:`year`,years:`year`,year:`year`};function V(e){return typeof e==`string`?me[e]||me[e.toLowerCase()]:void 0}function he(e){var t={},n,r;for(r in e)o(e,r)&&(n=V(r),n&&(t[n]=e[r]));return t}var ge={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function _e(e){var t=[],n;for(n in e)o(e,n)&&t.push({unit:n,priority:ge[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}var ve=/\d/,ye=/\d\d/,be=/\d{3}/,xe=/\d{4}/,Se=/[+-]?\d{6}/,H=/\d\d?/,Ce=/\d\d\d\d?/,we=/\d\d\d\d\d\d?/,Te=/\d{1,3}/,Ee=/\d{1,4}/,De=/[+-]?\d{1,6}/,Oe=/\d+/,ke=/[+-]?\d+/,Ae=/Z|[+-]\d\d:?\d\d/gi,je=/Z|[+-]\d\d(?::?\d\d)?/gi,Me=/[+-]?\d+(\.\d{1,3})?/,Ne=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Pe=/^[1-9]\d?/,Fe=/^([1-9]\d|\d)/,Ie={};function U(e,t,n){Ie[e]=O(t)?t:function(e,r){return e&&n?n:t}}function Le(e,t){return o(Ie,e)?Ie[e](t._strict,t._locale):new RegExp(Re(e))}function Re(e){return ze(e.replace(`\\`,``).replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i}))}function ze(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)}function Be(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function W(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=Be(t)),n}var Ve={};function G(e,t){var n,r=t,i;for(typeof e==`string`&&(e=[e]),l(t)&&(r=function(e,n){n[t]=W(e)}),i=e.length,n=0;n<i;n++)Ve[e[n]]=r}function He(e,t){G(e,function(e,n,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function Ue(e,t,n){t!=null&&o(Ve,e)&&Ve[e](t,n._a,n,e)}function We(e){return e%4==0&&e%100!=0||e%400==0}var K=0,Ge=1,Ke=2,q=3,qe=4,Je=5,Ye=6,Xe=7,Ze=8;R(`Y`,0,0,function(){var e=this.year();return e<=9999?N(e,4):`+`+e}),R(0,[`YY`,2],0,function(){return this.year()%100}),R(0,[`YYYY`,4],0,`year`),R(0,[`YYYYY`,5],0,`year`),R(0,[`YYYYYY`,6,!0],0,`year`),U(`Y`,ke),U(`YY`,H,ye),U(`YYYY`,Ee,xe),U(`YYYYY`,De,Se),U(`YYYYYY`,De,Se),G([`YYYYY`,`YYYYYY`],K),G(`YYYY`,function(e,t){t[K]=e.length===2?n.parseTwoDigitYear(e):W(e)}),G(`YY`,function(e,t){t[K]=n.parseTwoDigitYear(e)}),G(`Y`,function(e,t){t[K]=parseInt(e,10)});function Qe(e){return We(e)?366:365}n.parseTwoDigitYear=function(e){return W(e)+(W(e)>68?1900:2e3)};var $e=tt(`FullYear`,!0);function et(){return We(this.year())}function tt(e,t){return function(r){return r==null?nt(this,e):(rt(this,e,r),n.updateOffset(this,t),this)}}function nt(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case`Milliseconds`:return r?n.getUTCMilliseconds():n.getMilliseconds();case`Seconds`:return r?n.getUTCSeconds():n.getSeconds();case`Minutes`:return r?n.getUTCMinutes():n.getMinutes();case`Hours`:return r?n.getUTCHours():n.getHours();case`Date`:return r?n.getUTCDate():n.getDate();case`Day`:return r?n.getUTCDay():n.getDay();case`Month`:return r?n.getUTCMonth():n.getMonth();case`FullYear`:return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function rt(e,t,n){var r,i,a,o,s;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case`Milliseconds`:i?r.setUTCMilliseconds(n):r.setMilliseconds(n);return;case`Seconds`:i?r.setUTCSeconds(n):r.setSeconds(n);return;case`Minutes`:i?r.setUTCMinutes(n):r.setMinutes(n);return;case`Hours`:i?r.setUTCHours(n):r.setHours(n);return;case`Date`:i?r.setUTCDate(n):r.setDate(n);return;case`FullYear`:break;default:return}a=n,o=e.month(),s=e.date(),s=s===29&&o===1&&!We(a)?28:s,i?r.setUTCFullYear(a,o,s):r.setFullYear(a,o,s)}}function it(e){return e=V(e),O(this[e])?this[e]():this}function at(e,t){if(typeof e==`object`){e=he(e);var n=_e(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=V(e),O(this[e]))return this[e](t);return this}function ot(e,t){return(e%t+t)%t}var J=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function st(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ot(t,12);return e+=(t-n)/12,n===1?We(e)?29:28:31-n%7%2}R(`M`,[`MM`,2],`Mo`,function(){return this.month()+1}),R(`MMM`,0,0,function(e){return this.localeData().monthsShort(this,e)}),R(`MMMM`,0,0,function(e){return this.localeData().months(this,e)}),U(`M`,H,Pe),U(`MM`,H,ye),U(`MMM`,function(e,t){return t.monthsShortRegex(e)}),U(`MMMM`,function(e,t){return t.monthsRegex(e)}),G([`M`,`MM`],function(e,t){t[Ge]=W(e)-1}),G([`MMM`,`MMMM`],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i==null?h(n).invalidMonth=e:t[Ge]=i});var ct=`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),lt=`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),ut=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,dt=Ne,ft=Ne;function pt(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ut).test(t)?`format`:`standalone`][e.month()]:i(this._months)?this._months:this._months.standalone}function mt(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ut.test(t)?`format`:`standalone`][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ht(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,``).toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,``).toLocaleLowerCase();return n?t===`MMM`?(i=J.call(this._shortMonthsParse,o),i===-1?null:i):(i=J.call(this._longMonthsParse,o),i===-1?null:i):t===`MMM`?(i=J.call(this._shortMonthsParse,o),i===-1?(i=J.call(this._longMonthsParse,o),i===-1?null:i):i):(i=J.call(this._longMonthsParse,o),i===-1?(i=J.call(this._shortMonthsParse,o),i===-1?null:i):i)}function gt(e,t,n){var r,i,a;if(this._monthsParseExact)return ht.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if(i=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=RegExp(`^`+this.months(i,``).replace(`.`,``)+`$`,`i`),this._shortMonthsParse[r]=RegExp(`^`+this.monthsShort(i,``).replace(`.`,``)+`$`,`i`)),!n&&!this._monthsParse[r]&&(a=`^`+this.months(i,``)+`|^`+this.monthsShort(i,``),this._monthsParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`MMMM`&&this._longMonthsParse[r].test(e)||n&&t===`MMM`&&this._shortMonthsParse[r].test(e)||!n&&this._monthsParse[r].test(e))return r}function _t(e,t){if(!e.isValid())return e;if(typeof t==`string`){if(/^\d+$/.test(t))t=W(t);else if(t=e.localeData().monthsParse(t),!l(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,st(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function vt(e){return e==null?nt(this,`Month`):(_t(this,e),n.updateOffset(this,!0),this)}function yt(){return st(this.year(),this.month())}function bt(e){return this._monthsParseExact?(o(this,`_monthsRegex`)||St.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,`_monthsShortRegex`)||(this._monthsShortRegex=dt),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function xt(e){return this._monthsParseExact?(o(this,`_monthsRegex`)||St.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,`_monthsRegex`)||(this._monthsRegex=ft),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function St(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i,a,o,s;for(i=0;i<12;i++)a=p([2e3,i]),o=ze(this.monthsShort(a,``)),s=ze(this.months(a,``)),t.push(o),n.push(s),r.push(s),r.push(o);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._monthsShortStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function Ct(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function wt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Tt(e,t,n){var r=7+t-n;return-((7+wt(e,0,r).getUTCDay()-t)%7)+r-1}function Et(e,t,n,r,i){var a=(7+n-r)%7,o=Tt(e,r,i),s=1+7*(t-1)+a+o,c,l;return s<=0?(c=e-1,l=Qe(c)+s):s>Qe(e)?(c=e+1,l=s-Qe(e)):(c=e,l=s),{year:c,dayOfYear:l}}function Dt(e,t,n){var r=Tt(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,o;return i<1?(o=e.year()-1,a=i+Ot(o,t,n)):i>Ot(e.year(),t,n)?(a=i-Ot(e.year(),t,n),o=e.year()+1):(o=e.year(),a=i),{week:a,year:o}}function Ot(e,t,n){var r=Tt(e,t,n),i=Tt(e+1,t,n);return(Qe(e)-r+i)/7}R(`w`,[`ww`,2],`wo`,`week`),R(`W`,[`WW`,2],`Wo`,`isoWeek`),U(`w`,H,Pe),U(`ww`,H,ye),U(`W`,H,Pe),U(`WW`,H,ye),He([`w`,`ww`,`W`,`WW`],function(e,t,n,r){t[r.substr(0,1)]=W(e)});function kt(e){return Dt(e,this._week.dow,this._week.doy).week}var At={dow:0,doy:6};function jt(){return this._week.dow}function Mt(){return this._week.doy}function Nt(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,`d`)}function Pt(e){var t=Dt(this,1,4).week;return e==null?t:this.add((e-t)*7,`d`)}R(`d`,0,`do`,`day`),R(`dd`,0,0,function(e){return this.localeData().weekdaysMin(this,e)}),R(`ddd`,0,0,function(e){return this.localeData().weekdaysShort(this,e)}),R(`dddd`,0,0,function(e){return this.localeData().weekdays(this,e)}),R(`e`,0,0,`weekday`),R(`E`,0,0,`isoWeekday`),U(`d`,H),U(`e`,H),U(`E`,H),U(`dd`,function(e,t){return t.weekdaysMinRegex(e)}),U(`ddd`,function(e,t){return t.weekdaysShortRegex(e)}),U(`dddd`,function(e,t){return t.weekdaysRegex(e)}),He([`dd`,`ddd`,`dddd`],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i==null?h(n).invalidWeekday=e:t.d=i}),He([`d`,`e`,`E`],function(e,t,n,r){t[r]=W(e)});function Ft(e,t){return typeof e==`string`?isNaN(e)?(e=t.weekdaysParse(e),typeof e==`number`?e:null):parseInt(e,10):e}function It(e,t){return typeof e==`string`?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Lt(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Rt=`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),zt=`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),Bt=`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),Vt=Ne,Ht=Ne,Ut=Ne;function Wt(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?`format`:`standalone`];return e===!0?Lt(n,this._week.dow):e?n[e.day()]:n}function Gt(e){return e===!0?Lt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Kt(e){return e===!0?Lt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function qt(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,``).toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,``).toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,``).toLocaleLowerCase();return n?t===`dddd`?(i=J.call(this._weekdaysParse,o),i===-1?null:i):t===`ddd`?(i=J.call(this._shortWeekdaysParse,o),i===-1?null:i):(i=J.call(this._minWeekdaysParse,o),i===-1?null:i):t===`dddd`?(i=J.call(this._weekdaysParse,o),i!==-1||(i=J.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=J.call(this._minWeekdaysParse,o),i===-1?null:i)):t===`ddd`?(i=J.call(this._shortWeekdaysParse,o),i!==-1||(i=J.call(this._weekdaysParse,o),i!==-1)?i:(i=J.call(this._minWeekdaysParse,o),i===-1?null:i)):(i=J.call(this._minWeekdaysParse,o),i!==-1||(i=J.call(this._weekdaysParse,o),i!==-1)?i:(i=J.call(this._shortWeekdaysParse,o),i===-1?null:i))}function Jt(e,t,n){var r,i,a;if(this._weekdaysParseExact)return qt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=RegExp(`^`+this.weekdays(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._shortWeekdaysParse[r]=RegExp(`^`+this.weekdaysShort(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._minWeekdaysParse[r]=RegExp(`^`+this.weekdaysMin(i,``).replace(`.`,`\\.?`)+`$`,`i`)),this._weekdaysParse[r]||(a=`^`+this.weekdays(i,``)+`|^`+this.weekdaysShort(i,``)+`|^`+this.weekdaysMin(i,``),this._weekdaysParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`dddd`&&this._fullWeekdaysParse[r].test(e)||n&&t===`ddd`&&this._shortWeekdaysParse[r].test(e)||n&&t===`dd`&&this._minWeekdaysParse[r].test(e)||!n&&this._weekdaysParse[r].test(e))return r}function Yt(e){if(!this.isValid())return e==null?NaN:this;var t=nt(this,`Day`);return e==null?t:(e=Ft(e,this.localeData()),this.add(e-t,`d`))}function Xt(e){if(!this.isValid())return e==null?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,`d`)}function Zt(e){if(!this.isValid())return e==null?NaN:this;if(e!=null){var t=It(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Qt(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,`_weekdaysRegex`)||(this._weekdaysRegex=Vt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function $t(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,`_weekdaysShortRegex`)||(this._weekdaysShortRegex=Ht),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function en(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,`_weekdaysMinRegex`)||(this._weekdaysMinRegex=Ut),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function tn(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i=[],a,o,s,c,l;for(a=0;a<7;a++)o=p([2e3,1]).day(a),s=ze(this.weekdaysMin(o,``)),c=ze(this.weekdaysShort(o,``)),l=ze(this.weekdays(o,``)),t.push(s),n.push(c),r.push(l),i.push(s),i.push(c),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=RegExp(`^(`+i.join(`|`)+`)`,`i`),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._weekdaysShortStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._weekdaysMinStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function nn(){return this.hours()%12||12}function rn(){return this.hours()||24}R(`H`,[`HH`,2],0,`hour`),R(`h`,[`hh`,2],0,nn),R(`k`,[`kk`,2],0,rn),R(`hmm`,0,0,function(){return``+nn.apply(this)+N(this.minutes(),2)}),R(`hmmss`,0,0,function(){return``+nn.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)}),R(`Hmm`,0,0,function(){return``+this.hours()+N(this.minutes(),2)}),R(`Hmmss`,0,0,function(){return``+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)});function an(e,t){R(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}an(`a`,!0),an(`A`,!1);function on(e,t){return t._meridiemParse}U(`a`,on),U(`A`,on),U(`H`,H,Fe),U(`h`,H,Pe),U(`k`,H,Pe),U(`HH`,H,ye),U(`hh`,H,ye),U(`kk`,H,ye),U(`hmm`,Ce),U(`hmmss`,we),U(`Hmm`,Ce),U(`Hmmss`,we),G([`H`,`HH`],q),G([`k`,`kk`],function(e,t,n){var r=W(e);t[q]=r===24?0:r}),G([`a`,`A`],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),G([`h`,`hh`],function(e,t,n){t[q]=W(e),h(n).bigHour=!0}),G(`hmm`,function(e,t,n){var r=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r)),h(n).bigHour=!0}),G(`hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r,2)),t[Je]=W(e.substr(i)),h(n).bigHour=!0}),G(`Hmm`,function(e,t,n){var r=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r))}),G(`Hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r,2)),t[Je]=W(e.substr(i))});function sn(e){return(e+``).toLowerCase().charAt(0)===`p`}var cn=/[ap]\.?m?\.?/i,ln=tt(`Hours`,!0);function un(e,t,n){return e>11?n?`pm`:`PM`:n?`am`:`AM`}var dn={calendar:M,longDateFormat:ie,invalidDate:oe,ordinal:ce,dayOfMonthOrdinalParse:le,relativeTime:de,months:ct,monthsShort:lt,week:At,weekdays:Rt,weekdaysMin:Bt,weekdaysShort:zt,meridiemParse:cn},Y={},fn={},pn;function mn(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function hn(e){return e&&e.toLowerCase().replace(`_`,`-`)}function gn(e){for(var t=0,n,r,i,a;t<e.length;){for(a=hn(e[t]).split(`-`),n=a.length,r=hn(e[t+1]),r=r?r.split(`-`):null;n>0;){if(i=vn(a.slice(0,n).join(`-`)),i)return i;if(r&&r.length>=n&&mn(a,r)>=n-1)break;n--}t++}return pn}function _n(e){return!!(e&&e.match(`^[^/\\\\]*$`))}function vn(e){var n=null,r;if(Y[e]===void 0&&t!==void 0&&t&&t.exports&&_n(e))try{n=pn._abbr,r=require,r(`./locale/`+e),yn(n)}catch{Y[e]=null}return Y[e]}function yn(e,t){var n;return e&&(n=c(t)?Sn(e):bn(e,t),n?pn=n:typeof console<`u`&&console.warn&&console.warn(`Locale `+e+` not found. Did you forget to load it?`)),pn._abbr}function bn(e,t){if(t!==null){var n,r=dn;if(t.abbr=e,Y[e]!=null)D(`defineLocaleOverride`,`use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.`),r=Y[e]._config;else if(t.parentLocale!=null)if(Y[t.parentLocale]!=null)r=Y[t.parentLocale]._config;else if(n=vn(t.parentLocale),n!=null)r=n._config;else return fn[t.parentLocale]||(fn[t.parentLocale]=[]),fn[t.parentLocale].push({name:e,config:t}),null;return Y[e]=new A(k(r,t)),fn[e]&&fn[e].forEach(function(e){bn(e.name,e.config)}),yn(e),Y[e]}else return delete Y[e],null}function xn(e,t){if(t!=null){var n,r,i=dn;Y[e]!=null&&Y[e].parentLocale!=null?Y[e].set(k(Y[e]._config,t)):(r=vn(e),r!=null&&(i=r._config),t=k(i,t),r??(t.abbr=e),n=new A(t),n.parentLocale=Y[e],Y[e]=n),yn(e)}else Y[e]!=null&&(Y[e].parentLocale==null?Y[e]!=null&&delete Y[e]:(Y[e]=Y[e].parentLocale,e===yn()&&yn(e)));return Y[e]}function Sn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return pn;if(!i(e)){if(t=vn(e),t)return t;e=[e]}return gn(e)}function Cn(){return j(Y)}function wn(e){var t,n=e._a;return n&&h(e).overflow===-2&&(t=n[Ge]<0||n[Ge]>11?Ge:n[Ke]<1||n[Ke]>st(n[K],n[Ge])?Ke:n[q]<0||n[q]>24||n[q]===24&&(n[qe]!==0||n[Je]!==0||n[Ye]!==0)?q:n[qe]<0||n[qe]>59?qe:n[Je]<0||n[Je]>59?Je:n[Ye]<0||n[Ye]>999?Ye:-1,h(e)._overflowDayOfYear&&(t<K||t>Ke)&&(t=Ke),h(e)._overflowWeeks&&t===-1&&(t=Xe),h(e)._overflowWeekday&&t===-1&&(t=Ze),h(e).overflow=t),e}var Tn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,En=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dn=/Z|[+-]\d\d(?::?\d\d)?/,On=[[`YYYYYY-MM-DD`,/[+-]\d{6}-\d\d-\d\d/],[`YYYY-MM-DD`,/\d{4}-\d\d-\d\d/],[`GGGG-[W]WW-E`,/\d{4}-W\d\d-\d/],[`GGGG-[W]WW`,/\d{4}-W\d\d/,!1],[`YYYY-DDD`,/\d{4}-\d{3}/],[`YYYY-MM`,/\d{4}-\d\d/,!1],[`YYYYYYMMDD`,/[+-]\d{10}/],[`YYYYMMDD`,/\d{8}/],[`GGGG[W]WWE`,/\d{4}W\d{3}/],[`GGGG[W]WW`,/\d{4}W\d{2}/,!1],[`YYYYDDD`,/\d{7}/],[`YYYYMM`,/\d{6}/,!1],[`YYYY`,/\d{4}/,!1]],kn=[[`HH:mm:ss.SSSS`,/\d\d:\d\d:\d\d\.\d+/],[`HH:mm:ss,SSSS`,/\d\d:\d\d:\d\d,\d+/],[`HH:mm:ss`,/\d\d:\d\d:\d\d/],[`HH:mm`,/\d\d:\d\d/],[`HHmmss.SSSS`,/\d\d\d\d\d\d\.\d+/],[`HHmmss,SSSS`,/\d\d\d\d\d\d,\d+/],[`HHmmss`,/\d\d\d\d\d\d/],[`HHmm`,/\d\d\d\d/],[`HH`,/\d\d/]],An=/^\/?Date\((-?\d+)/i,jn=/^(?:(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{4}))$/,Mn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Nn(e){var t,n,r=e._i,i=Tn.exec(r)||En.exec(r),a,o,s,c,l=On.length,u=kn.length;if(i){for(h(e).iso=!0,t=0,n=l;t<n;t++)if(On[t][1].exec(i[1])){o=On[t][0],a=On[t][2]!==!1;break}if(o==null){e._isValid=!1;return}if(i[3]){for(t=0,n=u;t<n;t++)if(kn[t][1].exec(i[3])){s=(i[2]||` `)+kn[t][0];break}if(s==null){e._isValid=!1;return}}if(!a&&s!=null){e._isValid=!1;return}if(i[4])if(Dn.exec(i[4]))c=`Z`;else{e._isValid=!1;return}e._f=o+(s||``)+(c||``),Gn(e)}else e._isValid=!1}function Pn(e,t,n,r,i,a){var o=[Fn(e),lt.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&o.push(parseInt(a,10)),o}function Fn(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function In(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).replace(/^\s\s*/,``).replace(/\s\s*$/,``)}function Ln(e,t,n){return e&&zt.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay()?(h(n).weekdayMismatch=!0,n._isValid=!1,!1):!0}function Rn(e,t,n){if(e)return Mn[e];if(t)return 0;var r=parseInt(n,10),i=r%100;return(r-i)/100*60+i}function zn(e){var t=jn.exec(In(e._i)),n;if(t){if(n=Pn(t[4],t[3],t[2],t[5],t[6],t[7]),!Ln(t[1],n,e))return;e._a=n,e._tzm=Rn(t[8],t[9],t[10]),e._d=wt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function Bn(e){var t=An.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Nn(e),e._isValid===!1)delete e._isValid;else return;if(zn(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:n.createFromInputFallback(e)}n.createFromInputFallback=T(`value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.`,function(e){e._d=new Date(e._i+(e._useUTC?` UTC`:``))});function Vn(e,t,n){return e??t??n}function Hn(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Un(e){var t,n,r=[],i,a,o;if(!e._d){for(i=Hn(e),e._w&&e._a[Ke]==null&&e._a[Ge]==null&&Wn(e),e._dayOfYear!=null&&(o=Vn(e._a[K],i[K]),(e._dayOfYear>Qe(o)||e._dayOfYear===0)&&(h(e)._overflowDayOfYear=!0),n=wt(o,0,e._dayOfYear),e._a[Ge]=n.getUTCMonth(),e._a[Ke]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[q]===24&&e._a[qe]===0&&e._a[Je]===0&&e._a[Ye]===0&&(e._nextDay=!0,e._a[q]=0),e._d=(e._useUTC?wt:Ct).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[q]=24),e._w&&e._w.d!==void 0&&e._w.d!==a&&(h(e).weekdayMismatch=!0)}}function Wn(e){var t=e._w,n,r,i,a,o,s,c,l;t.GG!=null||t.W!=null||t.E!=null?(a=1,o=4,n=Vn(t.GG,e._a[K],Dt(X(),1,4).year),r=Vn(t.W,1),i=Vn(t.E,1),(i<1||i>7)&&(c=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,l=Dt(X(),a,o),n=Vn(t.gg,e._a[K],l.year),r=Vn(t.w,l.week),t.d==null?t.e==null?i=a:(i=t.e+a,(t.e<0||t.e>6)&&(c=!0)):(i=t.d,(i<0||i>6)&&(c=!0))),r<1||r>Ot(n,a,o)?h(e)._overflowWeeks=!0:c==null?(s=Et(n,r,i,a,o),e._a[K]=s.year,e._dayOfYear=s.dayOfYear):h(e)._overflowWeekday=!0}n.ISO_8601=function(){},n.RFC_2822=function(){};function Gn(e){if(e._f===n.ISO_8601){Nn(e);return}if(e._f===n.RFC_2822){zn(e);return}e._a=[],h(e).empty=!0;var t=``+e._i,r,i,a,o,s,c=t.length,l=0,u,d;for(a=re(e._f,e._locale).match(P)||[],d=a.length,r=0;r<d;r++)o=a[r],i=(t.match(Le(o,e))||[])[0],i&&(s=t.substr(0,t.indexOf(i)),s.length>0&&h(e).unusedInput.push(s),t=t.slice(t.indexOf(i)+i.length),l+=i.length),L[o]?(i?h(e).empty=!1:h(e).unusedTokens.push(o),Ue(o,i,e)):e._strict&&!i&&h(e).unusedTokens.push(o);h(e).charsLeftOver=c-l,t.length>0&&h(e).unusedInput.push(t),e._a[q]<=12&&h(e).bigHour===!0&&e._a[q]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[q]=Kn(e._locale,e._a[q],e._meridiem),u=h(e).era,u!==null&&(e._a[K]=e._locale.erasConvertYear(u,e._a[K])),Un(e),wn(e)}function Kn(e,t,n){var r;return n==null?t:e.meridiemHour==null?e.isPM==null?t:(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0),t):e.meridiemHour(t,n)}function qn(e){var t,n,r,i,a,o,s=!1,c=e._f.length;if(c===0){h(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<c;i++)a=0,o=!1,t=x({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Gn(t),_(t)&&(o=!0),a+=h(t).charsLeftOver,a+=h(t).unusedTokens.length*10,h(t).score=a,s?a<r&&(r=a,n=t):(r==null||a<r||o)&&(r=a,n=t,o&&(s=!0));f(e,n||t)}function Jn(e){if(!e._d){var t=he(e._i),n=t.day===void 0?t.date:t.day;e._a=d([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Un(e)}}function Yn(e){var t=new S(wn(Xn(e)));return t._nextDay&&=(t.add(1,`d`),void 0),t}function Xn(e){var t=e._i,n=e._f;return e._locale=e._locale||Sn(e._l),t===null||n===void 0&&t===``?v({nullInput:!0}):(typeof t==`string`&&(e._i=t=e._locale.preparse(t)),C(t)?new S(wn(t)):(u(t)?e._d=t:i(n)?qn(e):n?Gn(e):Zn(e),_(e)||(e._d=null),e))}function Zn(e){var t=e._i;c(t)?e._d=new Date(n.now()):u(t)?e._d=new Date(t.valueOf()):typeof t==`string`?Bn(e):i(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),Un(e)):a(t)?Jn(e):l(t)?e._d=new Date(t):n.createFromInputFallback(e)}function Qn(e,t,n,r,o){var c={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(a(e)&&s(e)||i(e)&&e.length===0)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=o,c._l=n,c._i=e,c._f=t,c._strict=r,Yn(c)}function X(e,t,n,r){return Qn(e,t,n,r,!1)}var $n=T(`moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=X.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),er=T(`moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=X.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:v()});function tr(e,t){var n,r;if(t.length===1&&i(t[0])&&(t=t[0]),!t.length)return X();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function nr(){return tr(`isBefore`,[].slice.call(arguments,0))}function rr(){return tr(`isAfter`,[].slice.call(arguments,0))}var ir=function(){return Date.now?Date.now():+new Date},ar=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`,`millisecond`];function or(e){var t,n=!1,r,i=ar.length;for(t in e)if(o(e,t)&&!(J.call(ar,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[ar[r]]){if(n)return!1;parseFloat(e[ar[r]])!==W(e[ar[r]])&&(n=!0)}return!0}function sr(){return this._isValid}function cr(){return jr(NaN)}function lr(e){var t=he(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,s=t.hour||0,c=t.minute||0,l=t.second||0,u=t.millisecond||0;this._isValid=or(t),this._milliseconds=+u+l*1e3+c*6e4+s*1e3*60*60,this._days=+o+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=Sn(),this._bubble()}function ur(e){return e instanceof lr}function dr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function fr(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,o;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&W(e[o])!==W(t[o]))&&a++;return a+i}function pr(e,t){R(e,0,0,function(){var e=this.utcOffset(),n=`+`;return e<0&&(e=-e,n=`-`),n+N(~~(e/60),2)+t+N(~~e%60,2)})}pr(`Z`,`:`),pr(`ZZ`,``),U(`Z`,je),U(`ZZ`,je),G([`Z`,`ZZ`],function(e,t,n){n._useUTC=!0,n._tzm=hr(je,e)});var mr=/([\+\-]|\d\d)/gi;function hr(e,t){var n=(t||``).match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+``).match(mr)||[`-`,0,0],a=+(i[1]*60)+W(i[2]),a===0?0:i[0]===`+`?a:-a)}function gr(e,t){var r,i;return t._isUTC?(r=t.clone(),i=(C(e)||u(e)?e.valueOf():X(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+i),n.updateOffset(r,!1),r):X(e).local()}function _r(e){return-Math.round(e._d.getTimezoneOffset())}n.updateOffset=function(){};function vr(e,t,r){var i=this._offset||0,a;if(!this.isValid())return e==null?NaN:this;if(e!=null){if(typeof e==`string`){if(e=hr(je,e),e===null)return this}else Math.abs(e)<16&&!r&&(e*=60);return!this._isUTC&&t&&(a=_r(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,`m`),i!==e&&(!t||this._changeInProgress?Ir(this,jr(e-i,`m`),1,!1):this._changeInProgress||=(this._changeInProgress=!0,n.updateOffset(this,!0),null)),this}else return this._isUTC?i:_r(this)}function yr(e,t){return e==null?-this.utcOffset():(typeof e!=`string`&&(e=-e),this.utcOffset(e,t),this)}function br(e){return this.utcOffset(0,e)}function xr(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(_r(this),`m`)),this}function Sr(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i==`string`){var e=hr(Ae,this._i);e==null?this.utcOffset(0,!0):this.utcOffset(e)}return this}function Cr(e){return this.isValid()?(e=e?X(e).utcOffset():0,(this.utcOffset()-e)%60==0):!1}function wr(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Tr(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e={},t;return x(e,this),e=Xn(e),e._a?(t=e._isUTC?p(e._a):X(e._a),this._isDSTShifted=this.isValid()&&fr(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Er(){return this.isValid()?!this._isUTC:!1}function Dr(){return this.isValid()?this._isUTC:!1}function Or(){return this.isValid()?this._isUTC&&this._offset===0:!1}var kr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ar=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jr(e,t){var n=e,r=null,i,a,s;return ur(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=kr.exec(e))?(i=r[1]===`-`?-1:1,n={y:0,d:W(r[Ke])*i,h:W(r[q])*i,m:W(r[qe])*i,s:W(r[Je])*i,ms:W(dr(r[Ye]*1e3))*i}):(r=Ar.exec(e))?(i=r[1]===`-`?-1:1,n={y:Mr(r[2],i),M:Mr(r[3],i),w:Mr(r[4],i),d:Mr(r[5],i),h:Mr(r[6],i),m:Mr(r[7],i),s:Mr(r[8],i)}):n==null?n={}:typeof n==`object`&&(`from`in n||`to`in n)&&(s=Pr(X(n.from),X(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),a=new lr(n),ur(e)&&o(e,`_locale`)&&(a._locale=e._locale),ur(e)&&o(e,`_isValid`)&&(a._isValid=e._isValid),a}jr.fn=lr.prototype,jr.invalid=cr;function Mr(e,t){var n=e&&parseFloat(e.replace(`,`,`.`));return(isNaN(n)?0:n)*t}function Nr(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,`M`).isAfter(t)&&--n.months,n.milliseconds=t-+e.clone().add(n.months,`M`),n}function Pr(e,t){var n;return e.isValid()&&t.isValid()?(t=gr(t,e),e.isBefore(t)?n=Nr(e,t):(n=Nr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Fr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(D(t,`moment().`+t+`(period, number) is deprecated. Please use moment().`+t+`(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.`),a=n,n=r,r=a),i=jr(n,r),Ir(this,i,e),this}}function Ir(e,t,r,i){var a=t._milliseconds,o=dr(t._days),s=dr(t._months);e.isValid()&&(i??=!0,s&&_t(e,nt(e,`Month`)+s*r),o&&rt(e,`Date`,nt(e,`Date`)+o*r),a&&e._d.setTime(e._d.valueOf()+a*r),i&&n.updateOffset(e,o||s))}var Lr=Fr(1,`add`),Rr=Fr(-1,`subtract`);function zr(e){return typeof e==`string`||e instanceof String}function Br(e){return C(e)||u(e)||zr(e)||l(e)||Hr(e)||Vr(e)||e==null}function Vr(e){var t=a(e)&&!s(e),n=!1,r=[`years`,`year`,`y`,`months`,`month`,`M`,`days`,`day`,`d`,`dates`,`date`,`D`,`hours`,`hour`,`h`,`minutes`,`minute`,`m`,`seconds`,`second`,`s`,`milliseconds`,`millisecond`,`ms`],i,c,l=r.length;for(i=0;i<l;i+=1)c=r[i],n||=o(e,c);return t&&n}function Hr(e){var t=i(e),n=!1;return t&&(n=e.filter(function(t){return!l(t)&&zr(e)}).length===0),t&&n}function Ur(e){var t=a(e)&&!s(e),n=!1,r=[`sameDay`,`nextDay`,`lastDay`,`nextWeek`,`lastWeek`,`sameElse`],i,c;for(i=0;i<r.length;i+=1)c=r[i],n||=o(e,c);return t&&n}function Wr(e,t){var n=e.diff(t,`days`,!0);return n<-6?`sameElse`:n<-1?`lastWeek`:n<0?`lastDay`:n<1?`sameDay`:n<2?`nextDay`:n<7?`nextWeek`:`sameElse`}function Gr(e,t){arguments.length===1&&(arguments[0]?Br(arguments[0])?(e=arguments[0],t=void 0):Ur(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var r=e||X(),i=gr(r,this).startOf(`day`),a=n.calendarFormat(this,i)||`sameElse`,o=t&&(O(t[a])?t[a].call(this,r):t[a]);return this.format(o||this.localeData().calendar(a,this,X(r)))}function Kr(){return new S(this)}function qr(e,t){var n=C(e)?e:X(e);return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Jr(e,t){var n=C(e)?e:X(e);return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Yr(e,t,n,r){var i=C(e)?e:X(e),a=C(t)?t:X(t);return this.isValid()&&i.isValid()&&a.isValid()?(r||=`()`,(r[0]===`(`?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===`)`?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Xr(e,t){var n=C(e)?e:X(e),r;return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Zr(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Qr(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function $r(e,t,n){var r,i,a;if(!this.isValid()||(r=gr(e,this),!r.isValid()))return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=V(t),t){case`year`:a=ei(this,r)/12;break;case`month`:a=ei(this,r);break;case`quarter`:a=ei(this,r)/3;break;case`second`:a=(this-r)/1e3;break;case`minute`:a=(this-r)/6e4;break;case`hour`:a=(this-r)/36e5;break;case`day`:a=(this-r-i)/864e5;break;case`week`:a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:Be(a)}function ei(e,t){if(e.date()<t.date())return-ei(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,`months`),i,a;return t-r<0?(i=e.clone().add(n-1,`months`),a=(t-r)/(r-i)):(i=e.clone().add(n+1,`months`),a=(t-r)/(i-r)),-(n+a)||0}n.defaultFormat=`YYYY-MM-DDTHH:mm:ssZ`,n.defaultFormatUtc=`YYYY-MM-DDTHH:mm:ss[Z]`;function ti(){return this.clone().locale(`en`).format(`ddd MMM DD YYYY HH:mm:ss [GMT]ZZ`)}function ni(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?B(n,t?`YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYYYY-MM-DD[T]HH:mm:ss.SSSZ`):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace(`Z`,B(n,`Z`)):B(n,t?`YYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYY-MM-DD[T]HH:mm:ss.SSSZ`)}function ri(){if(!this.isValid())return`moment.invalid(/* `+this._i+` */)`;var e=`moment`,t=``,n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?`moment.utc`:`moment.parseZone`,t=`Z`),n=`[`+e+`("]`,r=0<=this.year()&&this.year()<=9999?`YYYY`:`YYYYYY`,i=`-MM-DD[T]HH:mm:ss.SSS`,a=t+`[")]`,this.format(n+r+i+a)}function ii(e){e||=this.isUtc()?n.defaultFormatUtc:n.defaultFormat;var t=B(this,e);return this.localeData().postformat(t)}function ai(e,t){return this.isValid()&&(C(e)&&e.isValid()||X(e).isValid())?jr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oi(e){return this.from(X(),e)}function si(e,t){return this.isValid()&&(C(e)&&e.isValid()||X(e).isValid())?jr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ci(e){return this.to(X(),e)}function li(e){var t;return e===void 0?this._locale._abbr:(t=Sn(e),t!=null&&(this._locale=t),this)}var ui=T(`moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.`,function(e){return e===void 0?this.localeData():this.locale(e)});function di(){return this._locale}var fi=1e3,pi=60*fi,mi=60*pi,hi=146097*24*mi;function gi(e,t){return(e%t+t)%t}function _i(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-hi:new Date(e,t,n).valueOf()}function vi(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hi:Date.UTC(e,t,n)}function yi(e){var t,r;if(e=V(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(r=this._isUTC?vi:_i,e){case`year`:t=r(this.year(),0,1);break;case`quarter`:t=r(this.year(),this.month()-this.month()%3,1);break;case`month`:t=r(this.year(),this.month(),1);break;case`week`:t=r(this.year(),this.month(),this.date()-this.weekday());break;case`isoWeek`:t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case`day`:case`date`:t=r(this.year(),this.month(),this.date());break;case`hour`:t=this._d.valueOf(),t-=gi(t+(this._isUTC?0:this.utcOffset()*pi),mi);break;case`minute`:t=this._d.valueOf(),t-=gi(t,pi);break;case`second`:t=this._d.valueOf(),t-=gi(t,fi);break}return this._d.setTime(t),n.updateOffset(this,!0),this}function bi(e){var t,r;if(e=V(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(r=this._isUTC?vi:_i,e){case`year`:t=r(this.year()+1,0,1)-1;break;case`quarter`:t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case`month`:t=r(this.year(),this.month()+1,1)-1;break;case`week`:t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case`isoWeek`:t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case`day`:case`date`:t=r(this.year(),this.month(),this.date()+1)-1;break;case`hour`:t=this._d.valueOf(),t+=mi-gi(t+(this._isUTC?0:this.utcOffset()*pi),mi)-1;break;case`minute`:t=this._d.valueOf(),t+=pi-gi(t,pi)-1;break;case`second`:t=this._d.valueOf(),t+=fi-gi(t,fi)-1;break}return this._d.setTime(t),n.updateOffset(this,!0),this}function xi(){return this._d.valueOf()-(this._offset||0)*6e4}function Si(){return Math.floor(this.valueOf()/1e3)}function Ci(){return new Date(this.valueOf())}function wi(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ti(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ei(){return this.isValid()?this.toISOString():null}function Di(){return _(this)}function Oi(){return f({},h(this))}function ki(){return h(this).overflow}function Ai(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}R(`N`,0,0,`eraAbbr`),R(`NN`,0,0,`eraAbbr`),R(`NNN`,0,0,`eraAbbr`),R(`NNNN`,0,0,`eraName`),R(`NNNNN`,0,0,`eraNarrow`),R(`y`,[`y`,1],`yo`,`eraYear`),R(`y`,[`yy`,2],0,`eraYear`),R(`y`,[`yyy`,3],0,`eraYear`),R(`y`,[`yyyy`,4],0,`eraYear`),U(`N`,Vi),U(`NN`,Vi),U(`NNN`,Vi),U(`NNNN`,Hi),U(`NNNNN`,Ui),G([`N`,`NN`,`NNN`,`NNNN`,`NNNNN`],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?h(n).era=i:h(n).invalidEra=e}),U(`y`,Oe),U(`yy`,Oe),U(`yyy`,Oe),U(`yyyy`,Oe),U(`yo`,Wi),G([`y`,`yy`,`yyy`,`yyyy`],K),G([`yo`],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[K]=n._locale.eraYearOrdinalParse(e,i):t[K]=parseInt(e,10)});function ji(e,t){var r,i,a,o=this._eras||Sn(`en`)._eras;for(r=0,i=o.length;r<i;++r){switch(typeof o[r].since){case`string`:a=n(o[r].since).startOf(`day`),o[r].since=a.valueOf();break}switch(typeof o[r].until){case`undefined`:o[r].until=1/0;break;case`string`:a=n(o[r].until).startOf(`day`).valueOf(),o[r].until=a.valueOf();break}}return o}function Mi(e,t,n){var r,i,a=this.eras(),o,s,c;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(o=a[r].name.toUpperCase(),s=a[r].abbr.toUpperCase(),c=a[r].narrow.toUpperCase(),n)switch(t){case`N`:case`NN`:case`NNN`:if(s===e)return a[r];break;case`NNNN`:if(o===e)return a[r];break;case`NNNNN`:if(c===e)return a[r];break}else if([o,s,c].indexOf(e)>=0)return a[r]}function Ni(e,t){var r=e.since<=e.until?1:-1;return t===void 0?n(e.since).year():n(e.since).year()+(t-e.offset)*r}function Pi(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return``}function Fi(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return``}function Ii(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return``}function Li(){var e,t,r,i,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(r=a[e].since<=a[e].until?1:-1,i=this.clone().startOf(`day`).valueOf(),a[e].since<=i&&i<=a[e].until||a[e].until<=i&&i<=a[e].since)return(this.year()-n(a[e].since).year())*r+a[e].offset;return this.year()}function Ri(e){return o(this,`_erasNameRegex`)||Gi.call(this),e?this._erasNameRegex:this._erasRegex}function zi(e){return o(this,`_erasAbbrRegex`)||Gi.call(this),e?this._erasAbbrRegex:this._erasRegex}function Bi(e){return o(this,`_erasNarrowRegex`)||Gi.call(this),e?this._erasNarrowRegex:this._erasRegex}function Vi(e,t){return t.erasAbbrRegex(e)}function Hi(e,t){return t.erasNameRegex(e)}function Ui(e,t){return t.erasNarrowRegex(e)}function Wi(e,t){return t._eraYearOrdinalRegex||Oe}function Gi(){var e=[],t=[],n=[],r=[],i,a,o,s,c,l=this.eras();for(i=0,a=l.length;i<a;++i)o=ze(l[i].name),s=ze(l[i].abbr),c=ze(l[i].narrow),t.push(o),e.push(s),n.push(c),r.push(o),r.push(s),r.push(c);this._erasRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._erasNameRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`),this._erasAbbrRegex=RegExp(`^(`+e.join(`|`)+`)`,`i`),this._erasNarrowRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`)}R(0,[`gg`,2],0,function(){return this.weekYear()%100}),R(0,[`GG`,2],0,function(){return this.isoWeekYear()%100});function Ki(e,t){R(0,[e,e.length],0,t)}Ki(`gggg`,`weekYear`),Ki(`ggggg`,`weekYear`),Ki(`GGGG`,`isoWeekYear`),Ki(`GGGGG`,`isoWeekYear`),U(`G`,ke),U(`g`,ke),U(`GG`,H,ye),U(`gg`,H,ye),U(`GGGG`,Ee,xe),U(`gggg`,Ee,xe),U(`GGGGG`,De,Se),U(`ggggg`,De,Se),He([`gggg`,`ggggg`,`GGGG`,`GGGGG`],function(e,t,n,r){t[r.substr(0,2)]=W(e)}),He([`gg`,`GG`],function(e,t,r,i){t[i]=n.parseTwoDigitYear(e)});function qi(e){return $i.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Ji(e){return $i.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Yi(){return Ot(this.year(),1,4)}function Xi(){return Ot(this.isoWeekYear(),1,4)}function Zi(){var e=this.localeData()._week;return Ot(this.year(),e.dow,e.doy)}function Qi(){var e=this.localeData()._week;return Ot(this.weekYear(),e.dow,e.doy)}function $i(e,t,n,r,i){var a;return e==null?Dt(this,r,i).year:(a=Ot(e,r,i),t>a&&(t=a),ea.call(this,e,t,n,r,i))}function ea(e,t,n,r,i){var a=Et(e,t,n,r,i),o=wt(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}R(`Q`,0,`Qo`,`quarter`),U(`Q`,ve),G(`Q`,function(e,t){t[Ge]=(W(e)-1)*3});function ta(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}R(`D`,[`DD`,2],`Do`,`date`),U(`D`,H,Pe),U(`DD`,H,ye),U(`Do`,function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),G([`D`,`DD`],Ke),G(`Do`,function(e,t){t[Ke]=W(e.match(H)[0])});var na=tt(`Date`,!0);R(`DDD`,[`DDDD`,3],`DDDo`,`dayOfYear`),U(`DDD`,Te),U(`DDDD`,be),G([`DDD`,`DDDD`],function(e,t,n){n._dayOfYear=W(e)});function ra(e){var t=Math.round((this.clone().startOf(`day`)-this.clone().startOf(`year`))/864e5)+1;return e==null?t:this.add(e-t,`d`)}R(`m`,[`mm`,2],0,`minute`),U(`m`,H,Fe),U(`mm`,H,ye),G([`m`,`mm`],qe);var ia=tt(`Minutes`,!1);R(`s`,[`ss`,2],0,`second`),U(`s`,H,Fe),U(`ss`,H,ye),G([`s`,`ss`],Je);var aa=tt(`Seconds`,!1);R(`S`,0,0,function(){return~~(this.millisecond()/100)}),R(0,[`SS`,2],0,function(){return~~(this.millisecond()/10)}),R(0,[`SSS`,3],0,`millisecond`),R(0,[`SSSS`,4],0,function(){return this.millisecond()*10}),R(0,[`SSSSS`,5],0,function(){return this.millisecond()*100}),R(0,[`SSSSSS`,6],0,function(){return this.millisecond()*1e3}),R(0,[`SSSSSSS`,7],0,function(){return this.millisecond()*1e4}),R(0,[`SSSSSSSS`,8],0,function(){return this.millisecond()*1e5}),R(0,[`SSSSSSSSS`,9],0,function(){return this.millisecond()*1e6}),U(`S`,Te,ve),U(`SS`,Te,ye),U(`SSS`,Te,be);var oa,sa;for(oa=`SSSS`;oa.length<=9;oa+=`S`)U(oa,Oe);function ca(e,t){t[Ye]=W((`0.`+e)*1e3)}for(oa=`S`;oa.length<=9;oa+=`S`)G(oa,ca);sa=tt(`Milliseconds`,!1),R(`z`,0,0,`zoneAbbr`),R(`zz`,0,0,`zoneName`);function la(){return this._isUTC?`UTC`:``}function ua(){return this._isUTC?`Coordinated Universal Time`:``}var Z=S.prototype;Z.add=Lr,Z.calendar=Gr,Z.clone=Kr,Z.diff=$r,Z.endOf=bi,Z.format=ii,Z.from=ai,Z.fromNow=oi,Z.to=si,Z.toNow=ci,Z.get=it,Z.invalidAt=ki,Z.isAfter=qr,Z.isBefore=Jr,Z.isBetween=Yr,Z.isSame=Xr,Z.isSameOrAfter=Zr,Z.isSameOrBefore=Qr,Z.isValid=Di,Z.lang=ui,Z.locale=li,Z.localeData=di,Z.max=er,Z.min=$n,Z.parsingFlags=Oi,Z.set=at,Z.startOf=yi,Z.subtract=Rr,Z.toArray=wi,Z.toObject=Ti,Z.toDate=Ci,Z.toISOString=ni,Z.inspect=ri,typeof Symbol<`u`&&Symbol.for!=null&&(Z[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return`Moment<`+this.format()+`>`}),Z.toJSON=Ei,Z.toString=ti,Z.unix=Si,Z.valueOf=xi,Z.creationData=Ai,Z.eraName=Pi,Z.eraNarrow=Fi,Z.eraAbbr=Ii,Z.eraYear=Li,Z.year=$e,Z.isLeapYear=et,Z.weekYear=qi,Z.isoWeekYear=Ji,Z.quarter=Z.quarters=ta,Z.month=vt,Z.daysInMonth=yt,Z.week=Z.weeks=Nt,Z.isoWeek=Z.isoWeeks=Pt,Z.weeksInYear=Zi,Z.weeksInWeekYear=Qi,Z.isoWeeksInYear=Yi,Z.isoWeeksInISOWeekYear=Xi,Z.date=na,Z.day=Z.days=Yt,Z.weekday=Xt,Z.isoWeekday=Zt,Z.dayOfYear=ra,Z.hour=Z.hours=ln,Z.minute=Z.minutes=ia,Z.second=Z.seconds=aa,Z.millisecond=Z.milliseconds=sa,Z.utcOffset=vr,Z.utc=br,Z.local=xr,Z.parseZone=Sr,Z.hasAlignedHourOffset=Cr,Z.isDST=wr,Z.isLocal=Er,Z.isUtcOffset=Dr,Z.isUtc=Or,Z.isUTC=Or,Z.zoneAbbr=la,Z.zoneName=ua,Z.dates=T(`dates accessor is deprecated. Use date instead.`,na),Z.months=T(`months accessor is deprecated. Use month instead`,vt),Z.years=T(`years accessor is deprecated. Use year instead`,$e),Z.zone=T(`moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/`,yr),Z.isDSTShifted=T(`isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information`,Tr);function da(e){return X(e*1e3)}function fa(){return X.apply(null,arguments).parseZone()}function pa(e){return e}var Q=A.prototype;Q.calendar=te,Q.longDateFormat=ae,Q.invalidDate=se,Q.ordinal=ue,Q.preparse=pa,Q.postformat=pa,Q.relativeTime=fe,Q.pastFuture=pe,Q.set=ee,Q.eras=ji,Q.erasParse=Mi,Q.erasConvertYear=Ni,Q.erasAbbrRegex=zi,Q.erasNameRegex=Ri,Q.erasNarrowRegex=Bi,Q.months=pt,Q.monthsShort=mt,Q.monthsParse=gt,Q.monthsRegex=xt,Q.monthsShortRegex=bt,Q.week=kt,Q.firstDayOfYear=Mt,Q.firstDayOfWeek=jt,Q.weekdays=Wt,Q.weekdaysMin=Kt,Q.weekdaysShort=Gt,Q.weekdaysParse=Jt,Q.weekdaysRegex=Qt,Q.weekdaysShortRegex=$t,Q.weekdaysMinRegex=en,Q.isPM=sn,Q.meridiem=un;function ma(e,t,n,r){var i=Sn(),a=p().set(r,t);return i[n](a,e)}function ha(e,t,n){if(l(e)&&(t=e,e=void 0),e||=``,t!=null)return ma(e,t,n,`month`);var r,i=[];for(r=0;r<12;r++)i[r]=ma(e,r,n,`month`);return i}function ga(e,t,n,r){typeof e==`boolean`?(l(t)&&(n=t,t=void 0),t||=``):(t=e,n=t,e=!1,l(t)&&(n=t,t=void 0),t||=``);var i=Sn(),a=e?i._week.dow:0,o,s=[];if(n!=null)return ma(t,(n+a)%7,r,`day`);for(o=0;o<7;o++)s[o]=ma(t,(o+a)%7,r,`day`);return s}function _a(e,t){return ha(e,t,`months`)}function va(e,t){return ha(e,t,`monthsShort`)}function ya(e,t,n){return ga(e,t,n,`weekdays`)}function ba(e,t,n){return ga(e,t,n,`weekdaysShort`)}function xa(e,t,n){return ga(e,t,n,`weekdaysMin`)}yn(`en`,{eras:[{since:`0001-01-01`,until:1/0,offset:1,name:`Anno Domini`,narrow:`AD`,abbr:`AD`},{since:`0000-12-31`,until:-1/0,offset:1,name:`Before Christ`,narrow:`BC`,abbr:`BC`}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(W(e%100/10)===1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)}}),n.lang=T(`moment.lang is deprecated. Use moment.locale instead.`,yn),n.langData=T(`moment.langData is deprecated. Use moment.localeData instead.`,Sn);var Sa=Math.abs;function Ca(){var e=this._data;return this._milliseconds=Sa(this._milliseconds),this._days=Sa(this._days),this._months=Sa(this._months),e.milliseconds=Sa(e.milliseconds),e.seconds=Sa(e.seconds),e.minutes=Sa(e.minutes),e.hours=Sa(e.hours),e.months=Sa(e.months),e.years=Sa(e.years),this}function wa(e,t,n,r){var i=jr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Ta(e,t){return wa(this,e,t,1)}function Ea(e,t){return wa(this,e,t,-1)}function Da(e){return e<0?Math.floor(e):Math.ceil(e)}function Oa(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,o,s,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Da(Aa(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=Be(e/1e3),r.seconds=i%60,a=Be(i/60),r.minutes=a%60,o=Be(a/60),r.hours=o%24,t+=Be(o/24),c=Be(ka(t)),n+=c,t-=Da(Aa(c)),s=Be(n/12),n%=12,r.days=t,r.months=n,r.years=s,this}function ka(e){return e*4800/146097}function Aa(e){return e*146097/4800}function ja(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=V(e),e===`month`||e===`quarter`||e===`year`)switch(t=this._days+r/864e5,n=this._months+ka(t),e){case`month`:return n;case`quarter`:return n/3;case`year`:return n/12}else switch(t=this._days+Math.round(Aa(this._months)),e){case`week`:return t/7+r/6048e5;case`day`:return t+r/864e5;case`hour`:return t*24+r/36e5;case`minute`:return t*1440+r/6e4;case`second`:return t*86400+r/1e3;case`millisecond`:return Math.floor(t*864e5)+r;default:throw Error(`Unknown unit `+e)}}function Ma(e){return function(){return this.as(e)}}var Na=Ma(`ms`),Pa=Ma(`s`),Fa=Ma(`m`),Ia=Ma(`h`),La=Ma(`d`),Ra=Ma(`w`),za=Ma(`M`),Ba=Ma(`Q`),Va=Ma(`y`),Ha=Na;function Ua(){return jr(this)}function Wa(e){return e=V(e),this.isValid()?this[e+`s`]():NaN}function Ga(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ka=Ga(`milliseconds`),qa=Ga(`seconds`),Ja=Ga(`minutes`),Ya=Ga(`hours`),Xa=Ga(`days`),Za=Ga(`months`),Qa=Ga(`years`);function $a(){return Be(this.days()/7)}var eo=Math.round,to={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function no(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ro(e,t,n,r){var i=jr(e).abs(),a=eo(i.as(`s`)),o=eo(i.as(`m`)),s=eo(i.as(`h`)),c=eo(i.as(`d`)),l=eo(i.as(`M`)),u=eo(i.as(`w`)),d=eo(i.as(`y`)),f=a<=n.ss&&[`s`,a]||a<n.s&&[`ss`,a]||o<=1&&[`m`]||o<n.m&&[`mm`,o]||s<=1&&[`h`]||s<n.h&&[`hh`,s]||c<=1&&[`d`]||c<n.d&&[`dd`,c];return n.w!=null&&(f=f||u<=1&&[`w`]||u<n.w&&[`ww`,u]),f=f||l<=1&&[`M`]||l<n.M&&[`MM`,l]||d<=1&&[`y`]||[`yy`,d],f[2]=t,f[3]=+e>0,f[4]=r,no.apply(null,f)}function io(e){return e===void 0?eo:typeof e==`function`?(eo=e,!0):!1}function ao(e,t){return to[e]===void 0?!1:t===void 0?to[e]:(to[e]=t,e===`s`&&(to.ss=t-1),!0)}function oo(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=to,i,a;return typeof e==`object`&&(t=e,e=!1),typeof e==`boolean`&&(n=e),typeof t==`object`&&(r=Object.assign({},to,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=ro(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var so=Math.abs;function co(e){return(e>0)-(e<0)||+e}function lo(){if(!this.isValid())return this.localeData().invalidDate();var e=so(this._milliseconds)/1e3,t=so(this._days),n=so(this._months),r,i,a,o,s=this.asSeconds(),c,l,u,d;return s?(r=Be(e/60),i=Be(r/60),e%=60,r%=60,a=Be(n/12),n%=12,o=e?e.toFixed(3).replace(/\.?0+$/,``):``,c=s<0?`-`:``,l=co(this._months)===co(s)?``:`-`,u=co(this._days)===co(s)?``:`-`,d=co(this._milliseconds)===co(s)?``:`-`,c+`P`+(a?l+a+`Y`:``)+(n?l+n+`M`:``)+(t?u+t+`D`:``)+(i||r||e?`T`:``)+(i?d+i+`H`:``)+(r?d+r+`M`:``)+(e?d+o+`S`:``)):`P0D`}var $=lr.prototype;return $.isValid=sr,$.abs=Ca,$.add=Ta,$.subtract=Ea,$.as=ja,$.asMilliseconds=Na,$.asSeconds=Pa,$.asMinutes=Fa,$.asHours=Ia,$.asDays=La,$.asWeeks=Ra,$.asMonths=za,$.asQuarters=Ba,$.asYears=Va,$.valueOf=Ha,$._bubble=Oa,$.clone=Ua,$.get=Wa,$.milliseconds=Ka,$.seconds=qa,$.minutes=Ja,$.hours=Ya,$.days=Xa,$.weeks=$a,$.months=Za,$.years=Qa,$.humanize=oo,$.toISOString=lo,$.toString=lo,$.toJSON=lo,$.locale=li,$.localeData=di,$.toIsoString=T(`toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)`,lo),$.lang=ui,R(`X`,0,0,`unix`),R(`x`,0,0,`valueOf`),U(`x`,ke),U(`X`,Me),G(`X`,function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),G(`x`,function(e,t,n){n._d=new Date(W(e))}),n.version=`2.30.1`,r(X),n.fn=Z,n.min=nr,n.max=rr,n.now=ir,n.utc=p,n.unix=da,n.months=_a,n.isDate=u,n.locale=yn,n.invalid=v,n.duration=jr,n.isMoment=C,n.weekdays=ya,n.parseZone=fa,n.localeData=Sn,n.isDuration=ur,n.monthsShort=va,n.weekdaysMin=xa,n.defineLocale=bn,n.updateLocale=xn,n.locales=Cn,n.weekdaysShort=ba,n.normalizeUnits=V,n.relativeTimeRounding=io,n.relativeTimeThreshold=ao,n.calendarFormat=Wr,n.prototype=Z,n.HTML5_FMT={DATETIME_LOCAL:`YYYY-MM-DDTHH:mm`,DATETIME_LOCAL_SECONDS:`YYYY-MM-DDTHH:mm:ss`,DATETIME_LOCAL_MS:`YYYY-MM-DDTHH:mm:ss.SSS`,DATE:`YYYY-MM-DD`,TIME:`HH:mm`,TIME_SECONDS:`HH:mm:ss`,TIME_MS:`HH:mm:ss.SSS`,WEEK:`GGGG-[W]WW`,MONTH:`YYYY-MM`},n}))})),Fe=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Pe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";return e.defineLocale(`it`,{months:`gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre`.split(`_`),monthsShort:`gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic`.split(`_`),weekdays:`domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato`.split(`_`),weekdaysShort:`dom_lun_mar_mer_gio_ven_sab`.split(`_`),weekdaysMin:`do_lu_ma_me_gi_ve_sa`.split(`_`),longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd D MMMM YYYY HH:mm`},calendar:{sameDay:function(){return`[Oggi a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},nextDay:function(){return`[Domani a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},nextWeek:function(){return`dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},lastDay:function(){return`[Ieri a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},lastWeek:function(){switch(this.day()){case 0:return`[La scorsa] dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`;default:return`[Lo scorso] dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`}},sameElse:`L`},relativeTime:{future:`tra %s`,past:`%s fa`,s:`alcuni secondi`,ss:`%d secondi`,m:`un minuto`,mm:`%d minuti`,h:`un'ora`,hh:`%d ore`,d:`un giorno`,dd:`%d giorni`,w:`una settimana`,ww:`%d settimane`,M:`un mese`,MM:`%d mesi`,y:`un anno`,yy:`%d anni`},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:`%dº`,week:{dow:1,doy:4}})}))})),Ie=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Pe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";return e.defineLocale(`en-gb`,{months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),monthsShort:`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),weekdaysShort:`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),weekdaysMin:`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd, D MMMM YYYY HH:mm`},calendar:{sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`},relativeTime:{future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(~~(e%100/10)==1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)},week:{dow:1,doy:4}})}))}));o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Pe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";function t(e,t,n,r){var i={m:[`eine Minute`,`einer Minute`],h:[`eine Stunde`,`einer Stunde`],d:[`ein Tag`,`einem Tag`],dd:[e+` Tage`,e+` Tagen`],w:[`eine Woche`,`einer Woche`],M:[`ein Monat`,`einem Monat`],MM:[e+` Monate`,e+` Monaten`],y:[`ein Jahr`,`einem Jahr`],yy:[e+` Jahre`,e+` Jahren`]};return t?i[n][0]:i[n][1]}return e.defineLocale(`de`,{months:`Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember`.split(`_`),monthsShort:`Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.`.split(`_`),monthsParseExact:!0,weekdays:`Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag`.split(`_`),weekdaysShort:`So._Mo._Di._Mi._Do._Fr._Sa.`.split(`_`),weekdaysMin:`So_Mo_Di_Mi_Do_Fr_Sa`.split(`_`),weekdaysParseExact:!0,longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD.MM.YYYY`,LL:`D. MMMM YYYY`,LLL:`D. MMMM YYYY HH:mm`,LLLL:`dddd, D. MMMM YYYY HH:mm`},calendar:{sameDay:`[heute um] LT [Uhr]`,sameElse:`L`,nextDay:`[morgen um] LT [Uhr]`,nextWeek:`dddd [um] LT [Uhr]`,lastDay:`[gestern um] LT [Uhr]`,lastWeek:`[letzten] dddd [um] LT [Uhr]`},relativeTime:{future:`in %s`,past:`vor %s`,s:`ein paar Sekunden`,ss:`%d Sekunden`,m:t,mm:`%d Minuten`,h:t,hh:`%d Stunden`,d:t,dd:t,w:t,ww:`%d Wochen`,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:`%d.`,week:{dow:1,doy:4}})}))}))(),Ie(),Fe();var U=e=>{let t=``;return e.split(`:`).forEach(e=>{t+=e}),parseInt(t)},Le=e=>e.toString().padStart(4,`0`).match(/.{1,2}/g).join(`:`),Re=e=>{let t=e.address;if(e.addresstype===`county`&&t.country)return t.county;if(e.addresstype===`village`&&t.village)return t.village;let n=[];return[`emergency`,`historic`,`military`,`natural`,`landuse`,`place`,`railway`,`man_made`,`aerialway`,`boundary`,`amenity`,`aeroway`,`club`,`craft`,`leisure`,`office`,`mountain_pass`,`shop`,`tourism`,`bridge`,`tunnel`,`waterway`,`name`].forEach(e=>{t.hasOwnProperty(e)&&t[e]&&n.push(t[e])}),t.road?n.push(t.road):t.pedestrian?n.push(t.pedestrian):t.suburb?n.push(t.suburb):t.square?n.push(t.square):(t.neighbourhood&&n.push(t.neighbourhood),t.hamlet?n.push(t.hamlet):t.isolated_dwelling?n.push(t.isolated_dwelling):t.locality?n.push(t.locality):t.croft&&n.push(t.croft)),t.house_number&&n.push(t.house_number),t.postcode&&n.push(t.postcode),t.village&&n.push(t.village),t.town?n.push(t.town):t.city&&n.push(t.city),n.join(`, `).substr(0,150)};function ze(e){let t=window.sessionStorage.getItem(e);if(t!==null){let n=JSON.parse(t);if(new Date(n.expirationDate)>new Date)return n.value;window.sessionStorage.removeItem(e)}return null}function Be(e,t,n){let r=n?new Date(n*1e3):null;if(r){let n={value:t,expirationDate:r.toISOString()};window.sessionStorage.setItem(e,JSON.stringify(n))}}function W({day:e,slot:t,i18next:n}){return(0,f.jsx)(`li`,{className:`it-list-item`,children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsx)(`div`,{className:`it-right-zone`,children:(0,f.jsxs)(`span`,{className:`text pl-4`,children:[(0,f.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,f.jsx)(`b`,{children:t})]})})})})}function Ve(){return typeof document>`u`?void 0:document.activeElement?.closest?.(`[data-formio-widget-scope]`)||document.querySelector(`[data-formio-widget-scope]`)||document.querySelector(`widget-formio`)||document.body}var G=l.Formio.Components.components.field,He=({component:e,current:t,onChange:n,i18next:r})=>{let[i,a]=(0,d.useState)(),[o,s]=(0,d.useState)([]),[c,l]=(0,d.useState)([]),[u,p]=(0,d.useState)(!1),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),[E,D]=(0,d.useState)(null),[O,ee]=(0,d.useState)({}),[k,A]=(0,d.useState)(null),[M,te]=(0,d.useState)(!1),[N,P]=(0,d.useState)([]),[F,I]=(0,d.useState)(!1),L=(0,d.useRef)(),R=e.calendarId;g.default.locale(r.language),y.default.locale(r.language);let ne=e=>{let t=(0,g.default)(e).format(`YYYY-MM-DD`);fetch(ie(t)).then(e=>e.json()).then(t=>{let n=re(e||new Date),r=t.filter(e=>e.available==1);r.length===0&&he();let i=[];n.forEach(e=>{t.some(t=>t.date===e&&t.available==1)?i.push({available:!0,date:e}):i.push({available:!1,date:e})}),s(i.map(e=>{if(e.available===!1)return(0,g.default)(e.date,`YYYY-MM-DD`).toDate()})),z(r.length?r[0].date:e)}).catch(e=>console.error(e))},z=e=>{D(null),T(null),l([]);let t=(0,g.default)(e).format(`YYYY-MM-DD`);fetch(ae(t)).then(e=>e.json()).then(t=>{let n=t.filter(e=>e.availability==1);ee(n[0]),n.length>0?(l(t),p(!1),T((0,g.default)(e).format(`L`)),a((0,g.default)(e,`YYYY-MM-DD`).toDate())):(t.length>0&&a((0,g.default)(t[0].date,`YYYY-MM-DD`).toDate()),l([]),he())})},B=()=>{if(R!==``&&R!=null)if(!t.dataValue)ne(new Date);else if(e.multiple&&Array.isArray(t.dataValue)){if(t.dataValue.length>0){A(t.dataValue);let e=[];t.dataValue.map(t=>{e.push({...t,date:(0,g.default)(t.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)})}),P(e)}}else if(!e.multiple&&typeof t.dataValue==`object`){let e={date:t.dataValue.date,slot:t.dataValue.slot};P([{...t.dataValue,date:(0,g.default)(t.dataValue.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)}]),A(e)}else{let r=t.dataValue.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),i=r[2].split(`#`),a={date:(0,g.default)(r[0],`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:r[1]};e.multiple?(n([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}]),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])):(n({date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])),A(a)}};(0,d.useEffect)(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{B()},1e3)})},[]);let re=e=>{let t=(0,g.default)(e,`YYYY-MM`).daysInMonth(),n=[];for(;t;){let r=(0,g.default)(e).date(t);n.push(r.format(`YYYY-MM-DD`)),t--}return n},ie=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=`${j()}/api/calendars/${r}/availabilities`,s=[`from_time=${(0,g.default)(t).startOf(`month`).format(`YYYY-MM-DD`)}`,`to_time=${(0,g.default)(t).endOf(`month`).format(`YYYY-MM-DD`)}`];return n&&s.push(`available=${n}`),i&&a&&s.push(`opening_hours=${a.join()}`),`${o}?${s.join(`&`)}`},ae=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=(0,g.default)(t).format(`YYYY-MM-DD`),s=`${j()}/api/calendars/${r}/availabilities/${o}`,c=[];return n&&c.push(`available=${n}`),i&&a&&c.push(`opening_hours=${a.join()}`),c&&(s=`${s}?${c.join(`&`)}`),s},oe=e=>{ne(e)},se=e=>{setTimeout(()=>{te(!M)},1e3),z(e)},ce=e=>{D(null),setTimeout(()=>{e&&(C(e.target.dataset),D(e.target.id))},300)},le=t=>{x(null);let n=`${j()}/it/meetings/new-draft`,i={date:S?.date?(0,g.default)(S?.date).format(`DD-MM-YYYY`):(0,g.default)(t.target.dataset.date).format(`DD-MM-YYYY`),slot:S?.value_start&&S?.value_end?S.value_start+`-`+S.value_end:t.target.dataset.slots,calendar:e.calendarId,opening_hour:S?.opening_hour?S?.opening_hour:t.target.dataset.opening_hour,meeting:b?b.id:``,first_available_date:O.date,first_available_start_time:O.start_time,first_available_end_time:O.end_time,first_availability_updated_at:(0,g.default)().format()};fetch(n,{method:`POST`,body:JSON.stringify(i),headers:{"Content-Type":`application/json; charset=utf-8`},strictErrors:!0}).then(e=>{if(!e.ok)throw Error(r.t(`Intervallo selezionato non disponibile!`));return e.json()}).then(e=>{x(e);let t={date:i.date,slot:i.slot,calendar_id:i.calendar[0],opening_hour_id:i.opening_hour||i.opening_hour_id,meeting_id:e.id};P([...N,t])}).catch(e=>{console.log(e),v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},ue=()=>{S&&(le(),te(!M))},de=()=>(0,f.jsx)(`span`,{children:r.t(`Tempo prenotazione scaduto!`)}),fe=({minutes:e,seconds:t,completed:n})=>n?(0,f.jsx)(de,{}):(0,f.jsx)(`div`,{children:(0,f.jsxs)(`div`,{children:[` `,(0,f.jsxs)(`span`,{children:[` `,(0,f.jsxs)(`i`,{children:[r.t(`Per confermare la prenotazione che ti abbiamo riservato procedi con l’invio di questa pratica e con il pagamento (se richiesto) di quanto previsto entro`),`:`]}),` `,(0,f.jsxs)(`b`,{children:[e,` `,r.t(`minuti`),` `,t,` `,r.t(`secondi`)]})]})]})}),pe=e=>{let t=U(e.target.value),n=U(e.target.min),i=U(e.target.max);t<n||t>i||t>U(S.end)?(v.default.fire({title:``,html:`<p>${r.t(`l'orario`)} <b>${Le(t)}</b> ${r.t(`non è valido`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),V(``)):C({...S,value_start:e.target.value})},me=e=>{let t=U(e.target.value),n=U(e.target.min),i=U(e.target.max);t<n||t>i||t<U(S.start)?(v.default.fire({title:``,html:`<p>${r.t(`l'orario`)} <b>${Le(t)}</b> ${r.t(`non è valido`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),V(``)):C({...S,value_end:e.target.value})},V=t=>{if(t===null||t===``)n(``);else if(Array.isArray(t)&&t.length>0){let t=[];N.map(e=>{t.push({date:(0,g.default)(e.date,`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:e.slot,calendar_id:e.calendar_id||e.calendar[0],meeting_id:e.meeting_id,opening_hour_id:e.opening_hour||e.opening_hour_id})}),e.multiple?n(t):n(t[0])}else n(``)},he=()=>{p(!0),x(null),T(null),V(null)},ge=()=>{if(r.language===`it`)return Ne;if(r.language===`en`)return we;if(r.language===`de`)return ve};(0,d.useEffect)(()=>{V(N)},[N]),(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&F===!1?(I(!0),setTimeout(()=>{B()},1e3)):(I(!1),setTimeout(()=>{B()},1e3))},[]);let _e=(e,t)=>{let n=`${j()}/api/meetings/${t.meeting_id}`;fetch(n,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${ze(`auth-token`)}`},strictErrors:!0}).then(t=>{t&&t.status>400?v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori durante la cancellazione dello slot`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):(P([...N.slice(0,e),...N.slice(e+1)]),ne(new Date))})};return(0,f.jsxs)(f.Fragment,{children:[F&&k?(0,f.jsxs)(`div`,{className:`my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none`,children:[(0,f.jsxs)(`b`,{children:[Array.isArray(k)&&k.length>1?r.t(`Giorni selezionati per la prenotazione`):r.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,f.jsx)(`div`,{className:`mb-5`,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:Array.isArray(k)?k.map(e=>(0,f.jsx)(W,{day:(0,g.default)(e.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:r,slot:e.slot})):(0,f.jsx)(W,{day:(0,g.default)(k.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:r,slot:k.slot})})})})]}):(0,f.jsx)(`div`,{className:`slot-calendar `,children:(0,f.jsxs)(`div`,{className:`row`,children:[e.multiple?(0,f.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,f.jsxs)(`div`,{className:`m-2`,children:[(0,f.jsx)(`h6`,{children:r.t(e.label)}),(0,f.jsx)(m.DayPicker,{mode:`single`,selected:i,locale:ge(),disabled:o,onMonthChange:oe,onDayClick:se}),(0,f.jsx)(`p`,{children:r.t(`Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione`)})]})}):N.length===1?null:(0,f.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,f.jsxs)(`div`,{className:`m-2`,children:[(0,f.jsx)(`h6`,{children:r.t(e.label)}),(0,f.jsx)(m.DayPicker,{mode:`single`,selected:i,locale:ge(),disabled:o,onMonthChange:oe,onDayClick:se}),(0,f.jsxs)(`p`,{children:[` `,r.t(`Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione`)]})]})}),(0,f.jsx)(`div`,{className:`col-12`,children:N.length?(0,f.jsx)(`div`,{className:`row m-2`,children:(0,f.jsxs)(`div`,{className:`col-12 mb-4`,children:[(0,f.jsxs)(`b`,{children:[N.length>1?r.t(`Giorni selezionati per la prenotazione`):r.t(`Giorno selezionato per la prenotazione`),`:`,` `]}),(0,f.jsx)(`div`,{className:`mb-5`,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:N.map((e,t)=>(0,f.jsx)(`li`,{children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsxs)(`div`,{className:`it-right-zone`,children:[(0,f.jsxs)(`span`,{className:`text pl-4`,children:[e.date,` `,S||e.slot?`${r.t(`alle`)} ${e.slot}`:``]}),(0,f.jsx)(_.Icon,{icon:`it-delete`,onClick:()=>_e(t,e),role:`button`})]})})},`li`+t))})})}),b?(0,f.jsx)(_.Alert,{color:`info`,defaultValue:`string`,className:`d-print-none d-preview-calendar-none`,children:(0,f.jsx)(h.default,{date:b.expiration_time,renderer:fe})}):null]})}):null})]})}),(0,f.jsxs)(_.Modal,{isOpen:M,toggle:()=>te(!M),labelledBy:`daySelected`,size:`lg`,centered:!0,container:Ve(),children:[(0,f.jsx)(_.ModalHeader,{toggle:()=>te(!M),id:`daySelected`,children:r.t(`Seleziona una fascia oraria`)}),u?null:(0,f.jsxs)(`div`,{className:`title-xsmall u-grey-dark px-4`,children:[` `,r.t(`Seleziona una fascia oraria e, se necessario, utilizza l'apposito controllo per accorciare la durata della prenotazione, Poi clicca su Conferma`)]}),(0,f.jsx)(_.ModalBody,{children:(0,f.jsxs)(`div`,{className:`row`,children:[N.length>=1?(0,f.jsxs)(`div`,{children:[w&&!u?(0,f.jsxs)(`h6`,{children:[r.t(`Orari disponibili del`),` `,(0,y.default)(w).format(`DD/MM/YYYY`)]}):null,(0,f.jsxs)(`div`,{className:`calendar-last-selection col-12 pt-2 mb-5`,children:[(0,f.jsx)(`small`,{className:`pl-2 mb-2 d-flex px-2`,children:(0,f.jsxs)(`b`,{children:[(0,f.jsx)(_.Icon,{icon:`it-clock`,className:`mr-1`,size:`sm`}),` `,r.t(`Ultimo orario selezionato`)]})}),(0,f.jsx)(`div`,{className:`col-6 px-2`,children:(0,f.jsx)(`button`,{type:`button`,id:`slot-last-selection`,onClick:ce,tabIndex:`1`,className:E===`slot-last-selection`?`active btn btn-slot p-0`:`btn btn-slot p-0`,"data-date":(0,g.default)(w,`DD/MM/YYYY`).format(`YYYY-MM-DD`),"data-slots":N[N.length-1].slot,"data-opening_hour":N[N.length-1].opening_hour_id,"data-start":N[N.length-1].slot.split(`-`)[0],"data-end":N[N.length-1].slot.split(`-`)[1],"data-value_start":N[N.length-1].slot.split(`-`)[0],"data-value_end":N[N.length-1].slot.split(`-`)[1],disabled:u,children:N[N.length-1].slot})})]})]}):null,(0,f.jsx)(`div`,{children:w&&N.length>=1?(0,f.jsx)(`h6`,{children:r.t(`Seleziona altri orari`)}):u?null:(0,f.jsxs)(`h6`,{children:[r.t(`Orari disponibili del`),` `,(0,y.default)(w).format(`DD/MM/YYYY`)]})}),c.map((e,t)=>(0,f.jsx)(`div`,{className:`col-6`,children:(0,f.jsxs)(`button`,{type:`button`,id:`slot-`+t,onClick:ce,ref:L,className:E===`slot-`+t?`active btn btn-slot p-0`:`btn btn-slot p-0`,tabIndex:`1`,"data-date":e.date,"data-start":e.start_time,"data-end":e.end_time,"data-value_start":e.start_time,"data-value_end":e.end_time,"data-slots":e.start_time+`-`+e.end_time,"data-opening_hour":e.opening_hour,"data-min_duration":e.min_duration,disabled:e.slots_available==0,children:[e.start_time,` - `,e.end_time]})},`slot-`+t)),u?(0,f.jsxs)(`div`,{className:`callout callout-highlight warning`,children:[(0,f.jsxs)(`div`,{className:`callout-title`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":!0,icon:`it-help-circle`}),r.t(`Attenzione`)]}),(0,f.jsxs)(`p`,{children:[` `,r.t(`Non è possibile prenotare per la data selezionata`),`.`]})]}):null,(0,f.jsx)(`div`,{className:`col-12`,children:S?.value_start&&E?(0,f.jsxs)(`div`,{className:`row`,children:[(0,f.jsx)(`div`,{className:`col-12 mb-3`,children:(0,f.jsx)(`p`,{className:`mb-3`,children:(0,f.jsx)(`b`,{children:r.t(`Se necessario, utilizza il controllo che segue per accorciare la durata della prenotazione`)})})}),(0,f.jsx)(`div`,{className:`col-12 col-md-6 mb-4`,children:(0,f.jsx)(_.Input,{type:`time`,label:r.t(`Dalle`),className:`active`,defaultValue:S.value_start||S.start,min:S.start,max:S.end,onBlur:pe})}),(0,f.jsx)(`div`,{className:`col-12 col-md-6 mb-4`,children:(0,f.jsx)(_.Input,{type:`time`,label:r.t(`alle`),className:`active`,defaultValue:S.value_end||S.end,onBlur:me,min:S.start,max:S.end})})]}):null})]})}),(0,f.jsx)(_.ModalFooter,{children:(0,f.jsx)(_.Button,{color:`primary`,onClick:()=>ue(),disabled:!w||!S?.value_start,children:r.t(`Conferma`)})})]})]})},Ue=class e extends G{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Dynamic Calendar`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return G.schema({type:`dynamic_calendar`})}static editForm=te;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,u.createRoot)(e),this.rootComponent.render((0,f.jsx)(He,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){if(e)if(Array.isArray(e))this.selectedNextSlots=e,this.updateValue(e),this.shouldSetValue=!0;else if(typeof e==`object`)this.date=e.date,this.slot=e.slot,this.meeting=e.meeting_id,this.meeting_expiration_time=null,this.opening_hour=e.opening_hour_id,this.calendar_id=e.calendar_id,this.updateValue(e),this.shouldSetValue=!0;else{let t=e.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),n=t[2].split(`#`);this.date=t[0],this.slot=t[1],this.meeting=n[1],this.meeting_expiration_time=null,this.opening_hour=n.length===3?n[2]:``,this.updateValue({date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:this.meeting,opening_hour_id:this.opening_hour})}}getValue(){if(!(this.date&&this.slot&&this.meeting&&this.opening_hour)&&!(this.selectedNextSlots&&this.selectedNextSlots.length>0))return null;let e=this.meeting?this.meeting:``,t=this.opening_hour?this.opening_hour:``;return this.component.multiple?this.selectedNextSlots:{date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:e,opening_hour_id:t}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},We=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{type:`select`,label:`Nome Calendario`,key:`calendarId`,input:!0,weight:1,placeholder:`Nome Calendario`,tooltip:`Inserisci il nome del calendario`,dataSrc:`url`,defaultValue:``,data:{url:j()+`/api/calendars?type=time_fixed_slots`},valueProperty:`id`,template:`<span>{{ item.title }}</span>`,selectValues:`Results`},{type:`checkbox`,label:`Seleziona orari di apertura`,key:`select_opening_hours`,input:!0,weight:1,tooltip:`Abilita per selezionare i singoli orari di apertura`,defaultValue:!1},{label:`Base url`,calculateValue:`let url = '`+j()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{type:`select`,label:`Orari di apertura`,key:`opening_hours`,input:!0,weight:1,placeholder:`Seleziona gli orari di apertura`,tooltip:`Seleziona gli orari di apertura`,multiple:!0,dataSrc:`url`,defaultValue:``,data:{url:j()+`/api/calendars/{{data.calendarId}}/opening-hours`},valueProperty:`id`,template:`<span>{{ item.name }}</span>`,selectValues:`results`,conditional:{show:!0,when:`select_opening_hours`,eq:`true`}},{label:`Api Url`,redrawOn:`data`,calculateValue:`if (data.calendarId) {
36
36
  let url = data.url + '/api/calendars/' + data.calendarId + '/overlaps';
37
37
  if (data.select_opening_hours && data.opening_hours.length > 0) {
38
38
  let qs = "?opening_hours=" + data.opening_hours.join();
@@ -63,12 +63,10 @@ if(data.calendarId && data.api_url){
63
63
  data.overlaps_validation = -1; document.querySelector("input[name^='data[overlaps_validation]']").value = -1;
64
64
  }
65
65
  );
66
- }`,validateOn:`change`,validate:{customMessage:`Vi sono sovrapposizioni negli orari di apertura`,custom:`if (document.querySelector("input[name^='data[overlaps_validation]']").value === '0') {valid=true} else {valid = 'Sovrapposizione';}`},key:`overlaps_validation`,attributes:{readonly:`true`},required:!0,type:`number`,input:!0,weight:1},{label:`Precisione minima (minuti)`,defaultValue:1,required:!0,inputFormat:`plain`,key:`range_step`,type:`number`,input:!0,weight:1}];function We(...e){return p.Components.baseEditForm([{key:`display`,components:Ue}],...e)}function K({day:e,slot:t,i18next:n}){return(0,f.jsx)(`li`,{className:`it-list-item`,children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsx)(`div`,{className:`it-right-zone`,children:(0,f.jsxs)(`span`,{className:`text pl-4`,children:[(0,f.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,f.jsx)(`b`,{children:t})]})})})})}var Ge=l.Formio.Components.components.field,Ke=({component:e,current:t,onChange:n,i18next:r})=>{let[i,a]=(0,d.useState)(),[o,s]=(0,d.useState)([]),[c,l]=(0,d.useState)([]),[u,p]=(0,d.useState)(!1),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),[E,D]=(0,d.useState)(null),[O,k]=(0,d.useState)({}),[A,M]=(0,d.useState)(null),[N,P]=(0,d.useState)(!1),[F,I]=(0,d.useState)([]),[L,R]=(0,d.useState)(!1),z=(0,d.useRef)(),B=e.calendarId;g.default.locale(r.language),y.default.locale(r.language);let ee=e=>{let t=(0,g.default)(e).format(`YYYY-MM-DD`);fetch(ie(t)).then(e=>e.json()).then(t=>{let n=re(e||new Date),r=t.filter(e=>e.available==1);r.length===0&&me();let i=[];n.forEach(e=>{t.some(t=>t.date===e&&t.available==1)?i.push({available:!0,date:e}):i.push({available:!1,date:e})}),s(i.map(e=>{if(e.available===!1)return(0,g.default)(e.date,`YYYY-MM-DD`).toDate()})),te(r.length?r[0].date:e)}).catch(e=>console.error(e))},te=e=>{D(null),T(null),l([]);let t=(0,g.default)(e).format(`YYYY-MM-DD`);fetch(ae(t)).then(e=>e.json()).then(t=>{let n=t.filter(e=>e.availability==1);k(n[0]),n.length>0?(l(t),p(!1),T((0,g.default)(e).format(`L`)),a((0,g.default)(e,`YYYY-MM-DD`).toDate())):(t.length>0&&a((0,g.default)(t[0].date,`YYYY-MM-DD`).toDate()),l([]),me())})},ne=()=>{if(B!==``&&B!=null)if(!t.dataValue)ee(new Date);else if(e.multiple&&Array.isArray(t.dataValue)){if(t.dataValue.length>0){M(t.dataValue);let e=[];t.dataValue.map(t=>{e.push({...t,date:(0,g.default)(t.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)})}),I(e)}}else if(!e.multiple&&typeof t.dataValue==`object`){let e={date:t.dataValue.date,slot:t.dataValue.slot};I([{...t.dataValue,date:(0,g.default)(t.dataValue.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)}]),M(e)}else{let r=t.dataValue.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),i=r[2].split(`#`),a={date:(0,g.default)(r[0],`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:r[1]};e.multiple?(n([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}]),I([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])):(n({date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}),I([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])),M(a)}};(0,d.useEffect)(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{ne()},1e3)})},[]);let re=e=>{let t=(0,g.default)(e,`YYYY-MM`).daysInMonth(),n=[];for(;t;){let r=(0,g.default)(e).date(t);n.push(r.format(`YYYY-MM-DD`)),t--}return n},ie=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=`${j()}/api/calendars/${r}/availabilities`,s=[`from_time=${(0,g.default)(t).startOf(`month`).format(`YYYY-MM-DD`)}`,`to_time=${(0,g.default)(t).endOf(`month`).format(`YYYY-MM-DD`)}`];return n&&s.push(`available=${n}`),i&&a&&s.push(`opening_hours=${a.join()}`),`${o}?${s.join(`&`)}`},ae=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=(0,g.default)(t).format(`YYYY-MM-DD`),s=`${j()}/api/calendars/${r}/availabilities/${o}`,c=[];return n&&c.push(`available=${n}`),i&&a&&c.push(`opening_hours=${a.join()}`),c&&(s=`${s}?${c.join(`&`)}`),s},oe=e=>{ee(e)},se=e=>{setTimeout(()=>{P(!N)},1e3),te(e)},ce=e=>{D(null),setTimeout(()=>{e&&(C(e.target.dataset),D(e.target.id))},300)},le=t=>{x(null);let n=`${j()}/it/meetings/new-draft`,i={date:S?.date?(0,g.default)(S?.date).format(`DD-MM-YYYY`):(0,g.default)(t.target.dataset.date).format(`DD-MM-YYYY`),slot:S?.value_start&&S?.value_end?S.value_start+`-`+S.value_end:t.target.dataset.slots,calendar:e.calendarId,opening_hour:S?.opening_hour?S?.opening_hour:t.target.dataset.opening_hour,meeting:b?b.id:``,first_available_date:O.date,first_available_start_time:O.start_time,first_available_end_time:O.end_time,first_availability_updated_at:(0,g.default)().format()};fetch(n,{method:`POST`,body:JSON.stringify(i),headers:{"Content-Type":`application/json; charset=utf-8`},strictErrors:!0}).then(e=>{if(!e.ok)throw Error(r.t(`Intervallo selezionato non disponibile!`));return e.json()}).then(e=>{x(e);let t={date:i.date,slot:i.slot,calendar_id:i.calendar[0],opening_hour_id:i.opening_hour||i.opening_hour_id,meeting_id:e.id};I([...F,t])}).catch(e=>{console.log(e),v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},ue=()=>{S&&(le(),P(!N))},de=()=>(0,f.jsx)(`span`,{children:r.t(`Tempo prenotazione scaduto!`)}),fe=({minutes:e,seconds:t,completed:n})=>n?(0,f.jsx)(de,{}):(0,f.jsx)(`div`,{children:(0,f.jsxs)(`div`,{children:[` `,(0,f.jsxs)(`span`,{children:[` `,(0,f.jsxs)(`i`,{children:[r.t(`Per confermare la prenotazione che ti abbiamo riservato procedi con l’invio di questa pratica e con il pagamento (se richiesto) di quanto previsto entro`),`:`]}),` `,(0,f.jsxs)(`b`,{children:[e,` `,r.t(`minuti`),` `,t,` `,r.t(`secondi`)]})]})]})}),pe=t=>{if(t===null||t===``)n(``);else if(Array.isArray(t)&&t.length>0){let t=[];F.map(e=>{t.push({date:(0,g.default)(e.date,`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:e.slot,calendar_id:e.calendar_id||e.calendar[0],meeting_id:e.meeting_id,opening_hour_id:e.opening_hour||e.opening_hour_id})}),e.multiple?n(t):n(t[0])}else n(``)},me=()=>{p(!0),x(null),T(null),pe(null)},V=()=>{if(r.language===`it`)return Me;if(r.language===`en`)return Ce;if(r.language===`de`)return _e};(0,d.useEffect)(()=>{pe(F)},[F]),(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&L===!1?(R(!0),setTimeout(()=>{ne()},1e3)):(R(!1),setTimeout(()=>{ne()},1e3))},[]);let he=(e,t)=>{let n=`${j()}/api/meetings/${t.meeting_id}`;fetch(n,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${Re(`auth-token`)}`},strictErrors:!0}).then(t=>{t&&t.status>400?v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori durante la cancellazione dello slot`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):(I([...F.slice(0,e),...F.slice(e+1)]),ee(new Date))})};return(0,f.jsxs)(f.Fragment,{children:[L&&A?(0,f.jsxs)(`div`,{className:`my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none`,children:[(0,f.jsxs)(`b`,{children:[Array.isArray(A)&&A.length>1?r.t(`Giorni selezionati per la prenotazione`):r.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,f.jsx)(`div`,{className:`mb-5`,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:Array.isArray(A)?A.map(e=>(0,f.jsx)(K,{day:(0,g.default)(e.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:r,slot:e.slot})):(0,f.jsx)(K,{day:(0,y.default)(A.date).format(`DD/MM/YYYY`),i18next:r,slot:A.slot})})})})]}):(0,f.jsx)(`div`,{className:`slot-calendar `,children:(0,f.jsxs)(`div`,{className:`row`,children:[e.multiple?(0,f.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,f.jsxs)(`div`,{className:`m-2`,children:[(0,f.jsx)(`h6`,{children:r.t(e.label)}),(0,f.jsx)(m.DayPicker,{mode:`single`,selected:i,locale:V(),disabled:o,onMonthChange:oe,onDayClick:se})]})}):F.length===1?null:(0,f.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,f.jsxs)(`div`,{className:`m-2`,children:[(0,f.jsx)(`h6`,{children:r.t(e.label)}),(0,f.jsx)(m.DayPicker,{mode:`single`,selected:i,locale:V(),disabled:o,onMonthChange:oe,onDayClick:se})]})}),(0,f.jsx)(`div`,{className:`col-12`,children:F.length?(0,f.jsx)(`div`,{className:`row m-2`,children:(0,f.jsxs)(`div`,{className:`col-12 mb-4`,children:[(0,f.jsxs)(`b`,{children:[F.length>1?r.t(`Giorni selezionati per la prenotazione`):r.t(`Giorno selezionato per la prenotazione`),`:`,` `]}),(0,f.jsx)(`div`,{className:`mb-5`,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:F.map((e,t)=>(0,f.jsx)(`li`,{children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsxs)(`div`,{className:`it-right-zone`,children:[(0,f.jsxs)(`span`,{className:`text pl-4`,children:[e.date,` `,S||e.slot?`${r.t(`alle`)} ${e.slot}`:``]}),(0,f.jsx)(_.Icon,{icon:`it-delete`,onClick:()=>he(t,e),role:`button`})]})})},`li`+t))})})}),b?(0,f.jsx)(_.Alert,{color:`info`,defaultValue:`string`,className:`d-print-none d-preview-calendar-none`,children:(0,f.jsx)(h.default,{date:b.expiration_time,renderer:fe})}):null]})}):null})]})}),(0,f.jsxs)(_.Modal,{isOpen:N,toggle:()=>P(!N),labelledBy:`daySelected`,size:`lg`,centered:!0,container:W(),children:[(0,f.jsx)(_.ModalHeader,{toggle:()=>P(!N),id:`daySelected`,children:r.t(`Seleziona una fascia oraria`)}),(0,f.jsx)(_.ModalBody,{children:(0,f.jsxs)(`div`,{className:`row`,children:[F.length>=1?(0,f.jsxs)(`div`,{children:[w&&!u?(0,f.jsxs)(`h6`,{children:[r.t(`Orari disponibili del`),` `,(0,y.default)(w).format(`DD/MM/YYYY`)]}):null,(0,f.jsxs)(`div`,{className:`calendar-last-selection col-12 pt-2 mb-5`,children:[(0,f.jsx)(`small`,{className:`pl-2 mb-2 d-flex px-2`,children:(0,f.jsxs)(`b`,{children:[(0,f.jsx)(_.Icon,{icon:`it-clock`,className:`mr-1`,size:`sm`}),` `,r.t(`Ultimo orario selezionato`)]})}),(0,f.jsx)(`div`,{className:`col-6 px-2`,children:(0,f.jsx)(`button`,{type:`button`,id:`slot-last-selection`,onClick:ce,tabIndex:`1`,className:E===`slot-last-selection`?`active btn btn-slot p-0`:`btn btn-slot p-0`,"data-date":(0,g.default)(w,`DD/MM/YYYY`).format(`YYYY-MM-DD`),"data-slots":F[F.length-1].slot,"data-opening_hour":F[F.length-1].opening_hour_id,"data-start":F[F.length-1].slot.split(`-`)[0],"data-end":F[F.length-1].slot.split(`-`)[1],"data-value_start":F[F.length-1].slot.split(`-`)[0],"data-value_end":F[F.length-1].slot.split(`-`)[1],disabled:u,children:F[F.length-1].slot})})]})]}):null,(0,f.jsx)(`div`,{children:w&&F.length>=1?(0,f.jsx)(`h6`,{children:r.t(`Seleziona altri orari`)}):u?null:(0,f.jsxs)(`h6`,{children:[r.t(`Orari disponibili del`),` `,(0,y.default)(w).format(`DD/MM/YYYY`)]})}),c.map((e,t)=>(0,f.jsx)(`div`,{className:`col-6`,children:(0,f.jsxs)(`button`,{type:`button`,id:`slot-`+t,onClick:ce,ref:z,className:E===`slot-`+t?`active btn btn-slot p-0`:`btn btn-slot p-0`,tabIndex:`1`,"data-date":e.date,"data-start":e.start_time,"data-end":e.end_time,"data-value_start":e.start_time,"data-value_end":e.end_time,"data-slots":e.start_time+`-`+e.end_time,"data-opening_hour":e.opening_hour,"data-min_duration":e.min_duration,disabled:e.slots_available==0,children:[e.start_time,` - `,e.end_time]})},`slot-`+t)),u?(0,f.jsxs)(`div`,{className:`callout callout-highlight warning`,children:[(0,f.jsxs)(`div`,{className:`callout-title`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":!0,icon:`it-help-circle`}),r.t(`Attenzione`)]}),(0,f.jsxs)(`p`,{children:[` `,r.t(`Non è possibile prenotare per la data selezionata`),`.`]})]}):null]})}),(0,f.jsx)(_.ModalFooter,{children:(0,f.jsx)(_.Button,{color:`primary`,onClick:()=>ue(),disabled:!w||!S?.value_start,children:r.t(`Conferma`)})})]})]})},q=class e extends Ge{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Calendar`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Ge.schema({type:`calendar`})}static editForm=We;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,u.createRoot)(e),this.rootComponent.render((0,f.jsx)(Ke,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){if(e)if(Array.isArray(e))this.selectedNextSlots=e,this.updateValue(e),this.shouldSetValue=!0;else if(typeof e==`object`)this.date=e.date,this.slot=e.slot,this.meeting=e.meeting_id,this.meeting_expiration_time=null,this.opening_hour=e.opening_hour_id,this.calendar_id=e.calendar_id,this.updateValue(e),this.shouldSetValue=!0;else{let t=e.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),n=t[2].split(`#`);this.date=t[0],this.slot=t[1],this.meeting=n[1],this.meeting_expiration_time=null,this.opening_hour=n.length===3?n[2]:``,this.updateValue({date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:this.meeting,opening_hour_id:this.opening_hour})}}getValue(){if(!(this.date&&this.slot&&this.meeting&&this.opening_hour)&&!(this.selectedNextSlots&&this.selectedNextSlots.length>0))return null;let e=this.meeting?this.meeting:``,t=this.opening_hour?this.opening_hour:``;return this.component.multiple?this.selectedNextSlots:{date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:e,opening_hour_id:t}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},qe=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{label:`Base url`,calculateValue:`let url = '`+j()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{label:`Tipo di visualizazzione`,widget:`choicesjs`,tableView:!0,data:{values:[{label:`calendar`,value:`calendar`},{label:`select`,value:`select`}]},validateWhenHidden:!1,defaultValue:`calendar`,key:`view`,type:`select`,input:!0}];function Je(...e){return p.Components.baseEditForm([{key:`display`,components:qe}],...e)}function Ye({day:e,slot:t,i18next:n}){return(0,f.jsx)(`li`,{className:`it-list-item`,children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsx)(`div`,{className:`it-right-zone`,children:(0,f.jsxs)(`span`,{className:`text-paragraph pl-4`,children:[(0,f.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,f.jsx)(`b`,{children:t})]})})})})}function Xe(e,t){if(!t||t.length===0)return;let n=t.map(e=>{let t=new Date(e.start);return(new Date(e.end)-t)/6e4}),r=Math.min(...n),i=n.reduce((e,t)=>e+t,0)/n.length,a=0;a=r<=30&&r>15?i*1:r<=15?i*24:i*4,e.setOption(`slotHeight`,a),document.documentElement.style.setProperty(`--slot-height`,`${a}px`)}var Ze={AVAILABILITY:{key:`availability_data_cache_`,duration:10},SLOTS:{key:`availability_slots_cache_`,duration:10},SUBMISSION:{key:`submission_cache_`,duration:30}},Qe=(e,t,n)=>{let r={data:n,timestamp:(0,y.default)().toISOString()};localStorage.setItem(t,JSON.stringify(r))},$e=(e,t)=>{try{let n=localStorage.getItem(t);if(!n)return null;let r=JSON.parse(n),i=(0,y.default)().diff((0,y.default)(r.timestamp),`minutes`);return i>Ze[e].duration?(localStorage.removeItem(t),console.log(`⏰ Cache scaduto: ${e}`),null):(console.log(`✅ Cache letto: ${e} (${i} minuti fa)`),r.data)}catch(t){return console.error(`Errore nel leggere il cache (${e}):`,t),null}},et=(e,...t)=>Ze[e].key+btoa(t),tt=`calendar_view_state`,nt=`calendar_view_date`,rt=(e,t)=>{try{localStorage.setItem(tt,e),localStorage.setItem(nt,t||new Date().toISOString())}catch(e){console.error(`Errore nel salvare lo stato della view:`,e)}},it=()=>{try{let e=localStorage.getItem(tt),t=localStorage.getItem(nt);return{viewType:e||`timeGridWeek`,date:t?new Date(t):new Date}}catch(e){return console.error(`Errore nel leggere lo stato della view:`,e),{viewType:`timeGridWeek`,date:new Date}}},at=()=>{try{localStorage.removeItem(tt),localStorage.removeItem(nt)}catch(e){console.error(`Errore nel pulire lo stato della view:`,e)}},ot=l.Formio.Components.components.field,J=({component:e,current:t,onChange:n,i18next:r})=>{let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)([]),[u,p]=(0,d.useState)(!1),[m,h]=(0,d.useState)(!1),[x,S]=(0,d.useState)(null),[C,w]=(0,d.useState)([]),[T,E]=(0,d.useState)([]),[D,O]=(0,d.useState)([]),[k,A]=(0,d.useState)(null),[M,N]=(0,d.useState)(null),[P,F]=(0,d.useState)(null),I=(0,d.useRef)(null),L=(0,d.useRef)(null);r.language,g.default.locale(r.language),y.default.locale(r.language);function R(e){if(!e||e.length===0)return null;let t=e.map(e=>({start:e.start_time,end:e.end_time}));return{earliestStartTime:t.reduce((e,t)=>t.start<e?t.start:e,t[0].start),latestEndTime:t.reduce((e,t)=>t.end>e?t.end:e,t[0].end)}}function z(e){let t=e.map(e=>(0,g.default)(e.date).isoWeekday()),n=[1,2,3,4,5,6,7].filter(e=>!t.includes(e));n.length>0?L.current.setOption(`hiddenDays`,n):L.current.setOption(`hiddenDays`,[])}function B(e,t,n){let r=new URL(e),i=`${r.pathname.split(`/`).slice(0,4).join(`/`)}/${t}/${n}`;return`${r.origin}${i}${r.search}`}function ee(e,t,n){let r=new URL(e),i=`${r.pathname.split(`/`).slice(0,4).join(`/`)}`;return`${r.origin}${i}${r.search}&from_to=${t}&to_date=${n}`}function te(e,t,n){return`${j()}/api/availabilities/${e}/${t}?calendar_ids=${n}&available=true`}let ne=e=>{O([]),E([]),n({}),e&&E(i.filter(t=>t.date.startsWith(e)))},re=async(e,t)=>{let i=JSON.parse(e),a=et(`SLOTS`,i.date,i.calendar_ids);if(t===`manual`)O([]),F(null),S(null),n({});else{let e=$e(`SLOTS`,a);if(e){O(e);return}}try{let e=await window.FormioHelper.anonymousCall(`availabilities/${i.date}?calendar_ids=${i.calendar_ids}`);Qe(`SLOTS`,a,e.data),O(e.data)}catch(e){console.error(`Errore nel caricamento degli slot:`,e),v.default.fire({icon:`error`,title:r.t(`Errore`),text:r.t(`Errore nel caricamento degli orari`)})}},ie=e=>{let i=JSON.parse(e),a={status:6,calendar:i.calendar_id,opening_hour:i.opening_hour_id,user:null,email:null,fiscal_code:null,name:` `,phone_number:null,from_time:(0,y.default)(`${i.date}T${i.start_time}`).toISOString(),to_time:(0,y.default)(`${i.date}T${i.end_time}`).toISOString(),user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:t?.data?.service_data?.id,calendar_group_office_id:t?.data?.user_group?.id,calendar_group_place_id:t?.data?.place?.id};window.FormioHelper.authenticatedRequest(t?.dataValue?.id?`PATCH`:`POST`,t?.dataValue?.id?`meetings/${t.dataValue.id}`:`meetings`,a).then(e=>{S({day:(0,y.default)(i.date).format(`dddd, DD MMMM YYYY`),startDate:i.start_time,endDate:i.end_time}),n(e?.id?e:e?{...e,id:t.dataValue.id}:t.dataValue.id?{...a,id:t.dataValue.id}:{...a})}).catch(e=>{console.error(e),e.status===400&&e?.response?.data?.type===`validation_error`?v.default.fire({title:``,html:`<p>`+r.t(`Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa`)+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},ae=e=>{let t=new Set,n=[];return e.forEach(e=>{let r=(0,y.default)(e.date),i=r.format(`YYYY-MM`);t.has(i)||(t.add(i),n.push({value:i,label:r.format(`MMMM YYYY`).replace(/^\w/,e=>e.toUpperCase())}))}),n},oe=async()=>{let e=t?.root?.data?.place?.merge_availabilities?t?.root?.data?.place?.merged_availabilities_link:null,i=(0,g.default)().format(`YYYY-MM-DD`),o=(0,g.default)().add(1,`month`).format(`YYYY-MM-DD`),s=t?.root?.data?.place?.calendars[0]?.id||null,c=e?ee(e,i,o):te(i,o,s),l=et(`AVAILABILITY`,c),u=$e(`AVAILABILITY`,l);if(u){a(u),w(ae(u));return}else n({});p(!0);try{let e=await window.FormioHelper.fetchAPIUrlLimit(c);if(p(!1),!e?.length){v.default.fire({icon:`warning`,title:r.t(`warning`),html:r.t(`no_meetings`)});return}Qe(`AVAILABILITY`,l,e),a(e),w(ae(e))}catch(e){p(!1),console.error(`Errore nel caricamento disponibilità:`,e)}};(0,d.useEffect)(()=>{if(i?.length){let e=t?.dataValue??t?.getValue();if(e?.from_time&&e?.to_time&&!(0,y.default)().isAfter(e?.draft_expiration)){let t=(0,y.default)(e.from_time).format(`YYYY-MM`);A(t),t&&E&&(E(i.filter(e=>e.date.startsWith(t))),N((0,y.default)(e.from_time).format(`YYYY-MM-DD`)))}else e?.draft_expiration&&(0,y.default)().isAfter(e?.draft_expiration)&&v.default.fire({icon:`warning`,title:r.t(`warning`),html:r.t(`expired_meeting`)})}},[i]),(0,d.useEffect)(()=>{let e=t?.dataValue??t?.getValue();if(!C.length||k||e?.from_time||e?.to_time)return;let n=C[0];n&&(A(n.value),ne(n.value))},[C,k,t?.dataValue]),(0,d.useEffect)(()=>{if(M&&m===!1){let e=t?.dataValue??t?.getValue();re(JSON.stringify({date:M,calendar_ids:e.calendar.id}))}},[M]);let se=()=>window.innerWidth>768?`timeGridWeek`:`timeGridDay`;(0,d.useEffect)(()=>{let e=()=>{let e=L.current;if(!e)return;let t=se();t!==e.getView().type&&e.setOption(`view`,t)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,d.useEffect)(()=>{let e=t?.dataValue??t?.getValue();D?.length&&e?.from_time&&(F((0,y.default)(e.from_time).format(`HH:mm`)+` - `+(0,y.default)(e.to_time).format(`HH:mm`)),S({day:(0,y.default)(e.from_time).format(`dddd D MMM YYYY`),startDate:(0,y.default)(e.from_time).format(`HH:mm`),endDate:(0,y.default)(e.to_time).format(`HH:mm`)}))},[D]);let ce=()=>{let e=it();L.current=(0,b.createCalendar)(I.current,[b.TimeGrid],{events:[],buttonText:{today:r.t(`Oggi`)},allDaySlot:!1,firstDay:1,date:e.date,slotEventOverlap:!1,view:se(),height:`400px`,views:{timeGridWeek:{allDaySlot:!1,firstDay:1,slotHeight:48},timeGridDay:{allDaySlot:!1,firstDay:1,slotHeight:48}},datesSet:e=>{rt(e.view.type,e.start)},eventClick({event:e,el:i}){document.querySelectorAll(`.ec-event`).forEach(e=>{e.classList.remove(`highlighted-event`)}),i.classList.add(`highlighted-event`);let a=new Date(e.start),o=new Date(e.end),s=a.toLocaleDateString(`it-IT`,{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),c=a.toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}),l=o.toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}),u={status:6,calendar:e.extendedProps.calendar_id,opening_hour:e.extendedProps.opening_hour_id,user:null,email:null,fiscal_code:null,name:` `,phone_number:null,from_time:a,to_time:o,user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:t?.data?.service_data?.id,calendar_group_office_id:t?.data?.user_group?.id,calendar_group_place_id:t?.data?.place?.id};window.FormioHelper.authenticatedRequest(t?.dataValue?.id?`PATCH`:`POST`,t?.dataValue?.id?`meetings/${t.dataValue.id}`:`meetings`,u).then(e=>{let r;!e||e===``?r={...u,code:null,id:t?.dataValue?.id}:typeof e==`object`&&(r=e),S({day:s,startDate:c,endDate:l}),n(r)}).catch(e=>{console.error(e),e.status===400&&e?.response?.data?.type===`validation_error`?v.default.fire({title:``,html:`<p>`+r.t(`Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa`)+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},viewDidMount:le,eventDidMount:e=>{let{event:t,el:n}=e,r=t.extendedProps;n.setAttribute(`data-event-id`,t.id+`-`+r.date+`-`+r.start_time)},loading:e=>{p(e)}})},le=e=>{t?.root?.data?.place&&L.current.setOption(`eventSources`,[{events:ue}])};async function ue(e,n,i){try{L.current.setOption(`events`,[]);let i=(0,g.default)(e.start).format(`YYYY-MM-DD`),a=new Date(e.end);a.setDate(a.getDate()-1);let o=(0,g.default)(a).format(`YYYY-MM-DD`),s=t?.root?.data?.place?.merge_availabilities?t?.root?.data?.place?.merged_availabilities_link:null,c=s?B(s,i,o):te(i,o,null),l=et(`AVAILABILITY`,c),u=$e(`AVAILABILITY`,l),d;if(u?(d=u,p(!1)):(d=await window.FormioHelper.fetchAPIUrlLimit(c),Qe(`AVAILABILITY`,l,d)),!d?.length){n([]),v.default.fire({icon:`warning`,title:r.t(`warning`),html:r.t(`no_meetings`)});return}let f=d.map(e=>({id:e.opening_hour_id,allDay:!1,start:`${e.date}T${e.start_time}:00`,end:`${e.date}T${e.end_time}:00`,title:`${e.start_time} - ${e.end_time}`,editable:!1,display:`auto`,color:`#ebeef0`,textColor:`#000`,className:`event-slot`,extendedProps:{...e}})),m=R(d);L.current.setOption(`slotMinTime`,m.earliestStartTime),L.current.setOption(`slotMaxTime`,m.latestEndTime),z(d),Xe(L.current,f),n(f),setTimeout(()=>{de(f)},500)}catch(e){console.error(`Errore nel caricamento disponibilità:`,e),i?.(e)}}(0,d.useEffect)(()=>{let i,a=!1;async function o(){try{if(await window.FormioInstance?.formReady,a)return;if(!I.current){console.warn(`Elemento calendario non trovato`);return}let i=t?.dataValue??t?.getValue();i&&i?.draft_expiration&&(0,y.default)().isAfter(i.draft_expiration)&&(n({}),at()),t?.data?.service_data?.view_type===`calendar`||e.view===`calendar`?L?.current||ce():t?.data?.service_data?.view_type===`select`||e.view===`select`?oe():alert(r.t(`Il componente non è configurato per la visualizzazione a calendario`))}catch(e){console.error(`Errore durante l'inizializzazione del calendario:`,e)}}return i=setTimeout(o,500),()=>{a=!0,i&&clearTimeout(i),L.current&&=(I.current?.destroy?.(),null)}},[t?.root?.data?.place]);function de(e){let n=t?.dataValue;if(!n?.from_time)return;let r=(0,y.default)(n.from_time).format(`DD-MM-YYYY HH:mm`),i=(0,y.default)(n.to_time).format(`DD-MM-YYYY HH:mm`),a=e.find(e=>(0,y.default)(e.start).format(`DD-MM-YYYY HH:mm`)===r&&(0,y.default)(e.end).format(`DD-MM-YYYY HH:mm`)===i);if(!a)return;let o=document.querySelector(`.ec-event[data-event-id="${a.id}-${(0,y.default)(n?.from_time).format(`YYYY-MM-DD`)}-${(0,y.default)(n?.from_time).format(`HH:mm`)}"]`);o&&(o.classList.add(`highlighted-event`),o.scrollIntoView({behavior:`smooth`,block:`center`}),S({day:(0,y.default)(n?.from_time).format(`dddd, DD MMMM YYYY`),startDate:(0,y.default)(n?.from_time).format(`HH:mm`),endDate:(0,y.default)(n?.to_time).format(`HH:mm`)}))}return(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&m===!1?h(!0):(t?.data?.service_data?.view_type===`select`?oe():t?.data?.service_data?.view_type===`calendar`&&ce(),h(!1))},[]),(0,d.useEffect)(()=>{m&&setTimeout(()=>{let e=t?.dataValue??t?.getValue();console.log(`savedValue`,e,m),e&&s(e)},500)},[m]),(0,f.jsx)(f.Fragment,{children:m&&o?(0,f.jsxs)(`div`,{className:`mx-2`,children:[(0,f.jsxs)(`p`,{className:`text-paragraph`,children:[r.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,f.jsx)(`div`,{className:``,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:(0,f.jsx)(Ye,{day:(0,y.default)(o.from_time).format(`dddd D MMM YYYY`),i18next:r,slot:`${(0,y.default)(o.from_time).format(`HH:mm`)} - ${(0,y.default)(o.to_time).format(`HH:mm`)}`})})})})]}):(0,f.jsxs)(`div`,{className:``,children:[(0,f.jsx)(`div`,{ref:I}),C.length>0?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(_.Select,{label:`Mese`,id:`selectMonthYear`,onChange:ne,children:[(0,f.jsx)(`option`,{value:``,children:r.t(`Scegli un'opzione`)}),C.map(e=>(0,f.jsx)(`option`,{value:e.value,selected:e.value===k,children:e.label},e.value))]}),(0,f.jsxs)(_.Select,{label:`Giorno`,id:`selectDay`,onChange:e=>re(e,`manual`),disabled:T.length===0,children:[(0,f.jsx)(`option`,{value:``,children:r.t(`Scegli un'opzione`)}),T.map(e=>(0,f.jsx)(`option`,{value:JSON.stringify(e),selected:e.date===M,children:(0,y.default)(e.date).format(`dddd,DD MMMM YYYY`)},e.date))]}),(0,f.jsxs)(_.Select,{label:`Orario`,id:`selectSlot`,onChange:ie,disabled:D.length===0,children:[(0,f.jsx)(`option`,{value:``,children:r.t(`Scegli un'opzione`)}),D.map(e=>(0,f.jsx)(`option`,{value:JSON.stringify(e),selected:e.start_time+` - `+e.end_time===P,children:e.start_time+` - `+e.end_time},e.start_time+` - `+e.end_time))]})]}):null,x?(({day:e,startDate:t,endDate:n})=>(0,f.jsx)(`div`,{className:`mt-3`,children:(0,f.jsxs)(`div`,{className:`row align-items-center gy-3`,children:[(0,f.jsxs)(`div`,{className:`col-12 col-md border-light mx-md-3`,children:[(0,f.jsx)(`div`,{className:`text-paragraph-small`,children:r.t(`Data`)}),(0,f.jsx)(`p`,{className:`data-text`,children:(0,f.jsx)(`strong`,{children:e})})]}),(0,f.jsxs)(`div`,{className:`col-12 col-md border-light mx-md-3`,children:[(0,f.jsx)(`div`,{className:`text-paragraph-small`,children:r.t(`Ora`)}),(0,f.jsx)(`p`,{className:`data-text`,children:(0,f.jsxs)(`strong`,{children:[t,` - `,n]})})]})]})}))({day:x.day,startDate:x.startDate,endDate:x.endDate}):null,u?(0,f.jsx)(`div`,{className:`d-flex align-items-center justify-content-center position-absolute-center`,children:(0,f.jsx)(_.Spinner,{active:!0})}):null]})})},st=class e extends ot{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Calendar Advanced`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return ot.schema({type:`calendar-advanced`})}static editForm=Je;attach(e,t){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent&&=(this.rootComponent.unmount(),null),this.rootComponent=(0,u.createRoot)(e),this.builderMode?(this.rootComponent.render((0,f.jsx)(`div`,{className:`my-1 border border-2 border-light rounded p-3 text-secondary`,children:(0,f.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`Calendar Advanced`})})),this):(this.rootComponent.render((0,f.jsx)(J,{ref:t,component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this)):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){e&&(this.updateValue(e),this.shouldSetValue=!0)}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},ct=[{key:`defaultValue`,ignore:!0}],lt=[{key:`placeholder`,ignore:!0},{type:`checkbox`,label:`Files Synchronization feature`,tooltip:`Enable ability to control files synchronization. Files will be auto synced before submit.`,key:`autoSync`,input:!0,conditional:{json:{in:[{var:`data.storage`},[`s3`,`azure`,`googledrive`]]}}}],ut=[{type:`select`,input:!0,key:`storage`,label:`Storage`,placeholder:`Select your file storage provider`,weight:0,tooltip:`Which storage to save the files in.`,valueProperty:`value`,dataSrc:`custom`,hidden:!0,data:{custom:function(){return[{label:`url`,value:`url`}]}}},{type:`checkbox`,input:!0,defaultValue:!0,key:`protocol_required`,label:`Richiede protocollazione?`,tooltip:``,weight:10},{type:`checkbox`,input:!0,defaultValue:!1,key:`check_signature`,label:`Effettuare il controllo della firma?`,tooltip:``,weight:15},{type:`checkbox`,input:!0,key:`useMultipartUpload`,label:`Use the S3 Multipart Upload API`,tooltip:`The <a href='https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html'>S3 Multipart Upload API</a> is designed to improve the upload experience for larger objects (> 5GB).`,conditional:{json:{"===":[{var:`data.storage`},`s3`]}}},{label:`Multipart Upload`,tableView:!1,key:`multipart`,type:`container`,input:!0,components:[{label:`Part Size (MB)`,applyMaskOn:`change`,mask:!1,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:`plain`,truncateMultipleSpaces:!1,validate:{min:5,max:5e3},key:`partSize`,type:`number`,input:!0,defaultValue:500}],conditional:{json:{"===":[{var:`data.useMultipartUpload`},!0]}}},{type:`textfield`,input:!0,key:`options.indexeddb`,label:`Database`,weight:10,placeholder:`Enter the indexeddb database name`,conditional:{json:{in:[{var:`data.storage`},[`indexeddb`]]}}},{type:`textfield`,input:!0,label:`Table`,key:`options.indexeddbTable`,weight:10,placeholder:`Enter the name for indexeddb table`,conditional:{json:{in:[{var:`data.storage`},[`indexeddb`]]}}},{type:`textarea`,key:`options`,label:`Custom request options`,tooltip:`Pass your custom xhr options(optional)`,rows:5,editor:`ace`,input:!0,weight:15,placeholder:`{
66
+ }`,validateOn:`change`,validate:{customMessage:`Vi sono sovrapposizioni negli orari di apertura`,custom:`if (document.querySelector("input[name^='data[overlaps_validation]']").value === '0') {valid=true} else {valid = 'Sovrapposizione';}`},key:`overlaps_validation`,attributes:{readonly:`true`},required:!0,type:`number`,input:!0,weight:1},{label:`Precisione minima (minuti)`,defaultValue:1,required:!0,inputFormat:`plain`,key:`range_step`,type:`number`,input:!0,weight:1}];function K(...e){return p.Components.baseEditForm([{key:`display`,components:We}],...e)}function Ge({day:e,slot:t,i18next:n}){return(0,f.jsx)(`li`,{className:`it-list-item`,children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsx)(`div`,{className:`it-right-zone`,children:(0,f.jsxs)(`span`,{className:`text pl-4`,children:[(0,f.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,f.jsx)(`b`,{children:t})]})})})})}var Ke=l.Formio.Components.components.field,q=({component:e,current:t,onChange:n,i18next:r})=>{let[i,a]=(0,d.useState)(),[o,s]=(0,d.useState)([]),[c,l]=(0,d.useState)([]),[u,p]=(0,d.useState)(!1),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),[E,D]=(0,d.useState)(null),[O,ee]=(0,d.useState)({}),[k,A]=(0,d.useState)(null),[M,te]=(0,d.useState)(!1),[N,P]=(0,d.useState)([]),[F,I]=(0,d.useState)(!1),L=(0,d.useRef)(),R=e.calendarId;g.default.locale(r.language),y.default.locale(r.language);let ne=e=>{let t=(0,g.default)(e).format(`YYYY-MM-DD`);fetch(ie(t)).then(e=>e.json()).then(t=>{let n=re(e||new Date),r=t.filter(e=>e.available==1);r.length===0&&me();let i=[];n.forEach(e=>{t.some(t=>t.date===e&&t.available==1)?i.push({available:!0,date:e}):i.push({available:!1,date:e})}),s(i.map(e=>{if(e.available===!1)return(0,g.default)(e.date,`YYYY-MM-DD`).toDate()})),z(r.length?r[0].date:e)}).catch(e=>console.error(e))},z=e=>{D(null),T(null),l([]);let t=(0,g.default)(e).format(`YYYY-MM-DD`);fetch(ae(t)).then(e=>e.json()).then(t=>{let n=t.filter(e=>e.availability==1);ee(n[0]),n.length>0?(l(t),p(!1),T((0,g.default)(e).format(`L`)),a((0,g.default)(e,`YYYY-MM-DD`).toDate())):(t.length>0&&a((0,g.default)(t[0].date,`YYYY-MM-DD`).toDate()),l([]),me())})},B=()=>{if(R!==``&&R!=null)if(!t.dataValue)ne(new Date);else if(e.multiple&&Array.isArray(t.dataValue)){if(t.dataValue.length>0){A(t.dataValue);let e=[];t.dataValue.map(t=>{e.push({...t,date:(0,g.default)(t.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)})}),P(e)}}else if(!e.multiple&&typeof t.dataValue==`object`){let e={date:t.dataValue.date,slot:t.dataValue.slot};P([{...t.dataValue,date:(0,g.default)(t.dataValue.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)}]),A(e)}else{let r=t.dataValue.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),i=r[2].split(`#`),a={date:(0,g.default)(r[0],`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:r[1]};e.multiple?(n([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}]),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])):(n({date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])),A(a)}};(0,d.useEffect)(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{B()},1e3)})},[]);let re=e=>{let t=(0,g.default)(e,`YYYY-MM`).daysInMonth(),n=[];for(;t;){let r=(0,g.default)(e).date(t);n.push(r.format(`YYYY-MM-DD`)),t--}return n},ie=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=`${j()}/api/calendars/${r}/availabilities`,s=[`from_time=${(0,g.default)(t).startOf(`month`).format(`YYYY-MM-DD`)}`,`to_time=${(0,g.default)(t).endOf(`month`).format(`YYYY-MM-DD`)}`];return n&&s.push(`available=${n}`),i&&a&&s.push(`opening_hours=${a.join()}`),`${o}?${s.join(`&`)}`},ae=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=(0,g.default)(t).format(`YYYY-MM-DD`),s=`${j()}/api/calendars/${r}/availabilities/${o}`,c=[];return n&&c.push(`available=${n}`),i&&a&&c.push(`opening_hours=${a.join()}`),c&&(s=`${s}?${c.join(`&`)}`),s},oe=e=>{ne(e)},se=e=>{setTimeout(()=>{te(!M)},1e3),z(e)},ce=e=>{D(null),setTimeout(()=>{e&&(C(e.target.dataset),D(e.target.id))},300)},le=t=>{x(null);let n=`${j()}/it/meetings/new-draft`,i={date:S?.date?(0,g.default)(S?.date).format(`DD-MM-YYYY`):(0,g.default)(t.target.dataset.date).format(`DD-MM-YYYY`),slot:S?.value_start&&S?.value_end?S.value_start+`-`+S.value_end:t.target.dataset.slots,calendar:e.calendarId,opening_hour:S?.opening_hour?S?.opening_hour:t.target.dataset.opening_hour,meeting:b?b.id:``,first_available_date:O.date,first_available_start_time:O.start_time,first_available_end_time:O.end_time,first_availability_updated_at:(0,g.default)().format()};fetch(n,{method:`POST`,body:JSON.stringify(i),headers:{"Content-Type":`application/json; charset=utf-8`},strictErrors:!0}).then(e=>{if(!e.ok)throw Error(r.t(`Intervallo selezionato non disponibile!`));return e.json()}).then(e=>{x(e);let t={date:i.date,slot:i.slot,calendar_id:i.calendar[0],opening_hour_id:i.opening_hour||i.opening_hour_id,meeting_id:e.id};P([...N,t])}).catch(e=>{console.log(e),v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},ue=()=>{S&&(le(),te(!M))},de=()=>(0,f.jsx)(`span`,{children:r.t(`Tempo prenotazione scaduto!`)}),fe=({minutes:e,seconds:t,completed:n})=>n?(0,f.jsx)(de,{}):(0,f.jsx)(`div`,{children:(0,f.jsxs)(`div`,{children:[` `,(0,f.jsxs)(`span`,{children:[` `,(0,f.jsxs)(`i`,{children:[r.t(`Per confermare la prenotazione che ti abbiamo riservato procedi con l’invio di questa pratica e con il pagamento (se richiesto) di quanto previsto entro`),`:`]}),` `,(0,f.jsxs)(`b`,{children:[e,` `,r.t(`minuti`),` `,t,` `,r.t(`secondi`)]})]})]})}),pe=t=>{if(t===null||t===``)n(``);else if(Array.isArray(t)&&t.length>0){let t=[];N.map(e=>{t.push({date:(0,g.default)(e.date,`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:e.slot,calendar_id:e.calendar_id||e.calendar[0],meeting_id:e.meeting_id,opening_hour_id:e.opening_hour||e.opening_hour_id})}),e.multiple?n(t):n(t[0])}else n(``)},me=()=>{p(!0),x(null),T(null),pe(null)},V=()=>{if(r.language===`it`)return Ne;if(r.language===`en`)return we;if(r.language===`de`)return ve};(0,d.useEffect)(()=>{pe(N)},[N]),(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&F===!1?(I(!0),setTimeout(()=>{B()},1e3)):(I(!1),setTimeout(()=>{B()},1e3))},[]);let he=(e,t)=>{let n=`${j()}/api/meetings/${t.meeting_id}`;fetch(n,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${ze(`auth-token`)}`},strictErrors:!0}).then(t=>{t&&t.status>400?v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori durante la cancellazione dello slot`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):(P([...N.slice(0,e),...N.slice(e+1)]),ne(new Date))})};return(0,f.jsxs)(f.Fragment,{children:[F&&k?(0,f.jsxs)(`div`,{className:`my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none`,children:[(0,f.jsxs)(`b`,{children:[Array.isArray(k)&&k.length>1?r.t(`Giorni selezionati per la prenotazione`):r.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,f.jsx)(`div`,{className:`mb-5`,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:Array.isArray(k)?k.map(e=>(0,f.jsx)(Ge,{day:(0,g.default)(e.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:r,slot:e.slot})):(0,f.jsx)(Ge,{day:(0,y.default)(k.date).format(`DD/MM/YYYY`),i18next:r,slot:k.slot})})})})]}):(0,f.jsx)(`div`,{className:`slot-calendar `,children:(0,f.jsxs)(`div`,{className:`row`,children:[e.multiple?(0,f.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,f.jsxs)(`div`,{className:`m-2`,children:[(0,f.jsx)(`h6`,{children:r.t(e.label)}),(0,f.jsx)(m.DayPicker,{mode:`single`,selected:i,locale:V(),disabled:o,onMonthChange:oe,onDayClick:se})]})}):N.length===1?null:(0,f.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,f.jsxs)(`div`,{className:`m-2`,children:[(0,f.jsx)(`h6`,{children:r.t(e.label)}),(0,f.jsx)(m.DayPicker,{mode:`single`,selected:i,locale:V(),disabled:o,onMonthChange:oe,onDayClick:se})]})}),(0,f.jsx)(`div`,{className:`col-12`,children:N.length?(0,f.jsx)(`div`,{className:`row m-2`,children:(0,f.jsxs)(`div`,{className:`col-12 mb-4`,children:[(0,f.jsxs)(`b`,{children:[N.length>1?r.t(`Giorni selezionati per la prenotazione`):r.t(`Giorno selezionato per la prenotazione`),`:`,` `]}),(0,f.jsx)(`div`,{className:`mb-5`,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:N.map((e,t)=>(0,f.jsx)(`li`,{children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsxs)(`div`,{className:`it-right-zone`,children:[(0,f.jsxs)(`span`,{className:`text pl-4`,children:[e.date,` `,S||e.slot?`${r.t(`alle`)} ${e.slot}`:``]}),(0,f.jsx)(_.Icon,{icon:`it-delete`,onClick:()=>he(t,e),role:`button`})]})})},`li`+t))})})}),b?(0,f.jsx)(_.Alert,{color:`info`,defaultValue:`string`,className:`d-print-none d-preview-calendar-none`,children:(0,f.jsx)(h.default,{date:b.expiration_time,renderer:fe})}):null]})}):null})]})}),(0,f.jsxs)(_.Modal,{isOpen:M,toggle:()=>te(!M),labelledBy:`daySelected`,size:`lg`,centered:!0,container:Ve(),children:[(0,f.jsx)(_.ModalHeader,{toggle:()=>te(!M),id:`daySelected`,children:r.t(`Seleziona una fascia oraria`)}),(0,f.jsx)(_.ModalBody,{children:(0,f.jsxs)(`div`,{className:`row`,children:[N.length>=1?(0,f.jsxs)(`div`,{children:[w&&!u?(0,f.jsxs)(`h6`,{children:[r.t(`Orari disponibili del`),` `,(0,y.default)(w).format(`DD/MM/YYYY`)]}):null,(0,f.jsxs)(`div`,{className:`calendar-last-selection col-12 pt-2 mb-5`,children:[(0,f.jsx)(`small`,{className:`pl-2 mb-2 d-flex px-2`,children:(0,f.jsxs)(`b`,{children:[(0,f.jsx)(_.Icon,{icon:`it-clock`,className:`mr-1`,size:`sm`}),` `,r.t(`Ultimo orario selezionato`)]})}),(0,f.jsx)(`div`,{className:`col-6 px-2`,children:(0,f.jsx)(`button`,{type:`button`,id:`slot-last-selection`,onClick:ce,tabIndex:`1`,className:E===`slot-last-selection`?`active btn btn-slot p-0`:`btn btn-slot p-0`,"data-date":(0,g.default)(w,`DD/MM/YYYY`).format(`YYYY-MM-DD`),"data-slots":N[N.length-1].slot,"data-opening_hour":N[N.length-1].opening_hour_id,"data-start":N[N.length-1].slot.split(`-`)[0],"data-end":N[N.length-1].slot.split(`-`)[1],"data-value_start":N[N.length-1].slot.split(`-`)[0],"data-value_end":N[N.length-1].slot.split(`-`)[1],disabled:u,children:N[N.length-1].slot})})]})]}):null,(0,f.jsx)(`div`,{children:w&&N.length>=1?(0,f.jsx)(`h6`,{children:r.t(`Seleziona altri orari`)}):u?null:(0,f.jsxs)(`h6`,{children:[r.t(`Orari disponibili del`),` `,(0,y.default)(w).format(`DD/MM/YYYY`)]})}),c.map((e,t)=>(0,f.jsx)(`div`,{className:`col-6`,children:(0,f.jsxs)(`button`,{type:`button`,id:`slot-`+t,onClick:ce,ref:L,className:E===`slot-`+t?`active btn btn-slot p-0`:`btn btn-slot p-0`,tabIndex:`1`,"data-date":e.date,"data-start":e.start_time,"data-end":e.end_time,"data-value_start":e.start_time,"data-value_end":e.end_time,"data-slots":e.start_time+`-`+e.end_time,"data-opening_hour":e.opening_hour,"data-min_duration":e.min_duration,disabled:e.slots_available==0,children:[e.start_time,` - `,e.end_time]})},`slot-`+t)),u?(0,f.jsxs)(`div`,{className:`callout callout-highlight warning`,children:[(0,f.jsxs)(`div`,{className:`callout-title`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":!0,icon:`it-help-circle`}),r.t(`Attenzione`)]}),(0,f.jsxs)(`p`,{children:[` `,r.t(`Non è possibile prenotare per la data selezionata`),`.`]})]}):null]})}),(0,f.jsx)(_.ModalFooter,{children:(0,f.jsx)(_.Button,{color:`primary`,onClick:()=>ue(),disabled:!w||!S?.value_start,children:r.t(`Conferma`)})})]})]})},qe=class e extends Ke{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Calendar`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Ke.schema({type:`calendar`})}static editForm=K;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,u.createRoot)(e),this.rootComponent.render((0,f.jsx)(q,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){if(e)if(Array.isArray(e))this.selectedNextSlots=e,this.updateValue(e),this.shouldSetValue=!0;else if(typeof e==`object`)this.date=e.date,this.slot=e.slot,this.meeting=e.meeting_id,this.meeting_expiration_time=null,this.opening_hour=e.opening_hour_id,this.calendar_id=e.calendar_id,this.updateValue(e),this.shouldSetValue=!0;else{let t=e.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),n=t[2].split(`#`);this.date=t[0],this.slot=t[1],this.meeting=n[1],this.meeting_expiration_time=null,this.opening_hour=n.length===3?n[2]:``,this.updateValue({date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:this.meeting,opening_hour_id:this.opening_hour})}}getValue(){if(!(this.date&&this.slot&&this.meeting&&this.opening_hour)&&!(this.selectedNextSlots&&this.selectedNextSlots.length>0))return null;let e=this.meeting?this.meeting:``,t=this.opening_hour?this.opening_hour:``;return this.component.multiple?this.selectedNextSlots:{date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:e,opening_hour_id:t}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Je=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{label:`Base url`,calculateValue:`let url = '`+j()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{label:`Tipo di visualizazzione`,widget:`choicesjs`,tableView:!0,data:{values:[{label:`calendar`,value:`calendar`},{label:`select`,value:`select`}]},validateWhenHidden:!1,defaultValue:`calendar`,key:`view`,type:`select`,input:!0}];function Ye(...e){return p.Components.baseEditForm([{key:`display`,components:Je}],...e)}function Xe({day:e,slot:t,i18next:n}){return(0,f.jsx)(`li`,{className:`it-list-item`,children:(0,f.jsx)(`div`,{className:`list-item`,children:(0,f.jsx)(`div`,{className:`it-right-zone`,children:(0,f.jsxs)(`span`,{className:`text-paragraph pl-4`,children:[(0,f.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,f.jsx)(`b`,{children:t})]})})})})}function Ze(e,t){if(!t||t.length===0)return;let n=t.map(e=>{let t=new Date(e.start);return(new Date(e.end)-t)/6e4}),r=Math.min(...n),i=n.reduce((e,t)=>e+t,0)/n.length,a=0;a=r<=30&&r>15?i*1:r<=15?i*24:i*4,e.setOption(`slotHeight`,a),document.documentElement.style.setProperty(`--slot-height`,`${a}px`)}var Qe={AVAILABILITY:{key:`availability_data_cache_`,duration:10},SLOTS:{key:`availability_slots_cache_`,duration:10},SUBMISSION:{key:`submission_cache_`,duration:30}},$e=(e,t,n)=>{let r={data:n,timestamp:(0,y.default)().toISOString()};localStorage.setItem(t,JSON.stringify(r))},et=(e,t)=>{try{let n=localStorage.getItem(t);if(!n)return null;let r=JSON.parse(n),i=(0,y.default)().diff((0,y.default)(r.timestamp),`minutes`);return i>Qe[e].duration?(localStorage.removeItem(t),console.log(`⏰ Cache scaduto: ${e}`),null):(console.log(`✅ Cache letto: ${e} (${i} minuti fa)`),r.data)}catch(t){return console.error(`Errore nel leggere il cache (${e}):`,t),null}},tt=(e,...t)=>Qe[e].key+btoa(t),nt=`calendar_view_state`,rt=`calendar_view_date`,it=(e,t)=>{try{localStorage.setItem(nt,e),localStorage.setItem(rt,t||new Date().toISOString())}catch(e){console.error(`Errore nel salvare lo stato della view:`,e)}},at=()=>{try{let e=localStorage.getItem(nt),t=localStorage.getItem(rt);return{viewType:e||`timeGridWeek`,date:t?new Date(t):new Date}}catch(e){return console.error(`Errore nel leggere lo stato della view:`,e),{viewType:`timeGridWeek`,date:new Date}}},ot=()=>{try{localStorage.removeItem(nt),localStorage.removeItem(rt)}catch(e){console.error(`Errore nel pulire lo stato della view:`,e)}},J=l.Formio.Components.components.field,st=({component:e,current:t,onChange:n,i18next:r})=>{let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)([]),[u,p]=(0,d.useState)(!1),[m,h]=(0,d.useState)(!1),[x,S]=(0,d.useState)(null),[C,w]=(0,d.useState)([]),[T,E]=(0,d.useState)([]),[D,O]=(0,d.useState)([]),[ee,k]=(0,d.useState)(null),[A,M]=(0,d.useState)(null),[te,N]=(0,d.useState)(null),P=(0,d.useRef)(null),F=(0,d.useRef)(null);r.language,g.default.locale(r.language),y.default.locale(r.language);function I(e){if(!e||e.length===0)return null;let t=e.map(e=>({start:e.start_time,end:e.end_time}));return{earliestStartTime:t.reduce((e,t)=>t.start<e?t.start:e,t[0].start),latestEndTime:t.reduce((e,t)=>t.end>e?t.end:e,t[0].end)}}function L(e){let t=e.map(e=>(0,g.default)(e.date).isoWeekday()),n=[1,2,3,4,5,6,7].filter(e=>!t.includes(e));n.length>0?F.current.setOption(`hiddenDays`,n):F.current.setOption(`hiddenDays`,[])}function R(e,t,n){let r=new URL(e),i=`${r.pathname.split(`/`).slice(0,4).join(`/`)}/${t}/${n}`;return`${r.origin}${i}${r.search}`}function ne(e,t,n){let r=new URL(e),i=`${r.pathname.split(`/`).slice(0,4).join(`/`)}`;return`${r.origin}${i}${r.search}&from_to=${t}&to_date=${n}`}function z(e,t,n){return`${j()}/api/availabilities/${e}/${t}?calendar_ids=${n}&available=true`}let B=e=>{O([]),E([]),n({}),e&&E(i.filter(t=>t.date.startsWith(e)))},re=async(e,t)=>{let i=JSON.parse(e),a=tt(`SLOTS`,i.date,i.calendar_ids);if(t===`manual`)O([]),N(null),S(null),n({});else{let e=et(`SLOTS`,a);if(e){O(e);return}}try{let e=await window.FormioHelper.anonymousCall(`availabilities/${i.date}?calendar_ids=${i.calendar_ids}`);$e(`SLOTS`,a,e.data),O(e.data)}catch(e){console.error(`Errore nel caricamento degli slot:`,e),v.default.fire({icon:`error`,title:r.t(`Errore`),text:r.t(`Errore nel caricamento degli orari`)})}},ie=e=>{let i=JSON.parse(e),a={status:6,calendar:i.calendar_id,opening_hour:i.opening_hour_id,user:null,email:null,fiscal_code:null,name:` `,phone_number:null,from_time:(0,y.default)(`${i.date}T${i.start_time}`).toISOString(),to_time:(0,y.default)(`${i.date}T${i.end_time}`).toISOString(),user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:t?.data?.service_data?.id,calendar_group_office_id:t?.data?.user_group?.id,calendar_group_place_id:t?.data?.place?.id};window.FormioHelper.authenticatedRequest(t?.dataValue?.id?`PATCH`:`POST`,t?.dataValue?.id?`meetings/${t.dataValue.id}`:`meetings`,a).then(e=>{S({day:(0,y.default)(i.date).format(`dddd, DD MMMM YYYY`),startDate:i.start_time,endDate:i.end_time}),n(e?.id?e:e?{...e,id:t.dataValue.id}:t.dataValue.id?{...a,id:t.dataValue.id}:{...a})}).catch(e=>{console.error(e),e.status===400&&e?.response?.data?.type===`validation_error`?v.default.fire({title:``,html:`<p>`+r.t(`Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa`)+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},ae=e=>{let t=new Set,n=[];return e.forEach(e=>{let r=(0,y.default)(e.date),i=r.format(`YYYY-MM`);t.has(i)||(t.add(i),n.push({value:i,label:r.format(`MMMM YYYY`).replace(/^\w/,e=>e.toUpperCase())}))}),n},oe=async()=>{let e=t?.root?.data?.place?.merge_availabilities?t?.root?.data?.place?.merged_availabilities_link:null,i=(0,g.default)().format(`YYYY-MM-DD`),o=(0,g.default)().add(1,`month`).format(`YYYY-MM-DD`),s=t?.root?.data?.place?.calendars[0]?.id||null,c=e?ne(e,i,o):z(i,o,s),l=tt(`AVAILABILITY`,c),u=et(`AVAILABILITY`,l);if(u){a(u),w(ae(u));return}else n({});p(!0);try{let e=await window.FormioHelper.fetchAPIUrlLimit(c);if(p(!1),!e?.length){v.default.fire({icon:`warning`,title:r.t(`warning`),html:r.t(`no_meetings`)});return}$e(`AVAILABILITY`,l,e),a(e),w(ae(e))}catch(e){p(!1),console.error(`Errore nel caricamento disponibilità:`,e)}};(0,d.useEffect)(()=>{if(i?.length){let e=t?.dataValue??t?.getValue();if(e?.from_time&&e?.to_time&&!(0,y.default)().isAfter(e?.draft_expiration)){let t=(0,y.default)(e.from_time).format(`YYYY-MM`);k(t),t&&E&&(E(i.filter(e=>e.date.startsWith(t))),M((0,y.default)(e.from_time).format(`YYYY-MM-DD`)))}else e?.draft_expiration&&(0,y.default)().isAfter(e?.draft_expiration)&&v.default.fire({icon:`warning`,title:r.t(`warning`),html:r.t(`expired_meeting`)})}},[i]),(0,d.useEffect)(()=>{let e=t?.dataValue??t?.getValue();if(!C.length||ee||e?.from_time||e?.to_time)return;let n=C[0];n&&(k(n.value),B(n.value))},[C,ee,t?.dataValue]),(0,d.useEffect)(()=>{if(A&&m===!1){let e=t?.dataValue??t?.getValue();re(JSON.stringify({date:A,calendar_ids:e.calendar.id}))}},[A]);let se=()=>window.innerWidth>768?`timeGridWeek`:`timeGridDay`;(0,d.useEffect)(()=>{let e=()=>{let e=F.current;if(!e)return;let t=se();t!==e.getView().type&&e.setOption(`view`,t)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,d.useEffect)(()=>{let e=t?.dataValue??t?.getValue();D?.length&&e?.from_time&&(N((0,y.default)(e.from_time).format(`HH:mm`)+` - `+(0,y.default)(e.to_time).format(`HH:mm`)),S({day:(0,y.default)(e.from_time).format(`dddd D MMM YYYY`),startDate:(0,y.default)(e.from_time).format(`HH:mm`),endDate:(0,y.default)(e.to_time).format(`HH:mm`)}))},[D]);let ce=()=>{let e=at();F.current=(0,b.createCalendar)(P.current,[b.TimeGrid],{events:[],buttonText:{today:r.t(`Oggi`)},allDaySlot:!1,firstDay:1,date:e.date,slotEventOverlap:!1,view:se(),height:`400px`,views:{timeGridWeek:{allDaySlot:!1,firstDay:1,slotHeight:48},timeGridDay:{allDaySlot:!1,firstDay:1,slotHeight:48}},datesSet:e=>{it(e.view.type,e.start)},eventClick({event:e,el:i}){document.querySelectorAll(`.ec-event`).forEach(e=>{e.classList.remove(`highlighted-event`)}),i.classList.add(`highlighted-event`);let a=new Date(e.start),o=new Date(e.end),s=a.toLocaleDateString(`it-IT`,{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),c=a.toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}),l=o.toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}),u={status:6,calendar:e.extendedProps.calendar_id,opening_hour:e.extendedProps.opening_hour_id,user:null,email:null,fiscal_code:null,name:` `,phone_number:null,from_time:a,to_time:o,user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:t?.data?.service_data?.id,calendar_group_office_id:t?.data?.user_group?.id,calendar_group_place_id:t?.data?.place?.id};window.FormioHelper.authenticatedRequest(t?.dataValue?.id?`PATCH`:`POST`,t?.dataValue?.id?`meetings/${t.dataValue.id}`:`meetings`,u).then(e=>{let r;!e||e===``?r={...u,code:null,id:t?.dataValue?.id}:typeof e==`object`&&(r=e),S({day:s,startDate:c,endDate:l}),n(r)}).catch(e=>{console.error(e),e.status===400&&e?.response?.data?.type===`validation_error`?v.default.fire({title:``,html:`<p>`+r.t(`Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa`)+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},viewDidMount:le,eventDidMount:e=>{let{event:t,el:n}=e,r=t.extendedProps;n.setAttribute(`data-event-id`,t.id+`-`+r.date+`-`+r.start_time)},loading:e=>{p(e)}})},le=e=>{t?.root?.data?.place&&F.current.setOption(`eventSources`,[{events:ue}])};async function ue(e,n,i){try{F.current.setOption(`events`,[]);let i=(0,g.default)(e.start).format(`YYYY-MM-DD`),a=new Date(e.end);a.setDate(a.getDate()-1);let o=(0,g.default)(a).format(`YYYY-MM-DD`),s=t?.root?.data?.place?.merge_availabilities?t?.root?.data?.place?.merged_availabilities_link:null,c=s?R(s,i,o):z(i,o,null),l=tt(`AVAILABILITY`,c),u=et(`AVAILABILITY`,l),d;if(u?(d=u,p(!1)):(d=await window.FormioHelper.fetchAPIUrlLimit(c),$e(`AVAILABILITY`,l,d)),!d?.length){n([]),v.default.fire({icon:`warning`,title:r.t(`warning`),html:r.t(`no_meetings`)});return}let f=d.map(e=>({id:e.opening_hour_id,allDay:!1,start:`${e.date}T${e.start_time}:00`,end:`${e.date}T${e.end_time}:00`,title:`${e.start_time} - ${e.end_time}`,editable:!1,display:`auto`,color:`#ebeef0`,textColor:`#000`,className:`event-slot`,extendedProps:{...e}})),m=I(d);F.current.setOption(`slotMinTime`,m.earliestStartTime),F.current.setOption(`slotMaxTime`,m.latestEndTime),L(d),Ze(F.current,f),n(f),setTimeout(()=>{de(f)},500)}catch(e){console.error(`Errore nel caricamento disponibilità:`,e),i?.(e)}}(0,d.useEffect)(()=>{let i,a=!1;async function o(){try{if(await window.FormioInstance?.formReady,a)return;if(!P.current){console.warn(`Elemento calendario non trovato`);return}let i=t?.dataValue??t?.getValue();i&&i?.draft_expiration&&(0,y.default)().isAfter(i.draft_expiration)&&(n({}),ot()),t?.data?.service_data?.view_type===`calendar`||e.view===`calendar`?F?.current||ce():t?.data?.service_data?.view_type===`select`||e.view===`select`?oe():alert(r.t(`Il componente non è configurato per la visualizzazione a calendario`))}catch(e){console.error(`Errore durante l'inizializzazione del calendario:`,e)}}return i=setTimeout(o,500),()=>{a=!0,i&&clearTimeout(i),F.current&&=(P.current?.destroy?.(),null)}},[t?.root?.data?.place]);function de(e){let n=t?.dataValue;if(!n?.from_time)return;let r=(0,y.default)(n.from_time).format(`DD-MM-YYYY HH:mm`),i=(0,y.default)(n.to_time).format(`DD-MM-YYYY HH:mm`),a=e.find(e=>(0,y.default)(e.start).format(`DD-MM-YYYY HH:mm`)===r&&(0,y.default)(e.end).format(`DD-MM-YYYY HH:mm`)===i);if(!a)return;let o=document.querySelector(`.ec-event[data-event-id="${a.id}-${(0,y.default)(n?.from_time).format(`YYYY-MM-DD`)}-${(0,y.default)(n?.from_time).format(`HH:mm`)}"]`);o&&(o.classList.add(`highlighted-event`),o.scrollIntoView({behavior:`smooth`,block:`center`}),S({day:(0,y.default)(n?.from_time).format(`dddd, DD MMMM YYYY`),startDate:(0,y.default)(n?.from_time).format(`HH:mm`),endDate:(0,y.default)(n?.to_time).format(`HH:mm`)}))}return(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&m===!1?h(!0):(t?.data?.service_data?.view_type===`select`?oe():t?.data?.service_data?.view_type===`calendar`&&ce(),h(!1))},[]),(0,d.useEffect)(()=>{m&&setTimeout(()=>{let e=t?.dataValue??t?.getValue();console.log(`savedValue`,e,m),e&&s(e)},500)},[m]),(0,f.jsx)(f.Fragment,{children:m&&o?(0,f.jsxs)(`div`,{className:`mx-2`,children:[(0,f.jsxs)(`p`,{className:`text-paragraph`,children:[r.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,f.jsx)(`div`,{className:``,children:(0,f.jsx)(`div`,{className:`it-list-wrapper`,children:(0,f.jsx)(`ul`,{className:`it-list`,children:(0,f.jsx)(Xe,{day:(0,y.default)(o.from_time).format(`dddd D MMM YYYY`),i18next:r,slot:`${(0,y.default)(o.from_time).format(`HH:mm`)} - ${(0,y.default)(o.to_time).format(`HH:mm`)}`})})})})]}):(0,f.jsxs)(`div`,{className:``,children:[(0,f.jsx)(`div`,{ref:P}),C.length>0?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(_.Select,{label:`Mese`,id:`selectMonthYear`,onChange:B,children:[(0,f.jsx)(`option`,{value:``,children:r.t(`Scegli un'opzione`)}),C.map(e=>(0,f.jsx)(`option`,{value:e.value,selected:e.value===ee,children:e.label},e.value))]}),(0,f.jsxs)(_.Select,{label:`Giorno`,id:`selectDay`,onChange:e=>re(e,`manual`),disabled:T.length===0,children:[(0,f.jsx)(`option`,{value:``,children:r.t(`Scegli un'opzione`)}),T.map(e=>(0,f.jsx)(`option`,{value:JSON.stringify(e),selected:e.date===A,children:(0,y.default)(e.date).format(`dddd,DD MMMM YYYY`)},e.date))]}),(0,f.jsxs)(_.Select,{label:`Orario`,id:`selectSlot`,onChange:ie,disabled:D.length===0,children:[(0,f.jsx)(`option`,{value:``,children:r.t(`Scegli un'opzione`)}),D.map(e=>(0,f.jsx)(`option`,{value:JSON.stringify(e),selected:e.start_time+` - `+e.end_time===te,children:e.start_time+` - `+e.end_time},e.start_time+` - `+e.end_time))]})]}):null,x?(({day:e,startDate:t,endDate:n})=>(0,f.jsx)(`div`,{className:`mt-3`,children:(0,f.jsxs)(`div`,{className:`row align-items-center gy-3`,children:[(0,f.jsxs)(`div`,{className:`col-12 col-md border-light mx-md-3`,children:[(0,f.jsx)(`div`,{className:`text-paragraph-small`,children:r.t(`Data`)}),(0,f.jsx)(`p`,{className:`data-text`,children:(0,f.jsx)(`strong`,{children:e})})]}),(0,f.jsxs)(`div`,{className:`col-12 col-md border-light mx-md-3`,children:[(0,f.jsx)(`div`,{className:`text-paragraph-small`,children:r.t(`Ora`)}),(0,f.jsx)(`p`,{className:`data-text`,children:(0,f.jsxs)(`strong`,{children:[t,` - `,n]})})]})]})}))({day:x.day,startDate:x.startDate,endDate:x.endDate}):null,u?(0,f.jsx)(`div`,{className:`d-flex align-items-center justify-content-center position-absolute-center`,children:(0,f.jsx)(_.Spinner,{active:!0})}):null]})})},ct=class e extends J{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Calendar Advanced`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return J.schema({type:`calendar-advanced`})}static editForm=Ye;attach(e,t){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent&&=(this.rootComponent.unmount(),null),this.rootComponent=(0,u.createRoot)(e),this.builderMode?(this.rootComponent.render((0,f.jsx)(`div`,{className:`my-1 border border-2 border-light rounded p-3 text-secondary`,children:(0,f.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`Calendar Advanced`})})),this):(this.rootComponent.render((0,f.jsx)(st,{ref:t,component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this)):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){e&&(this.updateValue(e),this.shouldSetValue=!0)}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},lt=[{key:`defaultValue`,ignore:!0}],ut=[{key:`placeholder`,ignore:!0},{type:`checkbox`,label:`Files Synchronization feature`,tooltip:`Enable ability to control files synchronization. Files will be auto synced before submit.`,key:`autoSync`,input:!0,conditional:{json:{in:[{var:`data.storage`},[`s3`,`azure`,`googledrive`]]}}}],dt=[{type:`select`,input:!0,key:`storage`,label:`Storage`,placeholder:`Select your file storage provider`,weight:0,tooltip:`Which storage to save the files in.`,valueProperty:`value`,dataSrc:`custom`,hidden:!0,data:{custom:function(){return[{label:`url`,value:`url`}]}}},{type:`checkbox`,input:!0,defaultValue:!0,key:`protocol_required`,label:`Richiede protocollazione?`,tooltip:``,weight:10},{type:`checkbox`,input:!0,defaultValue:!1,key:`check_signature`,label:`Effettuare il controllo della firma?`,tooltip:``,weight:15},{type:`checkbox`,input:!0,key:`useMultipartUpload`,label:`Use the S3 Multipart Upload API`,tooltip:`The <a href='https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html'>S3 Multipart Upload API</a> is designed to improve the upload experience for larger objects (> 5GB).`,conditional:{json:{"===":[{var:`data.storage`},`s3`]}}},{label:`Multipart Upload`,tableView:!1,key:`multipart`,type:`container`,input:!0,components:[{label:`Part Size (MB)`,applyMaskOn:`change`,mask:!1,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:`plain`,truncateMultipleSpaces:!1,validate:{min:5,max:5e3},key:`partSize`,type:`number`,input:!0,defaultValue:500}],conditional:{json:{"===":[{var:`data.useMultipartUpload`},!0]}}},{type:`textfield`,input:!0,key:`options.indexeddb`,label:`Database`,weight:10,placeholder:`Enter the indexeddb database name`,conditional:{json:{in:[{var:`data.storage`},[`indexeddb`]]}}},{type:`textfield`,input:!0,label:`Table`,key:`options.indexeddbTable`,weight:10,placeholder:`Enter the name for indexeddb table`,conditional:{json:{in:[{var:`data.storage`},[`indexeddb`]]}}},{type:`textarea`,key:`options`,label:`Custom request options`,tooltip:`Pass your custom xhr options(optional)`,rows:5,editor:`ace`,input:!0,weight:15,placeholder:`{
67
67
  "withCredentials": true,
68
68
  "headers": {
69
69
  "Authorization": "Basic <key>"
70
70
  }
71
- }`,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`fileKey`,label:`File form-data key`,weight:17,placeholder:`Enter the key name of a file for form data.`,tooltip:`Key name that you would like to modify for the file while calling API request.`,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`dir`,label:`Directory`,placeholder:`(optional) Enter a directory for the files`,tooltip:`This will place all the files uploaded in this field in the directory`,weight:20,conditional:{json:{"!==":[{var:`data.storage`},`googledrive`]}}},{type:`textfield`,input:!0,key:`dir`,label:`Folder ID`,placeholder:`(optional) Enter an ID of the folder for the files`,tooltip:`This will place all the files uploaded in this field in the folder`,weight:20,conditional:{json:{"===":[{var:`data.storage`},`googledrive`]}}},{type:`textfield`,input:!0,key:`fileNameTemplate`,label:`File Name Template`,placeholder:`(optional) { {name} }-{ {guid} }"`,tooltip:"Specify template for name of uploaded file(s). Regular template variables are available (`data`, `component`, `user`, `value`, `moment` etc.), also `fileName`, `guid` variables are available. `guid` part must be present, if not found in template, will be added at the end.",weight:25},{type:`checkbox`,input:!0,key:`image`,label:`Display as image(s)`,tooltip:`Instead of a list of linked files, images will be rendered in the view.`,weight:30},{type:`checkbox`,input:!0,key:`uploadOnly`,label:`Upload Only`,tooltip:`When this is checked, will only allow you to upload file(s) and consequently the download, in this component, will be unavailable.`,weight:33},{type:`checkbox`,input:!0,key:`privateDownload`,label:`Private Download`,tooltip:`When this is checked, the file download will send a POST request to the download URL with the x-jwt-token header. This will allow your endpoint to create a Private download system.`,weight:31,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`imageSize`,label:`Image Size`,placeholder:`100`,tooltip:`The image size for previewing images.`,weight:40,conditional:{json:{"==":[{var:`data.image`},!0]}}},{type:`textfield`,input:!0,key:`maxFiles`,label:`Numero massimo di file`,placeholder:`100`,tooltip:`Numero massimo di file caricabilii, default è 100.`,weight:40},{type:`checkbox`,input:!0,key:`webcam`,label:`Enable web camera`,tooltip:`This will allow using an attached camera to directly take a picture instead of uploading an existing file.`,weight:32},{type:`textfield`,input:!0,key:`webcamSize`,label:`Webcam Width`,placeholder:`320`,tooltip:`The webcam size for taking pictures.`,weight:38,conditional:{json:{"==":[{var:`data.webcam`},!0]}}},{type:`datagrid`,input:!0,label:`File Types`,key:`fileTypes`,tooltip:`Specify file types to classify the uploads. This is useful if you allow multiple types of uploads but want to allow the user to specify which type of file each is.`,weight:11,components:[{label:`Label`,key:`label`,input:!0,type:`textfield`},{label:`Value`,key:`value`,input:!0,type:`textfield`}]},{type:`textfield`,input:!0,key:`filePattern`,label:`File Pattern`,placeholder:`.jpg,video/*,application/pdf`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file patterns.`,weight:50},{type:`textfield`,input:!0,key:`fileMinSize`,label:`File Minimum Size`,placeholder:`1MB`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.`,weight:60},{type:`textfield`,input:!0,key:`fileMaxSize`,label:`File Maximum Size`,placeholder:`10MB`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.`,weight:70},{type:`textfield`,input:!0,key:`maxFiles`,label:`Numero massimo di file`,placeholder:`100`,tooltip:`Numero massimo di file caricabilii, default è 100.`,weight:40}],dt=[{key:`unique`,ignore:!0},{key:`validateOn`,ignore:!0}];function ft(...e){return p.Components.baseEditForm([{key:`display`,components:lt},{key:`data`,components:ct},{label:`File`,key:`file`,weight:5,components:ut},{key:`validation`,components:dt}],...e)}var pt=o(((e,t)=>{t.exports=Array.isArray})),mt=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),ht=o(((e,t)=>{var n=mt(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),gt=o(((e,t)=>{t.exports=ht().Symbol})),_t=o(((e,t)=>{var n=gt(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),vt=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),yt=o(((e,t)=>{var n=gt(),r=_t(),i=vt(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),bt=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),xt=o(((e,t)=>{var n=yt(),r=bt(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),St=o(((e,t)=>{var n=pt(),r=xt(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Ct=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),wt=o(((e,t)=>{var n=yt(),r=Ct(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Tt=o(((e,t)=>{t.exports=ht()[`__core-js_shared__`]})),Et=o(((e,t)=>{var n=Tt(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Dt=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Ot=o(((e,t)=>{var n=wt(),r=Et(),i=Ct(),a=Dt(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),kt=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),At=o(((e,t)=>{var n=Ot(),r=kt();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),jt=o(((e,t)=>{t.exports=At()(Object,`create`)})),Mt=o(((e,t)=>{var n=jt();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Nt=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Pt=o(((e,t)=>{var n=jt(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Ft=o(((e,t)=>{var n=jt(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),It=o(((e,t)=>{var n=jt(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),Lt=o(((e,t)=>{var n=Mt(),r=Nt(),i=Pt(),a=Ft(),o=It();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Rt=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),zt=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Bt=o(((e,t)=>{var n=zt();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Vt=o(((e,t)=>{var n=Bt(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Ht=o(((e,t)=>{var n=Bt();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Ut=o(((e,t)=>{var n=Bt();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Wt=o(((e,t)=>{var n=Bt();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Gt=o(((e,t)=>{var n=Rt(),r=Vt(),i=Ht(),a=Ut(),o=Wt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Kt=o(((e,t)=>{t.exports=At()(ht(),`Map`)})),qt=o(((e,t)=>{var n=Lt(),r=Gt(),i=Kt();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Jt=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Yt=o(((e,t)=>{var n=Jt();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Xt=o(((e,t)=>{var n=Yt();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),Zt=o(((e,t)=>{var n=Yt();function r(e){return n(this,e).get(e)}t.exports=r})),Qt=o(((e,t)=>{var n=Yt();function r(e){return n(this,e).has(e)}t.exports=r})),$t=o(((e,t)=>{var n=Yt();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),en=o(((e,t)=>{var n=qt(),r=Xt(),i=Zt(),a=Qt(),o=$t();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),tn=o(((e,t)=>{var n=en(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),nn=o(((e,t)=>{var n=tn(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),rn=o(((e,t)=>{var n=nn(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),an=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),on=o(((e,t)=>{var n=gt(),r=an(),i=pt(),a=xt(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),sn=o(((e,t)=>{var n=on();function r(e){return e==null?``:n(e)}t.exports=r})),cn=o(((e,t)=>{var n=pt(),r=St(),i=rn(),a=sn();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),ln=o(((e,t)=>{var n=xt(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),un=o(((e,t)=>{var n=cn(),r=ln();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),dn=o(((e,t)=>{var n=un();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),Y=o(((e,t)=>{var n=At();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),fn=o(((e,t)=>{var n=Y();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),pn=o(((e,t)=>{var n=fn(),r=zt(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),mn=o(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),hn=o(((e,t)=>{var n=pn(),r=cn(),i=mn(),a=Ct(),o=ln();function s(e,t,s,c){if(!a(e))return e;t=r(t,e);for(var l=-1,u=t.length,d=u-1,f=e;f!=null&&++l<u;){var p=o(t[l]),m=s;if(p===`__proto__`||p===`constructor`||p===`prototype`)return e;if(l!=d){var h=f[p];m=c?c(h,p,f):void 0,m===void 0&&(m=a(h)?h:i(t[l+1])?[]:{})}n(f,p,m),f=f[p]}return e}t.exports=s})),gn=c(o(((e,t)=>{var n=hn();function r(e,t,r){return e==null?e:n(e,t,r)}t.exports=r}))(),1),_n=c(dn(),1);document.documentElement.lang.toString();var vn=class{constructor(){this.token=null,this.basePath=null,this.init()}init(){this.token=null,this.basePath=j()}async getSessionAuthToken(){let e=this;await S.default.get(e.basePath+`/api/session-auth`).then(t=>{e.token=t.data.token}).catch(e=>{v.default.fire(`'error_message_detail`,`'auth_error'`,`error`)})}getSessionAuthTokenPromise(){let e=this;return new Promise(async(t,n)=>{Re(`auth-token`)?t({token:Re(`auth-token`)}):await S.default.get(e.basePath+`/api/session-auth?with-cookie=true`,{withCredentials:!0,headers:{"Content-Type":`application/json; charset=utf-8`}}).then(e=>{let t=(0,T.jwtDecode)(e.data.token);t.exp&&ze(`auth-token`,e.data.token,t.exp)}).catch(e=>{console.log(e)})})}getToken(){return this.token}execAuthenticatedCall(e){this.token?e(this.token):this.getSessionAuthTokenPromise().then(t=>{this.token=t.token,e(this.token)})}},yn=l.Formio.Components.components.file,bn=null;document.querySelector(`widget-formio`)!==null&&(bn=document.querySelector(`widget-formio`).getAttribute(`signature-check-ws-url`));var xn=({component:e,current:t,onChange:n,i18next:r})=>{let[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(new Map),[c,l]=(0,d.useState)(!1),u=new vn;(0,d.useEffect)(()=>{u.getSessionAuthTokenPromise()},[]);let p=(e,t)=>{s(n=>{let r=new Map(n);return r.set(e,{...t,progress:Number(t?.progress)||0}),r})};function m(t){return t.size>(M(e.fileMaxSize)||M(`1GB`))?{code:`size-files`,message:`${r.t(`I file non possono superare le dimensioni di`)} ${e.fileMaxSize?e.fileMaxSize:`1GB`}`}:i.length>=(e.maxFiles?parseInt(e.maxFiles):e.multiple?100:1)?{code:`too-many-files`,message:`${r.t(`Puoi caricare massimo `)} ${e.maxFiles||100} ${r.t(`file`)}`}:t.size<M(e.fileMinSize)?{code:`file-too-small`,message:`${r.t(`I file devono avare una dimensione superiore a `)} ${e.fileMinSize}`}:null}function h(){if(e.filePattern){let t=e.filePattern.split(`,`).map(e=>e.trim()).filter(Boolean).reduce((e,t)=>{let n=t.startsWith(`.`)?t:`.${t}`,r=C.default.getType(n);return r?(e[r]||(e[r]=[]),e[r].push(n),e):e},{});return Object.keys(t).length?t:void 0}else return!0}let g=e=>{let t={};return t.originalName=e.originalName?e.originalName:e.name,t.name=e.name,t.url=e.url,t.data=e.data,t.signature_validation=e.signature_validation,t.mime_type=e.mime_type,t.storage=`url`,t.size=e.size,t},{getRootProps:y,getInputProps:b,fileRejections:T,isDragActive:E,open:D}=(0,x.useDropzone)({onDrop:e=>{e.map(e=>{A(e).then(e=>{})})},maxFiles:e.maxFiles?parseInt(e.maxFiles)-i.length:e.multiple?100:1,validator:m,accept:h()}),O=e=>{let t=j()+`/api/attachments/`+e.data.id;fetch(t,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${Re(`auth-token`)}`},strictErrors:!0}).then(()=>{a(t=>{let r=t.filter(t=>t.data.id!==e.data.id);return n(r),r})}).catch(e=>{v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori durante l'eliminazione del file`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),console.error(e)})},k=()=>{let e=typeof t?.getCurrentValue==`function`?t.getCurrentValue():t?.dataValue;e?.length>0&&(a(e),setTimeout(()=>{n(e)},100))};(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&c===!1?(l(!0),setTimeout(()=>{k()},1e3)):(l(!1),setTimeout(()=>{k()},1e3))},[]);async function A(i){let o,c=j()+`/it/upload`,l={mime_type:i.type,name:i.name,original_filename:i.name,protocol_required:e.protocol_required,size:i.size};return await S.default.post(c,l,{maxContentLength:1/0,maxBodyLength:1/0}).then(async c=>(o=c.data.id,i.url=j()+`/it/allegati/`+o,i.storage=`url`,i.mime_type=i.type,i.protocol_required=e.protocol_required,i.data={...c.data,baseUrl:j()+`/it/allegati/`+o},p(o,i),await S.default.put(c.data.uri,i,{onUploadProgress:e=>{let t=Math.round(e.loaded*100/e.total);s(e=>{let n=new Map(e),r=i;return r.progress=parseInt(t),n.has(o)&&n.set(o,r),n})},maxContentLength:1/0,maxBodyLength:1/0,headers:{"Content-Type":`multipart/form-data`}}).then(async c=>{let l=c.headers.etag.replace(/\\|"/gi,``)||null;return await S.default.put(j()+`/it/upload/`+o,{file_hash:l,check_signature:e.check_signature}).then(async r=>{s(e=>{let t=new Map(e);return t.delete(o),t});let c=t.dataValue||[],l=null;if(a(e=>{let t=[...e,g(i)];return l=t.length-1,n(t),t}),e.check_signature&&r.data.url&&bn)return await S.default.post(bn,{url:r.data.url,content:null},{headers:{"Content-Type":`application/json`}}).then(e=>{i.signature_validation=e.data.sign,c[l].signature_validation=e.data.sign}).catch(e=>{c[l].signature_validation=`File validation error: `+e});s(e=>{let t=new Map(e);return t.delete(o),t})}).catch(e=>{s(e=>{let t=new Map(e);return t.delete(o),t}),console.log(e),v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})}).catch(e=>{s(e=>{let t=new Map(e);return t.delete(o),t}),console.log(e),v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})}))).catch(e=>{console.log(e),v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),s(e=>{let t=new Map(e);return t.delete(o),t})})}function M(e){if(typeof e==`string`){if(e.search(/kb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024);if(e.search(/mb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024*1024);if(e.search(/gb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024*1024*1024);if(e.search(/b/i)===e.length-1||e.search(/s/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/m/i)===e.length-1)return parseFloat(e.substring(0,e.length-1)*60);if(e.search(/h/i)===e.length-1)return parseFloat(e.substring(0,e.length-1)*3600)}return e}function N(e,t=2){if(!+e)return`0 Bytes`;let n=1024,r=t<0?0:t,i=[`Bytes`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],a=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/n**+a).toFixed(r))} ${i[a]}`}return t.conditionallyHidden()||t.visible===!1?null:(0,f.jsx)(f.Fragment,{children:c?(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`label`,{className:`col-form-label floating-label`,htmlFor:`${e.id}-${e.key}`,children:[e.label,e.validate.required&&(0,f.jsx)(`span`,{className:`text-danger`})]}),(0,f.jsxs)(`ul`,{className:`upload-file-list`,children:[i.map((e,t)=>(0,f.jsxs)(`li`,{className:`upload-file success mw-100`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,f.jsxs)(`p`,{children:[(0,f.jsx)(`span`,{className:`visually-hidden`,children:r.t(`File caricato:`)}),e.name,(0,f.jsx)(`span`,{className:`upload-file-weight`,children:N(e.size)})]})]},e.size+t)),i.length<1&&(0,f.jsxs)(`li`,{className:`upload-file text-secondary mw-100`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`light`,icon:`it-files`,title:`Icona file`,size:`sm`}),(0,f.jsx)(`p`,{children:r.t(`Nessun elemento`)})]})]})]}):(0,f.jsxs)(f.Fragment,{children:[e.hideLabel||e.hidden?``:(0,f.jsxs)(`label`,{className:`col-form-label floating-label`,htmlFor:`${e.id}-${e.key}`,title:e.tooltip||void 0,children:[e.label,e.validate.required&&(0,f.jsx)(`span`,{className:`text-danger`}),e.tooltip&&(0,f.jsx)(`i`,{tabIndex:0,className:`bi bi-question-circle text-muted ms-1`,"data-tooltip":e.tooltip,"aria-expanded":`false`})]}),(0,f.jsxs)(`div`,{className:`my-1 border-2 border-light file-uploader-box rounded p-3 text-secondary${E?` dragover`:``}`,style:{border:`dashed`},...y({onClick:e=>e.stopPropagation()}),children:[(0,f.jsx)(`input`,{id:`${e.id}-${e.key}`,"aria-describedby":`file-uploader-description-${e.id}-${e.key}`,...b()}),(0,f.jsxs)(`div`,{className:`upload-dragdrop${E?` dragover`:``}`,children:[(0,f.jsx)(`div`,{className:`ms-1 me-3`,children:(0,f.jsx)(_.Icon,{color:`secondary`,icon:`it-upload`,title:r.t(`Carica file`),size:`_sm`})}),(0,f.jsxs)(`div`,{className:`upload-dragdrop-text`,children:[(0,f.jsx)(`div`,{className:`h5`,id:`file-uploader-description-${e.id}-${e.key}`,children:r.t(`Trascina il file per caricarlo`)}),(0,f.jsxs)(`p`,{className:`d-inline-flex`,children:[r.t(`oppure`),(0,f.jsx)(_.Button,{tag:`input`,type:`button`,value:r.t(`selezionalo dal dispositivo`),onClick:D,className:`px-1 py-0 text-decoration-underline primary-color`,size:`xs`})]})]})]})]}),(0,f.jsx)(`div`,{dangerouslySetInnerHTML:{__html:w.default.sanitize(e.description||``)}}),(0,f.jsxs)(`ul`,{className:`upload-file-list my-0`,children:[i.map((e,t)=>(0,f.jsxs)(`li`,{className:`upload-file success`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,f.jsxs)(`p`,{children:[(0,f.jsx)(`span`,{className:`visually-hidden`,children:r.t(`File caricato:`)}),e.name,(0,f.jsx)(`span`,{className:`upload-file-weight`,children:N(e.size)})]}),(0,f.jsx)(_.Button,{className:`px-1`,onClick:()=>O(e),children:(0,f.jsx)(_.Icon,{title:`${r.t(`Elimina file caricato`)} ${e.name}`,color:`secondary`,icon:`it-delete`,className:`ms-auto pointer`,size:`sm`})})]},e.size+t)),Array.from(o.entries()).map(([e,t])=>(0,f.jsxs)(`li`,{className:`upload-file success`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,f.jsxs)(`p`,{children:[(0,f.jsx)(`span`,{className:`visually-hidden`,children:r.t(`Caricamento file:`)}),t.name,(0,f.jsx)(`span`,{className:`upload-file-weight`,children:N(t.size)})]}),(0,f.jsx)(_.Progress,{value:Number(t?.progress)||0})]},e))]}),!!(T&&T.length)&&(0,f.jsx)(`div`,{className:`formio-error-wrapper`,children:(0,f.jsx)(`ul`,{className:`formio-errors upload-file-list my-0 `,children:T.map(({file:t,errors:n},i)=>(0,f.jsxs)(`li`,{className:`upload-file error`,children:[(0,f.jsxs)(`div`,{className:`upload-file-name-error-wrapper`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`error`,icon:`it-error`,title:`Icona file`,size:`sm`}),(0,f.jsxs)(`p`,{className:`text-wrap error`,children:[(0,f.jsx)(`span`,{className:`visually-hidden`,children:r.t(`Errore caricamento file:`)}),t.name,(0,f.jsx)(`span`,{className:`upload-file-weight`,children:N(t.size)})]})]}),(0,f.jsx)(`div`,{children:n.map(t=>t.code===`file-invalid-type`?(0,f.jsxs)(`p`,{className:`text-wrap ms-0`,children:[r.t(`I file possono essere di tipo `),e.filePattern]}):t.code===`too-many-files`?(0,f.jsxs)(`p`,{className:`text-wrap ms-0`,children:[r.t(`Puoi caricare massimo `),` `,e.maxFiles?e.maxFiles:e.multiple?100:1,` `,r.t(`file`)]}):(0,f.jsx)(`p`,{className:`text-wrap ms-0`,children:t.message}))})]},t.size+i))})})]})})},Sn=class e extends yn{constructor(e,t,n){super({...e,clearOnHide:!1},t,n),this.reactRef=null,this.lastRenderedVisible=void 0,this.rootComponent=null,this.mountNode=null}static get builderInfo(){return{title:`File Sdc`,group:`basic`,icon:`bi bi-file-earmark-text`,documentation:``,weight:70,schema:e.schema()}}get emptyValue(){return[]}init(){if(super.init(),this.component?.multiple&&!Array.isArray(this.getCurrentValue())){this.dataValue=[];let e=this.path||this.component?.key;e&&this.rootValue&&(0,gn.default)(this.rootValue,e,[])}}static schema(){return yn.schema({type:`sdcfile`,modelType:`array`})}static editForm=ft;getI18next(){return this.i18next&&typeof this.i18next.t==`function`?this.i18next:{language:this.options?.language||document?.documentElement?.lang||`it`,t:(e,t)=>this.t(e,t)}}hideFileProcessingLoader(){this.refs?.fileProcessingLoader&&(this.refs.fileProcessingLoader.style.display=`none`)}renderReact(){if(this.rootComponent){if(this.builderMode){this.rootComponent.render((0,f.jsx)(`div`,{className:`my-1 border border-2 border-light file-uploader-box rounded p-3 text-secondary`,children:(0,f.jsx)(`div`,{className:`upload-dragdrop`,children:(0,f.jsx)(`div`,{className:`upload-dragdrop-text`,children:(0,f.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`File Sdc`})})})}));return}this.rootComponent.render((0,f.jsx)(xn,{component:this.component,current:this,i18next:this.getI18next(),onChange:e=>this.updateValueFromReact(e)}))}}attach(e){let t=super.attach(e);this.hideFileProcessingLoader();let n=`react-${this.id}`;this.loadRefs(e,{[n]:`single`});let r=this.refs[n];return r?(this.rootComponent&&this.mountNode!==r&&(this.rootComponent.unmount(),this.rootComponent=null),this.rootComponent||=(0,u.createRoot)(r),this.mountNode=r,this.lastRenderedVisible=this.visible,this.renderReact(),t):t}updateValueFromReact(e,t={modified:!0}){let n=this.normalizeValue(e,t),r=this.updateValue(n,t),i=this.path||this.component?.key;if(i&&this.rootValue){let e=(0,_n.default)(this.rootValue,i);this.isEqual(e,n)||(0,gn.default)(this.rootValue,i,n)}return r}setValue(e,t={}){let n=this.normalizeValue(e,t),r=super.setValue(n,t),i=this.path||this.component?.key;if(i&&this.rootValue){let e=(0,_n.default)(this.rootValue,i);this.isEqual(e,n)||(0,gn.default)(this.rootValue,i,n)}return r}normalizeValue(e,t={}){let n=super.normalizeValue(e,t);return!this.component?.multiple||Array.isArray(n)?n:n==null||n===``?[]:[n]}detach(){return this.hideFileProcessingLoader(),this.rootComponent&&=(this.rootComponent.unmount(),null),this.mountNode=null,super.detach()}getValue(){return this.getCurrentValue()}get validationValue(){return this.getCurrentValue()}getCurrentValue(){let e=super.getValue(),t=this.path||this.component?.key,n=t&&this.rootValue?(0,_n.default)(this.rootValue,t):void 0;return this.component?.multiple?Array.isArray(e)&&e.length>0?e:Array.isArray(n)?n:[]:e??n??null}isEmpty(e=this.validationValue){return this.component?.multiple?!Array.isArray(e)||e.length===0:e==null||e===``}checkCondition(e,t){let n=super.checkCondition(e,t),r=this.visible;return this.lastRenderedVisible!==r&&(this.lastRenderedVisible=r,this.renderReact()),n}render(){let e=`<div ref="react-${this.id}"></div>`;return Object.getPrototypeOf(Object.getPrototypeOf(yn.prototype)).render.call(this,e)}},Cn=[{key:`labelPosition`,ignore:!0},{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0}];function wn(...e){return p.Components.baseEditForm([{key:`display`,components:Cn}],...e)}var Tn=o(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(require(`react`)):typeof define==`function`&&define.amd?define(`Autocomplete`,[`react`],r):typeof e==`object`?e.Autocomplete=r(require(`react`)):n.Autocomplete=r(n.React)})(e,(function(e){return function(){"use strict";var t={680:function(t){t.exports=e},8952:function(e,t,n){var r=n(4328),i=n(36),a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not a function`)}},2096:function(e,t,n){var r=n(2424),i=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(`Can't set `+i(e)+` as a prototype`)}},4764:function(e,t,n){var r=n(9764).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},6100:function(e,t,n){var r=n(7e3),i=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new i(`Incorrect invocation`)}},3951:function(e,t,n){var r=n(1632),i=String,a=TypeError;e.exports=function(e){if(r(e))return e;throw new a(i(e)+` is not an object`)}},2504:function(e,t,n){var r=n(4096),i=n(2495),a=n(3556),o=function(e){return function(t,n,o){var s=r(t),c=a(s);if(c===0)return!e&&-1;var l,u=i(o,c);if(e&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},3364:function(e,t,n){var r=n(8992),i=n(1664),a=n(5712),o=n(4356),s=n(3556),c=n(2568),l=i([].push),u=function(e){var t=e===1,n=e===2,i=e===3,u=e===4,d=e===6,f=e===7,p=e===5||d;return function(m,h,g,_){for(var v,y,b=o(m),x=a(b),S=s(x),C=r(h,g),w=0,T=_||c,E=t?T(m,S):n||f?T(m,0):void 0;S>w;w++)if((p||w in x)&&(y=C(v=x[w],w,b),e))if(t)E[w]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:l(E,v)}else switch(e){case 4:return!1;case 7:l(E,v)}return d?-1:i||u?u:E}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},953:function(e,t,n){var r=n(9957),i=n(9972),a=n(8504),o=i(`species`);e.exports=function(e){return a>=51||!r((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},t[e](Boolean).foo!==1}))}},1496:function(e,t,n){var r=n(9957);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},6728:function(e,t,n){var r=n(3476),i=n(1432),a=TypeError,o=Object.getOwnPropertyDescriptor;e.exports=r&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],`length`,{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(i(e)&&!o(e,`length`).writable)throw new a(`Cannot set read only .length`);return e.length=t}:function(e,t){return e.length=t}},6736:function(e,t,n){var r=n(1432),i=n(6072),a=n(1632),o=n(9972)(`species`),s=Array;e.exports=function(e){var t;return r(e)&&(t=e.constructor,(i(t)&&(t===s||r(t.prototype))||a(t)&&(t=t[o])===null)&&(t=void 0)),t===void 0?s:t}},2568:function(e,t,n){var r=n(6736);e.exports=function(e,t){return new(r(e))(t===0?0:t)}},8696:function(e,t,n){var r=n(3951),i=n(3112);e.exports=function(e,t,n,a){try{return a?t(r(n)[0],n[1]):t(n)}catch(t){i(e,`throw`,t)}}},1888:function(e,t,n){var r=n(1664),i=r({}.toString),a=r(``.slice);e.exports=function(e){return a(i(e),8,-1)}},4427:function(e,t,n){var r=n(16),i=n(4328),a=n(1888),o=n(9972)(`toStringTag`),s=Object,c=a(function(){return arguments}())===`Arguments`;e.exports=r?a:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=function(e,t){try{return e[t]}catch{}}(t=s(e),o))==`string`?n:c?a(t):(r=a(t))===`Object`&&i(t.callee)?`Arguments`:r}},9968:function(e,t,n){var r=n(5152),i=n(9252),a=n(9444),o=n(8352);e.exports=function(e,t,n){for(var s=i(t),c=o.f,l=a.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},2272:function(e,t,n){e.exports=!n(9957)((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},3336:function(e){e.exports=function(e,t){return{value:e,done:t}}},3440:function(e,t,n){var r=n(3476),i=n(8352),a=n(9728);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},9728:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},92:function(e,t,n){var r=n(3476),i=n(8352),a=n(9728);e.exports=function(e,t,n){r?i.f(e,t,a(0,n)):e[t]=n}},2544:function(e,t,n){var r=n(5312),i=n(8352);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}},6076:function(e,t,n){var r=n(4328),i=n(8352),a=n(5312),o=n(4636);e.exports=function(e,t,n,s){s||={};var c=s.enumerable,l=s.name===void 0?t:s.name;if(r(n)&&a(n,l,s),s.global)c?e[t]=n:o(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch{}c?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},4036:function(e,t,n){var r=n(6076);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},4636:function(e,t,n){var r=n(6420),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch{r[e]=t}return t}},3476:function(e,t,n){e.exports=!n(9957)((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}))},8168:function(e,t,n){var r=n(6420),i=n(1632),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},4316:function(e){var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t(`Maximum allowed index exceeded`);return e}},6064:function(e){e.exports=typeof navigator<`u`&&String(navigator.userAgent)||``},8504:function(e,t,n){var r,i,a=n(6420),o=n(6064),s=a.process,c=a.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(i=(r=u.split(`.`))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},8256:function(e){e.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]},6520:function(e,t,n){var r=n(1664),i=Error,a=r(``.replace),o=String(new i(`zxcasd`).stack),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(o);e.exports=function(e,t){if(c&&typeof e==`string`&&!i.prepareStackTrace)for(;t--;)e=a(e,s,``);return e}},3696:function(e,t,n){var r=n(3440),i=n(6520),a=n(9184),o=Error.captureStackTrace;e.exports=function(e,t,n,s){a&&(o?o(e,t):r(e,`stack`,i(n,s)))}},9184:function(e,t,n){var r=n(9957),i=n(9728);e.exports=!r((function(){var e=Error(`a`);return!(`stack`in e)||(Object.defineProperty(e,`stack`,i(1,7)),e.stack!==7)}))},9160:function(e,t,n){var r=n(6420),i=n(9444).f,a=n(3440),o=n(6076),s=n(4636),c=n(9968),l=n(6704);e.exports=function(e,t){var n,u,d,f,p,m=e.target,h=e.global,g=e.stat;if(n=h?r:g?r[m]||s(m,{}):r[m]&&r[m].prototype)for(u in t){if(f=t[u],d=e.dontCallGetSet?(p=i(n,u))&&p.value:n[u],!l(h?u:m+(g?`.`:`#`)+u,e.forced)&&d!==void 0){if(typeof f==typeof d)continue;c(f,d)}(e.sham||d&&d.sham)&&a(f,`sham`,!0),o(n,u,f,e)}}},9957:function(e){e.exports=function(e){try{return!!e()}catch{return!0}}},7176:function(e,t,n){n(880);var r=n(8448),i=n(6076),a=n(7680),o=n(9957),s=n(9972),c=n(3440),l=s(`species`),u=RegExp.prototype;e.exports=function(e,t,n,d){var f=s(e),p=!o((function(){var t={};return t[f]=function(){return 7},``[e](t)!==7})),m=p&&!o((function(){var t=!1,n=/a/;return e===`split`&&((n={}).constructor={},n.constructor[l]=function(){return n},n.flags=``,n[f]=/./[f]),n.exec=function(){return t=!0,null},n[f](``),!t}));if(!p||!m||n){var h=/./[f],g=t(f,``[e],(function(e,t,n,i,o){var s=t.exec;return s===a||s===u.exec?p&&!o?{done:!0,value:r(h,t,n,i)}:{done:!0,value:r(e,n,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(u,f,g[1])}d&&c(u[f],`sham`,!0)}},908:function(e,t,n){var r=n(7332),i=Function.prototype,a=i.apply,o=i.call;e.exports=typeof Reflect==`object`&&Reflect.apply||(r?o.bind(a):function(){return o.apply(a,arguments)})},8992:function(e,t,n){var r=n(3180),i=n(8952),a=n(7332),o=r(r.bind);e.exports=function(e,t){return i(e),t===void 0?e:a?o(e,t):function(){return e.apply(t,arguments)}}},7332:function(e,t,n){e.exports=!n(9957)((function(){var e=function(){}.bind();return typeof e!=`function`||e.hasOwnProperty(`prototype`)}))},8448:function(e,t,n){var r=n(7332),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},6208:function(e,t,n){var r=n(3476),i=n(5152),a=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,s=i(a,`name`);e.exports={EXISTS:s,PROPER:s&&function(){}.name===`something`,CONFIGURABLE:s&&(!r||r&&o(a,`name`).configurable)}},5288:function(e,t,n){var r=n(1664),i=n(8952);e.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}}},3180:function(e,t,n){var r=n(1888),i=n(1664);e.exports=function(e){if(r(e)===`Function`)return i(e)}},1664:function(e,t,n){var r=n(7332),i=Function.prototype,a=i.call,o=r&&i.bind.bind(a,a);e.exports=r?o:function(e){return function(){return a.apply(e,arguments)}}},5232:function(e,t,n){var r=n(6420),i=n(4328);e.exports=function(e,t){return arguments.length<2?(n=r[e],i(n)?n:void 0):r[e]&&r[e][t];var n}},6752:function(e){e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},4504:function(e,t,n){var r=n(8952),i=n(9760);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},6420:function(e,t,n){var r=function(e){return e&&e.Math===Math&&e};e.exports=r(typeof globalThis==`object`&&globalThis)||r(typeof window==`object`&&window)||r(typeof self==`object`&&self)||r(typeof n.g==`object`&&n.g)||r(typeof this==`object`&&this)||function(){return this}()||Function(`return this`)()},5152:function(e,t,n){var r=n(1664),i=n(4356),a=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},2560:function(e){e.exports={}},4168:function(e,t,n){e.exports=n(5232)(`document`,`documentElement`)},9888:function(e,t,n){var r=n(3476),i=n(9957),a=n(8168);e.exports=!r&&!i((function(){return Object.defineProperty(a(`div`),`a`,{get:function(){return 7}}).a!==7}))},5712:function(e,t,n){var r=n(1664),i=n(9957),a=n(1888),o=Object,s=r(``.split);e.exports=i((function(){return!o(`z`).propertyIsEnumerable(0)}))?function(e){return a(e)===`String`?s(e,``):o(e)}:o},7512:function(e,t,n){var r=n(4328),i=n(1632),a=n(4024);e.exports=function(e,t,n){var o,s;return a&&r(o=t.constructor)&&o!==n&&i(s=o.prototype)&&s!==n.prototype&&a(e,s),e}},9112:function(e,t,n){var r=n(1664),i=n(4328),a=n(3976),o=r(Function.toString);i(a.inspectSource)||(a.inspectSource=function(e){return o(e)}),e.exports=a.inspectSource},3480:function(e,t,n){var r=n(1632),i=n(3440);e.exports=function(e,t){r(t)&&`cause`in t&&i(e,`cause`,t.cause)}},9104:function(e,t,n){var r,i,a,o=n(4288),s=n(6420),c=n(1632),l=n(3440),u=n(5152),d=n(3976),f=n(6504),p=n(2560),m=`Object already initialized`,h=s.TypeError,g=s.WeakMap;if(o||d.state){var _=d.state||=new g;_.get=_.get,_.has=_.has,_.set=_.set,r=function(e,t){if(_.has(e))throw new h(m);return t.facade=e,_.set(e,t),t},i=function(e){return _.get(e)||{}},a=function(e){return _.has(e)}}else{var v=f(`state`);p[v]=!0,r=function(e,t){if(u(e,v))throw new h(m);return t.facade=e,l(e,v,t),t},i=function(e){return u(e,v)?e[v]:{}},a=function(e){return u(e,v)}}e.exports={set:r,get:i,has:a,enforce:function(e){return a(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=i(t)).type!==e)throw new h(`Incompatible receiver, `+e+` required`);return n}}}},1432:function(e,t,n){var r=n(1888);e.exports=Array.isArray||function(e){return r(e)===`Array`}},4328:function(e){var t=typeof document==`object`&&document.all;e.exports=t===void 0&&t!==void 0?function(e){return typeof e==`function`||e===t}:function(e){return typeof e==`function`}},6072:function(e,t,n){var r=n(1664),i=n(9957),a=n(4328),o=n(4427),s=n(5232),c=n(9112),l=function(){},u=s(`Reflect`,`construct`),d=/^\s*(?:class|function)\b/,f=r(d.exec),p=!d.test(l),m=function(e){if(!a(e))return!1;try{return u(l,[],e),!0}catch{return!1}},h=function(e){if(!a(e))return!1;switch(o(e)){case`AsyncFunction`:case`GeneratorFunction`:case`AsyncGeneratorFunction`:return!1}try{return p||!!f(d,c(e))}catch{return!0}};h.sham=!0,e.exports=!u||i((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?h:m},6704:function(e,t,n){var r=n(9957),i=n(4328),a=/#|\.prototype\./,o=function(e,t){var n=c[s(e)];return n===u||n!==l&&(i(t)?r(t):!!t)},s=o.normalize=function(e){return String(e).replace(a,`.`).toLowerCase()},c=o.data={},l=o.NATIVE=`N`,u=o.POLYFILL=`P`;e.exports=o},9760:function(e){e.exports=function(e){return e==null}},1632:function(e,t,n){var r=n(4328);e.exports=function(e){return typeof e==`object`?e!==null:r(e)}},2424:function(e,t,n){var r=n(1632);e.exports=function(e){return r(e)||e===null}},7048:function(e){e.exports=!1},7728:function(e,t,n){var r=n(5232),i=n(4328),a=n(7e3),o=n(6536),s=Object;e.exports=o?function(e){return typeof e==`symbol`}:function(e){var t=r(`Symbol`);return i(t)&&a(t.prototype,s(e))}},3112:function(e,t,n){var r=n(8448),i=n(3951),a=n(4504);e.exports=function(e,t,n){var o,s;i(e);try{if(!(o=a(e,`return`))){if(t===`throw`)throw n;return n}o=r(o,e)}catch(e){s=!0,o=e}if(t===`throw`)throw n;if(s)throw o;return i(o),n}},9724:function(e,t,n){var r=n(8448),i=n(9368),a=n(3440),o=n(4036),s=n(9972),c=n(9104),l=n(4504),u=n(336).IteratorPrototype,d=n(3336),f=n(3112),p=s(`toStringTag`),m=`IteratorHelper`,h=`WrapForValidIterator`,g=c.set,_=function(e){var t=c.getterFor(e?h:m);return o(i(u),{next:function(){var n=t(this);if(e)return n.nextHandler();try{return d(n.done?void 0:n.nextHandler(),n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),i=n.iterator;if(n.done=!0,e){var a=l(i,`return`);return a?r(a,i):d(void 0,!0)}if(n.inner)try{f(n.inner.iterator,`normal`)}catch(e){return f(i,`throw`,e)}return f(i,`normal`),d(void 0,!0)}})},v=_(!0),y=_(!1);a(y,p,`Iterator Helper`),e.exports=function(e,t){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=t?h:m,r.nextHandler=e,r.counter=0,r.done=!1,g(this,r)};return n.prototype=t?v:y,n}},5792:function(e,t,n){var r=n(8448),i=n(8952),a=n(3951),o=n(6752),s=n(9724),c=n(8696),l=s((function(){var e=this.iterator,t=a(r(this.next,e));if(!(this.done=!!t.done))return c(e,this.mapper,[t.value,this.counter++],!0)}));e.exports=function(e){return a(this),i(e),new l(o(this),{mapper:e})}},336:function(e,t,n){var r,i,a,o=n(9957),s=n(4328),c=n(1632),l=n(9368),u=n(7796),d=n(6076),f=n(9972),p=n(7048),m=f(`iterator`),h=!1;[].keys&&(`next`in(a=[].keys())?(i=u(u(a)))!==Object.prototype&&(r=i):h=!0),!c(r)||o((function(){var e={};return r[m].call(e)!==e}))?r={}:p&&(r=l(r)),s(r[m])||d(r,m,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},3556:function(e,t,n){var r=n(7584);e.exports=function(e){return r(e.length)}},5312:function(e,t,n){var r=n(1664),i=n(9957),a=n(4328),o=n(5152),s=n(3476),c=n(6208).CONFIGURABLE,l=n(9112),u=n(9104),d=u.enforce,f=u.get,p=String,m=Object.defineProperty,h=r(``.slice),g=r(``.replace),_=r([].join),v=s&&!i((function(){return m((function(){}),`length`,{value:8}).length!==8})),y=String(String).split(`String`),b=e.exports=function(e,t,n){h(p(t),0,7)===`Symbol(`&&(t=`[`+g(p(t),/^Symbol\(([^)]*)\).*$/,`$1`)+`]`),n&&n.getter&&(t=`get `+t),n&&n.setter&&(t=`set `+t),(!o(e,`name`)||c&&e.name!==t)&&(s?m(e,`name`,{value:t,configurable:!0}):e.name=t),v&&n&&o(n,`arity`)&&e.length!==n.arity&&m(e,`length`,{value:n.arity});try{n&&o(n,`constructor`)&&n.constructor?s&&m(e,`prototype`,{writable:!1}):e.prototype&&=void 0}catch{}var r=d(e);return o(r,`source`)||(r.source=_(y,typeof t==`string`?t:``)),e};Function.prototype.toString=b((function(){return a(this)&&f(this).source||l(this)}),`toString`)},1748:function(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},8948:function(e,t,n){var r=n(5016);e.exports=function(e,t){return e===void 0?arguments.length<2?``:t:r(e)}},9292:function(e,t,n){var r=n(3476),i=n(1664),a=n(8448),o=n(9957),s=n(1531),c=n(9392),l=n(8912),u=n(4356),d=n(5712),f=Object.assign,p=Object.defineProperty,m=i([].concat);e.exports=!f||o((function(){if(r&&f({b:1},f(p({},`a`,{enumerable:!0,get:function(){p(this,`b`,{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},n=Symbol(`assign detection`),i=`abcdefghijklmnopqrst`;return e[n]=7,i.split(``).forEach((function(e){t[e]=e})),f({},e)[n]!==7||s(f({},t)).join(``)!==i}))?function(e,t){for(var n=u(e),i=arguments.length,o=1,f=c.f,p=l.f;i>o;)for(var h,g=d(arguments[o++]),_=f?m(s(g),f(g)):s(g),v=_.length,y=0;v>y;)h=_[y++],r&&!a(p,g,h)||(n[h]=g[h]);return n}:f},9368:function(e,t,n){var r,i=n(3951),a=n(2056),o=n(8256),s=n(2560),c=n(4168),l=n(8168),u=n(6504),d=`prototype`,f=`script`,p=u(`IE_PROTO`),m=function(){},h=function(e){return`<`+f+`>`+e+`</`+f+`>`},g=function(e){e.write(h(``)),e.close();var t=e.parentWindow.Object;return e=null,t},_=function(){try{r=new ActiveXObject(`htmlfile`)}catch{}var e,t,n;_=typeof document<`u`?document.domain&&r?g(r):(t=l(`iframe`),n=`java`+f+`:`,t.style.display=`none`,c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(h(`document.F=Object`)),e.close(),e.F):g(r);for(var i=o.length;i--;)delete _[d][o[i]];return _()};s[p]=!0,e.exports=Object.create||function(e,t){var n;return e===null?n=_():(m[d]=i(e),n=new m,m[d]=null,n[p]=e),t===void 0?n:a.f(n,t)}},2056:function(e,t,n){var r=n(3476),i=n(1576),a=n(8352),o=n(3951),s=n(4096),c=n(1531);t.f=r&&!i?Object.defineProperties:function(e,t){o(e);for(var n,r=s(t),i=c(t),l=i.length,u=0;l>u;)a.f(e,n=i[u++],r[n]);return e}},8352:function(e,t,n){var r=n(3476),i=n(9888),a=n(1576),o=n(3951),s=n(88),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=`enumerable`,f=`configurable`,p=`writable`;t.f=r?a?function(e,t,n){if(o(e),t=s(t),o(n),typeof e==`function`&&t===`prototype`&&`value`in n&&p in n&&!n[p]){var r=u(e,t);r&&r[p]&&(e[t]=n.value,n={configurable:f in n?n[f]:r[f],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(o(e),t=s(t),o(n),i)try{return l(e,t,n)}catch{}if(`get`in n||`set`in n)throw new c(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e}},9444:function(e,t,n){var r=n(3476),i=n(8448),a=n(8912),o=n(9728),s=n(4096),c=n(88),l=n(5152),u=n(9888),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch{}if(l(e,t))return o(!i(a.f,e,t),e[t])}},5048:function(e,t,n){var r=n(9008),i=n(8256).concat(`length`,`prototype`);t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},9392:function(e,t){t.f=Object.getOwnPropertySymbols},7796:function(e,t,n){var r=n(5152),i=n(4328),a=n(4356),o=n(6504),s=n(2272),c=o(`IE_PROTO`),l=Object,u=l.prototype;e.exports=s?l.getPrototypeOf:function(e){var t=a(e);if(r(t,c))return t[c];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof l?u:null}},7e3:function(e,t,n){e.exports=n(1664)({}.isPrototypeOf)},9008:function(e,t,n){var r=n(1664),i=n(5152),a=n(4096),o=n(2504).indexOf,s=n(2560),c=r([].push);e.exports=function(e,t){var n,r=a(e),l=0,u=[];for(n in r)!i(s,n)&&i(r,n)&&c(u,n);for(;t.length>l;)i(r,n=t[l++])&&(~o(u,n)||c(u,n));return u}},1531:function(e,t,n){var r=n(9008),i=n(8256);e.exports=Object.keys||function(e){return r(e,i)}},8912:function(e,t){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor;t.f=r&&!n.call({1:2},1)?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},4024:function(e,t,n){var r=n(5288),i=n(3951),a=n(2096);e.exports=Object.setPrototypeOf||(`__proto__`in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,`__proto__`,`set`))(n,[]),t=n instanceof Array}catch{}return function(n,r){return i(n),a(r),t?e(n,r):n.__proto__=r,n}}():void 0)},7032:function(e,t,n){var r=n(16),i=n(4427);e.exports=r?{}.toString:function(){return`[object `+i(this)+`]`}},2104:function(e,t,n){var r=n(8448),i=n(4328),a=n(1632),o=TypeError;e.exports=function(e,t){var n,s;if(t===`string`&&i(n=e.toString)&&!a(s=r(n,e))||i(n=e.valueOf)&&!a(s=r(n,e))||t!==`string`&&i(n=e.toString)&&!a(s=r(n,e)))return s;throw new o(`Can't convert object to primitive value`)}},9252:function(e,t,n){var r=n(5232),i=n(1664),a=n(5048),o=n(9392),s=n(3951),c=i([].concat);e.exports=r(`Reflect`,`ownKeys`)||function(e){var t=a.f(s(e)),n=o.f;return n?c(t,n(e)):t}},584:function(e,t,n){var r=n(8352).f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},9092:function(e,t,n){var r=n(8448),i=n(3951),a=n(4328),o=n(1888),s=n(7680),c=TypeError;e.exports=function(e,t){var n=e.exec;if(a(n)){var l=r(n,e,t);return l!==null&&i(l),l}if(o(e)===`RegExp`)return r(s,e,t);throw new c(`RegExp#exec called on incompatible receiver`)}},7680:function(e,t,n){var r,i,a=n(8448),o=n(1664),s=n(5016),c=n(8872),l=n(3548),u=n(4696),d=n(9368),f=n(9104).get,p=n(8e3),m=n(9124),h=u(`native-string-replace`,String.prototype.replace),g=RegExp.prototype.exec,_=g,v=o(``.charAt),y=o(``.indexOf),b=o(``.replace),x=o(``.slice),S=(i=/b*/g,a(g,r=/a/,`a`),a(g,i,`a`),r.lastIndex!==0||i.lastIndex!==0),C=l.BROKEN_CARET,w=/()??/.exec(``)[1]!==void 0;(S||w||C||p||m)&&(_=function(e){var t,n,r,i,o,l,u,p=this,m=f(p),T=s(e),E=m.raw;if(E)return E.lastIndex=p.lastIndex,t=a(_,E,T),p.lastIndex=E.lastIndex,t;var D=m.groups,O=C&&p.sticky,k=a(c,p),A=p.source,j=0,M=T;if(O&&(k=b(k,`y`,``),y(k,`g`)===-1&&(k+=`g`),M=x(T,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&v(T,p.lastIndex-1)!==`
72
- `)&&(A=`(?: `+A+`)`,M=` `+M,j++),n=RegExp(`^(?:`+A+`)`,k)),w&&(n=RegExp(`^`+A+`$(?!\\s)`,k)),S&&(r=p.lastIndex),i=a(g,O?n:p,M),O?i?(i.input=x(i.input,j),i[0]=x(i[0],j),i.index=p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:S&&i&&(p.lastIndex=p.global?i.index+i[0].length:r),w&&i&&i.length>1&&a(h,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)arguments[o]===void 0&&(i[o]=void 0)})),i&&D)for(i.groups=l=d(null),o=0;o<D.length;o++)l[(u=D[o])[0]]=i[u[1]];return i}),e.exports=_},8872:function(e,t,n){var r=n(3951);e.exports=function(){var e=r(this),t=``;return e.hasIndices&&(t+=`d`),e.global&&(t+=`g`),e.ignoreCase&&(t+=`i`),e.multiline&&(t+=`m`),e.dotAll&&(t+=`s`),e.unicode&&(t+=`u`),e.unicodeSets&&(t+=`v`),e.sticky&&(t+=`y`),t}},3548:function(e,t,n){var r=n(9957),i=n(6420).RegExp,a=r((function(){var e=i(`a`,`y`);return e.lastIndex=2,e.exec(`abcd`)!==null})),o=a||r((function(){return!i(`a`,`y`).sticky}));e.exports={BROKEN_CARET:a||r((function(){var e=i(`^r`,`gy`);return e.lastIndex=2,e.exec(`str`)!==null})),MISSED_STICKY:o,UNSUPPORTED_Y:a}},8e3:function(e,t,n){var r=n(9957),i=n(6420).RegExp;e.exports=r((function(){var e=i(`.`,`s`);return!(e.dotAll&&e.test(`
73
- `)&&e.flags===`s`)}))},9124:function(e,t,n){var r=n(9957),i=n(6420).RegExp;e.exports=r((function(){var e=i(`(?<a>b)`,`g`);return e.exec(`b`).groups.a!==`b`||`b`.replace(e,`$<a>c`)!==`bc`}))},5436:function(e,t,n){var r=n(9760),i=TypeError;e.exports=function(e){if(r(e))throw new i(`Can't call method on `+e);return e}},6504:function(e,t,n){var r=n(4696),i=n(7776),a=r(`keys`);e.exports=function(e){return a[e]||(a[e]=i(e))}},3976:function(e,t,n){var r=n(7048),i=n(6420),a=n(4636),o=`__core-js_shared__`,s=e.exports=i[o]||a(o,{});(s.versions||=[]).push({version:`3.36.0`,mode:r?`pure`:`global`,copyright:`© 2014-2024 Denis Pushkarev (zloirock.ru)`,license:`https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE`,source:`https://github.com/zloirock/core-js`})},4696:function(e,t,n){var r=n(3976);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},9764:function(e,t,n){var r=n(1664),i=n(6180),a=n(5016),o=n(5436),s=r(``.charAt),c=r(``.charCodeAt),l=r(``.slice),u=function(e){return function(t,n){var r,u,d=a(o(t)),f=i(n),p=d.length;return f<0||f>=p?e?``:void 0:(r=c(d,f))<55296||r>56319||f+1===p||(u=c(d,f+1))<56320||u>57343?e?s(d,f):r:e?l(d,f,f+2):u-56320+(r-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},772:function(e,t,n){var r=n(8504),i=n(9957),a=n(6420).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol(`symbol detection`);return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},2495:function(e,t,n){var r=n(6180),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},4096:function(e,t,n){var r=n(5712),i=n(5436);e.exports=function(e){return r(i(e))}},6180:function(e,t,n){var r=n(1748);e.exports=function(e){var t=+e;return t!=t||t===0?0:r(t)}},7584:function(e,t,n){var r=n(6180),i=Math.min;e.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}},4356:function(e,t,n){var r=n(5436),i=Object;e.exports=function(e){return i(r(e))}},7024:function(e,t,n){var r=n(8448),i=n(1632),a=n(7728),o=n(4504),s=n(2104),c=n(9972),l=TypeError,u=c(`toPrimitive`);e.exports=function(e,t){if(!i(e)||a(e))return e;var n,c=o(e,u);if(c){if(t===void 0&&(t=`default`),n=r(c,e,t),!i(n)||a(n))return n;throw new l(`Can't convert object to primitive value`)}return t===void 0&&(t=`number`),s(e,t)}},88:function(e,t,n){var r=n(7024),i=n(7728);e.exports=function(e){var t=r(e,`string`);return i(t)?t:t+``}},16:function(e,t,n){var r={};r[n(9972)(`toStringTag`)]=`z`,e.exports=String(r)===`[object z]`},5016:function(e,t,n){var r=n(4427),i=String;e.exports=function(e){if(r(e)===`Symbol`)throw TypeError(`Cannot convert a Symbol value to a string`);return i(e)}},36:function(e){var t=String;e.exports=function(e){try{return t(e)}catch{return`Object`}}},7776:function(e,t,n){var r=n(1664),i=0,a=Math.random(),o=r(1 .toString);e.exports=function(e){return`Symbol(`+(e===void 0?``:e)+`)_`+o(++i+a,36)}},6536:function(e,t,n){e.exports=n(772)&&!Symbol.sham&&typeof Symbol.iterator==`symbol`},1576:function(e,t,n){var r=n(3476),i=n(9957);e.exports=r&&i((function(){return Object.defineProperty((function(){}),`prototype`,{value:42,writable:!1}).prototype!==42}))},4288:function(e,t,n){var r=n(6420),i=n(4328),a=r.WeakMap;e.exports=i(a)&&/native code/.test(String(a))},9972:function(e,t,n){var r=n(6420),i=n(4696),a=n(5152),o=n(7776),s=n(772),c=n(6536),l=r.Symbol,u=i(`wks`),d=c?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return a(u,e)||(u[e]=s&&a(l,e)?l[e]:d(`Symbol.`+e)),u[e]}},6488:function(e,t,n){var r=n(5232),i=n(5152),a=n(3440),o=n(7e3),s=n(4024),c=n(9968),l=n(584),u=n(7512),d=n(8948),f=n(3480),p=n(3696),m=n(3476),h=n(7048);e.exports=function(e,t,n,g){var _=`stackTraceLimit`,v=g?2:1,y=e.split(`.`),b=y[y.length-1],x=r.apply(null,y);if(x){var S=x.prototype;if(!h&&i(S,`cause`)&&delete S.cause,!n)return x;var C=r(`Error`),w=t((function(e,t){var n=d(g?t:e,void 0),r=g?new x(e):new x;return n!==void 0&&a(r,`message`,n),p(r,w,r.stack,2),this&&o(S,this)&&u(r,this,w),arguments.length>v&&f(r,arguments[v]),r}));if(w.prototype=S,b===`Error`?m&&_ in x&&(l(w,x,_),l(w,x,`prepareStackTrace`)):s?s(w,C):c(w,C,{name:!0}),c(w,x),!h)try{S.name!==b&&a(S,`name`,b),S.constructor=w}catch{}return w}}},7476:function(e,t,n){var r=n(9160),i=n(9957),a=n(1432),o=n(1632),s=n(4356),c=n(3556),l=n(4316),u=n(92),d=n(2568),f=n(953),p=n(9972),m=n(8504),h=p(`isConcatSpreadable`),g=m>=51||!i((function(){var e=[];return e[h]=!1,e.concat()[0]!==e})),_=function(e){if(!o(e))return!1;var t=e[h];return t===void 0?a(e):!!t};r({target:`Array`,proto:!0,arity:1,forced:!g||!f(`concat`)},{concat:function(e){var t,n,r,i,a,o=s(this),f=d(o,0),p=0;for(t=-1,r=arguments.length;t<r;t++)if(_(a=t===-1?o:arguments[t]))for(i=c(a),l(p+i),n=0;n<i;n++,p++)n in a&&u(f,p,a[n]);else l(p+1),u(f,p++,a);return f.length=p,f}})},6932:function(e,t,n){var r=n(9160),i=n(3364).filter;r({target:`Array`,proto:!0,forced:!n(953)(`filter`)},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},700:function(e,t,n){var r=n(9160),i=n(1664),a=n(5712),o=n(4096),s=n(1496),c=i([].join);r({target:`Array`,proto:!0,forced:a!==Object||!s(`join`,`,`)},{join:function(e){return c(o(this),e===void 0?`,`:e)}})},4456:function(e,t,n){var r=n(9160),i=n(3364).map;r({target:`Array`,proto:!0,forced:!n(953)(`map`)},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},4728:function(e,t,n){var r=n(9160),i=n(4356),a=n(3556),o=n(6728),s=n(4316);r({target:`Array`,proto:!0,arity:1,forced:n(9957)((function(){return[].push.call({length:4294967296},1)!==4294967297}))||!function(){try{Object.defineProperty([],`length`,{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=i(this),n=a(t),r=arguments.length;s(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return o(t,n),n}})},8752:function(e,t,n){var r=n(9160),i=n(6420),a=n(908),o=n(6488),s=`WebAssembly`,c=i[s],l=Error(`e`,{cause:7}).cause!==7,u=function(e,t){var n={};n[e]=o(e,t,l),r({global:!0,constructor:!0,arity:1,forced:l},n)},d=function(e,t){if(c&&c[e]){var n={};n[e]=o(s+`.`+e,t,l),r({target:s,stat:!0,constructor:!0,arity:1,forced:l},n)}};u(`Error`,(function(e){return function(t){return a(e,this,arguments)}})),u(`EvalError`,(function(e){return function(t){return a(e,this,arguments)}})),u(`RangeError`,(function(e){return function(t){return a(e,this,arguments)}})),u(`ReferenceError`,(function(e){return function(t){return a(e,this,arguments)}})),u(`SyntaxError`,(function(e){return function(t){return a(e,this,arguments)}})),u(`TypeError`,(function(e){return function(t){return a(e,this,arguments)}})),u(`URIError`,(function(e){return function(t){return a(e,this,arguments)}})),d(`CompileError`,(function(e){return function(t){return a(e,this,arguments)}})),d(`LinkError`,(function(e){return function(t){return a(e,this,arguments)}})),d(`RuntimeError`,(function(e){return function(t){return a(e,this,arguments)}}))},508:function(e,t,n){var r=n(3476),i=n(6208).EXISTS,a=n(1664),o=n(2544),s=Function.prototype,c=a(s.toString),l=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=a(l.exec);r&&!i&&o(s,`name`,{configurable:!0,get:function(){try{return u(l,c(this))[1]}catch{return``}}})},232:function(e,t,n){var r=n(9160),i=n(9292);r({target:`Object`,stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},5443:function(e,t,n){var r=n(16),i=n(6076),a=n(7032);r||i(Object.prototype,`toString`,a,{unsafe:!0})},880:function(e,t,n){var r=n(9160),i=n(7680);r({target:`RegExp`,proto:!0,forced:/./.exec!==i},{exec:i})},9836:function(e,t,n){var r=n(8448),i=n(7176),a=n(3951),o=n(9760),s=n(7584),c=n(5016),l=n(5436),u=n(4504),d=n(4764),f=n(9092);i(`match`,(function(e,t,n){return[function(t){var n=l(this),i=o(t)?void 0:u(t,e);return i?r(i,t,n):new RegExp(t)[e](c(n))},function(e){var r=a(this),i=c(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return f(r,i);var l=r.unicode;r.lastIndex=0;for(var u,p=[],m=0;(u=f(r,i))!==null;){var h=c(u[0]);p[m]=h,h===``&&(r.lastIndex=d(i,s(r.lastIndex),l)),m++}return m===0?null:p}]}))},3536:function(e,t,n){var r=n(9160),i=n(6420),a=n(6100),o=n(3951),s=n(4328),c=n(7796),l=n(2544),u=n(92),d=n(9957),f=n(5152),p=n(9972),m=n(336).IteratorPrototype,h=n(3476),g=n(7048),_=`constructor`,v=`Iterator`,y=p(`toStringTag`),b=TypeError,x=i[v],S=g||!s(x)||x.prototype!==m||!d((function(){x({})})),C=function(){if(a(this,m),c(this)===m)throw new b(`Abstract class Iterator not directly constructable`)},w=function(e,t){h?l(m,e,{configurable:!0,get:function(){return t},set:function(t){if(o(this),this===m)throw new b(`You can't redefine this property`);f(this,e)?this[e]=t:u(this,e,t)}}):m[e]=t};f(m,y)||w(y,v),!S&&f(m,_)&&m[_]!==Object||w(_,C),C.prototype=m,r({global:!0,constructor:!0,forced:S},{Iterator:C})},2144:function(e,t,n){var r=n(9160),i=n(8448),a=n(8952),o=n(3951),s=n(6752),c=n(9724),l=n(8696),u=n(7048),d=c((function(){for(var e,t,n=this.iterator,r=this.predicate,a=this.next;;){if(e=o(i(a,n)),this.done=!!e.done)return;if(t=e.value,l(n,r,[t,this.counter++],!0))return t}}));r({target:`Iterator`,proto:!0,real:!0,forced:u},{filter:function(e){return o(this),a(e),new d(s(this),{predicate:e})}})},9080:function(e,t,n){var r=n(9160),i=n(5792);r({target:`Iterator`,proto:!0,real:!0,forced:n(7048)},{map:i})}},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,r),a.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if(typeof globalThis==`object`)return globalThis;try{return this||Function(`return this`)()}catch{if(typeof window==`object`)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})};var i={};return function(){r.r(i),r.d(i,{default:function(){return d}}),r(8752),r(6932),r(700),r(4456),r(4728),r(508),r(232),r(5443),r(880),r(9836),r(3536),r(2144),r(9080);var e=r(680);r(7476);function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t(e,n)}var n=function(n){var r,i;function a(){for(var e,t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return(e=n.call.apply(n,[this].concat(r))||this).state={bump:!1,debounced:!1},e}i=n,(r=a).prototype=Object.create(i.prototype),r.prototype.constructor=r,t(r,i);var o=a.prototype;return o.componentWillMount=function(){var e,t,n,r,i=this;this.debounceStatusUpdate=(e=function(){if(!i.state.debounced){var e=!i.props.isInFocus||i.props.validChoiceMade;i.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}},t=1400,function(){var i=this,a=arguments,o=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||e.apply(i,a)}),t),o&&e.apply(i,a)})},o.componentWillReceiveProps=function(e){e.queryLength,this.setState({debounced:!1})},o.render=function(){var t=this.props,n=t.id,r=t.length,i=t.queryLength,a=t.minQueryLength,o=t.selectedOption,s=t.selectedOptionIndex,c=t.tQueryTooShort,l=t.tNoResults,u=t.tSelectedOption,d=t.tResults,f=t.className,p=this.state,m=p.bump,h=p.debounced,g=p.silenced,_=i<a,v=r===0,y=o?u(o,r,s):``,b=null;return b=_?c(a):v?l():d(r,y),this.debounceStatusUpdate(),(0,e.createElement)(`div`,{className:f,style:{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,marginBottom:`-1px`,marginRight:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`}},(0,e.createElement)(`div`,{id:n+`__status--A`,role:`status`,"aria-atomic":`true`,"aria-live":`polite`},!g&&h&&m?b:``),(0,e.createElement)(`div`,{id:n+`__status--B`,role:`status`,"aria-atomic":`true`,"aria-live":`polite`},g||!h||m?``:b))},a}(e.Component);n.defaultProps={tQueryTooShort:function(e){return`Type in `+e+` or more characters for results`},tNoResults:function(){return`No search results`},tSelectedOption:function(e,t,n){return e+` `+(n+1)+` of `+t+` is highlighted`},tResults:function(e,t){return e+` `+(e===1?`result`:`results`)+` `+(e===1?`is`:`are`)+` available. `+t}};var a=function(t){var n=t.className;return(0,e.createElement)(`svg`,{version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,className:n,focusable:`false`},(0,e.createElement)(`g`,{stroke:`none`,fill:`none`,"fill-rule":`evenodd`},(0,e.createElement)(`polygon`,{fill:`#000000`,points:`0 0 22 0 11 17`})))};function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function s(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}var l={13:`enter`,27:`escape`,32:`space`,38:`up`,40:`down`};function u(){return typeof navigator<`u`&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var d=function(t){var r,i;function a(e){var n;return(n=t.call(this,e)||this).elementReferences={},n.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},n.handleComponentBlur=n.handleComponentBlur.bind(s(n)),n.handleKeyDown=n.handleKeyDown.bind(s(n)),n.handleUpArrow=n.handleUpArrow.bind(s(n)),n.handleDownArrow=n.handleDownArrow.bind(s(n)),n.handleEnter=n.handleEnter.bind(s(n)),n.handlePrintableKey=n.handlePrintableKey.bind(s(n)),n.handleListMouseLeave=n.handleListMouseLeave.bind(s(n)),n.handleOptionBlur=n.handleOptionBlur.bind(s(n)),n.handleOptionClick=n.handleOptionClick.bind(s(n)),n.handleOptionFocus=n.handleOptionFocus.bind(s(n)),n.handleOptionMouseDown=n.handleOptionMouseDown.bind(s(n)),n.handleOptionMouseEnter=n.handleOptionMouseEnter.bind(s(n)),n.handleInputBlur=n.handleInputBlur.bind(s(n)),n.handleInputChange=n.handleInputChange.bind(s(n)),n.handleInputClick=n.handleInputClick.bind(s(n)),n.handleInputFocus=n.handleInputFocus.bind(s(n)),n.pollInputElement=n.pollInputElement.bind(s(n)),n.getDirectInputChanges=n.getDirectInputChanges.bind(s(n)),n}i=t,(r=a).prototype=Object.create(i.prototype),r.prototype.constructor=r,c(r,i);var d=a.prototype;return d.isQueryAnOption=function(e,t){var n=this;return t.map((function(e){return n.templateInputValue(e).toLowerCase()})).indexOf(e.toLowerCase())!==-1},d.componentDidMount=function(){this.pollInputElement()},d.componentWillUnmount=function(){clearTimeout(this.$pollInput)},d.pollInputElement=function(){var e=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){e.pollInputElement()}),100)},d.getDirectInputChanges=function(){var e=this.elementReferences[-1];e&&e.value!==this.state.query&&this.handleInputChange({target:{value:e.value}})},d.componentDidUpdate=function(e,t){var n=this.state.focused,r=n===null,i=t.focused!==n;i&&!r&&this.elementReferences[n].focus();var a=n===-1,o=i&&t.focused===null;if(a&&o){var s=this.elementReferences[n];s.setSelectionRange(0,s.value.length)}},d.hasAutoselect=function(){return!u()&&this.props.autoselect},d.templateInputValue=function(e){var t=this.props.templates&&this.props.templates.inputValue;return t?t(e):e},d.templateSuggestion=function(e){var t=this.props.templates&&this.props.templates.suggestion;return t?t(e):e},d.handleComponentBlur=function(e){var t,n=this.state,r=n.options,i=n.query,a=n.selected;this.props.confirmOnBlur?(t=e.query||i,this.props.onConfirm(r[a])):t=i,this.setState({focused:null,menuOpen:e.menuOpen||!1,query:t,selected:null,validChoiceMade:this.isQueryAnOption(t,r)})},d.handleListMouseLeave=function(e){this.setState({hovered:null})},d.handleOptionBlur=function(e,t){var n=this.state,r=n.focused,i=n.menuOpen,a=n.options,o=n.selected,s=e.relatedTarget===null,c=e.relatedTarget===this.elementReferences[-1],l=r!==t&&r!==-1;if(!l&&s||!(l||c)){var d=i&&u();this.handleComponentBlur({menuOpen:d,query:this.templateInputValue(a[o])})}},d.handleInputBlur=function(e){var t=this.state,n=t.focused,r=t.menuOpen,i=t.options,a=t.query,o=t.selected;if(n===-1){var s=r&&u(),c=u()?a:this.templateInputValue(i[o]);this.handleComponentBlur({menuOpen:s,query:c})}},d.handleInputChange=function(e){var t=this,n=this.props,r=n.minLength,i=n.source,a=n.showAllValues,o=this.hasAutoselect(),s=e.target.value,c=s.length===0,l=this.state.query!==s,u=s.length>=r;this.setState({query:s,ariaHint:c}),a||!c&&l&&u?i(s,(function(e){var n=e.length>0;t.setState({menuOpen:n,options:e,selected:o&&n?0:-1,validChoiceMade:!1})})):!c&&u||this.setState({menuOpen:!1,options:[]})},d.handleInputClick=function(e){this.handleInputChange(e)},d.handleInputFocus=function(e){var t=this.state,n=t.query,r=t.validChoiceMade,i=t.options,a=this.props.minLength,o=!r&&n.length>=a&&i.length>0;o?this.setState((function(e){var t=e.menuOpen;return{focused:-1,menuOpen:o||t,selected:-1}})):this.setState({focused:-1})},d.handleOptionFocus=function(e){this.setState({focused:e,hovered:null,selected:e})},d.handleOptionMouseEnter=function(e,t){u()||this.setState({hovered:t})},d.handleOptionClick=function(e,t){var n=this.state.options[t],r=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,hovered:null,menuOpen:!1,query:r,selected:-1,validChoiceMade:!0}),this.forceUpdate()},d.handleOptionMouseDown=function(e){e.preventDefault()},d.handleUpArrow=function(e){e.preventDefault();var t=this.state,n=t.menuOpen,r=t.selected;r!==-1&&n&&this.handleOptionFocus(r-1)},d.handleDownArrow=function(e){var t=this;if(e.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)e.preventDefault(),this.props.source(``,(function(e){t.setState({menuOpen:!0,options:e,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var n=this.state,r=n.menuOpen,i=n.options,a=n.selected;a!==i.length-1&&r&&this.handleOptionFocus(a+1)}},d.handleSpace=function(e){var t=this;this.props.showAllValues&&!1===this.state.menuOpen&&this.state.query===``&&(e.preventDefault(),this.props.source(``,(function(e){t.setState({menuOpen:!0,options:e})}))),this.state.focused!==-1&&(e.preventDefault(),this.handleOptionClick(e,this.state.focused))},d.handleEnter=function(e){this.state.menuOpen&&(e.preventDefault(),this.state.selected>=0&&this.handleOptionClick(e,this.state.selected))},d.handlePrintableKey=function(e){var t=this.elementReferences[-1];e.target===t||t.focus()},d.handleKeyDown=function(e){switch(l[e.keyCode]){case`up`:this.handleUpArrow(e);break;case`down`:this.handleDownArrow(e);break;case`space`:this.handleSpace(e);break;case`enter`:this.handleEnter(e);break;case`escape`:this.handleComponentBlur({query:this.state.query});break;default:((t=e.keyCode)>47&&t<58||t===32||t===8||t>64&&t<91||t>95&&t<112||t>185&&t<193||t>218&&t<223)&&this.handlePrintableKey(e)}var t},d.render=function(){var t,r=this,i=this.props,a=i.cssNamespace,s=i.displayMenu,c=i.id,l=i.minLength,d=i.name,f=i.placeholder,p=i.required,m=i.showAllValues,h=i.tNoResults,g=i.tStatusQueryTooShort,_=i.tStatusNoResults,v=i.tStatusSelectedOption,y=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,S=i.menuAttributes,C=i.inputClasses,w=i.hintClasses,T=i.menuClasses,E=this.state,D=E.focused,O=E.hovered,k=E.menuOpen,A=E.options,j=E.query,M=E.selected,N=E.ariaHint,P=E.validChoiceMade,F=this.hasAutoselect(),I=D===-1,L=A.length===0,R=j.length!==0,z=j.length>=l,B=this.props.showNoOptionsFound&&I&&L&&R&&z,ee=a+`__wrapper`,te=a+`__status`,ne=a+`__dropdown-arrow-down`,re=D!==-1&&D!==null,ie=a+`__option`,ae=a+`__hint`,oe=this.templateInputValue(A[M]),se=oe&&oe.toLowerCase().indexOf(j.toLowerCase())===0&&F?j+oe.substr(j.length):``,ce=c+`__assistiveHint`,le={"aria-describedby":N?ce:null,"aria-expanded":k?`true`:`false`,"aria-activedescendant":re?c+`__option--`+D:null,"aria-controls":c+`__listbox`,"aria-autocomplete":this.hasAutoselect()?`both`:`list`};m&&typeof(t=x({className:ne}))==`string`&&(t=(0,e.createElement)(`div`,{className:a+`__dropdown-arrow-down-wrapper`,dangerouslySetInnerHTML:{__html:t}}));var ue=a+`__input`,de=[ue,this.props.showAllValues?ue+`--show-all-values`:ue+`--default`];D!==null&&de.push(ue+`--focused`),C&&de.push(C);var fe=a+`__menu`,pe=[fe,fe+`--`+s,fe+`--`+(k||B?`visible`:`hidden`)];T&&pe.push(T),(S!=null&&S.class||S!=null&&S.className)&&pe.push(S?.class||S?.className);var me=Object.assign({"aria-labelledby":c},S,{id:c+`__listbox`,role:`listbox`,className:pe.join(` `),onMouseLeave:this.handleListMouseLeave});return delete me.class,(0,e.createElement)(`div`,{className:ee,onKeyDown:this.handleKeyDown},(0,e.createElement)(n,{id:c,length:A.length,queryLength:j.length,minQueryLength:l,selectedOption:this.templateInputValue(A[M]),selectedOptionIndex:M,validChoiceMade:P,isInFocus:this.state.focused!==null,tQueryTooShort:g,tNoResults:_,tSelectedOption:v,tResults:y,className:te}),se&&(0,e.createElement)(`span`,null,(0,e.createElement)(`input`,{className:[ae,w===null?C:w].filter(Boolean).join(` `),readonly:!0,tabIndex:`-1`,value:se})),(0,e.createElement)(`input`,o({},le,{autoComplete:`off`,className:de.join(` `),id:c,onClick:this.handleInputClick,onBlur:this.handleInputBlur},{onChange:this.handleInputChange},{onFocus:this.handleInputFocus,name:d,placeholder:f,ref:function(e){r.elementReferences[-1]=e},type:`text`,role:`combobox`,required:p,value:j})),t,(0,e.createElement)(`ul`,me,A.map((function(t,n){var i=(D===-1?M===n:D===n)&&O===null?` `+ie+`--focused`:``,a=n%2?` `+ie+`--odd`:``,o=u()?`<span id=`+c+`__option-suffix--`+n+` style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> `+(n+1)+` of `+A.length+`</span>`:``;return(0,e.createElement)(`li`,{"aria-selected":D===n?`true`:`false`,className:``+ie+i+a,dangerouslySetInnerHTML:{__html:r.templateSuggestion(t)+o},id:c+`__option--`+n,key:n,onBlur:function(e){return r.handleOptionBlur(e,n)},onClick:function(e){return r.handleOptionClick(e,n)},onMouseDown:r.handleOptionMouseDown,onMouseEnter:function(e){return r.handleOptionMouseEnter(e,n)},ref:function(e){r.elementReferences[n]=e},role:`option`,tabIndex:`-1`,"aria-posinset":n+1,"aria-setsize":A.length})})),B&&(0,e.createElement)(`li`,{className:ie+` `+ie+`--no-results`,role:`option`,"aria-disabled":`true`},h())),(0,e.createElement)(`span`,{id:ce,style:{display:`none`}},b()))},a}(e.Component);d.defaultProps={autoselect:!1,cssNamespace:`autocomplete`,defaultValue:``,displayMenu:`inline`,minLength:0,name:`input-autocomplete`,placeholder:``,onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return`No results found`},tAssistiveHint:function(){return`When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.`},dropdownArrow:a,menuAttributes:{},inputClasses:null,hintClasses:null,menuClasses:null}}(),i}()}))})),En=c(o(((e,t)=>{t.exports=Tn()}))(),1),Dn=({value:e,defaultValue:t=``,onConfirm:n,source:r,disabled:i,onClear:a,tClearInput:o=()=>`Clear input`,...s})=>{let c=(0,d.useRef)(null),l=e=>{setTimeout(()=>{c.current&&(c.current.elementReferences[-1].value=e)},0)};(0,d.useEffect)(()=>{e!==void 0&&l(e)},[e]),(0,d.useEffect)(()=>{i?c.current&&(c.current.elementReferences[-1].disabled=!0):c.current&&(c.current.elementReferences[-1].disabled=!1)},[i]);let u=()=>{a&&a()},p=(e,t)=>{c.current.elementReferences[-1].classList.contains(`autocomplete__input--focused`)&&r(e,t)},m=t=>{t?n(t):l(e)};return(0,f.jsxs)(`div`,{style:{position:`relative`,width:`100%`},children:[(0,f.jsx)(En.default,{ref:c,...s,defaultValue:t,onConfirm:m,source:p}),!!(e&&e.length>0&&!i)&&(0,f.jsx)(`button`,{onClick:u,style:{position:`absolute`,right:`0px`,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:`none`,cursor:`pointer`,padding:0},"aria-label":o(),children:(0,f.jsx)(_.Icon,{icon:`it-close`,size:`sm`,title:o()})})]})},On=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==`,kn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=`,An=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC`,jn=({position:e,areasLayer:t,bounds:n,onMarkedMoved:r})=>{let i=(0,d.useRef)(null),a=null,[o,s]=(0,d.useState)([]),c=(0,E.tileLayer)(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>`}),l=[41.9,12.5],u=()=>{let o=E.default.map(i.current,{keyboard:!1,minZoom:6,maxZoom:18}).setView(l,10);c.addTo(o),t&&t.map(e=>{e.addTo(o)});let s=e?[`${e.lat}`,`${e.lon}`]:n?n.getCenter():l;if(delete E.default.Icon.Default.prototype._getIconUrl,E.default.Icon.Default.mergeOptions({iconRetinaUrl:On,iconUrl:kn,shadowUrl:An}),a=E.default.marker(s,{draggable:!0}).addTo(o),a.on(`moveend`,function(e){r(e.target.getLatLng(),a)}),o.on(`click`,function(e){let t=e.latlng;a&&a.setLatLng(t).update(),r(t,a)}),!e&&n)o.fitBounds(n);else{let t=e?[e.lat,e.lon]:l;a&&(a.setLatLng(t).update(),o.setView(t,15))}};return(0,d.useEffect)(()=>{i.current&&u()},[i]),(0,f.jsx)(`div`,{className:`d-block`,style:{height:`60vh`,width:`100%`,display:`block`},children:(0,f.jsx)(`div`,{ref:i,style:{height:`100%`,width:`100%`},"aria-hidden":!0})})},Mn=l.Formio.Components.components.field,Nn=({component:e,value:t,current:n,onChange:r,i18next:i})=>{let[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)([]),[l,u]=(0,d.useState)(),[p,m]=(0,d.useState)(),[h,g]=(0,d.useState)(!1),[y,b]=(0,d.useState)(),[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(),[T,O]=(0,d.useState)(),[k,A]=(0,d.useState)(!1),[M,N]=(0,d.useState)(``),[P,F]=(0,d.useState)(``),[I,L]=(0,d.useState)(!1),[R,z]=(0,d.useState)(!1),B=new URLSearchParams(window.location.search).get(`area`),{geographic_areas_id:ee}=window.OC_SERVICE_DETAILS,te=(0,d.useRef)(),ne=i.language,re=E.default.latLngBounds(),ie=B||(ee&&ee.length>0?ee:void 0),ae=(e,t)=>{te.current=e;let n=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&countrycodes=it&viewbox=${l}&bounded=1&addressdetails=1&limit=14&format=jsonv2&accept-language=${ne}`,r=[],i=[];S(!0),fetch(n).then(e=>e.json()).then(n=>{if(n.length&&te.current===e){S(!0);let e=n.map((e,t)=>{let{lat:n,lon:r}=e,i=`${j()}/api/geographic-areas/contains?lat=${n}&lon=${r}&geographic_areas_ids=${y.join(`,`)}`;return fetch(i).then(e=>e.json()).then(t=>t.result?(e.label=Le(e),e):null)});return Promise.all(e)}else te.current===e&&(t([]),S(!1))}).then(n=>{n=n?n.filter(e=>e!==null):[],n.length>0?(n.forEach((e,t)=>{n[t].label=Le(e)}),n=D.default.uniqWith(n,(e,t)=>e.label===t.label),n.forEach((e,t)=>{i.push(e.label),r.push(e)}),te.current===e&&(t(i),c(r),S(!1))):te.current===e&&(t([]),S(!1))}).catch(e=>{console.error(`Error fetching locations:`,e),S(!1)})},oe=(e,t)=>{ae(e,t)},se=(e,t)=>{let{lat:n,lng:r}=e,i=`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${n}&lon=${r}&accept-language=${ne}`;fetch(i).then(e=>e.json()).then(e=>{if(e&&e.display_name)if(e.label=Le(e),e.lat=n,e.lon=r,t)t.bindPopup(`${e.label}`,{className:`address-map-popup`}).openPopup(),O(e);else{O(e);return}}).catch(e=>console.error(`Error with reverse geocoding:`,e))};function ce(){navigator.geolocation.getCurrentPosition(e=>{let t=e.coords.latitude,n=e.coords.longitude;if((y||[]).length>0){let e=`${j()}/api/geographic-areas/contains?lat=${t}&lon=${n}&geographic_areas_ids=${y.join(`,`)}`;fetch(e).then(e=>e.json()).then(e=>{e.result?(o({lat:t,lon:n}),se({lat:t,lng:n}),z(!R)):z(!R)})}else o({lat:t,lon:n}),se({lat:t,lng:n}),z(!R)},e=>{e?.code===1?(L(!I),F(i.t(`error_message_code_1`))):e?.code===2?(L(!I),F(i.t(`error_message_code_2`))):e?.code===3?(L(!I),F(i.t(`error_message_code_3`))):(L(!I),F(i.t(`error_message_generic`)))})}(0,d.useEffect)(()=>{t&&o(t),n.valuePosition&&o(n.valuePosition)},[t,n]);let le=()=>{t&&o(t),n.valuePosition&&o(n.valuePosition)};(0,d.useEffect)(()=>{window?.Formio?.formioReady.then(()=>{setTimeout(()=>{le(),ue()},1)})},[]);let ue=()=>{let e=`${j()}/api/geographic-areas`,t=[],n=[],r=[];fetch(e).then(e=>e.json()).then(e=>{if(Array.isArray(e)&&e.length>0){e.filter(e=>ie?Array.isArray(ie)?ie.includes(e.id):e.id===ie:!0).forEach(e=>{t.push(e.id);let i=JSON.parse(e.geofence);n.push(i);let a=E.default.geoJSON(i,{style:{color:`#3478bd`,fillColor:`#87CEEB`,fillOpacity:.2,weight:1.5},filter:function(e){return e.geometry.type===`Polygon`||e.geometry.type===`MultiPolygon`}});re.extend(a.getBounds()),r.push(a)}),m(r),b(t),w(re);let i=re.getNorthEast(),a=re.getSouthWest();u([i.lng,i.lat,a.lng,a.lat])}else console.log(`No geographic_areas_ids found.`)}).catch(e=>{console.error(`Error with reverse geocoding:`,e)})},de=()=>{N(a?.label?a.label:``)};(0,d.useEffect)(()=>{de(),r(a)},[a]),(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&k===!1?A(!0):A(!1)},[]);let fe=()=>{if(T){let e=`${j()}/api/geographic-areas/contains?lat=${T.lat}&lon=${T.lon}&geographic_areas_ids=${y.join(`,`)}`;g(!0),fetch(e).then(e=>e.json()).then(e=>{g(!1),e?e.result===!1?v.default.fire({title:``,html:`<p>`+i.t(`Attenzione: Il luogo selezionato si trova al di fuori dell’area coperta dal servizio. Per favore, scegli un luogo all'interno dell'area evidenziata nella mappa.`)+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):e.result===!0&&(z(!R),o(T)):(g(!1),console.log(`No geographic-areas/contains .`))}).catch(e=>{console.error(`Error with geographic-areas/contains:`,e),v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})}};return(0,f.jsx)(`div`,{children:(0,f.jsxs)(`div`,{id:`address-map-container-${e.key}`,className:`address-map-container`,children:[(0,f.jsx)(`div`,{children:(0,f.jsxs)(_.Modal,{wrapClassName:`formio-component-address_map`,isOpen:R,size:`lg`,scrollable:!0,toggle:()=>z(!R),labelledBy:`maps-evo`,container:W(),children:[(0,f.jsx)(_.ModalHeader,{toggle:()=>z(!R),id:`maps-evo`,children:i.t(`Individua il luogo sulla mappa`)}),(0,f.jsxs)(_.ModalBody,{children:[(0,f.jsx)(`p`,{children:(0,f.jsx)(`small`,{children:i.t(`Trascina l’icona nel punto preciso in cui si verifica l’evento che vuoi segnalare e fai click su Salva indirizzo`)})}),(0,f.jsx)(jn,{position:a,areasLayer:p,bounds:C,onMarkedMoved:(e,t)=>{se(e,t)}})]}),(0,f.jsxs)(_.ModalFooter,{children:[(0,f.jsx)(_.Button,{color:`secondary`,onClick:()=>z(!R),children:i.t(`Chiudi`)}),(0,f.jsx)(_.Button,{color:`primary`,onClick:()=>{fe()},disabled:!T||h,children:i.t(`Salva indirizzo`)})]})]})}),(0,f.jsx)(`div`,{children:(0,f.jsxs)(_.Modal,{isOpen:I,toggle:()=>L(!I),withIcon:!0,labelledBy:`error-modal-message`,container:W(),children:[(0,f.jsx)(_.ModalHeader,{icon:`it-info-circle`,id:`error-modal-message`,children:i.t(`warning`)}),(0,f.jsx)(_.ModalBody,{children:(0,f.jsx)(`p`,{children:P})}),(0,f.jsx)(_.ModalFooter,{children:(0,f.jsx)(_.Button,{color:`primary`,onClick:()=>L(!I),children:i.t(`close`)})})]})}),(0,f.jsxs)(`div`,{className:`position-relative`,children:[(0,f.jsx)(Dn,{id:`${e.id}-${e.key}`,inputClasses:`form-control`,source:(0,D.debounce)(oe,520),onConfirm:e=>{S(!1),te.current=``,e&&(e===``&&o(null),o(s.find(t=>t.label===e)))},onClear:()=>{S(!1),te.current=``,o(null)},dropdownArrow:()=>null,minLength:3,disabled:k,confirmOnBlur:!0,showNoOptionsFound:!x,defaultValue:a?.label,value:M,tNoResults:()=>i.t(`Nessun risultato trovato, prova a inserire l'indirizzo completo`),tClearInput:()=>i.t(`Clear input`)}),x&&(0,f.jsx)(`div`,{className:`position-absolute`,style:{width:`100%`,bottom:`0px`},children:(0,f.jsx)(_.Progress,{indeterminate:!0,label:`In elaborazione...`})})]}),!k&&(0,f.jsxs)(_.Button,{type:`button`,value:i.t(`Individua con precisione sulla mappa`),onClick:()=>{/Mobi|Android/i.test(navigator.userAgent)?ce():(z(!0),O(!1))},icon:!0,className:`px-0 primary-color`,children:[(0,f.jsx)(_.Icon,{color:`primary`,icon:`it-map-marker-circle`,role:`presentation`}),(0,f.jsx)(`span`,{children:i.t(`Individua con precisione sulla mappa`)})]})]})})},Pn=class e extends Mn{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Address Map`,group:`basic`,icon:`bi bi-map`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Mn.schema({type:`address_map`})}static editForm=wn;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,u.createRoot)(e),this.rootComponent.render((0,f.jsx)(Nn,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this},this.dataValue)),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){this.valuePosition=e,this.updateValue(e)}getValue(){return this.valuePosition}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Fn=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{label:`Base url`,calculateValue:`let url = '`+j()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1}];function In(...e){return p.Components.baseEditForm([{key:`display`,components:Fn}],...e)}var Ln=l.Formio.Components.components.field,Rn=({component:e,current:t,onChange:n,i18next:r})=>{let i=`list-services`,a=`selected-category`,[o,s]=(0,d.useState)([]),[c,l]=(0,d.useState)([]),[u,p]=(0,d.useState)(null),[m,h]=(0,d.useState)(null),[g,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(!1),[x,S]=(0,d.useState)(!1),C=(0,d.useRef)(!1),T=(0,d.useRef)(),E=(0,d.useMemo)(()=>u&&(c.find(e=>e.name===u)||o.find(e=>e.name===u))||null,[u,c,o]),D=(0,d.useMemo)(()=>E?.services||[],[E]),O=async()=>{S(!0);let e=sessionStorage.getItem(i),t=sessionStorage.getItem(a);if(e)try{let n=JSON.parse(e);if(Array.isArray(n)&&n.length>0)return s(n),l(n),p((n.find(e=>e.name===t)||n[0])?.name||null),S(!1),n}catch{console.warn(`⚠️ Cache corrotta, rigenerazione...`)}let n=await window.FormioHelper.getBookingConfig(),r={};n.forEach(e=>{(e.categories??[]).forEach(t=>{r[t]||(r[t]={name:t,services:[]}),r[t].services.push(e)})});let o=Object.fromEntries(Object.entries(r).sort(([e],[t])=>e.localeCompare(t,`it`,{sensitivity:`base`}))),c=Object.values(o).filter(e=>(e.name??``).trim()!==``);return s(c),l(c),p(c[0]?.name||null),sessionStorage.setItem(i,JSON.stringify(c)),sessionStorage.setItem(a,c[0]?.name||``),S(!1),c};(0,d.useEffect)(()=>{u&&sessionStorage.setItem(a,u)},[u]),(0,d.useEffect)(()=>{C.current||(C.current=!0,O())},[]);let k=e=>{let t=(e=``)=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=(e=``)=>e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/\s+/g,` `).trim(),r=(e=``)=>e.replace(/<[^>]*>/g,` `),i=(e,n)=>RegExp(`\\b${t(n)}`,`i`).test(e),a=(e,t)=>{let a=n(e.name),o=n((e.categories??[]).join(` `)),s=n(r(e.abstract??``));if(!t.every(e=>i(a,e)||i(o,e)||i(s,e)))return-1;let c=0;for(let e of t)i(a,e)?c+=3:i(o,e)?c+=2:i(s,e)&&(c+=1);return c},s=e.target.value;v(s);let c=n(s);if(!c){l(o),p(e=>e??o[0]?.name??null);return}let d=c.split(` `).filter(Boolean),f=o.map(e=>{let t=e.services.map(e=>({service:e,score:a(e,d)})).filter(e=>e.score>=0).sort((e,t)=>t.score-e.score).map(e=>e.service);return t.length?{...e,services:t}:null}).filter(Boolean);l(f),p(f.some(e=>e.name===u)?u:f[0]?.name??null)},A=e=>{h(e);let r=o.find(t=>t.services.some(t=>t.id===e.id));r&&p(r.name),n({id:e.id,link:e.link,name:e.name,show_howto_in_motivation:e.show_howto_in_motivation,categories:e.categories,offices:e.offices,abstract:e.abstract,view_type:e.view_type}),t.data.user_group=null,at()},j=e=>{p(e.name),h(null),v(``),l(o),n({})};return(0,d.useEffect)(()=>{b(!!document.querySelector(`.formio-read-only`))},[]),(0,d.useEffect)(()=>{let e=setTimeout(()=>{let e=t?.dataValue??t?.getValue();if(e?.id&&(h(e),o.length>0)){let t=o.find(t=>t.services.some(t=>t.id===e.id));t&&p(t.name)}},500);return()=>clearTimeout(e)},[t?.dataValue,t?.data,o]),(0,d.useEffect)(()=>{let e=window.FormioInstance;if(!e)return;let n=()=>{let n=e.submission?.data?.[t?.component?.key];if(n?.id&&(h(n),o.length>0)){let e=o.find(e=>e.services.some(e=>e.id===n.id));e&&p(e.name)}};return e.on(`change`,n),()=>e.off(`change`,n)},[o,t?.component?.key]),x?(0,f.jsx)(`div`,{className:`services-booking`,ref:T,children:(0,f.jsxs)(`div`,{children:[r.t(`Caricamento in corso`),`...`]})}):(0,f.jsx)(`div`,{className:`services-booking`,ref:T,children:o&&!y?(0,f.jsxs)(_.Container,{children:[(0,f.jsx)(_.Row,{className:`mb-3`,children:(0,f.jsx)(_.Col,{children:(0,f.jsx)(`h3`,{className:`h6 fw-bold text-uppercase mb-3`,children:r.t(`Seleziona il servizio per cui stai richiedendo un appuntamento`)})})}),(0,f.jsx)(_.Row,{className:`mb-3`,children:(0,f.jsx)(_.Col,{children:(0,f.jsx)(`div`,{className:`search-container`,children:(0,f.jsx)(_.Input,{id:`search`,label:r.t(`Cerca`),type:`text`,value:g,onChange:k,onInput:k,infoText:r.t(`Cerca per categoria, servizio o descrizione`)})})})}),(0,f.jsxs)(_.Row,{className:`mb-3`,children:[E?(0,f.jsx)(_.Col,{lg:3,md:4,className:`mb-4 mb-lg-0`,children:(0,f.jsxs)(`div`,{className:`categories-list`,children:[(0,f.jsx)(`h3`,{className:`h6 fw-bold text-uppercase mb-3`,children:r.t(`Categorie`)}),c.length>0&&c.map(e=>{let t=u===e.name;return(0,f.jsxs)(`button`,{onClick:()=>j(e),className:`category-item w-100 text-start p-3 mb-2 border-0 rounded ${t?`category-active bg-primary text-white`:`bg-light text-dark`}`,children:[(0,f.jsx)(`span`,{className:`fw-500 d-block`,children:e.name}),(0,f.jsxs)(`small`,{className:`d-block mt-1 ${t?`text-white`:`text-muted`}`,children:[e.services.length,` `,e.services.length>1?r.t(`servizi`):r.t(`servizio`)]})]},e.name)})]})}):null,(0,f.jsx)(_.Col,{lg:E?9:12,md:E?8:12,children:(0,f.jsxs)(`div`,{className:`services-container`,children:[D.length>0?(0,f.jsxs)(`div`,{className:`services-header mb-4`,children:[(0,f.jsx)(`h3`,{className:`h5 fw-bold text-primary mb-0`,children:E?.name}),(0,f.jsx)(`div`,{className:`border-bottom border-primary mt-3 mb-4`})]}):null,D.length>0?(0,f.jsx)(`div`,{className:`services-list`,children:D.map(e=>{let t=m?.id===e.id,n=w.default.sanitize(e?.abstract);return(0,f.jsx)(`button`,{onClick:()=>A(e),className:`service-card mb-4 p-4 rounded border cursor-pointer transition text-start w-100 ${t?`border-primary border-2 bg-light`:`border-light border-1 bg-white`}`,style:{cursor:`pointer`},tabIndex:`0`,role:`button`,"aria-label":`${e.name}`,"aria-pressed":t,children:(0,f.jsx)(`div`,{className:`d-flex justify-content-between align-items-start`,children:(0,f.jsxs)(`div`,{className:`flex-grow-1`,children:[(0,f.jsx)(`h5`,{className:`h6 fw-bold mb-2 text-dark`,children:e.name}),e?.abstract&&(0,f.jsx)(`p`,{className:`text-muted small mb-0`,dangerouslySetInnerHTML:{__html:n}})]})})},e.id)})}):(0,f.jsx)(`div`,{className:`alert alert-info text-italic`,children:r.t(`Il servizio che stai cercando non è disponibile per la prenotazione appuntamento`)})]})})]})]}):y?(0,f.jsx)(`fieldset`,{className:`it-page-section`,children:(0,f.jsx)(`div`,{className:`cmp-card mt-2`,children:(0,f.jsxs)(`div`,{className:`card has-bkg-grey shadow-sm p-big`,children:[(0,f.jsx)(`div`,{className:`card-header border-0 p-0 mb-lg-30`,children:(0,f.jsx)(`div`,{className:`d-flex`,children:(0,f.jsx)(`h2`,{className:`title-xxlarge mb-1`,children:E?.name})})}),(0,f.jsx)(`div`,{className:`card p-3 p-lg-4 fieldset-body`,children:t?.dataValue?.id?(0,f.jsx)(`div`,{className:`services-list`,children:(0,f.jsx)(`div`,{className:`service-card p-4 rounded border transition border-light border-1 bg-white`,children:(0,f.jsx)(`div`,{className:`d-flex justify-content-between align-items-start`,children:(0,f.jsx)(`div`,{className:`flex-grow-1`,children:(0,f.jsx)(`p`,{className:`mb-2 text-dark text-paragraph`,children:t.dataValue.name})})})},t.dataValue.id)}):null})]})})}):null})},zn=class e extends Ln{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Lista Servizi`,group:`basic`,icon:`bi bi-list`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Ln.schema({type:`list-services`})}static editForm=In;attach(e,t){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent&&=(this.rootComponent.unmount(),null),this.rootComponent=(0,u.createRoot)(e),this.builderMode?(this.rootComponent.render((0,f.jsx)(`div`,{className:`my-1 border border-2 border-light rounded p-3 text-secondary`,children:(0,f.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`Lista Servizi`})})),this):(this.rootComponent.render((0,f.jsx)(Rn,{ref:t,component:this.component,onChange:e=>this.setValue(e),...this,current:this})),this)):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){e&&(this.shouldSetValue=!0,this.updateValue(e))}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Bn=l.Components.components.select,Vn=class extends Bn{attach(e){let t=super.attach(e);return(Array.isArray(this.refs.autocompleteInput)?this.refs.autocompleteInput:[this.refs.autocompleteInput]).forEach(e=>{e?.parentNode&&e.parentNode.removeChild(e)}),t}},Hn={pagebreak:A,dynamic_calendar:He,calendar:q,"calendar-advanced":st,sdcfile:Sn,address_map:Pn,"list-services":zn,select:Vn};function Un(e){if(!e||typeof e.addComponent!=`function`)throw Error(`registerFormioComponents requires Formio Components with addComponent(name, component)`);return Object.entries(Hn).forEach(([t,n])=>{e.addComponent(t,n)}),Hn}exports.Calendar=q,exports.CalendarAdvanced=st,exports.FormioAddressMap=Pn,exports.FormioDynamicCalendar=He,exports.FormioListServices=zn,exports.FormioPageBreak=A,exports.SdcFile=Sn,exports.Select=Vn,exports.formioCustomComponents=Hn,exports.registerFormioComponents=Un;
71
+ }`,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`fileKey`,label:`File form-data key`,weight:17,placeholder:`Enter the key name of a file for form data.`,tooltip:`Key name that you would like to modify for the file while calling API request.`,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`dir`,label:`Directory`,placeholder:`(optional) Enter a directory for the files`,tooltip:`This will place all the files uploaded in this field in the directory`,weight:20,conditional:{json:{"!==":[{var:`data.storage`},`googledrive`]}}},{type:`textfield`,input:!0,key:`dir`,label:`Folder ID`,placeholder:`(optional) Enter an ID of the folder for the files`,tooltip:`This will place all the files uploaded in this field in the folder`,weight:20,conditional:{json:{"===":[{var:`data.storage`},`googledrive`]}}},{type:`textfield`,input:!0,key:`fileNameTemplate`,label:`File Name Template`,placeholder:`(optional) { {name} }-{ {guid} }"`,tooltip:"Specify template for name of uploaded file(s). Regular template variables are available (`data`, `component`, `user`, `value`, `moment` etc.), also `fileName`, `guid` variables are available. `guid` part must be present, if not found in template, will be added at the end.",weight:25},{type:`checkbox`,input:!0,key:`image`,label:`Display as image(s)`,tooltip:`Instead of a list of linked files, images will be rendered in the view.`,weight:30},{type:`checkbox`,input:!0,key:`uploadOnly`,label:`Upload Only`,tooltip:`When this is checked, will only allow you to upload file(s) and consequently the download, in this component, will be unavailable.`,weight:33},{type:`checkbox`,input:!0,key:`privateDownload`,label:`Private Download`,tooltip:`When this is checked, the file download will send a POST request to the download URL with the x-jwt-token header. This will allow your endpoint to create a Private download system.`,weight:31,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`imageSize`,label:`Image Size`,placeholder:`100`,tooltip:`The image size for previewing images.`,weight:40,conditional:{json:{"==":[{var:`data.image`},!0]}}},{type:`textfield`,input:!0,key:`maxFiles`,label:`Numero massimo di file`,placeholder:`100`,tooltip:`Numero massimo di file caricabilii, default è 100.`,weight:40},{type:`checkbox`,input:!0,key:`webcam`,label:`Enable web camera`,tooltip:`This will allow using an attached camera to directly take a picture instead of uploading an existing file.`,weight:32},{type:`textfield`,input:!0,key:`webcamSize`,label:`Webcam Width`,placeholder:`320`,tooltip:`The webcam size for taking pictures.`,weight:38,conditional:{json:{"==":[{var:`data.webcam`},!0]}}},{type:`datagrid`,input:!0,label:`File Types`,key:`fileTypes`,tooltip:`Specify file types to classify the uploads. This is useful if you allow multiple types of uploads but want to allow the user to specify which type of file each is.`,weight:11,components:[{label:`Label`,key:`label`,input:!0,type:`textfield`},{label:`Value`,key:`value`,input:!0,type:`textfield`}]},{type:`textfield`,input:!0,key:`filePattern`,label:`File Pattern`,placeholder:`.jpg,video/*,application/pdf`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file patterns.`,weight:50},{type:`textfield`,input:!0,key:`fileMinSize`,label:`File Minimum Size`,placeholder:`1MB`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.`,weight:60},{type:`textfield`,input:!0,key:`fileMaxSize`,label:`File Maximum Size`,placeholder:`10MB`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.`,weight:70},{type:`textfield`,input:!0,key:`maxFiles`,label:`Numero massimo di file`,placeholder:`100`,tooltip:`Numero massimo di file caricabilii, default è 100.`,weight:40}],ft=[{key:`unique`,ignore:!0},{key:`validateOn`,ignore:!0}];function pt(...e){return p.Components.baseEditForm([{key:`display`,components:ut},{key:`data`,components:lt},{label:`File`,key:`file`,weight:5,components:dt},{key:`validation`,components:ft}],...e)}var mt=o(((e,t)=>{t.exports=Array.isArray})),ht=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),gt=o(((e,t)=>{var n=ht(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),_t=o(((e,t)=>{t.exports=gt().Symbol})),vt=o(((e,t)=>{var n=_t(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),yt=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),bt=o(((e,t)=>{var n=_t(),r=vt(),i=yt(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),xt=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),St=o(((e,t)=>{var n=bt(),r=xt(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Ct=o(((e,t)=>{var n=mt(),r=St(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),wt=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Tt=o(((e,t)=>{var n=bt(),r=wt(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Et=o(((e,t)=>{t.exports=gt()[`__core-js_shared__`]})),Dt=o(((e,t)=>{var n=Et(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Ot=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),kt=o(((e,t)=>{var n=Tt(),r=Dt(),i=wt(),a=Ot(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),At=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),jt=o(((e,t)=>{var n=kt(),r=At();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Mt=o(((e,t)=>{t.exports=jt()(Object,`create`)})),Nt=o(((e,t)=>{var n=Mt();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Pt=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Ft=o(((e,t)=>{var n=Mt(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),It=o(((e,t)=>{var n=Mt(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Lt=o(((e,t)=>{var n=Mt(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),Rt=o(((e,t)=>{var n=Nt(),r=Pt(),i=Ft(),a=It(),o=Lt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),zt=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Bt=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Vt=o(((e,t)=>{var n=Bt();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Ht=o(((e,t)=>{var n=Vt(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Ut=o(((e,t)=>{var n=Vt();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Wt=o(((e,t)=>{var n=Vt();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Gt=o(((e,t)=>{var n=Vt();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Kt=o(((e,t)=>{var n=zt(),r=Ht(),i=Ut(),a=Wt(),o=Gt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),qt=o(((e,t)=>{t.exports=jt()(gt(),`Map`)})),Jt=o(((e,t)=>{var n=Rt(),r=Kt(),i=qt();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Yt=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Xt=o(((e,t)=>{var n=Yt();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Zt=o(((e,t)=>{var n=Xt();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),Qt=o(((e,t)=>{var n=Xt();function r(e){return n(this,e).get(e)}t.exports=r})),$t=o(((e,t)=>{var n=Xt();function r(e){return n(this,e).has(e)}t.exports=r})),en=o(((e,t)=>{var n=Xt();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),tn=o(((e,t)=>{var n=Jt(),r=Zt(),i=Qt(),a=$t(),o=en();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),nn=o(((e,t)=>{var n=tn(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),rn=o(((e,t)=>{var n=nn(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),an=o(((e,t)=>{var n=rn(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),on=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),sn=o(((e,t)=>{var n=_t(),r=on(),i=mt(),a=St(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),cn=o(((e,t)=>{var n=sn();function r(e){return e==null?``:n(e)}t.exports=r})),ln=o(((e,t)=>{var n=mt(),r=Ct(),i=an(),a=cn();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),un=o(((e,t)=>{var n=St(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),dn=o(((e,t)=>{var n=ln(),r=un();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Y=o(((e,t)=>{var n=dn();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),fn=o(((e,t)=>{var n=jt();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),pn=o(((e,t)=>{var n=fn();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),mn=o(((e,t)=>{var n=pn(),r=Bt(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),hn=o(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),gn=o(((e,t)=>{var n=mn(),r=ln(),i=hn(),a=wt(),o=un();function s(e,t,s,c){if(!a(e))return e;t=r(t,e);for(var l=-1,u=t.length,d=u-1,f=e;f!=null&&++l<u;){var p=o(t[l]),m=s;if(p===`__proto__`||p===`constructor`||p===`prototype`)return e;if(l!=d){var h=f[p];m=c?c(h,p,f):void 0,m===void 0&&(m=a(h)?h:i(t[l+1])?[]:{})}n(f,p,m),f=f[p]}return e}t.exports=s})),_n=c(o(((e,t)=>{var n=gn();function r(e,t,r){return e==null?e:n(e,t,r)}t.exports=r}))(),1),vn=c(Y(),1);document.documentElement.lang.toString();var yn=class{constructor(){this.token=null,this.basePath=null,this.init()}init(){this.token=null,this.basePath=j()}async getSessionAuthToken(){let e=this;await S.default.get(e.basePath+`/api/session-auth`).then(t=>{e.token=t.data.token}).catch(e=>{v.default.fire(`'error_message_detail`,`'auth_error'`,`error`)})}getSessionAuthTokenPromise(){let e=this;return new Promise(async(t,n)=>{ze(`auth-token`)?t({token:ze(`auth-token`)}):await S.default.get(e.basePath+`/api/session-auth?with-cookie=true`,{withCredentials:!0,headers:{"Content-Type":`application/json; charset=utf-8`}}).then(e=>{let t=(0,T.jwtDecode)(e.data.token);t.exp&&Be(`auth-token`,e.data.token,t.exp)}).catch(e=>{console.log(e)})})}getToken(){return this.token}execAuthenticatedCall(e){this.token?e(this.token):this.getSessionAuthTokenPromise().then(t=>{this.token=t.token,e(this.token)})}},bn=l.Formio.Components.components.file,xn=null;document.querySelector(`widget-formio`)!==null&&(xn=document.querySelector(`widget-formio`).getAttribute(`signature-check-ws-url`));var Sn=({component:e,current:t,onChange:n,i18next:r})=>{let[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(new Map),[c,l]=(0,d.useState)(!1),u=new yn;(0,d.useEffect)(()=>{u.getSessionAuthTokenPromise()},[]);let p=(e,t)=>{s(n=>{let r=new Map(n);return r.set(e,{...t,progress:Number(t?.progress)||0}),r})};function m(t){return t.size>(A(e.fileMaxSize)||A(`1GB`))?{code:`size-files`,message:`${r.t(`I file non possono superare le dimensioni di`)} ${e.fileMaxSize?e.fileMaxSize:`1GB`}`}:i.length>=(e.maxFiles?parseInt(e.maxFiles):e.multiple?100:1)?{code:`too-many-files`,message:`${r.t(`Puoi caricare massimo `)} ${e.maxFiles||100} ${r.t(`file`)}`}:t.size<A(e.fileMinSize)?{code:`file-too-small`,message:`${r.t(`I file devono avare una dimensione superiore a `)} ${e.fileMinSize}`}:null}function h(){if(e.filePattern){let t=e.filePattern.split(`,`).map(e=>e.trim()).filter(Boolean).reduce((e,t)=>{let n=t.startsWith(`.`)?t:`.${t}`,r=C.default.getType(n);return r?(e[r]||(e[r]=[]),e[r].push(n),e):e},{});return Object.keys(t).length?t:void 0}else return!0}let g=e=>{let t={};return t.originalName=e.originalName?e.originalName:e.name,t.name=e.name,t.url=e.url,t.data=e.data,t.signature_validation=e.signature_validation,t.mime_type=e.mime_type,t.storage=`url`,t.size=e.size,t},{getRootProps:y,getInputProps:b,fileRejections:T,isDragActive:E,open:D}=(0,x.useDropzone)({onDrop:e=>{e.map(e=>{k(e).then(e=>{})})},maxFiles:e.maxFiles?parseInt(e.maxFiles)-i.length:e.multiple?100:1,validator:m,accept:h()}),O=e=>{let t=j()+`/api/attachments/`+e.data.id;fetch(t,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${ze(`auth-token`)}`},strictErrors:!0}).then(()=>{a(t=>{let r=t.filter(t=>t.data.id!==e.data.id);return n(r),r})}).catch(e=>{v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori durante l'eliminazione del file`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),console.error(e)})},ee=()=>{let e=typeof t?.getCurrentValue==`function`?t.getCurrentValue():t?.dataValue;e?.length>0&&(a(e),setTimeout(()=>{n(e)},100))};(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&c===!1?(l(!0),setTimeout(()=>{ee()},1e3)):(l(!1),setTimeout(()=>{ee()},1e3))},[]);async function k(i){let o,c=j()+`/it/upload`,l={mime_type:i.type,name:i.name,original_filename:i.name,protocol_required:e.protocol_required,size:i.size};return await S.default.post(c,l,{maxContentLength:1/0,maxBodyLength:1/0}).then(async c=>(o=c.data.id,i.url=j()+`/it/allegati/`+o,i.storage=`url`,i.mime_type=i.type,i.protocol_required=e.protocol_required,i.data={...c.data,baseUrl:j()+`/it/allegati/`+o},p(o,i),await S.default.put(c.data.uri,i,{onUploadProgress:e=>{let t=Math.round(e.loaded*100/e.total);s(e=>{let n=new Map(e),r=i;return r.progress=parseInt(t),n.has(o)&&n.set(o,r),n})},maxContentLength:1/0,maxBodyLength:1/0,headers:{"Content-Type":`multipart/form-data`}}).then(async c=>{let l=c.headers.etag.replace(/\\|"/gi,``)||null;return await S.default.put(j()+`/it/upload/`+o,{file_hash:l,check_signature:e.check_signature}).then(async r=>{s(e=>{let t=new Map(e);return t.delete(o),t});let c=t.dataValue||[],l=null;if(a(e=>{let t=[...e,g(i)];return l=t.length-1,n(t),t}),e.check_signature&&r.data.url&&xn)return await S.default.post(xn,{url:r.data.url,content:null},{headers:{"Content-Type":`application/json`}}).then(e=>{i.signature_validation=e.data.sign,c[l].signature_validation=e.data.sign}).catch(e=>{c[l].signature_validation=`File validation error: `+e});s(e=>{let t=new Map(e);return t.delete(o),t})}).catch(e=>{s(e=>{let t=new Map(e);return t.delete(o),t}),console.log(e),v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})}).catch(e=>{s(e=>{let t=new Map(e);return t.delete(o),t}),console.log(e),v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})}))).catch(e=>{console.log(e),v.default.fire({title:``,html:`<p>${r.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:r.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),s(e=>{let t=new Map(e);return t.delete(o),t})})}function A(e){if(typeof e==`string`){if(e.search(/kb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024);if(e.search(/mb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024*1024);if(e.search(/gb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024*1024*1024);if(e.search(/b/i)===e.length-1||e.search(/s/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/m/i)===e.length-1)return parseFloat(e.substring(0,e.length-1)*60);if(e.search(/h/i)===e.length-1)return parseFloat(e.substring(0,e.length-1)*3600)}return e}function M(e,t=2){if(!+e)return`0 Bytes`;let n=1024,r=t<0?0:t,i=[`Bytes`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],a=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/n**+a).toFixed(r))} ${i[a]}`}return t.conditionallyHidden()||t.visible===!1?null:(0,f.jsx)(f.Fragment,{children:c?(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`label`,{className:`col-form-label floating-label`,htmlFor:`${e.id}-${e.key}`,children:[e.label,e.validate.required&&(0,f.jsx)(`span`,{className:`text-danger`})]}),(0,f.jsxs)(`ul`,{className:`upload-file-list`,children:[i.map((e,t)=>(0,f.jsxs)(`li`,{className:`upload-file success mw-100`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,f.jsxs)(`p`,{children:[(0,f.jsx)(`span`,{className:`visually-hidden`,children:r.t(`File caricato:`)}),e.name,(0,f.jsx)(`span`,{className:`upload-file-weight`,children:M(e.size)})]})]},e.size+t)),i.length<1&&(0,f.jsxs)(`li`,{className:`upload-file text-secondary mw-100`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`light`,icon:`it-files`,title:`Icona file`,size:`sm`}),(0,f.jsx)(`p`,{children:r.t(`Nessun elemento`)})]})]})]}):(0,f.jsxs)(f.Fragment,{children:[e.hideLabel||e.hidden?``:(0,f.jsxs)(`label`,{className:`col-form-label floating-label`,htmlFor:`${e.id}-${e.key}`,title:e.tooltip||void 0,children:[e.label,e.validate.required&&(0,f.jsx)(`span`,{className:`text-danger`}),e.tooltip&&(0,f.jsx)(`i`,{tabIndex:0,className:`bi bi-question-circle text-muted ms-1`,"data-tooltip":e.tooltip,"aria-expanded":`false`})]}),(0,f.jsxs)(`div`,{className:`my-1 border-2 border-light file-uploader-box rounded p-3 text-secondary${E?` dragover`:``}`,style:{border:`dashed`},...y({onClick:e=>e.stopPropagation()}),children:[(0,f.jsx)(`input`,{id:`${e.id}-${e.key}`,"aria-describedby":`file-uploader-description-${e.id}-${e.key}`,...b()}),(0,f.jsxs)(`div`,{className:`upload-dragdrop${E?` dragover`:``}`,children:[(0,f.jsx)(`div`,{className:`ms-1 me-3`,children:(0,f.jsx)(_.Icon,{color:`secondary`,icon:`it-upload`,title:r.t(`Carica file`),size:`_sm`})}),(0,f.jsxs)(`div`,{className:`upload-dragdrop-text`,children:[(0,f.jsx)(`div`,{className:`h5`,id:`file-uploader-description-${e.id}-${e.key}`,children:r.t(`Trascina il file per caricarlo`)}),(0,f.jsxs)(`p`,{className:`d-inline-flex`,children:[r.t(`oppure`),(0,f.jsx)(_.Button,{tag:`input`,type:`button`,value:r.t(`selezionalo dal dispositivo`),onClick:D,className:`px-1 py-0 text-decoration-underline primary-color`,size:`xs`})]})]})]})]}),(0,f.jsx)(`div`,{dangerouslySetInnerHTML:{__html:w.default.sanitize(e.description||``)}}),(0,f.jsxs)(`ul`,{className:`upload-file-list my-0`,children:[i.map((e,t)=>(0,f.jsxs)(`li`,{className:`upload-file success`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,f.jsxs)(`p`,{children:[(0,f.jsx)(`span`,{className:`visually-hidden`,children:r.t(`File caricato:`)}),e.name,(0,f.jsx)(`span`,{className:`upload-file-weight`,children:M(e.size)})]}),(0,f.jsx)(_.Button,{className:`px-1`,onClick:()=>O(e),children:(0,f.jsx)(_.Icon,{title:`${r.t(`Elimina file caricato`)} ${e.name}`,color:`secondary`,icon:`it-delete`,className:`ms-auto pointer`,size:`sm`})})]},e.size+t)),Array.from(o.entries()).map(([e,t])=>(0,f.jsxs)(`li`,{className:`upload-file success`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,f.jsxs)(`p`,{children:[(0,f.jsx)(`span`,{className:`visually-hidden`,children:r.t(`Caricamento file:`)}),t.name,(0,f.jsx)(`span`,{className:`upload-file-weight`,children:M(t.size)})]}),(0,f.jsx)(_.Progress,{value:Number(t?.progress)||0})]},e))]}),!!(T&&T.length)&&(0,f.jsx)(`div`,{className:`formio-error-wrapper`,children:(0,f.jsx)(`ul`,{className:`formio-errors upload-file-list my-0 `,children:T.map(({file:t,errors:n},i)=>(0,f.jsxs)(`li`,{className:`upload-file error`,children:[(0,f.jsxs)(`div`,{className:`upload-file-name-error-wrapper`,children:[(0,f.jsx)(_.Icon,{"aria-hidden":`true`,color:`error`,icon:`it-error`,title:`Icona file`,size:`sm`}),(0,f.jsxs)(`p`,{className:`text-wrap error`,children:[(0,f.jsx)(`span`,{className:`visually-hidden`,children:r.t(`Errore caricamento file:`)}),t.name,(0,f.jsx)(`span`,{className:`upload-file-weight`,children:M(t.size)})]})]}),(0,f.jsx)(`div`,{children:n.map(t=>t.code===`file-invalid-type`?(0,f.jsxs)(`p`,{className:`text-wrap ms-0`,children:[r.t(`I file possono essere di tipo `),e.filePattern]}):t.code===`too-many-files`?(0,f.jsxs)(`p`,{className:`text-wrap ms-0`,children:[r.t(`Puoi caricare massimo `),` `,e.maxFiles?e.maxFiles:e.multiple?100:1,` `,r.t(`file`)]}):(0,f.jsx)(`p`,{className:`text-wrap ms-0`,children:t.message}))})]},t.size+i))})})]})})},Cn=class e extends bn{constructor(e,t,n){super({...e,clearOnHide:!1},t,n),this.reactRef=null,this.lastRenderedVisible=void 0,this.rootComponent=null,this.mountNode=null}static get builderInfo(){return{title:`File Sdc`,group:`basic`,icon:`bi bi-file-earmark-text`,documentation:``,weight:70,schema:e.schema()}}get emptyValue(){return[]}init(){if(super.init(),this.component?.multiple&&!Array.isArray(this.getCurrentValue())){this.dataValue=[];let e=this.path||this.component?.key;e&&this.rootValue&&(0,_n.default)(this.rootValue,e,[])}}static schema(){return bn.schema({type:`sdcfile`,modelType:`array`})}static editForm=pt;getI18next(){return this.i18next&&typeof this.i18next.t==`function`?this.i18next:{language:this.options?.language||document?.documentElement?.lang||`it`,t:(e,t)=>this.t(e,t)}}hideFileProcessingLoader(){this.refs?.fileProcessingLoader&&(this.refs.fileProcessingLoader.style.display=`none`)}renderReact(){if(this.rootComponent){if(this.builderMode){this.rootComponent.render((0,f.jsx)(`div`,{className:`my-1 border border-2 border-light file-uploader-box rounded p-3 text-secondary`,children:(0,f.jsx)(`div`,{className:`upload-dragdrop`,children:(0,f.jsx)(`div`,{className:`upload-dragdrop-text`,children:(0,f.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`File Sdc`})})})}));return}this.rootComponent.render((0,f.jsx)(Sn,{component:this.component,current:this,i18next:this.getI18next(),onChange:e=>this.updateValueFromReact(e)}))}}attach(e){let t=super.attach(e);this.hideFileProcessingLoader();let n=`react-${this.id}`;this.loadRefs(e,{[n]:`single`});let r=this.refs[n];return r?(this.rootComponent&&this.mountNode!==r&&(this.rootComponent.unmount(),this.rootComponent=null),this.rootComponent||=(0,u.createRoot)(r),this.mountNode=r,this.lastRenderedVisible=this.visible,this.renderReact(),t):t}updateValueFromReact(e,t={modified:!0}){let n=this.normalizeValue(e,t),r=this.updateValue(n,t),i=this.path||this.component?.key;if(i&&this.rootValue){let e=(0,vn.default)(this.rootValue,i);this.isEqual(e,n)||(0,_n.default)(this.rootValue,i,n)}return r}setValue(e,t={}){let n=this.normalizeValue(e,t),r=super.setValue(n,t),i=this.path||this.component?.key;if(i&&this.rootValue){let e=(0,vn.default)(this.rootValue,i);this.isEqual(e,n)||(0,_n.default)(this.rootValue,i,n)}return r}normalizeValue(e,t={}){let n=super.normalizeValue(e,t);return!this.component?.multiple||Array.isArray(n)?n:n==null||n===``?[]:[n]}detach(){return this.hideFileProcessingLoader(),this.rootComponent&&=(this.rootComponent.unmount(),null),this.mountNode=null,super.detach()}getValue(){return this.getCurrentValue()}get validationValue(){return this.getCurrentValue()}getCurrentValue(){let e=super.getValue(),t=this.path||this.component?.key,n=t&&this.rootValue?(0,vn.default)(this.rootValue,t):void 0;return this.component?.multiple?Array.isArray(e)&&e.length>0?e:Array.isArray(n)?n:[]:e??n??null}isEmpty(e=this.validationValue){return this.component?.multiple?!Array.isArray(e)||e.length===0:e==null||e===``}checkCondition(e,t){let n=super.checkCondition(e,t),r=this.visible;return this.lastRenderedVisible!==r&&(this.lastRenderedVisible=r,this.renderReact()),n}render(){let e=`<div ref="react-${this.id}"></div>`;return Object.getPrototypeOf(Object.getPrototypeOf(bn.prototype)).render.call(this,e)}},wn=[{key:`labelPosition`,ignore:!0},{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0}];function Tn(...e){return p.Components.baseEditForm([{key:`display`,components:wn}],...e)}var En=({value:e,defaultValue:t=``,onConfirm:n,source:r,disabled:i,onClear:a,tClearInput:o=()=>`Clear input`,...s})=>{let c=(0,d.useRef)(null),l=e=>{setTimeout(()=>{c.current&&(c.current.elementReferences[-1].value=e)},0)};(0,d.useEffect)(()=>{e!==void 0&&l(e)},[e]),(0,d.useEffect)(()=>{i?c.current&&(c.current.elementReferences[-1].disabled=!0):c.current&&(c.current.elementReferences[-1].disabled=!1)},[i]);let u=()=>{a&&a()},p=(e,t)=>{c.current.elementReferences[-1].classList.contains(`autocomplete__input--focused`)&&r(e,t)},m=t=>{t?n(t):l(e)};return(0,f.jsxs)(`div`,{style:{position:`relative`,width:`100%`},children:[(0,f.jsx)(E.default,{ref:c,...s,defaultValue:t,onConfirm:m,source:p}),!!(e&&e.length>0&&!i)&&(0,f.jsx)(`button`,{onClick:u,style:{position:`absolute`,right:`0px`,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:`none`,cursor:`pointer`,padding:0},"aria-label":o(),children:(0,f.jsx)(_.Icon,{icon:`it-close`,size:`sm`,title:o()})})]})},Dn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==`,On=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=`,kn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC`,An=({position:e,areasLayer:t,bounds:n,onMarkedMoved:r})=>{let i=(0,d.useRef)(null),a=null,[o,s]=(0,d.useState)([]),c=(0,D.tileLayer)(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>`}),l=[41.9,12.5],u=()=>{let o=D.default.map(i.current,{keyboard:!1,minZoom:6,maxZoom:18}).setView(l,10);c.addTo(o),t&&t.map(e=>{e.addTo(o)});let s=e?[`${e.lat}`,`${e.lon}`]:n?n.getCenter():l;if(delete D.default.Icon.Default.prototype._getIconUrl,D.default.Icon.Default.mergeOptions({iconRetinaUrl:Dn,iconUrl:On,shadowUrl:kn}),a=D.default.marker(s,{draggable:!0}).addTo(o),a.on(`moveend`,function(e){r(e.target.getLatLng(),a)}),o.on(`click`,function(e){let t=e.latlng;a&&a.setLatLng(t).update(),r(t,a)}),!e&&n)o.fitBounds(n);else{let t=e?[e.lat,e.lon]:l;a&&(a.setLatLng(t).update(),o.setView(t,15))}};return(0,d.useEffect)(()=>{i.current&&u()},[i]),(0,f.jsx)(`div`,{className:`d-block`,style:{height:`60vh`,width:`100%`,display:`block`},children:(0,f.jsx)(`div`,{ref:i,style:{height:`100%`,width:`100%`},"aria-hidden":!0})})},jn=l.Formio.Components.components.field,Mn=({component:e,value:t,current:n,onChange:r,i18next:i})=>{let[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)([]),[l,u]=(0,d.useState)(),[p,m]=(0,d.useState)(),[h,g]=(0,d.useState)(!1),[y,b]=(0,d.useState)(),[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(),[T,E]=(0,d.useState)(),[ee,k]=(0,d.useState)(!1),[A,M]=(0,d.useState)(``),[te,N]=(0,d.useState)(``),[P,F]=(0,d.useState)(!1),[I,L]=(0,d.useState)(!1),R=new URLSearchParams(window.location.search).get(`area`),{geographic_areas_id:ne}=window.OC_SERVICE_DETAILS,z=(0,d.useRef)(),B=i.language,re=D.default.latLngBounds(),ie=R||(ne&&ne.length>0?ne:void 0),ae=(e,t)=>{z.current=e;let n=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&countrycodes=it&viewbox=${l}&bounded=1&addressdetails=1&limit=14&format=jsonv2&accept-language=${B}`,r=[],i=[];S(!0),fetch(n).then(e=>e.json()).then(n=>{if(n.length&&z.current===e){S(!0);let e=n.map((e,t)=>{let{lat:n,lon:r}=e,i=`${j()}/api/geographic-areas/contains?lat=${n}&lon=${r}&geographic_areas_ids=${y.join(`,`)}`;return fetch(i).then(e=>e.json()).then(t=>t.result?(e.label=Re(e),e):null)});return Promise.all(e)}else z.current===e&&(t([]),S(!1))}).then(n=>{n=n?n.filter(e=>e!==null):[],n.length>0?(n.forEach((e,t)=>{n[t].label=Re(e)}),n=O.default.uniqWith(n,(e,t)=>e.label===t.label),n.forEach((e,t)=>{i.push(e.label),r.push(e)}),z.current===e&&(t(i),c(r),S(!1))):z.current===e&&(t([]),S(!1))}).catch(e=>{console.error(`Error fetching locations:`,e),S(!1)})},oe=(e,t)=>{ae(e,t)},se=(e,t)=>{let{lat:n,lng:r}=e,i=`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${n}&lon=${r}&accept-language=${B}`;fetch(i).then(e=>e.json()).then(e=>{if(e&&e.display_name)if(e.label=Re(e),e.lat=n,e.lon=r,t)t.bindPopup(`${e.label}`,{className:`address-map-popup`}).openPopup(),E(e);else{E(e);return}}).catch(e=>console.error(`Error with reverse geocoding:`,e))};function ce(){navigator.geolocation.getCurrentPosition(e=>{let t=e.coords.latitude,n=e.coords.longitude;if((y||[]).length>0){let e=`${j()}/api/geographic-areas/contains?lat=${t}&lon=${n}&geographic_areas_ids=${y.join(`,`)}`;fetch(e).then(e=>e.json()).then(e=>{e.result?(o({lat:t,lon:n}),se({lat:t,lng:n}),L(!I)):L(!I)})}else o({lat:t,lon:n}),se({lat:t,lng:n}),L(!I)},e=>{e?.code===1?(F(!P),N(i.t(`error_message_code_1`))):e?.code===2?(F(!P),N(i.t(`error_message_code_2`))):e?.code===3?(F(!P),N(i.t(`error_message_code_3`))):(F(!P),N(i.t(`error_message_generic`)))})}(0,d.useEffect)(()=>{t&&o(t),n.valuePosition&&o(n.valuePosition)},[t,n]);let le=()=>{t&&o(t),n.valuePosition&&o(n.valuePosition)};(0,d.useEffect)(()=>{window?.Formio?.formioReady.then(()=>{setTimeout(()=>{le(),ue()},1)})},[]);let ue=()=>{let e=`${j()}/api/geographic-areas`,t=[],n=[],r=[];fetch(e).then(e=>e.json()).then(e=>{if(Array.isArray(e)&&e.length>0){e.filter(e=>ie?Array.isArray(ie)?ie.includes(e.id):e.id===ie:!0).forEach(e=>{t.push(e.id);let i=JSON.parse(e.geofence);n.push(i);let a=D.default.geoJSON(i,{style:{color:`#3478bd`,fillColor:`#87CEEB`,fillOpacity:.2,weight:1.5},filter:function(e){return e.geometry.type===`Polygon`||e.geometry.type===`MultiPolygon`}});re.extend(a.getBounds()),r.push(a)}),m(r),b(t),w(re);let i=re.getNorthEast(),a=re.getSouthWest();u([i.lng,i.lat,a.lng,a.lat])}else console.log(`No geographic_areas_ids found.`)}).catch(e=>{console.error(`Error with reverse geocoding:`,e)})},de=()=>{M(a?.label?a.label:``)};(0,d.useEffect)(()=>{de(),r(a)},[a]),(0,d.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&ee===!1?k(!0):k(!1)},[]);let fe=()=>{if(T){let e=`${j()}/api/geographic-areas/contains?lat=${T.lat}&lon=${T.lon}&geographic_areas_ids=${y.join(`,`)}`;g(!0),fetch(e).then(e=>e.json()).then(e=>{g(!1),e?e.result===!1?v.default.fire({title:``,html:`<p>`+i.t(`Attenzione: Il luogo selezionato si trova al di fuori dell’area coperta dal servizio. Per favore, scegli un luogo all'interno dell'area evidenziata nella mappa.`)+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):e.result===!0&&(L(!I),o(T)):(g(!1),console.log(`No geographic-areas/contains .`))}).catch(e=>{console.error(`Error with geographic-areas/contains:`,e),v.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})}};return(0,f.jsx)(`div`,{children:(0,f.jsxs)(`div`,{id:`address-map-container-${e.key}`,className:`address-map-container`,children:[(0,f.jsx)(`div`,{children:(0,f.jsxs)(_.Modal,{wrapClassName:`formio-component-address_map`,isOpen:I,size:`lg`,scrollable:!0,toggle:()=>L(!I),labelledBy:`maps-evo`,container:Ve(),children:[(0,f.jsx)(_.ModalHeader,{toggle:()=>L(!I),id:`maps-evo`,children:i.t(`Individua il luogo sulla mappa`)}),(0,f.jsxs)(_.ModalBody,{children:[(0,f.jsx)(`p`,{children:(0,f.jsx)(`small`,{children:i.t(`Trascina l’icona nel punto preciso in cui si verifica l’evento che vuoi segnalare e fai click su Salva indirizzo`)})}),(0,f.jsx)(An,{position:a,areasLayer:p,bounds:C,onMarkedMoved:(e,t)=>{se(e,t)}})]}),(0,f.jsxs)(_.ModalFooter,{children:[(0,f.jsx)(_.Button,{color:`secondary`,onClick:()=>L(!I),children:i.t(`Chiudi`)}),(0,f.jsx)(_.Button,{color:`primary`,onClick:()=>{fe()},disabled:!T||h,children:i.t(`Salva indirizzo`)})]})]})}),(0,f.jsx)(`div`,{children:(0,f.jsxs)(_.Modal,{isOpen:P,toggle:()=>F(!P),withIcon:!0,labelledBy:`error-modal-message`,container:Ve(),children:[(0,f.jsx)(_.ModalHeader,{icon:`it-info-circle`,id:`error-modal-message`,children:i.t(`warning`)}),(0,f.jsx)(_.ModalBody,{children:(0,f.jsx)(`p`,{children:te})}),(0,f.jsx)(_.ModalFooter,{children:(0,f.jsx)(_.Button,{color:`primary`,onClick:()=>F(!P),children:i.t(`close`)})})]})}),(0,f.jsxs)(`div`,{className:`position-relative`,children:[(0,f.jsx)(En,{id:`${e.id}-${e.key}`,inputClasses:`form-control`,source:(0,O.debounce)(oe,520),onConfirm:e=>{S(!1),z.current=``,e&&(e===``&&o(null),o(s.find(t=>t.label===e)))},onClear:()=>{S(!1),z.current=``,o(null)},dropdownArrow:()=>null,minLength:3,disabled:ee,confirmOnBlur:!0,showNoOptionsFound:!x,defaultValue:a?.label,value:A,tNoResults:()=>i.t(`Nessun risultato trovato, prova a inserire l'indirizzo completo`),tClearInput:()=>i.t(`Clear input`)}),x&&(0,f.jsx)(`div`,{className:`position-absolute`,style:{width:`100%`,bottom:`0px`},children:(0,f.jsx)(_.Progress,{indeterminate:!0,label:`In elaborazione...`})})]}),!ee&&(0,f.jsxs)(_.Button,{type:`button`,value:i.t(`Individua con precisione sulla mappa`),onClick:()=>{/Mobi|Android/i.test(navigator.userAgent)?ce():(L(!0),E(!1))},icon:!0,className:`px-0 primary-color`,children:[(0,f.jsx)(_.Icon,{color:`primary`,icon:`it-map-marker-circle`,role:`presentation`}),(0,f.jsx)(`span`,{children:i.t(`Individua con precisione sulla mappa`)})]})]})})},Nn=class e extends jn{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Address Map`,group:`basic`,icon:`bi bi-map`,documentation:``,weight:70,schema:e.schema()}}static schema(){return jn.schema({type:`address_map`})}static editForm=Tn;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,u.createRoot)(e),this.rootComponent.render((0,f.jsx)(Mn,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this},this.dataValue)),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){this.valuePosition=e,this.updateValue(e)}getValue(){return this.valuePosition}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Pn=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{label:`Base url`,calculateValue:`let url = '`+j()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1}];function Fn(...e){return p.Components.baseEditForm([{key:`display`,components:Pn}],...e)}var In=l.Formio.Components.components.field,Ln=({component:e,current:t,onChange:n,i18next:r})=>{let i=`list-services`,a=`selected-category`,[o,s]=(0,d.useState)([]),[c,l]=(0,d.useState)([]),[u,p]=(0,d.useState)(null),[m,h]=(0,d.useState)(null),[g,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(!1),[x,S]=(0,d.useState)(!1),C=(0,d.useRef)(!1),T=(0,d.useRef)(),E=(0,d.useMemo)(()=>u&&(c.find(e=>e.name===u)||o.find(e=>e.name===u))||null,[u,c,o]),D=(0,d.useMemo)(()=>E?.services||[],[E]),O=async()=>{S(!0);let e=sessionStorage.getItem(i),t=sessionStorage.getItem(a);if(e)try{let n=JSON.parse(e);if(Array.isArray(n)&&n.length>0)return s(n),l(n),p((n.find(e=>e.name===t)||n[0])?.name||null),S(!1),n}catch{console.warn(`⚠️ Cache corrotta, rigenerazione...`)}let n=await window.FormioHelper.getBookingConfig(),r={};n.forEach(e=>{(e.categories??[]).forEach(t=>{r[t]||(r[t]={name:t,services:[]}),r[t].services.push(e)})});let o=Object.fromEntries(Object.entries(r).sort(([e],[t])=>e.localeCompare(t,`it`,{sensitivity:`base`}))),c=Object.values(o).filter(e=>(e.name??``).trim()!==``);return s(c),l(c),p(c[0]?.name||null),sessionStorage.setItem(i,JSON.stringify(c)),sessionStorage.setItem(a,c[0]?.name||``),S(!1),c};(0,d.useEffect)(()=>{u&&sessionStorage.setItem(a,u)},[u]),(0,d.useEffect)(()=>{C.current||(C.current=!0,O())},[]);let ee=e=>{let t=(e=``)=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=(e=``)=>e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/\s+/g,` `).trim(),r=(e=``)=>e.replace(/<[^>]*>/g,` `),i=(e,n)=>RegExp(`\\b${t(n)}`,`i`).test(e),a=(e,t)=>{let a=n(e.name),o=n((e.categories??[]).join(` `)),s=n(r(e.abstract??``));if(!t.every(e=>i(a,e)||i(o,e)||i(s,e)))return-1;let c=0;for(let e of t)i(a,e)?c+=3:i(o,e)?c+=2:i(s,e)&&(c+=1);return c},s=e.target.value;v(s);let c=n(s);if(!c){l(o),p(e=>e??o[0]?.name??null);return}let d=c.split(` `).filter(Boolean),f=o.map(e=>{let t=e.services.map(e=>({service:e,score:a(e,d)})).filter(e=>e.score>=0).sort((e,t)=>t.score-e.score).map(e=>e.service);return t.length?{...e,services:t}:null}).filter(Boolean);l(f),p(f.some(e=>e.name===u)?u:f[0]?.name??null)},k=e=>{h(e);let r=o.find(t=>t.services.some(t=>t.id===e.id));r&&p(r.name),n({id:e.id,link:e.link,name:e.name,show_howto_in_motivation:e.show_howto_in_motivation,categories:e.categories,offices:e.offices,abstract:e.abstract,view_type:e.view_type}),t.data.user_group=null,ot()},A=e=>{p(e.name),h(null),v(``),l(o),n({})};return(0,d.useEffect)(()=>{b(!!document.querySelector(`.formio-read-only`))},[]),(0,d.useEffect)(()=>{let e=setTimeout(()=>{let e=t?.dataValue??t?.getValue();if(e?.id&&(h(e),o.length>0)){let t=o.find(t=>t.services.some(t=>t.id===e.id));t&&p(t.name)}},500);return()=>clearTimeout(e)},[t?.dataValue,t?.data,o]),(0,d.useEffect)(()=>{let e=window.FormioInstance;if(!e)return;let n=()=>{let n=e.submission?.data?.[t?.component?.key];if(n?.id&&(h(n),o.length>0)){let e=o.find(e=>e.services.some(e=>e.id===n.id));e&&p(e.name)}};return e.on(`change`,n),()=>e.off(`change`,n)},[o,t?.component?.key]),x?(0,f.jsx)(`div`,{className:`services-booking`,ref:T,children:(0,f.jsxs)(`div`,{children:[r.t(`Caricamento in corso`),`...`]})}):(0,f.jsx)(`div`,{className:`services-booking`,ref:T,children:o&&!y?(0,f.jsxs)(_.Container,{children:[(0,f.jsx)(_.Row,{className:`mb-3`,children:(0,f.jsx)(_.Col,{children:(0,f.jsx)(`h3`,{className:`h6 fw-bold text-uppercase mb-3`,children:r.t(`Seleziona il servizio per cui stai richiedendo un appuntamento`)})})}),(0,f.jsx)(_.Row,{className:`mb-3`,children:(0,f.jsx)(_.Col,{children:(0,f.jsx)(`div`,{className:`search-container`,children:(0,f.jsx)(_.Input,{id:`search`,label:r.t(`Cerca`),type:`text`,value:g,onChange:ee,onInput:ee,infoText:r.t(`Cerca per categoria, servizio o descrizione`)})})})}),(0,f.jsxs)(_.Row,{className:`mb-3`,children:[E?(0,f.jsx)(_.Col,{lg:3,md:4,className:`mb-4 mb-lg-0`,children:(0,f.jsxs)(`div`,{className:`categories-list`,children:[(0,f.jsx)(`h3`,{className:`h6 fw-bold text-uppercase mb-3`,children:r.t(`Categorie`)}),c.length>0&&c.map(e=>{let t=u===e.name;return(0,f.jsxs)(`button`,{onClick:()=>A(e),className:`category-item w-100 text-start p-3 mb-2 border-0 rounded ${t?`category-active bg-primary text-white`:`bg-light text-dark`}`,children:[(0,f.jsx)(`span`,{className:`fw-500 d-block`,children:e.name}),(0,f.jsxs)(`small`,{className:`d-block mt-1 ${t?`text-white`:`text-muted`}`,children:[e.services.length,` `,e.services.length>1?r.t(`servizi`):r.t(`servizio`)]})]},e.name)})]})}):null,(0,f.jsx)(_.Col,{lg:E?9:12,md:E?8:12,children:(0,f.jsxs)(`div`,{className:`services-container`,children:[D.length>0?(0,f.jsxs)(`div`,{className:`services-header mb-4`,children:[(0,f.jsx)(`h3`,{className:`h5 fw-bold text-primary mb-0`,children:E?.name}),(0,f.jsx)(`div`,{className:`border-bottom border-primary mt-3 mb-4`})]}):null,D.length>0?(0,f.jsx)(`div`,{className:`services-list`,children:D.map(e=>{let t=m?.id===e.id,n=w.default.sanitize(e?.abstract);return(0,f.jsx)(`button`,{onClick:()=>k(e),className:`service-card mb-4 p-4 rounded border cursor-pointer transition text-start w-100 ${t?`border-primary border-2 bg-light`:`border-light border-1 bg-white`}`,style:{cursor:`pointer`},tabIndex:`0`,role:`button`,"aria-label":`${e.name}`,"aria-pressed":t,children:(0,f.jsx)(`div`,{className:`d-flex justify-content-between align-items-start`,children:(0,f.jsxs)(`div`,{className:`flex-grow-1`,children:[(0,f.jsx)(`h5`,{className:`h6 fw-bold mb-2 text-dark`,children:e.name}),e?.abstract&&(0,f.jsx)(`p`,{className:`text-muted small mb-0`,dangerouslySetInnerHTML:{__html:n}})]})})},e.id)})}):(0,f.jsx)(`div`,{className:`alert alert-info text-italic`,children:r.t(`Il servizio che stai cercando non è disponibile per la prenotazione appuntamento`)})]})})]})]}):y?(0,f.jsx)(`fieldset`,{className:`it-page-section`,children:(0,f.jsx)(`div`,{className:`cmp-card mt-2`,children:(0,f.jsxs)(`div`,{className:`card has-bkg-grey shadow-sm p-big`,children:[(0,f.jsx)(`div`,{className:`card-header border-0 p-0 mb-lg-30`,children:(0,f.jsx)(`div`,{className:`d-flex`,children:(0,f.jsx)(`h2`,{className:`title-xxlarge mb-1`,children:E?.name})})}),(0,f.jsx)(`div`,{className:`card p-3 p-lg-4 fieldset-body`,children:t?.dataValue?.id?(0,f.jsx)(`div`,{className:`services-list`,children:(0,f.jsx)(`div`,{className:`service-card p-4 rounded border transition border-light border-1 bg-white`,children:(0,f.jsx)(`div`,{className:`d-flex justify-content-between align-items-start`,children:(0,f.jsx)(`div`,{className:`flex-grow-1`,children:(0,f.jsx)(`p`,{className:`mb-2 text-dark text-paragraph`,children:t.dataValue.name})})})},t.dataValue.id)}):null})]})})}):null})},Rn=class e extends In{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Lista Servizi`,group:`basic`,icon:`bi bi-list`,documentation:``,weight:70,schema:e.schema()}}static schema(){return In.schema({type:`list-services`})}static editForm=Fn;attach(e,t){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent&&=(this.rootComponent.unmount(),null),this.rootComponent=(0,u.createRoot)(e),this.builderMode?(this.rootComponent.render((0,f.jsx)(`div`,{className:`my-1 border border-2 border-light rounded p-3 text-secondary`,children:(0,f.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`Lista Servizi`})})),this):(this.rootComponent.render((0,f.jsx)(Ln,{ref:t,component:this.component,onChange:e=>this.setValue(e),...this,current:this})),this)):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){e&&(this.shouldSetValue=!0,this.updateValue(e))}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},zn=l.Components.components.select,Bn=class extends zn{attach(e){let t=super.attach(e);return(Array.isArray(this.refs.autocompleteInput)?this.refs.autocompleteInput:[this.refs.autocompleteInput]).forEach(e=>{e?.parentNode&&e.parentNode.removeChild(e)}),t}},Vn={pagebreak:A,dynamic_calendar:Ue,calendar:qe,"calendar-advanced":ct,sdcfile:Cn,address_map:Nn,"list-services":Rn,select:Bn};function Hn(e){if(!e||typeof e.addComponent!=`function`)throw Error(`registerFormioComponents requires Formio Components with addComponent(name, component)`);return Object.entries(Vn).forEach(([t,n])=>{e.addComponent(t,n)}),Vn}exports.Calendar=qe,exports.CalendarAdvanced=ct,exports.FormioAddressMap=Nn,exports.FormioDynamicCalendar=Ue,exports.FormioListServices=Rn,exports.FormioPageBreak=A,exports.SdcFile=Cn,exports.Select=Bn,exports.formioCustomComponents=Vn,exports.registerFormioComponents=Hn;
74
72
  //# sourceMappingURL=index.cjs.map