andoncloud-workplaces-state-timelines-widget 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,371 @@
1
- var e=require("react"),t=require("andoncloud-dashboard-toolkit"),n=require("andoncloud-widget-base"),r=require("react-i18next"),i=require("@mui/lab"),s=require("@mui/material"),a=require("@mui/material/styles");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/o(e);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(null,arguments)}var c="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function d(e){var t=e.prototype.toJSON;"function"==typeof t||function(){if(!Boolean(0))throw new Error("Unexpected invariant triggered.")}(),e.prototype.inspect=t,c&&(e.prototype[c]=t)}function h(e){return null!=e&&"string"==typeof e.kind}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function m(e){return p(e,[])}function p(e,t){switch(f(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var n=[].concat(t,[e]),r=function(e){var t=e[String(c)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==r){var i=r.call(e);if(i!==e)return"string"==typeof i?i:p(i,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,i=[],s=0;s<n;++s)i.push(p(e[s],t));return 1===r?i.push("... 1 more item"):r>1&&i.push("... ".concat(r," more items")),"["+i.join(", ")+"]"}(e,n);return function(e,t){var n=Object.keys(e);return 0===n.length?"{}":t.length>2?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return t}(e)+"]":"{ "+n.map(function(n){return n+": "+p(e[n],t)}).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}d(/*#__PURE__*/function(){function e(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}()),d(/*#__PURE__*/function(){function e(e,t,n,r,i,s,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=s,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}());var y={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},g=Object.freeze({});function v(e,t,n){var r=e[t];if(r){if(!n&&"function"==typeof r)return r;var i=n?r.leave:r.enter;if("function"==typeof i)return i}else{var s=n?e.leave:e.enter;if(s){if("function"==typeof s)return s;var a=s[t];if("function"==typeof a)return a}}}var _={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return b(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=k("(",b(e.variableDefinitions,", "),")"),i=b(e.directives," "),s=e.selectionSet;return n||i||r||"query"!==t?b([t,b([n,r]),i,s]," "):s},VariableDefinition:function(e){var t=e.directives;return e.variable+": "+e.type+k(" = ",e.defaultValue)+k(" ",b(t," "))},SelectionSet:function(e){return x(e.selections)},Field:function(e){var t=e.name,n=e.arguments,r=e.directives,i=e.selectionSet,s=k("",e.alias,": ")+t,a=s+k("(",b(n,", "),")");return a.length>80&&(a=s+k("(\n",S(b(n,"\n")),"\n)")),b([a,b(r," "),i]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+k(" ",b(e.directives," "))},InlineFragment:function(e){var t=e.directives,n=e.selectionSet;return b(["...",k("on ",e.typeCondition),b(t," "),n]," ")},FragmentDefinition:function(e){var t=e.typeCondition,n=e.variableDefinitions,r=e.directives,i=e.selectionSet;return"fragment ".concat(e.name).concat(k("(",b(n,", "),")")," ")+"on ".concat(t," ").concat(k("",b(r," ")," "))+i},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),i=!r||'"'===e[e.length-1]||"\\"===e[e.length-1]||n,s="";return!i||r&&(" "===e[0]||"\t"===e[0])||(s+="\n"+t),s+=t?e.replace(/\n/g,"\n"+t):e,i&&(s+="\n"),'"""'+s.replace(/"""/g,'\\"""')+'"""'}(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+b(e.values,", ")+"]"},ObjectValue:function(e){return"{"+b(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+k("(",b(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:w(function(e){var t=e.operationTypes;return b(["schema",b(e.directives," "),x(t)]," ")}),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:w(function(e){return b(["scalar",e.name,b(e.directives," ")]," ")}),ObjectTypeDefinition:w(function(e){var t=e.directives,n=e.fields;return b(["type",e.name,k("implements ",b(e.interfaces," & ")),b(t," "),x(n)]," ")}),FieldDefinition:w(function(e){var t=e.arguments,n=e.type,r=e.directives;return e.name+(O(t)?k("(\n",S(b(t,"\n")),"\n)"):k("(",b(t,", "),")"))+": "+n+k(" ",b(r," "))}),InputValueDefinition:w(function(e){var t=e.directives;return b([e.name+": "+e.type,k("= ",e.defaultValue),b(t," ")]," ")}),InterfaceTypeDefinition:w(function(e){var t=e.directives,n=e.fields;return b(["interface",e.name,k("implements ",b(e.interfaces," & ")),b(t," "),x(n)]," ")}),UnionTypeDefinition:w(function(e){var t=e.types;return b(["union",e.name,b(e.directives," "),t&&0!==t.length?"= "+b(t," | "):""]," ")}),EnumTypeDefinition:w(function(e){var t=e.values;return b(["enum",e.name,b(e.directives," "),x(t)]," ")}),EnumValueDefinition:w(function(e){return b([e.name,b(e.directives," ")]," ")}),InputObjectTypeDefinition:w(function(e){var t=e.fields;return b(["input",e.name,b(e.directives," "),x(t)]," ")}),DirectiveDefinition:w(function(e){var t=e.arguments,n=e.repeatable,r=e.locations;return"directive @"+e.name+(O(t)?k("(\n",S(b(t,"\n")),"\n)"):k("(",b(t,", "),")"))+(n?" repeatable":"")+" on "+b(r," | ")}),SchemaExtension:function(e){var t=e.operationTypes;return b(["extend schema",b(e.directives," "),x(t)]," ")},ScalarTypeExtension:function(e){return b(["extend scalar",e.name,b(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.directives,n=e.fields;return b(["extend type",e.name,k("implements ",b(e.interfaces," & ")),b(t," "),x(n)]," ")},InterfaceTypeExtension:function(e){var t=e.directives,n=e.fields;return b(["extend interface",e.name,k("implements ",b(e.interfaces," & ")),b(t," "),x(n)]," ")},UnionTypeExtension:function(e){var t=e.types;return b(["extend union",e.name,b(e.directives," "),t&&0!==t.length?"= "+b(t," | "):""]," ")},EnumTypeExtension:function(e){var t=e.values;return b(["extend enum",e.name,b(e.directives," "),x(t)]," ")},InputObjectTypeExtension:function(e){var t=e.fields;return b(["extend input",e.name,b(e.directives," "),x(t)]," ")}};function w(e){return function(t){return b([t.description,e(t)],"\n")}}function b(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter(function(e){return e}).join(n))&&void 0!==t?t:""}function x(e){return k("{\n",S(b(e,"\n")),"\n}")}function k(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function S(e){return k(" ",e.replace(/\n/g,"\n "))}function D(e){return-1!==e.indexOf("\n")}function O(e){return null!=e&&e.some(D)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var T,M,Y=(T=function(e,t){e.exports=function(){var t,n;function r(){return t.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(a(e,t))return!1;return!0}function u(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var n,r=[],i=e.length;for(n=0;n<i;++n)r.push(t(e[n],n));return r}function h(e,t){for(var n in t)a(t,n)&&(e[n]=t[n]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,n,r){return Nt(e,t,n,r,!0).utc()}function m(e){return null==e._pf&&(e._pf={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}),e._pf}function p(e){var t=null,r=!1,i=e._d&&!isNaN(e._d.getTime());return i&&(t=m(e),r=n.call(t.parsedDateParts,function(e){return null!=e}),i=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&r),e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?i:(e._isValid=i,e._isValid)}function y(e){var t=f(NaN);return null!=e?h(m(t),e):m(t).userInvalidated=!0,t}n=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var g=r.momentProperties=[],v=!1;function _(e,t){var n,r,i,s=g.length;if(u(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),u(t._i)||(e._i=t._i),u(t._f)||(e._f=t._f),u(t._l)||(e._l=t._l),u(t._strict)||(e._strict=t._strict),u(t._tzm)||(e._tzm=t._tzm),u(t._isUTC)||(e._isUTC=t._isUTC),u(t._offset)||(e._offset=t._offset),u(t._pf)||(e._pf=m(t)),u(t._locale)||(e._locale=t._locale),s>0)for(n=0;n<s;n++)u(i=t[r=g[n]])||(e[r]=i);return e}function w(e){_(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===v&&(v=!0,r.updateOffset(this),v=!1)}function b(e){return e instanceof w||null!=e&&null!=e._isAMomentObject}function x(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var n=!0;return h(function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var i,s,o,u=[],l=arguments.length;for(s=0;s<l;s++){if(i="","object"==typeof arguments[s]){for(o in i+="\n["+s+"] ",arguments[0])a(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[s];u.push(i)}x(e+"\nArguments: "+Array.prototype.slice.call(u).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var S,D={};function O(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),D[e]||(x(t),D[e]=!0)}function T(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function M(e,t){var n,r=h({},e);for(n in t)a(t,n)&&(s(e[n])&&s(t[n])?(r[n]={},h(r[n],e[n]),h(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)a(e,n)&&!a(t,n)&&s(e[n])&&(r[n]=h({},r[n]));return r}function Y(e){null!=e&&this.set(e)}function E(e,t,n){var r=""+Math.abs(e);return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-r.length)).toString().substr(1)+r}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)a(e,t)&&n.push(t);return n};var F=/(\[[^\[]*\])|(\\)?([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,C=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,N={},A={};function j(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(A[e]=i),t&&(A[t[0]]=function(){return E(i.apply(this,arguments),t[1],t[2])}),n&&(A[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function P(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function $(e,t){return e.isValid()?(t=V(t,e.localeData()),N[t]=N[t]||function(e){var t,n,r=e.match(F);for(t=0,n=r.length;t<n;t++)r[t]=A[r[t]]?A[r[t]]:P(r[t]);return function(t){var i,s="";for(i=0;i<n;i++)s+=T(r[i])?r[i].call(t,e):r[i];return s}}(t),N[t](e)):e.localeData().invalidDate()}function V(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(C.lastIndex=0;n>=0&&C.test(e);)e=e.replace(C,r),C.lastIndex=0,n-=1;return e}var R={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 W(e){return"string"==typeof e?R[e]||R[e.toLowerCase()]:void 0}function U(e){var t,n,r={};for(n in e)a(e,n)&&(t=W(n))&&(r[t]=e[n]);return r}var I,L={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},H=/\d/,z=/\d\d/,G=/\d{3}/,q=/\d{4}/,Z=/[+-]?\d{6}/,B=/\d\d?/,J=/\d\d\d\d?/,Q=/\d\d\d\d\d\d?/,K=/\d{1,3}/,X=/\d{1,4}/,ee=/[+-]?\d{1,6}/,te=/\d+/,ne=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,ie=/Z|[+-]\d\d(?::?\d\d)?/gi,se=/[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,ae=/^[1-9]\d?/,oe=/^([1-9]\d|\d)/;function ue(e,t,n){I[e]=T(t)?t:function(e,r){return e&&n?n:t}}function le(e,t){return a(I,e)?I[e](t._strict,t._locale):new RegExp(ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i})))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function de(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function he(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=de(t)),n}I={};var fe={};function me(e,t){var n,r,i=t;for("string"==typeof e&&(e=[e]),l(t)&&(i=function(e,n){n[t]=he(e)}),r=e.length,n=0;n<r;n++)fe[e[n]]=i}function pe(e,t){me(e,function(e,n,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function ye(e,t,n){null!=t&&a(fe,e)&&fe[e](t,n._a,n,e)}function ge(e){return e%4==0&&e%100!=0||e%400==0}var ve=0,_e=1,we=2,be=3,xe=4,ke=5,Se=6,De=7,Oe=8;function Te(e){return ge(e)?366:365}j("Y",0,0,function(){var e=this.year();return e<=9999?E(e,4):"+"+e}),j(0,["YY",2],0,function(){return this.year()%100}),j(0,["YYYY",4],0,"year"),j(0,["YYYYY",5],0,"year"),j(0,["YYYYYY",6,!0],0,"year"),ue("Y",ne),ue("YY",B,z),ue("YYYY",X,q),ue("YYYYY",ee,Z),ue("YYYYYY",ee,Z),me(["YYYYY","YYYYYY"],ve),me("YYYY",function(e,t){t[ve]=2===e.length?r.parseTwoDigitYear(e):he(e)}),me("YY",function(e,t){t[ve]=r.parseTwoDigitYear(e)}),me("Y",function(e,t){t[ve]=parseInt(e,10)}),r.parseTwoDigitYear=function(e){return he(e)+(he(e)>68?1900:2e3)};var Me,Ye=Ee("FullYear",!0);function Ee(e,t){return function(n){return null!=n?(Ce(this,e,n),r.updateOffset(this,t),this):Fe(this,e)}}function Fe(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ce(e,t,n){var r,i,s,a,o;if(e.isValid()&&!isNaN(n)){switch(r=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}s=n,a=e.month(),o=29!==(o=e.date())||1!==a||ge(s)?o:28,i?r.setUTCFullYear(s,a,o):r.setFullYear(s,a,o)}}function Ne(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=(t%12+12)%12;return e+=(t-n)/12,1===n?ge(e)?29:28:31-n%7%2}Me=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},j("M",["MM",2],"Mo",function(){return this.month()+1}),j("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),j("MMMM",0,0,function(e){return this.localeData().months(this,e)}),ue("M",B,ae),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[_e]=he(e)-1}),me(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);null!=i?t[_e]=i:m(n).invalidMonth=e});var Ae="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),je="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Pe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,$e=se,Ve=se;function Re(e,t,n){var r,i,s,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)s=f([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(s,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Me.call(this._shortMonthsParse,a))?i:null:-1!==(i=Me.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Me.call(this._shortMonthsParse,a))||-1!==(i=Me.call(this._longMonthsParse,a))?i:null:-1!==(i=Me.call(this._longMonthsParse,a))||-1!==(i=Me.call(this._shortMonthsParse,a))?i:null}function We(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=he(t);else if(!l(t=e.localeData().monthsParse(t)))return e;var n=t,r=e.date();return r=r<29?r:Math.min(r,Ne(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Ue(e){return null!=e?(We(this,e),r.updateOffset(this,!0),this):Fe(this,"Month")}function Ie(){function e(e,t){return t.length-e.length}var t,n,r,i,s=[],a=[],o=[];for(t=0;t<12;t++)n=f([2e3,t]),r=ce(this.monthsShort(n,"")),i=ce(this.months(n,"")),s.push(r),a.push(i),o.push(i),o.push(r);s.sort(e),a.sort(e),o.sort(e),this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Le(e,t,n,r,i,s,a){var o;return e<100&&e>=0?(o=new Date(e+400,t,n,r,i,s,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,r,i,s,a),o}function He(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ze(e,t,n){var r=7+t-n;return-(7+He(e,0,r).getUTCDay()-t)%7+r-1}function Ge(e,t,n,r,i){var s,a,o=1+7*(t-1)+(7+n-r)%7+ze(e,r,i);return o<=0?a=Te(s=e-1)+o:o>Te(e)?(s=e+1,a=o-Te(e)):(s=e,a=o),{year:s,dayOfYear:a}}function qe(e,t,n){var r,i,s=ze(e.year(),t,n),a=Math.floor((e.dayOfYear()-s-1)/7)+1;return a<1?r=a+Ze(i=e.year()-1,t,n):a>Ze(e.year(),t,n)?(r=a-Ze(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function Ze(e,t,n){var r=ze(e,t,n),i=ze(e+1,t,n);return(Te(e)-r+i)/7}function Be(e,t){return e.slice(t,7).concat(e.slice(0,t))}j("w",["ww",2],"wo","week"),j("W",["WW",2],"Wo","isoWeek"),ue("w",B,ae),ue("ww",B,z),ue("W",B,ae),ue("WW",B,z),pe(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=he(e)}),j("d",0,"do","day"),j("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),j("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),j("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),j("e",0,0,"weekday"),j("E",0,0,"isoWeekday"),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),pe(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:m(n).invalidWeekday=e}),pe(["d","e","E"],function(e,t,n,r){t[r]=he(e)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Xe=se,et=se,tt=se;function nt(e,t,n){var r,i,s,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)s=f([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(s,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Me.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Me.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Me.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Me.call(this._weekdaysParse,a))||-1!==(i=Me.call(this._shortWeekdaysParse,a))||-1!==(i=Me.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Me.call(this._shortWeekdaysParse,a))||-1!==(i=Me.call(this._weekdaysParse,a))||-1!==(i=Me.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Me.call(this._minWeekdaysParse,a))||-1!==(i=Me.call(this._weekdaysParse,a))||-1!==(i=Me.call(this._shortWeekdaysParse,a))?i:null}function rt(){function e(e,t){return t.length-e.length}var t,n,r,i,s,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=f([2e3,1]).day(t),r=ce(this.weekdaysMin(n,"")),i=ce(this.weekdaysShort(n,"")),s=ce(this.weekdays(n,"")),a.push(r),o.push(i),u.push(s),l.push(r),l.push(i),l.push(s);a.sort(e),o.sort(e),u.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function it(){return this.hours()%12||12}function st(e,t){j(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function at(e,t){return t._meridiemParse}j("H",["HH",2],0,"hour"),j("h",["hh",2],0,it),j("k",["kk",2],0,function(){return this.hours()||24}),j("hmm",0,0,function(){return""+it.apply(this)+E(this.minutes(),2)}),j("hmmss",0,0,function(){return""+it.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)}),j("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)}),j("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)}),st("a",!0),st("A",!1),ue("a",at),ue("A",at),ue("H",B,oe),ue("h",B,ae),ue("k",B,ae),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",J),ue("hmmss",Q),ue("Hmm",J),ue("Hmmss",Q),me(["H","HH"],be),me(["k","kk"],function(e,t,n){var r=he(e);t[be]=24===r?0:r}),me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),me(["h","hh"],function(e,t,n){t[be]=he(e),m(n).bigHour=!0}),me("hmm",function(e,t,n){var r=e.length-2;t[be]=he(e.substr(0,r)),t[xe]=he(e.substr(r)),m(n).bigHour=!0}),me("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[be]=he(e.substr(0,r)),t[xe]=he(e.substr(r,2)),t[ke]=he(e.substr(i)),m(n).bigHour=!0}),me("Hmm",function(e,t,n){var r=e.length-2;t[be]=he(e.substr(0,r)),t[xe]=he(e.substr(r))}),me("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[be]=he(e.substr(0,r)),t[xe]=he(e.substr(r,2)),t[ke]=he(e.substr(i))});var ot,ut=Ee("Hours",!0),lt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,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",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ae,monthsShort:je,week:{dow:0,doy:6},weekdays:Je,weekdaysMin:Ke,weekdaysShort:Qe,meridiemParse:/[ap]\.?m?\.?/i},ct={},dt={};function ht(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function ft(e){return e?e.toLowerCase().replace("_","-"):e}function mt(t){var n=null;if(void 0===ct[t]&&e&&e.exports&&function(e){return!(!e||!e.match("^[^/\\\\]*$"))}(t))try{n=ot._abbr,function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}("./locale/"+t),pt(n)}catch(e){ct[t]=null}return ct[t]}function pt(e,t){var n;return e&&((n=u(t)?gt(e):yt(e,t))?ot=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ot._abbr}function yt(e,t){if(null!==t){var n,r=lt;if(t.abbr=e,null!=ct[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ct[e]._config;else if(null!=t.parentLocale)if(null!=ct[t.parentLocale])r=ct[t.parentLocale]._config;else{if(null==(n=mt(t.parentLocale)))return dt[t.parentLocale]||(dt[t.parentLocale]=[]),dt[t.parentLocale].push({name:e,config:t}),null;r=n._config}return ct[e]=new Y(M(r,t)),dt[e]&&dt[e].forEach(function(e){yt(e.name,e.config)}),pt(e),ct[e]}return delete ct[e],null}function gt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ot;if(!i(e)){if(t=mt(e))return t;e=[e]}return function(e){for(var t,n,r,i,s=0;s<e.length;){for(t=(i=ft(e[s]).split("-")).length,n=(n=ft(e[s+1]))?n.split("-"):null;t>0;){if(r=mt(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&ht(i,n)>=t-1)break;t--}s++}return ot}(e)}function vt(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[_e]<0||n[_e]>11?_e:n[we]<1||n[we]>Ne(n[ve],n[_e])?we:n[be]<0||n[be]>24||24===n[be]&&(0!==n[xe]||0!==n[ke]||0!==n[Se])?be:n[xe]<0||n[xe]>59?xe:n[ke]<0||n[ke]>59?ke:n[Se]<0||n[Se]>999?Se:-1,m(e)._overflowDayOfYear&&(t<ve||t>we)&&(t=we),m(e)._overflowWeeks&&-1===t&&(t=De),m(e)._overflowWeekday&&-1===t&&(t=Oe),m(e).overflow=t),e}var _t=/^\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)?)?$/,wt=/^\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)?)?$/,bt=/Z|[+-]\d\d(?::?\d\d)?/,xt=[["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]],kt=[["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/]],St=/^\/?Date\((-?\d+)/i,Dt=/^(?:(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}))$/,Ot={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tt(e){var t,n,r,i,s,a,o=e._i,u=_t.exec(o)||wt.exec(o),l=xt.length,c=kt.length;if(u){for(m(e).iso=!0,t=0,n=l;t<n;t++)if(xt[t][1].exec(u[1])){i=xt[t][0],r=!1!==xt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=c;t<n;t++)if(kt[t][1].exec(u[3])){s=(u[2]||" ")+kt[t][0];break}if(null==s)return void(e._isValid=!1)}if(!r&&null!=s)return void(e._isValid=!1);if(u[4]){if(!bt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(s||"")+(a||""),Ft(e)}else e._isValid=!1}function Mt(e){var t,n,r,i,s,a,o,u,l,c=Dt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(c){if(n=c[3],r=c[2],i=c[5],s=c[6],a=c[7],o=[(u=c[4],l=parseInt(u,10),l<=49?2e3+l:l<=999?1900+l:l),je.indexOf(n),parseInt(r,10),parseInt(i,10),parseInt(s,10)],a&&o.push(parseInt(a,10)),!function(e,t,n){return!e||Qe.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(m(n).weekdayMismatch=!0,n._isValid=!1,!1)}(c[1],t=o,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return Ot[e];if(t)return 0;var r=parseInt(n,10),i=r%100;return(r-i)/100*60+i}(c[8],c[9],c[10]),e._d=He.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0}else e._isValid=!1}function Yt(e,t,n){return null!=e?e:null!=t?t:n}function Et(e){var t,n,i,s,a,o=[];if(!e._d){for(i=function(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[we]&&null==e._a[_e]&&function(e){var t,n,r,i,s,a,o,u,l;null!=(t=e._w).GG||null!=t.W||null!=t.E?(s=1,a=4,n=Yt(t.GG,e._a[ve],qe(At(),1,4).year),r=Yt(t.W,1),((i=Yt(t.E,1))<1||i>7)&&(u=!0)):(s=e._locale._week.dow,a=e._locale._week.doy,l=qe(At(),s,a),n=Yt(t.gg,e._a[ve],l.year),r=Yt(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+s,(t.e<0||t.e>6)&&(u=!0)):i=s),r<1||r>Ze(n,s,a)?m(e)._overflowWeeks=!0:null!=u?m(e)._overflowWeekday=!0:(o=Ge(n,r,i,s,a),e._a[ve]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(a=Yt(e._a[ve],i[ve]),(e._dayOfYear>Te(a)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=He(a,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[we]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=i[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[be]&&0===e._a[xe]&&0===e._a[ke]&&0===e._a[Se]&&(e._nextDay=!0,e._a[be]=0),e._d=(e._useUTC?He:Le).apply(null,o),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[be]=24),e._w&&void 0!==e._w.d&&e._w.d!==s&&(m(e).weekdayMismatch=!0)}}function Ft(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,n,i,s,a,o,u,l=""+e._i,c=l.length,d=0;for(u=(i=V(e._f,e._locale).match(F)||[]).length,t=0;t<u;t++)(n=(l.match(le(s=i[t],e))||[])[0])&&((a=l.substr(0,l.indexOf(n))).length>0&&m(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),d+=n.length),A[s]?(n?m(e).empty=!1:m(e).unusedTokens.push(s),ye(s,n,e)):e._strict&&!n&&m(e).unusedTokens.push(s);m(e).charsLeftOver=c-d,l.length>0&&m(e).unusedInput.push(l),e._a[be]<=12&&!0===m(e).bigHour&&e._a[be]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[be]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[be],e._meridiem),null!==(o=m(e).era)&&(e._a[ve]=e._locale.erasConvertYear(o,e._a[ve])),Et(e),vt(e)}else Mt(e);else Tt(e)}function Ct(e){var t=e._i,n=e._f;return e._locale=e._locale||gt(e._l),null===t||void 0===n&&""===t?y({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),b(t)?new w(vt(t)):(c(t)?e._d=t:i(n)?function(e){var t,n,r,i,s,a,o=!1,u=e._f.length;if(0===u)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<u;i++)s=0,a=!1,t=_({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Ft(t),p(t)&&(a=!0),s+=m(t).charsLeftOver,s+=10*m(t).unusedTokens.length,m(t).score=s,o?s<r&&(r=s,n=t):(null==r||s<r||a)&&(r=s,n=t,a&&(o=!0));h(e,n||t)}(e):n?Ft(e):function(e){var t=e._i;u(t)?e._d=new Date(r.now()):c(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=St.exec(e._i);null===t?(Tt(e),!1===e._isValid&&(delete e._isValid,Mt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):i(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),Et(e)):s(t)?function(e){if(!e._d){var t=U(e._i);e._a=d([t.year,t.month,void 0===t.day?t.date:t.day,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Et(e)}}(e):l(t)?e._d=new Date(t):r.createFromInputFallback(e)}(e),p(e)||(e._d=null),e))}function Nt(e,t,n,r,a){var u,l={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(s(e)&&o(e)||i(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=n,l._i=e,l._f=t,l._strict=r,(u=new w(vt(Ct(l))))._nextDay&&(u.add(1,"d"),u._nextDay=void 0),u}function At(e,t,n,r){return Nt(e,t,n,r,!1)}r.createFromInputFallback=k("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":""))}),r.ISO_8601=function(){},r.RFC_2822=function(){};var jt=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=At.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:y()}),Pt=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=At.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:y()});function $t(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return At();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var Vt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Rt(e){var t=U(e),n=t.year||0,r=t.quarter||0,i=t.month||0,s=t.week||t.isoWeek||0,o=t.day||0,u=t.hour||0,l=t.minute||0,c=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,n,r=!1,i=Vt.length;for(t in e)if(a(e,t)&&(-1===Me.call(Vt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<i;++n)if(e[Vt[n]]){if(r)return!1;parseFloat(e[Vt[n]])!==he(e[Vt[n]])&&(r=!0)}return!0}(t),this._milliseconds=+d+1e3*c+6e4*l+1e3*u*60*60,this._days=+o+7*s,this._months=+i+3*r+12*n,this._data={},this._locale=gt(),this._bubble()}function Wt(e){return e instanceof Rt}function Ut(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function It(e,t){j(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+E(~~(e/60),2)+t+E(~~e%60,2)})}It("Z",":"),It("ZZ",""),ue("Z",ie),ue("ZZ",ie),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ht(ie,e)});var Lt=/([\+\-]|\d\d)/gi;function Ht(e,t){var n,r,i=(t||"").match(e);return null===i?null:0===(r=60*(n=((i[i.length-1]||[])+"").match(Lt)||["-",0,0])[1]+he(n[2]))?0:"+"===n[0]?r:-r}function zt(e,t){var n,i;return t._isUTC?(n=t.clone(),i=(b(e)||c(e)?e.valueOf():At(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),r.updateOffset(n,!1),n):At(e).local()}function Gt(e){return-Math.round(e._d.getTimezoneOffset())}function qt(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Zt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Bt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Jt(e,t){var n,r,i,s,o,u,c=e,d=null;return Wt(e)?c={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(c={},t?c[t]=+e:c.milliseconds=+e):(d=Zt.exec(e))?(n="-"===d[1]?-1:1,c={y:0,d:he(d[we])*n,h:he(d[be])*n,m:he(d[xe])*n,s:he(d[ke])*n,ms:he(Ut(1e3*d[Se]))*n}):(d=Bt.exec(e))?c={y:Qt(d[2],n="-"===d[1]?-1:1),M:Qt(d[3],n),w:Qt(d[4],n),d:Qt(d[5],n),h:Qt(d[6],n),m:Qt(d[7],n),s:Qt(d[8],n)}:null==c?c={}:"object"==typeof c&&("from"in c||"to"in c)&&(s=At(c.from),o=At(c.to),i=s.isValid()&&o.isValid()?(o=zt(o,s),s.isBefore(o)?u=Kt(s,o):((u=Kt(o,s)).milliseconds=-u.milliseconds,u.months=-u.months),u):{milliseconds:0,months:0},(c={}).ms=i.milliseconds,c.M=i.months),r=new Rt(c),Wt(e)&&a(e,"_locale")&&(r._locale=e._locale),Wt(e)&&a(e,"_isValid")&&(r._isValid=e._isValid),r}function Qt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Kt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Xt(e,t){return function(n,r){var i;return null===r||isNaN(+r)||(O(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."),i=n,n=r,r=i),en(this,Jt(n,r),e),this}}function en(e,t,n,i){var s=t._milliseconds,a=Ut(t._days),o=Ut(t._months);e.isValid()&&(i=null==i||i,o&&We(e,Fe(e,"Month")+o*n),a&&Ce(e,"Date",Fe(e,"Date")+a*n),s&&e._d.setTime(e._d.valueOf()+s*n),i&&r.updateOffset(e,a||o))}Jt.fn=Rt.prototype,Jt.invalid=function(){return Jt(NaN)};var tn=Xt(1,"add"),nn=Xt(-1,"subtract");function rn(e){return"string"==typeof e||e instanceof String}function sn(e,t){if(e.date()<t.date())return-sn(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function an(e){var t;return void 0===e?this._locale._abbr:(null!=(t=gt(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var on=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function un(){return this._locale}var ln=1e3,cn=6e4,dn=36e5,hn=126227808e5;function fn(e,t){return(e%t+t)%t}function mn(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-hn:new Date(e,t,n).valueOf()}function pn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hn:Date.UTC(e,t,n)}function yn(e,t){return t.erasAbbrRegex(e)}function gn(){var e,t,n,r,i,s=[],a=[],o=[],u=[],l=this.eras();for(e=0,t=l.length;e<t;++e)n=ce(l[e].name),r=ce(l[e].abbr),i=ce(l[e].narrow),a.push(n),s.push(r),o.push(i),u.push(n),u.push(r),u.push(i);this._erasRegex=new RegExp("^("+u.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+a.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+o.join("|")+")","i")}function vn(e,t){j(0,[e,e.length],0,t)}function _n(e,t,n,r,i){var s;return null==e?qe(this,r,i).year:(t>(s=Ze(e,r,i))&&(t=s),wn.call(this,e,t,n,r,i))}function wn(e,t,n,r,i){var s=Ge(e,t,n,r,i),a=He(s.year,0,s.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}j("N",0,0,"eraAbbr"),j("NN",0,0,"eraAbbr"),j("NNN",0,0,"eraAbbr"),j("NNNN",0,0,"eraName"),j("NNNNN",0,0,"eraNarrow"),j("y",["y",1],"yo","eraYear"),j("y",["yy",2],0,"eraYear"),j("y",["yyy",3],0,"eraYear"),j("y",["yyyy",4],0,"eraYear"),ue("N",yn),ue("NN",yn),ue("NNN",yn),ue("NNNN",function(e,t){return t.erasNameRegex(e)}),ue("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?m(n).era=i:m(n).invalidEra=e}),ue("y",te),ue("yy",te),ue("yyy",te),ue("yyyy",te),ue("yo",function(e,t){return t._eraYearOrdinalRegex||te}),me(["y","yy","yyy","yyyy"],ve),me(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),t[ve]=n._locale.eraYearOrdinalParse?n._locale.eraYearOrdinalParse(e,i):parseInt(e,10)}),j(0,["gg",2],0,function(){return this.weekYear()%100}),j(0,["GG",2],0,function(){return this.isoWeekYear()%100}),vn("gggg","weekYear"),vn("ggggg","weekYear"),vn("GGGG","isoWeekYear"),vn("GGGGG","isoWeekYear"),ue("G",ne),ue("g",ne),ue("GG",B,z),ue("gg",B,z),ue("GGGG",X,q),ue("gggg",X,q),ue("GGGGG",ee,Z),ue("ggggg",ee,Z),pe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=he(e)}),pe(["gg","GG"],function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)}),j("Q",0,"Qo","quarter"),ue("Q",H),me("Q",function(e,t){t[_e]=3*(he(e)-1)}),j("D",["DD",2],"Do","date"),ue("D",B,ae),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],we),me("Do",function(e,t){t[we]=he(e.match(B)[0])});var bn=Ee("Date",!0);j("DDD",["DDDD",3],"DDDo","dayOfYear"),ue("DDD",K),ue("DDDD",G),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=he(e)}),j("m",["mm",2],0,"minute"),ue("m",B,oe),ue("mm",B,z),me(["m","mm"],xe);var xn=Ee("Minutes",!1);j("s",["ss",2],0,"second"),ue("s",B,oe),ue("ss",B,z),me(["s","ss"],ke);var kn,Sn,Dn=Ee("Seconds",!1);for(j("S",0,0,function(){return~~(this.millisecond()/100)}),j(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),j(0,["SSS",3],0,"millisecond"),j(0,["SSSS",4],0,function(){return 10*this.millisecond()}),j(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),j(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),j(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),j(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),j(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),ue("S",K,H),ue("SS",K,z),ue("SSS",K,G),kn="SSSS";kn.length<=9;kn+="S")ue(kn,te);function On(e,t){t[Se]=he(1e3*("0."+e))}for(kn="S";kn.length<=9;kn+="S")me(kn,On);Sn=Ee("Milliseconds",!1),j("z",0,0,"zoneAbbr"),j("zz",0,0,"zoneName");var Tn=w.prototype;function Mn(e){return e}Tn.add=tn,Tn.calendar=function(e,t){var n;1===arguments.length&&(arguments[0]?b(n=arguments[0])||c(n)||rn(n)||l(n)||function(e){var t=i(e),n=!1;return t&&(n=0===e.filter(function(t){return!l(t)&&rn(e)}).length),t&&n}(n)||function(e){var t,n=s(e)&&!o(e),r=!1,i=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],u=i.length;for(t=0;t<u;t+=1)r=r||a(e,i[t]);return n&&r}(n)||null==n?(e=arguments[0],t=void 0):function(e){var t,n=s(e)&&!o(e),r=!1,i=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<i.length;t+=1)r=r||a(e,i[t]);return n&&r}(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var u=e||At(),d=zt(u,this).startOf("day"),h=r.calendarFormat(this,d)||"sameElse",f=t&&(T(t[h])?t[h].call(this,u):t[h]);return this.format(f||this.localeData().calendar(h,this,At(u)))},Tn.clone=function(){return new w(this)},Tn.diff=function(e,t,n){var r,i,s;if(!this.isValid())return NaN;if(!(r=zt(e,this)).isValid())return NaN;switch(i=6e4*(r.utcOffset()-this.utcOffset()),t=W(t)){case"year":s=sn(this,r)/12;break;case"month":s=sn(this,r);break;case"quarter":s=sn(this,r)/3;break;case"second":s=(this-r)/1e3;break;case"minute":s=(this-r)/6e4;break;case"hour":s=(this-r)/36e5;break;case"day":s=(this-r-i)/864e5;break;case"week":s=(this-r-i)/6048e5;break;default:s=this-r}return n?s:de(s)},Tn.endOf=function(e){var t,n;if(void 0===(e=W(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?pn:mn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=dn-fn(t+(this._isUTC?0:this.utcOffset()*cn),dn)-1;break;case"minute":t=this._d.valueOf(),t+=cn-fn(t,cn)-1;break;case"second":t=this._d.valueOf(),t+=ln-fn(t,ln)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},Tn.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=$(this,e);return this.localeData().postformat(t)},Tn.from=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||At(e).isValid())?Jt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Tn.fromNow=function(e){return this.from(At(),e)},Tn.to=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||At(e).isValid())?Jt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Tn.toNow=function(e){return this.to(At(),e)},Tn.get=function(e){return T(this[e=W(e)])?this[e]():this},Tn.invalidAt=function(){return m(this).overflow},Tn.isAfter=function(e,t){var n=b(e)?e:At(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=W(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},Tn.isBefore=function(e,t){var n=b(e)?e:At(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=W(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},Tn.isBetween=function(e,t,n,r){var i=b(e)?e:At(e),s=b(t)?t:At(t);return!!(this.isValid()&&i.isValid()&&s.isValid())&&("("===(r=r||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===r[1]?this.isBefore(s,n):!this.isAfter(s,n))},Tn.isSame=function(e,t){var n,r=b(e)?e:At(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=W(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},Tn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Tn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Tn.isValid=function(){return p(this)},Tn.lang=on,Tn.locale=an,Tn.localeData=un,Tn.max=Pt,Tn.min=jt,Tn.parsingFlags=function(){return h({},m(this))},Tn.set=function(e,t){if("object"==typeof e){var n,r=function(e){var t,n=[];for(t in e)a(e,t)&&n.push({unit:t,priority:L[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=U(e)),i=r.length;for(n=0;n<i;n++)this[r[n].unit](e[r[n].unit])}else if(T(this[e=W(e)]))return this[e](t);return this},Tn.startOf=function(e){var t,n;if(void 0===(e=W(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?pn:mn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fn(t+(this._isUTC?0:this.utcOffset()*cn),dn);break;case"minute":t=this._d.valueOf(),t-=fn(t,cn);break;case"second":t=this._d.valueOf(),t-=fn(t,ln)}return this._d.setTime(t),r.updateOffset(this,!0),this},Tn.subtract=nn,Tn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Tn.toObject=function(){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()}},Tn.toDate=function(){return new Date(this.valueOf())},Tn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?$(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",$(n,"Z")):$(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Tn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n="moment",r="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+r+'[")]')},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Tn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Tn.toJSON=function(){return this.isValid()?this.toISOString():null},Tn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Tn.unix=function(){return Math.floor(this.valueOf()/1e3)},Tn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Tn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Tn.eraName=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].name;if(r[e].until<=n&&n<=r[e].since)return r[e].name}return""},Tn.eraNarrow=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].narrow;if(r[e].until<=n&&n<=r[e].since)return r[e].narrow}return""},Tn.eraAbbr=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].abbr;if(r[e].until<=n&&n<=r[e].since)return r[e].abbr}return""},Tn.eraYear=function(){var e,t,n,i,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(n=s[e].since<=s[e].until?1:-1,i=this.clone().startOf("day").valueOf(),s[e].since<=i&&i<=s[e].until||s[e].until<=i&&i<=s[e].since)return(this.year()-r(s[e].since).year())*n+s[e].offset;return this.year()},Tn.year=Ye,Tn.isLeapYear=function(){return ge(this.year())},Tn.weekYear=function(e){return _n.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},Tn.isoWeekYear=function(e){return _n.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Tn.quarter=Tn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Tn.month=Ue,Tn.daysInMonth=function(){return Ne(this.year(),this.month())},Tn.week=Tn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Tn.isoWeek=Tn.isoWeeks=function(e){var t=qe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Tn.weeksInYear=function(){var e=this.localeData()._week;return Ze(this.year(),e.dow,e.doy)},Tn.weeksInWeekYear=function(){var e=this.localeData()._week;return Ze(this.weekYear(),e.dow,e.doy)},Tn.isoWeeksInYear=function(){return Ze(this.year(),1,4)},Tn.isoWeeksInISOWeekYear=function(){return Ze(this.isoWeekYear(),1,4)},Tn.date=bn,Tn.day=Tn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=Fe(this,"Day");return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},Tn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},Tn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},Tn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},Tn.hour=Tn.hours=ut,Tn.minute=Tn.minutes=xn,Tn.second=Tn.seconds=Dn,Tn.millisecond=Tn.milliseconds=Sn,Tn.utcOffset=function(e,t,n){var i,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Ht(ie,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(i=Gt(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==e&&(!t||this._changeInProgress?en(this,Jt(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:Gt(this)},Tn.utc=function(e){return this.utcOffset(0,e)},Tn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),"m")),this},Tn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Ht(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Tn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?At(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Tn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Tn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Tn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Tn.isUtc=qt,Tn.isUTC=qt,Tn.zoneAbbr=function(){return this._isUTC?"UTC":""},Tn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Tn.dates=k("dates accessor is deprecated. Use date instead.",bn),Tn.months=k("months accessor is deprecated. Use month instead",Ue),Tn.years=k("years accessor is deprecated. Use year instead",Ye),Tn.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),Tn.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return _(t,this),(t=Ct(t))._a?(e=t._isUTC?f(t._a):At(t._a),this._isDSTShifted=this.isValid()&&function(e,t){var n,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0;for(n=0;n<r;n++)he(e[n])!==he(t[n])&&s++;return s+i}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var Yn=Y.prototype;function En(e,t,n,r){var i=gt(),s=f().set(r,t);return i[n](s,e)}function Fn(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return En(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=En(e,r,n,"month");return i}function Cn(e,t,n,r){"boolean"==typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var i,s=gt(),a=e?s._week.dow:0,o=[];if(null!=n)return En(t,(n+a)%7,r,"day");for(i=0;i<7;i++)o[i]=En(t,(i+a)%7,r,"day");return o}Yn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return T(r)?r.call(t,n):r},Yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(F).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},Yn.invalidDate=function(){return this._invalidDate},Yn.ordinal=function(e){return this._ordinal.replace("%d",e)},Yn.preparse=Mn,Yn.postformat=Mn,Yn.relativeTime=function(e,t,n,r){var i=this._relativeTime[n];return T(i)?i(e,t,n,r):i.replace(/%d/i,e)},Yn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return T(n)?n(t):n.replace(/%s/i,t)},Yn.set=function(e){var t,n;for(n in e)a(e,n)&&(T(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Yn.eras=function(e,t){var n,i,s,a=this._eras||gt("en")._eras;for(n=0,i=a.length;n<i;++n)switch("string"==typeof a[n].since&&(s=r(a[n].since).startOf("day"),a[n].since=s.valueOf()),typeof a[n].until){case"undefined":a[n].until=Infinity;break;case"string":s=r(a[n].until).startOf("day").valueOf(),a[n].until=s.valueOf()}return a},Yn.erasParse=function(e,t,n){var r,i,s,a,o,u=this.eras();for(e=e.toUpperCase(),r=0,i=u.length;r<i;++r)if(s=u[r].name.toUpperCase(),a=u[r].abbr.toUpperCase(),o=u[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[r];break;case"NNNN":if(s===e)return u[r];break;case"NNNNN":if(o===e)return u[r]}else if([s,a,o].indexOf(e)>=0)return u[r]},Yn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},Yn.erasAbbrRegex=function(e){return a(this,"_erasAbbrRegex")||gn.call(this),e?this._erasAbbrRegex:this._erasRegex},Yn.erasNameRegex=function(e){return a(this,"_erasNameRegex")||gn.call(this),e?this._erasNameRegex:this._erasRegex},Yn.erasNarrowRegex=function(e){return a(this,"_erasNarrowRegex")||gn.call(this),e?this._erasNarrowRegex:this._erasRegex},Yn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pe).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},Yn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pe.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Yn.monthsParse=function(e,t,n){var r,i,s;if(this._monthsParseExact)return Re.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=f([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(s.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},Yn.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ie.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=Ve),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Yn.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ie.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=$e),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},Yn.week=function(e){return qe(e,this._week.dow,this._week.doy).week},Yn.firstDayOfYear=function(){return this._week.doy},Yn.firstDayOfWeek=function(){return this._week.dow},Yn.weekdays=function(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Be(n,this._week.dow):e?n[e.day()]:n},Yn.weekdaysMin=function(e){return!0===e?Be(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Yn.weekdaysShort=function(e){return!0===e?Be(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Yn.weekdaysParse=function(e,t,n){var r,i,s;if(this._weekdaysParseExact)return nt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=f([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(s.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},Yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||rt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Yn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},pt("en",{eras:[{since:"0001-01-01",until:Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-Infinity,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===he(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=k("moment.lang is deprecated. Use moment.locale instead.",pt),r.langData=k("moment.langData is deprecated. Use moment.localeData instead.",gt);var Nn=Math.abs;function An(e,t,n,r){var i=Jt(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function jn(e){return e<0?Math.floor(e):Math.ceil(e)}function Pn(e){return 4800*e/146097}function $n(e){return 146097*e/4800}function Vn(e){return function(){return this.as(e)}}var Rn=Vn("ms"),Wn=Vn("s"),Un=Vn("m"),In=Vn("h"),Ln=Vn("d"),Hn=Vn("w"),zn=Vn("M"),Gn=Vn("Q"),qn=Vn("y"),Zn=Rn;function Bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Jn=Bn("milliseconds"),Qn=Bn("seconds"),Kn=Bn("minutes"),Xn=Bn("hours"),er=Bn("days"),tr=Bn("months"),nr=Bn("years"),rr=Math.round,ir={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function sr(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}var ar=Math.abs;function or(e){return(e>0)-(e<0)||+e}function ur(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,s,a,o,u=ar(this._milliseconds)/1e3,l=ar(this._days),c=ar(this._months),d=this.asSeconds();return d?(e=de(u/60),t=de(e/60),u%=60,e%=60,n=de(c/12),c%=12,r=u?u.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",s=or(this._months)!==or(d)?"-":"",a=or(this._days)!==or(d)?"-":"",o=or(this._milliseconds)!==or(d)?"-":"",i+"P"+(n?s+n+"Y":"")+(c?s+c+"M":"")+(l?a+l+"D":"")+(t||e||u?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(u?o+r+"S":"")):"P0D"}var lr=Rt.prototype;return lr.isValid=function(){return this._isValid},lr.abs=function(){var e=this._data;return this._milliseconds=Nn(this._milliseconds),this._days=Nn(this._days),this._months=Nn(this._months),e.milliseconds=Nn(e.milliseconds),e.seconds=Nn(e.seconds),e.minutes=Nn(e.minutes),e.hours=Nn(e.hours),e.months=Nn(e.months),e.years=Nn(e.years),this},lr.add=function(e,t){return An(this,e,t,1)},lr.subtract=function(e,t){return An(this,e,t,-1)},lr.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=W(e))||"quarter"===e||"year"===e)switch(n=this._months+Pn(t=this._days+r/864e5),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round($n(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},lr.asMilliseconds=Rn,lr.asSeconds=Wn,lr.asMinutes=Un,lr.asHours=In,lr.asDays=Ln,lr.asWeeks=Hn,lr.asMonths=zn,lr.asQuarters=Gn,lr.asYears=qn,lr.valueOf=Zn,lr._bubble=function(){var e,t,n,r,i,s=this._milliseconds,a=this._days,o=this._months,u=this._data;return s>=0&&a>=0&&o>=0||s<=0&&a<=0&&o<=0||(s+=864e5*jn($n(o)+a),a=0,o=0),u.milliseconds=s%1e3,e=de(s/1e3),u.seconds=e%60,t=de(e/60),u.minutes=t%60,n=de(t/60),u.hours=n%24,a+=de(n/24),o+=i=de(Pn(a)),a-=jn($n(i)),r=de(o/12),o%=12,u.days=a,u.months=o,u.years=r,this},lr.clone=function(){return Jt(this)},lr.get=function(e){return e=W(e),this.isValid()?this[e+"s"]():NaN},lr.milliseconds=Jn,lr.seconds=Qn,lr.minutes=Kn,lr.hours=Xn,lr.days=er,lr.weeks=function(){return de(this.days()/7)},lr.months=tr,lr.years=nr,lr.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,s=ir;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(s=Object.assign({},ir,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),r=function(e,t,n,r){var i=Jt(e).abs(),s=rr(i.as("s")),a=rr(i.as("m")),o=rr(i.as("h")),u=rr(i.as("d")),l=rr(i.as("M")),c=rr(i.as("w")),d=rr(i.as("y")),h=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||a<=1&&["m"]||a<n.m&&["mm",a]||o<=1&&["h"]||o<n.h&&["hh",o]||u<=1&&["d"]||u<n.d&&["dd",u];return null!=n.w&&(h=h||c<=1&&["w"]||c<n.w&&["ww",c]),(h=h||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=t,h[3]=+e>0,h[4]=r,sr.apply(null,h)}(this,!i,s,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)},lr.toISOString=ur,lr.toString=ur,lr.toJSON=ur,lr.locale=an,lr.localeData=un,lr.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ur),lr.lang=on,j("X",0,0,"unix"),j("x",0,0,"valueOf"),ue("x",ne),ue("X",/[+-]?\d+(\.\d{1,3})?/),me("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),me("x",function(e,t,n){n._d=new Date(he(e))}),r.version="2.30.1",t=At,r.fn=Tn,r.min=function(){return $t("isBefore",[].slice.call(arguments,0))},r.max=function(){return $t("isAfter",[].slice.call(arguments,0))},r.now=function(){return Date.now?Date.now():+new Date},r.utc=f,r.unix=function(e){return At(1e3*e)},r.months=function(e,t){return Fn(e,t,"months")},r.isDate=c,r.locale=pt,r.invalid=y,r.duration=Jt,r.isMoment=b,r.weekdays=function(e,t,n){return Cn(e,t,n,"weekdays")},r.parseZone=function(){return At.apply(null,arguments).parseZone()},r.localeData=gt,r.isDuration=Wt,r.monthsShort=function(e,t){return Fn(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return Cn(e,t,n,"weekdaysMin")},r.defineLocale=yt,r.updateLocale=function(e,t){if(null!=t){var n,r,i=lt;null!=ct[e]&&null!=ct[e].parentLocale?ct[e].set(M(ct[e]._config,t)):(null!=(r=mt(e))&&(i=r._config),t=M(i,t),null==r&&(t.abbr=e),(n=new Y(t)).parentLocale=ct[e],ct[e]=n),pt(e)}else null!=ct[e]&&(null!=ct[e].parentLocale?(ct[e]=ct[e].parentLocale,e===pt()&&pt(e)):null!=ct[e]&&delete ct[e]);return ct[e]},r.locales=function(){return S(ct)},r.weekdaysShort=function(e,t,n){return Cn(e,t,n,"weekdaysShort")},r.normalizeUnits=W,r.relativeTimeRounding=function(e){return void 0===e?rr:"function"==typeof e&&(rr=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==ir[e]&&(void 0===t?ir[e]:(ir[e]=t,"s"===e&&(ir.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=Tn,r.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"},r}()},T(M={exports:{}}),M.exports),E={en:{translation:{Loading:"Loading",Workplaces:"Workplaces","Select and arrange the order":"Select and arrange the order",Cancel:"Cancel",Save:"Save","History timeline time info now":"now",Settings:"Settings"}},pl:{translation:{Loading:"Wczytywanie",Workplaces:"Stanowiska","Select and arrange the order":"Wybierz i ustal kolejność",Cancel:"Anuluj",Save:"Zapisz","History timeline time info now":"teraz",Settings:"Ustawienia"}}},F="1.2.4",C=function(n){var a,o=n.data,l=n.formProps,c=e.useState("1"),d=c[0],h=c[1],f=r.useTranslation().t;return u.default.createElement(u.default.Fragment,null,u.default.createElement(i.TabContext,{value:d},u.default.createElement(s.Box,{sx:{borderBottom:1,borderColor:"divider"}},u.default.createElement(i.TabList,{onChange:function(e,t){h(t)}},u.default.createElement(s.Tab,{label:f("Workplaces"),value:"1"}))),u.default.createElement(i.TabPanel,{value:"1"},u.default.createElement(t.SortableSelect,{placeholder:f("Select and arrange the order")+"...",options:null==(a=o.workplaces)?void 0:a.map(function(e){return{label:e.name,value:e.id}}),selected:l.values.workplacesIds,onChange:function(e){return l.setFieldValue("workplacesIds",[].concat(e))}}))))},N=function(e,t,n){var r=e.startedAt.isAfter(t.startedAt)?e.startedAt:Y(t.startedAt);return r&&t.finishedAt?Math.abs(r.diff(Y(t.finishedAt),"seconds")):Math.abs(Y(n).diff(r,"seconds"))},A=function(e){switch(e){case"green":return"#2ACB42";case"red":return"#FF453A";case"yellow":return"#FFC12F";default:return"#525860"}},j=function(){return j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},j.apply(this,arguments)},P=function(t){var n=t.animate,r=void 0===n||n,i=t.backgroundColor,s=void 0===i?"#f5f6f7":i,a=t.backgroundOpacity,o=void 0===a?1:a,u=t.baseUrl,l=void 0===u?"":u,c=t.children,d=t.foregroundColor,h=void 0===d?"#eee":d,f=t.foregroundOpacity,m=void 0===f?1:f,p=t.gradientRatio,y=void 0===p?2:p,g=t.uniqueKey,v=t.rtl,_=void 0!==v&&v,w=t.speed,b=void 0===w?1.2:w,x=t.style,k=void 0===x?{}:x,S=t.title,D=void 0===S?"Loading...":S,O=t.beforeMask,T=void 0===O?null:O,M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["animate","backgroundColor","backgroundOpacity","baseUrl","children","foregroundColor","foregroundOpacity","gradientRatio","uniqueKey","rtl","speed","style","title","beforeMask"]),Y=g||Math.random().toString(36).substring(6),E="".concat(Y,"-diff"),F="".concat(Y,"-animated-diff"),C="".concat(Y,"-aria"),N=_?{transform:"scaleX(-1)"}:null,A="".concat(b,"s"),P="".concat(-1*y," 0"),$="".concat(y," 0");return e.createElement("svg",j({"aria-labelledby":C,role:"img",style:j(j({},k),N)},M),D?e.createElement("title",{id:C},D):null,T&&e.isValidElement(T)?T:null,e.createElement("rect",{role:"presentation",x:"0",y:"0",width:"100%",height:"100%",clipPath:"url(".concat(l,"#").concat(E,")"),style:{fill:"url(".concat(l,"#").concat(F,")")}}),e.createElement("defs",null,e.createElement("clipPath",{id:E},c),e.createElement("linearGradient",{id:F,gradientTransform:"translate(".concat(P,")")},e.createElement("stop",{offset:"0%",stopColor:s,stopOpacity:o}),e.createElement("stop",{offset:"50%",stopColor:h,stopOpacity:m}),e.createElement("stop",{offset:"100%",stopColor:s,stopOpacity:o}),r&&e.createElement("animateTransform",{attributeName:"gradientTransform",type:"translate",values:"".concat(P,"; 0 0; ").concat($),dur:A,repeatCount:"indefinite"}))))},$=function(t){return e.createElement(t.children?P:V,j({},t))},V=function(t){return e.createElement($,j({viewBox:"0 0 476 124"},t),e.createElement("rect",{x:"48",y:"8",width:"88",height:"6",rx:"3"}),e.createElement("rect",{x:"48",y:"26",width:"52",height:"6",rx:"3"}),e.createElement("rect",{x:"0",y:"56",width:"410",height:"6",rx:"3"}),e.createElement("rect",{x:"0",y:"72",width:"380",height:"6",rx:"3"}),e.createElement("rect",{x:"0",y:"88",width:"178",height:"6",rx:"3"}),e.createElement("circle",{cx:"20",cy:"20",r:"20"}))},R=$,W=function(){return u.default.createElement(R,{"data-testid":"timeline-loading",height:"28",width:"100%",speed:1.5,backgroundColor:"#3d3d3d",foregroundColor:"#ffffff"},u.default.createElement("rect",{x:"4%",y:"10",ry:"6",width:"92%",height:"14"}))},U=a.styled("div")({display:"flex",flexGrow:1,alignItems:"center",padding:"10px 0",background:"#252A32","&:nth-of-type(2n)":{background:"#30353d"}}),I=a.styled("div")({display:"flex",margin:"6px 0",zIndex:3,flexDirection:"row",height:"20px",width:"100%",overflow:"hidden",borderRadius:"4px",backgroundColor:"rgba(0, 0, 0, 0.2)"});a.styled("div")({display:"flex",alignItems:"center",justifyContent:"space-between"});var L=a.styled("span")({margin:"0 1.5em",fontSize:"12px",fontWeight:500,lineHeight:"12px",color:"rgba(255, 255, 255, 0.5)"}),H=a.styled("div")(function(e){return{flexBasis:e.percentWidth+"%",flexShrink:0,backgroundColor:A(e.color),"&:first-of-type":{borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}}}),z=function(t){var n=t.title,r=t.shift,i=t.statusChanges,a=t.loading,o=e.useState([]),l=o[0],c=o[1],d=e.useCallback(function(){return r?Math.abs(r.startedAt.diff(r.finishedAt,"seconds")):0},[r]),h=e.useCallback(function(e){var t=Y(e.startedAt),n=e.finishedAt?Y(e.finishedAt):null;return!!r&&(t.isBetween(r.startedAt,r.finishedAt)||(null==n?void 0:n.isBetween(r.startedAt,r.finishedAt))||t.isBefore(r.startedAt)&&!n)},[r]),f=e.useState(function(){return d()}),m=f[0],p=f[1];return e.useEffect(function(){p(d())},[r,d]),e.useEffect(function(){c(i.filter(function(e){return h(e)}))},[i,h]),a?u.default.createElement(W,null):u.default.createElement(U,null,u.default.createElement(s.Typography,{sx:{display:n?"block":"none",flexBasis:"25%",marginLeft:"20px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"white"}},n),r&&u.default.createElement(u.default.Fragment,null,u.default.createElement(L,null,r.startedAt.format("HH:mm")),u.default.createElement(I,{"data-testid":"timeline"},null==l?void 0:l.map(function(e){return e.reason.statusColor&&u.default.createElement(H,{"data-testid":"timeline-element-"+e.id+"-color-"+e.reason.statusColor,key:""+e.id+e.author.id,color:e.reason.statusColor,percentWidth:Math.min(N(r,e,new Date)/m*100,100)})})),u.default.createElement(L,null,r.finishedAt.format("HH:mm"))))},G=function(n){var r=n.data,i=n.settings,a=e.useState(null),o=a[0],l=a[1],c=function(e){var t,n,s=r.workplaces;return 1===(null==i||null==(t=i.workplacesIds)?void 0:t.length)?"":(null==s||null==(n=s.find(function(t){return t.id===e}))?void 0:n.name)||""};return e.useEffect(function(){var e=function(){var e=Y();l(t.getCurrentShift(e,t.normalizeShifts((null==r?void 0:r.shifts)||[],e)))},n=setInterval(function(){return e()},1e4);return e(),function(){clearInterval(n)}},[null==r?void 0:r.shifts]),u.default.createElement(s.Box,{display:"flex",flexDirection:"column",height:"100%"},null==i?void 0:i.workplacesIds.map(function(e){var t;return u.default.createElement(z,{key:e,title:c(e),shift:o,statusChanges:(null==(t=r.statusChanges)?void 0:t.filter(function(t){return t.workplaceId===e}))||[],loading:void 0===r})}))};function q(e){this._maxSize=e,this.clear()}q.prototype.clear=function(){this._size=0,this._values=Object.create(null)},q.prototype.get=function(e){return this._values[e]},q.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var Z=/[^.^\]^[]+|(?=\[\]|\.\.)/g,B=/^\d+$/,J=/^\d/,Q=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,K=/^\s*(['"]?)(.*?)(\1)\s*$/,X=new q(512),ee=new q(512),te=new q(512),ne={Cache:q,split:ie,normalizePath:re,setter:function(e){var t=re(e);return ee.get(e)||ee.set(e,function(e,n){for(var r=0,i=t.length,s=e;r<i-1;){var a=t[r];if("__proto__"===a||"constructor"===a||"prototype"===a)return e;s=s[t[r++]]}s[t[r]]=n})},getter:function(e,t){var n=re(e);return te.get(e)||te.set(e,function(e){for(var r=0,i=n.length;r<i;){if(null==e&&t)return;e=e[n[r++]]}return e})},join:function(e){return e.reduce(function(e,t){return e+(se(t)||B.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(e,t,n){!function(e,t,n){var r,i,s,a,o=e.length;for(i=0;i<o;i++)(r=e[i])&&(ae(r)&&(r='"'+r+'"'),s=!(a=se(r))&&/^\d+$/.test(r),t.call(n,r,a,s,i,e))}(Array.isArray(e)?e:ie(e),t,n)}};function re(e){return X.get(e)||X.set(e,ie(e).map(function(e){return e.replace(K,"$2")}))}function ie(e){return e.match(Z)||[""]}function se(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function ae(e){return!se(e)&&(function(e){return e.match(J)&&!e.match(B)}(e)||function(e){return Q.test(e)}(e))}const oe=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,ue=e=>e.match(oe)||[];var le=e=>ue(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),ce=e=>(e=>ue(e).join("_").toLowerCase())(e),de=function(e){return he(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}(e),e)};function he(e,t){var n=e.length,r=new Array(n),i={},s=n,a=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),o=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach(function(e){if(!o.has(e[0])||!o.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(e[s],s,new Set);return r;function u(e,t,s){if(s.has(e)){var l;try{l=", node was:"+JSON.stringify(e)}catch(e){l=""}throw new Error("Cyclic dependency"+l)}if(!o.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var c=a.get(e)||new Set;if(t=(c=Array.from(c)).length){s.add(e);do{var d=c[--t];u(d,o.get(d),s)}while(t);s.delete(e)}r[--n]=e}}}de.array=he;const fe=Object.prototype.toString,me=Error.prototype.toString,pe=RegExp.prototype.toString,ye="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",ge=/^Symbol\((.*)\)(.*)$/;function ve(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return ye.call(e).replace(ge,"Symbol($1)");const r=fe.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+me.call(e)+"]":"RegExp"===r?pe.call(e):null}function _e(e,t){let n=ve(e,t);return null!==n?n:JSON.stringify(e,function(e,n){let r=ve(this[e],t);return null!==r?r:n},2)}function we(e){return null==e?[]:[].concat(e)}let be,xe,ke,Se=/\$\{\s*(\w+)\s*\}/g;be=Symbol.toStringTag;class De{constructor(e,t,n,r){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[be]="Error",this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],we(e).forEach(e=>{Oe.isError(e)?(this.errors.push(...e.errors),this.inner.push(...e.inner.length?e.inner:[e])):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}xe=Symbol.hasInstance,ke=Symbol.toStringTag;class Oe extends Error{static formatError(e,t){return t=Object.assign({},t,{path:t.label||t.path||"this",originalPath:t.path}),"string"==typeof e?e.replace(Se,(e,n)=>_e(t[n])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r,i){const s=new De(e,t,n,r);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[ke]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}static[xe](e){return De[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Te={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=null!=r&&r!==n?` (cast from the value \`${_e(r,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${_e(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${_e(n,!0)}\``+i}},Me={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ye={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ee={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Fe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},Ce={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${_e(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${_e(n,!0)}\``}return Oe.formatError(Te.notType,e)}};var Ne=Object.assign(Object.create(null),{mixed:Te,string:Me,number:{min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date:Ye,object:Ee,array:Fe,boolean:{isValue:"${path} field must be ${value}"},tuple:Ce});const Ae=e=>e&&e.__isYupSchema__;class je{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,s="function"==typeof n?n:(...e)=>e.every(e=>e===n);return new je(e,(e,t)=>{var n;let a=s(...e)?r:i;return null!=(n=null==a?void 0:a(t))?n:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let n=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),r=this.fn(n,e,t);if(void 0===r||r===e)return e;if(!Ae(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}class Pe{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext="$"===this.key[0],this.isValue="."===this.key[0],this.isSibling=!this.isContext&&!this.isValue,this.path=this.key.slice((this.isContext?"$":this.isValue?".":"").length),this.getter=this.path&&ne.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Pe.prototype.__isYupRef=!0;const $e=e=>null==e;function Ve(e){function t({value:t,path:n="",options:r,originalValue:i,schema:s},a,o){const{name:u,test:l,params:c,message:d,skipAbsent:h}=e;let{parent:f,context:m,abortEarly:p=s.spec.abortEarly,disableStackTrace:y=s.spec.disableStackTrace}=r;const g={value:t,parent:f,context:m};function v(e={}){const r=Re(Object.assign({value:t,originalValue:i,label:s.spec.label,path:e.path||n,spec:s.spec,disableStackTrace:e.disableStackTrace||y},c,e.params),g),a=new Oe(Oe.formatError(e.message||d,r),t,r.path,e.type||u,r.disableStackTrace);return a.params=r,a}const _=p?a:o;let w={path:n,parent:f,type:u,from:r.from,createError:v,resolve:e=>We(e,g),options:r,originalValue:i,schema:s};const b=e=>{Oe.isError(e)?_(e):e?o(null):_(v())},x=e=>{Oe.isError(e)?_(e):a(e)};if(h&&$e(t))return b(!0);let k;try{var S;if(k=l.call(w,t,w),"function"==typeof(null==(S=k)?void 0:S.then)){if(r.sync)throw new Error(`Validation test of type: "${w.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(k).then(b,x)}}catch(e){return void x(e)}b(k)}return t.OPTIONS=e,t}function Re(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=We(e[n],t);return e}function We(e,t){return Pe.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function Ue(e,t,n,r=n){let i,s,a;return t?(ne.forEach(t,(o,u,l)=>{let c=u?o.slice(1,o.length-1):o,d="tuple"===(e=e.resolve({context:r,parent:i,value:n})).type,h=l?parseInt(c,10):0;if(e.innerType||d){if(d&&!l)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&h>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[h],e=d?e.spec.types[h]:e.innerType}if(!l){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);i=n,n=n&&n[c],e=e.fields[c]}s=c,a=u?"["+o+"]":"."+o}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Ie extends Set{describe(){const e=[];for(const t of this.values())e.push(Pe.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const n of this.values())t.push(e(n));return t}clone(){return new Ie(this.values())}merge(e,t){const n=this.clone();return e.forEach(e=>n.add(e)),t.forEach(e=>n.delete(e)),n}}function Le(e,t=new Map){if(Ae(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Le(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Le(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Le(r,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Le(i,t)}return n}function He(e){if(null==e||!e.length)return;const t=[];let n="",r=!1,i=!1;for(let s=0;s<e.length;s++){const a=e[s];"["!==a||i?"]"!==a||i?'"'!==a?"."!==a||r||i?n+=a:n&&(t.push(n),n=""):i=!i:(n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),r=!1):(n&&(t.push(...n.split(".").filter(Boolean)),n=""),r=!0)}return n&&t.push(...n.split(".").filter(Boolean)),t}function ze(e,t){var n;if((null==(n=e.inner)||!n.length)&&e.errors.length)return function(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(e=>({message:e,path:He(n)}))}(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>ze(e,r))}class Ge{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ie,this._blacklist=new Ie,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Te.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=Le(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=Object.assign({},t.spec,n.spec);return n.spec=r,n.internalTests=Object.assign({},t.internalTests,n.internalTests),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce((t,n)=>n.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,n,r,i;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(n=e.abortEarly)?n:this.spec.abortEarly,recursive:null!=(r=e.recursive)?r:this.spec.recursive,disableStackTrace:null!=(i=e.disableStackTrace)?i:this.spec.disableStackTrace})}cast(e,t={}){let n=this.resolve(Object.assign({},t,{value:e})),r="ignore-optionality"===t.assert,i=n._cast(e,t);if(!1!==t.assert&&!n.isType(i)){if(r&&$e(i))return i;let s=_e(e),a=_e(i);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}". \n\nattempted value: ${s} \n`+(a!==s?`result of cast: ${a}`:""))}return i}_cast(e,t){let n=void 0===e?e:this.transforms.reduce((n,r)=>r.call(this,n,e,this,t),e);return void 0===n&&(n=this.getDefault(t)),n}_validate(e,t={},n,r){let{path:i,originalValue:s=e,strict:a=this.spec.strict}=t,o=e;a||(o=this._cast(o,Object.assign({assert:!1},t)));let u=[];for(let e of Object.values(this.internalTests))e&&u.push(e);this.runTests({path:i,value:o,originalValue:s,options:t,tests:u},n,e=>{if(e.length)return r(e,o);this.runTests({path:i,value:o,originalValue:s,options:t,tests:this.tests},n,r)})}runTests(e,t,n){let r=!1,{tests:i,value:s,originalValue:a,path:o,options:u}=e,l=e=>{r||(r=!0,t(e,s))},c=e=>{r||(r=!0,n(e,s))},d=i.length,h=[];if(!d)return c([]);let f={value:s,originalValue:a,path:o,options:u,schema:this};for(let e=0;e<i.length;e++)(0,i[e])(f,l,function(e){e&&(Array.isArray(e)?h.push(...e):h.push(e)),--d<=0&&c(h)})}asNestedTest({key:e,index:t,parent:n,parentPath:r,originalParent:i,options:s}){const a=null!=e?e:t;if(null==a)throw TypeError("Must include `key` or `index` for nested validations");const o="number"==typeof a;let u=n[a];const l=Object.assign({},s,{strict:!0,parent:n,value:u,originalValue:i[a],key:void 0,[o?"index":"key"]:a,path:o||a.includes(".")?`${r||""}[${o?a:`"${a}"`}]`:(r?`${r}.`:"")+e});return(e,t,n)=>this.resolve(l)._validate(u,l,t,n)}validate(e,t){var n;let r=this.resolve(Object.assign({},t,{value:e})),i=null!=(n=null==t?void 0:t.disableStackTrace)?n:r.spec.disableStackTrace;return new Promise((n,s)=>r._validate(e,t,(e,t)=>{Oe.isError(e)&&(e.value=t),s(e)},(e,t)=>{e.length?s(new Oe(e,t,void 0,void 0,i)):n(t)}))}validateSync(e,t){var n;let r,i=this.resolve(Object.assign({},t,{value:e})),s=null!=(n=null==t?void 0:t.disableStackTrace)?n:i.spec.disableStackTrace;return i._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw Oe.isError(e)&&(e.value=t),e},(t,n)=>{if(t.length)throw new Oe(t,e,void 0,void 0,s);r=n}),r}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(Oe.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(Oe.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):Le(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const n=this.clone({nullable:e});return n.internalTests.nullable=Ve({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),n}optionality(e,t){const n=this.clone({optional:e});return n.internalTests.optionality=Ve({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),n}optional(){return this.optionality(!0)}defined(e=Te.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Te.notNull){return this.nullability(!1,e)}required(e=Te.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=Te.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=Ve(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter(e=>{if(e.OPTIONS.name===t.name){if(i)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0}),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=we(e).map(e=>new Pe(e));return r.forEach(e=>{e.isSibling&&n.deps.push(e.key)}),n.conditions.push("function"==typeof t?new je(r,t):je.fromOptions(r,t)),n}typeError(e){let t=this.clone();return t.internalTests.typeError=Ve({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=Te.oneOf){let n=this.clone();return e.forEach(e=>{n._whitelist.add(e),n._blacklist.delete(e)}),n.internalTests.whiteList=Ve({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}notOneOf(e,t=Te.notOneOf){let n=this.clone();return e.forEach(e=>{n._blacklist.add(e),n._whitelist.delete(e)}),n.internalTests.blacklist=Ve({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:n,meta:r,optional:i,nullable:s}=t.spec,a={meta:r,label:n,optional:i,nullable:s,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((e,t,n)=>n.findIndex(t=>t.OPTIONS.name===e.OPTIONS.name)===t).map(t=>{const n=t.OPTIONS.params&&e?Re(Object.assign({},t.OPTIONS.params),e):t.OPTIONS.params;return{name:t.OPTIONS.name,params:n}})};return a}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(t){try{return{value:await e.validate(t,{abortEarly:!1})}}catch(e){if(e instanceof Oe)return{issues:ze(e)};throw e}}}}}Ge.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Ge.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:a}=Ue(this,t,n,r.context);return a[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])Ge.prototype[e]=Ge.prototype.oneOf;for(const e of["not","nope"])Ge.prototype[e]=Ge.prototype.notOneOf;const qe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Ze(e){var t,n;const r=qe.exec(e);return r?{year:Be(r[1]),month:Be(r[2],1)-1,day:Be(r[3],1),hour:Be(r[4]),minute:Be(r[5]),second:Be(r[6]),millisecond:r[7]?Be(r[7].substring(0,3)):0,precision:null!=(t=null==(n=r[7])?void 0:n.length)?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:Be(r[10]),minuteOffset:Be(r[11])}:null}function Be(e,t=0){return Number(e)||t}let Je=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Qe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ke=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Xe=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"),et=e=>$e(e)||e===e.trim(),tt={}.toString();function nt(){return new rt}class rt extends Ge{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e))return e;if(Array.isArray(e))return e;const n=null!=e&&e.toString?e.toString():e;return n===tt?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||Te.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=Me.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=Me.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=Me.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let n,r,i=!1;return t&&("object"==typeof t?({excludeEmptyString:i=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||Me.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&i||-1!==t.search(e)})}email(e=Me.email){return this.matches(Je,{name:"email",message:e,excludeEmptyString:!0})}url(e=Me.url){return this.matches(Qe,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=Me.uuid){return this.matches(Ke,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,n,r="";return e&&("object"==typeof e?({message:r="",allowOffset:t=!1,precision:n}=e):r=e),this.matches(Xe,{name:"datetime",message:r||Me.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||Me.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const n=Ze(e);return!!n&&!!n.z}}).test({name:"datetime_precision",message:r||Me.datetime_precision,params:{precision:n},skipAbsent:!0,test:e=>{if(!e||null==n)return!0;const t=Ze(e);return!!t&&t.precision===n}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=Me.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:et})}lowercase(e=Me.lowercase){return this.transform(e=>$e(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>$e(e)||e===e.toLowerCase()})}uppercase(e=Me.uppercase){return this.transform(e=>$e(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>$e(e)||e===e.toUpperCase()})}}nt.prototype=rt.prototype;let it=new Date("");class st extends Ge{constructor(){super({type:"date",check:e=>"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||null===e?e:(e=function(e){const t=Ze(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(n=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}(e),isNaN(e)?st.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let n;if(Pe.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=Ye.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(n)}})}max(e,t=Ye.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(n)}})}}function at(e,t){let n=Infinity;return e.some((e,r)=>{var i;if(null!=(i=t.path)&&i.includes(e))return n=r,!0}),n}function ot(e){return(t,n)=>at(e,t)-at(e,n)}st.INVALID_DATE=it;const ut=(e,t,n)=>{if("string"!=typeof e)return e;let r=e;try{r=JSON.parse(e)}catch(e){}return n.isType(r)?r:e};function lt(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=lt(r);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=lt(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(lt)}):"optional"in e?e.optional():e}let ct=e=>"[object Object]"===Object.prototype.toString.call(e);function dt(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===n.indexOf(e))}const ht=ot([]);function ft(e){return new mt(e)}class mt extends Ge{constructor(e){super({type:"object",check:e=>ct(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=ht,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault(t);if(!this._typeCheck(r))return r;let i=this.fields,s=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(r).filter(e=>!this._nodes.includes(e))),o={},u=Object.assign({},t,{parent:o,__validating:t.__validating||!1}),l=!1;for(const e of a){let n=i[e],a=e in r,c=r[e];if(n){let i;u.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:c,context:t.context,parent:o});let s=n instanceof Ge?n.spec:void 0,a=null==s?void 0:s.strict;if(null!=s&&s.strip){l=l||e in r;continue}i=t.__validating&&a?c:n.cast(c,u),void 0!==i&&(o[e]=i)}else a&&!s&&(o[e]=c);a===e in o&&o[e]===c||(l=!0)}return l?o:r}_validate(e,t={},n,r){let{from:i=[],originalValue:s=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:s},...i],t.__validating=!0,t.originalValue=s,super._validate(e,t,n,(e,i)=>{if(!a||!ct(i))return void r(e,i);s=s||i;let o=[];for(let e of this._nodes){let n=this.fields[e];n&&!Pe.isRef(n)&&o.push(n.asNestedTest({options:t,key:e,parent:i,parentPath:t.path,originalParent:s}))}this.runTests({tests:o,value:i,originalValue:s,options:t},n,t=>{r(t.sort(this._sortErrors).concat(e),i)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];n[e]=void 0===r?t:r}return t.withMutation(t=>t.setFields(n,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{var r;const i=this.fields[n];let s=e;null!=(r=s)&&r.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),t[n]=i&&"getDefault"in i?i.getDefault(s):void 0}),t}setFields(e,t){let n=this.clone();return n.fields=e,n._nodes=function(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([e,t])=>`${e}-${t}`));function s(e,t){let s=ne.split(e)[0];r.add(s),i.has(`${t}-${s}`)||n.push([t,s])}for(const t of Object.keys(e)){let n=e[t];r.add(t),Pe.isRef(n)&&n.isSibling?s(n.path,t):Ae(n)&&"deps"in n&&n.deps.forEach(e=>s(e,t))}return de.array(Array.from(r),n).reverse()}(e,t),n._sortErrors=ot(Object.keys(e)),t&&(n._excludedEdges=t),n}shape(e,t=[]){return this.clone().withMutation(n=>{let r=n._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),r=[...n._excludedEdges,...t]),n.setFields(Object.assign(n.fields,e),r)})}partial(){const e={};for(const[t,n]of Object.entries(this.fields))e[t]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(e)}deepPartial(){return lt(this)}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.setFields(t,this._excludedEdges.filter(([t,n])=>e.includes(t)&&e.includes(n)))}omit(e){const t=[];for(const n of Object.keys(this.fields))e.includes(n)||t.push(n);return this.pick(t)}from(e,t,n){let r=ne.getter(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return((e,t)=>{const n=[...ne.normalizePath(t)];if(1===n.length)return n[0]in e;let r=n.pop(),i=ne.getter(ne.join(n),!0)(e);return!(!i||!(r in i))})(i,e)&&(s=Object.assign({},i),n||delete s[e],s[t]=r(i)),s})}json(){return this.transform(ut)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ee.exact,test(e){if(null==e)return!0;const t=dt(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Ee.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=dt(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=Ee.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const n={};for(const r of Object.keys(t))n[e(r)]=t[r];return n})}camelCase(){return this.transformKeys(le)}snakeCase(){return this.transformKeys(ce)}constantCase(){return this.transformKeys(e=>ce(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),n=super.describe(e);n.fields={};for(const[i,s]of Object.entries(t.fields)){var r;let t=e;null!=(r=t)&&r.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[i]})),n.fields[i]=s.describe(t)}return n}}function pt(e){return new yt(e)}ft.prototype=mt.prototype;class yt extends Ge{constructor(e){super({type:"array",spec:{types:e},check:e=>Array.isArray(e)}),this.innerType=void 0,this.innerType=e}_cast(e,t){const n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1;const i=n.map((e,i)=>{const s=this.innerType.cast(e,Object.assign({},t,{path:`${t.path||""}[${i}]`,parent:n,originalValue:e,value:e,index:i}));return s!==e&&(r=!0),s});return r?i:n}_validate(e,t={},n,r){var i;let s=this.innerType,a=null!=(i=t.recursive)?i:this.spec.recursive;super._validate(e,t,n,(i,o)=>{var u;if(!a||!s||!this._typeCheck(o))return void r(i,o);let l=new Array(o.length);for(let n=0;n<o.length;n++){var c;l[n]=s.asNestedTest({options:t,index:n,parent:o,parentPath:t.path,originalParent:null!=(c=t.originalValue)?c:e})}this.runTests({value:o,tests:l,originalValue:null!=(u=t.originalValue)?u:e,options:t},n,e=>r(e.concat(i),o))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(ut)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!Ae(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+_e(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=Fe.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t){return this.test({message:t=t||Fe.min,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t){return this.test({message:t=t||Fe.max,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(e){const t=(e?this.resolve(e):this).clone(),n=super.describe(e);if(t.innerType){var r;let i=e;null!=(r=i)&&r.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=t.innerType.describe(i)}return n}}pt.prototype=yt.prototype;var gt=function(e){var t;return t={mixed:{required:e("This field is required")}},Object.keys(t).forEach(e=>{Object.keys(t[e]).forEach(n=>{Ne[e][n]=t[e][n]})}),{initialValues:{workplacesIds:[]},validationSchema:ft({workplacesIds:pt().of(nt()).required()})}},vt=["url","wsUrl","lang","data","settings"];exports.Widget=function(r){var i=r.url,s=r.wsUrl,a=r.lang,o=r.data,c=r.settings,d=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(r,vt),f=t.useGqlClients({url:i,wsUrl:s,lang:a}),p=f.graphqlSdk,w=f.gqlWsClient,b=e.useState(o),x=b[0],k=b[1],S=e.useState(c),D=S[0],O=S[1];e.useEffect(function(){!o&&p&&(p.shifts().then(function(e){var t=e.shifts;return k(function(e){return l({},e||{},{shifts:t})})}).catch(function(){}),p.listWorkplaces().then(function(e){var t=e.workplaces;return k(function(e){return l({},e||{},{workplaces:t})})}).catch(function(){}),p.listStatusChanges().then(function(e){var t=e.statusChanges;return k(function(e){return l({},e||{},{statusChanges:(n=t,n.sort(function(e,t){return e.finishedAt&&t.finishedAt?Y(e.finishedAt).diff(Y(t.finishedAt)):e.finishedAt?-1:1}))});var n})}).catch(function(){})),null!=D&&D.workplacesIds&&w&&D.workplacesIds.forEach(function(e){w.subscribe(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y,r=void 0,i=Array.isArray(e),s=[e],a=-1,o=[],u=void 0,l=void 0,c=void 0,d=[],f=[],p=e;do{var _=++a===s.length,w=_&&0!==o.length;if(_){if(l=0===f.length?void 0:d[d.length-1],u=c,c=f.pop(),w){if(i)u=u.slice();else{for(var b={},x=0,k=Object.keys(u);x<k.length;x++){var S=k[x];b[S]=u[S]}u=b}for(var D=0,O=0;O<o.length;O++){var T=o[O][0],M=o[O][1];i&&(T-=D),i&&null===M?(u.splice(T,1),D++):u[T]=M}}a=r.index,s=r.keys,o=r.edits,i=r.inArray,r=r.prev}else{if(l=c?i?a:s[a]:void 0,null==(u=c?c[l]:p))continue;c&&d.push(l)}var Y,E=void 0;if(!Array.isArray(u)){if(!h(u))throw new Error("Invalid AST Node: ".concat(m(u),"."));var F=v(t,u.kind,_);if(F){if((E=F.call(t,u,l,c,d,f))===g)break;if(!1===E){if(!_){d.pop();continue}}else if(void 0!==E&&(o.push([l,E]),!_)){if(!h(E)){d.pop();continue}u=E}}}void 0===E&&w&&o.push([l,u]),_?d.pop():(r={inArray:i,index:a,keys:s,edits:o,prev:r},s=(i=Array.isArray(u))?u:null!==(Y=n[u.kind])&&void 0!==Y?Y:[],a=-1,o=[],c&&f.push(c),c=u)}while(void 0!==r);return 0!==o.length&&(p=o[o.length-1][1]),p}(t.WorkplaceEventDocument,{leave:_}),{id:e},function(n){var r=n.event,i=n.subject;if(r===t.WorkplaceEvent.StatusChangeCreated){var s=i;k(function(t){var n,r=null==t||null==(n=t.statusChanges)?void 0:n.filter(function(t){return t.workplaceId===e}),i=r[r.length-1];return i&&(i.finishedAt=s.startedAt),l({},t||{},{statusChanges:[].concat(t.statusChanges,[s])})})}else if(r===t.WorkplaceEvent.StatusChangeUpdated){var a=i;k(function(e){var t=e.statusChanges.map(function(e){return e.id===a.id?a:e});return l({},e||{},{statusChanges:t})})}})})},[o,p,w,D]);var T=e.useCallback(function(e){O(l({},e))},[O]);return u.default.createElement(n.BaseWidget,l({lang:a,locales:E,data:x,settings:c,gqlClients:{graphqlSdk:p,gqlWsClient:w},onSettingsChange:T,WidgetView:G,getSettingsFormProps:gt,SettingsFormContent:C,version:F,"data-testid":"workplaces-state-timelines-widget"},d))},exports.extraPermissions=[],exports.getDisplayName=function(e){switch(e){case"en":return"Status changes history for current shift";case"pl":return"Historia zmian statusów dla obecnej zmiany";default:return"workplaces-state-timelines-widget"}},exports.requiredFeatures=["feature.workplaces-state-timelines-widget"],exports.version=F;
2
- //# sourceMappingURL=index.js.map
1
+ import { Fragment, useCallback, useEffect, useState } from "react";
2
+ import { SortableSelect, WorkplaceEvent, WorkplaceEventDocument, getCurrentShift, normalizeShifts, useGqlClients } from "andoncloud-dashboard-toolkit";
3
+ import { BaseWidget } from "andoncloud-widget-base";
4
+ import dayjs from "dayjs";
5
+ import { print } from "graphql";
6
+ import { useTranslation } from "react-i18next";
7
+ import { TabContext, TabList, TabPanel } from "@mui/lab";
8
+ import { Box, Tab, TextField, Typography } from "@mui/material";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ import isBetween from "dayjs/plugin/isBetween.js";
11
+ import ContentLoader from "react-content-loader";
12
+ import { styled } from "@mui/material/styles";
13
+ import * as yup from "yup";
14
+ import i18n from "i18next";
15
+ //#endregion
16
+ //#region src/locales/index.ts
17
+ const resources = {
18
+ en: { translation: { workplacesStateTimelinesWidget: {
19
+ "advanced": "Advanced",
20
+ "cancel": "Cancel",
21
+ "customTitle": "Custom title",
22
+ "historyTimelineTimeInfoNow": "now",
23
+ "loading": "Loading",
24
+ "save": "Save",
25
+ "selectAndArrangeTheOrder": "Select and arrange the order",
26
+ "settings": "Settings",
27
+ "thisFieldIsRequired": "This field is required",
28
+ "displayName": "Status changes history for current shift",
29
+ "titleWorkplaces_one": "{{count}} workplace",
30
+ "titleWorkplaces_other": "{{count}} workplaces",
31
+ "workplaces": "Workplaces"
32
+ } } },
33
+ pl: { translation: { workplacesStateTimelinesWidget: {
34
+ "advanced": "Zaawansowane",
35
+ "cancel": "Anuluj",
36
+ "customTitle": "Własny tytuł",
37
+ "historyTimelineTimeInfoNow": "teraz",
38
+ "loading": "Wczytywanie",
39
+ "save": "Zapisz",
40
+ "selectAndArrangeTheOrder": "Wybierz i ustal kolejność",
41
+ "settings": "Ustawienia",
42
+ "thisFieldIsRequired": "To pole jest wymagane",
43
+ "displayName": "Historia zmian statusów dla obecnej zmiany",
44
+ "titleWorkplaces_one": "{{count}} stanowisko",
45
+ "titleWorkplaces_few": "{{count}} stanowiska",
46
+ "titleWorkplaces_many": "{{count}} stanowisk",
47
+ "workplaces": "Stanowiska"
48
+ } } }
49
+ };
50
+ //#endregion
51
+ //#region src/version.ts
52
+ const LIBRARY_VERSION = "1.2.6";
53
+ //#endregion
54
+ //#region src/components/SettingsFormContent/index.tsx
55
+ const SettingsFormContent = ({ data, formProps }) => {
56
+ const [selectedTab, setSelectedTab] = useState("workplaces");
57
+ const { t } = useTranslation();
58
+ return /* @__PURE__ */ jsxs(TabContext, {
59
+ value: selectedTab,
60
+ children: [
61
+ /* @__PURE__ */ jsxs(TabList, {
62
+ onChange: (_, value) => setSelectedTab(value),
63
+ centered: true,
64
+ children: [/* @__PURE__ */ jsx(Tab, {
65
+ label: t("workplacesStateTimelinesWidget.workplaces"),
66
+ value: "workplaces"
67
+ }), /* @__PURE__ */ jsx(Tab, {
68
+ label: t("workplacesStateTimelinesWidget.advanced"),
69
+ value: "advanced"
70
+ })]
71
+ }),
72
+ /* @__PURE__ */ jsx(TabPanel, {
73
+ value: "workplaces",
74
+ children: /* @__PURE__ */ jsx(SortableSelect, {
75
+ placeholder: `${t("workplacesStateTimelinesWidget.selectAndArrangeTheOrder")}...`,
76
+ options: data.workplaces?.map(({ id, name }) => ({
77
+ label: name,
78
+ value: id
79
+ })),
80
+ selected: formProps.values.workplacesIds,
81
+ onChange: (selected) => formProps.setFieldValue("workplacesIds", [...selected])
82
+ })
83
+ }),
84
+ /* @__PURE__ */ jsx(TabPanel, {
85
+ value: "advanced",
86
+ children: /* @__PURE__ */ jsx(TextField, {
87
+ name: "customTitle",
88
+ label: t("workplacesStateTimelinesWidget.customTitle"),
89
+ value: formProps.values.customTitle,
90
+ onChange: formProps.handleChange,
91
+ fullWidth: true
92
+ })
93
+ })
94
+ ]
95
+ });
96
+ };
97
+ //#endregion
98
+ //#region src/helpers.ts
99
+ const durationSeconds = (shift, statusChange, currentDate) => {
100
+ const startedAt = shift.startedAt.isAfter(statusChange.startedAt) ? shift.startedAt : dayjs(statusChange.startedAt);
101
+ if (startedAt && statusChange.finishedAt) return Math.abs(startedAt.diff(dayjs(statusChange.finishedAt), "seconds"));
102
+ return Math.abs(dayjs(currentDate).diff(startedAt, "seconds"));
103
+ };
104
+ const mapTimelineColor = (color) => {
105
+ switch (color) {
106
+ case "green": return "#2ACB42";
107
+ case "red": return "#FF453A";
108
+ case "yellow": return "#FFC12F";
109
+ default: return "#525860";
110
+ }
111
+ };
112
+ //#endregion
113
+ //#region src/components/TimelineLoader/index.tsx
114
+ const TimelineLoader = () => /* @__PURE__ */ jsx(ContentLoader, {
115
+ "data-testid": "timeline-loading",
116
+ height: "28",
117
+ width: "100%",
118
+ speed: 1.5,
119
+ backgroundColor: "#3d3d3d",
120
+ foregroundColor: "#ffffff",
121
+ children: /* @__PURE__ */ jsx("rect", {
122
+ x: "4%",
123
+ y: "10",
124
+ ry: "6",
125
+ width: "92%",
126
+ height: "14"
127
+ })
128
+ });
129
+ //#endregion
130
+ //#region src/components/Timeline/styled.ts
131
+ const TimelineRow = styled("div")({
132
+ display: "flex",
133
+ flexGrow: 1,
134
+ alignItems: "center",
135
+ padding: "10px 0",
136
+ background: "#252A32",
137
+ "&:nth-of-type(2n)": { background: "#30353d" }
138
+ });
139
+ const TimelineWrapper = styled("div")({
140
+ display: "flex",
141
+ margin: "6px 0",
142
+ zIndex: 3,
143
+ flexDirection: "row",
144
+ height: "20px",
145
+ width: "100%",
146
+ overflow: "hidden",
147
+ borderRadius: "4px",
148
+ backgroundColor: "rgba(0, 0, 0, 0.2)"
149
+ });
150
+ styled("div")({
151
+ display: "flex",
152
+ alignItems: "center",
153
+ justifyContent: "space-between"
154
+ });
155
+ const TimelineTimeInfo = styled("span")({
156
+ margin: "0 1.5em",
157
+ fontSize: "12px",
158
+ fontWeight: 500,
159
+ lineHeight: "12px",
160
+ color: "rgba(255, 255, 255, 0.5)"
161
+ });
162
+ const TimelineElement = styled("div")(({ percentWidth, color }) => ({
163
+ flexBasis: `${percentWidth}%`,
164
+ flexShrink: 0,
165
+ backgroundColor: mapTimelineColor(color),
166
+ "&:first-of-type": {
167
+ borderTopLeftRadius: "4px",
168
+ borderBottomLeftRadius: "4px"
169
+ }
170
+ }));
171
+ //#endregion
172
+ //#region src/components/Timeline/index.tsx
173
+ dayjs.extend(isBetween);
174
+ const Timeline = ({ title, shift, statusChanges, loading }) => {
175
+ const [shiftStatusChanges, setShiftStatusChanges] = useState([]);
176
+ const calculateShiftDuration = useCallback(() => {
177
+ return shift ? Math.abs(shift.startedAt.diff(shift.finishedAt, "seconds")) : 0;
178
+ }, [shift]);
179
+ const isShiftStatusChange = useCallback((statusChange) => {
180
+ const startedAt = dayjs(statusChange.startedAt);
181
+ const finishedAt = statusChange.finishedAt ? dayjs(statusChange.finishedAt) : null;
182
+ if (shift) return startedAt.isBetween(shift.startedAt, shift.finishedAt) || finishedAt?.isBetween(shift.startedAt, shift.finishedAt) || startedAt.isBefore(shift.startedAt) && !finishedAt;
183
+ return false;
184
+ }, [shift]);
185
+ const [shiftDuration, setShiftDuration] = useState(() => calculateShiftDuration());
186
+ useEffect(() => {
187
+ setShiftDuration(calculateShiftDuration());
188
+ }, [shift, calculateShiftDuration]);
189
+ useEffect(() => {
190
+ setShiftStatusChanges(statusChanges.filter((statusChange) => isShiftStatusChange(statusChange)));
191
+ }, [statusChanges, isShiftStatusChange]);
192
+ if (loading) return /* @__PURE__ */ jsx(TimelineLoader, {});
193
+ return /* @__PURE__ */ jsxs(TimelineRow, { children: [/* @__PURE__ */ jsx(Typography, {
194
+ sx: {
195
+ display: title ? "block" : "none",
196
+ flexBasis: "25%",
197
+ marginLeft: "20px",
198
+ whiteSpace: "nowrap",
199
+ overflow: "hidden",
200
+ textOverflow: "ellipsis",
201
+ color: "white"
202
+ },
203
+ children: title
204
+ }), shift && /* @__PURE__ */ jsxs(Fragment, { children: [
205
+ /* @__PURE__ */ jsx(TimelineTimeInfo, { children: shift.startedAt.format("HH:mm") }),
206
+ /* @__PURE__ */ jsx(TimelineWrapper, {
207
+ "data-testid": "timeline",
208
+ children: shiftStatusChanges?.map((status) => status.reason.statusColor && /* @__PURE__ */ jsx(TimelineElement, {
209
+ "data-testid": `timeline-element-${status.id}-color-${status.reason.statusColor}`,
210
+ color: status.reason.statusColor,
211
+ percentWidth: Math.min(durationSeconds(shift, status, /* @__PURE__ */ new Date()) / shiftDuration * 100, 100)
212
+ }, `${status.id}${status.author.id}`))
213
+ }),
214
+ /* @__PURE__ */ jsx(TimelineTimeInfo, { children: shift.finishedAt.format("HH:mm") })
215
+ ] })] });
216
+ };
217
+ //#endregion
218
+ //#region src/components/WidgetView/index.tsx
219
+ const WidgetView = ({ data, settings }) => {
220
+ const [currentShift, setCurrentShift] = useState(null);
221
+ const getTitle = (workplaceId) => {
222
+ const workplaces = data.workplaces;
223
+ return settings?.workplacesIds?.length === 1 ? "" : workplaces?.find((workplace) => workplace.id === workplaceId)?.name || "";
224
+ };
225
+ useEffect(() => {
226
+ const updateCurrentShift = () => {
227
+ const currentDate = dayjs();
228
+ setCurrentShift(getCurrentShift(currentDate, normalizeShifts(data?.shifts || [], currentDate)));
229
+ };
230
+ const intervalId = setInterval(() => updateCurrentShift(), 10 * 1e3);
231
+ updateCurrentShift();
232
+ return () => {
233
+ clearInterval(intervalId);
234
+ };
235
+ }, [data?.shifts]);
236
+ return /* @__PURE__ */ jsx(Box, {
237
+ display: "flex",
238
+ flexDirection: "column",
239
+ height: "100%",
240
+ children: settings?.workplacesIds.map((workplaceId) => /* @__PURE__ */ jsx(Timeline, {
241
+ title: getTitle(workplaceId),
242
+ shift: currentShift,
243
+ statusChanges: data.statusChanges?.filter((statusChange) => statusChange.workplaceId === workplaceId) || [],
244
+ loading: data === void 0
245
+ }, workplaceId))
246
+ });
247
+ };
248
+ //#endregion
249
+ //#region src/components/Widget/utils.ts
250
+ const getSettingsFormProps = (t) => {
251
+ yup.setLocale({ mixed: { required: t("workplacesStateTimelinesWidget.thisFieldIsRequired") } });
252
+ return {
253
+ initialValues: {
254
+ customTitle: "",
255
+ workplacesIds: []
256
+ },
257
+ validationSchema: yup.object({ workplacesIds: yup.array().of(yup.string()).required() })
258
+ };
259
+ };
260
+ //#endregion
261
+ //#region src/components/Widget/index.tsx
262
+ const Widget = ({ url, wsUrl, lang, data, settings, ...widgetProps }) => {
263
+ const { graphqlSdk, gqlWsClient } = useGqlClients({
264
+ url,
265
+ wsUrl,
266
+ lang
267
+ });
268
+ const [widgetData, setWidgetData] = useState(data);
269
+ const [widgetSettings, setWidgetSettings] = useState(settings);
270
+ const sortStatusChagnges = (items) => {
271
+ return items.sort((item1, item2) => {
272
+ if (item1.finishedAt && item2.finishedAt) return dayjs(item1.finishedAt).diff(dayjs(item2.finishedAt));
273
+ return item1.finishedAt ? -1 : 1;
274
+ });
275
+ };
276
+ useEffect(() => {
277
+ if (!data && graphqlSdk) {
278
+ graphqlSdk.listShifts().then(({ shifts }) => {
279
+ return setWidgetData((current) => ({
280
+ ...current || {},
281
+ shifts
282
+ }));
283
+ }).catch(() => {});
284
+ graphqlSdk.listWorkplaces().then(({ workplaces }) => {
285
+ return setWidgetData((current) => ({
286
+ ...current || {},
287
+ workplaces
288
+ }));
289
+ }).catch(() => {});
290
+ graphqlSdk.listStatusChanges().then(({ statusChanges }) => {
291
+ return setWidgetData((current) => ({
292
+ ...current || {},
293
+ statusChanges: sortStatusChagnges(statusChanges)
294
+ }));
295
+ }).catch(() => {});
296
+ }
297
+ if (widgetSettings?.workplacesIds && gqlWsClient) widgetSettings.workplacesIds.forEach((workplaceId) => {
298
+ gqlWsClient.subscribe(print(WorkplaceEventDocument), { id: workplaceId }, ({ event, subject }) => {
299
+ if (event === WorkplaceEvent.StatusChangeCreated) {
300
+ const statusChange = subject;
301
+ setWidgetData((current) => {
302
+ const workplaceStatusChanges = current?.statusChanges?.filter((statusChange) => statusChange.workplaceId === workplaceId);
303
+ const lastStatusChange = workplaceStatusChanges[workplaceStatusChanges.length - 1];
304
+ if (lastStatusChange) lastStatusChange.finishedAt = statusChange.startedAt;
305
+ return {
306
+ ...current || {},
307
+ statusChanges: [...current.statusChanges, statusChange]
308
+ };
309
+ });
310
+ } else if (event === WorkplaceEvent.StatusChangeUpdated) {
311
+ const updatedStatusChange = subject;
312
+ setWidgetData((current) => {
313
+ const statusChanges = current.statusChanges.map((statusChange) => statusChange.id === updatedStatusChange.id ? updatedStatusChange : statusChange);
314
+ return {
315
+ ...current || {},
316
+ statusChanges
317
+ };
318
+ });
319
+ }
320
+ });
321
+ });
322
+ }, [
323
+ data,
324
+ graphqlSdk,
325
+ gqlWsClient,
326
+ widgetSettings
327
+ ]);
328
+ const handleSettingsChange = useCallback((settings) => {
329
+ setWidgetSettings({ ...settings });
330
+ }, [setWidgetSettings]);
331
+ return /* @__PURE__ */ jsx(BaseWidget, {
332
+ ...widgetProps,
333
+ lang,
334
+ locales: resources,
335
+ data: widgetData,
336
+ settings,
337
+ gqlClients: {
338
+ graphqlSdk,
339
+ gqlWsClient
340
+ },
341
+ onSettingsChange: handleSettingsChange,
342
+ WidgetView,
343
+ getSettingsFormProps,
344
+ SettingsFormContent,
345
+ version: LIBRARY_VERSION,
346
+ "data-testid": "workplaces-state-timelines-widget"
347
+ });
348
+ };
349
+ //#endregion
350
+ //#region src/core/title.ts
351
+ const ns = "workplacesStateTimelinesWidget";
352
+ const t = (key, lng, options) => i18n.t(`${ns}.${key}`, {
353
+ lng,
354
+ ...options
355
+ });
356
+ const getDisplayName = (lang) => t("displayName", lang);
357
+ const getTitle = (data, _settings, _filters, lang) => {
358
+ const name = getDisplayName(lang);
359
+ const workplaces = data?.workplaces;
360
+ if (!workplaces?.length) return name;
361
+ return `${name} — ${t("titleWorkplaces", lang, { count: workplaces.length })}`;
362
+ };
363
+ //#endregion
364
+ //#region src/index.tsx
365
+ const thumbnail = void 0;
366
+ const requiredFeatures = ["feature.workplaces-state-timelines-widget"];
367
+ const extraPermissions = [];
368
+ //#endregion
369
+ export { Widget, extraPermissions, getDisplayName, getTitle, requiredFeatures, thumbnail, LIBRARY_VERSION as version };
370
+
371
+ //# sourceMappingURL=index.js.map