@opencitylabs/formio-custom-components 0.3.4 → 0.3.5
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 +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +64 -64
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),Rt=require("@formio/js"),Et=require("react-dom/client"),Bt=require("@formio/react"),yr=require("react-day-picker"),Vs=require("react-countdown"),he=require("moment"),ue=require("design-react-kit"),He=require("sweetalert2");require("i18next");const
|
|
2
|
-
`+Ie+b}}var Oe=!1,$;{var J=typeof WeakMap=="function"?WeakMap:Map;$=new J}function X(b,U){if(!b||Oe)return"";{var Q=$.get(b);if(Q!==void 0)return Q}var le;Oe=!0;var ye=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var xe;xe=Ne.current,Ne.current=null,oe();try{if(U){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),Rt=require("@formio/js"),Et=require("react-dom/client"),Bt=require("@formio/react"),yr=require("react-day-picker"),Vs=require("react-countdown"),he=require("moment"),ue=require("design-react-kit"),He=require("sweetalert2");require("i18next");const Se=require("dayjs"),ci=require("@event-calendar/core"),xc=require("react-dropzone"),$t=require("axios"),Dc=require("mime"),zs=require("dompurify"),kc=require("jwt-decode"),Nt=require("leaflet"),di=require("lodash");var mr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pn(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var pr={exports:{}},Qt={};var hi;function Oc(){if(hi)return Qt;hi=1;var l=G,s=Symbol.for("react.element"),u=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,S=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function I(o,y,r){var c,h={},f=null,p=null;r!==void 0&&(f=""+r),y.key!==void 0&&(f=""+y.key),y.ref!==void 0&&(p=y.ref);for(c in y)i.call(y,c)&&!x.hasOwnProperty(c)&&(h[c]=y[c]);if(o&&o.defaultProps)for(c in y=o.defaultProps,y)h[c]===void 0&&(h[c]=y[c]);return{$$typeof:s,type:o,key:f,ref:p,props:h,_owner:S.current}}return Qt.Fragment=u,Qt.jsx=I,Qt.jsxs=I,Qt}var er={};var fi;function Yc(){return fi||(fi=1,process.env.NODE_ENV!=="production"&&(function(){var l=G,s=Symbol.for("react.element"),u=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),o=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),r=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),g=Symbol.iterator,Y="@@iterator";function _(b){if(b===null||typeof b!="object")return null;var U=g&&b[g]||b[Y];return typeof U=="function"?U:null}var k=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(b){{for(var U=arguments.length,Q=new Array(U>1?U-1:0),le=1;le<U;le++)Q[le-1]=arguments[le];j("error",b,Q)}}function j(b,U,Q){{var le=k.ReactDebugCurrentFrame,ye=le.getStackAddendum();ye!==""&&(U+="%s",Q=Q.concat([ye]));var xe=Q.map(function(Me){return String(Me)});xe.unshift("Warning: "+U),Function.prototype.apply.call(console[b],console,xe)}}var F=!1,R=!1,O=!1,v=!1,T=!1,w;w=Symbol.for("react.module.reference");function M(b){return!!(typeof b=="string"||typeof b=="function"||b===i||b===x||T||b===S||b===r||b===c||v||b===p||F||R||O||typeof b=="object"&&b!==null&&(b.$$typeof===f||b.$$typeof===h||b.$$typeof===I||b.$$typeof===o||b.$$typeof===y||b.$$typeof===w||b.getModuleId!==void 0))}function V(b,U,Q){var le=b.displayName;if(le)return le;var ye=U.displayName||U.name||"";return ye!==""?Q+"("+ye+")":Q}function E(b){return b.displayName||"Context"}function A(b){if(b==null)return null;if(typeof b.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof b=="function")return b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case i:return"Fragment";case u:return"Portal";case x:return"Profiler";case S:return"StrictMode";case r:return"Suspense";case c:return"SuspenseList"}if(typeof b=="object")switch(b.$$typeof){case o:var U=b;return E(U)+".Consumer";case I:var Q=b;return E(Q._context)+".Provider";case y:return V(b,b.render,"ForwardRef");case h:var le=b.displayName||null;return le!==null?le:A(b.type)||"Memo";case f:{var ye=b,xe=ye._payload,Me=ye._init;try{return A(Me(xe))}catch{return null}}}return null}var z=Object.assign,B=0,ee,ie,re,fe,te,de,ve;function me(){}me.__reactDisabledLog=!0;function oe(){{if(B===0){ee=console.log,ie=console.info,re=console.warn,fe=console.error,te=console.group,de=console.groupCollapsed,ve=console.groupEnd;var b={configurable:!0,enumerable:!0,value:me,writable:!0};Object.defineProperties(console,{info:b,log:b,warn:b,error:b,group:b,groupCollapsed:b,groupEnd:b})}B++}}function Z(){{if(B--,B===0){var b={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},b,{value:ee}),info:z({},b,{value:ie}),warn:z({},b,{value:re}),error:z({},b,{value:fe}),group:z({},b,{value:te}),groupCollapsed:z({},b,{value:de}),groupEnd:z({},b,{value:ve})})}B<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ne=k.ReactCurrentDispatcher,Ie;function Ce(b,U,Q){{if(Ie===void 0)try{throw Error()}catch(ye){var le=ye.stack.trim().match(/\n( *(at )?)/);Ie=le&&le[1]||""}return`
|
|
2
|
+
`+Ie+b}}var Oe=!1,$;{var J=typeof WeakMap=="function"?WeakMap:Map;$=new J}function X(b,U){if(!b||Oe)return"";{var Q=$.get(b);if(Q!==void 0)return Q}var le;Oe=!0;var ye=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var xe;xe=Ne.current,Ne.current=null,oe();try{if(U){var Me=function(){throw Error()};if(Object.defineProperty(Me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Me,[])}catch(Je){le=Je}Reflect.construct(b,[],Me)}else{try{Me.call()}catch(Je){le=Je}b.call(Me.prototype)}}else{try{throw Error()}catch(Je){le=Je}b()}}catch(Je){if(Je&&le&&typeof Je.stack=="string"){for(var we=Je.stack.split(`
|
|
3
3
|
`),qe=le.stack.split(`
|
|
4
4
|
`),Fe=we.length-1,Le=qe.length-1;Fe>=1&&Le>=0&&we[Fe]!==qe[Le];)Le--;for(;Fe>=1&&Le>=0;Fe--,Le--)if(we[Fe]!==qe[Le]){if(Fe!==1||Le!==1)do if(Fe--,Le--,Le<0||we[Fe]!==qe[Le]){var Be=`
|
|
5
|
-
`+we[Fe].replace(" at new "," at ");return b.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",b.displayName)),typeof b=="function"&&$.set(b,Be),Be}while(Fe>=1&&Le>=0);break}}}finally{Oe=!1,Ne.current=xe,Z(),Error.prepareStackTrace=ye}var nt=b?b.displayName||b.name:"",ft=nt?Ce(nt):"";return typeof b=="function"&&$.set(b,ft),ft}function P(b,U,Q){return X(b,!1)}function H(b){var U=b.prototype;return!!(U&&U.isReactComponent)}function N(b,U,Q){if(b==null)return"";if(typeof b=="function")return X(b,H(b));if(typeof b=="string")return Ce(b);switch(b){case r:return Ce("Suspense");case c:return Ce("SuspenseList")}if(typeof b=="object")switch(b.$$typeof){case y:return P(b.render);case h:return N(b.type,U,Q);case f:{var le=b,ye=le._payload,xe=le._init;try{return N(xe(ye),U,Q)}catch{}}}return""}var W=Object.prototype.hasOwnProperty,q={},ce=k.ReactDebugCurrentFrame;function se(b){if(b){var U=b._owner,Q=N(b.type,b._source,U?U.type:null);ce.setExtraStackFrame(Q)}else ce.setExtraStackFrame(null)}function Pe(b,U,Q,le,ye){{var xe=Function.call.bind(W);for(var
|
|
5
|
+
`+we[Fe].replace(" at new "," at ");return b.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",b.displayName)),typeof b=="function"&&$.set(b,Be),Be}while(Fe>=1&&Le>=0);break}}}finally{Oe=!1,Ne.current=xe,Z(),Error.prepareStackTrace=ye}var nt=b?b.displayName||b.name:"",ft=nt?Ce(nt):"";return typeof b=="function"&&$.set(b,ft),ft}function P(b,U,Q){return X(b,!1)}function H(b){var U=b.prototype;return!!(U&&U.isReactComponent)}function N(b,U,Q){if(b==null)return"";if(typeof b=="function")return X(b,H(b));if(typeof b=="string")return Ce(b);switch(b){case r:return Ce("Suspense");case c:return Ce("SuspenseList")}if(typeof b=="object")switch(b.$$typeof){case y:return P(b.render);case h:return N(b.type,U,Q);case f:{var le=b,ye=le._payload,xe=le._init;try{return N(xe(ye),U,Q)}catch{}}}return""}var W=Object.prototype.hasOwnProperty,q={},ce=k.ReactDebugCurrentFrame;function se(b){if(b){var U=b._owner,Q=N(b.type,b._source,U?U.type:null);ce.setExtraStackFrame(Q)}else ce.setExtraStackFrame(null)}function Pe(b,U,Q,le,ye){{var xe=Function.call.bind(W);for(var Me in b)if(xe(b,Me)){var we=void 0;try{if(typeof b[Me]!="function"){var qe=Error((le||"React class")+": "+Q+" type `"+Me+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof b[Me]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw qe.name="Invariant Violation",qe}we=b[Me](U,Me,le,Q,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Fe){we=Fe}we&&!(we instanceof Error)&&(se(ye),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",le||"React class",Q,Me,typeof we),se(null)),we instanceof Error&&!(we.message in q)&&(q[we.message]=!0,se(ye),C("Failed %s type: %s",Q,we.message),se(null))}}}var ge=Array.isArray;function _e(b){return ge(b)}function $e(b){{var U=typeof Symbol=="function"&&Symbol.toStringTag,Q=U&&b[Symbol.toStringTag]||b.constructor.name||"Object";return Q}}function Re(b){try{return ct(b),!1}catch{return!0}}function ct(b){return""+b}function Ue(b){if(Re(b))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",$e(b)),ct(b)}var it=k.ReactCurrentOwner,Yt={key:!0,ref:!0,__self:!0,__source:!0},st,je;function Ct(b){if(W.call(b,"ref")){var U=Object.getOwnPropertyDescriptor(b,"ref").get;if(U&&U.isReactWarning)return!1}return b.ref!==void 0}function At(b){if(W.call(b,"key")){var U=Object.getOwnPropertyDescriptor(b,"key").get;if(U&&U.isReactWarning)return!1}return b.key!==void 0}function ot(b,U){typeof b.ref=="string"&&it.current}function mt(b,U){{var Q=function(){st||(st=!0,C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",U))};Q.isReactWarning=!0,Object.defineProperty(b,"key",{get:Q,configurable:!0})}}function dt(b,U){{var Q=function(){je||(je=!0,C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",U))};Q.isReactWarning=!0,Object.defineProperty(b,"ref",{get:Q,configurable:!0})}}var tt=function(b,U,Q,le,ye,xe,Me){var we={$$typeof:s,type:b,key:U,ref:Q,props:Me,_owner:xe};return we._store={},Object.defineProperty(we._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(we,"_self",{configurable:!1,enumerable:!1,writable:!1,value:le}),Object.defineProperty(we,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ye}),Object.freeze&&(Object.freeze(we.props),Object.freeze(we)),we};function pt(b,U,Q,le,ye){{var xe,Me={},we=null,qe=null;Q!==void 0&&(Ue(Q),we=""+Q),At(U)&&(Ue(U.key),we=""+U.key),Ct(U)&&(qe=U.ref,ot(U,ye));for(xe in U)W.call(U,xe)&&!Yt.hasOwnProperty(xe)&&(Me[xe]=U[xe]);if(b&&b.defaultProps){var Fe=b.defaultProps;for(xe in Fe)Me[xe]===void 0&&(Me[xe]=Fe[xe])}if(we||qe){var Le=typeof b=="function"?b.displayName||b.name||"Unknown":b;we&&mt(Me,Le),qe&&dt(Me,Le)}return tt(b,we,qe,ye,le,it.current,Me)}}var gt=k.ReactCurrentOwner,We=k.ReactDebugCurrentFrame;function ht(b){if(b){var U=b._owner,Q=N(b.type,b._source,U?U.type:null);We.setExtraStackFrame(Q)}else We.setExtraStackFrame(null)}var lt;lt=!1;function rt(b){return typeof b=="object"&&b!==null&&b.$$typeof===s}function Qe(){{if(gt.current){var b=A(gt.current.type);if(b)return`
|
|
6
6
|
|
|
7
7
|
Check the render method of \``+b+"`."}return""}}function It(b){return""}var ae={};function Cr(b){{var U=Qe();if(!U){var Q=typeof b=="string"?b:b.displayName||b.name;Q&&(U=`
|
|
8
8
|
|
|
9
|
-
Check the top-level render call using <`+Q+">.")}return U}}function rr(b,U){{if(!b._store||b._store.validated||b.key!=null)return;b._store.validated=!0;var Q=Cr(U);if(ae[Q])return;ae[Q]=!0;var le="";b&&b._owner&&b._owner!==gt.current&&(le=" It was passed a child from "+A(b._owner.type)+"."),ht(b),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,le),ht(null)}}function at(b,U){{if(typeof b!="object")return;if(_e(b))for(var Q=0;Q<b.length;Q++){var le=b[Q];rt(le)&&rr(le,U)}else if(rt(b))b._store&&(b._store.validated=!0);else if(b){var ye=_(b);if(typeof ye=="function"&&ye!==b.entries)for(var xe=ye.call(b),
|
|
9
|
+
Check the top-level render call using <`+Q+">.")}return U}}function rr(b,U){{if(!b._store||b._store.validated||b.key!=null)return;b._store.validated=!0;var Q=Cr(U);if(ae[Q])return;ae[Q]=!0;var le="";b&&b._owner&&b._owner!==gt.current&&(le=" It was passed a child from "+A(b._owner.type)+"."),ht(b),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Q,le),ht(null)}}function at(b,U){{if(typeof b!="object")return;if(_e(b))for(var Q=0;Q<b.length;Q++){var le=b[Q];rt(le)&&rr(le,U)}else if(rt(b))b._store&&(b._store.validated=!0);else if(b){var ye=_(b);if(typeof ye=="function"&&ye!==b.entries)for(var xe=ye.call(b),Me;!(Me=xe.next()).done;)rt(Me.value)&&rr(Me.value,U)}}}function et(b){{var U=b.type;if(U==null||typeof U=="string")return;var Q;if(typeof U=="function")Q=U.propTypes;else if(typeof U=="object"&&(U.$$typeof===y||U.$$typeof===h))Q=U.propTypes;else return;if(Q){var le=A(U);Pe(Q,b.props,"prop",le,b)}else if(U.PropTypes!==void 0&&!lt){lt=!0;var ye=A(U);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ye||"Unknown")}typeof U.getDefaultProps=="function"&&!U.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function be(b){{for(var U=Object.keys(b.props),Q=0;Q<U.length;Q++){var le=U[Q];if(le!=="children"&&le!=="key"){ht(b),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",le),ht(null);break}}b.ref!==null&&(ht(b),C("Invalid attribute `ref` supplied to `React.Fragment`."),ht(null))}}var Ft={};function Te(b,U,Q,le,ye,xe){{var Me=M(b);if(!Me){var we="";(b===void 0||typeof b=="object"&&b!==null&&Object.keys(b).length===0)&&(we+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var qe=It();qe?we+=qe:we+=Qe();var Fe;b===null?Fe="null":_e(b)?Fe="array":b!==void 0&&b.$$typeof===s?(Fe="<"+(A(b.type)||"Unknown")+" />",we=" Did you accidentally export a JSX literal instead of a component?"):Fe=typeof b,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Fe,we)}var Le=pt(b,U,Q,ye,xe);if(Le==null)return Le;if(Me){var Be=U.children;if(Be!==void 0)if(le)if(_e(Be)){for(var nt=0;nt<Be.length;nt++)at(Be[nt],b);Object.freeze&&Object.freeze(Be)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else at(Be,b)}if(W.call(U,"key")){var ft=A(b),Je=Object.keys(U).filter(function(ze){return ze!=="key"}),Ut=Je.length>0?"{key: someKey, "+Je.join(": ..., ")+": ...}":"{key: someKey}";if(!Ft[ft+Ut]){var Tr=Je.length>0?"{"+Je.join(": ..., ")+": ...}":"{}";C(`A props object containing a "key" prop is being spread into JSX:
|
|
10
10
|
let props = %s;
|
|
11
11
|
<%s {...props} />
|
|
12
12
|
React keys must be passed directly to JSX without using spread:
|
|
@@ -45,7 +45,7 @@ if(data.calendarId && data.api_url){
|
|
|
45
45
|
}`,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 Pc(...l){return Bt.Components.baseEditForm([{key:"display",components:Tc}],...l)}function Mt(l){return(s={})=>{const u=s.width?String(s.width):l.defaultWidth;return l.formats[u]||l.formats[l.defaultWidth]}}function Xe(l){return(s,u)=>{const i=u?.context?String(u.context):"standalone";let S;if(i==="formatting"&&l.formattingValues){const I=l.defaultFormattingWidth||l.defaultWidth,o=u?.width?String(u.width):I;S=l.formattingValues[o]||l.formattingValues[I]}else{const I=l.defaultWidth,o=u?.width?String(u.width):l.defaultWidth;S=l.values[o]||l.values[I]}const x=l.argumentCallback?l.argumentCallback(s):s;return S[x]}}function Ze(l){return(s,u={})=>{const i=u.width,S=i&&l.matchPatterns[i]||l.matchPatterns[l.defaultMatchWidth],x=s.match(S);if(!x)return null;const I=x[0],o=i&&l.parsePatterns[i]||l.parsePatterns[l.defaultParseWidth],y=Array.isArray(o)?Rc(o,h=>h.test(I)):Nc(o,h=>h.test(I));let r;r=l.valueCallback?l.valueCallback(y):y,r=u.valueCallback?u.valueCallback(r):r;const c=s.slice(I.length);return{value:r,rest:c}}}function Nc(l,s){for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u)&&s(l[u]))return u}function Rc(l,s){for(let u=0;u<l.length;u++)if(s(l[u]))return u}function gn(l){return(s,u={})=>{const i=s.match(l.matchPattern);if(!i)return null;const S=i[0],x=s.match(l.parsePattern);if(!x)return null;let I=l.valueCallback?l.valueCallback(x[0]):x[0];I=u.valueCallback?u.valueCallback(I):I;const o=s.slice(S.length);return{value:I,rest:o}}}const gi=Symbol.for("constructDateFrom");function Ls(l,s){return typeof l=="function"?l(s):l&&typeof l=="object"&&gi in l?l[gi](s):l instanceof Date?new l.constructor(s):new Date(s)}function Ec(l,...s){const u=Ls.bind(null,l||s.find(i=>typeof i=="object"));return s.map(u)}let Ac={};function Ic(){return Ac}function Fc(l,s){return Ls(s||l,l)}function vi(l,s){const u=Ic(),i=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??u.weekStartsOn??u.locale?.options?.weekStartsOn??0,S=Fc(l,s?.in),x=S.getDay(),I=(x<i?7:0)+x-i;return S.setDate(S.getDate()-I),S.setHours(0,0,0,0),S}function yi(l,s,u){const[i,S]=Ec(u?.in,l,s);return+vi(i,u)==+vi(S,u)}const _i={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"}}},Vc=(l,s,u)=>{let i;const S=u?.addSuffix?_i[l].withPreposition:_i[l].standalone;return typeof S=="string"?i=S:s===1?i=S.one:i=S.other.replace("{{count}}",String(s)),u?.addSuffix?u.comparison&&u.comparison>0?"in "+i:"vor "+i:i},zc={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},Lc={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Wc={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},qc={date:Mt({formats:zc,defaultWidth:"full"}),time:Mt({formats:Lc,defaultWidth:"full"}),dateTime:Mt({formats:Wc,defaultWidth:"full"})},Hc={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},$c=(l,s,u,i)=>Hc[l],Bc={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},Uc={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},un={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"]},Gc={narrow:un.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:un.wide},Jc={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"]},Kc={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"}},Xc={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"}},Zc=l=>Number(l)+".",Qc={ordinalNumber:Zc,era:Xe({values:Bc,defaultWidth:"wide"}),quarter:Xe({values:Uc,defaultWidth:"wide",argumentCallback:l=>l-1}),month:Xe({values:un,formattingValues:Gc,defaultWidth:"wide"}),day:Xe({values:Jc,defaultWidth:"wide"}),dayPeriod:Xe({values:Kc,defaultWidth:"wide",formattingValues:Xc,defaultFormattingWidth:"wide"})},ed=/^(\d+)(\.)?/i,td=/\d+/i,rd={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},ad={any:[/^v/i,/^n/i]},nd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},id={any:[/1/i,/2/i,/3/i,/4/i]},sd={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},od={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]},ld={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},ud={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},cd={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},dd={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}},hd={ordinalNumber:gn({matchPattern:ed,parsePattern:td,valueCallback:l=>parseInt(l)}),era:Ze({matchPatterns:rd,defaultMatchWidth:"wide",parsePatterns:ad,defaultParseWidth:"any"}),quarter:Ze({matchPatterns:nd,defaultMatchWidth:"wide",parsePatterns:id,defaultParseWidth:"any",valueCallback:l=>l+1}),month:Ze({matchPatterns:sd,defaultMatchWidth:"wide",parsePatterns:od,defaultParseWidth:"any"}),day:Ze({matchPatterns:ld,defaultMatchWidth:"wide",parsePatterns:ud,defaultParseWidth:"any"}),dayPeriod:Ze({matchPatterns:cd,defaultMatchWidth:"wide",parsePatterns:dd,defaultParseWidth:"any"})},Ws={code:"de",formatDistance:Vc,formatLong:qc,formatRelative:$c,localize:Qc,match:hd,options:{weekStartsOn:1,firstWeekContainsDate:4}},fd={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"}},md=(l,s,u)=>{let i;const S=fd[l];return typeof S=="string"?i=S:s===1?i=S.one:i=S.other.replace("{{count}}",s.toString()),u?.addSuffix?u.comparison&&u.comparison>0?"in "+i:i+" ago":i},pd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gd=(l,s,u,i)=>pd[l],vd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_d={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"]},bd={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"]},wd={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"}},Sd={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"}},Md=(l,s)=>{const u=Number(l),i=u%100;if(i>20||i<10)switch(i%10){case 1:return u+"st";case 2:return u+"nd";case 3:return u+"rd"}return u+"th"},xd={ordinalNumber:Md,era:Xe({values:vd,defaultWidth:"wide"}),quarter:Xe({values:yd,defaultWidth:"wide",argumentCallback:l=>l-1}),month:Xe({values:_d,defaultWidth:"wide"}),day:Xe({values:bd,defaultWidth:"wide"}),dayPeriod:Xe({values:wd,defaultWidth:"wide",formattingValues:Sd,defaultFormattingWidth:"wide"})},Dd=/^(\d+)(th|st|nd|rd)?/i,kd=/\d+/i,Od={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},Yd={any:[/^b/i,/^(a|c)/i]},Cd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},jd={any:[/1/i,/2/i,/3/i,/4/i]},Td={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},Pd={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]},Nd={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},Rd={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]},Ed={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},Ad={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}},Id={ordinalNumber:gn({matchPattern:Dd,parsePattern:kd,valueCallback:l=>parseInt(l,10)}),era:Ze({matchPatterns:Od,defaultMatchWidth:"wide",parsePatterns:Yd,defaultParseWidth:"any"}),quarter:Ze({matchPatterns:Cd,defaultMatchWidth:"wide",parsePatterns:jd,defaultParseWidth:"any",valueCallback:l=>l+1}),month:Ze({matchPatterns:Td,defaultMatchWidth:"wide",parsePatterns:Pd,defaultParseWidth:"any"}),day:Ze({matchPatterns:Nd,defaultMatchWidth:"wide",parsePatterns:Rd,defaultParseWidth:"any"}),dayPeriod:Ze({matchPatterns:Ed,defaultMatchWidth:"any",parsePatterns:Ad,defaultParseWidth:"any"})},Fd={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},Vd={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},zd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ld={date:Mt({formats:Fd,defaultWidth:"full"}),time:Mt({formats:Vd,defaultWidth:"full"}),dateTime:Mt({formats:zd,defaultWidth:"full"})},qs={code:"en-GB",formatDistance:md,formatLong:Ld,formatRelative:gd,localize:xd,match:Id,options:{weekStartsOn:1,firstWeekContainsDate:4}},Wd={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"}},qd=(l,s,u)=>{let i;const S=Wd[l];return typeof S=="string"?i=S:s===1?i=S.one:i=S.other.replace("{{count}}",s.toString()),u?.addSuffix?u.comparison&&u.comparison>0?"tra "+i:i+" fa":i},Hd={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},$d={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Bd={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Ud={date:Mt({formats:Hd,defaultWidth:"full"}),time:Mt({formats:$d,defaultWidth:"full"}),dateTime:Mt({formats:Bd,defaultWidth:"full"})},vn=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function Gd(l){return l===0?"'domenica scorsa alle' p":"'"+vn[l]+" scorso alle' p"}function bi(l){return"'"+vn[l]+" alle' p"}function Jd(l){return l===0?"'domenica prossima alle' p":"'"+vn[l]+" prossimo alle' p"}const Kd={lastWeek:(l,s,u)=>{const i=l.getDay();return yi(l,s,u)?bi(i):Gd(i)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(l,s,u)=>{const i=l.getDay();return yi(l,s,u)?bi(i):Jd(i)},other:"P"},Xd=(l,s,u,i)=>{const S=Kd[l];return typeof S=="function"?S(s,u,i):S},Zd={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},Qd={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},eh={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"]},th={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"]},rh={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"}},ah={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"}},nh=(l,s)=>{const u=Number(l);return String(u)},ih={ordinalNumber:nh,era:Xe({values:Zd,defaultWidth:"wide"}),quarter:Xe({values:Qd,defaultWidth:"wide",argumentCallback:l=>l-1}),month:Xe({values:eh,defaultWidth:"wide"}),day:Xe({values:th,defaultWidth:"wide"}),dayPeriod:Xe({values:rh,defaultWidth:"wide",formattingValues:ah,defaultFormattingWidth:"wide"})},sh=/^(\d+)(º)?/i,oh=/\d+/i,lh={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},uh={any:[/^a/i,/^(d|e)/i]},ch={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},dh={any:[/1/i,/2/i,/3/i,/4/i]},hh={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},fh={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]},mh={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},ph={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]},gh={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},vh={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}},yh={ordinalNumber:gn({matchPattern:sh,parsePattern:oh,valueCallback:l=>parseInt(l,10)}),era:Ze({matchPatterns:lh,defaultMatchWidth:"wide",parsePatterns:uh,defaultParseWidth:"any"}),quarter:Ze({matchPatterns:ch,defaultMatchWidth:"wide",parsePatterns:dh,defaultParseWidth:"any",valueCallback:l=>l+1}),month:Ze({matchPatterns:hh,defaultMatchWidth:"wide",parsePatterns:fh,defaultParseWidth:"any"}),day:Ze({matchPatterns:mh,defaultMatchWidth:"wide",parsePatterns:ph,defaultParseWidth:"any"}),dayPeriod:Ze({matchPatterns:gh,defaultMatchWidth:"any",parsePatterns:vh,defaultParseWidth:"any"})},Hs={code:"it",formatDistance:qd,formatLong:Ud,formatRelative:Xd,localize:ih,match:yh,options:{weekStartsOn:1,firstWeekContainsDate:4}};function br(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var cn={exports:{}},gr={exports:{}},_h=gr.exports,wi;function yn(){return wi||(wi=1,(function(l,s){(function(u,i){l.exports=i()})(_h,(function(){var u;function i(){return u.apply(null,arguments)}function S(e){u=e}function x(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function I(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function y(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(o(e,t))return!1;return!0}function r(e){return e===void 0}function c(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function h(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function f(e,t){var a=[],n,d=e.length;for(n=0;n<d;++n)a.push(t(e[n],n));return a}function p(e,t){for(var a in t)o(t,a)&&(e[a]=t[a]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function g(e,t,a,n){return Ln(e,t,a,n,!0).utc()}function Y(){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 _(e){return e._pf==null&&(e._pf=Y()),e._pf}var k;Array.prototype.some?k=Array.prototype.some:k=function(e){var t=Object(this),a=t.length>>>0,n;for(n=0;n<a;n++)if(n in t&&e.call(this,t[n],n,t))return!0;return!1};function C(e){var t=null,a=!1,n=e._d&&!isNaN(e._d.getTime());if(n&&(t=_(e),a=k.call(t.parsedDateParts,function(d){return d!=null}),n=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&a),e._strict&&(n=n&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=n;else return n;return e._isValid}function j(e){var t=g(NaN);return e!=null?p(_(t),e):_(t).userInvalidated=!0,t}var F=i.momentProperties=[],R=!1;function O(e,t){var a,n,d,D=F.length;if(r(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),r(t._i)||(e._i=t._i),r(t._f)||(e._f=t._f),r(t._l)||(e._l=t._l),r(t._strict)||(e._strict=t._strict),r(t._tzm)||(e._tzm=t._tzm),r(t._isUTC)||(e._isUTC=t._isUTC),r(t._offset)||(e._offset=t._offset),r(t._pf)||(e._pf=_(t)),r(t._locale)||(e._locale=t._locale),D>0)for(a=0;a<D;a++)n=F[a],d=t[n],r(d)||(e[n]=d);return e}function v(e){O(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),R===!1&&(R=!0,i.updateOffset(this),R=!1)}function T(e){return e instanceof v||e!=null&&e._isAMomentObject!=null}function w(e){i.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function M(e,t){var a=!0;return p(function(){if(i.deprecationHandler!=null&&i.deprecationHandler(null,e),a){var n=[],d,D,L,ne=arguments.length;for(D=0;D<ne;D++){if(d="",typeof arguments[D]=="object"){d+=`
|
|
46
46
|
[`+D+"] ";for(L in arguments[0])o(arguments[0],L)&&(d+=L+": "+arguments[0][L]+", ");d=d.slice(0,-2)}else d=arguments[D];n.push(d)}w(e+`
|
|
47
47
|
Arguments: `+Array.prototype.slice.call(n).join("")+`
|
|
48
|
-
`+new Error().stack),a=!1}return t.apply(this,arguments)},t)}var V={};function E(e,t){i.deprecationHandler!=null&&i.deprecationHandler(e,t),V[e]||(w(t),V[e]=!0)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null;function A(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function z(e){var t,a;for(a in e)o(e,a)&&(t=e[a],A(t)?this[a]=t:this["_"+a]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function B(e,t){var a=p({},e),n;for(n in t)o(t,n)&&(I(e[n])&&I(t[n])?(a[n]={},p(a[n],e[n]),p(a[n],t[n])):t[n]!=null?a[n]=t[n]:delete a[n]);for(n in e)o(e,n)&&!o(t,n)&&I(e[n])&&(a[n]=p({},a[n]));return a}function ee(e){e!=null&&this.set(e)}var ie;Object.keys?ie=Object.keys:ie=function(e){var t,a=[];for(t in e)o(e,t)&&a.push(t);return a};var re={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function fe(e,t,a){var n=this._calendar[e]||this._calendar.sameElse;return A(n)?n.call(t,a):n}function te(e,t,a){var n=""+Math.abs(e),d=t-n.length,D=e>=0;return(D?a?"+":"":"-")+Math.pow(10,Math.max(0,d)).toString().substr(1)+n}var de=/(\[[^\[]*\])|(\\)?([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,ve=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,me={},oe={};function Z(e,t,a,n){var d=n;typeof n=="string"&&(d=function(){return this[n]()}),e&&(oe[e]=d),t&&(oe[t[0]]=function(){return te(d.apply(this,arguments),t[1],t[2])}),a&&(oe[a]=function(){return this.localeData().ordinal(d.apply(this,arguments),e)})}function Ne(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Ie(e){var t=e.match(de),a,n;for(a=0,n=t.length;a<n;a++)oe[t[a]]?t[a]=oe[t[a]]:t[a]=Ne(t[a]);return function(d){var D="",L;for(L=0;L<n;L++)D+=A(t[L])?t[L].call(d,e):t[L];return D}}function Ce(e,t){return e.isValid()?(t=Oe(t,e.localeData()),me[t]=me[t]||Ie(t),me[t](e)):e.localeData().invalidDate()}function Oe(e,t){var a=5;function n(d){return t.longDateFormat(d)||d}for(ve.lastIndex=0;a>=0&&ve.test(e);)e=e.replace(ve,n),ve.lastIndex=0,a-=1;return e}var $={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 J(e){var t=this._longDateFormat[e],a=this._longDateFormat[e.toUpperCase()];return t||!a?t:(this._longDateFormat[e]=a.match(de).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var X="Invalid date";function P(){return this._invalidDate}var H="%d",N=/\d{1,2}/;function W(e){return this._ordinal.replace("%d",e)}var q={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 ce(e,t,a,n){var d=this._relativeTime[a];return A(d)?d(e,t,a,n):d.replace(/%d/i,e)}function se(e,t){var a=this._relativeTime[e>0?"future":"past"];return A(a)?a(t):a.replace(/%s/i,t)}var Pe={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 ge(e){return typeof e=="string"?Pe[e]||Pe[e.toLowerCase()]:void 0}function _e(e){var t={},a,n;for(n in e)o(e,n)&&(a=ge(n),a&&(t[a]=e[n]));return t}var $e={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 Re(e){var t=[],a;for(a in e)o(e,a)&&t.push({unit:a,priority:$e[a]});return t.sort(function(n,d){return n.priority-d.priority}),t}var ct=/\d/,Ue=/\d\d/,it=/\d{3}/,Yt=/\d{4}/,st=/[+-]?\d{6}/,je=/\d\d?/,Ct=/\d\d\d\d?/,At=/\d\d\d\d\d\d?/,ot=/\d{1,3}/,mt=/\d{1,4}/,dt=/[+-]?\d{1,6}/,tt=/\d+/,pt=/[+-]?\d+/,gt=/Z|[+-]\d\d:?\d\d/gi,We=/Z|[+-]\d\d(?::?\d\d)?/gi,ht=/[+-]?\d+(\.\d{1,3})?/,lt=/[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,rt=/^[1-9]\d?/,Qe=/^([1-9]\d|\d)/,It;It={};function ae(e,t,a){It[e]=A(t)?t:function(n,d){return n&&a?a:t}}function Cr(e,t){return o(It,e)?It[e](t._strict,t._locale):new RegExp(rr(e))}function rr(e){return at(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,a,n,d,D){return a||n||d||D}))}function at(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function et(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function be(e){var t=+e,a=0;return t!==0&&isFinite(t)&&(a=et(t)),a}var Ft={};function Te(e,t){var a,n=t,d;for(typeof e=="string"&&(e=[e]),c(t)&&(n=function(D,L){L[t]=be(D)}),d=e.length,a=0;a<d;a++)Ft[e[a]]=n}function jt(e,t){Te(e,function(a,n,d,D){d._w=d._w||{},t(a,d._w,d,D)})}function jr(e,t,a){t!=null&&o(Ft,e)&&Ft[e](t,a._a,a,e)}function Vt(e){return e%4===0&&e%100!==0||e%400===0}var Ge=0,b=1,U=2,Q=3,le=4,ye=5,xe=6,Se=7,we=8;Z("Y",0,0,function(){var e=this.year();return e<=9999?te(e,4):"+"+e}),Z(0,["YY",2],0,function(){return this.year()%100}),Z(0,["YYYY",4],0,"year"),Z(0,["YYYYY",5],0,"year"),Z(0,["YYYYYY",6,!0],0,"year"),ae("Y",pt),ae("YY",je,Ue),ae("YYYY",mt,Yt),ae("YYYYY",dt,st),ae("YYYYYY",dt,st),Te(["YYYYY","YYYYYY"],Ge),Te("YYYY",function(e,t){t[Ge]=e.length===2?i.parseTwoDigitYear(e):be(e)}),Te("YY",function(e,t){t[Ge]=i.parseTwoDigitYear(e)}),Te("Y",function(e,t){t[Ge]=parseInt(e,10)});function qe(e){return Vt(e)?366:365}i.parseTwoDigitYear=function(e){return be(e)+(be(e)>68?1900:2e3)};var Fe=Be("FullYear",!0);function Le(){return Vt(this.year())}function Be(e,t){return function(a){return a!=null?(ft(this,e,a),i.updateOffset(this,t),this):nt(this,e)}}function nt(e,t){if(!e.isValid())return NaN;var a=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?a.getUTCMilliseconds():a.getMilliseconds();case"Seconds":return n?a.getUTCSeconds():a.getSeconds();case"Minutes":return n?a.getUTCMinutes():a.getMinutes();case"Hours":return n?a.getUTCHours():a.getHours();case"Date":return n?a.getUTCDate():a.getDate();case"Day":return n?a.getUTCDay():a.getDay();case"Month":return n?a.getUTCMonth():a.getMonth();case"FullYear":return n?a.getUTCFullYear():a.getFullYear();default:return NaN}}function ft(e,t,a){var n,d,D,L,ne;if(!(!e.isValid()||isNaN(a))){switch(n=e._d,d=e._isUTC,t){case"Milliseconds":return void(d?n.setUTCMilliseconds(a):n.setMilliseconds(a));case"Seconds":return void(d?n.setUTCSeconds(a):n.setSeconds(a));case"Minutes":return void(d?n.setUTCMinutes(a):n.setMinutes(a));case"Hours":return void(d?n.setUTCHours(a):n.setHours(a));case"Date":return void(d?n.setUTCDate(a):n.setDate(a));case"FullYear":break;default:return}D=a,L=e.month(),ne=e.date(),ne=ne===29&&L===1&&!Vt(D)?28:ne,d?n.setUTCFullYear(D,L,ne):n.setFullYear(D,L,ne)}}function Je(e){return e=ge(e),A(this[e])?this[e]():this}function Ut(e,t){if(typeof e=="object"){e=_e(e);var a=Re(e),n,d=a.length;for(n=0;n<d;n++)this[a[n].unit](e[a[n].unit])}else if(e=ge(e),A(this[e]))return this[e](t);return this}function Tr(e,t){return(e%t+t)%t}var ze;Array.prototype.indexOf?ze=Array.prototype.indexOf:ze=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Pr(e,t){if(isNaN(e)||isNaN(t))return NaN;var a=Tr(t,12);return e+=(t-a)/12,a===1?Vt(e)?29:28:31-a%7%2}Z("M",["MM",2],"Mo",function(){return this.month()+1}),Z("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),Z("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ae("M",je,rt),ae("MM",je,Ue),ae("MMM",function(e,t){return t.monthsShortRegex(e)}),ae("MMMM",function(e,t){return t.monthsRegex(e)}),Te(["M","MM"],function(e,t){t[b]=be(e)-1}),Te(["MMM","MMMM"],function(e,t,a,n){var d=a._locale.monthsParse(e,n,a._strict);d!=null?t[b]=d:_(a).invalidMonth=e});var Qs="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),On="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yn=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,eo=lt,to=lt;function ro(e,t){return e?x(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Yn).test(t)?"format":"standalone"][e.month()]:x(this._months)?this._months:this._months.standalone}function ao(e,t){return e?x(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Yn.test(t)?"format":"standalone"][e.month()]:x(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function no(e,t,a){var n,d,D,L=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)D=g([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(D,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(D,"").toLocaleLowerCase();return a?t==="MMM"?(d=ze.call(this._shortMonthsParse,L),d!==-1?d:null):(d=ze.call(this._longMonthsParse,L),d!==-1?d:null):t==="MMM"?(d=ze.call(this._shortMonthsParse,L),d!==-1?d:(d=ze.call(this._longMonthsParse,L),d!==-1?d:null)):(d=ze.call(this._longMonthsParse,L),d!==-1?d:(d=ze.call(this._shortMonthsParse,L),d!==-1?d:null))}function io(e,t,a){var n,d,D;if(this._monthsParseExact)return no.call(this,e,t,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(d=g([2e3,n]),a&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(d,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(d,"").replace(".","")+"$","i")),!a&&!this._monthsParse[n]&&(D="^"+this.months(d,"")+"|^"+this.monthsShort(d,""),this._monthsParse[n]=new RegExp(D.replace(".",""),"i")),a&&t==="MMMM"&&this._longMonthsParse[n].test(e))return n;if(a&&t==="MMM"&&this._shortMonthsParse[n].test(e))return n;if(!a&&this._monthsParse[n].test(e))return n}}function Cn(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=be(t);else if(t=e.localeData().monthsParse(t),!c(t))return e}var a=t,n=e.date();return n=n<29?n:Math.min(n,Pr(e.year(),a)),e._isUTC?e._d.setUTCMonth(a,n):e._d.setMonth(a,n),e}function jn(e){return e!=null?(Cn(this,e),i.updateOffset(this,!0),this):nt(this,"Month")}function so(){return Pr(this.year(),this.month())}function oo(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Tn.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=eo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function lo(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Tn.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=to),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Tn(){function e(pe,De){return De.length-pe.length}var t=[],a=[],n=[],d,D,L,ne;for(d=0;d<12;d++)D=g([2e3,d]),L=at(this.monthsShort(D,"")),ne=at(this.months(D,"")),t.push(L),a.push(ne),n.push(ne),n.push(L);t.sort(e),a.sort(e),n.sort(e),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function uo(e,t,a,n,d,D,L){var ne;return e<100&&e>=0?(ne=new Date(e+400,t,a,n,d,D,L),isFinite(ne.getFullYear())&&ne.setFullYear(e)):ne=new Date(e,t,a,n,d,D,L),ne}function Gt(e){var t,a;return e<100&&e>=0?(a=Array.prototype.slice.call(arguments),a[0]=e+400,t=new Date(Date.UTC.apply(null,a)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ar(e,t,a){var n=7+t-a,d=(7+Gt(e,0,n).getUTCDay()-t)%7;return-d+n-1}function Pn(e,t,a,n,d){var D=(7+a-n)%7,L=ar(e,n,d),ne=1+7*(t-1)+D+L,pe,De;return ne<=0?(pe=e-1,De=qe(pe)+ne):ne>qe(e)?(pe=e+1,De=ne-qe(e)):(pe=e,De=ne),{year:pe,dayOfYear:De}}function Jt(e,t,a){var n=ar(e.year(),t,a),d=Math.floor((e.dayOfYear()-n-1)/7)+1,D,L;return d<1?(L=e.year()-1,D=d+vt(L,t,a)):d>vt(e.year(),t,a)?(D=d-vt(e.year(),t,a),L=e.year()+1):(L=e.year(),D=d),{week:D,year:L}}function vt(e,t,a){var n=ar(e,t,a),d=ar(e+1,t,a);return(qe(e)-n+d)/7}Z("w",["ww",2],"wo","week"),Z("W",["WW",2],"Wo","isoWeek"),ae("w",je,rt),ae("ww",je,Ue),ae("W",je,rt),ae("WW",je,Ue),jt(["w","ww","W","WW"],function(e,t,a,n){t[n.substr(0,1)]=be(e)});function co(e){return Jt(e,this._week.dow,this._week.doy).week}var ho={dow:0,doy:6};function fo(){return this._week.dow}function mo(){return this._week.doy}function po(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function go(e){var t=Jt(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Z("d",0,"do","day"),Z("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),Z("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),Z("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),Z("e",0,0,"weekday"),Z("E",0,0,"isoWeekday"),ae("d",je),ae("e",je),ae("E",je),ae("dd",function(e,t){return t.weekdaysMinRegex(e)}),ae("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ae("dddd",function(e,t){return t.weekdaysRegex(e)}),jt(["dd","ddd","dddd"],function(e,t,a,n){var d=a._locale.weekdaysParse(e,n,a._strict);d!=null?t.d=d:_(a).invalidWeekday=e}),jt(["d","e","E"],function(e,t,a,n){t[n]=be(e)});function vo(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function yo(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Nr(e,t){return e.slice(t,7).concat(e.slice(0,t))}var _o="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Nn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),bo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),wo=lt,So=lt,Mo=lt;function xo(e,t){var a=x(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Nr(a,this._week.dow):e?a[e.day()]:a}function Do(e){return e===!0?Nr(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ko(e){return e===!0?Nr(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Oo(e,t,a){var n,d,D,L=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)D=g([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(D,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(D,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(D,"").toLocaleLowerCase();return a?t==="dddd"?(d=ze.call(this._weekdaysParse,L),d!==-1?d:null):t==="ddd"?(d=ze.call(this._shortWeekdaysParse,L),d!==-1?d:null):(d=ze.call(this._minWeekdaysParse,L),d!==-1?d:null):t==="dddd"?(d=ze.call(this._weekdaysParse,L),d!==-1||(d=ze.call(this._shortWeekdaysParse,L),d!==-1)?d:(d=ze.call(this._minWeekdaysParse,L),d!==-1?d:null)):t==="ddd"?(d=ze.call(this._shortWeekdaysParse,L),d!==-1||(d=ze.call(this._weekdaysParse,L),d!==-1)?d:(d=ze.call(this._minWeekdaysParse,L),d!==-1?d:null)):(d=ze.call(this._minWeekdaysParse,L),d!==-1||(d=ze.call(this._weekdaysParse,L),d!==-1)?d:(d=ze.call(this._shortWeekdaysParse,L),d!==-1?d:null))}function Yo(e,t,a){var n,d,D;if(this._weekdaysParseExact)return Oo.call(this,e,t,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(d=g([2e3,1]).day(n),a&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(d,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(d,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(d,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(D="^"+this.weekdays(d,"")+"|^"+this.weekdaysShort(d,"")+"|^"+this.weekdaysMin(d,""),this._weekdaysParse[n]=new RegExp(D.replace(".",""),"i")),a&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(a&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(a&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!a&&this._weekdaysParse[n].test(e))return n}}function Co(e){if(!this.isValid())return e!=null?this:NaN;var t=nt(this,"Day");return e!=null?(e=vo(e,this.localeData()),this.add(e-t,"d")):t}function jo(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function To(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=yo(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Po(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Rr.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=wo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function No(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Rr.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=So),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ro(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Rr.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Rr(){function e(Ke,St){return St.length-Ke.length}var t=[],a=[],n=[],d=[],D,L,ne,pe,De;for(D=0;D<7;D++)L=g([2e3,1]).day(D),ne=at(this.weekdaysMin(L,"")),pe=at(this.weekdaysShort(L,"")),De=at(this.weekdays(L,"")),t.push(ne),a.push(pe),n.push(De),d.push(ne),d.push(pe),d.push(De);t.sort(e),a.sort(e),n.sort(e),d.sort(e),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Er(){return this.hours()%12||12}function Eo(){return this.hours()||24}Z("H",["HH",2],0,"hour"),Z("h",["hh",2],0,Er),Z("k",["kk",2],0,Eo),Z("hmm",0,0,function(){return""+Er.apply(this)+te(this.minutes(),2)}),Z("hmmss",0,0,function(){return""+Er.apply(this)+te(this.minutes(),2)+te(this.seconds(),2)}),Z("Hmm",0,0,function(){return""+this.hours()+te(this.minutes(),2)}),Z("Hmmss",0,0,function(){return""+this.hours()+te(this.minutes(),2)+te(this.seconds(),2)});function Rn(e,t){Z(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Rn("a",!0),Rn("A",!1);function En(e,t){return t._meridiemParse}ae("a",En),ae("A",En),ae("H",je,Qe),ae("h",je,rt),ae("k",je,rt),ae("HH",je,Ue),ae("hh",je,Ue),ae("kk",je,Ue),ae("hmm",Ct),ae("hmmss",At),ae("Hmm",Ct),ae("Hmmss",At),Te(["H","HH"],Q),Te(["k","kk"],function(e,t,a){var n=be(e);t[Q]=n===24?0:n}),Te(["a","A"],function(e,t,a){a._isPm=a._locale.isPM(e),a._meridiem=e}),Te(["h","hh"],function(e,t,a){t[Q]=be(e),_(a).bigHour=!0}),Te("hmm",function(e,t,a){var n=e.length-2;t[Q]=be(e.substr(0,n)),t[le]=be(e.substr(n)),_(a).bigHour=!0}),Te("hmmss",function(e,t,a){var n=e.length-4,d=e.length-2;t[Q]=be(e.substr(0,n)),t[le]=be(e.substr(n,2)),t[ye]=be(e.substr(d)),_(a).bigHour=!0}),Te("Hmm",function(e,t,a){var n=e.length-2;t[Q]=be(e.substr(0,n)),t[le]=be(e.substr(n))}),Te("Hmmss",function(e,t,a){var n=e.length-4,d=e.length-2;t[Q]=be(e.substr(0,n)),t[le]=be(e.substr(n,2)),t[ye]=be(e.substr(d))});function Ao(e){return(e+"").toLowerCase().charAt(0)==="p"}var Io=/[ap]\.?m?\.?/i,Fo=Be("Hours",!0);function Vo(e,t,a){return e>11?a?"pm":"PM":a?"am":"AM"}var An={calendar:re,longDateFormat:$,invalidDate:X,ordinal:H,dayOfMonthOrdinalParse:N,relativeTime:q,months:Qs,monthsShort:On,week:ho,weekdays:_o,weekdaysMin:bo,weekdaysShort:Nn,meridiemParse:Io},Ve={},Kt={},Xt;function zo(e,t){var a,n=Math.min(e.length,t.length);for(a=0;a<n;a+=1)if(e[a]!==t[a])return a;return n}function In(e){return e&&e.toLowerCase().replace("_","-")}function Lo(e){for(var t=0,a,n,d,D;t<e.length;){for(D=In(e[t]).split("-"),a=D.length,n=In(e[t+1]),n=n?n.split("-"):null;a>0;){if(d=nr(D.slice(0,a).join("-")),d)return d;if(n&&n.length>=a&&zo(D,n)>=a-1)break;a--}t++}return Xt}function Wo(e){return!!(e&&e.match("^[^/\\\\]*$"))}function nr(e){var t=null,a;if(Ve[e]===void 0&&l&&l.exports&&Wo(e))try{t=Xt._abbr,a=br,a("./locale/"+e),xt(t)}catch{Ve[e]=null}return Ve[e]}function xt(e,t){var a;return e&&(r(t)?a=yt(e):a=Ar(e,t),a?Xt=a:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Xt._abbr}function Ar(e,t){if(t!==null){var a,n=An;if(t.abbr=e,Ve[e]!=null)E("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."),n=Ve[e]._config;else if(t.parentLocale!=null)if(Ve[t.parentLocale]!=null)n=Ve[t.parentLocale]._config;else if(a=nr(t.parentLocale),a!=null)n=a._config;else return Kt[t.parentLocale]||(Kt[t.parentLocale]=[]),Kt[t.parentLocale].push({name:e,config:t}),null;return Ve[e]=new ee(B(n,t)),Kt[e]&&Kt[e].forEach(function(d){Ar(d.name,d.config)}),xt(e),Ve[e]}else return delete Ve[e],null}function qo(e,t){if(t!=null){var a,n,d=An;Ve[e]!=null&&Ve[e].parentLocale!=null?Ve[e].set(B(Ve[e]._config,t)):(n=nr(e),n!=null&&(d=n._config),t=B(d,t),n==null&&(t.abbr=e),a=new ee(t),a.parentLocale=Ve[e],Ve[e]=a),xt(e)}else Ve[e]!=null&&(Ve[e].parentLocale!=null?(Ve[e]=Ve[e].parentLocale,e===xt()&&xt(e)):Ve[e]!=null&&delete Ve[e]);return Ve[e]}function yt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Xt;if(!x(e)){if(t=nr(e),t)return t;e=[e]}return Lo(e)}function Ho(){return ie(Ve)}function Ir(e){var t,a=e._a;return a&&_(e).overflow===-2&&(t=a[b]<0||a[b]>11?b:a[U]<1||a[U]>Pr(a[Ge],a[b])?U:a[Q]<0||a[Q]>24||a[Q]===24&&(a[le]!==0||a[ye]!==0||a[xe]!==0)?Q:a[le]<0||a[le]>59?le:a[ye]<0||a[ye]>59?ye:a[xe]<0||a[xe]>999?xe:-1,_(e)._overflowDayOfYear&&(t<Ge||t>U)&&(t=U),_(e)._overflowWeeks&&t===-1&&(t=Se),_(e)._overflowWeekday&&t===-1&&(t=we),_(e).overflow=t),e}var $o=/^\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)?)?$/,Bo=/^\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)?)?$/,Uo=/Z|[+-]\d\d(?::?\d\d)?/,ir=[["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]],Fr=[["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/]],Go=/^\/?Date\((-?\d+)/i,Jo=/^(?:(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}))$/,Ko={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Fn(e){var t,a,n=e._i,d=$o.exec(n)||Bo.exec(n),D,L,ne,pe,De=ir.length,Ke=Fr.length;if(d){for(_(e).iso=!0,t=0,a=De;t<a;t++)if(ir[t][1].exec(d[1])){L=ir[t][0],D=ir[t][2]!==!1;break}if(L==null){e._isValid=!1;return}if(d[3]){for(t=0,a=Ke;t<a;t++)if(Fr[t][1].exec(d[3])){ne=(d[2]||" ")+Fr[t][0];break}if(ne==null){e._isValid=!1;return}}if(!D&&ne!=null){e._isValid=!1;return}if(d[4])if(Uo.exec(d[4]))pe="Z";else{e._isValid=!1;return}e._f=L+(ne||"")+(pe||""),zr(e)}else e._isValid=!1}function Xo(e,t,a,n,d,D){var L=[Zo(e),On.indexOf(t),parseInt(a,10),parseInt(n,10),parseInt(d,10)];return D&&L.push(parseInt(D,10)),L}function Zo(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Qo(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function el(e,t,a){if(e){var n=Nn.indexOf(e),d=new Date(t[0],t[1],t[2]).getDay();if(n!==d)return _(a).weekdayMismatch=!0,a._isValid=!1,!1}return!0}function tl(e,t,a){if(e)return Ko[e];if(t)return 0;var n=parseInt(a,10),d=n%100,D=(n-d)/100;return D*60+d}function Vn(e){var t=Jo.exec(Qo(e._i)),a;if(t){if(a=Xo(t[4],t[3],t[2],t[5],t[6],t[7]),!el(t[1],a,e))return;e._a=a,e._tzm=tl(t[8],t[9],t[10]),e._d=Gt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),_(e).rfc2822=!0}else e._isValid=!1}function rl(e){var t=Go.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Fn(e),e._isValid===!1)delete e._isValid;else return;if(Vn(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:i.createFromInputFallback(e)}i.createFromInputFallback=M("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 zt(e,t,a){return e??t??a}function al(e){var t=new Date(i.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Vr(e){var t,a,n=[],d,D,L;if(!e._d){for(d=al(e),e._w&&e._a[U]==null&&e._a[b]==null&&nl(e),e._dayOfYear!=null&&(L=zt(e._a[Ge],d[Ge]),(e._dayOfYear>qe(L)||e._dayOfYear===0)&&(_(e)._overflowDayOfYear=!0),a=Gt(L,0,e._dayOfYear),e._a[b]=a.getUTCMonth(),e._a[U]=a.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=d[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Q]===24&&e._a[le]===0&&e._a[ye]===0&&e._a[xe]===0&&(e._nextDay=!0,e._a[Q]=0),e._d=(e._useUTC?Gt:uo).apply(null,n),D=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&&typeof e._w.d<"u"&&e._w.d!==D&&(_(e).weekdayMismatch=!0)}}function nl(e){var t,a,n,d,D,L,ne,pe,De;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(D=1,L=4,a=zt(t.GG,e._a[Ge],Jt(Ae(),1,4).year),n=zt(t.W,1),d=zt(t.E,1),(d<1||d>7)&&(pe=!0)):(D=e._locale._week.dow,L=e._locale._week.doy,De=Jt(Ae(),D,L),a=zt(t.gg,e._a[Ge],De.year),n=zt(t.w,De.week),t.d!=null?(d=t.d,(d<0||d>6)&&(pe=!0)):t.e!=null?(d=t.e+D,(t.e<0||t.e>6)&&(pe=!0)):d=D),n<1||n>vt(a,D,L)?_(e)._overflowWeeks=!0:pe!=null?_(e)._overflowWeekday=!0:(ne=Pn(a,n,d,D,L),e._a[Ge]=ne.year,e._dayOfYear=ne.dayOfYear)}i.ISO_8601=function(){},i.RFC_2822=function(){};function zr(e){if(e._f===i.ISO_8601){Fn(e);return}if(e._f===i.RFC_2822){Vn(e);return}e._a=[],_(e).empty=!0;var t=""+e._i,a,n,d,D,L,ne=t.length,pe=0,De,Ke;for(d=Oe(e._f,e._locale).match(de)||[],Ke=d.length,a=0;a<Ke;a++)D=d[a],n=(t.match(Cr(D,e))||[])[0],n&&(L=t.substr(0,t.indexOf(n)),L.length>0&&_(e).unusedInput.push(L),t=t.slice(t.indexOf(n)+n.length),pe+=n.length),oe[D]?(n?_(e).empty=!1:_(e).unusedTokens.push(D),jr(D,n,e)):e._strict&&!n&&_(e).unusedTokens.push(D);_(e).charsLeftOver=ne-pe,t.length>0&&_(e).unusedInput.push(t),e._a[Q]<=12&&_(e).bigHour===!0&&e._a[Q]>0&&(_(e).bigHour=void 0),_(e).parsedDateParts=e._a.slice(0),_(e).meridiem=e._meridiem,e._a[Q]=il(e._locale,e._a[Q],e._meridiem),De=_(e).era,De!==null&&(e._a[Ge]=e._locale.erasConvertYear(De,e._a[Ge])),Vr(e),Ir(e)}function il(e,t,a){var n;return a==null?t:e.meridiemHour!=null?e.meridiemHour(t,a):(e.isPM!=null&&(n=e.isPM(a),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function sl(e){var t,a,n,d,D,L,ne=!1,pe=e._f.length;if(pe===0){_(e).invalidFormat=!0,e._d=new Date(NaN);return}for(d=0;d<pe;d++)D=0,L=!1,t=O({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[d],zr(t),C(t)&&(L=!0),D+=_(t).charsLeftOver,D+=_(t).unusedTokens.length*10,_(t).score=D,ne?D<n&&(n=D,a=t):(n==null||D<n||L)&&(n=D,a=t,L&&(ne=!0));p(e,a||t)}function ol(e){if(!e._d){var t=_e(e._i),a=t.day===void 0?t.date:t.day;e._a=f([t.year,t.month,a,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),Vr(e)}}function ll(e){var t=new v(Ir(zn(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function zn(e){var t=e._i,a=e._f;return e._locale=e._locale||yt(e._l),t===null||a===void 0&&t===""?j({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),T(t)?new v(Ir(t)):(h(t)?e._d=t:x(a)?sl(e):a?zr(e):ul(e),C(e)||(e._d=null),e))}function ul(e){var t=e._i;r(t)?e._d=new Date(i.now()):h(t)?e._d=new Date(t.valueOf()):typeof t=="string"?rl(e):x(t)?(e._a=f(t.slice(0),function(a){return parseInt(a,10)}),Vr(e)):I(t)?ol(e):c(t)?e._d=new Date(t):i.createFromInputFallback(e)}function Ln(e,t,a,n,d){var D={};return(t===!0||t===!1)&&(n=t,t=void 0),(a===!0||a===!1)&&(n=a,a=void 0),(I(e)&&y(e)||x(e)&&e.length===0)&&(e=void 0),D._isAMomentObject=!0,D._useUTC=D._isUTC=d,D._l=a,D._i=e,D._f=t,D._strict=n,ll(D)}function Ae(e,t,a,n){return Ln(e,t,a,n,!1)}var cl=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ae.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:j()}),dl=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ae.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:j()});function Wn(e,t){var a,n;if(t.length===1&&x(t[0])&&(t=t[0]),!t.length)return Ae();for(a=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][e](a))&&(a=t[n]);return a}function hl(){var e=[].slice.call(arguments,0);return Wn("isBefore",e)}function fl(){var e=[].slice.call(arguments,0);return Wn("isAfter",e)}var ml=function(){return Date.now?Date.now():+new Date},Zt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function pl(e){var t,a=!1,n,d=Zt.length;for(t in e)if(o(e,t)&&!(ze.call(Zt,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(n=0;n<d;++n)if(e[Zt[n]]){if(a)return!1;parseFloat(e[Zt[n]])!==be(e[Zt[n]])&&(a=!0)}return!0}function gl(){return this._isValid}function vl(){return ut(NaN)}function sr(e){var t=_e(e),a=t.year||0,n=t.quarter||0,d=t.month||0,D=t.week||t.isoWeek||0,L=t.day||0,ne=t.hour||0,pe=t.minute||0,De=t.second||0,Ke=t.millisecond||0;this._isValid=pl(t),this._milliseconds=+Ke+De*1e3+pe*6e4+ne*1e3*60*60,this._days=+L+D*7,this._months=+d+n*3+a*12,this._data={},this._locale=yt(),this._bubble()}function or(e){return e instanceof sr}function Lr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function yl(e,t,a){var n=Math.min(e.length,t.length),d=Math.abs(e.length-t.length),D=0,L;for(L=0;L<n;L++)be(e[L])!==be(t[L])&&D++;return D+d}function qn(e,t){Z(e,0,0,function(){var a=this.utcOffset(),n="+";return a<0&&(a=-a,n="-"),n+te(~~(a/60),2)+t+te(~~a%60,2)})}qn("Z",":"),qn("ZZ",""),ae("Z",We),ae("ZZ",We),Te(["Z","ZZ"],function(e,t,a){a._useUTC=!0,a._tzm=Wr(We,e)});var _l=/([\+\-]|\d\d)/gi;function Wr(e,t){var a=(t||"").match(e),n,d,D;return a===null?null:(n=a[a.length-1]||[],d=(n+"").match(_l)||["-",0,0],D=+(d[1]*60)+be(d[2]),D===0?0:d[0]==="+"?D:-D)}function qr(e,t){var a,n;return t._isUTC?(a=t.clone(),n=(T(e)||h(e)?e.valueOf():Ae(e).valueOf())-a.valueOf(),a._d.setTime(a._d.valueOf()+n),i.updateOffset(a,!1),a):Ae(e).local()}function Hr(e){return-Math.round(e._d.getTimezoneOffset())}i.updateOffset=function(){};function bl(e,t,a){var n=this._offset||0,d;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Wr(We,e),e===null)return this}else Math.abs(e)<16&&!a&&(e=e*60);return!this._isUTC&&t&&(d=Hr(this)),this._offset=e,this._isUTC=!0,d!=null&&this.add(d,"m"),n!==e&&(!t||this._changeInProgress?Un(this,ut(e-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Hr(this)}function wl(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Sl(e){return this.utcOffset(0,e)}function Ml(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Hr(this),"m")),this}function xl(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Wr(gt,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Dl(e){return this.isValid()?(e=e?Ae(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function kl(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ol(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e={},t;return O(e,this),e=zn(e),e._a?(t=e._isUTC?g(e._a):Ae(e._a),this._isDSTShifted=this.isValid()&&yl(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Yl(){return this.isValid()?!this._isUTC:!1}function Cl(){return this.isValid()?this._isUTC:!1}function Hn(){return this.isValid()?this._isUTC&&this._offset===0:!1}var jl=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Tl=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ut(e,t){var a=e,n=null,d,D,L;return or(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(n=jl.exec(e))?(d=n[1]==="-"?-1:1,a={y:0,d:be(n[U])*d,h:be(n[Q])*d,m:be(n[le])*d,s:be(n[ye])*d,ms:be(Lr(n[xe]*1e3))*d}):(n=Tl.exec(e))?(d=n[1]==="-"?-1:1,a={y:Tt(n[2],d),M:Tt(n[3],d),w:Tt(n[4],d),d:Tt(n[5],d),h:Tt(n[6],d),m:Tt(n[7],d),s:Tt(n[8],d)}):a==null?a={}:typeof a=="object"&&("from"in a||"to"in a)&&(L=Pl(Ae(a.from),Ae(a.to)),a={},a.ms=L.milliseconds,a.M=L.months),D=new sr(a),or(e)&&o(e,"_locale")&&(D._locale=e._locale),or(e)&&o(e,"_isValid")&&(D._isValid=e._isValid),D}ut.fn=sr.prototype,ut.invalid=vl;function Tt(e,t){var a=e&&parseFloat(e.replace(",","."));return(isNaN(a)?0:a)*t}function $n(e,t){var a={};return a.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(a.months,"M").isAfter(t)&&--a.months,a.milliseconds=+t-+e.clone().add(a.months,"M"),a}function Pl(e,t){var a;return e.isValid()&&t.isValid()?(t=qr(t,e),e.isBefore(t)?a=$n(e,t):(a=$n(t,e),a.milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function Bn(e,t){return function(a,n){var d,D;return n!==null&&!isNaN(+n)&&(E(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."),D=a,a=n,n=D),d=ut(a,n),Un(this,d,e),this}}function Un(e,t,a,n){var d=t._milliseconds,D=Lr(t._days),L=Lr(t._months);e.isValid()&&(n=n??!0,L&&Cn(e,nt(e,"Month")+L*a),D&&ft(e,"Date",nt(e,"Date")+D*a),d&&e._d.setTime(e._d.valueOf()+d*a),n&&i.updateOffset(e,D||L))}var Nl=Bn(1,"add"),Rl=Bn(-1,"subtract");function Gn(e){return typeof e=="string"||e instanceof String}function El(e){return T(e)||h(e)||Gn(e)||c(e)||Il(e)||Al(e)||e===null||e===void 0}function Al(e){var t=I(e)&&!y(e),a=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],d,D,L=n.length;for(d=0;d<L;d+=1)D=n[d],a=a||o(e,D);return t&&a}function Il(e){var t=x(e),a=!1;return t&&(a=e.filter(function(n){return!c(n)&&Gn(e)}).length===0),t&&a}function Fl(e){var t=I(e)&&!y(e),a=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],d,D;for(d=0;d<n.length;d+=1)D=n[d],a=a||o(e,D);return t&&a}function Vl(e,t){var a=e.diff(t,"days",!0);return a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse"}function zl(e,t){arguments.length===1&&(arguments[0]?El(arguments[0])?(e=arguments[0],t=void 0):Fl(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var a=e||Ae(),n=qr(a,this).startOf("day"),d=i.calendarFormat(this,n)||"sameElse",D=t&&(A(t[d])?t[d].call(this,a):t[d]);return this.format(D||this.localeData().calendar(d,this,Ae(a)))}function Ll(){return new v(this)}function Wl(e,t){var a=T(e)?e:Ae(e);return this.isValid()&&a.isValid()?(t=ge(t)||"millisecond",t==="millisecond"?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(t).valueOf()):!1}function ql(e,t){var a=T(e)?e:Ae(e);return this.isValid()&&a.isValid()?(t=ge(t)||"millisecond",t==="millisecond"?this.valueOf()<a.valueOf():this.clone().endOf(t).valueOf()<a.valueOf()):!1}function Hl(e,t,a,n){var d=T(e)?e:Ae(e),D=T(t)?t:Ae(t);return this.isValid()&&d.isValid()&&D.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(d,a):!this.isBefore(d,a))&&(n[1]===")"?this.isBefore(D,a):!this.isAfter(D,a))):!1}function $l(e,t){var a=T(e)?e:Ae(e),n;return this.isValid()&&a.isValid()?(t=ge(t)||"millisecond",t==="millisecond"?this.valueOf()===a.valueOf():(n=a.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf())):!1}function Bl(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Ul(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Gl(e,t,a){var n,d,D;if(!this.isValid())return NaN;if(n=qr(e,this),!n.isValid())return NaN;switch(d=(n.utcOffset()-this.utcOffset())*6e4,t=ge(t),t){case"year":D=lr(this,n)/12;break;case"month":D=lr(this,n);break;case"quarter":D=lr(this,n)/3;break;case"second":D=(this-n)/1e3;break;case"minute":D=(this-n)/6e4;break;case"hour":D=(this-n)/36e5;break;case"day":D=(this-n-d)/864e5;break;case"week":D=(this-n-d)/6048e5;break;default:D=this-n}return a?D:et(D)}function lr(e,t){if(e.date()<t.date())return-lr(t,e);var a=(t.year()-e.year())*12+(t.month()-e.month()),n=e.clone().add(a,"months"),d,D;return t-n<0?(d=e.clone().add(a-1,"months"),D=(t-n)/(n-d)):(d=e.clone().add(a+1,"months"),D=(t-n)/(d-n)),-(a+D)||0}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Jl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Kl(e){if(!this.isValid())return null;var t=e!==!0,a=t?this.clone().utc():this;return a.year()<0||a.year()>9999?Ce(a,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ce(a,"Z")):Ce(a,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Xl(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",a,n,d,D;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),a="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",d="-MM-DD[T]HH:mm:ss.SSS",D=t+'[")]',this.format(a+n+d+D)}function Zl(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=Ce(this,e);return this.localeData().postformat(t)}function Ql(e,t){return this.isValid()&&(T(e)&&e.isValid()||Ae(e).isValid())?ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function eu(e){return this.from(Ae(),e)}function tu(e,t){return this.isValid()&&(T(e)&&e.isValid()||Ae(e).isValid())?ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ru(e){return this.to(Ae(),e)}function Jn(e){var t;return e===void 0?this._locale._abbr:(t=yt(e),t!=null&&(this._locale=t),this)}var Kn=M("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 Xn(){return this._locale}var ur=1e3,Lt=60*ur,cr=60*Lt,Zn=(365*400+97)*24*cr;function Wt(e,t){return(e%t+t)%t}function Qn(e,t,a){return e<100&&e>=0?new Date(e+400,t,a)-Zn:new Date(e,t,a).valueOf()}function ei(e,t,a){return e<100&&e>=0?Date.UTC(e+400,t,a)-Zn:Date.UTC(e,t,a)}function au(e){var t,a;if(e=ge(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?ei:Qn,e){case"year":t=a(this.year(),0,1);break;case"quarter":t=a(this.year(),this.month()-this.month()%3,1);break;case"month":t=a(this.year(),this.month(),1);break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=a(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Wt(t+(this._isUTC?0:this.utcOffset()*Lt),cr);break;case"minute":t=this._d.valueOf(),t-=Wt(t,Lt);break;case"second":t=this._d.valueOf(),t-=Wt(t,ur);break}return this._d.setTime(t),i.updateOffset(this,!0),this}function nu(e){var t,a;if(e=ge(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?ei:Qn,e){case"year":t=a(this.year()+1,0,1)-1;break;case"quarter":t=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=a(this.year(),this.month()+1,1)-1;break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=cr-Wt(t+(this._isUTC?0:this.utcOffset()*Lt),cr)-1;break;case"minute":t=this._d.valueOf(),t+=Lt-Wt(t,Lt)-1;break;case"second":t=this._d.valueOf(),t+=ur-Wt(t,ur)-1;break}return this._d.setTime(t),i.updateOffset(this,!0),this}function iu(){return this._d.valueOf()-(this._offset||0)*6e4}function su(){return Math.floor(this.valueOf()/1e3)}function ou(){return new Date(this.valueOf())}function lu(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function uu(){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 cu(){return this.isValid()?this.toISOString():null}function du(){return C(this)}function hu(){return p({},_(this))}function fu(){return _(this).overflow}function mu(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Z("N",0,0,"eraAbbr"),Z("NN",0,0,"eraAbbr"),Z("NNN",0,0,"eraAbbr"),Z("NNNN",0,0,"eraName"),Z("NNNNN",0,0,"eraNarrow"),Z("y",["y",1],"yo","eraYear"),Z("y",["yy",2],0,"eraYear"),Z("y",["yyy",3],0,"eraYear"),Z("y",["yyyy",4],0,"eraYear"),ae("N",$r),ae("NN",$r),ae("NNN",$r),ae("NNNN",Du),ae("NNNNN",ku),Te(["N","NN","NNN","NNNN","NNNNN"],function(e,t,a,n){var d=a._locale.erasParse(e,n,a._strict);d?_(a).era=d:_(a).invalidEra=e}),ae("y",tt),ae("yy",tt),ae("yyy",tt),ae("yyyy",tt),ae("yo",Ou),Te(["y","yy","yyy","yyyy"],Ge),Te(["yo"],function(e,t,a,n){var d;a._locale._eraYearOrdinalRegex&&(d=e.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?t[Ge]=a._locale.eraYearOrdinalParse(e,d):t[Ge]=parseInt(e,10)});function pu(e,t){var a,n,d,D=this._eras||yt("en")._eras;for(a=0,n=D.length;a<n;++a)switch(typeof D[a].since==="string"&&(d=i(D[a].since).startOf("day"),D[a].since=d.valueOf()),typeof D[a].until){case"undefined":D[a].until=1/0;break;case"string":d=i(D[a].until).startOf("day").valueOf(),D[a].until=d.valueOf();break}return D}function gu(e,t,a){var n,d,D=this.eras(),L,ne,pe;for(e=e.toUpperCase(),n=0,d=D.length;n<d;++n)if(L=D[n].name.toUpperCase(),ne=D[n].abbr.toUpperCase(),pe=D[n].narrow.toUpperCase(),a)switch(t){case"N":case"NN":case"NNN":if(ne===e)return D[n];break;case"NNNN":if(L===e)return D[n];break;case"NNNNN":if(pe===e)return D[n];break}else if([L,ne,pe].indexOf(e)>=0)return D[n]}function vu(e,t){var a=e.since<=e.until?1:-1;return t===void 0?i(e.since).year():i(e.since).year()+(t-e.offset)*a}function yu(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until||n[e].until<=a&&a<=n[e].since)return n[e].name;return""}function _u(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until||n[e].until<=a&&a<=n[e].since)return n[e].narrow;return""}function bu(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until||n[e].until<=a&&a<=n[e].since)return n[e].abbr;return""}function wu(){var e,t,a,n,d=this.localeData().eras();for(e=0,t=d.length;e<t;++e)if(a=d[e].since<=d[e].until?1:-1,n=this.clone().startOf("day").valueOf(),d[e].since<=n&&n<=d[e].until||d[e].until<=n&&n<=d[e].since)return(this.year()-i(d[e].since).year())*a+d[e].offset;return this.year()}function Su(e){return o(this,"_erasNameRegex")||Br.call(this),e?this._erasNameRegex:this._erasRegex}function Mu(e){return o(this,"_erasAbbrRegex")||Br.call(this),e?this._erasAbbrRegex:this._erasRegex}function xu(e){return o(this,"_erasNarrowRegex")||Br.call(this),e?this._erasNarrowRegex:this._erasRegex}function $r(e,t){return t.erasAbbrRegex(e)}function Du(e,t){return t.erasNameRegex(e)}function ku(e,t){return t.erasNarrowRegex(e)}function Ou(e,t){return t._eraYearOrdinalRegex||tt}function Br(){var e=[],t=[],a=[],n=[],d,D,L,ne,pe,De=this.eras();for(d=0,D=De.length;d<D;++d)L=at(De[d].name),ne=at(De[d].abbr),pe=at(De[d].narrow),t.push(L),e.push(ne),a.push(pe),n.push(L),n.push(ne),n.push(pe);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}Z(0,["gg",2],0,function(){return this.weekYear()%100}),Z(0,["GG",2],0,function(){return this.isoWeekYear()%100});function dr(e,t){Z(0,[e,e.length],0,t)}dr("gggg","weekYear"),dr("ggggg","weekYear"),dr("GGGG","isoWeekYear"),dr("GGGGG","isoWeekYear"),ae("G",pt),ae("g",pt),ae("GG",je,Ue),ae("gg",je,Ue),ae("GGGG",mt,Yt),ae("gggg",mt,Yt),ae("GGGGG",dt,st),ae("ggggg",dt,st),jt(["gggg","ggggg","GGGG","GGGGG"],function(e,t,a,n){t[n.substr(0,2)]=be(e)}),jt(["gg","GG"],function(e,t,a,n){t[n]=i.parseTwoDigitYear(e)});function Yu(e){return ti.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Cu(e){return ti.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function ju(){return vt(this.year(),1,4)}function Tu(){return vt(this.isoWeekYear(),1,4)}function Pu(){var e=this.localeData()._week;return vt(this.year(),e.dow,e.doy)}function Nu(){var e=this.localeData()._week;return vt(this.weekYear(),e.dow,e.doy)}function ti(e,t,a,n,d){var D;return e==null?Jt(this,n,d).year:(D=vt(e,n,d),t>D&&(t=D),Ru.call(this,e,t,a,n,d))}function Ru(e,t,a,n,d){var D=Pn(e,t,a,n,d),L=Gt(D.year,0,D.dayOfYear);return this.year(L.getUTCFullYear()),this.month(L.getUTCMonth()),this.date(L.getUTCDate()),this}Z("Q",0,"Qo","quarter"),ae("Q",ct),Te("Q",function(e,t){t[b]=(be(e)-1)*3});function Eu(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Z("D",["DD",2],"Do","date"),ae("D",je,rt),ae("DD",je,Ue),ae("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Te(["D","DD"],U),Te("Do",function(e,t){t[U]=be(e.match(je)[0])});var ri=Be("Date",!0);Z("DDD",["DDDD",3],"DDDo","dayOfYear"),ae("DDD",ot),ae("DDDD",it),Te(["DDD","DDDD"],function(e,t,a){a._dayOfYear=be(e)});function Au(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Z("m",["mm",2],0,"minute"),ae("m",je,Qe),ae("mm",je,Ue),Te(["m","mm"],le);var Iu=Be("Minutes",!1);Z("s",["ss",2],0,"second"),ae("s",je,Qe),ae("ss",je,Ue),Te(["s","ss"],ye);var Fu=Be("Seconds",!1);Z("S",0,0,function(){return~~(this.millisecond()/100)}),Z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Z(0,["SSS",3],0,"millisecond"),Z(0,["SSSS",4],0,function(){return this.millisecond()*10}),Z(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Z(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Z(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Z(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Z(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ae("S",ot,ct),ae("SS",ot,Ue),ae("SSS",ot,it);var Dt,ai;for(Dt="SSSS";Dt.length<=9;Dt+="S")ae(Dt,tt);function Vu(e,t){t[xe]=be(("0."+e)*1e3)}for(Dt="S";Dt.length<=9;Dt+="S")Te(Dt,Vu);ai=Be("Milliseconds",!1),Z("z",0,0,"zoneAbbr"),Z("zz",0,0,"zoneName");function zu(){return this._isUTC?"UTC":""}function Lu(){return this._isUTC?"Coordinated Universal Time":""}var K=v.prototype;K.add=Nl,K.calendar=zl,K.clone=Ll,K.diff=Gl,K.endOf=nu,K.format=Zl,K.from=Ql,K.fromNow=eu,K.to=tu,K.toNow=ru,K.get=Je,K.invalidAt=fu,K.isAfter=Wl,K.isBefore=ql,K.isBetween=Hl,K.isSame=$l,K.isSameOrAfter=Bl,K.isSameOrBefore=Ul,K.isValid=du,K.lang=Kn,K.locale=Jn,K.localeData=Xn,K.max=dl,K.min=cl,K.parsingFlags=hu,K.set=Ut,K.startOf=au,K.subtract=Rl,K.toArray=lu,K.toObject=uu,K.toDate=ou,K.toISOString=Kl,K.inspect=Xl,typeof Symbol<"u"&&Symbol.for!=null&&(K[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),K.toJSON=cu,K.toString=Jl,K.unix=su,K.valueOf=iu,K.creationData=mu,K.eraName=yu,K.eraNarrow=_u,K.eraAbbr=bu,K.eraYear=wu,K.year=Fe,K.isLeapYear=Le,K.weekYear=Yu,K.isoWeekYear=Cu,K.quarter=K.quarters=Eu,K.month=jn,K.daysInMonth=so,K.week=K.weeks=po,K.isoWeek=K.isoWeeks=go,K.weeksInYear=Pu,K.weeksInWeekYear=Nu,K.isoWeeksInYear=ju,K.isoWeeksInISOWeekYear=Tu,K.date=ri,K.day=K.days=Co,K.weekday=jo,K.isoWeekday=To,K.dayOfYear=Au,K.hour=K.hours=Fo,K.minute=K.minutes=Iu,K.second=K.seconds=Fu,K.millisecond=K.milliseconds=ai,K.utcOffset=bl,K.utc=Sl,K.local=Ml,K.parseZone=xl,K.hasAlignedHourOffset=Dl,K.isDST=kl,K.isLocal=Yl,K.isUtcOffset=Cl,K.isUtc=Hn,K.isUTC=Hn,K.zoneAbbr=zu,K.zoneName=Lu,K.dates=M("dates accessor is deprecated. Use date instead.",ri),K.months=M("months accessor is deprecated. Use month instead",jn),K.years=M("years accessor is deprecated. Use year instead",Fe),K.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",wl),K.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ol);function Wu(e){return Ae(e*1e3)}function qu(){return Ae.apply(null,arguments).parseZone()}function ni(e){return e}var Ye=ee.prototype;Ye.calendar=fe,Ye.longDateFormat=J,Ye.invalidDate=P,Ye.ordinal=W,Ye.preparse=ni,Ye.postformat=ni,Ye.relativeTime=ce,Ye.pastFuture=se,Ye.set=z,Ye.eras=pu,Ye.erasParse=gu,Ye.erasConvertYear=vu,Ye.erasAbbrRegex=Mu,Ye.erasNameRegex=Su,Ye.erasNarrowRegex=xu,Ye.months=ro,Ye.monthsShort=ao,Ye.monthsParse=io,Ye.monthsRegex=lo,Ye.monthsShortRegex=oo,Ye.week=co,Ye.firstDayOfYear=mo,Ye.firstDayOfWeek=fo,Ye.weekdays=xo,Ye.weekdaysMin=ko,Ye.weekdaysShort=Do,Ye.weekdaysParse=Yo,Ye.weekdaysRegex=Po,Ye.weekdaysShortRegex=No,Ye.weekdaysMinRegex=Ro,Ye.isPM=Ao,Ye.meridiem=Vo;function hr(e,t,a,n){var d=yt(),D=g().set(n,t);return d[a](D,e)}function ii(e,t,a){if(c(e)&&(t=e,e=void 0),e=e||"",t!=null)return hr(e,t,a,"month");var n,d=[];for(n=0;n<12;n++)d[n]=hr(e,n,a,"month");return d}function Ur(e,t,a,n){typeof e=="boolean"?(c(t)&&(a=t,t=void 0),t=t||""):(t=e,a=t,e=!1,c(t)&&(a=t,t=void 0),t=t||"");var d=yt(),D=e?d._week.dow:0,L,ne=[];if(a!=null)return hr(t,(a+D)%7,n,"day");for(L=0;L<7;L++)ne[L]=hr(t,(L+D)%7,n,"day");return ne}function Hu(e,t){return ii(e,t,"months")}function $u(e,t){return ii(e,t,"monthsShort")}function Bu(e,t,a){return Ur(e,t,a,"weekdays")}function Uu(e,t,a){return Ur(e,t,a,"weekdaysShort")}function Gu(e,t,a){return Ur(e,t,a,"weekdaysMin")}xt("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,a=be(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+a}}),i.lang=M("moment.lang is deprecated. Use moment.locale instead.",xt),i.langData=M("moment.langData is deprecated. Use moment.localeData instead.",yt);var _t=Math.abs;function Ju(){var e=this._data;return this._milliseconds=_t(this._milliseconds),this._days=_t(this._days),this._months=_t(this._months),e.milliseconds=_t(e.milliseconds),e.seconds=_t(e.seconds),e.minutes=_t(e.minutes),e.hours=_t(e.hours),e.months=_t(e.months),e.years=_t(e.years),this}function si(e,t,a,n){var d=ut(t,a);return e._milliseconds+=n*d._milliseconds,e._days+=n*d._days,e._months+=n*d._months,e._bubble()}function Ku(e,t){return si(this,e,t,1)}function Xu(e,t){return si(this,e,t,-1)}function oi(e){return e<0?Math.floor(e):Math.ceil(e)}function Zu(){var e=this._milliseconds,t=this._days,a=this._months,n=this._data,d,D,L,ne,pe;return e>=0&&t>=0&&a>=0||e<=0&&t<=0&&a<=0||(e+=oi(Gr(a)+t)*864e5,t=0,a=0),n.milliseconds=e%1e3,d=et(e/1e3),n.seconds=d%60,D=et(d/60),n.minutes=D%60,L=et(D/60),n.hours=L%24,t+=et(L/24),pe=et(li(t)),a+=pe,t-=oi(Gr(pe)),ne=et(a/12),a%=12,n.days=t,n.months=a,n.years=ne,this}function li(e){return e*4800/146097}function Gr(e){return e*146097/4800}function Qu(e){if(!this.isValid())return NaN;var t,a,n=this._milliseconds;if(e=ge(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,a=this._months+li(t),e){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(t=this._days+Math.round(Gr(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function bt(e){return function(){return this.as(e)}}var ui=bt("ms"),ec=bt("s"),tc=bt("m"),rc=bt("h"),ac=bt("d"),nc=bt("w"),ic=bt("M"),sc=bt("Q"),oc=bt("y"),lc=ui;function uc(){return ut(this)}function cc(e){return e=ge(e),this.isValid()?this[e+"s"]():NaN}function Pt(e){return function(){return this.isValid()?this._data[e]:NaN}}var dc=Pt("milliseconds"),hc=Pt("seconds"),fc=Pt("minutes"),mc=Pt("hours"),pc=Pt("days"),gc=Pt("months"),vc=Pt("years");function yc(){return et(this.days()/7)}var wt=Math.round,qt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function _c(e,t,a,n,d){return d.relativeTime(t||1,!!a,e,n)}function bc(e,t,a,n){var d=ut(e).abs(),D=wt(d.as("s")),L=wt(d.as("m")),ne=wt(d.as("h")),pe=wt(d.as("d")),De=wt(d.as("M")),Ke=wt(d.as("w")),St=wt(d.as("y")),kt=D<=a.ss&&["s",D]||D<a.s&&["ss",D]||L<=1&&["m"]||L<a.m&&["mm",L]||ne<=1&&["h"]||ne<a.h&&["hh",ne]||pe<=1&&["d"]||pe<a.d&&["dd",pe];return a.w!=null&&(kt=kt||Ke<=1&&["w"]||Ke<a.w&&["ww",Ke]),kt=kt||De<=1&&["M"]||De<a.M&&["MM",De]||St<=1&&["y"]||["yy",St],kt[2]=t,kt[3]=+e>0,kt[4]=n,_c.apply(null,kt)}function wc(e){return e===void 0?wt:typeof e=="function"?(wt=e,!0):!1}function Sc(e,t){return qt[e]===void 0?!1:t===void 0?qt[e]:(qt[e]=t,e==="s"&&(qt.ss=t-1),!0)}function Mc(e,t){if(!this.isValid())return this.localeData().invalidDate();var a=!1,n=qt,d,D;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(a=e),typeof t=="object"&&(n=Object.assign({},qt,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),d=this.localeData(),D=bc(this,!a,n,d),a&&(D=d.pastFuture(+this,D)),d.postformat(D)}var Jr=Math.abs;function Ht(e){return(e>0)-(e<0)||+e}function fr(){if(!this.isValid())return this.localeData().invalidDate();var e=Jr(this._milliseconds)/1e3,t=Jr(this._days),a=Jr(this._months),n,d,D,L,ne=this.asSeconds(),pe,De,Ke,St;return ne?(n=et(e/60),d=et(n/60),e%=60,n%=60,D=et(a/12),a%=12,L=e?e.toFixed(3).replace(/\.?0+$/,""):"",pe=ne<0?"-":"",De=Ht(this._months)!==Ht(ne)?"-":"",Ke=Ht(this._days)!==Ht(ne)?"-":"",St=Ht(this._milliseconds)!==Ht(ne)?"-":"",pe+"P"+(D?De+D+"Y":"")+(a?De+a+"M":"")+(t?Ke+t+"D":"")+(d||n||e?"T":"")+(d?St+d+"H":"")+(n?St+n+"M":"")+(e?St+L+"S":"")):"P0D"}var ke=sr.prototype;ke.isValid=gl,ke.abs=Ju,ke.add=Ku,ke.subtract=Xu,ke.as=Qu,ke.asMilliseconds=ui,ke.asSeconds=ec,ke.asMinutes=tc,ke.asHours=rc,ke.asDays=ac,ke.asWeeks=nc,ke.asMonths=ic,ke.asQuarters=sc,ke.asYears=oc,ke.valueOf=lc,ke._bubble=Zu,ke.clone=uc,ke.get=cc,ke.milliseconds=dc,ke.seconds=hc,ke.minutes=fc,ke.hours=mc,ke.days=pc,ke.weeks=yc,ke.months=gc,ke.years=vc,ke.humanize=Mc,ke.toISOString=fr,ke.toString=fr,ke.toJSON=fr,ke.locale=Jn,ke.localeData=Xn,ke.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",fr),ke.lang=Kn,Z("X",0,0,"unix"),Z("x",0,0,"valueOf"),ae("x",pt),ae("X",ht),Te("X",function(e,t,a){a._d=new Date(parseFloat(e)*1e3)}),Te("x",function(e,t,a){a._d=new Date(be(e))});return i.version="2.30.1",S(Ae),i.fn=K,i.min=hl,i.max=fl,i.now=ml,i.utc=g,i.unix=Wu,i.months=Hu,i.isDate=h,i.locale=xt,i.invalid=j,i.duration=ut,i.isMoment=T,i.weekdays=Bu,i.parseZone=qu,i.localeData=yt,i.isDuration=or,i.monthsShort=$u,i.weekdaysMin=Gu,i.defineLocale=Ar,i.updateLocale=qo,i.locales=Ho,i.weekdaysShort=Uu,i.normalizeUnits=ge,i.relativeTimeRounding=wc,i.relativeTimeThreshold=Sc,i.calendarFormat=Vl,i.prototype=K,i.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"},i}))})(gr)),gr.exports}var bh=cn.exports,Si;function wh(){return Si||(Si=1,(function(l,s){(function(u,i){i(typeof br=="function"?yn():u.moment)})(bh,(function(u){var i=u.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(){return this.day()===0?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT":"[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}});return i}))})()),cn.exports}wh();var dn={exports:{}},Sh=dn.exports,Mi;function Mh(){return Mi||(Mi=1,(function(l,s){(function(u,i){i(typeof br=="function"?yn():u.moment)})(Sh,(function(u){var i=u.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(S){var x=S%10,I=~~(S%100/10)===1?"th":x===1?"st":x===2?"nd":x===3?"rd":"th";return S+I},week:{dow:1,doy:4}});return i}))})()),dn.exports}Mh();var hn={exports:{}},xh=hn.exports,xi;function Dh(){return xi||(xi=1,(function(l,s){(function(u,i){i(typeof br=="function"?yn():u.moment)})(xh,(function(u){function i(x,I,o,y){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[x+" Tage",x+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[x+" Monate",x+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[x+" Jahre",x+" Jahren"]};return I?r[o][0]:r[o][1]}var S=u.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:i,mm:"%d Minuten",h:i,hh:"%d Stunden",d:i,dd:i,w:i,ww:"%d Wochen",M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return S}))})()),hn.exports}Dh();const Ot=l=>{let s="";return l.split(":").forEach(u=>{s+=u}),parseInt(s)},Di=l=>l.toString().padStart(4,"0").match(/.{1,2}/g).join(":"),Kr=l=>{const s=l.address;if(l.addresstype==="county"&&s.country)return s.county;if(l.addresstype==="village"&&s.village)return s.village;const u=[];["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(x=>{s.hasOwnProperty(x)&&s[x]&&u.push(s[x])}),s.road?u.push(s.road):s.pedestrian?u.push(s.pedestrian):s.suburb?u.push(s.suburb):s.square?u.push(s.square):(s.neighbourhood&&u.push(s.neighbourhood),s.hamlet?u.push(s.hamlet):s.isolated_dwelling?u.push(s.isolated_dwelling):s.locality?u.push(s.locality):s.croft&&u.push(s.croft)),s.house_number&&u.push(s.house_number),s.postcode&&u.push(s.postcode),s.village&&u.push(s.village),s.town?u.push(s.town):s.city&&u.push(s.city);var S=u.join(", ").substr(0,150);return S};function tr(l){let s=window.sessionStorage.getItem(l);if(s!==null){let u=JSON.parse(s);if(new Date(u.expirationDate)>new Date)return u.value;window.sessionStorage.removeItem(l)}return null}function kh(l,s,u){let i=u?new Date(u*1e3):null;if(i){let S={value:s,expirationDate:i.toISOString()};window.sessionStorage.setItem(l,JSON.stringify(S))}}function ki({day:l,slot:s,i18next:u}){return m.jsx("li",{className:"it-list-item",children:m.jsx("div",{className:"list-item",children:m.jsx("div",{className:"it-right-zone",children:m.jsxs("span",{className:"text pl-4",children:[m.jsx("b",{children:l})," ",u.t("alle")," ",u.t("ore")," ",m.jsx("b",{children:s})]})})})})}const Oi=Rt.Formio.Components.components.field,Oh=({component:l,current:s,onChange:u,i18next:i})=>{const[S,x]=G.useState(),[I,o]=G.useState([]),[y,r]=G.useState([]),[c,h]=G.useState(!1),[f,p]=G.useState(null),[g,Y]=G.useState(null),[_,k]=G.useState(null),[C,j]=G.useState(null),[F,R]=G.useState({}),[O,v]=G.useState(null),[T,w]=G.useState(!1),[M,V]=G.useState([]),[E,A]=G.useState(!1),z=G.useRef(),B=l.calendarId;he.locale(i.language);const ee=N=>{let W=he(N).format("YYYY-MM-DD");fetch(te(W)).then(q=>q.json()).then(q=>{let ce=fe(N||new Date);const se=q.filter(Re=>Re.available==!0);se.length===0&&X();let ge=[];ce.forEach(Re=>{q.some(ct=>ct.date===Re&&ct.available==!0)?ge.push({available:!0,date:Re}):ge.push({available:!1,date:Re})});const _e=ge.map(Re=>{if(Re.available===!1)return he(Re.date,"YYYY-MM-DD").toDate()});o(_e);const $e=se.length?se[0].date:N;ie($e)}).catch(q=>console.error(q))},ie=N=>{j(null),k(null),r([]);let W=he(N).format("YYYY-MM-DD");fetch(de(W)).then(q=>q.json()).then(q=>{const ce=q.filter(se=>se.availability==!0);R(ce[0]),ce.length>0?(r(q),h(!1),k(he(N).format("L")),x(he(N,"YYYY-MM-DD").toDate())):(q.length>0&&x(he(q[0].date,"YYYY-MM-DD").toDate()),r([]),X())})},re=()=>{if(B!==""&&B!=null)if(!s.dataValue)ee(new Date);else if(l.multiple&&Array.isArray(s.dataValue)){if(s.dataValue.length>0){v(s.dataValue);let N=[];s.dataValue.map(W=>{N.push({...W,date:he(W.date,"YYYY-MM-DD").format("DD-MM-YYYY")})}),V(N)}}else if(!l.multiple&&typeof s.dataValue=="object"){const N={date:s.dataValue.date,slot:s.dataValue.slot},W={...s.dataValue,date:he(s.dataValue.date,"YYYY-MM-DD").format("DD-MM-YYYY")};V([W]),v(N)}else{let N=s.dataValue.replace(")","").replace(" ("," @ ").replace(/\//g,"-").split(" @ "),W=N[2].split("#");const q={date:he(N[0],"DD-MM-YYYY").format("YYYY-MM-DD"),slot:N[1]};l.multiple?(u([{date:N[0],slot:N[1],calendar_id:W[0],meeting_id:W[1],opening_hour_id:W.length===3?W[2]:""}]),V([{date:N[0],slot:N[1],calendar_id:W[0],meeting_id:W[1],opening_hour_id:W.length===3?W[2]:""}])):(u({date:N[0],slot:N[1],calendar_id:W[0],meeting_id:W[1],opening_hour_id:W.length===3?W[2]:""}),V([{date:N[0],slot:N[1],calendar_id:W[0],meeting_id:W[1],opening_hour_id:W.length===3?W[2]:""}])),v(q)}};G.useEffect(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{re()},1e3)})},[]);const fe=N=>{let q=he(N,"YYYY-MM").daysInMonth(),ce=[];for(;q;){let se=he(N).date(q);ce.push(se.format("YYYY-MM-DD")),q--}return ce},te=(N,W=!1)=>{let q=l.calendarId,ce=l.select_opening_hours,se=l.select_opening_hours?l.opening_hours:[];window.location.pathname.split("/");let ge=`${Ee()}/api/calendars/${q}/availabilities`,_e=[`from_time=${he(N).startOf("month").format("YYYY-MM-DD")}`,`to_time=${he(N).endOf("month").format("YYYY-MM-DD")}`];return W&&_e.push(`available=${W}`),ce&&se&&_e.push(`opening_hours=${se.join()}`),`${ge}?${_e.join("&")}`},de=(N,W=!1)=>{let q=l.calendarId,ce=l.select_opening_hours,se=l.select_opening_hours?l.opening_hours:[];window.location.pathname.split("/");const ge=he(N).format("YYYY-MM-DD");let _e=`${Ee()}/api/calendars/${q}/availabilities/${ge}`,$e=[];return W&&$e.push(`available=${W}`),ce&&se&&$e.push(`opening_hours=${se.join()}`),$e&&(_e=`${_e}?${$e.join("&")}`),_e},ve=N=>{ee(N)},me=N=>{setTimeout(()=>{w(!T)},1e3),ie(N)},oe=N=>{j(null),setTimeout(()=>{N&&(Y(N.target.dataset),j(N.target.id))},300)},Z=N=>{p(null);let W=`${Ee()}/it/meetings/new-draft`,q={date:g?.date?he(g?.date).format("DD-MM-YYYY"):he(N.target.dataset.date).format("DD-MM-YYYY"),slot:g?.value_start&&g?.value_end?g.value_start+"-"+g.value_end:N.target.dataset.slots,calendar:l.calendarId,opening_hour:g?.opening_hour?g?.opening_hour:N.target.dataset.opening_hour,meeting:f?f.id:"",first_available_date:F.date,first_available_start_time:F.start_time,first_available_end_time:F.end_time,first_availability_updated_at:he().format()};fetch(W,{method:"POST",body:JSON.stringify(q),headers:{"Content-Type":"application/json; charset=utf-8"},strictErrors:!0}).then(ce=>{if(!ce.ok)throw new Error(i.t("Intervallo selezionato non disponibile!"));return ce.json()}).then(ce=>{p(ce);const se={date:q.date,slot:q.slot,calendar_id:q.calendar[0],opening_hour_id:q.opening_hour||q.opening_hour_id,meeting_id:ce.id};V([...M,se])}).catch(ce=>{console.log(ce),He.fire({title:"",html:"<p>"+ce+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1})})},Ne=()=>{g&&(Z(),w(!T))},Ie=()=>m.jsx("span",{children:i.t("Tempo prenotazione scaduto!")}),Ce=({minutes:N,seconds:W,completed:q})=>q?m.jsx(Ie,{}):m.jsx("div",{children:m.jsxs("div",{children:[" ",m.jsxs("span",{children:[" ",m.jsxs("i",{children:[i.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"),":"]})," ",m.jsxs("b",{children:[N," ",i.t("minuti")," ",W," ",i.t("secondi")]})]})]})}),Oe=N=>{const W=Ot(N.target.value),q=Ot(N.target.min),ce=Ot(N.target.max);W<q||W>ce||W>Ot(g.end)?(He.fire({title:"",html:`<p>${i.t("l'orario")} <b>${Di(W)}</b> ${i.t("non è valido")}</p>`,icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1}),J("")):Y({...g,value_start:N.target.value})},$=N=>{const W=Ot(N.target.value),q=Ot(N.target.min),ce=Ot(N.target.max);W<q||W>ce||W<Ot(g.start)?(He.fire({title:"",html:`<p>${i.t("l'orario")} <b>${Di(W)}</b> ${i.t("non è valido")}</p>`,icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1}),J("")):Y({...g,value_end:N.target.value})},J=N=>{if(N===null||N==="")u("");else if(Array.isArray(N)&&N.length>0){let W=[];M.map(q=>{W.push({date:he(q.date,"DD-MM-YYYY").format("YYYY-MM-DD"),slot:q.slot,calendar_id:q.calendar_id||q.calendar[0],meeting_id:q.meeting_id,opening_hour_id:q.opening_hour||q.opening_hour_id})}),l.multiple?u(W):u(W[0])}else u("")},X=()=>{h(!0),p(null),k(null),J(null)},P=()=>{if(i.language==="it")return Hs;if(i.language==="en")return qs;if(i.language==="de")return Ws};G.useEffect(()=>{J(M)},[M]),G.useEffect(()=>{document.querySelector(".formio-read-only")&&E===!1?(A(!0),setTimeout(()=>{re()},1e3)):(A(!1),setTimeout(()=>{re()},1e3))},[]);const H=(N,W)=>{let q=`${Ee()}/api/meetings/${W.meeting_id}`;fetch(q,{method:"DELETE",headers:{"Content-Type":"application/json; charset=utf-8",Authorization:`Bearer ${tr("auth-token")}`},strictErrors:!0}).then(ce=>{if(ce&&ce.status>400)He.fire({title:"",html:`<p>${i.t("Ci sono stati degli errori durante la cancellazione dello slot")}</p>`,icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1});else{const se=[...M.slice(0,N),...M.slice(N+1)];V(se),ee(new Date)}})};return m.jsxs(m.Fragment,{children:[E&&O?m.jsxs("div",{className:"my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none",children:[m.jsxs("b",{children:[Array.isArray(O)&&O.length>1?i.t("Giorni selezionati per la prenotazione"):i.t("Giorno selezionato per la prenotazione"),":"]}),m.jsx("div",{className:"mb-5",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:Array.isArray(O)?O.map(N=>m.jsx(ki,{day:he(N.date,"DD-MM-YYYY").format("DD/MM/YYYY"),i18next:i,slot:N.slot})):m.jsx(ki,{day:he(O.date,"DD-MM-YYYY").format("DD/MM/YYYY"),i18next:i,slot:O.slot})})})})]}):m.jsx("div",{className:"slot-calendar ",children:m.jsxs("div",{className:"row",children:[l.multiple?m.jsx("div",{className:"col-12 d-print-none d-preview-calendar-none",children:m.jsxs("div",{className:"m-2",children:[m.jsx("h6",{children:i.t(l.label)}),m.jsx(yr.DayPicker,{mode:"single",selected:S,locale:P(),disabled:I,onMonthChange:ve,onDayClick:me}),m.jsx("p",{children:i.t("Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione")})]})}):M.length!==1?m.jsx("div",{className:"col-12 d-print-none d-preview-calendar-none",children:m.jsxs("div",{className:"m-2",children:[m.jsx("h6",{children:i.t(l.label)}),m.jsx(yr.DayPicker,{mode:"single",selected:S,locale:P(),disabled:I,onMonthChange:ve,onDayClick:me}),m.jsxs("p",{children:[" ",i.t("Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione")]})]})}):null,m.jsx("div",{className:"col-12",children:M.length?m.jsx("div",{className:"row m-2",children:m.jsxs("div",{className:"col-12 mb-4",children:[m.jsxs("b",{children:[M.length>1?i.t("Giorni selezionati per la prenotazione"):i.t("Giorno selezionato per la prenotazione"),":"," "]}),m.jsx("div",{className:"mb-5",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:M.map((N,W)=>m.jsx("li",{children:m.jsx("div",{className:"list-item",children:m.jsxs("div",{className:"it-right-zone",children:[m.jsxs("span",{className:"text pl-4",children:[N.date," ",g||N.slot?`${i.t("alle")} ${N.slot}`:""]}),m.jsx(ue.Icon,{icon:"it-delete",onClick:()=>H(W,N),role:"button"})]})})},"li"+W))})})}),f?m.jsx(ue.Alert,{color:"info",defaultValue:"string",className:"d-print-none d-preview-calendar-none",children:m.jsx(Vs,{date:f.expiration_time,renderer:Ce})}):null]})}):null})]})}),m.jsxs(ue.Modal,{isOpen:T,toggle:()=>w(!T),labelledBy:"daySelected",size:"lg",centered:!0,container:document.body,children:[m.jsx(ue.ModalHeader,{toggle:()=>w(!T),id:"daySelected",children:i.t("Seleziona una fascia oraria")}),c?null:m.jsxs("div",{className:"title-xsmall u-grey-dark px-4",children:[" ",i.t("Seleziona una fascia oraria e, se necessario, utilizza l'apposito controllo per accorciare la durata della prenotazione, Poi clicca su Conferma")]}),m.jsx(ue.ModalBody,{children:m.jsxs("div",{className:"row",children:[M.length>=1?m.jsxs("div",{children:[_&&!c?m.jsxs("h6",{children:[i.t("Orari disponibili del")," ",Me(_).format("DD/MM/YYYY")]}):null,m.jsxs("div",{className:"calendar-last-selection col-12 pt-2 mb-5",children:[m.jsx("small",{className:"pl-2 mb-2 d-flex px-2",children:m.jsxs("b",{children:[m.jsx(ue.Icon,{icon:"it-clock",className:"mr-1",size:"sm"})," ",i.t("Ultimo orario selezionato")]})}),m.jsx("div",{className:"col-6 px-2",children:m.jsx("button",{type:"button",id:"slot-last-selection",onClick:oe,tabIndex:"1",className:C==="slot-last-selection"?"active btn btn-slot p-0":"btn btn-slot p-0","data-date":he(_,"DD/MM/YYYY").format("YYYY-MM-DD"),"data-slots":M[M.length-1].slot,"data-opening_hour":M[M.length-1].opening_hour_id,"data-start":M[M.length-1].slot.split("-")[0],"data-end":M[M.length-1].slot.split("-")[1],"data-value_start":M[M.length-1].slot.split("-")[0],"data-value_end":M[M.length-1].slot.split("-")[1],disabled:c,children:M[M.length-1].slot})})]})]}):null,m.jsx("div",{children:_&&M.length>=1?m.jsx("h6",{children:i.t("Seleziona altri orari")}):c?null:m.jsxs("h6",{children:[i.t("Orari disponibili del")," ",Me(_).format("DD/MM/YYYY")]})}),y.map((N,W)=>m.jsx("div",{className:"col-6",children:m.jsxs("button",{type:"button",id:"slot-"+W,onClick:oe,ref:z,className:C==="slot-"+W?"active btn btn-slot p-0":"btn btn-slot p-0",tabIndex:"1","data-date":N.date,"data-start":N.start_time,"data-end":N.end_time,"data-value_start":N.start_time,"data-value_end":N.end_time,"data-slots":N.start_time+"-"+N.end_time,"data-opening_hour":N.opening_hour,"data-min_duration":N.min_duration,disabled:N.slots_available==0,children:[N.start_time," - ",N.end_time]})},"slot-"+W)),c?m.jsxs("div",{className:"callout callout-highlight warning",children:[m.jsxs("div",{className:"callout-title",children:[m.jsx(ue.Icon,{"aria-hidden":!0,icon:"it-help-circle"}),i.t("Attenzione")]}),m.jsxs("p",{children:[" ",i.t("Non è possibile prenotare per la data selezionata"),"."]})]}):null,m.jsx("div",{className:"col-12",children:g?.value_start&&C?m.jsxs("div",{className:"row",children:[m.jsx("div",{className:"col-12 mb-3",children:m.jsx("p",{className:"mb-3",children:m.jsx("b",{children:i.t("Se necessario, utilizza il controllo che segue per accorciare la durata della prenotazione")})})}),m.jsx("div",{className:"col-12 col-md-6 mb-4",children:m.jsx(ue.Input,{type:"time",label:i.t("Dalle"),className:"active",defaultValue:g.value_start||g.start,min:g.start,max:g.end,onBlur:Oe})}),m.jsx("div",{className:"col-12 col-md-6 mb-4",children:m.jsx(ue.Input,{type:"time",label:i.t("alle"),className:"active",defaultValue:g.value_end||g.end,onBlur:$,min:g.start,max:g.end})})]}):null})]})}),m.jsx(ue.ModalFooter,{children:m.jsx(ue.Button,{color:"primary",onClick:()=>Ne(),disabled:!_||!g?.value_start,children:i.t("Conferma")})})]})]})};let $s=class Bs extends Oi{constructor(s,u,i){super(s,u,i)}static get builderInfo(){return{title:"Dynamic Calendar",group:"basic",icon:"bi bi-calendar-plus",documentation:"",weight:70,schema:Bs.schema()}}static schema(){return Oi.schema({type:"dynamic_calendar"})}static editForm=Pc;attach(s){return super.attach(s).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:"single"});const u=this.refs[`react-${this.id}`];return u?(this.rootComponent=Et.createRoot(u),this.rootComponent.render(m.jsx(Oh,{component:this.component,value:this.dataValue,onChange:i=>this.setValue(i),...this,current:this})),this):this})}detach(){return this.rootComponent&&(this.rootComponent.unmount(),this.rootComponent=null),super.detach()}setValue(s){if(s)if(Array.isArray(s))this.selectedNextSlots=s,this.updateValue(s),this.shouldSetValue=!0;else if(typeof s=="object")this.date=s.date,this.slot=s.slot,this.meeting=s.meeting_id,this.meeting_expiration_time=null,this.opening_hour=s.opening_hour_id,this.calendar_id=s.calendar_id,this.updateValue(s),this.shouldSetValue=!0;else{let u=s.replace(")","").replace(" ("," @ ").replace(/\//g,"-").split(" @ "),i=u[2].split("#");this.date=u[0],this.slot=u[1],this.meeting=i[1],this.meeting_expiration_time=null,this.opening_hour=i.length===3?i[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 s=this.meeting?this.meeting:"",u=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:s,opening_hour_id:u}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}};const Yh=[{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:Ee()+"/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 = '"+Ee()+"'; 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:Ee()+"/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) {
|
|
48
|
+
`+new Error().stack),a=!1}return t.apply(this,arguments)},t)}var V={};function E(e,t){i.deprecationHandler!=null&&i.deprecationHandler(e,t),V[e]||(w(t),V[e]=!0)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null;function A(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function z(e){var t,a;for(a in e)o(e,a)&&(t=e[a],A(t)?this[a]=t:this["_"+a]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function B(e,t){var a=p({},e),n;for(n in t)o(t,n)&&(I(e[n])&&I(t[n])?(a[n]={},p(a[n],e[n]),p(a[n],t[n])):t[n]!=null?a[n]=t[n]:delete a[n]);for(n in e)o(e,n)&&!o(t,n)&&I(e[n])&&(a[n]=p({},a[n]));return a}function ee(e){e!=null&&this.set(e)}var ie;Object.keys?ie=Object.keys:ie=function(e){var t,a=[];for(t in e)o(e,t)&&a.push(t);return a};var re={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function fe(e,t,a){var n=this._calendar[e]||this._calendar.sameElse;return A(n)?n.call(t,a):n}function te(e,t,a){var n=""+Math.abs(e),d=t-n.length,D=e>=0;return(D?a?"+":"":"-")+Math.pow(10,Math.max(0,d)).toString().substr(1)+n}var de=/(\[[^\[]*\])|(\\)?([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,ve=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,me={},oe={};function Z(e,t,a,n){var d=n;typeof n=="string"&&(d=function(){return this[n]()}),e&&(oe[e]=d),t&&(oe[t[0]]=function(){return te(d.apply(this,arguments),t[1],t[2])}),a&&(oe[a]=function(){return this.localeData().ordinal(d.apply(this,arguments),e)})}function Ne(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Ie(e){var t=e.match(de),a,n;for(a=0,n=t.length;a<n;a++)oe[t[a]]?t[a]=oe[t[a]]:t[a]=Ne(t[a]);return function(d){var D="",L;for(L=0;L<n;L++)D+=A(t[L])?t[L].call(d,e):t[L];return D}}function Ce(e,t){return e.isValid()?(t=Oe(t,e.localeData()),me[t]=me[t]||Ie(t),me[t](e)):e.localeData().invalidDate()}function Oe(e,t){var a=5;function n(d){return t.longDateFormat(d)||d}for(ve.lastIndex=0;a>=0&&ve.test(e);)e=e.replace(ve,n),ve.lastIndex=0,a-=1;return e}var $={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 J(e){var t=this._longDateFormat[e],a=this._longDateFormat[e.toUpperCase()];return t||!a?t:(this._longDateFormat[e]=a.match(de).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var X="Invalid date";function P(){return this._invalidDate}var H="%d",N=/\d{1,2}/;function W(e){return this._ordinal.replace("%d",e)}var q={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 ce(e,t,a,n){var d=this._relativeTime[a];return A(d)?d(e,t,a,n):d.replace(/%d/i,e)}function se(e,t){var a=this._relativeTime[e>0?"future":"past"];return A(a)?a(t):a.replace(/%s/i,t)}var Pe={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 ge(e){return typeof e=="string"?Pe[e]||Pe[e.toLowerCase()]:void 0}function _e(e){var t={},a,n;for(n in e)o(e,n)&&(a=ge(n),a&&(t[a]=e[n]));return t}var $e={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 Re(e){var t=[],a;for(a in e)o(e,a)&&t.push({unit:a,priority:$e[a]});return t.sort(function(n,d){return n.priority-d.priority}),t}var ct=/\d/,Ue=/\d\d/,it=/\d{3}/,Yt=/\d{4}/,st=/[+-]?\d{6}/,je=/\d\d?/,Ct=/\d\d\d\d?/,At=/\d\d\d\d\d\d?/,ot=/\d{1,3}/,mt=/\d{1,4}/,dt=/[+-]?\d{1,6}/,tt=/\d+/,pt=/[+-]?\d+/,gt=/Z|[+-]\d\d:?\d\d/gi,We=/Z|[+-]\d\d(?::?\d\d)?/gi,ht=/[+-]?\d+(\.\d{1,3})?/,lt=/[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,rt=/^[1-9]\d?/,Qe=/^([1-9]\d|\d)/,It;It={};function ae(e,t,a){It[e]=A(t)?t:function(n,d){return n&&a?a:t}}function Cr(e,t){return o(It,e)?It[e](t._strict,t._locale):new RegExp(rr(e))}function rr(e){return at(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,a,n,d,D){return a||n||d||D}))}function at(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function et(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function be(e){var t=+e,a=0;return t!==0&&isFinite(t)&&(a=et(t)),a}var Ft={};function Te(e,t){var a,n=t,d;for(typeof e=="string"&&(e=[e]),c(t)&&(n=function(D,L){L[t]=be(D)}),d=e.length,a=0;a<d;a++)Ft[e[a]]=n}function jt(e,t){Te(e,function(a,n,d,D){d._w=d._w||{},t(a,d._w,d,D)})}function jr(e,t,a){t!=null&&o(Ft,e)&&Ft[e](t,a._a,a,e)}function Vt(e){return e%4===0&&e%100!==0||e%400===0}var Ge=0,b=1,U=2,Q=3,le=4,ye=5,xe=6,Me=7,we=8;Z("Y",0,0,function(){var e=this.year();return e<=9999?te(e,4):"+"+e}),Z(0,["YY",2],0,function(){return this.year()%100}),Z(0,["YYYY",4],0,"year"),Z(0,["YYYYY",5],0,"year"),Z(0,["YYYYYY",6,!0],0,"year"),ae("Y",pt),ae("YY",je,Ue),ae("YYYY",mt,Yt),ae("YYYYY",dt,st),ae("YYYYYY",dt,st),Te(["YYYYY","YYYYYY"],Ge),Te("YYYY",function(e,t){t[Ge]=e.length===2?i.parseTwoDigitYear(e):be(e)}),Te("YY",function(e,t){t[Ge]=i.parseTwoDigitYear(e)}),Te("Y",function(e,t){t[Ge]=parseInt(e,10)});function qe(e){return Vt(e)?366:365}i.parseTwoDigitYear=function(e){return be(e)+(be(e)>68?1900:2e3)};var Fe=Be("FullYear",!0);function Le(){return Vt(this.year())}function Be(e,t){return function(a){return a!=null?(ft(this,e,a),i.updateOffset(this,t),this):nt(this,e)}}function nt(e,t){if(!e.isValid())return NaN;var a=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?a.getUTCMilliseconds():a.getMilliseconds();case"Seconds":return n?a.getUTCSeconds():a.getSeconds();case"Minutes":return n?a.getUTCMinutes():a.getMinutes();case"Hours":return n?a.getUTCHours():a.getHours();case"Date":return n?a.getUTCDate():a.getDate();case"Day":return n?a.getUTCDay():a.getDay();case"Month":return n?a.getUTCMonth():a.getMonth();case"FullYear":return n?a.getUTCFullYear():a.getFullYear();default:return NaN}}function ft(e,t,a){var n,d,D,L,ne;if(!(!e.isValid()||isNaN(a))){switch(n=e._d,d=e._isUTC,t){case"Milliseconds":return void(d?n.setUTCMilliseconds(a):n.setMilliseconds(a));case"Seconds":return void(d?n.setUTCSeconds(a):n.setSeconds(a));case"Minutes":return void(d?n.setUTCMinutes(a):n.setMinutes(a));case"Hours":return void(d?n.setUTCHours(a):n.setHours(a));case"Date":return void(d?n.setUTCDate(a):n.setDate(a));case"FullYear":break;default:return}D=a,L=e.month(),ne=e.date(),ne=ne===29&&L===1&&!Vt(D)?28:ne,d?n.setUTCFullYear(D,L,ne):n.setFullYear(D,L,ne)}}function Je(e){return e=ge(e),A(this[e])?this[e]():this}function Ut(e,t){if(typeof e=="object"){e=_e(e);var a=Re(e),n,d=a.length;for(n=0;n<d;n++)this[a[n].unit](e[a[n].unit])}else if(e=ge(e),A(this[e]))return this[e](t);return this}function Tr(e,t){return(e%t+t)%t}var ze;Array.prototype.indexOf?ze=Array.prototype.indexOf:ze=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Pr(e,t){if(isNaN(e)||isNaN(t))return NaN;var a=Tr(t,12);return e+=(t-a)/12,a===1?Vt(e)?29:28:31-a%7%2}Z("M",["MM",2],"Mo",function(){return this.month()+1}),Z("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),Z("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ae("M",je,rt),ae("MM",je,Ue),ae("MMM",function(e,t){return t.monthsShortRegex(e)}),ae("MMMM",function(e,t){return t.monthsRegex(e)}),Te(["M","MM"],function(e,t){t[b]=be(e)-1}),Te(["MMM","MMMM"],function(e,t,a,n){var d=a._locale.monthsParse(e,n,a._strict);d!=null?t[b]=d:_(a).invalidMonth=e});var Qs="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),On="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yn=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,eo=lt,to=lt;function ro(e,t){return e?x(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Yn).test(t)?"format":"standalone"][e.month()]:x(this._months)?this._months:this._months.standalone}function ao(e,t){return e?x(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Yn.test(t)?"format":"standalone"][e.month()]:x(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function no(e,t,a){var n,d,D,L=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)D=g([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(D,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(D,"").toLocaleLowerCase();return a?t==="MMM"?(d=ze.call(this._shortMonthsParse,L),d!==-1?d:null):(d=ze.call(this._longMonthsParse,L),d!==-1?d:null):t==="MMM"?(d=ze.call(this._shortMonthsParse,L),d!==-1?d:(d=ze.call(this._longMonthsParse,L),d!==-1?d:null)):(d=ze.call(this._longMonthsParse,L),d!==-1?d:(d=ze.call(this._shortMonthsParse,L),d!==-1?d:null))}function io(e,t,a){var n,d,D;if(this._monthsParseExact)return no.call(this,e,t,a);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(d=g([2e3,n]),a&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(d,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(d,"").replace(".","")+"$","i")),!a&&!this._monthsParse[n]&&(D="^"+this.months(d,"")+"|^"+this.monthsShort(d,""),this._monthsParse[n]=new RegExp(D.replace(".",""),"i")),a&&t==="MMMM"&&this._longMonthsParse[n].test(e))return n;if(a&&t==="MMM"&&this._shortMonthsParse[n].test(e))return n;if(!a&&this._monthsParse[n].test(e))return n}}function Cn(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=be(t);else if(t=e.localeData().monthsParse(t),!c(t))return e}var a=t,n=e.date();return n=n<29?n:Math.min(n,Pr(e.year(),a)),e._isUTC?e._d.setUTCMonth(a,n):e._d.setMonth(a,n),e}function jn(e){return e!=null?(Cn(this,e),i.updateOffset(this,!0),this):nt(this,"Month")}function so(){return Pr(this.year(),this.month())}function oo(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Tn.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=eo),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function lo(e){return this._monthsParseExact?(o(this,"_monthsRegex")||Tn.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=to),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Tn(){function e(pe,De){return De.length-pe.length}var t=[],a=[],n=[],d,D,L,ne;for(d=0;d<12;d++)D=g([2e3,d]),L=at(this.monthsShort(D,"")),ne=at(this.months(D,"")),t.push(L),a.push(ne),n.push(ne),n.push(L);t.sort(e),a.sort(e),n.sort(e),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function uo(e,t,a,n,d,D,L){var ne;return e<100&&e>=0?(ne=new Date(e+400,t,a,n,d,D,L),isFinite(ne.getFullYear())&&ne.setFullYear(e)):ne=new Date(e,t,a,n,d,D,L),ne}function Gt(e){var t,a;return e<100&&e>=0?(a=Array.prototype.slice.call(arguments),a[0]=e+400,t=new Date(Date.UTC.apply(null,a)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ar(e,t,a){var n=7+t-a,d=(7+Gt(e,0,n).getUTCDay()-t)%7;return-d+n-1}function Pn(e,t,a,n,d){var D=(7+a-n)%7,L=ar(e,n,d),ne=1+7*(t-1)+D+L,pe,De;return ne<=0?(pe=e-1,De=qe(pe)+ne):ne>qe(e)?(pe=e+1,De=ne-qe(e)):(pe=e,De=ne),{year:pe,dayOfYear:De}}function Jt(e,t,a){var n=ar(e.year(),t,a),d=Math.floor((e.dayOfYear()-n-1)/7)+1,D,L;return d<1?(L=e.year()-1,D=d+vt(L,t,a)):d>vt(e.year(),t,a)?(D=d-vt(e.year(),t,a),L=e.year()+1):(L=e.year(),D=d),{week:D,year:L}}function vt(e,t,a){var n=ar(e,t,a),d=ar(e+1,t,a);return(qe(e)-n+d)/7}Z("w",["ww",2],"wo","week"),Z("W",["WW",2],"Wo","isoWeek"),ae("w",je,rt),ae("ww",je,Ue),ae("W",je,rt),ae("WW",je,Ue),jt(["w","ww","W","WW"],function(e,t,a,n){t[n.substr(0,1)]=be(e)});function co(e){return Jt(e,this._week.dow,this._week.doy).week}var ho={dow:0,doy:6};function fo(){return this._week.dow}function mo(){return this._week.doy}function po(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function go(e){var t=Jt(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Z("d",0,"do","day"),Z("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),Z("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),Z("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),Z("e",0,0,"weekday"),Z("E",0,0,"isoWeekday"),ae("d",je),ae("e",je),ae("E",je),ae("dd",function(e,t){return t.weekdaysMinRegex(e)}),ae("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ae("dddd",function(e,t){return t.weekdaysRegex(e)}),jt(["dd","ddd","dddd"],function(e,t,a,n){var d=a._locale.weekdaysParse(e,n,a._strict);d!=null?t.d=d:_(a).invalidWeekday=e}),jt(["d","e","E"],function(e,t,a,n){t[n]=be(e)});function vo(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function yo(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Nr(e,t){return e.slice(t,7).concat(e.slice(0,t))}var _o="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Nn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),bo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),wo=lt,So=lt,Mo=lt;function xo(e,t){var a=x(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Nr(a,this._week.dow):e?a[e.day()]:a}function Do(e){return e===!0?Nr(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ko(e){return e===!0?Nr(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Oo(e,t,a){var n,d,D,L=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)D=g([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(D,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(D,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(D,"").toLocaleLowerCase();return a?t==="dddd"?(d=ze.call(this._weekdaysParse,L),d!==-1?d:null):t==="ddd"?(d=ze.call(this._shortWeekdaysParse,L),d!==-1?d:null):(d=ze.call(this._minWeekdaysParse,L),d!==-1?d:null):t==="dddd"?(d=ze.call(this._weekdaysParse,L),d!==-1||(d=ze.call(this._shortWeekdaysParse,L),d!==-1)?d:(d=ze.call(this._minWeekdaysParse,L),d!==-1?d:null)):t==="ddd"?(d=ze.call(this._shortWeekdaysParse,L),d!==-1||(d=ze.call(this._weekdaysParse,L),d!==-1)?d:(d=ze.call(this._minWeekdaysParse,L),d!==-1?d:null)):(d=ze.call(this._minWeekdaysParse,L),d!==-1||(d=ze.call(this._weekdaysParse,L),d!==-1)?d:(d=ze.call(this._shortWeekdaysParse,L),d!==-1?d:null))}function Yo(e,t,a){var n,d,D;if(this._weekdaysParseExact)return Oo.call(this,e,t,a);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(d=g([2e3,1]).day(n),a&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(d,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(d,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(d,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(D="^"+this.weekdays(d,"")+"|^"+this.weekdaysShort(d,"")+"|^"+this.weekdaysMin(d,""),this._weekdaysParse[n]=new RegExp(D.replace(".",""),"i")),a&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(a&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(a&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!a&&this._weekdaysParse[n].test(e))return n}}function Co(e){if(!this.isValid())return e!=null?this:NaN;var t=nt(this,"Day");return e!=null?(e=vo(e,this.localeData()),this.add(e-t,"d")):t}function jo(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function To(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=yo(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Po(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Rr.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=wo),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function No(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Rr.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=So),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ro(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Rr.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mo),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Rr(){function e(Ke,St){return St.length-Ke.length}var t=[],a=[],n=[],d=[],D,L,ne,pe,De;for(D=0;D<7;D++)L=g([2e3,1]).day(D),ne=at(this.weekdaysMin(L,"")),pe=at(this.weekdaysShort(L,"")),De=at(this.weekdays(L,"")),t.push(ne),a.push(pe),n.push(De),d.push(ne),d.push(pe),d.push(De);t.sort(e),a.sort(e),n.sort(e),d.sort(e),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Er(){return this.hours()%12||12}function Eo(){return this.hours()||24}Z("H",["HH",2],0,"hour"),Z("h",["hh",2],0,Er),Z("k",["kk",2],0,Eo),Z("hmm",0,0,function(){return""+Er.apply(this)+te(this.minutes(),2)}),Z("hmmss",0,0,function(){return""+Er.apply(this)+te(this.minutes(),2)+te(this.seconds(),2)}),Z("Hmm",0,0,function(){return""+this.hours()+te(this.minutes(),2)}),Z("Hmmss",0,0,function(){return""+this.hours()+te(this.minutes(),2)+te(this.seconds(),2)});function Rn(e,t){Z(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Rn("a",!0),Rn("A",!1);function En(e,t){return t._meridiemParse}ae("a",En),ae("A",En),ae("H",je,Qe),ae("h",je,rt),ae("k",je,rt),ae("HH",je,Ue),ae("hh",je,Ue),ae("kk",je,Ue),ae("hmm",Ct),ae("hmmss",At),ae("Hmm",Ct),ae("Hmmss",At),Te(["H","HH"],Q),Te(["k","kk"],function(e,t,a){var n=be(e);t[Q]=n===24?0:n}),Te(["a","A"],function(e,t,a){a._isPm=a._locale.isPM(e),a._meridiem=e}),Te(["h","hh"],function(e,t,a){t[Q]=be(e),_(a).bigHour=!0}),Te("hmm",function(e,t,a){var n=e.length-2;t[Q]=be(e.substr(0,n)),t[le]=be(e.substr(n)),_(a).bigHour=!0}),Te("hmmss",function(e,t,a){var n=e.length-4,d=e.length-2;t[Q]=be(e.substr(0,n)),t[le]=be(e.substr(n,2)),t[ye]=be(e.substr(d)),_(a).bigHour=!0}),Te("Hmm",function(e,t,a){var n=e.length-2;t[Q]=be(e.substr(0,n)),t[le]=be(e.substr(n))}),Te("Hmmss",function(e,t,a){var n=e.length-4,d=e.length-2;t[Q]=be(e.substr(0,n)),t[le]=be(e.substr(n,2)),t[ye]=be(e.substr(d))});function Ao(e){return(e+"").toLowerCase().charAt(0)==="p"}var Io=/[ap]\.?m?\.?/i,Fo=Be("Hours",!0);function Vo(e,t,a){return e>11?a?"pm":"PM":a?"am":"AM"}var An={calendar:re,longDateFormat:$,invalidDate:X,ordinal:H,dayOfMonthOrdinalParse:N,relativeTime:q,months:Qs,monthsShort:On,week:ho,weekdays:_o,weekdaysMin:bo,weekdaysShort:Nn,meridiemParse:Io},Ve={},Kt={},Xt;function zo(e,t){var a,n=Math.min(e.length,t.length);for(a=0;a<n;a+=1)if(e[a]!==t[a])return a;return n}function In(e){return e&&e.toLowerCase().replace("_","-")}function Lo(e){for(var t=0,a,n,d,D;t<e.length;){for(D=In(e[t]).split("-"),a=D.length,n=In(e[t+1]),n=n?n.split("-"):null;a>0;){if(d=nr(D.slice(0,a).join("-")),d)return d;if(n&&n.length>=a&&zo(D,n)>=a-1)break;a--}t++}return Xt}function Wo(e){return!!(e&&e.match("^[^/\\\\]*$"))}function nr(e){var t=null,a;if(Ve[e]===void 0&&l&&l.exports&&Wo(e))try{t=Xt._abbr,a=br,a("./locale/"+e),xt(t)}catch{Ve[e]=null}return Ve[e]}function xt(e,t){var a;return e&&(r(t)?a=yt(e):a=Ar(e,t),a?Xt=a:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Xt._abbr}function Ar(e,t){if(t!==null){var a,n=An;if(t.abbr=e,Ve[e]!=null)E("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."),n=Ve[e]._config;else if(t.parentLocale!=null)if(Ve[t.parentLocale]!=null)n=Ve[t.parentLocale]._config;else if(a=nr(t.parentLocale),a!=null)n=a._config;else return Kt[t.parentLocale]||(Kt[t.parentLocale]=[]),Kt[t.parentLocale].push({name:e,config:t}),null;return Ve[e]=new ee(B(n,t)),Kt[e]&&Kt[e].forEach(function(d){Ar(d.name,d.config)}),xt(e),Ve[e]}else return delete Ve[e],null}function qo(e,t){if(t!=null){var a,n,d=An;Ve[e]!=null&&Ve[e].parentLocale!=null?Ve[e].set(B(Ve[e]._config,t)):(n=nr(e),n!=null&&(d=n._config),t=B(d,t),n==null&&(t.abbr=e),a=new ee(t),a.parentLocale=Ve[e],Ve[e]=a),xt(e)}else Ve[e]!=null&&(Ve[e].parentLocale!=null?(Ve[e]=Ve[e].parentLocale,e===xt()&&xt(e)):Ve[e]!=null&&delete Ve[e]);return Ve[e]}function yt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Xt;if(!x(e)){if(t=nr(e),t)return t;e=[e]}return Lo(e)}function Ho(){return ie(Ve)}function Ir(e){var t,a=e._a;return a&&_(e).overflow===-2&&(t=a[b]<0||a[b]>11?b:a[U]<1||a[U]>Pr(a[Ge],a[b])?U:a[Q]<0||a[Q]>24||a[Q]===24&&(a[le]!==0||a[ye]!==0||a[xe]!==0)?Q:a[le]<0||a[le]>59?le:a[ye]<0||a[ye]>59?ye:a[xe]<0||a[xe]>999?xe:-1,_(e)._overflowDayOfYear&&(t<Ge||t>U)&&(t=U),_(e)._overflowWeeks&&t===-1&&(t=Me),_(e)._overflowWeekday&&t===-1&&(t=we),_(e).overflow=t),e}var $o=/^\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)?)?$/,Bo=/^\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)?)?$/,Uo=/Z|[+-]\d\d(?::?\d\d)?/,ir=[["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]],Fr=[["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/]],Go=/^\/?Date\((-?\d+)/i,Jo=/^(?:(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}))$/,Ko={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Fn(e){var t,a,n=e._i,d=$o.exec(n)||Bo.exec(n),D,L,ne,pe,De=ir.length,Ke=Fr.length;if(d){for(_(e).iso=!0,t=0,a=De;t<a;t++)if(ir[t][1].exec(d[1])){L=ir[t][0],D=ir[t][2]!==!1;break}if(L==null){e._isValid=!1;return}if(d[3]){for(t=0,a=Ke;t<a;t++)if(Fr[t][1].exec(d[3])){ne=(d[2]||" ")+Fr[t][0];break}if(ne==null){e._isValid=!1;return}}if(!D&&ne!=null){e._isValid=!1;return}if(d[4])if(Uo.exec(d[4]))pe="Z";else{e._isValid=!1;return}e._f=L+(ne||"")+(pe||""),zr(e)}else e._isValid=!1}function Xo(e,t,a,n,d,D){var L=[Zo(e),On.indexOf(t),parseInt(a,10),parseInt(n,10),parseInt(d,10)];return D&&L.push(parseInt(D,10)),L}function Zo(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Qo(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function el(e,t,a){if(e){var n=Nn.indexOf(e),d=new Date(t[0],t[1],t[2]).getDay();if(n!==d)return _(a).weekdayMismatch=!0,a._isValid=!1,!1}return!0}function tl(e,t,a){if(e)return Ko[e];if(t)return 0;var n=parseInt(a,10),d=n%100,D=(n-d)/100;return D*60+d}function Vn(e){var t=Jo.exec(Qo(e._i)),a;if(t){if(a=Xo(t[4],t[3],t[2],t[5],t[6],t[7]),!el(t[1],a,e))return;e._a=a,e._tzm=tl(t[8],t[9],t[10]),e._d=Gt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),_(e).rfc2822=!0}else e._isValid=!1}function rl(e){var t=Go.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Fn(e),e._isValid===!1)delete e._isValid;else return;if(Vn(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:i.createFromInputFallback(e)}i.createFromInputFallback=M("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 zt(e,t,a){return e??t??a}function al(e){var t=new Date(i.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Vr(e){var t,a,n=[],d,D,L;if(!e._d){for(d=al(e),e._w&&e._a[U]==null&&e._a[b]==null&&nl(e),e._dayOfYear!=null&&(L=zt(e._a[Ge],d[Ge]),(e._dayOfYear>qe(L)||e._dayOfYear===0)&&(_(e)._overflowDayOfYear=!0),a=Gt(L,0,e._dayOfYear),e._a[b]=a.getUTCMonth(),e._a[U]=a.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=d[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Q]===24&&e._a[le]===0&&e._a[ye]===0&&e._a[xe]===0&&(e._nextDay=!0,e._a[Q]=0),e._d=(e._useUTC?Gt:uo).apply(null,n),D=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&&typeof e._w.d<"u"&&e._w.d!==D&&(_(e).weekdayMismatch=!0)}}function nl(e){var t,a,n,d,D,L,ne,pe,De;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(D=1,L=4,a=zt(t.GG,e._a[Ge],Jt(Ae(),1,4).year),n=zt(t.W,1),d=zt(t.E,1),(d<1||d>7)&&(pe=!0)):(D=e._locale._week.dow,L=e._locale._week.doy,De=Jt(Ae(),D,L),a=zt(t.gg,e._a[Ge],De.year),n=zt(t.w,De.week),t.d!=null?(d=t.d,(d<0||d>6)&&(pe=!0)):t.e!=null?(d=t.e+D,(t.e<0||t.e>6)&&(pe=!0)):d=D),n<1||n>vt(a,D,L)?_(e)._overflowWeeks=!0:pe!=null?_(e)._overflowWeekday=!0:(ne=Pn(a,n,d,D,L),e._a[Ge]=ne.year,e._dayOfYear=ne.dayOfYear)}i.ISO_8601=function(){},i.RFC_2822=function(){};function zr(e){if(e._f===i.ISO_8601){Fn(e);return}if(e._f===i.RFC_2822){Vn(e);return}e._a=[],_(e).empty=!0;var t=""+e._i,a,n,d,D,L,ne=t.length,pe=0,De,Ke;for(d=Oe(e._f,e._locale).match(de)||[],Ke=d.length,a=0;a<Ke;a++)D=d[a],n=(t.match(Cr(D,e))||[])[0],n&&(L=t.substr(0,t.indexOf(n)),L.length>0&&_(e).unusedInput.push(L),t=t.slice(t.indexOf(n)+n.length),pe+=n.length),oe[D]?(n?_(e).empty=!1:_(e).unusedTokens.push(D),jr(D,n,e)):e._strict&&!n&&_(e).unusedTokens.push(D);_(e).charsLeftOver=ne-pe,t.length>0&&_(e).unusedInput.push(t),e._a[Q]<=12&&_(e).bigHour===!0&&e._a[Q]>0&&(_(e).bigHour=void 0),_(e).parsedDateParts=e._a.slice(0),_(e).meridiem=e._meridiem,e._a[Q]=il(e._locale,e._a[Q],e._meridiem),De=_(e).era,De!==null&&(e._a[Ge]=e._locale.erasConvertYear(De,e._a[Ge])),Vr(e),Ir(e)}function il(e,t,a){var n;return a==null?t:e.meridiemHour!=null?e.meridiemHour(t,a):(e.isPM!=null&&(n=e.isPM(a),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function sl(e){var t,a,n,d,D,L,ne=!1,pe=e._f.length;if(pe===0){_(e).invalidFormat=!0,e._d=new Date(NaN);return}for(d=0;d<pe;d++)D=0,L=!1,t=O({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[d],zr(t),C(t)&&(L=!0),D+=_(t).charsLeftOver,D+=_(t).unusedTokens.length*10,_(t).score=D,ne?D<n&&(n=D,a=t):(n==null||D<n||L)&&(n=D,a=t,L&&(ne=!0));p(e,a||t)}function ol(e){if(!e._d){var t=_e(e._i),a=t.day===void 0?t.date:t.day;e._a=f([t.year,t.month,a,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),Vr(e)}}function ll(e){var t=new v(Ir(zn(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function zn(e){var t=e._i,a=e._f;return e._locale=e._locale||yt(e._l),t===null||a===void 0&&t===""?j({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),T(t)?new v(Ir(t)):(h(t)?e._d=t:x(a)?sl(e):a?zr(e):ul(e),C(e)||(e._d=null),e))}function ul(e){var t=e._i;r(t)?e._d=new Date(i.now()):h(t)?e._d=new Date(t.valueOf()):typeof t=="string"?rl(e):x(t)?(e._a=f(t.slice(0),function(a){return parseInt(a,10)}),Vr(e)):I(t)?ol(e):c(t)?e._d=new Date(t):i.createFromInputFallback(e)}function Ln(e,t,a,n,d){var D={};return(t===!0||t===!1)&&(n=t,t=void 0),(a===!0||a===!1)&&(n=a,a=void 0),(I(e)&&y(e)||x(e)&&e.length===0)&&(e=void 0),D._isAMomentObject=!0,D._useUTC=D._isUTC=d,D._l=a,D._i=e,D._f=t,D._strict=n,ll(D)}function Ae(e,t,a,n){return Ln(e,t,a,n,!1)}var cl=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ae.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:j()}),dl=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ae.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:j()});function Wn(e,t){var a,n;if(t.length===1&&x(t[0])&&(t=t[0]),!t.length)return Ae();for(a=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][e](a))&&(a=t[n]);return a}function hl(){var e=[].slice.call(arguments,0);return Wn("isBefore",e)}function fl(){var e=[].slice.call(arguments,0);return Wn("isAfter",e)}var ml=function(){return Date.now?Date.now():+new Date},Zt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function pl(e){var t,a=!1,n,d=Zt.length;for(t in e)if(o(e,t)&&!(ze.call(Zt,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(n=0;n<d;++n)if(e[Zt[n]]){if(a)return!1;parseFloat(e[Zt[n]])!==be(e[Zt[n]])&&(a=!0)}return!0}function gl(){return this._isValid}function vl(){return ut(NaN)}function sr(e){var t=_e(e),a=t.year||0,n=t.quarter||0,d=t.month||0,D=t.week||t.isoWeek||0,L=t.day||0,ne=t.hour||0,pe=t.minute||0,De=t.second||0,Ke=t.millisecond||0;this._isValid=pl(t),this._milliseconds=+Ke+De*1e3+pe*6e4+ne*1e3*60*60,this._days=+L+D*7,this._months=+d+n*3+a*12,this._data={},this._locale=yt(),this._bubble()}function or(e){return e instanceof sr}function Lr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function yl(e,t,a){var n=Math.min(e.length,t.length),d=Math.abs(e.length-t.length),D=0,L;for(L=0;L<n;L++)be(e[L])!==be(t[L])&&D++;return D+d}function qn(e,t){Z(e,0,0,function(){var a=this.utcOffset(),n="+";return a<0&&(a=-a,n="-"),n+te(~~(a/60),2)+t+te(~~a%60,2)})}qn("Z",":"),qn("ZZ",""),ae("Z",We),ae("ZZ",We),Te(["Z","ZZ"],function(e,t,a){a._useUTC=!0,a._tzm=Wr(We,e)});var _l=/([\+\-]|\d\d)/gi;function Wr(e,t){var a=(t||"").match(e),n,d,D;return a===null?null:(n=a[a.length-1]||[],d=(n+"").match(_l)||["-",0,0],D=+(d[1]*60)+be(d[2]),D===0?0:d[0]==="+"?D:-D)}function qr(e,t){var a,n;return t._isUTC?(a=t.clone(),n=(T(e)||h(e)?e.valueOf():Ae(e).valueOf())-a.valueOf(),a._d.setTime(a._d.valueOf()+n),i.updateOffset(a,!1),a):Ae(e).local()}function Hr(e){return-Math.round(e._d.getTimezoneOffset())}i.updateOffset=function(){};function bl(e,t,a){var n=this._offset||0,d;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Wr(We,e),e===null)return this}else Math.abs(e)<16&&!a&&(e=e*60);return!this._isUTC&&t&&(d=Hr(this)),this._offset=e,this._isUTC=!0,d!=null&&this.add(d,"m"),n!==e&&(!t||this._changeInProgress?Un(this,ut(e-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Hr(this)}function wl(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Sl(e){return this.utcOffset(0,e)}function Ml(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Hr(this),"m")),this}function xl(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Wr(gt,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Dl(e){return this.isValid()?(e=e?Ae(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function kl(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ol(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e={},t;return O(e,this),e=zn(e),e._a?(t=e._isUTC?g(e._a):Ae(e._a),this._isDSTShifted=this.isValid()&&yl(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Yl(){return this.isValid()?!this._isUTC:!1}function Cl(){return this.isValid()?this._isUTC:!1}function Hn(){return this.isValid()?this._isUTC&&this._offset===0:!1}var jl=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Tl=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ut(e,t){var a=e,n=null,d,D,L;return or(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(a={},t?a[t]=+e:a.milliseconds=+e):(n=jl.exec(e))?(d=n[1]==="-"?-1:1,a={y:0,d:be(n[U])*d,h:be(n[Q])*d,m:be(n[le])*d,s:be(n[ye])*d,ms:be(Lr(n[xe]*1e3))*d}):(n=Tl.exec(e))?(d=n[1]==="-"?-1:1,a={y:Tt(n[2],d),M:Tt(n[3],d),w:Tt(n[4],d),d:Tt(n[5],d),h:Tt(n[6],d),m:Tt(n[7],d),s:Tt(n[8],d)}):a==null?a={}:typeof a=="object"&&("from"in a||"to"in a)&&(L=Pl(Ae(a.from),Ae(a.to)),a={},a.ms=L.milliseconds,a.M=L.months),D=new sr(a),or(e)&&o(e,"_locale")&&(D._locale=e._locale),or(e)&&o(e,"_isValid")&&(D._isValid=e._isValid),D}ut.fn=sr.prototype,ut.invalid=vl;function Tt(e,t){var a=e&&parseFloat(e.replace(",","."));return(isNaN(a)?0:a)*t}function $n(e,t){var a={};return a.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(a.months,"M").isAfter(t)&&--a.months,a.milliseconds=+t-+e.clone().add(a.months,"M"),a}function Pl(e,t){var a;return e.isValid()&&t.isValid()?(t=qr(t,e),e.isBefore(t)?a=$n(e,t):(a=$n(t,e),a.milliseconds=-a.milliseconds,a.months=-a.months),a):{milliseconds:0,months:0}}function Bn(e,t){return function(a,n){var d,D;return n!==null&&!isNaN(+n)&&(E(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."),D=a,a=n,n=D),d=ut(a,n),Un(this,d,e),this}}function Un(e,t,a,n){var d=t._milliseconds,D=Lr(t._days),L=Lr(t._months);e.isValid()&&(n=n??!0,L&&Cn(e,nt(e,"Month")+L*a),D&&ft(e,"Date",nt(e,"Date")+D*a),d&&e._d.setTime(e._d.valueOf()+d*a),n&&i.updateOffset(e,D||L))}var Nl=Bn(1,"add"),Rl=Bn(-1,"subtract");function Gn(e){return typeof e=="string"||e instanceof String}function El(e){return T(e)||h(e)||Gn(e)||c(e)||Il(e)||Al(e)||e===null||e===void 0}function Al(e){var t=I(e)&&!y(e),a=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],d,D,L=n.length;for(d=0;d<L;d+=1)D=n[d],a=a||o(e,D);return t&&a}function Il(e){var t=x(e),a=!1;return t&&(a=e.filter(function(n){return!c(n)&&Gn(e)}).length===0),t&&a}function Fl(e){var t=I(e)&&!y(e),a=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],d,D;for(d=0;d<n.length;d+=1)D=n[d],a=a||o(e,D);return t&&a}function Vl(e,t){var a=e.diff(t,"days",!0);return a<-6?"sameElse":a<-1?"lastWeek":a<0?"lastDay":a<1?"sameDay":a<2?"nextDay":a<7?"nextWeek":"sameElse"}function zl(e,t){arguments.length===1&&(arguments[0]?El(arguments[0])?(e=arguments[0],t=void 0):Fl(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var a=e||Ae(),n=qr(a,this).startOf("day"),d=i.calendarFormat(this,n)||"sameElse",D=t&&(A(t[d])?t[d].call(this,a):t[d]);return this.format(D||this.localeData().calendar(d,this,Ae(a)))}function Ll(){return new v(this)}function Wl(e,t){var a=T(e)?e:Ae(e);return this.isValid()&&a.isValid()?(t=ge(t)||"millisecond",t==="millisecond"?this.valueOf()>a.valueOf():a.valueOf()<this.clone().startOf(t).valueOf()):!1}function ql(e,t){var a=T(e)?e:Ae(e);return this.isValid()&&a.isValid()?(t=ge(t)||"millisecond",t==="millisecond"?this.valueOf()<a.valueOf():this.clone().endOf(t).valueOf()<a.valueOf()):!1}function Hl(e,t,a,n){var d=T(e)?e:Ae(e),D=T(t)?t:Ae(t);return this.isValid()&&d.isValid()&&D.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(d,a):!this.isBefore(d,a))&&(n[1]===")"?this.isBefore(D,a):!this.isAfter(D,a))):!1}function $l(e,t){var a=T(e)?e:Ae(e),n;return this.isValid()&&a.isValid()?(t=ge(t)||"millisecond",t==="millisecond"?this.valueOf()===a.valueOf():(n=a.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf())):!1}function Bl(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Ul(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Gl(e,t,a){var n,d,D;if(!this.isValid())return NaN;if(n=qr(e,this),!n.isValid())return NaN;switch(d=(n.utcOffset()-this.utcOffset())*6e4,t=ge(t),t){case"year":D=lr(this,n)/12;break;case"month":D=lr(this,n);break;case"quarter":D=lr(this,n)/3;break;case"second":D=(this-n)/1e3;break;case"minute":D=(this-n)/6e4;break;case"hour":D=(this-n)/36e5;break;case"day":D=(this-n-d)/864e5;break;case"week":D=(this-n-d)/6048e5;break;default:D=this-n}return a?D:et(D)}function lr(e,t){if(e.date()<t.date())return-lr(t,e);var a=(t.year()-e.year())*12+(t.month()-e.month()),n=e.clone().add(a,"months"),d,D;return t-n<0?(d=e.clone().add(a-1,"months"),D=(t-n)/(n-d)):(d=e.clone().add(a+1,"months"),D=(t-n)/(d-n)),-(a+D)||0}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Jl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Kl(e){if(!this.isValid())return null;var t=e!==!0,a=t?this.clone().utc():this;return a.year()<0||a.year()>9999?Ce(a,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ce(a,"Z")):Ce(a,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Xl(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",a,n,d,D;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),a="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",d="-MM-DD[T]HH:mm:ss.SSS",D=t+'[")]',this.format(a+n+d+D)}function Zl(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=Ce(this,e);return this.localeData().postformat(t)}function Ql(e,t){return this.isValid()&&(T(e)&&e.isValid()||Ae(e).isValid())?ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function eu(e){return this.from(Ae(),e)}function tu(e,t){return this.isValid()&&(T(e)&&e.isValid()||Ae(e).isValid())?ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ru(e){return this.to(Ae(),e)}function Jn(e){var t;return e===void 0?this._locale._abbr:(t=yt(e),t!=null&&(this._locale=t),this)}var Kn=M("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 Xn(){return this._locale}var ur=1e3,Lt=60*ur,cr=60*Lt,Zn=(365*400+97)*24*cr;function Wt(e,t){return(e%t+t)%t}function Qn(e,t,a){return e<100&&e>=0?new Date(e+400,t,a)-Zn:new Date(e,t,a).valueOf()}function ei(e,t,a){return e<100&&e>=0?Date.UTC(e+400,t,a)-Zn:Date.UTC(e,t,a)}function au(e){var t,a;if(e=ge(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?ei:Qn,e){case"year":t=a(this.year(),0,1);break;case"quarter":t=a(this.year(),this.month()-this.month()%3,1);break;case"month":t=a(this.year(),this.month(),1);break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=a(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Wt(t+(this._isUTC?0:this.utcOffset()*Lt),cr);break;case"minute":t=this._d.valueOf(),t-=Wt(t,Lt);break;case"second":t=this._d.valueOf(),t-=Wt(t,ur);break}return this._d.setTime(t),i.updateOffset(this,!0),this}function nu(e){var t,a;if(e=ge(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(a=this._isUTC?ei:Qn,e){case"year":t=a(this.year()+1,0,1)-1;break;case"quarter":t=a(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=a(this.year(),this.month()+1,1)-1;break;case"week":t=a(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=a(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=a(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=cr-Wt(t+(this._isUTC?0:this.utcOffset()*Lt),cr)-1;break;case"minute":t=this._d.valueOf(),t+=Lt-Wt(t,Lt)-1;break;case"second":t=this._d.valueOf(),t+=ur-Wt(t,ur)-1;break}return this._d.setTime(t),i.updateOffset(this,!0),this}function iu(){return this._d.valueOf()-(this._offset||0)*6e4}function su(){return Math.floor(this.valueOf()/1e3)}function ou(){return new Date(this.valueOf())}function lu(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function uu(){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 cu(){return this.isValid()?this.toISOString():null}function du(){return C(this)}function hu(){return p({},_(this))}function fu(){return _(this).overflow}function mu(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Z("N",0,0,"eraAbbr"),Z("NN",0,0,"eraAbbr"),Z("NNN",0,0,"eraAbbr"),Z("NNNN",0,0,"eraName"),Z("NNNNN",0,0,"eraNarrow"),Z("y",["y",1],"yo","eraYear"),Z("y",["yy",2],0,"eraYear"),Z("y",["yyy",3],0,"eraYear"),Z("y",["yyyy",4],0,"eraYear"),ae("N",$r),ae("NN",$r),ae("NNN",$r),ae("NNNN",Du),ae("NNNNN",ku),Te(["N","NN","NNN","NNNN","NNNNN"],function(e,t,a,n){var d=a._locale.erasParse(e,n,a._strict);d?_(a).era=d:_(a).invalidEra=e}),ae("y",tt),ae("yy",tt),ae("yyy",tt),ae("yyyy",tt),ae("yo",Ou),Te(["y","yy","yyy","yyyy"],Ge),Te(["yo"],function(e,t,a,n){var d;a._locale._eraYearOrdinalRegex&&(d=e.match(a._locale._eraYearOrdinalRegex)),a._locale.eraYearOrdinalParse?t[Ge]=a._locale.eraYearOrdinalParse(e,d):t[Ge]=parseInt(e,10)});function pu(e,t){var a,n,d,D=this._eras||yt("en")._eras;for(a=0,n=D.length;a<n;++a)switch(typeof D[a].since==="string"&&(d=i(D[a].since).startOf("day"),D[a].since=d.valueOf()),typeof D[a].until){case"undefined":D[a].until=1/0;break;case"string":d=i(D[a].until).startOf("day").valueOf(),D[a].until=d.valueOf();break}return D}function gu(e,t,a){var n,d,D=this.eras(),L,ne,pe;for(e=e.toUpperCase(),n=0,d=D.length;n<d;++n)if(L=D[n].name.toUpperCase(),ne=D[n].abbr.toUpperCase(),pe=D[n].narrow.toUpperCase(),a)switch(t){case"N":case"NN":case"NNN":if(ne===e)return D[n];break;case"NNNN":if(L===e)return D[n];break;case"NNNNN":if(pe===e)return D[n];break}else if([L,ne,pe].indexOf(e)>=0)return D[n]}function vu(e,t){var a=e.since<=e.until?1:-1;return t===void 0?i(e.since).year():i(e.since).year()+(t-e.offset)*a}function yu(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until||n[e].until<=a&&a<=n[e].since)return n[e].name;return""}function _u(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until||n[e].until<=a&&a<=n[e].since)return n[e].narrow;return""}function bu(){var e,t,a,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(a=this.clone().startOf("day").valueOf(),n[e].since<=a&&a<=n[e].until||n[e].until<=a&&a<=n[e].since)return n[e].abbr;return""}function wu(){var e,t,a,n,d=this.localeData().eras();for(e=0,t=d.length;e<t;++e)if(a=d[e].since<=d[e].until?1:-1,n=this.clone().startOf("day").valueOf(),d[e].since<=n&&n<=d[e].until||d[e].until<=n&&n<=d[e].since)return(this.year()-i(d[e].since).year())*a+d[e].offset;return this.year()}function Su(e){return o(this,"_erasNameRegex")||Br.call(this),e?this._erasNameRegex:this._erasRegex}function Mu(e){return o(this,"_erasAbbrRegex")||Br.call(this),e?this._erasAbbrRegex:this._erasRegex}function xu(e){return o(this,"_erasNarrowRegex")||Br.call(this),e?this._erasNarrowRegex:this._erasRegex}function $r(e,t){return t.erasAbbrRegex(e)}function Du(e,t){return t.erasNameRegex(e)}function ku(e,t){return t.erasNarrowRegex(e)}function Ou(e,t){return t._eraYearOrdinalRegex||tt}function Br(){var e=[],t=[],a=[],n=[],d,D,L,ne,pe,De=this.eras();for(d=0,D=De.length;d<D;++d)L=at(De[d].name),ne=at(De[d].abbr),pe=at(De[d].narrow),t.push(L),e.push(ne),a.push(pe),n.push(L),n.push(ne),n.push(pe);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}Z(0,["gg",2],0,function(){return this.weekYear()%100}),Z(0,["GG",2],0,function(){return this.isoWeekYear()%100});function dr(e,t){Z(0,[e,e.length],0,t)}dr("gggg","weekYear"),dr("ggggg","weekYear"),dr("GGGG","isoWeekYear"),dr("GGGGG","isoWeekYear"),ae("G",pt),ae("g",pt),ae("GG",je,Ue),ae("gg",je,Ue),ae("GGGG",mt,Yt),ae("gggg",mt,Yt),ae("GGGGG",dt,st),ae("ggggg",dt,st),jt(["gggg","ggggg","GGGG","GGGGG"],function(e,t,a,n){t[n.substr(0,2)]=be(e)}),jt(["gg","GG"],function(e,t,a,n){t[n]=i.parseTwoDigitYear(e)});function Yu(e){return ti.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Cu(e){return ti.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function ju(){return vt(this.year(),1,4)}function Tu(){return vt(this.isoWeekYear(),1,4)}function Pu(){var e=this.localeData()._week;return vt(this.year(),e.dow,e.doy)}function Nu(){var e=this.localeData()._week;return vt(this.weekYear(),e.dow,e.doy)}function ti(e,t,a,n,d){var D;return e==null?Jt(this,n,d).year:(D=vt(e,n,d),t>D&&(t=D),Ru.call(this,e,t,a,n,d))}function Ru(e,t,a,n,d){var D=Pn(e,t,a,n,d),L=Gt(D.year,0,D.dayOfYear);return this.year(L.getUTCFullYear()),this.month(L.getUTCMonth()),this.date(L.getUTCDate()),this}Z("Q",0,"Qo","quarter"),ae("Q",ct),Te("Q",function(e,t){t[b]=(be(e)-1)*3});function Eu(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Z("D",["DD",2],"Do","date"),ae("D",je,rt),ae("DD",je,Ue),ae("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Te(["D","DD"],U),Te("Do",function(e,t){t[U]=be(e.match(je)[0])});var ri=Be("Date",!0);Z("DDD",["DDDD",3],"DDDo","dayOfYear"),ae("DDD",ot),ae("DDDD",it),Te(["DDD","DDDD"],function(e,t,a){a._dayOfYear=be(e)});function Au(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Z("m",["mm",2],0,"minute"),ae("m",je,Qe),ae("mm",je,Ue),Te(["m","mm"],le);var Iu=Be("Minutes",!1);Z("s",["ss",2],0,"second"),ae("s",je,Qe),ae("ss",je,Ue),Te(["s","ss"],ye);var Fu=Be("Seconds",!1);Z("S",0,0,function(){return~~(this.millisecond()/100)}),Z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Z(0,["SSS",3],0,"millisecond"),Z(0,["SSSS",4],0,function(){return this.millisecond()*10}),Z(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Z(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Z(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Z(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Z(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),ae("S",ot,ct),ae("SS",ot,Ue),ae("SSS",ot,it);var Dt,ai;for(Dt="SSSS";Dt.length<=9;Dt+="S")ae(Dt,tt);function Vu(e,t){t[xe]=be(("0."+e)*1e3)}for(Dt="S";Dt.length<=9;Dt+="S")Te(Dt,Vu);ai=Be("Milliseconds",!1),Z("z",0,0,"zoneAbbr"),Z("zz",0,0,"zoneName");function zu(){return this._isUTC?"UTC":""}function Lu(){return this._isUTC?"Coordinated Universal Time":""}var K=v.prototype;K.add=Nl,K.calendar=zl,K.clone=Ll,K.diff=Gl,K.endOf=nu,K.format=Zl,K.from=Ql,K.fromNow=eu,K.to=tu,K.toNow=ru,K.get=Je,K.invalidAt=fu,K.isAfter=Wl,K.isBefore=ql,K.isBetween=Hl,K.isSame=$l,K.isSameOrAfter=Bl,K.isSameOrBefore=Ul,K.isValid=du,K.lang=Kn,K.locale=Jn,K.localeData=Xn,K.max=dl,K.min=cl,K.parsingFlags=hu,K.set=Ut,K.startOf=au,K.subtract=Rl,K.toArray=lu,K.toObject=uu,K.toDate=ou,K.toISOString=Kl,K.inspect=Xl,typeof Symbol<"u"&&Symbol.for!=null&&(K[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),K.toJSON=cu,K.toString=Jl,K.unix=su,K.valueOf=iu,K.creationData=mu,K.eraName=yu,K.eraNarrow=_u,K.eraAbbr=bu,K.eraYear=wu,K.year=Fe,K.isLeapYear=Le,K.weekYear=Yu,K.isoWeekYear=Cu,K.quarter=K.quarters=Eu,K.month=jn,K.daysInMonth=so,K.week=K.weeks=po,K.isoWeek=K.isoWeeks=go,K.weeksInYear=Pu,K.weeksInWeekYear=Nu,K.isoWeeksInYear=ju,K.isoWeeksInISOWeekYear=Tu,K.date=ri,K.day=K.days=Co,K.weekday=jo,K.isoWeekday=To,K.dayOfYear=Au,K.hour=K.hours=Fo,K.minute=K.minutes=Iu,K.second=K.seconds=Fu,K.millisecond=K.milliseconds=ai,K.utcOffset=bl,K.utc=Sl,K.local=Ml,K.parseZone=xl,K.hasAlignedHourOffset=Dl,K.isDST=kl,K.isLocal=Yl,K.isUtcOffset=Cl,K.isUtc=Hn,K.isUTC=Hn,K.zoneAbbr=zu,K.zoneName=Lu,K.dates=M("dates accessor is deprecated. Use date instead.",ri),K.months=M("months accessor is deprecated. Use month instead",jn),K.years=M("years accessor is deprecated. Use year instead",Fe),K.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",wl),K.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ol);function Wu(e){return Ae(e*1e3)}function qu(){return Ae.apply(null,arguments).parseZone()}function ni(e){return e}var Ye=ee.prototype;Ye.calendar=fe,Ye.longDateFormat=J,Ye.invalidDate=P,Ye.ordinal=W,Ye.preparse=ni,Ye.postformat=ni,Ye.relativeTime=ce,Ye.pastFuture=se,Ye.set=z,Ye.eras=pu,Ye.erasParse=gu,Ye.erasConvertYear=vu,Ye.erasAbbrRegex=Mu,Ye.erasNameRegex=Su,Ye.erasNarrowRegex=xu,Ye.months=ro,Ye.monthsShort=ao,Ye.monthsParse=io,Ye.monthsRegex=lo,Ye.monthsShortRegex=oo,Ye.week=co,Ye.firstDayOfYear=mo,Ye.firstDayOfWeek=fo,Ye.weekdays=xo,Ye.weekdaysMin=ko,Ye.weekdaysShort=Do,Ye.weekdaysParse=Yo,Ye.weekdaysRegex=Po,Ye.weekdaysShortRegex=No,Ye.weekdaysMinRegex=Ro,Ye.isPM=Ao,Ye.meridiem=Vo;function hr(e,t,a,n){var d=yt(),D=g().set(n,t);return d[a](D,e)}function ii(e,t,a){if(c(e)&&(t=e,e=void 0),e=e||"",t!=null)return hr(e,t,a,"month");var n,d=[];for(n=0;n<12;n++)d[n]=hr(e,n,a,"month");return d}function Ur(e,t,a,n){typeof e=="boolean"?(c(t)&&(a=t,t=void 0),t=t||""):(t=e,a=t,e=!1,c(t)&&(a=t,t=void 0),t=t||"");var d=yt(),D=e?d._week.dow:0,L,ne=[];if(a!=null)return hr(t,(a+D)%7,n,"day");for(L=0;L<7;L++)ne[L]=hr(t,(L+D)%7,n,"day");return ne}function Hu(e,t){return ii(e,t,"months")}function $u(e,t){return ii(e,t,"monthsShort")}function Bu(e,t,a){return Ur(e,t,a,"weekdays")}function Uu(e,t,a){return Ur(e,t,a,"weekdaysShort")}function Gu(e,t,a){return Ur(e,t,a,"weekdaysMin")}xt("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,a=be(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+a}}),i.lang=M("moment.lang is deprecated. Use moment.locale instead.",xt),i.langData=M("moment.langData is deprecated. Use moment.localeData instead.",yt);var _t=Math.abs;function Ju(){var e=this._data;return this._milliseconds=_t(this._milliseconds),this._days=_t(this._days),this._months=_t(this._months),e.milliseconds=_t(e.milliseconds),e.seconds=_t(e.seconds),e.minutes=_t(e.minutes),e.hours=_t(e.hours),e.months=_t(e.months),e.years=_t(e.years),this}function si(e,t,a,n){var d=ut(t,a);return e._milliseconds+=n*d._milliseconds,e._days+=n*d._days,e._months+=n*d._months,e._bubble()}function Ku(e,t){return si(this,e,t,1)}function Xu(e,t){return si(this,e,t,-1)}function oi(e){return e<0?Math.floor(e):Math.ceil(e)}function Zu(){var e=this._milliseconds,t=this._days,a=this._months,n=this._data,d,D,L,ne,pe;return e>=0&&t>=0&&a>=0||e<=0&&t<=0&&a<=0||(e+=oi(Gr(a)+t)*864e5,t=0,a=0),n.milliseconds=e%1e3,d=et(e/1e3),n.seconds=d%60,D=et(d/60),n.minutes=D%60,L=et(D/60),n.hours=L%24,t+=et(L/24),pe=et(li(t)),a+=pe,t-=oi(Gr(pe)),ne=et(a/12),a%=12,n.days=t,n.months=a,n.years=ne,this}function li(e){return e*4800/146097}function Gr(e){return e*146097/4800}function Qu(e){if(!this.isValid())return NaN;var t,a,n=this._milliseconds;if(e=ge(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,a=this._months+li(t),e){case"month":return a;case"quarter":return a/3;case"year":return a/12}else switch(t=this._days+Math.round(Gr(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function bt(e){return function(){return this.as(e)}}var ui=bt("ms"),ec=bt("s"),tc=bt("m"),rc=bt("h"),ac=bt("d"),nc=bt("w"),ic=bt("M"),sc=bt("Q"),oc=bt("y"),lc=ui;function uc(){return ut(this)}function cc(e){return e=ge(e),this.isValid()?this[e+"s"]():NaN}function Pt(e){return function(){return this.isValid()?this._data[e]:NaN}}var dc=Pt("milliseconds"),hc=Pt("seconds"),fc=Pt("minutes"),mc=Pt("hours"),pc=Pt("days"),gc=Pt("months"),vc=Pt("years");function yc(){return et(this.days()/7)}var wt=Math.round,qt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function _c(e,t,a,n,d){return d.relativeTime(t||1,!!a,e,n)}function bc(e,t,a,n){var d=ut(e).abs(),D=wt(d.as("s")),L=wt(d.as("m")),ne=wt(d.as("h")),pe=wt(d.as("d")),De=wt(d.as("M")),Ke=wt(d.as("w")),St=wt(d.as("y")),kt=D<=a.ss&&["s",D]||D<a.s&&["ss",D]||L<=1&&["m"]||L<a.m&&["mm",L]||ne<=1&&["h"]||ne<a.h&&["hh",ne]||pe<=1&&["d"]||pe<a.d&&["dd",pe];return a.w!=null&&(kt=kt||Ke<=1&&["w"]||Ke<a.w&&["ww",Ke]),kt=kt||De<=1&&["M"]||De<a.M&&["MM",De]||St<=1&&["y"]||["yy",St],kt[2]=t,kt[3]=+e>0,kt[4]=n,_c.apply(null,kt)}function wc(e){return e===void 0?wt:typeof e=="function"?(wt=e,!0):!1}function Sc(e,t){return qt[e]===void 0?!1:t===void 0?qt[e]:(qt[e]=t,e==="s"&&(qt.ss=t-1),!0)}function Mc(e,t){if(!this.isValid())return this.localeData().invalidDate();var a=!1,n=qt,d,D;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(a=e),typeof t=="object"&&(n=Object.assign({},qt,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),d=this.localeData(),D=bc(this,!a,n,d),a&&(D=d.pastFuture(+this,D)),d.postformat(D)}var Jr=Math.abs;function Ht(e){return(e>0)-(e<0)||+e}function fr(){if(!this.isValid())return this.localeData().invalidDate();var e=Jr(this._milliseconds)/1e3,t=Jr(this._days),a=Jr(this._months),n,d,D,L,ne=this.asSeconds(),pe,De,Ke,St;return ne?(n=et(e/60),d=et(n/60),e%=60,n%=60,D=et(a/12),a%=12,L=e?e.toFixed(3).replace(/\.?0+$/,""):"",pe=ne<0?"-":"",De=Ht(this._months)!==Ht(ne)?"-":"",Ke=Ht(this._days)!==Ht(ne)?"-":"",St=Ht(this._milliseconds)!==Ht(ne)?"-":"",pe+"P"+(D?De+D+"Y":"")+(a?De+a+"M":"")+(t?Ke+t+"D":"")+(d||n||e?"T":"")+(d?St+d+"H":"")+(n?St+n+"M":"")+(e?St+L+"S":"")):"P0D"}var ke=sr.prototype;ke.isValid=gl,ke.abs=Ju,ke.add=Ku,ke.subtract=Xu,ke.as=Qu,ke.asMilliseconds=ui,ke.asSeconds=ec,ke.asMinutes=tc,ke.asHours=rc,ke.asDays=ac,ke.asWeeks=nc,ke.asMonths=ic,ke.asQuarters=sc,ke.asYears=oc,ke.valueOf=lc,ke._bubble=Zu,ke.clone=uc,ke.get=cc,ke.milliseconds=dc,ke.seconds=hc,ke.minutes=fc,ke.hours=mc,ke.days=pc,ke.weeks=yc,ke.months=gc,ke.years=vc,ke.humanize=Mc,ke.toISOString=fr,ke.toString=fr,ke.toJSON=fr,ke.locale=Jn,ke.localeData=Xn,ke.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",fr),ke.lang=Kn,Z("X",0,0,"unix"),Z("x",0,0,"valueOf"),ae("x",pt),ae("X",ht),Te("X",function(e,t,a){a._d=new Date(parseFloat(e)*1e3)}),Te("x",function(e,t,a){a._d=new Date(be(e))});return i.version="2.30.1",S(Ae),i.fn=K,i.min=hl,i.max=fl,i.now=ml,i.utc=g,i.unix=Wu,i.months=Hu,i.isDate=h,i.locale=xt,i.invalid=j,i.duration=ut,i.isMoment=T,i.weekdays=Bu,i.parseZone=qu,i.localeData=yt,i.isDuration=or,i.monthsShort=$u,i.weekdaysMin=Gu,i.defineLocale=Ar,i.updateLocale=qo,i.locales=Ho,i.weekdaysShort=Uu,i.normalizeUnits=ge,i.relativeTimeRounding=wc,i.relativeTimeThreshold=Sc,i.calendarFormat=Vl,i.prototype=K,i.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"},i}))})(gr)),gr.exports}var bh=cn.exports,Si;function wh(){return Si||(Si=1,(function(l,s){(function(u,i){i(typeof br=="function"?yn():u.moment)})(bh,(function(u){var i=u.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(){return this.day()===0?"[La scorsa] dddd [a"+(this.hours()>1?"lle ":this.hours()===0?" ":"ll'")+"]LT":"[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}});return i}))})()),cn.exports}wh();var dn={exports:{}},Sh=dn.exports,Mi;function Mh(){return Mi||(Mi=1,(function(l,s){(function(u,i){i(typeof br=="function"?yn():u.moment)})(Sh,(function(u){var i=u.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(S){var x=S%10,I=~~(S%100/10)===1?"th":x===1?"st":x===2?"nd":x===3?"rd":"th";return S+I},week:{dow:1,doy:4}});return i}))})()),dn.exports}Mh();var hn={exports:{}},xh=hn.exports,xi;function Dh(){return xi||(xi=1,(function(l,s){(function(u,i){i(typeof br=="function"?yn():u.moment)})(xh,(function(u){function i(x,I,o,y){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[x+" Tage",x+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[x+" Monate",x+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[x+" Jahre",x+" Jahren"]};return I?r[o][0]:r[o][1]}var S=u.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:i,mm:"%d Minuten",h:i,hh:"%d Stunden",d:i,dd:i,w:i,ww:"%d Wochen",M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return S}))})()),hn.exports}Dh();const Ot=l=>{let s="";return l.split(":").forEach(u=>{s+=u}),parseInt(s)},Di=l=>l.toString().padStart(4,"0").match(/.{1,2}/g).join(":"),Kr=l=>{const s=l.address;if(l.addresstype==="county"&&s.country)return s.county;if(l.addresstype==="village"&&s.village)return s.village;const u=[];["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(x=>{s.hasOwnProperty(x)&&s[x]&&u.push(s[x])}),s.road?u.push(s.road):s.pedestrian?u.push(s.pedestrian):s.suburb?u.push(s.suburb):s.square?u.push(s.square):(s.neighbourhood&&u.push(s.neighbourhood),s.hamlet?u.push(s.hamlet):s.isolated_dwelling?u.push(s.isolated_dwelling):s.locality?u.push(s.locality):s.croft&&u.push(s.croft)),s.house_number&&u.push(s.house_number),s.postcode&&u.push(s.postcode),s.village&&u.push(s.village),s.town?u.push(s.town):s.city&&u.push(s.city);var S=u.join(", ").substr(0,150);return S};function tr(l){let s=window.sessionStorage.getItem(l);if(s!==null){let u=JSON.parse(s);if(new Date(u.expirationDate)>new Date)return u.value;window.sessionStorage.removeItem(l)}return null}function kh(l,s,u){let i=u?new Date(u*1e3):null;if(i){let S={value:s,expirationDate:i.toISOString()};window.sessionStorage.setItem(l,JSON.stringify(S))}}function ki({day:l,slot:s,i18next:u}){return m.jsx("li",{className:"it-list-item",children:m.jsx("div",{className:"list-item",children:m.jsx("div",{className:"it-right-zone",children:m.jsxs("span",{className:"text pl-4",children:[m.jsx("b",{children:l})," ",u.t("alle")," ",u.t("ore")," ",m.jsx("b",{children:s})]})})})})}const Oi=Rt.Formio.Components.components.field,Oh=({component:l,current:s,onChange:u,i18next:i})=>{const[S,x]=G.useState(),[I,o]=G.useState([]),[y,r]=G.useState([]),[c,h]=G.useState(!1),[f,p]=G.useState(null),[g,Y]=G.useState(null),[_,k]=G.useState(null),[C,j]=G.useState(null),[F,R]=G.useState({}),[O,v]=G.useState(null),[T,w]=G.useState(!1),[M,V]=G.useState([]),[E,A]=G.useState(!1),z=G.useRef(),B=l.calendarId;he.locale(i.language),Se.locale(i.language);const ee=N=>{let W=he(N).format("YYYY-MM-DD");fetch(te(W)).then(q=>q.json()).then(q=>{let ce=fe(N||new Date);const se=q.filter(Re=>Re.available==!0);se.length===0&&X();let ge=[];ce.forEach(Re=>{q.some(ct=>ct.date===Re&&ct.available==!0)?ge.push({available:!0,date:Re}):ge.push({available:!1,date:Re})});const _e=ge.map(Re=>{if(Re.available===!1)return he(Re.date,"YYYY-MM-DD").toDate()});o(_e);const $e=se.length?se[0].date:N;ie($e)}).catch(q=>console.error(q))},ie=N=>{j(null),k(null),r([]);let W=he(N).format("YYYY-MM-DD");fetch(de(W)).then(q=>q.json()).then(q=>{const ce=q.filter(se=>se.availability==!0);R(ce[0]),ce.length>0?(r(q),h(!1),k(he(N).format("L")),x(he(N,"YYYY-MM-DD").toDate())):(q.length>0&&x(he(q[0].date,"YYYY-MM-DD").toDate()),r([]),X())})},re=()=>{if(B!==""&&B!=null)if(!s.dataValue)ee(new Date);else if(l.multiple&&Array.isArray(s.dataValue)){if(s.dataValue.length>0){v(s.dataValue);let N=[];s.dataValue.map(W=>{N.push({...W,date:he(W.date,"YYYY-MM-DD").format("DD-MM-YYYY")})}),V(N)}}else if(!l.multiple&&typeof s.dataValue=="object"){const N={date:s.dataValue.date,slot:s.dataValue.slot},W={...s.dataValue,date:he(s.dataValue.date,"YYYY-MM-DD").format("DD-MM-YYYY")};V([W]),v(N)}else{let N=s.dataValue.replace(")","").replace(" ("," @ ").replace(/\//g,"-").split(" @ "),W=N[2].split("#");const q={date:he(N[0],"DD-MM-YYYY").format("YYYY-MM-DD"),slot:N[1]};l.multiple?(u([{date:N[0],slot:N[1],calendar_id:W[0],meeting_id:W[1],opening_hour_id:W.length===3?W[2]:""}]),V([{date:N[0],slot:N[1],calendar_id:W[0],meeting_id:W[1],opening_hour_id:W.length===3?W[2]:""}])):(u({date:N[0],slot:N[1],calendar_id:W[0],meeting_id:W[1],opening_hour_id:W.length===3?W[2]:""}),V([{date:N[0],slot:N[1],calendar_id:W[0],meeting_id:W[1],opening_hour_id:W.length===3?W[2]:""}])),v(q)}};G.useEffect(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{re()},1e3)})},[]);const fe=N=>{let q=he(N,"YYYY-MM").daysInMonth(),ce=[];for(;q;){let se=he(N).date(q);ce.push(se.format("YYYY-MM-DD")),q--}return ce},te=(N,W=!1)=>{let q=l.calendarId,ce=l.select_opening_hours,se=l.select_opening_hours?l.opening_hours:[];window.location.pathname.split("/");let ge=`${Ee()}/api/calendars/${q}/availabilities`,_e=[`from_time=${he(N).startOf("month").format("YYYY-MM-DD")}`,`to_time=${he(N).endOf("month").format("YYYY-MM-DD")}`];return W&&_e.push(`available=${W}`),ce&&se&&_e.push(`opening_hours=${se.join()}`),`${ge}?${_e.join("&")}`},de=(N,W=!1)=>{let q=l.calendarId,ce=l.select_opening_hours,se=l.select_opening_hours?l.opening_hours:[];window.location.pathname.split("/");const ge=he(N).format("YYYY-MM-DD");let _e=`${Ee()}/api/calendars/${q}/availabilities/${ge}`,$e=[];return W&&$e.push(`available=${W}`),ce&&se&&$e.push(`opening_hours=${se.join()}`),$e&&(_e=`${_e}?${$e.join("&")}`),_e},ve=N=>{ee(N)},me=N=>{setTimeout(()=>{w(!T)},1e3),ie(N)},oe=N=>{j(null),setTimeout(()=>{N&&(Y(N.target.dataset),j(N.target.id))},300)},Z=N=>{p(null);let W=`${Ee()}/it/meetings/new-draft`,q={date:g?.date?he(g?.date).format("DD-MM-YYYY"):he(N.target.dataset.date).format("DD-MM-YYYY"),slot:g?.value_start&&g?.value_end?g.value_start+"-"+g.value_end:N.target.dataset.slots,calendar:l.calendarId,opening_hour:g?.opening_hour?g?.opening_hour:N.target.dataset.opening_hour,meeting:f?f.id:"",first_available_date:F.date,first_available_start_time:F.start_time,first_available_end_time:F.end_time,first_availability_updated_at:he().format()};fetch(W,{method:"POST",body:JSON.stringify(q),headers:{"Content-Type":"application/json; charset=utf-8"},strictErrors:!0}).then(ce=>{if(!ce.ok)throw new Error(i.t("Intervallo selezionato non disponibile!"));return ce.json()}).then(ce=>{p(ce);const se={date:q.date,slot:q.slot,calendar_id:q.calendar[0],opening_hour_id:q.opening_hour||q.opening_hour_id,meeting_id:ce.id};V([...M,se])}).catch(ce=>{console.log(ce),He.fire({title:"",html:"<p>"+ce+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1})})},Ne=()=>{g&&(Z(),w(!T))},Ie=()=>m.jsx("span",{children:i.t("Tempo prenotazione scaduto!")}),Ce=({minutes:N,seconds:W,completed:q})=>q?m.jsx(Ie,{}):m.jsx("div",{children:m.jsxs("div",{children:[" ",m.jsxs("span",{children:[" ",m.jsxs("i",{children:[i.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"),":"]})," ",m.jsxs("b",{children:[N," ",i.t("minuti")," ",W," ",i.t("secondi")]})]})]})}),Oe=N=>{const W=Ot(N.target.value),q=Ot(N.target.min),ce=Ot(N.target.max);W<q||W>ce||W>Ot(g.end)?(He.fire({title:"",html:`<p>${i.t("l'orario")} <b>${Di(W)}</b> ${i.t("non è valido")}</p>`,icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1}),J("")):Y({...g,value_start:N.target.value})},$=N=>{const W=Ot(N.target.value),q=Ot(N.target.min),ce=Ot(N.target.max);W<q||W>ce||W<Ot(g.start)?(He.fire({title:"",html:`<p>${i.t("l'orario")} <b>${Di(W)}</b> ${i.t("non è valido")}</p>`,icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1}),J("")):Y({...g,value_end:N.target.value})},J=N=>{if(N===null||N==="")u("");else if(Array.isArray(N)&&N.length>0){let W=[];M.map(q=>{W.push({date:he(q.date,"DD-MM-YYYY").format("YYYY-MM-DD"),slot:q.slot,calendar_id:q.calendar_id||q.calendar[0],meeting_id:q.meeting_id,opening_hour_id:q.opening_hour||q.opening_hour_id})}),l.multiple?u(W):u(W[0])}else u("")},X=()=>{h(!0),p(null),k(null),J(null)},P=()=>{if(i.language==="it")return Hs;if(i.language==="en")return qs;if(i.language==="de")return Ws};G.useEffect(()=>{J(M)},[M]),G.useEffect(()=>{document.querySelector(".formio-read-only")&&E===!1?(A(!0),setTimeout(()=>{re()},1e3)):(A(!1),setTimeout(()=>{re()},1e3))},[]);const H=(N,W)=>{let q=`${Ee()}/api/meetings/${W.meeting_id}`;fetch(q,{method:"DELETE",headers:{"Content-Type":"application/json; charset=utf-8",Authorization:`Bearer ${tr("auth-token")}`},strictErrors:!0}).then(ce=>{if(ce&&ce.status>400)He.fire({title:"",html:`<p>${i.t("Ci sono stati degli errori durante la cancellazione dello slot")}</p>`,icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1});else{const se=[...M.slice(0,N),...M.slice(N+1)];V(se),ee(new Date)}})};return m.jsxs(m.Fragment,{children:[E&&O?m.jsxs("div",{className:"my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none",children:[m.jsxs("b",{children:[Array.isArray(O)&&O.length>1?i.t("Giorni selezionati per la prenotazione"):i.t("Giorno selezionato per la prenotazione"),":"]}),m.jsx("div",{className:"mb-5",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:Array.isArray(O)?O.map(N=>m.jsx(ki,{day:he(N.date,"DD-MM-YYYY").format("DD/MM/YYYY"),i18next:i,slot:N.slot})):m.jsx(ki,{day:he(O.date,"DD-MM-YYYY").format("DD/MM/YYYY"),i18next:i,slot:O.slot})})})})]}):m.jsx("div",{className:"slot-calendar ",children:m.jsxs("div",{className:"row",children:[l.multiple?m.jsx("div",{className:"col-12 d-print-none d-preview-calendar-none",children:m.jsxs("div",{className:"m-2",children:[m.jsx("h6",{children:i.t(l.label)}),m.jsx(yr.DayPicker,{mode:"single",selected:S,locale:P(),disabled:I,onMonthChange:ve,onDayClick:me}),m.jsx("p",{children:i.t("Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione")})]})}):M.length!==1?m.jsx("div",{className:"col-12 d-print-none d-preview-calendar-none",children:m.jsxs("div",{className:"m-2",children:[m.jsx("h6",{children:i.t(l.label)}),m.jsx(yr.DayPicker,{mode:"single",selected:S,locale:P(),disabled:I,onMonthChange:ve,onDayClick:me}),m.jsxs("p",{children:[" ",i.t("Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione")]})]})}):null,m.jsx("div",{className:"col-12",children:M.length?m.jsx("div",{className:"row m-2",children:m.jsxs("div",{className:"col-12 mb-4",children:[m.jsxs("b",{children:[M.length>1?i.t("Giorni selezionati per la prenotazione"):i.t("Giorno selezionato per la prenotazione"),":"," "]}),m.jsx("div",{className:"mb-5",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:M.map((N,W)=>m.jsx("li",{children:m.jsx("div",{className:"list-item",children:m.jsxs("div",{className:"it-right-zone",children:[m.jsxs("span",{className:"text pl-4",children:[N.date," ",g||N.slot?`${i.t("alle")} ${N.slot}`:""]}),m.jsx(ue.Icon,{icon:"it-delete",onClick:()=>H(W,N),role:"button"})]})})},"li"+W))})})}),f?m.jsx(ue.Alert,{color:"info",defaultValue:"string",className:"d-print-none d-preview-calendar-none",children:m.jsx(Vs,{date:f.expiration_time,renderer:Ce})}):null]})}):null})]})}),m.jsxs(ue.Modal,{isOpen:T,toggle:()=>w(!T),labelledBy:"daySelected",size:"lg",centered:!0,container:document.body,children:[m.jsx(ue.ModalHeader,{toggle:()=>w(!T),id:"daySelected",children:i.t("Seleziona una fascia oraria")}),c?null:m.jsxs("div",{className:"title-xsmall u-grey-dark px-4",children:[" ",i.t("Seleziona una fascia oraria e, se necessario, utilizza l'apposito controllo per accorciare la durata della prenotazione, Poi clicca su Conferma")]}),m.jsx(ue.ModalBody,{children:m.jsxs("div",{className:"row",children:[M.length>=1?m.jsxs("div",{children:[_&&!c?m.jsxs("h6",{children:[i.t("Orari disponibili del")," ",Se(_).format("DD/MM/YYYY")]}):null,m.jsxs("div",{className:"calendar-last-selection col-12 pt-2 mb-5",children:[m.jsx("small",{className:"pl-2 mb-2 d-flex px-2",children:m.jsxs("b",{children:[m.jsx(ue.Icon,{icon:"it-clock",className:"mr-1",size:"sm"})," ",i.t("Ultimo orario selezionato")]})}),m.jsx("div",{className:"col-6 px-2",children:m.jsx("button",{type:"button",id:"slot-last-selection",onClick:oe,tabIndex:"1",className:C==="slot-last-selection"?"active btn btn-slot p-0":"btn btn-slot p-0","data-date":he(_,"DD/MM/YYYY").format("YYYY-MM-DD"),"data-slots":M[M.length-1].slot,"data-opening_hour":M[M.length-1].opening_hour_id,"data-start":M[M.length-1].slot.split("-")[0],"data-end":M[M.length-1].slot.split("-")[1],"data-value_start":M[M.length-1].slot.split("-")[0],"data-value_end":M[M.length-1].slot.split("-")[1],disabled:c,children:M[M.length-1].slot})})]})]}):null,m.jsx("div",{children:_&&M.length>=1?m.jsx("h6",{children:i.t("Seleziona altri orari")}):c?null:m.jsxs("h6",{children:[i.t("Orari disponibili del")," ",Se(_).format("DD/MM/YYYY")]})}),y.map((N,W)=>m.jsx("div",{className:"col-6",children:m.jsxs("button",{type:"button",id:"slot-"+W,onClick:oe,ref:z,className:C==="slot-"+W?"active btn btn-slot p-0":"btn btn-slot p-0",tabIndex:"1","data-date":N.date,"data-start":N.start_time,"data-end":N.end_time,"data-value_start":N.start_time,"data-value_end":N.end_time,"data-slots":N.start_time+"-"+N.end_time,"data-opening_hour":N.opening_hour,"data-min_duration":N.min_duration,disabled:N.slots_available==0,children:[N.start_time," - ",N.end_time]})},"slot-"+W)),c?m.jsxs("div",{className:"callout callout-highlight warning",children:[m.jsxs("div",{className:"callout-title",children:[m.jsx(ue.Icon,{"aria-hidden":!0,icon:"it-help-circle"}),i.t("Attenzione")]}),m.jsxs("p",{children:[" ",i.t("Non è possibile prenotare per la data selezionata"),"."]})]}):null,m.jsx("div",{className:"col-12",children:g?.value_start&&C?m.jsxs("div",{className:"row",children:[m.jsx("div",{className:"col-12 mb-3",children:m.jsx("p",{className:"mb-3",children:m.jsx("b",{children:i.t("Se necessario, utilizza il controllo che segue per accorciare la durata della prenotazione")})})}),m.jsx("div",{className:"col-12 col-md-6 mb-4",children:m.jsx(ue.Input,{type:"time",label:i.t("Dalle"),className:"active",defaultValue:g.value_start||g.start,min:g.start,max:g.end,onBlur:Oe})}),m.jsx("div",{className:"col-12 col-md-6 mb-4",children:m.jsx(ue.Input,{type:"time",label:i.t("alle"),className:"active",defaultValue:g.value_end||g.end,onBlur:$,min:g.start,max:g.end})})]}):null})]})}),m.jsx(ue.ModalFooter,{children:m.jsx(ue.Button,{color:"primary",onClick:()=>Ne(),disabled:!_||!g?.value_start,children:i.t("Conferma")})})]})]})};let $s=class Bs extends Oi{constructor(s,u,i){super(s,u,i)}static get builderInfo(){return{title:"Dynamic Calendar",group:"basic",icon:"bi bi-calendar-plus",documentation:"",weight:70,schema:Bs.schema()}}static schema(){return Oi.schema({type:"dynamic_calendar"})}static editForm=Pc;attach(s){return super.attach(s).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:"single"});const u=this.refs[`react-${this.id}`];return u?(this.rootComponent=Et.createRoot(u),this.rootComponent.render(m.jsx(Oh,{component:this.component,value:this.dataValue,onChange:i=>this.setValue(i),...this,current:this})),this):this})}detach(){return this.rootComponent&&(this.rootComponent.unmount(),this.rootComponent=null),super.detach()}setValue(s){if(s)if(Array.isArray(s))this.selectedNextSlots=s,this.updateValue(s),this.shouldSetValue=!0;else if(typeof s=="object")this.date=s.date,this.slot=s.slot,this.meeting=s.meeting_id,this.meeting_expiration_time=null,this.opening_hour=s.opening_hour_id,this.calendar_id=s.calendar_id,this.updateValue(s),this.shouldSetValue=!0;else{let u=s.replace(")","").replace(" ("," @ ").replace(/\//g,"-").split(" @ "),i=u[2].split("#");this.date=u[0],this.slot=u[1],this.meeting=i[1],this.meeting_expiration_time=null,this.opening_hour=i.length===3?i[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 s=this.meeting?this.meeting:"",u=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:s,opening_hour_id:u}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}};const Yh=[{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:Ee()+"/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 = '"+Ee()+"'; 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:Ee()+"/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) {
|
|
49
49
|
let url = data.url + '/api/calendars/' + data.calendarId + '/overlaps';
|
|
50
50
|
if (data.select_opening_hours && data.opening_hours.length > 0) {
|
|
51
51
|
let qs = "?opening_hours=" + data.opening_hours.join();
|
|
@@ -76,7 +76,7 @@ if(data.calendarId && data.api_url){
|
|
|
76
76
|
data.overlaps_validation = -1; document.querySelector("input[name^='data[overlaps_validation]']").value = -1;
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
}`,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 Ch(...l){return Bt.Components.baseEditForm([{key:"display",components:Yh}],...l)}function Yi({day:l,slot:s,i18next:u}){return m.jsx("li",{className:"it-list-item",children:m.jsx("div",{className:"list-item",children:m.jsx("div",{className:"it-right-zone",children:m.jsxs("span",{className:"text pl-4",children:[m.jsx("b",{children:l})," ",u.t("alle")," ",u.t("ore")," ",m.jsx("b",{children:s})]})})})})}const Ci=Rt.Formio.Components.components.field,jh=({component:l,current:s,onChange:u,i18next:i})=>{const[S,x]=G.useState(),[I,o]=G.useState([]),[y,r]=G.useState([]),[c,h]=G.useState(!1),[f,p]=G.useState(null),[g,Y]=G.useState(null),[_,k]=G.useState(null),[C,j]=G.useState(null),[F,R]=G.useState({}),[O,v]=G.useState(null),[T,w]=G.useState(!1),[M,V]=G.useState([]),[E,A]=G.useState(!1),z=G.useRef(),B=l.calendarId;he.locale(i.language);const ee=P=>{let H=he(P).format("YYYY-MM-DD");fetch(te(H)).then(N=>N.json()).then(N=>{let W=fe(P||new Date);const q=N.filter(_e=>_e.available==!0);q.length===0&&$();let se=[];W.forEach(_e=>{N.some($e=>$e.date===_e&&$e.available==!0)?se.push({available:!0,date:_e}):se.push({available:!1,date:_e})});const Pe=se.map(_e=>{if(_e.available===!1)return he(_e.date,"YYYY-MM-DD").toDate()});o(Pe);const ge=q.length?q[0].date:P;ie(ge)}).catch(N=>console.error(N))},ie=P=>{j(null),k(null),r([]);let H=he(P).format("YYYY-MM-DD");fetch(de(H)).then(N=>N.json()).then(N=>{const W=N.filter(q=>q.availability==!0);R(W[0]),W.length>0?(r(N),h(!1),k(he(P).format("L")),x(he(P,"YYYY-MM-DD").toDate())):(N.length>0&&x(he(N[0].date,"YYYY-MM-DD").toDate()),r([]),$())})},re=()=>{if(B!==""&&B!=null)if(!s.dataValue)ee(new Date);else if(l.multiple&&Array.isArray(s.dataValue)){if(s.dataValue.length>0){v(s.dataValue);let P=[];s.dataValue.map(H=>{P.push({...H,date:he(H.date,"YYYY-MM-DD").format("DD-MM-YYYY")})}),V(P)}}else if(!l.multiple&&typeof s.dataValue=="object"){const P={date:s.dataValue.date,slot:s.dataValue.slot},H={...s.dataValue,date:he(s.dataValue.date,"YYYY-MM-DD").format("DD-MM-YYYY")};V([H]),v(P)}else{let P=s.dataValue.replace(")","").replace(" ("," @ ").replace(/\//g,"-").split(" @ "),H=P[2].split("#");const N={date:he(P[0],"DD-MM-YYYY").format("YYYY-MM-DD"),slot:P[1]};l.multiple?(u([{date:P[0],slot:P[1],calendar_id:H[0],meeting_id:H[1],opening_hour_id:H.length===3?H[2]:""}]),V([{date:P[0],slot:P[1],calendar_id:H[0],meeting_id:H[1],opening_hour_id:H.length===3?H[2]:""}])):(u({date:P[0],slot:P[1],calendar_id:H[0],meeting_id:H[1],opening_hour_id:H.length===3?H[2]:""}),V([{date:P[0],slot:P[1],calendar_id:H[0],meeting_id:H[1],opening_hour_id:H.length===3?H[2]:""}])),v(N)}};G.useEffect(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{re()},1e3)})},[]);const fe=P=>{let N=he(P,"YYYY-MM").daysInMonth(),W=[];for(;N;){let q=he(P).date(N);W.push(q.format("YYYY-MM-DD")),N--}return W},te=(P,H=!1)=>{let N=l.calendarId,W=l.select_opening_hours,q=l.select_opening_hours?l.opening_hours:[];window.location.pathname.split("/");let se=`${Ee()}/api/calendars/${N}/availabilities`,Pe=[`from_time=${he(P).startOf("month").format("YYYY-MM-DD")}`,`to_time=${he(P).endOf("month").format("YYYY-MM-DD")}`];return H&&Pe.push(`available=${H}`),W&&q&&Pe.push(`opening_hours=${q.join()}`),`${se}?${Pe.join("&")}`},de=(P,H=!1)=>{let N=l.calendarId,W=l.select_opening_hours,q=l.select_opening_hours?l.opening_hours:[];window.location.pathname.split("/");const se=he(P).format("YYYY-MM-DD");let Pe=`${Ee()}/api/calendars/${N}/availabilities/${se}`,ge=[];return H&&ge.push(`available=${H}`),W&&q&&ge.push(`opening_hours=${q.join()}`),ge&&(Pe=`${Pe}?${ge.join("&")}`),Pe},ve=P=>{ee(P)},me=P=>{setTimeout(()=>{w(!T)},1e3),ie(P)},oe=P=>{j(null),setTimeout(()=>{P&&(Y(P.target.dataset),j(P.target.id))},300)},Z=P=>{p(null);let H=`${Ee()}/it/meetings/new-draft`,N={date:g?.date?he(g?.date).format("DD-MM-YYYY"):he(P.target.dataset.date).format("DD-MM-YYYY"),slot:g?.value_start&&g?.value_end?g.value_start+"-"+g.value_end:P.target.dataset.slots,calendar:l.calendarId,opening_hour:g?.opening_hour?g?.opening_hour:P.target.dataset.opening_hour,meeting:f?f.id:"",first_available_date:F.date,first_available_start_time:F.start_time,first_available_end_time:F.end_time,first_availability_updated_at:he().format()};fetch(H,{method:"POST",body:JSON.stringify(N),headers:{"Content-Type":"application/json; charset=utf-8"},strictErrors:!0}).then(W=>{if(!W.ok)throw new Error(i.t("Intervallo selezionato non disponibile!"));return W.json()}).then(W=>{p(W);const q={date:N.date,slot:N.slot,calendar_id:N.calendar[0],opening_hour_id:N.opening_hour||N.opening_hour_id,meeting_id:W.id};V([...M,q])}).catch(W=>{console.log(W),He.fire({title:"",html:"<p>"+W+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1})})},Ne=()=>{g&&(Z(),w(!T))},Ie=()=>m.jsx("span",{children:i.t("Tempo prenotazione scaduto!")}),Ce=({minutes:P,seconds:H,completed:N})=>N?m.jsx(Ie,{}):m.jsx("div",{children:m.jsxs("div",{children:[" ",m.jsxs("span",{children:[" ",m.jsxs("i",{children:[i.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"),":"]})," ",m.jsxs("b",{children:[P," ",i.t("minuti")," ",H," ",i.t("secondi")]})]})]})}),Oe=P=>{if(P===null||P==="")u("");else if(Array.isArray(P)&&P.length>0){let H=[];M.map(N=>{H.push({date:he(N.date,"DD-MM-YYYY").format("YYYY-MM-DD"),slot:N.slot,calendar_id:N.calendar_id||N.calendar[0],meeting_id:N.meeting_id,opening_hour_id:N.opening_hour||N.opening_hour_id})}),l.multiple?u(H):u(H[0])}else u("")},$=()=>{h(!0),p(null),k(null),Oe(null)},J=()=>{if(i.language==="it")return Hs;if(i.language==="en")return qs;if(i.language==="de")return Ws};G.useEffect(()=>{Oe(M)},[M]),G.useEffect(()=>{document.querySelector(".formio-read-only")&&E===!1?(A(!0),setTimeout(()=>{re()},1e3)):(A(!1),setTimeout(()=>{re()},1e3))},[]);const X=(P,H)=>{let N=`${Ee()}/api/meetings/${H.meeting_id}`;fetch(N,{method:"DELETE",headers:{"Content-Type":"application/json; charset=utf-8",Authorization:`Bearer ${tr("auth-token")}`},strictErrors:!0}).then(W=>{if(W&&W.status>400)He.fire({title:"",html:`<p>${i.t("Ci sono stati degli errori durante la cancellazione dello slot")}</p>`,icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1});else{const q=[...M.slice(0,P),...M.slice(P+1)];V(q),ee(new Date)}})};return m.jsxs(m.Fragment,{children:[E&&O?m.jsxs("div",{className:"my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none",children:[m.jsxs("b",{children:[Array.isArray(O)&&O.length>1?i.t("Giorni selezionati per la prenotazione"):i.t("Giorno selezionato per la prenotazione"),":"]}),m.jsx("div",{className:"mb-5",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:Array.isArray(O)?O.map(P=>m.jsx(Yi,{day:he(P.date,"DD-MM-YYYY").format("DD/MM/YYYY"),i18next:i,slot:P.slot})):m.jsx(Yi,{day:Me(O.date).format("DD/MM/YYYY"),i18next:i,slot:O.slot})})})})]}):m.jsx("div",{className:"slot-calendar ",children:m.jsxs("div",{className:"row",children:[l.multiple?m.jsx("div",{className:"col-12 d-print-none d-preview-calendar-none",children:m.jsxs("div",{className:"m-2",children:[m.jsx("h6",{children:i.t(l.label)}),m.jsx(yr.DayPicker,{mode:"single",selected:S,locale:J(),disabled:I,onMonthChange:ve,onDayClick:me})]})}):M.length!==1?m.jsx("div",{className:"col-12 d-print-none d-preview-calendar-none",children:m.jsxs("div",{className:"m-2",children:[m.jsx("h6",{children:i.t(l.label)}),m.jsx(yr.DayPicker,{mode:"single",selected:S,locale:J(),disabled:I,onMonthChange:ve,onDayClick:me})]})}):null,m.jsx("div",{className:"col-12",children:M.length?m.jsx("div",{className:"row m-2",children:m.jsxs("div",{className:"col-12 mb-4",children:[m.jsxs("b",{children:[M.length>1?i.t("Giorni selezionati per la prenotazione"):i.t("Giorno selezionato per la prenotazione"),":"," "]}),m.jsx("div",{className:"mb-5",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:M.map((P,H)=>m.jsx("li",{children:m.jsx("div",{className:"list-item",children:m.jsxs("div",{className:"it-right-zone",children:[m.jsxs("span",{className:"text pl-4",children:[P.date," ",g||P.slot?`${i.t("alle")} ${P.slot}`:""]}),m.jsx(ue.Icon,{icon:"it-delete",onClick:()=>X(H,P),role:"button"})]})})},"li"+H))})})}),f?m.jsx(ue.Alert,{color:"info",defaultValue:"string",className:"d-print-none d-preview-calendar-none",children:m.jsx(Vs,{date:f.expiration_time,renderer:Ce})}):null]})}):null})]})}),m.jsxs(ue.Modal,{isOpen:T,toggle:()=>w(!T),labelledBy:"daySelected",size:"lg",centered:!0,container:document.body,children:[m.jsx(ue.ModalHeader,{toggle:()=>w(!T),id:"daySelected",children:i.t("Seleziona una fascia oraria")}),m.jsx(ue.ModalBody,{children:m.jsxs("div",{className:"row",children:[M.length>=1?m.jsxs("div",{children:[_&&!c?m.jsxs("h6",{children:[i.t("Orari disponibili del")," ",Me(_).format("DD/MM/YYYY")]}):null,m.jsxs("div",{className:"calendar-last-selection col-12 pt-2 mb-5",children:[m.jsx("small",{className:"pl-2 mb-2 d-flex px-2",children:m.jsxs("b",{children:[m.jsx(ue.Icon,{icon:"it-clock",className:"mr-1",size:"sm"})," ",i.t("Ultimo orario selezionato")]})}),m.jsx("div",{className:"col-6 px-2",children:m.jsx("button",{type:"button",id:"slot-last-selection",onClick:oe,tabIndex:"1",className:C==="slot-last-selection"?"active btn btn-slot p-0":"btn btn-slot p-0","data-date":he(_,"DD/MM/YYYY").format("YYYY-MM-DD"),"data-slots":M[M.length-1].slot,"data-opening_hour":M[M.length-1].opening_hour_id,"data-start":M[M.length-1].slot.split("-")[0],"data-end":M[M.length-1].slot.split("-")[1],"data-value_start":M[M.length-1].slot.split("-")[0],"data-value_end":M[M.length-1].slot.split("-")[1],disabled:c,children:M[M.length-1].slot})})]})]}):null,m.jsx("div",{children:_&&M.length>=1?m.jsx("h6",{children:i.t("Seleziona altri orari")}):c?null:m.jsxs("h6",{children:[i.t("Orari disponibili del")," ",Me(_).format("DD/MM/YYYY")]})}),y.map((P,H)=>m.jsx("div",{className:"col-6",children:m.jsxs("button",{type:"button",id:"slot-"+H,onClick:oe,ref:z,className:C==="slot-"+H?"active btn btn-slot p-0":"btn btn-slot p-0",tabIndex:"1","data-date":P.date,"data-start":P.start_time,"data-end":P.end_time,"data-value_start":P.start_time,"data-value_end":P.end_time,"data-slots":P.start_time+"-"+P.end_time,"data-opening_hour":P.opening_hour,"data-min_duration":P.min_duration,disabled:P.slots_available==0,children:[P.start_time," - ",P.end_time]})},"slot-"+H)),c?m.jsxs("div",{className:"callout callout-highlight warning",children:[m.jsxs("div",{className:"callout-title",children:[m.jsx(ue.Icon,{"aria-hidden":!0,icon:"it-help-circle"}),i.t("Attenzione")]}),m.jsxs("p",{children:[" ",i.t("Non è possibile prenotare per la data selezionata"),"."]})]}):null]})}),m.jsx(ue.ModalFooter,{children:m.jsx(ue.Button,{color:"primary",onClick:()=>Ne(),disabled:!_||!g?.value_start,children:i.t("Conferma")})})]})]})};class wr extends Ci{constructor(s,u,i){super(s,u,i)}static get builderInfo(){return{title:"Calendar",group:"basic",icon:"bi bi-calendar-plus",documentation:"",weight:70,schema:wr.schema()}}static schema(){return Ci.schema({type:"calendar"})}static editForm=Ch;attach(s){return super.attach(s).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:"single"});const u=this.refs[`react-${this.id}`];return u?(this.rootComponent=Et.createRoot(u),this.rootComponent.render(m.jsx(jh,{component:this.component,value:this.dataValue,onChange:i=>this.setValue(i),...this,current:this})),this):this})}detach(){return this.rootComponent&&(this.rootComponent.unmount(),this.rootComponent=null),super.detach()}setValue(s){if(s)if(Array.isArray(s))this.selectedNextSlots=s,this.updateValue(s),this.shouldSetValue=!0;else if(typeof s=="object")this.date=s.date,this.slot=s.slot,this.meeting=s.meeting_id,this.meeting_expiration_time=null,this.opening_hour=s.opening_hour_id,this.calendar_id=s.calendar_id,this.updateValue(s),this.shouldSetValue=!0;else{let u=s.replace(")","").replace(" ("," @ ").replace(/\//g,"-").split(" @ "),i=u[2].split("#");this.date=u[0],this.slot=u[1],this.meeting=i[1],this.meeting_expiration_time=null,this.opening_hour=i.length===3?i[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 s=this.meeting?this.meeting:"",u=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:s,opening_hour_id:u}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}}const Th=[{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 = '"+Ee()+"'; data.url = url; value=url;",key:"url",type:"hidden",input:!0,weight:1}];function Ph(...l){return Bt.Components.baseEditForm([{key:"display",components:Th}],...l)}function Nh({day:l,slot:s,i18next:u}){return m.jsx("li",{className:"it-list-item",children:m.jsx("div",{className:"list-item",children:m.jsx("div",{className:"it-right-zone",children:m.jsxs("span",{className:"text-paragraph pl-4",children:[m.jsx("b",{children:l})," ",u.t("alle")," ",u.t("ore")," ",m.jsx("b",{children:s})]})})})})}function Rh(l,s){if(!s||s.length===0)return;const u=s.map(I=>{const o=new Date(I.start);return(new Date(I.end)-o)/6e4}),i=Math.min(...u),S=u.reduce((I,o)=>I+o,0)/u.length;let x=0;i<=30&&i>15?x=S*1:i<=15?x=S*24:x=S*4,l.setOption("slotHeight",x),document.documentElement.style.setProperty("--slot-height",`${x}px`)}const Us={AVAILABILITY:{key:"availability_data_cache_",duration:10},SLOTS:{key:"availability_slots_cache_",duration:10},SUBMISSION:{key:"submission_cache_",duration:30}},Xr=(l,s,u)=>{const i={data:u,timestamp:Me().toISOString()};sessionStorage.setItem(s,JSON.stringify(i)),console.log(`✅ Cache salvato: ${l}`)},Zr=(l,s)=>{try{const u=sessionStorage.getItem(s);if(!u)return null;const i=JSON.parse(u),S=Me().diff(Me(i.timestamp),"minutes");return S>Us[l].duration?(sessionStorage.removeItem(s),console.log(`⏰ Cache scaduto: ${l}`),null):(console.log(`✅ Cache letto: ${l} (${S} minuti fa)`),i.data)}catch(u){return console.error(`Errore nel leggere il cache (${l}):`,u),null}},Qr=(l,...s)=>Us[l].key+btoa(s),_n="calendar_view_state",bn="calendar_view_date",Eh=(l,s)=>{try{sessionStorage.setItem(_n,l),sessionStorage.setItem(bn,s||new Date().toISOString())}catch(u){console.error("Errore nel salvare lo stato della view:",u)}},Ah=()=>{try{const l=sessionStorage.getItem(_n),s=sessionStorage.getItem(bn);return{viewType:l||"timeGridWeek",date:s?new Date(s):new Date}}catch(l){return console.error("Errore nel leggere lo stato della view:",l),{viewType:"timeGridWeek",date:new Date}}},Gs=()=>{try{sessionStorage.removeItem(_n),sessionStorage.removeItem(bn)}catch(l){console.error("Errore nel pulire lo stato della view:",l)}},ji=Rt.Formio.Components.components.field,Ih=({component:l,current:s,onChange:u,i18next:i})=>{const[S,x]=G.useState(null),[I,o]=G.useState(null),[y,r]=G.useState([]),[c,h]=G.useState(!1),[f,p]=G.useState(!1),[g,Y]=G.useState(null),[_,k]=G.useState([]),[C,j]=G.useState([]),[F,R]=G.useState([]),[O,v]=G.useState(null),[T,w]=G.useState(null),[M,V]=G.useState(null),E=G.useRef(null),A=G.useRef(null);i.language,he.locale(i.language),Me.locale(i.language);function z($){if(!$||$.length===0)return null;const J=$.map(H=>({start:H.start_time,end:H.end_time})),X=J.reduce((H,N)=>N.start<H?N.start:H,J[0].start),P=J.reduce((H,N)=>N.end>H?N.end:H,J[0].end);return{earliestStartTime:X,latestEndTime:P}}function B($){const J=$.map(H=>he(H.date).isoWeekday()),P=[1,2,3,4,5,6,7].filter(H=>!J.includes(H));P.length>0?A.current.setOption("hiddenDays",P):A.current.setOption("hiddenDays",[])}function ee($,J,X){const P=new URL($),N=`${P.pathname.split("/").slice(0,4).join("/")}/${J}/${X}`;return`${P.origin}${N}${P.search}`}function ie($,J,X){const P=new URL($),N=`${P.pathname.split("/").slice(0,4).join("/")}`;return`${P.origin}${N}${P.search}&from_to=${J}&to_date=${X}`}function re($,J,X){return`${Ee()}/api/availabilities/${$}/${J}?calendar_ids=${X}&available=true`}const fe=$=>{R([]),j([]),u({}),$&&j(S.filter(J=>J.date.startsWith($)))},te=async($,J)=>{const X=JSON.parse($),P=Qr("SLOTS",X.date,X.calendar_ids);if(J==="manual")R([]),V(null),Y(null),u({});else{const H=Zr("SLOTS",P);if(H){R(H);return}}try{const H=await window.FormioHelper.anonymousCall(`availabilities/${X.date}?calendar_ids=${X.calendar_ids}`);Xr("SLOTS",P,H.data),R(H.data)}catch(H){console.error("Errore nel caricamento degli slot:",H),He.fire({icon:"error",title:i.t("Errore"),text:i.t("Errore nel caricamento degli orari")})}},de=$=>{const J=JSON.parse($),X={status:6,calendar:J.calendar_id,opening_hour:J.opening_hour_id,user:null,email:null,fiscal_code:null,name:" ",phone_number:null,from_time:Me(`${J.date}T${J.start_time}`).toISOString(),to_time:Me(`${J.date}T${J.end_time}`).toISOString(),user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:s?.data?.service_data?.id,calendar_group_office_id:s?.data?.user_group?.id,calendar_group_place_id:s?.data?.place?.id};window.FormioHelper.authenticatedRequest(s?.dataValue?.id?"PATCH":"POST",s?.dataValue?.id?`meetings/${s.dataValue.id}`:"meetings",X).then(P=>{Y({day:Me(J.date).format("dddd, DD MMMM YYYY"),startDate:J.start_time,endDate:J.end_time}),u(P?.id?P:P?{...P,id:s.dataValue.id}:s.dataValue.id?{...X,id:s.dataValue.id}:{...X})}).catch(P=>{console.error(P),P.status===400&&P?.response?.data?.type==="validation_error"?He.fire({title:"",html:"<p>"+i.t("Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa")+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1}):He.fire({title:"",html:"<p>"+P+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1})})},ve=$=>{const J=new Set,X=[];return $.forEach(P=>{const H=Me(P.date),N=H.format("YYYY-MM");J.has(N)||(J.add(N),X.push({value:N,label:H.format("MMMM YYYY").replace(/^\w/,W=>W.toUpperCase())}))}),X},me=async()=>{const $=s?.root?.data?.place?.merge_availabilities?s?.root?.data?.place?.merged_availabilities_link:null,J=he().format("YYYY-MM-DD"),X=he().add(1,"month").format("YYYY-MM-DD"),P=s?.root?.data?.place?.calendars[0]?.id||null,H=$?ie($,J,X):re(J,X,P),N=Qr("AVAILABILITY",H),W=Zr("AVAILABILITY",N);if(W){x(W),k(ve(W));return}else u({});h(!0);try{const q=await window.FormioHelper.fetchAPIUrlLimit(H);if(h(!1),!q?.length){He.fire({icon:"warning",title:i.t("warning"),html:i.t("no_meetings")});return}Xr("AVAILABILITY",N,q),x(q),k(ve(q))}catch(q){h(!1),console.error("Errore nel caricamento disponibilità:",q)}};G.useEffect(()=>{if(S?.length){const $=s?.dataValue??s?.getValue();if($?.from_time&&$?.to_time&&!Me().isAfter($?.draft_expiration)){const J=Me($.from_time).format("YYYY-MM");v(J),J&&j&&(j(S.filter(X=>X.date.startsWith(J))),w(Me($.from_time).format("YYYY-MM-DD")))}else $?.draft_expiration&&Me().isAfter($?.draft_expiration)&&He.fire({icon:"warning",title:i.t("warning"),html:i.t("expired_meeting")})}},[S]),G.useEffect(()=>{const $=s?.dataValue??s?.getValue();if(!_.length||O||$?.from_time||$?.to_time)return;const J=_[0];J&&(v(J.value),fe(J.value))},[_,O,s?.dataValue]),G.useEffect(()=>{if(T&&f===!1){const $=s?.dataValue??s?.getValue();te(JSON.stringify({date:T,calendar_ids:$.calendar.id}))}},[T]);const oe=()=>window.innerWidth>768?"timeGridWeek":"timeGridDay";G.useEffect(()=>{const $=()=>{const J=A.current;if(!J)return;const X=oe(),P=J.getView().type;X!==P&&J.setOption("view",X)};return window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)},[]),G.useEffect(()=>{const $=s?.dataValue??s?.getValue();F?.length&&$?.from_time&&(V(Me($.from_time).format("HH:mm")+" - "+Me($.to_time).format("HH:mm")),Y({day:Me($.from_time).format("dddd D MMM YYYY"),startDate:Me($.from_time).format("HH:mm"),endDate:Me($.to_time).format("HH:mm")}))},[F]);const Z=()=>{const $=Ah();A.current=ci.createCalendar(E.current,[ci.TimeGrid],{events:[],buttonText:{today:i.t("Oggi")},allDaySlot:!1,firstDay:1,date:$.date,slotEventOverlap:!1,view:oe(),height:"400px",views:{timeGridWeek:{allDaySlot:!1,firstDay:1,slotHeight:48},timeGridDay:{allDaySlot:!1,firstDay:1,slotHeight:48}},datesSet:J=>{Eh(J.view.type,J.start)},eventClick({event:J,el:X}){document.querySelectorAll(".ec-event").forEach(se=>{se.classList.remove("highlighted-event")}),X.classList.add("highlighted-event");const P=new Date(J.start),H=new Date(J.end),N=P.toLocaleDateString("it-IT",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),W=P.toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit"}),q=H.toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit"}),ce={status:6,calendar:J.extendedProps.calendar_id,opening_hour:J.extendedProps.opening_hour_id,user:null,email:null,fiscal_code:null,name:" ",phone_number:null,from_time:P,to_time:H,user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:s?.data?.service_data?.id,calendar_group_office_id:s?.data?.user_group?.id,calendar_group_place_id:s?.data?.place?.id};window.FormioHelper.authenticatedRequest(s?.dataValue?.id?"PATCH":"POST",s?.dataValue?.id?`meetings/${s.dataValue.id}`:"meetings",ce).then(se=>{let Pe;!se||se===""?Pe={...ce,code:null,id:s?.dataValue?.id}:typeof se=="object"&&(Pe=se),Y({day:N,startDate:W,endDate:q}),u(Pe)}).catch(se=>{console.error(se),se.status===400&&se?.response?.data?.type==="validation_error"?He.fire({title:"",html:"<p>"+i.t("Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa")+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1}):He.fire({title:"",html:"<p>"+se+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1})})},viewDidMount:Ne,eventDidMount:J=>{const{event:X,el:P}=J,H=X.extendedProps;P.setAttribute("data-event-id",X.id+"-"+H.date+"-"+H.start_time)},loading:J=>{h(J)}})},Ne=$=>{s?.root?.data?.place&&A.current.setOption("eventSources",[{events:Ie}])};async function Ie($,J,X){try{A.current.setOption("events",[]);const P=he($.start).format("YYYY-MM-DD"),H=new Date($.end);H.setDate(H.getDate()-1);const N=he(H).format("YYYY-MM-DD"),W=null,q=s?.root?.data?.place?.merge_availabilities?s?.root?.data?.place?.merged_availabilities_link:null,ce=q?ee(q,P,N):re(P,N,W),se=Qr("AVAILABILITY",ce),Pe=Zr("AVAILABILITY",se);let ge;if(Pe?(ge=Pe,h(!1)):(ge=await window.FormioHelper.fetchAPIUrlLimit(ce),Xr("AVAILABILITY",se,ge)),!ge?.length){J([]),He.fire({icon:"warning",title:i.t("warning"),html:i.t("no_meetings")});return}const _e=ge.map(Re=>({id:Re.opening_hour_id,allDay:!1,start:`${Re.date}T${Re.start_time}:00`,end:`${Re.date}T${Re.end_time}:00`,title:`${Re.start_time} - ${Re.end_time}`,editable:!1,display:"auto",color:"#ebeef0",textColor:"#000",className:"event-slot",extendedProps:{...Re}})),$e=z(ge);A.current.setOption("slotMinTime",$e.earliestStartTime),A.current.setOption("slotMaxTime",$e.latestEndTime),B(ge),Rh(A.current,_e),J(_e),setTimeout(()=>{Ce(_e)},500)}catch(P){console.error("Errore nel caricamento disponibilità:",P),X?.(P)}}G.useEffect(()=>{let $,J=!1;async function X(){try{if(await window.FormioInstance?.formReady,J)return;if(!E.current){console.warn("Elemento calendario non trovato");return}const P=s?.dataValue??s?.getValue();P&&P?.draft_expiration&&Me().isAfter(P.draft_expiration)&&(u({}),Gs()),s?.data?.service_data?.view_type==="calendar"?A?.current||Z():s?.data?.service_data?.view_type==="select"?me():alert(i.t("Il componente non è configurato per la visualizzazione a calendario"))}catch(P){console.error("Errore durante l'inizializzazione del calendario:",P)}}return $=setTimeout(X,500),()=>{J=!0,$&&clearTimeout($),A.current&&(E.current?.destroy?.(),A.current=null)}},[s?.root?.data?.place]);function Ce($){const J=s?.dataValue;if(!J?.from_time)return;const X=Me(J.from_time).format("DD-MM-YYYY HH:mm"),P=Me(J.to_time).format("DD-MM-YYYY HH:mm"),H=$.find(W=>Me(W.start).format("DD-MM-YYYY HH:mm")===X&&Me(W.end).format("DD-MM-YYYY HH:mm")===P);if(!H)return;const N=document.querySelector(`.ec-event[data-event-id="${H.id}-${Me(J?.from_time).format("YYYY-MM-DD")}-${Me(J?.from_time).format("HH:mm")}"]`);N&&(N.classList.add("highlighted-event"),N.scrollIntoView({behavior:"smooth",block:"center"}),Y({day:Me(J?.from_time).format("dddd, DD MMMM YYYY"),startDate:Me(J?.from_time).format("HH:mm"),endDate:Me(J?.to_time).format("HH:mm")}))}const Oe=({day:$,startDate:J,endDate:X})=>m.jsx("div",{className:"mt-3",children:m.jsxs("div",{className:"row align-items-center gy-3",children:[m.jsxs("div",{className:"col-12 col-md border-light mx-md-3",children:[m.jsx("div",{className:"text-paragraph-small",children:i.t("Data")}),m.jsx("p",{className:"data-text",children:m.jsx("strong",{children:$})})]}),m.jsxs("div",{className:"col-12 col-md border-light mx-md-3",children:[m.jsx("div",{className:"text-paragraph-small",children:i.t("Ora")}),m.jsx("p",{className:"data-text",children:m.jsxs("strong",{children:[J," - ",X]})})]})]})});return G.useEffect(()=>{document.querySelector(".formio-read-only")&&f===!1?p(!0):(s?.data?.service_data?.view_type==="select"?me():s?.data?.service_data?.view_type==="calendar"&&Z(),p(!1))},[]),G.useEffect(()=>{f&&setTimeout(()=>{const $=s?.dataValue??s?.getValue();console.log("savedValue",$,f),$&&o($)},500)},[f]),m.jsx(m.Fragment,{children:f&&I?m.jsxs("div",{className:"mx-2",children:[m.jsxs("p",{className:"text-paragraph",children:[i.t("Giorno selezionato per la prenotazione"),":"]}),m.jsx("div",{className:"",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:m.jsx(Nh,{day:Me(I.from_time).format("dddd D MMM YYYY"),i18next:i,slot:`${Me(I.from_time).format("HH:mm")} - ${Me(I.to_time).format("HH:mm")}`})})})})]}):m.jsxs("div",{className:"",children:[m.jsx("div",{ref:E}),_.length>0?m.jsxs(m.Fragment,{children:[m.jsxs(ue.Select,{label:"Mese",id:"selectMonthYear",onChange:fe,children:[m.jsx("option",{value:"",children:i.t("Scegli un'opzione")}),_.map($=>m.jsx("option",{value:$.value,selected:$.value===O,children:$.label},$.value))]}),m.jsxs(ue.Select,{label:"Giorno",id:"selectDay",onChange:$=>te($,"manual"),disabled:C.length===0,children:[m.jsx("option",{value:"",children:i.t("Scegli un'opzione")}),C.map($=>m.jsx("option",{value:JSON.stringify($),selected:$.date===T,children:Me($.date).format("dddd,DD MMMM YYYY")},$.date))]}),m.jsxs(ue.Select,{label:"Orario",id:"selectSlot",onChange:de,disabled:F.length===0,children:[m.jsx("option",{value:"",children:i.t("Scegli un'opzione")}),F.map($=>m.jsx("option",{value:JSON.stringify($),selected:$.start_time+" - "+$.end_time===M,children:$.start_time+" - "+$.end_time},$.start_time+" - "+$.end_time))]})]}):null,g?Oe({day:g.day,startDate:g.startDate,endDate:g.endDate}):null,c?m.jsx("div",{className:"d-flex align-items-center justify-content-center position-absolute-center",children:m.jsx(ue.Spinner,{active:!0})}):null]})})};class Sr extends ji{constructor(s,u,i){super(s,u,i)}static get builderInfo(){return{title:"Calendar Advanced",group:"basic",icon:"bi bi-calendar-plus",documentation:"",weight:70,schema:Sr.schema()}}static schema(){return ji.schema({type:"calendar-advanced"})}static editForm=Ph;attach(s,u){this.rootComponent=Et.createRoot(s),this.rootComponent.render(m.jsx(Ih,{ref:u,component:this.component,value:this.dataValue,onChange:i=>this.setValue(i),...this,current:this}))}setValue(s){s&&(this.updateValue(s),this.shouldSetValue=!0)}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}}const Fh=[{key:"defaultValue",ignore:!0}],Vh=[{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"]]}}}],zh=[{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:`{
|
|
79
|
+
}`,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 Ch(...l){return Bt.Components.baseEditForm([{key:"display",components:Yh}],...l)}function Yi({day:l,slot:s,i18next:u}){return m.jsx("li",{className:"it-list-item",children:m.jsx("div",{className:"list-item",children:m.jsx("div",{className:"it-right-zone",children:m.jsxs("span",{className:"text pl-4",children:[m.jsx("b",{children:l})," ",u.t("alle")," ",u.t("ore")," ",m.jsx("b",{children:s})]})})})})}const Ci=Rt.Formio.Components.components.field,jh=({component:l,current:s,onChange:u,i18next:i})=>{const[S,x]=G.useState(),[I,o]=G.useState([]),[y,r]=G.useState([]),[c,h]=G.useState(!1),[f,p]=G.useState(null),[g,Y]=G.useState(null),[_,k]=G.useState(null),[C,j]=G.useState(null),[F,R]=G.useState({}),[O,v]=G.useState(null),[T,w]=G.useState(!1),[M,V]=G.useState([]),[E,A]=G.useState(!1),z=G.useRef(),B=l.calendarId;he.locale(i.language),Se.locale(i.language);const ee=P=>{let H=he(P).format("YYYY-MM-DD");fetch(te(H)).then(N=>N.json()).then(N=>{let W=fe(P||new Date);const q=N.filter(_e=>_e.available==!0);q.length===0&&$();let se=[];W.forEach(_e=>{N.some($e=>$e.date===_e&&$e.available==!0)?se.push({available:!0,date:_e}):se.push({available:!1,date:_e})});const Pe=se.map(_e=>{if(_e.available===!1)return he(_e.date,"YYYY-MM-DD").toDate()});o(Pe);const ge=q.length?q[0].date:P;ie(ge)}).catch(N=>console.error(N))},ie=P=>{j(null),k(null),r([]);let H=he(P).format("YYYY-MM-DD");fetch(de(H)).then(N=>N.json()).then(N=>{const W=N.filter(q=>q.availability==!0);R(W[0]),W.length>0?(r(N),h(!1),k(he(P).format("L")),x(he(P,"YYYY-MM-DD").toDate())):(N.length>0&&x(he(N[0].date,"YYYY-MM-DD").toDate()),r([]),$())})},re=()=>{if(B!==""&&B!=null)if(!s.dataValue)ee(new Date);else if(l.multiple&&Array.isArray(s.dataValue)){if(s.dataValue.length>0){v(s.dataValue);let P=[];s.dataValue.map(H=>{P.push({...H,date:he(H.date,"YYYY-MM-DD").format("DD-MM-YYYY")})}),V(P)}}else if(!l.multiple&&typeof s.dataValue=="object"){const P={date:s.dataValue.date,slot:s.dataValue.slot},H={...s.dataValue,date:he(s.dataValue.date,"YYYY-MM-DD").format("DD-MM-YYYY")};V([H]),v(P)}else{let P=s.dataValue.replace(")","").replace(" ("," @ ").replace(/\//g,"-").split(" @ "),H=P[2].split("#");const N={date:he(P[0],"DD-MM-YYYY").format("YYYY-MM-DD"),slot:P[1]};l.multiple?(u([{date:P[0],slot:P[1],calendar_id:H[0],meeting_id:H[1],opening_hour_id:H.length===3?H[2]:""}]),V([{date:P[0],slot:P[1],calendar_id:H[0],meeting_id:H[1],opening_hour_id:H.length===3?H[2]:""}])):(u({date:P[0],slot:P[1],calendar_id:H[0],meeting_id:H[1],opening_hour_id:H.length===3?H[2]:""}),V([{date:P[0],slot:P[1],calendar_id:H[0],meeting_id:H[1],opening_hour_id:H.length===3?H[2]:""}])),v(N)}};G.useEffect(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{re()},1e3)})},[]);const fe=P=>{let N=he(P,"YYYY-MM").daysInMonth(),W=[];for(;N;){let q=he(P).date(N);W.push(q.format("YYYY-MM-DD")),N--}return W},te=(P,H=!1)=>{let N=l.calendarId,W=l.select_opening_hours,q=l.select_opening_hours?l.opening_hours:[];window.location.pathname.split("/");let se=`${Ee()}/api/calendars/${N}/availabilities`,Pe=[`from_time=${he(P).startOf("month").format("YYYY-MM-DD")}`,`to_time=${he(P).endOf("month").format("YYYY-MM-DD")}`];return H&&Pe.push(`available=${H}`),W&&q&&Pe.push(`opening_hours=${q.join()}`),`${se}?${Pe.join("&")}`},de=(P,H=!1)=>{let N=l.calendarId,W=l.select_opening_hours,q=l.select_opening_hours?l.opening_hours:[];window.location.pathname.split("/");const se=he(P).format("YYYY-MM-DD");let Pe=`${Ee()}/api/calendars/${N}/availabilities/${se}`,ge=[];return H&&ge.push(`available=${H}`),W&&q&&ge.push(`opening_hours=${q.join()}`),ge&&(Pe=`${Pe}?${ge.join("&")}`),Pe},ve=P=>{ee(P)},me=P=>{setTimeout(()=>{w(!T)},1e3),ie(P)},oe=P=>{j(null),setTimeout(()=>{P&&(Y(P.target.dataset),j(P.target.id))},300)},Z=P=>{p(null);let H=`${Ee()}/it/meetings/new-draft`,N={date:g?.date?he(g?.date).format("DD-MM-YYYY"):he(P.target.dataset.date).format("DD-MM-YYYY"),slot:g?.value_start&&g?.value_end?g.value_start+"-"+g.value_end:P.target.dataset.slots,calendar:l.calendarId,opening_hour:g?.opening_hour?g?.opening_hour:P.target.dataset.opening_hour,meeting:f?f.id:"",first_available_date:F.date,first_available_start_time:F.start_time,first_available_end_time:F.end_time,first_availability_updated_at:he().format()};fetch(H,{method:"POST",body:JSON.stringify(N),headers:{"Content-Type":"application/json; charset=utf-8"},strictErrors:!0}).then(W=>{if(!W.ok)throw new Error(i.t("Intervallo selezionato non disponibile!"));return W.json()}).then(W=>{p(W);const q={date:N.date,slot:N.slot,calendar_id:N.calendar[0],opening_hour_id:N.opening_hour||N.opening_hour_id,meeting_id:W.id};V([...M,q])}).catch(W=>{console.log(W),He.fire({title:"",html:"<p>"+W+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1})})},Ne=()=>{g&&(Z(),w(!T))},Ie=()=>m.jsx("span",{children:i.t("Tempo prenotazione scaduto!")}),Ce=({minutes:P,seconds:H,completed:N})=>N?m.jsx(Ie,{}):m.jsx("div",{children:m.jsxs("div",{children:[" ",m.jsxs("span",{children:[" ",m.jsxs("i",{children:[i.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"),":"]})," ",m.jsxs("b",{children:[P," ",i.t("minuti")," ",H," ",i.t("secondi")]})]})]})}),Oe=P=>{if(P===null||P==="")u("");else if(Array.isArray(P)&&P.length>0){let H=[];M.map(N=>{H.push({date:he(N.date,"DD-MM-YYYY").format("YYYY-MM-DD"),slot:N.slot,calendar_id:N.calendar_id||N.calendar[0],meeting_id:N.meeting_id,opening_hour_id:N.opening_hour||N.opening_hour_id})}),l.multiple?u(H):u(H[0])}else u("")},$=()=>{h(!0),p(null),k(null),Oe(null)},J=()=>{if(i.language==="it")return Hs;if(i.language==="en")return qs;if(i.language==="de")return Ws};G.useEffect(()=>{Oe(M)},[M]),G.useEffect(()=>{document.querySelector(".formio-read-only")&&E===!1?(A(!0),setTimeout(()=>{re()},1e3)):(A(!1),setTimeout(()=>{re()},1e3))},[]);const X=(P,H)=>{let N=`${Ee()}/api/meetings/${H.meeting_id}`;fetch(N,{method:"DELETE",headers:{"Content-Type":"application/json; charset=utf-8",Authorization:`Bearer ${tr("auth-token")}`},strictErrors:!0}).then(W=>{if(W&&W.status>400)He.fire({title:"",html:`<p>${i.t("Ci sono stati degli errori durante la cancellazione dello slot")}</p>`,icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1});else{const q=[...M.slice(0,P),...M.slice(P+1)];V(q),ee(new Date)}})};return m.jsxs(m.Fragment,{children:[E&&O?m.jsxs("div",{className:"my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none",children:[m.jsxs("b",{children:[Array.isArray(O)&&O.length>1?i.t("Giorni selezionati per la prenotazione"):i.t("Giorno selezionato per la prenotazione"),":"]}),m.jsx("div",{className:"mb-5",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:Array.isArray(O)?O.map(P=>m.jsx(Yi,{day:he(P.date,"DD-MM-YYYY").format("DD/MM/YYYY"),i18next:i,slot:P.slot})):m.jsx(Yi,{day:Se(O.date).format("DD/MM/YYYY"),i18next:i,slot:O.slot})})})})]}):m.jsx("div",{className:"slot-calendar ",children:m.jsxs("div",{className:"row",children:[l.multiple?m.jsx("div",{className:"col-12 d-print-none d-preview-calendar-none",children:m.jsxs("div",{className:"m-2",children:[m.jsx("h6",{children:i.t(l.label)}),m.jsx(yr.DayPicker,{mode:"single",selected:S,locale:J(),disabled:I,onMonthChange:ve,onDayClick:me})]})}):M.length!==1?m.jsx("div",{className:"col-12 d-print-none d-preview-calendar-none",children:m.jsxs("div",{className:"m-2",children:[m.jsx("h6",{children:i.t(l.label)}),m.jsx(yr.DayPicker,{mode:"single",selected:S,locale:J(),disabled:I,onMonthChange:ve,onDayClick:me})]})}):null,m.jsx("div",{className:"col-12",children:M.length?m.jsx("div",{className:"row m-2",children:m.jsxs("div",{className:"col-12 mb-4",children:[m.jsxs("b",{children:[M.length>1?i.t("Giorni selezionati per la prenotazione"):i.t("Giorno selezionato per la prenotazione"),":"," "]}),m.jsx("div",{className:"mb-5",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:M.map((P,H)=>m.jsx("li",{children:m.jsx("div",{className:"list-item",children:m.jsxs("div",{className:"it-right-zone",children:[m.jsxs("span",{className:"text pl-4",children:[P.date," ",g||P.slot?`${i.t("alle")} ${P.slot}`:""]}),m.jsx(ue.Icon,{icon:"it-delete",onClick:()=>X(H,P),role:"button"})]})})},"li"+H))})})}),f?m.jsx(ue.Alert,{color:"info",defaultValue:"string",className:"d-print-none d-preview-calendar-none",children:m.jsx(Vs,{date:f.expiration_time,renderer:Ce})}):null]})}):null})]})}),m.jsxs(ue.Modal,{isOpen:T,toggle:()=>w(!T),labelledBy:"daySelected",size:"lg",centered:!0,container:document.body,children:[m.jsx(ue.ModalHeader,{toggle:()=>w(!T),id:"daySelected",children:i.t("Seleziona una fascia oraria")}),m.jsx(ue.ModalBody,{children:m.jsxs("div",{className:"row",children:[M.length>=1?m.jsxs("div",{children:[_&&!c?m.jsxs("h6",{children:[i.t("Orari disponibili del")," ",Se(_).format("DD/MM/YYYY")]}):null,m.jsxs("div",{className:"calendar-last-selection col-12 pt-2 mb-5",children:[m.jsx("small",{className:"pl-2 mb-2 d-flex px-2",children:m.jsxs("b",{children:[m.jsx(ue.Icon,{icon:"it-clock",className:"mr-1",size:"sm"})," ",i.t("Ultimo orario selezionato")]})}),m.jsx("div",{className:"col-6 px-2",children:m.jsx("button",{type:"button",id:"slot-last-selection",onClick:oe,tabIndex:"1",className:C==="slot-last-selection"?"active btn btn-slot p-0":"btn btn-slot p-0","data-date":he(_,"DD/MM/YYYY").format("YYYY-MM-DD"),"data-slots":M[M.length-1].slot,"data-opening_hour":M[M.length-1].opening_hour_id,"data-start":M[M.length-1].slot.split("-")[0],"data-end":M[M.length-1].slot.split("-")[1],"data-value_start":M[M.length-1].slot.split("-")[0],"data-value_end":M[M.length-1].slot.split("-")[1],disabled:c,children:M[M.length-1].slot})})]})]}):null,m.jsx("div",{children:_&&M.length>=1?m.jsx("h6",{children:i.t("Seleziona altri orari")}):c?null:m.jsxs("h6",{children:[i.t("Orari disponibili del")," ",Se(_).format("DD/MM/YYYY")]})}),y.map((P,H)=>m.jsx("div",{className:"col-6",children:m.jsxs("button",{type:"button",id:"slot-"+H,onClick:oe,ref:z,className:C==="slot-"+H?"active btn btn-slot p-0":"btn btn-slot p-0",tabIndex:"1","data-date":P.date,"data-start":P.start_time,"data-end":P.end_time,"data-value_start":P.start_time,"data-value_end":P.end_time,"data-slots":P.start_time+"-"+P.end_time,"data-opening_hour":P.opening_hour,"data-min_duration":P.min_duration,disabled:P.slots_available==0,children:[P.start_time," - ",P.end_time]})},"slot-"+H)),c?m.jsxs("div",{className:"callout callout-highlight warning",children:[m.jsxs("div",{className:"callout-title",children:[m.jsx(ue.Icon,{"aria-hidden":!0,icon:"it-help-circle"}),i.t("Attenzione")]}),m.jsxs("p",{children:[" ",i.t("Non è possibile prenotare per la data selezionata"),"."]})]}):null]})}),m.jsx(ue.ModalFooter,{children:m.jsx(ue.Button,{color:"primary",onClick:()=>Ne(),disabled:!_||!g?.value_start,children:i.t("Conferma")})})]})]})};class wr extends Ci{constructor(s,u,i){super(s,u,i)}static get builderInfo(){return{title:"Calendar",group:"basic",icon:"bi bi-calendar-plus",documentation:"",weight:70,schema:wr.schema()}}static schema(){return Ci.schema({type:"calendar"})}static editForm=Ch;attach(s){return super.attach(s).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:"single"});const u=this.refs[`react-${this.id}`];return u?(this.rootComponent=Et.createRoot(u),this.rootComponent.render(m.jsx(jh,{component:this.component,value:this.dataValue,onChange:i=>this.setValue(i),...this,current:this})),this):this})}detach(){return this.rootComponent&&(this.rootComponent.unmount(),this.rootComponent=null),super.detach()}setValue(s){if(s)if(Array.isArray(s))this.selectedNextSlots=s,this.updateValue(s),this.shouldSetValue=!0;else if(typeof s=="object")this.date=s.date,this.slot=s.slot,this.meeting=s.meeting_id,this.meeting_expiration_time=null,this.opening_hour=s.opening_hour_id,this.calendar_id=s.calendar_id,this.updateValue(s),this.shouldSetValue=!0;else{let u=s.replace(")","").replace(" ("," @ ").replace(/\//g,"-").split(" @ "),i=u[2].split("#");this.date=u[0],this.slot=u[1],this.meeting=i[1],this.meeting_expiration_time=null,this.opening_hour=i.length===3?i[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 s=this.meeting?this.meeting:"",u=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:s,opening_hour_id:u}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}}const Th=[{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 = '"+Ee()+"'; data.url = url; value=url;",key:"url",type:"hidden",input:!0,weight:1}];function Ph(...l){return Bt.Components.baseEditForm([{key:"display",components:Th}],...l)}function Nh({day:l,slot:s,i18next:u}){return m.jsx("li",{className:"it-list-item",children:m.jsx("div",{className:"list-item",children:m.jsx("div",{className:"it-right-zone",children:m.jsxs("span",{className:"text-paragraph pl-4",children:[m.jsx("b",{children:l})," ",u.t("alle")," ",u.t("ore")," ",m.jsx("b",{children:s})]})})})})}function Rh(l,s){if(!s||s.length===0)return;const u=s.map(I=>{const o=new Date(I.start);return(new Date(I.end)-o)/6e4}),i=Math.min(...u),S=u.reduce((I,o)=>I+o,0)/u.length;let x=0;i<=30&&i>15?x=S*1:i<=15?x=S*24:x=S*4,l.setOption("slotHeight",x),document.documentElement.style.setProperty("--slot-height",`${x}px`)}const Us={AVAILABILITY:{key:"availability_data_cache_",duration:10},SLOTS:{key:"availability_slots_cache_",duration:10},SUBMISSION:{key:"submission_cache_",duration:30}},Xr=(l,s,u)=>{const i={data:u,timestamp:Se().toISOString()};sessionStorage.setItem(s,JSON.stringify(i)),console.log(`✅ Cache salvato: ${l}`)},Zr=(l,s)=>{try{const u=sessionStorage.getItem(s);if(!u)return null;const i=JSON.parse(u),S=Se().diff(Se(i.timestamp),"minutes");return S>Us[l].duration?(sessionStorage.removeItem(s),console.log(`⏰ Cache scaduto: ${l}`),null):(console.log(`✅ Cache letto: ${l} (${S} minuti fa)`),i.data)}catch(u){return console.error(`Errore nel leggere il cache (${l}):`,u),null}},Qr=(l,...s)=>Us[l].key+btoa(s),_n="calendar_view_state",bn="calendar_view_date",Eh=(l,s)=>{try{sessionStorage.setItem(_n,l),sessionStorage.setItem(bn,s||new Date().toISOString())}catch(u){console.error("Errore nel salvare lo stato della view:",u)}},Ah=()=>{try{const l=sessionStorage.getItem(_n),s=sessionStorage.getItem(bn);return{viewType:l||"timeGridWeek",date:s?new Date(s):new Date}}catch(l){return console.error("Errore nel leggere lo stato della view:",l),{viewType:"timeGridWeek",date:new Date}}},Gs=()=>{try{sessionStorage.removeItem(_n),sessionStorage.removeItem(bn)}catch(l){console.error("Errore nel pulire lo stato della view:",l)}},ji=Rt.Formio.Components.components.field,Ih=({component:l,current:s,onChange:u,i18next:i})=>{const[S,x]=G.useState(null),[I,o]=G.useState(null),[y,r]=G.useState([]),[c,h]=G.useState(!1),[f,p]=G.useState(!1),[g,Y]=G.useState(null),[_,k]=G.useState([]),[C,j]=G.useState([]),[F,R]=G.useState([]),[O,v]=G.useState(null),[T,w]=G.useState(null),[M,V]=G.useState(null),E=G.useRef(null),A=G.useRef(null);i.language,he.locale(i.language),Se.locale(i.language);function z($){if(!$||$.length===0)return null;const J=$.map(H=>({start:H.start_time,end:H.end_time})),X=J.reduce((H,N)=>N.start<H?N.start:H,J[0].start),P=J.reduce((H,N)=>N.end>H?N.end:H,J[0].end);return{earliestStartTime:X,latestEndTime:P}}function B($){const J=$.map(H=>he(H.date).isoWeekday()),P=[1,2,3,4,5,6,7].filter(H=>!J.includes(H));P.length>0?A.current.setOption("hiddenDays",P):A.current.setOption("hiddenDays",[])}function ee($,J,X){const P=new URL($),N=`${P.pathname.split("/").slice(0,4).join("/")}/${J}/${X}`;return`${P.origin}${N}${P.search}`}function ie($,J,X){const P=new URL($),N=`${P.pathname.split("/").slice(0,4).join("/")}`;return`${P.origin}${N}${P.search}&from_to=${J}&to_date=${X}`}function re($,J,X){return`${Ee()}/api/availabilities/${$}/${J}?calendar_ids=${X}&available=true`}const fe=$=>{R([]),j([]),u({}),$&&j(S.filter(J=>J.date.startsWith($)))},te=async($,J)=>{const X=JSON.parse($),P=Qr("SLOTS",X.date,X.calendar_ids);if(J==="manual")R([]),V(null),Y(null),u({});else{const H=Zr("SLOTS",P);if(H){R(H);return}}try{const H=await window.FormioHelper.anonymousCall(`availabilities/${X.date}?calendar_ids=${X.calendar_ids}`);Xr("SLOTS",P,H.data),R(H.data)}catch(H){console.error("Errore nel caricamento degli slot:",H),He.fire({icon:"error",title:i.t("Errore"),text:i.t("Errore nel caricamento degli orari")})}},de=$=>{const J=JSON.parse($),X={status:6,calendar:J.calendar_id,opening_hour:J.opening_hour_id,user:null,email:null,fiscal_code:null,name:" ",phone_number:null,from_time:Se(`${J.date}T${J.start_time}`).toISOString(),to_time:Se(`${J.date}T${J.end_time}`).toISOString(),user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:s?.data?.service_data?.id,calendar_group_office_id:s?.data?.user_group?.id,calendar_group_place_id:s?.data?.place?.id};window.FormioHelper.authenticatedRequest(s?.dataValue?.id?"PATCH":"POST",s?.dataValue?.id?`meetings/${s.dataValue.id}`:"meetings",X).then(P=>{Y({day:Se(J.date).format("dddd, DD MMMM YYYY"),startDate:J.start_time,endDate:J.end_time}),u(P?.id?P:P?{...P,id:s.dataValue.id}:s.dataValue.id?{...X,id:s.dataValue.id}:{...X})}).catch(P=>{console.error(P),P.status===400&&P?.response?.data?.type==="validation_error"?He.fire({title:"",html:"<p>"+i.t("Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa")+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1}):He.fire({title:"",html:"<p>"+P+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1})})},ve=$=>{const J=new Set,X=[];return $.forEach(P=>{const H=Se(P.date),N=H.format("YYYY-MM");J.has(N)||(J.add(N),X.push({value:N,label:H.format("MMMM YYYY").replace(/^\w/,W=>W.toUpperCase())}))}),X},me=async()=>{const $=s?.root?.data?.place?.merge_availabilities?s?.root?.data?.place?.merged_availabilities_link:null,J=he().format("YYYY-MM-DD"),X=he().add(1,"month").format("YYYY-MM-DD"),P=s?.root?.data?.place?.calendars[0]?.id||null,H=$?ie($,J,X):re(J,X,P),N=Qr("AVAILABILITY",H),W=Zr("AVAILABILITY",N);if(W){x(W),k(ve(W));return}else u({});h(!0);try{const q=await window.FormioHelper.fetchAPIUrlLimit(H);if(h(!1),!q?.length){He.fire({icon:"warning",title:i.t("warning"),html:i.t("no_meetings")});return}Xr("AVAILABILITY",N,q),x(q),k(ve(q))}catch(q){h(!1),console.error("Errore nel caricamento disponibilità:",q)}};G.useEffect(()=>{if(S?.length){const $=s?.dataValue??s?.getValue();if($?.from_time&&$?.to_time&&!Se().isAfter($?.draft_expiration)){const J=Se($.from_time).format("YYYY-MM");v(J),J&&j&&(j(S.filter(X=>X.date.startsWith(J))),w(Se($.from_time).format("YYYY-MM-DD")))}else $?.draft_expiration&&Se().isAfter($?.draft_expiration)&&He.fire({icon:"warning",title:i.t("warning"),html:i.t("expired_meeting")})}},[S]),G.useEffect(()=>{const $=s?.dataValue??s?.getValue();if(!_.length||O||$?.from_time||$?.to_time)return;const J=_[0];J&&(v(J.value),fe(J.value))},[_,O,s?.dataValue]),G.useEffect(()=>{if(T&&f===!1){const $=s?.dataValue??s?.getValue();te(JSON.stringify({date:T,calendar_ids:$.calendar.id}))}},[T]);const oe=()=>window.innerWidth>768?"timeGridWeek":"timeGridDay";G.useEffect(()=>{const $=()=>{const J=A.current;if(!J)return;const X=oe(),P=J.getView().type;X!==P&&J.setOption("view",X)};return window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)},[]),G.useEffect(()=>{const $=s?.dataValue??s?.getValue();F?.length&&$?.from_time&&(V(Se($.from_time).format("HH:mm")+" - "+Se($.to_time).format("HH:mm")),Y({day:Se($.from_time).format("dddd D MMM YYYY"),startDate:Se($.from_time).format("HH:mm"),endDate:Se($.to_time).format("HH:mm")}))},[F]);const Z=()=>{const $=Ah();A.current=ci.createCalendar(E.current,[ci.TimeGrid],{events:[],buttonText:{today:i.t("Oggi")},allDaySlot:!1,firstDay:1,date:$.date,slotEventOverlap:!1,view:oe(),height:"400px",views:{timeGridWeek:{allDaySlot:!1,firstDay:1,slotHeight:48},timeGridDay:{allDaySlot:!1,firstDay:1,slotHeight:48}},datesSet:J=>{Eh(J.view.type,J.start)},eventClick({event:J,el:X}){document.querySelectorAll(".ec-event").forEach(se=>{se.classList.remove("highlighted-event")}),X.classList.add("highlighted-event");const P=new Date(J.start),H=new Date(J.end),N=P.toLocaleDateString("it-IT",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),W=P.toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit"}),q=H.toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit"}),ce={status:6,calendar:J.extendedProps.calendar_id,opening_hour:J.extendedProps.opening_hour_id,user:null,email:null,fiscal_code:null,name:" ",phone_number:null,from_time:P,to_time:H,user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:s?.data?.service_data?.id,calendar_group_office_id:s?.data?.user_group?.id,calendar_group_place_id:s?.data?.place?.id};window.FormioHelper.authenticatedRequest(s?.dataValue?.id?"PATCH":"POST",s?.dataValue?.id?`meetings/${s.dataValue.id}`:"meetings",ce).then(se=>{let Pe;!se||se===""?Pe={...ce,code:null,id:s?.dataValue?.id}:typeof se=="object"&&(Pe=se),Y({day:N,startDate:W,endDate:q}),u(Pe)}).catch(se=>{console.error(se),se.status===400&&se?.response?.data?.type==="validation_error"?He.fire({title:"",html:"<p>"+i.t("Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa")+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1}):He.fire({title:"",html:"<p>"+se+"</p>",icon:"error",cancelButtonText:i.t("Chiudi"),showCancelButton:!0,showConfirmButton:!1})})},viewDidMount:Ne,eventDidMount:J=>{const{event:X,el:P}=J,H=X.extendedProps;P.setAttribute("data-event-id",X.id+"-"+H.date+"-"+H.start_time)},loading:J=>{h(J)}})},Ne=$=>{s?.root?.data?.place&&A.current.setOption("eventSources",[{events:Ie}])};async function Ie($,J,X){try{A.current.setOption("events",[]);const P=he($.start).format("YYYY-MM-DD"),H=new Date($.end);H.setDate(H.getDate()-1);const N=he(H).format("YYYY-MM-DD"),W=null,q=s?.root?.data?.place?.merge_availabilities?s?.root?.data?.place?.merged_availabilities_link:null,ce=q?ee(q,P,N):re(P,N,W),se=Qr("AVAILABILITY",ce),Pe=Zr("AVAILABILITY",se);let ge;if(Pe?(ge=Pe,h(!1)):(ge=await window.FormioHelper.fetchAPIUrlLimit(ce),Xr("AVAILABILITY",se,ge)),!ge?.length){J([]),He.fire({icon:"warning",title:i.t("warning"),html:i.t("no_meetings")});return}const _e=ge.map(Re=>({id:Re.opening_hour_id,allDay:!1,start:`${Re.date}T${Re.start_time}:00`,end:`${Re.date}T${Re.end_time}:00`,title:`${Re.start_time} - ${Re.end_time}`,editable:!1,display:"auto",color:"#ebeef0",textColor:"#000",className:"event-slot",extendedProps:{...Re}})),$e=z(ge);A.current.setOption("slotMinTime",$e.earliestStartTime),A.current.setOption("slotMaxTime",$e.latestEndTime),B(ge),Rh(A.current,_e),J(_e),setTimeout(()=>{Ce(_e)},500)}catch(P){console.error("Errore nel caricamento disponibilità:",P),X?.(P)}}G.useEffect(()=>{let $,J=!1;async function X(){try{if(await window.FormioInstance?.formReady,J)return;if(!E.current){console.warn("Elemento calendario non trovato");return}const P=s?.dataValue??s?.getValue();P&&P?.draft_expiration&&Se().isAfter(P.draft_expiration)&&(u({}),Gs()),s?.data?.service_data?.view_type==="calendar"?A?.current||Z():s?.data?.service_data?.view_type==="select"?me():alert(i.t("Il componente non è configurato per la visualizzazione a calendario"))}catch(P){console.error("Errore durante l'inizializzazione del calendario:",P)}}return $=setTimeout(X,500),()=>{J=!0,$&&clearTimeout($),A.current&&(E.current?.destroy?.(),A.current=null)}},[s?.root?.data?.place]);function Ce($){const J=s?.dataValue;if(!J?.from_time)return;const X=Se(J.from_time).format("DD-MM-YYYY HH:mm"),P=Se(J.to_time).format("DD-MM-YYYY HH:mm"),H=$.find(W=>Se(W.start).format("DD-MM-YYYY HH:mm")===X&&Se(W.end).format("DD-MM-YYYY HH:mm")===P);if(!H)return;const N=document.querySelector(`.ec-event[data-event-id="${H.id}-${Se(J?.from_time).format("YYYY-MM-DD")}-${Se(J?.from_time).format("HH:mm")}"]`);N&&(N.classList.add("highlighted-event"),N.scrollIntoView({behavior:"smooth",block:"center"}),Y({day:Se(J?.from_time).format("dddd, DD MMMM YYYY"),startDate:Se(J?.from_time).format("HH:mm"),endDate:Se(J?.to_time).format("HH:mm")}))}const Oe=({day:$,startDate:J,endDate:X})=>m.jsx("div",{className:"mt-3",children:m.jsxs("div",{className:"row align-items-center gy-3",children:[m.jsxs("div",{className:"col-12 col-md border-light mx-md-3",children:[m.jsx("div",{className:"text-paragraph-small",children:i.t("Data")}),m.jsx("p",{className:"data-text",children:m.jsx("strong",{children:$})})]}),m.jsxs("div",{className:"col-12 col-md border-light mx-md-3",children:[m.jsx("div",{className:"text-paragraph-small",children:i.t("Ora")}),m.jsx("p",{className:"data-text",children:m.jsxs("strong",{children:[J," - ",X]})})]})]})});return G.useEffect(()=>{document.querySelector(".formio-read-only")&&f===!1?p(!0):(s?.data?.service_data?.view_type==="select"?me():s?.data?.service_data?.view_type==="calendar"&&Z(),p(!1))},[]),G.useEffect(()=>{f&&setTimeout(()=>{const $=s?.dataValue??s?.getValue();console.log("savedValue",$,f),$&&o($)},500)},[f]),m.jsx(m.Fragment,{children:f&&I?m.jsxs("div",{className:"mx-2",children:[m.jsxs("p",{className:"text-paragraph",children:[i.t("Giorno selezionato per la prenotazione"),":"]}),m.jsx("div",{className:"",children:m.jsx("div",{className:"it-list-wrapper",children:m.jsx("ul",{className:"it-list",children:m.jsx(Nh,{day:Se(I.from_time).format("dddd D MMM YYYY"),i18next:i,slot:`${Se(I.from_time).format("HH:mm")} - ${Se(I.to_time).format("HH:mm")}`})})})})]}):m.jsxs("div",{className:"",children:[m.jsx("div",{ref:E}),_.length>0?m.jsxs(m.Fragment,{children:[m.jsxs(ue.Select,{label:"Mese",id:"selectMonthYear",onChange:fe,children:[m.jsx("option",{value:"",children:i.t("Scegli un'opzione")}),_.map($=>m.jsx("option",{value:$.value,selected:$.value===O,children:$.label},$.value))]}),m.jsxs(ue.Select,{label:"Giorno",id:"selectDay",onChange:$=>te($,"manual"),disabled:C.length===0,children:[m.jsx("option",{value:"",children:i.t("Scegli un'opzione")}),C.map($=>m.jsx("option",{value:JSON.stringify($),selected:$.date===T,children:Se($.date).format("dddd,DD MMMM YYYY")},$.date))]}),m.jsxs(ue.Select,{label:"Orario",id:"selectSlot",onChange:de,disabled:F.length===0,children:[m.jsx("option",{value:"",children:i.t("Scegli un'opzione")}),F.map($=>m.jsx("option",{value:JSON.stringify($),selected:$.start_time+" - "+$.end_time===M,children:$.start_time+" - "+$.end_time},$.start_time+" - "+$.end_time))]})]}):null,g?Oe({day:g.day,startDate:g.startDate,endDate:g.endDate}):null,c?m.jsx("div",{className:"d-flex align-items-center justify-content-center position-absolute-center",children:m.jsx(ue.Spinner,{active:!0})}):null]})})};class Sr extends ji{constructor(s,u,i){super(s,u,i)}static get builderInfo(){return{title:"Calendar Advanced",group:"basic",icon:"bi bi-calendar-plus",documentation:"",weight:70,schema:Sr.schema()}}static schema(){return ji.schema({type:"calendar-advanced"})}static editForm=Ph;attach(s,u){this.rootComponent=Et.createRoot(s),this.rootComponent.render(m.jsx(Ih,{ref:u,component:this.component,value:this.dataValue,onChange:i=>this.setValue(i),...this,current:this}))}setValue(s){s&&(this.updateValue(s),this.shouldSetValue=!0)}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}}const Fh=[{key:"defaultValue",ignore:!0}],Vh=[{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"]]}}}],zh=[{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:`{
|
|
80
80
|
"withCredentials": true,
|
|
81
81
|
"headers": {
|
|
82
82
|
"Authorization": "Basic <key>"
|