anarock-widgets 1.0.210 → 1.0.211
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/anarock-widgets.css +1 -1
- package/dist/index.cjs.js +7 -7
- package/dist/index.es.js +530 -440
- package/dist/index.umd.js +7 -7
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -120,11 +120,11 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
120
120
|
react-datepicker v9.1.0
|
|
121
121
|
https://github.com/Hacker0x01/react-datepicker
|
|
122
122
|
Released under the MIT License.
|
|
123
|
-
*/var Av=function(t,n){return Av=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},Av(t,n)};function pn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Av(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var _e=function(){return _e=Object.assign||function(n){for(var r,i=1,o=arguments.length;i<o;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])}return n},_e.apply(this,arguments)};function hi(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var _6=function(e){var t=e.showTimeSelectOnly,n=t===void 0?!1:t,r=e.showTime,i=r===void 0?!1:r,o=e.className,a=e.children,s=e.inline,l=n?"Choose Time":"Choose Date".concat(i?" and Time":"");return P.createElement("div",{className:o,"aria-label":l,role:s?void 0:"dialog","aria-modal":s?void 0:"true",translate:"no"},a)},S6=function(e,t){var n=P.useRef(null),r=P.useRef(e);P.useEffect(function(){r.current=e},[e]);var i=P.useCallback(function(o){var a,s=o.composed&&o.composedPath&&o.composedPath().find(function(l){return l instanceof Node})||o.target;n.current&&!n.current.contains(s)&&(t&&s instanceof HTMLElement&&s.classList.contains(t)||(a=r.current)===null||a===void 0||a.call(r,o))},[t]);return P.useEffect(function(){return document.addEventListener("mousedown",i),function(){document.removeEventListener("mousedown",i)}},[i]),n},Qp=function(e){var t=e.children,n=e.onClickOutside,r=e.className,i=e.containerRef,o=e.style,a=e.ignoreClass,s=S6(n,a);return P.createElement("div",{className:r,style:o,ref:function(l){s.current=l,i&&(i.current=l)}},t)},Gu=null,Aw=!1;function Tk(){if(Aw)return Gu;Aw=!0;try{var e="date-fns-tz";Gu=require(e)}catch{Gu=null}return Gu}function Tw(e,t){if(!t)return e;var n=Tk();return n?n.toZonedTime(e,t):(process.env.NODE_ENV!=="production"&&console.warn('react-datepicker: timeZone prop requires "date-fns-tz" package. Please install it: npm install date-fns-tz'),e)}function Ii(e,t){if(!t)return e;var n=Tk();return n?n.fromZonedTime(e,t):(process.env.NODE_ENV!=="production"&&console.warn('react-datepicker: timeZone prop requires "date-fns-tz" package. Please install it: npm install date-fns-tz'),e)}var ne;(function(e){e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.PageUp="PageUp",e.PageDown="PageDown",e.Home="Home",e.End="End",e.Enter="Enter",e.Space=" ",e.Tab="Tab",e.Escape="Escape",e.Backspace="Backspace",e.X="x"})(ne||(ne={}));function Mk(){var e=typeof window<"u"?window:globalThis;return e}var du=12;function Ae(e){if(e==null)return new Date;var t=typeof e=="string"?$4(e):me(e);return Un(t)?t:new Date}function da(e,t,n,r,i){i===void 0&&(i=Ae());for(var o=Us(n)||Us(gb()),a=Array.isArray(t)?t:[t],s=0,l=a;s<l.length;s++){var c=l[s],u=N4(e,c,i,{locale:o});if(Un(u)&&(!r||e===pt(u,c,n)))return u}if(!r&&e&&e.length>=8){var d=new Date(e);if(zs(d))return d}return null}function E6(e,t){if(t===void 0&&(t=Ae()),!e)return null;var n=e.match(/\b(1\d{3}|2\d{3})\b/);if(!n||!n[1])return null;var r=parseInt(n[1],10),i=e.match(/(?:^|[/\-\s])?(0?[1-9]|1[0-2])(?:[/\-\s]|$)/),o=i&&i[1]?parseInt(i[1],10)-1:t.getMonth();return new Date(r,o,1)}function Un(e){return zs(e)}function Da(e){return e==null?null:vi(e)&&zs(e)?e:null}function pt(e,t,n){if(n==="en")return gw(e,t,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var r=n?Us(n):void 0;return n&&!r&&console.warn('A locale object was not found for the provided string ["'.concat(n,'"].')),r=r||Us(gb()),gw(e,t,{locale:r,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function Hn(e,t){var n=t.dateFormat,r=t.locale,i=Array.isArray(n)&&n.length>0?n[0]:n;return e&&pt(e,i,r)||""}var Nk=" - ";function O6(e,t,n){if(!e&&!t)return"";var r=e?Hn(e,n):"",i=t?Hn(t,n):"",o=n.rangeSeparator||Nk;return"".concat(r).concat(o).concat(i)}function C6(e,t){if(!e?.length)return"";var n=e[0]?Hn(e[0],t):"";if(e.length===1)return n;if(e.length===2&&e[1]){var r=Hn(e[1],t);return"".concat(n,", ").concat(r)}var i=e.length-1;return"".concat(n," (+").concat(i,")")}function Li(e,t){var n=t.hour,r=n===void 0?0:n,i=t.minute,o=i===void 0?0:i,a=t.second,s=a===void 0?0:a;return Gd(Xd(Qd(e,s),o),r)}function P6(e){return sb(e)}function k6(e,t){return pt(e,"ddd",t)}function oc(e){return Ya(e)}function Wo(e,t,n){var r=Us(t||gb());return ao(e,{locale:r,weekStartsOn:n})}function Ji(e){return ck(e)}function ac(e){return Yp(e)}function Mw(e){return Ov(e)}function Nw(){return Ya(Ae())}function jw(e){return sk(e)}function D6(e){return $$(e)}function A6(e){return lk(e)}function ci(e,t){return e&&t?L4(e,t):!e&&!t}function Mn(e,t){return e&&t?R4(e,t):!e&&!t}function _f(e,t){return e&&t?I4(e,t):!e&&!t}function Pe(e,t){return e&&t?L$(e,t):!e&&!t}function Aa(e,t){return e&&t?F5(e,t):!e&&!t}function ya(e,t,n){var r,i=Ya(t),o=sk(n);try{r=Mc(e,{start:i,end:o})}catch{r=!1}return r}function gb(){var e=Mk();return e.__localeId__}function Us(e){if(typeof e=="string"){var t=Mk();return t.__localeData__?t.__localeData__[e]:void 0}else return e}function T6(e,t,n){return t(pt(e,"EEEE",n))}function M6(e,t){return pt(e,"EEEEEE",t)}function N6(e,t){return pt(e,"EEE",t)}function vb(e,t){return pt(sr(Ae(),e),"LLLL",t)}function jk(e,t){return pt(sr(Ae(),e),"LLL",t)}function j6(e,t){return pt(Os(Ae(),e),"QQQ",t)}function Dr(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.excludeDateIntervals,s=n.includeDates,l=n.includeDateIntervals,c=n.filterDate,u=n.disabled;return u?!0:fu(e,{minDate:r,maxDate:i})||o&&o.some(function(d){return d instanceof Date?Pe(e,d):Pe(e,d.date)})||a&&a.some(function(d){var f=d.start,p=d.end;return Mc(e,{start:f,end:p})})||s&&!s.some(function(d){return Pe(e,d)})||l&&!l.some(function(d){var f=d.start,p=d.end;return Mc(e,{start:f,end:p})})||c&&!c(Ae(e))||!1}function yb(e,t){var n=t===void 0?{}:t,r=n.excludeDates,i=n.excludeDateIntervals;return i&&i.length>0?i.some(function(o){var a=o.start,s=o.end;return Mc(e,{start:a,end:s})}):r&&r.some(function(o){var a;return o instanceof Date?Pe(e,o):Pe(e,(a=o.date)!==null&&a!==void 0?a:new Date)})||!1}function Rk(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.includeDates,s=n.filterDate;return fu(e,{minDate:r?ck(r):void 0,maxDate:i?lk(i):void 0})||o?.some(function(l){return Mn(e,l instanceof Date?l:l.date)})||a&&!a.some(function(l){return Mn(e,l)})||s&&!s(Ae(e))||!1}function Xu(e,t,n,r){var i=Ee(e),o=Kn(e),a=Ee(t),s=Kn(t),l=Ee(r);return i===a&&i===l?o<=n&&n<=s:i<a?l===i&&o<=n||l===a&&s>=n||l<a&&l>i:!1}function R6(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.includeDates;return fu(e,{minDate:r,maxDate:i})||o&&o.some(function(s){return Mn(s instanceof Date?s:s.date,e)})||a&&!a.some(function(s){return Mn(s,e)})||!1}function Qu(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.includeDates,s=n.filterDate,l=n.disabled;return l?!0:fu(e,{minDate:r,maxDate:i})||o?.some(function(c){return _f(e,c instanceof Date?c:c.date)})||a&&!a.some(function(c){return _f(e,c)})||s&&!s(Ae(e))||!1}function Zu(e,t,n){if(!t||!n||!zs(t)||!zs(n))return!1;var r=Ee(t),i=Ee(n);return r<=e&&i>=e}function Jd(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.includeDates,s=n.filterDate,l=n.disabled;if(l)return!0;var c=new Date(e,0,1);return fu(c,{minDate:r?Yp(r):void 0,maxDate:i?uk(i):void 0})||o?.some(function(u){return ci(c,u instanceof Date?u:u.date)})||a&&!a.some(function(u){return ci(c,u)})||s&&!s(Ae(c))||!1}function Ju(e,t,n,r){var i=Ee(e),o=jo(e),a=Ee(t),s=jo(t),l=Ee(r);return i===a&&i===l?o<=n&&n<=s:i<a?l===i&&o<=n||l===a&&s>=n||l<a&&l>i:!1}function fu(e,t){var n,r=t===void 0?{}:t,i=r.minDate,o=r.maxDate;return(n=i&&Ws(e,i)<0||o&&Ws(e,o)>0)!==null&&n!==void 0?n:!1}function Rw(e,t){return t.some(function(n){return xn(n)===xn(e)&&wn(n)===wn(e)&&Bo(n)===Bo(e)})}function Iw(e,t){var n=t===void 0?{}:t,r=n.excludeTimes,i=n.includeTimes,o=n.filterTime;return r&&Rw(e,r)||i&&!Rw(e,i)||o&&!o(e)||!1}function Lw(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var i=Ae();i=Gd(i,xn(e)),i=Xd(i,wn(e)),i=Qd(i,Bo(e));var o=Ae();o=Gd(o,xn(n)),o=Xd(o,wn(n)),o=Qd(o,Bo(n));var a=Ae();a=Gd(a,xn(r)),a=Xd(a,wn(r)),a=Qd(a,Bo(r));var s;try{s=!Mc(i,{start:o,end:a})}catch{s=!1}return s}function Fw(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,o=Ia(e,1);return r&&pf(r,o)>0||i&&i.every(function(a){return pf(a,o)>0})||!1}function $w(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,o=Xr(e,1);return r&&pf(o,r)>0||i&&i.every(function(a){return pf(o,a)>0})||!1}function I6(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,o=Yp(e),a=bk(o);return r&&hf(r,a)>0||i&&i.every(function(s){return hf(s,a)>0})||!1}function L6(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,o=uk(e),a=ab(o,1);return r&&hf(a,r)>0||i&&i.every(function(s){return hf(a,s)>0})||!1}function Bw(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,o=Ko(e,1);return r&&mf(r,o)>0||i&&i.every(function(a){return mf(a,o)>0})||!1}function F6(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.yearItemNumber,o=i===void 0?du:i,a=ac(Ko(e,o)),s=Ki(a,o).endPeriod,l=r&&Ee(r);return l&&l>s||!1}function Ww(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,o=Gr(e,1);return r&&mf(o,r)>0||i&&i.every(function(a){return mf(o,a)>0})||!1}function $6(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.yearItemNumber,o=i===void 0?du:i,a=Gr(e,o),s=Ki(a,o).startPeriod,l=r&&Ee(r);return l&&l<s||!1}function Ik(e){var t=e.minDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Ws(i,t)>=0});return uw(r)}else return n?uw(n):t}function Lk(e){var t=e.maxDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Ws(i,t)<=0});return cw(r)}else return n?cw(n):t}function zw(e,t){var n;e===void 0&&(e=[]),t===void 0&&(t="react-datepicker__day--highlighted");for(var r=new Map,i=0,o=e.length;i<o;i++){var a=e[i];if(vi(a)){var s=pt(a,"MM.dd.yyyy"),l=r.get(s)||[];l.includes(t)||(l.push(t),r.set(s,l))}else if(typeof a=="object"){var c=Object.keys(a),u=(n=c[0])!==null&&n!==void 0?n:"",d=a[u];if(typeof u=="string"&&Array.isArray(d))for(var f=0,p=d.length;f<p;f++){var h=d[f];if(h){var s=pt(h,"MM.dd.yyyy"),l=r.get(s)||[];l.includes(u)||(l.push(u),r.set(s,l))}}}}return r}function B6(e,t){return e.length!==t.length?!1:e.every(function(n,r){return n===t[r]})}function W6(e,t){e===void 0&&(e=[]),t===void 0&&(t="react-datepicker__day--holidays");var n=new Map;return e.forEach(function(r){var i=r.date,o=r.holidayName;if(vi(i)){var a=pt(i,"MM.dd.yyyy"),s=n.get(a)||{className:"",holidayNames:[]};if(!("className"in s&&s.className===t&&B6(s.holidayNames,[o]))){s.className=t;var l=s.holidayNames;s.holidayNames=l?hi(hi([],l,!0),[o],!1):[o],n.set(a,s)}}}),n}function z6(e,t,n,r,i){for(var o=i.length,a=[],s=0;s<o;s++){var l=e,c=i[s];c&&(l=N$(l,xn(c)),l=Tc(l,wn(c)),l=I$(l,Bo(c)));var u=Tc(e,(n+1)*r);Zi(l,t)&&pi(l,u)&&c!=null&&a.push(c)}return a}function vs(e){return e<10?"0".concat(e):"".concat(e)}function Ki(e,t){t===void 0&&(t=du);var n=Math.ceil(Ee(e)/t)*t,r=n-(t-1);return{startPeriod:r,endPeriod:n}}function V6(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),24);return Math.round((+n-+t)/36e5)}function Vw(e){var t=e.getSeconds(),n=e.getMilliseconds();return me(e.getTime()-t*1e3-n)}function Fk(e,t){return Vw(e).getTime()===Vw(t).getTime()}function Hw(e){if(!vi(e))throw new Error("Invalid date");var t=new Date(e);return t.setHours(0,0,0,0),t}function pm(e,t){if(!vi(e)||!vi(t))throw new Error("Invalid date received");var n=Hw(e),r=Hw(t);return pi(n,r)}function $k(e){return e.key===ne.Space}var hm=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.inputRef=P.createRef(),r.onTimeChange=function(i){var o,a;r.setState({time:i});var s=r.props.date,l=s instanceof Date&&!isNaN(+s),c=l?s:new Date;if(i?.includes(":")){var u=i.split(":"),d=u[0],f=u[1];c.setHours(Number(d)),c.setMinutes(Number(f))}(a=(o=r.props).onChange)===null||a===void 0||a.call(o,c)},r.renderTimeInput=function(){var i=r.state.time,o=r.props,a=o.date,s=o.timeString,l=o.customTimeInput;return l?P.cloneElement(l,{date:a,value:i,onChange:r.onTimeChange}):P.createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:r.inputRef,onClick:function(){var c;(c=r.inputRef.current)===null||c===void 0||c.focus()},required:!0,value:i,onChange:function(c){r.onTimeChange(c.target.value||s)}})},r.state={time:r.props.timeString},r}return t.getDerivedStateFromProps=function(n,r){return n.timeString!==r.time?{time:n.timeString}:null},t.prototype.render=function(){return P.createElement("div",{className:"react-datepicker__input-time-container"},P.createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),P.createElement("div",{className:"react-datepicker-time__input-container"},P.createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},t})(P.Component),H6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.dayEl=P.createRef(),n.handleClick=function(r){!n.isDisabled()&&n.props.onClick&&n.props.onClick(r)},n.handleMouseEnter=function(r){!n.isDisabled()&&n.props.onMouseEnter&&n.props.onMouseEnter(r)},n.handleOnKeyDown=function(r){var i,o,a=r.key;a===ne.Space&&(r.preventDefault(),r.key=ne.Enter),(o=(i=n.props).handleOnKeyDown)===null||o===void 0||o.call(i,r)},n.isSameDay=function(r){return Pe(n.props.day,r)},n.isKeyboardSelected=function(){var r;if(n.props.disabledKeyboardNavigation)return!1;var i=n.props.selectsMultiple?(r=n.props.selectedDates)===null||r===void 0?void 0:r.some(function(a){return n.isSameDayOrWeek(a)}):n.isSameDayOrWeek(n.props.selected),o=n.props.preSelection&&n.isDisabled(n.props.preSelection);return!i&&n.isSameDayOrWeek(n.props.preSelection)&&!o},n.isDisabled=function(r){return r===void 0&&(r=n.props.day),Dr(r,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals,includeDateIntervals:n.props.includeDateIntervals,includeDates:n.props.includeDates,filterDate:n.props.filterDate,disabled:n.props.disabled})},n.isExcluded=function(){return yb(n.props.day,{excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals})},n.isStartOfWeek=function(){return Pe(n.props.day,Wo(n.props.day,n.props.locale,n.props.calendarStartDay))},n.isSameWeek=function(r){return n.props.showWeekPicker&&Pe(r,Wo(n.props.day,n.props.locale,n.props.calendarStartDay))},n.isSameDayOrWeek=function(r){return n.isSameDay(r)||n.isSameWeek(r)},n.getHighLightedClass=function(){var r=n.props,i=r.day,o=r.highlightDates;if(!o)return!1;var a=pt(i,"MM.dd.yyyy");return o.get(a)},n.getHolidaysClass=function(){var r,i=n.props,o=i.day,a=i.holidays;if(!a)return[void 0];var s=pt(o,"MM.dd.yyyy");return a.has(s)?[(r=a.get(s))===null||r===void 0?void 0:r.className]:[void 0]},n.isInRange=function(){var r=n.props,i=r.day,o=r.startDate,a=r.endDate;return!o||!a?!1:ya(i,o,a)},n.isInSelectingRange=function(){var r,i=n.props,o=i.day,a=i.selectsStart,s=i.selectsEnd,l=i.selectsRange,c=i.selectsDisabledDaysInRange,u=i.startDate,d=i.swapRange,f=i.endDate,p=(r=n.props.selectingDate)!==null&&r!==void 0?r:n.props.preSelection;if(n.isAfterMonth()||n.isBeforeMonth()||!(a||s||l)||!p||!c&&n.isDisabled())return!1;if(a&&f&&(pi(p,f)||Aa(p,f)))return ya(o,p,f);if(s&&u&&(Zi(p,u)||Aa(p,u)))return ya(o,u,p);if(l&&u&&!f){if(Aa(p,u)||Zi(p,u))return ya(o,u,p);if(d&&pi(p,u))return ya(o,p,u)}return!1},n.isSelectingRangeStart=function(){var r;if(!n.isInSelectingRange())return!1;var i=n.props,o=i.day,a=i.startDate,s=i.selectsStart,l=i.swapRange,c=i.selectsRange,u=(r=n.props.selectingDate)!==null&&r!==void 0?r:n.props.preSelection;return s?Pe(o,u):c&&l&&a&&u?Pe(o,pi(u,a)?u:a):Pe(o,a)},n.isSelectingRangeEnd=function(){var r;if(!n.isInSelectingRange())return!1;var i=n.props,o=i.day,a=i.endDate,s=i.selectsEnd,l=i.selectsRange,c=i.swapRange,u=i.startDate,d=(r=n.props.selectingDate)!==null&&r!==void 0?r:n.props.preSelection;return s?Pe(o,d):l&&c&&u&&d?Pe(o,pi(d,u)?u:d):l?Pe(o,d):Pe(o,a)},n.isRangeStart=function(){var r=n.props,i=r.day,o=r.startDate,a=r.endDate;return!o||!a?!1:Pe(o,i)},n.isRangeEnd=function(){var r=n.props,i=r.day,o=r.startDate,a=r.endDate;return!o||!a?!1:Pe(a,i)},n.isWeekend=function(){var r=j5(n.props.day);return r===0||r===6},n.isAfterMonth=function(){return n.props.month!==void 0&&(n.props.month+1)%12===Kn(n.props.day)},n.isBeforeMonth=function(){return n.props.month!==void 0&&(Kn(n.props.day)+1)%12===n.props.month},n.isCurrentDay=function(){return n.isSameDay(Ae())},n.isSelected=function(){var r;return n.props.selectsMultiple?(r=n.props.selectedDates)===null||r===void 0?void 0:r.some(function(i){return n.isSameDayOrWeek(i)}):n.isSameDayOrWeek(n.props.selected)},n.getClassNames=function(r){var i=n.props.dayClassName?n.props.dayClassName(r):void 0;return oe("react-datepicker__day",i,"react-datepicker__day--"+k6(n.props.day),{"react-datepicker__day--disabled":n.isDisabled(),"react-datepicker__day--excluded":n.isExcluded(),"react-datepicker__day--selected":n.isSelected(),"react-datepicker__day--keyboard-selected":n.isKeyboardSelected(),"react-datepicker__day--range-start":n.isRangeStart(),"react-datepicker__day--range-end":n.isRangeEnd(),"react-datepicker__day--in-range":n.isInRange(),"react-datepicker__day--in-selecting-range":n.isInSelectingRange(),"react-datepicker__day--selecting-range-start":n.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":n.isSelectingRangeEnd(),"react-datepicker__day--today":n.isCurrentDay(),"react-datepicker__day--weekend":n.isWeekend(),"react-datepicker__day--outside-month":n.isAfterMonth()||n.isBeforeMonth()},n.getHighLightedClass(),n.getHolidaysClass())},n.getAriaLabel=function(){var r=n.props,i=r.day,o=r.ariaLabelPrefixWhenEnabled,a=o===void 0?"Choose":o,s=r.ariaLabelPrefixWhenDisabled,l=s===void 0?"Not available":s,c=n.isDisabled()||n.isExcluded()?l:a;return"".concat(c," ").concat(pt(i,"PPPP",n.props.locale))},n.getTitle=function(){var r=n.props,i=r.day,o=r.holidays,a=o===void 0?new Map:o,s=r.excludeDates,l=pt(i,"MM.dd.yyyy"),c=[];return a.has(l)&&c.push.apply(c,a.get(l).holidayNames),n.isExcluded()&&c.push(s?.filter(function(u){return u instanceof Date?Pe(u,i):Pe(u?.date,i)}).map(function(u){if(!(u instanceof Date))return u?.message})),c.join(", ")},n.getTabIndex=function(){var r=n.props.selected,i=n.props.preSelection,o=!(n.props.showWeekPicker&&(n.props.showWeekNumber||!n.isStartOfWeek()))&&(n.isKeyboardSelected()||n.isSameDay(r)&&Pe(i,r))?0:-1;return o},n.handleFocusDay=function(){var r;n.shouldFocusDay()&&((r=n.dayEl.current)===null||r===void 0||r.focus({preventScroll:!0}))},n.renderDayContents=function(){return n.props.monthShowsDuplicateDaysEnd&&n.isAfterMonth()||n.props.monthShowsDuplicateDaysStart&&n.isBeforeMonth()?null:n.props.renderDayContents?n.props.renderDayContents(vw(n.props.day),n.props.day):vw(n.props.day)},n.render=function(){return P.createElement("div",{ref:n.dayEl,className:n.getClassNames(n.props.day),onKeyDown:n.handleOnKeyDown,onClick:n.handleClick,onMouseEnter:n.props.usePointerEvent?void 0:n.handleMouseEnter,onPointerEnter:n.props.usePointerEvent?n.handleMouseEnter:void 0,tabIndex:n.getTabIndex(),"aria-label":n.getAriaLabel(),role:"gridcell",title:n.getTitle(),"aria-disabled":n.isDisabled(),"aria-current":n.isCurrentDay()?"date":void 0,"aria-selected":n.isSelected()||n.isInRange()},n.renderDayContents(),n.getTitle()!==""&&P.createElement("span",{className:"overlay"},n.getTitle()))},n}return t.prototype.componentDidMount=function(){this.handleFocusDay()},t.prototype.componentDidUpdate=function(){this.handleFocusDay()},t.prototype.shouldFocusDay=function(){var n=!1;return this.getTabIndex()===0&&this.isSameDay(this.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(n=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(n=!1),this.isDayActiveElement()&&(n=!0),this.isDuplicateDay()&&(n=!1)),n},t.prototype.isDayActiveElement=function(){var n,r,i;return((r=(n=this.props.containerRef)===null||n===void 0?void 0:n.current)===null||r===void 0?void 0:r.contains(document.activeElement))&&((i=document.activeElement)===null||i===void 0?void 0:i.classList.contains("react-datepicker__day"))},t.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},t})(P.Component),Y6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.weekNumberEl=P.createRef(),n.handleClick=function(r){n.props.onClick&&n.props.onClick(r)},n.handleOnKeyDown=function(r){var i,o,a=r.key;a===ne.Space&&(r.preventDefault(),r.key=ne.Enter),(o=(i=n.props).handleOnKeyDown)===null||o===void 0||o.call(i,r)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!Pe(n.props.date,n.props.selected)&&Pe(n.props.date,n.props.preSelection)},n.getTabIndex=function(){return n.props.showWeekPicker&&n.props.showWeekNumber&&(n.isKeyboardSelected()||Pe(n.props.date,n.props.selected)&&Pe(n.props.preSelection,n.props.selected))?0:-1},n.handleFocusWeekNumber=function(r){var i=!1;n.getTabIndex()===0&&!r?.isInputFocused&&Pe(n.props.date,n.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(i=!0),n.props.inline&&!n.props.shouldFocusDayInline&&(i=!1),n.props.containerRef&&n.props.containerRef.current&&n.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(i=!0)),i&&n.weekNumberEl.current&&n.weekNumberEl.current.focus({preventScroll:!0})},n}return Object.defineProperty(t,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},t.prototype.componentDidUpdate=function(n){this.handleFocusWeekNumber(n)},t.prototype.render=function(){var n=this.props,r=n.weekNumber,i=n.isWeekDisabled,o=n.ariaLabelPrefix,a=o===void 0?t.defaultProps.ariaLabelPrefix:o,s=n.onClick,l={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!s&&!i,"react-datepicker__week-number--selected":!!s&&Pe(this.props.date,this.props.selected)};return P.createElement("div",{ref:this.weekNumberEl,className:oe(l),"aria-label":"".concat(a," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex(),role:"gridcell"},r)},t})(P.Component),U6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.isDisabled=function(r){return Dr(r,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals,includeDateIntervals:n.props.includeDateIntervals,includeDates:n.props.includeDates,filterDate:n.props.filterDate})},n.handleDayClick=function(r,i){n.props.onDayClick&&n.props.onDayClick(r,i)},n.handleDayMouseEnter=function(r){n.props.onDayMouseEnter&&n.props.onDayMouseEnter(r)},n.handleWeekClick=function(r,i,o){for(var a,s,l,c=new Date(r),u=0;u<7;u++){var d=new Date(r);d.setDate(d.getDate()+u);var f=!n.isDisabled(d);if(f){c=d;break}}typeof n.props.onWeekSelect=="function"&&n.props.onWeekSelect(c,i,o),n.props.showWeekPicker&&n.handleDayClick(c,o),((a=n.props.shouldCloseOnSelect)!==null&&a!==void 0?a:t.defaultProps.shouldCloseOnSelect)&&((l=(s=n.props).setOpen)===null||l===void 0||l.call(s,!1))},n.formatWeekNumber=function(r){return n.props.formatWeekNumber?n.props.formatWeekNumber(r):P6(r)},n.isWeekDisabled=function(){for(var r=n.startOfWeek(),i=qr(r,6),o=new Date(r);o<=i;){if(!n.isDisabled(o))return!1;o=qr(o,1)}return!0},n.renderDays=function(){var r=n.startOfWeek(),i=[],o=n.formatWeekNumber(r);if(n.props.showWeekNumber){var a=n.props.onWeekSelect||n.props.showWeekPicker?n.handleWeekClick.bind(n,r,o):void 0;i.push(P.createElement(Y6,_e({key:"W"},t.defaultProps,n.props,{weekNumber:o,isWeekDisabled:n.isWeekDisabled(),date:r,onClick:a})))}return i.concat([0,1,2,3,4,5,6].map(function(s){var l=qr(r,s);return P.createElement(H6,_e({},t.defaultProps,n.props,{ariaLabelPrefixWhenEnabled:n.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:n.props.disabledDayAriaLabelPrefix,key:l.valueOf(),day:l,onClick:n.handleDayClick.bind(n,l),onMouseEnter:n.handleDayMouseEnter.bind(n,l)}))}))},n.startOfWeek=function(){return Wo(n.props.day,n.props.locale,n.props.calendarStartDay)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!Pe(n.startOfWeek(),n.props.selected)&&Pe(n.startOfWeek(),n.props.preSelection)},n}return Object.defineProperty(t,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var n={"react-datepicker__week":!0,"react-datepicker__week--selected":Pe(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()},r=this.props.weekClassName?this.props.weekClassName(this.startOfWeek()):void 0;return P.createElement("div",{className:oe(n,r),role:"row"},this.renderDays())},t})(P.Component),Fl,K6=6,Ms={TWO_COLUMNS:"two_columns",THREE_COLUMNS:"three_columns",FOUR_COLUMNS:"four_columns"},mm=(Fl={},Fl[Ms.TWO_COLUMNS]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},Fl[Ms.THREE_COLUMNS]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},Fl[Ms.FOUR_COLUMNS]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},Fl),ed=1;function Yw(e,t){return e?Ms.FOUR_COLUMNS:t?Ms.TWO_COLUMNS:Ms.THREE_COLUMNS}var q6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.MONTH_REFS=hi([],Array(12),!0).map(function(){return P.createRef()}),n.QUARTER_REFS=hi([],Array(4),!0).map(function(){return P.createRef()}),n.isDisabled=function(r){return Dr(r,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals,includeDateIntervals:n.props.includeDateIntervals,includeDates:n.props.includeDates,filterDate:n.props.filterDate,disabled:n.props.disabled})},n.isExcluded=function(r){return yb(r,{excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals})},n.handleDayClick=function(r,i){var o,a;(a=(o=n.props).onDayClick)===null||a===void 0||a.call(o,r,i,n.props.orderInDisplay)},n.handleDayMouseEnter=function(r){var i,o;(o=(i=n.props).onDayMouseEnter)===null||o===void 0||o.call(i,r)},n.handleMouseLeave=function(){var r,i;(i=(r=n.props).onMouseLeave)===null||i===void 0||i.call(r)},n.isRangeStartMonth=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate;return!a||!s?!1:Mn(sr(o,r),a)},n.isRangeStartQuarter=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate;return!a||!s?!1:_f(Os(o,r),a)},n.isRangeEndMonth=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate;return!a||!s?!1:Mn(sr(o,r),s)},n.isRangeEndQuarter=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate;return!a||!s?!1:_f(Os(o,r),s)},n.isInSelectingRangeMonth=function(r){var i,o=n.props,a=o.day,s=o.selectsStart,l=o.selectsEnd,c=o.selectsRange,u=o.startDate,d=o.endDate,f=(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection;return!(s||l||c)||!f?!1:s&&d?Xu(f,d,r,a):l&&u||c&&u&&!d?Xu(u,f,r,a):!1},n.isSelectingMonthRangeStart=function(r){var i;if(!n.isInSelectingRangeMonth(r))return!1;var o=n.props,a=o.day,s=o.startDate,l=o.selectsStart,c=sr(a,r),u=(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection;return l?Mn(c,u):Mn(c,s)},n.isSelectingMonthRangeEnd=function(r){var i;if(!n.isInSelectingRangeMonth(r))return!1;var o=n.props,a=o.day,s=o.endDate,l=o.selectsEnd,c=o.selectsRange,u=sr(a,r),d=(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection;return l||c?Mn(u,d):Mn(u,s)},n.isInSelectingRangeQuarter=function(r){var i,o=n.props,a=o.day,s=o.selectsStart,l=o.selectsEnd,c=o.selectsRange,u=o.startDate,d=o.endDate,f=(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection;return!(s||l||c)||!f?!1:s&&d?Ju(f,d,r,a):l&&u||c&&u&&!d?Ju(u,f,r,a):!1},n.isWeekInMonth=function(r){var i=n.props.day,o=qr(r,6);return Mn(r,i)||Mn(o,i)},n.isCurrentMonth=function(r,i){return Ee(r)===Ee(Ae())&&i===Kn(Ae())},n.isCurrentQuarter=function(r,i){return Ee(r)===Ee(Ae())&&i===jo(Ae())},n.isSelectedMonth=function(r,i,o){return Kn(o)===i&&Ee(r)===Ee(o)},n.isSelectMonthInList=function(r,i,o){return o.some(function(a){return n.isSelectedMonth(r,i,a)})},n.isSelectedQuarter=function(r,i,o){return jo(o)===i&&Ee(r)===Ee(o)},n.isSelectQuarterInList=function(r,i,o){return o.some(function(a){return n.isSelectedQuarter(r,i,a)})},n.isMonthSelected=function(){var r=n.props,i=r.day,o=r.selected,a=r.selectedDates,s=r.selectsMultiple,l=Kn(i);return s?a?.some(function(c){return n.isSelectedMonth(i,l,c)}):!!o&&n.isSelectedMonth(i,l,o)},n.isQuarterSelected=function(){var r=n.props,i=r.day,o=r.selected,a=r.selectedDates,s=r.selectsMultiple,l=jo(i);return s?a?.some(function(c){return n.isSelectedQuarter(i,l,c)}):!!o&&n.isSelectedQuarter(i,l,o)},n.renderWeeks=function(){if(!Un(n.props.day))return[];for(var r=[],i=n.props.fixedHeight,o=0,a=!1,s=Wo(Ji(n.props.day),n.props.locale,n.props.calendarStartDay),l=function(h){return n.props.showWeekPicker?Wo(h,n.props.locale,n.props.calendarStartDay):n.props.preSelection},c=function(h){return n.props.showWeekPicker?Wo(h,n.props.locale,n.props.calendarStartDay):n.props.selected},u=n.props.selected?c(n.props.selected):void 0,d=n.props.preSelection?l(n.props.preSelection):void 0;r.push(P.createElement(U6,_e({},n.props,{ariaLabelPrefix:n.props.weekAriaLabelPrefix,key:o,day:s,month:Kn(n.props.day),onDayClick:n.handleDayClick,onDayMouseEnter:n.handleDayMouseEnter,selected:u,preSelection:d,showWeekNumber:n.props.showWeekNumbers}))),!a;){o++,s=ff(s,1);var f=i&&o>=K6,p=!i&&!n.isWeekInMonth(s);if(f||p)if(n.props.peekNextMonth)a=!0;else break}return r},n.onMonthClick=function(r,i){var o=n.isMonthDisabledForLabelDate(i),a=o.isDisabled,s=o.labelDate;a||n.handleDayClick(Ji(s),r)},n.onMonthMouseEnter=function(r){var i=n.isMonthDisabledForLabelDate(r),o=i.isDisabled,a=i.labelDate;o||n.handleDayMouseEnter(Ji(a))},n.handleMonthNavigation=function(r,i){var o,a,s,l;(a=(o=n.props).setPreSelection)===null||a===void 0||a.call(o,i),(l=(s=n.MONTH_REFS[r])===null||s===void 0?void 0:s.current)===null||l===void 0||l.focus()},n.handleKeyboardNavigation=function(r,i,o){var a,s=n.props,l=s.selected,c=s.preSelection,u=s.setPreSelection,d=s.minDate,f=s.maxDate,p=s.showFourColumnMonthYearPicker,h=s.showTwoColumnMonthYearPicker;if(c){var m=Yw(p,h),g=n.getVerticalOffset(m),b=(a=mm[m])===null||a===void 0?void 0:a.grid,S=function(k,D,T){var j,A,C=D,N=T;switch(k){case ne.ArrowRight:C=Xr(D,ed),N=T===11?0:T+ed;break;case ne.ArrowLeft:C=Ia(D,ed),N=T===0?11:T-ed;break;case ne.ArrowUp:C=Ia(D,g),N=!((j=b?.[0])===null||j===void 0)&&j.includes(T)?T+12-g:T-g;break;case ne.ArrowDown:C=Xr(D,g),N=!((A=b?.[b.length-1])===null||A===void 0)&&A.includes(T)?T-12+g:T+g;break}return{newCalculatedDate:C,newCalculatedMonth:N}},w=function(k,D,T){for(var j=40,A=k,C=!1,N=0,M=S(A,D,T),I=M.newCalculatedDate,L=M.newCalculatedMonth;!C;){if(N>=j){I=D,L=T;break}if(d&&I<d){A=ne.ArrowRight;var $=S(A,I,L);I=$.newCalculatedDate,L=$.newCalculatedMonth}if(f&&I>f){A=ne.ArrowLeft;var $=S(A,I,L);I=$.newCalculatedDate,L=$.newCalculatedMonth}if(R6(I,n.props)){var $=S(A,I,L);I=$.newCalculatedDate,L=$.newCalculatedMonth}else C=!0;N++}return{newCalculatedDate:I,newCalculatedMonth:L}};if(i===ne.Enter){n.isMonthDisabled(o)||(n.onMonthClick(r,o),u?.(l));return}var x=w(i,c,o),_=x.newCalculatedDate,O=x.newCalculatedMonth;switch(i){case ne.ArrowRight:case ne.ArrowLeft:case ne.ArrowUp:case ne.ArrowDown:n.handleMonthNavigation(O,_);break}}},n.getVerticalOffset=function(r){var i,o;return(o=(i=mm[r])===null||i===void 0?void 0:i.verticalNavigationOffset)!==null&&o!==void 0?o:0},n.onMonthKeyDown=function(r,i){var o=n.props,a=o.disabledKeyboardNavigation,s=o.handleOnMonthKeyDown,l=r.key;l!==ne.Tab&&r.preventDefault(),a||n.handleKeyboardNavigation(r,l,i),s&&s(r)},n.onQuarterClick=function(r,i){var o=Os(n.props.day,i);Qu(o,n.props)||n.handleDayClick(Mw(o),r)},n.onQuarterMouseEnter=function(r){var i=Os(n.props.day,r);Qu(i,n.props)||n.handleDayMouseEnter(Mw(i))},n.handleQuarterNavigation=function(r,i){var o,a,s,l;n.isDisabled(i)||n.isExcluded(i)||((a=(o=n.props).setPreSelection)===null||a===void 0||a.call(o,i),(l=(s=n.QUARTER_REFS[r-1])===null||s===void 0?void 0:s.current)===null||l===void 0||l.focus())},n.onQuarterKeyDown=function(r,i){var o,a,s=r.key;if(!n.props.disabledKeyboardNavigation)switch(s){case ne.Enter:n.onQuarterClick(r,i),(a=(o=n.props).setPreSelection)===null||a===void 0||a.call(o,n.props.selected);break;case ne.ArrowRight:if(!n.props.preSelection)break;n.handleQuarterNavigation(i===4?1:i+1,ab(n.props.preSelection,1));break;case ne.ArrowLeft:if(!n.props.preSelection)break;n.handleQuarterNavigation(i===1?4:i-1,bk(n.props.preSelection));break}},n.isMonthDisabledForLabelDate=function(r){var i,o=n.props,a=o.day,s=o.disabled,l=o.minDate,c=o.maxDate,u=o.excludeDates,d=o.includeDates,f=sr(a,r);return s?{isDisabled:!0,labelDate:sr(a,r)}:{isDisabled:(i=(l||c||u||d)&&Rk(f,n.props))!==null&&i!==void 0?i:!1,labelDate:f}},n.isMonthDisabled=function(r){var i=n.isMonthDisabledForLabelDate(r).isDisabled;return i},n.getMonthClassNames=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate,l=i.preSelection,c=i.monthClassName,u=c?c(sr(o,r)):void 0,d=n.getSelection();return oe("react-datepicker__month-text","react-datepicker__month-".concat(r),u,{"react-datepicker__month-text--disabled":n.isMonthDisabled(r),"react-datepicker__month-text--selected":d?n.isSelectMonthInList(o,r,d):void 0,"react-datepicker__month-text--keyboard-selected":!n.props.disabledKeyboardNavigation&&l&&n.isSelectedMonth(o,r,l)&&!n.isMonthSelected()&&!n.isMonthDisabled(r),"react-datepicker__month-text--in-selecting-range":n.isInSelectingRangeMonth(r),"react-datepicker__month-text--in-range":a&&s?Xu(a,s,r,o):void 0,"react-datepicker__month-text--range-start":n.isRangeStartMonth(r),"react-datepicker__month-text--range-end":n.isRangeEndMonth(r),"react-datepicker__month-text--selecting-range-start":n.isSelectingMonthRangeStart(r),"react-datepicker__month-text--selecting-range-end":n.isSelectingMonthRangeEnd(r),"react-datepicker__month-text--today":n.isCurrentMonth(o,r)})},n.getTabIndex=function(r){if(n.props.preSelection==null)return"-1";var i=Kn(n.props.preSelection),o=n.isMonthDisabledForLabelDate(i).isDisabled,a=r===i&&!(o||n.props.disabledKeyboardNavigation)?"0":"-1";return a},n.getQuarterTabIndex=function(r){if(n.props.preSelection==null)return"-1";var i=jo(n.props.preSelection),o=Qu(n.props.day,n.props),a=r===i&&!(o||n.props.disabledKeyboardNavigation)?"0":"-1";return a},n.getAriaLabel=function(r){var i=n.props,o=i.chooseDayAriaLabelPrefix,a=o===void 0?"Choose":o,s=i.disabledDayAriaLabelPrefix,l=s===void 0?"Not available":s,c=i.day,u=i.locale,d=sr(c,r),f=n.isDisabled(d)||n.isExcluded(d)?l:a;return"".concat(f," ").concat(pt(d,"MMMM yyyy",u))},n.getQuarterClassNames=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate,l=i.minDate,c=i.maxDate,u=i.excludeDates,d=i.includeDates,f=i.filterDate,p=i.preSelection,h=i.disabledKeyboardNavigation,m=i.disabled,g=(l||c||u||d||f||m)&&Qu(Os(o,r),n.props),b=n.getSelection();return oe("react-datepicker__quarter-text","react-datepicker__quarter-".concat(r),{"react-datepicker__quarter-text--disabled":g,"react-datepicker__quarter-text--selected":b?n.isSelectQuarterInList(o,r,b):void 0,"react-datepicker__quarter-text--keyboard-selected":!h&&p&&n.isSelectedQuarter(o,r,p)&&!n.isQuarterSelected()&&!g,"react-datepicker__quarter-text--in-selecting-range":n.isInSelectingRangeQuarter(r),"react-datepicker__quarter-text--in-range":a&&s?Ju(a,s,r,o):void 0,"react-datepicker__quarter-text--range-start":n.isRangeStartQuarter(r),"react-datepicker__quarter-text--range-end":n.isRangeEndQuarter(r),"react-datepicker__quarter-text--today":n.isCurrentQuarter(o,r)})},n.getMonthContent=function(r){var i=n.props,o=i.showFullMonthYearPicker,a=i.renderMonthContent,s=i.locale,l=i.day,c=jk(r,s),u=vb(r,s);return a?a(r,c,u,l):o?u:c},n.getQuarterContent=function(r){var i,o=n.props,a=o.renderQuarterContent,s=o.locale,l=j6(r,s);return(i=a?.(r,l))!==null&&i!==void 0?i:l},n.renderMonths=function(){var r,i=n.props,o=i.showTwoColumnMonthYearPicker,a=i.showFourColumnMonthYearPicker,s=i.day,l=i.selected,c=(r=mm[Yw(a,o)])===null||r===void 0?void 0:r.grid;return c?.map(function(u,d){return P.createElement("div",{className:"react-datepicker__month-wrapper",key:d},u.map(function(f,p){return P.createElement("div",{ref:n.MONTH_REFS[f],key:p,onClick:function(h){n.onMonthClick(h,f)},onKeyDown:function(h){$k(h)&&(h.preventDefault(),h.key=ne.Enter),n.onMonthKeyDown(h,f)},onMouseEnter:n.props.usePointerEvent?void 0:function(){return n.onMonthMouseEnter(f)},onPointerEnter:n.props.usePointerEvent?function(){return n.onMonthMouseEnter(f)}:void 0,tabIndex:Number(n.getTabIndex(f)),className:n.getMonthClassNames(f),"aria-disabled":n.isMonthDisabled(f),role:"option","aria-label":n.getAriaLabel(f),"aria-current":n.isCurrentMonth(s,f)?"date":void 0,"aria-selected":l?n.isSelectedMonth(s,f,l):void 0},n.getMonthContent(f))}))})},n.renderQuarters=function(){var r=n.props,i=r.day,o=r.selected,a=[1,2,3,4];return P.createElement("div",{className:"react-datepicker__quarter-wrapper"},a.map(function(s,l){return P.createElement("div",{key:l,ref:n.QUARTER_REFS[l],role:"option",onClick:function(c){n.onQuarterClick(c,s)},onKeyDown:function(c){n.onQuarterKeyDown(c,s)},onMouseEnter:n.props.usePointerEvent?void 0:function(){return n.onQuarterMouseEnter(s)},onPointerEnter:n.props.usePointerEvent?function(){return n.onQuarterMouseEnter(s)}:void 0,className:n.getQuarterClassNames(s),"aria-selected":o?n.isSelectedQuarter(i,s,o):void 0,tabIndex:Number(n.getQuarterTabIndex(s)),"aria-current":n.isCurrentQuarter(i,s)?"date":void 0},n.getQuarterContent(s))}))},n.getClassNames=function(){var r=n.props,i=r.selectingDate,o=r.selectsStart,a=r.selectsEnd,s=r.showMonthYearPicker,l=r.showQuarterYearPicker,c=r.showWeekPicker;return oe("react-datepicker__month",{"react-datepicker__month--selecting-range":i&&(o||a)},{"react-datepicker__monthPicker":s},{"react-datepicker__quarterPicker":l},{"react-datepicker__weekPicker":c})},n}return t.prototype.getSelection=function(){var n=this.props,r=n.selected,i=n.selectedDates,o=n.selectsMultiple;if(o)return i;if(r)return[r]},t.prototype.render=function(){var n=this.props,r=n.showMonthYearPicker,i=n.showQuarterYearPicker,o=n.day,a=n.ariaLabelPrefix,s=a===void 0?"Month ":a,l=s?s.trim()+" ":"",c=Un(o)?"".concat(l).concat(pt(o,"MMMM, yyyy",this.props.locale)):"",u=r||i;return u?P.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":c,role:"listbox"},r?this.renderMonths():this.renderQuarters()):P.createElement("div",{role:"table"},this.props.dayNamesHeader&&P.createElement("div",{role:"rowgroup"},this.props.dayNamesHeader),this.props.monthHeader&&P.createElement("div",{role:"rowgroup"},this.props.monthHeader),P.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":c,role:"rowgroup"},this.renderWeeks()),this.props.monthFooter&&P.createElement("div",{role:"rowgroup"},this.props.monthFooter))},t})(P.Component),G6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.monthOptionButtonsRef={},n.isSelectedMonth=function(r){return n.props.month===r},n.handleOptionKeyDown=function(r,i){var o;switch(i.key){case"Enter":i.preventDefault(),n.onChange(r);break;case"Escape":i.preventDefault(),n.props.onCancel();break;case"ArrowUp":case"ArrowDown":{i.preventDefault();var a=(r+(i.key==="ArrowUp"?-1:1)+n.props.monthNames.length)%n.props.monthNames.length;(o=n.monthOptionButtonsRef[a])===null||o===void 0||o.focus();break}}},n.renderOptions=function(){return n.monthOptionButtonsRef={},n.props.monthNames.map(function(r,i){return P.createElement("div",{ref:function(o){n.monthOptionButtonsRef[i]=o,n.isSelectedMonth(i)&&o?.focus()},role:"button",tabIndex:0,className:n.isSelectedMonth(i)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:r,onClick:n.onChange.bind(n,i),onKeyDown:n.handleOptionKeyDown.bind(n,i),"aria-selected":n.isSelectedMonth(i)?"true":void 0},n.isSelectedMonth(i)?P.createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",r)})},n.onChange=function(r){return n.props.onChange(r)},n.handleClickOutside=function(){return n.props.onCancel()},n}return t.prototype.render=function(){return P.createElement(Qp,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},t})(P.Component),X6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={dropdownVisible:!1},n.renderSelectOptions=function(r){return r.map(function(i,o){return P.createElement("option",{key:i,value:o},i)})},n.renderSelectMode=function(r){return P.createElement("select",{value:n.props.month,className:"react-datepicker__month-select",onChange:function(i){return n.onChange(parseInt(i.target.value))}},n.renderSelectOptions(r))},n.renderReadView=function(r,i){return P.createElement("button",{key:"read",type:"button",style:{visibility:r?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:n.toggleDropdown},P.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},i[n.props.month]))},n.renderDropdown=function(r){return P.createElement(G6,_e({key:"dropdown"},n.props,{monthNames:r,onChange:n.onChange,onCancel:n.toggleDropdown}))},n.renderScrollMode=function(r){var i=n.state.dropdownVisible,o=[n.renderReadView(!i,r)];return i&&o.unshift(n.renderDropdown(r)),o},n.onChange=function(r){n.toggleDropdown(),r!==n.props.month&&n.props.onChange(r)},n.toggleDropdown=function(){return n.setState({dropdownVisible:!n.state.dropdownVisible})},n}return t.prototype.render=function(){var n=this,r=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(o){return jk(o,n.props.locale)}:function(o){return vb(o,n.props.locale)}),i;switch(this.props.dropdownMode){case"scroll":i=this.renderScrollMode(r);break;case"select":i=this.renderSelectMode(r);break}return P.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},i)},t})(P.Component),Uw=5;function Q6(e,t,n){for(var r=[],i=e??Ko(n,Uw),o=t??Gr(n,Uw),a=Ji(i),s=Ji(o);!Zi(a,s);)r.push(Ae(a)),a=Xr(a,1);return r}var Z6=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.renderOptions=function(){return r.state.monthYearsList.map(function(i){var o=Pv(i),a=ci(r.props.date,i)&&Mn(r.props.date,i);return P.createElement("div",{className:a?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:o,onClick:r.onChange.bind(r,o),"aria-selected":a?"true":void 0},a?P.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",pt(i,r.props.dateFormat,r.props.locale))})},r.onChange=function(i){return r.props.onChange(i)},r.handleClickOutside=function(){r.props.onCancel()},r.state={monthYearsList:Q6(r.props.minDate,r.props.maxDate,r.props.date)},r}return t.prototype.render=function(){var n=oe({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return P.createElement(Qp,{className:n,onClickOutside:this.handleClickOutside},this.renderOptions())},t})(P.Component),Kw=5,J6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={dropdownVisible:!1},n.renderSelectOptions=function(){for(var r,i,o=(r=n.props.minDate)!==null&&r!==void 0?r:Ko(n.props.date,Kw),a=(i=n.props.maxDate)!==null&&i!==void 0?i:Gr(n.props.date,Kw),s=Ji(o),l=Ji(a),c=[];!Zi(s,l);){var u=Pv(s);c.push(P.createElement("option",{key:u,value:u},pt(s,n.props.dateFormat,n.props.locale))),s=Xr(s,1)}return c},n.onSelectChange=function(r){n.onChange(parseInt(r.target.value))},n.renderSelectMode=function(){return P.createElement("select",{value:Pv(Ji(n.props.date)),className:"react-datepicker__month-year-select",onChange:n.onSelectChange},n.renderSelectOptions())},n.renderReadView=function(r){var i=pt(n.props.date,n.props.dateFormat,n.props.locale);return P.createElement("div",{key:"read",style:{visibility:r?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:n.toggleDropdown},P.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},i))},n.renderDropdown=function(){return P.createElement(Z6,_e({key:"dropdown"},n.props,{onChange:n.onChange,onCancel:n.toggleDropdown}))},n.renderScrollMode=function(){var r=n.state.dropdownVisible,i=[n.renderReadView(!r)];return r&&i.unshift(n.renderDropdown()),i},n.onChange=function(r){n.toggleDropdown();var i=Ae(r);ci(n.props.date,i)&&Mn(n.props.date,i)||n.props.onChange(i)},n.toggleDropdown=function(){return n.setState({dropdownVisible:!n.state.dropdownVisible})},n}return t.prototype.render=function(){var n;switch(this.props.dropdownMode){case"scroll":n=this.renderScrollMode();break;case"select":n=this.renderSelectMode();break}return P.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},n)},t})(P.Component),e3=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={height:null},n.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var r,i,o;n.list&&(n.list.scrollTop=(o=n.centerLi&&t.calcCenterPosition(n.props.monthRef?n.props.monthRef.clientHeight-((i=(r=n.header)===null||r===void 0?void 0:r.clientHeight)!==null&&i!==void 0?i:0):n.list.clientHeight,n.centerLi))!==null&&o!==void 0?o:0)})},n.handleClick=function(r){var i,o;(n.props.minTime||n.props.maxTime)&&Lw(r,n.props)||(n.props.excludeTimes||n.props.includeTimes||n.props.filterTime)&&Iw(r,n.props)||(o=(i=n.props).onChange)===null||o===void 0||o.call(i,r)},n.isSelectedTime=function(r){var i=Da(n.props.selected);return i&&Fk(i,r)},n.isDisabledTime=function(r){return(n.props.minTime||n.props.maxTime)&&Lw(r,n.props)||(n.props.excludeTimes||n.props.includeTimes||n.props.filterTime)&&Iw(r,n.props)},n.liClasses=function(r){var i,o=["react-datepicker__time-list-item",n.props.timeClassName?n.props.timeClassName(r):void 0];return n.isSelectedTime(r)&&o.push("react-datepicker__time-list-item--selected"),n.isDisabledTime(r)&&o.push("react-datepicker__time-list-item--disabled"),n.props.injectTimes&&(xn(r)*3600+wn(r)*60+Bo(r))%(((i=n.props.intervals)!==null&&i!==void 0?i:t.defaultProps.intervals)*60)!==0&&o.push("react-datepicker__time-list-item--injected"),o.join(" ")},n.handleOnKeyDown=function(r,i){var o,a;r.key===ne.Space&&(r.preventDefault(),r.key=ne.Enter),(r.key===ne.ArrowUp||r.key===ne.ArrowLeft)&&r.target instanceof HTMLElement&&r.target.previousSibling&&(r.preventDefault(),r.target.previousSibling instanceof HTMLElement&&r.target.previousSibling.focus()),(r.key===ne.ArrowDown||r.key===ne.ArrowRight)&&r.target instanceof HTMLElement&&r.target.nextSibling&&(r.preventDefault(),r.target.nextSibling instanceof HTMLElement&&r.target.nextSibling.focus()),r.key===ne.Enter&&n.handleClick(i),(a=(o=n.props).handleOnKeyDown)===null||a===void 0||a.call(o,r)},n.renderTimes=function(){for(var r,i=[],o=typeof n.props.format=="string"?n.props.format:"p",a=(r=n.props.intervals)!==null&&r!==void 0?r:t.defaultProps.intervals,s=Da(n.props.selected)||Da(n.props.openToDate)||Ae(),l=oc(s),c=n.props.injectTimes&&n.props.injectTimes.sort(function(g,b){return g.getTime()-b.getTime()}),u=60*V6(s),d=u/a,f=0;f<d;f++){var p=Tc(l,f*a);if(i.push(p),c){var h=z6(l,p,f,a,c);i=i.concat(h)}}var m=i.reduce(function(g,b){return b.getTime()<=s.getTime()?b:g},i[0]);return i.map(function(g){return P.createElement("li",{key:g.valueOf(),onClick:n.handleClick.bind(n,g),className:n.liClasses(g),ref:function(b){g===m&&(n.centerLi=b)},onKeyDown:function(b){n.handleOnKeyDown(b,g)},tabIndex:g===m?0:-1,role:"option","aria-selected":n.isSelectedTime(g)?"true":void 0,"aria-disabled":n.isDisabledTime(g)?"true":void 0},pt(g,o,n.props.locale))})},n.renderTimeCaption=function(){return n.props.showTimeCaption===!1?P.createElement(P.Fragment,null):P.createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(n.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(r){n.header=r}},P.createElement("div",{className:"react-datepicker-time__header"},n.props.timeCaption))},n}return Object.defineProperty(t,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},t.prototype.componentWillUnmount=function(){var n;(n=this.resizeObserver)===null||n===void 0||n.disconnect()},t.prototype.observeDatePickerHeightChanges=function(){var n=this,r=this.props.monthRef;this.updateContainerHeight(),r&&(this.resizeObserver=new ResizeObserver(function(){n.updateContainerHeight()}),this.resizeObserver.observe(r))},t.prototype.updateContainerHeight=function(){if(this.props.monthRef&&this.header){var n=this.props.monthRef.clientHeight-this.header.clientHeight;this.state.height!==n&&this.setState({height:n})}},t.prototype.render=function(){var n=this,r,i=this.state.height;return P.createElement("div",{className:"react-datepicker__time-container ".concat(((r=this.props.todayButton)!==null&&r!==void 0?r:t.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),P.createElement("div",{className:"react-datepicker__time"},P.createElement("div",{className:"react-datepicker__time-box"},P.createElement("ul",{className:"react-datepicker__time-list",ref:function(o){n.list=o},style:i?{height:i}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},t.calcCenterPosition=function(n,r){return r.offsetTop-(n/2-r.clientHeight/2)},t})(P.Component),qw=3,t3=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.YEAR_REFS=hi([],Array(r.props.yearItemNumber),!0).map(function(){return P.createRef()}),r.isDisabled=function(i){return Dr(i,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(i){return yb(i,{excludeDates:r.props.excludeDates})},r.selectingDate=function(){var i;return(i=r.props.selectingDate)!==null&&i!==void 0?i:r.props.preSelection},r.updateFocusOnPaginate=function(i){var o=function(){var a,s;(s=(a=r.YEAR_REFS[i])===null||a===void 0?void 0:a.current)===null||s===void 0||s.focus()};window.requestAnimationFrame(o)},r.handleYearClick=function(i,o){r.props.onDayClick&&r.props.onDayClick(i,o)},r.handleYearNavigation=function(i,o){var a,s,l,c,u=r.props,d=u.date,f=u.yearItemNumber;if(!(d===void 0||f===void 0)){var p=Ki(d,f).startPeriod;r.isDisabled(o)||r.isExcluded(o)||((s=(a=r.props).setPreSelection)===null||s===void 0||s.call(a,o),i-p<0?r.updateFocusOnPaginate(f-(p-i)):i-p>=f?r.updateFocusOnPaginate(Math.abs(f-(i-p))):(c=(l=r.YEAR_REFS[i-p])===null||l===void 0?void 0:l.current)===null||c===void 0||c.focus())}},r.isSameDay=function(i,o){return Pe(i,o)},r.isCurrentYear=function(i){return i===Ee(Ae())},r.isRangeStart=function(i){return r.props.startDate&&r.props.endDate&&ci(ai(Ae(),i),r.props.startDate)},r.isRangeEnd=function(i){return r.props.startDate&&r.props.endDate&&ci(ai(Ae(),i),r.props.endDate)},r.isInRange=function(i){return Zu(i,r.props.startDate,r.props.endDate)},r.isInSelectingRange=function(i){var o=r.props,a=o.selectsStart,s=o.selectsEnd,l=o.selectsRange,c=o.startDate,u=o.endDate;return!(a||s||l)||!r.selectingDate()?!1:a&&u?Zu(i,r.selectingDate(),u):s&&c||l&&c&&!u?Zu(i,c,r.selectingDate()):!1},r.isSelectingRangeStart=function(i){var o;if(!r.isInSelectingRange(i))return!1;var a=r.props,s=a.startDate,l=a.selectsStart,c=ai(Ae(),i);return l?ci(c,(o=r.selectingDate())!==null&&o!==void 0?o:null):ci(c,s??null)},r.isSelectingRangeEnd=function(i){var o;if(!r.isInSelectingRange(i))return!1;var a=r.props,s=a.endDate,l=a.selectsEnd,c=a.selectsRange,u=ai(Ae(),i);return l||c?ci(u,(o=r.selectingDate())!==null&&o!==void 0?o:null):ci(u,s??null)},r.isKeyboardSelected=function(i){if(!(r.props.disabledKeyboardNavigation||r.props.date===void 0||r.props.preSelection==null)){var o=r.props,a=o.minDate,s=o.maxDate,l=o.excludeDates,c=o.includeDates,u=o.filterDate,d=o.selected,f=ac(ai(r.props.date,i)),p=(a||s||l||c||u)&&Jd(i,r.props),h=!!d&&Pe(f,ac(d)),m=Pe(f,ac(r.props.preSelection));return!r.props.inline&&!h&&m&&!p}},r.isSelectedYear=function(i){var o=r.props,a=o.selectsMultiple,s=o.selected,l=o.selectedDates;return a?l?.some(function(c){return i===Ee(c)}):!!s&&i===Ee(s)},r.onYearClick=function(i,o){var a=r.props.date;a!==void 0&&r.handleYearClick(ac(ai(a,o)),i)},r.onYearKeyDown=function(i,o){var a,s,l=i.key,c=r.props,u=c.date,d=c.yearItemNumber,f=c.handleOnKeyDown;if(l!==ne.Tab&&i.preventDefault(),!r.props.disabledKeyboardNavigation)switch(l){case ne.Enter:if(r.props.selected==null)break;r.onYearClick(i,o),(s=(a=r.props).setPreSelection)===null||s===void 0||s.call(a,r.props.selected);break;case ne.ArrowRight:if(r.props.preSelection==null)break;r.handleYearNavigation(o+1,Gr(r.props.preSelection,1));break;case ne.ArrowLeft:if(r.props.preSelection==null)break;r.handleYearNavigation(o-1,Ko(r.props.preSelection,1));break;case ne.ArrowUp:{if(u===void 0||d===void 0||r.props.preSelection==null)break;var p=Ki(u,d).startPeriod,h=qw,m=o-h;if(m<p){var g=d%h;o>=p&&o<p+g?h=g:h+=g,m=o-h}r.handleYearNavigation(m,Ko(r.props.preSelection,h));break}case ne.ArrowDown:{if(u===void 0||d===void 0||r.props.preSelection==null)break;var b=Ki(u,d).endPeriod,h=qw,m=o+h;if(m>b){var g=d%h;o<=b&&o>b-g?h=g:h+=g,m=o+h}r.handleYearNavigation(m,Gr(r.props.preSelection,h));break}}f&&f(i)},r.getYearClassNames=function(i){var o=r.props,a=o.date,s=o.disabled,l=o.minDate,c=o.maxDate,u=o.excludeDates,d=o.includeDates,f=o.filterDate,p=o.yearClassName;return oe("react-datepicker__year-text","react-datepicker__year-".concat(i),a?p?.(ai(a,i)):void 0,{"react-datepicker__year-text--selected":r.isSelectedYear(i),"react-datepicker__year-text--disabled":(l||c||u||d||f||s)&&Jd(i,r.props),"react-datepicker__year-text--keyboard-selected":r.isKeyboardSelected(i),"react-datepicker__year-text--range-start":r.isRangeStart(i),"react-datepicker__year-text--range-end":r.isRangeEnd(i),"react-datepicker__year-text--in-range":r.isInRange(i),"react-datepicker__year-text--in-selecting-range":r.isInSelectingRange(i),"react-datepicker__year-text--selecting-range-start":r.isSelectingRangeStart(i),"react-datepicker__year-text--selecting-range-end":r.isSelectingRangeEnd(i),"react-datepicker__year-text--today":r.isCurrentYear(i)})},r.getYearTabIndex=function(i){if(r.props.disabledKeyboardNavigation||r.props.preSelection==null)return"-1";var o=Ee(r.props.preSelection),a=Jd(i,r.props);return i===o&&!a?"0":"-1"},r.getYearContent=function(i){return r.props.renderYearContent?r.props.renderYearContent(i):i},r}return t.prototype.render=function(){var n=this,r=[],i=this.props,o=i.date,a=i.yearItemNumber,s=i.onYearMouseEnter,l=i.onYearMouseLeave;if(o===void 0)return null;for(var c=Ki(o,a),u=c.startPeriod,d=c.endPeriod,f=function(m){r.push(P.createElement("div",{ref:p.YEAR_REFS[m-u],onClick:function(g){n.onYearClick(g,m)},onKeyDown:function(g){$k(g)&&(g.preventDefault(),g.key=ne.Enter),n.onYearKeyDown(g,m)},tabIndex:Number(p.getYearTabIndex(m)),className:p.getYearClassNames(m),onMouseEnter:p.props.usePointerEvent?void 0:function(g){return s(g,m)},onPointerEnter:p.props.usePointerEvent?function(g){return s(g,m)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(g){return l(g,m)},onPointerLeave:p.props.usePointerEvent?function(g){return l(g,m)}:void 0,key:m,"aria-current":p.isCurrentYear(m)?"date":void 0},p.getYearContent(m)))},p=this,h=u;h<=d;h++)f(h);return P.createElement("div",{className:"react-datepicker__year"},P.createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},r))},t})(P.Component);function n3(e,t,n,r){for(var i=[],o=0;o<2*t+1;o++){var a=e+t-o,s=!0;n&&(s=Ee(n)<=a),r&&s&&(s=Ee(r)>=a),s&&i.push(a)}return i}var r3=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;r.yearOptionButtonsRef={},r.handleOptionKeyDown=function(s,l){var c;switch(l.key){case"Enter":l.preventDefault(),r.onChange(s);break;case"Escape":l.preventDefault(),r.props.onCancel();break;case"ArrowUp":case"ArrowDown":{l.preventDefault();var u=s+(l.key==="ArrowUp"?1:-1);r.yearOptionButtonsRef[u]&&((c=r.yearOptionButtonsRef[u])===null||c===void 0||c.focus());break}}},r.renderOptions=function(){r.yearOptionButtonsRef={};var s=r.props.year,l=r.state.yearsList.map(function(d){return P.createElement("div",{ref:function(f){r.yearOptionButtonsRef[d]=f,d===s&&f?.focus()},role:"button",tabIndex:0,className:s===d?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:d,onClick:r.onChange.bind(r,d),onKeyDown:r.handleOptionKeyDown.bind(r,d),"aria-selected":s===d?"true":void 0},s===d?P.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",d)}),c=r.props.minDate?Ee(r.props.minDate):null,u=r.props.maxDate?Ee(r.props.maxDate):null;return(!u||!r.state.yearsList.find(function(d){return d===u}))&&l.unshift(P.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:r.incrementYears},P.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!c||!r.state.yearsList.find(function(d){return d===c}))&&l.push(P.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:r.decrementYears},P.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),l},r.onChange=function(s){r.props.onChange(s)},r.handleClickOutside=function(){r.props.onCancel()},r.shiftYears=function(s){var l=r.state.yearsList.map(function(c){return c+s});r.setState({yearsList:l})},r.incrementYears=function(){return r.shiftYears(1)},r.decrementYears=function(){return r.shiftYears(-1)};var i=n.yearDropdownItemNumber,o=n.scrollableYearDropdown,a=i||(o?10:5);return r.state={yearsList:n3(r.props.year,a,r.props.minDate,r.props.maxDate)},r.dropdownRef=P.createRef(),r}return t.prototype.componentDidMount=function(){var n=this.dropdownRef.current;if(n){var r=n.children?Array.from(n.children):null,i=r?r.find(function(o){return o.ariaSelected}):null;n.scrollTop=i&&i instanceof HTMLElement?i.offsetTop+(i.clientHeight-n.clientHeight)/2:(n.scrollHeight-n.clientHeight)/2}},t.prototype.render=function(){var n=oe({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return P.createElement(Qp,{className:n,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},t})(P.Component),i3=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={dropdownVisible:!1},n.renderSelectOptions=function(){for(var r=n.props.minDate?Ee(n.props.minDate):1900,i=n.props.maxDate?Ee(n.props.maxDate):2100,o=[],a=r;a<=i;a++)o.push(P.createElement("option",{key:a,value:a},a));return o},n.onSelectChange=function(r){n.onChange(parseInt(r.target.value))},n.renderSelectMode=function(){return P.createElement("select",{value:n.props.year,className:"react-datepicker__year-select",onChange:n.onSelectChange},n.renderSelectOptions())},n.renderReadView=function(r){return P.createElement("button",{key:"read",type:"button",style:{visibility:r?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:n.toggleDropdown},P.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},n.props.year))},n.renderDropdown=function(){return P.createElement(r3,_e({key:"dropdown"},n.props,{onChange:n.onChange,onCancel:n.toggleDropdown}))},n.renderScrollMode=function(){var r=n.state.dropdownVisible,i=[n.renderReadView(!r)];return r&&i.unshift(n.renderDropdown()),i},n.onChange=function(r){n.toggleDropdown(),r!==n.props.year&&n.props.onChange(r)},n.toggleDropdown=function(r){n.setState({dropdownVisible:!n.state.dropdownVisible},function(){n.props.adjustDateOnChange&&n.handleYearChange(n.props.date,r)})},n.handleYearChange=function(r,i){var o;(o=n.onSelect)===null||o===void 0||o.call(n,r,i),n.setOpen()},n.onSelect=function(r,i){var o,a;(a=(o=n.props).onSelect)===null||a===void 0||a.call(o,r,i)},n.setOpen=function(){var r,i;(i=(r=n.props).setOpen)===null||i===void 0||i.call(r,!0)},n}return t.prototype.render=function(){var n;switch(this.props.dropdownMode){case"scroll":n=this.renderScrollMode();break;case"select":n=this.renderSelectMode();break}return P.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},n)},t})(P.Component),o3=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],Bk="react-datepicker-ignore-onclickoutside",a3=function(e){var t=(e.className||"").split(/\s+/);return o3.some(function(n){return t.indexOf(n)>=0})},s3=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.monthContainer=void 0,r.handleClickOutside=function(i){r.props.onClickOutside(i)},r.setClickOutsideRef=function(){return r.containerRef.current},r.handleDropdownFocus=function(i){var o,a;a3(i.target)&&((a=(o=r.props).onDropdownFocus)===null||a===void 0||a.call(o,i))},r.getDateInView=function(){var i=r.props,o=i.preSelection,a=i.selected,s=i.openToDate,l=Ik(r.props),c=Lk(r.props),u=Ae(),d=s||a||o;return d||(l&&pi(u,l)?l:c&&Zi(u,c)?c:u)},r.increaseMonth=function(){r.setState(function(i){var o=i.date;return{date:Xr(o,1)}},function(){return r.handleMonthChange(r.state.date)})},r.decreaseMonth=function(){r.setState(function(i){var o=i.date;return{date:Ia(o,1)}},function(){return r.handleMonthChange(r.state.date)})},r.handleDayClick=function(i,o,a){r.props.onSelect(i,o,a),r.props.setPreSelection&&r.props.setPreSelection(i)},r.handleDayMouseEnter=function(i){r.setState({selectingDate:i}),r.props.onDayMouseEnter&&r.props.onDayMouseEnter(i)},r.handleMonthMouseLeave=function(){r.setState({selectingDate:void 0}),r.props.onMonthMouseLeave&&r.props.onMonthMouseLeave()},r.handleYearMouseEnter=function(i,o){r.setState({selectingDate:ai(Ae(),o)}),r.props.onYearMouseEnter&&r.props.onYearMouseEnter(i,o)},r.handleYearMouseLeave=function(i,o){r.props.onYearMouseLeave&&r.props.onYearMouseLeave(i,o)},r.handleYearChange=function(i){var o,a,s,l;(a=(o=r.props).onYearChange)===null||a===void 0||a.call(o,i),r.setState({isRenderAriaLiveMessage:!0}),r.props.adjustDateOnChange&&(r.props.onSelect(i),(l=(s=r.props).setOpen)===null||l===void 0||l.call(s,!0)),r.props.setPreSelection&&r.props.setPreSelection(i)},r.getEnabledPreSelectionDateForMonth=function(i){if(!Dr(i,r.props))return i;for(var o=Ji(i),a=A6(i),s=F$(a,o),l=null,c=0;c<=s;c++){var u=qr(o,c);if(!Dr(u,r.props)){l=u;break}}return l},r.handleMonthChange=function(i){var o,a,s,l=(o=r.getEnabledPreSelectionDateForMonth(i))!==null&&o!==void 0?o:i;r.handleCustomMonthChange(l),r.props.adjustDateOnChange&&(r.props.onSelect(l),(s=(a=r.props).setOpen)===null||s===void 0||s.call(a,!0)),r.props.setPreSelection&&r.props.setPreSelection(l)},r.handleCustomMonthChange=function(i){var o,a;(a=(o=r.props).onMonthChange)===null||a===void 0||a.call(o,i),r.setState({isRenderAriaLiveMessage:!0})},r.handleMonthYearChange=function(i){r.handleYearChange(i),r.handleMonthChange(i)},r.changeYear=function(i){r.setState(function(o){var a=o.date;return{date:ai(a,Number(i))}},function(){return r.handleYearChange(r.state.date)})},r.changeMonth=function(i){r.setState(function(o){var a=o.date;return{date:sr(a,Number(i))}},function(){var o,a;r.handleMonthChange(r.state.date),(a=(o=r.props).onMonthSelectedInChange)===null||a===void 0||a.call(o,0)})},r.changeMonthYear=function(i){r.setState(function(o){var a=o.date;return{date:ai(sr(a,Kn(i)),Ee(i))}},function(){return r.handleMonthYearChange(r.state.date)})},r.header=function(i,o){if(i===void 0&&(i=r.state.date),o===void 0&&(o=0),!Un(i))return[];var a=r.props.disabled,s=Wo(i,r.props.locale,r.props.calendarStartDay),l=[];return r.props.showWeekNumbers&&l.push(P.createElement("div",{key:"W",className:"react-datepicker__day-name ".concat(a?"react-datepicker__day-name--disabled":""),role:"columnheader"},P.createElement("span",{className:"react-datepicker__sr-only"},"Week number"),P.createElement("span",{"aria-hidden":"true"},r.props.weekLabel||"#"))),l.concat([0,1,2,3,4,5,6].map(function(c){var u=qr(s,c),d=r.formatWeekday(u,r.props.locale),f=pt(u,"EEEE",r.props.locale),p=r.props.weekDayClassName?r.props.weekDayClassName(u):void 0;if(r.props.renderCustomDayName){var h=r.props.renderCustomDayName({day:u,shortName:d,fullName:f,locale:r.props.locale,customDayNameCount:o});return P.createElement("div",{key:c,role:"columnheader",className:oe("react-datepicker__day-name",p,a?"react-datepicker__day-name--disabled":"")},h)}return P.createElement("div",{key:c,role:"columnheader",className:oe("react-datepicker__day-name",p,a?"react-datepicker__day-name--disabled":"")},P.createElement("span",{className:"react-datepicker__sr-only"},f),P.createElement("span",{"aria-hidden":"true"},d))}))},r.formatWeekday=function(i,o){return r.props.formatWeekDay?T6(i,r.props.formatWeekDay,o):r.props.useWeekdaysShort?N6(i,o):M6(i,o)},r.decreaseYear=function(){r.setState(function(i){var o,a=i.date;return{date:Ko(a,r.props.showYearPicker?(o=r.props.yearItemNumber)!==null&&o!==void 0?o:t.defaultProps.yearItemNumber:1)}},function(){return r.handleYearChange(r.state.date)})},r.clearSelectingDate=function(){r.setState({selectingDate:void 0})},r.renderPreviousButton=function(){var i,o,a;if(!r.props.renderCustomHeader){var s=(i=r.props.monthsShown)!==null&&i!==void 0?i:t.defaultProps.monthsShown,l=r.props.showPreviousMonths?s-1:0,c=(o=r.props.monthSelectedIn)!==null&&o!==void 0?o:l,u=Ia(r.state.date,c),d;switch(!0){case r.props.disabled:d=!0;break;case r.props.showMonthYearPicker:d=Bw(r.state.date,r.props);break;case r.props.showYearPicker:d=F6(r.state.date,r.props);break;case r.props.showQuarterYearPicker:d=I6(r.state.date,r.props);break;default:d=Fw(u,r.props);break}if(!(!((a=r.props.forceShowMonthNavigation)!==null&&a!==void 0?a:t.defaultProps.forceShowMonthNavigation)&&!r.props.showDisabledMonthNavigation&&d||r.props.showTimeSelectOnly)){var f=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],p=["react-datepicker__navigation","react-datepicker__navigation--previous"],h=r.decreaseMonth;(r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker)&&(h=r.decreaseYear),d&&r.props.showDisabledMonthNavigation&&(p.push("react-datepicker__navigation--previous--disabled"),h=void 0);var m=r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker,g=r.props,b=g.previousMonthButtonLabel,S=b===void 0?t.defaultProps.previousMonthButtonLabel:b,w=g.previousYearButtonLabel,x=w===void 0?t.defaultProps.previousYearButtonLabel:w,_=r.props,O=_.previousMonthAriaLabel,k=O===void 0?typeof S=="string"?S:"Previous Month":O,D=_.previousYearAriaLabel,T=D===void 0?typeof x=="string"?x:"Previous Year":D;return P.createElement("button",{type:"button",className:p.join(" "),onClick:h,onKeyDown:r.props.handleOnKeyDown,"aria-label":m?T:k},P.createElement("span",{className:f.join(" ")},m?x:S))}}},r.increaseYear=function(){r.setState(function(i){var o,a=i.date;return{date:Gr(a,r.props.showYearPicker?(o=r.props.yearItemNumber)!==null&&o!==void 0?o:t.defaultProps.yearItemNumber:1)}},function(){return r.handleYearChange(r.state.date)})},r.renderNextButton=function(){var i;if(!r.props.renderCustomHeader){var o;switch(!0){case r.props.disabled:o=!0;break;case r.props.showMonthYearPicker:o=Ww(r.state.date,r.props);break;case r.props.showYearPicker:o=$6(r.state.date,r.props);break;case r.props.showQuarterYearPicker:o=L6(r.state.date,r.props);break;default:o=$w(r.state.date,r.props);break}if(!(!((i=r.props.forceShowMonthNavigation)!==null&&i!==void 0?i:t.defaultProps.forceShowMonthNavigation)&&!r.props.showDisabledMonthNavigation&&o||r.props.showTimeSelectOnly)){var a=["react-datepicker__navigation","react-datepicker__navigation--next"],s=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];r.props.showTimeSelect&&a.push("react-datepicker__navigation--next--with-time"),r.props.todayButton&&a.push("react-datepicker__navigation--next--with-today-button");var l=r.increaseMonth;(r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker)&&(l=r.increaseYear),o&&r.props.showDisabledMonthNavigation&&(a.push("react-datepicker__navigation--next--disabled"),l=void 0);var c=r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker,u=r.props,d=u.nextMonthButtonLabel,f=d===void 0?t.defaultProps.nextMonthButtonLabel:d,p=u.nextYearButtonLabel,h=p===void 0?t.defaultProps.nextYearButtonLabel:p,m=r.props,g=m.nextMonthAriaLabel,b=g===void 0?typeof f=="string"?f:"Next Month":g,S=m.nextYearAriaLabel,w=S===void 0?typeof h=="string"?h:"Next Year":S;return P.createElement("button",{type:"button",className:a.join(" "),onClick:l,onKeyDown:r.props.handleOnKeyDown,"aria-label":c?w:b},P.createElement("span",{className:s.join(" ")},c?h:f))}}},r.renderCurrentMonth=function(i){i===void 0&&(i=r.state.date);var o=["react-datepicker__current-month"];return r.props.showYearDropdown&&o.push("react-datepicker__current-month--hasYearDropdown"),r.props.showMonthDropdown&&o.push("react-datepicker__current-month--hasMonthDropdown"),r.props.showMonthYearDropdown&&o.push("react-datepicker__current-month--hasMonthYearDropdown"),P.createElement("h2",{className:o.join(" ")},Un(i)?pt(i,r.props.dateFormat,r.props.locale):"")},r.renderYearDropdown=function(i){if(i===void 0&&(i=!1),!(!r.props.showYearDropdown||i))return P.createElement(i3,_e({},t.defaultProps,r.props,{date:r.state.date,onChange:r.changeYear,year:Ee(r.state.date)}))},r.renderMonthDropdown=function(i){if(i===void 0&&(i=!1),!(!r.props.showMonthDropdown||i))return P.createElement(X6,_e({},t.defaultProps,r.props,{month:Kn(r.state.date),onChange:r.changeMonth}))},r.renderMonthYearDropdown=function(i){if(i===void 0&&(i=!1),!(!r.props.showMonthYearDropdown||i))return P.createElement(J6,_e({},t.defaultProps,r.props,{date:r.state.date,onChange:r.changeMonthYear}))},r.handleTodayButtonClick=function(i){r.props.onSelect(Nw(),i),r.props.setPreSelection&&r.props.setPreSelection(Nw())},r.renderTodayButton=function(){if(!(!r.props.todayButton||r.props.showTimeSelectOnly))return P.createElement("div",{className:"react-datepicker__today-button",onClick:r.handleTodayButtonClick},r.props.todayButton)},r.renderDayNamesHeader=function(i,o){return o===void 0&&(o=0),P.createElement("div",{className:"react-datepicker__day-names",role:"row"},r.header(i,o))},r.renderDefaultHeader=function(i){var o=i.monthDate,a=i.i,s=P.createElement("div",{className:oe("react-datepicker__header",{"react-datepicker__header--has-time-select":r.props.showTimeSelect,"react-datepicker__header--middle":r.props.monthHeaderPosition==="middle","react-datepicker__header--bottom":r.props.monthHeaderPosition==="bottom"})},r.renderCurrentMonth(o),P.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(r.props.dropdownMode),onFocus:r.handleDropdownFocus},r.renderMonthDropdown(a!==0),r.renderMonthYearDropdown(a!==0),r.renderYearDropdown(a!==0)));return r.props.monthHeaderPosition==="top"?s:P.createElement("div",{className:"react-datepicker__header-wrapper"},r.renderPreviousButton()||null,r.renderNextButton()||null,s)},r.renderCustomHeader=function(i){var o,a,s=i.monthDate,l=i.i;if(r.props.showTimeSelect&&!r.state.monthContainer||r.props.showTimeSelectOnly)return null;var c=r.props,u=c.showYearPicker,d=c.yearItemNumber,f;if(u){var p=Ki(s,d),h=p.startPeriod,m=p.endPeriod;f={startYear:h,endYear:m}}var g=Fw(r.state.date,r.props),b=$w(r.state.date,r.props),S=Bw(r.state.date,r.props),w=Ww(r.state.date,r.props);return P.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:r.props.onDropdownFocus},(a=(o=r.props).renderCustomHeader)===null||a===void 0?void 0:a.call(o,_e(_e(_e({},r.state),u&&{visibleYearsRange:f}),{customHeaderCount:l,monthDate:s,changeMonth:r.changeMonth,changeYear:r.changeYear,decreaseMonth:r.decreaseMonth,increaseMonth:r.increaseMonth,decreaseYear:r.decreaseYear,increaseYear:r.increaseYear,prevMonthButtonDisabled:g,nextMonthButtonDisabled:b,prevYearButtonDisabled:S,nextYearButtonDisabled:w})))},r.renderYearHeader=function(i){var o=i.monthDate,a=r.props,s=a.showYearPicker,l=a.yearItemNumber,c=l===void 0?t.defaultProps.yearItemNumber:l,u=Ki(o,c),d=u.startPeriod,f=u.endPeriod;return P.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},s?"".concat(d," - ").concat(f):Ee(o))},r.renderHeader=function(i){var o=i.monthDate,a=i.i,s=a===void 0?0:a,l={monthDate:o,i:s};switch(!0){case r.props.renderCustomHeader!==void 0:return r.renderCustomHeader(l);case(r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker):return r.renderYearHeader(l);default:return r.renderDefaultHeader(l)}},r.renderMonths=function(){var i,o;if(!(r.props.showTimeSelectOnly||r.props.showYearPicker)){for(var a=[],s=(i=r.props.monthsShown)!==null&&i!==void 0?i:t.defaultProps.monthsShown,l=r.props.showPreviousMonths?s-1:0,c=r.props.showMonthYearPicker||r.props.showQuarterYearPicker?Gr(r.state.date,l):Ia(r.state.date,l),u=(o=r.props.monthSelectedIn)!==null&&o!==void 0?o:l,d=0;d<s;++d){var f=d-u+l,p=r.props.showMonthYearPicker||r.props.showQuarterYearPicker?Gr(c,f):Xr(c,f),h="month-".concat(d),m=d<s-1,g=d>0;a.push(P.createElement("div",{key:h,ref:function(b){r.monthContainer=b??void 0},className:"react-datepicker__month-container"},r.props.monthHeaderPosition==="top"&&r.renderHeader({monthDate:p,i:d}),P.createElement(q6,_e({},t.defaultProps,r.props,{containerRef:r.containerRef,ariaLabelPrefix:r.props.monthAriaLabelPrefix,day:p,onDayClick:r.handleDayClick,handleOnKeyDown:r.props.handleOnDayKeyDown,handleOnMonthKeyDown:r.props.handleOnKeyDown,onDayMouseEnter:r.handleDayMouseEnter,onMouseLeave:r.handleMonthMouseLeave,orderInDisplay:d,selectingDate:r.state.selectingDate,monthShowsDuplicateDaysEnd:m,monthShowsDuplicateDaysStart:g,dayNamesHeader:r.renderDayNamesHeader(p,d),monthHeader:r.props.monthHeaderPosition==="middle"?r.renderHeader({monthDate:p,i:d}):void 0,monthFooter:r.props.monthHeaderPosition==="bottom"?r.renderHeader({monthDate:p,i:d}):void 0}))))}return a}},r.renderYears=function(){if(!r.props.showTimeSelectOnly&&r.props.showYearPicker)return P.createElement("div",{className:"react-datepicker__year--container"},r.renderHeader({monthDate:r.state.date}),P.createElement(t3,_e({},t.defaultProps,r.props,{selectingDate:r.state.selectingDate,date:r.state.date,onDayClick:r.handleDayClick,clearSelectingDate:r.clearSelectingDate,onYearMouseEnter:r.handleYearMouseEnter,onYearMouseLeave:r.handleYearMouseLeave})))},r.renderTimeSection=function(){if(r.props.showTimeSelect&&(r.state.monthContainer||r.props.showTimeSelectOnly))return P.createElement(e3,_e({},t.defaultProps,r.props,{onChange:r.props.onTimeChange,format:r.props.timeFormat,intervals:r.props.timeIntervals,monthRef:r.state.monthContainer}))},r.renderInputTimeSection=function(){var i,o;if(r.props.showTimeInput){if(r.props.selectsRange){var a=r.props,s=a.startDate,l=a.endDate,c=s?new Date(s):void 0,u=c&&Un(c)&&!!s,d=u?"".concat(vs(c.getHours()),":").concat(vs(c.getMinutes())):"",f=l?new Date(l):void 0,p=f&&Un(f)&&!!l,h=p?"".concat(vs(f.getHours()),":").concat(vs(f.getMinutes())):"";return P.createElement(P.Fragment,null,P.createElement(hm,_e({},t.defaultProps,r.props,{date:c,timeString:d,onChange:function(S){var w,x;(x=(w=r.props).onTimeChange)===null||x===void 0||x.call(w,S,"start")},timeInputLabel:((i=r.props.timeInputLabel)!==null&&i!==void 0?i:"Time")+" (Start)"})),P.createElement(hm,_e({},t.defaultProps,r.props,{date:f,timeString:h,onChange:function(S){var w,x;(x=(w=r.props).onTimeChange)===null||x===void 0||x.call(w,S,"end")},timeInputLabel:((o=r.props.timeInputLabel)!==null&&o!==void 0?o:"Time")+" (End)"})))}var m=r.props.selected?new Date(r.props.selected):void 0,g=m&&Un(m)&&!!r.props.selected,b=g?"".concat(vs(m.getHours()),":").concat(vs(m.getMinutes())):"";return P.createElement(hm,_e({},t.defaultProps,r.props,{date:m,timeString:b,onChange:function(S){var w,x;(x=(w=r.props).onTimeChange)===null||x===void 0||x.call(w,S)}}))}},r.renderAriaLiveRegion=function(){var i;if(!Un(r.state.date))return P.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"});var o=Ki(r.state.date,(i=r.props.yearItemNumber)!==null&&i!==void 0?i:t.defaultProps.yearItemNumber),a=o.startPeriod,s=o.endPeriod,l;return r.props.showYearPicker?l="".concat(a," - ").concat(s):r.props.showMonthYearPicker||r.props.showQuarterYearPicker?l=Ee(r.state.date):l="".concat(vb(Kn(r.state.date),r.props.locale)," ").concat(Ee(r.state.date)),P.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},r.state.isRenderAriaLiveMessage&&l)},r.renderChildren=function(){if(r.props.children)return P.createElement("div",{className:"react-datepicker__children-container"},r.props.children)},r.containerRef=P.createRef(),r.state={date:r.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},r}return Object.defineProperty(t,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,outsideClickIgnoreClass:Bk,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:du,monthHeaderPosition:"top"}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){var n=this;this.props.showTimeSelect&&(this.assignMonthContainer=(function(){n.setState({monthContainer:n.monthContainer})})())},t.prototype.componentDidUpdate=function(n){var r=this;if(this.props.preSelection&&Un(this.props.preSelection)&&(!Pe(this.props.preSelection,n.preSelection)||this.props.monthSelectedIn!==n.monthSelectedIn)){var i=!Mn(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return i&&r.handleCustomMonthChange(r.state.date)})}else this.props.openToDate&&!Pe(this.props.openToDate,n.openToDate)&&this.setState({date:this.props.openToDate})},t.prototype.render=function(){var n=this.props.container||_6;return P.createElement(Qp,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},P.createElement("div",{style:{display:"contents"},ref:this.containerRef},P.createElement(n,{className:oe("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly,inline:this.props.inline},this.renderAriaLiveRegion(),this.props.monthHeaderPosition==="top"&&this.renderPreviousButton(),this.props.monthHeaderPosition==="top"&&this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},t})(P.Component),l3=function(e){var t=e.icon,n=e.className,r=n===void 0?"":n,i=e.onClick,o="react-datepicker__calendar-icon";if(typeof t=="string")return P.createElement("i",{className:"".concat(o," ").concat(t," ").concat(r),"aria-hidden":"true",onClick:i});if(P.isValidElement(t)){var a=t;return P.cloneElement(a,{className:"".concat(a.props.className||""," ").concat(o," ").concat(r),onClick:function(s){typeof a.props.onClick=="function"&&a.props.onClick(s),typeof i=="function"&&i(s)}})}return P.createElement("svg",{className:"".concat(o," ").concat(r),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:i},P.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},Wk=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.portalRoot=null,r.el=document.createElement("div"),r}return t.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},t.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},t.prototype.render=function(){return Ui.createPortal(this.props.children,this.el)},t})(P.Component),c3="[tabindex], a, button, input, select, textarea",u3=function(e){return(e instanceof HTMLAnchorElement||!e.disabled)&&e.tabIndex!==-1},zk=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.getTabChildren=function(){var i;return Array.prototype.slice.call((i=r.tabLoopRef.current)===null||i===void 0?void 0:i.querySelectorAll(c3),1,-1).filter(u3)},r.handleFocusStart=function(){var i=r.getTabChildren();i&&i.length>1&&i[i.length-1].focus()},r.handleFocusEnd=function(){var i=r.getTabChildren();i&&i.length>1&&i[0].focus()},r.tabLoopRef=P.createRef(),r}return t.prototype.render=function(){var n;return((n=this.props.enableTabLoop)!==null&&n!==void 0?n:t.defaultProps.enableTabLoop)?P.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},P.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,P.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},t.defaultProps={enableTabLoop:!0},t})(P.Component);function d3(e){function t(n){var r,i=typeof n.hidePopper=="boolean"?n.hidePopper:!0,o=P.useRef(null),a=w6(_e({open:!i,whileElementsMounted:QB,placement:n.popperPlacement,middleware:hi([a6({padding:15}),o6(10),s6({element:o})],(r=n.popperModifiers)!==null&&r!==void 0?r:[],!0)},n.popperProps)),s=_e(_e({},n),{hidePopper:i,popperProps:_e(_e({},a),{arrowRef:o})});return P.createElement(e,_e({},s))}return t.displayName="withFloating(".concat(e.displayName||e.name||"Component",")"),t}var f3=function(e){var t=e.className,n=e.wrapperClassName,r=e.hidePopper,i=r===void 0?!0:r,o=e.popperComponent,a=e.targetComponent,s=e.enableTabLoop,l=e.popperOnKeyDown,c=e.portalId,u=e.portalHost,d=e.popperProps,f=e.showArrow,p=e.popperTargetRef,h=e.monthHeaderPosition;P.useEffect(function(){p?.current&&d.refs.setPositionReference(p.current)},[p,d.refs]);var m=void 0;if(!i){var g=oe("react-datepicker-popper",!f&&"react-datepicker-popper-offset",h==="middle"&&"react-datepicker-popper--header-middle",h==="bottom"&&"react-datepicker-popper--header-bottom",t);m=P.createElement(zk,{enableTabLoop:s},P.createElement("div",{ref:d.refs.setFloating,style:d.floatingStyles,className:g,"data-placement":d.placement,onKeyDown:l},o,f&&P.createElement(h6,{ref:d.arrowRef,context:d.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}e.popperContainer&&(m=P.createElement(e.popperContainer,{},m)),c&&!i&&(m=P.createElement(Wk,{portalId:c,portalHost:u},m));var b=oe("react-datepicker-wrapper",n);return P.createElement(P.Fragment,null,P.createElement("div",{ref:d.refs.setReference,className:b},a),m)},p3=d3(f3);function Gw(e,t){return e&&t?Kn(e)!==Kn(t)||Ee(e)!==Ee(t):e!==t}var gm="Date input not valid.",Vk=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.calendar=null,r.input=null,r.getPreSelection=function(){var i=r.props.timeZone,o=r.props.openToDate?r.props.openToDate:r.props.selectsEnd&&r.props.startDate?r.props.startDate:r.props.selectsStart&&r.props.endDate?r.props.endDate:Ae();return i?Tw(o,i):o},r.modifyHolidays=function(){var i;return(i=r.props.holidays)===null||i===void 0?void 0:i.reduce(function(o,a){var s=da(a.date,"yyyy-MM-dd",void 0,!1);return s?hi(hi([],o,!0),[_e(_e({},a),{date:s})],!1):o},[])},r.calcInitialState=function(){var i=r.props.timeZone,o=r.getPreSelection(),a=Ik(r.props),s=Lk(r.props),l=a&&pi(o,oc(a))?a:s&&Zi(o,jw(s))?s:o,c=r.props.selectsRange?r.props.startDate:r.props.selected;return c&&i&&(c=Tw(c,i)),{open:r.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:c??l,highlightDates:zw(r.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},r.getInputValue=function(){var i,o=r.props,a=o.locale,s=o.startDate,l=o.endDate,c=o.rangeSeparator,u=o.selected,d=o.selectedDates,f=o.selectsMultiple,p=o.selectsRange,h=o.formatMultipleDates,m=o.value,g=(i=r.props.dateFormat)!==null&&i!==void 0?i:t.defaultProps.dateFormat,b=r.state.inputValue;if(typeof m=="string")return m;if(typeof b=="string")return b;if(p)return O6(s,l,{dateFormat:g,locale:a,rangeSeparator:c});if(f){if(h){var S=function(w){return Hn(w,{dateFormat:g,locale:a})};return h(d??[],S)}return C6(d??[],{dateFormat:g,locale:a})}return Hn(u,{dateFormat:g,locale:a})},r.resetHiddenStatus=function(){r.setState(_e(_e({},r.state),{wasHidden:!1}))},r.setHiddenStatus=function(){r.setState(_e(_e({},r.state),{wasHidden:!0}))},r.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&r.setHiddenStatus()},r.clearPreventFocusTimeout=function(){r.preventFocusTimeout&&clearTimeout(r.preventFocusTimeout)},r.setFocus=function(){var i,o;(o=(i=r.input)===null||i===void 0?void 0:i.focus)===null||o===void 0||o.call(i,{preventScroll:!0})},r.setBlur=function(){var i,o;(o=(i=r.input)===null||i===void 0?void 0:i.blur)===null||o===void 0||o.call(i),r.cancelFocusInput()},r.deferBlur=function(){requestAnimationFrame(function(){r.setBlur()})},r.setOpen=function(i,o){o===void 0&&(o=!1),r.setState({open:i,preSelection:i&&r.state.open?r.state.preSelection:r.calcInitialState().preSelection,lastPreSelectChange:vm},function(){i||r.setState(function(a){return{focused:o?a.focused:!1}},function(){!o&&r.deferBlur(),r.setState({inputValue:null})})})},r.inputOk=function(){return vi(r.state.preSelection)},r.isCalendarOpen=function(){return r.props.open===void 0?r.state.open&&!r.props.disabled&&!r.props.readOnly:r.props.open},r.handleFocus=function(i){var o,a,s=r.state.wasHidden,l=s?r.state.open:!0;s&&r.resetHiddenStatus(),r.state.preventFocus||((a=(o=r.props).onFocus)===null||a===void 0||a.call(o,i),l&&!r.props.preventOpenOnFocus&&!r.props.readOnly&&r.setOpen(!0)),r.setState({focused:!0})},r.sendFocusBackToInput=function(){r.preventFocusTimeout&&r.clearPreventFocusTimeout(),r.setState({preventFocus:!0},function(){r.preventFocusTimeout=setTimeout(function(){r.setFocus(),r.setState({preventFocus:!1})})})},r.cancelFocusInput=function(){clearTimeout(r.inputFocusTimeout),r.inputFocusTimeout=void 0},r.deferFocusInput=function(){r.cancelFocusInput(),r.inputFocusTimeout=setTimeout(function(){return r.setFocus()},1)},r.handleDropdownFocus=function(){r.cancelFocusInput()},r.resetInputValue=function(){r.setState(_e(_e({},r.state),{inputValue:null}))},r.handleBlur=function(i){var o,a;(!r.state.open||r.props.withPortal||r.props.showTimeInput)&&((a=(o=r.props).onBlur)===null||a===void 0||a.call(o,i));var s=r.state.inputValue;if(typeof s=="string"&&s.length>0){var l=/[a-zA-Z0-9]/.test(s);!l&&r.props.selected&&r.setSelected(null,void 0,!0)}r.resetInputValue(),r.state.open&&r.props.open===!1&&r.setOpen(!1),r.setState({focused:!1})},r.handleCalendarClickOutside=function(i){var o,a;(a=(o=r.props).onClickOutside)===null||a===void 0||a.call(o,i),!r.props.inline&&!i.defaultPrevented&&r.setOpen(!1),r.props.withPortal&&i.preventDefault()},r.handleChange=function(){for(var i,o,a,s,l,c,u,d,f=[],p=0;p<arguments.length;p++)f[p]=arguments[p];var h=f[0];if(!(r.props.onChangeRaw&&(r.props.onChangeRaw.apply(r,f),!h||typeof h.isDefaultPrevented!="function"||h.isDefaultPrevented()))){r.setState({inputValue:h?.target instanceof HTMLInputElement?h.target.value:null,lastPreSelectChange:h3});var m=r.props,g=m.selectsRange,b=m.startDate,S=m.endDate,w=(i=r.props.dateFormat)!==null&&i!==void 0?i:t.defaultProps.dateFormat,x=(o=r.props.strictParsing)!==null&&o!==void 0?o:t.defaultProps.strictParsing,_=h?.target instanceof HTMLInputElement?h.target.value:"";if(g){var O=r.props.rangeSeparator,k=O.trim(),D=_.split(w.includes(k)?O:k,2).map(function($){return $.trim()}),T=D[0],j=D[1],A=da(T??"",w,r.props.locale,x),C=A?da(j??"",w,r.props.locale,x):null,N=((a=Da(b))===null||a===void 0?void 0:a.getTime())!==A?.getTime(),M=((s=Da(S))===null||s===void 0?void 0:s.getTime())!==C?.getTime();if(!N&&!M||A&&Dr(A,r.props)||C&&Dr(C,r.props))return;A&&r.setState({preSelection:A}),(c=(l=r.props).onChange)===null||c===void 0||c.call(l,[A,C],h)}else{var I=da(_,w,r.props.locale,x,(u=r.props.selected)!==null&&u!==void 0?u:void 0);if(I||!_)r.setSelected(I,h,!0);else if(!r.props.inline){var L=E6(_,(d=r.state.preSelection)!==null&&d!==void 0?d:void 0);L&&(!r.props.minDate||!pi(L,r.props.minDate))&&(!r.props.maxDate||!Zi(L,r.props.maxDate))&&r.setState({preSelection:L})}}}},r.handleSelect=function(i,o,a){var s;if(!r.props.readOnly){var l=r.props,c=l.selectsRange,u=l.startDate,d=l.endDate,f=l.locale,p=l.swapRange,h=(s=r.props.dateFormat)!==null&&s!==void 0?s:t.defaultProps.dateFormat,m=!c||u&&!d&&(p||!pm(i,u));if(r.props.shouldCloseOnSelect&&!r.props.showTimeSelect&&m&&r.sendFocusBackToInput(),r.props.onChangeRaw){var g=Hn(i,{dateFormat:h,locale:f});r.props.onChangeRaw(o,{date:i,formattedDate:g})}r.setSelected(i,o,!1,a),r.props.showDateSelect&&r.setState({isRenderAriaLiveMessage:!0}),!r.props.shouldCloseOnSelect||r.props.showTimeSelect?r.setPreSelection(i):m&&r.setOpen(!1)}},r.setSelected=function(i,o,a,s){var l,c,u=r.props.timeZone,d=i;if(d&&u&&(d=Ii(d,u)),r.props.showYearPicker){if(d!==null&&Jd(Ee(d),r.props))return}else if(r.props.showMonthYearPicker){if(d!==null&&Rk(d,r.props))return}else if(d!==null&&Dr(d,r.props))return;var f=r.props,p=f.onChange,h=f.selectsRange,m=f.startDate,g=f.endDate,b=f.selectsMultiple,S=f.selectedDates,w=f.minTime,x=f.swapRange;if(!Aa(r.props.selected,d)||r.props.allowSameDay||h||b)if(d!==null&&(r.props.selected&&(!a||!r.props.showTimeSelect&&!r.props.showTimeSelectOnly&&!r.props.showTimeInput)&&(d=Li(d,{hour:xn(r.props.selected),minute:wn(r.props.selected),second:Bo(r.props.selected)})),!a&&(r.props.showTimeSelect||r.props.showTimeSelectOnly)&&w&&(d=Li(d,{hour:w.getHours(),minute:w.getMinutes(),second:w.getSeconds()})),r.props.inline||r.setState({preSelection:d}),r.props.focusSelectedMonth||r.setState({monthSelectedIn:s})),h){var _=p,O=!m&&!g,k=m&&!g,D=!m&&!!g,T=m&&g;O?_?.([d,null],o):k?d===null?_?.([null,null],o):pm(d,m)?_?.(x?[d,m]:[d,null],o):_?.([m,d],o):D&&(d&&pm(d,g)?_?.([d,g],o):_?.([d,null],o)),T&&_?.([d,null],o)}else if(b){var j=p;if(d!==null)if(!S?.length)j?.([d],o);else{var A=S.some(function(N){return Pe(N,d)});if(A){var C=S.filter(function(N){return!Pe(N,d)});j?.(C,o)}else j?.(hi(hi([],S,!0),[d],!1),o)}}else p?.(d,o);a||((c=(l=r.props).onSelect)===null||c===void 0||c.call(l,d,o),r.setState({inputValue:null}))},r.setPreSelection=function(i){if(!r.props.readOnly){var o=vi(r.props.minDate),a=vi(r.props.maxDate),s=!0;if(i){var l=oc(i);if(o&&a)s=ya(i,r.props.minDate,r.props.maxDate);else if(o){var c=oc(r.props.minDate);s=Zi(i,c)||Aa(l,c)}else if(a){var u=jw(r.props.maxDate);s=pi(i,u)||Aa(l,u)}}s&&r.setState({preSelection:i})}},r.toggleCalendar=function(){r.setOpen(!r.state.open)},r.handleTimeChange=function(i,o){var a,s;if(!r.props.selectsMultiple){var l=r.props,c=l.selectsRange,u=l.startDate,d=l.endDate,f=l.onChange,p=l.timeZone;if(c){var h=f;if(o==="start"){if(u){var m=Li(u,{hour:xn(i),minute:wn(i)});r.setState({preSelection:m}),p&&(m=Ii(m,p)),h?.([m,d?p?Ii(d,p):d:null],void 0)}}else if(o==="end"){if(d){var g=Li(d,{hour:xn(i),minute:wn(i)});r.setState({preSelection:g}),p&&(g=Ii(g,p)),h?.([u?p?Ii(u,p):u:null,g],void 0)}}else{var b=u&&!d;if(b){var m=Li(u,{hour:xn(i),minute:wn(i)});r.setState({preSelection:m}),p&&(m=Ii(m,p)),h?.([m,null],void 0)}else if(u&&d){var g=Li(d,{hour:xn(i),minute:wn(i)});r.setState({preSelection:g}),p&&(g=Ii(g,p)),h?.([p?Ii(u,p):u,g],void 0)}else{var S=Li(r.getPreSelection(),{hour:xn(i),minute:wn(i)});r.setState({preSelection:S})}}}else{var w=r.props.selected?r.props.selected:r.getPreSelection(),S=r.props.selected?i:Li(w,{hour:xn(i),minute:wn(i)});r.setState({preSelection:S}),S&&p&&(S=Ii(S,p)),(s=(a=r.props).onChange)===null||s===void 0||s.call(a,S)}r.props.shouldCloseOnSelect&&!r.props.showTimeInput&&(r.sendFocusBackToInput(),r.setOpen(!1)),r.props.showTimeInput&&r.setOpen(!0),(r.props.showTimeSelectOnly||r.props.showTimeSelect)&&r.setState({isRenderAriaLiveMessage:!0}),r.setState({inputValue:null})}},r.onInputClick=function(){var i,o;!r.props.disabled&&!r.props.readOnly&&r.setOpen(!0),(o=(i=r.props).onInputClick)===null||o===void 0||o.call(i)},r.handleTimeOnlyArrowKey=function(i){var o,a,s,l,c=Da(r.props.selected)||r.state.preSelection||Ae(),u=(o=r.props.timeIntervals)!==null&&o!==void 0?o:30,d=(a=r.props.dateFormat)!==null&&a!==void 0?a:t.defaultProps.dateFormat,f=Array.isArray(d)?d[0]:d,p=oc(c),h=xn(c)*60+wn(c),m=1440-u,g;if(i===ne.ArrowUp){var b=Math.max(0,h-u);g=Tc(p,b)}else{var b=Math.min(m,h+u);g=Tc(p,b)}var S=pt(g,f||t.defaultProps.dateFormat,r.props.locale);if(r.setState({preSelection:g,inputValue:S}),!(r.props.selectsRange||r.props.selectsMultiple)){var w=r.props.selected?r.props.selected:r.getPreSelection(),x=r.props.selected?g:Li(w,{hour:xn(g),minute:wn(g)});(l=(s=r.props).onChange)===null||l===void 0||l.call(s,x),(r.props.showTimeSelectOnly||r.props.showTimeSelect)&&r.setState({isRenderAriaLiveMessage:!0}),requestAnimationFrame(function(){r.scrollToTimeOption(g)})}},r.handleTimeOnlyEnterKey=function(i){var o,a,s,l,c=i.target,u=c.value,d=(o=r.props.dateFormat)!==null&&o!==void 0?o:t.defaultProps.dateFormat,f=r.props.timeFormat||"p",p=r.state.preSelection||Da(r.props.selected)||Ae(),h=da(u,d,r.props.locale,(a=r.props.strictParsing)!==null&&a!==void 0?a:!1,p),m=p;if(h&&Un(h))m=h;else{var g=((s=r.calendar)===null||s===void 0?void 0:s.containerRef.current)instanceof Element&&r.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");if(g instanceof HTMLElement){var b=(l=g.textContent)===null||l===void 0?void 0:l.trim();if(b){var S=da(b,f,r.props.locale,!1,p);S&&Un(S)&&(m=S)}}}r.handleTimeChange(m),r.setOpen(!1),r.sendFocusBackToInput()},r.scrollToTimeOption=function(i){var o,a;if(!((o=r.calendar)===null||o===void 0)&&o.containerRef.current){for(var s=r.calendar.containerRef.current,l=Array.from(s.querySelectorAll(".react-datepicker__time-list-item")),c=null,u=1/0,d=r.props.timeFormat||"p",f=0,p=l;f<p.length;f++){var h=p[f],m=(a=h.textContent)===null||a===void 0?void 0:a.trim();if(m){var g=da(m,d,r.props.locale,!1,i);if(g&&Un(g)){if(Fk(g,i)){c=h;break}var b=Math.abs(g.getTime()-i.getTime());b<u&&(u=b,c=h)}}}c&&(l.forEach(function(S){S.setAttribute("tabindex","-1")}),c.setAttribute("tabindex","0"),c.scrollIntoView({behavior:"smooth",block:"center"}))}},r.onInputKeyDown=function(i){var o,a,s,l,c,u;(a=(o=r.props).onKeyDown)===null||a===void 0||a.call(o,i);var d=i.key;if(!r.state.open&&!r.props.inline&&!r.props.preventOpenOnFocus){(d===ne.ArrowDown||d===ne.ArrowUp||d===ne.Enter)&&((s=r.onInputClick)===null||s===void 0||s.call(r));return}if(r.state.open&&r.props.showTimeSelectOnly){if(d===ne.ArrowDown||d===ne.ArrowUp){i.preventDefault(),r.handleTimeOnlyArrowKey(d);return}if(d===ne.Enter){i.preventDefault(),r.handleTimeOnlyEnterKey(i);return}}if(r.state.open){if(d===ne.ArrowDown||d===ne.ArrowUp){i.preventDefault();var f=r.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":r.props.showWeekPicker&&r.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':r.props.showFullMonthYearPicker||r.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',p=((l=r.calendar)===null||l===void 0?void 0:l.containerRef.current)instanceof Element&&r.calendar.containerRef.current.querySelector(f);p instanceof HTMLElement&&p.focus({preventScroll:!0});return}var h=Ae(r.state.preSelection);d===ne.Enter?(i.preventDefault(),i.target.blur(),r.inputOk()&&r.state.lastPreSelectChange===vm?(r.handleSelect(h,i),!r.props.shouldCloseOnSelect&&r.setPreSelection(h)):r.setOpen(!1)):d===ne.Escape?(i.preventDefault(),i.target.blur(),r.sendFocusBackToInput(),r.setOpen(!1)):d===ne.Tab&&r.setOpen(!1),r.inputOk()||(u=(c=r.props).onInputError)===null||u===void 0||u.call(c,{code:1,msg:gm})}},r.onPortalKeyDown=function(i){var o=i.key;o===ne.Escape&&(i.preventDefault(),r.setState({preventFocus:!0},function(){r.setOpen(!1),setTimeout(function(){r.setFocus(),r.setState({preventFocus:!1})})}))},r.onDayKeyDown=function(i){var o,a,s,l,c,u,d=r.props,f=d.minDate,p=d.maxDate,h=d.disabledKeyboardNavigation,m=d.showWeekPicker,g=d.shouldCloseOnSelect,b=d.locale,S=d.calendarStartDay,w=d.adjustDateOnChange,x=d.inline;if((a=(o=r.props).onKeyDown)===null||a===void 0||a.call(o,i),!h){var _=i.key,O=i.shiftKey,k=Ae(r.state.preSelection),D=function(A,C){var N=C;switch(A){case ne.ArrowRight:N=m?ff(C,1):qr(C,1);break;case ne.ArrowLeft:N=m?yw(C):F4(C);break;case ne.ArrowUp:N=yw(C);break;case ne.ArrowDown:N=ff(C,1);break;case ne.PageUp:N=O?Ko(C,1):Ia(C,1);break;case ne.PageDown:N=O?Gr(C,1):Xr(C,1);break;case ne.Home:N=Wo(C,b,S);break;case ne.End:N=D6(C);break}return N},T=function(A,C){for(var N=40,M=A,I=!1,L=0,$=D(A,C);!I;){if(L>=N){$=C;break}f&&$<f&&(M=ne.ArrowRight,$=Dr(f,r.props)?D(M,$):f),p&&$>p&&(M=ne.ArrowLeft,$=Dr(p,r.props)?D(M,$):p),Dr($,r.props)?((M===ne.PageUp||M===ne.Home)&&(M=ne.ArrowRight),(M===ne.PageDown||M===ne.End)&&(M=ne.ArrowLeft),$=D(M,$)):I=!0,L++}return $};if(_===ne.Enter){i.preventDefault(),r.handleSelect(k,i),!g&&r.setPreSelection(k);return}else if(_===ne.Escape){i.preventDefault(),r.setOpen(!1),r.inputOk()||(l=(s=r.props).onInputError)===null||l===void 0||l.call(s,{code:1,msg:gm});return}var j=null;switch(_){case ne.ArrowLeft:case ne.ArrowRight:case ne.ArrowUp:case ne.ArrowDown:case ne.PageUp:case ne.PageDown:case ne.Home:case ne.End:j=T(_,k);break}if(!j){(u=(c=r.props).onInputError)===null||u===void 0||u.call(c,{code:1,msg:gm});return}i.preventDefault(),r.setState({lastPreSelectChange:vm}),w&&r.setSelected(j),r.setPreSelection(j),x&&r.setState({shouldFocusDayInline:!0})}},r.onPopperKeyDown=function(i){var o=i.key;o===ne.Escape&&(i.preventDefault(),r.sendFocusBackToInput(),r.setOpen(!1))},r.onClearClick=function(i){i&&i.preventDefault&&i.preventDefault(),r.sendFocusBackToInput();var o=r.props,a=o.selectsRange,s=o.onChange;s?.(a?[null,null]:null,i),r.setState({inputValue:null})},r.clear=function(){r.onClearClick()},r.onScroll=function(i){typeof r.props.closeOnScroll=="boolean"&&r.props.closeOnScroll?(i.target===document||i.target===document.documentElement||i.target===document.body)&&r.setOpen(!1):typeof r.props.closeOnScroll=="function"&&r.props.closeOnScroll(i)&&r.setOpen(!1)},r.handleMonthSelectedInChange=function(i){r.setState({monthSelectedIn:i})},r.renderCalendar=function(){var i,o;return!r.props.inline&&!r.isCalendarOpen()?null:P.createElement(s3,_e({showMonthYearDropdown:void 0,ref:function(a){r.calendar=a}},r.props,r.state,{setOpen:r.setOpen,dateFormat:(i=r.props.dateFormatCalendar)!==null&&i!==void 0?i:t.defaultProps.dateFormatCalendar,onSelect:r.handleSelect,onClickOutside:r.handleCalendarClickOutside,holidays:W6(r.modifyHolidays()),outsideClickIgnoreClass:r.props.outsideClickIgnoreClass,onDropdownFocus:r.handleDropdownFocus,onTimeChange:r.handleTimeChange,className:r.props.calendarClassName,container:r.props.calendarContainer,handleOnKeyDown:r.props.onKeyDown,handleOnDayKeyDown:r.onDayKeyDown,setPreSelection:r.setPreSelection,dropdownMode:(o=r.props.dropdownMode)!==null&&o!==void 0?o:t.defaultProps.dropdownMode,onMonthSelectedInChange:r.handleMonthSelectedInChange}),r.props.children)},r.renderAriaLiveRegion=function(){var i,o=r.props.locale,a=(i=r.props.dateFormat)!==null&&i!==void 0?i:t.defaultProps.dateFormat,s=r.props.showTimeInput||r.props.showTimeSelect,l=s?"PPPPp":"PPPP",c;return r.props.selectsRange?c="Selected start date: ".concat(Hn(r.props.startDate,{dateFormat:l,locale:o}),". ").concat(r.props.endDate?"End date: "+Hn(r.props.endDate,{dateFormat:l,locale:o}):""):r.props.showTimeSelectOnly?c="Selected time: ".concat(Hn(r.props.selected,{dateFormat:a,locale:o})):r.props.showYearPicker?c="Selected year: ".concat(Hn(r.props.selected,{dateFormat:"yyyy",locale:o})):r.props.showMonthYearPicker?c="Selected month: ".concat(Hn(r.props.selected,{dateFormat:"MMMM yyyy",locale:o})):r.props.showQuarterYearPicker?c="Selected quarter: ".concat(Hn(r.props.selected,{dateFormat:"yyyy, QQQ",locale:o})):c="Selected date: ".concat(Hn(r.props.selected,{dateFormat:l,locale:o})),P.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},c)},r.renderDateInput=function(){var i,o,a,s,l,c,u,d=oe(r.props.className,(i={},i[r.props.outsideClickIgnoreClass||t.defaultProps.outsideClickIgnoreClass]=r.state.open,i)),f=r.props.customInput||P.createElement("input",{type:"text"}),p=r.props.customInputRef||"ref",h={},m=(a=r.props["aria-describedby"])!==null&&a!==void 0?a:r.props.ariaDescribedBy,g=(s=r.props["aria-invalid"])!==null&&s!==void 0?s:r.props.ariaInvalid,b=(l=r.props["aria-label"])!==null&&l!==void 0?l:r.props.ariaLabel,S=(c=r.props["aria-labelledby"])!==null&&c!==void 0?c:r.props.ariaLabelledBy,w=(u=r.props["aria-required"])!==null&&u!==void 0?u:r.props.ariaRequired;return m!=null&&(h["aria-describedby"]=m),g!=null&&(h["aria-invalid"]=g),b!=null&&(h["aria-label"]=b),S!=null&&(h["aria-labelledby"]=S),w!=null&&(h["aria-required"]=w),P.cloneElement(f,_e((o={},o[p]=function(x){r.input=x},o.value=r.getInputValue(),o.onBlur=r.handleBlur,o.onChange=r.handleChange,o.onClick=r.onInputClick,o.onFocus=r.handleFocus,o.onKeyDown=r.onInputKeyDown,o.id=r.props.id,o.name=r.props.name,o.form=r.props.form,o.autoFocus=r.props.autoFocus,o.placeholder=r.props.placeholderText,o.disabled=r.props.disabled,o.autoComplete=r.props.autoComplete,o.className=oe(f.props.className,d),o.title=r.props.title,o.readOnly=r.props.readOnly,o.required=r.props.required,o.tabIndex=r.props.tabIndex,o),h))},r.renderClearButton=function(){var i=r.props,o=i.isClearable,a=i.disabled,s=i.selected,l=i.startDate,c=i.endDate,u=i.clearButtonTitle,d=i.clearButtonClassName,f=d===void 0?"":d,p=i.ariaLabelClose,h=p===void 0?"Close":p,m=i.selectedDates,g=i.readOnly;return o&&!g&&(s!=null||l!=null||c!=null||m?.length)?P.createElement("button",{type:"button",className:oe("react-datepicker__close-icon",f,{"react-datepicker__close-icon--disabled":a}),disabled:a,"aria-label":h,onClick:r.onClearClick,title:u,tabIndex:-1}):null},r.state=r.calcInitialState(),r.preventFocusTimeout=void 0,r}return Object.defineProperty(t,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,outsideClickIgnoreClass:Bk,readOnly:!1,rangeSeparator:Nk,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:du,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},t.prototype.componentDidUpdate=function(n,r){var i,o,a,s;this.props.selectsRange&&Gw(n.startDate,this.props.startDate)?this.setPreSelection(this.props.startDate):Gw(n.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&n.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),this.props.selectsRange&&r.open===!1&&this.state.open===!0&&this.state.monthSelectedIn!==0&&this.setState({monthSelectedIn:0}),n.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:zw(this.props.highlightDates)}),!r.focused&&!Aa(n.selected,this.props.selected)&&this.setState({inputValue:null}),r.open!==this.state.open&&(r.open===!1&&this.state.open===!0&&((o=(i=this.props).onCalendarOpen)===null||o===void 0||o.call(i)),r.open===!0&&this.state.open===!1&&((s=(a=this.props).onCalendarClose)===null||s===void 0||s.call(a)))},t.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},t.prototype.renderInputContainer=function(){var n=this.props,r=n.showIcon,i=n.icon,o=n.calendarIconClassname,a=n.calendarIconClassName,s=n.toggleCalendarOnIconClick,l=this.state.open;return o&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),P.createElement("div",{className:"react-datepicker__input-container".concat(r?" react-datepicker__view-calendar-icon":"")},r&&P.createElement(l3,_e({icon:i,className:oe(a,!a&&o,l&&"react-datepicker-ignore-onclickoutside")},s?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},t.prototype.render=function(){var n=this.renderCalendar();if(this.props.inline)return n;if(this.props.withPortal){var r=this.state.open?P.createElement(zk,{enableTabLoop:this.props.enableTabLoop},P.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},n)):null;return this.state.open&&this.props.portalId&&(r=P.createElement(Wk,_e({portalId:this.props.portalId},this.props),r)),P.createElement(P.Fragment,null,this.renderInputContainer(),r)}return P.createElement(p3,_e({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:n,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow,monthHeaderPosition:this.props.monthHeaderPosition}))},t})(P.Component),h3="input",vm="navigate";function m3({title:e,description:t,onExport:n}){const[r,i]=P.useState(!1),[o,a]=P.useState(!1),[s,l]=P.useState("Last 7 Days"),[c,u]=P.useState(null),[d,f]=P.useState(null),[p,h]=P.useState(!1),[m,g]=P.useState(!1),b=P.useRef(null),S=P.useRef(null),w=["Last 7 Days","Last 30 Days","This Month","Previous Month","Custom Range"],x=[{label:"Export as Excel",value:"xlsx"},{label:"Export as PDF",value:"pdf"}];P.useEffect(()=>{const A=C=>{b.current&&!b.current.contains(C.target)&&(i(!1),h(!1)),S.current&&!S.current.contains(C.target)&&a(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]),P.useEffect(()=>{const A=new URLSearchParams(window.location.search),C=A.get(`${e.toLowerCase()}start_date`),N=A.get(`${e.toLowerCase()}end_date`);C&&N&&(u(new Date(C)),f(new Date(N)),l("Custom Range"))},[e]);const _=A=>{const C=new Date;C.setHours(0,0,0,0);let N,M;switch(A){case"Last 7 Days":N=new Date(C),N.setDate(C.getDate()-6),M=C;break;case"Last 30 Days":N=new Date(C),N.setDate(C.getDate()-29),M=C;break;case"This Month":N=new Date(C.getFullYear(),C.getMonth(),1),M=C;break;case"Previous Month":N=new Date(C.getFullYear(),C.getMonth()-1,1),M=new Date(C.getFullYear(),C.getMonth(),0);break;default:return null}return{start:N.toISOString().split("T")[0],end:M.toISOString().split("T")[0]}},O=(A,C)=>{const N=new URLSearchParams(window.location.search);N.set(`${e.toLowerCase()}start_date`,A),N.set(`${e.toLowerCase()}end_date`,C),window.history.pushState({},"",`${window.location.pathname}?${N.toString()}`),window.dispatchEvent(new Event("dateRangeChange"))},k=A=>{if(A==="Custom Range"){l(A),h(!0),u(null),f(null);return}const C=_(A);C&&(l(A),i(!1),h(!1),O(C.start,C.end))},D=()=>{!c||!d||(O(c.toISOString().split("T")[0],d.toISOString().split("T")[0]),i(!1),h(!1))},T=()=>s==="Custom Range"&&c&&d?`${c.toLocaleDateString()} - ${d.toLocaleDateString()}`:s,j=async A=>{g(!0),a(!1);try{let C,N;if(s==="Custom Range")C=c?.toISOString().split("T")[0],N=d?.toISOString().split("T")[0];else{const M=_(s);C=M?.start,N=M?.end}await n?.({format:A,section:e,start:C,end:N})}finally{g(!1)}};return v.jsxs("div",{className:"flex items-center justify-between px-6 my-6",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[24px] font-semibold text-[#121212]",children:e}),v.jsx("div",{className:"text-gray-500 text-sm",children:t})]}),v.jsxs("div",{className:"flex gap-3",children:[v.jsxs("div",{className:"relative",ref:b,children:[v.jsxs("button",{onClick:()=>i(A=>!A),className:"flex items-center gap-2 bg-gray-50 px-4 py-2.5 rounded-lg border border-gray-200 text-sm font-medium text-gray-700 hover:bg-gray-100 transition-colors",children:[v.jsx(k$,{fontSize:"small",className:"text-gray-600"}),T(),v.jsx(A$,{className:"text-gray-500"})]}),r&&v.jsx("div",{className:"absolute right-0 mt-2 bg-white rounded-lg shadow-xl border border-gray-200 z-50",children:p?v.jsxs("div",{className:"p-4 w-[360px]",children:[v.jsx(Vk,{inline:!0,selectsRange:!0,startDate:c,endDate:d,onChange:([A,C])=>{u(A),f(C)},maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40}),v.jsxs("div",{className:"flex justify-between mt-4 gap-2",children:[v.jsx("button",{onClick:()=>h(!1),className:"px-4 py-2 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancel"}),v.jsx("button",{onClick:D,disabled:!c||!d,className:"px-4 py-2 bg-purple-600 text-white rounded-lg text-sm font-medium hover:bg-purple-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors",children:"Apply"})]})]}):v.jsx("div",{className:"min-w-[200px] py-1",children:w.map(A=>v.jsx("button",{onClick:()=>k(A),className:`w-full text-left px-4 py-2.5 text-sm hover:bg-purple-50 transition-colors ${s===A?"bg-purple-50 text-purple-600 font-medium":"text-gray-700"}`,children:A},A))})})]}),v.jsxs("div",{className:"relative",ref:S,children:[v.jsxs("button",{disabled:m,onClick:()=>a(A=>!A),className:"flex items-center gap-2 px-4 py-2.5 rounded-lg bg-purple-600 text-white font-medium text-sm hover:bg-purple-700 transition-colors disabled:bg-gray-400 disabled:cursor-not-allowed",children:[m?"Exporting...":"Export Report",v.jsx(D$,{fontSize:"small"})]}),o&&v.jsx("div",{className:"absolute right-0 mt-2 bg-white border border-gray-200 rounded-lg shadow-lg z-50 min-w-[180px]",children:x.map(A=>v.jsx("button",{onClick:()=>j(A.value),className:"block px-4 py-2.5 text-sm hover:bg-purple-50 w-full text-left text-gray-700 transition-colors first:rounded-t-lg last:rounded-b-lg",children:A.label},A.value))})]})]})]})}var Hk={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Xw=P.createContext&&P.createContext(Hk),g3=["attr","size","title"];function v3(e,t){if(e==null)return{};var n=y3(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function y3(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sf.apply(this,arguments)}function Qw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qw(Object(n),!0).forEach(function(r){b3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b3(e,t,n){return t=x3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x3(e){var t=w3(e,"string");return typeof t=="symbol"?t:t+""}function w3(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yk(e){return e&&e.map((t,n)=>P.createElement(t.tag,Ef({key:n},t.attr),Yk(t.child)))}function Ze(e){return t=>P.createElement(_3,Sf({attr:Ef({},e.attr)},t),Yk(e.child))}function _3(e){var t=n=>{var{attr:r,size:i,title:o}=e,a=v3(e,g3),s=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),P.createElement("svg",Sf({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:Ef(Ef({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&P.createElement("title",null,o),e.children)};return Xw!==void 0?P.createElement(Xw.Consumer,null,n=>t(n)):t(Hk)}function Ks(e){return Ze({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"},child:[]}]})(e)}function qs(e){return Ze({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"},child:[]}]})(e)}function S3(e){return Ze({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M192 208c0-17.67-14.33-32-32-32h-16c-35.35 0-64 28.65-64 64v48c0 35.35 28.65 64 64 64h16c17.67 0 32-14.33 32-32V208zm176 144c35.35 0 64-28.65 64-64v-48c0-35.35-28.65-64-64-64h-16c-17.67 0-32 14.33-32 32v112c0 17.67 14.33 32 32 32h16zM256 0C113.18 0 4.58 118.83 0 256v16c0 8.84 7.16 16 16 16h16c8.84 0 16-7.16 16-16v-16c0-114.69 93.31-208 208-208s208 93.31 208 208h-.12c.08 2.43.12 165.72.12 165.72 0 23.35-18.93 42.28-42.28 42.28H320c0-26.51-21.49-48-48-48h-32c-26.51 0-48 21.49-48 48s21.49 48 48 48h181.72c49.86 0 90.28-40.42 90.28-90.28V256C507.42 118.83 398.82 0 256 0z"},child:[]}]})(e)}function Uk(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M9 22v-4h6v4"},child:[]},{tag:"path",attr:{d:"M8 6h.01"},child:[]},{tag:"path",attr:{d:"M16 6h.01"},child:[]},{tag:"path",attr:{d:"M12 6h.01"},child:[]},{tag:"path",attr:{d:"M12 10h.01"},child:[]},{tag:"path",attr:{d:"M12 14h.01"},child:[]},{tag:"path",attr:{d:"M16 10h.01"},child:[]},{tag:"path",attr:{d:"M16 14h.01"},child:[]},{tag:"path",attr:{d:"M8 10h.01"},child:[]},{tag:"path",attr:{d:"M8 14h.01"},child:[]}]})(e)}function E3(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2"},child:[]},{tag:"circle",attr:{cx:"7",cy:"17",r:"2"},child:[]},{tag:"path",attr:{d:"M9 17h6"},child:[]},{tag:"circle",attr:{cx:"17",cy:"17",r:"2"},child:[]}]})(e)}function Zp(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 4h3a2 2 0 0 1 2 2v14"},child:[]},{tag:"path",attr:{d:"M2 20h3"},child:[]},{tag:"path",attr:{d:"M13 20h9"},child:[]},{tag:"path",attr:{d:"M10 12v.01"},child:[]},{tag:"path",attr:{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z"},child:[]}]})(e)}function O3(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 5h6"},child:[]},{tag:"path",attr:{d:"M19 2v6"},child:[]},{tag:"path",attr:{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5"},child:[]},{tag:"path",attr:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"2"},child:[]}]})(e)}function Kk(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"},child:[]}]})(e)}function Tv(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"},child:[]},{tag:"path",attr:{d:"M14 8H8"},child:[]},{tag:"path",attr:{d:"M16 12H8"},child:[]},{tag:"path",attr:{d:"M13 16H8"},child:[]}]})(e)}function qk(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"},child:[]},{tag:"path",attr:{d:"m9 12 2 2 4-4"},child:[]}]})(e)}function bb(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"},child:[]},{tag:"path",attr:{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"},child:[]},{tag:"path",attr:{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"},child:[]}]})(e)}function C3(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"},child:[]}]})(e)}function Gk(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.03 2.59a1.501 1.501 0 0 1 1.94 0l7.5 6.363a1.5 1.5 0 0 1 .53 1.144V19.5a1.5 1.5 0 0 1-1.5 1.5h-5.75a.75.75 0 0 1-.75-.75V14h-2v6.25a.75.75 0 0 1-.75.75H4.5A1.5 1.5 0 0 1 3 19.5v-9.403c0-.44.194-.859.53-1.144ZM12 3.734l-7.5 6.363V19.5h5v-6.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 .75.75v6.25h5v-9.403Z"},child:[]}]})(e)}function xb(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.5 8a5.5 5.5 0 1 1 8.596 4.547 9.005 9.005 0 0 1 5.9 8.18.751.751 0 0 1-1.5.045 7.5 7.5 0 0 0-14.993 0 .75.75 0 0 1-1.499-.044 9.005 9.005 0 0 1 5.9-8.181A5.496 5.496 0 0 1 3.5 8ZM9 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm8.29 4c-.148 0-.292.01-.434.03a.75.75 0 1 1-.212-1.484 4.53 4.53 0 0 1 3.38 8.097 6.69 6.69 0 0 1 3.956 6.107.75.75 0 0 1-1.5 0 5.193 5.193 0 0 0-3.696-4.972l-.534-.16v-1.676l.41-.209A3.03 3.03 0 0 0 17.29 8Z"},child:[]}]})(e)}function Xk(e){return Ze({attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 2 7 L 2 24 L 30 24 L 30 7 L 2 7 z M 6 9 L 26 9 C 26 10.105 26.895 11 28 11 L 28 20 C 26.895 20 26 20.895 26 22 L 6 22 C 6 20.895 5.105 20 4 20 L 4 11 C 5.105 11 6 10.105 6 9 z M 16 11 C 13.789 11 12 13.016 12 15.5 C 12 17.984 13.789 20 16 20 C 18.211 20 20 17.984 20 15.5 C 20 13.016 18.211 11 16 11 z M 16 13 C 17.102 13 18 14.121 18 15.5 C 18 16.879 17.102 18 16 18 C 14.898 18 14 16.879 14 15.5 C 14 14.121 14.898 13 16 13 z M 8.5 14 C 7.672 14 7 14.672 7 15.5 C 7 16.328 7.672 17 8.5 17 C 9.328 17 10 16.328 10 15.5 C 10 14.672 9.328 14 8.5 14 z M 23.5 14 C 22.672 14 22 14.672 22 15.5 C 22 16.328 22.672 17 23.5 17 C 24.328 17 25 16.328 25 15.5 C 25 14.672 24.328 14 23.5 14 z"},child:[]}]})(e)}const P3=[{name:"Overview",icon:Gk},{name:"Community",icon:Uk},{name:"Financials",icon:Xk},{name:"Facilities",icon:Zp},{name:"Gate & Security",icon:bb},{name:"Helpdesk",icon:S3},{name:"Engagement",icon:Kk}];function k3(){const[e,t]=P.useState("Overview");return v.jsx("div",{className:"flex gap-[8px] p-3",children:P3.map(n=>{const r=n.icon,i=e===n.name;return v.jsxs("button",{onClick:()=>t(n.name),className:`flex items-center gap-[8px] rounded px-4 py-3 text-[14px] leading-[16px] font-medium transition
|
|
124
|
-
${i?"bg-[#FBF5FF] text-[#884EA7]":"bg-white text-[#64748B] hover:bg-gray-50"}`,children:[v.jsx(r,{className:"h-[15px] w-[15px] font-bold"}),n.name]},n.name)})})}function D3(e){return Ze({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M384 160c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-82.7L342.6 374.6c-12.5 12.5-32.8 12.5-45.3 0L192 269.3 54.6 406.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160c12.5-12.5 32.8-12.5 45.3 0L320 306.7 466.7 160 384 160z"},child:[]}]})(e)}function A3(e){return Ze({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0z"},child:[]}]})(e)}function T3(e){return Ze({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"},child:[]}]})(e)}function M3(e){return Ze({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"},child:[]}]})(e)}function N3(e){return Ze({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"},child:[]}]})(e)}const j3=({color:e})=>v.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),pu=({active:e,payload:t,coordinate:n})=>{if(!e||!t||!t.length)return null;const r=60,i=235;let o=n?.y||0;return o+r/2>i&&(o=i-r/2-8),o-r/2<0&&(o=r/2+8),v.jsxs("div",{className:"relative bg-[#121212] text-white text-[12px] px-
|
|
123
|
+
*/var Av=function(t,n){return Av=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},Av(t,n)};function pn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Av(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var _e=function(){return _e=Object.assign||function(n){for(var r,i=1,o=arguments.length;i<o;i++){r=arguments[i];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])}return n},_e.apply(this,arguments)};function hi(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var _6=function(e){var t=e.showTimeSelectOnly,n=t===void 0?!1:t,r=e.showTime,i=r===void 0?!1:r,o=e.className,a=e.children,s=e.inline,l=n?"Choose Time":"Choose Date".concat(i?" and Time":"");return P.createElement("div",{className:o,"aria-label":l,role:s?void 0:"dialog","aria-modal":s?void 0:"true",translate:"no"},a)},S6=function(e,t){var n=P.useRef(null),r=P.useRef(e);P.useEffect(function(){r.current=e},[e]);var i=P.useCallback(function(o){var a,s=o.composed&&o.composedPath&&o.composedPath().find(function(l){return l instanceof Node})||o.target;n.current&&!n.current.contains(s)&&(t&&s instanceof HTMLElement&&s.classList.contains(t)||(a=r.current)===null||a===void 0||a.call(r,o))},[t]);return P.useEffect(function(){return document.addEventListener("mousedown",i),function(){document.removeEventListener("mousedown",i)}},[i]),n},Qp=function(e){var t=e.children,n=e.onClickOutside,r=e.className,i=e.containerRef,o=e.style,a=e.ignoreClass,s=S6(n,a);return P.createElement("div",{className:r,style:o,ref:function(l){s.current=l,i&&(i.current=l)}},t)},Gu=null,Aw=!1;function Tk(){if(Aw)return Gu;Aw=!0;try{var e="date-fns-tz";Gu=require(e)}catch{Gu=null}return Gu}function Tw(e,t){if(!t)return e;var n=Tk();return n?n.toZonedTime(e,t):(process.env.NODE_ENV!=="production"&&console.warn('react-datepicker: timeZone prop requires "date-fns-tz" package. Please install it: npm install date-fns-tz'),e)}function Ii(e,t){if(!t)return e;var n=Tk();return n?n.fromZonedTime(e,t):(process.env.NODE_ENV!=="production"&&console.warn('react-datepicker: timeZone prop requires "date-fns-tz" package. Please install it: npm install date-fns-tz'),e)}var ne;(function(e){e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.PageUp="PageUp",e.PageDown="PageDown",e.Home="Home",e.End="End",e.Enter="Enter",e.Space=" ",e.Tab="Tab",e.Escape="Escape",e.Backspace="Backspace",e.X="x"})(ne||(ne={}));function Mk(){var e=typeof window<"u"?window:globalThis;return e}var du=12;function Ae(e){if(e==null)return new Date;var t=typeof e=="string"?$4(e):me(e);return Un(t)?t:new Date}function da(e,t,n,r,i){i===void 0&&(i=Ae());for(var o=Us(n)||Us(gb()),a=Array.isArray(t)?t:[t],s=0,l=a;s<l.length;s++){var c=l[s],u=N4(e,c,i,{locale:o});if(Un(u)&&(!r||e===pt(u,c,n)))return u}if(!r&&e&&e.length>=8){var d=new Date(e);if(zs(d))return d}return null}function E6(e,t){if(t===void 0&&(t=Ae()),!e)return null;var n=e.match(/\b(1\d{3}|2\d{3})\b/);if(!n||!n[1])return null;var r=parseInt(n[1],10),i=e.match(/(?:^|[/\-\s])?(0?[1-9]|1[0-2])(?:[/\-\s]|$)/),o=i&&i[1]?parseInt(i[1],10)-1:t.getMonth();return new Date(r,o,1)}function Un(e){return zs(e)}function Da(e){return e==null?null:vi(e)&&zs(e)?e:null}function pt(e,t,n){if(n==="en")return gw(e,t,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var r=n?Us(n):void 0;return n&&!r&&console.warn('A locale object was not found for the provided string ["'.concat(n,'"].')),r=r||Us(gb()),gw(e,t,{locale:r,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function Hn(e,t){var n=t.dateFormat,r=t.locale,i=Array.isArray(n)&&n.length>0?n[0]:n;return e&&pt(e,i,r)||""}var Nk=" - ";function O6(e,t,n){if(!e&&!t)return"";var r=e?Hn(e,n):"",i=t?Hn(t,n):"",o=n.rangeSeparator||Nk;return"".concat(r).concat(o).concat(i)}function C6(e,t){if(!e?.length)return"";var n=e[0]?Hn(e[0],t):"";if(e.length===1)return n;if(e.length===2&&e[1]){var r=Hn(e[1],t);return"".concat(n,", ").concat(r)}var i=e.length-1;return"".concat(n," (+").concat(i,")")}function Li(e,t){var n=t.hour,r=n===void 0?0:n,i=t.minute,o=i===void 0?0:i,a=t.second,s=a===void 0?0:a;return Gd(Xd(Qd(e,s),o),r)}function P6(e){return sb(e)}function k6(e,t){return pt(e,"ddd",t)}function oc(e){return Ya(e)}function Wo(e,t,n){var r=Us(t||gb());return ao(e,{locale:r,weekStartsOn:n})}function Ji(e){return ck(e)}function ac(e){return Yp(e)}function Mw(e){return Ov(e)}function Nw(){return Ya(Ae())}function jw(e){return sk(e)}function D6(e){return $$(e)}function A6(e){return lk(e)}function ci(e,t){return e&&t?L4(e,t):!e&&!t}function Mn(e,t){return e&&t?R4(e,t):!e&&!t}function _f(e,t){return e&&t?I4(e,t):!e&&!t}function Pe(e,t){return e&&t?L$(e,t):!e&&!t}function Aa(e,t){return e&&t?F5(e,t):!e&&!t}function ya(e,t,n){var r,i=Ya(t),o=sk(n);try{r=Mc(e,{start:i,end:o})}catch{r=!1}return r}function gb(){var e=Mk();return e.__localeId__}function Us(e){if(typeof e=="string"){var t=Mk();return t.__localeData__?t.__localeData__[e]:void 0}else return e}function T6(e,t,n){return t(pt(e,"EEEE",n))}function M6(e,t){return pt(e,"EEEEEE",t)}function N6(e,t){return pt(e,"EEE",t)}function vb(e,t){return pt(sr(Ae(),e),"LLLL",t)}function jk(e,t){return pt(sr(Ae(),e),"LLL",t)}function j6(e,t){return pt(Os(Ae(),e),"QQQ",t)}function Dr(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.excludeDateIntervals,s=n.includeDates,l=n.includeDateIntervals,c=n.filterDate,u=n.disabled;return u?!0:fu(e,{minDate:r,maxDate:i})||o&&o.some(function(d){return d instanceof Date?Pe(e,d):Pe(e,d.date)})||a&&a.some(function(d){var f=d.start,p=d.end;return Mc(e,{start:f,end:p})})||s&&!s.some(function(d){return Pe(e,d)})||l&&!l.some(function(d){var f=d.start,p=d.end;return Mc(e,{start:f,end:p})})||c&&!c(Ae(e))||!1}function yb(e,t){var n=t===void 0?{}:t,r=n.excludeDates,i=n.excludeDateIntervals;return i&&i.length>0?i.some(function(o){var a=o.start,s=o.end;return Mc(e,{start:a,end:s})}):r&&r.some(function(o){var a;return o instanceof Date?Pe(e,o):Pe(e,(a=o.date)!==null&&a!==void 0?a:new Date)})||!1}function Rk(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.includeDates,s=n.filterDate;return fu(e,{minDate:r?ck(r):void 0,maxDate:i?lk(i):void 0})||o?.some(function(l){return Mn(e,l instanceof Date?l:l.date)})||a&&!a.some(function(l){return Mn(e,l)})||s&&!s(Ae(e))||!1}function Xu(e,t,n,r){var i=Ee(e),o=Kn(e),a=Ee(t),s=Kn(t),l=Ee(r);return i===a&&i===l?o<=n&&n<=s:i<a?l===i&&o<=n||l===a&&s>=n||l<a&&l>i:!1}function R6(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.includeDates;return fu(e,{minDate:r,maxDate:i})||o&&o.some(function(s){return Mn(s instanceof Date?s:s.date,e)})||a&&!a.some(function(s){return Mn(s,e)})||!1}function Qu(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.includeDates,s=n.filterDate,l=n.disabled;return l?!0:fu(e,{minDate:r,maxDate:i})||o?.some(function(c){return _f(e,c instanceof Date?c:c.date)})||a&&!a.some(function(c){return _f(e,c)})||s&&!s(Ae(e))||!1}function Zu(e,t,n){if(!t||!n||!zs(t)||!zs(n))return!1;var r=Ee(t),i=Ee(n);return r<=e&&i>=e}function Jd(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.maxDate,o=n.excludeDates,a=n.includeDates,s=n.filterDate,l=n.disabled;if(l)return!0;var c=new Date(e,0,1);return fu(c,{minDate:r?Yp(r):void 0,maxDate:i?uk(i):void 0})||o?.some(function(u){return ci(c,u instanceof Date?u:u.date)})||a&&!a.some(function(u){return ci(c,u)})||s&&!s(Ae(c))||!1}function Ju(e,t,n,r){var i=Ee(e),o=jo(e),a=Ee(t),s=jo(t),l=Ee(r);return i===a&&i===l?o<=n&&n<=s:i<a?l===i&&o<=n||l===a&&s>=n||l<a&&l>i:!1}function fu(e,t){var n,r=t===void 0?{}:t,i=r.minDate,o=r.maxDate;return(n=i&&Ws(e,i)<0||o&&Ws(e,o)>0)!==null&&n!==void 0?n:!1}function Rw(e,t){return t.some(function(n){return xn(n)===xn(e)&&wn(n)===wn(e)&&Bo(n)===Bo(e)})}function Iw(e,t){var n=t===void 0?{}:t,r=n.excludeTimes,i=n.includeTimes,o=n.filterTime;return r&&Rw(e,r)||i&&!Rw(e,i)||o&&!o(e)||!1}function Lw(e,t){var n=t.minTime,r=t.maxTime;if(!n||!r)throw new Error("Both minTime and maxTime props required");var i=Ae();i=Gd(i,xn(e)),i=Xd(i,wn(e)),i=Qd(i,Bo(e));var o=Ae();o=Gd(o,xn(n)),o=Xd(o,wn(n)),o=Qd(o,Bo(n));var a=Ae();a=Gd(a,xn(r)),a=Xd(a,wn(r)),a=Qd(a,Bo(r));var s;try{s=!Mc(i,{start:o,end:a})}catch{s=!1}return s}function Fw(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,o=Ia(e,1);return r&&pf(r,o)>0||i&&i.every(function(a){return pf(a,o)>0})||!1}function $w(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,o=Xr(e,1);return r&&pf(o,r)>0||i&&i.every(function(a){return pf(o,a)>0})||!1}function I6(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,o=Yp(e),a=bk(o);return r&&hf(r,a)>0||i&&i.every(function(s){return hf(s,a)>0})||!1}function L6(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,o=uk(e),a=ab(o,1);return r&&hf(a,r)>0||i&&i.every(function(s){return hf(a,s)>0})||!1}function Bw(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.includeDates,o=Ko(e,1);return r&&mf(r,o)>0||i&&i.every(function(a){return mf(a,o)>0})||!1}function F6(e,t){var n=t===void 0?{}:t,r=n.minDate,i=n.yearItemNumber,o=i===void 0?du:i,a=ac(Ko(e,o)),s=Ki(a,o).endPeriod,l=r&&Ee(r);return l&&l>s||!1}function Ww(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.includeDates,o=Gr(e,1);return r&&mf(o,r)>0||i&&i.every(function(a){return mf(o,a)>0})||!1}function $6(e,t){var n=t===void 0?{}:t,r=n.maxDate,i=n.yearItemNumber,o=i===void 0?du:i,a=Gr(e,o),s=Ki(a,o).startPeriod,l=r&&Ee(r);return l&&l<s||!1}function Ik(e){var t=e.minDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Ws(i,t)>=0});return uw(r)}else return n?uw(n):t}function Lk(e){var t=e.maxDate,n=e.includeDates;if(n&&t){var r=n.filter(function(i){return Ws(i,t)<=0});return cw(r)}else return n?cw(n):t}function zw(e,t){var n;e===void 0&&(e=[]),t===void 0&&(t="react-datepicker__day--highlighted");for(var r=new Map,i=0,o=e.length;i<o;i++){var a=e[i];if(vi(a)){var s=pt(a,"MM.dd.yyyy"),l=r.get(s)||[];l.includes(t)||(l.push(t),r.set(s,l))}else if(typeof a=="object"){var c=Object.keys(a),u=(n=c[0])!==null&&n!==void 0?n:"",d=a[u];if(typeof u=="string"&&Array.isArray(d))for(var f=0,p=d.length;f<p;f++){var h=d[f];if(h){var s=pt(h,"MM.dd.yyyy"),l=r.get(s)||[];l.includes(u)||(l.push(u),r.set(s,l))}}}}return r}function B6(e,t){return e.length!==t.length?!1:e.every(function(n,r){return n===t[r]})}function W6(e,t){e===void 0&&(e=[]),t===void 0&&(t="react-datepicker__day--holidays");var n=new Map;return e.forEach(function(r){var i=r.date,o=r.holidayName;if(vi(i)){var a=pt(i,"MM.dd.yyyy"),s=n.get(a)||{className:"",holidayNames:[]};if(!("className"in s&&s.className===t&&B6(s.holidayNames,[o]))){s.className=t;var l=s.holidayNames;s.holidayNames=l?hi(hi([],l,!0),[o],!1):[o],n.set(a,s)}}}),n}function z6(e,t,n,r,i){for(var o=i.length,a=[],s=0;s<o;s++){var l=e,c=i[s];c&&(l=N$(l,xn(c)),l=Tc(l,wn(c)),l=I$(l,Bo(c)));var u=Tc(e,(n+1)*r);Zi(l,t)&&pi(l,u)&&c!=null&&a.push(c)}return a}function vs(e){return e<10?"0".concat(e):"".concat(e)}function Ki(e,t){t===void 0&&(t=du);var n=Math.ceil(Ee(e)/t)*t,r=n-(t-1);return{startPeriod:r,endPeriod:n}}function V6(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),24);return Math.round((+n-+t)/36e5)}function Vw(e){var t=e.getSeconds(),n=e.getMilliseconds();return me(e.getTime()-t*1e3-n)}function Fk(e,t){return Vw(e).getTime()===Vw(t).getTime()}function Hw(e){if(!vi(e))throw new Error("Invalid date");var t=new Date(e);return t.setHours(0,0,0,0),t}function pm(e,t){if(!vi(e)||!vi(t))throw new Error("Invalid date received");var n=Hw(e),r=Hw(t);return pi(n,r)}function $k(e){return e.key===ne.Space}var hm=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.inputRef=P.createRef(),r.onTimeChange=function(i){var o,a;r.setState({time:i});var s=r.props.date,l=s instanceof Date&&!isNaN(+s),c=l?s:new Date;if(i?.includes(":")){var u=i.split(":"),d=u[0],f=u[1];c.setHours(Number(d)),c.setMinutes(Number(f))}(a=(o=r.props).onChange)===null||a===void 0||a.call(o,c)},r.renderTimeInput=function(){var i=r.state.time,o=r.props,a=o.date,s=o.timeString,l=o.customTimeInput;return l?P.cloneElement(l,{date:a,value:i,onChange:r.onTimeChange}):P.createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:r.inputRef,onClick:function(){var c;(c=r.inputRef.current)===null||c===void 0||c.focus()},required:!0,value:i,onChange:function(c){r.onTimeChange(c.target.value||s)}})},r.state={time:r.props.timeString},r}return t.getDerivedStateFromProps=function(n,r){return n.timeString!==r.time?{time:n.timeString}:null},t.prototype.render=function(){return P.createElement("div",{className:"react-datepicker__input-time-container"},P.createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),P.createElement("div",{className:"react-datepicker-time__input-container"},P.createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},t})(P.Component),H6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.dayEl=P.createRef(),n.handleClick=function(r){!n.isDisabled()&&n.props.onClick&&n.props.onClick(r)},n.handleMouseEnter=function(r){!n.isDisabled()&&n.props.onMouseEnter&&n.props.onMouseEnter(r)},n.handleOnKeyDown=function(r){var i,o,a=r.key;a===ne.Space&&(r.preventDefault(),r.key=ne.Enter),(o=(i=n.props).handleOnKeyDown)===null||o===void 0||o.call(i,r)},n.isSameDay=function(r){return Pe(n.props.day,r)},n.isKeyboardSelected=function(){var r;if(n.props.disabledKeyboardNavigation)return!1;var i=n.props.selectsMultiple?(r=n.props.selectedDates)===null||r===void 0?void 0:r.some(function(a){return n.isSameDayOrWeek(a)}):n.isSameDayOrWeek(n.props.selected),o=n.props.preSelection&&n.isDisabled(n.props.preSelection);return!i&&n.isSameDayOrWeek(n.props.preSelection)&&!o},n.isDisabled=function(r){return r===void 0&&(r=n.props.day),Dr(r,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals,includeDateIntervals:n.props.includeDateIntervals,includeDates:n.props.includeDates,filterDate:n.props.filterDate,disabled:n.props.disabled})},n.isExcluded=function(){return yb(n.props.day,{excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals})},n.isStartOfWeek=function(){return Pe(n.props.day,Wo(n.props.day,n.props.locale,n.props.calendarStartDay))},n.isSameWeek=function(r){return n.props.showWeekPicker&&Pe(r,Wo(n.props.day,n.props.locale,n.props.calendarStartDay))},n.isSameDayOrWeek=function(r){return n.isSameDay(r)||n.isSameWeek(r)},n.getHighLightedClass=function(){var r=n.props,i=r.day,o=r.highlightDates;if(!o)return!1;var a=pt(i,"MM.dd.yyyy");return o.get(a)},n.getHolidaysClass=function(){var r,i=n.props,o=i.day,a=i.holidays;if(!a)return[void 0];var s=pt(o,"MM.dd.yyyy");return a.has(s)?[(r=a.get(s))===null||r===void 0?void 0:r.className]:[void 0]},n.isInRange=function(){var r=n.props,i=r.day,o=r.startDate,a=r.endDate;return!o||!a?!1:ya(i,o,a)},n.isInSelectingRange=function(){var r,i=n.props,o=i.day,a=i.selectsStart,s=i.selectsEnd,l=i.selectsRange,c=i.selectsDisabledDaysInRange,u=i.startDate,d=i.swapRange,f=i.endDate,p=(r=n.props.selectingDate)!==null&&r!==void 0?r:n.props.preSelection;if(n.isAfterMonth()||n.isBeforeMonth()||!(a||s||l)||!p||!c&&n.isDisabled())return!1;if(a&&f&&(pi(p,f)||Aa(p,f)))return ya(o,p,f);if(s&&u&&(Zi(p,u)||Aa(p,u)))return ya(o,u,p);if(l&&u&&!f){if(Aa(p,u)||Zi(p,u))return ya(o,u,p);if(d&&pi(p,u))return ya(o,p,u)}return!1},n.isSelectingRangeStart=function(){var r;if(!n.isInSelectingRange())return!1;var i=n.props,o=i.day,a=i.startDate,s=i.selectsStart,l=i.swapRange,c=i.selectsRange,u=(r=n.props.selectingDate)!==null&&r!==void 0?r:n.props.preSelection;return s?Pe(o,u):c&&l&&a&&u?Pe(o,pi(u,a)?u:a):Pe(o,a)},n.isSelectingRangeEnd=function(){var r;if(!n.isInSelectingRange())return!1;var i=n.props,o=i.day,a=i.endDate,s=i.selectsEnd,l=i.selectsRange,c=i.swapRange,u=i.startDate,d=(r=n.props.selectingDate)!==null&&r!==void 0?r:n.props.preSelection;return s?Pe(o,d):l&&c&&u&&d?Pe(o,pi(d,u)?u:d):l?Pe(o,d):Pe(o,a)},n.isRangeStart=function(){var r=n.props,i=r.day,o=r.startDate,a=r.endDate;return!o||!a?!1:Pe(o,i)},n.isRangeEnd=function(){var r=n.props,i=r.day,o=r.startDate,a=r.endDate;return!o||!a?!1:Pe(a,i)},n.isWeekend=function(){var r=j5(n.props.day);return r===0||r===6},n.isAfterMonth=function(){return n.props.month!==void 0&&(n.props.month+1)%12===Kn(n.props.day)},n.isBeforeMonth=function(){return n.props.month!==void 0&&(Kn(n.props.day)+1)%12===n.props.month},n.isCurrentDay=function(){return n.isSameDay(Ae())},n.isSelected=function(){var r;return n.props.selectsMultiple?(r=n.props.selectedDates)===null||r===void 0?void 0:r.some(function(i){return n.isSameDayOrWeek(i)}):n.isSameDayOrWeek(n.props.selected)},n.getClassNames=function(r){var i=n.props.dayClassName?n.props.dayClassName(r):void 0;return oe("react-datepicker__day",i,"react-datepicker__day--"+k6(n.props.day),{"react-datepicker__day--disabled":n.isDisabled(),"react-datepicker__day--excluded":n.isExcluded(),"react-datepicker__day--selected":n.isSelected(),"react-datepicker__day--keyboard-selected":n.isKeyboardSelected(),"react-datepicker__day--range-start":n.isRangeStart(),"react-datepicker__day--range-end":n.isRangeEnd(),"react-datepicker__day--in-range":n.isInRange(),"react-datepicker__day--in-selecting-range":n.isInSelectingRange(),"react-datepicker__day--selecting-range-start":n.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":n.isSelectingRangeEnd(),"react-datepicker__day--today":n.isCurrentDay(),"react-datepicker__day--weekend":n.isWeekend(),"react-datepicker__day--outside-month":n.isAfterMonth()||n.isBeforeMonth()},n.getHighLightedClass(),n.getHolidaysClass())},n.getAriaLabel=function(){var r=n.props,i=r.day,o=r.ariaLabelPrefixWhenEnabled,a=o===void 0?"Choose":o,s=r.ariaLabelPrefixWhenDisabled,l=s===void 0?"Not available":s,c=n.isDisabled()||n.isExcluded()?l:a;return"".concat(c," ").concat(pt(i,"PPPP",n.props.locale))},n.getTitle=function(){var r=n.props,i=r.day,o=r.holidays,a=o===void 0?new Map:o,s=r.excludeDates,l=pt(i,"MM.dd.yyyy"),c=[];return a.has(l)&&c.push.apply(c,a.get(l).holidayNames),n.isExcluded()&&c.push(s?.filter(function(u){return u instanceof Date?Pe(u,i):Pe(u?.date,i)}).map(function(u){if(!(u instanceof Date))return u?.message})),c.join(", ")},n.getTabIndex=function(){var r=n.props.selected,i=n.props.preSelection,o=!(n.props.showWeekPicker&&(n.props.showWeekNumber||!n.isStartOfWeek()))&&(n.isKeyboardSelected()||n.isSameDay(r)&&Pe(i,r))?0:-1;return o},n.handleFocusDay=function(){var r;n.shouldFocusDay()&&((r=n.dayEl.current)===null||r===void 0||r.focus({preventScroll:!0}))},n.renderDayContents=function(){return n.props.monthShowsDuplicateDaysEnd&&n.isAfterMonth()||n.props.monthShowsDuplicateDaysStart&&n.isBeforeMonth()?null:n.props.renderDayContents?n.props.renderDayContents(vw(n.props.day),n.props.day):vw(n.props.day)},n.render=function(){return P.createElement("div",{ref:n.dayEl,className:n.getClassNames(n.props.day),onKeyDown:n.handleOnKeyDown,onClick:n.handleClick,onMouseEnter:n.props.usePointerEvent?void 0:n.handleMouseEnter,onPointerEnter:n.props.usePointerEvent?n.handleMouseEnter:void 0,tabIndex:n.getTabIndex(),"aria-label":n.getAriaLabel(),role:"gridcell",title:n.getTitle(),"aria-disabled":n.isDisabled(),"aria-current":n.isCurrentDay()?"date":void 0,"aria-selected":n.isSelected()||n.isInRange()},n.renderDayContents(),n.getTitle()!==""&&P.createElement("span",{className:"overlay"},n.getTitle()))},n}return t.prototype.componentDidMount=function(){this.handleFocusDay()},t.prototype.componentDidUpdate=function(){this.handleFocusDay()},t.prototype.shouldFocusDay=function(){var n=!1;return this.getTabIndex()===0&&this.isSameDay(this.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(n=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(n=!1),this.isDayActiveElement()&&(n=!0),this.isDuplicateDay()&&(n=!1)),n},t.prototype.isDayActiveElement=function(){var n,r,i;return((r=(n=this.props.containerRef)===null||n===void 0?void 0:n.current)===null||r===void 0?void 0:r.contains(document.activeElement))&&((i=document.activeElement)===null||i===void 0?void 0:i.classList.contains("react-datepicker__day"))},t.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},t})(P.Component),Y6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.weekNumberEl=P.createRef(),n.handleClick=function(r){n.props.onClick&&n.props.onClick(r)},n.handleOnKeyDown=function(r){var i,o,a=r.key;a===ne.Space&&(r.preventDefault(),r.key=ne.Enter),(o=(i=n.props).handleOnKeyDown)===null||o===void 0||o.call(i,r)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!Pe(n.props.date,n.props.selected)&&Pe(n.props.date,n.props.preSelection)},n.getTabIndex=function(){return n.props.showWeekPicker&&n.props.showWeekNumber&&(n.isKeyboardSelected()||Pe(n.props.date,n.props.selected)&&Pe(n.props.preSelection,n.props.selected))?0:-1},n.handleFocusWeekNumber=function(r){var i=!1;n.getTabIndex()===0&&!r?.isInputFocused&&Pe(n.props.date,n.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(i=!0),n.props.inline&&!n.props.shouldFocusDayInline&&(i=!1),n.props.containerRef&&n.props.containerRef.current&&n.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(i=!0)),i&&n.weekNumberEl.current&&n.weekNumberEl.current.focus({preventScroll:!0})},n}return Object.defineProperty(t,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},t.prototype.componentDidUpdate=function(n){this.handleFocusWeekNumber(n)},t.prototype.render=function(){var n=this.props,r=n.weekNumber,i=n.isWeekDisabled,o=n.ariaLabelPrefix,a=o===void 0?t.defaultProps.ariaLabelPrefix:o,s=n.onClick,l={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!s&&!i,"react-datepicker__week-number--selected":!!s&&Pe(this.props.date,this.props.selected)};return P.createElement("div",{ref:this.weekNumberEl,className:oe(l),"aria-label":"".concat(a," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex(),role:"gridcell"},r)},t})(P.Component),U6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.isDisabled=function(r){return Dr(r,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals,includeDateIntervals:n.props.includeDateIntervals,includeDates:n.props.includeDates,filterDate:n.props.filterDate})},n.handleDayClick=function(r,i){n.props.onDayClick&&n.props.onDayClick(r,i)},n.handleDayMouseEnter=function(r){n.props.onDayMouseEnter&&n.props.onDayMouseEnter(r)},n.handleWeekClick=function(r,i,o){for(var a,s,l,c=new Date(r),u=0;u<7;u++){var d=new Date(r);d.setDate(d.getDate()+u);var f=!n.isDisabled(d);if(f){c=d;break}}typeof n.props.onWeekSelect=="function"&&n.props.onWeekSelect(c,i,o),n.props.showWeekPicker&&n.handleDayClick(c,o),((a=n.props.shouldCloseOnSelect)!==null&&a!==void 0?a:t.defaultProps.shouldCloseOnSelect)&&((l=(s=n.props).setOpen)===null||l===void 0||l.call(s,!1))},n.formatWeekNumber=function(r){return n.props.formatWeekNumber?n.props.formatWeekNumber(r):P6(r)},n.isWeekDisabled=function(){for(var r=n.startOfWeek(),i=qr(r,6),o=new Date(r);o<=i;){if(!n.isDisabled(o))return!1;o=qr(o,1)}return!0},n.renderDays=function(){var r=n.startOfWeek(),i=[],o=n.formatWeekNumber(r);if(n.props.showWeekNumber){var a=n.props.onWeekSelect||n.props.showWeekPicker?n.handleWeekClick.bind(n,r,o):void 0;i.push(P.createElement(Y6,_e({key:"W"},t.defaultProps,n.props,{weekNumber:o,isWeekDisabled:n.isWeekDisabled(),date:r,onClick:a})))}return i.concat([0,1,2,3,4,5,6].map(function(s){var l=qr(r,s);return P.createElement(H6,_e({},t.defaultProps,n.props,{ariaLabelPrefixWhenEnabled:n.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:n.props.disabledDayAriaLabelPrefix,key:l.valueOf(),day:l,onClick:n.handleDayClick.bind(n,l),onMouseEnter:n.handleDayMouseEnter.bind(n,l)}))}))},n.startOfWeek=function(){return Wo(n.props.day,n.props.locale,n.props.calendarStartDay)},n.isKeyboardSelected=function(){return!n.props.disabledKeyboardNavigation&&!Pe(n.startOfWeek(),n.props.selected)&&Pe(n.startOfWeek(),n.props.preSelection)},n}return Object.defineProperty(t,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}},enumerable:!1,configurable:!0}),t.prototype.render=function(){var n={"react-datepicker__week":!0,"react-datepicker__week--selected":Pe(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()},r=this.props.weekClassName?this.props.weekClassName(this.startOfWeek()):void 0;return P.createElement("div",{className:oe(n,r),role:"row"},this.renderDays())},t})(P.Component),Fl,K6=6,Ms={TWO_COLUMNS:"two_columns",THREE_COLUMNS:"three_columns",FOUR_COLUMNS:"four_columns"},mm=(Fl={},Fl[Ms.TWO_COLUMNS]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},Fl[Ms.THREE_COLUMNS]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},Fl[Ms.FOUR_COLUMNS]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},Fl),ed=1;function Yw(e,t){return e?Ms.FOUR_COLUMNS:t?Ms.TWO_COLUMNS:Ms.THREE_COLUMNS}var q6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.MONTH_REFS=hi([],Array(12),!0).map(function(){return P.createRef()}),n.QUARTER_REFS=hi([],Array(4),!0).map(function(){return P.createRef()}),n.isDisabled=function(r){return Dr(r,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals,includeDateIntervals:n.props.includeDateIntervals,includeDates:n.props.includeDates,filterDate:n.props.filterDate,disabled:n.props.disabled})},n.isExcluded=function(r){return yb(r,{excludeDates:n.props.excludeDates,excludeDateIntervals:n.props.excludeDateIntervals})},n.handleDayClick=function(r,i){var o,a;(a=(o=n.props).onDayClick)===null||a===void 0||a.call(o,r,i,n.props.orderInDisplay)},n.handleDayMouseEnter=function(r){var i,o;(o=(i=n.props).onDayMouseEnter)===null||o===void 0||o.call(i,r)},n.handleMouseLeave=function(){var r,i;(i=(r=n.props).onMouseLeave)===null||i===void 0||i.call(r)},n.isRangeStartMonth=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate;return!a||!s?!1:Mn(sr(o,r),a)},n.isRangeStartQuarter=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate;return!a||!s?!1:_f(Os(o,r),a)},n.isRangeEndMonth=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate;return!a||!s?!1:Mn(sr(o,r),s)},n.isRangeEndQuarter=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate;return!a||!s?!1:_f(Os(o,r),s)},n.isInSelectingRangeMonth=function(r){var i,o=n.props,a=o.day,s=o.selectsStart,l=o.selectsEnd,c=o.selectsRange,u=o.startDate,d=o.endDate,f=(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection;return!(s||l||c)||!f?!1:s&&d?Xu(f,d,r,a):l&&u||c&&u&&!d?Xu(u,f,r,a):!1},n.isSelectingMonthRangeStart=function(r){var i;if(!n.isInSelectingRangeMonth(r))return!1;var o=n.props,a=o.day,s=o.startDate,l=o.selectsStart,c=sr(a,r),u=(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection;return l?Mn(c,u):Mn(c,s)},n.isSelectingMonthRangeEnd=function(r){var i;if(!n.isInSelectingRangeMonth(r))return!1;var o=n.props,a=o.day,s=o.endDate,l=o.selectsEnd,c=o.selectsRange,u=sr(a,r),d=(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection;return l||c?Mn(u,d):Mn(u,s)},n.isInSelectingRangeQuarter=function(r){var i,o=n.props,a=o.day,s=o.selectsStart,l=o.selectsEnd,c=o.selectsRange,u=o.startDate,d=o.endDate,f=(i=n.props.selectingDate)!==null&&i!==void 0?i:n.props.preSelection;return!(s||l||c)||!f?!1:s&&d?Ju(f,d,r,a):l&&u||c&&u&&!d?Ju(u,f,r,a):!1},n.isWeekInMonth=function(r){var i=n.props.day,o=qr(r,6);return Mn(r,i)||Mn(o,i)},n.isCurrentMonth=function(r,i){return Ee(r)===Ee(Ae())&&i===Kn(Ae())},n.isCurrentQuarter=function(r,i){return Ee(r)===Ee(Ae())&&i===jo(Ae())},n.isSelectedMonth=function(r,i,o){return Kn(o)===i&&Ee(r)===Ee(o)},n.isSelectMonthInList=function(r,i,o){return o.some(function(a){return n.isSelectedMonth(r,i,a)})},n.isSelectedQuarter=function(r,i,o){return jo(o)===i&&Ee(r)===Ee(o)},n.isSelectQuarterInList=function(r,i,o){return o.some(function(a){return n.isSelectedQuarter(r,i,a)})},n.isMonthSelected=function(){var r=n.props,i=r.day,o=r.selected,a=r.selectedDates,s=r.selectsMultiple,l=Kn(i);return s?a?.some(function(c){return n.isSelectedMonth(i,l,c)}):!!o&&n.isSelectedMonth(i,l,o)},n.isQuarterSelected=function(){var r=n.props,i=r.day,o=r.selected,a=r.selectedDates,s=r.selectsMultiple,l=jo(i);return s?a?.some(function(c){return n.isSelectedQuarter(i,l,c)}):!!o&&n.isSelectedQuarter(i,l,o)},n.renderWeeks=function(){if(!Un(n.props.day))return[];for(var r=[],i=n.props.fixedHeight,o=0,a=!1,s=Wo(Ji(n.props.day),n.props.locale,n.props.calendarStartDay),l=function(h){return n.props.showWeekPicker?Wo(h,n.props.locale,n.props.calendarStartDay):n.props.preSelection},c=function(h){return n.props.showWeekPicker?Wo(h,n.props.locale,n.props.calendarStartDay):n.props.selected},u=n.props.selected?c(n.props.selected):void 0,d=n.props.preSelection?l(n.props.preSelection):void 0;r.push(P.createElement(U6,_e({},n.props,{ariaLabelPrefix:n.props.weekAriaLabelPrefix,key:o,day:s,month:Kn(n.props.day),onDayClick:n.handleDayClick,onDayMouseEnter:n.handleDayMouseEnter,selected:u,preSelection:d,showWeekNumber:n.props.showWeekNumbers}))),!a;){o++,s=ff(s,1);var f=i&&o>=K6,p=!i&&!n.isWeekInMonth(s);if(f||p)if(n.props.peekNextMonth)a=!0;else break}return r},n.onMonthClick=function(r,i){var o=n.isMonthDisabledForLabelDate(i),a=o.isDisabled,s=o.labelDate;a||n.handleDayClick(Ji(s),r)},n.onMonthMouseEnter=function(r){var i=n.isMonthDisabledForLabelDate(r),o=i.isDisabled,a=i.labelDate;o||n.handleDayMouseEnter(Ji(a))},n.handleMonthNavigation=function(r,i){var o,a,s,l;(a=(o=n.props).setPreSelection)===null||a===void 0||a.call(o,i),(l=(s=n.MONTH_REFS[r])===null||s===void 0?void 0:s.current)===null||l===void 0||l.focus()},n.handleKeyboardNavigation=function(r,i,o){var a,s=n.props,l=s.selected,c=s.preSelection,u=s.setPreSelection,d=s.minDate,f=s.maxDate,p=s.showFourColumnMonthYearPicker,h=s.showTwoColumnMonthYearPicker;if(c){var m=Yw(p,h),g=n.getVerticalOffset(m),b=(a=mm[m])===null||a===void 0?void 0:a.grid,S=function(k,D,T){var j,A,C=D,N=T;switch(k){case ne.ArrowRight:C=Xr(D,ed),N=T===11?0:T+ed;break;case ne.ArrowLeft:C=Ia(D,ed),N=T===0?11:T-ed;break;case ne.ArrowUp:C=Ia(D,g),N=!((j=b?.[0])===null||j===void 0)&&j.includes(T)?T+12-g:T-g;break;case ne.ArrowDown:C=Xr(D,g),N=!((A=b?.[b.length-1])===null||A===void 0)&&A.includes(T)?T-12+g:T+g;break}return{newCalculatedDate:C,newCalculatedMonth:N}},w=function(k,D,T){for(var j=40,A=k,C=!1,N=0,M=S(A,D,T),I=M.newCalculatedDate,L=M.newCalculatedMonth;!C;){if(N>=j){I=D,L=T;break}if(d&&I<d){A=ne.ArrowRight;var $=S(A,I,L);I=$.newCalculatedDate,L=$.newCalculatedMonth}if(f&&I>f){A=ne.ArrowLeft;var $=S(A,I,L);I=$.newCalculatedDate,L=$.newCalculatedMonth}if(R6(I,n.props)){var $=S(A,I,L);I=$.newCalculatedDate,L=$.newCalculatedMonth}else C=!0;N++}return{newCalculatedDate:I,newCalculatedMonth:L}};if(i===ne.Enter){n.isMonthDisabled(o)||(n.onMonthClick(r,o),u?.(l));return}var x=w(i,c,o),_=x.newCalculatedDate,O=x.newCalculatedMonth;switch(i){case ne.ArrowRight:case ne.ArrowLeft:case ne.ArrowUp:case ne.ArrowDown:n.handleMonthNavigation(O,_);break}}},n.getVerticalOffset=function(r){var i,o;return(o=(i=mm[r])===null||i===void 0?void 0:i.verticalNavigationOffset)!==null&&o!==void 0?o:0},n.onMonthKeyDown=function(r,i){var o=n.props,a=o.disabledKeyboardNavigation,s=o.handleOnMonthKeyDown,l=r.key;l!==ne.Tab&&r.preventDefault(),a||n.handleKeyboardNavigation(r,l,i),s&&s(r)},n.onQuarterClick=function(r,i){var o=Os(n.props.day,i);Qu(o,n.props)||n.handleDayClick(Mw(o),r)},n.onQuarterMouseEnter=function(r){var i=Os(n.props.day,r);Qu(i,n.props)||n.handleDayMouseEnter(Mw(i))},n.handleQuarterNavigation=function(r,i){var o,a,s,l;n.isDisabled(i)||n.isExcluded(i)||((a=(o=n.props).setPreSelection)===null||a===void 0||a.call(o,i),(l=(s=n.QUARTER_REFS[r-1])===null||s===void 0?void 0:s.current)===null||l===void 0||l.focus())},n.onQuarterKeyDown=function(r,i){var o,a,s=r.key;if(!n.props.disabledKeyboardNavigation)switch(s){case ne.Enter:n.onQuarterClick(r,i),(a=(o=n.props).setPreSelection)===null||a===void 0||a.call(o,n.props.selected);break;case ne.ArrowRight:if(!n.props.preSelection)break;n.handleQuarterNavigation(i===4?1:i+1,ab(n.props.preSelection,1));break;case ne.ArrowLeft:if(!n.props.preSelection)break;n.handleQuarterNavigation(i===1?4:i-1,bk(n.props.preSelection));break}},n.isMonthDisabledForLabelDate=function(r){var i,o=n.props,a=o.day,s=o.disabled,l=o.minDate,c=o.maxDate,u=o.excludeDates,d=o.includeDates,f=sr(a,r);return s?{isDisabled:!0,labelDate:sr(a,r)}:{isDisabled:(i=(l||c||u||d)&&Rk(f,n.props))!==null&&i!==void 0?i:!1,labelDate:f}},n.isMonthDisabled=function(r){var i=n.isMonthDisabledForLabelDate(r).isDisabled;return i},n.getMonthClassNames=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate,l=i.preSelection,c=i.monthClassName,u=c?c(sr(o,r)):void 0,d=n.getSelection();return oe("react-datepicker__month-text","react-datepicker__month-".concat(r),u,{"react-datepicker__month-text--disabled":n.isMonthDisabled(r),"react-datepicker__month-text--selected":d?n.isSelectMonthInList(o,r,d):void 0,"react-datepicker__month-text--keyboard-selected":!n.props.disabledKeyboardNavigation&&l&&n.isSelectedMonth(o,r,l)&&!n.isMonthSelected()&&!n.isMonthDisabled(r),"react-datepicker__month-text--in-selecting-range":n.isInSelectingRangeMonth(r),"react-datepicker__month-text--in-range":a&&s?Xu(a,s,r,o):void 0,"react-datepicker__month-text--range-start":n.isRangeStartMonth(r),"react-datepicker__month-text--range-end":n.isRangeEndMonth(r),"react-datepicker__month-text--selecting-range-start":n.isSelectingMonthRangeStart(r),"react-datepicker__month-text--selecting-range-end":n.isSelectingMonthRangeEnd(r),"react-datepicker__month-text--today":n.isCurrentMonth(o,r)})},n.getTabIndex=function(r){if(n.props.preSelection==null)return"-1";var i=Kn(n.props.preSelection),o=n.isMonthDisabledForLabelDate(i).isDisabled,a=r===i&&!(o||n.props.disabledKeyboardNavigation)?"0":"-1";return a},n.getQuarterTabIndex=function(r){if(n.props.preSelection==null)return"-1";var i=jo(n.props.preSelection),o=Qu(n.props.day,n.props),a=r===i&&!(o||n.props.disabledKeyboardNavigation)?"0":"-1";return a},n.getAriaLabel=function(r){var i=n.props,o=i.chooseDayAriaLabelPrefix,a=o===void 0?"Choose":o,s=i.disabledDayAriaLabelPrefix,l=s===void 0?"Not available":s,c=i.day,u=i.locale,d=sr(c,r),f=n.isDisabled(d)||n.isExcluded(d)?l:a;return"".concat(f," ").concat(pt(d,"MMMM yyyy",u))},n.getQuarterClassNames=function(r){var i=n.props,o=i.day,a=i.startDate,s=i.endDate,l=i.minDate,c=i.maxDate,u=i.excludeDates,d=i.includeDates,f=i.filterDate,p=i.preSelection,h=i.disabledKeyboardNavigation,m=i.disabled,g=(l||c||u||d||f||m)&&Qu(Os(o,r),n.props),b=n.getSelection();return oe("react-datepicker__quarter-text","react-datepicker__quarter-".concat(r),{"react-datepicker__quarter-text--disabled":g,"react-datepicker__quarter-text--selected":b?n.isSelectQuarterInList(o,r,b):void 0,"react-datepicker__quarter-text--keyboard-selected":!h&&p&&n.isSelectedQuarter(o,r,p)&&!n.isQuarterSelected()&&!g,"react-datepicker__quarter-text--in-selecting-range":n.isInSelectingRangeQuarter(r),"react-datepicker__quarter-text--in-range":a&&s?Ju(a,s,r,o):void 0,"react-datepicker__quarter-text--range-start":n.isRangeStartQuarter(r),"react-datepicker__quarter-text--range-end":n.isRangeEndQuarter(r),"react-datepicker__quarter-text--today":n.isCurrentQuarter(o,r)})},n.getMonthContent=function(r){var i=n.props,o=i.showFullMonthYearPicker,a=i.renderMonthContent,s=i.locale,l=i.day,c=jk(r,s),u=vb(r,s);return a?a(r,c,u,l):o?u:c},n.getQuarterContent=function(r){var i,o=n.props,a=o.renderQuarterContent,s=o.locale,l=j6(r,s);return(i=a?.(r,l))!==null&&i!==void 0?i:l},n.renderMonths=function(){var r,i=n.props,o=i.showTwoColumnMonthYearPicker,a=i.showFourColumnMonthYearPicker,s=i.day,l=i.selected,c=(r=mm[Yw(a,o)])===null||r===void 0?void 0:r.grid;return c?.map(function(u,d){return P.createElement("div",{className:"react-datepicker__month-wrapper",key:d},u.map(function(f,p){return P.createElement("div",{ref:n.MONTH_REFS[f],key:p,onClick:function(h){n.onMonthClick(h,f)},onKeyDown:function(h){$k(h)&&(h.preventDefault(),h.key=ne.Enter),n.onMonthKeyDown(h,f)},onMouseEnter:n.props.usePointerEvent?void 0:function(){return n.onMonthMouseEnter(f)},onPointerEnter:n.props.usePointerEvent?function(){return n.onMonthMouseEnter(f)}:void 0,tabIndex:Number(n.getTabIndex(f)),className:n.getMonthClassNames(f),"aria-disabled":n.isMonthDisabled(f),role:"option","aria-label":n.getAriaLabel(f),"aria-current":n.isCurrentMonth(s,f)?"date":void 0,"aria-selected":l?n.isSelectedMonth(s,f,l):void 0},n.getMonthContent(f))}))})},n.renderQuarters=function(){var r=n.props,i=r.day,o=r.selected,a=[1,2,3,4];return P.createElement("div",{className:"react-datepicker__quarter-wrapper"},a.map(function(s,l){return P.createElement("div",{key:l,ref:n.QUARTER_REFS[l],role:"option",onClick:function(c){n.onQuarterClick(c,s)},onKeyDown:function(c){n.onQuarterKeyDown(c,s)},onMouseEnter:n.props.usePointerEvent?void 0:function(){return n.onQuarterMouseEnter(s)},onPointerEnter:n.props.usePointerEvent?function(){return n.onQuarterMouseEnter(s)}:void 0,className:n.getQuarterClassNames(s),"aria-selected":o?n.isSelectedQuarter(i,s,o):void 0,tabIndex:Number(n.getQuarterTabIndex(s)),"aria-current":n.isCurrentQuarter(i,s)?"date":void 0},n.getQuarterContent(s))}))},n.getClassNames=function(){var r=n.props,i=r.selectingDate,o=r.selectsStart,a=r.selectsEnd,s=r.showMonthYearPicker,l=r.showQuarterYearPicker,c=r.showWeekPicker;return oe("react-datepicker__month",{"react-datepicker__month--selecting-range":i&&(o||a)},{"react-datepicker__monthPicker":s},{"react-datepicker__quarterPicker":l},{"react-datepicker__weekPicker":c})},n}return t.prototype.getSelection=function(){var n=this.props,r=n.selected,i=n.selectedDates,o=n.selectsMultiple;if(o)return i;if(r)return[r]},t.prototype.render=function(){var n=this.props,r=n.showMonthYearPicker,i=n.showQuarterYearPicker,o=n.day,a=n.ariaLabelPrefix,s=a===void 0?"Month ":a,l=s?s.trim()+" ":"",c=Un(o)?"".concat(l).concat(pt(o,"MMMM, yyyy",this.props.locale)):"",u=r||i;return u?P.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":c,role:"listbox"},r?this.renderMonths():this.renderQuarters()):P.createElement("div",{role:"table"},this.props.dayNamesHeader&&P.createElement("div",{role:"rowgroup"},this.props.dayNamesHeader),this.props.monthHeader&&P.createElement("div",{role:"rowgroup"},this.props.monthHeader),P.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":c,role:"rowgroup"},this.renderWeeks()),this.props.monthFooter&&P.createElement("div",{role:"rowgroup"},this.props.monthFooter))},t})(P.Component),G6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.monthOptionButtonsRef={},n.isSelectedMonth=function(r){return n.props.month===r},n.handleOptionKeyDown=function(r,i){var o;switch(i.key){case"Enter":i.preventDefault(),n.onChange(r);break;case"Escape":i.preventDefault(),n.props.onCancel();break;case"ArrowUp":case"ArrowDown":{i.preventDefault();var a=(r+(i.key==="ArrowUp"?-1:1)+n.props.monthNames.length)%n.props.monthNames.length;(o=n.monthOptionButtonsRef[a])===null||o===void 0||o.focus();break}}},n.renderOptions=function(){return n.monthOptionButtonsRef={},n.props.monthNames.map(function(r,i){return P.createElement("div",{ref:function(o){n.monthOptionButtonsRef[i]=o,n.isSelectedMonth(i)&&o?.focus()},role:"button",tabIndex:0,className:n.isSelectedMonth(i)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:r,onClick:n.onChange.bind(n,i),onKeyDown:n.handleOptionKeyDown.bind(n,i),"aria-selected":n.isSelectedMonth(i)?"true":void 0},n.isSelectedMonth(i)?P.createElement("span",{className:"react-datepicker__month-option--selected"},"✓"):"",r)})},n.onChange=function(r){return n.props.onChange(r)},n.handleClickOutside=function(){return n.props.onCancel()},n}return t.prototype.render=function(){return P.createElement(Qp,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},t})(P.Component),X6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={dropdownVisible:!1},n.renderSelectOptions=function(r){return r.map(function(i,o){return P.createElement("option",{key:i,value:o},i)})},n.renderSelectMode=function(r){return P.createElement("select",{value:n.props.month,className:"react-datepicker__month-select",onChange:function(i){return n.onChange(parseInt(i.target.value))}},n.renderSelectOptions(r))},n.renderReadView=function(r,i){return P.createElement("button",{key:"read",type:"button",style:{visibility:r?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:n.toggleDropdown},P.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},i[n.props.month]))},n.renderDropdown=function(r){return P.createElement(G6,_e({key:"dropdown"},n.props,{monthNames:r,onChange:n.onChange,onCancel:n.toggleDropdown}))},n.renderScrollMode=function(r){var i=n.state.dropdownVisible,o=[n.renderReadView(!i,r)];return i&&o.unshift(n.renderDropdown(r)),o},n.onChange=function(r){n.toggleDropdown(),r!==n.props.month&&n.props.onChange(r)},n.toggleDropdown=function(){return n.setState({dropdownVisible:!n.state.dropdownVisible})},n}return t.prototype.render=function(){var n=this,r=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(o){return jk(o,n.props.locale)}:function(o){return vb(o,n.props.locale)}),i;switch(this.props.dropdownMode){case"scroll":i=this.renderScrollMode(r);break;case"select":i=this.renderSelectMode(r);break}return P.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},i)},t})(P.Component),Uw=5;function Q6(e,t,n){for(var r=[],i=e??Ko(n,Uw),o=t??Gr(n,Uw),a=Ji(i),s=Ji(o);!Zi(a,s);)r.push(Ae(a)),a=Xr(a,1);return r}var Z6=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.renderOptions=function(){return r.state.monthYearsList.map(function(i){var o=Pv(i),a=ci(r.props.date,i)&&Mn(r.props.date,i);return P.createElement("div",{className:a?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:o,onClick:r.onChange.bind(r,o),"aria-selected":a?"true":void 0},a?P.createElement("span",{className:"react-datepicker__month-year-option--selected"},"✓"):"",pt(i,r.props.dateFormat,r.props.locale))})},r.onChange=function(i){return r.props.onChange(i)},r.handleClickOutside=function(){r.props.onCancel()},r.state={monthYearsList:Q6(r.props.minDate,r.props.maxDate,r.props.date)},r}return t.prototype.render=function(){var n=oe({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return P.createElement(Qp,{className:n,onClickOutside:this.handleClickOutside},this.renderOptions())},t})(P.Component),Kw=5,J6=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={dropdownVisible:!1},n.renderSelectOptions=function(){for(var r,i,o=(r=n.props.minDate)!==null&&r!==void 0?r:Ko(n.props.date,Kw),a=(i=n.props.maxDate)!==null&&i!==void 0?i:Gr(n.props.date,Kw),s=Ji(o),l=Ji(a),c=[];!Zi(s,l);){var u=Pv(s);c.push(P.createElement("option",{key:u,value:u},pt(s,n.props.dateFormat,n.props.locale))),s=Xr(s,1)}return c},n.onSelectChange=function(r){n.onChange(parseInt(r.target.value))},n.renderSelectMode=function(){return P.createElement("select",{value:Pv(Ji(n.props.date)),className:"react-datepicker__month-year-select",onChange:n.onSelectChange},n.renderSelectOptions())},n.renderReadView=function(r){var i=pt(n.props.date,n.props.dateFormat,n.props.locale);return P.createElement("div",{key:"read",style:{visibility:r?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:n.toggleDropdown},P.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},i))},n.renderDropdown=function(){return P.createElement(Z6,_e({key:"dropdown"},n.props,{onChange:n.onChange,onCancel:n.toggleDropdown}))},n.renderScrollMode=function(){var r=n.state.dropdownVisible,i=[n.renderReadView(!r)];return r&&i.unshift(n.renderDropdown()),i},n.onChange=function(r){n.toggleDropdown();var i=Ae(r);ci(n.props.date,i)&&Mn(n.props.date,i)||n.props.onChange(i)},n.toggleDropdown=function(){return n.setState({dropdownVisible:!n.state.dropdownVisible})},n}return t.prototype.render=function(){var n;switch(this.props.dropdownMode){case"scroll":n=this.renderScrollMode();break;case"select":n=this.renderSelectMode();break}return P.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},n)},t})(P.Component),e3=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={height:null},n.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var r,i,o;n.list&&(n.list.scrollTop=(o=n.centerLi&&t.calcCenterPosition(n.props.monthRef?n.props.monthRef.clientHeight-((i=(r=n.header)===null||r===void 0?void 0:r.clientHeight)!==null&&i!==void 0?i:0):n.list.clientHeight,n.centerLi))!==null&&o!==void 0?o:0)})},n.handleClick=function(r){var i,o;(n.props.minTime||n.props.maxTime)&&Lw(r,n.props)||(n.props.excludeTimes||n.props.includeTimes||n.props.filterTime)&&Iw(r,n.props)||(o=(i=n.props).onChange)===null||o===void 0||o.call(i,r)},n.isSelectedTime=function(r){var i=Da(n.props.selected);return i&&Fk(i,r)},n.isDisabledTime=function(r){return(n.props.minTime||n.props.maxTime)&&Lw(r,n.props)||(n.props.excludeTimes||n.props.includeTimes||n.props.filterTime)&&Iw(r,n.props)},n.liClasses=function(r){var i,o=["react-datepicker__time-list-item",n.props.timeClassName?n.props.timeClassName(r):void 0];return n.isSelectedTime(r)&&o.push("react-datepicker__time-list-item--selected"),n.isDisabledTime(r)&&o.push("react-datepicker__time-list-item--disabled"),n.props.injectTimes&&(xn(r)*3600+wn(r)*60+Bo(r))%(((i=n.props.intervals)!==null&&i!==void 0?i:t.defaultProps.intervals)*60)!==0&&o.push("react-datepicker__time-list-item--injected"),o.join(" ")},n.handleOnKeyDown=function(r,i){var o,a;r.key===ne.Space&&(r.preventDefault(),r.key=ne.Enter),(r.key===ne.ArrowUp||r.key===ne.ArrowLeft)&&r.target instanceof HTMLElement&&r.target.previousSibling&&(r.preventDefault(),r.target.previousSibling instanceof HTMLElement&&r.target.previousSibling.focus()),(r.key===ne.ArrowDown||r.key===ne.ArrowRight)&&r.target instanceof HTMLElement&&r.target.nextSibling&&(r.preventDefault(),r.target.nextSibling instanceof HTMLElement&&r.target.nextSibling.focus()),r.key===ne.Enter&&n.handleClick(i),(a=(o=n.props).handleOnKeyDown)===null||a===void 0||a.call(o,r)},n.renderTimes=function(){for(var r,i=[],o=typeof n.props.format=="string"?n.props.format:"p",a=(r=n.props.intervals)!==null&&r!==void 0?r:t.defaultProps.intervals,s=Da(n.props.selected)||Da(n.props.openToDate)||Ae(),l=oc(s),c=n.props.injectTimes&&n.props.injectTimes.sort(function(g,b){return g.getTime()-b.getTime()}),u=60*V6(s),d=u/a,f=0;f<d;f++){var p=Tc(l,f*a);if(i.push(p),c){var h=z6(l,p,f,a,c);i=i.concat(h)}}var m=i.reduce(function(g,b){return b.getTime()<=s.getTime()?b:g},i[0]);return i.map(function(g){return P.createElement("li",{key:g.valueOf(),onClick:n.handleClick.bind(n,g),className:n.liClasses(g),ref:function(b){g===m&&(n.centerLi=b)},onKeyDown:function(b){n.handleOnKeyDown(b,g)},tabIndex:g===m?0:-1,role:"option","aria-selected":n.isSelectedTime(g)?"true":void 0,"aria-disabled":n.isDisabledTime(g)?"true":void 0},pt(g,o,n.props.locale))})},n.renderTimeCaption=function(){return n.props.showTimeCaption===!1?P.createElement(P.Fragment,null):P.createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(n.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(r){n.header=r}},P.createElement("div",{className:"react-datepicker-time__header"},n.props.timeCaption))},n}return Object.defineProperty(t,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},t.prototype.componentWillUnmount=function(){var n;(n=this.resizeObserver)===null||n===void 0||n.disconnect()},t.prototype.observeDatePickerHeightChanges=function(){var n=this,r=this.props.monthRef;this.updateContainerHeight(),r&&(this.resizeObserver=new ResizeObserver(function(){n.updateContainerHeight()}),this.resizeObserver.observe(r))},t.prototype.updateContainerHeight=function(){if(this.props.monthRef&&this.header){var n=this.props.monthRef.clientHeight-this.header.clientHeight;this.state.height!==n&&this.setState({height:n})}},t.prototype.render=function(){var n=this,r,i=this.state.height;return P.createElement("div",{className:"react-datepicker__time-container ".concat(((r=this.props.todayButton)!==null&&r!==void 0?r:t.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),P.createElement("div",{className:"react-datepicker__time"},P.createElement("div",{className:"react-datepicker__time-box"},P.createElement("ul",{className:"react-datepicker__time-list",ref:function(o){n.list=o},style:i?{height:i}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},t.calcCenterPosition=function(n,r){return r.offsetTop-(n/2-r.clientHeight/2)},t})(P.Component),qw=3,t3=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.YEAR_REFS=hi([],Array(r.props.yearItemNumber),!0).map(function(){return P.createRef()}),r.isDisabled=function(i){return Dr(i,{minDate:r.props.minDate,maxDate:r.props.maxDate,excludeDates:r.props.excludeDates,includeDates:r.props.includeDates,filterDate:r.props.filterDate})},r.isExcluded=function(i){return yb(i,{excludeDates:r.props.excludeDates})},r.selectingDate=function(){var i;return(i=r.props.selectingDate)!==null&&i!==void 0?i:r.props.preSelection},r.updateFocusOnPaginate=function(i){var o=function(){var a,s;(s=(a=r.YEAR_REFS[i])===null||a===void 0?void 0:a.current)===null||s===void 0||s.focus()};window.requestAnimationFrame(o)},r.handleYearClick=function(i,o){r.props.onDayClick&&r.props.onDayClick(i,o)},r.handleYearNavigation=function(i,o){var a,s,l,c,u=r.props,d=u.date,f=u.yearItemNumber;if(!(d===void 0||f===void 0)){var p=Ki(d,f).startPeriod;r.isDisabled(o)||r.isExcluded(o)||((s=(a=r.props).setPreSelection)===null||s===void 0||s.call(a,o),i-p<0?r.updateFocusOnPaginate(f-(p-i)):i-p>=f?r.updateFocusOnPaginate(Math.abs(f-(i-p))):(c=(l=r.YEAR_REFS[i-p])===null||l===void 0?void 0:l.current)===null||c===void 0||c.focus())}},r.isSameDay=function(i,o){return Pe(i,o)},r.isCurrentYear=function(i){return i===Ee(Ae())},r.isRangeStart=function(i){return r.props.startDate&&r.props.endDate&&ci(ai(Ae(),i),r.props.startDate)},r.isRangeEnd=function(i){return r.props.startDate&&r.props.endDate&&ci(ai(Ae(),i),r.props.endDate)},r.isInRange=function(i){return Zu(i,r.props.startDate,r.props.endDate)},r.isInSelectingRange=function(i){var o=r.props,a=o.selectsStart,s=o.selectsEnd,l=o.selectsRange,c=o.startDate,u=o.endDate;return!(a||s||l)||!r.selectingDate()?!1:a&&u?Zu(i,r.selectingDate(),u):s&&c||l&&c&&!u?Zu(i,c,r.selectingDate()):!1},r.isSelectingRangeStart=function(i){var o;if(!r.isInSelectingRange(i))return!1;var a=r.props,s=a.startDate,l=a.selectsStart,c=ai(Ae(),i);return l?ci(c,(o=r.selectingDate())!==null&&o!==void 0?o:null):ci(c,s??null)},r.isSelectingRangeEnd=function(i){var o;if(!r.isInSelectingRange(i))return!1;var a=r.props,s=a.endDate,l=a.selectsEnd,c=a.selectsRange,u=ai(Ae(),i);return l||c?ci(u,(o=r.selectingDate())!==null&&o!==void 0?o:null):ci(u,s??null)},r.isKeyboardSelected=function(i){if(!(r.props.disabledKeyboardNavigation||r.props.date===void 0||r.props.preSelection==null)){var o=r.props,a=o.minDate,s=o.maxDate,l=o.excludeDates,c=o.includeDates,u=o.filterDate,d=o.selected,f=ac(ai(r.props.date,i)),p=(a||s||l||c||u)&&Jd(i,r.props),h=!!d&&Pe(f,ac(d)),m=Pe(f,ac(r.props.preSelection));return!r.props.inline&&!h&&m&&!p}},r.isSelectedYear=function(i){var o=r.props,a=o.selectsMultiple,s=o.selected,l=o.selectedDates;return a?l?.some(function(c){return i===Ee(c)}):!!s&&i===Ee(s)},r.onYearClick=function(i,o){var a=r.props.date;a!==void 0&&r.handleYearClick(ac(ai(a,o)),i)},r.onYearKeyDown=function(i,o){var a,s,l=i.key,c=r.props,u=c.date,d=c.yearItemNumber,f=c.handleOnKeyDown;if(l!==ne.Tab&&i.preventDefault(),!r.props.disabledKeyboardNavigation)switch(l){case ne.Enter:if(r.props.selected==null)break;r.onYearClick(i,o),(s=(a=r.props).setPreSelection)===null||s===void 0||s.call(a,r.props.selected);break;case ne.ArrowRight:if(r.props.preSelection==null)break;r.handleYearNavigation(o+1,Gr(r.props.preSelection,1));break;case ne.ArrowLeft:if(r.props.preSelection==null)break;r.handleYearNavigation(o-1,Ko(r.props.preSelection,1));break;case ne.ArrowUp:{if(u===void 0||d===void 0||r.props.preSelection==null)break;var p=Ki(u,d).startPeriod,h=qw,m=o-h;if(m<p){var g=d%h;o>=p&&o<p+g?h=g:h+=g,m=o-h}r.handleYearNavigation(m,Ko(r.props.preSelection,h));break}case ne.ArrowDown:{if(u===void 0||d===void 0||r.props.preSelection==null)break;var b=Ki(u,d).endPeriod,h=qw,m=o+h;if(m>b){var g=d%h;o<=b&&o>b-g?h=g:h+=g,m=o+h}r.handleYearNavigation(m,Gr(r.props.preSelection,h));break}}f&&f(i)},r.getYearClassNames=function(i){var o=r.props,a=o.date,s=o.disabled,l=o.minDate,c=o.maxDate,u=o.excludeDates,d=o.includeDates,f=o.filterDate,p=o.yearClassName;return oe("react-datepicker__year-text","react-datepicker__year-".concat(i),a?p?.(ai(a,i)):void 0,{"react-datepicker__year-text--selected":r.isSelectedYear(i),"react-datepicker__year-text--disabled":(l||c||u||d||f||s)&&Jd(i,r.props),"react-datepicker__year-text--keyboard-selected":r.isKeyboardSelected(i),"react-datepicker__year-text--range-start":r.isRangeStart(i),"react-datepicker__year-text--range-end":r.isRangeEnd(i),"react-datepicker__year-text--in-range":r.isInRange(i),"react-datepicker__year-text--in-selecting-range":r.isInSelectingRange(i),"react-datepicker__year-text--selecting-range-start":r.isSelectingRangeStart(i),"react-datepicker__year-text--selecting-range-end":r.isSelectingRangeEnd(i),"react-datepicker__year-text--today":r.isCurrentYear(i)})},r.getYearTabIndex=function(i){if(r.props.disabledKeyboardNavigation||r.props.preSelection==null)return"-1";var o=Ee(r.props.preSelection),a=Jd(i,r.props);return i===o&&!a?"0":"-1"},r.getYearContent=function(i){return r.props.renderYearContent?r.props.renderYearContent(i):i},r}return t.prototype.render=function(){var n=this,r=[],i=this.props,o=i.date,a=i.yearItemNumber,s=i.onYearMouseEnter,l=i.onYearMouseLeave;if(o===void 0)return null;for(var c=Ki(o,a),u=c.startPeriod,d=c.endPeriod,f=function(m){r.push(P.createElement("div",{ref:p.YEAR_REFS[m-u],onClick:function(g){n.onYearClick(g,m)},onKeyDown:function(g){$k(g)&&(g.preventDefault(),g.key=ne.Enter),n.onYearKeyDown(g,m)},tabIndex:Number(p.getYearTabIndex(m)),className:p.getYearClassNames(m),onMouseEnter:p.props.usePointerEvent?void 0:function(g){return s(g,m)},onPointerEnter:p.props.usePointerEvent?function(g){return s(g,m)}:void 0,onMouseLeave:p.props.usePointerEvent?void 0:function(g){return l(g,m)},onPointerLeave:p.props.usePointerEvent?function(g){return l(g,m)}:void 0,key:m,"aria-current":p.isCurrentYear(m)?"date":void 0},p.getYearContent(m)))},p=this,h=u;h<=d;h++)f(h);return P.createElement("div",{className:"react-datepicker__year"},P.createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},r))},t})(P.Component);function n3(e,t,n,r){for(var i=[],o=0;o<2*t+1;o++){var a=e+t-o,s=!0;n&&(s=Ee(n)<=a),r&&s&&(s=Ee(r)>=a),s&&i.push(a)}return i}var r3=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;r.yearOptionButtonsRef={},r.handleOptionKeyDown=function(s,l){var c;switch(l.key){case"Enter":l.preventDefault(),r.onChange(s);break;case"Escape":l.preventDefault(),r.props.onCancel();break;case"ArrowUp":case"ArrowDown":{l.preventDefault();var u=s+(l.key==="ArrowUp"?1:-1);r.yearOptionButtonsRef[u]&&((c=r.yearOptionButtonsRef[u])===null||c===void 0||c.focus());break}}},r.renderOptions=function(){r.yearOptionButtonsRef={};var s=r.props.year,l=r.state.yearsList.map(function(d){return P.createElement("div",{ref:function(f){r.yearOptionButtonsRef[d]=f,d===s&&f?.focus()},role:"button",tabIndex:0,className:s===d?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:d,onClick:r.onChange.bind(r,d),onKeyDown:r.handleOptionKeyDown.bind(r,d),"aria-selected":s===d?"true":void 0},s===d?P.createElement("span",{className:"react-datepicker__year-option--selected"},"✓"):"",d)}),c=r.props.minDate?Ee(r.props.minDate):null,u=r.props.maxDate?Ee(r.props.maxDate):null;return(!u||!r.state.yearsList.find(function(d){return d===u}))&&l.unshift(P.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:r.incrementYears},P.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!c||!r.state.yearsList.find(function(d){return d===c}))&&l.push(P.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:r.decrementYears},P.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),l},r.onChange=function(s){r.props.onChange(s)},r.handleClickOutside=function(){r.props.onCancel()},r.shiftYears=function(s){var l=r.state.yearsList.map(function(c){return c+s});r.setState({yearsList:l})},r.incrementYears=function(){return r.shiftYears(1)},r.decrementYears=function(){return r.shiftYears(-1)};var i=n.yearDropdownItemNumber,o=n.scrollableYearDropdown,a=i||(o?10:5);return r.state={yearsList:n3(r.props.year,a,r.props.minDate,r.props.maxDate)},r.dropdownRef=P.createRef(),r}return t.prototype.componentDidMount=function(){var n=this.dropdownRef.current;if(n){var r=n.children?Array.from(n.children):null,i=r?r.find(function(o){return o.ariaSelected}):null;n.scrollTop=i&&i instanceof HTMLElement?i.offsetTop+(i.clientHeight-n.clientHeight)/2:(n.scrollHeight-n.clientHeight)/2}},t.prototype.render=function(){var n=oe({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return P.createElement(Qp,{className:n,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},t})(P.Component),i3=(function(e){pn(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={dropdownVisible:!1},n.renderSelectOptions=function(){for(var r=n.props.minDate?Ee(n.props.minDate):1900,i=n.props.maxDate?Ee(n.props.maxDate):2100,o=[],a=r;a<=i;a++)o.push(P.createElement("option",{key:a,value:a},a));return o},n.onSelectChange=function(r){n.onChange(parseInt(r.target.value))},n.renderSelectMode=function(){return P.createElement("select",{value:n.props.year,className:"react-datepicker__year-select",onChange:n.onSelectChange},n.renderSelectOptions())},n.renderReadView=function(r){return P.createElement("button",{key:"read",type:"button",style:{visibility:r?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:n.toggleDropdown},P.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),P.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},n.props.year))},n.renderDropdown=function(){return P.createElement(r3,_e({key:"dropdown"},n.props,{onChange:n.onChange,onCancel:n.toggleDropdown}))},n.renderScrollMode=function(){var r=n.state.dropdownVisible,i=[n.renderReadView(!r)];return r&&i.unshift(n.renderDropdown()),i},n.onChange=function(r){n.toggleDropdown(),r!==n.props.year&&n.props.onChange(r)},n.toggleDropdown=function(r){n.setState({dropdownVisible:!n.state.dropdownVisible},function(){n.props.adjustDateOnChange&&n.handleYearChange(n.props.date,r)})},n.handleYearChange=function(r,i){var o;(o=n.onSelect)===null||o===void 0||o.call(n,r,i),n.setOpen()},n.onSelect=function(r,i){var o,a;(a=(o=n.props).onSelect)===null||a===void 0||a.call(o,r,i)},n.setOpen=function(){var r,i;(i=(r=n.props).setOpen)===null||i===void 0||i.call(r,!0)},n}return t.prototype.render=function(){var n;switch(this.props.dropdownMode){case"scroll":n=this.renderScrollMode();break;case"select":n=this.renderSelectMode();break}return P.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},n)},t})(P.Component),o3=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],Bk="react-datepicker-ignore-onclickoutside",a3=function(e){var t=(e.className||"").split(/\s+/);return o3.some(function(n){return t.indexOf(n)>=0})},s3=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.monthContainer=void 0,r.handleClickOutside=function(i){r.props.onClickOutside(i)},r.setClickOutsideRef=function(){return r.containerRef.current},r.handleDropdownFocus=function(i){var o,a;a3(i.target)&&((a=(o=r.props).onDropdownFocus)===null||a===void 0||a.call(o,i))},r.getDateInView=function(){var i=r.props,o=i.preSelection,a=i.selected,s=i.openToDate,l=Ik(r.props),c=Lk(r.props),u=Ae(),d=s||a||o;return d||(l&&pi(u,l)?l:c&&Zi(u,c)?c:u)},r.increaseMonth=function(){r.setState(function(i){var o=i.date;return{date:Xr(o,1)}},function(){return r.handleMonthChange(r.state.date)})},r.decreaseMonth=function(){r.setState(function(i){var o=i.date;return{date:Ia(o,1)}},function(){return r.handleMonthChange(r.state.date)})},r.handleDayClick=function(i,o,a){r.props.onSelect(i,o,a),r.props.setPreSelection&&r.props.setPreSelection(i)},r.handleDayMouseEnter=function(i){r.setState({selectingDate:i}),r.props.onDayMouseEnter&&r.props.onDayMouseEnter(i)},r.handleMonthMouseLeave=function(){r.setState({selectingDate:void 0}),r.props.onMonthMouseLeave&&r.props.onMonthMouseLeave()},r.handleYearMouseEnter=function(i,o){r.setState({selectingDate:ai(Ae(),o)}),r.props.onYearMouseEnter&&r.props.onYearMouseEnter(i,o)},r.handleYearMouseLeave=function(i,o){r.props.onYearMouseLeave&&r.props.onYearMouseLeave(i,o)},r.handleYearChange=function(i){var o,a,s,l;(a=(o=r.props).onYearChange)===null||a===void 0||a.call(o,i),r.setState({isRenderAriaLiveMessage:!0}),r.props.adjustDateOnChange&&(r.props.onSelect(i),(l=(s=r.props).setOpen)===null||l===void 0||l.call(s,!0)),r.props.setPreSelection&&r.props.setPreSelection(i)},r.getEnabledPreSelectionDateForMonth=function(i){if(!Dr(i,r.props))return i;for(var o=Ji(i),a=A6(i),s=F$(a,o),l=null,c=0;c<=s;c++){var u=qr(o,c);if(!Dr(u,r.props)){l=u;break}}return l},r.handleMonthChange=function(i){var o,a,s,l=(o=r.getEnabledPreSelectionDateForMonth(i))!==null&&o!==void 0?o:i;r.handleCustomMonthChange(l),r.props.adjustDateOnChange&&(r.props.onSelect(l),(s=(a=r.props).setOpen)===null||s===void 0||s.call(a,!0)),r.props.setPreSelection&&r.props.setPreSelection(l)},r.handleCustomMonthChange=function(i){var o,a;(a=(o=r.props).onMonthChange)===null||a===void 0||a.call(o,i),r.setState({isRenderAriaLiveMessage:!0})},r.handleMonthYearChange=function(i){r.handleYearChange(i),r.handleMonthChange(i)},r.changeYear=function(i){r.setState(function(o){var a=o.date;return{date:ai(a,Number(i))}},function(){return r.handleYearChange(r.state.date)})},r.changeMonth=function(i){r.setState(function(o){var a=o.date;return{date:sr(a,Number(i))}},function(){var o,a;r.handleMonthChange(r.state.date),(a=(o=r.props).onMonthSelectedInChange)===null||a===void 0||a.call(o,0)})},r.changeMonthYear=function(i){r.setState(function(o){var a=o.date;return{date:ai(sr(a,Kn(i)),Ee(i))}},function(){return r.handleMonthYearChange(r.state.date)})},r.header=function(i,o){if(i===void 0&&(i=r.state.date),o===void 0&&(o=0),!Un(i))return[];var a=r.props.disabled,s=Wo(i,r.props.locale,r.props.calendarStartDay),l=[];return r.props.showWeekNumbers&&l.push(P.createElement("div",{key:"W",className:"react-datepicker__day-name ".concat(a?"react-datepicker__day-name--disabled":""),role:"columnheader"},P.createElement("span",{className:"react-datepicker__sr-only"},"Week number"),P.createElement("span",{"aria-hidden":"true"},r.props.weekLabel||"#"))),l.concat([0,1,2,3,4,5,6].map(function(c){var u=qr(s,c),d=r.formatWeekday(u,r.props.locale),f=pt(u,"EEEE",r.props.locale),p=r.props.weekDayClassName?r.props.weekDayClassName(u):void 0;if(r.props.renderCustomDayName){var h=r.props.renderCustomDayName({day:u,shortName:d,fullName:f,locale:r.props.locale,customDayNameCount:o});return P.createElement("div",{key:c,role:"columnheader",className:oe("react-datepicker__day-name",p,a?"react-datepicker__day-name--disabled":"")},h)}return P.createElement("div",{key:c,role:"columnheader",className:oe("react-datepicker__day-name",p,a?"react-datepicker__day-name--disabled":"")},P.createElement("span",{className:"react-datepicker__sr-only"},f),P.createElement("span",{"aria-hidden":"true"},d))}))},r.formatWeekday=function(i,o){return r.props.formatWeekDay?T6(i,r.props.formatWeekDay,o):r.props.useWeekdaysShort?N6(i,o):M6(i,o)},r.decreaseYear=function(){r.setState(function(i){var o,a=i.date;return{date:Ko(a,r.props.showYearPicker?(o=r.props.yearItemNumber)!==null&&o!==void 0?o:t.defaultProps.yearItemNumber:1)}},function(){return r.handleYearChange(r.state.date)})},r.clearSelectingDate=function(){r.setState({selectingDate:void 0})},r.renderPreviousButton=function(){var i,o,a;if(!r.props.renderCustomHeader){var s=(i=r.props.monthsShown)!==null&&i!==void 0?i:t.defaultProps.monthsShown,l=r.props.showPreviousMonths?s-1:0,c=(o=r.props.monthSelectedIn)!==null&&o!==void 0?o:l,u=Ia(r.state.date,c),d;switch(!0){case r.props.disabled:d=!0;break;case r.props.showMonthYearPicker:d=Bw(r.state.date,r.props);break;case r.props.showYearPicker:d=F6(r.state.date,r.props);break;case r.props.showQuarterYearPicker:d=I6(r.state.date,r.props);break;default:d=Fw(u,r.props);break}if(!(!((a=r.props.forceShowMonthNavigation)!==null&&a!==void 0?a:t.defaultProps.forceShowMonthNavigation)&&!r.props.showDisabledMonthNavigation&&d||r.props.showTimeSelectOnly)){var f=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],p=["react-datepicker__navigation","react-datepicker__navigation--previous"],h=r.decreaseMonth;(r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker)&&(h=r.decreaseYear),d&&r.props.showDisabledMonthNavigation&&(p.push("react-datepicker__navigation--previous--disabled"),h=void 0);var m=r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker,g=r.props,b=g.previousMonthButtonLabel,S=b===void 0?t.defaultProps.previousMonthButtonLabel:b,w=g.previousYearButtonLabel,x=w===void 0?t.defaultProps.previousYearButtonLabel:w,_=r.props,O=_.previousMonthAriaLabel,k=O===void 0?typeof S=="string"?S:"Previous Month":O,D=_.previousYearAriaLabel,T=D===void 0?typeof x=="string"?x:"Previous Year":D;return P.createElement("button",{type:"button",className:p.join(" "),onClick:h,onKeyDown:r.props.handleOnKeyDown,"aria-label":m?T:k},P.createElement("span",{className:f.join(" ")},m?x:S))}}},r.increaseYear=function(){r.setState(function(i){var o,a=i.date;return{date:Gr(a,r.props.showYearPicker?(o=r.props.yearItemNumber)!==null&&o!==void 0?o:t.defaultProps.yearItemNumber:1)}},function(){return r.handleYearChange(r.state.date)})},r.renderNextButton=function(){var i;if(!r.props.renderCustomHeader){var o;switch(!0){case r.props.disabled:o=!0;break;case r.props.showMonthYearPicker:o=Ww(r.state.date,r.props);break;case r.props.showYearPicker:o=$6(r.state.date,r.props);break;case r.props.showQuarterYearPicker:o=L6(r.state.date,r.props);break;default:o=$w(r.state.date,r.props);break}if(!(!((i=r.props.forceShowMonthNavigation)!==null&&i!==void 0?i:t.defaultProps.forceShowMonthNavigation)&&!r.props.showDisabledMonthNavigation&&o||r.props.showTimeSelectOnly)){var a=["react-datepicker__navigation","react-datepicker__navigation--next"],s=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];r.props.showTimeSelect&&a.push("react-datepicker__navigation--next--with-time"),r.props.todayButton&&a.push("react-datepicker__navigation--next--with-today-button");var l=r.increaseMonth;(r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker)&&(l=r.increaseYear),o&&r.props.showDisabledMonthNavigation&&(a.push("react-datepicker__navigation--next--disabled"),l=void 0);var c=r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker,u=r.props,d=u.nextMonthButtonLabel,f=d===void 0?t.defaultProps.nextMonthButtonLabel:d,p=u.nextYearButtonLabel,h=p===void 0?t.defaultProps.nextYearButtonLabel:p,m=r.props,g=m.nextMonthAriaLabel,b=g===void 0?typeof f=="string"?f:"Next Month":g,S=m.nextYearAriaLabel,w=S===void 0?typeof h=="string"?h:"Next Year":S;return P.createElement("button",{type:"button",className:a.join(" "),onClick:l,onKeyDown:r.props.handleOnKeyDown,"aria-label":c?w:b},P.createElement("span",{className:s.join(" ")},c?h:f))}}},r.renderCurrentMonth=function(i){i===void 0&&(i=r.state.date);var o=["react-datepicker__current-month"];return r.props.showYearDropdown&&o.push("react-datepicker__current-month--hasYearDropdown"),r.props.showMonthDropdown&&o.push("react-datepicker__current-month--hasMonthDropdown"),r.props.showMonthYearDropdown&&o.push("react-datepicker__current-month--hasMonthYearDropdown"),P.createElement("h2",{className:o.join(" ")},Un(i)?pt(i,r.props.dateFormat,r.props.locale):"")},r.renderYearDropdown=function(i){if(i===void 0&&(i=!1),!(!r.props.showYearDropdown||i))return P.createElement(i3,_e({},t.defaultProps,r.props,{date:r.state.date,onChange:r.changeYear,year:Ee(r.state.date)}))},r.renderMonthDropdown=function(i){if(i===void 0&&(i=!1),!(!r.props.showMonthDropdown||i))return P.createElement(X6,_e({},t.defaultProps,r.props,{month:Kn(r.state.date),onChange:r.changeMonth}))},r.renderMonthYearDropdown=function(i){if(i===void 0&&(i=!1),!(!r.props.showMonthYearDropdown||i))return P.createElement(J6,_e({},t.defaultProps,r.props,{date:r.state.date,onChange:r.changeMonthYear}))},r.handleTodayButtonClick=function(i){r.props.onSelect(Nw(),i),r.props.setPreSelection&&r.props.setPreSelection(Nw())},r.renderTodayButton=function(){if(!(!r.props.todayButton||r.props.showTimeSelectOnly))return P.createElement("div",{className:"react-datepicker__today-button",onClick:r.handleTodayButtonClick},r.props.todayButton)},r.renderDayNamesHeader=function(i,o){return o===void 0&&(o=0),P.createElement("div",{className:"react-datepicker__day-names",role:"row"},r.header(i,o))},r.renderDefaultHeader=function(i){var o=i.monthDate,a=i.i,s=P.createElement("div",{className:oe("react-datepicker__header",{"react-datepicker__header--has-time-select":r.props.showTimeSelect,"react-datepicker__header--middle":r.props.monthHeaderPosition==="middle","react-datepicker__header--bottom":r.props.monthHeaderPosition==="bottom"})},r.renderCurrentMonth(o),P.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(r.props.dropdownMode),onFocus:r.handleDropdownFocus},r.renderMonthDropdown(a!==0),r.renderMonthYearDropdown(a!==0),r.renderYearDropdown(a!==0)));return r.props.monthHeaderPosition==="top"?s:P.createElement("div",{className:"react-datepicker__header-wrapper"},r.renderPreviousButton()||null,r.renderNextButton()||null,s)},r.renderCustomHeader=function(i){var o,a,s=i.monthDate,l=i.i;if(r.props.showTimeSelect&&!r.state.monthContainer||r.props.showTimeSelectOnly)return null;var c=r.props,u=c.showYearPicker,d=c.yearItemNumber,f;if(u){var p=Ki(s,d),h=p.startPeriod,m=p.endPeriod;f={startYear:h,endYear:m}}var g=Fw(r.state.date,r.props),b=$w(r.state.date,r.props),S=Bw(r.state.date,r.props),w=Ww(r.state.date,r.props);return P.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:r.props.onDropdownFocus},(a=(o=r.props).renderCustomHeader)===null||a===void 0?void 0:a.call(o,_e(_e(_e({},r.state),u&&{visibleYearsRange:f}),{customHeaderCount:l,monthDate:s,changeMonth:r.changeMonth,changeYear:r.changeYear,decreaseMonth:r.decreaseMonth,increaseMonth:r.increaseMonth,decreaseYear:r.decreaseYear,increaseYear:r.increaseYear,prevMonthButtonDisabled:g,nextMonthButtonDisabled:b,prevYearButtonDisabled:S,nextYearButtonDisabled:w})))},r.renderYearHeader=function(i){var o=i.monthDate,a=r.props,s=a.showYearPicker,l=a.yearItemNumber,c=l===void 0?t.defaultProps.yearItemNumber:l,u=Ki(o,c),d=u.startPeriod,f=u.endPeriod;return P.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},s?"".concat(d," - ").concat(f):Ee(o))},r.renderHeader=function(i){var o=i.monthDate,a=i.i,s=a===void 0?0:a,l={monthDate:o,i:s};switch(!0){case r.props.renderCustomHeader!==void 0:return r.renderCustomHeader(l);case(r.props.showMonthYearPicker||r.props.showQuarterYearPicker||r.props.showYearPicker):return r.renderYearHeader(l);default:return r.renderDefaultHeader(l)}},r.renderMonths=function(){var i,o;if(!(r.props.showTimeSelectOnly||r.props.showYearPicker)){for(var a=[],s=(i=r.props.monthsShown)!==null&&i!==void 0?i:t.defaultProps.monthsShown,l=r.props.showPreviousMonths?s-1:0,c=r.props.showMonthYearPicker||r.props.showQuarterYearPicker?Gr(r.state.date,l):Ia(r.state.date,l),u=(o=r.props.monthSelectedIn)!==null&&o!==void 0?o:l,d=0;d<s;++d){var f=d-u+l,p=r.props.showMonthYearPicker||r.props.showQuarterYearPicker?Gr(c,f):Xr(c,f),h="month-".concat(d),m=d<s-1,g=d>0;a.push(P.createElement("div",{key:h,ref:function(b){r.monthContainer=b??void 0},className:"react-datepicker__month-container"},r.props.monthHeaderPosition==="top"&&r.renderHeader({monthDate:p,i:d}),P.createElement(q6,_e({},t.defaultProps,r.props,{containerRef:r.containerRef,ariaLabelPrefix:r.props.monthAriaLabelPrefix,day:p,onDayClick:r.handleDayClick,handleOnKeyDown:r.props.handleOnDayKeyDown,handleOnMonthKeyDown:r.props.handleOnKeyDown,onDayMouseEnter:r.handleDayMouseEnter,onMouseLeave:r.handleMonthMouseLeave,orderInDisplay:d,selectingDate:r.state.selectingDate,monthShowsDuplicateDaysEnd:m,monthShowsDuplicateDaysStart:g,dayNamesHeader:r.renderDayNamesHeader(p,d),monthHeader:r.props.monthHeaderPosition==="middle"?r.renderHeader({monthDate:p,i:d}):void 0,monthFooter:r.props.monthHeaderPosition==="bottom"?r.renderHeader({monthDate:p,i:d}):void 0}))))}return a}},r.renderYears=function(){if(!r.props.showTimeSelectOnly&&r.props.showYearPicker)return P.createElement("div",{className:"react-datepicker__year--container"},r.renderHeader({monthDate:r.state.date}),P.createElement(t3,_e({},t.defaultProps,r.props,{selectingDate:r.state.selectingDate,date:r.state.date,onDayClick:r.handleDayClick,clearSelectingDate:r.clearSelectingDate,onYearMouseEnter:r.handleYearMouseEnter,onYearMouseLeave:r.handleYearMouseLeave})))},r.renderTimeSection=function(){if(r.props.showTimeSelect&&(r.state.monthContainer||r.props.showTimeSelectOnly))return P.createElement(e3,_e({},t.defaultProps,r.props,{onChange:r.props.onTimeChange,format:r.props.timeFormat,intervals:r.props.timeIntervals,monthRef:r.state.monthContainer}))},r.renderInputTimeSection=function(){var i,o;if(r.props.showTimeInput){if(r.props.selectsRange){var a=r.props,s=a.startDate,l=a.endDate,c=s?new Date(s):void 0,u=c&&Un(c)&&!!s,d=u?"".concat(vs(c.getHours()),":").concat(vs(c.getMinutes())):"",f=l?new Date(l):void 0,p=f&&Un(f)&&!!l,h=p?"".concat(vs(f.getHours()),":").concat(vs(f.getMinutes())):"";return P.createElement(P.Fragment,null,P.createElement(hm,_e({},t.defaultProps,r.props,{date:c,timeString:d,onChange:function(S){var w,x;(x=(w=r.props).onTimeChange)===null||x===void 0||x.call(w,S,"start")},timeInputLabel:((i=r.props.timeInputLabel)!==null&&i!==void 0?i:"Time")+" (Start)"})),P.createElement(hm,_e({},t.defaultProps,r.props,{date:f,timeString:h,onChange:function(S){var w,x;(x=(w=r.props).onTimeChange)===null||x===void 0||x.call(w,S,"end")},timeInputLabel:((o=r.props.timeInputLabel)!==null&&o!==void 0?o:"Time")+" (End)"})))}var m=r.props.selected?new Date(r.props.selected):void 0,g=m&&Un(m)&&!!r.props.selected,b=g?"".concat(vs(m.getHours()),":").concat(vs(m.getMinutes())):"";return P.createElement(hm,_e({},t.defaultProps,r.props,{date:m,timeString:b,onChange:function(S){var w,x;(x=(w=r.props).onTimeChange)===null||x===void 0||x.call(w,S)}}))}},r.renderAriaLiveRegion=function(){var i;if(!Un(r.state.date))return P.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"});var o=Ki(r.state.date,(i=r.props.yearItemNumber)!==null&&i!==void 0?i:t.defaultProps.yearItemNumber),a=o.startPeriod,s=o.endPeriod,l;return r.props.showYearPicker?l="".concat(a," - ").concat(s):r.props.showMonthYearPicker||r.props.showQuarterYearPicker?l=Ee(r.state.date):l="".concat(vb(Kn(r.state.date),r.props.locale)," ").concat(Ee(r.state.date)),P.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},r.state.isRenderAriaLiveMessage&&l)},r.renderChildren=function(){if(r.props.children)return P.createElement("div",{className:"react-datepicker__children-container"},r.props.children)},r.containerRef=P.createRef(),r.state={date:r.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},r}return Object.defineProperty(t,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,outsideClickIgnoreClass:Bk,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:du,monthHeaderPosition:"top"}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){var n=this;this.props.showTimeSelect&&(this.assignMonthContainer=(function(){n.setState({monthContainer:n.monthContainer})})())},t.prototype.componentDidUpdate=function(n){var r=this;if(this.props.preSelection&&Un(this.props.preSelection)&&(!Pe(this.props.preSelection,n.preSelection)||this.props.monthSelectedIn!==n.monthSelectedIn)){var i=!Mn(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return i&&r.handleCustomMonthChange(r.state.date)})}else this.props.openToDate&&!Pe(this.props.openToDate,n.openToDate)&&this.setState({date:this.props.openToDate})},t.prototype.render=function(){var n=this.props.container||_6;return P.createElement(Qp,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},P.createElement("div",{style:{display:"contents"},ref:this.containerRef},P.createElement(n,{className:oe("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly,inline:this.props.inline},this.renderAriaLiveRegion(),this.props.monthHeaderPosition==="top"&&this.renderPreviousButton(),this.props.monthHeaderPosition==="top"&&this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},t})(P.Component),l3=function(e){var t=e.icon,n=e.className,r=n===void 0?"":n,i=e.onClick,o="react-datepicker__calendar-icon";if(typeof t=="string")return P.createElement("i",{className:"".concat(o," ").concat(t," ").concat(r),"aria-hidden":"true",onClick:i});if(P.isValidElement(t)){var a=t;return P.cloneElement(a,{className:"".concat(a.props.className||""," ").concat(o," ").concat(r),onClick:function(s){typeof a.props.onClick=="function"&&a.props.onClick(s),typeof i=="function"&&i(s)}})}return P.createElement("svg",{className:"".concat(o," ").concat(r),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:i},P.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},Wk=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.portalRoot=null,r.el=document.createElement("div"),r}return t.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},t.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},t.prototype.render=function(){return Ui.createPortal(this.props.children,this.el)},t})(P.Component),c3="[tabindex], a, button, input, select, textarea",u3=function(e){return(e instanceof HTMLAnchorElement||!e.disabled)&&e.tabIndex!==-1},zk=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.getTabChildren=function(){var i;return Array.prototype.slice.call((i=r.tabLoopRef.current)===null||i===void 0?void 0:i.querySelectorAll(c3),1,-1).filter(u3)},r.handleFocusStart=function(){var i=r.getTabChildren();i&&i.length>1&&i[i.length-1].focus()},r.handleFocusEnd=function(){var i=r.getTabChildren();i&&i.length>1&&i[0].focus()},r.tabLoopRef=P.createRef(),r}return t.prototype.render=function(){var n;return((n=this.props.enableTabLoop)!==null&&n!==void 0?n:t.defaultProps.enableTabLoop)?P.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},P.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,P.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},t.defaultProps={enableTabLoop:!0},t})(P.Component);function d3(e){function t(n){var r,i=typeof n.hidePopper=="boolean"?n.hidePopper:!0,o=P.useRef(null),a=w6(_e({open:!i,whileElementsMounted:QB,placement:n.popperPlacement,middleware:hi([a6({padding:15}),o6(10),s6({element:o})],(r=n.popperModifiers)!==null&&r!==void 0?r:[],!0)},n.popperProps)),s=_e(_e({},n),{hidePopper:i,popperProps:_e(_e({},a),{arrowRef:o})});return P.createElement(e,_e({},s))}return t.displayName="withFloating(".concat(e.displayName||e.name||"Component",")"),t}var f3=function(e){var t=e.className,n=e.wrapperClassName,r=e.hidePopper,i=r===void 0?!0:r,o=e.popperComponent,a=e.targetComponent,s=e.enableTabLoop,l=e.popperOnKeyDown,c=e.portalId,u=e.portalHost,d=e.popperProps,f=e.showArrow,p=e.popperTargetRef,h=e.monthHeaderPosition;P.useEffect(function(){p?.current&&d.refs.setPositionReference(p.current)},[p,d.refs]);var m=void 0;if(!i){var g=oe("react-datepicker-popper",!f&&"react-datepicker-popper-offset",h==="middle"&&"react-datepicker-popper--header-middle",h==="bottom"&&"react-datepicker-popper--header-bottom",t);m=P.createElement(zk,{enableTabLoop:s},P.createElement("div",{ref:d.refs.setFloating,style:d.floatingStyles,className:g,"data-placement":d.placement,onKeyDown:l},o,f&&P.createElement(h6,{ref:d.arrowRef,context:d.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}e.popperContainer&&(m=P.createElement(e.popperContainer,{},m)),c&&!i&&(m=P.createElement(Wk,{portalId:c,portalHost:u},m));var b=oe("react-datepicker-wrapper",n);return P.createElement(P.Fragment,null,P.createElement("div",{ref:d.refs.setReference,className:b},a),m)},p3=d3(f3);function Gw(e,t){return e&&t?Kn(e)!==Kn(t)||Ee(e)!==Ee(t):e!==t}var gm="Date input not valid.",Vk=(function(e){pn(t,e);function t(n){var r=e.call(this,n)||this;return r.calendar=null,r.input=null,r.getPreSelection=function(){var i=r.props.timeZone,o=r.props.openToDate?r.props.openToDate:r.props.selectsEnd&&r.props.startDate?r.props.startDate:r.props.selectsStart&&r.props.endDate?r.props.endDate:Ae();return i?Tw(o,i):o},r.modifyHolidays=function(){var i;return(i=r.props.holidays)===null||i===void 0?void 0:i.reduce(function(o,a){var s=da(a.date,"yyyy-MM-dd",void 0,!1);return s?hi(hi([],o,!0),[_e(_e({},a),{date:s})],!1):o},[])},r.calcInitialState=function(){var i=r.props.timeZone,o=r.getPreSelection(),a=Ik(r.props),s=Lk(r.props),l=a&&pi(o,oc(a))?a:s&&Zi(o,jw(s))?s:o,c=r.props.selectsRange?r.props.startDate:r.props.selected;return c&&i&&(c=Tw(c,i)),{open:r.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:c??l,highlightDates:zw(r.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},r.getInputValue=function(){var i,o=r.props,a=o.locale,s=o.startDate,l=o.endDate,c=o.rangeSeparator,u=o.selected,d=o.selectedDates,f=o.selectsMultiple,p=o.selectsRange,h=o.formatMultipleDates,m=o.value,g=(i=r.props.dateFormat)!==null&&i!==void 0?i:t.defaultProps.dateFormat,b=r.state.inputValue;if(typeof m=="string")return m;if(typeof b=="string")return b;if(p)return O6(s,l,{dateFormat:g,locale:a,rangeSeparator:c});if(f){if(h){var S=function(w){return Hn(w,{dateFormat:g,locale:a})};return h(d??[],S)}return C6(d??[],{dateFormat:g,locale:a})}return Hn(u,{dateFormat:g,locale:a})},r.resetHiddenStatus=function(){r.setState(_e(_e({},r.state),{wasHidden:!1}))},r.setHiddenStatus=function(){r.setState(_e(_e({},r.state),{wasHidden:!0}))},r.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&r.setHiddenStatus()},r.clearPreventFocusTimeout=function(){r.preventFocusTimeout&&clearTimeout(r.preventFocusTimeout)},r.setFocus=function(){var i,o;(o=(i=r.input)===null||i===void 0?void 0:i.focus)===null||o===void 0||o.call(i,{preventScroll:!0})},r.setBlur=function(){var i,o;(o=(i=r.input)===null||i===void 0?void 0:i.blur)===null||o===void 0||o.call(i),r.cancelFocusInput()},r.deferBlur=function(){requestAnimationFrame(function(){r.setBlur()})},r.setOpen=function(i,o){o===void 0&&(o=!1),r.setState({open:i,preSelection:i&&r.state.open?r.state.preSelection:r.calcInitialState().preSelection,lastPreSelectChange:vm},function(){i||r.setState(function(a){return{focused:o?a.focused:!1}},function(){!o&&r.deferBlur(),r.setState({inputValue:null})})})},r.inputOk=function(){return vi(r.state.preSelection)},r.isCalendarOpen=function(){return r.props.open===void 0?r.state.open&&!r.props.disabled&&!r.props.readOnly:r.props.open},r.handleFocus=function(i){var o,a,s=r.state.wasHidden,l=s?r.state.open:!0;s&&r.resetHiddenStatus(),r.state.preventFocus||((a=(o=r.props).onFocus)===null||a===void 0||a.call(o,i),l&&!r.props.preventOpenOnFocus&&!r.props.readOnly&&r.setOpen(!0)),r.setState({focused:!0})},r.sendFocusBackToInput=function(){r.preventFocusTimeout&&r.clearPreventFocusTimeout(),r.setState({preventFocus:!0},function(){r.preventFocusTimeout=setTimeout(function(){r.setFocus(),r.setState({preventFocus:!1})})})},r.cancelFocusInput=function(){clearTimeout(r.inputFocusTimeout),r.inputFocusTimeout=void 0},r.deferFocusInput=function(){r.cancelFocusInput(),r.inputFocusTimeout=setTimeout(function(){return r.setFocus()},1)},r.handleDropdownFocus=function(){r.cancelFocusInput()},r.resetInputValue=function(){r.setState(_e(_e({},r.state),{inputValue:null}))},r.handleBlur=function(i){var o,a;(!r.state.open||r.props.withPortal||r.props.showTimeInput)&&((a=(o=r.props).onBlur)===null||a===void 0||a.call(o,i));var s=r.state.inputValue;if(typeof s=="string"&&s.length>0){var l=/[a-zA-Z0-9]/.test(s);!l&&r.props.selected&&r.setSelected(null,void 0,!0)}r.resetInputValue(),r.state.open&&r.props.open===!1&&r.setOpen(!1),r.setState({focused:!1})},r.handleCalendarClickOutside=function(i){var o,a;(a=(o=r.props).onClickOutside)===null||a===void 0||a.call(o,i),!r.props.inline&&!i.defaultPrevented&&r.setOpen(!1),r.props.withPortal&&i.preventDefault()},r.handleChange=function(){for(var i,o,a,s,l,c,u,d,f=[],p=0;p<arguments.length;p++)f[p]=arguments[p];var h=f[0];if(!(r.props.onChangeRaw&&(r.props.onChangeRaw.apply(r,f),!h||typeof h.isDefaultPrevented!="function"||h.isDefaultPrevented()))){r.setState({inputValue:h?.target instanceof HTMLInputElement?h.target.value:null,lastPreSelectChange:h3});var m=r.props,g=m.selectsRange,b=m.startDate,S=m.endDate,w=(i=r.props.dateFormat)!==null&&i!==void 0?i:t.defaultProps.dateFormat,x=(o=r.props.strictParsing)!==null&&o!==void 0?o:t.defaultProps.strictParsing,_=h?.target instanceof HTMLInputElement?h.target.value:"";if(g){var O=r.props.rangeSeparator,k=O.trim(),D=_.split(w.includes(k)?O:k,2).map(function($){return $.trim()}),T=D[0],j=D[1],A=da(T??"",w,r.props.locale,x),C=A?da(j??"",w,r.props.locale,x):null,N=((a=Da(b))===null||a===void 0?void 0:a.getTime())!==A?.getTime(),M=((s=Da(S))===null||s===void 0?void 0:s.getTime())!==C?.getTime();if(!N&&!M||A&&Dr(A,r.props)||C&&Dr(C,r.props))return;A&&r.setState({preSelection:A}),(c=(l=r.props).onChange)===null||c===void 0||c.call(l,[A,C],h)}else{var I=da(_,w,r.props.locale,x,(u=r.props.selected)!==null&&u!==void 0?u:void 0);if(I||!_)r.setSelected(I,h,!0);else if(!r.props.inline){var L=E6(_,(d=r.state.preSelection)!==null&&d!==void 0?d:void 0);L&&(!r.props.minDate||!pi(L,r.props.minDate))&&(!r.props.maxDate||!Zi(L,r.props.maxDate))&&r.setState({preSelection:L})}}}},r.handleSelect=function(i,o,a){var s;if(!r.props.readOnly){var l=r.props,c=l.selectsRange,u=l.startDate,d=l.endDate,f=l.locale,p=l.swapRange,h=(s=r.props.dateFormat)!==null&&s!==void 0?s:t.defaultProps.dateFormat,m=!c||u&&!d&&(p||!pm(i,u));if(r.props.shouldCloseOnSelect&&!r.props.showTimeSelect&&m&&r.sendFocusBackToInput(),r.props.onChangeRaw){var g=Hn(i,{dateFormat:h,locale:f});r.props.onChangeRaw(o,{date:i,formattedDate:g})}r.setSelected(i,o,!1,a),r.props.showDateSelect&&r.setState({isRenderAriaLiveMessage:!0}),!r.props.shouldCloseOnSelect||r.props.showTimeSelect?r.setPreSelection(i):m&&r.setOpen(!1)}},r.setSelected=function(i,o,a,s){var l,c,u=r.props.timeZone,d=i;if(d&&u&&(d=Ii(d,u)),r.props.showYearPicker){if(d!==null&&Jd(Ee(d),r.props))return}else if(r.props.showMonthYearPicker){if(d!==null&&Rk(d,r.props))return}else if(d!==null&&Dr(d,r.props))return;var f=r.props,p=f.onChange,h=f.selectsRange,m=f.startDate,g=f.endDate,b=f.selectsMultiple,S=f.selectedDates,w=f.minTime,x=f.swapRange;if(!Aa(r.props.selected,d)||r.props.allowSameDay||h||b)if(d!==null&&(r.props.selected&&(!a||!r.props.showTimeSelect&&!r.props.showTimeSelectOnly&&!r.props.showTimeInput)&&(d=Li(d,{hour:xn(r.props.selected),minute:wn(r.props.selected),second:Bo(r.props.selected)})),!a&&(r.props.showTimeSelect||r.props.showTimeSelectOnly)&&w&&(d=Li(d,{hour:w.getHours(),minute:w.getMinutes(),second:w.getSeconds()})),r.props.inline||r.setState({preSelection:d}),r.props.focusSelectedMonth||r.setState({monthSelectedIn:s})),h){var _=p,O=!m&&!g,k=m&&!g,D=!m&&!!g,T=m&&g;O?_?.([d,null],o):k?d===null?_?.([null,null],o):pm(d,m)?_?.(x?[d,m]:[d,null],o):_?.([m,d],o):D&&(d&&pm(d,g)?_?.([d,g],o):_?.([d,null],o)),T&&_?.([d,null],o)}else if(b){var j=p;if(d!==null)if(!S?.length)j?.([d],o);else{var A=S.some(function(N){return Pe(N,d)});if(A){var C=S.filter(function(N){return!Pe(N,d)});j?.(C,o)}else j?.(hi(hi([],S,!0),[d],!1),o)}}else p?.(d,o);a||((c=(l=r.props).onSelect)===null||c===void 0||c.call(l,d,o),r.setState({inputValue:null}))},r.setPreSelection=function(i){if(!r.props.readOnly){var o=vi(r.props.minDate),a=vi(r.props.maxDate),s=!0;if(i){var l=oc(i);if(o&&a)s=ya(i,r.props.minDate,r.props.maxDate);else if(o){var c=oc(r.props.minDate);s=Zi(i,c)||Aa(l,c)}else if(a){var u=jw(r.props.maxDate);s=pi(i,u)||Aa(l,u)}}s&&r.setState({preSelection:i})}},r.toggleCalendar=function(){r.setOpen(!r.state.open)},r.handleTimeChange=function(i,o){var a,s;if(!r.props.selectsMultiple){var l=r.props,c=l.selectsRange,u=l.startDate,d=l.endDate,f=l.onChange,p=l.timeZone;if(c){var h=f;if(o==="start"){if(u){var m=Li(u,{hour:xn(i),minute:wn(i)});r.setState({preSelection:m}),p&&(m=Ii(m,p)),h?.([m,d?p?Ii(d,p):d:null],void 0)}}else if(o==="end"){if(d){var g=Li(d,{hour:xn(i),minute:wn(i)});r.setState({preSelection:g}),p&&(g=Ii(g,p)),h?.([u?p?Ii(u,p):u:null,g],void 0)}}else{var b=u&&!d;if(b){var m=Li(u,{hour:xn(i),minute:wn(i)});r.setState({preSelection:m}),p&&(m=Ii(m,p)),h?.([m,null],void 0)}else if(u&&d){var g=Li(d,{hour:xn(i),minute:wn(i)});r.setState({preSelection:g}),p&&(g=Ii(g,p)),h?.([p?Ii(u,p):u,g],void 0)}else{var S=Li(r.getPreSelection(),{hour:xn(i),minute:wn(i)});r.setState({preSelection:S})}}}else{var w=r.props.selected?r.props.selected:r.getPreSelection(),S=r.props.selected?i:Li(w,{hour:xn(i),minute:wn(i)});r.setState({preSelection:S}),S&&p&&(S=Ii(S,p)),(s=(a=r.props).onChange)===null||s===void 0||s.call(a,S)}r.props.shouldCloseOnSelect&&!r.props.showTimeInput&&(r.sendFocusBackToInput(),r.setOpen(!1)),r.props.showTimeInput&&r.setOpen(!0),(r.props.showTimeSelectOnly||r.props.showTimeSelect)&&r.setState({isRenderAriaLiveMessage:!0}),r.setState({inputValue:null})}},r.onInputClick=function(){var i,o;!r.props.disabled&&!r.props.readOnly&&r.setOpen(!0),(o=(i=r.props).onInputClick)===null||o===void 0||o.call(i)},r.handleTimeOnlyArrowKey=function(i){var o,a,s,l,c=Da(r.props.selected)||r.state.preSelection||Ae(),u=(o=r.props.timeIntervals)!==null&&o!==void 0?o:30,d=(a=r.props.dateFormat)!==null&&a!==void 0?a:t.defaultProps.dateFormat,f=Array.isArray(d)?d[0]:d,p=oc(c),h=xn(c)*60+wn(c),m=1440-u,g;if(i===ne.ArrowUp){var b=Math.max(0,h-u);g=Tc(p,b)}else{var b=Math.min(m,h+u);g=Tc(p,b)}var S=pt(g,f||t.defaultProps.dateFormat,r.props.locale);if(r.setState({preSelection:g,inputValue:S}),!(r.props.selectsRange||r.props.selectsMultiple)){var w=r.props.selected?r.props.selected:r.getPreSelection(),x=r.props.selected?g:Li(w,{hour:xn(g),minute:wn(g)});(l=(s=r.props).onChange)===null||l===void 0||l.call(s,x),(r.props.showTimeSelectOnly||r.props.showTimeSelect)&&r.setState({isRenderAriaLiveMessage:!0}),requestAnimationFrame(function(){r.scrollToTimeOption(g)})}},r.handleTimeOnlyEnterKey=function(i){var o,a,s,l,c=i.target,u=c.value,d=(o=r.props.dateFormat)!==null&&o!==void 0?o:t.defaultProps.dateFormat,f=r.props.timeFormat||"p",p=r.state.preSelection||Da(r.props.selected)||Ae(),h=da(u,d,r.props.locale,(a=r.props.strictParsing)!==null&&a!==void 0?a:!1,p),m=p;if(h&&Un(h))m=h;else{var g=((s=r.calendar)===null||s===void 0?void 0:s.containerRef.current)instanceof Element&&r.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");if(g instanceof HTMLElement){var b=(l=g.textContent)===null||l===void 0?void 0:l.trim();if(b){var S=da(b,f,r.props.locale,!1,p);S&&Un(S)&&(m=S)}}}r.handleTimeChange(m),r.setOpen(!1),r.sendFocusBackToInput()},r.scrollToTimeOption=function(i){var o,a;if(!((o=r.calendar)===null||o===void 0)&&o.containerRef.current){for(var s=r.calendar.containerRef.current,l=Array.from(s.querySelectorAll(".react-datepicker__time-list-item")),c=null,u=1/0,d=r.props.timeFormat||"p",f=0,p=l;f<p.length;f++){var h=p[f],m=(a=h.textContent)===null||a===void 0?void 0:a.trim();if(m){var g=da(m,d,r.props.locale,!1,i);if(g&&Un(g)){if(Fk(g,i)){c=h;break}var b=Math.abs(g.getTime()-i.getTime());b<u&&(u=b,c=h)}}}c&&(l.forEach(function(S){S.setAttribute("tabindex","-1")}),c.setAttribute("tabindex","0"),c.scrollIntoView({behavior:"smooth",block:"center"}))}},r.onInputKeyDown=function(i){var o,a,s,l,c,u;(a=(o=r.props).onKeyDown)===null||a===void 0||a.call(o,i);var d=i.key;if(!r.state.open&&!r.props.inline&&!r.props.preventOpenOnFocus){(d===ne.ArrowDown||d===ne.ArrowUp||d===ne.Enter)&&((s=r.onInputClick)===null||s===void 0||s.call(r));return}if(r.state.open&&r.props.showTimeSelectOnly){if(d===ne.ArrowDown||d===ne.ArrowUp){i.preventDefault(),r.handleTimeOnlyArrowKey(d);return}if(d===ne.Enter){i.preventDefault(),r.handleTimeOnlyEnterKey(i);return}}if(r.state.open){if(d===ne.ArrowDown||d===ne.ArrowUp){i.preventDefault();var f=r.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":r.props.showWeekPicker&&r.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':r.props.showFullMonthYearPicker||r.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',p=((l=r.calendar)===null||l===void 0?void 0:l.containerRef.current)instanceof Element&&r.calendar.containerRef.current.querySelector(f);p instanceof HTMLElement&&p.focus({preventScroll:!0});return}var h=Ae(r.state.preSelection);d===ne.Enter?(i.preventDefault(),i.target.blur(),r.inputOk()&&r.state.lastPreSelectChange===vm?(r.handleSelect(h,i),!r.props.shouldCloseOnSelect&&r.setPreSelection(h)):r.setOpen(!1)):d===ne.Escape?(i.preventDefault(),i.target.blur(),r.sendFocusBackToInput(),r.setOpen(!1)):d===ne.Tab&&r.setOpen(!1),r.inputOk()||(u=(c=r.props).onInputError)===null||u===void 0||u.call(c,{code:1,msg:gm})}},r.onPortalKeyDown=function(i){var o=i.key;o===ne.Escape&&(i.preventDefault(),r.setState({preventFocus:!0},function(){r.setOpen(!1),setTimeout(function(){r.setFocus(),r.setState({preventFocus:!1})})}))},r.onDayKeyDown=function(i){var o,a,s,l,c,u,d=r.props,f=d.minDate,p=d.maxDate,h=d.disabledKeyboardNavigation,m=d.showWeekPicker,g=d.shouldCloseOnSelect,b=d.locale,S=d.calendarStartDay,w=d.adjustDateOnChange,x=d.inline;if((a=(o=r.props).onKeyDown)===null||a===void 0||a.call(o,i),!h){var _=i.key,O=i.shiftKey,k=Ae(r.state.preSelection),D=function(A,C){var N=C;switch(A){case ne.ArrowRight:N=m?ff(C,1):qr(C,1);break;case ne.ArrowLeft:N=m?yw(C):F4(C);break;case ne.ArrowUp:N=yw(C);break;case ne.ArrowDown:N=ff(C,1);break;case ne.PageUp:N=O?Ko(C,1):Ia(C,1);break;case ne.PageDown:N=O?Gr(C,1):Xr(C,1);break;case ne.Home:N=Wo(C,b,S);break;case ne.End:N=D6(C);break}return N},T=function(A,C){for(var N=40,M=A,I=!1,L=0,$=D(A,C);!I;){if(L>=N){$=C;break}f&&$<f&&(M=ne.ArrowRight,$=Dr(f,r.props)?D(M,$):f),p&&$>p&&(M=ne.ArrowLeft,$=Dr(p,r.props)?D(M,$):p),Dr($,r.props)?((M===ne.PageUp||M===ne.Home)&&(M=ne.ArrowRight),(M===ne.PageDown||M===ne.End)&&(M=ne.ArrowLeft),$=D(M,$)):I=!0,L++}return $};if(_===ne.Enter){i.preventDefault(),r.handleSelect(k,i),!g&&r.setPreSelection(k);return}else if(_===ne.Escape){i.preventDefault(),r.setOpen(!1),r.inputOk()||(l=(s=r.props).onInputError)===null||l===void 0||l.call(s,{code:1,msg:gm});return}var j=null;switch(_){case ne.ArrowLeft:case ne.ArrowRight:case ne.ArrowUp:case ne.ArrowDown:case ne.PageUp:case ne.PageDown:case ne.Home:case ne.End:j=T(_,k);break}if(!j){(u=(c=r.props).onInputError)===null||u===void 0||u.call(c,{code:1,msg:gm});return}i.preventDefault(),r.setState({lastPreSelectChange:vm}),w&&r.setSelected(j),r.setPreSelection(j),x&&r.setState({shouldFocusDayInline:!0})}},r.onPopperKeyDown=function(i){var o=i.key;o===ne.Escape&&(i.preventDefault(),r.sendFocusBackToInput(),r.setOpen(!1))},r.onClearClick=function(i){i&&i.preventDefault&&i.preventDefault(),r.sendFocusBackToInput();var o=r.props,a=o.selectsRange,s=o.onChange;s?.(a?[null,null]:null,i),r.setState({inputValue:null})},r.clear=function(){r.onClearClick()},r.onScroll=function(i){typeof r.props.closeOnScroll=="boolean"&&r.props.closeOnScroll?(i.target===document||i.target===document.documentElement||i.target===document.body)&&r.setOpen(!1):typeof r.props.closeOnScroll=="function"&&r.props.closeOnScroll(i)&&r.setOpen(!1)},r.handleMonthSelectedInChange=function(i){r.setState({monthSelectedIn:i})},r.renderCalendar=function(){var i,o;return!r.props.inline&&!r.isCalendarOpen()?null:P.createElement(s3,_e({showMonthYearDropdown:void 0,ref:function(a){r.calendar=a}},r.props,r.state,{setOpen:r.setOpen,dateFormat:(i=r.props.dateFormatCalendar)!==null&&i!==void 0?i:t.defaultProps.dateFormatCalendar,onSelect:r.handleSelect,onClickOutside:r.handleCalendarClickOutside,holidays:W6(r.modifyHolidays()),outsideClickIgnoreClass:r.props.outsideClickIgnoreClass,onDropdownFocus:r.handleDropdownFocus,onTimeChange:r.handleTimeChange,className:r.props.calendarClassName,container:r.props.calendarContainer,handleOnKeyDown:r.props.onKeyDown,handleOnDayKeyDown:r.onDayKeyDown,setPreSelection:r.setPreSelection,dropdownMode:(o=r.props.dropdownMode)!==null&&o!==void 0?o:t.defaultProps.dropdownMode,onMonthSelectedInChange:r.handleMonthSelectedInChange}),r.props.children)},r.renderAriaLiveRegion=function(){var i,o=r.props.locale,a=(i=r.props.dateFormat)!==null&&i!==void 0?i:t.defaultProps.dateFormat,s=r.props.showTimeInput||r.props.showTimeSelect,l=s?"PPPPp":"PPPP",c;return r.props.selectsRange?c="Selected start date: ".concat(Hn(r.props.startDate,{dateFormat:l,locale:o}),". ").concat(r.props.endDate?"End date: "+Hn(r.props.endDate,{dateFormat:l,locale:o}):""):r.props.showTimeSelectOnly?c="Selected time: ".concat(Hn(r.props.selected,{dateFormat:a,locale:o})):r.props.showYearPicker?c="Selected year: ".concat(Hn(r.props.selected,{dateFormat:"yyyy",locale:o})):r.props.showMonthYearPicker?c="Selected month: ".concat(Hn(r.props.selected,{dateFormat:"MMMM yyyy",locale:o})):r.props.showQuarterYearPicker?c="Selected quarter: ".concat(Hn(r.props.selected,{dateFormat:"yyyy, QQQ",locale:o})):c="Selected date: ".concat(Hn(r.props.selected,{dateFormat:l,locale:o})),P.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},c)},r.renderDateInput=function(){var i,o,a,s,l,c,u,d=oe(r.props.className,(i={},i[r.props.outsideClickIgnoreClass||t.defaultProps.outsideClickIgnoreClass]=r.state.open,i)),f=r.props.customInput||P.createElement("input",{type:"text"}),p=r.props.customInputRef||"ref",h={},m=(a=r.props["aria-describedby"])!==null&&a!==void 0?a:r.props.ariaDescribedBy,g=(s=r.props["aria-invalid"])!==null&&s!==void 0?s:r.props.ariaInvalid,b=(l=r.props["aria-label"])!==null&&l!==void 0?l:r.props.ariaLabel,S=(c=r.props["aria-labelledby"])!==null&&c!==void 0?c:r.props.ariaLabelledBy,w=(u=r.props["aria-required"])!==null&&u!==void 0?u:r.props.ariaRequired;return m!=null&&(h["aria-describedby"]=m),g!=null&&(h["aria-invalid"]=g),b!=null&&(h["aria-label"]=b),S!=null&&(h["aria-labelledby"]=S),w!=null&&(h["aria-required"]=w),P.cloneElement(f,_e((o={},o[p]=function(x){r.input=x},o.value=r.getInputValue(),o.onBlur=r.handleBlur,o.onChange=r.handleChange,o.onClick=r.onInputClick,o.onFocus=r.handleFocus,o.onKeyDown=r.onInputKeyDown,o.id=r.props.id,o.name=r.props.name,o.form=r.props.form,o.autoFocus=r.props.autoFocus,o.placeholder=r.props.placeholderText,o.disabled=r.props.disabled,o.autoComplete=r.props.autoComplete,o.className=oe(f.props.className,d),o.title=r.props.title,o.readOnly=r.props.readOnly,o.required=r.props.required,o.tabIndex=r.props.tabIndex,o),h))},r.renderClearButton=function(){var i=r.props,o=i.isClearable,a=i.disabled,s=i.selected,l=i.startDate,c=i.endDate,u=i.clearButtonTitle,d=i.clearButtonClassName,f=d===void 0?"":d,p=i.ariaLabelClose,h=p===void 0?"Close":p,m=i.selectedDates,g=i.readOnly;return o&&!g&&(s!=null||l!=null||c!=null||m?.length)?P.createElement("button",{type:"button",className:oe("react-datepicker__close-icon",f,{"react-datepicker__close-icon--disabled":a}),disabled:a,"aria-label":h,onClick:r.onClearClick,title:u,tabIndex:-1}):null},r.state=r.calcInitialState(),r.preventFocusTimeout=void 0,r}return Object.defineProperty(t,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,outsideClickIgnoreClass:Bk,readOnly:!1,rangeSeparator:Nk,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:du,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}},enumerable:!1,configurable:!0}),t.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},t.prototype.componentDidUpdate=function(n,r){var i,o,a,s;this.props.selectsRange&&Gw(n.startDate,this.props.startDate)?this.setPreSelection(this.props.startDate):Gw(n.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&n.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),this.props.selectsRange&&r.open===!1&&this.state.open===!0&&this.state.monthSelectedIn!==0&&this.setState({monthSelectedIn:0}),n.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:zw(this.props.highlightDates)}),!r.focused&&!Aa(n.selected,this.props.selected)&&this.setState({inputValue:null}),r.open!==this.state.open&&(r.open===!1&&this.state.open===!0&&((o=(i=this.props).onCalendarOpen)===null||o===void 0||o.call(i)),r.open===!0&&this.state.open===!1&&((s=(a=this.props).onCalendarClose)===null||s===void 0||s.call(a)))},t.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},t.prototype.renderInputContainer=function(){var n=this.props,r=n.showIcon,i=n.icon,o=n.calendarIconClassname,a=n.calendarIconClassName,s=n.toggleCalendarOnIconClick,l=this.state.open;return o&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),P.createElement("div",{className:"react-datepicker__input-container".concat(r?" react-datepicker__view-calendar-icon":"")},r&&P.createElement(l3,_e({icon:i,className:oe(a,!a&&o,l&&"react-datepicker-ignore-onclickoutside")},s?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},t.prototype.render=function(){var n=this.renderCalendar();if(this.props.inline)return n;if(this.props.withPortal){var r=this.state.open?P.createElement(zk,{enableTabLoop:this.props.enableTabLoop},P.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},n)):null;return this.state.open&&this.props.portalId&&(r=P.createElement(Wk,_e({portalId:this.props.portalId},this.props),r)),P.createElement(P.Fragment,null,this.renderInputContainer(),r)}return P.createElement(p3,_e({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:n,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow,monthHeaderPosition:this.props.monthHeaderPosition}))},t})(P.Component),h3="input",vm="navigate";function m3({title:e,description:t,onExport:n}){const[r,i]=P.useState(!1),[o,a]=P.useState(!1),[s,l]=P.useState("Last 7 Days"),[c,u]=P.useState(null),[d,f]=P.useState(null),[p,h]=P.useState(!1),[m,g]=P.useState(!1),b=P.useRef(null),S=P.useRef(null),w=["Last 7 Days","Last 30 Days","This Month","Previous Month","Custom Range"],x=[{label:"Export as Excel",value:"xlsx"},{label:"Export as PDF",value:"pdf"}];P.useEffect(()=>{const A=C=>{b.current&&!b.current.contains(C.target)&&(i(!1),h(!1)),S.current&&!S.current.contains(C.target)&&a(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]),P.useEffect(()=>{const A=new URLSearchParams(window.location.search),C=A.get(`${e.toLowerCase()}start_date`),N=A.get(`${e.toLowerCase()}end_date`);C&&N&&(u(new Date(C)),f(new Date(N)),l("Custom Range"))},[e]);const _=A=>{const C=new Date;C.setHours(0,0,0,0);let N,M;switch(A){case"Last 7 Days":N=new Date(C),N.setDate(C.getDate()-6),M=C;break;case"Last 30 Days":N=new Date(C),N.setDate(C.getDate()-29),M=C;break;case"This Month":N=new Date(C.getFullYear(),C.getMonth(),1),M=C;break;case"Previous Month":N=new Date(C.getFullYear(),C.getMonth()-1,1),M=new Date(C.getFullYear(),C.getMonth(),0);break;default:return null}return{start:N.toISOString().split("T")[0],end:M.toISOString().split("T")[0]}},O=(A,C)=>{const N=new URLSearchParams(window.location.search);N.set(`${e.toLowerCase()}start_date`,A),N.set(`${e.toLowerCase()}end_date`,C),window.history.pushState({},"",`${window.location.pathname}?${N.toString()}`),window.dispatchEvent(new Event("dateRangeChange"))},k=A=>{if(A==="Custom Range"){l(A),h(!0),u(null),f(null);return}const C=_(A);C&&(l(A),i(!1),h(!1),O(C.start,C.end))},D=()=>{!c||!d||(O(c.toISOString().split("T")[0],d.toISOString().split("T")[0]),i(!1),h(!1))},T=()=>s==="Custom Range"&&c&&d?`${c.toLocaleDateString()} - ${d.toLocaleDateString()}`:s,j=async A=>{g(!0),a(!1);try{let C,N;if(s==="Custom Range")C=c?.toISOString().split("T")[0],N=d?.toISOString().split("T")[0];else{const M=_(s);C=M?.start,N=M?.end}await n?.({format:A,section:e,start:C,end:N})}finally{g(!1)}};return v.jsxs("div",{className:"flex items-center justify-between px-[24px] my-6",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-[24px] font-semibold text-[#121212]",children:e}),v.jsx("div",{className:"text-gray-500 text-sm",children:t})]}),v.jsxs("div",{className:"flex gap-[12px]",children:[v.jsxs("div",{className:"relative",ref:b,children:[v.jsxs("button",{onClick:()=>i(A=>!A),className:"flex items-center gap-[8px] bg-gray-50 px-[16px] py-[8px].5 rounded-[8px] border border-gray-200 text-sm font-medium text-gray-700 hover:bg-gray-100 transition-colors",children:[v.jsx(k$,{fontSize:"small",className:"text-gray-600"}),T(),v.jsx(A$,{className:"text-gray-500"})]}),r&&v.jsx("div",{className:"absolute right-0 mt-2 bg-white rounded-[8px] shadow-xl border border-gray-200 z-50",children:p?v.jsxs("div",{className:"p-[16px] w-[360px]",children:[v.jsx(Vk,{inline:!0,selectsRange:!0,startDate:c,endDate:d,onChange:([A,C])=>{u(A),f(C)},maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40}),v.jsxs("div",{className:"flex justify-between mt-4 gap-[8px]",children:[v.jsx("button",{onClick:()=>h(!1),className:"px-[16px] py-[8px] border border-gray-300 rounded-[8px] text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancel"}),v.jsx("button",{onClick:D,disabled:!c||!d,className:"px-[16px] py-[8px] bg-purple-600 text-white rounded-[8px] text-sm font-medium hover:bg-purple-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors",children:"Apply"})]})]}):v.jsx("div",{className:"min-w-[200px] py-[4px]",children:w.map(A=>v.jsx("button",{onClick:()=>k(A),className:`w-full text-left px-[16px] py-[8px].5 text-sm hover:bg-purple-50 transition-colors ${s===A?"bg-purple-50 text-purple-600 font-medium":"text-gray-700"}`,children:A},A))})})]}),v.jsxs("div",{className:"relative",ref:S,children:[v.jsxs("button",{disabled:m,onClick:()=>a(A=>!A),className:"flex items-center gap-[8px] px-[16px] py-[8px].5 rounded-[8px] bg-purple-600 text-white font-medium text-sm hover:bg-purple-700 transition-colors disabled:bg-gray-400 disabled:cursor-not-allowed",children:[m?"Exporting...":"Export Report",v.jsx(D$,{fontSize:"small"})]}),o&&v.jsx("div",{className:"absolute right-0 mt-2 bg-white border border-gray-200 rounded-[8px] shadow-lg z-50 min-w-[180px]",children:x.map(A=>v.jsx("button",{onClick:()=>j(A.value),className:"block px-[16px] py-[8px].5 text-sm hover:bg-purple-50 w-full text-left text-gray-700 transition-colors first:rounded-t-lg last:rounded-b-lg",children:A.label},A.value))})]})]})]})}var Hk={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Xw=P.createContext&&P.createContext(Hk),g3=["attr","size","title"];function v3(e,t){if(e==null)return{};var n=y3(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function y3(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sf.apply(this,arguments)}function Qw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qw(Object(n),!0).forEach(function(r){b3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b3(e,t,n){return t=x3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x3(e){var t=w3(e,"string");return typeof t=="symbol"?t:t+""}function w3(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yk(e){return e&&e.map((t,n)=>P.createElement(t.tag,Ef({key:n},t.attr),Yk(t.child)))}function Ze(e){return t=>P.createElement(_3,Sf({attr:Ef({},e.attr)},t),Yk(e.child))}function _3(e){var t=n=>{var{attr:r,size:i,title:o}=e,a=v3(e,g3),s=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),P.createElement("svg",Sf({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:Ef(Ef({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),o&&P.createElement("title",null,o),e.children)};return Xw!==void 0?P.createElement(Xw.Consumer,null,n=>t(n)):t(Hk)}function Ks(e){return Ze({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"},child:[]}]})(e)}function qs(e){return Ze({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M288.662 352H31.338c-17.818 0-26.741-21.543-14.142-34.142l128.662-128.662c7.81-7.81 20.474-7.81 28.284 0l128.662 128.662c12.6 12.599 3.676 34.142-14.142 34.142z"},child:[]}]})(e)}function S3(e){return Ze({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M192 208c0-17.67-14.33-32-32-32h-16c-35.35 0-64 28.65-64 64v48c0 35.35 28.65 64 64 64h16c17.67 0 32-14.33 32-32V208zm176 144c35.35 0 64-28.65 64-64v-48c0-35.35-28.65-64-64-64h-16c-17.67 0-32 14.33-32 32v112c0 17.67 14.33 32 32 32h16zM256 0C113.18 0 4.58 118.83 0 256v16c0 8.84 7.16 16 16 16h16c8.84 0 16-7.16 16-16v-16c0-114.69 93.31-208 208-208s208 93.31 208 208h-.12c.08 2.43.12 165.72.12 165.72 0 23.35-18.93 42.28-42.28 42.28H320c0-26.51-21.49-48-48-48h-32c-26.51 0-48 21.49-48 48s21.49 48 48 48h181.72c49.86 0 90.28-40.42 90.28-90.28V256C507.42 118.83 398.82 0 256 0z"},child:[]}]})(e)}function Uk(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M9 22v-4h6v4"},child:[]},{tag:"path",attr:{d:"M8 6h.01"},child:[]},{tag:"path",attr:{d:"M16 6h.01"},child:[]},{tag:"path",attr:{d:"M12 6h.01"},child:[]},{tag:"path",attr:{d:"M12 10h.01"},child:[]},{tag:"path",attr:{d:"M12 14h.01"},child:[]},{tag:"path",attr:{d:"M16 10h.01"},child:[]},{tag:"path",attr:{d:"M16 14h.01"},child:[]},{tag:"path",attr:{d:"M8 10h.01"},child:[]},{tag:"path",attr:{d:"M8 14h.01"},child:[]}]})(e)}function E3(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2"},child:[]},{tag:"circle",attr:{cx:"7",cy:"17",r:"2"},child:[]},{tag:"path",attr:{d:"M9 17h6"},child:[]},{tag:"circle",attr:{cx:"17",cy:"17",r:"2"},child:[]}]})(e)}function Zp(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M13 4h3a2 2 0 0 1 2 2v14"},child:[]},{tag:"path",attr:{d:"M2 20h3"},child:[]},{tag:"path",attr:{d:"M13 20h9"},child:[]},{tag:"path",attr:{d:"M10 12v.01"},child:[]},{tag:"path",attr:{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z"},child:[]}]})(e)}function O3(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M16 5h6"},child:[]},{tag:"path",attr:{d:"M19 2v6"},child:[]},{tag:"path",attr:{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5"},child:[]},{tag:"path",attr:{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"2"},child:[]}]})(e)}function Kk(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"},child:[]}]})(e)}function Tv(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"},child:[]},{tag:"path",attr:{d:"M14 8H8"},child:[]},{tag:"path",attr:{d:"M16 12H8"},child:[]},{tag:"path",attr:{d:"M13 16H8"},child:[]}]})(e)}function qk(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"},child:[]},{tag:"path",attr:{d:"m9 12 2 2 4-4"},child:[]}]})(e)}function bb(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"},child:[]},{tag:"path",attr:{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"},child:[]},{tag:"path",attr:{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1"},child:[]}]})(e)}function C3(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"},child:[]}]})(e)}function Gk(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.03 2.59a1.501 1.501 0 0 1 1.94 0l7.5 6.363a1.5 1.5 0 0 1 .53 1.144V19.5a1.5 1.5 0 0 1-1.5 1.5h-5.75a.75.75 0 0 1-.75-.75V14h-2v6.25a.75.75 0 0 1-.75.75H4.5A1.5 1.5 0 0 1 3 19.5v-9.403c0-.44.194-.859.53-1.144ZM12 3.734l-7.5 6.363V19.5h5v-6.25a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 .75.75v6.25h5v-9.403Z"},child:[]}]})(e)}function xb(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.5 8a5.5 5.5 0 1 1 8.596 4.547 9.005 9.005 0 0 1 5.9 8.18.751.751 0 0 1-1.5.045 7.5 7.5 0 0 0-14.993 0 .75.75 0 0 1-1.499-.044 9.005 9.005 0 0 1 5.9-8.181A5.496 5.496 0 0 1 3.5 8ZM9 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm8.29 4c-.148 0-.292.01-.434.03a.75.75 0 1 1-.212-1.484 4.53 4.53 0 0 1 3.38 8.097 6.69 6.69 0 0 1 3.956 6.107.75.75 0 0 1-1.5 0 5.193 5.193 0 0 0-3.696-4.972l-.534-.16v-1.676l.41-.209A3.03 3.03 0 0 0 17.29 8Z"},child:[]}]})(e)}function Xk(e){return Ze({attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 2 7 L 2 24 L 30 24 L 30 7 L 2 7 z M 6 9 L 26 9 C 26 10.105 26.895 11 28 11 L 28 20 C 26.895 20 26 20.895 26 22 L 6 22 C 6 20.895 5.105 20 4 20 L 4 11 C 5.105 11 6 10.105 6 9 z M 16 11 C 13.789 11 12 13.016 12 15.5 C 12 17.984 13.789 20 16 20 C 18.211 20 20 17.984 20 15.5 C 20 13.016 18.211 11 16 11 z M 16 13 C 17.102 13 18 14.121 18 15.5 C 18 16.879 17.102 18 16 18 C 14.898 18 14 16.879 14 15.5 C 14 14.121 14.898 13 16 13 z M 8.5 14 C 7.672 14 7 14.672 7 15.5 C 7 16.328 7.672 17 8.5 17 C 9.328 17 10 16.328 10 15.5 C 10 14.672 9.328 14 8.5 14 z M 23.5 14 C 22.672 14 22 14.672 22 15.5 C 22 16.328 22.672 17 23.5 17 C 24.328 17 25 16.328 25 15.5 C 25 14.672 24.328 14 23.5 14 z"},child:[]}]})(e)}const P3=[{name:"Overview",icon:Gk},{name:"Community",icon:Uk},{name:"Financials",icon:Xk},{name:"Facilities",icon:Zp},{name:"Gate & Security",icon:bb},{name:"Helpdesk",icon:S3},{name:"Engagement",icon:Kk}];function k3(){const[e,t]=P.useState("Overview");return v.jsx("div",{className:"flex gap-[8px] p-[12px]",children:P3.map(n=>{const r=n.icon,i=e===n.name;return v.jsxs("button",{onClick:()=>t(n.name),className:`flex items-center gap-[8px] rounded px-[16px] py-[12px] text-[14px] leading-[16px] font-medium transition
|
|
124
|
+
${i?"bg-[#FBF5FF] text-[#884EA7]":"bg-white text-[#64748B] hover:bg-gray-50"}`,children:[v.jsx(r,{className:"h-[15px] w-[15px] font-bold"}),n.name]},n.name)})})}function D3(e){return Ze({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M384 160c-17.7 0-32-14.3-32-32s14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-82.7L342.6 374.6c-12.5 12.5-32.8 12.5-45.3 0L192 269.3 54.6 406.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l160-160c12.5-12.5 32.8-12.5 45.3 0L320 306.7 466.7 160 384 160z"},child:[]}]})(e)}function A3(e){return Ze({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M151.6 42.4C145.5 35.8 137 32 128 32s-17.5 3.8-23.6 10.4l-88 96c-11.9 13-11.1 33.3 2 45.2s33.3 11.1 45.2-2L96 146.3 96 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-301.7 32.4 35.4c11.9 13 32.2 13.9 45.2 2s13.9-32.2 2-45.2l-88-96zM320 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0zm0 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l224 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-224 0z"},child:[]}]})(e)}function T3(e){return Ze({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"},child:[]}]})(e)}function M3(e){return Ze({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"},child:[]}]})(e)}function N3(e){return Ze({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"},child:[]}]})(e)}const j3=({color:e})=>v.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),pu=({active:e,payload:t,coordinate:n})=>{if(!e||!t||!t.length)return null;const r=60,i=235;let o=n?.y||0;return o+r/2>i&&(o=i-r/2-8),o-r/2<0&&(o=r/2+8),v.jsxs("div",{className:"relative bg-[#121212] text-white text-[12px] px-[16px] py-[8px] rounded-[8px] shadow-lg",style:{transform:`translateY(${o}px) translateY(-50%)`},children:[v.jsx("div",{className:`absolute left-[-6px] top-1/2 -translate-y-1/2 w-0 h-0
|
|
125
125
|
border-t-[6px] border-t-transparent
|
|
126
126
|
border-b-[6px] border-b-transparent
|
|
127
|
-
border-r-[6px] border-r-[#121212]`}),t.map((a,s)=>v.jsxs("div",{className:"flex items-center gap-2 capitalize",children:[a.payload.color&&v.jsx(j3,{color:a.payload.color}),v.jsx("span",{className:"text-[#D1D3D4] min-w-[70px]",children:a?.payload?.name}),v.jsx("span",{className:"font-semibold",children:a.value})]},s))]})},wb=({value:e})=>{const t=typeof e=="string"?parseFloat(e.replace("%","")):e??0,n=t>=0;return v.jsxs("div",{className:`w-fit p-1 rounded text-[10px] leading-[14px] font-medium flex items-center gap-1 ${n?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[n?v.jsx(M3,{}):v.jsx(T3,{}),Math.abs(t).toFixed(1),"%"]})},is=({title:e,icon:t,period:n,actionButtons:r,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,headingClassName:c,childrenClassName:u})=>{const d=s==="semi-bold"?600:500;return v.jsxs("div",{className:`relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px] flex flex-col ${a||"gap-[24px]"}`,children:[v.jsxs("div",{className:`flex items-center justify-between ${c}`,children:[v.jsxs("div",{className:"flex items-center gap-[12px]",children:[t,v.jsx("div",{style:{fontWeight:d,fontSize:"16px",lineHeight:"20px"},className:"!my-0 !text-[16px] !leading-[20px] !text-[#121212]",children:e})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[r&&r,n&&v.jsx("div",{className:"!text-[12px] !leading-[16px] !text-[#64748B]",children:n})]})]}),v.jsx("div",{className:`flex-1 min-h-0 ${u||"space-y-[24px]"}`,children:i}),o&&v.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 !text-[12px] text-[#64748B]",children:o})]})};function Zw(e,t){sessionStorage.setItem(e,t),(e==="community_id"||e==="export"||e==="widget_id")&&window.dispatchEvent(new StorageEvent("dashboard-update",{key:e}))}function Jw(e){if(e==null)return"0";let t=Number(e);if(isNaN(t))return"0";const n=t<0;if(t=Math.abs(t),t<1e3)return(n?"-":"")+String(t);if(t<1e5){const i=(t/1e3).toFixed(t>=1e4?0:1);return(n?"-":"")+ym(i)+"K"}if(t<1e7){const i=(t/1e5).toFixed(t>=1e6?0:1);return(n?"-":"")+ym(i)+"L"}const r=(t/1e7).toFixed(t>=1e8?0:1);return(n?"-":"")+ym(r)+"Cr"}function ym(e){if(e.indexOf(".")===-1)return e;for(;e[e.length-1]==="0";)e=e.slice(0,-1);return e[e.length-1]==="."&&(e=e.slice(0,-1)),e}var bm={},xm={},e_;function R3(){return e_||(e_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(xm)),xm}var wm={},t_;function Qk(){return t_||(t_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(wm)),wm}var _m={},n_;function Zk(){return n_||(n_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="string"||typeof n=="symbol"?n:Object.is(n?.valueOf?.(),-0)?"-0":String(n)}e.toKey=t})(_m)),_m}var Sm={},r_;function _b(){return r_||(r_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){const r=[],i=n.length;if(i===0)return r;let o=0,a="",s="",l=!1;for(n.charCodeAt(0)===46&&(r.push(""),o++);o<i;){const c=n[o];s?c==="\\"&&o+1<i?(o++,a+=n[o]):c===s?s="":a+=c:l?c==='"'||c==="'"?s=c:c==="]"?(l=!1,r.push(a),a=""):a+=c:c==="["?(l=!0,a&&(r.push(a),a="")):c==="."?a&&(r.push(a),a=""):a+=c,o++}return a&&r.push(a),r}e.toPath=t})(Sm)),Sm}var i_;function Sb(){return i_||(i_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=R3(),n=Qk(),r=Zk(),i=_b();function o(s,l,c){if(s==null)return c;switch(typeof l){case"string":{if(t.isUnsafeProperty(l))return c;const u=s[l];return u===void 0?n.isDeepKey(l)?o(s,i.toPath(l),c):c:u}case"number":case"symbol":{typeof l=="number"&&(l=r.toKey(l));const u=s[l];return u===void 0?c:u}default:{if(Array.isArray(l))return a(s,l,c);if(Object.is(l?.valueOf(),-0)?l="-0":l=String(l),t.isUnsafeProperty(l))return c;const u=s[l];return u===void 0?c:u}}}function a(s,l,c){if(l.length===0)return c;let u=s;for(let d=0;d<l.length;d++){if(u==null||t.isUnsafeProperty(l[d]))return c;u=u[l[d]]}return u===void 0?c:u}e.get=o})(bm)),bm}var Em,o_;function I3(){return o_||(o_=1,Em=Sb().get),Em}var L3=I3();const Ka=ho(L3);var tn=e=>e===0?0:e>0?1:-1,Pn=e=>typeof e=="number"&&e!=+e,Ta=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,pe=e=>(typeof e=="number"||e instanceof Number)&&!Pn(e),jr=e=>pe(e)||typeof e=="string",F3=0,Rc=e=>{var t=++F3;return"".concat(e||"").concat(t)},Cn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!pe(t)&&typeof t!="string")return r;var o;if(Ta(t)){if(n==null)return r;var a=t.indexOf("%");o=n*parseFloat(t.slice(0,a))/100}else o=+t;return Pn(o)&&(o=r),i&&n!=null&&o>n&&(o=n),o},Jk=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[e[r]])n[e[r]]=!0;else return!0;return!1};function tt(e,t,n){return pe(e)&&pe(t)?e+n*(t-e):t}function eD(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Ka(r,t))===n)}var ht=e=>e===null||typeof e>"u",hu=e=>ht(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),$3=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Eb(e){if(typeof e!="string")return!1;var t=$3;return t.includes(e)}var B3=["viewBox","children"],a_=["points","pathLength"],Om={svg:B3,polygon:a_,polyline:a_},Ob=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(P.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{Eb(i)&&(r[i]=(o=>n[i](n,o)))}),r},W3=(e,t,n)=>r=>(e(t,n,r),null),mu=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var o=e[i];Eb(i)&&typeof o=="function"&&(r||(r={}),r[i]=W3(o,t,n))}),r},z3=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"];function tD(e){if(typeof e!="string")return!1;var t=z3;return t.includes(e)}function zr(e){var t=Object.entries(e).filter(n=>{var[r]=n;return tD(r)});return Object.fromEntries(t)}var s_=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",l_=null,Cm=null,nD=e=>{if(e===l_&&Array.isArray(Cm))return Cm;var t=[];return P.Children.forEach(e,n=>{ht(n)||(Yo.isFragment(n)?t=t.concat(nD(n.props.children)):t.push(n))}),Cm=t,l_=e,t};function Cb(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>s_(i)):r=[s_(t)],nD(e).forEach(i=>{var o=Ka(i,"type.displayName")||Ka(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}var Jp=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,V3=(e,t,n,r)=>{var i;if(typeof t=="symbol"||typeof t=="number")return!0;var o=(i=r&&Om?.[r])!==null&&i!==void 0?i:[],a=t.startsWith("data-"),s=typeof e!="function"&&(!!r&&o.includes(t)||tD(t)),l=!!n&&Eb(t);return a||s||l},ct=(e,t,n)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(P.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var i={};return Object.keys(r).forEach(o=>{var a;V3((a=r)===null||a===void 0?void 0:a[o],o,t,n)&&(i[o]=r[o])}),i},H3=["children","width","height","viewBox","className","style","title","desc"];function Mv(){return Mv=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},Mv.apply(null,arguments)}function Y3(e,t){if(e==null)return{};var n,r,i=U3(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function U3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Pb=P.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:o,className:a,style:s,title:l,desc:c}=e,u=Y3(e,H3),d=o||{width:r,height:i,x:0,y:0},f=oe("recharts-surface",a);return E.createElement("svg",Mv({},ct(u,!0,"svg"),{className:f,width:r,height:i,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),E.createElement("title",null,l),E.createElement("desc",null,c),n)}),K3=["children","className"];function Nv(){return Nv=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},Nv.apply(null,arguments)}function q3(e,t){if(e==null)return{};var n,r,i=G3(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function G3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Et=E.forwardRef((e,t)=>{var{children:n,className:r}=e,i=q3(e,K3),o=oe("recharts-layer",r);return E.createElement("g",Nv({className:o},ct(i,!0),{ref:t}),n)}),rD=P.createContext(null),X3=()=>P.useContext(rD);function lt(e){return function(){return e}}const iD=Math.cos,Of=Math.sin,Zr=Math.sqrt,Cf=Math.PI,eh=2*Cf,jv=Math.PI,Rv=2*jv,ba=1e-6,Q3=Rv-ba;function oD(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Z3(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return oD;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class J3{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?oD:Z3(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-t,c=i-n,u=a-t,d=s-n,f=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>ba)if(!(Math.abs(d*l-c*u)>ba)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,h=i-s,m=l*l+c*c,g=p*p+h*h,b=Math.sqrt(m),S=Math.sqrt(f),w=o*Math.tan((jv-Math.acos((m+f-g)/(2*b*S)))/2),x=w/S,_=w/b;Math.abs(x-1)>ba&&this._append`L${t+x*u},${n+x*d}`,this._append`A${o},${o},0,0,${+(d*p>u*h)},${this._x1=t+_*l},${this._y1=n+_*c}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=t+s,u=n+l,d=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>ba||Math.abs(this._y1-u)>ba)&&this._append`L${c},${u}`,r&&(f<0&&(f=f%Rv+Rv),f>Q3?this._append`A${r},${r},0,1,${d},${t-s},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:f>ba&&this._append`A${r},${r},0,${+(f>=jv)},${d},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function kb(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new J3(t)}function Db(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function aD(e){this._context=e}aD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function th(e){return new aD(e)}function sD(e){return e[0]}function lD(e){return e[1]}function cD(e,t){var n=lt(!0),r=null,i=th,o=null,a=kb(s);e=typeof e=="function"?e:e===void 0?sD:lt(e),t=typeof t=="function"?t:t===void 0?lD:lt(t);function s(l){var c,u=(l=Db(l)).length,d,f=!1,p;for(r==null&&(o=i(p=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(d,c,l),+t(d,c,l));if(p)return o=null,p+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:lt(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:lt(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:lt(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function td(e,t,n){var r=null,i=lt(!0),o=null,a=th,s=null,l=kb(c);e=typeof e=="function"?e:e===void 0?sD:lt(+e),t=typeof t=="function"?t:lt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?lD:lt(+n);function c(d){var f,p,h,m=(d=Db(d)).length,g,b=!1,S,w=new Array(m),x=new Array(m);for(o==null&&(s=a(S=l())),f=0;f<=m;++f){if(!(f<m&&i(g=d[f],f,d))===b)if(b=!b)p=f,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=f-1;h>=p;--h)s.point(w[h],x[h]);s.lineEnd(),s.areaEnd()}b&&(w[f]=+e(g,f,d),x[f]=+t(g,f,d),s.point(r?+r(g,f,d):w[f],n?+n(g,f,d):x[f]))}if(S)return s=null,S+""||null}function u(){return cD().defined(i).curve(a).context(o)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:lt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:lt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:lt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:lt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:lt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:lt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:lt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,o!=null&&(s=a(o)),c):a},c.context=function(d){return arguments.length?(d==null?o=s=null:s=a(o=d),c):o},c}class uD{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function e8(e){return new uD(e,!0)}function t8(e){return new uD(e,!1)}const Ab={draw(e,t){const n=Zr(t/Cf);e.moveTo(n,0),e.arc(0,0,n,0,eh)}},n8={draw(e,t){const n=Zr(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},dD=Zr(1/3),r8=dD*2,i8={draw(e,t){const n=Zr(t/r8),r=n*dD;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},o8={draw(e,t){const n=Zr(t),r=-n/2;e.rect(r,r,n,n)}},a8=.8908130915292852,fD=Of(Cf/10)/Of(7*Cf/10),s8=Of(eh/10)*fD,l8=-iD(eh/10)*fD,c8={draw(e,t){const n=Zr(t*a8),r=s8*n,i=l8*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=eh*o/5,s=iD(a),l=Of(a);e.lineTo(l*n,-s*n),e.lineTo(s*r-l*i,l*r+s*i)}e.closePath()}},Pm=Zr(3),u8={draw(e,t){const n=-Zr(t/(Pm*3));e.moveTo(0,n*2),e.lineTo(-Pm*n,-n),e.lineTo(Pm*n,-n),e.closePath()}},Sr=-.5,Er=Zr(3)/2,Iv=1/Zr(12),d8=(Iv/2+1)*3,f8={draw(e,t){const n=Zr(t/d8),r=n/2,i=n*Iv,o=r,a=n*Iv+n,s=-o,l=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,l),e.lineTo(Sr*r-Er*i,Er*r+Sr*i),e.lineTo(Sr*o-Er*a,Er*o+Sr*a),e.lineTo(Sr*s-Er*l,Er*s+Sr*l),e.lineTo(Sr*r+Er*i,Sr*i-Er*r),e.lineTo(Sr*o+Er*a,Sr*a-Er*o),e.lineTo(Sr*s+Er*l,Sr*l-Er*s),e.closePath()}};function p8(e,t){let n=null,r=kb(i);e=typeof e=="function"?e:lt(e||Ab),t=typeof t=="function"?t:lt(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:lt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Pf(){}function kf(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function pD(e){this._context=e}pD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:kf(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h8(e){return new pD(e)}function hD(e){this._context=e}hD.prototype={areaStart:Pf,areaEnd:Pf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function m8(e){return new hD(e)}function mD(e){this._context=e}mD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function g8(e){return new mD(e)}function gD(e){this._context=e}gD.prototype={areaStart:Pf,areaEnd:Pf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function v8(e){return new gD(e)}function c_(e){return e<0?-1:1}function u_(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(c_(o)+c_(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function d_(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function km(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Df(e){this._context=e}Df.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:km(this,this._t0,d_(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,km(this,d_(this,n=u_(this,e,t)),n);break;default:km(this,this._t0,n=u_(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function vD(e){this._context=new yD(e)}(vD.prototype=Object.create(Df.prototype)).point=function(e,t){Df.prototype.point.call(this,t,e)};function yD(e){this._context=e}yD.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function y8(e){return new Df(e)}function b8(e){return new vD(e)}function bD(e){this._context=e}bD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=f_(e),i=f_(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function f_(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function x8(e){return new bD(e)}function nh(e,t){this._context=e,this._t=t}nh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function w8(e){return new nh(e,.5)}function _8(e){return new nh(e,0)}function S8(e){return new nh(e,1)}function Gs(e,t){if((a=e.length)>1)for(var n=1,r,i,o=e[t[0]],a,s=o.length;n<a;++n)for(i=o,o=e[t[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Lv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function E8(e,t){return e[t]}function O8(e){const t=[];return t.key=e,t}function C8(){var e=lt([]),t=Lv,n=Gs,r=E8;function i(o){var a=Array.from(e.apply(this,arguments),O8),s,l=a.length,c=-1,u;for(const d of o)for(s=0,++c;s<l;++s)(a[s][c]=[0,+r(d,a[s].key,c,o)]).data=d;for(s=0,u=Db(t(a));s<l;++s)a[u[s]].index=s;return n(a,u),a}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:lt(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:lt(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Lv:typeof o=="function"?o:lt(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Gs,i):n},i}function P8(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=e[n][i][1]||0;if(a)for(n=0;n<r;++n)e[n][i][1]/=a}Gs(e,t)}}function k8(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=e[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}Gs(e,t)}}function D8(e,t){if(!(!((a=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,l=0,c=0;s<a;++s){for(var u=e[t[s]],d=u[r][1]||0,f=u[r-1][1]||0,p=(d-f)/2,h=0;h<s;++h){var m=e[t[h]],g=m[r][1]||0,b=m[r-1][1]||0;p+=g-b}l+=d,c+=p*d}i[r-1][1]+=i[r-1][0]=n,l&&(n-=c/l)}i[r-1][1]+=i[r-1][0]=n,Gs(e,t)}}var A8=["type","size","sizeType"];function Fv(){return Fv=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},Fv.apply(null,arguments)}function p_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function h_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p_(Object(n),!0).forEach(function(r){T8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T8(e,t,n){return(t=M8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M8(e){var t=N8(e,"string");return typeof t=="symbol"?t:t+""}function N8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function j8(e,t){if(e==null)return{};var n,r,i=R8(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function R8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var xD={symbolCircle:Ab,symbolCross:n8,symbolDiamond:i8,symbolSquare:o8,symbolStar:c8,symbolTriangle:u8,symbolWye:f8},I8=Math.PI/180,L8=e=>{var t="symbol".concat(hu(e));return xD[t]||Ab},F8=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*I8;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},$8=(e,t)=>{xD["symbol".concat(hu(e))]=t},Tb=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=j8(e,A8),o=h_(h_({},i),{},{type:t,size:n,sizeType:r}),a="circle";typeof t=="string"&&(a=t);var s=()=>{var f=L8(a),p=p8().type(f).size(F8(n,r,a));return p()},{className:l,cx:c,cy:u}=o,d=ct(o,!0);return c===+c&&u===+u&&n===+n?E.createElement("path",Fv({},d,{className:oe("recharts-symbols",l),transform:"translate(".concat(c,", ").concat(u,")"),d:s()})):null};Tb.registerSymbol=$8;function $v(){return $v=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},$v.apply(null,arguments)}function m_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function B8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m_(Object(n),!0).forEach(function(r){Mb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mb(e,t,n){return(t=W8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W8(e){var t=z8(e,"string");return typeof t=="symbol"?t:t+""}function z8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Or=32;class Nb extends P.PureComponent{renderIcon(t,n){var{inactiveColor:r}=this.props,i=Or/2,o=Or/6,a=Or/3,s=t.inactive?r:t.color,l=n??t.type;if(l==="none")return null;if(l==="plainline")return E.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:t.payload.strokeDasharray,x1:0,y1:i,x2:Or,y2:i,className:"recharts-legend-icon"});if(l==="line")return E.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(a,`
|
|
127
|
+
border-r-[6px] border-r-[#121212]`}),t.map((a,s)=>v.jsxs("div",{className:"flex items-center gap-[8px] capitalize",children:[a.payload.color&&v.jsx(j3,{color:a.payload.color}),v.jsx("span",{className:"text-[#D1D3D4] min-w-[70px]",children:a?.payload?.name}),v.jsx("span",{className:"font-semibold",children:a.value})]},s))]})},wb=({value:e})=>{const t=typeof e=="string"?parseFloat(e.replace("%","")):e??0,n=t>=0;return v.jsxs("div",{className:`w-fit p-[4px] rounded text-[10px] leading-[14px] font-medium flex items-center gap-[4px] ${n?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:[n?v.jsx(M3,{}):v.jsx(T3,{}),Math.abs(t).toFixed(1),"%"]})},is=({title:e,icon:t,period:n,actionButtons:r,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,headingClassName:c,childrenClassName:u})=>{const d=s==="semi-bold"?600:500;return v.jsxs("div",{className:`relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px] flex flex-col ${a||"gap-[24px]"}`,children:[v.jsxs("div",{className:`flex items-center justify-between ${c}`,children:[v.jsxs("div",{className:"flex items-center gap-[12px]",children:[t,v.jsx("div",{style:{fontWeight:d,fontSize:"16px",lineHeight:"20px"},className:"!my-0 !text-[16px] !leading-[20px] !text-[#121212]",children:e})]}),v.jsxs("div",{className:"flex items-center gap-[8px]",children:[r&&r,n&&v.jsx("div",{className:"!text-[12px] !leading-[16px] !text-[#64748B]",children:n})]})]}),v.jsx("div",{className:`flex-1 min-h-0 ${u||"space-y-[24px]"}`,children:i}),o&&v.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 !text-[12px] text-[#64748B]",children:o})]})};function Zw(e,t){sessionStorage.setItem(e,t),(e==="community_id"||e==="export"||e==="widget_id")&&window.dispatchEvent(new StorageEvent("dashboard-update",{key:e}))}function Jw(e){if(e==null)return"0";let t=Number(e);if(isNaN(t))return"0";const n=t<0;if(t=Math.abs(t),t<1e3)return(n?"-":"")+String(t);if(t<1e5){const i=(t/1e3).toFixed(t>=1e4?0:1);return(n?"-":"")+ym(i)+"K"}if(t<1e7){const i=(t/1e5).toFixed(t>=1e6?0:1);return(n?"-":"")+ym(i)+"L"}const r=(t/1e7).toFixed(t>=1e8?0:1);return(n?"-":"")+ym(r)+"Cr"}function ym(e){if(e.indexOf(".")===-1)return e;for(;e[e.length-1]==="0";)e=e.slice(0,-1);return e[e.length-1]==="."&&(e=e.slice(0,-1)),e}var bm={},xm={},e_;function R3(){return e_||(e_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(xm)),xm}var wm={},t_;function Qk(){return t_||(t_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(wm)),wm}var _m={},n_;function Zk(){return n_||(n_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="string"||typeof n=="symbol"?n:Object.is(n?.valueOf?.(),-0)?"-0":String(n)}e.toKey=t})(_m)),_m}var Sm={},r_;function _b(){return r_||(r_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){const r=[],i=n.length;if(i===0)return r;let o=0,a="",s="",l=!1;for(n.charCodeAt(0)===46&&(r.push(""),o++);o<i;){const c=n[o];s?c==="\\"&&o+1<i?(o++,a+=n[o]):c===s?s="":a+=c:l?c==='"'||c==="'"?s=c:c==="]"?(l=!1,r.push(a),a=""):a+=c:c==="["?(l=!0,a&&(r.push(a),a="")):c==="."?a&&(r.push(a),a=""):a+=c,o++}return a&&r.push(a),r}e.toPath=t})(Sm)),Sm}var i_;function Sb(){return i_||(i_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=R3(),n=Qk(),r=Zk(),i=_b();function o(s,l,c){if(s==null)return c;switch(typeof l){case"string":{if(t.isUnsafeProperty(l))return c;const u=s[l];return u===void 0?n.isDeepKey(l)?o(s,i.toPath(l),c):c:u}case"number":case"symbol":{typeof l=="number"&&(l=r.toKey(l));const u=s[l];return u===void 0?c:u}default:{if(Array.isArray(l))return a(s,l,c);if(Object.is(l?.valueOf(),-0)?l="-0":l=String(l),t.isUnsafeProperty(l))return c;const u=s[l];return u===void 0?c:u}}}function a(s,l,c){if(l.length===0)return c;let u=s;for(let d=0;d<l.length;d++){if(u==null||t.isUnsafeProperty(l[d]))return c;u=u[l[d]]}return u===void 0?c:u}e.get=o})(bm)),bm}var Em,o_;function I3(){return o_||(o_=1,Em=Sb().get),Em}var L3=I3();const Ka=ho(L3);var tn=e=>e===0?0:e>0?1:-1,Pn=e=>typeof e=="number"&&e!=+e,Ta=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,pe=e=>(typeof e=="number"||e instanceof Number)&&!Pn(e),jr=e=>pe(e)||typeof e=="string",F3=0,Rc=e=>{var t=++F3;return"".concat(e||"").concat(t)},Cn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!pe(t)&&typeof t!="string")return r;var o;if(Ta(t)){if(n==null)return r;var a=t.indexOf("%");o=n*parseFloat(t.slice(0,a))/100}else o=+t;return Pn(o)&&(o=r),i&&n!=null&&o>n&&(o=n),o},Jk=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[e[r]])n[e[r]]=!0;else return!0;return!1};function tt(e,t,n){return pe(e)&&pe(t)?e+n*(t-e):t}function eD(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Ka(r,t))===n)}var ht=e=>e===null||typeof e>"u",hu=e=>ht(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),$3=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Eb(e){if(typeof e!="string")return!1;var t=$3;return t.includes(e)}var B3=["viewBox","children"],a_=["points","pathLength"],Om={svg:B3,polygon:a_,polyline:a_},Ob=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(P.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{Eb(i)&&(r[i]=(o=>n[i](n,o)))}),r},W3=(e,t,n)=>r=>(e(t,n,r),null),mu=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var o=e[i];Eb(i)&&typeof o=="function"&&(r||(r={}),r[i]=W3(o,t,n))}),r},z3=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"];function tD(e){if(typeof e!="string")return!1;var t=z3;return t.includes(e)}function zr(e){var t=Object.entries(e).filter(n=>{var[r]=n;return tD(r)});return Object.fromEntries(t)}var s_=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",l_=null,Cm=null,nD=e=>{if(e===l_&&Array.isArray(Cm))return Cm;var t=[];return P.Children.forEach(e,n=>{ht(n)||(Yo.isFragment(n)?t=t.concat(nD(n.props.children)):t.push(n))}),Cm=t,l_=e,t};function Cb(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>s_(i)):r=[s_(t)],nD(e).forEach(i=>{var o=Ka(i,"type.displayName")||Ka(i,"type.name");r.indexOf(o)!==-1&&n.push(i)}),n}var Jp=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,V3=(e,t,n,r)=>{var i;if(typeof t=="symbol"||typeof t=="number")return!0;var o=(i=r&&Om?.[r])!==null&&i!==void 0?i:[],a=t.startsWith("data-"),s=typeof e!="function"&&(!!r&&o.includes(t)||tD(t)),l=!!n&&Eb(t);return a||s||l},ct=(e,t,n)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(P.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var i={};return Object.keys(r).forEach(o=>{var a;V3((a=r)===null||a===void 0?void 0:a[o],o,t,n)&&(i[o]=r[o])}),i},H3=["children","width","height","viewBox","className","style","title","desc"];function Mv(){return Mv=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},Mv.apply(null,arguments)}function Y3(e,t){if(e==null)return{};var n,r,i=U3(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function U3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Pb=P.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:o,className:a,style:s,title:l,desc:c}=e,u=Y3(e,H3),d=o||{width:r,height:i,x:0,y:0},f=oe("recharts-surface",a);return E.createElement("svg",Mv({},ct(u,!0,"svg"),{className:f,width:r,height:i,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),E.createElement("title",null,l),E.createElement("desc",null,c),n)}),K3=["children","className"];function Nv(){return Nv=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},Nv.apply(null,arguments)}function q3(e,t){if(e==null)return{};var n,r,i=G3(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function G3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Et=E.forwardRef((e,t)=>{var{children:n,className:r}=e,i=q3(e,K3),o=oe("recharts-layer",r);return E.createElement("g",Nv({className:o},ct(i,!0),{ref:t}),n)}),rD=P.createContext(null),X3=()=>P.useContext(rD);function lt(e){return function(){return e}}const iD=Math.cos,Of=Math.sin,Zr=Math.sqrt,Cf=Math.PI,eh=2*Cf,jv=Math.PI,Rv=2*jv,ba=1e-6,Q3=Rv-ba;function oD(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Z3(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return oD;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class J3{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?oD:Z3(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-t,c=i-n,u=a-t,d=s-n,f=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>ba)if(!(Math.abs(d*l-c*u)>ba)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,h=i-s,m=l*l+c*c,g=p*p+h*h,b=Math.sqrt(m),S=Math.sqrt(f),w=o*Math.tan((jv-Math.acos((m+f-g)/(2*b*S)))/2),x=w/S,_=w/b;Math.abs(x-1)>ba&&this._append`L${t+x*u},${n+x*d}`,this._append`A${o},${o},0,0,${+(d*p>u*h)},${this._x1=t+_*l},${this._y1=n+_*c}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=t+s,u=n+l,d=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>ba||Math.abs(this._y1-u)>ba)&&this._append`L${c},${u}`,r&&(f<0&&(f=f%Rv+Rv),f>Q3?this._append`A${r},${r},0,1,${d},${t-s},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:f>ba&&this._append`A${r},${r},0,${+(f>=jv)},${d},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function kb(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new J3(t)}function Db(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function aD(e){this._context=e}aD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function th(e){return new aD(e)}function sD(e){return e[0]}function lD(e){return e[1]}function cD(e,t){var n=lt(!0),r=null,i=th,o=null,a=kb(s);e=typeof e=="function"?e:e===void 0?sD:lt(e),t=typeof t=="function"?t:t===void 0?lD:lt(t);function s(l){var c,u=(l=Db(l)).length,d,f=!1,p;for(r==null&&(o=i(p=a())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(d,c,l),+t(d,c,l));if(p)return o=null,p+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:lt(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:lt(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:lt(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function td(e,t,n){var r=null,i=lt(!0),o=null,a=th,s=null,l=kb(c);e=typeof e=="function"?e:e===void 0?sD:lt(+e),t=typeof t=="function"?t:lt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?lD:lt(+n);function c(d){var f,p,h,m=(d=Db(d)).length,g,b=!1,S,w=new Array(m),x=new Array(m);for(o==null&&(s=a(S=l())),f=0;f<=m;++f){if(!(f<m&&i(g=d[f],f,d))===b)if(b=!b)p=f,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=f-1;h>=p;--h)s.point(w[h],x[h]);s.lineEnd(),s.areaEnd()}b&&(w[f]=+e(g,f,d),x[f]=+t(g,f,d),s.point(r?+r(g,f,d):w[f],n?+n(g,f,d):x[f]))}if(S)return s=null,S+""||null}function u(){return cD().defined(i).curve(a).context(o)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:lt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:lt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:lt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:lt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:lt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:lt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:lt(!!d),c):i},c.curve=function(d){return arguments.length?(a=d,o!=null&&(s=a(o)),c):a},c.context=function(d){return arguments.length?(d==null?o=s=null:s=a(o=d),c):o},c}class uD{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function e8(e){return new uD(e,!0)}function t8(e){return new uD(e,!1)}const Ab={draw(e,t){const n=Zr(t/Cf);e.moveTo(n,0),e.arc(0,0,n,0,eh)}},n8={draw(e,t){const n=Zr(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},dD=Zr(1/3),r8=dD*2,i8={draw(e,t){const n=Zr(t/r8),r=n*dD;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},o8={draw(e,t){const n=Zr(t),r=-n/2;e.rect(r,r,n,n)}},a8=.8908130915292852,fD=Of(Cf/10)/Of(7*Cf/10),s8=Of(eh/10)*fD,l8=-iD(eh/10)*fD,c8={draw(e,t){const n=Zr(t*a8),r=s8*n,i=l8*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=eh*o/5,s=iD(a),l=Of(a);e.lineTo(l*n,-s*n),e.lineTo(s*r-l*i,l*r+s*i)}e.closePath()}},Pm=Zr(3),u8={draw(e,t){const n=-Zr(t/(Pm*3));e.moveTo(0,n*2),e.lineTo(-Pm*n,-n),e.lineTo(Pm*n,-n),e.closePath()}},Sr=-.5,Er=Zr(3)/2,Iv=1/Zr(12),d8=(Iv/2+1)*3,f8={draw(e,t){const n=Zr(t/d8),r=n/2,i=n*Iv,o=r,a=n*Iv+n,s=-o,l=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,l),e.lineTo(Sr*r-Er*i,Er*r+Sr*i),e.lineTo(Sr*o-Er*a,Er*o+Sr*a),e.lineTo(Sr*s-Er*l,Er*s+Sr*l),e.lineTo(Sr*r+Er*i,Sr*i-Er*r),e.lineTo(Sr*o+Er*a,Sr*a-Er*o),e.lineTo(Sr*s+Er*l,Sr*l-Er*s),e.closePath()}};function p8(e,t){let n=null,r=kb(i);e=typeof e=="function"?e:lt(e||Ab),t=typeof t=="function"?t:lt(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:lt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Pf(){}function kf(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function pD(e){this._context=e}pD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:kf(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h8(e){return new pD(e)}function hD(e){this._context=e}hD.prototype={areaStart:Pf,areaEnd:Pf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function m8(e){return new hD(e)}function mD(e){this._context=e}mD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:kf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function g8(e){return new mD(e)}function gD(e){this._context=e}gD.prototype={areaStart:Pf,areaEnd:Pf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function v8(e){return new gD(e)}function c_(e){return e<0?-1:1}function u_(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(c_(o)+c_(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function d_(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function km(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Df(e){this._context=e}Df.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:km(this,this._t0,d_(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,km(this,d_(this,n=u_(this,e,t)),n);break;default:km(this,this._t0,n=u_(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function vD(e){this._context=new yD(e)}(vD.prototype=Object.create(Df.prototype)).point=function(e,t){Df.prototype.point.call(this,t,e)};function yD(e){this._context=e}yD.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function y8(e){return new Df(e)}function b8(e){return new vD(e)}function bD(e){this._context=e}bD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=f_(e),i=f_(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function f_(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),a=new Array(n);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function x8(e){return new bD(e)}function nh(e,t){this._context=e,this._t=t}nh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function w8(e){return new nh(e,.5)}function _8(e){return new nh(e,0)}function S8(e){return new nh(e,1)}function Gs(e,t){if((a=e.length)>1)for(var n=1,r,i,o=e[t[0]],a,s=o.length;n<a;++n)for(i=o,o=e[t[n]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Lv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function E8(e,t){return e[t]}function O8(e){const t=[];return t.key=e,t}function C8(){var e=lt([]),t=Lv,n=Gs,r=E8;function i(o){var a=Array.from(e.apply(this,arguments),O8),s,l=a.length,c=-1,u;for(const d of o)for(s=0,++c;s<l;++s)(a[s][c]=[0,+r(d,a[s].key,c,o)]).data=d;for(s=0,u=Db(t(a));s<l;++s)a[u[s]].index=s;return n(a,u),a}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:lt(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:lt(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Lv:typeof o=="function"?o:lt(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Gs,i):n},i}function P8(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,a;i<o;++i){for(a=n=0;n<r;++n)a+=e[n][i][1]||0;if(a)for(n=0;n<r;++n)e[n][i][1]/=a}Gs(e,t)}}function k8(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var a=0,s=0;a<i;++a)s+=e[a][n][1]||0;r[n][1]+=r[n][0]=-s/2}Gs(e,t)}}function D8(e,t){if(!(!((a=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,a;r<o;++r){for(var s=0,l=0,c=0;s<a;++s){for(var u=e[t[s]],d=u[r][1]||0,f=u[r-1][1]||0,p=(d-f)/2,h=0;h<s;++h){var m=e[t[h]],g=m[r][1]||0,b=m[r-1][1]||0;p+=g-b}l+=d,c+=p*d}i[r-1][1]+=i[r-1][0]=n,l&&(n-=c/l)}i[r-1][1]+=i[r-1][0]=n,Gs(e,t)}}var A8=["type","size","sizeType"];function Fv(){return Fv=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},Fv.apply(null,arguments)}function p_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function h_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p_(Object(n),!0).forEach(function(r){T8(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T8(e,t,n){return(t=M8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M8(e){var t=N8(e,"string");return typeof t=="symbol"?t:t+""}function N8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function j8(e,t){if(e==null)return{};var n,r,i=R8(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function R8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var xD={symbolCircle:Ab,symbolCross:n8,symbolDiamond:i8,symbolSquare:o8,symbolStar:c8,symbolTriangle:u8,symbolWye:f8},I8=Math.PI/180,L8=e=>{var t="symbol".concat(hu(e));return xD[t]||Ab},F8=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*I8;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},$8=(e,t)=>{xD["symbol".concat(hu(e))]=t},Tb=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=j8(e,A8),o=h_(h_({},i),{},{type:t,size:n,sizeType:r}),a="circle";typeof t=="string"&&(a=t);var s=()=>{var f=L8(a),p=p8().type(f).size(F8(n,r,a));return p()},{className:l,cx:c,cy:u}=o,d=ct(o,!0);return c===+c&&u===+u&&n===+n?E.createElement("path",Fv({},d,{className:oe("recharts-symbols",l),transform:"translate(".concat(c,", ").concat(u,")"),d:s()})):null};Tb.registerSymbol=$8;function $v(){return $v=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},$v.apply(null,arguments)}function m_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function B8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m_(Object(n),!0).forEach(function(r){Mb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mb(e,t,n){return(t=W8(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W8(e){var t=z8(e,"string");return typeof t=="symbol"?t:t+""}function z8(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Or=32;class Nb extends P.PureComponent{renderIcon(t,n){var{inactiveColor:r}=this.props,i=Or/2,o=Or/6,a=Or/3,s=t.inactive?r:t.color,l=n??t.type;if(l==="none")return null;if(l==="plainline")return E.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:t.payload.strokeDasharray,x1:0,y1:i,x2:Or,y2:i,className:"recharts-legend-icon"});if(l==="line")return E.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(a,`
|
|
128
128
|
A`).concat(o,",").concat(o,",0,1,1,").concat(2*a,",").concat(i,`
|
|
129
129
|
H`).concat(Or,"M").concat(2*a,",").concat(i,`
|
|
130
130
|
A`).concat(o,",").concat(o,",0,1,1,").concat(a,",").concat(i),className:"recharts-legend-icon"});if(l==="rect")return E.createElement("path",{stroke:"none",fill:s,d:"M0,".concat(Or/8,"h").concat(Or,"v").concat(Or*3/4,"h").concat(-Or,"z"),className:"recharts-legend-icon"});if(E.isValidElement(t.legendIcon)){var c=B8({},t);return delete c.legendIcon,E.cloneElement(t.legendIcon,c)}return E.createElement(Tb,{fill:s,cx:i,cy:i,size:Or,sizeType:"diameter",type:l})}renderItems(){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:o,iconType:a}=this.props,s={x:0,y:0,width:Or,height:Or},l={display:r==="horizontal"?"inline-block":"block",marginRight:10},c={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((u,d)=>{var f=u.formatter||i,p=oe({"recharts-legend-item":!0,["legend-item-".concat(d)]:!0,inactive:u.inactive});if(u.type==="none")return null;var h=u.inactive?o:u.color,m=f?f(u.value,u,d):u.value;return E.createElement("li",$v({className:p,style:l,key:"legend-item-".concat(d)},mu(this.props,u,d)),E.createElement(Pb,{width:n,height:n,viewBox:s,style:c,"aria-label":"".concat(m," legend icon")},this.renderIcon(u,a)),E.createElement("span",{className:"recharts-legend-item-text",style:{color:h}},m))})}render(){var{payload:t,layout:n,align:r}=this.props;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:n==="horizontal"?r:"left"};return E.createElement("ul",{className:"recharts-default-legend",style:i},this.renderItems())}}Mb(Nb,"displayName","Legend");Mb(Nb,"defaultProps",{align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle"});var Dm={},Am={},g_;function V8(){return g_||(g_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let o=0;o<n.length;o++){const a=n[o],s=r(a);i.has(s)||i.set(s,a)}return Array.from(i.values())}e.uniqBy=t})(Am)),Am}var Tm={},v_;function wD(){return v_||(v_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Tm)),Tm}var Mm={},Nm={},jm={},y_;function H8(){return y_||(y_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(jm)),jm}var b_;function jb(){return b_||(b_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=H8();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Nm)),Nm}var Rm={},x_;function Y8(){return x_||(x_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Rm)),Rm}var w_;function U8(){return w_||(w_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jb(),n=Y8();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Mm)),Mm}var Im={},Lm={},__;function K8(){return __||(__=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sb();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Lm)),Lm}var Fm={},$m={},Bm={},Wm={},S_;function _D(){return S_||(S_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(Wm)),Wm}var zm={},E_;function SD(){return E_||(E_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(zm)),zm}var Vm={},O_;function ED(){return O_||(O_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.eq=t})(Vm)),Vm}var C_;function q8(){return C_||(C_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rb(),n=_D(),r=SD(),i=ED();function o(d,f,p){return typeof p!="function"?t.isMatch(d,f):a(d,f,function h(m,g,b,S,w,x){const _=p(m,g,b,S,w,x);return _!==void 0?!!_:a(m,g,h,x)},new Map)}function a(d,f,p,h){if(f===d)return!0;switch(typeof f){case"object":return s(d,f,p,h);case"function":return Object.keys(f).length>0?a(d,{...f},p,h):i.eq(d,f);default:return n.isObject(d)?typeof f=="string"?f==="":!0:i.eq(d,f)}}function s(d,f,p,h){if(f==null)return!0;if(Array.isArray(f))return c(d,f,p,h);if(f instanceof Map)return l(d,f,p,h);if(f instanceof Set)return u(d,f,p,h);const m=Object.keys(f);if(d==null)return m.length===0;if(m.length===0)return!0;if(h&&h.has(f))return h.get(f)===d;h&&h.set(f,d);try{for(let g=0;g<m.length;g++){const b=m[g];if(!r.isPrimitive(d)&&!(b in d)||f[b]===void 0&&d[b]!==void 0||f[b]===null&&d[b]!==null||!p(d[b],f[b],b,d,f,h))return!1}return!0}finally{h&&h.delete(f)}}function l(d,f,p,h){if(f.size===0)return!0;if(!(d instanceof Map))return!1;for(const[m,g]of f.entries()){const b=d.get(m);if(p(b,g,m,d,f,h)===!1)return!1}return!0}function c(d,f,p,h){if(f.length===0)return!0;if(!Array.isArray(d))return!1;const m=new Set;for(let g=0;g<f.length;g++){const b=f[g];let S=!1;for(let w=0;w<d.length;w++){if(m.has(w))continue;const x=d[w];let _=!1;if(p(x,b,g,d,f,h)&&(_=!0),_){m.add(w),S=!0;break}}if(!S)return!1}return!0}function u(d,f,p,h){return f.size===0?!0:d instanceof Set?c([...d],[...f],p,h):!1}e.isMatchWith=o,e.isSetMatch=u})(Bm)),Bm}var P_;function Rb(){return P_||(P_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q8();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})($m)),$m}var Hm={},Ym={},Um={},k_;function G8(){return k_||(k_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(Um)),Um}var Km={},D_;function OD(){return D_||(D_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(Km)),Km}var qm={},A_;function CD(){return A_||(A_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",o="[object Arguments]",a="[object Symbol]",s="[object Date]",l="[object Map]",c="[object Set]",u="[object Array]",d="[object Function]",f="[object ArrayBuffer]",p="[object Object]",h="[object Error]",m="[object DataView]",g="[object Uint8Array]",b="[object Uint8ClampedArray]",S="[object Uint16Array]",w="[object Uint32Array]",x="[object BigUint64Array]",_="[object Int8Array]",O="[object Int16Array]",k="[object Int32Array]",D="[object BigInt64Array]",T="[object Float32Array]",j="[object Float64Array]";e.argumentsTag=o,e.arrayBufferTag=f,e.arrayTag=u,e.bigInt64ArrayTag=D,e.bigUint64ArrayTag=x,e.booleanTag=i,e.dataViewTag=m,e.dateTag=s,e.errorTag=h,e.float32ArrayTag=T,e.float64ArrayTag=j,e.functionTag=d,e.int16ArrayTag=O,e.int32ArrayTag=k,e.int8ArrayTag=_,e.mapTag=l,e.numberTag=r,e.objectTag=p,e.regexpTag=t,e.setTag=c,e.stringTag=n,e.symbolTag=a,e.uint16ArrayTag=S,e.uint32ArrayTag=w,e.uint8ArrayTag=g,e.uint8ClampedArrayTag=b})(qm)),qm}var Gm={},T_;function X8(){return T_||(T_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(Gm)),Gm}var M_;function PD(){return M_||(M_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=G8(),n=OD(),r=CD(),i=SD(),o=X8();function a(u,d){return s(u,void 0,u,new Map,d)}function s(u,d,f,p=new Map,h=void 0){const m=h?.(u,d,f,p);if(m!==void 0)return m;if(i.isPrimitive(u))return u;if(p.has(u))return p.get(u);if(Array.isArray(u)){const g=new Array(u.length);p.set(u,g);for(let b=0;b<u.length;b++)g[b]=s(u[b],b,f,p,h);return Object.hasOwn(u,"index")&&(g.index=u.index),Object.hasOwn(u,"input")&&(g.input=u.input),g}if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp){const g=new RegExp(u.source,u.flags);return g.lastIndex=u.lastIndex,g}if(u instanceof Map){const g=new Map;p.set(u,g);for(const[b,S]of u)g.set(b,s(S,b,f,p,h));return g}if(u instanceof Set){const g=new Set;p.set(u,g);for(const b of u)g.add(s(b,void 0,f,p,h));return g}if(typeof Buffer<"u"&&Buffer.isBuffer(u))return u.subarray();if(o.isTypedArray(u)){const g=new(Object.getPrototypeOf(u)).constructor(u.length);p.set(u,g);for(let b=0;b<u.length;b++)g[b]=s(u[b],b,f,p,h);return g}if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer)return u.slice(0);if(u instanceof DataView){const g=new DataView(u.buffer.slice(0),u.byteOffset,u.byteLength);return p.set(u,g),l(g,u,f,p,h),g}if(typeof File<"u"&&u instanceof File){const g=new File([u],u.name,{type:u.type});return p.set(u,g),l(g,u,f,p,h),g}if(u instanceof Blob){const g=new Blob([u],{type:u.type});return p.set(u,g),l(g,u,f,p,h),g}if(u instanceof Error){const g=new u.constructor;return p.set(u,g),g.message=u.message,g.name=u.name,g.stack=u.stack,g.cause=u.cause,l(g,u,f,p,h),g}if(typeof u=="object"&&c(u)){const g=Object.create(Object.getPrototypeOf(u));return p.set(u,g),l(g,u,f,p,h),g}return u}function l(u,d,f=u,p,h){const m=[...Object.keys(d),...t.getSymbols(d)];for(let g=0;g<m.length;g++){const b=m[g],S=Object.getOwnPropertyDescriptor(u,b);(S==null||S.writable)&&(u[b]=s(d[b],b,f,p,h))}}function c(u){switch(n.getTag(u)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=a,e.cloneDeepWithImpl=s,e.copyProperties=l})(Ym)),Ym}var N_;function Q8(){return N_||(N_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PD();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(Hm)),Hm}var j_;function Z8(){return j_||(j_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rb(),n=Q8();function r(i){return i=n.cloneDeep(i),o=>t.isMatch(o,i)}e.matches=r})(Fm)),Fm}var Xm={},Qm={},Zm={},R_;function J8(){return R_||(R_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=PD(),n=CD();function r(i,o){return t.cloneDeepWith(i,(a,s,l,c)=>{const u=o?.(a,s,l,c);if(u!==void 0)return u;if(typeof i=="object")switch(Object.prototype.toString.call(i)){case n.numberTag:case n.stringTag:case n.booleanTag:{const d=new i.constructor(i?.valueOf());return t.copyProperties(d,i),d}case n.argumentsTag:{const d={};return t.copyProperties(d,i),d.length=i.length,d[Symbol.iterator]=i[Symbol.iterator],d}default:return}})}e.cloneDeepWith=r})(Zm)),Zm}var I_;function eW(){return I_||(I_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=J8();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Qm)),Qm}var Jm={},eg={},L_;function kD(){return L_||(L_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(eg)),eg}var tg={},F_;function tW(){return F_||(F_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=OD();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(tg)),tg}var $_;function nW(){return $_||($_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qk(),n=kD(),r=tW(),i=_b();function o(a,s){let l;if(Array.isArray(s)?l=s:typeof s=="string"&&t.isDeepKey(s)&&a?.[s]==null?l=i.toPath(s):l=[s],l.length===0)return!1;let c=a;for(let u=0;u<l.length;u++){const d=l[u];if((c==null||!Object.hasOwn(c,d))&&!((Array.isArray(c)||r.isArguments(c))&&n.isIndex(d)&&d<c.length))return!1;c=c[d]}return!0}e.has=o})(Jm)),Jm}var B_;function rW(){return B_||(B_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rb(),n=Zk(),r=eW(),i=Sb(),o=nW();function a(s,l){switch(typeof s){case"object":{Object.is(s?.valueOf(),-0)&&(s="-0");break}case"number":{s=n.toKey(s);break}}return l=r.cloneDeep(l),function(c){const u=i.get(c,s);return u===void 0?o.has(c,s):l===void 0?u===void 0:t.isMatch(u,l)}}e.matchesProperty=a})(Xm)),Xm}var W_;function iW(){return W_||(W_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wD(),n=K8(),r=Z8(),i=rW();function o(a){if(a==null)return t.identity;switch(typeof a){case"function":return a;case"object":return Array.isArray(a)&&a.length===2?i.matchesProperty(a[0],a[1]):r.matches(a);case"string":case"symbol":case"number":return n.property(a)}}e.iteratee=o})(Im)),Im}var z_;function oW(){return z_||(z_=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=V8(),n=wD(),r=U8(),i=iW();function o(a,s=n.identity){return r.isArrayLikeObject(a)?t.uniqBy(Array.from(a),i.iteratee(s)):[]}e.uniqBy=o})(Dm)),Dm}var ng,V_;function aW(){return V_||(V_=1,ng=oW().uniqBy),ng}var sW=aW();const H_=ho(sW);function DD(e,t,n){return t===!0?H_(e,n):typeof t=="function"?H_(e,t):e}var nd={exports:{}},rg={},rd={exports:{}},ig={};/**
|
|
@@ -242,7 +242,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
242
242
|
`))}},[on,we,S,w,W]),mn&&(S?mt.length===0?At=null:At=mt.reduce((G,de,he)=>(G.push(de),he<mt.length-1&&G.push(", "),G),[]):At=Ht);let Bn=ue;!a&&ae&&ee&&(Bn=R.clientWidth);let Qt;typeof M<"u"?Qt=M:Qt=d?null:0;const Wn=N.id||(w?`mui-component-select-${w}`:void 0),ye={...t,variant:$,value:W,open:ut,error:p},vn=Kie(ye),Zt={...b.PaperProps,...typeof b.slotProps?.paper=="function"?b.slotProps.paper(ye):b.slotProps?.paper},H={...b.MenuListProps,...typeof b.slotProps?.list=="function"?b.slotProps.list(ye):b.slotProps?.list},le=qP();return v.jsxs(E.Fragment,{children:[v.jsx(Vie,{as:"div",ref:Z,tabIndex:Qt,role:"combobox","aria-controls":ut?le:void 0,"aria-disabled":d?"true":void 0,"aria-expanded":ut?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[g,Wn].filter(Boolean).join(" ")||void 0,"aria-describedby":r,"aria-required":C?"true":void 0,"aria-invalid":p?"true":void 0,onKeyDown:_t,onMouseDown:d||j?null:te,onBlur:Ye,onFocus:k,...N,ownerState:ye,className:oe(N.className,vn.select,l),id:Wn,children:Uie(At)?M2||(M2=v.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):At}),v.jsx(Yie,{"aria-invalid":p,value:Array.isArray(W)?W.join(","):W,name:w,ref:re,"aria-hidden":!0,onChange:Fe,tabIndex:-1,disabled:d,className:vn.nativeInput,autoFocus:o,required:C,...V,ownerState:ye}),v.jsx(Hie,{as:h,className:vn.icon,ownerState:ye}),v.jsx(Pj,{id:`menu-${w||""}`,anchorEl:R,open:ut,onClose:ve,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...b,slotProps:{...b.slotProps,list:{"aria-labelledby":g,role:"listbox","aria-multiselectable":S?"true":void 0,disableListWrap:!0,id:le,...H},paper:{...Zt,style:{minWidth:Bn,...Zt!=null?Zt.style:null}}},children:gn})]})});process.env.NODE_ENV!=="production"&&(Nj.propTypes={"aria-describedby":y.string,"aria-label":y.string,autoFocus:y.bool,autoWidth:y.bool,children:y.node,classes:y.object,className:y.string,defaultOpen:y.bool,defaultValue:y.any,disabled:y.bool,displayEmpty:y.bool,error:y.bool,IconComponent:y.elementType.isRequired,inputRef:So,labelId:y.string,MenuProps:y.object,multiple:y.bool,name:y.string,onBlur:y.func,onChange:y.func,onClose:y.func,onFocus:y.func,onOpen:y.func,open:y.bool,readOnly:y.bool,renderValue:y.func,required:y.bool,SelectDisplayProps:y.object,tabIndex:y.oneOfType([y.number,y.string]),type:y.any,value:y.any,variant:y.oneOf(["standard","outlined","filled"])});const qie=e=>{const{classes:t}=e,r=Dn({root:["root"]},Mj,t);return{...t,...r}},Fx={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>mo(e)&&e!=="variant"},Gie=ke(Rx,Fx)(""),Xie=ke(Lx,Fx)(""),Qie=ke(jx,Fx)(""),$x=E.forwardRef(function(t,n){const r=rr({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:o,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Vre,id:d,input:f,inputProps:p,label:h,labelId:m,MenuProps:g,multiple:b=!1,native:S=!1,onClose:w,onOpen:x,open:_,renderValue:O,SelectDisplayProps:k,variant:D="outlined",...T}=r,j=S?Aj:Nj,A=Nx(),C=Tx({props:r,muiFormControl:A,states:["variant","error"]}),N=C.variant||D,M={...r,variant:N,classes:a},I=qie(M),{root:L,...$}=I,V=f||{standard:v.jsx(Gie,{ownerState:M}),outlined:v.jsx(Xie,{label:h,ownerState:M}),filled:v.jsx(Qie,{ownerState:M})}[N],W=In(n,Ol(V));return v.jsx(E.Fragment,{children:E.cloneElement(V,{inputComponent:j,inputProps:{children:o,error:C.error,IconComponent:u,variant:N,type:void 0,multiple:b,...S?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:c,labelId:m,MenuProps:g,onClose:w,onOpen:x,open:_,renderValue:O,SelectDisplayProps:{id:d,...k}},...p,classes:p?On($,p.classes):$,...f?f.props.inputProps:{}},...(b&&S||c)&&N==="outlined"?{notched:!0}:{},ref:W,className:oe(V.props.className,s,I.root),...!f&&{variant:N},...T})})});process.env.NODE_ENV!=="production"&&($x.propTypes={autoWidth:y.bool,children:y.node,classes:y.object,className:y.string,defaultOpen:y.bool,defaultValue:y.any,displayEmpty:y.bool,IconComponent:y.elementType,id:y.string,input:y.element,inputProps:y.object,label:y.node,labelId:y.string,MenuProps:y.object,multiple:y.bool,native:y.bool,onChange:y.func,onClose:y.func,onOpen:y.func,open:y.bool,renderValue:y.func,SelectDisplayProps:y.object,sx:y.oneOfType([y.arrayOf(y.oneOfType([y.func,y.object,y.bool])),y.func,y.object]),value:y.oneOfType([y.oneOf([""]),y.any]),variant:y.oneOf(["filled","outlined","standard"])});$x.muiName="Select";function Zie(e){return fn("MuiTooltip",e)}const Pt=Ln("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function Jie(e){return Math.round(e*1e5)/1e5}const eoe=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:i,placement:o}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${cn(o.split("-")[0])}`],arrow:["arrow"]};return Dn(a,Zie,t)},toe=ke(Ax,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(Fn(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${Pt.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Pt.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),noe=ke("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${cn(n.placement.split("-")[0])}`]]}})(Fn(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Pt.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Pt.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Pt.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Jie(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Pt.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Pt.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),roe=ke("span",{name:"MuiTooltip",slot:"Arrow"})(Fn(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let Od=!1;const j2=new Fh;let Ql={x:0,y:0};function Cd(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const jj=E.forwardRef(function(t,n){const r=rr({props:t,name:"MuiTooltip"}),{arrow:i=!1,children:o,classes:a,components:s={},componentsProps:l={},describeChild:c=!1,disableFocusListener:u=!1,disableHoverListener:d=!1,disableInteractive:f=!1,disableTouchListener:p=!1,enterDelay:h=100,enterNextDelay:m=0,enterTouchDelay:g=700,followCursor:b=!1,id:S,leaveDelay:w=0,leaveTouchDelay:x=1500,onClose:_,onOpen:O,open:k,placement:D="bottom",PopperComponent:T,PopperProps:j={},slotProps:A={},slots:C={},title:N,TransitionComponent:M,TransitionProps:I,...L}=r,$=E.isValidElement(o)?o:v.jsx("span",{children:o}),V=zp(),W=nb(),[B,X]=E.useState(),[q,re]=E.useState(null),J=E.useRef(!1),ee=f||b,ie=uc(),ae=uc(),ue=uc(),U=uc(),[K,Z]=Ev({controlled:k,default:!1,name:"Tooltip",state:"open"});let R=K;if(process.env.NODE_ENV!=="production"){const{current:be}=E.useRef(k!==void 0);E.useEffect(()=>{B&&B.disabled&&!be&&N!==""&&B.tagName.toLowerCase()==="button"&&console.warn(["MUI: You are providing a disabled `button` child to the Tooltip component.","A disabled element does not fire events.","Tooltip needs to listen to the child element's events to display the title.","","Add a simple wrapper element, such as a `span`."].join(`
|
|
243
243
|
`))},[N,B,be])}const ge=qP(S),te=E.useRef(),ve=Ac(()=>{te.current!==void 0&&(document.body.style.WebkitUserSelect=te.current,te.current=void 0),U.clear()});E.useEffect(()=>ve,[ve]);const we=be=>{j2.clear(),Od=!0,Z(!0),O&&!R&&O(be)},Fe=Ac(be=>{j2.start(800+w,()=>{Od=!1}),Z(!1),_&&R&&_(be),ie.start(V.transitions.duration.shortest,()=>{J.current=!1})}),st=be=>{J.current&&be.type!=="touchstart"||(B&&B.removeAttribute("title"),ae.clear(),ue.clear(),h||Od&&m?ae.start(Od?m:h,()=>{we(be)}):we(be))},_t=be=>{ae.clear(),ue.start(w,()=>{Fe(be)})},[,ut]=E.useState(!1),Ye=be=>{u2(be.target)||(ut(!1),_t(be))},At=be=>{B||X(be.currentTarget),u2(be.target)&&(ut(!0),st(be))},Ht=be=>{J.current=!0;const An=$.props;An.onTouchStart&&An.onTouchStart(be)},mt=be=>{Ht(be),ue.clear(),ie.clear(),ve(),te.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",U.start(g,()=>{document.body.style.WebkitUserSelect=te.current,st(be)})},mn=be=>{$.props.onTouchEnd&&$.props.onTouchEnd(be),ve(),ue.start(x,()=>{Fe(be)})};E.useEffect(()=>{if(!R)return;function be(An){An.key==="Escape"&&Fe(An)}return document.addEventListener("keydown",be),()=>{document.removeEventListener("keydown",be)}},[Fe,R]);const on=In(Ol($),X,n);!N&&N!==0&&(R=!1);const gn=E.useRef(),Bn=be=>{const An=$.props;An.onMouseMove&&An.onMouseMove(be),Ql={x:be.clientX,y:be.clientY},gn.current&&gn.current.update()},Qt={},Wn=typeof N=="string";c?(Qt.title=!R&&Wn&&!d?N:null,Qt["aria-describedby"]=R?ge:null):(Qt["aria-label"]=Wn?N:null,Qt["aria-labelledby"]=R&&!Wn?ge:null);const ye={...Qt,...L,...$.props,className:oe(L.className,$.props.className),onTouchStart:Ht,ref:on,...b?{onMouseMove:Bn}:{}};process.env.NODE_ENV!=="production"&&(ye["data-mui-internal-clone-element"]=!0,E.useEffect(()=>{B&&!B.getAttribute("data-mui-internal-clone-element")&&console.error(["MUI: The `children` component of the Tooltip is not forwarding its props correctly.","Please make sure that props are spread on the same element that the ref is applied to."].join(`
|
|
244
244
|
`))},[B]));const vn={};p||(ye.onTouchStart=mt,ye.onTouchEnd=mn),d||(ye.onMouseOver=Cd(st,ye.onMouseOver),ye.onMouseLeave=Cd(_t,ye.onMouseLeave),ee||(vn.onMouseOver=st,vn.onMouseLeave=_t)),u||(ye.onFocus=Cd(At,ye.onFocus),ye.onBlur=Cd(Ye,ye.onBlur),ee||(vn.onFocus=At,vn.onBlur=Ye)),process.env.NODE_ENV!=="production"&&$.props.title&&console.error(["MUI: You have provided a `title` prop to the child of <Tooltip />.",`Remove this title prop \`${$.props.title}\` or the Tooltip component.`].join(`
|
|
245
|
-
`));const Zt={...r,isRtl:W,arrow:i,disableInteractive:ee,placement:D,PopperComponentProp:T,touch:J.current},H=typeof A.popper=="function"?A.popper(Zt):A.popper,le=E.useMemo(()=>{let be=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return j.popperOptions?.modifiers&&(be=be.concat(j.popperOptions.modifiers)),H?.popperOptions?.modifiers&&(be=be.concat(H.popperOptions.modifiers)),{...j.popperOptions,...H?.popperOptions,modifiers:be}},[q,j.popperOptions,H?.popperOptions]),G=eoe(Zt),de=typeof A.transition=="function"?A.transition(Zt):A.transition,he={slots:{popper:s.Popper,transition:s.Transition??M,tooltip:s.Tooltip,arrow:s.Arrow,...C},slotProps:{arrow:A.arrow??l.arrow,popper:{...j,...H??l.popper},tooltip:A.tooltip??l.tooltip,transition:{...I,...de??l.transition}}},[rt,gt]=Qn("popper",{elementType:toe,externalForwardedProps:he,ownerState:Zt,className:oe(G.popper,j?.className)}),[xr,ko]=Qn("transition",{elementType:Gc,externalForwardedProps:he,ownerState:Zt}),[wr,la]=Qn("tooltip",{elementType:noe,className:G.tooltip,externalForwardedProps:he,ownerState:Zt}),[ji,ei]=Qn("arrow",{elementType:roe,className:G.arrow,externalForwardedProps:he,ownerState:Zt,ref:re});return v.jsxs(E.Fragment,{children:[E.cloneElement($,ye),v.jsx(rt,{as:T??Ax,placement:D,anchorEl:b?{getBoundingClientRect:()=>({top:Ql.y,left:Ql.x,right:Ql.x,bottom:Ql.y,width:0,height:0})}:B,popperRef:gn,open:B?R:!1,id:ge,transition:!0,...vn,...gt,popperOptions:le,children:({TransitionProps:be})=>v.jsx(xr,{timeout:V.transitions.duration.shorter,...be,...ko,children:v.jsxs(wr,{...la,children:[N,i?v.jsx(ji,{...ei}):null]})})})]})});process.env.NODE_ENV!=="production"&&(jj.propTypes={arrow:y.bool,children:Cl.isRequired,classes:y.object,className:y.string,components:y.shape({Arrow:y.elementType,Popper:y.elementType,Tooltip:y.elementType,Transition:y.elementType}),componentsProps:y.shape({arrow:y.object,popper:y.object,tooltip:y.object,transition:y.object}),describeChild:y.bool,disableFocusListener:y.bool,disableHoverListener:y.bool,disableInteractive:y.bool,disableTouchListener:y.bool,enterDelay:y.number,enterNextDelay:y.number,enterTouchDelay:y.number,followCursor:y.bool,id:y.string,leaveDelay:y.number,leaveTouchDelay:y.number,onClose:y.func,onOpen:y.func,open:y.bool,placement:y.oneOf(["auto-end","auto-start","auto","bottom-end","bottom-start","bottom","left-end","left-start","left","right-end","right-start","right","top-end","top-start","top"]),PopperComponent:y.elementType,PopperProps:y.object,slotProps:y.shape({arrow:y.oneOfType([y.func,y.object]),popper:y.oneOfType([y.func,y.object]),tooltip:y.oneOfType([y.func,y.object]),transition:y.oneOfType([y.func,y.object])}),slots:y.shape({arrow:y.elementType,popper:y.elementType,tooltip:y.elementType,transition:y.elementType}),sx:y.oneOfType([y.arrayOf(y.oneOfType([y.func,y.object,y.bool])),y.func,y.object]),title:y.node,TransitionComponent:y.elementType,TransitionProps:y.object});function ioe(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Box_List"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M6.562,8.062h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,8.062Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,20.938h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,20.938Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,14.5h-2a1.5,1.5,0,0,1-1.5-1.5V11a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,14.5Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V11a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M20.438,6.062h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,12.5h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,18.935h-9a.5.5,0,1,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]}]}]}]})(e)}function ooe(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Export"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M5.552,20.968a2.577,2.577,0,0,1-2.5-2.73c-.012-2.153,0-4.306,0-6.459a.5.5,0,0,1,1,0c0,2.2-.032,4.4,0,6.6.016,1.107.848,1.589,1.838,1.589H18.353A1.546,1.546,0,0,0,19.825,19a3.023,3.023,0,0,0,.1-1.061V11.779h0a.5.5,0,0,1,1,0c0,2.224.085,4.465,0,6.687a2.567,2.567,0,0,1-2.67,2.5Z"},child:[]},{tag:"path",attr:{d:"M12.337,3.176a.455.455,0,0,0-.311-.138c-.015,0-.028,0-.043-.006s-.027,0-.041.006a.457.457,0,0,0-.312.138L7.961,6.845a.5.5,0,0,0,.707.707l2.816-2.815V15.479a.5.5,0,0,0,1,0V4.737L15.3,7.552a.5.5,0,0,0,.707-.707Z"},child:[]}]}]}]})(e)}function aoe(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Warning"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12.5,8.752a.5.5,0,0,0-1,0h0v6a.5.5,0,0,0,1,0Z"},child:[]},{tag:"circle",attr:{cx:"11.999",cy:"16.736",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M18.642,20.934H5.385A2.5,2.5,0,0,1,3.163,17.29L9.792,4.421a2.5,2.5,0,0,1,4.444,0L20.865,17.29a2.5,2.5,0,0,1-2.223,3.644ZM12.014,4.065a1.478,1.478,0,0,0-1.334.814L4.052,17.748a1.5,1.5,0,0,0,1.333,2.186H18.642a1.5,1.5,0,0,0,1.334-2.186L13.348,4.879A1.478,1.478,0,0,0,12.014,4.065Z"},child:[]}]}]}]})(e)}lf($x)(()=>({width:"fit-content",maxWidth:"100px",height:"28px",padding:"0 6px",display:"flex",fontSize:"12px",alignItems:"center","& .MuiSelect-select":{padding:0},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#C6C6C6",transition:"all 0.2s ease"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#B084CC"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#884EA7 !important",boxShadow:"0 0 0 3px rgba(136, 78, 167, 0.2)"}}));function Pl({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=P.useState(o),[l,c]=P.useState("");t.filter(d=>d.community_name.toLowerCase().includes(l.toLowerCase()));const u=()=>{Zw("widget_id",e),Zw("export",!0),i()};return v.jsx("div",{className:"flex items-center gap-2",children:v.jsx(jj,{title:"Export CSV for this widget",children:v.jsx("button",{onClick:u,className:"px-3 py-2 bg-[#FBF5FF] rounded cursor-pointer",children:v.jsx(ooe,{className:"stroke-[#884EA7] stroke-[1.4]"})})})})}function soe({isStatic:e,data:t}){const n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),r=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),i=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),a=["#8B5CF6","#EBE4F9"],s=[{name:"Move-ins",value:n,color:a[0]},{name:"Move-outs",value:r,color:a[1]}];function l(c,u){return((Number(c)+Number(u))/2).toFixed(2)+"%"}return v.jsx(is,{title:"Community",period:"This Month",icon:v.jsx(Uk,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid gap-[20px]`,actionButtons:v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsxs("div",{className:"flex",children:[v.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]",children:[v.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),v.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),v.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[v.jsx(wb,{value:l(i,o)}),v.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),v.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:v.jsx(Ft,{width:"75%",height:"100%",children:v.jsxs(_o,{children:[v.jsxs(Mi,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[v.jsx(kn,{fill:a[0]}),v.jsx(kn,{fill:a[1]})]}),v.jsx(Vt,{content:v.jsx(pu,{})})]})})})]})})}function loe({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||t?.total_forum_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||t?.total_poll_detail||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||t?.total_survey_detail||0),color:r[3]}],o=t?.widget==="commercial";return v.jsx(is,{title:"Engagement",period:"This Month",icon:v.jsx(Kk,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} ${o?"h-[324px]":"h-[303px]"} gap-[20px]`,actionButtons:!o&&v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsx("div",{className:"w-full h-[260px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[v.jsx(Hr,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),v.jsx(nr,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),v.jsx(br,{type:"number",allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),v.jsx(Vt,{content:v.jsx(pu,{}),cursor:{fill:"transparent"},wrapperStyle:{outline:"none"},position:{x:160,y:0}}),v.jsx(jn,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((a,s)=>v.jsx(kn,{fill:r[s]},a.name))})]})})})})}function coe({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=P.useMemo(()=>{if(!t?.graph)return[];const{labels:s=[],bookings:l=[],utilization:c=[]}=t.graph;return s.map((u,d)=>({time:u,bookings:l[d]||0,utilization:c[d]||0}))},[t]),o=s=>["12 AM","6 AM","12 PM","6 PM","11 PM"].includes(s)?s:"",a=i.length?i:Array.from({length:24},(s,l)=>({time:`${l%12||12} ${l>=12?"PM":"AM"}`,bookings:0,utilization:0}));return v.jsxs(is,{title:"Facilities",period:"Today",icon:v.jsx(Zp,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,actionButtons:v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:[v.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[16px] mb-[16px]",children:[v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),v.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),v.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),v.jsx("div",{className:"w-full h-[170px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(wx,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),v.jsx(br,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),v.jsx(nr,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(nr,{yAxisId:"right",orientation:"right",domain:[0,100],ticks:[0,20,40,60,80,100],tickFormatter:s=>`${s}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(Vt,{content:v.jsx(pu,{})}),v.jsx(Vo,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1,isAnimationActive:!1}),v.jsx(Vo,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4",isAnimationActive:!1})]})})})]})}function uoe({data:e}){const t=e?.incomeSummary||{},n=e?.expenditureSummary||{},r=["AED","USD","EUR"],i=["Rs","INR","₹"];function o(s){if(s==null||isNaN(s))return"0";const l=Number(s),c=Math.abs(l),u=l<0?"-":"";return c>=1e9?u+(c/1e9).toFixed(c%1e9===0?0:2)+"B":c>=1e6?u+(c/1e6).toFixed(c%1e6===0?0:2)+"M":c>=1e3?u+(c/1e3).toFixed(c%1e3===0?0:2)+"K":u+c.toFixed(c%1===0?0:2)}function a(s,l){return l?i.includes(l)?`${l} ${o(s)}`:r.includes(l)?`${o(s)} ${l}`:`${o(s)} ${l}`:o(s)}return v.jsx(is,{title:"Income",period:"This Month",icon:v.jsx(Tv,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:v.jsx(Pl,{widgetId:e?.widget_id,options:e?.communities}),children:v.jsxs("div",{children:[v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[v.jsx("div",{children:"Opening"}),v.jsx("div",{children:"Income"}),v.jsx("div",{children:"Collection"}),v.jsx("div",{children:"Closing"})]}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[v.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),v.jsx("div",{children:a(t.income,t?.currency_type)}),v.jsx("div",{children:a(t.collection,t?.currency_type)}),v.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),v.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("div",{className:"flex items-center gap-[12px]",children:[v.jsx(Tv,{className:"!text-[24px] text-red-600"}),v.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[v.jsx("div",{children:"Opening"}),v.jsx("div",{children:"Expenditure"}),v.jsx("div",{children:"Payment"}),v.jsx("div",{children:"Outstanding"})]}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[v.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),v.jsx("div",{children:a(n.expenditure,n?.currency_type)}),v.jsx("div",{children:a(n.payment,n?.currency_type)}),v.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var doe="tippy-box",Rj="tippy-content",foe="tippy-backdrop",Ij="tippy-arrow",Lj="tippy-svg-arrow",Ea={passive:!0,capture:!0},Fj=function(){return document.body};function poe(e,t){return{}.hasOwnProperty.call(e,t)}function Zg(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Bx(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function $j(e,t){return typeof e=="function"?e.apply(void 0,t):e}function R2(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function hoe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function moe(e){return e.split(/\s+/).filter(Boolean)}function Ps(e){return[].concat(e)}function I2(e,t){e.indexOf(t)===-1&&e.push(t)}function goe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function voe(e){return e.split("-")[0]}function mp(e){return[].slice.call(e)}function L2(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function wc(){return document.createElement("div")}function Xc(e){return["Element","Fragment"].some(function(t){return Bx(e,t)})}function yoe(e){return Bx(e,"NodeList")}function boe(e){return Bx(e,"MouseEvent")}function xoe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function woe(e){return Xc(e)?[e]:yoe(e)?mp(e):Array.isArray(e)?e:mp(document.querySelectorAll(e))}function Jg(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function F2(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function _oe(e){var t,n=Ps(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function Soe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=voe(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=o.top-r+d>l,g=r-o.bottom-f>l,b=o.left-n+p>l,S=n-o.right-h>l;return m||g||b||S})}function ev(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function $2(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ui={isTouch:!1},B2=0;function Eoe(){ui.isTouch||(ui.isTouch=!0,window.performance&&document.addEventListener("mousemove",Bj))}function Bj(){var e=performance.now();e-B2<20&&(ui.isTouch=!1,document.removeEventListener("mousemove",Bj)),B2=e}function Ooe(){var e=document.activeElement;if(xoe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Coe(){document.addEventListener("touchstart",Eoe,Ea),window.addEventListener("blur",Ooe)}var Poe=typeof window<"u"&&typeof document<"u",koe=Poe?!!window.msCrypto:!1;function xs(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function W2(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function Doe(e){return W2(`
|
|
245
|
+
`));const Zt={...r,isRtl:W,arrow:i,disableInteractive:ee,placement:D,PopperComponentProp:T,touch:J.current},H=typeof A.popper=="function"?A.popper(Zt):A.popper,le=E.useMemo(()=>{let be=[{name:"arrow",enabled:!!q,options:{element:q,padding:4}}];return j.popperOptions?.modifiers&&(be=be.concat(j.popperOptions.modifiers)),H?.popperOptions?.modifiers&&(be=be.concat(H.popperOptions.modifiers)),{...j.popperOptions,...H?.popperOptions,modifiers:be}},[q,j.popperOptions,H?.popperOptions]),G=eoe(Zt),de=typeof A.transition=="function"?A.transition(Zt):A.transition,he={slots:{popper:s.Popper,transition:s.Transition??M,tooltip:s.Tooltip,arrow:s.Arrow,...C},slotProps:{arrow:A.arrow??l.arrow,popper:{...j,...H??l.popper},tooltip:A.tooltip??l.tooltip,transition:{...I,...de??l.transition}}},[rt,gt]=Qn("popper",{elementType:toe,externalForwardedProps:he,ownerState:Zt,className:oe(G.popper,j?.className)}),[xr,ko]=Qn("transition",{elementType:Gc,externalForwardedProps:he,ownerState:Zt}),[wr,la]=Qn("tooltip",{elementType:noe,className:G.tooltip,externalForwardedProps:he,ownerState:Zt}),[ji,ei]=Qn("arrow",{elementType:roe,className:G.arrow,externalForwardedProps:he,ownerState:Zt,ref:re});return v.jsxs(E.Fragment,{children:[E.cloneElement($,ye),v.jsx(rt,{as:T??Ax,placement:D,anchorEl:b?{getBoundingClientRect:()=>({top:Ql.y,left:Ql.x,right:Ql.x,bottom:Ql.y,width:0,height:0})}:B,popperRef:gn,open:B?R:!1,id:ge,transition:!0,...vn,...gt,popperOptions:le,children:({TransitionProps:be})=>v.jsx(xr,{timeout:V.transitions.duration.shorter,...be,...ko,children:v.jsxs(wr,{...la,children:[N,i?v.jsx(ji,{...ei}):null]})})})]})});process.env.NODE_ENV!=="production"&&(jj.propTypes={arrow:y.bool,children:Cl.isRequired,classes:y.object,className:y.string,components:y.shape({Arrow:y.elementType,Popper:y.elementType,Tooltip:y.elementType,Transition:y.elementType}),componentsProps:y.shape({arrow:y.object,popper:y.object,tooltip:y.object,transition:y.object}),describeChild:y.bool,disableFocusListener:y.bool,disableHoverListener:y.bool,disableInteractive:y.bool,disableTouchListener:y.bool,enterDelay:y.number,enterNextDelay:y.number,enterTouchDelay:y.number,followCursor:y.bool,id:y.string,leaveDelay:y.number,leaveTouchDelay:y.number,onClose:y.func,onOpen:y.func,open:y.bool,placement:y.oneOf(["auto-end","auto-start","auto","bottom-end","bottom-start","bottom","left-end","left-start","left","right-end","right-start","right","top-end","top-start","top"]),PopperComponent:y.elementType,PopperProps:y.object,slotProps:y.shape({arrow:y.oneOfType([y.func,y.object]),popper:y.oneOfType([y.func,y.object]),tooltip:y.oneOfType([y.func,y.object]),transition:y.oneOfType([y.func,y.object])}),slots:y.shape({arrow:y.elementType,popper:y.elementType,tooltip:y.elementType,transition:y.elementType}),sx:y.oneOfType([y.arrayOf(y.oneOfType([y.func,y.object,y.bool])),y.func,y.object]),title:y.node,TransitionComponent:y.elementType,TransitionProps:y.object});function ioe(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Box_List"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M6.562,8.062h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,8.062Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,20.938h-2a1.5,1.5,0,0,1-1.5-1.5v-2a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,20.938Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5v-2a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M6.562,14.5h-2a1.5,1.5,0,0,1-1.5-1.5V11a1.5,1.5,0,0,1,1.5-1.5h2a1.5,1.5,0,0,1,1.5,1.5v2A1.5,1.5,0,0,1,6.562,14.5Zm-2-4a.5.5,0,0,0-.5.5v2a.5.5,0,0,0,.5.5h2a.5.5,0,0,0,.5-.5V11a.5.5,0,0,0-.5-.5Z"},child:[]},{tag:"path",attr:{d:"M20.438,6.062h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,12.5h-9a.5.5,0,0,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]},{tag:"path",attr:{d:"M20.438,18.935h-9a.5.5,0,1,1,0-1h9a.5.5,0,0,1,0,1Z"},child:[]}]}]}]})(e)}function ooe(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Export"},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M5.552,20.968a2.577,2.577,0,0,1-2.5-2.73c-.012-2.153,0-4.306,0-6.459a.5.5,0,0,1,1,0c0,2.2-.032,4.4,0,6.6.016,1.107.848,1.589,1.838,1.589H18.353A1.546,1.546,0,0,0,19.825,19a3.023,3.023,0,0,0,.1-1.061V11.779h0a.5.5,0,0,1,1,0c0,2.224.085,4.465,0,6.687a2.567,2.567,0,0,1-2.67,2.5Z"},child:[]},{tag:"path",attr:{d:"M12.337,3.176a.455.455,0,0,0-.311-.138c-.015,0-.028,0-.043-.006s-.027,0-.041.006a.457.457,0,0,0-.312.138L7.961,6.845a.5.5,0,0,0,.707.707l2.816-2.815V15.479a.5.5,0,0,0,1,0V4.737L15.3,7.552a.5.5,0,0,0,.707-.707Z"},child:[]}]}]}]})(e)}function aoe(e){return Ze({attr:{viewBox:"0 0 24 24"},child:[{tag:"g",attr:{id:"Warning"},child:[{tag:"g",attr:{},child:[{tag:"g",attr:{},child:[{tag:"path",attr:{d:"M12.5,8.752a.5.5,0,0,0-1,0h0v6a.5.5,0,0,0,1,0Z"},child:[]},{tag:"circle",attr:{cx:"11.999",cy:"16.736",r:"0.5"},child:[]}]},{tag:"path",attr:{d:"M18.642,20.934H5.385A2.5,2.5,0,0,1,3.163,17.29L9.792,4.421a2.5,2.5,0,0,1,4.444,0L20.865,17.29a2.5,2.5,0,0,1-2.223,3.644ZM12.014,4.065a1.478,1.478,0,0,0-1.334.814L4.052,17.748a1.5,1.5,0,0,0,1.333,2.186H18.642a1.5,1.5,0,0,0,1.334-2.186L13.348,4.879A1.478,1.478,0,0,0,12.014,4.065Z"},child:[]}]}]}]})(e)}lf($x)(()=>({width:"fit-content",maxWidth:"100px",height:"28px",padding:"0 6px",display:"flex",fontSize:"12px",alignItems:"center","& .MuiSelect-select":{padding:0},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#C6C6C6",transition:"all 0.2s ease"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#B084CC"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#884EA7 !important",boxShadow:"0 0 0 3px rgba(136, 78, 167, 0.2)"}}));function Pl({widgetId:e,options:t=[],defaultValue:n=["all"],onFilterChange:r=()=>{},onExport:i=()=>{}}){const o=JSON.parse(sessionStorage.getItem("community_id"))||[],[a,s]=P.useState(o),[l,c]=P.useState("");t.filter(d=>d.community_name.toLowerCase().includes(l.toLowerCase()));const u=()=>{Zw("widget_id",e),Zw("export",!0),i()};return v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx(jj,{title:"Export CSV for this widget",children:v.jsx("button",{onClick:u,className:"px-[12px] py-[8px] bg-[#FBF5FF] rounded cursor-pointer",children:v.jsx(ooe,{className:"stroke-[#884EA7] stroke-[1.4]"})})})})}function soe({isStatic:e,data:t}){const n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),r=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),i=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),a=["#8B5CF6","#EBE4F9"],s=[{name:"Move-ins",value:n,color:a[0]},{name:"Move-outs",value:r,color:a[1]}];function l(c,u){return((Number(c)+Number(u))/2).toFixed(2)+"%"}return v.jsx(is,{title:"Community",period:"This Month",icon:v.jsx(Uk,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid gap-[20px]`,actionButtons:v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsxs("div",{className:"flex",children:[v.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]",children:[v.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),v.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+r})]}),v.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[v.jsx(wb,{value:l(i,o)}),v.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),v.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:v.jsx(Ft,{width:"75%",height:"100%",children:v.jsxs(_o,{children:[v.jsxs(Mi,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[v.jsx(kn,{fill:a[0]}),v.jsx(kn,{fill:a[1]})]}),v.jsx(Vt,{content:v.jsx(pu,{})})]})})})]})})}function loe({isStatic:e,data:t,communities:n}){const r=["#8B5CF6","#22C55E","#3B82F6","#F59E0B"],i=[{name:"Notice",value:Number(t?.total_notices||0),color:r[0]},{name:"Post",value:Number(t?.total_topics||t?.total_forum_topics||0),color:r[1]},{name:"Poll",value:Number(t?.total_polls||t?.total_poll_detail||0),color:r[2]},{name:"Survey",value:Number(t?.total_surveys||t?.total_survey_detail||0),color:r[3]}],o=t?.widget==="commercial";return v.jsx(is,{title:"Engagement",period:"This Month",icon:v.jsx(Kk,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} ${o?"h-[324px]":"h-[303px]"} gap-[20px]`,actionButtons:!o&&v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsx("div",{className:"w-full h-[260px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:i,layout:"vertical",margin:{top:4,right:8,left:0,bottom:0},children:[v.jsx(Hr,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),v.jsx(nr,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),v.jsx(br,{type:"number",allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),v.jsx(Vt,{content:v.jsx(pu,{}),cursor:{fill:"transparent"},wrapperStyle:{outline:"none"},position:{x:160,y:0}}),v.jsx(jn,{dataKey:"value",barSize:40,isAnimationActive:!1,children:i.map((a,s)=>v.jsx(kn,{fill:r[s]},a.name))})]})})})})}function coe({isStatic:e,data:t}){const n=Number(t?.totalBookings||0),r=Number(t?.averageUtilizationPercentage||0),i=P.useMemo(()=>{if(!t?.graph)return[];const{labels:s=[],bookings:l=[],utilization:c=[]}=t.graph;return s.map((u,d)=>({time:u,bookings:l[d]||0,utilization:c[d]||0}))},[t]),o=s=>["12 AM","6 AM","12 PM","6 PM","11 PM"].includes(s)?s:"",a=i.length?i:Array.from({length:24},(s,l)=>({time:`${l%12||12} ${l>=12?"PM":"AM"}`,bookings:0,utilization:0}));return v.jsxs(is,{title:"Facilities",period:"Today",icon:v.jsx(Zp,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,actionButtons:v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:[v.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[16px] mb-[16px]",children:[v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Bookings"}),v.jsx("div",{className:"!text-[24px] font-medium text-[#8B5CF6]",children:n})]}),v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:"Utilisation Rate"}),v.jsxs("div",{className:"!text-[24px] font-medium text-[#329DFF]",children:[r.toFixed(2),"%"]})]})]}),v.jsx("div",{className:"w-full h-[170px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(wx,{data:a,margin:{top:5,right:-30,left:-35,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),v.jsx(br,{dataKey:"time",interval:0,tickFormatter:o,tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1,minTickGap:0}),v.jsx(nr,{yAxisId:"left",tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(nr,{yAxisId:"right",orientation:"right",domain:[0,100],ticks:[0,20,40,60,80,100],tickFormatter:s=>`${s}%`,tick:{fontSize:10,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(Vt,{content:v.jsx(pu,{})}),v.jsx(Vo,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1,isAnimationActive:!1}),v.jsx(Vo,{yAxisId:"right",type:"monotone",dataKey:"utilization",name:"Utilization Rate",stroke:"#329DFF",strokeWidth:2,dot:!1,strokeDasharray:"2 4",isAnimationActive:!1})]})})})]})}function uoe({data:e}){const t=e?.incomeSummary||{},n=e?.expenditureSummary||{},r=["AED","USD","EUR"],i=["Rs","INR","₹"];function o(s){if(s==null||isNaN(s))return"0";const l=Number(s),c=Math.abs(l),u=l<0?"-":"";return c>=1e9?u+(c/1e9).toFixed(c%1e9===0?0:2)+"B":c>=1e6?u+(c/1e6).toFixed(c%1e6===0?0:2)+"M":c>=1e3?u+(c/1e3).toFixed(c%1e3===0?0:2)+"K":u+c.toFixed(c%1===0?0:2)}function a(s,l){return l?i.includes(l)?`${l} ${o(s)}`:r.includes(l)?`${o(s)} ${l}`:`${o(s)} ${l}`:o(s)}return v.jsx(is,{title:"Income",period:"This Month",icon:v.jsx(Tv,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",actionButtons:v.jsx(Pl,{widgetId:e?.widget_id,options:e?.communities}),children:v.jsxs("div",{children:[v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-[8px]",children:[v.jsx("div",{children:"Opening"}),v.jsx("div",{children:"Income"}),v.jsx("div",{children:"Collection"}),v.jsx("div",{children:"Closing"})]}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-[8px]",children:[v.jsx("div",{children:a(t.opening_balance,t?.currency_type)}),v.jsx("div",{children:a(t.income,t?.currency_type)}),v.jsx("div",{children:a(t.collection,t?.currency_type)}),v.jsx("div",{children:a(t.closing_balance,t?.currency_type)})]}),v.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("div",{className:"flex items-center gap-[12px]",children:[v.jsx(Tv,{className:"!text-[24px] text-red-600"}),v.jsx("div",{className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]})}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-[8px]",children:[v.jsx("div",{children:"Opening"}),v.jsx("div",{children:"Expenditure"}),v.jsx("div",{children:"Payment"}),v.jsx("div",{children:"Outstanding"})]}),v.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[v.jsx("div",{children:a(n.opening_balance,n?.currency_type)}),v.jsx("div",{children:a(n.expenditure,n?.currency_type)}),v.jsx("div",{children:a(n.payment,n?.currency_type)}),v.jsx("div",{children:a(n.outstanding,n?.currency_type)})]})]})})}var doe="tippy-box",Rj="tippy-content",foe="tippy-backdrop",Ij="tippy-arrow",Lj="tippy-svg-arrow",Ea={passive:!0,capture:!0},Fj=function(){return document.body};function poe(e,t){return{}.hasOwnProperty.call(e,t)}function Zg(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function Bx(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function $j(e,t){return typeof e=="function"?e.apply(void 0,t):e}function R2(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function hoe(e,t){var n=Object.assign({},e);return t.forEach(function(r){delete n[r]}),n}function moe(e){return e.split(/\s+/).filter(Boolean)}function Ps(e){return[].concat(e)}function I2(e,t){e.indexOf(t)===-1&&e.push(t)}function goe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function voe(e){return e.split("-")[0]}function mp(e){return[].slice.call(e)}function L2(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function wc(){return document.createElement("div")}function Xc(e){return["Element","Fragment"].some(function(t){return Bx(e,t)})}function yoe(e){return Bx(e,"NodeList")}function boe(e){return Bx(e,"MouseEvent")}function xoe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function woe(e){return Xc(e)?[e]:yoe(e)?mp(e):Array.isArray(e)?e:mp(document.querySelectorAll(e))}function Jg(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function F2(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function _oe(e){var t,n=Ps(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function Soe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,c=voe(a.placement),u=a.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=o.top-r+d>l,g=r-o.bottom-f>l,b=o.left-n+p>l,S=n-o.right-h>l;return m||g||b||S})}function ev(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function $2(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ui={isTouch:!1},B2=0;function Eoe(){ui.isTouch||(ui.isTouch=!0,window.performance&&document.addEventListener("mousemove",Bj))}function Bj(){var e=performance.now();e-B2<20&&(ui.isTouch=!1,document.removeEventListener("mousemove",Bj)),B2=e}function Ooe(){var e=document.activeElement;if(xoe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Coe(){document.addEventListener("touchstart",Eoe,Ea),window.addEventListener("blur",Ooe)}var Poe=typeof window<"u"&&typeof document<"u",koe=Poe?!!window.msCrypto:!1;function xs(e){var t=e==="destroy"?"n already-":" ";return[e+"() was called on a"+t+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function W2(e){var t=/[ \t]{2,}/g,n=/^[ \t]*/gm;return e.replace(t," ").replace(n,"").trim()}function Doe(e){return W2(`
|
|
246
246
|
%ctippy.js
|
|
247
247
|
|
|
248
248
|
%c`+W2(e)+`
|
|
@@ -262,7 +262,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
262
262
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
263
263
|
|
|
264
264
|
`,`1) content: element.innerHTML
|
|
265
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&Foe(c,r);return u&&l.push(u),l},[]);return Xc(e)?s[0]:s}Fu.defaultProps=fr;Fu.setDefaultProps=joe;Fu.currentInput=ui;Object.assign({},rj,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Fu.setDefaultProps({render:Yj});function Uj(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Kj=typeof window<"u"&&typeof document<"u";function Iy(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function Y2(){return Kj&&document.createElement("div")}function $oe(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function qj(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!qj(e[n],t[n]))return!1}else return!1;return!0}else return!1}function Boe(e){var t=[];return e.forEach(function(n){t.find(function(r){return qj(n,r)})||t.push(n)}),t}function Woe(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:Boe([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var nv=Kj?P.useLayoutEffect:P.useEffect;function zoe(e){var t=P.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function U2(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var Voe={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}U2(n,"add",t.props.className)}function o(){r()&&U2(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function Hoe(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,s=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,d=n.ignoreAttributes,f=d===void 0?!0:d;n.__source,n.__self;var p=Uj(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),h=o!==void 0,m=a!==void 0,g=P.useState(!1),b=g[0],S=g[1],w=P.useState({}),x=w[0],_=w[1],O=P.useState(),k=O[0],D=O[1],T=zoe(function(){return{container:Y2(),renders:1}}),j=Object.assign({ignoreAttributes:f},p,{content:T.container});h&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(M){j[M]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+M+"` prop in","controlled mode (`visible` prop)"].join(" "))}),j.trigger="manual",j.hideOnClick=!1),m&&(u=!0);var A=j,C=j.plugins||[];s&&(A=Object.assign({},j,{plugins:m&&a.data!=null?[].concat(C,[{fn:function(){return{onTrigger:function(L,$){var V=a.data.children.find(function(W){var B=W.instance;return B.reference===$.currentTarget});L.state.$$activeSingletonInstance=V.instance,D(V.content)}}}}]):C,render:function(){return{popper:T.container}}}));var N=[l].concat(r?[r.type]:[]);return nv(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var I=e(M||T.ref||Y2(),Object.assign({},A,{plugins:[Voe].concat(j.plugins||[])}));return T.instance=I,u&&I.disable(),o&&I.show(),m&&a.hook({instance:I,content:i,props:A,setSingletonContent:D}),S(!0),function(){I.destroy(),a?.cleanup(I)}},N),nv(function(){var M;if(T.renders===1){T.renders++;return}var I=T.instance;I.setProps(Woe(I.props,A)),(M=I.popperInstance)==null||M.forceUpdate(),u?I.disable():I.enable(),h&&(o?I.show():I.hide()),m&&a.hook({instance:I,content:i,props:A,setSingletonContent:D})}),nv(function(){var M;if(s){var I=T.instance;I.setProps({popperOptions:Object.assign({},I.props.popperOptions,{modifiers:[].concat((((M=I.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function(L){var $=L.name;return $!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function($){var V,W=$.state,B=(V=W.modifiersData)==null?void 0:V.hide;(x.placement!==W.placement||x.referenceHidden!==B?.isReferenceHidden||x.escaped!==B?.hasPopperEscaped)&&_({placement:W.placement,referenceHidden:B?.isReferenceHidden,escaped:B?.hasPopperEscaped}),W.attributes.popper={}}}])})})}},[x.placement,x.referenceHidden,x.escaped].concat(N)),P.createElement(P.Fragment,null,r?P.cloneElement(r,{ref:function(I){T.ref=I,Iy(r.ref,I)}}):null,b&&Ui.createPortal(s?s($oe(x),k,T.instance):i,T.container))}return t}var Yoe=(function(e,t){return P.forwardRef(function(r,i){var o=r.children,a=Uj(r,["children"]);return P.createElement(e,Object.assign({},t,a),o?P.cloneElement(o,{ref:function(l){Iy(i,l),Iy(o.ref,l)}}):null)})}),Gj=Yoe(Hoe(Fu));function Uoe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Koe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>i.hour===n)||{};return{hour:n,time:Uoe(n),walkins:r.walkins??0,checkins:r.preApproved??0,staffAttendance:r.staffAttendance??0}})}const ws={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function qoe({type:e,data:t,children:n}){if(!e||!t)return n;const r={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},o={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},a=v.jsx(is,{title:i[e],period:"Today",icon:v.jsx(bb,{className:`${o[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-lg border border-gray-200",children:v.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:r[e].map(([s,l])=>v.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[v.jsx("div",{children:s}),v.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return v.jsx(Gj,{content:a,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:n})}function Goe({isStatic:e,data:t}){const n=t?.summary?.activeWalkins||{},r=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},o=P.useMemo(()=>Koe(t?.chart||[]),[t]),{yAxisTicks:a,yAxisMax:s}=P.useMemo(()=>{const l=Math.max(...o.flatMap(u=>[u.walkins,u.checkins,u.staffAttendance])),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[o]);return v.jsx(is,{title:"Gate Updates",period:"Today",icon:v.jsx(bb,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,actionButtons:v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsxs("div",{children:[v.jsx("div",{className:"grid grid-cols-3 gap-[24px] mt-[16px] mb-[16px]",children:[{key:"activeWalkins",data:n,color:ws.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:ws.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:r,color:ws.preApproved,label:"Pre-approved"}].map(l=>v.jsx(qoe,{type:l.key,data:l.data,children:v.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[v.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:l.label}),v.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:l.color},children:[l.key==="activeWalkins"?l.data?.visitor_in??0:l.key==="preApprovedCheckins"?l.data?.currently_inside??0:l.data?.total_in_now??0,v.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",l.key==="activeWalkins"?l.data?.total_pass??0:l.key==="preApprovedCheckins"?l.data?.total_expected_pass??0:l.data?.total_staff??0]})]})]})},l.key))}),v.jsx("div",{className:"w-full h-[105px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(wx,{data:o,margin:{top:5,right:0,left:-40,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),v.jsx(br,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),v.jsx(nr,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:a,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),v.jsx(Vt,{content:v.jsx(pu,{})}),v.jsx(Vo,{type:"monotone",dataKey:"walkins",stroke:ws.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins",isAnimationActive:!1}),v.jsx(Vo,{type:"monotone",dataKey:"checkins",stroke:ws.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1}),v.jsx(Vo,{type:"monotone",dataKey:"staffAttendance",stroke:ws.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance",isAnimationActive:!1})]})})})]})})}function Xoe({isStatic:e,data:t}){const n=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],r=[{name:"L1 Level",value:Number(t?.total_L1||0),color:n[0]},{name:"L2 Level",value:Number(t?.total_L2||0),color:n[1]},{name:"L3 Level",value:Number(t?.total_L3||0),color:n[2]},{name:"No Level",value:Number(t?.total_NoLevel||0),color:n[3]}];r.reduce((o,a)=>o+a.value,0);const i=r;return v.jsx(is,{title:"Helpdesk",period:"As of Today",icon:v.jsx(C3,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid gap-[20px]`,actionButtons:v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsxs("div",{className:"flex gap-[12px] h-fit",children:[v.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]",children:[v.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),v.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.total_open_complaints??0})]}),v.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[v.jsx(wb,{value:t?.percent_change}),v.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),v.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:v.jsx(Ft,{width:"75%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((o,a)=>v.jsx(kn,{fill:n[a]||"#CBD5E1"},o.name))}),v.jsx(Vt,{content:v.jsx(pu,{})})]})})})]})})}/*!
|
|
265
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&Foe(c,r);return u&&l.push(u),l},[]);return Xc(e)?s[0]:s}Fu.defaultProps=fr;Fu.setDefaultProps=joe;Fu.currentInput=ui;Object.assign({},rj,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Fu.setDefaultProps({render:Yj});function Uj(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Kj=typeof window<"u"&&typeof document<"u";function Iy(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function Y2(){return Kj&&document.createElement("div")}function $oe(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function qj(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!qj(e[n],t[n]))return!1}else return!1;return!0}else return!1}function Boe(e){var t=[];return e.forEach(function(n){t.find(function(r){return qj(n,r)})||t.push(n)}),t}function Woe(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:Boe([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var nv=Kj?P.useLayoutEffect:P.useEffect;function zoe(e){var t=P.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function U2(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var Voe={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}U2(n,"add",t.props.className)}function o(){r()&&U2(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function Hoe(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,s=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,d=n.ignoreAttributes,f=d===void 0?!0:d;n.__source,n.__self;var p=Uj(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),h=o!==void 0,m=a!==void 0,g=P.useState(!1),b=g[0],S=g[1],w=P.useState({}),x=w[0],_=w[1],O=P.useState(),k=O[0],D=O[1],T=zoe(function(){return{container:Y2(),renders:1}}),j=Object.assign({ignoreAttributes:f},p,{content:T.container});h&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(M){j[M]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+M+"` prop in","controlled mode (`visible` prop)"].join(" "))}),j.trigger="manual",j.hideOnClick=!1),m&&(u=!0);var A=j,C=j.plugins||[];s&&(A=Object.assign({},j,{plugins:m&&a.data!=null?[].concat(C,[{fn:function(){return{onTrigger:function(L,$){var V=a.data.children.find(function(W){var B=W.instance;return B.reference===$.currentTarget});L.state.$$activeSingletonInstance=V.instance,D(V.content)}}}}]):C,render:function(){return{popper:T.container}}}));var N=[l].concat(r?[r.type]:[]);return nv(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var I=e(M||T.ref||Y2(),Object.assign({},A,{plugins:[Voe].concat(j.plugins||[])}));return T.instance=I,u&&I.disable(),o&&I.show(),m&&a.hook({instance:I,content:i,props:A,setSingletonContent:D}),S(!0),function(){I.destroy(),a?.cleanup(I)}},N),nv(function(){var M;if(T.renders===1){T.renders++;return}var I=T.instance;I.setProps(Woe(I.props,A)),(M=I.popperInstance)==null||M.forceUpdate(),u?I.disable():I.enable(),h&&(o?I.show():I.hide()),m&&a.hook({instance:I,content:i,props:A,setSingletonContent:D})}),nv(function(){var M;if(s){var I=T.instance;I.setProps({popperOptions:Object.assign({},I.props.popperOptions,{modifiers:[].concat((((M=I.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function(L){var $=L.name;return $!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function($){var V,W=$.state,B=(V=W.modifiersData)==null?void 0:V.hide;(x.placement!==W.placement||x.referenceHidden!==B?.isReferenceHidden||x.escaped!==B?.hasPopperEscaped)&&_({placement:W.placement,referenceHidden:B?.isReferenceHidden,escaped:B?.hasPopperEscaped}),W.attributes.popper={}}}])})})}},[x.placement,x.referenceHidden,x.escaped].concat(N)),P.createElement(P.Fragment,null,r?P.cloneElement(r,{ref:function(I){T.ref=I,Iy(r.ref,I)}}):null,b&&Ui.createPortal(s?s($oe(x),k,T.instance):i,T.container))}return t}var Yoe=(function(e,t){return P.forwardRef(function(r,i){var o=r.children,a=Uj(r,["children"]);return P.createElement(e,Object.assign({},t,a),o?P.cloneElement(o,{ref:function(l){Iy(i,l),Iy(o.ref,l)}}):null)})}),Gj=Yoe(Hoe(Fu));function Uoe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Koe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>i.hour===n)||{};return{hour:n,time:Uoe(n),walkins:r.walkins??0,checkins:r.preApproved??0,staffAttendance:r.staffAttendance??0}})}const ws={walkins:"#1FA05B",preApproved:"#E7A015",staffAttendance:"#329DFF"};function qoe({type:e,data:t,children:n}){if(!e||!t)return n;const r={activeWalkins:[["Currently Inside",t.visitor_in],["Total Visited Today",t.total_pass]],preApprovedCheckins:[["Currently Inside",t.currently_inside],["Total Visited Today",t.expected_pass_scanned],["No show",t.expected_pass_not_scanned],["Total Scheduled",t.total_expected_pass]],staffAttendance:[["Currently Inside",t.total_in_now],["Absent Today",t.absent_staff],["Total Visited Today",t.total_in_today],["Total Staff",t.total_staff]]},i={activeWalkins:"Active Walk-ins",preApprovedCheckins:"Pre-approved Check-ins",staffAttendance:"Staff Attendance"},o={activeWalkins:"text-[#1FA05B]",preApprovedCheckins:"text-[#E7A015]",staffAttendance:"text-[#329DFF]"},a=v.jsx(is,{title:i[e],period:"Today",icon:v.jsx(bb,{className:`${o[e]} !text-[24px]`}),className:"!gap-0 min-w-[353px] bg-white shadow-xl rounded-[8px] border border-gray-200",children:v.jsx("div",{className:"flex flex-col gap-[8px] mt-[12px] pt-[12px] border-t border-dashed border-[#EBEBEB]",children:r[e].map(([s,l])=>v.jsxs("div",{className:"flex justify-between text-[14px] text-[#64748B]",children:[v.jsx("div",{children:s}),v.jsx("div",{className:"font-semibold text-gray-800",children:l??0})]},s))})});return v.jsx(Gj,{content:a,placement:"bottom-start",interactive:!0,delay:[100,0],offset:[0,8],appendTo:document.body,theme:"light-border",maxWidth:"none",children:n})}function Goe({isStatic:e,data:t}){const n=t?.summary?.activeWalkins||{},r=t?.summary?.preApprovedCheckins||{},i=t?.summary?.staffAttendance||{},o=P.useMemo(()=>Koe(t?.chart||[]),[t]),{yAxisTicks:a,yAxisMax:s}=P.useMemo(()=>{const l=Math.max(...o.flatMap(u=>[u.walkins,u.checkins,u.staffAttendance])),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[o]);return v.jsx(is,{title:"Gate Updates",period:"Today",icon:v.jsx(bb,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,actionButtons:v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsxs("div",{children:[v.jsx("div",{className:"grid grid-cols-3 gap-[24px] mt-[16px] mb-[16px]",children:[{key:"activeWalkins",data:n,color:ws.walkins,label:"Active Walk-ins"},{key:"staffAttendance",data:i,color:ws.staffAttendance,label:"Staff Checked-in"},{key:"preApprovedCheckins",data:r,color:ws.preApproved,label:"Pre-approved"}].map(l=>v.jsx(qoe,{type:l.key,data:l.data,children:v.jsxs("div",{className:"flex flex-col gap-[8px] cursor-pointer",children:[v.jsx("div",{className:"text-[10px] text-[#64748B] whitespace-nowrap",children:l.label}),v.jsxs("div",{className:"text-[28px] font-medium flex items-center",style:{color:l.color},children:[l.key==="activeWalkins"?l.data?.visitor_in??0:l.key==="preApprovedCheckins"?l.data?.currently_inside??0:l.data?.total_in_now??0,v.jsxs("div",{className:"text-[20px] text-[#64748B] ml-1",children:["/",l.key==="activeWalkins"?l.data?.total_pass??0:l.key==="preApprovedCheckins"?l.data?.total_expected_pass??0:l.data?.total_staff??0]})]})]})},l.key))}),v.jsx("div",{className:"w-full h-[105px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(wx,{data:o,margin:{top:5,right:0,left:-40,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),v.jsx(br,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",tick:{fontSize:10,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),v.jsx(nr,{tick:{fontSize:10,fill:"#64748B",fontWeight:400},ticks:a,domain:[0,s],allowDecimals:!1,axisLine:!1,tickLine:!1}),v.jsx(Vt,{content:v.jsx(pu,{})}),v.jsx(Vo,{type:"monotone",dataKey:"walkins",stroke:ws.walkins,strokeWidth:2,dot:!1,name:"Active Walk-ins",isAnimationActive:!1}),v.jsx(Vo,{type:"monotone",dataKey:"checkins",stroke:ws.preApproved,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1}),v.jsx(Vo,{type:"monotone",dataKey:"staffAttendance",stroke:ws.staffAttendance,strokeWidth:2,dot:!1,name:"Staff Attendance",isAnimationActive:!1})]})})})]})})}function Xoe({isStatic:e,data:t}){const n=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],r=[{name:"L1 Level",value:Number(t?.total_L1||0),color:n[0]},{name:"L2 Level",value:Number(t?.total_L2||0),color:n[1]},{name:"L3 Level",value:Number(t?.total_L3||0),color:n[2]},{name:"No Level",value:Number(t?.total_NoLevel||0),color:n[3]}];r.reduce((o,a)=>o+a.value,0);const i=r;return v.jsx(is,{title:"Helpdesk",period:"As of Today",icon:v.jsx(C3,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid gap-[20px]`,actionButtons:v.jsx(Pl,{widgetId:t?.widget_id,options:t?.communities}),children:v.jsxs("div",{className:"flex gap-[12px] h-fit",children:[v.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]",children:[v.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Un-resolved Complaints"}),v.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.total_open_complaints??0})]}),v.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] flex items-center gap-[4px]",children:[v.jsx(wb,{value:t?.percent_change}),v.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),v.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:v.jsx(Ft,{width:"75%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:i.map((o,a)=>v.jsx(kn,{fill:n[a]||"#CBD5E1"},o.name))}),v.jsx(Vt,{content:v.jsx(pu,{})})]})})})]})})}/*!
|
|
266
266
|
* @kurkle/color v0.3.4
|
|
267
267
|
* https://github.com/kurkle/color#readme
|
|
268
268
|
* (c) 2024 Jukka Kurkela
|
|
@@ -279,7 +279,7 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
279
279
|
* Released under the MIT License
|
|
280
280
|
*/class Yse{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],a=n.duration;o.forEach(s=>s({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=oR.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let a=o.length-1,s=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $i=new Yse;const gC="transparent",Use={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=oC(e||gC),i=r.valid&&oC(t||gC);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Kse{constructor(t,n,r,i){const o=n[r];i=Md([t.to,i,o,t.from]);const a=Md([t.from,o,i]);this._active=!0,this._fn=t.fn||Use[t.type||typeof a],this._easing=Ec[t.easing]||Ec.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=a,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,a=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Md([t.to,n,i,t.from]),this._from=Md([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,a=this._loop,s=this._to;let l;if(this._active=o!==s&&(a||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class bR{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Te(t))return;const n=Object.keys(Rt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Te(o))return;const a={};for(const s of n)a[s]=o[s];(en(o.properties)&&o.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,a)})})}_animateOptions(t,n){const r=n.options,i=Gse(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&qse(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),a=Object.keys(n),s=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,s);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new Kse(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return $i.add(this._chart,r),!0}}function qse(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Gse(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function vC(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function Xse(e,t,n){if(n===!1)return!1;const r=vC(e,n),i=vC(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Qse(e){let t,n,r,i;return Te(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function xR(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function yC(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let a,s,l,c;if(t===null)return;let u=!1;for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===n){if(u=!0,r.all)continue;break}c=e.values[l],$r(c)&&(o||t===0||wi(t)===wi(c))&&(t+=c)}return!u&&!r.all?0:t}function Zse(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",a=Object.keys(e),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[i]:u,[o]:e[u]};return s}function av(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Jse(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function ele(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function tle(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function bC(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function xC(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=r,l=o.axis,c=a.axis,u=Jse(o,a,r),d=t.length;let f;for(let p=0;p<d;++p){const h=t[p],{[l]:m,[c]:g}=h,b=h._stacks||(h._stacks={});f=b[c]=tle(i,u,m),f[s]=g,f._top=bC(f,a,!0,r.type),f._bottom=bC(f,a,!1,r.type);const S=f._visualValues||(f._visualValues={});S[s]=g}}function sv(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function nle(e,t){return ls(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function rle(e,t,n){return ls(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Zl(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const lv=e=>e==="reset"||e==="none",wC=(e,t)=>t?e:Object.assign({},e),ile=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:xR(n,!0),values:null};class Kh{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=av(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Zl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,p,h)=>d==="x"?f:d==="r"?h:p,o=n.xAxisID=Se(r.xAxisID,sv(t,"x")),a=n.yAxisID=Se(r.yAxisID,sv(t,"y")),s=n.rAxisID=Se(r.rAxisID,sv(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,a,s),u=n.vAxisID=i(l,a,o,s);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&nC(this._data,this),t._stacked&&Zl(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Te(n)){const i=this._cachedMeta;this._data=Zse(n,i)}else if(r!==n){if(r){nC(r,this);const i=this._cachedMeta;Zl(i),i._parsed=[]}n&&Object.isExtensible(n)&&Lae(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=av(n.vScale,n),n.stack!==r.stack&&(i=!0,Zl(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(xC(this,n._parsed),n._stacked=av(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:a}=r,s=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{en(i[t])?f=this.parseArrayData(r,i,t,n):Te(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const p=()=>d[s]===null||c&&d[s]<c[s];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);r._sorted=l}a&&xC(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:a}=t,s=o.axis,l=a.axis,c=o.getLabels(),u=o===a,d=new Array(i);let f,p,h;for(f=0,p=i;f<p;++f)h=f+r,d[f]={[s]:u||o.parse(c[h],h),[l]:a.parse(n[h],h)};return d}parseArrayData(t,n,r,i){const{xScale:o,yScale:a}=t,s=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],s[l]={x:o.parse(d[0],u),y:a.parse(d[1],u)};return s}parseObjectData(t,n,r,i){const{xScale:o,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,p;for(u=0,d=i;u<d;++u)f=u+r,p=n[f],c[u]={x:o.parse(ts(p,s),f),y:a.parse(ts(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,a=n[t.axis],s={keys:xR(i,!0),values:n._stacks[t.axis]._visualValues};return yC(s,a,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let a=o===null?NaN:o;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,a=yC(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,a=i.length,s=this._getOtherScale(t),l=ile(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=ele(s);let f,p;function h(){p=i[f];const m=p[s.axis];return!$r(p[t.axis])||u>m||d<m}for(f=0;f<a&&!(!h()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!h()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,a;for(i=0,o=n.length;i<o;++i)a=n[i][t.axis],$r(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Qse(Se(this.options.clip,Xse(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||i.length-s,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,s,l),u=s;u<s+l;++u){const d=i[u];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(u=0;u<a.length;++u)a[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=rle(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=nle(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,a=t+"-"+n,s=o[a],l=this.enableOptionSharing&&eu(r);if(s)return wC(s,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(Rt.elements[t]),h=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,p,h,d);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(wC(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,s=o[a];if(s)return s;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new bR(i,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||lv(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),a=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:a}}updateElement(t,n,r,i){lv(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!lv(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];const i=r.length,o=n.length,a=Math.min(o,i);a&&this.parse(0,a),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,a=t+n;let s;const l=c=>{for(c.length+=n,s=c.length-1;s>=a;s--)c[s]=c[s-n]};for(l(o),s=t;s<a;++s)o[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&Zl(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function ole(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=iR(r.sort((i,o)=>i-o))}return e._cache.$bar}function ale(e){const t=e.iScale,n=ole(t,e.type);let r=t._length,i,o,a,s;const l=()=>{a===32767||a===-32768||(eu(s)&&(r=Math.min(r,Math.abs(a-s)||r)),s=a)};for(i=0,o=n.length;i<o;++i)a=t.getPixelForValue(n[i]),l();for(s=void 0,i=0,o=t.ticks.length;i<o;++i)a=t.getPixelForTick(i),l();return r}function sle(e,t,n,r){const i=n.barThickness;let o,a;return He(i)?(o=t.min*n.categoryPercentage,a=n.barPercentage):(o=i*r,a=1),{chunk:o/r,ratio:a,start:t.pixels[e]-o/2}}function lle(e,t,n,r){const i=t.pixels,o=i[e];let a=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;a===null&&(a=o-(s===null?t.end-t.start:s-o)),s===null&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}function cle(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),a=Math.min(i,o),s=Math.max(i,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:a,max:s}}function wR(e,t,n,r){return en(e)?cle(e,t,n,r):t[n.axis]=n.parse(e,r),t}function _C(e,t,n,r){const i=e.iScale,o=e.vScale,a=i.getLabels(),s=i===o,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[i.axis]=s||i.parse(a[c],c),l.push(wR(f,d,o,c));return l}function cv(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function ule(e,t,n){return e!==0?wi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function dle(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function fle(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:s,reverse:l,top:c,bottom:u}=dle(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[SC(u,a,s,l)]=!0,i=c)),o[SC(i,a,s,l)]=!0,e.borderSkipped=o}function SC(e,t,n,r){return r?(e=ple(e,t,n),e=EC(e,n,t)):e=EC(e,t,n),e}function ple(e,t,n){return e===t?n:e===n?t:e}function EC(e,t,n){return e==="start"?t:e==="end"?n:e}function hle(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class mle extends Kh{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,r,i){return _C(t,n,r,i)}parseArrayData(t,n,r,i){return _C(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?s:l,u=a.axis==="x"?s:l,d=[];let f,p,h,m;for(f=r,p=r+i;f<p;++f)m=n[f],h={},h[o.axis]=o.parse(ts(m,c),f),d.push(wR(ts(m,u),h,a,f));return d}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),a=o._custom,s=cv(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const h=this.getParsed(p),m=o||He(h[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),g=this._calculateBarIndexPixels(p,u),b=(h._stacks||{})[s.axis],S={horizontal:c,base:m.base,enableBorderRadius:!b||cv(h._custom)||a===b._top||a===b._bottom,x:c?m.head:g.center,y:c?g.center:m.head,height:c?g.size:Math.abs(m.size),width:c?Math.abs(m.size):g.size};f&&(S.options=d||this.resolveDataElementOptions(p,t[p].active?"active":i));const w=S.options||t[p].options;fle(S,w,b,a),hle(S,w,u.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,a=[],s=this._cachedMeta.controller.getParsed(n),l=s&&s[r.axis],c=u=>{const d=u._parsed.find(p=>p[r.axis]===l),f=d&&d[u.vScale.axis];if(He(f)||isNaN(f))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Se(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,a;for(o=0,a=n.data.length;o<a;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const s=t.barThickness;return{min:s||ale(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:a}}=this,s=o||0,l=this.getParsed(t),c=l._custom,u=cv(c);let d=l[n.axis],f=0,p=r?this.applyStack(n,l,r):d,h,m;p!==d&&(f=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&wi(d)!==wi(c.barEnd)&&(f=0),f+=d);const g=!He(o)&&!u?o:f;let b=n.getPixelForValue(g);if(this.chart.getDataVisibility(t)?h=n.getPixelForValue(f+p):h=b,m=h-b,Math.abs(m)<a){m=ule(m,n,s)*a,d===s&&(b-=m/2);const S=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),x=Math.min(S,w),_=Math.max(S,w);b=Math.max(Math.min(b,_),x),h=b+m,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(h)-n.getValueForPixel(b))}if(b===n.getPixelForValue(s)){const S=wi(m)*n.getLineWidthForValue(s)/2;b+=S,m-=S}return{size:m,base:b,head:h,center:h+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,a=Se(i.maxBarThickness,1/0);let s,l;const c=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?lle(t,n,i,u*c):sle(t,n,i,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(Se(f,this.getFirstScaleIdForIndexAxis())),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+p;s=d.start+d.chunk*h+d.chunk/2,l=Math.min(a,d.chunk*d.ratio)}else s=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(a,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}function gle(e,t,n){let r=1,i=1,o=0,a=0;if(t<kt){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),f=Math.sin(l),p=(w,x,_)=>nu(w,s,l,!0)?1:Math.max(x,x*n,_,_*n),h=(w,x,_)=>nu(w,s,l,!0)?-1:Math.min(x,x*n,_,_*n),m=p(0,c,d),g=p(Ut,u,f),b=h(ot,c,d),S=h(ot+Ut,u,f);r=(m-b)/2,i=(g-S)/2,o=-(m+b)/2,a=-(g+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:a}}class vle extends Kh{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(Te(r[t])){const{key:l="value"}=this._parsing;o=c=>+ts(r[c],l)}let a,s;for(a=t,s=t+n;a<s;++a)i._parsed[a]=o(a)}}_getRotation(){return Qi(this.options.rotation-90)}_getCircumference(){return Qi(this.options.circumference)}_getRotationExtents(){let t=kt,n=-kt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),a=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-a)/2,0),l=Math.min(xae(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:h,offsetY:m}=gle(d,u,l),g=(r.width-a)/f,b=(r.height-a)/p,S=Math.max(Math.min(g,b)/2,0),w=Jj(this.options.radius,S),x=Math.max(w*l,0),_=(w-x)/this._getVisibleDatasetWeightTotal();this.offsetX=h*w,this.offsetY=m*w,i.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/kt)}updateElements(t,n,r,i){const o=i==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,u=(s.left+s.right)/2,d=(s.top+s.bottom)/2,f=o&&c.animateScale,p=f?0:this.innerRadius,h=f?0:this.outerRadius,{sharedOptions:m,includeOptions:g}=this._getSharedOptions(n,i);let b=this._getRotation(),S;for(S=0;S<n;++S)b+=this._circumference(S,o);for(S=n;S<n+r;++S){const w=this._circumference(S,o),x=t[S],_={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:h,innerRadius:p};g&&(_.options=m||this.resolveDataElementOptions(S,x.active?"active":i)),b+=w,this.updateElement(x,S,_,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?kt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=Kx(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,a,s,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){a=r.getDatasetMeta(i),t=a.data,s=a.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Se(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yle extends Kh{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:s,count:l}=Bae(n,i,a);this._drawStart=s,this._drawCount=l,Wae(n)&&(s=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:c},t),this.updateElements(i,s,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=a.axis,p=s.axis,{spanGaps:h,segment:m}=this.options,g=tu(h)?h:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||i==="none",S=n+r,w=t.length;let x=n>0&&this.getParsed(n-1);for(let _=0;_<w;++_){const O=t[_],k=b?O:{};if(_<n||_>=S){k.skip=!0;continue}const D=this.getParsed(_),T=He(D[p]),j=k[f]=a.getPixelForValue(D[f],_),A=k[p]=o||T?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,D,l):D[p],_);k.skip=isNaN(j)||isNaN(A)||T,k.stop=_>0&&Math.abs(D[f]-x[f])>g,m&&(k.parsed=D,k.raw=c.data[_]),d&&(k.options=u||this.resolveDataElementOptions(_,O.active?"active":i)),b||this.updateElement(O,_,k,i),x=D}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function ga(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class n1{static override(t){Object.assign(n1.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ga()}parse(){return ga()}format(){return ga()}add(){return ga()}diff(){return ga()}startOf(){return ga()}endOf(){return ga()}}var ble={_date:n1};function xle(e,t,n,r){const{controller:i,data:o,_sorted:a}=e,s=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!=="r"&&a&&o.length){const c=s._reversePixels?Rae:Ra;if(r){if(i._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(m=>!He(m[d.axis]));u.lo-=Math.max(0,p);const h=f.slice(u.hi).findIndex(m=>!He(m[d.axis]));u.hi+=Math.max(0,h)}return u}}return{lo:0,hi:o.length-1}}function qh(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),a=n[t];for(let s=0,l=o.length;s<l;++s){const{index:c,data:u}=o[s],{lo:d,hi:f}=xle(o[s],t,a,i);for(let p=d;p<=f;++p){const h=u[p];h.skip||r(h,c,p)}}}function wle(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,a=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function uv(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||qh(e,n,t,function(s,l,c){!i&&!ru(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&o.push({element:s,datasetIndex:l,index:c})},!0),o}function _le(e,t,n,r){let i=[];function o(a,s,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:d}=nR(a,{x:t.x,y:t.y});nu(d,c,u)&&i.push({element:a,datasetIndex:s,index:l})}return qh(e,n,t,o),i}function Sle(e,t,n,r,i,o){let a=[];const s=wle(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const h=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(h))&&!p)return;const g=s(t,h);g<l?(a=[{element:u,datasetIndex:d,index:f}],l=g):g===l&&a.push({element:u,datasetIndex:d,index:f})}return qh(e,n,t,c),a}function dv(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?_le(e,t,n,i):Sle(e,t,n,r,i,o)}function OC(e,t,n,r,i){const o=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return qh(e,n,t,(l,c,u)=>{l[a]&&l[a](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),s=s||l.inRange(t.x,t.y,i))}),r&&!s?[]:o}var Ele={modes:{index(e,t,n,r){const i=Oa(t,e),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?uv(e,i,o,r,a):dv(e,i,o,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=s[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=Oa(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?uv(e,i,o,r,a):dv(e,i,o,!1,r,a);if(s.length>0){const l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let u=0;u<c.length;++u)s.push({element:c[u],datasetIndex:l,index:u})}return s},point(e,t,n,r){const i=Oa(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return uv(e,i,o,r,a)},nearest(e,t,n,r){const i=Oa(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return dv(e,i,o,n.intersect,r,a)},x(e,t,n,r){const i=Oa(t,e);return OC(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Oa(t,e);return OC(e,i,"y",n.intersect,r)}}};const _R=["left","top","right","bottom"];function Jl(e,t){return e.filter(n=>n.pos===t)}function CC(e,t){return e.filter(n=>_R.indexOf(n.pos)===-1&&n.box.axis===t)}function ec(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function Ole(e){const t=[];let n,r,i,o,a,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:a,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:s});return t}function Cle(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!_R.includes(i))continue;const a=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Ple(e,t){const n=Cle(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,a,s;for(o=0,a=e.length;o<a;++o){s=e[o];const{fullSize:l}=s.box,c=n[s.stack],u=c&&s.stackWeight/c.weight;s.horizontal?(s.width=u?u*r:l&&t.availableWidth,s.height=i):(s.width=r,s.height=u?u*i:l&&t.availableHeight)}return n}function kle(e){const t=Ole(e),n=ec(t.filter(c=>c.box.fullSize),!0),r=ec(Jl(t,"left"),!0),i=ec(Jl(t,"right")),o=ec(Jl(t,"top"),!0),a=ec(Jl(t,"bottom")),s=CC(t,"x"),l=CC(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:Jl(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}function PC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function SR(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Dle(e,t,n,r){const{pos:i,box:o}=n,a=e.maxPadding;if(!Te(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&SR(a,o.getPadding());const s=Math.max(0,t.outerWidth-PC(a,e,"left","right")),l=Math.max(0,t.outerHeight-PC(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Ale(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Tle(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{o[a]=Math.max(t[a],n[a])}),o}return r(e?["left","right"]:["top","bottom"])}function pc(e,t,n,r){const i=[];let o,a,s,l,c,u;for(o=0,a=e.length,c=0;o<a;++o){s=e[o],l=s.box,l.update(s.width||t.w,s.height||t.h,Tle(s.horizontal,t));const{same:d,other:f}=Dle(t,n,s,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(s)}return c&&pc(i,t,n,r)||u}function Id(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function kC(e,t,n,r){const i=n.padding;let{x:o,y:a}=t;for(const s of e){const l=s.box,c=r[s.stack]||{placed:0,weight:1},u=s.stackWeight/c.weight||1;if(s.horizontal){const d=t.w*u,f=c.size||l.height;eu(c.start)&&(a=c.start),l.fullSize?Id(l,i.left,a,n.outerWidth-i.right-i.left,f):Id(l,t.left+c.placed,a,d,f),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,f=c.size||l.width;eu(c.start)&&(o=c.start),l.fullSize?Id(l,o,i.top,f,n.outerHeight-i.bottom-i.top):Id(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var Lo={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Qr(e.options.layout.padding),o=Math.max(t-i.width,0),a=Math.max(n-i.height,0),s=kle(e.boxes),l=s.vertical,c=s.horizontal;Ge(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,g)=>g.box.options&&g.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},i);SR(f,Qr(r));const p=Object.assign({maxPadding:f,w:o,h:a,x:i.left,y:i.top},i),h=Ple(l.concat(c),d);pc(s.fullSize,p,d,h),pc(l,p,d,h),pc(c,p,d,h)&&pc(l,p,d,h),Ale(p),kC(s.leftAndTop,p,d,h),p.x+=p.w,p.y+=p.h,kC(s.rightAndBottom,p,d,h),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Ge(s.chartArea,m=>{const g=m.box;Object.assign(g,e.chartArea),g.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class ER{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class Mle extends ER{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const rf="$chartjs",Nle={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},DC=e=>e===null||e==="";function jle(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[rf]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",DC(i)){const o=fC(e,"width");o!==void 0&&(e.width=o)}if(DC(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=fC(e,"height");o!==void 0&&(e.height=o)}return e}const OR=Ase?{passive:!0}:!1;function Rle(e,t,n){e&&e.addEventListener(t,n,OR)}function Ile(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,OR)}function Lle(e,t){const n=Nle[e.type]||e.type,{x:r,y:i}=Oa(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function _p(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Fle(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||_p(s.addedNodes,r),a=a&&!_p(s.removedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function $le(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||_p(s.removedNodes,r),a=a&&!_p(s.addedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const iu=new Map;let AC=0;function CR(){const e=window.devicePixelRatio;e!==AC&&(AC=e,iu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Ble(e,t){iu.size||window.addEventListener("resize",CR),iu.set(e,t)}function Wle(e){iu.delete(e),iu.size||window.removeEventListener("resize",CR)}function zle(e,t,n){const r=e.canvas,i=r&&t1(r);if(!i)return;const o=aR((s,l)=>{const c=i.clientWidth;n(s,l),c<i.clientWidth&&n()},window),a=new ResizeObserver(s=>{const l=s[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return a.observe(i),Ble(e,o),a}function fv(e,t,n){n&&n.disconnect(),t==="resize"&&Wle(e)}function Vle(e,t,n){const r=e.canvas,i=aR(o=>{e.ctx!==null&&n(Lle(o,e))},e);return Rle(r,t,i),i}class Hle extends ER{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(jle(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[rf])return!1;const r=n[rf].initial;["height","width"].forEach(o=>{const a=r[o];He(a)?n.removeAttribute(o):n.setAttribute(o,a)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[rf],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),a={attach:Fle,detach:$le,resize:zle}[n]||Vle;i[n]=a(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:fv,detach:fv,resize:fv}[n]||Ile)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return Dse(t,n,r,i)}isAttached(t){const n=t&&t1(t);return!!(n&&n.isConnected)}}function Yle(e){return!e1()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Mle:Hle}let sa=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return tu(this.x)&&tu(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}};function Ule(e,t){const n=e.options.ticks,r=Kle(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?Gle(t):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>i)return Xle(t,c,o,a/i),c;const u=qle(o,t,i);if(a>0){let d,f;const p=a>1?Math.round((l-s)/(a-1)):null;for(Ld(t,c,u,He(p)?0:s-p,s),d=0,f=a-1;d<f;d++)Ld(t,c,u,o[d],o[d+1]);return Ld(t,c,u,l,He(p)?t.length:l+p),c}return Ld(t,c,u),c}function Kle(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function qle(e,t,n){const r=Qle(e),i=t.length/n;if(!r)return Math.max(i,1);const o=kae(r);for(let a=0,s=o.length-1;a<s;a++){const l=o[a];if(l>i)return l}return Math.max(i,1)}function Gle(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Xle(e,t,n,r){let i=0,o=n[0],a;for(r=Math.ceil(r),a=0;a<e.length;a++)a===o&&(t.push(e[a]),i++,o=n[i*r])}function Ld(e,t,n,r,i){const o=Se(r,0),a=Math.min(Se(i,e.length),e.length);let s=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=o;u<0;)s++,u=Math.round(o+s*n);for(c=Math.max(o,0);c<a;c++)c===u&&(t.push(e[c]),s++,u=Math.round(o+s*n))}function Qle(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const Zle=e=>e==="left"?"right":e==="right"?"left":e,TC=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,MC=(e,t)=>Math.min(t||e,e);function NC(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function Jle(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,a=e._endPixel,s=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-s||l>a+s)))return l}function ece(e,t){Ge(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function tc(e){return e.drawTicks?e.tickLength:0}function jC(e,t){if(!e.display)return 0;const n=Zn(e.font,t),r=Qr(e.padding);return(en(e.text)?e.text.length:1)*n.lineHeight+r.height}function tce(e,t){return ls(e,{scale:t,type:"scale"})}function nce(e,t,n){return ls(e,{tick:n,index:t,type:"tick"})}function rce(e,t,n){let r=sR(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Zle(r)),r}function ice(e,t,n,r){const{top:i,left:o,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,p,h;const m=a-i,g=s-o;if(e.isHorizontal()){if(p=ar(r,o,s),Te(n)){const b=Object.keys(n)[0],S=n[b];h=u[b].getPixelForValue(S)+m-t}else n==="center"?h=(c.bottom+c.top)/2+m-t:h=TC(e,n,t);f=s-o}else{if(Te(n)){const b=Object.keys(n)[0],S=n[b];p=u[b].getPixelForValue(S)-g+t}else n==="center"?p=(c.left+c.right)/2-g+t:p=TC(e,n,t);h=ar(r,a,i),d=n==="left"?-Ut:Ut}return{titleX:p,titleY:h,maxWidth:f,rotation:d}}class kl extends sa{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=ri(t,Number.POSITIVE_INFINITY),n=ri(n,Number.NEGATIVE_INFINITY),r=ri(r,Number.POSITIVE_INFINITY),i=ri(i,Number.NEGATIVE_INFINITY),{min:ri(t,r),max:ri(n,i),minDefined:$r(t),maxDefined:$r(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),a;if(i&&o)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),i||(n=Math.min(n,a.min)),o||(r=Math.max(r,a.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:ri(n,ri(r,n)),max:ri(r,ri(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){dt(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=sse(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?NC(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Ule(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){dt(this.options.afterUpdate,[this])}beforeSetDimensions(){dt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){dt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),dt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){dt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=dt(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){dt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){dt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=MC(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let a=i,s,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=En(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:p/(r-1),d+6>s&&(s=p/(r-(t.offset?.5:1)),l=this.maxHeight-tc(t.grid)-n.padding-jC(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),a=Mae(Math.min(Math.asin(En((u.highest.height+6)/s,-1,1)),Math.asin(En(l/c,-1,1))-Math.asin(En(f/c,-1,1)))),a=Math.max(i,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){dt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){dt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){const l=jC(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=tc(o)+l):(t.height=this.maxHeight,t.width=tc(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=r.padding*2,h=Qi(this.labelRotation),m=Math.cos(h),g=Math.sin(h);if(s){const b=r.mirror?0:g*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+b+p)}else{const b=r.mirror?0:m*d.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+b+p)}this._calculatePadding(c,u,g,m)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?c?(f=i*t.width,p=r*n.height):(f=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+a)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){dt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)He(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=NC(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,a=[],s=[],l=Math.floor(n/MC(n,r));let c=0,u=0,d,f,p,h,m,g,b,S,w,x,_;for(d=0;d<n;d+=l){if(h=t[d].label,m=this._resolveTickFontOptions(d),i.font=g=m.string,b=o[g]=o[g]||{data:{},gc:[]},S=m.lineHeight,w=x=0,!He(h)&&!en(h))w=sC(i,b.data,b.gc,w,h),x=S;else if(en(h))for(f=0,p=h.length;f<p;++f)_=h[f],!He(_)&&!en(_)&&(w=sC(i,b.data,b.gc,w,_),x+=S);a.push(w),s.push(x),c=Math.max(w,c),u=Math.max(x,u)}ece(o,n);const O=a.indexOf(c),k=s.indexOf(u),D=T=>({width:a[T]||0,height:s[T]||0});return{first:D(0),last:D(n-1),widest:D(O),highest:D(k),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return jae(this._alignToPixels?ma(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=nce(this.getContext(),t,r))}return this.$context||(this.$context=tce(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Qi(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:a,border:s}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=tc(o),p=[],h=s.setContext(this.getContext()),m=h.display?h.width:0,g=m/2,b=function(L){return ma(r,L,m)};let S,w,x,_,O,k,D,T,j,A,C,N;if(a==="top")S=b(this.bottom),k=this.bottom-f,T=S-g,A=b(t.top)+g,N=t.bottom;else if(a==="bottom")S=b(this.top),A=t.top,N=b(t.bottom)-g,k=S+g,T=this.top+f;else if(a==="left")S=b(this.right),O=this.right-f,D=S-g,j=b(t.left)+g,C=t.right;else if(a==="right")S=b(this.left),j=t.left,C=b(t.right)-g,O=S+g,D=this.left+f;else if(n==="x"){if(a==="center")S=b((t.top+t.bottom)/2+.5);else if(Te(a)){const L=Object.keys(a)[0],$=a[L];S=b(this.chart.scales[L].getPixelForValue($))}A=t.top,N=t.bottom,k=S+g,T=k+f}else if(n==="y"){if(a==="center")S=b((t.left+t.right)/2);else if(Te(a)){const L=Object.keys(a)[0],$=a[L];S=b(this.chart.scales[L].getPixelForValue($))}O=S-g,D=O-f,j=t.left,C=t.right}const M=Se(i.ticks.maxTicksLimit,d),I=Math.max(1,Math.ceil(d/M));for(w=0;w<d;w+=I){const L=this.getContext(w),$=o.setContext(L),V=s.setContext(L),W=$.lineWidth,B=$.color,X=V.dash||[],q=V.dashOffset,re=$.tickWidth,J=$.tickColor,ee=$.tickBorderDash||[],ie=$.tickBorderDashOffset;x=Jle(this,w,l),x!==void 0&&(_=ma(r,x,W),c?O=D=j=C=_:k=T=A=N=_,p.push({tx1:O,ty1:k,tx2:D,ty2:T,x1:j,y1:A,x2:C,y2:N,width:W,color:B,borderDash:X,borderDashOffset:q,tickWidth:re,tickColor:J,tickBorderDash:ee,tickBorderDashOffset:ie}))}return this._ticksLength=d,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,f=tc(r.grid),p=f+u,h=d?-u:p,m=-Qi(this.labelRotation),g=[];let b,S,w,x,_,O,k,D,T,j,A,C,N="middle";if(i==="top")O=this.bottom-h,k=this._getXAxisLabelAlignment();else if(i==="bottom")O=this.top+h,k=this._getXAxisLabelAlignment();else if(i==="left"){const I=this._getYAxisLabelAlignment(f);k=I.textAlign,_=I.x}else if(i==="right"){const I=this._getYAxisLabelAlignment(f);k=I.textAlign,_=I.x}else if(n==="x"){if(i==="center")O=(t.top+t.bottom)/2+p;else if(Te(i)){const I=Object.keys(i)[0],L=i[I];O=this.chart.scales[I].getPixelForValue(L)+p}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(t.left+t.right)/2-p;else if(Te(i)){const I=Object.keys(i)[0],L=i[I];_=this.chart.scales[I].getPixelForValue(L)}k=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const M=this._getLabelSizes();for(b=0,S=s.length;b<S;++b){w=s[b],x=w.label;const I=o.setContext(this.getContext(b));D=this.getPixelForTick(b)+o.labelOffset,T=this._resolveTickFontOptions(b),j=T.lineHeight,A=en(x)?x.length:1;const L=A/2,$=I.color,V=I.textStrokeColor,W=I.textStrokeWidth;let B=k;a?(_=D,k==="inner"&&(b===S-1?B=this.options.reverse?"left":"right":b===0?B=this.options.reverse?"right":"left":B="center"),i==="top"?c==="near"||m!==0?C=-A*j+j/2:c==="center"?C=-M.highest.height/2-L*j+j:C=-M.highest.height+j/2:c==="near"||m!==0?C=j/2:c==="center"?C=M.highest.height/2-L*j:C=M.highest.height-A*j,d&&(C*=-1),m!==0&&!I.showLabelBackdrop&&(_+=j/2*Math.sin(m))):(O=D,C=(1-A)*j/2);let X;if(I.showLabelBackdrop){const q=Qr(I.backdropPadding),re=M.heights[b],J=M.widths[b];let ee=C-q.top,ie=0-q.left;switch(N){case"middle":ee-=re/2;break;case"bottom":ee-=re;break}switch(k){case"center":ie-=J/2;break;case"right":ie-=J;break;case"inner":b===S-1?ie-=J:b>0&&(ie-=J/2);break}X={left:ie,top:ee,width:J+q.width,height:re+q.height,color:I.backdropColor}}g.push({label:x,font:T,textOffset:C,options:{rotation:m,color:$,strokeColor:V,strokeWidth:W,textAlign:B,textBaseline:N,translation:[_,O],backdrop:X}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Qi(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,a=this._getLabelSizes(),s=t+o,l=a.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const s=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,a=i.length;o<a;++o){const l=i[o];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),a=r.display?o.width:0;if(!a)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=ma(t,this.left,a)-a/2,u=ma(t,this.right,s)+s/2,d=f=l):(d=ma(t,this.top,a)-a/2,f=ma(t,this.bottom,s)+s/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&qx(r,i);const o=this.getLabelItems(t);for(const a of o){const s=a.options,l=a.font,c=a.label,u=a.textOffset;bp(r,c,0,u,l,s)}i&&Gx(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=Zn(r.font),a=Qr(r.padding),s=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Te(n)?(l+=a.bottom,en(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=ice(this,l,n,s);bp(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:rce(s,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Se(t.grid&&t.grid.z,-1),i=Se(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==kl.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,a;for(o=0,a=n.length;o<a;++o){const s=n[o];s[r]===this.id&&(!t||s.type===t)&&i.push(s)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Zn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Fd{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;sce(n)&&(r=this.register(n));const i=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,oce(t,a,r),this.override&&Rt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Rt[i]&&(delete Rt[i][r],this.override&&delete ns[r])}}function oce(e,t,n){const r=Jc(Object.create(null),[n?Rt.get(n):{},Rt.get(t),e.defaults]);Rt.set(t,r),e.defaultRoutes&&ace(t,e.defaultRoutes),e.descriptors&&Rt.describe(t,e.descriptors)}function ace(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");Rt.route(o,i,l,s)})}function sce(e){return"id"in e&&"defaults"in e}class lce{constructor(){this.controllers=new Fd(Kh,"datasets",!0),this.elements=new Fd(sa,"elements"),this.plugins=new Fd(Object,"plugins"),this.scales=new Fd(kl,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Ge(i,a=>{const s=r||this._getRegistryForType(a);this._exec(t,s,a)})})}_exec(t,n,r){const i=Hx(t);dt(r["before"+i],[],r),n[t](r),dt(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var oi=new lce;class cce{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,r,i){i=i||{};for(const o of t){const a=o.plugin,s=a[r],l=[n,i,o.options];if(dt(s,l,a)===!1&&i.cancelable)return!1}return!0}invalidate(){He(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Se(r.options&&r.options.plugins,{}),o=uce(r);return i===!1&&!n?[]:fce(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,a)=>o.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function uce(e){const t={},n=[],r=Object.keys(oi.plugins.items);for(let o=0;o<r.length;o++)n.push(oi.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const a=i[o];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function dce(e,t){return!t&&e===!1?null:e===!0?{}:e}function fce(e,{plugins:t,localIds:n},r,i){const o=[],a=e.getContext();for(const s of t){const l=s.id,c=dce(r[l],i);c!==null&&o.push({plugin:s,options:pce(e.config,{plugin:s,local:n[l]},c,a)})}return o}function pce(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(r,o);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Wy(e,t){const n=Rt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function hce(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function mce(e,t){return e===t?"_index_":"_value_"}function RC(e){if(e==="x"||e==="y"||e==="r")return e}function gce(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function zy(e,...t){if(RC(e))return e;for(const n of t){const r=n.axis||gce(n.position)||e.length>1&&RC(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function IC(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function vce(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return IC(e,"x",n[0])||IC(e,"y",n[0])}return{}}function yce(e,t){const n=ns[e.type]||{scales:{}},r=t.scales||{},i=Wy(e.type,t),o=Object.create(null);return Object.keys(r).forEach(a=>{const s=r[a];if(!Te(s))return console.error(`Invalid scale configuration for scale: ${a}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=zy(a,s,vce(a,e),Rt.scales[s.type]),c=mce(l,i),u=n.scales||{};o[a]=_c(Object.create(null),[{axis:l},s,u[l],u[c]])}),e.data.datasets.forEach(a=>{const s=a.type||e.type,l=a.indexAxis||Wy(s,t),u=(ns[s]||{}).scales||{};Object.keys(u).forEach(d=>{const f=hce(d,l),p=a[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),_c(o[p],[{axis:f},r[p],u[d]])})}),Object.keys(o).forEach(a=>{const s=o[a];_c(s,[Rt.scales[s.type],Rt.scale])}),o}function PR(e){const t=e.options||(e.options={});t.plugins=Se(t.plugins,{}),t.scales=yce(e,t)}function kR(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function bce(e){return e=e||{},e.data=kR(e.data),PR(e),e}const LC=new Map,DR=new Set;function $d(e,t){let n=LC.get(e);return n||(n=t(),LC.set(e,n),DR.add(n)),n}const nc=(e,t,n)=>{const r=ts(t,n);r!==void 0&&e.add(r)};class xce{constructor(t){this._config=bce(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=kR(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),PR(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $d(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return $d(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return $d(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return $d(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,a=this._cachedScopes(t,r),s=a.get(n);if(s)return s;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>nc(l,t,d))),u.forEach(d=>nc(l,i,d)),u.forEach(d=>nc(l,ns[o]||{},d)),u.forEach(d=>nc(l,Rt,d)),u.forEach(d=>nc(l,$y,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),DR.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ns[n]||{},Rt.datasets[n]||{},{type:n},Rt,$y]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:s}=FC(this._resolverCache,t,i);let l=a;if(_ce(a,n)){o.$shared=!1,r=Jo(r)?r():r;const c=this.createResolver(t,r,s);l=cl(a,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=FC(this._resolverCache,t,r);return Te(n)?cl(o,n,void 0,i):o}}function FC(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:Qx(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,o)),o}const wce=e=>Te(e)&&Object.getOwnPropertyNames(e).some(t=>Jo(e[t]));function _ce(e,t){const{isScriptable:n,isIndexable:r}=dR(e);for(const i of t){const o=n(i),a=r(i),s=(a||o)&&e[i];if(o&&(Jo(s)||wce(s))||a&&en(s))return!0}return!1}var Sce="4.5.0";const Ece=["top","bottom","left","right","chartArea"];function $C(e,t){return e==="top"||e==="bottom"||Ece.indexOf(e)===-1&&t==="x"}function BC(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function WC(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),dt(n&&n.onComplete,[e],t)}function Oce(e){const t=e.chart,n=t.options.animation;dt(n&&n.onProgress,[e],t)}function AR(e){return e1()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const of={},zC=e=>{const t=AR(e);return Object.values(of).filter(n=>n.canvas===t).pop()};function Cce(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const a=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=a)}}}function Pce(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let $n=class{static defaults=Rt;static instances=of;static overrides=ns;static registry=oi;static version=Sce;static getChart=zC;static register(...t){oi.add(...t),VC()}static unregister(...t){oi.remove(...t),VC()}constructor(t,n){const r=this.config=new xce(n),i=AR(t),o=zC(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Yle(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,u=l&&l.width;if(this.id=bae(),this.ctx=s,this.canvas=l,this.width=u,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new cce,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Fae(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],of[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$i.listen(this,"complete",WC),$i.listen(this,"progress",Oce),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return He(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return oi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return lC(this.canvas,this.ctx),this}stop(){return $i.stop(this),this}resize(t,n){$i.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,n,o),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,dC(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),dt(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ge(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((a,s)=>(a[s]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const s=n[a],l=zy(a,s),c=l==="r",u=l==="x";return{options:s,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Ge(o,a=>{const s=a.options,l=s.id,c=zy(l,s),u=Se(s.type,a.dtype);(s.position===void 0||$C(s.position,c)!==$C(a.dposition))&&(s.position=a.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=oi.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),Ge(i,(a,s)=>{a||delete r[s]}),Ge(r,a=>{Lo.configure(this,a,a.options),Lo.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(BC("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let a=this.getDatasetMeta(r);const s=o.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=s,a.indexAxis=o.indexAxis||Wy(s,this.options),a.order=o.order||0,a.index=r,a.label=""+o.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const l=oi.getController(s),{datasetElementType:c,dataElementType:u}=Rt.datasets[s];Object.assign(l,{dataElementType:oi.getElement(u),datasetElementType:c&&oi.getElement(c)}),a.controller=new l(this,r),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Ge(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),i||Ge(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(BC("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Ge(this.scales,t=>{Lo.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Z2(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const a=r==="_removeElements"?-o:o;Cce(t,i,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(a=>a[0]===o).map((a,s)=>s+","+a.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!Z2(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Lo.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ge(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Jo(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&($i.has(this)?this.attached&&!$i.running(this)&&$i.start(this):(this.draw(),WC({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];(!t||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=Hse(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&qx(n,i),t.controller.draw(),i&&Gx(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ru(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=Ele.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=ls(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,i);eu(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(o,{visible:r}),this.update(s=>s.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),$i.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),lC(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete of[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},i=(o,a,s)=>{o.offsetX=a,o.offsetY=s,this._eventHandler(o)};Ge(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",o),r("detach",a)};a=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():a()}unbindEvents(){Ge(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ge(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,a,s,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[i+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:a})=>{const s=this.getDatasetMeta(o);if(!s)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:s.data[a],index:a}});!gp(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),a=o(n,t),s=r?t:o(t,n);a.length&&this.updateHoverStyle(a,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,a=n,s=this._getActiveElements(t,i,r,a),l=Oae(t),c=Pce(t,this._lastEvent,r,l);r&&(this._lastEvent=null,dt(o.onHover,[t,s,this],this),l&&dt(o.onClick,[t,s,this],this));const u=!gp(s,i);return(u||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}};function VC(){return Ge($n.instances,e=>e._plugins.invalidate())}function kce(e,t,n){const{startAngle:r,x:i,y:o,outerRadius:a,innerRadius:s,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/a,Ur(r-n));if(e.beginPath(),e.arc(i,o,a-c/2,r+d/2,n-d/2),s>0){const f=Math.min(c/s,Ur(r-n));e.arc(i,o,s+c/2,n-f/2,r+f/2,!0)}else{const f=Math.min(c/2,a*Ur(r-n));if(u==="round")e.arc(i,o,f,n-ot/2,r+ot/2,!0);else if(u==="bevel"){const p=2*f*f,h=-p*Math.cos(n+ot/2)+i,m=-p*Math.sin(n+ot/2)+o,g=p*Math.cos(r+ot/2)+i,b=p*Math.sin(r+ot/2)+o;e.lineTo(h,m),e.lineTo(g,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Dce(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:a,outerRadius:s,innerRadius:l}=t;let c=i/s;e.beginPath(),e.arc(o,a,s,r-c,n+c),l>i?(c=i/l,e.arc(o,a,l,n+c,r-c,!0)):e.arc(o,a,i,n+Ut,r-Ut),e.closePath(),e.clip()}function Ace(e){return Xx(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Tce(e,t,n,r){const i=Ace(e.options.borderRadius),o=(n-t)/2,a=Math.min(o,r*t/2),s=l=>{const c=(n-Math.min(o,l))*r/2;return En(l,0,Math.min(o,c))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:En(i.innerStart,0,a),innerEnd:En(i.innerEnd,0,a)}}function Ss(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Sp(e,t,n,r,i,o){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let p=0;const h=i-l;if(r){const I=u>0?u-r:0,L=d>0?d-r:0,$=(I+L)/2,V=$!==0?h*$/($+r):h;p=(h-V)/2}const m=Math.max(.001,h*d-n/ot)/d,g=(h-m)/2,b=l+g+p,S=i-g-p,{outerStart:w,outerEnd:x,innerStart:_,innerEnd:O}=Tce(t,f,d,S-b),k=d-w,D=d-x,T=b+w/k,j=S-x/D,A=f+_,C=f+O,N=b+_/A,M=S-O/C;if(e.beginPath(),o){const I=(T+j)/2;if(e.arc(a,s,d,T,I),e.arc(a,s,d,I,j),x>0){const W=Ss(D,j,a,s);e.arc(W.x,W.y,x,j,S+Ut)}const L=Ss(C,S,a,s);if(e.lineTo(L.x,L.y),O>0){const W=Ss(C,M,a,s);e.arc(W.x,W.y,O,S+Ut,M+Math.PI)}const $=(S-O/f+(b+_/f))/2;if(e.arc(a,s,f,S-O/f,$,!0),e.arc(a,s,f,$,b+_/f,!0),_>0){const W=Ss(A,N,a,s);e.arc(W.x,W.y,_,N+Math.PI,b-Ut)}const V=Ss(k,b,a,s);if(e.lineTo(V.x,V.y),w>0){const W=Ss(k,T,a,s);e.arc(W.x,W.y,w,b-Ut,T)}}else{e.moveTo(a,s);const I=Math.cos(T)*d+a,L=Math.sin(T)*d+s;e.lineTo(I,L);const $=Math.cos(j)*d+a,V=Math.sin(j)*d+s;e.lineTo($,V)}e.closePath()}function Mce(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s}=t;let l=t.endAngle;if(o){Sp(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(s)||(l=a+(s%kt||kt))}return Sp(e,t,n,r,l,i),e.fill(),l}function Nce(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(o){Sp(e,t,n,r,m,i);for(let g=0;g<o;++g)e.stroke();isNaN(s)||(m=a+(s%kt||kt))}h&&Dce(e,t,m),l.selfJoin&&m-a>=ot&&p===0&&u!=="miter"&&kce(e,t,m),o||(Sp(e,t,n,r,m,i),e.stroke())}class r1 extends sa{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,r){const i=this.getProps(["x","y"],r),{angle:o,distance:a}=nR(i,{x:t,y:n}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,p=Se(d,l-s),h=nu(o,s,l)&&s!==l,m=p>=kt||h,g=Io(a,c+f,u+f);return m&&g}getCenterPoint(t){const{x:n,y:r,startAngle:i,endAngle:o,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(i+o)/2,d=(a+s+c+l)/2;return{x:n+Math.cos(u)*d,y:r+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:r}=this,i=(n.offset||0)/4,o=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>kt?Math.floor(r/kt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const s=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(s)*i,Math.sin(s)*i);const l=1-Math.sin(Math.min(ot,r||0)),c=i*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,Mce(t,this,c,o,a),Nce(t,this,c,o,a),t.restore()}}function TR(e,t,n=t){e.lineCap=Se(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Se(n.borderDash,t.borderDash)),e.lineDashOffset=Se(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Se(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Se(n.borderWidth,t.borderWidth),e.strokeStyle=Se(n.borderColor,t.borderColor)}function jce(e,t,n){e.lineTo(n.x,n.y)}function Rce(e){return e.stepped?Zae:e.tension||e.cubicInterpolationMode==="monotone"?Jae:jce}function MR(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:a,end:s}=t,l=Math.max(i,a),c=Math.min(o,s),u=i<a&&o<a||i>s&&o>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Ice(e,t,n,r){const{points:i,options:o}=t,{count:a,start:s,loop:l,ilen:c}=MR(i,n,r),u=Rce(o);let{move:d=!0,reverse:f}=r||{},p,h,m;for(p=0;p<=c;++p)h=i[(s+(f?c-p:p))%a],!h.skip&&(d?(e.moveTo(h.x,h.y),d=!1):u(e,m,h,f,o.stepped),m=h);return l&&(h=i[(s+(f?c:0))%a],u(e,m,h,f,o.stepped)),!!l}function Lce(e,t,n,r){const i=t.points,{count:o,start:a,ilen:s}=MR(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,p,h,m,g,b;const S=x=>(a+(c?s-x:x))%o,w=()=>{m!==g&&(e.lineTo(u,g),e.lineTo(u,m),e.lineTo(u,b))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[S(f)],p.skip)continue;const x=p.x,_=p.y,O=x|0;O===h?(_<m?m=_:_>g&&(g=_),u=(d*u+x)/++d):(w(),e.lineTo(x,_),h=O,d=0,m=g=_),b=_}w()}function Vy(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Lce:Ice}function Fce(e){return e.stepped?Tse:e.tension||e.cubicInterpolationMode==="monotone"?Mse:Ca}function $ce(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),TR(e,t.options),e.stroke(i)}function Bce(e,t,n,r){const{segments:i,options:o}=t,a=Vy(t);for(const s of i)TR(e,o,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Wce=typeof Path2D=="function";function zce(e,t,n,r){Wce&&!t.options.segment?$ce(e,t,n,r):Bce(e,t,n,r)}class i1 extends sa{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;Sse(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Bse(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,a=Lse(this,{property:n,start:i,end:i});if(!a.length)return;const s=[],l=Fce(r);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:f}=a[c],p=o[d],h=o[f];if(p===h){s.push(p);continue}const m=Math.abs((i-p[n])/(h[n]-p[n])),g=l(p,h,m,r.stepped);g[n]=t[n],s.push(g)}return s.length===1?s[0]:s}pathSegment(t,n,r){return Vy(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=Vy(this);let a=this._loop;n=n||0,r=r||this.points.length-n;for(const s of i)a&=o(t,this,s,{start:n,end:n+r-1});return!!a}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),zce(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function HC(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class o1 extends sa{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,r){const i=this.options,{x:o,y:a}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,n){return HC(this,t,"x",n)}inYRange(t,n){return HC(this,t,"y",n)}getCenterPoint(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const r=n&&t.borderWidth||0;return(n+r)*2}draw(t,n){const r=this.options;this.skip||r.radius<.1||!ru(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,By(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function NR(e,t){const{x:n,y:r,base:i,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=o/2,s=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:s,top:c,right:l,bottom:u}}function Fo(e,t,n,r){return e?0:En(t,n,r)}function Vce(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=uR(r);return{t:Fo(i.top,o.top,0,n),r:Fo(i.right,o.right,0,t),b:Fo(i.bottom,o.bottom,0,n),l:Fo(i.left,o.left,0,t)}}function Hce(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=Is(i),a=Math.min(t,n),s=e.borderSkipped,l=r||Te(i);return{topLeft:Fo(!l||s.top||s.left,o.topLeft,0,a),topRight:Fo(!l||s.top||s.right,o.topRight,0,a),bottomLeft:Fo(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:Fo(!l||s.bottom||s.right,o.bottomRight,0,a)}}function Yce(e){const t=NR(e),n=t.right-t.left,r=t.bottom-t.top,i=Vce(e,n/2,r/2),o=Hce(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function pv(e,t,n,r){const i=t===null,o=n===null,s=e&&!(i&&o)&&NR(e,r);return s&&(i||Io(t,s.left,s.right))&&(o||Io(n,s.top,s.bottom))}function Uce(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Kce(e,t){e.rect(t.x,t.y,t.w,t.h)}function hv(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+a,radius:e.radius}}class Dl extends sa{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:a}=Yce(this),s=Uce(a.radius)?xp:Kce;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),s(t,hv(a,n,o)),t.clip(),s(t,hv(o,-n,a)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,hv(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return pv(this,t,n,r)}inXRange(t,n){return pv(this,t,null,n)}inYRange(t,n){return pv(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const YC=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},qce=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class UC extends sa{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=dt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Zn(r.font),o=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=YC(r,o);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,o,s,l)+10):(u=this.maxHeight,c=this._fitCols(a,i,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+s;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((h,m)=>{const g=r+n/2+o.measureText(h.text).width;(m===0||c[c.length-1]+g+2*s>a)&&(d+=u,c[c.length-(m>0?0:1)]=0,p+=u,f++),l[m]={left:0,top:p,row:f,width:g,height:i},c[c.length-1]+=g+s}),d}_fitCols(t,n,r,i){const{ctx:o,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let d=s,f=0,p=0,h=0,m=0;return this.legendItems.forEach((g,b)=>{const{itemWidth:S,itemHeight:w}=Gce(r,n,o,g,i);b>0&&p+w+2*s>u&&(d+=f+s,c.push({width:f,height:p}),h+=f+s,m++,f=p=0),l[b]={left:h,top:p,col:m,width:S,height:w},f=Math.max(f,S),p+=w+s}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,a=Ls(o,this.left,this.width);if(this.isHorizontal()){let s=0,l=ar(r,this.left+i,this.right-this.lineWidths[s]);for(const c of n)s!==c.row&&(s=c.row,l=ar(r,this.left+i,this.right-this.lineWidths[s])),c.top+=this.top+t+i,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+i}else{let s=0,l=ar(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const c of n)c.col!==s&&(s=c.col,l=ar(r,this.top+t+i,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+i,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;qx(t,this),this._draw(),Gx(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:a}=t,s=Rt.color,l=Ls(t.rtl,this.left,this.width),c=Zn(a.font),{padding:u}=a,d=c.size,f=d/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:h,boxHeight:m,itemHeight:g}=YC(a,d),b=function(O,k,D){if(isNaN(h)||h<=0||isNaN(m)||m<0)return;i.save();const T=Se(D.lineWidth,1);if(i.fillStyle=Se(D.fillStyle,s),i.lineCap=Se(D.lineCap,"butt"),i.lineDashOffset=Se(D.lineDashOffset,0),i.lineJoin=Se(D.lineJoin,"miter"),i.lineWidth=T,i.strokeStyle=Se(D.strokeStyle,s),i.setLineDash(Se(D.lineDash,[])),a.usePointStyle){const j={radius:m*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:T},A=l.xPlus(O,h/2),C=k+f;cR(i,j,A,C,a.pointStyleWidth&&h)}else{const j=k+Math.max((d-m)/2,0),A=l.leftForLtr(O,h),C=Is(D.borderRadius);i.beginPath(),Object.values(C).some(N=>N!==0)?xp(i,{x:A,y:j,w:h,h:m,radius:C}):i.rect(A,j,h,m),i.fill(),T!==0&&i.stroke()}i.restore()},S=function(O,k,D){bp(i,D.text,O,k+g/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?p={x:ar(o,this.left+u,this.right-r[0]),y:this.top+u+x,line:0}:p={x:this.left+u,y:ar(o,this.top+x+u,this.bottom-n[0].height),line:0},gR(this.ctx,t.textDirection);const _=g+u;this.legendItems.forEach((O,k)=>{i.strokeStyle=O.fontColor,i.fillStyle=O.fontColor;const D=i.measureText(O.text).width,T=l.textAlign(O.textAlign||(O.textAlign=a.textAlign)),j=h+f+D;let A=p.x,C=p.y;l.setWidth(this.width),w?k>0&&A+j+u>this.right&&(C=p.y+=_,p.line++,A=p.x=ar(o,this.left+u,this.right-r[p.line])):k>0&&C+_>this.bottom&&(A=p.x=A+n[p.line].width+u,p.line++,C=p.y=ar(o,this.top+x+u,this.bottom-n[p.line].height));const N=l.x(A);if(b(N,C,O),A=$ae(T,A+h+f,w?A+j:this.right,t.rtl),S(l.x(A),C,O),w)p.x+=j+u;else if(typeof O.text!="string"){const M=c.lineHeight;p.y+=jR(O,M)+u}else p.y+=_}),vR(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Zn(n.font),i=Qr(n.padding);if(!n.display)return;const o=Ls(t.rtl,this.left,this.width),a=this.ctx,s=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ar(t.align,d,this.right-f);else{const h=this.columnSizes.reduce((m,g)=>Math.max(m,g.height),0);u=c+ar(t.align,this.top,this.bottom-h-t.labels.padding-this._computeTitleHeight())}const p=ar(s,d,d+f);a.textAlign=o.textAlign(sR(s)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,bp(a,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=Zn(t.font),r=Qr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(Io(t,this.left,this.right)&&Io(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],Io(t,i.left,i.left+i.width)&&Io(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!Zce(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=qce(i,r);i&&!o&&dt(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&dt(n.onHover,[t,r,this],this)}else r&&dt(n.onClick,[t,r,this],this)}}function Gce(e,t,n,r,i){const o=Xce(r,e,t,n),a=Qce(i,r,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Xce(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,a)=>o.length>a.length?o:a)),t+n.size/2+r.measureText(i).width}function Qce(e,t,n){let r=e;return typeof t.text!="string"&&(r=jR(t,n)),r}function jR(e,t){const n=e.text?e.text.length:0;return t*n}function Zce(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Jr={id:"legend",_element:UC,start(e,t,n){const r=e.legend=new UC({ctx:e.ctx,options:n,chart:e});Lo.configure(e,r,n),Lo.addBox(e,r)},stop(e){Lo.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Lo.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Qr(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:a&&(s||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};const hc={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,a,s;for(o=0,a=e.length;o<a;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Fy(t,c);u<i&&(i=u,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function ii(e,t){return t&&(en(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Bi(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
281
281
|
`)>-1?e.split(`
|
|
282
|
-
`):e}function Jce(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function KC(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Zn(t.bodyFont),c=Zn(t.titleFont),u=Zn(t.footerFont),d=o.length,f=i.length,p=r.length,h=Qr(t.padding);let m=h.height,g=0,b=r.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=p*x+(b-p)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const w=function(x){g=Math.max(g,n.measureText(x).width+S)};return n.save(),n.font=c.string,Ge(e.title,w),n.font=l.string,Ge(e.beforeBody.concat(e.afterBody),w),S=t.displayColors?a+2+t.boxPadding:0,Ge(r,x=>{Ge(x.before,w),Ge(x.lines,w),Ge(x.after,w)}),S=0,n.font=u.string,Ge(e.footer,w),n.restore(),g+=h.width,{width:g,height:m}}function eue(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function tue(e,t,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&i+o+a>t.width||e==="right"&&i-o-a<0)return!0}function nue(e,t,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),tue(c,e,t,n)&&(c="center"),c}function qC(e,t,n){const r=n.yAlign||t.yAlign||eue(e,n);return{xAlign:n.xAlign||t.xAlign||nue(e,t,n,r),yAlign:r}}function rue(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function iue(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function GC(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=Is(a);let h=rue(t,s);const m=iue(t,l,c);return l==="center"?s==="left"?h+=c:s==="right"&&(h-=c):s==="left"?h-=Math.max(u,f)+i:s==="right"&&(h+=Math.max(d,p)+i),{x:En(h,0,r.width-t.width),y:En(m,0,r.height-t.height)}}function Bd(e,t,n){const r=Qr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function XC(e){return ii([],Bi(e))}function oue(e,t,n){return ls(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function QC(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const RR={beforeTitle:Fi,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Fi,beforeBody:Fi,beforeLabel:Fi,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return He(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Fi,afterBody:Fi,beforeFooter:Fi,footer:Fi,afterFooter:Fi};function Vn(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?RR[t].call(n,r):i}class ZC extends sa{static positioners=hc;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new bR(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=oue(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Vn(r,"beforeTitle",this,t),o=Vn(r,"title",this,t),a=Vn(r,"afterTitle",this,t);let s=[];return s=ii(s,Bi(i)),s=ii(s,Bi(o)),s=ii(s,Bi(a)),s}getBeforeBody(t,n){return XC(Vn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ge(t,o=>{const a={before:[],lines:[],after:[]},s=QC(r,o);ii(a.before,Bi(Vn(s,"beforeLabel",this,o))),ii(a.lines,Vn(s,"label",this,o)),ii(a.after,Bi(Vn(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return XC(Vn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Vn(r,"beforeFooter",this,t),o=Vn(r,"footer",this,t),a=Vn(r,"afterFooter",this,t);let s=[];return s=ii(s,Bi(i)),s=ii(s,Bi(o)),s=ii(s,Bi(a)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(Jce(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Ge(s,u=>{const d=QC(t.callbacks,u);i.push(Vn(d,"labelColor",this,u)),o.push(Vn(d,"labelPointStyle",this,u)),a.push(Vn(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const s=hc[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=KC(this,r),c=Object.assign({},s,l),u=qC(this.chart,r,c),d=GC(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Is(s),{x:f,y:p}=t,{width:h,height:m}=n;let g,b,S,w,x,_;return o==="center"?(x=p+m/2,i==="left"?(g=f,b=g-a,w=x+a,_=x-a):(g=f+h,b=g+a,w=x-a,_=x+a),S=g):(i==="left"?b=f+Math.max(l,u)+a:i==="right"?b=f+h-Math.max(c,d)-a:b=this.caretX,o==="top"?(w=p,x=w-a,g=b-a,S=b+a):(w=p+m,x=w+a,g=b+a,S=b-a),_=w),{x1:g,x2:b,x3:S,y1:w,y2:x,y3:_}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=Ls(r.rtl,this.x,this.width);for(t.x=Bd(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=Zn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=Zn(o.bodyFont),d=Bd(this,"left",o),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,h=n.y+p;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},g=i.leftForLtr(f,c)+c/2,b=h+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,By(t,m,g,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,By(t,m,g,b)}else{t.lineWidth=Te(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=i.leftForLtr(f,c),g=i.leftForLtr(i.xPlus(f,1),c-2),b=Is(a.borderRadius);Object.values(b).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,xp(t,{x:m,y:h,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),xp(t,{x:g,y:h+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,h,c,l),t.strokeRect(m,h,c,l),t.fillStyle=a.backgroundColor,t.fillRect(g,h+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Zn(r.bodyFont);let f=d.lineHeight,p=0;const h=Ls(r.rtl,this.x,this.width),m=function(D){n.fillText(D,h.x(t.x+p),t.y+f/2),t.y+=f+o},g=h.textAlign(a);let b,S,w,x,_,O,k;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Bd(this,g,r),n.fillStyle=r.bodyColor,Ge(this.beforeBody,m),p=s&&g!=="right"?a==="center"?c/2+u:c+2+u:0,x=0,O=i.length;x<O;++x){for(b=i[x],S=this.labelTextColors[x],n.fillStyle=S,Ge(b.before,m),w=b.lines,s&&w.length&&(this._drawColorBox(n,t,x,h,r),f=Math.max(d.lineHeight,l)),_=0,k=w.length;_<k;++_)m(w[_]),f=d.lineHeight;Ge(b.after,m)}p=0,f=d.lineHeight,Ge(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=Ls(r.rtl,this.x,this.width);for(t.x=Bd(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=Zn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:h}=Is(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+c-f,l),n.quadraticCurveTo(s+c,l,s+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-h),n.quadraticCurveTo(s+c,l+u,s+c-h,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=hc[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=KC(this,t),l=Object.assign({},a,this._size),c=qC(n,t,l),u=GC(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Qr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),gR(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),vR(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),o=!gp(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),s=this._positionChanged(a,t),l=n||!gp(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,a=hc[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var Yr={id:"tooltip",_element:ZC,positioners:hc,afterInit(e,t,n){n&&(e.tooltip=new ZC({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:RR},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const aue=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function sue(e,t,n,r){const i=e.indexOf(t);if(i===-1)return aue(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const lue=(e,t)=>e===null?null:En(Math.round(e),0,t);function JC(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Eo extends kl{static id="category";static defaults={ticks:{callback:JC}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(He(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:sue(r,t,Se(n,t),this._addedLabels),lue(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)i.push({value:a});return i}getLabelForValue(t){return JC.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function cue(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,h=u-1,{min:m,max:g}=t,b=!He(a),S=!He(s),w=!He(c),x=(g-m)/(d+1);let _=eC((g-m)/h/p)*p,O,k,D,T;if(_<1e-14&&!b&&!S)return[{value:m},{value:g}];T=Math.ceil(g/_)-Math.floor(m/_),T>h&&(_=eC(T*_/h/p)*p),He(l)||(O=Math.pow(10,l),_=Math.ceil(_*O)/O),i==="ticks"?(k=Math.floor(m/_)*_,D=Math.ceil(g/_)*_):(k=m,D=g),b&&S&&o&&Aae((s-a)/o,_/1e3)?(T=Math.round(Math.min((s-a)/_,u)),_=(s-a)/T,k=a,D=s):w?(k=b?a:k,D=S?s:D,T=c-1,_=(D-k)/T):(T=(D-k)/_,Sc(T,Math.round(T),_/1e3)?T=Math.round(T):T=Math.ceil(T));const j=Math.max(tC(_),tC(k));O=Math.pow(10,He(l)?j:l),k=Math.round(k*O)/O,D=Math.round(D*O)/O;let A=0;for(b&&(f&&k!==a?(n.push({value:a}),k<a&&A++,Sc(Math.round((k+A*_)*O)/O,a,eP(a,x,e))&&A++):k<a&&A++);A<T;++A){const C=Math.round((k+A*_)*O)/O;if(S&&C>s)break;n.push({value:C})}return S&&f&&D!==s?n.length&&Sc(n[n.length-1].value,s,eP(s,x,e))?n[n.length-1].value=s:n.push({value:s}):(!S||D===s)&&n.push({value:D}),n}function eP(e,t,{horizontal:n,minRotation:r}){const i=Qi(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class uue extends kl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return He(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(t){const l=wi(i),c=wi(o);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),t||a(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=cue(i,o);return t.bounds==="ticks"&&Tae(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Kx(t,this.chart.options.locale,this.options.ticks.format)}}class Oo extends uue{static id="linear";static defaults={ticks:{callback:lR.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=$r(t)?t:0,this.max=$r(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Qi(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Gh={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Gn=Object.keys(Gh);function tP(e,t){return e-t}function nP(e,t){if(He(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),$r(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(tu(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function rP(e,t,n,r){const i=Gn.length;for(let o=Gn.indexOf(e);o<i-1;++o){const a=Gh[Gn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return Gn[o]}return Gn[i-1]}function due(e,t,n,r,i){for(let o=Gn.length-1;o>=Gn.indexOf(n);o--){const a=Gn[o];if(Gh[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return Gn[n?Gn.indexOf(n):0]}function fue(e){for(let t=Gn.indexOf(e)+1,n=Gn.length;t<n;++t)if(Gh[Gn[t]].common)return Gn[t]}function iP(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Yx(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function pue(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function oP(e,t,n){const r=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:pue(e,r,i,n)}class aP extends kl{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new ble._date(t.adapters.date);i.init(n),_c(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:nP(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=$r(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=$r(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=Iae(i,o,a);return this._unit=n.unit||(r.autoSkip?rP(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):due(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:fue(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),oP(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=En(n,0,a),r=En(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||rP(o.minUnit,n,r,this._getLabelCapacity(n)),s=Se(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=tu(l)||l===!0,u={};let d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const h=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,s,a),p++)iP(u,f,h);return(f===r||i.bounds==="ticks"||p===1)&&iP(u,f,h),Object.keys(u).sort(tP).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return dt(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Qi(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,oP(this,[t],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(nP(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return iR(t.sort(tP))}}function Wd(e,t,n){let r=0,i=e.length-1,o,a,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Ra(e,"pos",t)),{pos:o,time:s}=e[r],{pos:a,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Ra(e,"time",t)),{time:o,pos:s}=e[r],{time:a,pos:l}=e[i]);const c=a-o;return c?s+(l-s)*(t-o)/c:s}class lpe extends aP{static id="timeseries";static defaults=aP.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Wd(n,this.min),this._tableRange=Wd(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)u=i[a+1],l=i[a-1],c=i[a],Math.round((u+l)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Wd(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Wd(this._table,r*this._tableRange+this._minPos,!0)}}const IR="label";function sP(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function hue(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function LR(e,t){e.labels=t}function FR(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:IR;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function mue(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:IR;const n={labels:[],datasets:[]};return LR(n,e.labels),FR(n,e.datasets,t),n}function gue(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,p=P.useRef(null),h=P.useRef(null),m=()=>{p.current&&(h.current=new $n(p.current,{type:a,data:mue(s,o),options:l&&{...l},plugins:c}),sP(t,h.current))},g=()=>{sP(t,null),h.current&&(h.current.destroy(),h.current=null)};return P.useEffect(()=>{!i&&h.current&&l&&hue(h.current,l)},[i,l]),P.useEffect(()=>{!i&&h.current&&LR(h.current.config.data,s.labels)},[i,s.labels]),P.useEffect(()=>{!i&&h.current&&s.datasets&&FR(h.current.config.data,s.datasets,o)},[i,s.datasets]),P.useEffect(()=>{h.current&&(i?(g(),setTimeout(m)):h.current.update(d))},[i,l,s.labels,s.datasets,d]),P.useEffect(()=>{h.current&&(g(),setTimeout(m))},[a]),P.useEffect(()=>(m(),()=>g()),[]),P.createElement("canvas",{ref:p,role:"img",height:n,width:r,...f},u)}const vue=P.forwardRef(gue);function a1(e,t){return $n.register(t),P.forwardRef((n,r)=>P.createElement(vue,{...n,ref:r,type:e}))}const s1=a1("line",yle),Al=a1("bar",mle),l1=a1("doughnut",vle);$n.register(r1,Yr,Jr);const yue={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},$R=({title:e="Tickets",icon:t,firstLabel:n="First",firstValue:r=0,firstColor:i="#12B981",secondLabel:o="Second",secondValue:a=0,secondColor:s="#AB0000",growthPercentage:l="+0%",growthText:c="Compared to last month",totalLabel:u="Total",centerTopColor:d="#0F172A",centerBottomColor:f="#64748B",widgetType:p="",data:h})=>{const m=h?.title??e,g=h?.icon??t,b=h?.firstLabel??n,S=Number(h?.firstValue??r??0),w=h?.firstColor??i,x=h?.secondLabel??o,_=Number(h?.secondValue??a??0),O=h?.secondColor??s,k=h?.growthPercentage??l??"+0%",D=h?.growthText??c,T=h?.totalLabel??u,j=h?.widgetType??p,A=S+_,C={labels:[b,x],datasets:[{data:[S,_],backgroundColor:[w,O],borderWidth:2,hoverOffset:4}]},N={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:V=>`${V.label}: ${V.parsed}`},displayColors:!1},centerText:{top:`${A}`,bottom:T,topSize:20,bottomSize:10,topColor:d,bottomColor:f}}},M=[{label:b,value:S,color:w},{label:x,value:_,color:O}],I=k.toString().includes("+"),L=k.toString().includes("-"),$=I?"#1FA05B":"#AB0000";return v.jsx(Ie,{title:m,icon:g,className:j==="commercial"?"h-[362px]":"h-[238px]",children:v.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[v.jsxs("div",{className:"col-span-5 space-y-[16px]",children:[M.map((V,W)=>v.jsxs("div",{children:[v.jsx("div",{className:`text-[12px] text-[#64748B] ${j==="commercial"?"mb-[8px]":""}`,children:V.label}),v.jsx("div",{className:"text-[28px] leading-[32px]",style:{color:V.color},children:V.value})]},W)),v.jsxs("div",{className:`text-[10px] flex gap-[4px] ${j==="commercial"?"mt-[20px]":""} items-center`,style:{color:$},children:[I&&v.jsx(qs,{}),L&&v.jsx(Ks,{}),v.jsx("div",{children:k.replace("+","").replace("-","")}),v.jsx("div",{className:"text-[#64748B] text-[10px] ml-[4px]",children:D})]})]}),v.jsx("div",{className:"col-span-7",children:v.jsx("div",{className:`${j==="commercial"?"h-[260px] w-[263px]":"h-[158px] w-[158px]"} ml-auto mr-2`,children:v.jsx(l1,{data:C,options:N,plugins:[yue]})})})]})})},lP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return v.jsxs("div",{className:"flex flex-col items-start",children:[v.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:v.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),v.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),v.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},cP=({title:e,value:t,suffix:n,valueClass:r=""})=>v.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] h-[98px] p-4 flex flex-col justify-center",children:[v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-1",children:e}),v.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&v.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),bue=({data:e,totalUnits:t=847,occupiedUnits:n=756,ownerCount:r=700,tenantCount:i=56,avgResidents:o=4.4,avgLeaseMonths:a=18})=>{const s=Number(e?.totalUnits??t??0),l=Number(e?.occupiedUnits??n??0),c=Number(e?.ownerCount??r??0),u=Number(e?.tenantCount??i??0),d=e?.avgResidents??o,f=e?.avgLeaseMonths??a,p=c+u;return v.jsxs("div",{children:[v.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[v.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[v.jsx(xb,{className:"h-6 w-6 text-[#329DFF]"}),v.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),v.jsxs("div",{className:"flex items-center justify-between gap-",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:l}),v.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",s]})]})]}),v.jsxs("div",{className:"flex items-end",children:[v.jsx(lP,{value:c,total:p,colorClass:"bg-[#8B5CF6]",label:"Owner"}),v.jsx(lP,{value:u,total:p,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),v.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[v.jsx(cP,{title:"Avg Residents Per Unit",value:d,valueClass:"text-[#8B5CF6]"}),v.jsx(cP,{title:"Avg Lease Period",value:f,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};$n.register(r1,Yr,Jr);const xue={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},wue=({data:e,ownerCount:t=1e3,tenantCount:n=200,nonResidingOwners:r=26,growthPct:i="+9.1%"})=>{const o=Number(e?.ownerCount??t??0),a=Number(e?.tenantCount??n??0),s=Number(e?.nonResidingOwners??r??0),l=e?.growthPct??i,c=Math.max(o-s,0),u=o+a,d={labels:["Owners","Tenants","Non-residing Owner"],datasets:[{data:[c,a,s],backgroundColor:["#3C81F6","#08B6D4","#8B5CF6"],borderWidth:2,hoverOffset:4}]},f={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:p=>`${p.label}: ${p.parsed}`},displayColors:!1},centerText:{top:`${u}`,bottom:"Total Members",topSize:20,bottomSize:10}}};return v.jsx(Ie,{title:"Resident Overview",icon:v.jsx(Gk,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:v.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[v.jsxs("div",{className:"col-span-5",children:[v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),v.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:o})]}),v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),v.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:a})]}),v.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-2 items-center",children:[l," ",v.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),v.jsx("div",{className:"col-span-7",children:v.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:v.jsx(l1,{data:d,options:f,plugins:[xue]})})})]})})};$n.register(Eo,Oo,Dl,Yr,Jr);const _ue=({data:e,blocks:t=[{name:"Block A",owner:110,rented:24,vacant:8},{name:"Block B",owner:95,rented:18,vacant:6},{name:"Block C",owner:65,rented:12,vacant:18},{name:"Block D",owner:78,rented:16,vacant:30}]})=>{const n=Array.isArray(e?.blocks)&&e.blocks.length>0?e.blocks:Array.isArray(e)&&e.length>0?e:t,r=n.map(c=>c.name),i=n.map(c=>Number(c.owner??0)),o=n.map(c=>Number(c.rented??0)),a=n.map(c=>Number(c.vacant??0)),s={labels:r,datasets:[{label:"Owner",data:i,backgroundColor:"#3C81F6",barThickness:40},{label:"",data:i.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Rented",data:o,backgroundColor:"#8B5CF6",barThickness:40},{label:"",data:o.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Vacant",data:a,backgroundColor:"#08B6D4",barThickness:40}]},l={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot",padding:20}},tooltip:{callbacks:{label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,suggestedMax:180,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:20}}}};return v.jsx(Ie,{title:"Block-wise Occupancy",period:v.jsx(Wr,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:v.jsx(Al,{data:s,options:l})})};$n.register(Eo,Oo,o1,i1,Yr,Jr);const Sue=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},Eue=({data:e,labels:t=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:n=[24,27,20,26,23],moveOut:r=[12,17,8,5,16]})=>{const i=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:t,o=Array.isArray(e?.moveIn)&&e.moveIn.length>0?e.moveIn:n,a=Array.isArray(e?.moveOut)&&e.moveOut.length>0?e.moveOut:r,s={labels:i,datasets:[{label:"Move-in",data:o,borderColor:"#12B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#12B981",pointStyle:"rectRot",fill:!1},{label:"Move-out",data:a,borderColor:"#8B5CF6",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#8B5CF6",pointStyle:"rectRot",fill:!1}]},l={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:c=>Sue(c[0].label),label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return v.jsx(Ie,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:v.jsx(Wr,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:v.jsx(s1,{data:s,options:l})})};$n.register(Eo,Oo,o1,i1,Yr,Jr);const Oue=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},Cue=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],Pue=[24,27,20,26,23],kue=[4,17,8,5,16],BR=({data:e,labels:t,moveIn:n,moveOut:r})=>{const i=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Array.isArray(t)&&t.length>0?t:Cue,o=Array.isArray(e?.moveIn)&&e.moveIn.length>0?e.moveIn:Array.isArray(n)&&n.length>0?n:Pue,a=Array.isArray(e?.moveOut)&&e.moveOut.length>0?e.moveOut:Array.isArray(r)&&r.length>0?r:kue,s={labels:i,datasets:[{label:"Income",data:o,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Expenditure",data:a,borderColor:"#AB0000",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#AB0000",pointStyle:"rectRot",fill:!1}]},l={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:c=>Oue(c[0].label),label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return v.jsx(s1,{data:s,options:l})};function uP({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return v.jsxs("div",{className:`rounded-lg p-4 ${r} border border-[#EBEBEB] h-[126px]`,children:[v.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),v.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[v.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),v.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function Due({data:e={}}){const t=e?.incomeCard??{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"},n=e?.expenditureCard??{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"};return v.jsxs(Ie,{title:"Accounting",className:"w-full h-[523px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[v.jsx(uP,{...t}),v.jsx(uP,{...n})]}),v.jsx("div",{className:"h-[254px] mt-[35.5px]",children:v.jsx(BR,{data:e?.incomeExpenditure})})]})}$n.register(Eo,Oo,Dl,Yr,Jr);const Aue=["Maintenance","Security","Utilities","Housekeeping","Administration","Others"],Tue=[55e3,56e3,64e3,38e3,54e3,65e3],Mue=[63e3,48e3,51300,28e3,42e3,35e3],Nue=({data:e={}})=>{const t=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Aue,n=Array.isArray(e?.budgetValues)&&e.budgetValues.length>0?e.budgetValues:Tue,r=Array.isArray(e?.actualValues)&&e.actualValues.length>0?e.actualValues:Mue,i={labels:t,datasets:[{label:"Budget",data:n,backgroundColor:"#93C5FD",barThickness:60},{label:"Actual",data:r,backgroundColor:"#3B82F6",barThickness:60}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:a=>t[a[0].dataIndex],label:a=>{const s=a.parsed.y;return`${a.dataset.label}: AED ${(s/1e3).toFixed(1)}K`}}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:a=>`${a/1e3}K`}}}};return v.jsx(Ie,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:v.jsx(Al,{data:i,options:o})})},jue=[{title:"Primary Account",amount:285e4,subtitle:"Savings"},{title:"Emergency Fund",amount:12e5,subtitle:"Fixed deposit"},{title:"Maintenance Fund",amount:68e4,subtitle:"Current"}],Rue=({data:e})=>{const t=Array.isArray(e?.accounts)&&e.accounts.length>0?e.accounts:Array.isArray(e)&&e.length>0?e:jue,n=t.reduce((i,o)=>i+o.amount,0),r=i=>i>=1e6?`AED ${(i/1e6).toFixed(2)}M`:i>=1e3?`AED ${(i/1e3).toFixed(1)}K`:`AED ${i}`;return v.jsxs(Ie,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((i,o)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:i.title}),v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:i?.subtitle})]}),v.jsx("div",{className:"flex flex-col items-end",children:v.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:r(i.amount)})})]},o))}),v.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-3",children:[v.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),v.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:r(n)})]})]})};$n.register(Eo,Oo,Dl,Yr,Jr);const Iue=[{label:"Current Month",value:13e3,units:18},{label:"1-3 Months",value:9400,units:12},{label:"3-6 Months",value:8800,units:18},{label:"6+ Months",value:7200,units:6}],Lue=({data:e})=>{const t=Array.isArray(e?.items)&&e.items.length>0?e.items:Array.isArray(e)&&e.length>0?e:Iue,n=t.map(s=>s.label),r=t.map(s=>Number(s.value??0)),i=t.map(s=>Number(s.units??0)),o={labels:n,datasets:[{label:"Due",data:r,backgroundColor:"#EF4444",barThickness:60}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:s=>n[s[0].dataIndex],label:s=>`Due: AED ${(s.parsed.y/1e3).toFixed(1)}K`,afterLabel:s=>`Units Count: ${i[s.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:s=>`${s/1e3}K`}}}};return v.jsxs(Ie,{title:"Dues Ageing",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[v.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:n.map((s,l)=>v.jsx("div",{className:"p-2 rounded-lg bg-slate-50",children:v.jsxs("div",{className:"flex justify-between items-start",children:[v.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:s}),v.jsxs("div",{className:"text-right",children:[v.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(r[l]/1e3).toFixed(1),"K"]}),v.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[i[l]," Units"]})]})]})},s))}),v.jsx("div",{className:"h-[192px]",children:v.jsx(Al,{data:o,options:a})})]})};$n.register(r1,Yr,Jr);const Fue=[{label:"Maintenance",value:45e4,color:"#08B6D4"},{label:"Utilities",value:32e4,color:"#8B5CF6"},{label:"Security",value:28e4,color:"#EF4444"},{label:"Administration",value:18e4,color:"#F69E0A"},{label:"Others",value:12e4,color:"#12B981"}],$ue=({data:e})=>{const t=Array.isArray(e?.items)&&e.items.length>0?e.items:Array.isArray(e)&&e.length>0?e:Fue,n=t.map(l=>l.label),r=t.map(l=>Number(l.value??0)),i=t.map(l=>l.color),o={labels:n,datasets:[{label:"Expenses",data:r,backgroundColor:i,borderColor:"#FFFFFF",borderWidth:2,cutout:"70%"}]},a=r.reduce((l,c)=>l+c,0),s={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:10,callbacks:{label:l=>`${l.label}: AED ${l.formattedValue}`}}}};return v.jsxs(Ie,{title:"Expense Categories",className:"w-full h-[523px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[v.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[v.jsx(l1,{data:o,options:s}),v.jsxs("div",{className:"absolute text-center",children:[v.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(a/1e6).toFixed(2),"M"]}),v.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),v.jsx("div",{className:"space-y-2",children:n.map((l,c)=>v.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[v.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[v.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:o.datasets[0].backgroundColor[c]}}),l]}),v.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(r[c]/1e3).toFixed(0),"K"]})]},l))})]})},Bue=[{name:"Gym Equipment",value:1e6,color:"#08B6D4"},{name:"Security",value:8e5,color:"#EF4444"},{name:"Others",value:6e5,color:"#F59E0B"},{name:"Pool Maintenance",value:7e5,color:"#8B5CF6"},{name:"Administration",value:52e4,color:"#10B981"}];function Wue({data:e}){const t=Array.isArray(e)&&e.length>0?e:Bue,n=t.reduce((r,i)=>r+Number(i.value??0),0);return v.jsx(Ie,{title:"Asset Value Breakdown",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((r,i)=>v.jsx(kn,{fill:r.color},`cell-${i}`))}),v.jsx(Vt,{formatter:r=>`AED ${r.toLocaleString()}`})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:["AED ",(n/1e6).toFixed(2),"M"]}),v.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),v.jsxs("div",{className:"flex justify-between w-full px-4 sm:px-8 mt-4 text-[14px]",children:[v.jsx("div",{className:"flex flex-col gap-[8px]",children:t.slice(0,3).map(r=>v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:r.color}}),v.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:r.name})]},r.name))}),v.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:t.slice(3).map(r=>v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:r.color}}),v.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:r.name})]},r.name))})]})]})})}$n.register(Eo,Oo,Dl,Yr,Jr);const zue=[{label:"Gym",value:13e3,units:18},{label:"Parking",value:9400,units:12},{label:"Swimming Pool",value:8800,units:18},{label:"Community Hall",value:7200,units:6},{label:"Tennis Court",value:6e3,units:10}],Vue=({data:e})=>{const t=Array.isArray(e)&&e.length>0?e:zue,n=t.map(s=>s.label),r=t.map(s=>Number(s.value??0)),i=t.map(s=>Number(s.units??0)),o={labels:n,datasets:[{label:"Due",data:r,backgroundColor:"#8B5CF6",barThickness:60}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:s=>n[s[0].dataIndex],label:s=>`Due: AED ${(s.parsed.y/1e3).toFixed(1)}K`,afterLabel:s=>`Units Count: ${i[s.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:s=>`${s/1e3}K`}}}};return v.jsx(Ie,{title:"Revenue by Category",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:v.jsx(Al,{data:o,options:a})})};function Hue(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 5l0 2"},child:[]},{tag:"path",attr:{d:"M15 11l0 2"},child:[]},{tag:"path",attr:{d:"M15 17l0 2"},child:[]},{tag:"path",attr:{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2"},child:[]}]})(e)}function Yue(e){return Ze({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M855.7 210.8l-42.4-42.4a8.03 8.03 0 0 0-11.3 0L168.3 801.9a8.03 8.03 0 0 0 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0L855.6 222c3.2-3 3.2-8.1.1-11.2zM304 448c79.4 0 144-64.6 144-144s-64.6-144-144-144-144 64.6-144 144 64.6 144 144 144zm0-216c39.7 0 72 32.3 72 72s-32.3 72-72 72-72-32.3-72-72 32.3-72 72-72zm416 344c-79.4 0-144 64.6-144 144s64.6 144 144 144 144-64.6 144-144-64.6-144-144-144zm0 216c-39.7 0-72-32.3-72-72s32.3-72 72-72 72 32.3 72 72-32.3 72-72 72z"},child:[]}]})(e)}function Uue({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsxs(Ie,{title:e,icon:v.jsx("div",{className:"h-6 w-6 grid place-items-center",children:v.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[v.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[v.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-slate-500",children:r})]})]})}const Kue=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:qk,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Yue,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hue,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:Xk,iconColor:"text-[#DBB467]"}];function que({data:e}){const t=Array.isArray(e)&&e.length>0?e:Kue;return v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(Uue,{...n},r))})}/**
|
|
282
|
+
`):e}function Jce(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function KC(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Zn(t.bodyFont),c=Zn(t.titleFont),u=Zn(t.footerFont),d=o.length,f=i.length,p=r.length,h=Qr(t.padding);let m=h.height,g=0,b=r.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;m+=p*x+(b-p)*l.lineHeight+(b-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const w=function(x){g=Math.max(g,n.measureText(x).width+S)};return n.save(),n.font=c.string,Ge(e.title,w),n.font=l.string,Ge(e.beforeBody.concat(e.afterBody),w),S=t.displayColors?a+2+t.boxPadding:0,Ge(r,x=>{Ge(x.before,w),Ge(x.lines,w),Ge(x.after,w)}),S=0,n.font=u.string,Ge(e.footer,w),n.restore(),g+=h.width,{width:g,height:m}}function eue(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function tue(e,t,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&i+o+a>t.width||e==="right"&&i-o-a<0)return!0}function nue(e,t,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),tue(c,e,t,n)&&(c="center"),c}function qC(e,t,n){const r=n.yAlign||t.yAlign||eue(e,n);return{xAlign:n.xAlign||t.xAlign||nue(e,t,n,r),yAlign:r}}function rue(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function iue(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function GC(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=Is(a);let h=rue(t,s);const m=iue(t,l,c);return l==="center"?s==="left"?h+=c:s==="right"&&(h-=c):s==="left"?h-=Math.max(u,f)+i:s==="right"&&(h+=Math.max(d,p)+i),{x:En(h,0,r.width-t.width),y:En(m,0,r.height-t.height)}}function Bd(e,t,n){const r=Qr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function XC(e){return ii([],Bi(e))}function oue(e,t,n){return ls(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function QC(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const RR={beforeTitle:Fi,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Fi,beforeBody:Fi,beforeLabel:Fi,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return He(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Fi,afterBody:Fi,beforeFooter:Fi,footer:Fi,afterFooter:Fi};function Vn(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?RR[t].call(n,r):i}class ZC extends sa{static positioners=hc;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new bR(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=oue(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Vn(r,"beforeTitle",this,t),o=Vn(r,"title",this,t),a=Vn(r,"afterTitle",this,t);let s=[];return s=ii(s,Bi(i)),s=ii(s,Bi(o)),s=ii(s,Bi(a)),s}getBeforeBody(t,n){return XC(Vn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ge(t,o=>{const a={before:[],lines:[],after:[]},s=QC(r,o);ii(a.before,Bi(Vn(s,"beforeLabel",this,o))),ii(a.lines,Vn(s,"label",this,o)),ii(a.after,Bi(Vn(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return XC(Vn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Vn(r,"beforeFooter",this,t),o=Vn(r,"footer",this,t),a=Vn(r,"afterFooter",this,t);let s=[];return s=ii(s,Bi(i)),s=ii(s,Bi(o)),s=ii(s,Bi(a)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(Jce(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Ge(s,u=>{const d=QC(t.callbacks,u);i.push(Vn(d,"labelColor",this,u)),o.push(Vn(d,"labelPointStyle",this,u)),a.push(Vn(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const s=hc[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=KC(this,r),c=Object.assign({},s,l),u=qC(this.chart,r,c),d=GC(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Is(s),{x:f,y:p}=t,{width:h,height:m}=n;let g,b,S,w,x,_;return o==="center"?(x=p+m/2,i==="left"?(g=f,b=g-a,w=x+a,_=x-a):(g=f+h,b=g+a,w=x-a,_=x+a),S=g):(i==="left"?b=f+Math.max(l,u)+a:i==="right"?b=f+h-Math.max(c,d)-a:b=this.caretX,o==="top"?(w=p,x=w-a,g=b-a,S=b+a):(w=p+m,x=w+a,g=b+a,S=b-a),_=w),{x1:g,x2:b,x3:S,y1:w,y2:x,y3:_}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=Ls(r.rtl,this.x,this.width);for(t.x=Bd(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=Zn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=Zn(o.bodyFont),d=Bd(this,"left",o),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,h=n.y+p;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},g=i.leftForLtr(f,c)+c/2,b=h+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,By(t,m,g,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,By(t,m,g,b)}else{t.lineWidth=Te(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=i.leftForLtr(f,c),g=i.leftForLtr(i.xPlus(f,1),c-2),b=Is(a.borderRadius);Object.values(b).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,xp(t,{x:m,y:h,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),xp(t,{x:g,y:h+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,h,c,l),t.strokeRect(m,h,c,l),t.fillStyle=a.backgroundColor,t.fillRect(g,h+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Zn(r.bodyFont);let f=d.lineHeight,p=0;const h=Ls(r.rtl,this.x,this.width),m=function(D){n.fillText(D,h.x(t.x+p),t.y+f/2),t.y+=f+o},g=h.textAlign(a);let b,S,w,x,_,O,k;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Bd(this,g,r),n.fillStyle=r.bodyColor,Ge(this.beforeBody,m),p=s&&g!=="right"?a==="center"?c/2+u:c+2+u:0,x=0,O=i.length;x<O;++x){for(b=i[x],S=this.labelTextColors[x],n.fillStyle=S,Ge(b.before,m),w=b.lines,s&&w.length&&(this._drawColorBox(n,t,x,h,r),f=Math.max(d.lineHeight,l)),_=0,k=w.length;_<k;++_)m(w[_]),f=d.lineHeight;Ge(b.after,m)}p=0,f=d.lineHeight,Ge(this.afterBody,m),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=Ls(r.rtl,this.x,this.width);for(t.x=Bd(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=Zn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:h}=Is(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+c-f,l),n.quadraticCurveTo(s+c,l,s+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-h),n.quadraticCurveTo(s+c,l+u,s+c-h,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=hc[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=KC(this,t),l=Object.assign({},a,this._size),c=qC(n,t,l),u=GC(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Qr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),gR(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),vR(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),o=!gp(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),s=this._positionChanged(a,t),l=n||!gp(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,a=hc[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var Yr={id:"tooltip",_element:ZC,positioners:hc,afterInit(e,t,n){n&&(e.tooltip=new ZC({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:RR},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const aue=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function sue(e,t,n,r){const i=e.indexOf(t);if(i===-1)return aue(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const lue=(e,t)=>e===null?null:En(Math.round(e),0,t);function JC(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Eo extends kl{static id="category";static defaults={ticks:{callback:JC}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(He(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:sue(r,t,Se(n,t),this._addedLabels),lue(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)i.push({value:a});return i}getLabelForValue(t){return JC.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function cue(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,h=u-1,{min:m,max:g}=t,b=!He(a),S=!He(s),w=!He(c),x=(g-m)/(d+1);let _=eC((g-m)/h/p)*p,O,k,D,T;if(_<1e-14&&!b&&!S)return[{value:m},{value:g}];T=Math.ceil(g/_)-Math.floor(m/_),T>h&&(_=eC(T*_/h/p)*p),He(l)||(O=Math.pow(10,l),_=Math.ceil(_*O)/O),i==="ticks"?(k=Math.floor(m/_)*_,D=Math.ceil(g/_)*_):(k=m,D=g),b&&S&&o&&Aae((s-a)/o,_/1e3)?(T=Math.round(Math.min((s-a)/_,u)),_=(s-a)/T,k=a,D=s):w?(k=b?a:k,D=S?s:D,T=c-1,_=(D-k)/T):(T=(D-k)/_,Sc(T,Math.round(T),_/1e3)?T=Math.round(T):T=Math.ceil(T));const j=Math.max(tC(_),tC(k));O=Math.pow(10,He(l)?j:l),k=Math.round(k*O)/O,D=Math.round(D*O)/O;let A=0;for(b&&(f&&k!==a?(n.push({value:a}),k<a&&A++,Sc(Math.round((k+A*_)*O)/O,a,eP(a,x,e))&&A++):k<a&&A++);A<T;++A){const C=Math.round((k+A*_)*O)/O;if(S&&C>s)break;n.push({value:C})}return S&&f&&D!==s?n.length&&Sc(n[n.length-1].value,s,eP(s,x,e))?n[n.length-1].value=s:n.push({value:s}):(!S||D===s)&&n.push({value:D}),n}function eP(e,t,{horizontal:n,minRotation:r}){const i=Qi(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class uue extends kl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return He(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(t){const l=wi(i),c=wi(o);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),t||a(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=cue(i,o);return t.bounds==="ticks"&&Tae(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Kx(t,this.chart.options.locale,this.options.ticks.format)}}class Oo extends uue{static id="linear";static defaults={ticks:{callback:lR.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=$r(t)?t:0,this.max=$r(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Qi(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Gh={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Gn=Object.keys(Gh);function tP(e,t){return e-t}function nP(e,t){if(He(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),$r(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(tu(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function rP(e,t,n,r){const i=Gn.length;for(let o=Gn.indexOf(e);o<i-1;++o){const a=Gh[Gn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return Gn[o]}return Gn[i-1]}function due(e,t,n,r,i){for(let o=Gn.length-1;o>=Gn.indexOf(n);o--){const a=Gn[o];if(Gh[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return Gn[n?Gn.indexOf(n):0]}function fue(e){for(let t=Gn.indexOf(e)+1,n=Gn.length;t<n;++t)if(Gh[Gn[t]].common)return Gn[t]}function iP(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Yx(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function pue(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function oP(e,t,n){const r=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:pue(e,r,i,n)}class aP extends kl{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new ble._date(t.adapters.date);i.init(n),_c(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:nP(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=$r(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=$r(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=Iae(i,o,a);return this._unit=n.unit||(r.autoSkip?rP(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):due(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:fue(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),oP(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=En(n,0,a),r=En(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||rP(o.minUnit,n,r,this._getLabelCapacity(n)),s=Se(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=tu(l)||l===!0,u={};let d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const h=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,s,a),p++)iP(u,f,h);return(f===r||i.bounds==="ticks"||p===1)&&iP(u,f,h),Object.keys(u).sort(tP).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return dt(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Qi(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,oP(this,[t],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(nP(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return iR(t.sort(tP))}}function Wd(e,t,n){let r=0,i=e.length-1,o,a,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Ra(e,"pos",t)),{pos:o,time:s}=e[r],{pos:a,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Ra(e,"time",t)),{time:o,pos:s}=e[r],{time:a,pos:l}=e[i]);const c=a-o;return c?s+(l-s)*(t-o)/c:s}class lpe extends aP{static id="timeseries";static defaults=aP.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Wd(n,this.min),this._tableRange=Wd(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)u=i[a+1],l=i[a-1],c=i[a],Math.round((u+l)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Wd(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Wd(this._table,r*this._tableRange+this._minPos,!0)}}const IR="label";function sP(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function hue(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function LR(e,t){e.labels=t}function FR(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:IR;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function mue(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:IR;const n={labels:[],datasets:[]};return LR(n,e.labels),FR(n,e.datasets,t),n}function gue(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,p=P.useRef(null),h=P.useRef(null),m=()=>{p.current&&(h.current=new $n(p.current,{type:a,data:mue(s,o),options:l&&{...l},plugins:c}),sP(t,h.current))},g=()=>{sP(t,null),h.current&&(h.current.destroy(),h.current=null)};return P.useEffect(()=>{!i&&h.current&&l&&hue(h.current,l)},[i,l]),P.useEffect(()=>{!i&&h.current&&LR(h.current.config.data,s.labels)},[i,s.labels]),P.useEffect(()=>{!i&&h.current&&s.datasets&&FR(h.current.config.data,s.datasets,o)},[i,s.datasets]),P.useEffect(()=>{h.current&&(i?(g(),setTimeout(m)):h.current.update(d))},[i,l,s.labels,s.datasets,d]),P.useEffect(()=>{h.current&&(g(),setTimeout(m))},[a]),P.useEffect(()=>(m(),()=>g()),[]),P.createElement("canvas",{ref:p,role:"img",height:n,width:r,...f},u)}const vue=P.forwardRef(gue);function a1(e,t){return $n.register(t),P.forwardRef((n,r)=>P.createElement(vue,{...n,ref:r,type:e}))}const s1=a1("line",yle),Al=a1("bar",mle),l1=a1("doughnut",vle);$n.register(r1,Yr,Jr);const yue={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},$R=({title:e="Tickets",icon:t,firstLabel:n="First",firstValue:r=0,firstColor:i="#12B981",secondLabel:o="Second",secondValue:a=0,secondColor:s="#AB0000",growthPercentage:l="+0%",growthText:c="Compared to last month",totalLabel:u="Total",centerTopColor:d="#0F172A",centerBottomColor:f="#64748B",widgetType:p="",data:h})=>{const m=h?.title??e,g=h?.icon??t,b=h?.firstLabel??n,S=Number(h?.firstValue??r??0),w=h?.firstColor??i,x=h?.secondLabel??o,_=Number(h?.secondValue??a??0),O=h?.secondColor??s,k=h?.growthPercentage??l??"+0%",D=h?.growthText??c,T=h?.totalLabel??u,j=h?.widgetType??p,A=S+_,C={labels:[b,x],datasets:[{data:[S,_],backgroundColor:[w,O],borderWidth:2,hoverOffset:4}]},N={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:V=>`${V.label}: ${V.parsed}`},displayColors:!1},centerText:{top:`${A}`,bottom:T,topSize:20,bottomSize:10,topColor:d,bottomColor:f}}},M=[{label:b,value:S,color:w},{label:x,value:_,color:O}],I=k.toString().includes("+"),L=k.toString().includes("-"),$=I?"#1FA05B":"#AB0000";return v.jsx(Ie,{title:m,icon:g,className:j==="commercial"?"h-[362px]":"h-[238px]",children:v.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[v.jsxs("div",{className:"col-span-5 space-y-[16px]",children:[M.map((V,W)=>v.jsxs("div",{children:[v.jsx("div",{className:`text-[12px] text-[#64748B] ${j==="commercial"?"mb-[8px]":""}`,children:V.label}),v.jsx("div",{className:"text-[28px] leading-[32px]",style:{color:V.color},children:V.value})]},W)),v.jsxs("div",{className:`text-[10px] flex gap-[4px] ${j==="commercial"?"mt-[20px]":""} items-center`,style:{color:$},children:[I&&v.jsx(qs,{}),L&&v.jsx(Ks,{}),v.jsx("div",{children:k.replace("+","").replace("-","")}),v.jsx("div",{className:"text-[#64748B] text-[10px] ml-[4px]",children:D})]})]}),v.jsx("div",{className:"col-span-7",children:v.jsx("div",{className:`${j==="commercial"?"h-[260px] w-[263px]":"h-[158px] w-[158px]"} ml-auto mr-2`,children:v.jsx(l1,{data:C,options:N,plugins:[yue]})})})]})})},lP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return v.jsxs("div",{className:"flex flex-col items-start",children:[v.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:v.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),v.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),v.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},cP=({title:e,value:t,suffix:n,valueClass:r=""})=>v.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] h-[98px] p-[16px] flex flex-col justify-center",children:[v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-[4px]",children:e}),v.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&v.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),bue=({data:e,totalUnits:t=847,occupiedUnits:n=756,ownerCount:r=700,tenantCount:i=56,avgResidents:o=4.4,avgLeaseMonths:a=18})=>{const s=Number(e?.totalUnits??t??0),l=Number(e?.occupiedUnits??n??0),c=Number(e?.ownerCount??r??0),u=Number(e?.tenantCount??i??0),d=e?.avgResidents??o,f=e?.avgLeaseMonths??a,p=c+u;return v.jsxs("div",{children:[v.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[v.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[v.jsx(xb,{className:"h-6 w-6 text-[#329DFF]"}),v.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),v.jsxs("div",{className:"flex items-center justify-between gap-",children:[v.jsxs("div",{children:[v.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),v.jsxs("div",{className:"flex items-center gap-[4px]",children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:l}),v.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",s]})]})]}),v.jsxs("div",{className:"flex items-end",children:[v.jsx(lP,{value:c,total:p,colorClass:"bg-[#8B5CF6]",label:"Owner"}),v.jsx(lP,{value:u,total:p,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),v.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[v.jsx(cP,{title:"Avg Residents Per Unit",value:d,valueClass:"text-[#8B5CF6]"}),v.jsx(cP,{title:"Avg Lease Period",value:f,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};$n.register(r1,Yr,Jr);const xue={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},wue=({data:e,ownerCount:t=1e3,tenantCount:n=200,nonResidingOwners:r=26,growthPct:i="+9.1%"})=>{const o=Number(e?.ownerCount??t??0),a=Number(e?.tenantCount??n??0),s=Number(e?.nonResidingOwners??r??0),l=e?.growthPct??i,c=Math.max(o-s,0),u=o+a,d={labels:["Owners","Tenants","Non-residing Owner"],datasets:[{data:[c,a,s],backgroundColor:["#3C81F6","#08B6D4","#8B5CF6"],borderWidth:2,hoverOffset:4}]},f={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:p=>`${p.label}: ${p.parsed}`},displayColors:!1},centerText:{top:`${u}`,bottom:"Total Members",topSize:20,bottomSize:10}}};return v.jsx(Ie,{title:"Resident Overview",icon:v.jsx(Gk,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:v.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[v.jsxs("div",{className:"col-span-5",children:[v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),v.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:o})]}),v.jsxs("div",{children:[v.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),v.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:a})]}),v.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center",children:[l," ",v.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),v.jsx("div",{className:"col-span-7",children:v.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:v.jsx(l1,{data:d,options:f,plugins:[xue]})})})]})})};$n.register(Eo,Oo,Dl,Yr,Jr);const _ue=({data:e,blocks:t=[{name:"Block A",owner:110,rented:24,vacant:8},{name:"Block B",owner:95,rented:18,vacant:6},{name:"Block C",owner:65,rented:12,vacant:18},{name:"Block D",owner:78,rented:16,vacant:30}]})=>{const n=Array.isArray(e?.blocks)&&e.blocks.length>0?e.blocks:Array.isArray(e)&&e.length>0?e:t,r=n.map(c=>c.name),i=n.map(c=>Number(c.owner??0)),o=n.map(c=>Number(c.rented??0)),a=n.map(c=>Number(c.vacant??0)),s={labels:r,datasets:[{label:"Owner",data:i,backgroundColor:"#3C81F6",barThickness:40},{label:"",data:i.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Rented",data:o,backgroundColor:"#8B5CF6",barThickness:40},{label:"",data:o.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Vacant",data:a,backgroundColor:"#08B6D4",barThickness:40}]},l={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot",padding:20}},tooltip:{callbacks:{label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,suggestedMax:180,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:20}}}};return v.jsx(Ie,{title:"Block-wise Occupancy",period:v.jsx(Wr,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:v.jsx(Al,{data:s,options:l})})};$n.register(Eo,Oo,o1,i1,Yr,Jr);const Sue=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},Eue=({data:e,labels:t=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:n=[24,27,20,26,23],moveOut:r=[12,17,8,5,16]})=>{const i=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:t,o=Array.isArray(e?.moveIn)&&e.moveIn.length>0?e.moveIn:n,a=Array.isArray(e?.moveOut)&&e.moveOut.length>0?e.moveOut:r,s={labels:i,datasets:[{label:"Move-in",data:o,borderColor:"#12B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#12B981",pointStyle:"rectRot",fill:!1},{label:"Move-out",data:a,borderColor:"#8B5CF6",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#8B5CF6",pointStyle:"rectRot",fill:!1}]},l={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:c=>Sue(c[0].label),label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return v.jsx(Ie,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:v.jsx(Wr,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:v.jsx(s1,{data:s,options:l})})};$n.register(Eo,Oo,o1,i1,Yr,Jr);const Oue=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},Cue=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],Pue=[24,27,20,26,23],kue=[4,17,8,5,16],BR=({data:e,labels:t,moveIn:n,moveOut:r})=>{const i=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Array.isArray(t)&&t.length>0?t:Cue,o=Array.isArray(e?.moveIn)&&e.moveIn.length>0?e.moveIn:Array.isArray(n)&&n.length>0?n:Pue,a=Array.isArray(e?.moveOut)&&e.moveOut.length>0?e.moveOut:Array.isArray(r)&&r.length>0?r:kue,s={labels:i,datasets:[{label:"Income",data:o,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Expenditure",data:a,borderColor:"#AB0000",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#AB0000",pointStyle:"rectRot",fill:!1}]},l={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:c=>Oue(c[0].label),label:c=>`${c.dataset.label}: ${c.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return v.jsx(s1,{data:s,options:l})};function uP({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return v.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} border border-[#EBEBEB] h-[126px]`,children:[v.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),v.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[v.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),v.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function Due({data:e={}}){const t=e?.incomeCard??{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"},n=e?.expenditureCard??{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"};return v.jsxs(Ie,{title:"Accounting",className:"w-full h-[523px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[v.jsx(uP,{...t}),v.jsx(uP,{...n})]}),v.jsx("div",{className:"h-[254px] mt-[35.5px]",children:v.jsx(BR,{data:e?.incomeExpenditure})})]})}$n.register(Eo,Oo,Dl,Yr,Jr);const Aue=["Maintenance","Security","Utilities","Housekeeping","Administration","Others"],Tue=[55e3,56e3,64e3,38e3,54e3,65e3],Mue=[63e3,48e3,51300,28e3,42e3,35e3],Nue=({data:e={}})=>{const t=Array.isArray(e?.labels)&&e.labels.length>0?e.labels:Aue,n=Array.isArray(e?.budgetValues)&&e.budgetValues.length>0?e.budgetValues:Tue,r=Array.isArray(e?.actualValues)&&e.actualValues.length>0?e.actualValues:Mue,i={labels:t,datasets:[{label:"Budget",data:n,backgroundColor:"#93C5FD",barThickness:60},{label:"Actual",data:r,backgroundColor:"#3B82F6",barThickness:60}]},o={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:a=>t[a[0].dataIndex],label:a=>{const s=a.parsed.y;return`${a.dataset.label}: AED ${(s/1e3).toFixed(1)}K`}}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:a=>`${a/1e3}K`}}}};return v.jsx(Ie,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:v.jsx(Al,{data:i,options:o})})},jue=[{title:"Primary Account",amount:285e4,subtitle:"Savings"},{title:"Emergency Fund",amount:12e5,subtitle:"Fixed deposit"},{title:"Maintenance Fund",amount:68e4,subtitle:"Current"}],Rue=({data:e})=>{const t=Array.isArray(e?.accounts)&&e.accounts.length>0?e.accounts:Array.isArray(e)&&e.length>0?e:jue,n=t.reduce((i,o)=>i+o.amount,0),r=i=>i>=1e6?`AED ${(i/1e6).toFixed(2)}M`:i>=1e3?`AED ${(i/1e3).toFixed(1)}K`:`AED ${i}`;return v.jsxs(Ie,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((i,o)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:i.title}),v.jsx("div",{className:"!text-[12px] text-[#64748B]",children:i?.subtitle})]}),v.jsx("div",{className:"flex flex-col items-end",children:v.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:r(i.amount)})})]},o))}),v.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-[12px]",children:[v.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),v.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:r(n)})]})]})};$n.register(Eo,Oo,Dl,Yr,Jr);const Iue=[{label:"Current Month",value:13e3,units:18},{label:"1-3 Months",value:9400,units:12},{label:"3-6 Months",value:8800,units:18},{label:"6+ Months",value:7200,units:6}],Lue=({data:e})=>{const t=Array.isArray(e?.items)&&e.items.length>0?e.items:Array.isArray(e)&&e.length>0?e:Iue,n=t.map(s=>s.label),r=t.map(s=>Number(s.value??0)),i=t.map(s=>Number(s.units??0)),o={labels:n,datasets:[{label:"Due",data:r,backgroundColor:"#EF4444",barThickness:60}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:s=>n[s[0].dataIndex],label:s=>`Due: AED ${(s.parsed.y/1e3).toFixed(1)}K`,afterLabel:s=>`Units Count: ${i[s.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:s=>`${s/1e3}K`}}}};return v.jsxs(Ie,{title:"Dues Ageing",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[v.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:n.map((s,l)=>v.jsx("div",{className:"p-[8px] rounded-[8px] bg-slate-50",children:v.jsxs("div",{className:"flex justify-between items-start",children:[v.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:s}),v.jsxs("div",{className:"text-right",children:[v.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(r[l]/1e3).toFixed(1),"K"]}),v.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[i[l]," Units"]})]})]})},s))}),v.jsx("div",{className:"h-[192px]",children:v.jsx(Al,{data:o,options:a})})]})};$n.register(r1,Yr,Jr);const Fue=[{label:"Maintenance",value:45e4,color:"#08B6D4"},{label:"Utilities",value:32e4,color:"#8B5CF6"},{label:"Security",value:28e4,color:"#EF4444"},{label:"Administration",value:18e4,color:"#F69E0A"},{label:"Others",value:12e4,color:"#12B981"}],$ue=({data:e})=>{const t=Array.isArray(e?.items)&&e.items.length>0?e.items:Array.isArray(e)&&e.length>0?e:Fue,n=t.map(l=>l.label),r=t.map(l=>Number(l.value??0)),i=t.map(l=>l.color),o={labels:n,datasets:[{label:"Expenses",data:r,backgroundColor:i,borderColor:"#FFFFFF",borderWidth:2,cutout:"70%"}]},a=r.reduce((l,c)=>l+c,0),s={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:10,callbacks:{label:l=>`${l.label}: AED ${l.formattedValue}`}}}};return v.jsxs(Ie,{title:"Expense Categories",className:"w-full h-[523px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[v.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[v.jsx(l1,{data:o,options:s}),v.jsxs("div",{className:"absolute text-center",children:[v.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(a/1e6).toFixed(2),"M"]}),v.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),v.jsx("div",{className:"space-y-2",children:n.map((l,c)=>v.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[v.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[v.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:o.datasets[0].backgroundColor[c]}}),l]}),v.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(r[c]/1e3).toFixed(0),"K"]})]},l))})]})},Bue=[{name:"Gym Equipment",value:1e6,color:"#08B6D4"},{name:"Security",value:8e5,color:"#EF4444"},{name:"Others",value:6e5,color:"#F59E0B"},{name:"Pool Maintenance",value:7e5,color:"#8B5CF6"},{name:"Administration",value:52e4,color:"#10B981"}];function Wue({data:e}){const t=Array.isArray(e)&&e.length>0?e:Bue,n=t.reduce((r,i)=>r+Number(i.value??0),0);return v.jsx(Ie,{title:"Asset Value Breakdown",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((r,i)=>v.jsx(kn,{fill:r.color},`cell-${i}`))}),v.jsx(Vt,{formatter:r=>`AED ${r.toLocaleString()}`})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:["AED ",(n/1e6).toFixed(2),"M"]}),v.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),v.jsxs("div",{className:"flex justify-between w-full px-[16px] sm:px-[32px] mt-4 text-[14px]",children:[v.jsx("div",{className:"flex flex-col gap-[8px]",children:t.slice(0,3).map(r=>v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:r.color}}),v.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:r.name})]},r.name))}),v.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:t.slice(3).map(r=>v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:r.color}}),v.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:r.name})]},r.name))})]})]})})}$n.register(Eo,Oo,Dl,Yr,Jr);const zue=[{label:"Gym",value:13e3,units:18},{label:"Parking",value:9400,units:12},{label:"Swimming Pool",value:8800,units:18},{label:"Community Hall",value:7200,units:6},{label:"Tennis Court",value:6e3,units:10}],Vue=({data:e})=>{const t=Array.isArray(e)&&e.length>0?e:zue,n=t.map(s=>s.label),r=t.map(s=>Number(s.value??0)),i=t.map(s=>Number(s.units??0)),o={labels:n,datasets:[{label:"Due",data:r,backgroundColor:"#8B5CF6",barThickness:60}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:s=>n[s[0].dataIndex],label:s=>`Due: AED ${(s.parsed.y/1e3).toFixed(1)}K`,afterLabel:s=>`Units Count: ${i[s.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:s=>`${s/1e3}K`}}}};return v.jsx(Ie,{title:"Revenue by Category",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:v.jsx(Al,{data:o,options:a})})};function Hue(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 5l0 2"},child:[]},{tag:"path",attr:{d:"M15 11l0 2"},child:[]},{tag:"path",attr:{d:"M15 17l0 2"},child:[]},{tag:"path",attr:{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2"},child:[]}]})(e)}function Yue(e){return Ze({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M855.7 210.8l-42.4-42.4a8.03 8.03 0 0 0-11.3 0L168.3 801.9a8.03 8.03 0 0 0 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0L855.6 222c3.2-3 3.2-8.1.1-11.2zM304 448c79.4 0 144-64.6 144-144s-64.6-144-144-144-144 64.6-144 144 64.6 144 144 144zm0-216c39.7 0 72 32.3 72 72s-32.3 72-72 72-72-32.3-72-72 32.3-72 72-72zm416 344c-79.4 0-144 64.6-144 144s64.6 144 144 144 144-64.6 144-144-64.6-144-144-144zm0 216c-39.7 0-72-32.3-72-72s32.3-72 72-72 72 32.3 72 72-32.3 72-72 72z"},child:[]}]})(e)}function Uue({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsxs(Ie,{title:e,icon:v.jsx("div",{className:"h-6 w-6 grid place-items-center",children:v.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[v.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[v.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-slate-500",children:r})]})]})}const Kue=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:qk,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Yue,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hue,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:Xk,iconColor:"text-[#DBB467]"}];function que({data:e}){const t=Array.isArray(e)&&e.length>0?e:Kue;return v.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(Uue,{...n},r))})}/**
|
|
283
283
|
* @license lucide-react v0.564.0 - ISC
|
|
284
284
|
*
|
|
285
285
|
* This source code is licensed under the ISC license.
|
|
@@ -364,4 +364,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
364
364
|
*
|
|
365
365
|
* This source code is licensed under the ISC license.
|
|
366
366
|
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/const hde=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],mde=Co("waves-ladder",hde),dn=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,onCalendarClick:f,onPrevClick:p,onNextClick:h})=>{const m=s==="semi-bold"?600:500;return v.jsxs("div",{className:`relative bg-white rounded-[12px] p-[24px] shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[t&&v.jsx("div",{className:c,children:t}),v.jsx("div",{style:{fontWeight:m,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),n&&!r&&v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&v.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 rounded-lg bg-white text-sm text-[#64748B]",children:[v.jsx(rde,{size:16,className:"text-[#64748B] cursor-pointer",onClick:f}),v.jsx(zR,{size:16,className:"cursor-pointer",onClick:p}),v.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),v.jsx(VR,{size:16,className:"cursor-pointer",onClick:h})]})]}),v.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&v.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},gde={completed:18,not_completed:6,missed:4};function vde({data:e={}}){const t=e&&Object.keys(e).length>0?e:gde,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return v.jsx(dn,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>v.jsx(kn,{fill:o?.color??"#ccc"},`cell-${a}`))}),v.jsx(Vt,{formatter:o=>Number(o??0).toLocaleString()})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),v.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>v.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-[10px]",children:[v.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):v.jsx("div",{className:"text-center text-gray-400 text-sm py-6",children:"No patrol data"})})]})})}$n.register(Eo,Oo,o1,i1,Yr,Jr);const yde=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],zd={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},bde=({data:e})=>{const n={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:yde,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:zd.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:zd.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:zd.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:zd.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},r={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:i=>i[0].label,label:i=>`${i.dataset.label} ${i.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return v.jsx(Ie,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"text-[20px] text-[#884EA7]"}),children:v.jsx(s1,{data:n,options:r})})},xde={open:4,in_progress:7,closed:12},wde=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function _de({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:xde,r=Array.isArray(t)&&t.length>0?t:wde,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return v.jsx(dn,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[v.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),v.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),v.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:v.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):v.jsx("div",{className:"text-center text-gray-400 text-sm py-6",children:"No incidents found"})})]})})}const Sde=[{total_staff:42,absent_staff:6}],Ede=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function Ode({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:Sde,r=Array.isArray(t)&&t.length>0?t:Ede,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return v.jsx(dn,{title:"Staff Attendance",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex gap-[24px] text-center",children:[v.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] rounded h-[76px]",children:[v.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),v.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),v.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] rounded h-[76px]",children:[v.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),v.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),v.jsx("div",{className:"mt-[24px] space-y-2 overflow-y-auto max-h-[200px]",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#F8FAFC] rounded-md",children:[v.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),v.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):v.jsx(v.Fragment,{})})]})})}function Cde(e){return Ze({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Pde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsxs(Ie,{title:e,icon:v.jsx("div",{className:"h-6 w-6 grid place-items-center",children:v.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[v.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[v.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-slate-500",children:r})]})]})}const kde=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:xb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:aoe,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Cde,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:E3,iconColor:"text-[#36AB6C]"}];function Dde({data:e}){const t=Array.isArray(e)&&e.length>0?e:kde;return v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(Pde,{...n},r))})}const Ade=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Tde=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function Mde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Tde(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Ade;return v.jsx(Ie,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),v.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Nde=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},jde=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],Rde=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return v.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[v.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=Nde(a);return v.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[v.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),v.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),v.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},Ide=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return v.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[v.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),v.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Lde=({data:e})=>{const t=P.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:jde).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=P.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return v.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[v.jsx(Ft,{width:"100%",height:"85%",children:v.jsxs(oa,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[v.jsx(Hr,{strokeDasharray:"0",vertical:!1}),v.jsx(br,{dataKey:"level"}),v.jsx(nr,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),v.jsx(Vt,{content:v.jsx(Rde,{}),cursor:!1}),v.jsx(jn,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),v.jsx(jn,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),v.jsx(jn,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),v.jsx(Ide,{})]})},Fde=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function $de({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):Fde;return v.jsx(Ie,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),v.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Bde(e){return Ze({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const Wde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],zde={open_complaints:{title:"Open Complaints",Icon:qk,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Bde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:N3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:D3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Vde=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>v.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Hde={primary:{size:28,lineHeight:32,weight:500}},Yde={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Ude({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?v.jsx(fP,{id:e,data:t}):v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Wde.map(n=>v.jsx(fP,{id:n},n))})}function fP({id:e,data:t}){const n=zde[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=lu,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:Yde[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,v.jsx("div",{className:"h-[132px]",children:v.jsxs(Ie,{title:i,titleColor:a,icon:v.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:v.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[v.jsx(Vde,{...Hde.primary,children:c}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[v.jsx(wb,{value:u}),v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Kde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function qde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return v.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),v.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-2 py-1 ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),v.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),v.jsxs("div",{className:"flex justify-between items-center mt-2",children:[v.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),v.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),v.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:v.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Gde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Kde;return v.jsx(Ie,{title:"Events Utilisation",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:v.jsx("div",{children:t.map((n,r)=>v.jsx(qde,{...n},`${n.title}-${r}`))})})}const Xde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function Qde({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return v.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[v.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),v.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Zde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Xde;return v.jsx(Ie,{title:"Notice Board Status",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:v.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>v.jsx(Qde,{...n},`${n.label}-${r}`))})})}function HR(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function Jde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsx(Ie,{title:e,icon:v.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:v.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[v.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function efe({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:HR,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return v.jsx("div",{className:"h-full",children:t.map((n,r)=>v.jsx(Jde,{...n},r))})}function tfe(e){return Ze({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function nfe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsx(Ie,{title:e,icon:v.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:v.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[v.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const rfe=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:HR,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:O3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:ioe,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:tfe,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function ife({data:e}){const t=Array.isArray(e)&&e.length>0?e:rfe;return v.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(nfe,{...n},r))})}const pP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return v.jsxs("div",{className:"flex flex-col items-start",children:[v.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:v.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),v.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},ofe=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return v.jsx("div",{children:v.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[v.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[v.jsx(xb,{className:"!text-[20px] text-[#329DFF]"}),v.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),v.jsxs("div",{className:"flex items-start justify-between",children:[v.jsxs("div",{className:"flex flex-col gap-[4px]",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),v.jsxs("div",{className:"flex items-end gap-1",children:[v.jsx(pP,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),v.jsx(pP,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};$n.register(Eo,Oo,Dl,Yr);const afe=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return v.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:v.jsx(tde,{className:"!text-[24px] text-[#8B5CF6]"}),children:[v.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),v.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),v.jsx("div",{className:"h-[110px]",children:v.jsx(Al,{data:t,options:n})})]})},sfe="₹",hP=["bg-blue-500","bg-red-500","bg-purple-700"],Es={title:"Food & Beverages",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function YR(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function mP(e){if(e==null||e==="")return"0";if(typeof e=="number")return Jw(e);const t=Number(e);return Number.isNaN(t)?String(e):Jw(t)}function lfe(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((d,f)=>({name:d?.name||d?.outlet_name||d?.tenant_name||d?.company_name||"Unknown",orders:d?.orders??d?.total_orders??d?.count??0,revenue:d?.revenue??d?.revenue_generated??d?.total_revenue??0,percentage:d?.percentage,color:d?.color||hP[f%hP.length]})),o=n?.totalOrders??n?.orders??Es.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??Es.summary.revenueGenerated,s=YR(n?.growthPercentage??n?.revenueGrowth,Es.summary.growthPercentage),l=n?.currencyType||n?.currency||sfe,c=i.reduce((d,f)=>d+(Number(f?.orders)||0),0),u=i.map(d=>({...d,percentage:d?.percentage!==null&&d?.percentage!==void 0?Number(d.percentage)||0:c>0?Math.round((Number(d?.orders)||0)/c*100):0}));return{title:t?.title||Es.title,period:t?.period||Es.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,currencyType:l},outlets:u.length>0?u:Es.outlets}}function cfe({data:e,title:t,period:n,icon:r}){const i=lfe(e),o=t||i.title,a=n||i.period,s=r||v.jsx(pde,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=mP(i.summary.revenueGenerated),u=YR(i.summary.growthPercentage,0),d=u>=0;return v.jsx(Ie,{className:"h-[324px]",title:o,period:a,icon:s,children:v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l})]}),v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),v.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[i.summary.currencyType," ",c]}),v.jsxs("div",{className:`inline-flex items-center gap-1 text-[10px] leading-[14px] px-2 py-1 rounded-full ${d?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[d?v.jsx(qs,{}):v.jsx(Ks,{}),u,"%",v.jsx("span",{children:"from last month"})]})]})]}),v.jsx("div",{className:"mt-[16px]",children:i.outlets.map((f,p)=>v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:f.name}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[v.jsxs("div",{className:"text-[#64748B] inline-block",children:[f.orders," orders"]}),v.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",mP(f.revenue)]})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:`h-[11px] rounded-full ${f.color}`,style:{width:`${f.percentage}%`}})})]},`${f.name}-${p}`))})]})})}function ufe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const g=m?.total_bookings||0;return h+g},0),u=i.map(h=>{const m=h?.total_bookings||0,g=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:g,percentage:b,color:"bg-[#3C81F6]",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return v.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:v.jsx(mde,{className:"!text-[24px] text-[#8B5CF6]"}),children:v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),v.jsxs("div",{className:`inline-flex items-center gap-1 text-[10px] leading-[14px] px-2 py-1 rounded-full ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?v.jsx(qs,{}):v.jsx(Ks,{}),l,"%",v.jsx("span",{children:"from last month"})]})]}),!o&&v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),v.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&v.jsxs("div",{className:`inline-flex items-center gap-1 text-[10px] leading-[14px] px-2 py-1 rounded-full ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?v.jsx(qs,{}):v.jsx(Ks,{}),f,"%",v.jsx("span",{children:"from last month"})]})]})]}),v.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[v.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&v.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):v.jsx("div",{className:"flex items-center justify-center h-[120px]",children:v.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}$n.register(Eo,Oo,Dl,Yr,Jr);function dfe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return v.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:v.jsx(A3,{className:"!text-[24px] text-[#3C81F6]"}),children:v.jsx("div",{className:"h-full",children:v.jsx(Al,{data:l,options:c})})})}const ffe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return v.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:v.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[v.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),v.jsx("div",{children:n.name}),v.jsx("div",{className:"ml-2",children:n.value})]})})};function pfe({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return v.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:v.jsx(Tv,{className:"!text-[24px] text-[#EF4444]"}),children:v.jsxs("div",{className:"flex h-full items-center gap-4",children:[v.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>v.jsx(kn,{fill:a.color},s))}),v.jsx(Vt,{content:v.jsx(ffe,{}),wrapperStyle:{zIndex:1e3}})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[v.jsx("div",{children:r(n.completed)}),v.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),v.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>v.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const gP={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function hfe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function mfe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function gfe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>mfe(i?.hour)===n)||{};return{hour:n,time:hfe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function vP({title:e,color:t,rows:n=[],children:r}){const i=v.jsxs("div",{className:"bg-white rounded-xl min-w-[260px] p-4",children:[v.jsxs("div",{className:"flex items-center gap-2 font-medium text-[#121212]",children:[v.jsx(Zp,{className:`text-[20px] ${t}`}),v.jsx("div",{children:e??""})]}),v.jsx("div",{className:"mt-3 pt-3 border-t border-dashed border-gray-200 space-y-2",children:n?.map(({label:o,value:a,valueColor:s})=>v.jsxs("div",{className:"flex justify-between text-[14px]",children:[v.jsx("div",{children:o??""}),v.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return v.jsx(Gj,{content:i,placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,theme:"light-border",maxWidth:"none",children:r})}function vfe({active:e,payload:t}){return!e||!t?.length?null:v.jsx("div",{className:"rounded-lg bg-[#121212] px-3 py-2 text-[12px] text-white shadow-lg",children:t.map(n=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),v.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),v.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function yfe({data:e}){const t=e&&Object.keys(e).length?e:gP,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=P.useMemo(()=>{const l=t?.chart_data??[];return gfe(l.length?l:gP.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=P.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return v.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:v.jsx(Zp,{className:"!text-[24px] text-[#8B5CF6]"}),children:v.jsxs("div",{className:"flex flex-col mt-2",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6 mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),v.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),v.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),v.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),v.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[v.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),v.jsx(vP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:v.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),v.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),v.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[v.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),v.jsx(vP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:v.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),v.jsx("div",{className:"w-full h-[179px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(wx,{data:i??[],margin:{top:5,right:0,left:-18,bottom:0},children:[v.jsx(Hr,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),v.jsx(br,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),v.jsx(nr,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),v.jsx(Vt,{content:v.jsx(vfe,{})}),v.jsx(Vo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),v.jsx(Vo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const bfe=({color:e})=>v.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),xfe=({active:e,payload:t})=>!e||!t||!t.length?null:v.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:t.map((n,r)=>v.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[v.jsx(bfe,{color:n.color}),n.name,": ",v.jsx("div",{className:"font-semibold",children:n.value})]},r))});function wfe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return v.jsx(dn,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[v.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:v.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),v.jsx("div",{className:"h-[184px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>v.jsx(kn,{fill:a.color},s))}),v.jsx(Vt,{content:v.jsx(xfe,{}),wrapperStyle:{zIndex:9999}})]})})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),v.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),v.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function UR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return v.jsx(dn,{className:n,title:e,titleWeight:"semi-bold",children:v.jsxs("div",{className:"rounded-xl overflow-hidden mt-[16px]",children:[v.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[v.jsx("div",{children:"Point"}),v.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>v.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),v.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function _fe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return v.jsx(dn,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"8 8",vertical:!1}),v.jsx(fx,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),v.jsx(br,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(nr,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(Vt,{cursor:!1}),v.jsx(jn,{dataKey:"value",barSize:60,children:n.map((o,a)=>v.jsx(kn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}function Po({image:e="https://cdni.iconscout.com/illustration/premium/thumb/businessman-sad-for-no-data-in-folder-illustration-svg-download-png-10155562.png",title:t="No Data Available",description:n="Catch up all the data. Change the date range to see the data."}){return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-4",children:[v.jsx("img",{src:e,alt:"no data",className:"w-32 h-32 mb-4 opacity-80"}),v.jsx("div",{className:"text-[16px] font-semibold text-gray-900 mb-[4px]",children:t}),v.jsx("div",{className:"text-[12px] text-gray-500 max-w-[260px]",children:n})]})}const Sfe=({active:e,payload:t})=>e&&t&&t.length?v.jsx("div",{className:"bg-black text-white px-4 py-2 rounded-lg text-sm shadow-lg",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{children:t[0].payload.name}),v.jsx("div",{className:"font-semibold",children:t[0].value})]})}):null,Efe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return v.jsx("g",{transform:`translate(${e},${t})`,children:v.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>v.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function Ofe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints}));return v.jsx(dn,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full",children:t?v.jsx("div",{className:"w-full h-[280px] mt-[28px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n,layout:"vertical",children:[v.jsx(Hr,{strokeDasharray:"3 3",horizontal:!1}),v.jsx(br,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,allowDecimals:!1}),v.jsx(nr,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:120,tick:v.jsx(Efe,{})}),v.jsx(Vt,{content:v.jsx(Sfe,{}),cursor:{fill:"transparent"}}),v.jsx(jn,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):v.jsx(Po,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function Cfe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return v.jsxs("div",{className:"relative bg-white rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[e&&v.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx(e,{className:"h-[20px] w-[20px]"})}),v.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),v.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&v.jsxs("div",{className:"mt-[12px] flex items-center gap-2",children:[i&&v.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?v.jsx(qs,{}):v.jsx(Ks,{}),Math.abs(a),"%"]}),o&&v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const Pfe=({data:e=[],onDateChange:t})=>{const[n,r]=P.useState(new Date),[i,o]=P.useState(!1),s=(g=>{const b=new Date(g);return b.setDate(b.getDate()-6),b})(n),l=g=>{try{return g.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=g=>{const b=new Date(g),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const g=new Date(n);g.setDate(g.getDate()-7),r(g),c(g)},d=()=>{const g=new Date(n);g.setDate(g.getDate()+7),r(g),c(g)},f=()=>{o(g=>!g)},p=g=>{const b=g||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(g=>g.no_of_visitors===0);return v.jsxs(dn,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&v.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50 rounded-lg bg-white shadow-lg",children:v.jsx(Vk,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),m?v.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:v.jsx(Po,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):v.jsx("div",{className:"w-full h-[280px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(lne,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[v.jsx("defs",{children:v.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[v.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),v.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),v.jsx(br,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:g=>new Date(g).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),v.jsx(nr,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),v.jsx(Vt,{labelFormatter:g=>new Date(g).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),formatter:g=>[g,"Visitors"]}),v.jsx(DN,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:{r:6}})]})})})]})},kfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],Dfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?kfe:Array.isArray(e)?e:[];return v.jsx(dn,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?v.jsx(Po,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],margin:{top:10,right:10,left:0,bottom:0},barCategoryGap:35,children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),v.jsx(br,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),v.jsx(nr,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),v.jsx(Vt,{cursor:!1}),v.jsx(jn,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function Afe({data:e}){return v.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return v.jsx(Ie,{iconClassName:"!gap-[8px]",title:v.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:v.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:"h-[132px]",children:v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),v.jsxs("div",{className:`flex items-center pt-[8px] text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&v.jsxs("div",{className:"flex items-center gap-[4px]",style:{color:i?"#1FA05B":"#E11D48",fontWeight:500},children:[i?v.jsx(qs,{}):v.jsx(Ks,{}),Math.abs(r),"%"]}),v.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const Tfe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Mfe=({x:e,y:t,payload:n})=>v.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:v.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Nfe({data:e}){const t=Array?.isArray(e)&&e?.length===0,n=e==null?Tfe:Array?.isArray(e)?e:[];return v.jsx(Ie,{title:"Bookings",icon:v.jsx(dde,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:v.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t?v.jsx(Po,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],layout:"vertical",margin:{top:0,right:10,left:10,bottom:0},children:[v.jsx(br,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),v.jsx(nr,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:v.jsx(Mfe,{})}),v.jsx(Vt,{formatter:r=>[r,"Bookings"],cursor:{fill:"rgba(0,0,0,0.05)"}}),v.jsx(jn,{dataKey:"total_booking",barSize:40,fill:"#8B5CF6"})]})})})})}const jfe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Rfe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?jfe:Array.isArray(e)?e:[];return v.jsx(dn,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:t?v.jsx(Po,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],margin:{top:0,right:0,left:-15,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),v.jsx(br,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),v.jsx(nr,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),v.jsx(Vt,{formatter:r=>[r,"Bookings"],labelFormatter:r=>`Organisation: ${r}`,cursor:{fill:"rgba(0,0,0,0.05)"}}),v.jsx(jn,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const Ife=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],Vd=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Lfe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??Ife,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return v.jsx(dn,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"grid grid-cols-12 gap-6 items-center h-full",children:n?v.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:v.jsx(Po,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"col-span-5 h-[240px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>v.jsx(kn,{fill:Vd?.[c%Vd?.length]},`cell-${c}`))}),v.jsx(Vt,{formatter:l=>s(l),labelFormatter:l=>`Amenity: ${l||""}`,contentStyle:{borderRadius:"10px",border:"1px solid #EBEBEB",fontSize:"12px"}})]})})}),v.jsx("div",{className:"col-span-7",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden",children:[v.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[v.jsx("div",{children:"Amenity"}),v.jsx("div",{className:"text-right",children:"Revenue"})]}),v.jsx("div",{className:"divide-y divide-[#F1F5F9]",children:i?.map?.((l,c)=>v.jsxs("div",{className:"grid grid-cols-2 px-4 py-4 text-[14px] text-[#121212]",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:Vd?.[c%Vd?.length]}}),v.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),v.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const Hd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Ffe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],$fe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,color:Hd[o%Hd.length]})):Ffe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,color:Hd[o%Hd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?v.jsx(dn,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(Po,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):v.jsx(dn,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:v.jsxs("div",{className:"flex items-center justify-between h-full",children:[v.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsx(_o,{children:v.jsx(Mi,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>v.jsx(kn,{fill:i.color},o))})})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[v.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),v.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),v.jsx("div",{className:"flex-1 max-w-[280px]",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white",children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-[#F8FAFC]",children:[v.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),v.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>v.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[#F1F5F9]",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),v.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),v.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},Bfe=({data:e})=>{const[t,n]=P.useState({}),r=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],i=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:r,[e]),o=a=>{const{dataKey:s}=a;n(l=>({...l,[s]:!l[s]}))};return Array.isArray(e)&&e.length===0?v.jsx(dn,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:v.jsx(Po,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):v.jsx(dn,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?v.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):v.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:i,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-30,bottom:20},children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),v.jsx(br,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),v.jsx(nr,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),v.jsx(Vt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},contentStyle:{borderRadius:"10px",border:"1px solid #E2E8F0",fontSize:"12px"}}),v.jsx(ph,{verticalAlign:"bottom",align:"center",onClick:o,content:({payload:a})=>v.jsx("div",{className:"flex items-center justify-center gap-4 pt-4 flex-wrap",children:a.map((s,l)=>v.jsxs("div",{onClick:()=>o({dataKey:s.dataKey}),className:"flex items-center gap-2 cursor-pointer",children:[v.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[s.dataKey]?"#CBD5E1":s.color}}),v.jsx("span",{style:{fontSize:"12px",color:t[s.dataKey]?"#CBD5E1":"#64748B"},children:s.value})]},l))})}),v.jsx(jn,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),v.jsx(jn,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:t.Closed}),v.jsx(jn,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),v.jsx(jn,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold}),v.jsx(jn,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})};function Wfe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return v.jsx(dn,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>v.jsx(kn,{fill:i.color},`cell-${o}`))}),v.jsx(Vt,{formatter:i=>i.toLocaleString()})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),v.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>v.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-[10px]",children:[v.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function zfe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return v.jsx(dn,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[v.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[v.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),v.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[v.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),v.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[v.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),v.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return v.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),v.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:v.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):v.jsx(v.Fragment,{})})]})})}function Vfe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Orders"},{key:"d",label:"Revenue"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,h=n-p.length>0?n-p.length:0,m=a===0&&c.length===0;return console.log("safeData:",c),console.log("currentData:",p),v.jsxs("div",{className:"w-full bg-white rounded-xl h-[390px] shadow-md overflow-hidden flex flex-col",children:[v.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((g,b)=>v.jsx("div",{className:"px-6 py-4 text-[16px] leading-[20px] whitespace-nowrap text-center",children:g.label},b))}),v.jsx("div",{className:"flex-1 overflow-y-auto",children:m?v.jsx(Po,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsxs(v.Fragment,{children:[p.map((g,b)=>v.jsx("div",{className:"grid",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((S,w)=>{const x=g[S.key],_=typeof x=="string"&&x.includes("%"),O=x==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return v.jsx("div",{className:`px-6 py-4 flex items-center justify-center ${w===0?"bg-white":"bg-gray-50"}`,children:_?v.jsx("div",{className:`inline-block px-3 py-1 rounded-full text-[14px] font-medium ${O}`,children:x}):v.jsx("div",{children:x??"-"})},w)})},b)),Array.from({length:h}).map((g,b)=>v.jsx("div",{className:"grid",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((S,w)=>v.jsx("div",{className:`px-6 py-4 ${w===0?"bg-white":"bg-gray-50"}`,children:" "},w))},`empty-${b}`))]})}),v.jsxs("div",{className:"flex justify-end items-center px-6 py-4 text-sm bg-white border-t border-[#F0F0F0] gap-8",children:[v.jsxs("div",{className:"flex items-center gap-2 text-gray-600 text-[14px]",children:[v.jsx("div",{children:"Rows per page:"}),v.jsx("select",{value:n,onChange:g=>{r(Number(g.target.value)),o(1)},className:"border rounded px-2 py-1",children:l.map((g,b)=>v.jsx("option",{value:g,children:g},b))}),v.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," ","of ",a||c?.length]})]}),v.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[v.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(sde,{size:18})}),v.jsx("button",{onClick:()=>o(g=>g-1),disabled:i===1,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(zR,{size:18})}),v.jsx("button",{onClick:()=>o(g=>g+1),disabled:i===f,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(VR,{size:18})}),v.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-2 rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(cde,{size:18})})]})]})]})}exports.AccessPointsUsage=_fe;exports.Accounting=Due;exports.Amenities=ufe;exports.AmenitiesStatsCard=Afe;exports.AmenityWiseRevenue=Lfe;exports.AssetValueBreakdown=Wue;exports.AssetsByType=$fe;exports.BlockWiseOccupancy=_ue;exports.BookingTrendChart=Rfe;exports.Bookings=Nfe;exports.Budgets=Nue;exports.Card=Ie;exports.CardAccess=UR;exports.CashBankBalance=Rue;exports.CommercialAccessOverview=wfe;exports.CommercialGuardPatrols=Wfe;exports.CommercialIncidentReports=zfe;exports.CommercialOccupancy=ofe;exports.CommercialReportTable=Vfe;exports.Community=soe;exports.Complaints=Mde;exports.ComplaintsByLevel=Lde;exports.DuesAgeing=Lue;exports.EmployeeFootfall=afe;exports.Engagement=loe;exports.EngagementStatsGrid=ife;exports.EventsUtilisation=Gde;exports.ExpenseCategories=$ue;exports.Facilities=coe;exports.FinanceSummary=uoe;exports.FoodBeverages=cfe;exports.GateAndSecurityStatsGrid=Dde;exports.GateUpdates=Goe;exports.GuardPatrols=vde;exports.Header=m3;exports.Helpdesk=Xoe;exports.HelpdeskStatsGrid=Ude;exports.HourlyTrafficFlow=bde;exports.IncidentReports=_de;exports.IncomeExpenditure=BR;exports.MainHeader=k3;exports.MaintenanceStatus=Bfe;exports.MetricCard=Cfe;exports.MobileAccess=UR;exports.MoveInOutTrends=Eue;exports.NoticeBoardStatus=Zde;exports.OccupancyOverview=bue;exports.OrganisationWiseVisitors=Dfe;exports.RequestBox=$de;exports.ResidentOverview=wue;exports.RevenuebyCategory=Vue;exports.SingleStats=efe;exports.StaffAttendance=Ode;exports.StatsGrid=que;exports.TicketEscalation=dfe;exports.TicketStatus=pfe;exports.Tickets=$R;exports.TicketsperCategory=Ofe;exports.UnitStatus=$R;exports.VisitorUpdates=yfe;exports.WeeklyVisitorPattern=Pfe;
|
|
367
|
+
*/const hde=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],mde=Co("waves-ladder",hde),dn=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,onCalendarClick:f,onPrevClick:p,onNextClick:h})=>{const m=s==="semi-bold"?600:500;return v.jsxs("div",{className:`relative bg-white rounded-[12px] p-[24px] shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&v.jsx("div",{className:c,children:t}),v.jsx("div",{style:{fontWeight:m,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),n&&!r&&v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&v.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[v.jsx(rde,{size:16,className:"text-[#64748B] cursor-pointer",onClick:f}),v.jsx(zR,{size:16,className:"cursor-pointer",onClick:p}),v.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),v.jsx(VR,{size:16,className:"cursor-pointer",onClick:h})]})]}),v.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&v.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},gde={completed:18,not_completed:6,missed:4};function vde({data:e={}}){const t=e&&Object.keys(e).length>0?e:gde,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return v.jsx(dn,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>v.jsx(kn,{fill:o?.color??"#ccc"},`cell-${a}`))}),v.jsx(Vt,{formatter:o=>Number(o??0).toLocaleString()})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),v.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>v.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-[10px]",children:[v.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):v.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}$n.register(Eo,Oo,o1,i1,Yr,Jr);const yde=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],zd={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},bde=({data:e})=>{const n={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:yde,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:zd.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:zd.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:zd.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:zd.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},r={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:i=>i[0].label,label:i=>`${i.dataset.label} ${i.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return v.jsx(Ie,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:v.jsx(Wr,{className:"text-[20px] text-[#884EA7]"}),children:v.jsx(s1,{data:n,options:r})})},xde={open:4,in_progress:7,closed:12},wde=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function _de({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:xde,r=Array.isArray(t)&&t.length>0?t:wde,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return v.jsx(dn,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[v.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),v.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),v.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[v.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),v.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return v.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),v.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:v.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):v.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const Sde=[{total_staff:42,absent_staff:6}],Ede=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function Ode({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:Sde,r=Array.isArray(t)&&t.length>0?t:Ede,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return v.jsx(dn,{title:"Staff Attendance",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex gap-[24px] text-center",children:[v.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[v.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),v.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),v.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[v.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),v.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),v.jsx("div",{className:"mt-[24px] space-y-2 overflow-y-auto max-h-[200px]",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return v.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[v.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),v.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):v.jsx(v.Fragment,{})})]})})}function Cde(e){return Ze({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Pde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsxs(Ie,{title:e,icon:v.jsx("div",{className:"h-6 w-6 grid place-items-center",children:v.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[v.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[v.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-slate-500",children:r})]})]})}const kde=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:xb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:aoe,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Cde,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:E3,iconColor:"text-[#36AB6C]"}];function Dde({data:e}){const t=Array.isArray(e)&&e.length>0?e:kde;return v.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(Pde,{...n},r))})}const Ade=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Tde=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function Mde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Tde(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Ade;return v.jsx(Ie,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),v.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Nde=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},jde=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],Rde=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return v.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[v.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=Nde(a);return v.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[v.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),v.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),v.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},Ide=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return v.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[v.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),v.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Lde=({data:e})=>{const t=P.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:jde).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=P.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return v.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[v.jsx(Ft,{width:"100%",height:"85%",children:v.jsxs(oa,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[v.jsx(Hr,{strokeDasharray:"0",vertical:!1}),v.jsx(br,{dataKey:"level"}),v.jsx(nr,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),v.jsx(Vt,{content:v.jsx(Rde,{}),cursor:!1}),v.jsx(jn,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),v.jsx(jn,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),v.jsx(jn,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),v.jsx(Ide,{})]})},Fde=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function $de({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):Fde;return v.jsx(Ie,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:v.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>v.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[v.jsxs("div",{className:"flex flex-col",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),v.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),v.jsxs("div",{className:"flex flex-col items-end",children:[v.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Bde(e){return Ze({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const Wde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],zde={open_complaints:{title:"Open Complaints",Icon:qk,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Bde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:N3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:D3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Vde=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>v.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Hde={primary:{size:28,lineHeight:32,weight:500}},Yde={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Ude({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?v.jsx(fP,{id:e,data:t}):v.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:Wde.map(n=>v.jsx(fP,{id:n},n))})}function fP({id:e,data:t}){const n=zde[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=lu,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:Yde[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,v.jsx("div",{className:"h-[132px]",children:v.jsxs(Ie,{title:i,titleColor:a,icon:v.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:v.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[v.jsx(Vde,{...Hde.primary,children:c}),v.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[v.jsx(wb,{value:u}),v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Kde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function qde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return v.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),v.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),v.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),v.jsxs("div",{className:"flex justify-between items-center mt-2",children:[v.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),v.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),v.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:v.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Gde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Kde;return v.jsx(Ie,{title:"Events Utilisation",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:v.jsx("div",{children:t.map((n,r)=>v.jsx(qde,{...n},`${n.title}-${r}`))})})}const Xde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function Qde({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return v.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[v.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),v.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Zde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Xde;return v.jsx(Ie,{title:"Notice Board Status",period:v.jsx(Wr,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:v.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>v.jsx(Qde,{...n},`${n.label}-${r}`))})})}function HR(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function Jde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsx(Ie,{title:e,icon:v.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:v.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[v.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function efe({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:HR,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return v.jsx("div",{className:"h-full",children:t.map((n,r)=>v.jsx(Jde,{...n},r))})}function tfe(e){return Ze({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function nfe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return v.jsx(Ie,{title:e,icon:v.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:v.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:v.jsxs("div",{children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),v.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[v.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),v.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const rfe=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:HR,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:O3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:ioe,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:tfe,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function ife({data:e}){const t=Array.isArray(e)&&e.length>0?e:rfe;return v.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>v.jsx(nfe,{...n},r))})}const pP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return v.jsxs("div",{className:"flex flex-col items-start",children:[v.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:v.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),v.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),v.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},ofe=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return v.jsx("div",{children:v.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[v.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[v.jsx(xb,{className:"!text-[20px] text-[#329DFF]"}),v.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),v.jsxs("div",{className:"flex items-start justify-between",children:[v.jsxs("div",{className:"flex flex-col gap-[4px]",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),v.jsxs("div",{className:"flex items-end gap-[4px]",children:[v.jsx(pP,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),v.jsx(pP,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};$n.register(Eo,Oo,Dl,Yr);const afe=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return v.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:v.jsx(tde,{className:"!text-[24px] text-[#8B5CF6]"}),children:[v.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),v.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),v.jsx("div",{className:"h-[110px]",children:v.jsx(Al,{data:t,options:n})})]})},sfe="₹",hP=["bg-blue-500","bg-red-500","bg-purple-700"],Es={title:"Food & Beverages",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function YR(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function mP(e){if(e==null||e==="")return"0";if(typeof e=="number")return Jw(e);const t=Number(e);return Number.isNaN(t)?String(e):Jw(t)}function lfe(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((d,f)=>({name:d?.name||d?.outlet_name||d?.tenant_name||d?.company_name||"Unknown",orders:d?.orders??d?.total_orders??d?.count??0,revenue:d?.revenue??d?.revenue_generated??d?.total_revenue??0,percentage:d?.percentage,color:d?.color||hP[f%hP.length]})),o=n?.totalOrders??n?.orders??Es.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??Es.summary.revenueGenerated,s=YR(n?.growthPercentage??n?.revenueGrowth,Es.summary.growthPercentage),l=n?.currencyType||n?.currency||sfe,c=i.reduce((d,f)=>d+(Number(f?.orders)||0),0),u=i.map(d=>({...d,percentage:d?.percentage!==null&&d?.percentage!==void 0?Number(d.percentage)||0:c>0?Math.round((Number(d?.orders)||0)/c*100):0}));return{title:t?.title||Es.title,period:t?.period||Es.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,currencyType:l},outlets:u.length>0?u:Es.outlets}}function cfe({data:e,title:t,period:n,icon:r}){const i=lfe(e),o=t||i.title,a=n||i.period,s=r||v.jsx(pde,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=mP(i.summary.revenueGenerated),u=YR(i.summary.growthPercentage,0),d=u>=0;return v.jsx(Ie,{className:"h-[324px]",title:o,period:a,icon:s,children:v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l})]}),v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),v.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[i.summary.currencyType," ",c]}),v.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${d?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[d?v.jsx(qs,{}):v.jsx(Ks,{}),u,"%",v.jsx("span",{children:"from last month"})]})]})]}),v.jsx("div",{className:"mt-[16px]",children:i.outlets.map((f,p)=>v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:f.name}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[v.jsxs("div",{className:"text-[#64748B] inline-block",children:[f.orders," orders"]}),v.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",mP(f.revenue)]})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:`h-[11px] rounded-full ${f.color}`,style:{width:`${f.percentage}%`}})})]},`${f.name}-${p}`))})]})})}function ufe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const g=m?.total_bookings||0;return h+g},0),u=i.map(h=>{const m=h?.total_bookings||0,g=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:g,percentage:b,color:"bg-[#3C81F6]",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return v.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:v.jsx(mde,{className:"!text-[24px] text-[#8B5CF6]"}),children:v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),v.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?v.jsx(qs,{}):v.jsx(Ks,{}),l,"%",v.jsx("span",{children:"from last month"})]})]}),!o&&v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),v.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&v.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?v.jsx(qs,{}):v.jsx(Ks,{}),f,"%",v.jsx("span",{children:"from last month"})]})]})]}),v.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>v.jsxs("div",{className:"mb-[16px]",children:[v.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),v.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[v.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&v.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),v.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:v.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):v.jsx("div",{className:"flex items-center justify-center h-[120px]",children:v.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}$n.register(Eo,Oo,Dl,Yr,Jr);function dfe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return v.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:v.jsx(A3,{className:"!text-[24px] text-[#3C81F6]"}),children:v.jsx("div",{className:"h-full",children:v.jsx(Al,{data:l,options:c})})})}const ffe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return v.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:v.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[v.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),v.jsx("div",{children:n.name}),v.jsx("div",{className:"ml-2",children:n.value})]})})};function pfe({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return v.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:v.jsx(Tv,{className:"!text-[24px] text-[#EF4444]"}),children:v.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[v.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>v.jsx(kn,{fill:a.color},s))}),v.jsx(Vt,{content:v.jsx(ffe,{}),wrapperStyle:{zIndex:1e3}})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[v.jsx("div",{children:r(n.completed)}),v.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),v.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>v.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),v.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const gP={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function hfe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function mfe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function gfe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>mfe(i?.hour)===n)||{};return{hour:n,time:hfe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function vP({title:e,color:t,rows:n=[],children:r}){const i=v.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px]",children:[v.jsxs("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:[v.jsx(Zp,{className:`text-[20px] ${t}`}),v.jsx("div",{children:e??""})]}),v.jsx("div",{className:"mt-3 pt-3 border-t border-dashed border-gray-200 space-y-2",children:n?.map(({label:o,value:a,valueColor:s})=>v.jsxs("div",{className:"flex justify-between text-[14px]",children:[v.jsx("div",{children:o??""}),v.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return v.jsx(Gj,{content:i,placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,theme:"light-border",maxWidth:"none",children:r})}function vfe({active:e,payload:t}){return!e||!t?.length?null:v.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),v.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),v.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function yfe({data:e}){const t=e&&Object.keys(e).length?e:gP,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=P.useMemo(()=>{const l=t?.chart_data??[];return gfe(l.length?l:gP.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=P.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return v.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:v.jsx(Zp,{className:"!text-[24px] text-[#8B5CF6]"}),children:v.jsxs("div",{className:"flex flex-col mt-2",children:[v.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6 mb-6",children:[v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),v.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),v.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),v.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),v.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[v.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),v.jsx(vP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:v.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),v.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),v.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[v.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),v.jsx(vP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:v.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),v.jsx("div",{className:"w-full h-[179px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(wx,{data:i??[],margin:{top:5,right:0,left:-18,bottom:0},children:[v.jsx(Hr,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),v.jsx(br,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),v.jsx(nr,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),v.jsx(Vt,{content:v.jsx(vfe,{})}),v.jsx(Vo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),v.jsx(Vo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const bfe=({color:e})=>v.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),xfe=({active:e,payload:t})=>!e||!t||!t.length?null:v.jsx("div",{className:"bg-black text-white !text-[12px] px-[12px] py-[8px] rounded-[8px] shadow-lg",children:t.map((n,r)=>v.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[v.jsx(bfe,{color:n.color}),n.name,": ",v.jsx("div",{className:"font-semibold",children:n.value})]},r))});function wfe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return v.jsx(dn,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[v.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[v.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:v.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),v.jsx("div",{className:"h-[184px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>v.jsx(kn,{fill:a.color},s))}),v.jsx(Vt,{content:v.jsx(xfe,{}),wrapperStyle:{zIndex:9999}})]})})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),v.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),v.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function UR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return v.jsx(dn,{className:n,title:e,titleWeight:"semi-bold",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[v.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[v.jsx("div",{children:"Point"}),v.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>v.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),v.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function _fe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return v.jsx(dn,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"8 8",vertical:!1}),v.jsx(fx,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),v.jsx(br,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(nr,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),v.jsx(Vt,{cursor:!1}),v.jsx(jn,{dataKey:"value",barSize:60,children:n.map((o,a)=>v.jsx(kn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}function Po({image:e="https://cdni.iconscout.com/illustration/premium/thumb/businessman-sad-for-no-data-in-folder-illustration-svg-download-png-10155562.png",title:t="No Data Available",description:n="Catch up all the data. Change the date range to see the data."}){return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center px-[16px]",children:[v.jsx("img",{src:e,alt:"no data",className:"w-32 h-32 mb-4 opacity-80"}),v.jsx("div",{className:"text-[16px] font-semibold text-gray-900 mb-[4px]",children:t}),v.jsx("div",{className:"text-[12px] text-gray-500 max-w-[260px]",children:n})]})}const Sfe=({active:e,payload:t})=>e&&t&&t.length?v.jsx("div",{className:"bg-black text-white px-[16px] py-[8px] rounded-[8px] text-sm shadow-lg",children:v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("div",{children:t[0].payload.name}),v.jsx("div",{className:"font-semibold",children:t[0].value})]})}):null,Efe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return v.jsx("g",{transform:`translate(${e},${t})`,children:v.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>v.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function Ofe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints}));return v.jsx(dn,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full",children:t?v.jsx("div",{className:"w-full h-[280px] mt-[28px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n,layout:"vertical",children:[v.jsx(Hr,{strokeDasharray:"3 3",horizontal:!1}),v.jsx(br,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,allowDecimals:!1}),v.jsx(nr,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:120,tick:v.jsx(Efe,{})}),v.jsx(Vt,{content:v.jsx(Sfe,{}),cursor:{fill:"transparent"}}),v.jsx(jn,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):v.jsx(Po,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function Cfe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return v.jsxs("div",{className:"relative bg-white rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[v.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&v.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx(e,{className:"h-[20px] w-[20px]"})}),v.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),v.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&v.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&v.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?v.jsx(qs,{}):v.jsx(Ks,{}),Math.abs(a),"%"]}),o&&v.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const Pfe=({data:e=[],onDateChange:t})=>{const[n,r]=P.useState(new Date),[i,o]=P.useState(!1),s=(g=>{const b=new Date(g);return b.setDate(b.getDate()-6),b})(n),l=g=>{try{return g.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=g=>{const b=new Date(g),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const g=new Date(n);g.setDate(g.getDate()-7),r(g),c(g)},d=()=>{const g=new Date(n);g.setDate(g.getDate()+7),r(g),c(g)},f=()=>{o(g=>!g)},p=g=>{const b=g||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(g=>g.no_of_visitors===0);return v.jsxs(dn,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&v.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50 rounded-[8px] bg-white shadow-lg",children:v.jsx(Vk,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),m?v.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:v.jsx(Po,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):v.jsx("div",{className:"w-full h-[280px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(lne,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[v.jsx("defs",{children:v.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[v.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),v.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),v.jsx(br,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:g=>new Date(g).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),v.jsx(nr,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),v.jsx(Vt,{labelFormatter:g=>new Date(g).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),formatter:g=>[g,"Visitors"]}),v.jsx(DN,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:{r:6}})]})})})]})},kfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],Dfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?kfe:Array.isArray(e)?e:[];return v.jsx(dn,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?v.jsx(Po,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],margin:{top:10,right:10,left:0,bottom:0},barCategoryGap:35,children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),v.jsx(br,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),v.jsx(nr,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),v.jsx(Vt,{cursor:!1}),v.jsx(jn,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function Afe({data:e}){return v.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return v.jsx(Ie,{iconClassName:"!gap-[8px]",title:v.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:v.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:"h-[132px]",children:v.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[v.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),v.jsxs("div",{className:`flex items-center pt-[8px] text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&v.jsxs("div",{className:"flex items-center gap-[4px]",style:{color:i?"#1FA05B":"#E11D48",fontWeight:500},children:[i?v.jsx(qs,{}):v.jsx(Ks,{}),Math.abs(r),"%"]}),v.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const Tfe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Mfe=({x:e,y:t,payload:n})=>v.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:v.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Nfe({data:e}){const t=Array?.isArray(e)&&e?.length===0,n=e==null?Tfe:Array?.isArray(e)?e:[];return v.jsx(Ie,{title:"Bookings",icon:v.jsx(dde,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:v.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t?v.jsx(Po,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],layout:"vertical",margin:{top:0,right:10,left:10,bottom:0},children:[v.jsx(br,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),v.jsx(nr,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:v.jsx(Mfe,{})}),v.jsx(Vt,{formatter:r=>[r,"Bookings"],cursor:{fill:"rgba(0,0,0,0.05)"}}),v.jsx(jn,{dataKey:"total_booking",barSize:40,fill:"#8B5CF6"})]})})})})}const jfe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Rfe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?jfe:Array.isArray(e)?e:[];return v.jsx(dn,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:t?v.jsx(Po,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:n||[],margin:{top:0,right:0,left:-15,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),v.jsx(br,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),v.jsx(nr,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),v.jsx(Vt,{formatter:r=>[r,"Bookings"],labelFormatter:r=>`Organisation: ${r}`,cursor:{fill:"rgba(0,0,0,0.05)"}}),v.jsx(jn,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const Ife=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],Vd=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Lfe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??Ife,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return v.jsx(dn,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:v.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full",children:n?v.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:v.jsx(Po,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"col-span-5 h-[240px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>v.jsx(kn,{fill:Vd?.[c%Vd?.length]},`cell-${c}`))}),v.jsx(Vt,{formatter:l=>s(l),labelFormatter:l=>`Amenity: ${l||""}`,contentStyle:{borderRadius:"10px",border:"1px solid #EBEBEB",fontSize:"12px"}})]})})}),v.jsx("div",{className:"col-span-7",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden",children:[v.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[v.jsx("div",{children:"Amenity"}),v.jsx("div",{className:"text-right",children:"Revenue"})]}),v.jsx("div",{className:"divide-y divide-[#F1F5F9]",children:i?.map?.((l,c)=>v.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[v.jsxs("div",{className:"flex items-center gap-[12px]",children:[v.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:Vd?.[c%Vd?.length]}}),v.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),v.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const Hd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Ffe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],$fe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,color:Hd[o%Hd.length]})):Ffe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,color:Hd[o%Hd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?v.jsx(dn,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(Po,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):v.jsx(dn,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:v.jsxs("div",{className:"flex items-center justify-between h-full",children:[v.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsx(_o,{children:v.jsx(Mi,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>v.jsx(kn,{fill:i.color},o))})})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[v.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),v.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),v.jsx("div",{className:"flex-1 max-w-[280px]",children:v.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white",children:[v.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[v.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),v.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>v.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[v.jsxs("div",{className:"flex items-center gap-[8px]",children:[v.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),v.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),v.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},Bfe=({data:e})=>{const[t,n]=P.useState({}),r=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],i=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:r,[e]),o=a=>{const{dataKey:s}=a;n(l=>({...l,[s]:!l[s]}))};return Array.isArray(e)&&e.length===0?v.jsx(dn,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:v.jsx(Po,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):v.jsx(dn,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:v.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?v.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):v.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(oa,{data:i,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[v.jsx(Hr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),v.jsx(br,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),v.jsx(nr,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),v.jsx(Vt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},contentStyle:{borderRadius:"10px",border:"1px solid #E2E8F0",fontSize:"12px"}}),v.jsx(ph,{verticalAlign:"bottom",align:"center",onClick:o,content:({payload:a})=>v.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:a.map((s,l)=>v.jsxs("div",{onClick:()=>o({dataKey:s.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[v.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[s.dataKey]?"#CBD5E1":s.color}}),v.jsx("span",{style:{fontSize:"12px",color:t[s.dataKey]?"#CBD5E1":"#64748B"},children:s.value})]},l))})}),v.jsx(jn,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),v.jsx(jn,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:t.Closed}),v.jsx(jn,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),v.jsx(jn,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold}),v.jsx(jn,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})};function Wfe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return v.jsx(dn,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{className:"flex flex-col items-center justify-center",children:[v.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[v.jsx(Ft,{width:"100%",height:"100%",children:v.jsxs(_o,{children:[v.jsx(Mi,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>v.jsx(kn,{fill:i.color},`cell-${o}`))}),v.jsx(Vt,{formatter:i=>i.toLocaleString()})]})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[v.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),v.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),v.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>v.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[v.jsxs("div",{className:"flex items-center gap-[10px]",children:[v.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),v.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function zfe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return v.jsx(dn,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:v.jsxs("div",{children:[v.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[v.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[v.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),v.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[v.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),v.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[v.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),v.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),v.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return v.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[v.jsx("div",{className:"flex items-center gap-[8px]",children:v.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),v.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:v.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):v.jsx(v.Fragment,{})})]})})}function Vfe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Orders"},{key:"d",label:"Revenue"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,h=n-p.length>0?n-p.length:0,m=a===0&&c.length===0;return console.log("safeData:",c),console.log("currentData:",p),v.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] shadow-md overflow-hidden flex flex-col",children:[v.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((g,b)=>v.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-center",children:g.label},b))}),v.jsx("div",{className:"flex-1 overflow-y-auto",children:m?v.jsx(Po,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):v.jsxs(v.Fragment,{children:[p.map((g,b)=>v.jsx("div",{className:"grid",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((S,w)=>{const x=g[S.key],_=typeof x=="string"&&x.includes("%"),O=x==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return v.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-center ${w===0?"bg-white":"bg-gray-50"}`,children:_?v.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${O}`,children:x}):v.jsx("div",{children:x??"-"})},w)})},b)),Array.from({length:h}).map((g,b)=>v.jsx("div",{className:"grid",style:{gridTemplateColumns:`repeat(${u.length}, 1fr)`},children:u.map((S,w)=>v.jsx("div",{className:`px-[24px] py-[16px] ${w===0?"bg-white":"bg-gray-50"}`,children:" "},w))},`empty-${b}`))]})}),v.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px]",children:[v.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[v.jsx("div",{children:"Rows per page:"}),v.jsx("select",{value:n,onChange:g=>{r(Number(g.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((g,b)=>v.jsx("option",{value:g,children:g},b))}),v.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),v.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[v.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(sde,{size:18})}),v.jsx("button",{onClick:()=>o(g=>g-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(zR,{size:18})}),v.jsx("button",{onClick:()=>o(g=>g+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(VR,{size:18})}),v.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:v.jsx(cde,{size:18})})]})]})]})}exports.AccessPointsUsage=_fe;exports.Accounting=Due;exports.Amenities=ufe;exports.AmenitiesStatsCard=Afe;exports.AmenityWiseRevenue=Lfe;exports.AssetValueBreakdown=Wue;exports.AssetsByType=$fe;exports.BlockWiseOccupancy=_ue;exports.BookingTrendChart=Rfe;exports.Bookings=Nfe;exports.Budgets=Nue;exports.Card=Ie;exports.CardAccess=UR;exports.CashBankBalance=Rue;exports.CommercialAccessOverview=wfe;exports.CommercialGuardPatrols=Wfe;exports.CommercialIncidentReports=zfe;exports.CommercialOccupancy=ofe;exports.CommercialReportTable=Vfe;exports.Community=soe;exports.Complaints=Mde;exports.ComplaintsByLevel=Lde;exports.DuesAgeing=Lue;exports.EmployeeFootfall=afe;exports.Engagement=loe;exports.EngagementStatsGrid=ife;exports.EventsUtilisation=Gde;exports.ExpenseCategories=$ue;exports.Facilities=coe;exports.FinanceSummary=uoe;exports.FoodBeverages=cfe;exports.GateAndSecurityStatsGrid=Dde;exports.GateUpdates=Goe;exports.GuardPatrols=vde;exports.Header=m3;exports.Helpdesk=Xoe;exports.HelpdeskStatsGrid=Ude;exports.HourlyTrafficFlow=bde;exports.IncidentReports=_de;exports.IncomeExpenditure=BR;exports.MainHeader=k3;exports.MaintenanceStatus=Bfe;exports.MetricCard=Cfe;exports.MobileAccess=UR;exports.MoveInOutTrends=Eue;exports.NoticeBoardStatus=Zde;exports.OccupancyOverview=bue;exports.OrganisationWiseVisitors=Dfe;exports.RequestBox=$de;exports.ResidentOverview=wue;exports.RevenuebyCategory=Vue;exports.SingleStats=efe;exports.StaffAttendance=Ode;exports.StatsGrid=que;exports.TicketEscalation=dfe;exports.TicketStatus=pfe;exports.Tickets=$R;exports.TicketsperCategory=Ofe;exports.UnitStatus=$R;exports.VisitorUpdates=yfe;exports.WeeklyVisitorPattern=Pfe;
|