604 lines
1.5 MiB
604 lines
1.5 MiB
var YK=Object.defineProperty;var gN=e=>{throw TypeError(e)};var XK=(e,t,n)=>t in e?YK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oc=(e,t,n)=>XK(e,typeof t!="symbol"?t+"":t,n),jw=(e,t,n)=>t.has(e)||gN("Cannot "+n);var ue=(e,t,n)=>(jw(e,t,"read from private field"),n?n.call(e):t.get(e)),Ft=(e,t,n)=>t.has(e)?gN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),bt=(e,t,n,r)=>(jw(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),mn=(e,t,n)=>(jw(e,t,"access private method"),n);var Cv=(e,t,n,r)=>({set _(i){bt(e,t,i,n)},get _(){return ue(e,t,r)}});function QK(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Xp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function In(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ow={exports:{}},Lp={},Tw={exports:{}},wn={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var vN;function JK(){if(vN)return wn;vN=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(ie){return ie===null||typeof ie!="object"?null:(ie=m&&ie[m]||ie["@@iterator"],typeof ie=="function"?ie:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},P=Object.assign,x={};function w(ie,de,He){this.props=ie,this.context=de,this.refs=x,this.updater=He||b}w.prototype.isReactComponent={},w.prototype.setState=function(ie,de){if(typeof ie!="object"&&typeof ie!="function"&&ie!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,ie,de,"setState")},w.prototype.forceUpdate=function(ie){this.updater.enqueueForceUpdate(this,ie,"forceUpdate")};function T(){}T.prototype=w.prototype;function E(ie,de,He){this.props=ie,this.context=de,this.refs=x,this.updater=He||b}var k=E.prototype=new T;k.constructor=E,P(k,w.prototype),k.isPureReactComponent=!0;var D=Array.isArray,I=Object.prototype.hasOwnProperty,R={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function V(ie,de,He){var je,$e={},We=null,Ye=null;if(de!=null)for(je in de.ref!==void 0&&(Ye=de.ref),de.key!==void 0&&(We=""+de.key),de)I.call(de,je)&&!$.hasOwnProperty(je)&&($e[je]=de[je]);var rt=arguments.length-2;if(rt===1)$e.children=He;else if(1<rt){for(var ze=Array(rt),Fe=0;Fe<rt;Fe++)ze[Fe]=arguments[Fe+2];$e.children=ze}if(ie&&ie.defaultProps)for(je in rt=ie.defaultProps,rt)$e[je]===void 0&&($e[je]=rt[je]);return{$$typeof:e,type:ie,key:We,ref:Ye,props:$e,_owner:R.current}}function K(ie,de){return{$$typeof:e,type:ie.type,key:de,ref:ie.ref,props:ie.props,_owner:ie._owner}}function Z(ie){return typeof ie=="object"&&ie!==null&&ie.$$typeof===e}function ee(ie){var de={"=":"=0",":":"=2"};return"$"+ie.replace(/[=:]/g,function(He){return de[He]})}var ne=/\/+/g;function oe(ie,de){return typeof ie=="object"&&ie!==null&&ie.key!=null?ee(""+ie.key):de.toString(36)}function he(ie,de,He,je,$e){var We=typeof ie;(We==="undefined"||We==="boolean")&&(ie=null);var Ye=!1;if(ie===null)Ye=!0;else switch(We){case"string":case"number":Ye=!0;break;case"object":switch(ie.$$typeof){case e:case t:Ye=!0}}if(Ye)return Ye=ie,$e=$e(Ye),ie=je===""?"."+oe(Ye,0):je,D($e)?(He="",ie!=null&&(He=ie.replace(ne,"$&/")+"/"),he($e,de,He,"",function(Fe){return Fe})):$e!=null&&(Z($e)&&($e=K($e,He+(!$e.key||Ye&&Ye.key===$e.key?"":(""+$e.key).replace(ne,"$&/")+"/")+ie)),de.push($e)),1;if(Ye=0,je=je===""?".":je+":",D(ie))for(var rt=0;rt<ie.length;rt++){We=ie[rt];var ze=je+oe(We,rt);Ye+=he(We,de,He,ze,$e)}else if(ze=y(ie),typeof ze=="function")for(ie=ze.call(ie),rt=0;!(We=ie.next()).done;)We=We.value,ze=je+oe(We,rt++),Ye+=he(We,de,He,ze,$e);else if(We==="object")throw de=String(ie),Error("Objects are not valid as a React child (found: "+(de==="[object Object]"?"object with keys {"+Object.keys(ie).join(", ")+"}":de)+"). If you meant to render a collection of children, use an array instead.");return Ye}function Se(ie,de,He){if(ie==null)return ie;var je=[],$e=0;return he(ie,je,"","",function(We){return de.call(He,We,$e++)}),je}function fe(ie){if(ie._status===-1){var de=ie._result;de=de(),de.then(function(He){(ie._status===0||ie._status===-1)&&(ie._status=1,ie._result=He)},function(He){(ie._status===0||ie._status===-1)&&(ie._status=2,ie._result=He)}),ie._status===-1&&(ie._status=0,ie._result=de)}if(ie._status===1)return ie._result.default;throw ie._result}var Oe={current:null},re={transition:null},Ce={ReactCurrentDispatcher:Oe,ReactCurrentBatchConfig:re,ReactCurrentOwner:R};function ae(){throw Error("act(...) is not supported in production builds of React.")}return wn.Children={map:Se,forEach:function(ie,de,He){Se(ie,function(){de.apply(this,arguments)},He)},count:function(ie){var de=0;return Se(ie,function(){de++}),de},toArray:function(ie){return Se(ie,function(de){return de})||[]},only:function(ie){if(!Z(ie))throw Error("React.Children.only expected to receive a single React element child.");return ie}},wn.Component=w,wn.Fragment=n,wn.Profiler=i,wn.PureComponent=E,wn.StrictMode=r,wn.Suspense=c,wn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ce,wn.act=ae,wn.cloneElement=function(ie,de,He){if(ie==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+ie+".");var je=P({},ie.props),$e=ie.key,We=ie.ref,Ye=ie._owner;if(de!=null){if(de.ref!==void 0&&(We=de.ref,Ye=R.current),de.key!==void 0&&($e=""+de.key),ie.type&&ie.type.defaultProps)var rt=ie.type.defaultProps;for(ze in de)I.call(de,ze)&&!$.hasOwnProperty(ze)&&(je[ze]=de[ze]===void 0&&rt!==void 0?rt[ze]:de[ze])}var ze=arguments.length-2;if(ze===1)je.children=He;else if(1<ze){rt=Array(ze);for(var Fe=0;Fe<ze;Fe++)rt[Fe]=arguments[Fe+2];je.children=rt}return{$$typeof:e,type:ie.type,key:$e,ref:We,props:je,_owner:Ye}},wn.createContext=function(ie){return ie={$$typeof:o,_currentValue:ie,_currentValue2:ie,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},ie.Provider={$$typeof:a,_context:ie},ie.Consumer=ie},wn.createElement=V,wn.createFactory=function(ie){var de=V.bind(null,ie);return de.type=ie,de},wn.createRef=function(){return{current:null}},wn.forwardRef=function(ie){return{$$typeof:s,render:ie}},wn.isValidElement=Z,wn.lazy=function(ie){return{$$typeof:p,_payload:{_status:-1,_result:ie},_init:fe}},wn.memo=function(ie,de){return{$$typeof:d,type:ie,compare:de===void 0?null:de}},wn.startTransition=function(ie){var de=re.transition;re.transition={};try{ie()}finally{re.transition=de}},wn.unstable_act=ae,wn.useCallback=function(ie,de){return Oe.current.useCallback(ie,de)},wn.useContext=function(ie){return Oe.current.useContext(ie)},wn.useDebugValue=function(){},wn.useDeferredValue=function(ie){return Oe.current.useDeferredValue(ie)},wn.useEffect=function(ie,de){return Oe.current.useEffect(ie,de)},wn.useId=function(){return Oe.current.useId()},wn.useImperativeHandle=function(ie,de,He){return Oe.current.useImperativeHandle(ie,de,He)},wn.useInsertionEffect=function(ie,de){return Oe.current.useInsertionEffect(ie,de)},wn.useLayoutEffect=function(ie,de){return Oe.current.useLayoutEffect(ie,de)},wn.useMemo=function(ie,de){return Oe.current.useMemo(ie,de)},wn.useReducer=function(ie,de,He){return Oe.current.useReducer(ie,de,He)},wn.useRef=function(ie){return Oe.current.useRef(ie)},wn.useState=function(ie){return Oe.current.useState(ie)},wn.useSyncExternalStore=function(ie,de,He){return Oe.current.useSyncExternalStore(ie,de,He)},wn.useTransition=function(){return Oe.current.useTransition()},wn.version="18.3.1",wn}var yN;function QT(){return yN||(yN=1,Tw.exports=JK()),Tw.exports}/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var bN;function eH(){if(bN)return Lp;bN=1;var e=QT(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(s,c,d){var p,m={},y=null,b=null;d!==void 0&&(y=""+d),c.key!==void 0&&(y=""+c.key),c.ref!==void 0&&(b=c.ref);for(p in c)r.call(c,p)&&!a.hasOwnProperty(p)&&(m[p]=c[p]);if(s&&s.defaultProps)for(p in c=s.defaultProps,c)m[p]===void 0&&(m[p]=c[p]);return{$$typeof:t,type:s,key:y,ref:b,props:m,_owner:i.current}}return Lp.Fragment=n,Lp.jsx=o,Lp.jsxs=o,Lp}var xN;function tH(){return xN||(xN=1,Ow.exports=eH()),Ow.exports}var h=tH(),M=QT();const ce=In(M),X0=QK({__proto__:null,default:ce},[M]);var Nv={},Ew={exports:{}},yo={},Aw={exports:{}},kw={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var wN;function nH(){return wN||(wN=1,(function(e){function t(re,Ce){var ae=re.length;re.push(Ce);e:for(;0<ae;){var ie=ae-1>>>1,de=re[ie];if(0<i(de,Ce))re[ie]=Ce,re[ae]=de,ae=ie;else break e}}function n(re){return re.length===0?null:re[0]}function r(re){if(re.length===0)return null;var Ce=re[0],ae=re.pop();if(ae!==Ce){re[0]=ae;e:for(var ie=0,de=re.length,He=de>>>1;ie<He;){var je=2*(ie+1)-1,$e=re[je],We=je+1,Ye=re[We];if(0>i($e,ae))We<de&&0>i(Ye,$e)?(re[ie]=Ye,re[We]=ae,ie=We):(re[ie]=$e,re[je]=ae,ie=je);else if(We<de&&0>i(Ye,ae))re[ie]=Ye,re[We]=ae,ie=We;else break e}}return Ce}function i(re,Ce){var ae=re.sortIndex-Ce.sortIndex;return ae!==0?ae:re.id-Ce.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],d=[],p=1,m=null,y=3,b=!1,P=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(re){for(var Ce=n(d);Ce!==null;){if(Ce.callback===null)r(d);else if(Ce.startTime<=re)r(d),Ce.sortIndex=Ce.expirationTime,t(c,Ce);else break;Ce=n(d)}}function D(re){if(x=!1,k(re),!P)if(n(c)!==null)P=!0,fe(I);else{var Ce=n(d);Ce!==null&&Oe(D,Ce.startTime-re)}}function I(re,Ce){P=!1,x&&(x=!1,T(V),V=-1),b=!0;var ae=y;try{for(k(Ce),m=n(c);m!==null&&(!(m.expirationTime>Ce)||re&&!ee());){var ie=m.callback;if(typeof ie=="function"){m.callback=null,y=m.priorityLevel;var de=ie(m.expirationTime<=Ce);Ce=e.unstable_now(),typeof de=="function"?m.callback=de:m===n(c)&&r(c),k(Ce)}else r(c);m=n(c)}if(m!==null)var He=!0;else{var je=n(d);je!==null&&Oe(D,je.startTime-Ce),He=!1}return He}finally{m=null,y=ae,b=!1}}var R=!1,$=null,V=-1,K=5,Z=-1;function ee(){return!(e.unstable_now()-Z<K)}function ne(){if($!==null){var re=e.unstable_now();Z=re;var Ce=!0;try{Ce=$(!0,re)}finally{Ce?oe():(R=!1,$=null)}}else R=!1}var oe;if(typeof E=="function")oe=function(){E(ne)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,Se=he.port2;he.port1.onmessage=ne,oe=function(){Se.postMessage(null)}}else oe=function(){w(ne,0)};function fe(re){$=re,R||(R=!0,oe())}function Oe(re,Ce){V=w(function(){re(e.unstable_now())},Ce)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(re){re.callback=null},e.unstable_continueExecution=function(){P||b||(P=!0,fe(I))},e.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<re?Math.floor(1e3/re):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(re){switch(y){case 1:case 2:case 3:var Ce=3;break;default:Ce=y}var ae=y;y=Ce;try{return re()}finally{y=ae}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(re,Ce){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var ae=y;y=re;try{return Ce()}finally{y=ae}},e.unstable_scheduleCallback=function(re,Ce,ae){var ie=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ie+ae:ie):ae=ie,re){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=ae+de,re={id:p++,callback:Ce,priorityLevel:re,startTime:ae,expirationTime:de,sortIndex:-1},ae>ie?(re.sortIndex=ae,t(d,re),n(c)===null&&re===n(d)&&(x?(T(V),V=-1):x=!0,Oe(D,ae-ie))):(re.sortIndex=de,t(c,re),P||b||(P=!0,fe(I))),re},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(re){var Ce=y;return function(){var ae=y;y=Ce;try{return re.apply(this,arguments)}finally{y=ae}}}})(kw)),kw}var _N;function rH(){return _N||(_N=1,Aw.exports=nH()),Aw.exports}/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var SN;function iH(){if(SN)return yo;SN=1;var e=QT(),t=rH();function n(l){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+l,v=1;v<arguments.length;v++)f+="&args[]="+encodeURIComponent(arguments[v]);return"Minified React error #"+l+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function a(l,f){o(l,f),o(l+"Capture",f)}function o(l,f){for(i[l]=f,l=0;l<f.length;l++)r.add(f[l])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function y(l){return c.call(m,l)?!0:c.call(p,l)?!1:d.test(l)?m[l]=!0:(p[l]=!0,!1)}function b(l,f,v,j){if(v!==null&&v.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return j?!1:v!==null?!v.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function P(l,f,v,j){if(f===null||typeof f>"u"||b(l,f,v,j))return!0;if(j)return!1;if(v!==null)switch(v.type){case 3:return!f;case 4:return f===!1;case 5:return isNaN(f);case 6:return isNaN(f)||1>f}return!1}function x(l,f,v,j,N,F,Y){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=j,this.attributeNamespace=N,this.mustUseProperty=v,this.propertyName=l,this.type=f,this.sanitizeURL=F,this.removeEmptyString=Y}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){w[l]=new x(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var f=l[0];w[f]=new x(f,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){w[l]=new x(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){w[l]=new x(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){w[l]=new x(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){w[l]=new x(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){w[l]=new x(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){w[l]=new x(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){w[l]=new x(l,5,!1,l.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function E(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var f=l.replace(T,E);w[f]=new x(f,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var f=l.replace(T,E);w[f]=new x(f,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var f=l.replace(T,E);w[f]=new x(f,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){w[l]=new x(l,1,!1,l.toLowerCase(),null,!1,!1)}),w.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){w[l]=new x(l,1,!1,l.toLowerCase(),null,!0,!0)});function k(l,f,v,j){var N=w.hasOwnProperty(f)?w[f]:null;(N!==null?N.type!==0:j||!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(P(f,v,N,j)&&(v=null),j||N===null?y(f)&&(v===null?l.removeAttribute(f):l.setAttribute(f,""+v)):N.mustUseProperty?l[N.propertyName]=v===null?N.type===3?!1:"":v:(f=N.attributeName,j=N.attributeNamespace,v===null?l.removeAttribute(f):(N=N.type,v=N===3||N===4&&v===!0?"":""+v,j?l.setAttributeNS(j,f,v):l.setAttribute(f,v))))}var D=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),R=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),Z=Symbol.for("react.provider"),ee=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),he=Symbol.for("react.suspense_list"),Se=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),Oe=Symbol.for("react.offscreen"),re=Symbol.iterator;function Ce(l){return l===null||typeof l!="object"?null:(l=re&&l[re]||l["@@iterator"],typeof l=="function"?l:null)}var ae=Object.assign,ie;function de(l){if(ie===void 0)try{throw Error()}catch(v){var f=v.stack.trim().match(/\n( *(at )?)/);ie=f&&f[1]||""}return`
|
||
`+ie+l}var He=!1;function je(l,f){if(!l||He)return"";He=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(qe){var j=qe}Reflect.construct(l,[],f)}else{try{f.call()}catch(qe){j=qe}l.call(f.prototype)}else{try{throw Error()}catch(qe){j=qe}l()}}catch(qe){if(qe&&j&&typeof qe.stack=="string"){for(var N=qe.stack.split(`
|
||
`),F=j.stack.split(`
|
||
`),Y=N.length-1,se=F.length-1;1<=Y&&0<=se&&N[Y]!==F[se];)se--;for(;1<=Y&&0<=se;Y--,se--)if(N[Y]!==F[se]){if(Y!==1||se!==1)do if(Y--,se--,0>se||N[Y]!==F[se]){var ge=`
|
||
`+N[Y].replace(" at new "," at ");return l.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",l.displayName)),ge}while(1<=Y&&0<=se);break}}}finally{He=!1,Error.prepareStackTrace=v}return(l=l?l.displayName||l.name:"")?de(l):""}function $e(l){switch(l.tag){case 5:return de(l.type);case 16:return de("Lazy");case 13:return de("Suspense");case 19:return de("SuspenseList");case 0:case 2:case 15:return l=je(l.type,!1),l;case 11:return l=je(l.type.render,!1),l;case 1:return l=je(l.type,!0),l;default:return""}}function We(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case $:return"Fragment";case R:return"Portal";case K:return"Profiler";case V:return"StrictMode";case oe:return"Suspense";case he:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case ee:return(l.displayName||"Context")+".Consumer";case Z:return(l._context.displayName||"Context")+".Provider";case ne:var f=l.render;return l=l.displayName,l||(l=f.displayName||f.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Se:return f=l.displayName||null,f!==null?f:We(l.type)||"Memo";case fe:f=l._payload,l=l._init;try{return We(l(f))}catch{}}return null}function Ye(l){var f=l.type;switch(l.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=f.render,l=l.displayName||l.name||"",f.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return We(f);case 8:return f===V?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function rt(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ze(l){var f=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function Fe(l){var f=ze(l)?"checked":"value",v=Object.getOwnPropertyDescriptor(l.constructor.prototype,f),j=""+l[f];if(!l.hasOwnProperty(f)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var N=v.get,F=v.set;return Object.defineProperty(l,f,{configurable:!0,get:function(){return N.call(this)},set:function(Y){j=""+Y,F.call(this,Y)}}),Object.defineProperty(l,f,{enumerable:v.enumerable}),{getValue:function(){return j},setValue:function(Y){j=""+Y},stopTracking:function(){l._valueTracker=null,delete l[f]}}}}function st(l){l._valueTracker||(l._valueTracker=Fe(l))}function Te(l){if(!l)return!1;var f=l._valueTracker;if(!f)return!0;var v=f.getValue(),j="";return l&&(j=ze(l)?l.checked?"true":"false":l.value),l=j,l!==v?(f.setValue(l),!0):!1}function Dt(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Lt(l,f){var v=f.checked;return ae({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??l._wrapperState.initialChecked})}function dn(l,f){var v=f.defaultValue==null?"":f.defaultValue,j=f.checked!=null?f.checked:f.defaultChecked;v=rt(f.value!=null?f.value:v),l._wrapperState={initialChecked:j,initialValue:v,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function xn(l,f){f=f.checked,f!=null&&k(l,"checked",f,!1)}function qn(l,f){xn(l,f);var v=rt(f.value),j=f.type;if(v!=null)j==="number"?(v===0&&l.value===""||l.value!=v)&&(l.value=""+v):l.value!==""+v&&(l.value=""+v);else if(j==="submit"||j==="reset"){l.removeAttribute("value");return}f.hasOwnProperty("value")?Zr(l,f.type,v):f.hasOwnProperty("defaultValue")&&Zr(l,f.type,rt(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(l.defaultChecked=!!f.defaultChecked)}function Ar(l,f,v){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var j=f.type;if(!(j!=="submit"&&j!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+l._wrapperState.initialValue,v||f===l.value||(l.value=f),l.defaultValue=f}v=l.name,v!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,v!==""&&(l.name=v)}function Zr(l,f,v){(f!=="number"||Dt(l.ownerDocument)!==l)&&(v==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+v&&(l.defaultValue=""+v))}var $r=Array.isArray;function Bn(l,f,v,j){if(l=l.options,f){f={};for(var N=0;N<v.length;N++)f["$"+v[N]]=!0;for(v=0;v<l.length;v++)N=f.hasOwnProperty("$"+l[v].value),l[v].selected!==N&&(l[v].selected=N),N&&j&&(l[v].defaultSelected=!0)}else{for(v=""+rt(v),f=null,N=0;N<l.length;N++){if(l[N].value===v){l[N].selected=!0,j&&(l[N].defaultSelected=!0);return}f!==null||l[N].disabled||(f=l[N])}f!==null&&(f.selected=!0)}}function _r(l,f){if(f.dangerouslySetInnerHTML!=null)throw Error(n(91));return ae({},f,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function fr(l,f){var v=f.value;if(v==null){if(v=f.children,f=f.defaultValue,v!=null){if(f!=null)throw Error(n(92));if($r(v)){if(1<v.length)throw Error(n(93));v=v[0]}f=v}f==null&&(f=""),v=f}l._wrapperState={initialValue:rt(v)}}function To(l,f){var v=rt(f.value),j=rt(f.defaultValue);v!=null&&(v=""+v,v!==l.value&&(l.value=v),f.defaultValue==null&&l.defaultValue!==v&&(l.defaultValue=v)),j!=null&&(l.defaultValue=""+j)}function ua(l){var f=l.textContent;f===l._wrapperState.initialValue&&f!==""&&f!==null&&(l.value=f)}function Fr(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ca(l,f){return l==null||l==="http://www.w3.org/1999/xhtml"?Fr(f):l==="http://www.w3.org/2000/svg"&&f==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Eo,Vt=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(f,v,j,N){MSApp.execUnsafeLocalFunction(function(){return l(f,v,j,N)})}:l})(function(l,f){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=f;else{for(Eo=Eo||document.createElement("div"),Eo.innerHTML="<svg>"+f.valueOf().toString()+"</svg>",f=Eo.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;f.firstChild;)l.appendChild(f.firstChild)}});function Na(l,f){if(f){var v=l.firstChild;if(v&&v===l.lastChild&&v.nodeType===3){v.nodeValue=f;return}}l.textContent=f}var Wi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ja=["Webkit","ms","Moz","O"];Object.keys(Wi).forEach(function(l){Ja.forEach(function(f){f=f+l.charAt(0).toUpperCase()+l.substring(1),Wi[f]=Wi[l]})});function Ki(l,f,v){return f==null||typeof f=="boolean"||f===""?"":v||typeof f!="number"||f===0||Wi.hasOwnProperty(l)&&Wi[l]?(""+f).trim():f+"px"}function Ho(l,f){l=l.style;for(var v in f)if(f.hasOwnProperty(v)){var j=v.indexOf("--")===0,N=Ki(v,f[v],j);v==="float"&&(v="cssFloat"),j?l.setProperty(v,N):l[v]=N}}var qr=ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Pt(l,f){if(f){if(qr[l]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(n(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(n(61))}if(f.style!=null&&typeof f.style!="object")throw Error(n(62))}}function Ci(l,f){if(l.indexOf("-")===-1)return typeof f.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fa=null;function lt(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var ht=null,Ma=null,vr=null;function Go(l){if(l=nu(l)){if(typeof ht!="function")throw Error(n(280));var f=l.stateNode;f&&(f=yd(f),ht(l.stateNode,l.type,f))}}function Cs(l){Ma?vr?vr.push(l):vr=[l]:Ma=l}function Zo(){if(Ma){var l=Ma,f=vr;if(vr=Ma=null,Go(l),f)for(l=0;l<f.length;l++)Go(f[l])}}function eo(l,f){return l(f)}function Yl(){}var ar=!1;function da(l,f,v){if(ar)return l(f,v);ar=!0;try{return eo(l,f,v)}finally{ar=!1,(Ma!==null||vr!==null)&&(Yl(),Zo())}}function Ni(l,f){var v=l.stateNode;if(v===null)return null;var j=yd(v);if(j===null)return null;v=j[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(j=!j.disabled)||(l=l.type,j=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!j;break e;default:l=!1}if(l)return null;if(v&&typeof v!="function")throw Error(n(231,f,typeof v));return v}var Ao=!1;if(s)try{var An={};Object.defineProperty(An,"passive",{get:function(){Ao=!0}}),window.addEventListener("test",An,An),window.removeEventListener("test",An,An)}catch{Ao=!1}function or(l,f,v,j,N,F,Y,se,ge){var qe=Array.prototype.slice.call(arguments,3);try{f.apply(v,qe)}catch(tt){this.onError(tt)}}var Rn=!1,_t=null,to=!1,Ra=null,$u={onError:function(l){Rn=!0,_t=l}};function Hi(l,f,v,j,N,F,Y,se,ge){Rn=!1,_t=null,or.apply($u,arguments)}function La(l,f,v,j,N,F,Y,se,ge){if(Hi.apply(this,arguments),Rn){if(Rn){var qe=_t;Rn=!1,_t=null}else throw Error(n(198));to||(to=!0,Ra=qe)}}function Sr(l){var f=l,v=l;if(l.alternate)for(;f.return;)f=f.return;else{l=f;do f=l,(f.flags&4098)!==0&&(v=f.return),l=f.return;while(l)}return f.tag===3?v:null}function ha(l){if(l.tag===13){var f=l.memoizedState;if(f===null&&(l=l.alternate,l!==null&&(f=l.memoizedState)),f!==null)return f.dehydrated}return null}function Mi(l){if(Sr(l)!==l)throw Error(n(188))}function Gi(l){var f=l.alternate;if(!f){if(f=Sr(l),f===null)throw Error(n(188));return f!==l?null:l}for(var v=l,j=f;;){var N=v.return;if(N===null)break;var F=N.alternate;if(F===null){if(j=N.return,j!==null){v=j;continue}break}if(N.child===F.child){for(F=N.child;F;){if(F===v)return Mi(N),l;if(F===j)return Mi(N),f;F=F.sibling}throw Error(n(188))}if(v.return!==j.return)v=N,j=F;else{for(var Y=!1,se=N.child;se;){if(se===v){Y=!0,v=N,j=F;break}if(se===j){Y=!0,j=N,v=F;break}se=se.sibling}if(!Y){for(se=F.child;se;){if(se===v){Y=!0,v=F,j=N;break}if(se===j){Y=!0,j=F,v=N;break}se=se.sibling}if(!Y)throw Error(n(189))}}if(v.alternate!==j)throw Error(n(190))}if(v.tag!==3)throw Error(n(188));return v.stateNode.current===v?l:f}function Ns(l){return l=Gi(l),l!==null?Ia(l):null}function Ia(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var f=Ia(l);if(f!==null)return f;l=l.sibling}return null}var vl=t.unstable_scheduleCallback,Da=t.unstable_cancelCallback,nr=t.unstable_shouldYield,hi=t.unstable_requestPaint,jn=t.unstable_now,ko=t.unstable_getCurrentPriorityLevel,pa=t.unstable_ImmediatePriority,Yo=t.unstable_UserBlockingPriority,Co=t.unstable_NormalPriority,Xo=t.unstable_LowPriority,Ri=t.unstable_IdlePriority,pi=null,ln=null;function Li(l){if(ln&&typeof ln.onCommitFiberRoot=="function")try{ln.onCommitFiberRoot(pi,l,void 0,(l.current.flags&128)===128)}catch{}}var ft=Math.clz32?Math.clz32:Zi,$n=Math.log,no=Math.LN2;function Zi(l){return l>>>=0,l===0?32:31-($n(l)/no|0)|0}var mi=64,No=4194304;function qt(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function zn(l,f){var v=l.pendingLanes;if(v===0)return 0;var j=0,N=l.suspendedLanes,F=l.pingedLanes,Y=v&268435455;if(Y!==0){var se=Y&~N;se!==0?j=qt(se):(F&=Y,F!==0&&(j=qt(F)))}else Y=v&~N,Y!==0?j=qt(Y):F!==0&&(j=qt(F));if(j===0)return 0;if(f!==0&&f!==j&&(f&N)===0&&(N=j&-j,F=f&-f,N>=F||N===16&&(F&4194240)!==0))return f;if((j&4)!==0&&(j|=v&16),f=l.entangledLanes,f!==0)for(l=l.entanglements,f&=j;0<f;)v=31-ft(f),N=1<<v,j|=l[v],f&=~N;return j}function kn(l,f){switch(l){case 1:case 2:case 4:return f+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ro(l,f){for(var v=l.suspendedLanes,j=l.pingedLanes,N=l.expirationTimes,F=l.pendingLanes;0<F;){var Y=31-ft(F),se=1<<Y,ge=N[Y];ge===-1?((se&v)===0||(se&j)!==0)&&(N[Y]=kn(se,f)):ge<=f&&(l.expiredLanes|=se),F&=~se}}function dr(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function io(){var l=mi;return mi<<=1,(mi&4194240)===0&&(mi=64),l}function ma(l){for(var f=[],v=0;31>v;v++)f.push(l);return f}function gi(l,f,v){l.pendingLanes|=f,f!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,f=31-ft(f),l[f]=v}function Un(l,f){var v=l.pendingLanes&~f;l.pendingLanes=f,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=f,l.mutableReadLanes&=f,l.entangledLanes&=f,f=l.entanglements;var j=l.eventTimes;for(l=l.expirationTimes;0<v;){var N=31-ft(v),F=1<<N;f[N]=0,j[N]=-1,l[N]=-1,v&=~F}}function zr(l,f){var v=l.entangledLanes|=f;for(l=l.entanglements;v;){var j=31-ft(v),N=1<<j;N&f|l[j]&f&&(l[j]|=f),v&=~N}}var un=0;function ri(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Ms,cn,Qo,ao,oo,sr=!1,Ii=[],Yr=null,yr=null,kr=null,Ba=new Map,xt=new Map,gn=[],On="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function $a(l,f){switch(l){case"focusin":case"focusout":Yr=null;break;case"dragenter":case"dragleave":yr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":Ba.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":xt.delete(f.pointerId)}}function Yi(l,f,v,j,N,F){return l===null||l.nativeEvent!==F?(l={blockedOn:f,domEventName:v,eventSystemFlags:j,nativeEvent:F,targetContainers:[N]},f!==null&&(f=nu(f),f!==null&&cn(f)),l):(l.eventSystemFlags|=j,f=l.targetContainers,N!==null&&f.indexOf(N)===-1&&f.push(N),l)}function Xi(l,f,v,j,N){switch(f){case"focusin":return Yr=Yi(Yr,l,f,v,j,N),!0;case"dragenter":return yr=Yi(yr,l,f,v,j,N),!0;case"mouseover":return kr=Yi(kr,l,f,v,j,N),!0;case"pointerover":var F=N.pointerId;return Ba.set(F,Yi(Ba.get(F)||null,l,f,v,j,N)),!0;case"gotpointercapture":return F=N.pointerId,xt.set(F,Yi(xt.get(F)||null,l,f,v,j,N)),!0}return!1}function Rs(l){var f=tu(l.target);if(f!==null){var v=Sr(f);if(v!==null){if(f=v.tag,f===13){if(f=ha(v),f!==null){l.blockedOn=f,oo(l.priority,function(){Qo(v)});return}}else if(f===3&&v.stateNode.current.memoizedState.isDehydrated){l.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}l.blockedOn=null}function A(l){if(l.blockedOn!==null)return!1;for(var f=l.targetContainers;0<f.length;){var v=Jn(l.domEventName,l.eventSystemFlags,f[0],l.nativeEvent);if(v===null){v=l.nativeEvent;var j=new v.constructor(v.type,v);fa=j,v.target.dispatchEvent(j),fa=null}else return f=nu(v),f!==null&&cn(f),l.blockedOn=v,!1;f.shift()}return!0}function q(l,f,v){A(l)&&v.delete(f)}function H(){sr=!1,Yr!==null&&A(Yr)&&(Yr=null),yr!==null&&A(yr)&&(yr=null),kr!==null&&A(kr)&&(kr=null),Ba.forEach(q),xt.forEach(q)}function X(l,f){l.blockedOn===f&&(l.blockedOn=null,sr||(sr=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,H)))}function xe(l){function f(N){return X(N,l)}if(0<Ii.length){X(Ii[0],l);for(var v=1;v<Ii.length;v++){var j=Ii[v];j.blockedOn===l&&(j.blockedOn=null)}}for(Yr!==null&&X(Yr,l),yr!==null&&X(yr,l),kr!==null&&X(kr,l),Ba.forEach(f),xt.forEach(f),v=0;v<gn.length;v++)j=gn[v],j.blockedOn===l&&(j.blockedOn=null);for(;0<gn.length&&(v=gn[0],v.blockedOn===null);)Rs(v),v.blockedOn===null&&gn.shift()}var Le=D.ReactCurrentBatchConfig,Ge=!0;function zt(l,f,v,j){var N=un,F=Le.transition;Le.transition=null;try{un=1,Zt(l,f,v,j)}finally{un=N,Le.transition=F}}function Sn(l,f,v,j){var N=un,F=Le.transition;Le.transition=null;try{un=4,Zt(l,f,v,j)}finally{un=N,Le.transition=F}}function Zt(l,f,v,j){if(Ge){var N=Jn(l,f,v,j);if(N===null)u(l,f,j,Ln,v),$a(l,j);else if(Xi(N,l,f,v,j))j.stopPropagation();else if($a(l,j),f&4&&-1<On.indexOf(l)){for(;N!==null;){var F=nu(N);if(F!==null&&Ms(F),F=Jn(l,f,v,j),F===null&&u(l,f,j,Ln,v),F===N)break;N=F}N!==null&&j.stopPropagation()}else u(l,f,j,null,v)}}var Ln=null;function Jn(l,f,v,j){if(Ln=null,l=lt(j),l=tu(l),l!==null)if(f=Sr(l),f===null)l=null;else if(v=f.tag,v===13){if(l=ha(f),l!==null)return l;l=null}else if(v===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;l=null}else f!==l&&(l=null);return Ln=l,null}function rn(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ko()){case pa:return 1;case Yo:return 4;case Co:case Xo:return 16;case Ri:return 536870912;default:return 16}default:return 16}}var ga=null,ii=null,so=null;function yl(){if(so)return so;var l,f=ii,v=f.length,j,N="value"in ga?ga.value:ga.textContent,F=N.length;for(l=0;l<v&&f[l]===N[l];l++);var Y=v-l;for(j=1;j<=Y&&f[v-j]===N[F-j];j++);return so=N.slice(l,1<j?1-j:void 0)}function Jo(l){var f=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&f===13&&(l=13)):l=f,l===10&&(l=13),32<=l||l===13?l:0}function lo(){return!0}function Xl(){return!1}function Cr(l){function f(v,j,N,F,Y){this._reactName=v,this._targetInst=N,this.type=j,this.nativeEvent=F,this.target=Y,this.currentTarget=null;for(var se in l)l.hasOwnProperty(se)&&(v=l[se],this[se]=v?v(F):F[se]);return this.isDefaultPrevented=(F.defaultPrevented!=null?F.defaultPrevented:F.returnValue===!1)?lo:Xl,this.isPropagationStopped=Xl,this}return ae(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=lo)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=lo)},persist:function(){},isPersistent:lo}),f}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},es=Cr(Fa),uo=ae({},Fa,{view:0,detail:0}),Jc=Cr(uo),Pr,Ls,co,vi=ae({},uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qi,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==co&&(co&&l.type==="mousemove"?(Pr=l.screenX-co.screenX,Ls=l.screenY-co.screenY):Ls=Pr=0,co=l),Pr)},movementY:function(l){return"movementY"in l?l.movementY:Ls}}),Is=Cr(vi),Nr=ae({},vi,{dataTransfer:0}),Mo=Cr(Nr),Ds=ae({},uo,{relatedTarget:0}),ts=Cr(Ds),Bs=ae({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),Fu=Cr(Bs),qu=ae({},Fa,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),ns=Cr(qu),Ql=ae({},Fa,{data:0}),qa=Cr(Ql),$s={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rs={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},va={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jl(l){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(l):(l=va[l])?!!f[l]:!1}function Qi(){return Jl}var yi=ae({},uo,{key:function(l){if(l.key){var f=$s[l.key]||l.key;if(f!=="Unidentified")return f}return l.type==="keypress"?(l=Jo(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?rs[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qi,charCode:function(l){return l.type==="keypress"?Jo(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Jo(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),Fs=Cr(yi),is=ae({},vi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ne=Cr(is),Ze=ae({},uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qi}),jt=Cr(Ze),$t=ae({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),an=Cr($t),Tn=ae({},vi,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Ji=Cr(Tn),Gn=[9,13,27,32],Mr=s&&"CompositionEvent"in window,ai=null;s&&"documentMode"in document&&(ai=document.documentMode);var bi=s&&"TextEvent"in window&&!ai,za=s&&(!Mr||ai&&8<ai&&11>=ai),fo=" ",vd=!1;function bl(l,f){switch(l){case"keyup":return Gn.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ef(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ya=!1;function Ro(l,f){switch(l){case"compositionend":return ef(f);case"keypress":return f.which!==32?null:(vd=!0,fo);case"textInput":return l=f.data,l===fo&&vd?null:l;default:return null}}function Vn(l,f){if(ya)return l==="compositionend"||!Mr&&bl(l,f)?(l=yl(),so=ii=ga=null,ya=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return za&&f.locale!=="ko"?null:f.data;default:return null}}var qs={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function zs(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f==="input"?!!qs[l.type]:f==="textarea"}function zu(l,f,v,j){Cs(j),f=S(f,"onChange"),0<f.length&&(v=new es("onChange","change",null,v,j),l.push({event:v,listeners:f}))}var Us=null,Di=null;function Vs(l){yp(l,0)}function Ua(l){var f=ru(l);if(Te(f))return l}function xl(l,f){if(l==="change")return f}var Xr=!1;if(s){var Ws;if(s){var _="oninput"in document;if(!_){var O=document.createElement("div");O.setAttribute("oninput","return;"),_=typeof O.oninput=="function"}Ws=_}else Ws=!1;Xr=Ws&&(!document.documentMode||9<document.documentMode)}function B(){Us&&(Us.detachEvent("onpropertychange",z),Di=Us=null)}function z(l){if(l.propertyName==="value"&&Ua(Di)){var f=[];zu(f,Di,l,lt(l)),da(Vs,f)}}function W(l,f,v){l==="focusin"?(B(),Us=f,Di=v,Us.attachEvent("onpropertychange",z)):l==="focusout"&&B()}function G(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Ua(Di)}function J(l,f){if(l==="click")return Ua(f)}function te(l,f){if(l==="input"||l==="change")return Ua(f)}function be(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var Ee=typeof Object.is=="function"?Object.is:be;function pe(l,f){if(Ee(l,f))return!0;if(typeof l!="object"||l===null||typeof f!="object"||f===null)return!1;var v=Object.keys(l),j=Object.keys(f);if(v.length!==j.length)return!1;for(j=0;j<v.length;j++){var N=v[j];if(!c.call(f,N)||!Ee(l[N],f[N]))return!1}return!0}function me(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function we(l,f){var v=me(l);l=0;for(var j;v;){if(v.nodeType===3){if(j=l+v.textContent.length,l<=f&&j>=f)return{node:v,offset:f-l};l=j}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=me(v)}}function _e(l,f){return l&&f?l===f?!0:l&&l.nodeType===3?!1:f&&f.nodeType===3?_e(l,f.parentNode):"contains"in l?l.contains(f):l.compareDocumentPosition?!!(l.compareDocumentPosition(f)&16):!1:!1}function ye(){for(var l=window,f=Dt();f instanceof l.HTMLIFrameElement;){try{var v=typeof f.contentWindow.location.href=="string"}catch{v=!1}if(v)l=f.contentWindow;else break;f=Dt(l.document)}return f}function ve(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f&&(f==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||f==="textarea"||l.contentEditable==="true")}function ke(l){var f=ye(),v=l.focusedElem,j=l.selectionRange;if(f!==v&&v&&v.ownerDocument&&_e(v.ownerDocument.documentElement,v)){if(j!==null&&ve(v)){if(f=j.start,l=j.end,l===void 0&&(l=f),"selectionStart"in v)v.selectionStart=f,v.selectionEnd=Math.min(l,v.value.length);else if(l=(f=v.ownerDocument||document)&&f.defaultView||window,l.getSelection){l=l.getSelection();var N=v.textContent.length,F=Math.min(j.start,N);j=j.end===void 0?F:Math.min(j.end,N),!l.extend&&F>j&&(N=j,j=F,F=N),N=we(v,F);var Y=we(v,j);N&&Y&&(l.rangeCount!==1||l.anchorNode!==N.node||l.anchorOffset!==N.offset||l.focusNode!==Y.node||l.focusOffset!==Y.offset)&&(f=f.createRange(),f.setStart(N.node,N.offset),l.removeAllRanges(),F>j?(l.addRange(f),l.extend(Y.node,Y.offset)):(f.setEnd(Y.node,Y.offset),l.addRange(f)))}}for(f=[],l=v;l=l.parentNode;)l.nodeType===1&&f.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<f.length;v++)l=f[v],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var Ie=s&&"documentMode"in document&&11>=document.documentMode,Ae=null,Ve=null,Je=null,at=!1;function ut(l,f,v){var j=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;at||Ae==null||Ae!==Dt(j)||(j=Ae,"selectionStart"in j&&ve(j)?j={start:j.selectionStart,end:j.selectionEnd}:(j=(j.ownerDocument&&j.ownerDocument.defaultView||window).getSelection(),j={anchorNode:j.anchorNode,anchorOffset:j.anchorOffset,focusNode:j.focusNode,focusOffset:j.focusOffset}),Je&&pe(Je,j)||(Je=j,j=S(Ve,"onSelect"),0<j.length&&(f=new es("onSelect","select",null,f,v),l.push({event:f,listeners:j}),f.target=Ae)))}function Qe(l,f){var v={};return v[l.toLowerCase()]=f.toLowerCase(),v["Webkit"+l]="webkit"+f,v["Moz"+l]="moz"+f,v}var gt={animationend:Qe("Animation","AnimationEnd"),animationiteration:Qe("Animation","AnimationIteration"),animationstart:Qe("Animation","AnimationStart"),transitionend:Qe("Transition","TransitionEnd")},dt={},it={};s&&(it=document.createElement("div").style,"AnimationEvent"in window||(delete gt.animationend.animation,delete gt.animationiteration.animation,delete gt.animationstart.animation),"TransitionEvent"in window||delete gt.transitionend.transition);function vt(l){if(dt[l])return dt[l];if(!gt[l])return l;var f=gt[l],v;for(v in f)if(f.hasOwnProperty(v)&&v in it)return dt[l]=f[v];return l}var vn=vt("animationend"),on=vt("animationiteration"),Bt=vt("animationstart"),sn=vt("transitionend"),Wn=new Map,ea="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function En(l,f){Wn.set(l,f),a(f,[l])}for(var ta=0;ta<ea.length;ta++){var wl=ea[ta],Ug=wl.toLowerCase(),bx=wl[0].toUpperCase()+wl.slice(1);En(Ug,"on"+bx)}En(vn,"onAnimationEnd"),En(on,"onAnimationIteration"),En(Bt,"onAnimationStart"),En("dblclick","onDoubleClick"),En("focusin","onFocus"),En("focusout","onBlur"),En(sn,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Vg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Uu));function vp(l,f,v){var j=l.type||"unknown-event";l.currentTarget=v,La(j,f,void 0,l),l.currentTarget=null}function yp(l,f){f=(f&4)!==0;for(var v=0;v<l.length;v++){var j=l[v],N=j.event;j=j.listeners;e:{var F=void 0;if(f)for(var Y=j.length-1;0<=Y;Y--){var se=j[Y],ge=se.instance,qe=se.currentTarget;if(se=se.listener,ge!==F&&N.isPropagationStopped())break e;vp(N,se,qe),F=ge}else for(Y=0;Y<j.length;Y++){if(se=j[Y],ge=se.instance,qe=se.currentTarget,se=se.listener,ge!==F&&N.isPropagationStopped())break e;vp(N,se,qe),F=ge}}}if(to)throw l=Ra,to=!1,Ra=null,l}function rr(l,f){var v=f[Hu];v===void 0&&(v=f[Hu]=new Set);var j=l+"__bubble";v.has(j)||(Wg(f,l,2,!1),v.add(j))}function bp(l,f,v){var j=0;f&&(j|=4),Wg(v,l,j,f)}var tf="_reactListening"+Math.random().toString(36).slice(2);function Vu(l){if(!l[tf]){l[tf]=!0,r.forEach(function(v){v!=="selectionchange"&&(Vg.has(v)||bp(v,!1,l),bp(v,!0,l))});var f=l.nodeType===9?l:l.ownerDocument;f===null||f[tf]||(f[tf]=!0,bp("selectionchange",!1,f))}}function Wg(l,f,v,j){switch(rn(f)){case 1:var N=zt;break;case 4:N=Sn;break;default:N=Zt}v=N.bind(null,f,v,l),N=void 0,!Ao||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(N=!0),j?N!==void 0?l.addEventListener(f,v,{capture:!0,passive:N}):l.addEventListener(f,v,!0):N!==void 0?l.addEventListener(f,v,{passive:N}):l.addEventListener(f,v,!1)}function u(l,f,v,j,N){var F=j;if((f&1)===0&&(f&2)===0&&j!==null)e:for(;;){if(j===null)return;var Y=j.tag;if(Y===3||Y===4){var se=j.stateNode.containerInfo;if(se===N||se.nodeType===8&&se.parentNode===N)break;if(Y===4)for(Y=j.return;Y!==null;){var ge=Y.tag;if((ge===3||ge===4)&&(ge=Y.stateNode.containerInfo,ge===N||ge.nodeType===8&&ge.parentNode===N))return;Y=Y.return}for(;se!==null;){if(Y=tu(se),Y===null)return;if(ge=Y.tag,ge===5||ge===6){j=F=Y;continue e}se=se.parentNode}}j=j.return}da(function(){var qe=F,tt=lt(v),nt=[];e:{var et=Wn.get(l);if(et!==void 0){var wt=es,At=l;switch(l){case"keypress":if(Jo(v)===0)break e;case"keydown":case"keyup":wt=Fs;break;case"focusin":At="focus",wt=ts;break;case"focusout":At="blur",wt=ts;break;case"beforeblur":case"afterblur":wt=ts;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":wt=Is;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":wt=Mo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":wt=jt;break;case vn:case on:case Bt:wt=Fu;break;case sn:wt=an;break;case"scroll":wt=Jc;break;case"wheel":wt=Ji;break;case"copy":case"cut":case"paste":wt=ns;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":wt=Ne}var Nt=(f&4)!==0,Qr=!Nt&&l==="scroll",Re=Nt?et!==null?et+"Capture":null:et;Nt=[];for(var Pe=qe,De;Pe!==null;){De=Pe;var ot=De.stateNode;if(De.tag===5&&ot!==null&&(De=ot,Re!==null&&(ot=Ni(Pe,Re),ot!=null&&Nt.push(g(Pe,ot,De)))),Qr)break;Pe=Pe.return}0<Nt.length&&(et=new wt(et,At,null,v,tt),nt.push({event:et,listeners:Nt}))}}if((f&7)===0){e:{if(et=l==="mouseover"||l==="pointerover",wt=l==="mouseout"||l==="pointerout",et&&v!==fa&&(At=v.relatedTarget||v.fromElement)&&(tu(At)||At[Zn]))break e;if((wt||et)&&(et=tt.window===tt?tt:(et=tt.ownerDocument)?et.defaultView||et.parentWindow:window,wt?(At=v.relatedTarget||v.toElement,wt=qe,At=At?tu(At):null,At!==null&&(Qr=Sr(At),At!==Qr||At.tag!==5&&At.tag!==6)&&(At=null)):(wt=null,At=qe),wt!==At)){if(Nt=Is,ot="onMouseLeave",Re="onMouseEnter",Pe="mouse",(l==="pointerout"||l==="pointerover")&&(Nt=Ne,ot="onPointerLeave",Re="onPointerEnter",Pe="pointer"),Qr=wt==null?et:ru(wt),De=At==null?et:ru(At),et=new Nt(ot,Pe+"leave",wt,v,tt),et.target=Qr,et.relatedTarget=De,ot=null,tu(tt)===qe&&(Nt=new Nt(Re,Pe+"enter",At,v,tt),Nt.target=De,Nt.relatedTarget=Qr,ot=Nt),Qr=ot,wt&&At)t:{for(Nt=wt,Re=At,Pe=0,De=Nt;De;De=C(De))Pe++;for(De=0,ot=Re;ot;ot=C(ot))De++;for(;0<Pe-De;)Nt=C(Nt),Pe--;for(;0<De-Pe;)Re=C(Re),De--;for(;Pe--;){if(Nt===Re||Re!==null&&Nt===Re.alternate)break t;Nt=C(Nt),Re=C(Re)}Nt=null}else Nt=null;wt!==null&&U(nt,et,wt,Nt,!1),At!==null&&Qr!==null&&U(nt,Qr,At,Nt,!0)}}e:{if(et=qe?ru(qe):window,wt=et.nodeName&&et.nodeName.toLowerCase(),wt==="select"||wt==="input"&&et.type==="file")var It=xl;else if(zs(et))if(Xr)It=te;else{It=G;var Ht=W}else(wt=et.nodeName)&&wt.toLowerCase()==="input"&&(et.type==="checkbox"||et.type==="radio")&&(It=J);if(It&&(It=It(l,qe))){zu(nt,It,v,tt);break e}Ht&&Ht(l,et,qe),l==="focusout"&&(Ht=et._wrapperState)&&Ht.controlled&&et.type==="number"&&Zr(et,"number",et.value)}switch(Ht=qe?ru(qe):window,l){case"focusin":(zs(Ht)||Ht.contentEditable==="true")&&(Ae=Ht,Ve=qe,Je=null);break;case"focusout":Je=Ve=Ae=null;break;case"mousedown":at=!0;break;case"contextmenu":case"mouseup":case"dragend":at=!1,ut(nt,v,tt);break;case"selectionchange":if(Ie)break;case"keydown":case"keyup":ut(nt,v,tt)}var Gt;if(Mr)e:{switch(l){case"compositionstart":var en="onCompositionStart";break e;case"compositionend":en="onCompositionEnd";break e;case"compositionupdate":en="onCompositionUpdate";break e}en=void 0}else ya?bl(l,v)&&(en="onCompositionEnd"):l==="keydown"&&v.keyCode===229&&(en="onCompositionStart");en&&(za&&v.locale!=="ko"&&(ya||en!=="onCompositionStart"?en==="onCompositionEnd"&&ya&&(Gt=yl()):(ga=tt,ii="value"in ga?ga.value:ga.textContent,ya=!0)),Ht=S(qe,en),0<Ht.length&&(en=new qa(en,l,null,v,tt),nt.push({event:en,listeners:Ht}),Gt?en.data=Gt:(Gt=ef(v),Gt!==null&&(en.data=Gt)))),(Gt=bi?Ro(l,v):Vn(l,v))&&(qe=S(qe,"onBeforeInput"),0<qe.length&&(tt=new qa("onBeforeInput","beforeinput",null,v,tt),nt.push({event:tt,listeners:qe}),tt.data=Gt))}yp(nt,f)})}function g(l,f,v){return{instance:l,listener:f,currentTarget:v}}function S(l,f){for(var v=f+"Capture",j=[];l!==null;){var N=l,F=N.stateNode;N.tag===5&&F!==null&&(N=F,F=Ni(l,v),F!=null&&j.unshift(g(l,F,N)),F=Ni(l,f),F!=null&&j.push(g(l,F,N))),l=l.return}return j}function C(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function U(l,f,v,j,N){for(var F=f._reactName,Y=[];v!==null&&v!==j;){var se=v,ge=se.alternate,qe=se.stateNode;if(ge!==null&&ge===j)break;se.tag===5&&qe!==null&&(se=qe,N?(ge=Ni(v,F),ge!=null&&Y.unshift(g(v,ge,se))):N||(ge=Ni(v,F),ge!=null&&Y.push(g(v,ge,se)))),v=v.return}Y.length!==0&&l.push({event:f,listeners:Y})}var Q=/\r\n?/g,le=/\u0000|\uFFFD/g;function Me(l){return(typeof l=="string"?l:""+l).replace(Q,`
|
||
`).replace(le,"")}function Be(l,f,v){if(f=Me(f),Me(l)!==f&&v)throw Error(n(425))}function Xe(){}var yt=null,Wt=null;function hn(l,f){return l==="textarea"||l==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var xi=typeof setTimeout=="function"?setTimeout:void 0,oi=typeof clearTimeout=="function"?clearTimeout:void 0,Va=typeof Promise=="function"?Promise:void 0,ba=typeof queueMicrotask=="function"?queueMicrotask:typeof Va<"u"?function(l){return Va.resolve(null).then(l).catch(Wu)}:xi;function Wu(l){setTimeout(function(){throw l})}function xp(l,f){var v=f,j=0;do{var N=v.nextSibling;if(l.removeChild(v),N&&N.nodeType===8)if(v=N.data,v==="/$"){if(j===0){l.removeChild(N),xe(f);return}j--}else v!=="$"&&v!=="$?"&&v!=="$!"||j++;v=N}while(v);xe(f)}function _l(l){for(;l!=null;l=l.nextSibling){var f=l.nodeType;if(f===1||f===3)break;if(f===8){if(f=l.data,f==="$"||f==="$!"||f==="$?")break;if(f==="/$")return null}}return l}function Kg(l){l=l.previousSibling;for(var f=0;l;){if(l.nodeType===8){var v=l.data;if(v==="$"||v==="$!"||v==="$?"){if(f===0)return l;f--}else v==="/$"&&f++}l=l.previousSibling}return null}var eu=Math.random().toString(36).slice(2),as="__reactFiber$"+eu,Ku="__reactProps$"+eu,Zn="__reactContainer$"+eu,Hu="__reactEvents$"+eu,xx="__reactListeners$"+eu,wx="__reactHandles$"+eu;function tu(l){var f=l[as];if(f)return f;for(var v=l.parentNode;v;){if(f=v[Zn]||v[as]){if(v=f.alternate,f.child!==null||v!==null&&v.child!==null)for(l=Kg(l);l!==null;){if(v=l[as])return v;l=Kg(l)}return f}l=v,v=l.parentNode}return null}function nu(l){return l=l[as]||l[Zn],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function ru(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function yd(l){return l[Ku]||null}var _x=[],bd=-1;function Gu(l){return{current:l}}function br(l){0>bd||(l.current=_x[bd],_x[bd]=null,bd--)}function hr(l,f){bd++,_x[bd]=l.current,l.current=f}var Zu={},xa=Gu(Zu),ho=Gu(!1),nf=Zu;function xd(l,f){var v=l.type.contextTypes;if(!v)return Zu;var j=l.stateNode;if(j&&j.__reactInternalMemoizedUnmaskedChildContext===f)return j.__reactInternalMemoizedMaskedChildContext;var N={},F;for(F in v)N[F]=f[F];return j&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=f,l.__reactInternalMemoizedMaskedChildContext=N),N}function po(l){return l=l.childContextTypes,l!=null}function Hg(){br(ho),br(xa)}function Bk(l,f,v){if(xa.current!==Zu)throw Error(n(168));hr(xa,f),hr(ho,v)}function $k(l,f,v){var j=l.stateNode;if(f=f.childContextTypes,typeof j.getChildContext!="function")return v;j=j.getChildContext();for(var N in j)if(!(N in f))throw Error(n(108,Ye(l)||"Unknown",N));return ae({},v,j)}function Gg(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Zu,nf=xa.current,hr(xa,l),hr(ho,ho.current),!0}function Fk(l,f,v){var j=l.stateNode;if(!j)throw Error(n(169));v?(l=$k(l,f,nf),j.__reactInternalMemoizedMergedChildContext=l,br(ho),br(xa),hr(xa,l)):br(ho),hr(ho,v)}var iu=null,Zg=!1,Sx=!1;function qk(l){iu===null?iu=[l]:iu.push(l)}function mK(l){Zg=!0,qk(l)}function Yu(){if(!Sx&&iu!==null){Sx=!0;var l=0,f=un;try{var v=iu;for(un=1;l<v.length;l++){var j=v[l];do j=j(!0);while(j!==null)}iu=null,Zg=!1}catch(N){throw iu!==null&&(iu=iu.slice(l+1)),vl(pa,Yu),N}finally{un=f,Sx=!1}}return null}var wd=[],_d=0,Yg=null,Xg=0,os=[],ss=0,rf=null,au=1,ou="";function af(l,f){wd[_d++]=Xg,wd[_d++]=Yg,Yg=l,Xg=f}function zk(l,f,v){os[ss++]=au,os[ss++]=ou,os[ss++]=rf,rf=l;var j=au;l=ou;var N=32-ft(j)-1;j&=~(1<<N),v+=1;var F=32-ft(f)+N;if(30<F){var Y=N-N%5;F=(j&(1<<Y)-1).toString(32),j>>=Y,N-=Y,au=1<<32-ft(f)+N|v<<N|j,ou=F+l}else au=1<<F|v<<N|j,ou=l}function Px(l){l.return!==null&&(af(l,1),zk(l,1,0))}function jx(l){for(;l===Yg;)Yg=wd[--_d],wd[_d]=null,Xg=wd[--_d],wd[_d]=null;for(;l===rf;)rf=os[--ss],os[ss]=null,ou=os[--ss],os[ss]=null,au=os[--ss],os[ss]=null}var Lo=null,Io=null,jr=!1,Ks=null;function Uk(l,f){var v=fs(5,null,null,0);v.elementType="DELETED",v.stateNode=f,v.return=l,f=l.deletions,f===null?(l.deletions=[v],l.flags|=16):f.push(v)}function Vk(l,f){switch(l.tag){case 5:var v=l.type;return f=f.nodeType!==1||v.toLowerCase()!==f.nodeName.toLowerCase()?null:f,f!==null?(l.stateNode=f,Lo=l,Io=_l(f.firstChild),!0):!1;case 6:return f=l.pendingProps===""||f.nodeType!==3?null:f,f!==null?(l.stateNode=f,Lo=l,Io=null,!0):!1;case 13:return f=f.nodeType!==8?null:f,f!==null?(v=rf!==null?{id:au,overflow:ou}:null,l.memoizedState={dehydrated:f,treeContext:v,retryLane:1073741824},v=fs(18,null,null,0),v.stateNode=f,v.return=l,l.child=v,Lo=l,Io=null,!0):!1;default:return!1}}function Ox(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Tx(l){if(jr){var f=Io;if(f){var v=f;if(!Vk(l,f)){if(Ox(l))throw Error(n(418));f=_l(v.nextSibling);var j=Lo;f&&Vk(l,f)?Uk(j,v):(l.flags=l.flags&-4097|2,jr=!1,Lo=l)}}else{if(Ox(l))throw Error(n(418));l.flags=l.flags&-4097|2,jr=!1,Lo=l}}}function Wk(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Lo=l}function Qg(l){if(l!==Lo)return!1;if(!jr)return Wk(l),jr=!0,!1;var f;if((f=l.tag!==3)&&!(f=l.tag!==5)&&(f=l.type,f=f!=="head"&&f!=="body"&&!hn(l.type,l.memoizedProps)),f&&(f=Io)){if(Ox(l))throw Kk(),Error(n(418));for(;f;)Uk(l,f),f=_l(f.nextSibling)}if(Wk(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,f=0;l;){if(l.nodeType===8){var v=l.data;if(v==="/$"){if(f===0){Io=_l(l.nextSibling);break e}f--}else v!=="$"&&v!=="$!"&&v!=="$?"||f++}l=l.nextSibling}Io=null}}else Io=Lo?_l(l.stateNode.nextSibling):null;return!0}function Kk(){for(var l=Io;l;)l=_l(l.nextSibling)}function Sd(){Io=Lo=null,jr=!1}function Ex(l){Ks===null?Ks=[l]:Ks.push(l)}var gK=D.ReactCurrentBatchConfig;function wp(l,f,v){if(l=v.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(n(309));var j=v.stateNode}if(!j)throw Error(n(147,l));var N=j,F=""+l;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===F?f.ref:(f=function(Y){var se=N.refs;Y===null?delete se[F]:se[F]=Y},f._stringRef=F,f)}if(typeof l!="string")throw Error(n(284));if(!v._owner)throw Error(n(290,l))}return l}function Jg(l,f){throw l=Object.prototype.toString.call(f),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":l))}function Hk(l){var f=l._init;return f(l._payload)}function Gk(l){function f(Re,Pe){if(l){var De=Re.deletions;De===null?(Re.deletions=[Pe],Re.flags|=16):De.push(Pe)}}function v(Re,Pe){if(!l)return null;for(;Pe!==null;)f(Re,Pe),Pe=Pe.sibling;return null}function j(Re,Pe){for(Re=new Map;Pe!==null;)Pe.key!==null?Re.set(Pe.key,Pe):Re.set(Pe.index,Pe),Pe=Pe.sibling;return Re}function N(Re,Pe){return Re=ic(Re,Pe),Re.index=0,Re.sibling=null,Re}function F(Re,Pe,De){return Re.index=De,l?(De=Re.alternate,De!==null?(De=De.index,De<Pe?(Re.flags|=2,Pe):De):(Re.flags|=2,Pe)):(Re.flags|=1048576,Pe)}function Y(Re){return l&&Re.alternate===null&&(Re.flags|=2),Re}function se(Re,Pe,De,ot){return Pe===null||Pe.tag!==6?(Pe=bw(De,Re.mode,ot),Pe.return=Re,Pe):(Pe=N(Pe,De),Pe.return=Re,Pe)}function ge(Re,Pe,De,ot){var It=De.type;return It===$?tt(Re,Pe,De.props.children,ot,De.key):Pe!==null&&(Pe.elementType===It||typeof It=="object"&&It!==null&&It.$$typeof===fe&&Hk(It)===Pe.type)?(ot=N(Pe,De.props),ot.ref=wp(Re,Pe,De),ot.return=Re,ot):(ot=Sv(De.type,De.key,De.props,null,Re.mode,ot),ot.ref=wp(Re,Pe,De),ot.return=Re,ot)}function qe(Re,Pe,De,ot){return Pe===null||Pe.tag!==4||Pe.stateNode.containerInfo!==De.containerInfo||Pe.stateNode.implementation!==De.implementation?(Pe=xw(De,Re.mode,ot),Pe.return=Re,Pe):(Pe=N(Pe,De.children||[]),Pe.return=Re,Pe)}function tt(Re,Pe,De,ot,It){return Pe===null||Pe.tag!==7?(Pe=hf(De,Re.mode,ot,It),Pe.return=Re,Pe):(Pe=N(Pe,De),Pe.return=Re,Pe)}function nt(Re,Pe,De){if(typeof Pe=="string"&&Pe!==""||typeof Pe=="number")return Pe=bw(""+Pe,Re.mode,De),Pe.return=Re,Pe;if(typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case I:return De=Sv(Pe.type,Pe.key,Pe.props,null,Re.mode,De),De.ref=wp(Re,null,Pe),De.return=Re,De;case R:return Pe=xw(Pe,Re.mode,De),Pe.return=Re,Pe;case fe:var ot=Pe._init;return nt(Re,ot(Pe._payload),De)}if($r(Pe)||Ce(Pe))return Pe=hf(Pe,Re.mode,De,null),Pe.return=Re,Pe;Jg(Re,Pe)}return null}function et(Re,Pe,De,ot){var It=Pe!==null?Pe.key:null;if(typeof De=="string"&&De!==""||typeof De=="number")return It!==null?null:se(Re,Pe,""+De,ot);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case I:return De.key===It?ge(Re,Pe,De,ot):null;case R:return De.key===It?qe(Re,Pe,De,ot):null;case fe:return It=De._init,et(Re,Pe,It(De._payload),ot)}if($r(De)||Ce(De))return It!==null?null:tt(Re,Pe,De,ot,null);Jg(Re,De)}return null}function wt(Re,Pe,De,ot,It){if(typeof ot=="string"&&ot!==""||typeof ot=="number")return Re=Re.get(De)||null,se(Pe,Re,""+ot,It);if(typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case I:return Re=Re.get(ot.key===null?De:ot.key)||null,ge(Pe,Re,ot,It);case R:return Re=Re.get(ot.key===null?De:ot.key)||null,qe(Pe,Re,ot,It);case fe:var Ht=ot._init;return wt(Re,Pe,De,Ht(ot._payload),It)}if($r(ot)||Ce(ot))return Re=Re.get(De)||null,tt(Pe,Re,ot,It,null);Jg(Pe,ot)}return null}function At(Re,Pe,De,ot){for(var It=null,Ht=null,Gt=Pe,en=Pe=0,Fi=null;Gt!==null&&en<De.length;en++){Gt.index>en?(Fi=Gt,Gt=null):Fi=Gt.sibling;var Kn=et(Re,Gt,De[en],ot);if(Kn===null){Gt===null&&(Gt=Fi);break}l&&Gt&&Kn.alternate===null&&f(Re,Gt),Pe=F(Kn,Pe,en),Ht===null?It=Kn:Ht.sibling=Kn,Ht=Kn,Gt=Fi}if(en===De.length)return v(Re,Gt),jr&&af(Re,en),It;if(Gt===null){for(;en<De.length;en++)Gt=nt(Re,De[en],ot),Gt!==null&&(Pe=F(Gt,Pe,en),Ht===null?It=Gt:Ht.sibling=Gt,Ht=Gt);return jr&&af(Re,en),It}for(Gt=j(Re,Gt);en<De.length;en++)Fi=wt(Gt,Re,en,De[en],ot),Fi!==null&&(l&&Fi.alternate!==null&&Gt.delete(Fi.key===null?en:Fi.key),Pe=F(Fi,Pe,en),Ht===null?It=Fi:Ht.sibling=Fi,Ht=Fi);return l&&Gt.forEach(function(ac){return f(Re,ac)}),jr&&af(Re,en),It}function Nt(Re,Pe,De,ot){var It=Ce(De);if(typeof It!="function")throw Error(n(150));if(De=It.call(De),De==null)throw Error(n(151));for(var Ht=It=null,Gt=Pe,en=Pe=0,Fi=null,Kn=De.next();Gt!==null&&!Kn.done;en++,Kn=De.next()){Gt.index>en?(Fi=Gt,Gt=null):Fi=Gt.sibling;var ac=et(Re,Gt,Kn.value,ot);if(ac===null){Gt===null&&(Gt=Fi);break}l&&Gt&&ac.alternate===null&&f(Re,Gt),Pe=F(ac,Pe,en),Ht===null?It=ac:Ht.sibling=ac,Ht=ac,Gt=Fi}if(Kn.done)return v(Re,Gt),jr&&af(Re,en),It;if(Gt===null){for(;!Kn.done;en++,Kn=De.next())Kn=nt(Re,Kn.value,ot),Kn!==null&&(Pe=F(Kn,Pe,en),Ht===null?It=Kn:Ht.sibling=Kn,Ht=Kn);return jr&&af(Re,en),It}for(Gt=j(Re,Gt);!Kn.done;en++,Kn=De.next())Kn=wt(Gt,Re,en,Kn.value,ot),Kn!==null&&(l&&Kn.alternate!==null&&Gt.delete(Kn.key===null?en:Kn.key),Pe=F(Kn,Pe,en),Ht===null?It=Kn:Ht.sibling=Kn,Ht=Kn);return l&&Gt.forEach(function(ZK){return f(Re,ZK)}),jr&&af(Re,en),It}function Qr(Re,Pe,De,ot){if(typeof De=="object"&&De!==null&&De.type===$&&De.key===null&&(De=De.props.children),typeof De=="object"&&De!==null){switch(De.$$typeof){case I:e:{for(var It=De.key,Ht=Pe;Ht!==null;){if(Ht.key===It){if(It=De.type,It===$){if(Ht.tag===7){v(Re,Ht.sibling),Pe=N(Ht,De.props.children),Pe.return=Re,Re=Pe;break e}}else if(Ht.elementType===It||typeof It=="object"&&It!==null&&It.$$typeof===fe&&Hk(It)===Ht.type){v(Re,Ht.sibling),Pe=N(Ht,De.props),Pe.ref=wp(Re,Ht,De),Pe.return=Re,Re=Pe;break e}v(Re,Ht);break}else f(Re,Ht);Ht=Ht.sibling}De.type===$?(Pe=hf(De.props.children,Re.mode,ot,De.key),Pe.return=Re,Re=Pe):(ot=Sv(De.type,De.key,De.props,null,Re.mode,ot),ot.ref=wp(Re,Pe,De),ot.return=Re,Re=ot)}return Y(Re);case R:e:{for(Ht=De.key;Pe!==null;){if(Pe.key===Ht)if(Pe.tag===4&&Pe.stateNode.containerInfo===De.containerInfo&&Pe.stateNode.implementation===De.implementation){v(Re,Pe.sibling),Pe=N(Pe,De.children||[]),Pe.return=Re,Re=Pe;break e}else{v(Re,Pe);break}else f(Re,Pe);Pe=Pe.sibling}Pe=xw(De,Re.mode,ot),Pe.return=Re,Re=Pe}return Y(Re);case fe:return Ht=De._init,Qr(Re,Pe,Ht(De._payload),ot)}if($r(De))return At(Re,Pe,De,ot);if(Ce(De))return Nt(Re,Pe,De,ot);Jg(Re,De)}return typeof De=="string"&&De!==""||typeof De=="number"?(De=""+De,Pe!==null&&Pe.tag===6?(v(Re,Pe.sibling),Pe=N(Pe,De),Pe.return=Re,Re=Pe):(v(Re,Pe),Pe=bw(De,Re.mode,ot),Pe.return=Re,Re=Pe),Y(Re)):v(Re,Pe)}return Qr}var Pd=Gk(!0),Zk=Gk(!1),ev=Gu(null),tv=null,jd=null,Ax=null;function kx(){Ax=jd=tv=null}function Cx(l){var f=ev.current;br(ev),l._currentValue=f}function Nx(l,f,v){for(;l!==null;){var j=l.alternate;if((l.childLanes&f)!==f?(l.childLanes|=f,j!==null&&(j.childLanes|=f)):j!==null&&(j.childLanes&f)!==f&&(j.childLanes|=f),l===v)break;l=l.return}}function Od(l,f){tv=l,Ax=jd=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&f)!==0&&(mo=!0),l.firstContext=null)}function ls(l){var f=l._currentValue;if(Ax!==l)if(l={context:l,memoizedValue:f,next:null},jd===null){if(tv===null)throw Error(n(308));jd=l,tv.dependencies={lanes:0,firstContext:l}}else jd=jd.next=l;return f}var of=null;function Mx(l){of===null?of=[l]:of.push(l)}function Yk(l,f,v,j){var N=f.interleaved;return N===null?(v.next=v,Mx(f)):(v.next=N.next,N.next=v),f.interleaved=v,su(l,j)}function su(l,f){l.lanes|=f;var v=l.alternate;for(v!==null&&(v.lanes|=f),v=l,l=l.return;l!==null;)l.childLanes|=f,v=l.alternate,v!==null&&(v.childLanes|=f),v=l,l=l.return;return v.tag===3?v.stateNode:null}var Xu=!1;function Rx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xk(l,f){l=l.updateQueue,f.updateQueue===l&&(f.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function lu(l,f){return{eventTime:l,lane:f,tag:0,payload:null,callback:null,next:null}}function Qu(l,f,v){var j=l.updateQueue;if(j===null)return null;if(j=j.shared,(Fn&2)!==0){var N=j.pending;return N===null?f.next=f:(f.next=N.next,N.next=f),j.pending=f,su(l,v)}return N=j.interleaved,N===null?(f.next=f,Mx(j)):(f.next=N.next,N.next=f),j.interleaved=f,su(l,v)}function nv(l,f,v){if(f=f.updateQueue,f!==null&&(f=f.shared,(v&4194240)!==0)){var j=f.lanes;j&=l.pendingLanes,v|=j,f.lanes=v,zr(l,v)}}function Qk(l,f){var v=l.updateQueue,j=l.alternate;if(j!==null&&(j=j.updateQueue,v===j)){var N=null,F=null;if(v=v.firstBaseUpdate,v!==null){do{var Y={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};F===null?N=F=Y:F=F.next=Y,v=v.next}while(v!==null);F===null?N=F=f:F=F.next=f}else N=F=f;v={baseState:j.baseState,firstBaseUpdate:N,lastBaseUpdate:F,shared:j.shared,effects:j.effects},l.updateQueue=v;return}l=v.lastBaseUpdate,l===null?v.firstBaseUpdate=f:l.next=f,v.lastBaseUpdate=f}function rv(l,f,v,j){var N=l.updateQueue;Xu=!1;var F=N.firstBaseUpdate,Y=N.lastBaseUpdate,se=N.shared.pending;if(se!==null){N.shared.pending=null;var ge=se,qe=ge.next;ge.next=null,Y===null?F=qe:Y.next=qe,Y=ge;var tt=l.alternate;tt!==null&&(tt=tt.updateQueue,se=tt.lastBaseUpdate,se!==Y&&(se===null?tt.firstBaseUpdate=qe:se.next=qe,tt.lastBaseUpdate=ge))}if(F!==null){var nt=N.baseState;Y=0,tt=qe=ge=null,se=F;do{var et=se.lane,wt=se.eventTime;if((j&et)===et){tt!==null&&(tt=tt.next={eventTime:wt,lane:0,tag:se.tag,payload:se.payload,callback:se.callback,next:null});e:{var At=l,Nt=se;switch(et=f,wt=v,Nt.tag){case 1:if(At=Nt.payload,typeof At=="function"){nt=At.call(wt,nt,et);break e}nt=At;break e;case 3:At.flags=At.flags&-65537|128;case 0:if(At=Nt.payload,et=typeof At=="function"?At.call(wt,nt,et):At,et==null)break e;nt=ae({},nt,et);break e;case 2:Xu=!0}}se.callback!==null&&se.lane!==0&&(l.flags|=64,et=N.effects,et===null?N.effects=[se]:et.push(se))}else wt={eventTime:wt,lane:et,tag:se.tag,payload:se.payload,callback:se.callback,next:null},tt===null?(qe=tt=wt,ge=nt):tt=tt.next=wt,Y|=et;if(se=se.next,se===null){if(se=N.shared.pending,se===null)break;et=se,se=et.next,et.next=null,N.lastBaseUpdate=et,N.shared.pending=null}}while(!0);if(tt===null&&(ge=nt),N.baseState=ge,N.firstBaseUpdate=qe,N.lastBaseUpdate=tt,f=N.shared.interleaved,f!==null){N=f;do Y|=N.lane,N=N.next;while(N!==f)}else F===null&&(N.shared.lanes=0);uf|=Y,l.lanes=Y,l.memoizedState=nt}}function Jk(l,f,v){if(l=f.effects,f.effects=null,l!==null)for(f=0;f<l.length;f++){var j=l[f],N=j.callback;if(N!==null){if(j.callback=null,j=v,typeof N!="function")throw Error(n(191,N));N.call(j)}}}var _p={},Sl=Gu(_p),Sp=Gu(_p),Pp=Gu(_p);function sf(l){if(l===_p)throw Error(n(174));return l}function Lx(l,f){switch(hr(Pp,f),hr(Sp,l),hr(Sl,_p),l=f.nodeType,l){case 9:case 11:f=(f=f.documentElement)?f.namespaceURI:ca(null,"");break;default:l=l===8?f.parentNode:f,f=l.namespaceURI||null,l=l.tagName,f=ca(f,l)}br(Sl),hr(Sl,f)}function Td(){br(Sl),br(Sp),br(Pp)}function eC(l){sf(Pp.current);var f=sf(Sl.current),v=ca(f,l.type);f!==v&&(hr(Sp,l),hr(Sl,v))}function Ix(l){Sp.current===l&&(br(Sl),br(Sp))}var Rr=Gu(0);function iv(l){for(var f=l;f!==null;){if(f.tag===13){var v=f.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||v.data==="$?"||v.data==="$!"))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Dx=[];function Bx(){for(var l=0;l<Dx.length;l++)Dx[l]._workInProgressVersionPrimary=null;Dx.length=0}var av=D.ReactCurrentDispatcher,$x=D.ReactCurrentBatchConfig,lf=0,Lr=null,wi=null,Bi=null,ov=!1,jp=!1,Op=0,vK=0;function wa(){throw Error(n(321))}function Fx(l,f){if(f===null)return!1;for(var v=0;v<f.length&&v<l.length;v++)if(!Ee(l[v],f[v]))return!1;return!0}function qx(l,f,v,j,N,F){if(lf=F,Lr=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,av.current=l===null||l.memoizedState===null?wK:_K,l=v(j,N),jp){F=0;do{if(jp=!1,Op=0,25<=F)throw Error(n(301));F+=1,Bi=wi=null,f.updateQueue=null,av.current=SK,l=v(j,N)}while(jp)}if(av.current=uv,f=wi!==null&&wi.next!==null,lf=0,Bi=wi=Lr=null,ov=!1,f)throw Error(n(300));return l}function zx(){var l=Op!==0;return Op=0,l}function Pl(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bi===null?Lr.memoizedState=Bi=l:Bi=Bi.next=l,Bi}function us(){if(wi===null){var l=Lr.alternate;l=l!==null?l.memoizedState:null}else l=wi.next;var f=Bi===null?Lr.memoizedState:Bi.next;if(f!==null)Bi=f,wi=l;else{if(l===null)throw Error(n(310));wi=l,l={memoizedState:wi.memoizedState,baseState:wi.baseState,baseQueue:wi.baseQueue,queue:wi.queue,next:null},Bi===null?Lr.memoizedState=Bi=l:Bi=Bi.next=l}return Bi}function Tp(l,f){return typeof f=="function"?f(l):f}function Ux(l){var f=us(),v=f.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var j=wi,N=j.baseQueue,F=v.pending;if(F!==null){if(N!==null){var Y=N.next;N.next=F.next,F.next=Y}j.baseQueue=N=F,v.pending=null}if(N!==null){F=N.next,j=j.baseState;var se=Y=null,ge=null,qe=F;do{var tt=qe.lane;if((lf&tt)===tt)ge!==null&&(ge=ge.next={lane:0,action:qe.action,hasEagerState:qe.hasEagerState,eagerState:qe.eagerState,next:null}),j=qe.hasEagerState?qe.eagerState:l(j,qe.action);else{var nt={lane:tt,action:qe.action,hasEagerState:qe.hasEagerState,eagerState:qe.eagerState,next:null};ge===null?(se=ge=nt,Y=j):ge=ge.next=nt,Lr.lanes|=tt,uf|=tt}qe=qe.next}while(qe!==null&&qe!==F);ge===null?Y=j:ge.next=se,Ee(j,f.memoizedState)||(mo=!0),f.memoizedState=j,f.baseState=Y,f.baseQueue=ge,v.lastRenderedState=j}if(l=v.interleaved,l!==null){N=l;do F=N.lane,Lr.lanes|=F,uf|=F,N=N.next;while(N!==l)}else N===null&&(v.lanes=0);return[f.memoizedState,v.dispatch]}function Vx(l){var f=us(),v=f.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var j=v.dispatch,N=v.pending,F=f.memoizedState;if(N!==null){v.pending=null;var Y=N=N.next;do F=l(F,Y.action),Y=Y.next;while(Y!==N);Ee(F,f.memoizedState)||(mo=!0),f.memoizedState=F,f.baseQueue===null&&(f.baseState=F),v.lastRenderedState=F}return[F,j]}function tC(){}function nC(l,f){var v=Lr,j=us(),N=f(),F=!Ee(j.memoizedState,N);if(F&&(j.memoizedState=N,mo=!0),j=j.queue,Wx(aC.bind(null,v,j,l),[l]),j.getSnapshot!==f||F||Bi!==null&&Bi.memoizedState.tag&1){if(v.flags|=2048,Ep(9,iC.bind(null,v,j,N,f),void 0,null),$i===null)throw Error(n(349));(lf&30)!==0||rC(v,f,N)}return N}function rC(l,f,v){l.flags|=16384,l={getSnapshot:f,value:v},f=Lr.updateQueue,f===null?(f={lastEffect:null,stores:null},Lr.updateQueue=f,f.stores=[l]):(v=f.stores,v===null?f.stores=[l]:v.push(l))}function iC(l,f,v,j){f.value=v,f.getSnapshot=j,oC(f)&&sC(l)}function aC(l,f,v){return v(function(){oC(f)&&sC(l)})}function oC(l){var f=l.getSnapshot;l=l.value;try{var v=f();return!Ee(l,v)}catch{return!0}}function sC(l){var f=su(l,1);f!==null&&Ys(f,l,1,-1)}function lC(l){var f=Pl();return typeof l=="function"&&(l=l()),f.memoizedState=f.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Tp,lastRenderedState:l},f.queue=l,l=l.dispatch=xK.bind(null,Lr,l),[f.memoizedState,l]}function Ep(l,f,v,j){return l={tag:l,create:f,destroy:v,deps:j,next:null},f=Lr.updateQueue,f===null?(f={lastEffect:null,stores:null},Lr.updateQueue=f,f.lastEffect=l.next=l):(v=f.lastEffect,v===null?f.lastEffect=l.next=l:(j=v.next,v.next=l,l.next=j,f.lastEffect=l)),l}function uC(){return us().memoizedState}function sv(l,f,v,j){var N=Pl();Lr.flags|=l,N.memoizedState=Ep(1|f,v,void 0,j===void 0?null:j)}function lv(l,f,v,j){var N=us();j=j===void 0?null:j;var F=void 0;if(wi!==null){var Y=wi.memoizedState;if(F=Y.destroy,j!==null&&Fx(j,Y.deps)){N.memoizedState=Ep(f,v,F,j);return}}Lr.flags|=l,N.memoizedState=Ep(1|f,v,F,j)}function cC(l,f){return sv(8390656,8,l,f)}function Wx(l,f){return lv(2048,8,l,f)}function fC(l,f){return lv(4,2,l,f)}function dC(l,f){return lv(4,4,l,f)}function hC(l,f){if(typeof f=="function")return l=l(),f(l),function(){f(null)};if(f!=null)return l=l(),f.current=l,function(){f.current=null}}function pC(l,f,v){return v=v!=null?v.concat([l]):null,lv(4,4,hC.bind(null,f,l),v)}function Kx(){}function mC(l,f){var v=us();f=f===void 0?null:f;var j=v.memoizedState;return j!==null&&f!==null&&Fx(f,j[1])?j[0]:(v.memoizedState=[l,f],l)}function gC(l,f){var v=us();f=f===void 0?null:f;var j=v.memoizedState;return j!==null&&f!==null&&Fx(f,j[1])?j[0]:(l=l(),v.memoizedState=[l,f],l)}function vC(l,f,v){return(lf&21)===0?(l.baseState&&(l.baseState=!1,mo=!0),l.memoizedState=v):(Ee(v,f)||(v=io(),Lr.lanes|=v,uf|=v,l.baseState=!0),f)}function yK(l,f){var v=un;un=v!==0&&4>v?v:4,l(!0);var j=$x.transition;$x.transition={};try{l(!1),f()}finally{un=v,$x.transition=j}}function yC(){return us().memoizedState}function bK(l,f,v){var j=nc(l);if(v={lane:j,action:v,hasEagerState:!1,eagerState:null,next:null},bC(l))xC(f,v);else if(v=Yk(l,f,v,j),v!==null){var N=Ka();Ys(v,l,j,N),wC(v,f,j)}}function xK(l,f,v){var j=nc(l),N={lane:j,action:v,hasEagerState:!1,eagerState:null,next:null};if(bC(l))xC(f,N);else{var F=l.alternate;if(l.lanes===0&&(F===null||F.lanes===0)&&(F=f.lastRenderedReducer,F!==null))try{var Y=f.lastRenderedState,se=F(Y,v);if(N.hasEagerState=!0,N.eagerState=se,Ee(se,Y)){var ge=f.interleaved;ge===null?(N.next=N,Mx(f)):(N.next=ge.next,ge.next=N),f.interleaved=N;return}}catch{}finally{}v=Yk(l,f,N,j),v!==null&&(N=Ka(),Ys(v,l,j,N),wC(v,f,j))}}function bC(l){var f=l.alternate;return l===Lr||f!==null&&f===Lr}function xC(l,f){jp=ov=!0;var v=l.pending;v===null?f.next=f:(f.next=v.next,v.next=f),l.pending=f}function wC(l,f,v){if((v&4194240)!==0){var j=f.lanes;j&=l.pendingLanes,v|=j,f.lanes=v,zr(l,v)}}var uv={readContext:ls,useCallback:wa,useContext:wa,useEffect:wa,useImperativeHandle:wa,useInsertionEffect:wa,useLayoutEffect:wa,useMemo:wa,useReducer:wa,useRef:wa,useState:wa,useDebugValue:wa,useDeferredValue:wa,useTransition:wa,useMutableSource:wa,useSyncExternalStore:wa,useId:wa,unstable_isNewReconciler:!1},wK={readContext:ls,useCallback:function(l,f){return Pl().memoizedState=[l,f===void 0?null:f],l},useContext:ls,useEffect:cC,useImperativeHandle:function(l,f,v){return v=v!=null?v.concat([l]):null,sv(4194308,4,hC.bind(null,f,l),v)},useLayoutEffect:function(l,f){return sv(4194308,4,l,f)},useInsertionEffect:function(l,f){return sv(4,2,l,f)},useMemo:function(l,f){var v=Pl();return f=f===void 0?null:f,l=l(),v.memoizedState=[l,f],l},useReducer:function(l,f,v){var j=Pl();return f=v!==void 0?v(f):f,j.memoizedState=j.baseState=f,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:f},j.queue=l,l=l.dispatch=bK.bind(null,Lr,l),[j.memoizedState,l]},useRef:function(l){var f=Pl();return l={current:l},f.memoizedState=l},useState:lC,useDebugValue:Kx,useDeferredValue:function(l){return Pl().memoizedState=l},useTransition:function(){var l=lC(!1),f=l[0];return l=yK.bind(null,l[1]),Pl().memoizedState=l,[f,l]},useMutableSource:function(){},useSyncExternalStore:function(l,f,v){var j=Lr,N=Pl();if(jr){if(v===void 0)throw Error(n(407));v=v()}else{if(v=f(),$i===null)throw Error(n(349));(lf&30)!==0||rC(j,f,v)}N.memoizedState=v;var F={value:v,getSnapshot:f};return N.queue=F,cC(aC.bind(null,j,F,l),[l]),j.flags|=2048,Ep(9,iC.bind(null,j,F,v,f),void 0,null),v},useId:function(){var l=Pl(),f=$i.identifierPrefix;if(jr){var v=ou,j=au;v=(j&~(1<<32-ft(j)-1)).toString(32)+v,f=":"+f+"R"+v,v=Op++,0<v&&(f+="H"+v.toString(32)),f+=":"}else v=vK++,f=":"+f+"r"+v.toString(32)+":";return l.memoizedState=f},unstable_isNewReconciler:!1},_K={readContext:ls,useCallback:mC,useContext:ls,useEffect:Wx,useImperativeHandle:pC,useInsertionEffect:fC,useLayoutEffect:dC,useMemo:gC,useReducer:Ux,useRef:uC,useState:function(){return Ux(Tp)},useDebugValue:Kx,useDeferredValue:function(l){var f=us();return vC(f,wi.memoizedState,l)},useTransition:function(){var l=Ux(Tp)[0],f=us().memoizedState;return[l,f]},useMutableSource:tC,useSyncExternalStore:nC,useId:yC,unstable_isNewReconciler:!1},SK={readContext:ls,useCallback:mC,useContext:ls,useEffect:Wx,useImperativeHandle:pC,useInsertionEffect:fC,useLayoutEffect:dC,useMemo:gC,useReducer:Vx,useRef:uC,useState:function(){return Vx(Tp)},useDebugValue:Kx,useDeferredValue:function(l){var f=us();return wi===null?f.memoizedState=l:vC(f,wi.memoizedState,l)},useTransition:function(){var l=Vx(Tp)[0],f=us().memoizedState;return[l,f]},useMutableSource:tC,useSyncExternalStore:nC,useId:yC,unstable_isNewReconciler:!1};function Hs(l,f){if(l&&l.defaultProps){f=ae({},f),l=l.defaultProps;for(var v in l)f[v]===void 0&&(f[v]=l[v]);return f}return f}function Hx(l,f,v,j){f=l.memoizedState,v=v(j,f),v=v==null?f:ae({},f,v),l.memoizedState=v,l.lanes===0&&(l.updateQueue.baseState=v)}var cv={isMounted:function(l){return(l=l._reactInternals)?Sr(l)===l:!1},enqueueSetState:function(l,f,v){l=l._reactInternals;var j=Ka(),N=nc(l),F=lu(j,N);F.payload=f,v!=null&&(F.callback=v),f=Qu(l,F,N),f!==null&&(Ys(f,l,N,j),nv(f,l,N))},enqueueReplaceState:function(l,f,v){l=l._reactInternals;var j=Ka(),N=nc(l),F=lu(j,N);F.tag=1,F.payload=f,v!=null&&(F.callback=v),f=Qu(l,F,N),f!==null&&(Ys(f,l,N,j),nv(f,l,N))},enqueueForceUpdate:function(l,f){l=l._reactInternals;var v=Ka(),j=nc(l),N=lu(v,j);N.tag=2,f!=null&&(N.callback=f),f=Qu(l,N,j),f!==null&&(Ys(f,l,j,v),nv(f,l,j))}};function _C(l,f,v,j,N,F,Y){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(j,F,Y):f.prototype&&f.prototype.isPureReactComponent?!pe(v,j)||!pe(N,F):!0}function SC(l,f,v){var j=!1,N=Zu,F=f.contextType;return typeof F=="object"&&F!==null?F=ls(F):(N=po(f)?nf:xa.current,j=f.contextTypes,F=(j=j!=null)?xd(l,N):Zu),f=new f(v,F),l.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=cv,l.stateNode=f,f._reactInternals=l,j&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=N,l.__reactInternalMemoizedMaskedChildContext=F),f}function PC(l,f,v,j){l=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(v,j),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(v,j),f.state!==l&&cv.enqueueReplaceState(f,f.state,null)}function Gx(l,f,v,j){var N=l.stateNode;N.props=v,N.state=l.memoizedState,N.refs={},Rx(l);var F=f.contextType;typeof F=="object"&&F!==null?N.context=ls(F):(F=po(f)?nf:xa.current,N.context=xd(l,F)),N.state=l.memoizedState,F=f.getDerivedStateFromProps,typeof F=="function"&&(Hx(l,f,F,v),N.state=l.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(f=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),f!==N.state&&cv.enqueueReplaceState(N,N.state,null),rv(l,v,N,j),N.state=l.memoizedState),typeof N.componentDidMount=="function"&&(l.flags|=4194308)}function Ed(l,f){try{var v="",j=f;do v+=$e(j),j=j.return;while(j);var N=v}catch(F){N=`
|
||
Error generating stack: `+F.message+`
|
||
`+F.stack}return{value:l,source:f,stack:N,digest:null}}function Zx(l,f,v){return{value:l,source:null,stack:v??null,digest:f??null}}function Yx(l,f){try{console.error(f.value)}catch(v){setTimeout(function(){throw v})}}var PK=typeof WeakMap=="function"?WeakMap:Map;function jC(l,f,v){v=lu(-1,v),v.tag=3,v.payload={element:null};var j=f.value;return v.callback=function(){vv||(vv=!0,fw=j),Yx(l,f)},v}function OC(l,f,v){v=lu(-1,v),v.tag=3;var j=l.type.getDerivedStateFromError;if(typeof j=="function"){var N=f.value;v.payload=function(){return j(N)},v.callback=function(){Yx(l,f)}}var F=l.stateNode;return F!==null&&typeof F.componentDidCatch=="function"&&(v.callback=function(){Yx(l,f),typeof j!="function"&&(ec===null?ec=new Set([this]):ec.add(this));var Y=f.stack;this.componentDidCatch(f.value,{componentStack:Y!==null?Y:""})}),v}function TC(l,f,v){var j=l.pingCache;if(j===null){j=l.pingCache=new PK;var N=new Set;j.set(f,N)}else N=j.get(f),N===void 0&&(N=new Set,j.set(f,N));N.has(v)||(N.add(v),l=BK.bind(null,l,f,v),f.then(l,l))}function EC(l){do{var f;if((f=l.tag===13)&&(f=l.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return l;l=l.return}while(l!==null);return null}function AC(l,f,v,j,N){return(l.mode&1)===0?(l===f?l.flags|=65536:(l.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(f=lu(-1,1),f.tag=2,Qu(v,f,1))),v.lanes|=1),l):(l.flags|=65536,l.lanes=N,l)}var jK=D.ReactCurrentOwner,mo=!1;function Wa(l,f,v,j){f.child=l===null?Zk(f,null,v,j):Pd(f,l.child,v,j)}function kC(l,f,v,j,N){v=v.render;var F=f.ref;return Od(f,N),j=qx(l,f,v,j,F,N),v=zx(),l!==null&&!mo?(f.updateQueue=l.updateQueue,f.flags&=-2053,l.lanes&=~N,uu(l,f,N)):(jr&&v&&Px(f),f.flags|=1,Wa(l,f,j,N),f.child)}function CC(l,f,v,j,N){if(l===null){var F=v.type;return typeof F=="function"&&!yw(F)&&F.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(f.tag=15,f.type=F,NC(l,f,F,j,N)):(l=Sv(v.type,null,j,f,f.mode,N),l.ref=f.ref,l.return=f,f.child=l)}if(F=l.child,(l.lanes&N)===0){var Y=F.memoizedProps;if(v=v.compare,v=v!==null?v:pe,v(Y,j)&&l.ref===f.ref)return uu(l,f,N)}return f.flags|=1,l=ic(F,j),l.ref=f.ref,l.return=f,f.child=l}function NC(l,f,v,j,N){if(l!==null){var F=l.memoizedProps;if(pe(F,j)&&l.ref===f.ref)if(mo=!1,f.pendingProps=j=F,(l.lanes&N)!==0)(l.flags&131072)!==0&&(mo=!0);else return f.lanes=l.lanes,uu(l,f,N)}return Xx(l,f,v,j,N)}function MC(l,f,v){var j=f.pendingProps,N=j.children,F=l!==null?l.memoizedState:null;if(j.mode==="hidden")if((f.mode&1)===0)f.memoizedState={baseLanes:0,cachePool:null,transitions:null},hr(kd,Do),Do|=v;else{if((v&1073741824)===0)return l=F!==null?F.baseLanes|v:v,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:l,cachePool:null,transitions:null},f.updateQueue=null,hr(kd,Do),Do|=l,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},j=F!==null?F.baseLanes:v,hr(kd,Do),Do|=j}else F!==null?(j=F.baseLanes|v,f.memoizedState=null):j=v,hr(kd,Do),Do|=j;return Wa(l,f,N,v),f.child}function RC(l,f){var v=f.ref;(l===null&&v!==null||l!==null&&l.ref!==v)&&(f.flags|=512,f.flags|=2097152)}function Xx(l,f,v,j,N){var F=po(v)?nf:xa.current;return F=xd(f,F),Od(f,N),v=qx(l,f,v,j,F,N),j=zx(),l!==null&&!mo?(f.updateQueue=l.updateQueue,f.flags&=-2053,l.lanes&=~N,uu(l,f,N)):(jr&&j&&Px(f),f.flags|=1,Wa(l,f,v,N),f.child)}function LC(l,f,v,j,N){if(po(v)){var F=!0;Gg(f)}else F=!1;if(Od(f,N),f.stateNode===null)dv(l,f),SC(f,v,j),Gx(f,v,j,N),j=!0;else if(l===null){var Y=f.stateNode,se=f.memoizedProps;Y.props=se;var ge=Y.context,qe=v.contextType;typeof qe=="object"&&qe!==null?qe=ls(qe):(qe=po(v)?nf:xa.current,qe=xd(f,qe));var tt=v.getDerivedStateFromProps,nt=typeof tt=="function"||typeof Y.getSnapshotBeforeUpdate=="function";nt||typeof Y.UNSAFE_componentWillReceiveProps!="function"&&typeof Y.componentWillReceiveProps!="function"||(se!==j||ge!==qe)&&PC(f,Y,j,qe),Xu=!1;var et=f.memoizedState;Y.state=et,rv(f,j,Y,N),ge=f.memoizedState,se!==j||et!==ge||ho.current||Xu?(typeof tt=="function"&&(Hx(f,v,tt,j),ge=f.memoizedState),(se=Xu||_C(f,v,se,j,et,ge,qe))?(nt||typeof Y.UNSAFE_componentWillMount!="function"&&typeof Y.componentWillMount!="function"||(typeof Y.componentWillMount=="function"&&Y.componentWillMount(),typeof Y.UNSAFE_componentWillMount=="function"&&Y.UNSAFE_componentWillMount()),typeof Y.componentDidMount=="function"&&(f.flags|=4194308)):(typeof Y.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=j,f.memoizedState=ge),Y.props=j,Y.state=ge,Y.context=qe,j=se):(typeof Y.componentDidMount=="function"&&(f.flags|=4194308),j=!1)}else{Y=f.stateNode,Xk(l,f),se=f.memoizedProps,qe=f.type===f.elementType?se:Hs(f.type,se),Y.props=qe,nt=f.pendingProps,et=Y.context,ge=v.contextType,typeof ge=="object"&&ge!==null?ge=ls(ge):(ge=po(v)?nf:xa.current,ge=xd(f,ge));var wt=v.getDerivedStateFromProps;(tt=typeof wt=="function"||typeof Y.getSnapshotBeforeUpdate=="function")||typeof Y.UNSAFE_componentWillReceiveProps!="function"&&typeof Y.componentWillReceiveProps!="function"||(se!==nt||et!==ge)&&PC(f,Y,j,ge),Xu=!1,et=f.memoizedState,Y.state=et,rv(f,j,Y,N);var At=f.memoizedState;se!==nt||et!==At||ho.current||Xu?(typeof wt=="function"&&(Hx(f,v,wt,j),At=f.memoizedState),(qe=Xu||_C(f,v,qe,j,et,At,ge)||!1)?(tt||typeof Y.UNSAFE_componentWillUpdate!="function"&&typeof Y.componentWillUpdate!="function"||(typeof Y.componentWillUpdate=="function"&&Y.componentWillUpdate(j,At,ge),typeof Y.UNSAFE_componentWillUpdate=="function"&&Y.UNSAFE_componentWillUpdate(j,At,ge)),typeof Y.componentDidUpdate=="function"&&(f.flags|=4),typeof Y.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof Y.componentDidUpdate!="function"||se===l.memoizedProps&&et===l.memoizedState||(f.flags|=4),typeof Y.getSnapshotBeforeUpdate!="function"||se===l.memoizedProps&&et===l.memoizedState||(f.flags|=1024),f.memoizedProps=j,f.memoizedState=At),Y.props=j,Y.state=At,Y.context=ge,j=qe):(typeof Y.componentDidUpdate!="function"||se===l.memoizedProps&&et===l.memoizedState||(f.flags|=4),typeof Y.getSnapshotBeforeUpdate!="function"||se===l.memoizedProps&&et===l.memoizedState||(f.flags|=1024),j=!1)}return Qx(l,f,v,j,F,N)}function Qx(l,f,v,j,N,F){RC(l,f);var Y=(f.flags&128)!==0;if(!j&&!Y)return N&&Fk(f,v,!1),uu(l,f,F);j=f.stateNode,jK.current=f;var se=Y&&typeof v.getDerivedStateFromError!="function"?null:j.render();return f.flags|=1,l!==null&&Y?(f.child=Pd(f,l.child,null,F),f.child=Pd(f,null,se,F)):Wa(l,f,se,F),f.memoizedState=j.state,N&&Fk(f,v,!0),f.child}function IC(l){var f=l.stateNode;f.pendingContext?Bk(l,f.pendingContext,f.pendingContext!==f.context):f.context&&Bk(l,f.context,!1),Lx(l,f.containerInfo)}function DC(l,f,v,j,N){return Sd(),Ex(N),f.flags|=256,Wa(l,f,v,j),f.child}var Jx={dehydrated:null,treeContext:null,retryLane:0};function ew(l){return{baseLanes:l,cachePool:null,transitions:null}}function BC(l,f,v){var j=f.pendingProps,N=Rr.current,F=!1,Y=(f.flags&128)!==0,se;if((se=Y)||(se=l!==null&&l.memoizedState===null?!1:(N&2)!==0),se?(F=!0,f.flags&=-129):(l===null||l.memoizedState!==null)&&(N|=1),hr(Rr,N&1),l===null)return Tx(f),l=f.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((f.mode&1)===0?f.lanes=1:l.data==="$!"?f.lanes=8:f.lanes=1073741824,null):(Y=j.children,l=j.fallback,F?(j=f.mode,F=f.child,Y={mode:"hidden",children:Y},(j&1)===0&&F!==null?(F.childLanes=0,F.pendingProps=Y):F=Pv(Y,j,0,null),l=hf(l,j,v,null),F.return=f,l.return=f,F.sibling=l,f.child=F,f.child.memoizedState=ew(v),f.memoizedState=Jx,l):tw(f,Y));if(N=l.memoizedState,N!==null&&(se=N.dehydrated,se!==null))return OK(l,f,Y,j,se,N,v);if(F){F=j.fallback,Y=f.mode,N=l.child,se=N.sibling;var ge={mode:"hidden",children:j.children};return(Y&1)===0&&f.child!==N?(j=f.child,j.childLanes=0,j.pendingProps=ge,f.deletions=null):(j=ic(N,ge),j.subtreeFlags=N.subtreeFlags&14680064),se!==null?F=ic(se,F):(F=hf(F,Y,v,null),F.flags|=2),F.return=f,j.return=f,j.sibling=F,f.child=j,j=F,F=f.child,Y=l.child.memoizedState,Y=Y===null?ew(v):{baseLanes:Y.baseLanes|v,cachePool:null,transitions:Y.transitions},F.memoizedState=Y,F.childLanes=l.childLanes&~v,f.memoizedState=Jx,j}return F=l.child,l=F.sibling,j=ic(F,{mode:"visible",children:j.children}),(f.mode&1)===0&&(j.lanes=v),j.return=f,j.sibling=null,l!==null&&(v=f.deletions,v===null?(f.deletions=[l],f.flags|=16):v.push(l)),f.child=j,f.memoizedState=null,j}function tw(l,f){return f=Pv({mode:"visible",children:f},l.mode,0,null),f.return=l,l.child=f}function fv(l,f,v,j){return j!==null&&Ex(j),Pd(f,l.child,null,v),l=tw(f,f.pendingProps.children),l.flags|=2,f.memoizedState=null,l}function OK(l,f,v,j,N,F,Y){if(v)return f.flags&256?(f.flags&=-257,j=Zx(Error(n(422))),fv(l,f,Y,j)):f.memoizedState!==null?(f.child=l.child,f.flags|=128,null):(F=j.fallback,N=f.mode,j=Pv({mode:"visible",children:j.children},N,0,null),F=hf(F,N,Y,null),F.flags|=2,j.return=f,F.return=f,j.sibling=F,f.child=j,(f.mode&1)!==0&&Pd(f,l.child,null,Y),f.child.memoizedState=ew(Y),f.memoizedState=Jx,F);if((f.mode&1)===0)return fv(l,f,Y,null);if(N.data==="$!"){if(j=N.nextSibling&&N.nextSibling.dataset,j)var se=j.dgst;return j=se,F=Error(n(419)),j=Zx(F,j,void 0),fv(l,f,Y,j)}if(se=(Y&l.childLanes)!==0,mo||se){if(j=$i,j!==null){switch(Y&-Y){case 4:N=2;break;case 16:N=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:N=32;break;case 536870912:N=268435456;break;default:N=0}N=(N&(j.suspendedLanes|Y))!==0?0:N,N!==0&&N!==F.retryLane&&(F.retryLane=N,su(l,N),Ys(j,l,N,-1))}return vw(),j=Zx(Error(n(421))),fv(l,f,Y,j)}return N.data==="$?"?(f.flags|=128,f.child=l.child,f=$K.bind(null,l),N._reactRetry=f,null):(l=F.treeContext,Io=_l(N.nextSibling),Lo=f,jr=!0,Ks=null,l!==null&&(os[ss++]=au,os[ss++]=ou,os[ss++]=rf,au=l.id,ou=l.overflow,rf=f),f=tw(f,j.children),f.flags|=4096,f)}function $C(l,f,v){l.lanes|=f;var j=l.alternate;j!==null&&(j.lanes|=f),Nx(l.return,f,v)}function nw(l,f,v,j,N){var F=l.memoizedState;F===null?l.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:j,tail:v,tailMode:N}:(F.isBackwards=f,F.rendering=null,F.renderingStartTime=0,F.last=j,F.tail=v,F.tailMode=N)}function FC(l,f,v){var j=f.pendingProps,N=j.revealOrder,F=j.tail;if(Wa(l,f,j.children,v),j=Rr.current,(j&2)!==0)j=j&1|2,f.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=f.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&$C(l,v,f);else if(l.tag===19)$C(l,v,f);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===f)break e;for(;l.sibling===null;){if(l.return===null||l.return===f)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}j&=1}if(hr(Rr,j),(f.mode&1)===0)f.memoizedState=null;else switch(N){case"forwards":for(v=f.child,N=null;v!==null;)l=v.alternate,l!==null&&iv(l)===null&&(N=v),v=v.sibling;v=N,v===null?(N=f.child,f.child=null):(N=v.sibling,v.sibling=null),nw(f,!1,N,v,F);break;case"backwards":for(v=null,N=f.child,f.child=null;N!==null;){if(l=N.alternate,l!==null&&iv(l)===null){f.child=N;break}l=N.sibling,N.sibling=v,v=N,N=l}nw(f,!0,v,null,F);break;case"together":nw(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function dv(l,f){(f.mode&1)===0&&l!==null&&(l.alternate=null,f.alternate=null,f.flags|=2)}function uu(l,f,v){if(l!==null&&(f.dependencies=l.dependencies),uf|=f.lanes,(v&f.childLanes)===0)return null;if(l!==null&&f.child!==l.child)throw Error(n(153));if(f.child!==null){for(l=f.child,v=ic(l,l.pendingProps),f.child=v,v.return=f;l.sibling!==null;)l=l.sibling,v=v.sibling=ic(l,l.pendingProps),v.return=f;v.sibling=null}return f.child}function TK(l,f,v){switch(f.tag){case 3:IC(f),Sd();break;case 5:eC(f);break;case 1:po(f.type)&&Gg(f);break;case 4:Lx(f,f.stateNode.containerInfo);break;case 10:var j=f.type._context,N=f.memoizedProps.value;hr(ev,j._currentValue),j._currentValue=N;break;case 13:if(j=f.memoizedState,j!==null)return j.dehydrated!==null?(hr(Rr,Rr.current&1),f.flags|=128,null):(v&f.child.childLanes)!==0?BC(l,f,v):(hr(Rr,Rr.current&1),l=uu(l,f,v),l!==null?l.sibling:null);hr(Rr,Rr.current&1);break;case 19:if(j=(v&f.childLanes)!==0,(l.flags&128)!==0){if(j)return FC(l,f,v);f.flags|=128}if(N=f.memoizedState,N!==null&&(N.rendering=null,N.tail=null,N.lastEffect=null),hr(Rr,Rr.current),j)break;return null;case 22:case 23:return f.lanes=0,MC(l,f,v)}return uu(l,f,v)}var qC,rw,zC,UC;qC=function(l,f){for(var v=f.child;v!==null;){if(v.tag===5||v.tag===6)l.appendChild(v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===f)break;for(;v.sibling===null;){if(v.return===null||v.return===f)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},rw=function(){},zC=function(l,f,v,j){var N=l.memoizedProps;if(N!==j){l=f.stateNode,sf(Sl.current);var F=null;switch(v){case"input":N=Lt(l,N),j=Lt(l,j),F=[];break;case"select":N=ae({},N,{value:void 0}),j=ae({},j,{value:void 0}),F=[];break;case"textarea":N=_r(l,N),j=_r(l,j),F=[];break;default:typeof N.onClick!="function"&&typeof j.onClick=="function"&&(l.onclick=Xe)}Pt(v,j);var Y;v=null;for(qe in N)if(!j.hasOwnProperty(qe)&&N.hasOwnProperty(qe)&&N[qe]!=null)if(qe==="style"){var se=N[qe];for(Y in se)se.hasOwnProperty(Y)&&(v||(v={}),v[Y]="")}else qe!=="dangerouslySetInnerHTML"&&qe!=="children"&&qe!=="suppressContentEditableWarning"&&qe!=="suppressHydrationWarning"&&qe!=="autoFocus"&&(i.hasOwnProperty(qe)?F||(F=[]):(F=F||[]).push(qe,null));for(qe in j){var ge=j[qe];if(se=N!=null?N[qe]:void 0,j.hasOwnProperty(qe)&&ge!==se&&(ge!=null||se!=null))if(qe==="style")if(se){for(Y in se)!se.hasOwnProperty(Y)||ge&&ge.hasOwnProperty(Y)||(v||(v={}),v[Y]="");for(Y in ge)ge.hasOwnProperty(Y)&&se[Y]!==ge[Y]&&(v||(v={}),v[Y]=ge[Y])}else v||(F||(F=[]),F.push(qe,v)),v=ge;else qe==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,se=se?se.__html:void 0,ge!=null&&se!==ge&&(F=F||[]).push(qe,ge)):qe==="children"?typeof ge!="string"&&typeof ge!="number"||(F=F||[]).push(qe,""+ge):qe!=="suppressContentEditableWarning"&&qe!=="suppressHydrationWarning"&&(i.hasOwnProperty(qe)?(ge!=null&&qe==="onScroll"&&rr("scroll",l),F||se===ge||(F=[])):(F=F||[]).push(qe,ge))}v&&(F=F||[]).push("style",v);var qe=F;(f.updateQueue=qe)&&(f.flags|=4)}},UC=function(l,f,v,j){v!==j&&(f.flags|=4)};function Ap(l,f){if(!jr)switch(l.tailMode){case"hidden":f=l.tail;for(var v=null;f!==null;)f.alternate!==null&&(v=f),f=f.sibling;v===null?l.tail=null:v.sibling=null;break;case"collapsed":v=l.tail;for(var j=null;v!==null;)v.alternate!==null&&(j=v),v=v.sibling;j===null?f||l.tail===null?l.tail=null:l.tail.sibling=null:j.sibling=null}}function _a(l){var f=l.alternate!==null&&l.alternate.child===l.child,v=0,j=0;if(f)for(var N=l.child;N!==null;)v|=N.lanes|N.childLanes,j|=N.subtreeFlags&14680064,j|=N.flags&14680064,N.return=l,N=N.sibling;else for(N=l.child;N!==null;)v|=N.lanes|N.childLanes,j|=N.subtreeFlags,j|=N.flags,N.return=l,N=N.sibling;return l.subtreeFlags|=j,l.childLanes=v,f}function EK(l,f,v){var j=f.pendingProps;switch(jx(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _a(f),null;case 1:return po(f.type)&&Hg(),_a(f),null;case 3:return j=f.stateNode,Td(),br(ho),br(xa),Bx(),j.pendingContext&&(j.context=j.pendingContext,j.pendingContext=null),(l===null||l.child===null)&&(Qg(f)?f.flags|=4:l===null||l.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Ks!==null&&(pw(Ks),Ks=null))),rw(l,f),_a(f),null;case 5:Ix(f);var N=sf(Pp.current);if(v=f.type,l!==null&&f.stateNode!=null)zC(l,f,v,j,N),l.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!j){if(f.stateNode===null)throw Error(n(166));return _a(f),null}if(l=sf(Sl.current),Qg(f)){j=f.stateNode,v=f.type;var F=f.memoizedProps;switch(j[as]=f,j[Ku]=F,l=(f.mode&1)!==0,v){case"dialog":rr("cancel",j),rr("close",j);break;case"iframe":case"object":case"embed":rr("load",j);break;case"video":case"audio":for(N=0;N<Uu.length;N++)rr(Uu[N],j);break;case"source":rr("error",j);break;case"img":case"image":case"link":rr("error",j),rr("load",j);break;case"details":rr("toggle",j);break;case"input":dn(j,F),rr("invalid",j);break;case"select":j._wrapperState={wasMultiple:!!F.multiple},rr("invalid",j);break;case"textarea":fr(j,F),rr("invalid",j)}Pt(v,F),N=null;for(var Y in F)if(F.hasOwnProperty(Y)){var se=F[Y];Y==="children"?typeof se=="string"?j.textContent!==se&&(F.suppressHydrationWarning!==!0&&Be(j.textContent,se,l),N=["children",se]):typeof se=="number"&&j.textContent!==""+se&&(F.suppressHydrationWarning!==!0&&Be(j.textContent,se,l),N=["children",""+se]):i.hasOwnProperty(Y)&&se!=null&&Y==="onScroll"&&rr("scroll",j)}switch(v){case"input":st(j),Ar(j,F,!0);break;case"textarea":st(j),ua(j);break;case"select":case"option":break;default:typeof F.onClick=="function"&&(j.onclick=Xe)}j=N,f.updateQueue=j,j!==null&&(f.flags|=4)}else{Y=N.nodeType===9?N:N.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Fr(v)),l==="http://www.w3.org/1999/xhtml"?v==="script"?(l=Y.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof j.is=="string"?l=Y.createElement(v,{is:j.is}):(l=Y.createElement(v),v==="select"&&(Y=l,j.multiple?Y.multiple=!0:j.size&&(Y.size=j.size))):l=Y.createElementNS(l,v),l[as]=f,l[Ku]=j,qC(l,f,!1,!1),f.stateNode=l;e:{switch(Y=Ci(v,j),v){case"dialog":rr("cancel",l),rr("close",l),N=j;break;case"iframe":case"object":case"embed":rr("load",l),N=j;break;case"video":case"audio":for(N=0;N<Uu.length;N++)rr(Uu[N],l);N=j;break;case"source":rr("error",l),N=j;break;case"img":case"image":case"link":rr("error",l),rr("load",l),N=j;break;case"details":rr("toggle",l),N=j;break;case"input":dn(l,j),N=Lt(l,j),rr("invalid",l);break;case"option":N=j;break;case"select":l._wrapperState={wasMultiple:!!j.multiple},N=ae({},j,{value:void 0}),rr("invalid",l);break;case"textarea":fr(l,j),N=_r(l,j),rr("invalid",l);break;default:N=j}Pt(v,N),se=N;for(F in se)if(se.hasOwnProperty(F)){var ge=se[F];F==="style"?Ho(l,ge):F==="dangerouslySetInnerHTML"?(ge=ge?ge.__html:void 0,ge!=null&&Vt(l,ge)):F==="children"?typeof ge=="string"?(v!=="textarea"||ge!=="")&&Na(l,ge):typeof ge=="number"&&Na(l,""+ge):F!=="suppressContentEditableWarning"&&F!=="suppressHydrationWarning"&&F!=="autoFocus"&&(i.hasOwnProperty(F)?ge!=null&&F==="onScroll"&&rr("scroll",l):ge!=null&&k(l,F,ge,Y))}switch(v){case"input":st(l),Ar(l,j,!1);break;case"textarea":st(l),ua(l);break;case"option":j.value!=null&&l.setAttribute("value",""+rt(j.value));break;case"select":l.multiple=!!j.multiple,F=j.value,F!=null?Bn(l,!!j.multiple,F,!1):j.defaultValue!=null&&Bn(l,!!j.multiple,j.defaultValue,!0);break;default:typeof N.onClick=="function"&&(l.onclick=Xe)}switch(v){case"button":case"input":case"select":case"textarea":j=!!j.autoFocus;break e;case"img":j=!0;break e;default:j=!1}}j&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return _a(f),null;case 6:if(l&&f.stateNode!=null)UC(l,f,l.memoizedProps,j);else{if(typeof j!="string"&&f.stateNode===null)throw Error(n(166));if(v=sf(Pp.current),sf(Sl.current),Qg(f)){if(j=f.stateNode,v=f.memoizedProps,j[as]=f,(F=j.nodeValue!==v)&&(l=Lo,l!==null))switch(l.tag){case 3:Be(j.nodeValue,v,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Be(j.nodeValue,v,(l.mode&1)!==0)}F&&(f.flags|=4)}else j=(v.nodeType===9?v:v.ownerDocument).createTextNode(j),j[as]=f,f.stateNode=j}return _a(f),null;case 13:if(br(Rr),j=f.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(jr&&Io!==null&&(f.mode&1)!==0&&(f.flags&128)===0)Kk(),Sd(),f.flags|=98560,F=!1;else if(F=Qg(f),j!==null&&j.dehydrated!==null){if(l===null){if(!F)throw Error(n(318));if(F=f.memoizedState,F=F!==null?F.dehydrated:null,!F)throw Error(n(317));F[as]=f}else Sd(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;_a(f),F=!1}else Ks!==null&&(pw(Ks),Ks=null),F=!0;if(!F)return f.flags&65536?f:null}return(f.flags&128)!==0?(f.lanes=v,f):(j=j!==null,j!==(l!==null&&l.memoizedState!==null)&&j&&(f.child.flags|=8192,(f.mode&1)!==0&&(l===null||(Rr.current&1)!==0?_i===0&&(_i=3):vw())),f.updateQueue!==null&&(f.flags|=4),_a(f),null);case 4:return Td(),rw(l,f),l===null&&Vu(f.stateNode.containerInfo),_a(f),null;case 10:return Cx(f.type._context),_a(f),null;case 17:return po(f.type)&&Hg(),_a(f),null;case 19:if(br(Rr),F=f.memoizedState,F===null)return _a(f),null;if(j=(f.flags&128)!==0,Y=F.rendering,Y===null)if(j)Ap(F,!1);else{if(_i!==0||l!==null&&(l.flags&128)!==0)for(l=f.child;l!==null;){if(Y=iv(l),Y!==null){for(f.flags|=128,Ap(F,!1),j=Y.updateQueue,j!==null&&(f.updateQueue=j,f.flags|=4),f.subtreeFlags=0,j=v,v=f.child;v!==null;)F=v,l=j,F.flags&=14680066,Y=F.alternate,Y===null?(F.childLanes=0,F.lanes=l,F.child=null,F.subtreeFlags=0,F.memoizedProps=null,F.memoizedState=null,F.updateQueue=null,F.dependencies=null,F.stateNode=null):(F.childLanes=Y.childLanes,F.lanes=Y.lanes,F.child=Y.child,F.subtreeFlags=0,F.deletions=null,F.memoizedProps=Y.memoizedProps,F.memoizedState=Y.memoizedState,F.updateQueue=Y.updateQueue,F.type=Y.type,l=Y.dependencies,F.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),v=v.sibling;return hr(Rr,Rr.current&1|2),f.child}l=l.sibling}F.tail!==null&&jn()>Cd&&(f.flags|=128,j=!0,Ap(F,!1),f.lanes=4194304)}else{if(!j)if(l=iv(Y),l!==null){if(f.flags|=128,j=!0,v=l.updateQueue,v!==null&&(f.updateQueue=v,f.flags|=4),Ap(F,!0),F.tail===null&&F.tailMode==="hidden"&&!Y.alternate&&!jr)return _a(f),null}else 2*jn()-F.renderingStartTime>Cd&&v!==1073741824&&(f.flags|=128,j=!0,Ap(F,!1),f.lanes=4194304);F.isBackwards?(Y.sibling=f.child,f.child=Y):(v=F.last,v!==null?v.sibling=Y:f.child=Y,F.last=Y)}return F.tail!==null?(f=F.tail,F.rendering=f,F.tail=f.sibling,F.renderingStartTime=jn(),f.sibling=null,v=Rr.current,hr(Rr,j?v&1|2:v&1),f):(_a(f),null);case 22:case 23:return gw(),j=f.memoizedState!==null,l!==null&&l.memoizedState!==null!==j&&(f.flags|=8192),j&&(f.mode&1)!==0?(Do&1073741824)!==0&&(_a(f),f.subtreeFlags&6&&(f.flags|=8192)):_a(f),null;case 24:return null;case 25:return null}throw Error(n(156,f.tag))}function AK(l,f){switch(jx(f),f.tag){case 1:return po(f.type)&&Hg(),l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 3:return Td(),br(ho),br(xa),Bx(),l=f.flags,(l&65536)!==0&&(l&128)===0?(f.flags=l&-65537|128,f):null;case 5:return Ix(f),null;case 13:if(br(Rr),l=f.memoizedState,l!==null&&l.dehydrated!==null){if(f.alternate===null)throw Error(n(340));Sd()}return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 19:return br(Rr),null;case 4:return Td(),null;case 10:return Cx(f.type._context),null;case 22:case 23:return gw(),null;case 24:return null;default:return null}}var hv=!1,Sa=!1,kK=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function Ad(l,f){var v=l.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(j){Ur(l,f,j)}else v.current=null}function iw(l,f,v){try{v()}catch(j){Ur(l,f,j)}}var VC=!1;function CK(l,f){if(yt=Ge,l=ye(),ve(l)){if("selectionStart"in l)var v={start:l.selectionStart,end:l.selectionEnd};else e:{v=(v=l.ownerDocument)&&v.defaultView||window;var j=v.getSelection&&v.getSelection();if(j&&j.rangeCount!==0){v=j.anchorNode;var N=j.anchorOffset,F=j.focusNode;j=j.focusOffset;try{v.nodeType,F.nodeType}catch{v=null;break e}var Y=0,se=-1,ge=-1,qe=0,tt=0,nt=l,et=null;t:for(;;){for(var wt;nt!==v||N!==0&&nt.nodeType!==3||(se=Y+N),nt!==F||j!==0&&nt.nodeType!==3||(ge=Y+j),nt.nodeType===3&&(Y+=nt.nodeValue.length),(wt=nt.firstChild)!==null;)et=nt,nt=wt;for(;;){if(nt===l)break t;if(et===v&&++qe===N&&(se=Y),et===F&&++tt===j&&(ge=Y),(wt=nt.nextSibling)!==null)break;nt=et,et=nt.parentNode}nt=wt}v=se===-1||ge===-1?null:{start:se,end:ge}}else v=null}v=v||{start:0,end:0}}else v=null;for(Wt={focusedElem:l,selectionRange:v},Ge=!1,Ot=f;Ot!==null;)if(f=Ot,l=f.child,(f.subtreeFlags&1028)!==0&&l!==null)l.return=f,Ot=l;else for(;Ot!==null;){f=Ot;try{var At=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(At!==null){var Nt=At.memoizedProps,Qr=At.memoizedState,Re=f.stateNode,Pe=Re.getSnapshotBeforeUpdate(f.elementType===f.type?Nt:Hs(f.type,Nt),Qr);Re.__reactInternalSnapshotBeforeUpdate=Pe}break;case 3:var De=f.stateNode.containerInfo;De.nodeType===1?De.textContent="":De.nodeType===9&&De.documentElement&&De.removeChild(De.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ot){Ur(f,f.return,ot)}if(l=f.sibling,l!==null){l.return=f.return,Ot=l;break}Ot=f.return}return At=VC,VC=!1,At}function kp(l,f,v){var j=f.updateQueue;if(j=j!==null?j.lastEffect:null,j!==null){var N=j=j.next;do{if((N.tag&l)===l){var F=N.destroy;N.destroy=void 0,F!==void 0&&iw(f,v,F)}N=N.next}while(N!==j)}}function pv(l,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var v=f=f.next;do{if((v.tag&l)===l){var j=v.create;v.destroy=j()}v=v.next}while(v!==f)}}function aw(l){var f=l.ref;if(f!==null){var v=l.stateNode;switch(l.tag){case 5:l=v;break;default:l=v}typeof f=="function"?f(l):f.current=l}}function WC(l){var f=l.alternate;f!==null&&(l.alternate=null,WC(f)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(f=l.stateNode,f!==null&&(delete f[as],delete f[Ku],delete f[Hu],delete f[xx],delete f[wx])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function KC(l){return l.tag===5||l.tag===3||l.tag===4}function HC(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||KC(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function ow(l,f,v){var j=l.tag;if(j===5||j===6)l=l.stateNode,f?v.nodeType===8?v.parentNode.insertBefore(l,f):v.insertBefore(l,f):(v.nodeType===8?(f=v.parentNode,f.insertBefore(l,v)):(f=v,f.appendChild(l)),v=v._reactRootContainer,v!=null||f.onclick!==null||(f.onclick=Xe));else if(j!==4&&(l=l.child,l!==null))for(ow(l,f,v),l=l.sibling;l!==null;)ow(l,f,v),l=l.sibling}function sw(l,f,v){var j=l.tag;if(j===5||j===6)l=l.stateNode,f?v.insertBefore(l,f):v.appendChild(l);else if(j!==4&&(l=l.child,l!==null))for(sw(l,f,v),l=l.sibling;l!==null;)sw(l,f,v),l=l.sibling}var na=null,Gs=!1;function Ju(l,f,v){for(v=v.child;v!==null;)GC(l,f,v),v=v.sibling}function GC(l,f,v){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(pi,v)}catch{}switch(v.tag){case 5:Sa||Ad(v,f);case 6:var j=na,N=Gs;na=null,Ju(l,f,v),na=j,Gs=N,na!==null&&(Gs?(l=na,v=v.stateNode,l.nodeType===8?l.parentNode.removeChild(v):l.removeChild(v)):na.removeChild(v.stateNode));break;case 18:na!==null&&(Gs?(l=na,v=v.stateNode,l.nodeType===8?xp(l.parentNode,v):l.nodeType===1&&xp(l,v),xe(l)):xp(na,v.stateNode));break;case 4:j=na,N=Gs,na=v.stateNode.containerInfo,Gs=!0,Ju(l,f,v),na=j,Gs=N;break;case 0:case 11:case 14:case 15:if(!Sa&&(j=v.updateQueue,j!==null&&(j=j.lastEffect,j!==null))){N=j=j.next;do{var F=N,Y=F.destroy;F=F.tag,Y!==void 0&&((F&2)!==0||(F&4)!==0)&&iw(v,f,Y),N=N.next}while(N!==j)}Ju(l,f,v);break;case 1:if(!Sa&&(Ad(v,f),j=v.stateNode,typeof j.componentWillUnmount=="function"))try{j.props=v.memoizedProps,j.state=v.memoizedState,j.componentWillUnmount()}catch(se){Ur(v,f,se)}Ju(l,f,v);break;case 21:Ju(l,f,v);break;case 22:v.mode&1?(Sa=(j=Sa)||v.memoizedState!==null,Ju(l,f,v),Sa=j):Ju(l,f,v);break;default:Ju(l,f,v)}}function ZC(l){var f=l.updateQueue;if(f!==null){l.updateQueue=null;var v=l.stateNode;v===null&&(v=l.stateNode=new kK),f.forEach(function(j){var N=FK.bind(null,l,j);v.has(j)||(v.add(j),j.then(N,N))})}}function Zs(l,f){var v=f.deletions;if(v!==null)for(var j=0;j<v.length;j++){var N=v[j];try{var F=l,Y=f,se=Y;e:for(;se!==null;){switch(se.tag){case 5:na=se.stateNode,Gs=!1;break e;case 3:na=se.stateNode.containerInfo,Gs=!0;break e;case 4:na=se.stateNode.containerInfo,Gs=!0;break e}se=se.return}if(na===null)throw Error(n(160));GC(F,Y,N),na=null,Gs=!1;var ge=N.alternate;ge!==null&&(ge.return=null),N.return=null}catch(qe){Ur(N,f,qe)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)YC(f,l),f=f.sibling}function YC(l,f){var v=l.alternate,j=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Zs(f,l),jl(l),j&4){try{kp(3,l,l.return),pv(3,l)}catch(Nt){Ur(l,l.return,Nt)}try{kp(5,l,l.return)}catch(Nt){Ur(l,l.return,Nt)}}break;case 1:Zs(f,l),jl(l),j&512&&v!==null&&Ad(v,v.return);break;case 5:if(Zs(f,l),jl(l),j&512&&v!==null&&Ad(v,v.return),l.flags&32){var N=l.stateNode;try{Na(N,"")}catch(Nt){Ur(l,l.return,Nt)}}if(j&4&&(N=l.stateNode,N!=null)){var F=l.memoizedProps,Y=v!==null?v.memoizedProps:F,se=l.type,ge=l.updateQueue;if(l.updateQueue=null,ge!==null)try{se==="input"&&F.type==="radio"&&F.name!=null&&xn(N,F),Ci(se,Y);var qe=Ci(se,F);for(Y=0;Y<ge.length;Y+=2){var tt=ge[Y],nt=ge[Y+1];tt==="style"?Ho(N,nt):tt==="dangerouslySetInnerHTML"?Vt(N,nt):tt==="children"?Na(N,nt):k(N,tt,nt,qe)}switch(se){case"input":qn(N,F);break;case"textarea":To(N,F);break;case"select":var et=N._wrapperState.wasMultiple;N._wrapperState.wasMultiple=!!F.multiple;var wt=F.value;wt!=null?Bn(N,!!F.multiple,wt,!1):et!==!!F.multiple&&(F.defaultValue!=null?Bn(N,!!F.multiple,F.defaultValue,!0):Bn(N,!!F.multiple,F.multiple?[]:"",!1))}N[Ku]=F}catch(Nt){Ur(l,l.return,Nt)}}break;case 6:if(Zs(f,l),jl(l),j&4){if(l.stateNode===null)throw Error(n(162));N=l.stateNode,F=l.memoizedProps;try{N.nodeValue=F}catch(Nt){Ur(l,l.return,Nt)}}break;case 3:if(Zs(f,l),jl(l),j&4&&v!==null&&v.memoizedState.isDehydrated)try{xe(f.containerInfo)}catch(Nt){Ur(l,l.return,Nt)}break;case 4:Zs(f,l),jl(l);break;case 13:Zs(f,l),jl(l),N=l.child,N.flags&8192&&(F=N.memoizedState!==null,N.stateNode.isHidden=F,!F||N.alternate!==null&&N.alternate.memoizedState!==null||(cw=jn())),j&4&&ZC(l);break;case 22:if(tt=v!==null&&v.memoizedState!==null,l.mode&1?(Sa=(qe=Sa)||tt,Zs(f,l),Sa=qe):Zs(f,l),jl(l),j&8192){if(qe=l.memoizedState!==null,(l.stateNode.isHidden=qe)&&!tt&&(l.mode&1)!==0)for(Ot=l,tt=l.child;tt!==null;){for(nt=Ot=tt;Ot!==null;){switch(et=Ot,wt=et.child,et.tag){case 0:case 11:case 14:case 15:kp(4,et,et.return);break;case 1:Ad(et,et.return);var At=et.stateNode;if(typeof At.componentWillUnmount=="function"){j=et,v=et.return;try{f=j,At.props=f.memoizedProps,At.state=f.memoizedState,At.componentWillUnmount()}catch(Nt){Ur(j,v,Nt)}}break;case 5:Ad(et,et.return);break;case 22:if(et.memoizedState!==null){JC(nt);continue}}wt!==null?(wt.return=et,Ot=wt):JC(nt)}tt=tt.sibling}e:for(tt=null,nt=l;;){if(nt.tag===5){if(tt===null){tt=nt;try{N=nt.stateNode,qe?(F=N.style,typeof F.setProperty=="function"?F.setProperty("display","none","important"):F.display="none"):(se=nt.stateNode,ge=nt.memoizedProps.style,Y=ge!=null&&ge.hasOwnProperty("display")?ge.display:null,se.style.display=Ki("display",Y))}catch(Nt){Ur(l,l.return,Nt)}}}else if(nt.tag===6){if(tt===null)try{nt.stateNode.nodeValue=qe?"":nt.memoizedProps}catch(Nt){Ur(l,l.return,Nt)}}else if((nt.tag!==22&&nt.tag!==23||nt.memoizedState===null||nt===l)&&nt.child!==null){nt.child.return=nt,nt=nt.child;continue}if(nt===l)break e;for(;nt.sibling===null;){if(nt.return===null||nt.return===l)break e;tt===nt&&(tt=null),nt=nt.return}tt===nt&&(tt=null),nt.sibling.return=nt.return,nt=nt.sibling}}break;case 19:Zs(f,l),jl(l),j&4&&ZC(l);break;case 21:break;default:Zs(f,l),jl(l)}}function jl(l){var f=l.flags;if(f&2){try{e:{for(var v=l.return;v!==null;){if(KC(v)){var j=v;break e}v=v.return}throw Error(n(160))}switch(j.tag){case 5:var N=j.stateNode;j.flags&32&&(Na(N,""),j.flags&=-33);var F=HC(l);sw(l,F,N);break;case 3:case 4:var Y=j.stateNode.containerInfo,se=HC(l);ow(l,se,Y);break;default:throw Error(n(161))}}catch(ge){Ur(l,l.return,ge)}l.flags&=-3}f&4096&&(l.flags&=-4097)}function NK(l,f,v){Ot=l,XC(l)}function XC(l,f,v){for(var j=(l.mode&1)!==0;Ot!==null;){var N=Ot,F=N.child;if(N.tag===22&&j){var Y=N.memoizedState!==null||hv;if(!Y){var se=N.alternate,ge=se!==null&&se.memoizedState!==null||Sa;se=hv;var qe=Sa;if(hv=Y,(Sa=ge)&&!qe)for(Ot=N;Ot!==null;)Y=Ot,ge=Y.child,Y.tag===22&&Y.memoizedState!==null?eN(N):ge!==null?(ge.return=Y,Ot=ge):eN(N);for(;F!==null;)Ot=F,XC(F),F=F.sibling;Ot=N,hv=se,Sa=qe}QC(l)}else(N.subtreeFlags&8772)!==0&&F!==null?(F.return=N,Ot=F):QC(l)}}function QC(l){for(;Ot!==null;){var f=Ot;if((f.flags&8772)!==0){var v=f.alternate;try{if((f.flags&8772)!==0)switch(f.tag){case 0:case 11:case 15:Sa||pv(5,f);break;case 1:var j=f.stateNode;if(f.flags&4&&!Sa)if(v===null)j.componentDidMount();else{var N=f.elementType===f.type?v.memoizedProps:Hs(f.type,v.memoizedProps);j.componentDidUpdate(N,v.memoizedState,j.__reactInternalSnapshotBeforeUpdate)}var F=f.updateQueue;F!==null&&Jk(f,F,j);break;case 3:var Y=f.updateQueue;if(Y!==null){if(v=null,f.child!==null)switch(f.child.tag){case 5:v=f.child.stateNode;break;case 1:v=f.child.stateNode}Jk(f,Y,v)}break;case 5:var se=f.stateNode;if(v===null&&f.flags&4){v=se;var ge=f.memoizedProps;switch(f.type){case"button":case"input":case"select":case"textarea":ge.autoFocus&&v.focus();break;case"img":ge.src&&(v.src=ge.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(f.memoizedState===null){var qe=f.alternate;if(qe!==null){var tt=qe.memoizedState;if(tt!==null){var nt=tt.dehydrated;nt!==null&&xe(nt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Sa||f.flags&512&&aw(f)}catch(et){Ur(f,f.return,et)}}if(f===l){Ot=null;break}if(v=f.sibling,v!==null){v.return=f.return,Ot=v;break}Ot=f.return}}function JC(l){for(;Ot!==null;){var f=Ot;if(f===l){Ot=null;break}var v=f.sibling;if(v!==null){v.return=f.return,Ot=v;break}Ot=f.return}}function eN(l){for(;Ot!==null;){var f=Ot;try{switch(f.tag){case 0:case 11:case 15:var v=f.return;try{pv(4,f)}catch(ge){Ur(f,v,ge)}break;case 1:var j=f.stateNode;if(typeof j.componentDidMount=="function"){var N=f.return;try{j.componentDidMount()}catch(ge){Ur(f,N,ge)}}var F=f.return;try{aw(f)}catch(ge){Ur(f,F,ge)}break;case 5:var Y=f.return;try{aw(f)}catch(ge){Ur(f,Y,ge)}}}catch(ge){Ur(f,f.return,ge)}if(f===l){Ot=null;break}var se=f.sibling;if(se!==null){se.return=f.return,Ot=se;break}Ot=f.return}}var MK=Math.ceil,mv=D.ReactCurrentDispatcher,lw=D.ReactCurrentOwner,cs=D.ReactCurrentBatchConfig,Fn=0,$i=null,si=null,ra=0,Do=0,kd=Gu(0),_i=0,Cp=null,uf=0,gv=0,uw=0,Np=null,go=null,cw=0,Cd=1/0,cu=null,vv=!1,fw=null,ec=null,yv=!1,tc=null,bv=0,Mp=0,dw=null,xv=-1,wv=0;function Ka(){return(Fn&6)!==0?jn():xv!==-1?xv:xv=jn()}function nc(l){return(l.mode&1)===0?1:(Fn&2)!==0&&ra!==0?ra&-ra:gK.transition!==null?(wv===0&&(wv=io()),wv):(l=un,l!==0||(l=window.event,l=l===void 0?16:rn(l.type)),l)}function Ys(l,f,v,j){if(50<Mp)throw Mp=0,dw=null,Error(n(185));gi(l,v,j),((Fn&2)===0||l!==$i)&&(l===$i&&((Fn&2)===0&&(gv|=v),_i===4&&rc(l,ra)),vo(l,j),v===1&&Fn===0&&(f.mode&1)===0&&(Cd=jn()+500,Zg&&Yu()))}function vo(l,f){var v=l.callbackNode;ro(l,f);var j=zn(l,l===$i?ra:0);if(j===0)v!==null&&Da(v),l.callbackNode=null,l.callbackPriority=0;else if(f=j&-j,l.callbackPriority!==f){if(v!=null&&Da(v),f===1)l.tag===0?mK(nN.bind(null,l)):qk(nN.bind(null,l)),ba(function(){(Fn&6)===0&&Yu()}),v=null;else{switch(ri(j)){case 1:v=pa;break;case 4:v=Yo;break;case 16:v=Co;break;case 536870912:v=Ri;break;default:v=Co}v=cN(v,tN.bind(null,l))}l.callbackPriority=f,l.callbackNode=v}}function tN(l,f){if(xv=-1,wv=0,(Fn&6)!==0)throw Error(n(327));var v=l.callbackNode;if(Nd()&&l.callbackNode!==v)return null;var j=zn(l,l===$i?ra:0);if(j===0)return null;if((j&30)!==0||(j&l.expiredLanes)!==0||f)f=_v(l,j);else{f=j;var N=Fn;Fn|=2;var F=iN();($i!==l||ra!==f)&&(cu=null,Cd=jn()+500,ff(l,f));do try{IK();break}catch(se){rN(l,se)}while(!0);kx(),mv.current=F,Fn=N,si!==null?f=0:($i=null,ra=0,f=_i)}if(f!==0){if(f===2&&(N=dr(l),N!==0&&(j=N,f=hw(l,N))),f===1)throw v=Cp,ff(l,0),rc(l,j),vo(l,jn()),v;if(f===6)rc(l,j);else{if(N=l.current.alternate,(j&30)===0&&!RK(N)&&(f=_v(l,j),f===2&&(F=dr(l),F!==0&&(j=F,f=hw(l,F))),f===1))throw v=Cp,ff(l,0),rc(l,j),vo(l,jn()),v;switch(l.finishedWork=N,l.finishedLanes=j,f){case 0:case 1:throw Error(n(345));case 2:df(l,go,cu);break;case 3:if(rc(l,j),(j&130023424)===j&&(f=cw+500-jn(),10<f)){if(zn(l,0)!==0)break;if(N=l.suspendedLanes,(N&j)!==j){Ka(),l.pingedLanes|=l.suspendedLanes&N;break}l.timeoutHandle=xi(df.bind(null,l,go,cu),f);break}df(l,go,cu);break;case 4:if(rc(l,j),(j&4194240)===j)break;for(f=l.eventTimes,N=-1;0<j;){var Y=31-ft(j);F=1<<Y,Y=f[Y],Y>N&&(N=Y),j&=~F}if(j=N,j=jn()-j,j=(120>j?120:480>j?480:1080>j?1080:1920>j?1920:3e3>j?3e3:4320>j?4320:1960*MK(j/1960))-j,10<j){l.timeoutHandle=xi(df.bind(null,l,go,cu),j);break}df(l,go,cu);break;case 5:df(l,go,cu);break;default:throw Error(n(329))}}}return vo(l,jn()),l.callbackNode===v?tN.bind(null,l):null}function hw(l,f){var v=Np;return l.current.memoizedState.isDehydrated&&(ff(l,f).flags|=256),l=_v(l,f),l!==2&&(f=go,go=v,f!==null&&pw(f)),l}function pw(l){go===null?go=l:go.push.apply(go,l)}function RK(l){for(var f=l;;){if(f.flags&16384){var v=f.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var j=0;j<v.length;j++){var N=v[j],F=N.getSnapshot;N=N.value;try{if(!Ee(F(),N))return!1}catch{return!1}}}if(v=f.child,f.subtreeFlags&16384&&v!==null)v.return=f,f=v;else{if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function rc(l,f){for(f&=~uw,f&=~gv,l.suspendedLanes|=f,l.pingedLanes&=~f,l=l.expirationTimes;0<f;){var v=31-ft(f),j=1<<v;l[v]=-1,f&=~j}}function nN(l){if((Fn&6)!==0)throw Error(n(327));Nd();var f=zn(l,0);if((f&1)===0)return vo(l,jn()),null;var v=_v(l,f);if(l.tag!==0&&v===2){var j=dr(l);j!==0&&(f=j,v=hw(l,j))}if(v===1)throw v=Cp,ff(l,0),rc(l,f),vo(l,jn()),v;if(v===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=f,df(l,go,cu),vo(l,jn()),null}function mw(l,f){var v=Fn;Fn|=1;try{return l(f)}finally{Fn=v,Fn===0&&(Cd=jn()+500,Zg&&Yu())}}function cf(l){tc!==null&&tc.tag===0&&(Fn&6)===0&&Nd();var f=Fn;Fn|=1;var v=cs.transition,j=un;try{if(cs.transition=null,un=1,l)return l()}finally{un=j,cs.transition=v,Fn=f,(Fn&6)===0&&Yu()}}function gw(){Do=kd.current,br(kd)}function ff(l,f){l.finishedWork=null,l.finishedLanes=0;var v=l.timeoutHandle;if(v!==-1&&(l.timeoutHandle=-1,oi(v)),si!==null)for(v=si.return;v!==null;){var j=v;switch(jx(j),j.tag){case 1:j=j.type.childContextTypes,j!=null&&Hg();break;case 3:Td(),br(ho),br(xa),Bx();break;case 5:Ix(j);break;case 4:Td();break;case 13:br(Rr);break;case 19:br(Rr);break;case 10:Cx(j.type._context);break;case 22:case 23:gw()}v=v.return}if($i=l,si=l=ic(l.current,null),ra=Do=f,_i=0,Cp=null,uw=gv=uf=0,go=Np=null,of!==null){for(f=0;f<of.length;f++)if(v=of[f],j=v.interleaved,j!==null){v.interleaved=null;var N=j.next,F=v.pending;if(F!==null){var Y=F.next;F.next=N,j.next=Y}v.pending=j}of=null}return l}function rN(l,f){do{var v=si;try{if(kx(),av.current=uv,ov){for(var j=Lr.memoizedState;j!==null;){var N=j.queue;N!==null&&(N.pending=null),j=j.next}ov=!1}if(lf=0,Bi=wi=Lr=null,jp=!1,Op=0,lw.current=null,v===null||v.return===null){_i=1,Cp=f,si=null;break}e:{var F=l,Y=v.return,se=v,ge=f;if(f=ra,se.flags|=32768,ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var qe=ge,tt=se,nt=tt.tag;if((tt.mode&1)===0&&(nt===0||nt===11||nt===15)){var et=tt.alternate;et?(tt.updateQueue=et.updateQueue,tt.memoizedState=et.memoizedState,tt.lanes=et.lanes):(tt.updateQueue=null,tt.memoizedState=null)}var wt=EC(Y);if(wt!==null){wt.flags&=-257,AC(wt,Y,se,F,f),wt.mode&1&&TC(F,qe,f),f=wt,ge=qe;var At=f.updateQueue;if(At===null){var Nt=new Set;Nt.add(ge),f.updateQueue=Nt}else At.add(ge);break e}else{if((f&1)===0){TC(F,qe,f),vw();break e}ge=Error(n(426))}}else if(jr&&se.mode&1){var Qr=EC(Y);if(Qr!==null){(Qr.flags&65536)===0&&(Qr.flags|=256),AC(Qr,Y,se,F,f),Ex(Ed(ge,se));break e}}F=ge=Ed(ge,se),_i!==4&&(_i=2),Np===null?Np=[F]:Np.push(F),F=Y;do{switch(F.tag){case 3:F.flags|=65536,f&=-f,F.lanes|=f;var Re=jC(F,ge,f);Qk(F,Re);break e;case 1:se=ge;var Pe=F.type,De=F.stateNode;if((F.flags&128)===0&&(typeof Pe.getDerivedStateFromError=="function"||De!==null&&typeof De.componentDidCatch=="function"&&(ec===null||!ec.has(De)))){F.flags|=65536,f&=-f,F.lanes|=f;var ot=OC(F,se,f);Qk(F,ot);break e}}F=F.return}while(F!==null)}oN(v)}catch(It){f=It,si===v&&v!==null&&(si=v=v.return);continue}break}while(!0)}function iN(){var l=mv.current;return mv.current=uv,l===null?uv:l}function vw(){(_i===0||_i===3||_i===2)&&(_i=4),$i===null||(uf&268435455)===0&&(gv&268435455)===0||rc($i,ra)}function _v(l,f){var v=Fn;Fn|=2;var j=iN();($i!==l||ra!==f)&&(cu=null,ff(l,f));do try{LK();break}catch(N){rN(l,N)}while(!0);if(kx(),Fn=v,mv.current=j,si!==null)throw Error(n(261));return $i=null,ra=0,_i}function LK(){for(;si!==null;)aN(si)}function IK(){for(;si!==null&&!nr();)aN(si)}function aN(l){var f=uN(l.alternate,l,Do);l.memoizedProps=l.pendingProps,f===null?oN(l):si=f,lw.current=null}function oN(l){var f=l;do{var v=f.alternate;if(l=f.return,(f.flags&32768)===0){if(v=EK(v,f,Do),v!==null){si=v;return}}else{if(v=AK(v,f),v!==null){v.flags&=32767,si=v;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{_i=6,si=null;return}}if(f=f.sibling,f!==null){si=f;return}si=f=l}while(f!==null);_i===0&&(_i=5)}function df(l,f,v){var j=un,N=cs.transition;try{cs.transition=null,un=1,DK(l,f,v,j)}finally{cs.transition=N,un=j}return null}function DK(l,f,v,j){do Nd();while(tc!==null);if((Fn&6)!==0)throw Error(n(327));v=l.finishedWork;var N=l.finishedLanes;if(v===null)return null;if(l.finishedWork=null,l.finishedLanes=0,v===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var F=v.lanes|v.childLanes;if(Un(l,F),l===$i&&(si=$i=null,ra=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||yv||(yv=!0,cN(Co,function(){return Nd(),null})),F=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||F){F=cs.transition,cs.transition=null;var Y=un;un=1;var se=Fn;Fn|=4,lw.current=null,CK(l,v),YC(v,l),ke(Wt),Ge=!!yt,Wt=yt=null,l.current=v,NK(v),hi(),Fn=se,un=Y,cs.transition=F}else l.current=v;if(yv&&(yv=!1,tc=l,bv=N),F=l.pendingLanes,F===0&&(ec=null),Li(v.stateNode),vo(l,jn()),f!==null)for(j=l.onRecoverableError,v=0;v<f.length;v++)N=f[v],j(N.value,{componentStack:N.stack,digest:N.digest});if(vv)throw vv=!1,l=fw,fw=null,l;return(bv&1)!==0&&l.tag!==0&&Nd(),F=l.pendingLanes,(F&1)!==0?l===dw?Mp++:(Mp=0,dw=l):Mp=0,Yu(),null}function Nd(){if(tc!==null){var l=ri(bv),f=cs.transition,v=un;try{if(cs.transition=null,un=16>l?16:l,tc===null)var j=!1;else{if(l=tc,tc=null,bv=0,(Fn&6)!==0)throw Error(n(331));var N=Fn;for(Fn|=4,Ot=l.current;Ot!==null;){var F=Ot,Y=F.child;if((Ot.flags&16)!==0){var se=F.deletions;if(se!==null){for(var ge=0;ge<se.length;ge++){var qe=se[ge];for(Ot=qe;Ot!==null;){var tt=Ot;switch(tt.tag){case 0:case 11:case 15:kp(8,tt,F)}var nt=tt.child;if(nt!==null)nt.return=tt,Ot=nt;else for(;Ot!==null;){tt=Ot;var et=tt.sibling,wt=tt.return;if(WC(tt),tt===qe){Ot=null;break}if(et!==null){et.return=wt,Ot=et;break}Ot=wt}}}var At=F.alternate;if(At!==null){var Nt=At.child;if(Nt!==null){At.child=null;do{var Qr=Nt.sibling;Nt.sibling=null,Nt=Qr}while(Nt!==null)}}Ot=F}}if((F.subtreeFlags&2064)!==0&&Y!==null)Y.return=F,Ot=Y;else e:for(;Ot!==null;){if(F=Ot,(F.flags&2048)!==0)switch(F.tag){case 0:case 11:case 15:kp(9,F,F.return)}var Re=F.sibling;if(Re!==null){Re.return=F.return,Ot=Re;break e}Ot=F.return}}var Pe=l.current;for(Ot=Pe;Ot!==null;){Y=Ot;var De=Y.child;if((Y.subtreeFlags&2064)!==0&&De!==null)De.return=Y,Ot=De;else e:for(Y=Pe;Ot!==null;){if(se=Ot,(se.flags&2048)!==0)try{switch(se.tag){case 0:case 11:case 15:pv(9,se)}}catch(It){Ur(se,se.return,It)}if(se===Y){Ot=null;break e}var ot=se.sibling;if(ot!==null){ot.return=se.return,Ot=ot;break e}Ot=se.return}}if(Fn=N,Yu(),ln&&typeof ln.onPostCommitFiberRoot=="function")try{ln.onPostCommitFiberRoot(pi,l)}catch{}j=!0}return j}finally{un=v,cs.transition=f}}return!1}function sN(l,f,v){f=Ed(v,f),f=jC(l,f,1),l=Qu(l,f,1),f=Ka(),l!==null&&(gi(l,1,f),vo(l,f))}function Ur(l,f,v){if(l.tag===3)sN(l,l,v);else for(;f!==null;){if(f.tag===3){sN(f,l,v);break}else if(f.tag===1){var j=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof j.componentDidCatch=="function"&&(ec===null||!ec.has(j))){l=Ed(v,l),l=OC(f,l,1),f=Qu(f,l,1),l=Ka(),f!==null&&(gi(f,1,l),vo(f,l));break}}f=f.return}}function BK(l,f,v){var j=l.pingCache;j!==null&&j.delete(f),f=Ka(),l.pingedLanes|=l.suspendedLanes&v,$i===l&&(ra&v)===v&&(_i===4||_i===3&&(ra&130023424)===ra&&500>jn()-cw?ff(l,0):uw|=v),vo(l,f)}function lN(l,f){f===0&&((l.mode&1)===0?f=1:(f=No,No<<=1,(No&130023424)===0&&(No=4194304)));var v=Ka();l=su(l,f),l!==null&&(gi(l,f,v),vo(l,v))}function $K(l){var f=l.memoizedState,v=0;f!==null&&(v=f.retryLane),lN(l,v)}function FK(l,f){var v=0;switch(l.tag){case 13:var j=l.stateNode,N=l.memoizedState;N!==null&&(v=N.retryLane);break;case 19:j=l.stateNode;break;default:throw Error(n(314))}j!==null&&j.delete(f),lN(l,v)}var uN;uN=function(l,f,v){if(l!==null)if(l.memoizedProps!==f.pendingProps||ho.current)mo=!0;else{if((l.lanes&v)===0&&(f.flags&128)===0)return mo=!1,TK(l,f,v);mo=(l.flags&131072)!==0}else mo=!1,jr&&(f.flags&1048576)!==0&&zk(f,Xg,f.index);switch(f.lanes=0,f.tag){case 2:var j=f.type;dv(l,f),l=f.pendingProps;var N=xd(f,xa.current);Od(f,v),N=qx(null,f,j,l,N,v);var F=zx();return f.flags|=1,typeof N=="object"&&N!==null&&typeof N.render=="function"&&N.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,po(j)?(F=!0,Gg(f)):F=!1,f.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,Rx(f),N.updater=cv,f.stateNode=N,N._reactInternals=f,Gx(f,j,l,v),f=Qx(null,f,j,!0,F,v)):(f.tag=0,jr&&F&&Px(f),Wa(null,f,N,v),f=f.child),f;case 16:j=f.elementType;e:{switch(dv(l,f),l=f.pendingProps,N=j._init,j=N(j._payload),f.type=j,N=f.tag=zK(j),l=Hs(j,l),N){case 0:f=Xx(null,f,j,l,v);break e;case 1:f=LC(null,f,j,l,v);break e;case 11:f=kC(null,f,j,l,v);break e;case 14:f=CC(null,f,j,Hs(j.type,l),v);break e}throw Error(n(306,j,""))}return f;case 0:return j=f.type,N=f.pendingProps,N=f.elementType===j?N:Hs(j,N),Xx(l,f,j,N,v);case 1:return j=f.type,N=f.pendingProps,N=f.elementType===j?N:Hs(j,N),LC(l,f,j,N,v);case 3:e:{if(IC(f),l===null)throw Error(n(387));j=f.pendingProps,F=f.memoizedState,N=F.element,Xk(l,f),rv(f,j,null,v);var Y=f.memoizedState;if(j=Y.element,F.isDehydrated)if(F={element:j,isDehydrated:!1,cache:Y.cache,pendingSuspenseBoundaries:Y.pendingSuspenseBoundaries,transitions:Y.transitions},f.updateQueue.baseState=F,f.memoizedState=F,f.flags&256){N=Ed(Error(n(423)),f),f=DC(l,f,j,v,N);break e}else if(j!==N){N=Ed(Error(n(424)),f),f=DC(l,f,j,v,N);break e}else for(Io=_l(f.stateNode.containerInfo.firstChild),Lo=f,jr=!0,Ks=null,v=Zk(f,null,j,v),f.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Sd(),j===N){f=uu(l,f,v);break e}Wa(l,f,j,v)}f=f.child}return f;case 5:return eC(f),l===null&&Tx(f),j=f.type,N=f.pendingProps,F=l!==null?l.memoizedProps:null,Y=N.children,hn(j,N)?Y=null:F!==null&&hn(j,F)&&(f.flags|=32),RC(l,f),Wa(l,f,Y,v),f.child;case 6:return l===null&&Tx(f),null;case 13:return BC(l,f,v);case 4:return Lx(f,f.stateNode.containerInfo),j=f.pendingProps,l===null?f.child=Pd(f,null,j,v):Wa(l,f,j,v),f.child;case 11:return j=f.type,N=f.pendingProps,N=f.elementType===j?N:Hs(j,N),kC(l,f,j,N,v);case 7:return Wa(l,f,f.pendingProps,v),f.child;case 8:return Wa(l,f,f.pendingProps.children,v),f.child;case 12:return Wa(l,f,f.pendingProps.children,v),f.child;case 10:e:{if(j=f.type._context,N=f.pendingProps,F=f.memoizedProps,Y=N.value,hr(ev,j._currentValue),j._currentValue=Y,F!==null)if(Ee(F.value,Y)){if(F.children===N.children&&!ho.current){f=uu(l,f,v);break e}}else for(F=f.child,F!==null&&(F.return=f);F!==null;){var se=F.dependencies;if(se!==null){Y=F.child;for(var ge=se.firstContext;ge!==null;){if(ge.context===j){if(F.tag===1){ge=lu(-1,v&-v),ge.tag=2;var qe=F.updateQueue;if(qe!==null){qe=qe.shared;var tt=qe.pending;tt===null?ge.next=ge:(ge.next=tt.next,tt.next=ge),qe.pending=ge}}F.lanes|=v,ge=F.alternate,ge!==null&&(ge.lanes|=v),Nx(F.return,v,f),se.lanes|=v;break}ge=ge.next}}else if(F.tag===10)Y=F.type===f.type?null:F.child;else if(F.tag===18){if(Y=F.return,Y===null)throw Error(n(341));Y.lanes|=v,se=Y.alternate,se!==null&&(se.lanes|=v),Nx(Y,v,f),Y=F.sibling}else Y=F.child;if(Y!==null)Y.return=F;else for(Y=F;Y!==null;){if(Y===f){Y=null;break}if(F=Y.sibling,F!==null){F.return=Y.return,Y=F;break}Y=Y.return}F=Y}Wa(l,f,N.children,v),f=f.child}return f;case 9:return N=f.type,j=f.pendingProps.children,Od(f,v),N=ls(N),j=j(N),f.flags|=1,Wa(l,f,j,v),f.child;case 14:return j=f.type,N=Hs(j,f.pendingProps),N=Hs(j.type,N),CC(l,f,j,N,v);case 15:return NC(l,f,f.type,f.pendingProps,v);case 17:return j=f.type,N=f.pendingProps,N=f.elementType===j?N:Hs(j,N),dv(l,f),f.tag=1,po(j)?(l=!0,Gg(f)):l=!1,Od(f,v),SC(f,j,N),Gx(f,j,N,v),Qx(null,f,j,!0,l,v);case 19:return FC(l,f,v);case 22:return MC(l,f,v)}throw Error(n(156,f.tag))};function cN(l,f){return vl(l,f)}function qK(l,f,v,j){this.tag=l,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=j,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fs(l,f,v,j){return new qK(l,f,v,j)}function yw(l){return l=l.prototype,!(!l||!l.isReactComponent)}function zK(l){if(typeof l=="function")return yw(l)?1:0;if(l!=null){if(l=l.$$typeof,l===ne)return 11;if(l===Se)return 14}return 2}function ic(l,f){var v=l.alternate;return v===null?(v=fs(l.tag,f,l.key,l.mode),v.elementType=l.elementType,v.type=l.type,v.stateNode=l.stateNode,v.alternate=l,l.alternate=v):(v.pendingProps=f,v.type=l.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=l.flags&14680064,v.childLanes=l.childLanes,v.lanes=l.lanes,v.child=l.child,v.memoizedProps=l.memoizedProps,v.memoizedState=l.memoizedState,v.updateQueue=l.updateQueue,f=l.dependencies,v.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},v.sibling=l.sibling,v.index=l.index,v.ref=l.ref,v}function Sv(l,f,v,j,N,F){var Y=2;if(j=l,typeof l=="function")yw(l)&&(Y=1);else if(typeof l=="string")Y=5;else e:switch(l){case $:return hf(v.children,N,F,f);case V:Y=8,N|=8;break;case K:return l=fs(12,v,f,N|2),l.elementType=K,l.lanes=F,l;case oe:return l=fs(13,v,f,N),l.elementType=oe,l.lanes=F,l;case he:return l=fs(19,v,f,N),l.elementType=he,l.lanes=F,l;case Oe:return Pv(v,N,F,f);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Z:Y=10;break e;case ee:Y=9;break e;case ne:Y=11;break e;case Se:Y=14;break e;case fe:Y=16,j=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return f=fs(Y,v,f,N),f.elementType=l,f.type=j,f.lanes=F,f}function hf(l,f,v,j){return l=fs(7,l,j,f),l.lanes=v,l}function Pv(l,f,v,j){return l=fs(22,l,j,f),l.elementType=Oe,l.lanes=v,l.stateNode={isHidden:!1},l}function bw(l,f,v){return l=fs(6,l,null,f),l.lanes=v,l}function xw(l,f,v){return f=fs(4,l.children!==null?l.children:[],l.key,f),f.lanes=v,f.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},f}function UK(l,f,v,j,N){this.tag=f,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ma(0),this.expirationTimes=ma(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ma(0),this.identifierPrefix=j,this.onRecoverableError=N,this.mutableSourceEagerHydrationData=null}function ww(l,f,v,j,N,F,Y,se,ge){return l=new UK(l,f,v,se,ge),f===1?(f=1,F===!0&&(f|=8)):f=0,F=fs(3,null,null,f),l.current=F,F.stateNode=l,F.memoizedState={element:j,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rx(F),l}function VK(l,f,v){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:j==null?null:""+j,children:l,containerInfo:f,implementation:v}}function fN(l){if(!l)return Zu;l=l._reactInternals;e:{if(Sr(l)!==l||l.tag!==1)throw Error(n(170));var f=l;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(po(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(n(171))}if(l.tag===1){var v=l.type;if(po(v))return $k(l,v,f)}return f}function dN(l,f,v,j,N,F,Y,se,ge){return l=ww(v,j,!0,l,N,F,Y,se,ge),l.context=fN(null),v=l.current,j=Ka(),N=nc(v),F=lu(j,N),F.callback=f??null,Qu(v,F,N),l.current.lanes=N,gi(l,N,j),vo(l,j),l}function jv(l,f,v,j){var N=f.current,F=Ka(),Y=nc(N);return v=fN(v),f.context===null?f.context=v:f.pendingContext=v,f=lu(F,Y),f.payload={element:l},j=j===void 0?null:j,j!==null&&(f.callback=j),l=Qu(N,f,Y),l!==null&&(Ys(l,N,Y,F),nv(l,N,Y)),Y}function Ov(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function hN(l,f){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var v=l.retryLane;l.retryLane=v!==0&&v<f?v:f}}function _w(l,f){hN(l,f),(l=l.alternate)&&hN(l,f)}function WK(){return null}var pN=typeof reportError=="function"?reportError:function(l){console.error(l)};function Sw(l){this._internalRoot=l}Tv.prototype.render=Sw.prototype.render=function(l){var f=this._internalRoot;if(f===null)throw Error(n(409));jv(l,f,null,null)},Tv.prototype.unmount=Sw.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var f=l.containerInfo;cf(function(){jv(null,l,null,null)}),f[Zn]=null}};function Tv(l){this._internalRoot=l}Tv.prototype.unstable_scheduleHydration=function(l){if(l){var f=ao();l={blockedOn:null,target:l,priority:f};for(var v=0;v<gn.length&&f!==0&&f<gn[v].priority;v++);gn.splice(v,0,l),v===0&&Rs(l)}};function Pw(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Ev(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function mN(){}function KK(l,f,v,j,N){if(N){if(typeof j=="function"){var F=j;j=function(){var qe=Ov(Y);F.call(qe)}}var Y=dN(f,j,l,0,null,!1,!1,"",mN);return l._reactRootContainer=Y,l[Zn]=Y.current,Vu(l.nodeType===8?l.parentNode:l),cf(),Y}for(;N=l.lastChild;)l.removeChild(N);if(typeof j=="function"){var se=j;j=function(){var qe=Ov(ge);se.call(qe)}}var ge=ww(l,0,!1,null,null,!1,!1,"",mN);return l._reactRootContainer=ge,l[Zn]=ge.current,Vu(l.nodeType===8?l.parentNode:l),cf(function(){jv(f,ge,v,j)}),ge}function Av(l,f,v,j,N){var F=v._reactRootContainer;if(F){var Y=F;if(typeof N=="function"){var se=N;N=function(){var ge=Ov(Y);se.call(ge)}}jv(f,Y,l,N)}else Y=KK(v,f,l,N,j);return Ov(Y)}Ms=function(l){switch(l.tag){case 3:var f=l.stateNode;if(f.current.memoizedState.isDehydrated){var v=qt(f.pendingLanes);v!==0&&(zr(f,v|1),vo(f,jn()),(Fn&6)===0&&(Cd=jn()+500,Yu()))}break;case 13:cf(function(){var j=su(l,1);if(j!==null){var N=Ka();Ys(j,l,1,N)}}),_w(l,1)}},cn=function(l){if(l.tag===13){var f=su(l,134217728);if(f!==null){var v=Ka();Ys(f,l,134217728,v)}_w(l,134217728)}},Qo=function(l){if(l.tag===13){var f=nc(l),v=su(l,f);if(v!==null){var j=Ka();Ys(v,l,f,j)}_w(l,f)}},ao=function(){return un},oo=function(l,f){var v=un;try{return un=l,f()}finally{un=v}},ht=function(l,f,v){switch(f){case"input":if(qn(l,v),f=v.name,v.type==="radio"&&f!=null){for(v=l;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<v.length;f++){var j=v[f];if(j!==l&&j.form===l.form){var N=yd(j);if(!N)throw Error(n(90));Te(j),qn(j,N)}}}break;case"textarea":To(l,v);break;case"select":f=v.value,f!=null&&Bn(l,!!v.multiple,f,!1)}},eo=mw,Yl=cf;var HK={usingClientEntryPoint:!1,Events:[nu,ru,yd,Cs,Zo,mw]},Rp={findFiberByHostInstance:tu,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},GK={bundleType:Rp.bundleType,version:Rp.version,rendererPackageName:Rp.rendererPackageName,rendererConfig:Rp.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:D.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Ns(l),l===null?null:l.stateNode},findFiberByHostInstance:Rp.findFiberByHostInstance||WK,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kv.isDisabled&&kv.supportsFiber)try{pi=kv.inject(GK),ln=kv}catch{}}return yo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HK,yo.createPortal=function(l,f){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pw(f))throw Error(n(200));return VK(l,f,null,v)},yo.createRoot=function(l,f){if(!Pw(l))throw Error(n(299));var v=!1,j="",N=pN;return f!=null&&(f.unstable_strictMode===!0&&(v=!0),f.identifierPrefix!==void 0&&(j=f.identifierPrefix),f.onRecoverableError!==void 0&&(N=f.onRecoverableError)),f=ww(l,1,!1,null,null,v,!1,j,N),l[Zn]=f.current,Vu(l.nodeType===8?l.parentNode:l),new Sw(f)},yo.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var f=l._reactInternals;if(f===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=Ns(f),l=l===null?null:l.stateNode,l},yo.flushSync=function(l){return cf(l)},yo.hydrate=function(l,f,v){if(!Ev(f))throw Error(n(200));return Av(null,l,f,!0,v)},yo.hydrateRoot=function(l,f,v){if(!Pw(l))throw Error(n(405));var j=v!=null&&v.hydratedSources||null,N=!1,F="",Y=pN;if(v!=null&&(v.unstable_strictMode===!0&&(N=!0),v.identifierPrefix!==void 0&&(F=v.identifierPrefix),v.onRecoverableError!==void 0&&(Y=v.onRecoverableError)),f=dN(f,null,l,1,v??null,N,!1,F,Y),l[Zn]=f.current,Vu(l),j)for(l=0;l<j.length;l++)v=j[l],N=v._getVersion,N=N(v._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[v,N]:f.mutableSourceEagerHydrationData.push(v,N);return new Tv(f)},yo.render=function(l,f,v){if(!Ev(f))throw Error(n(200));return Av(null,l,f,!1,v)},yo.unmountComponentAtNode=function(l){if(!Ev(l))throw Error(n(40));return l._reactRootContainer?(cf(function(){Av(null,null,l,!1,function(){l._reactRootContainer=null,l[Zn]=null})}),!0):!1},yo.unstable_batchedUpdates=mw,yo.unstable_renderSubtreeIntoContainer=function(l,f,v,j){if(!Ev(v))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Av(l,f,v,!1,j)},yo.version="18.3.1-next-f1338f8080-20240426",yo}var PN;function W$(){if(PN)return Ew.exports;PN=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ew.exports=iH(),Ew.exports}var jN;function aH(){if(jN)return Nv;jN=1;var e=W$();return Nv.createRoot=e.createRoot,Nv.hydrateRoot=e.hydrateRoot,Nv}var oH=aH();const sH=In(oH),lH=20,uH=1e6,bu={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let Cw=0;function cH(){return Cw=(Cw+1)%Number.MAX_VALUE,Cw.toString()}const Nw=new Map,ON=e=>{if(Nw.has(e))return;const t=setTimeout(()=>{Nw.delete(e),fm({type:bu.REMOVE_TOAST,toastId:e})},uH);Nw.set(e,t)},fH=(e,t)=>{switch(t.type){case bu.ADD_TOAST:return{...e,toasts:[t.toast,...e.toasts].slice(0,lH)};case bu.UPDATE_TOAST:return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case bu.DISMISS_TOAST:{const{toastId:n}=t;return n?ON(n):e.toasts.forEach(r=>{ON(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case bu.REMOVE_TOAST:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},uy=[];let cy={toasts:[]};function fm(e){cy=fH(cy,e),uy.forEach(t=>{t(cy)})}function dH({...e}){const t=cH(),n=i=>fm({type:bu.UPDATE_TOAST,toast:{...i,id:t}}),r=()=>fm({type:bu.DISMISS_TOAST,toastId:t});return fm({type:bu.ADD_TOAST,toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function hH(){const[e,t]=M.useState(cy);return M.useEffect(()=>(uy.push(t),()=>{const n=uy.indexOf(t);n>-1&&uy.splice(n,1)}),[e]),{...e,toast:dH,dismiss:n=>fm({type:bu.DISMISS_TOAST,toastId:n})}}function K$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=K$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function pn(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=K$(e))&&(r&&(r+=" "),r+=t);return r}const TN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,EN=pn,Q0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return EN(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(d=>{const p=n==null?void 0:n[d],m=a==null?void 0:a[d];if(p===null)return null;const y=TN(p)||TN(m);return i[d][y]}),s=n&&Object.entries(n).reduce((d,p)=>{let[m,y]=p;return y===void 0||(d[m]=y),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:m,className:y,...b}=p;return Object.entries(b).every(P=>{let[x,w]=P;return Array.isArray(w)?w.includes({...a,...s}[x]):{...a,...s}[x]===w})?[...d,m,y]:d},[]);return EN(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pH=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),H$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var mH={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const gH=M.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...s},c)=>M.createElement("svg",{ref:c,...mH,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:H$("lucide",i),...s},[...o.map(([d,p])=>M.createElement(d,p)),...Array.isArray(a)?a:[a]]));/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ut=(e,t)=>{const n=M.forwardRef(({className:r,...i},a)=>M.createElement(gH,{ref:a,iconNode:t,className:H$(`lucide-${pH(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vH=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],G$=Ut("ArrowDown",vH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yH=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],J0=Ut("ArrowLeft",yH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const bH=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],eb=Ut("Bug",bH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const xH=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Z$=Ut("Calendar",xH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const wH=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],_j=Ut("ChartColumn",wH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _H=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Y$=Ut("Check",_H);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const SH=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],X$=Ut("ChevronDown",SH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const PH=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],tb=Ut("ChevronRight",PH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const jH=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],OH=Ut("ChevronUp",jH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const TH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],EH=Ut("CircleAlert",TH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const AH=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],la=Ut("CircleCheckBig",AH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const kH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ph=Ut("CircleX",kH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const CH=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]],NH=Ut("ClipboardCheck",CH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const MH=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],RH=Ut("ClipboardList",MH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const LH=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Hf=Ut("Clock",LH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const IH=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]],Q$=Ut("CloudOff",IH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const DH=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],JT=Ut("Cloud",DH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const BH=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],$H=Ut("CreditCard",BH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const FH=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],J$=Ut("Droplets",FH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qH=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],AN=Ut("FileCheck",qH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zH=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],eE=Ut("Filter",zH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const UH=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],kN=Ut("LayoutDashboard",UH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const VH=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],WH=Ut("LayoutGrid",VH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const KH=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],ky=Ut("Leaf",KH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const HH=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ti=Ut("LoaderCircle",HH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const GH=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],mh=Ut("LogOut",GH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ZH=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],So=Ut("MapPin",ZH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const YH=[["path",{d:"M18 8c0 3.613-3.869 7.429-5.393 8.795a1 1 0 0 1-1.214 0C9.87 15.429 6 11.613 6 8a6 6 0 0 1 12 0",key:"11u0oz"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["path",{d:"M8.714 14h-3.71a1 1 0 0 0-.948.683l-2.004 6A1 1 0 0 0 3 22h18a1 1 0 0 0 .948-1.316l-2-6a1 1 0 0 0-.949-.684h-3.712",key:"q8zwxj"}]],XH=Ut("MapPinned",YH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const QH=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],js=Ut("Map",QH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const JH=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],eF=Ut("Maximize2",JH);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const e9=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],t9=Ut("Menu",e9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const n9=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],r9=Ut("Navigation",n9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const i9=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Tc=Ut("Package",i9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const a9=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],Yh=Ut("Phone",a9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const o9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Dc=Ut("Plus",o9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const s9=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],tF=Ut("RefreshCw",s9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const l9=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],u9=Ut("RotateCcw",l9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const c9=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],nF=Ut("Save",c9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const f9=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],rF=Ut("Scale",f9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const d9=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],tE=Ut("Search",d9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const h9=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],iF=Ut("Send",h9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const p9=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],gh=Ut("Shield",p9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const m9=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aF=Ut("SquarePen",m9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const g9=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Mv=Ut("Star",g9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const v9=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],nb=Ut("Trash2",v9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const y9=[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]],sa=Ut("TreePine",y9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const b9=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],oF=Ut("TrendingUp",b9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const x9=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ul=Ut("TriangleAlert",x9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const w9=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],fy=Ut("Truck",w9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _9=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],S9=Ut("UserPlus",_9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const P9=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],zf=Ut("User",P9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const j9=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],ll=Ut("Users",j9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const O9=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Sj=Ut("WifiOff",O9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const T9=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Pj=Ut("Wifi",T9);/**
|
||
* @license lucide-react v0.475.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const E9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],rb=Ut("X",E9),A9=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},k9=(e,t)=>({classGroupId:e,validator:t}),sF=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Cy="-",CN=[],C9="arbitrary..",N9=e=>{const t=R9(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return M9(o);const s=o.split(Cy),c=s[0]===""&&s.length>1?1:0;return lF(s,c,t)},getConflictingClassGroupIds:(o,s)=>{if(s){const c=r[o],d=n[o];return c?d?A9(d,c):c:d||CN}return n[o]||CN}}},lF=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const d=lF(e,t+1,a);if(d)return d}const o=n.validators;if(o===null)return;const s=t===0?e.join(Cy):e.slice(t).join(Cy),c=o.length;for(let d=0;d<c;d++){const p=o[d];if(p.validator(s))return p.classGroupId}},M9=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?C9+r:void 0})(),R9=e=>{const{theme:t,classGroups:n}=e;return L9(n,t)},L9=(e,t)=>{const n=sF();for(const r in e){const i=e[r];nE(i,n,r,t)}return n},nE=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];I9(o,t,n,r)}},I9=(e,t,n,r)=>{if(typeof e=="string"){D9(e,t,n);return}if(typeof e=="function"){B9(e,t,n,r);return}$9(e,t,n,r)},D9=(e,t,n)=>{const r=e===""?t:uF(t,e);r.classGroupId=n},B9=(e,t,n,r)=>{if(F9(e)){nE(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(k9(n,e))},$9=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[s,c]=i[o];nE(c,uF(t,s),n,r)}},uF=(e,t)=>{let n=e;const r=t.split(Cy),i=r.length;for(let a=0;a<i;a++){const o=r[a];let s=n.nextPart.get(o);s||(s=sF(),n.nextPart.set(o,s)),n=s}return n},F9=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,q9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},jj="!",NN=":",z9=[],MN=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),U9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,s=0,c=0,d;const p=i.length;for(let x=0;x<p;x++){const w=i[x];if(o===0&&s===0){if(w===NN){a.push(i.slice(c,x)),c=x+1;continue}if(w==="/"){d=x;continue}}w==="["?o++:w==="]"?o--:w==="("?s++:w===")"&&s--}const m=a.length===0?i:i.slice(c);let y=m,b=!1;m.endsWith(jj)?(y=m.slice(0,-1),b=!0):m.startsWith(jj)&&(y=m.slice(1),b=!0);const P=d&&d>c?d-c:void 0;return MN(a,b,y,P)};if(t){const i=t+NN,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):MN(z9,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},V9=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],s=o[0]==="[",c=t.has(o);s||c?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},W9=e=>({cache:q9(e.cacheSize),parseClassName:U9(e),sortModifiers:V9(e),...N9(e)}),K9=/\s+/,H9=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(K9);let c="";for(let d=s.length-1;d>=0;d-=1){const p=s[d],{isExternal:m,modifiers:y,hasImportantModifier:b,baseClassName:P,maybePostfixModifierPosition:x}=n(p);if(m){c=p+(c.length>0?" "+c:c);continue}let w=!!x,T=r(w?P.substring(0,x):P);if(!T){if(!w){c=p+(c.length>0?" "+c:c);continue}if(T=r(P),!T){c=p+(c.length>0?" "+c:c);continue}w=!1}const E=y.length===0?"":y.length===1?y[0]:a(y).join(":"),k=b?E+jj:E,D=k+T;if(o.indexOf(D)>-1)continue;o.push(D);const I=i(T,w);for(let R=0;R<I.length;++R){const $=I[R];o.push(k+$)}c=p+(c.length>0?" "+c:c)}return c},G9=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=cF(n))&&(i&&(i+=" "),i+=r);return i},cF=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=cF(e[r]))&&(n&&(n+=" "),n+=t);return n},Z9=(e,...t)=>{let n,r,i,a;const o=c=>{const d=t.reduce((p,m)=>m(p),e());return n=W9(d),r=n.cache.get,i=n.cache.set,a=s,s(c)},s=c=>{const d=r(c);if(d)return d;const p=H9(c,n);return i(c,p),p};return a=o,(...c)=>a(G9(...c))},Y9=[],Si=e=>{const t=n=>n[e]||Y9;return t.isThemeGetter=!0,t},fF=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dF=/^\((?:(\w[\w-]*):)?(.+)\)$/i,X9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Q9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,J9=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,e7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,t7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sc=e=>X9.test(e),yn=e=>!!e&&!Number.isNaN(Number(e)),lc=e=>!!e&&Number.isInteger(Number(e)),Mw=e=>e.endsWith("%")&&yn(e.slice(0,-1)),fu=e=>Q9.test(e),hF=()=>!0,r7=e=>J9.test(e)&&!e7.test(e),rE=()=>!1,i7=e=>t7.test(e),a7=e=>n7.test(e),o7=e=>!kt(e)&&!Ct(e),s7=e=>Vc(e,gF,rE),kt=e=>fF.test(e),pf=e=>Vc(e,vF,r7),RN=e=>Vc(e,m7,yn),l7=e=>Vc(e,bF,hF),u7=e=>Vc(e,yF,rE),LN=e=>Vc(e,pF,rE),c7=e=>Vc(e,mF,a7),Rv=e=>Vc(e,xF,i7),Ct=e=>dF.test(e),Ip=e=>ld(e,vF),f7=e=>ld(e,yF),IN=e=>ld(e,pF),d7=e=>ld(e,gF),h7=e=>ld(e,mF),Lv=e=>ld(e,xF,!0),p7=e=>ld(e,bF,!0),Vc=(e,t,n)=>{const r=fF.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ld=(e,t,n=!1)=>{const r=dF.exec(e);return r?r[1]?t(r[1]):n:!1},pF=e=>e==="position"||e==="percentage",mF=e=>e==="image"||e==="url",gF=e=>e==="length"||e==="size"||e==="bg-size",vF=e=>e==="length",m7=e=>e==="number",yF=e=>e==="family-name",bF=e=>e==="number"||e==="weight",xF=e=>e==="shadow",g7=()=>{const e=Si("color"),t=Si("font"),n=Si("text"),r=Si("font-weight"),i=Si("tracking"),a=Si("leading"),o=Si("breakpoint"),s=Si("container"),c=Si("spacing"),d=Si("radius"),p=Si("shadow"),m=Si("inset-shadow"),y=Si("text-shadow"),b=Si("drop-shadow"),P=Si("blur"),x=Si("perspective"),w=Si("aspect"),T=Si("ease"),E=Si("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...D(),Ct,kt],R=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto","contain","none"],V=()=>[Ct,kt,c],K=()=>[sc,"full","auto",...V()],Z=()=>[lc,"none","subgrid",Ct,kt],ee=()=>["auto",{span:["full",lc,Ct,kt]},lc,Ct,kt],ne=()=>[lc,"auto",Ct,kt],oe=()=>["auto","min","max","fr",Ct,kt],he=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Se=()=>["start","end","center","stretch","center-safe","end-safe"],fe=()=>["auto",...V()],Oe=()=>[sc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],re=()=>[sc,"screen","full","dvw","lvw","svw","min","max","fit",...V()],Ce=()=>[sc,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],ae=()=>[e,Ct,kt],ie=()=>[...D(),IN,LN,{position:[Ct,kt]}],de=()=>["no-repeat",{repeat:["","x","y","space","round"]}],He=()=>["auto","cover","contain",d7,s7,{size:[Ct,kt]}],je=()=>[Mw,Ip,pf],$e=()=>["","none","full",d,Ct,kt],We=()=>["",yn,Ip,pf],Ye=()=>["solid","dashed","dotted","double"],rt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>[yn,Mw,IN,LN],Fe=()=>["","none",P,Ct,kt],st=()=>["none",yn,Ct,kt],Te=()=>["none",yn,Ct,kt],Dt=()=>[yn,Ct,kt],Lt=()=>[sc,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fu],breakpoint:[fu],color:[hF],container:[fu],"drop-shadow":[fu],ease:["in","out","in-out"],font:[o7],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fu],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fu],shadow:[fu],spacing:["px",yn],text:[fu],"text-shadow":[fu],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sc,kt,Ct,w]}],container:["container"],columns:[{columns:[yn,kt,Ct,s]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:I()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[lc,"auto",Ct,kt]}],basis:[{basis:[sc,"full","auto",s,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[yn,sc,"auto","initial","none",kt]}],grow:[{grow:["",yn,Ct,kt]}],shrink:[{shrink:["",yn,Ct,kt]}],order:[{order:[lc,"first","last","none",Ct,kt]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...he(),"normal"]}],"justify-items":[{"justify-items":[...Se(),"normal"]}],"justify-self":[{"justify-self":["auto",...Se()]}],"align-content":[{content:["normal",...he()]}],"align-items":[{items:[...Se(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Se(),{baseline:["","last"]}]}],"place-content":[{"place-content":he()}],"place-items":[{"place-items":[...Se(),"baseline"]}],"place-self":[{"place-self":["auto",...Se()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:fe()}],mx:[{mx:fe()}],my:[{my:fe()}],ms:[{ms:fe()}],me:[{me:fe()}],mbs:[{mbs:fe()}],mbe:[{mbe:fe()}],mt:[{mt:fe()}],mr:[{mr:fe()}],mb:[{mb:fe()}],ml:[{ml:fe()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:Oe()}],"inline-size":[{inline:["auto",...re()]}],"min-inline-size":[{"min-inline":["auto",...re()]}],"max-inline-size":[{"max-inline":["none",...re()]}],"block-size":[{block:["auto",...Ce()]}],"min-block-size":[{"min-block":["auto",...Ce()]}],"max-block-size":[{"max-block":["none",...Ce()]}],w:[{w:[s,"screen",...Oe()]}],"min-w":[{"min-w":[s,"screen","none",...Oe()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...Oe()]}],h:[{h:["screen","lh",...Oe()]}],"min-h":[{"min-h":["screen","lh","none",...Oe()]}],"max-h":[{"max-h":["screen","lh",...Oe()]}],"font-size":[{text:["base",n,Ip,pf]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,p7,l7]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mw,kt]}],"font-family":[{font:[f7,u7,t]}],"font-features":[{"font-features":[kt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ct,kt]}],"line-clamp":[{"line-clamp":[yn,"none",Ct,RN]}],leading:[{leading:[a,...V()]}],"list-image":[{"list-image":["none",Ct,kt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ct,kt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ae()}],"text-color":[{text:ae()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[yn,"from-font","auto",Ct,pf]}],"text-decoration-color":[{decoration:ae()}],"underline-offset":[{"underline-offset":[yn,"auto",Ct,kt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ct,kt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ct,kt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:de()}],"bg-size":[{bg:He()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},lc,Ct,kt],radial:["",Ct,kt],conic:[lc,Ct,kt]},h7,c7]}],"bg-color":[{bg:ae()}],"gradient-from-pos":[{from:je()}],"gradient-via-pos":[{via:je()}],"gradient-to-pos":[{to:je()}],"gradient-from":[{from:ae()}],"gradient-via":[{via:ae()}],"gradient-to":[{to:ae()}],rounded:[{rounded:$e()}],"rounded-s":[{"rounded-s":$e()}],"rounded-e":[{"rounded-e":$e()}],"rounded-t":[{"rounded-t":$e()}],"rounded-r":[{"rounded-r":$e()}],"rounded-b":[{"rounded-b":$e()}],"rounded-l":[{"rounded-l":$e()}],"rounded-ss":[{"rounded-ss":$e()}],"rounded-se":[{"rounded-se":$e()}],"rounded-ee":[{"rounded-ee":$e()}],"rounded-es":[{"rounded-es":$e()}],"rounded-tl":[{"rounded-tl":$e()}],"rounded-tr":[{"rounded-tr":$e()}],"rounded-br":[{"rounded-br":$e()}],"rounded-bl":[{"rounded-bl":$e()}],"border-w":[{border:We()}],"border-w-x":[{"border-x":We()}],"border-w-y":[{"border-y":We()}],"border-w-s":[{"border-s":We()}],"border-w-e":[{"border-e":We()}],"border-w-bs":[{"border-bs":We()}],"border-w-be":[{"border-be":We()}],"border-w-t":[{"border-t":We()}],"border-w-r":[{"border-r":We()}],"border-w-b":[{"border-b":We()}],"border-w-l":[{"border-l":We()}],"divide-x":[{"divide-x":We()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":We()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ye(),"hidden","none"]}],"divide-style":[{divide:[...Ye(),"hidden","none"]}],"border-color":[{border:ae()}],"border-color-x":[{"border-x":ae()}],"border-color-y":[{"border-y":ae()}],"border-color-s":[{"border-s":ae()}],"border-color-e":[{"border-e":ae()}],"border-color-bs":[{"border-bs":ae()}],"border-color-be":[{"border-be":ae()}],"border-color-t":[{"border-t":ae()}],"border-color-r":[{"border-r":ae()}],"border-color-b":[{"border-b":ae()}],"border-color-l":[{"border-l":ae()}],"divide-color":[{divide:ae()}],"outline-style":[{outline:[...Ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[yn,Ct,kt]}],"outline-w":[{outline:["",yn,Ip,pf]}],"outline-color":[{outline:ae()}],shadow:[{shadow:["","none",p,Lv,Rv]}],"shadow-color":[{shadow:ae()}],"inset-shadow":[{"inset-shadow":["none",m,Lv,Rv]}],"inset-shadow-color":[{"inset-shadow":ae()}],"ring-w":[{ring:We()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ae()}],"ring-offset-w":[{"ring-offset":[yn,pf]}],"ring-offset-color":[{"ring-offset":ae()}],"inset-ring-w":[{"inset-ring":We()}],"inset-ring-color":[{"inset-ring":ae()}],"text-shadow":[{"text-shadow":["none",y,Lv,Rv]}],"text-shadow-color":[{"text-shadow":ae()}],opacity:[{opacity:[yn,Ct,kt]}],"mix-blend":[{"mix-blend":[...rt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":rt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[yn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ze()}],"mask-image-linear-to-pos":[{"mask-linear-to":ze()}],"mask-image-linear-from-color":[{"mask-linear-from":ae()}],"mask-image-linear-to-color":[{"mask-linear-to":ae()}],"mask-image-t-from-pos":[{"mask-t-from":ze()}],"mask-image-t-to-pos":[{"mask-t-to":ze()}],"mask-image-t-from-color":[{"mask-t-from":ae()}],"mask-image-t-to-color":[{"mask-t-to":ae()}],"mask-image-r-from-pos":[{"mask-r-from":ze()}],"mask-image-r-to-pos":[{"mask-r-to":ze()}],"mask-image-r-from-color":[{"mask-r-from":ae()}],"mask-image-r-to-color":[{"mask-r-to":ae()}],"mask-image-b-from-pos":[{"mask-b-from":ze()}],"mask-image-b-to-pos":[{"mask-b-to":ze()}],"mask-image-b-from-color":[{"mask-b-from":ae()}],"mask-image-b-to-color":[{"mask-b-to":ae()}],"mask-image-l-from-pos":[{"mask-l-from":ze()}],"mask-image-l-to-pos":[{"mask-l-to":ze()}],"mask-image-l-from-color":[{"mask-l-from":ae()}],"mask-image-l-to-color":[{"mask-l-to":ae()}],"mask-image-x-from-pos":[{"mask-x-from":ze()}],"mask-image-x-to-pos":[{"mask-x-to":ze()}],"mask-image-x-from-color":[{"mask-x-from":ae()}],"mask-image-x-to-color":[{"mask-x-to":ae()}],"mask-image-y-from-pos":[{"mask-y-from":ze()}],"mask-image-y-to-pos":[{"mask-y-to":ze()}],"mask-image-y-from-color":[{"mask-y-from":ae()}],"mask-image-y-to-color":[{"mask-y-to":ae()}],"mask-image-radial":[{"mask-radial":[Ct,kt]}],"mask-image-radial-from-pos":[{"mask-radial-from":ze()}],"mask-image-radial-to-pos":[{"mask-radial-to":ze()}],"mask-image-radial-from-color":[{"mask-radial-from":ae()}],"mask-image-radial-to-color":[{"mask-radial-to":ae()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[yn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ze()}],"mask-image-conic-to-pos":[{"mask-conic-to":ze()}],"mask-image-conic-from-color":[{"mask-conic-from":ae()}],"mask-image-conic-to-color":[{"mask-conic-to":ae()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:de()}],"mask-size":[{mask:He()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ct,kt]}],filter:[{filter:["","none",Ct,kt]}],blur:[{blur:Fe()}],brightness:[{brightness:[yn,Ct,kt]}],contrast:[{contrast:[yn,Ct,kt]}],"drop-shadow":[{"drop-shadow":["","none",b,Lv,Rv]}],"drop-shadow-color":[{"drop-shadow":ae()}],grayscale:[{grayscale:["",yn,Ct,kt]}],"hue-rotate":[{"hue-rotate":[yn,Ct,kt]}],invert:[{invert:["",yn,Ct,kt]}],saturate:[{saturate:[yn,Ct,kt]}],sepia:[{sepia:["",yn,Ct,kt]}],"backdrop-filter":[{"backdrop-filter":["","none",Ct,kt]}],"backdrop-blur":[{"backdrop-blur":Fe()}],"backdrop-brightness":[{"backdrop-brightness":[yn,Ct,kt]}],"backdrop-contrast":[{"backdrop-contrast":[yn,Ct,kt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",yn,Ct,kt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[yn,Ct,kt]}],"backdrop-invert":[{"backdrop-invert":["",yn,Ct,kt]}],"backdrop-opacity":[{"backdrop-opacity":[yn,Ct,kt]}],"backdrop-saturate":[{"backdrop-saturate":[yn,Ct,kt]}],"backdrop-sepia":[{"backdrop-sepia":["",yn,Ct,kt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ct,kt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[yn,"initial",Ct,kt]}],ease:[{ease:["linear","initial",T,Ct,kt]}],delay:[{delay:[yn,Ct,kt]}],animate:[{animate:["none",E,Ct,kt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ct,kt]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:st()}],"rotate-x":[{"rotate-x":st()}],"rotate-y":[{"rotate-y":st()}],"rotate-z":[{"rotate-z":st()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Dt()}],"skew-x":[{"skew-x":Dt()}],"skew-y":[{"skew-y":Dt()}],transform:[{transform:[Ct,kt,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Lt()}],"translate-x":[{"translate-x":Lt()}],"translate-y":[{"translate-y":Lt()}],"translate-z":[{"translate-z":Lt()}],"translate-none":["translate-none"],accent:[{accent:ae()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ae()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ct,kt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ct,kt]}],fill:[{fill:["none",...ae()]}],"stroke-w":[{stroke:[yn,Ip,pf,RN]}],stroke:[{stroke:["none",...ae()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},v7=Z9(g7);function fn(...e){return v7(pn(e))}const wF=M.forwardRef(({...e},t)=>h.jsx("div",{ref:t,className:"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",...e}));wF.displayName="ToastProvider";const _F=M.forwardRef(({...e},t)=>h.jsx("div",{ref:t,className:"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",...e}));_F.displayName="ToastViewport";const y7=Q0("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),SF=M.forwardRef(({className:e,variant:t,...n},r)=>h.jsx("div",{ref:r,className:fn(y7({variant:t}),e),...n}));SF.displayName="Toast";const b7=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));b7.displayName="ToastAction";const PF=M.forwardRef(({className:e,...t},n)=>h.jsx("button",{ref:n,className:fn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:h.jsx(rb,{className:"h-4 w-4"})}));PF.displayName="ToastClose";const jF=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("text-sm font-semibold",e),...t}));jF.displayName="ToastTitle";const OF=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("text-sm opacity-90",e),...t}));OF.displayName="ToastDescription";function x7(){const{toasts:e}=hH();return h.jsxs(wF,{children:[e.map(function({id:t,title:n,description:r,action:i,...a}){return h.jsxs(SF,{...a,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(jF,{children:n}),r&&h.jsx(OF,{children:r})]}),i,h.jsx(PF,{})]},t)}),h.jsx(_F,{})]})}var Xh=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},w7={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},gc,XT,R$,_7=(R$=class{constructor(){Ft(this,gc,w7);Ft(this,XT,!1)}setTimeoutProvider(e){bt(this,gc,e)}setTimeout(e,t){return ue(this,gc).setTimeout(e,t)}clearTimeout(e){ue(this,gc).clearTimeout(e)}setInterval(e,t){return ue(this,gc).setInterval(e,t)}clearInterval(e){ue(this,gc).clearInterval(e)}},gc=new WeakMap,XT=new WeakMap,R$),Of=new _7;function S7(e){setTimeout(e,0)}var Gf=typeof window>"u"||"Deno"in globalThis;function Ga(){}function P7(e,t){return typeof e=="function"?e(t):e}function Oj(e){return typeof e=="number"&&e>=0&&e!==1/0}function TF(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ec(e,t){return typeof e=="function"?e(t):e}function xs(e,t){return typeof e=="function"?e(t):e}function DN(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==iE(o,t.options))return!1}else if(!Pm(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function BN(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Zf(t.options.mutationKey)!==Zf(a))return!1}else if(!Pm(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function iE(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zf)(e)}function Zf(e){return JSON.stringify(e,(t,n)=>Tj(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Pm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Pm(e[n],t[n])):!1}var j7=Object.prototype.hasOwnProperty;function EF(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=$N(e)&&$N(t);if(!r&&!(Tj(e)&&Tj(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),s=o.length,c=r?new Array(s):{};let d=0;for(let p=0;p<s;p++){const m=r?p:o[p],y=e[m],b=t[m];if(y===b){c[m]=y,(r?p<a:j7.call(e,m))&&d++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){c[m]=b;continue}const P=EF(y,b,n+1);c[m]=P,P===y&&d++}return a===s&&d===a?e:c}function Ny(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function $N(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tj(e){if(!FN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!FN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function FN(e){return Object.prototype.toString.call(e)==="[object Object]"}function O7(e){return new Promise(t=>{Of.setTimeout(t,e)})}function Ej(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?EF(e,t):t}function T7(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function E7(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var aE=Symbol();function AF(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===aE?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function oE(e,t){return typeof e=="function"?e(...t):!!e}function A7(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var Mf,vc,nh,L$,k7=(L$=class extends Xh{constructor(){super();Ft(this,Mf);Ft(this,vc);Ft(this,nh);bt(this,nh,t=>{if(!Gf&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ue(this,vc)||this.setEventListener(ue(this,nh))}onUnsubscribe(){var t;this.hasListeners()||((t=ue(this,vc))==null||t.call(this),bt(this,vc,void 0))}setEventListener(t){var n;bt(this,nh,t),(n=ue(this,vc))==null||n.call(this),bt(this,vc,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ue(this,Mf)!==t&&(bt(this,Mf,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ue(this,Mf)=="boolean"?ue(this,Mf):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Mf=new WeakMap,vc=new WeakMap,nh=new WeakMap,L$),sE=new k7;function Aj(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var C7=S7;function N7(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=C7;const a=s=>{t?e.push(s):i(()=>{n(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(c=>{n(c)})})})};return{batch:s=>{let c;t++;try{c=s()}finally{t--,t||o()}return c},batchCalls:s=>(...c)=>{a(()=>{s(...c)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Oi=N7(),rh,yc,ih,I$,M7=(I$=class extends Xh{constructor(){super();Ft(this,rh,!0);Ft(this,yc);Ft(this,ih);bt(this,ih,t=>{if(!Gf&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){ue(this,yc)||this.setEventListener(ue(this,ih))}onUnsubscribe(){var t;this.hasListeners()||((t=ue(this,yc))==null||t.call(this),bt(this,yc,void 0))}setEventListener(t){var n;bt(this,ih,t),(n=ue(this,yc))==null||n.call(this),bt(this,yc,t(this.setOnline.bind(this)))}setOnline(t){ue(this,rh)!==t&&(bt(this,rh,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ue(this,rh)}},rh=new WeakMap,yc=new WeakMap,ih=new WeakMap,I$),My=new M7;function R7(e){return Math.min(1e3*2**e,3e4)}function kF(e){return(e??"online")==="online"?My.isOnline():!0}var kj=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function CF(e){let t=!1,n=0,r;const i=Aj(),a=()=>i.status!=="pending",o=x=>{var w;if(!a()){const T=new kj(x);y(T),(w=e.onCancel)==null||w.call(e,T)}},s=()=>{t=!0},c=()=>{t=!1},d=()=>sE.isFocused()&&(e.networkMode==="always"||My.isOnline())&&e.canRun(),p=()=>kF(e.networkMode)&&e.canRun(),m=x=>{a()||(r==null||r(),i.resolve(x))},y=x=>{a()||(r==null||r(),i.reject(x))},b=()=>new Promise(x=>{var w;r=T=>{(a()||d())&&x(T)},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;r=void 0,a()||(x=e.onContinue)==null||x.call(e)}),P=()=>{if(a())return;let x;const w=n===0?e.initialPromise:void 0;try{x=w??e.fn()}catch(T){x=Promise.reject(T)}Promise.resolve(x).then(m).catch(T=>{var R;if(a())return;const E=e.retry??(Gf?0:3),k=e.retryDelay??R7,D=typeof k=="function"?k(n,T):k,I=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,T);if(t||!I){y(T);return}n++,(R=e.onFail)==null||R.call(e,n,T),O7(D).then(()=>d()?void 0:b()).then(()=>{t?y(T):P()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r==null||r(),i),cancelRetry:s,continueRetry:c,canStart:p,start:()=>(p()?P():b().then(P),i)}}var Rf,D$,NF=(D$=class{constructor(){Ft(this,Rf)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Oj(this.gcTime)&&bt(this,Rf,Of.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Gf?1/0:300*1e3))}clearGcTimeout(){ue(this,Rf)&&(Of.clearTimeout(ue(this,Rf)),bt(this,Rf,void 0))}},Rf=new WeakMap,D$),Lf,ah,bs,If,qi,vg,Df,el,hu,B$,L7=(B$=class extends NF{constructor(t){super();Ft(this,el);Ft(this,Lf);Ft(this,ah);Ft(this,bs);Ft(this,If);Ft(this,qi);Ft(this,vg);Ft(this,Df);bt(this,Df,!1),bt(this,vg,t.defaultOptions),this.setOptions(t.options),this.observers=[],bt(this,If,t.client),bt(this,bs,ue(this,If).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,bt(this,Lf,zN(this.options)),this.state=t.state??ue(this,Lf),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ue(this,qi))==null?void 0:t.promise}setOptions(t){if(this.options={...ue(this,vg),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=zN(this.options);n.data!==void 0&&(this.setState(qN(n.data,n.dataUpdatedAt)),bt(this,Lf,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ue(this,bs).remove(this)}setData(t,n){const r=Ej(this.state.data,t,this.options);return mn(this,el,hu).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){mn(this,el,hu).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=ue(this,qi))==null?void 0:r.promise;return(i=ue(this,qi))==null||i.cancel(t),n?n.then(Ga).catch(Ga):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ue(this,Lf))}isActive(){return this.observers.some(t=>xs(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===aE||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ec(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!TF(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ue(this,qi))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ue(this,qi))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ue(this,bs).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ue(this,qi)&&(ue(this,Df)?ue(this,qi).cancel({revert:!0}):ue(this,qi).cancelRetry()),this.scheduleGc()),ue(this,bs).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mn(this,el,hu).call(this,{type:"invalidate"})}async fetch(t,n){var c,d,p,m,y,b,P,x,w,T,E,k;if(this.state.fetchStatus!=="idle"&&((c=ue(this,qi))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ue(this,qi))return ue(this,qi).continueRetry(),ue(this,qi).promise}if(t&&this.setOptions(t),!this.options.queryFn){const D=this.observers.find(I=>I.options.queryFn);D&&this.setOptions(D.options)}const r=new AbortController,i=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>(bt(this,Df,!0),r.signal)})},a=()=>{const D=AF(this.options,n),R=(()=>{const $={client:ue(this,If),queryKey:this.queryKey,meta:this.meta};return i($),$})();return bt(this,Df,!1),this.options.persister?this.options.persister(D,R,this):D(R)},s=(()=>{const D={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ue(this,If),state:this.state,fetchFn:a};return i(D),D})();(d=this.options.behavior)==null||d.onFetch(s,this),bt(this,ah,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=s.fetchOptions)==null?void 0:p.meta))&&mn(this,el,hu).call(this,{type:"fetch",meta:(m=s.fetchOptions)==null?void 0:m.meta}),bt(this,qi,CF({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,onCancel:D=>{D instanceof kj&&D.revert&&this.setState({...ue(this,ah),fetchStatus:"idle"}),r.abort()},onFail:(D,I)=>{mn(this,el,hu).call(this,{type:"failed",failureCount:D,error:I})},onPause:()=>{mn(this,el,hu).call(this,{type:"pause"})},onContinue:()=>{mn(this,el,hu).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const D=await ue(this,qi).start();if(D===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(D),(b=(y=ue(this,bs).config).onSuccess)==null||b.call(y,D,this),(x=(P=ue(this,bs).config).onSettled)==null||x.call(P,D,this.state.error,this),D}catch(D){if(D instanceof kj){if(D.silent)return ue(this,qi).promise;if(D.revert){if(this.state.data===void 0)throw D;return this.state.data}}throw mn(this,el,hu).call(this,{type:"error",error:D}),(T=(w=ue(this,bs).config).onError)==null||T.call(w,D,this),(k=(E=ue(this,bs).config).onSettled)==null||k.call(E,this.state.data,D,this),D}finally{this.scheduleGc()}}},Lf=new WeakMap,ah=new WeakMap,bs=new WeakMap,If=new WeakMap,qi=new WeakMap,vg=new WeakMap,Df=new WeakMap,el=new WeakSet,hu=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...MF(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...qN(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return bt(this,ah,t.manual?i:void 0),i;case"error":const a=t.error;return{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Oi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),ue(this,bs).notify({query:this,type:"updated",action:t})})},B$);function MF(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kF(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qN(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function zN(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var bo,Cn,yg,Ha,Bf,oh,mu,bc,bg,sh,lh,$f,Ff,xc,uh,Qn,Qp,Cj,Nj,Mj,Rj,Lj,Ij,Dj,RF,$$,I7=($$=class extends Xh{constructor(t,n){super();Ft(this,Qn);Ft(this,bo);Ft(this,Cn);Ft(this,yg);Ft(this,Ha);Ft(this,Bf);Ft(this,oh);Ft(this,mu);Ft(this,bc);Ft(this,bg);Ft(this,sh);Ft(this,lh);Ft(this,$f);Ft(this,Ff);Ft(this,xc);Ft(this,uh,new Set);this.options=n,bt(this,bo,t),bt(this,bc,null),bt(this,mu,Aj()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ue(this,Cn).addObserver(this),UN(ue(this,Cn),this.options)?mn(this,Qn,Qp).call(this):this.updateResult(),mn(this,Qn,Rj).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bj(ue(this,Cn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bj(ue(this,Cn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,mn(this,Qn,Lj).call(this),mn(this,Qn,Ij).call(this),ue(this,Cn).removeObserver(this)}setOptions(t){const n=this.options,r=ue(this,Cn);if(this.options=ue(this,bo).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xs(this.options.enabled,ue(this,Cn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");mn(this,Qn,Dj).call(this),ue(this,Cn).setOptions(this.options),n._defaulted&&!Ny(this.options,n)&&ue(this,bo).getQueryCache().notify({type:"observerOptionsUpdated",query:ue(this,Cn),observer:this});const i=this.hasListeners();i&&VN(ue(this,Cn),r,this.options,n)&&mn(this,Qn,Qp).call(this),this.updateResult(),i&&(ue(this,Cn)!==r||xs(this.options.enabled,ue(this,Cn))!==xs(n.enabled,ue(this,Cn))||Ec(this.options.staleTime,ue(this,Cn))!==Ec(n.staleTime,ue(this,Cn)))&&mn(this,Qn,Cj).call(this);const a=mn(this,Qn,Nj).call(this);i&&(ue(this,Cn)!==r||xs(this.options.enabled,ue(this,Cn))!==xs(n.enabled,ue(this,Cn))||a!==ue(this,xc))&&mn(this,Qn,Mj).call(this,a)}getOptimisticResult(t){const n=ue(this,bo).getQueryCache().build(ue(this,bo),t),r=this.createResult(n,t);return B7(this,r)&&(bt(this,Ha,r),bt(this,oh,this.options),bt(this,Bf,ue(this,Cn).state)),r}getCurrentResult(){return ue(this,Ha)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ue(this,mu).status==="pending"&&ue(this,mu).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){ue(this,uh).add(t)}getCurrentQuery(){return ue(this,Cn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ue(this,bo).defaultQueryOptions(t),r=ue(this,bo).getQueryCache().build(ue(this,bo),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return mn(this,Qn,Qp).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ue(this,Ha)))}createResult(t,n){var K;const r=ue(this,Cn),i=this.options,a=ue(this,Ha),o=ue(this,Bf),s=ue(this,oh),d=t!==r?t.state:ue(this,yg),{state:p}=t;let m={...p},y=!1,b;if(n._optimisticResults){const Z=this.hasListeners(),ee=!Z&&UN(t,n),ne=Z&&VN(t,r,n,i);(ee||ne)&&(m={...m,...MF(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:P,errorUpdatedAt:x,status:w}=m;b=m.data;let T=!1;if(n.placeholderData!==void 0&&b===void 0&&w==="pending"){let Z;a!=null&&a.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData)?(Z=a.data,T=!0):Z=typeof n.placeholderData=="function"?n.placeholderData((K=ue(this,lh))==null?void 0:K.state.data,ue(this,lh)):n.placeholderData,Z!==void 0&&(w="success",b=Ej(a==null?void 0:a.data,Z,n),y=!0)}if(n.select&&b!==void 0&&!T)if(a&&b===(o==null?void 0:o.data)&&n.select===ue(this,bg))b=ue(this,sh);else try{bt(this,bg,n.select),b=n.select(b),b=Ej(a==null?void 0:a.data,b,n),bt(this,sh,b),bt(this,bc,null)}catch(Z){bt(this,bc,Z)}ue(this,bc)&&(P=ue(this,bc),b=ue(this,sh),x=Date.now(),w="error");const E=m.fetchStatus==="fetching",k=w==="pending",D=w==="error",I=k&&E,R=b!==void 0,V={status:w,fetchStatus:m.fetchStatus,isPending:k,isSuccess:w==="success",isError:D,isInitialLoading:I,isLoading:I,data:b,dataUpdatedAt:m.dataUpdatedAt,error:P,errorUpdatedAt:x,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:E,isRefetching:E&&!k,isLoadingError:D&&!R,isPaused:m.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:D&&R,isStale:lE(t,n),refetch:this.refetch,promise:ue(this,mu),isEnabled:xs(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const Z=V.data!==void 0,ee=V.status==="error"&&!Z,ne=Se=>{ee?Se.reject(V.error):Z&&Se.resolve(V.data)},oe=()=>{const Se=bt(this,mu,V.promise=Aj());ne(Se)},he=ue(this,mu);switch(he.status){case"pending":t.queryHash===r.queryHash&&ne(he);break;case"fulfilled":(ee||V.data!==he.value)&&oe();break;case"rejected":(!ee||V.error!==he.reason)&&oe();break}}return V}updateResult(){const t=ue(this,Ha),n=this.createResult(ue(this,Cn),this.options);if(bt(this,Bf,ue(this,Cn).state),bt(this,oh,this.options),ue(this,Bf).data!==void 0&&bt(this,lh,ue(this,Cn)),Ny(n,t))return;bt(this,Ha,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!ue(this,uh).size)return!0;const o=new Set(a??ue(this,uh));return this.options.throwOnError&&o.add("error"),Object.keys(ue(this,Ha)).some(s=>{const c=s;return ue(this,Ha)[c]!==t[c]&&o.has(c)})};mn(this,Qn,RF).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&mn(this,Qn,Rj).call(this)}},bo=new WeakMap,Cn=new WeakMap,yg=new WeakMap,Ha=new WeakMap,Bf=new WeakMap,oh=new WeakMap,mu=new WeakMap,bc=new WeakMap,bg=new WeakMap,sh=new WeakMap,lh=new WeakMap,$f=new WeakMap,Ff=new WeakMap,xc=new WeakMap,uh=new WeakMap,Qn=new WeakSet,Qp=function(t){mn(this,Qn,Dj).call(this);let n=ue(this,Cn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ga)),n},Cj=function(){mn(this,Qn,Lj).call(this);const t=Ec(this.options.staleTime,ue(this,Cn));if(Gf||ue(this,Ha).isStale||!Oj(t))return;const r=TF(ue(this,Ha).dataUpdatedAt,t)+1;bt(this,$f,Of.setTimeout(()=>{ue(this,Ha).isStale||this.updateResult()},r))},Nj=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ue(this,Cn)):this.options.refetchInterval)??!1},Mj=function(t){mn(this,Qn,Ij).call(this),bt(this,xc,t),!(Gf||xs(this.options.enabled,ue(this,Cn))===!1||!Oj(ue(this,xc))||ue(this,xc)===0)&&bt(this,Ff,Of.setInterval(()=>{(this.options.refetchIntervalInBackground||sE.isFocused())&&mn(this,Qn,Qp).call(this)},ue(this,xc)))},Rj=function(){mn(this,Qn,Cj).call(this),mn(this,Qn,Mj).call(this,mn(this,Qn,Nj).call(this))},Lj=function(){ue(this,$f)&&(Of.clearTimeout(ue(this,$f)),bt(this,$f,void 0))},Ij=function(){ue(this,Ff)&&(Of.clearInterval(ue(this,Ff)),bt(this,Ff,void 0))},Dj=function(){const t=ue(this,bo).getQueryCache().build(ue(this,bo),this.options);if(t===ue(this,Cn))return;const n=ue(this,Cn);bt(this,Cn,t),bt(this,yg,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},RF=function(t){Oi.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ue(this,Ha))}),ue(this,bo).getQueryCache().notify({query:ue(this,Cn),type:"observerResultsUpdated"})})},$$);function D7(e,t){return xs(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function UN(e,t){return D7(e,t)||e.state.data!==void 0&&Bj(e,t,t.refetchOnMount)}function Bj(e,t,n){if(xs(t.enabled,e)!==!1&&Ec(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&lE(e,t)}return!1}function VN(e,t,n,r){return(e!==t||xs(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&lE(e,n)}function lE(e,t){return xs(t.enabled,e)!==!1&&e.isStaleByTime(Ec(t.staleTime,e))}function B7(e,t){return!Ny(e.getCurrentResult(),t)}function WN(e){return{onFetch:(t,n)=>{var p,m,y,b,P;const r=t.options,i=(y=(m=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:m.fetchMore)==null?void 0:y.direction,a=((b=t.state.data)==null?void 0:b.pages)||[],o=((P=t.state.data)==null?void 0:P.pageParams)||[];let s={pages:[],pageParams:[]},c=0;const d=async()=>{let x=!1;const w=k=>{A7(k,()=>t.signal,()=>x=!0)},T=AF(t.options,t.fetchOptions),E=async(k,D,I)=>{if(x)return Promise.reject();if(D==null&&k.pages.length)return Promise.resolve(k);const $=(()=>{const ee={client:t.client,queryKey:t.queryKey,pageParam:D,direction:I?"backward":"forward",meta:t.options.meta};return w(ee),ee})(),V=await T($),{maxPages:K}=t.options,Z=I?E7:T7;return{pages:Z(k.pages,V,K),pageParams:Z(k.pageParams,D,K)}};if(i&&a.length){const k=i==="backward",D=k?$7:KN,I={pages:a,pageParams:o},R=D(r,I);s=await E(I,R,k)}else{const k=e??a.length;do{const D=c===0?o[0]??r.initialPageParam:KN(r,s);if(c>0&&D==null)break;s=await E(s,D),c++}while(c<k)}return s};t.options.persister?t.fetchFn=()=>{var x,w;return(w=(x=t.options).persister)==null?void 0:w.call(x,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function KN(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function $7(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var xg,Tl,Pa,qf,El,cc,F$,F7=(F$=class extends NF{constructor(t){super();Ft(this,El);Ft(this,xg);Ft(this,Tl);Ft(this,Pa);Ft(this,qf);bt(this,xg,t.client),this.mutationId=t.mutationId,bt(this,Pa,t.mutationCache),bt(this,Tl,[]),this.state=t.state||LF(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ue(this,Tl).includes(t)||(ue(this,Tl).push(t),this.clearGcTimeout(),ue(this,Pa).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){bt(this,Tl,ue(this,Tl).filter(n=>n!==t)),this.scheduleGc(),ue(this,Pa).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ue(this,Tl).length||(this.state.status==="pending"?this.scheduleGc():ue(this,Pa).remove(this))}continue(){var t;return((t=ue(this,qf))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,c,d,p,m,y,b,P,x,w,T,E,k,D,I,R,$;const n=()=>{mn(this,El,cc).call(this,{type:"continue"})},r={client:ue(this,xg),meta:this.options.meta,mutationKey:this.options.mutationKey};bt(this,qf,CF({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(V,K)=>{mn(this,El,cc).call(this,{type:"failed",failureCount:V,error:K})},onPause:()=>{mn(this,El,cc).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ue(this,Pa).canRun(this)}));const i=this.state.status==="pending",a=!ue(this,qf).canStart();try{if(i)n();else{mn(this,El,cc).call(this,{type:"pending",variables:t,isPaused:a}),ue(this,Pa).config.onMutate&&await ue(this,Pa).config.onMutate(t,this,r);const K=await((s=(o=this.options).onMutate)==null?void 0:s.call(o,t,r));K!==this.state.context&&mn(this,El,cc).call(this,{type:"pending",context:K,variables:t,isPaused:a})}const V=await ue(this,qf).start();return await((d=(c=ue(this,Pa).config).onSuccess)==null?void 0:d.call(c,V,t,this.state.context,this,r)),await((m=(p=this.options).onSuccess)==null?void 0:m.call(p,V,t,this.state.context,r)),await((b=(y=ue(this,Pa).config).onSettled)==null?void 0:b.call(y,V,null,this.state.variables,this.state.context,this,r)),await((x=(P=this.options).onSettled)==null?void 0:x.call(P,V,null,t,this.state.context,r)),mn(this,El,cc).call(this,{type:"success",data:V}),V}catch(V){try{await((T=(w=ue(this,Pa).config).onError)==null?void 0:T.call(w,V,t,this.state.context,this,r))}catch(K){Promise.reject(K)}try{await((k=(E=this.options).onError)==null?void 0:k.call(E,V,t,this.state.context,r))}catch(K){Promise.reject(K)}try{await((I=(D=ue(this,Pa).config).onSettled)==null?void 0:I.call(D,void 0,V,this.state.variables,this.state.context,this,r))}catch(K){Promise.reject(K)}try{await(($=(R=this.options).onSettled)==null?void 0:$.call(R,void 0,V,t,this.state.context,r))}catch(K){Promise.reject(K)}throw mn(this,El,cc).call(this,{type:"error",error:V}),V}finally{ue(this,Pa).runNext(this)}}},xg=new WeakMap,Tl=new WeakMap,Pa=new WeakMap,qf=new WeakMap,El=new WeakSet,cc=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Oi.batch(()=>{ue(this,Tl).forEach(r=>{r.onMutationUpdate(t)}),ue(this,Pa).notify({mutation:this,type:"updated",action:t})})},F$);function LF(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gu,tl,wg,q$,q7=(q$=class extends Xh{constructor(t={}){super();Ft(this,gu);Ft(this,tl);Ft(this,wg);this.config=t,bt(this,gu,new Set),bt(this,tl,new Map),bt(this,wg,0)}build(t,n,r){const i=new F7({client:t,mutationCache:this,mutationId:++Cv(this,wg)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){ue(this,gu).add(t);const n=Iv(t);if(typeof n=="string"){const r=ue(this,tl).get(n);r?r.push(t):ue(this,tl).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ue(this,gu).delete(t)){const n=Iv(t);if(typeof n=="string"){const r=ue(this,tl).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&ue(this,tl).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Iv(t);if(typeof n=="string"){const r=ue(this,tl).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Iv(t);if(typeof n=="string"){const i=(r=ue(this,tl).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Oi.batch(()=>{ue(this,gu).forEach(t=>{this.notify({type:"removed",mutation:t})}),ue(this,gu).clear(),ue(this,tl).clear()})}getAll(){return Array.from(ue(this,gu))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>BN(n,r))}findAll(t={}){return this.getAll().filter(n=>BN(t,n))}notify(t){Oi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Oi.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ga))))}},gu=new WeakMap,tl=new WeakMap,wg=new WeakMap,q$);function Iv(e){var t;return(t=e.options.scope)==null?void 0:t.id}var vu,wc,xo,yu,Tu,dy,$j,z$,z7=(z$=class extends Xh{constructor(n,r){super();Ft(this,Tu);Ft(this,vu);Ft(this,wc);Ft(this,xo);Ft(this,yu);bt(this,vu,n),this.setOptions(r),this.bindMethods(),mn(this,Tu,dy).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=ue(this,vu).defaultMutationOptions(n),Ny(this.options,r)||ue(this,vu).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ue(this,xo),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Zf(r.mutationKey)!==Zf(this.options.mutationKey)?this.reset():((i=ue(this,xo))==null?void 0:i.state.status)==="pending"&&ue(this,xo).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=ue(this,xo))==null||n.removeObserver(this)}onMutationUpdate(n){mn(this,Tu,dy).call(this),mn(this,Tu,$j).call(this,n)}getCurrentResult(){return ue(this,wc)}reset(){var n;(n=ue(this,xo))==null||n.removeObserver(this),bt(this,xo,void 0),mn(this,Tu,dy).call(this),mn(this,Tu,$j).call(this)}mutate(n,r){var i;return bt(this,yu,r),(i=ue(this,xo))==null||i.removeObserver(this),bt(this,xo,ue(this,vu).getMutationCache().build(ue(this,vu),this.options)),ue(this,xo).addObserver(this),ue(this,xo).execute(n)}},vu=new WeakMap,wc=new WeakMap,xo=new WeakMap,yu=new WeakMap,Tu=new WeakSet,dy=function(){var r;const n=((r=ue(this,xo))==null?void 0:r.state)??LF();bt(this,wc,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},$j=function(n){Oi.batch(()=>{var r,i,a,o,s,c,d,p;if(ue(this,yu)&&this.hasListeners()){const m=ue(this,wc).variables,y=ue(this,wc).context,b={client:ue(this,vu),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=ue(this,yu)).onSuccess)==null||i.call(r,n.data,m,y,b)}catch(P){Promise.reject(P)}try{(o=(a=ue(this,yu)).onSettled)==null||o.call(a,n.data,null,m,y,b)}catch(P){Promise.reject(P)}}else if((n==null?void 0:n.type)==="error"){try{(c=(s=ue(this,yu)).onError)==null||c.call(s,n.error,m,y,b)}catch(P){Promise.reject(P)}try{(p=(d=ue(this,yu)).onSettled)==null||p.call(d,void 0,n.error,m,y,b)}catch(P){Promise.reject(P)}}}this.listeners.forEach(m=>{m(ue(this,wc))})})},z$),Al,U$,U7=(U$=class extends Xh{constructor(t={}){super();Ft(this,Al);this.config=t,bt(this,Al,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??iE(i,n);let o=this.get(a);return o||(o=new L7({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){ue(this,Al).has(t.queryHash)||(ue(this,Al).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ue(this,Al).get(t.queryHash);n&&(t.destroy(),n===t&&ue(this,Al).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Oi.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ue(this,Al).get(t)}getAll(){return[...ue(this,Al).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>DN(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>DN(t,r)):n}notify(t){Oi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Oi.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Oi.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Al=new WeakMap,U$),Vr,_c,Sc,ch,fh,Pc,dh,hh,V$,V7=(V$=class{constructor(e={}){Ft(this,Vr);Ft(this,_c);Ft(this,Sc);Ft(this,ch);Ft(this,fh);Ft(this,Pc);Ft(this,dh);Ft(this,hh);bt(this,Vr,e.queryCache||new U7),bt(this,_c,e.mutationCache||new q7),bt(this,Sc,e.defaultOptions||{}),bt(this,ch,new Map),bt(this,fh,new Map),bt(this,Pc,0)}mount(){Cv(this,Pc)._++,ue(this,Pc)===1&&(bt(this,dh,sE.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,Vr).onFocus())})),bt(this,hh,My.subscribe(async e=>{e&&(await this.resumePausedMutations(),ue(this,Vr).onOnline())})))}unmount(){var e,t;Cv(this,Pc)._--,ue(this,Pc)===0&&((e=ue(this,dh))==null||e.call(this),bt(this,dh,void 0),(t=ue(this,hh))==null||t.call(this),bt(this,hh,void 0))}isFetching(e){return ue(this,Vr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ue(this,_c).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ue(this,Vr).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ue(this,Vr).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ec(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return ue(this,Vr).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=ue(this,Vr).get(r.queryHash),a=i==null?void 0:i.state.data,o=P7(t,a);if(o!==void 0)return ue(this,Vr).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Oi.batch(()=>ue(this,Vr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ue(this,Vr).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ue(this,Vr);Oi.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ue(this,Vr);return Oi.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Oi.batch(()=>ue(this,Vr).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Ga).catch(Ga)}invalidateQueries(e,t={}){return Oi.batch(()=>(ue(this,Vr).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Oi.batch(()=>ue(this,Vr).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(Ga)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Ga)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ue(this,Vr).build(this,t);return n.isStaleByTime(Ec(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ga).catch(Ga)}fetchInfiniteQuery(e){return e.behavior=WN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ga).catch(Ga)}ensureInfiniteQueryData(e){return e.behavior=WN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return My.isOnline()?ue(this,_c).resumePausedMutations():Promise.resolve()}getQueryCache(){return ue(this,Vr)}getMutationCache(){return ue(this,_c)}getDefaultOptions(){return ue(this,Sc)}setDefaultOptions(e){bt(this,Sc,e)}setQueryDefaults(e,t){ue(this,ch).set(Zf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ue(this,ch).values()],n={};return t.forEach(r=>{Pm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){ue(this,fh).set(Zf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ue(this,fh).values()],n={};return t.forEach(r=>{Pm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ue(this,Sc).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=iE(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===aE&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ue(this,Sc).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ue(this,Vr).clear(),ue(this,_c).clear()}},Vr=new WeakMap,_c=new WeakMap,Sc=new WeakMap,ch=new WeakMap,fh=new WeakMap,Pc=new WeakMap,dh=new WeakMap,hh=new WeakMap,V$),IF=M.createContext(void 0),As=e=>{const t=M.useContext(IF);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},W7=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(IF.Provider,{value:e,children:t})),DF=M.createContext(!1),K7=()=>M.useContext(DF);DF.Provider;function H7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var G7=M.createContext(H7()),Z7=()=>M.useContext(G7),Y7=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?oE(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},X7=e=>{M.useEffect(()=>{e.clearReset()},[e])},Q7=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||oE(n,[e.error,r])),J7=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},eG=(e,t)=>e.isLoading&&e.isFetching&&!t,tG=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,HN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function nG(e,t,n){var y,b,P,x;const r=K7(),i=Z7(),a=As(),o=a.defaultQueryOptions(e);(b=(y=a.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||b.call(y,o);const s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",J7(o),Y7(o,i,s),X7(i);const c=!a.getQueryCache().get(o.queryHash),[d]=M.useState(()=>new t(a,o)),p=d.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(M.useSyncExternalStore(M.useCallback(w=>{const T=m?d.subscribe(Oi.batchCalls(w)):Ga;return d.updateResult(),T},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),M.useEffect(()=>{d.setOptions(o)},[o,d]),tG(o,p))throw HN(o,d,i);if(Q7({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw p.error;if((x=(P=a.getDefaultOptions().queries)==null?void 0:P._experimental_afterQuery)==null||x.call(P,o,p),o.experimental_prefetchInRender&&!Gf&&eG(p,r)){const w=c?HN(o,d,i):s==null?void 0:s.promise;w==null||w.catch(Ga).finally(()=>{d.updateResult()})}return o.notifyOnChangeProps?p:d.trackResult(p)}function bn(e,t){return nG(e,I7)}function ci(e,t){const n=As(),[r]=M.useState(()=>new z7(n,e));M.useEffect(()=>{r.setOptions(e)},[r,e]);const i=M.useSyncExternalStore(M.useCallback(o=>r.subscribe(Oi.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=M.useCallback((o,s)=>{r.mutate(o,s).catch(Ga)},[r]);if(i.error&&oE(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}const rG=new V7({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});var Qh=W$();const iG=In(Qh);/**
|
||
* @remix-run/router v1.23.2
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function jm(){return jm=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},jm.apply(this,arguments)}var jc;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(jc||(jc={}));const GN="popstate";function aG(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:o,hash:s}=r.location;return Fj("",{pathname:a,search:o,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ry(i)}return sG(t,n,null,e)}function fi(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function uE(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function oG(){return Math.random().toString(36).substr(2,8)}function ZN(e,t){return{usr:e.state,key:e.key,idx:t}}function Fj(e,t,n,r){return n===void 0&&(n=null),jm({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Jh(t):t,{state:n,key:t&&t.key||r||oG()})}function Ry(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Jh(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function sG(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=jc.Pop,c=null,d=p();d==null&&(d=0,o.replaceState(jm({},o.state,{idx:d}),""));function p(){return(o.state||{idx:null}).idx}function m(){s=jc.Pop;let w=p(),T=w==null?null:w-d;d=w,c&&c({action:s,location:x.location,delta:T})}function y(w,T){s=jc.Push;let E=Fj(x.location,w,T);d=p()+1;let k=ZN(E,d),D=x.createHref(E);try{o.pushState(k,"",D)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;i.location.assign(D)}a&&c&&c({action:s,location:x.location,delta:1})}function b(w,T){s=jc.Replace;let E=Fj(x.location,w,T);d=p();let k=ZN(E,d),D=x.createHref(E);o.replaceState(k,"",D),a&&c&&c({action:s,location:x.location,delta:0})}function P(w){let T=i.location.origin!=="null"?i.location.origin:i.location.href,E=typeof w=="string"?w:Ry(w);return E=E.replace(/ $/,"%20"),fi(T,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,T)}let x={get action(){return s},get location(){return e(i,o)},listen(w){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(GN,m),c=w,()=>{i.removeEventListener(GN,m),c=null}},createHref(w){return t(i,w)},createURL:P,encodeLocation(w){let T=P(w);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:y,replace:b,go(w){return o.go(w)}};return x}var YN;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(YN||(YN={}));function lG(e,t,n){return n===void 0&&(n="/"),uG(e,t,n)}function uG(e,t,n,r){let i=typeof t=="string"?Jh(t):t,a=cE(i.pathname||"/",n);if(a==null)return null;let o=BF(e);cG(o);let s=null;for(let c=0;s==null&&c<o.length;++c){let d=_G(a);s=bG(o[c],d)}return s}function BF(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,o,s)=>{let c={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(fi(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=Ac([r,c.relativePath]),p=n.concat(c);a.children&&a.children.length>0&&(fi(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),BF(a.children,t,p,d)),!(a.path==null&&!a.index)&&t.push({path:d,score:vG(d,a.index),routesMeta:p})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let c of $F(a.path))i(a,o,c)}),t}function $F(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=$F(r.join("/")),s=[];return s.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&s.push(...o),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function cG(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:yG(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const fG=/^:[\w-]+$/,dG=3,hG=2,pG=1,mG=10,gG=-2,XN=e=>e==="*";function vG(e,t){let n=e.split("/"),r=n.length;return n.some(XN)&&(r+=gG),t&&(r+=hG),n.filter(i=>!XN(i)).reduce((i,a)=>i+(fG.test(a)?dG:a===""?pG:mG),r)}function yG(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function bG(e,t,n){let{routesMeta:r}=e,i={},a="/",o=[];for(let s=0;s<r.length;++s){let c=r[s],d=s===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",m=xG({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},p),y=c.route;if(!m)return null;Object.assign(i,m.params),o.push({params:i,pathname:Ac([a,m.pathname]),pathnameBase:TG(Ac([a,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(a=Ac([a,m.pathnameBase]))}return o}function xG(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=wG(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((d,p,m)=>{let{paramName:y,isOptional:b}=p;if(y==="*"){let x=s[m]||"";o=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const P=s[m];return b&&!P?d[y]=void 0:d[y]=(P||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:e}}function wG(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),uE(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,c)=>(r.push({paramName:s,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function _G(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return uE(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cE(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const SG=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,PG=e=>SG.test(e);function jG(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Jh(e):e,a;if(n)if(PG(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),uE(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=QN(n.substring(1),"/"):a=QN(n,t)}else a=t;return{pathname:a,search:EG(r),hash:AG(i)}}function QN(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Rw(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function OG(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function FF(e,t){let n=OG(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function qF(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Jh(e):(i=jm({},e),fi(!i.pathname||!i.pathname.includes("?"),Rw("?","pathname","search",i)),fi(!i.pathname||!i.pathname.includes("#"),Rw("#","pathname","hash",i)),fi(!i.search||!i.search.includes("#"),Rw("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=n;else{let m=t.length-1;if(!r&&o.startsWith("..")){let y=o.split("/");for(;y[0]==="..";)y.shift(),m-=1;i.pathname=y.join("/")}s=m>=0?t[m]:"/"}let c=jG(i,s),d=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||p)&&(c.pathname+="/"),c}const Ac=e=>e.join("/").replace(/\/\/+/g,"/"),TG=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),EG=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AG=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function kG(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const zF=["post","put","patch","delete"];new Set(zF);const CG=["get",...zF];new Set(CG);/**
|
||
* React Router v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function Om(){return Om=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},Om.apply(this,arguments)}const fE=M.createContext(null),NG=M.createContext(null),ud=M.createContext(null),ib=M.createContext(null),Wc=M.createContext({outlet:null,matches:[],isDataRoute:!1}),UF=M.createContext(null);function MG(e,t){let{relative:n}=t===void 0?{}:t;_g()||fi(!1);let{basename:r,navigator:i}=M.useContext(ud),{hash:a,pathname:o,search:s}=KF(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Ac([r,o])),i.createHref({pathname:c,search:s,hash:a})}function _g(){return M.useContext(ib)!=null}function cd(){return _g()||fi(!1),M.useContext(ib).location}function VF(e){M.useContext(ud).static||M.useLayoutEffect(e)}function dE(){let{isDataRoute:e}=M.useContext(Wc);return e?KG():RG()}function RG(){_g()||fi(!1);let e=M.useContext(fE),{basename:t,future:n,navigator:r}=M.useContext(ud),{matches:i}=M.useContext(Wc),{pathname:a}=cd(),o=JSON.stringify(FF(i,n.v7_relativeSplatPath)),s=M.useRef(!1);return VF(()=>{s.current=!0}),M.useCallback(function(d,p){if(p===void 0&&(p={}),!s.current)return;if(typeof d=="number"){r.go(d);return}let m=qF(d,JSON.parse(o),a,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ac([t,m.pathname])),(p.replace?r.replace:r.push)(m,p.state,p)},[t,r,o,a,e])}function WF(){let{matches:e}=M.useContext(Wc),t=e[e.length-1];return t?t.params:{}}function KF(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=M.useContext(ud),{matches:i}=M.useContext(Wc),{pathname:a}=cd(),o=JSON.stringify(FF(i,r.v7_relativeSplatPath));return M.useMemo(()=>qF(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function LG(e,t){return IG(e,t)}function IG(e,t,n,r){_g()||fi(!1);let{navigator:i}=M.useContext(ud),{matches:a}=M.useContext(Wc),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=cd(),p;if(t){var m;let w=typeof t=="string"?Jh(t):t;c==="/"||(m=w.pathname)!=null&&m.startsWith(c)||fi(!1),p=w}else p=d;let y=p.pathname||"/",b=y;if(c!=="/"){let w=c.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(w.length).join("/")}let P=lG(e,{pathname:b}),x=qG(P&&P.map(w=>Object.assign({},w,{params:Object.assign({},s,w.params),pathname:Ac([c,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:Ac([c,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),a,n,r);return t&&x?M.createElement(ib.Provider,{value:{location:Om({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:jc.Pop}},x):x}function DG(){let e=WG(),t=kG(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},t),n?M.createElement("pre",{style:i},n):null,null)}const BG=M.createElement(DG,null);class $G extends M.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?M.createElement(Wc.Provider,{value:this.props.routeContext},M.createElement(UF.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function FG(e){let{routeContext:t,match:n,children:r}=e,i=M.useContext(fE);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),M.createElement(Wc.Provider,{value:t},r)}function qG(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=(i=n)==null?void 0:i.errors;if(s!=null){let p=o.findIndex(m=>m.route.id&&(s==null?void 0:s[m.route.id])!==void 0);p>=0||fi(!1),o=o.slice(0,Math.min(o.length,p+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<o.length;p++){let m=o[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=p),m.route.id){let{loaderData:y,errors:b}=n,P=m.route.loader&&y[m.route.id]===void 0&&(!b||b[m.route.id]===void 0);if(m.route.lazy||P){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((p,m,y)=>{let b,P=!1,x=null,w=null;n&&(b=s&&m.route.id?s[m.route.id]:void 0,x=m.route.errorElement||BG,c&&(d<0&&y===0?(HG("route-fallback"),P=!0,w=null):d===y&&(P=!0,w=m.route.hydrateFallbackElement||null)));let T=t.concat(o.slice(0,y+1)),E=()=>{let k;return b?k=x:P?k=w:m.route.Component?k=M.createElement(m.route.Component,null):m.route.element?k=m.route.element:k=p,M.createElement(FG,{match:m,routeContext:{outlet:p,matches:T,isDataRoute:n!=null},children:k})};return n&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?M.createElement($G,{location:n.location,revalidation:n.revalidation,component:x,error:b,children:E(),routeContext:{outlet:null,matches:T,isDataRoute:!0}}):E()},null)}var HF=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(HF||{}),GF=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(GF||{});function zG(e){let t=M.useContext(fE);return t||fi(!1),t}function UG(e){let t=M.useContext(NG);return t||fi(!1),t}function VG(e){let t=M.useContext(Wc);return t||fi(!1),t}function ZF(e){let t=VG(),n=t.matches[t.matches.length-1];return n.route.id||fi(!1),n.route.id}function WG(){var e;let t=M.useContext(UF),n=UG(),r=ZF();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function KG(){let{router:e}=zG(HF.UseNavigateStable),t=ZF(GF.UseNavigateStable),n=M.useRef(!1);return VF(()=>{n.current=!0}),M.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Om({fromRouteId:t},a)))},[e,t])}const JN={};function HG(e,t,n){JN[e]||(JN[e]=!0)}function GG(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function hy(e){fi(!1)}function ZG(e){let{basename:t="/",children:n=null,location:r,navigationType:i=jc.Pop,navigator:a,static:o=!1,future:s}=e;_g()&&fi(!1);let c=t.replace(/^\/*/,"/"),d=M.useMemo(()=>({basename:c,navigator:a,static:o,future:Om({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r=="string"&&(r=Jh(r));let{pathname:p="/",search:m="",hash:y="",state:b=null,key:P="default"}=r,x=M.useMemo(()=>{let w=cE(p,c);return w==null?null:{location:{pathname:w,search:m,hash:y,state:b,key:P},navigationType:i}},[c,p,m,y,b,P,i]);return x==null?null:M.createElement(ud.Provider,{value:d},M.createElement(ib.Provider,{children:n,value:x}))}function YG(e){let{children:t,location:n}=e;return LG(qj(t),n)}new Promise(()=>{});function qj(e,t){t===void 0&&(t=[]);let n=[];return M.Children.forEach(e,(r,i)=>{if(!M.isValidElement(r))return;let a=[...t,i];if(r.type===M.Fragment){n.push.apply(n,qj(r.props.children,a));return}r.type!==hy&&fi(!1),!r.props.index||!r.props.children||fi(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=qj(r.props.children,a)),n.push(o)}),n}/**
|
||
* React Router DOM v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function zj(){return zj=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},zj.apply(this,arguments)}function XG(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function QG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function JG(e,t){return e.button===0&&(!t||t==="_self")&&!QG(e)}const eZ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],tZ="6";try{window.__reactRouterVersion=tZ}catch{}const nZ="startTransition",e2=X0[nZ];function rZ(e){let{basename:t,children:n,future:r,window:i}=e,a=M.useRef();a.current==null&&(a.current=aG({window:i,v5Compat:!0}));let o=a.current,[s,c]=M.useState({action:o.action,location:o.location}),{v7_startTransition:d}=r||{},p=M.useCallback(m=>{d&&e2?e2(()=>c(m)):c(m)},[c,d]);return M.useLayoutEffect(()=>o.listen(p),[o,p]),M.useEffect(()=>GG(r),[r]),M.createElement(ZG,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}const iZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zo=M.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:s,target:c,to:d,preventScrollReset:p,viewTransition:m}=t,y=XG(t,eZ),{basename:b}=M.useContext(ud),P,x=!1;if(typeof d=="string"&&aZ.test(d)&&(P=d,iZ))try{let k=new URL(window.location.href),D=d.startsWith("//")?new URL(k.protocol+d):new URL(d),I=cE(D.pathname,b);D.origin===k.origin&&I!=null?d=I+D.search+D.hash:x=!0}catch{}let w=MG(d,{relative:i}),T=oZ(d,{replace:o,state:s,target:c,preventScrollReset:p,relative:i,viewTransition:m});function E(k){r&&r(k),k.defaultPrevented||T(k)}return M.createElement("a",zj({},y,{href:P||w,onClick:x||a?r:E,ref:n,target:c}))});var t2;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(t2||(t2={}));var n2;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(n2||(n2={}));function oZ(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,c=dE(),d=cd(),p=KF(e,{relative:o});return M.useCallback(m=>{if(JG(m,n)){m.preventDefault();let y=r!==void 0?r:Ry(d)===Ry(p);c(e,{replace:y,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[d,c,p,r,i,n,e,a,o,s])}function YF(e,t){return function(){return e.apply(t,arguments)}}const{toString:sZ}=Object.prototype,{getPrototypeOf:hE}=Object,{iterator:ab,toStringTag:XF}=Symbol,ob=(e=>t=>{const n=sZ.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),hl=e=>(e=e.toLowerCase(),t=>ob(t)===e),sb=e=>t=>typeof t===e,{isArray:ep}=Array,vh=sb("undefined");function Sg(e){return e!==null&&!vh(e)&&e.constructor!==null&&!vh(e.constructor)&&Po(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const QF=hl("ArrayBuffer");function lZ(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&QF(e.buffer),t}const uZ=sb("string"),Po=sb("function"),JF=sb("number"),Pg=e=>e!==null&&typeof e=="object",cZ=e=>e===!0||e===!1,py=e=>{if(ob(e)!=="object")return!1;const t=hE(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(XF in e)&&!(ab in e)},fZ=e=>{if(!Pg(e)||Sg(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},dZ=hl("Date"),hZ=hl("File"),pZ=hl("Blob"),mZ=hl("FileList"),gZ=e=>Pg(e)&&Po(e.pipe),vZ=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Po(e.append)&&((t=ob(e))==="formdata"||t==="object"&&Po(e.toString)&&e.toString()==="[object FormData]"))},yZ=hl("URLSearchParams"),[bZ,xZ,wZ,_Z]=["ReadableStream","Request","Response","Headers"].map(hl),SZ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function jg(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),ep(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Sg(e))return;const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(r=0;r<o;r++)s=a[r],t.call(null,e[s],s,e)}}function e5(e,t){if(Sg(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Tf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,t5=e=>!vh(e)&&e!==Tf;function Uj(){const{caseless:e,skipUndefined:t}=t5(this)&&this||{},n={},r=(i,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const o=e&&e5(n,a)||a;py(n[o])&&py(i)?n[o]=Uj(n[o],i):py(i)?n[o]=Uj({},i):ep(i)?n[o]=i.slice():(!t||!vh(i))&&(n[o]=i)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&jg(arguments[i],r);return n}const PZ=(e,t,n,{allOwnKeys:r}={})=>(jg(t,(i,a)=>{n&&Po(i)?Object.defineProperty(e,a,{value:YF(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,a,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),jZ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),OZ=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},TZ=(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&hE(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},EZ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},AZ=e=>{if(!e)return null;if(ep(e))return e;let t=e.length;if(!JF(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},kZ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&hE(Uint8Array)),CZ=(e,t)=>{const r=(e&&e[ab]).call(e);let i;for(;(i=r.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},NZ=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},MZ=hl("HTMLFormElement"),RZ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),r2=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),LZ=hl("RegExp"),n5=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};jg(n,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(r[a]=o||i)}),Object.defineProperties(e,r)},IZ=e=>{n5(e,(t,n)=>{if(Po(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Po(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},DZ=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return ep(e)?r(e):r(String(e).split(t)),n},BZ=()=>{},$Z=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function FZ(e){return!!(e&&Po(e.append)&&e[XF]==="FormData"&&e[ab])}const qZ=e=>{const t=new Array(10),n=(r,i)=>{if(Pg(r)){if(t.indexOf(r)>=0)return;if(Sg(r))return r;if(!("toJSON"in r)){t[i]=r;const a=ep(r)?[]:{};return jg(r,(o,s)=>{const c=n(o,i+1);!vh(c)&&(a[s]=c)}),t[i]=void 0,a}}return r};return n(e,0)},zZ=hl("AsyncFunction"),UZ=e=>e&&(Pg(e)||Po(e))&&Po(e.then)&&Po(e.catch),r5=((e,t)=>e?setImmediate:t?((n,r)=>(Tf.addEventListener("message",({source:i,data:a})=>{i===Tf&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Tf.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Po(Tf.postMessage)),VZ=typeof queueMicrotask<"u"?queueMicrotask.bind(Tf):typeof process<"u"&&process.nextTick||r5,WZ=e=>e!=null&&Po(e[ab]),Ue={isArray:ep,isArrayBuffer:QF,isBuffer:Sg,isFormData:vZ,isArrayBufferView:lZ,isString:uZ,isNumber:JF,isBoolean:cZ,isObject:Pg,isPlainObject:py,isEmptyObject:fZ,isReadableStream:bZ,isRequest:xZ,isResponse:wZ,isHeaders:_Z,isUndefined:vh,isDate:dZ,isFile:hZ,isBlob:pZ,isRegExp:LZ,isFunction:Po,isStream:gZ,isURLSearchParams:yZ,isTypedArray:kZ,isFileList:mZ,forEach:jg,merge:Uj,extend:PZ,trim:SZ,stripBOM:jZ,inherits:OZ,toFlatObject:TZ,kindOf:ob,kindOfTest:hl,endsWith:EZ,toArray:AZ,forEachEntry:CZ,matchAll:NZ,isHTMLForm:MZ,hasOwnProperty:r2,hasOwnProp:r2,reduceDescriptors:n5,freezeMethods:IZ,toObjectSet:DZ,toCamelCase:RZ,noop:BZ,toFiniteNumber:$Z,findKey:e5,global:Tf,isContextDefined:t5,isSpecCompliantForm:FZ,toJSONObject:qZ,isAsyncFn:zZ,isThenable:UZ,setImmediate:r5,asap:VZ,isIterable:WZ};let Qt=class i5 extends Error{static from(t,n,r,i,a,o){const s=new i5(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,o&&Object.assign(s,o),s}constructor(t,n,r,i,a){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),a&&(this.response=a,this.status=a.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ue.toJSONObject(this.config),code:this.code,status:this.status}}};Qt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Qt.ERR_BAD_OPTION="ERR_BAD_OPTION";Qt.ECONNABORTED="ECONNABORTED";Qt.ETIMEDOUT="ETIMEDOUT";Qt.ERR_NETWORK="ERR_NETWORK";Qt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Qt.ERR_DEPRECATED="ERR_DEPRECATED";Qt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Qt.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Qt.ERR_CANCELED="ERR_CANCELED";Qt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Qt.ERR_INVALID_URL="ERR_INVALID_URL";const KZ=null;function Vj(e){return Ue.isPlainObject(e)||Ue.isArray(e)}function a5(e){return Ue.endsWith(e,"[]")?e.slice(0,-2):e}function i2(e,t,n){return e?e.concat(t).map(function(i,a){return i=a5(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function HZ(e){return Ue.isArray(e)&&!e.some(Vj)}const GZ=Ue.toFlatObject(Ue,{},null,function(t){return/^is[A-Z]/.test(t)});function lb(e,t,n){if(!Ue.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Ue.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,w){return!Ue.isUndefined(w[x])});const r=n.metaTokens,i=n.visitor||p,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Ue.isSpecCompliantForm(t);if(!Ue.isFunction(i))throw new TypeError("visitor must be a function");function d(P){if(P===null)return"";if(Ue.isDate(P))return P.toISOString();if(Ue.isBoolean(P))return P.toString();if(!c&&Ue.isBlob(P))throw new Qt("Blob is not supported. Use a Buffer instead.");return Ue.isArrayBuffer(P)||Ue.isTypedArray(P)?c&&typeof Blob=="function"?new Blob([P]):Buffer.from(P):P}function p(P,x,w){let T=P;if(P&&!w&&typeof P=="object"){if(Ue.endsWith(x,"{}"))x=r?x:x.slice(0,-2),P=JSON.stringify(P);else if(Ue.isArray(P)&&HZ(P)||(Ue.isFileList(P)||Ue.endsWith(x,"[]"))&&(T=Ue.toArray(P)))return x=a5(x),T.forEach(function(k,D){!(Ue.isUndefined(k)||k===null)&&t.append(o===!0?i2([x],D,a):o===null?x:x+"[]",d(k))}),!1}return Vj(P)?!0:(t.append(i2(w,x,a),d(P)),!1)}const m=[],y=Object.assign(GZ,{defaultVisitor:p,convertValue:d,isVisitable:Vj});function b(P,x){if(!Ue.isUndefined(P)){if(m.indexOf(P)!==-1)throw Error("Circular reference detected in "+x.join("."));m.push(P),Ue.forEach(P,function(T,E){(!(Ue.isUndefined(T)||T===null)&&i.call(t,T,Ue.isString(E)?E.trim():E,x,y))===!0&&b(T,x?x.concat(E):[E])}),m.pop()}}if(!Ue.isObject(e))throw new TypeError("data must be an object");return b(e),t}function a2(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function pE(e,t){this._pairs=[],e&&lb(e,this,t)}const o5=pE.prototype;o5.append=function(t,n){this._pairs.push([t,n])};o5.toString=function(t){const n=t?function(r){return t.call(this,r,a2)}:a2;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function ZZ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function s5(e,t,n){if(!t)return e;const r=n&&n.encode||ZZ,i=Ue.isFunction(n)?{serialize:n}:n,a=i&&i.serialize;let o;if(a?o=a(t,i):o=Ue.isURLSearchParams(t)?t.toString():new pE(t,i).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class o2{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ue.forEach(this.handlers,function(r){r!==null&&t(r)})}}const mE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},YZ=typeof URLSearchParams<"u"?URLSearchParams:pE,XZ=typeof FormData<"u"?FormData:null,QZ=typeof Blob<"u"?Blob:null,JZ={isBrowser:!0,classes:{URLSearchParams:YZ,FormData:XZ,Blob:QZ},protocols:["http","https","file","blob","url","data"]},gE=typeof window<"u"&&typeof document<"u",Wj=typeof navigator=="object"&&navigator||void 0,eY=gE&&(!Wj||["ReactNative","NativeScript","NS"].indexOf(Wj.product)<0),tY=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",nY=gE&&window.location.href||"http://localhost",rY=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:gE,hasStandardBrowserEnv:eY,hasStandardBrowserWebWorkerEnv:tY,navigator:Wj,origin:nY},Symbol.toStringTag,{value:"Module"})),Ea={...rY,...JZ};function iY(e,t){return lb(e,new Ea.classes.URLSearchParams,{visitor:function(n,r,i,a){return Ea.isNode&&Ue.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function aY(e){return Ue.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function oY(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function l5(e){function t(n,r,i,a){let o=n[a++];if(o==="__proto__")return!0;const s=Number.isFinite(+o),c=a>=n.length;return o=!o&&Ue.isArray(i)?i.length:o,c?(Ue.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!s):((!i[o]||!Ue.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],a)&&Ue.isArray(i[o])&&(i[o]=oY(i[o])),!s)}if(Ue.isFormData(e)&&Ue.isFunction(e.entries)){const n={};return Ue.forEachEntry(e,(r,i)=>{t(aY(r),i,n,0)}),n}return null}function sY(e,t,n){if(Ue.isString(e))try{return(t||JSON.parse)(e),Ue.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Og={transitional:mE,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=Ue.isObject(t);if(a&&Ue.isHTMLForm(t)&&(t=new FormData(t)),Ue.isFormData(t))return i?JSON.stringify(l5(t)):t;if(Ue.isArrayBuffer(t)||Ue.isBuffer(t)||Ue.isStream(t)||Ue.isFile(t)||Ue.isBlob(t)||Ue.isReadableStream(t))return t;if(Ue.isArrayBufferView(t))return t.buffer;if(Ue.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return iY(t,this.formSerializer).toString();if((s=Ue.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return lb(s?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),sY(t)):t}],transformResponse:[function(t){const n=this.transitional||Og.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(Ue.isResponse(t)||Ue.isReadableStream(t))return t;if(t&&Ue.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(s){if(o)throw s.name==="SyntaxError"?Qt.from(s,Qt.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ea.classes.FormData,Blob:Ea.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ue.forEach(["delete","get","head","post","put","patch"],e=>{Og.headers[e]={}});const lY=Ue.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),uY=e=>{const t={};let n,r,i;return e&&e.split(`
|
||
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&lY[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},s2=Symbol("internals");function Dp(e){return e&&String(e).trim().toLowerCase()}function my(e){return e===!1||e==null?e:Ue.isArray(e)?e.map(my):String(e)}function cY(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const fY=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Lw(e,t,n,r,i){if(Ue.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Ue.isString(t)){if(Ue.isString(r))return t.indexOf(r)!==-1;if(Ue.isRegExp(r))return r.test(t)}}function dY(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function hY(e,t){const n=Ue.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,a,o){return this[r].call(this,t,i,a,o)},configurable:!0})})}let jo=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function a(s,c,d){const p=Dp(c);if(!p)throw new Error("header name must be a non-empty string");const m=Ue.findKey(i,p);(!m||i[m]===void 0||d===!0||d===void 0&&i[m]!==!1)&&(i[m||c]=my(s))}const o=(s,c)=>Ue.forEach(s,(d,p)=>a(d,p,c));if(Ue.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(Ue.isString(t)&&(t=t.trim())&&!fY(t))o(uY(t),n);else if(Ue.isObject(t)&&Ue.isIterable(t)){let s={},c,d;for(const p of t){if(!Ue.isArray(p))throw TypeError("Object iterator must return a key-value pair");s[d=p[0]]=(c=s[d])?Ue.isArray(c)?[...c,p[1]]:[c,p[1]]:p[1]}o(s,n)}else t!=null&&a(n,t,r);return this}get(t,n){if(t=Dp(t),t){const r=Ue.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return cY(i);if(Ue.isFunction(n))return n.call(this,i,r);if(Ue.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Dp(t),t){const r=Ue.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Lw(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function a(o){if(o=Dp(o),o){const s=Ue.findKey(r,o);s&&(!n||Lw(r,r[s],s,n))&&(delete r[s],i=!0)}}return Ue.isArray(t)?t.forEach(a):a(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const a=n[r];(!t||Lw(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const n=this,r={};return Ue.forEach(this,(i,a)=>{const o=Ue.findKey(r,a);if(o){n[o]=my(i),delete n[a];return}const s=t?dY(a):String(a).trim();s!==a&&delete n[a],n[s]=my(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Ue.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Ue.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[s2]=this[s2]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=Dp(o);r[s]||(hY(i,o),r[s]=!0)}return Ue.isArray(t)?t.forEach(a):a(t),this}};jo.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ue.reduceDescriptors(jo.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});Ue.freezeMethods(jo);function Iw(e,t){const n=this||Og,r=t||n,i=jo.from(r.headers);let a=r.data;return Ue.forEach(e,function(s){a=s.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function u5(e){return!!(e&&e.__CANCEL__)}let Tg=class extends Qt{constructor(t,n,r){super(t??"canceled",Qt.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function c5(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Qt("Request failed with status code "+n.status,[Qt.ERR_BAD_REQUEST,Qt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function pY(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mY(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),p=r[a];o||(o=d),n[i]=c,r[i]=d;let m=a,y=0;for(;m!==i;)y+=n[m++],m=m%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),d-o<t)return;const b=p&&d-p;return b?Math.round(y*1e3/b):void 0}}function gY(e,t){let n=0,r=1e3/t,i,a;const o=(d,p=Date.now())=>{n=p,i=null,a&&(clearTimeout(a),a=null),e(...d)};return[(...d)=>{const p=Date.now(),m=p-n;m>=r?o(d,p):(i=d,a||(a=setTimeout(()=>{a=null,o(i)},r-m)))},()=>i&&o(i)]}const Ly=(e,t,n=3)=>{let r=0;const i=mY(50,250);return gY(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,c=o-r,d=i(c),p=o<=s;r=o;const m={loaded:o,total:s,progress:s?o/s:void 0,bytes:c,rate:d||void 0,estimated:d&&s&&p?(s-o)/d:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(m)},n)},l2=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},u2=e=>(...t)=>Ue.asap(()=>e(...t)),vY=Ea.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ea.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ea.origin),Ea.navigator&&/(msie|trident)/i.test(Ea.navigator.userAgent)):()=>!0,yY=Ea.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];Ue.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Ue.isString(r)&&s.push(`path=${r}`),Ue.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push("secure"),Ue.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function bY(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xY(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function f5(e,t,n){let r=!bY(t);return e&&(r||n==!1)?xY(e,t):t}const c2=e=>e instanceof jo?{...e}:e;function Yf(e,t){t=t||{};const n={};function r(d,p,m,y){return Ue.isPlainObject(d)&&Ue.isPlainObject(p)?Ue.merge.call({caseless:y},d,p):Ue.isPlainObject(p)?Ue.merge({},p):Ue.isArray(p)?p.slice():p}function i(d,p,m,y){if(Ue.isUndefined(p)){if(!Ue.isUndefined(d))return r(void 0,d,m,y)}else return r(d,p,m,y)}function a(d,p){if(!Ue.isUndefined(p))return r(void 0,p)}function o(d,p){if(Ue.isUndefined(p)){if(!Ue.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function s(d,p,m){if(m in t)return r(d,p);if(m in e)return r(void 0,d)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(d,p,m)=>i(c2(d),c2(p),m,!0)};return Ue.forEach(Object.keys({...e,...t}),function(p){if(p==="__proto__"||p==="constructor"||p==="prototype")return;const m=Ue.hasOwnProp(c,p)?c[p]:i,y=m(e[p],t[p],p);Ue.isUndefined(y)&&m!==s||(n[p]=y)}),n}const d5=e=>{const t=Yf({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=jo.from(o),t.url=s5(f5(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Ue.isFormData(n)){if(Ea.hasStandardBrowserEnv||Ea.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(Ue.isFunction(n.getHeaders)){const c=n.getHeaders(),d=["content-type","content-length"];Object.entries(c).forEach(([p,m])=>{d.includes(p.toLowerCase())&&o.set(p,m)})}}if(Ea.hasStandardBrowserEnv&&(r&&Ue.isFunction(r)&&(r=r(t)),r||r!==!1&&vY(t.url))){const c=i&&a&&yY.read(a);c&&o.set(i,c)}return t},wY=typeof XMLHttpRequest<"u",_Y=wY&&function(e){return new Promise(function(n,r){const i=d5(e);let a=i.data;const o=jo.from(i.headers).normalize();let{responseType:s,onUploadProgress:c,onDownloadProgress:d}=i,p,m,y,b,P;function x(){b&&b(),P&&P(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let w=new XMLHttpRequest;w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout;function T(){if(!w)return;const k=jo.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),I={data:!s||s==="text"||s==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:k,config:e,request:w};c5(function($){n($),x()},function($){r($),x()},I),w=null}"onloadend"in w?w.onloadend=T:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(T)},w.onabort=function(){w&&(r(new Qt("Request aborted",Qt.ECONNABORTED,e,w)),w=null)},w.onerror=function(D){const I=D&&D.message?D.message:"Network Error",R=new Qt(I,Qt.ERR_NETWORK,e,w);R.event=D||null,r(R),w=null},w.ontimeout=function(){let D=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const I=i.transitional||mE;i.timeoutErrorMessage&&(D=i.timeoutErrorMessage),r(new Qt(D,I.clarifyTimeoutError?Qt.ETIMEDOUT:Qt.ECONNABORTED,e,w)),w=null},a===void 0&&o.setContentType(null),"setRequestHeader"in w&&Ue.forEach(o.toJSON(),function(D,I){w.setRequestHeader(I,D)}),Ue.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),s&&s!=="json"&&(w.responseType=i.responseType),d&&([y,P]=Ly(d,!0),w.addEventListener("progress",y)),c&&w.upload&&([m,b]=Ly(c),w.upload.addEventListener("progress",m),w.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(p=k=>{w&&(r(!k||k.type?new Tg(null,e,w):k),w.abort(),w=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const E=pY(i.url);if(E&&Ea.protocols.indexOf(E)===-1){r(new Qt("Unsupported protocol "+E+":",Qt.ERR_BAD_REQUEST,e));return}w.send(a||null)})},SY=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const a=function(d){if(!i){i=!0,s();const p=d instanceof Error?d:this.reason;r.abort(p instanceof Qt?p:new Tg(p instanceof Error?p.message:p))}};let o=t&&setTimeout(()=>{o=null,a(new Qt(`timeout of ${t}ms exceeded`,Qt.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(a):d.removeEventListener("abort",a)}),e=null)};e.forEach(d=>d.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>Ue.asap(s),c}},PY=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},jY=async function*(e,t){for await(const n of OY(e))yield*PY(n,t)},OY=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},f2=(e,t,n,r)=>{const i=jY(e,t);let a=0,o,s=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:p}=await i.next();if(d){s(),c.close();return}let m=p.byteLength;if(n){let y=a+=m;n(y)}c.enqueue(new Uint8Array(p))}catch(d){throw s(d),d}},cancel(c){return s(c),i.return()}},{highWaterMark:2})},d2=64*1024,{isFunction:Dv}=Ue,TY=(({Request:e,Response:t})=>({Request:e,Response:t}))(Ue.global),{ReadableStream:h2,TextEncoder:p2}=Ue.global,m2=(e,...t)=>{try{return!!e(...t)}catch{return!1}},EY=e=>{e=Ue.merge.call({skipUndefined:!0},TY,e);const{fetch:t,Request:n,Response:r}=e,i=t?Dv(t):typeof fetch=="function",a=Dv(n),o=Dv(r);if(!i)return!1;const s=i&&Dv(h2),c=i&&(typeof p2=="function"?(P=>x=>P.encode(x))(new p2):async P=>new Uint8Array(await new n(P).arrayBuffer())),d=a&&s&&m2(()=>{let P=!1;const x=new n(Ea.origin,{body:new h2,method:"POST",get duplex(){return P=!0,"half"}}).headers.has("Content-Type");return P&&!x}),p=o&&s&&m2(()=>Ue.isReadableStream(new r("").body)),m={stream:p&&(P=>P.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(P=>{!m[P]&&(m[P]=(x,w)=>{let T=x&&x[P];if(T)return T.call(x);throw new Qt(`Response type '${P}' is not supported`,Qt.ERR_NOT_SUPPORT,w)})});const y=async P=>{if(P==null)return 0;if(Ue.isBlob(P))return P.size;if(Ue.isSpecCompliantForm(P))return(await new n(Ea.origin,{method:"POST",body:P}).arrayBuffer()).byteLength;if(Ue.isArrayBufferView(P)||Ue.isArrayBuffer(P))return P.byteLength;if(Ue.isURLSearchParams(P)&&(P=P+""),Ue.isString(P))return(await c(P)).byteLength},b=async(P,x)=>{const w=Ue.toFiniteNumber(P.getContentLength());return w??y(x)};return async P=>{let{url:x,method:w,data:T,signal:E,cancelToken:k,timeout:D,onDownloadProgress:I,onUploadProgress:R,responseType:$,headers:V,withCredentials:K="same-origin",fetchOptions:Z}=d5(P),ee=t||fetch;$=$?($+"").toLowerCase():"text";let ne=SY([E,k&&k.toAbortSignal()],D),oe=null;const he=ne&&ne.unsubscribe&&(()=>{ne.unsubscribe()});let Se;try{if(R&&d&&w!=="get"&&w!=="head"&&(Se=await b(V,T))!==0){let ie=new n(x,{method:"POST",body:T,duplex:"half"}),de;if(Ue.isFormData(T)&&(de=ie.headers.get("content-type"))&&V.setContentType(de),ie.body){const[He,je]=l2(Se,Ly(u2(R)));T=f2(ie.body,d2,He,je)}}Ue.isString(K)||(K=K?"include":"omit");const fe=a&&"credentials"in n.prototype,Oe={...Z,signal:ne,method:w.toUpperCase(),headers:V.normalize().toJSON(),body:T,duplex:"half",credentials:fe?K:void 0};oe=a&&new n(x,Oe);let re=await(a?ee(oe,Z):ee(x,Oe));const Ce=p&&($==="stream"||$==="response");if(p&&(I||Ce&&he)){const ie={};["status","statusText","headers"].forEach($e=>{ie[$e]=re[$e]});const de=Ue.toFiniteNumber(re.headers.get("content-length")),[He,je]=I&&l2(de,Ly(u2(I),!0))||[];re=new r(f2(re.body,d2,He,()=>{je&&je(),he&&he()}),ie)}$=$||"text";let ae=await m[Ue.findKey(m,$)||"text"](re,P);return!Ce&&he&&he(),await new Promise((ie,de)=>{c5(ie,de,{data:ae,headers:jo.from(re.headers),status:re.status,statusText:re.statusText,config:P,request:oe})})}catch(fe){throw he&&he(),fe&&fe.name==="TypeError"&&/Load failed|fetch/i.test(fe.message)?Object.assign(new Qt("Network Error",Qt.ERR_NETWORK,P,oe,fe&&fe.response),{cause:fe.cause||fe}):Qt.from(fe,fe&&fe.code,P,oe,fe&&fe.response)}}},AY=new Map,h5=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,a=[r,i,n];let o=a.length,s=o,c,d,p=AY;for(;s--;)c=a[s],d=p.get(c),d===void 0&&p.set(c,d=s?new Map:EY(t)),p=d;return d};h5();const vE={http:KZ,xhr:_Y,fetch:{get:h5}};Ue.forEach(vE,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const g2=e=>`- ${e}`,kY=e=>Ue.isFunction(e)||e===null||e===!1;function CY(e,t){e=Ue.isArray(e)?e:[e];const{length:n}=e;let r,i;const a={};for(let o=0;o<n;o++){r=e[o];let s;if(i=r,!kY(r)&&(i=vE[(s=String(r)).toLowerCase()],i===void 0))throw new Qt(`Unknown adapter '${s}'`);if(i&&(Ue.isFunction(i)||(i=i.get(t))))break;a[s||"#"+o]=i}if(!i){const o=Object.entries(a).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let s=n?o.length>1?`since :
|
||
`+o.map(g2).join(`
|
||
`):" "+g2(o[0]):"as no adapter specified";throw new Qt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const p5={getAdapter:CY,adapters:vE};function Dw(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Tg(null,e)}function v2(e){return Dw(e),e.headers=jo.from(e.headers),e.data=Iw.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),p5.getAdapter(e.adapter||Og.adapter,e)(e).then(function(r){return Dw(e),r.data=Iw.call(e,e.transformResponse,r),r.headers=jo.from(r.headers),r},function(r){return u5(r)||(Dw(e),r&&r.response&&(r.response.data=Iw.call(e,e.transformResponse,r.response),r.response.headers=jo.from(r.response.headers))),Promise.reject(r)})}const m5="1.13.5",ub={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ub[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const y2={};ub.transitional=function(t,n,r){function i(a,o){return"[Axios v"+m5+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,s)=>{if(t===!1)throw new Qt(i(o," has been removed"+(n?" in "+n:"")),Qt.ERR_DEPRECATED);return n&&!y2[o]&&(y2[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,o,s):!0}};ub.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function NY(e,t,n){if(typeof e!="object")throw new Qt("options must be an object",Qt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const s=e[a],c=s===void 0||o(s,a,e);if(c!==!0)throw new Qt("option "+a+" must be "+c,Qt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Qt("Unknown option "+a,Qt.ERR_BAD_OPTION)}}const gy={assertOptions:NY,validators:ub},ds=gy.validators;let Uf=class{constructor(t){this.defaults=t||{},this.interceptors={request:new o2,response:new o2}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
||
`+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Yf(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&gy.assertOptions(r,{silentJSONParsing:ds.transitional(ds.boolean),forcedJSONParsing:ds.transitional(ds.boolean),clarifyTimeoutError:ds.transitional(ds.boolean),legacyInterceptorReqResOrdering:ds.transitional(ds.boolean)},!1),i!=null&&(Ue.isFunction(i)?n.paramsSerializer={serialize:i}:gy.assertOptions(i,{encode:ds.function,serialize:ds.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gy.assertOptions(n,{baseUrl:ds.spelling("baseURL"),withXsrfToken:ds.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&Ue.merge(a.common,a[n.method]);a&&Ue.forEach(["delete","get","head","post","put","patch","common"],P=>{delete a[P]}),n.headers=jo.concat(o,a);const s=[];let c=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(n)===!1)return;c=c&&x.synchronous;const w=n.transitional||mE;w&&w.legacyInterceptorReqResOrdering?s.unshift(x.fulfilled,x.rejected):s.push(x.fulfilled,x.rejected)});const d=[];this.interceptors.response.forEach(function(x){d.push(x.fulfilled,x.rejected)});let p,m=0,y;if(!c){const P=[v2.bind(this),void 0];for(P.unshift(...s),P.push(...d),y=P.length,p=Promise.resolve(n);m<y;)p=p.then(P[m++],P[m++]);return p}y=s.length;let b=n;for(;m<y;){const P=s[m++],x=s[m++];try{b=P(b)}catch(w){x.call(this,w);break}}try{p=v2.call(this,b)}catch(P){return Promise.reject(P)}for(m=0,y=d.length;m<y;)p=p.then(d[m++],d[m++]);return p}getUri(t){t=Yf(this.defaults,t);const n=f5(t.baseURL,t.url,t.allowAbsoluteUrls);return s5(n,t.params,t.paramsSerializer)}};Ue.forEach(["delete","get","head","options"],function(t){Uf.prototype[t]=function(n,r){return this.request(Yf(r||{},{method:t,url:n,data:(r||{}).data}))}});Ue.forEach(["post","put","patch"],function(t){function n(r){return function(a,o,s){return this.request(Yf(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Uf.prototype[t]=n(),Uf.prototype[t+"Form"]=n(!0)});let MY=class g5{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{r.subscribe(s),a=s}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},t(function(a,o,s){r.reason||(r.reason=new Tg(a,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new g5(function(i){t=i}),cancel:t}}};function RY(e){return function(n){return e.apply(null,n)}}function LY(e){return Ue.isObject(e)&&e.isAxiosError===!0}const Kj={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Kj).forEach(([e,t])=>{Kj[t]=e});function v5(e){const t=new Uf(e),n=YF(Uf.prototype.request,t);return Ue.extend(n,Uf.prototype,t,{allOwnKeys:!0}),Ue.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return v5(Yf(e,i))},n}const ni=v5(Og);ni.Axios=Uf;ni.CanceledError=Tg;ni.CancelToken=MY;ni.isCancel=u5;ni.VERSION=m5;ni.toFormData=lb;ni.AxiosError=Qt;ni.Cancel=ni.CanceledError;ni.all=function(t){return Promise.all(t)};ni.spread=RY;ni.isAxiosError=LY;ni.mergeConfig=Yf;ni.AxiosHeaders=jo;ni.formToJSON=e=>l5(Ue.isHTMLForm(e)?new FormData(e):e);ni.getAdapter=p5.getAdapter;ni.HttpStatusCode=Kj;ni.default=ni;const{Axios:POe,AxiosError:jOe,CanceledError:OOe,isCancel:TOe,CancelToken:EOe,VERSION:AOe,all:kOe,Cancel:COe,isAxiosError:NOe,spread:MOe,toFormData:ROe,AxiosHeaders:LOe,HttpStatusCode:IOe,formToJSON:DOe,getAdapter:BOe,mergeConfig:$Oe}=ni,IY=typeof window>"u",b2=!IY&&window.self!==window.top,Bw=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),ia=[];for(let e=0;e<256;++e)ia.push((e+256).toString(16).slice(1));function DY(e,t=0){return(ia[e[t+0]]+ia[e[t+1]]+ia[e[t+2]]+ia[e[t+3]]+"-"+ia[e[t+4]]+ia[e[t+5]]+"-"+ia[e[t+6]]+ia[e[t+7]]+"-"+ia[e[t+8]]+ia[e[t+9]]+"-"+ia[e[t+10]]+ia[e[t+11]]+ia[e[t+12]]+ia[e[t+13]]+ia[e[t+14]]+ia[e[t+15]]).toLowerCase()}let $w;const BY=new Uint8Array(16);function $Y(){if(!$w){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");$w=crypto.getRandomValues.bind(crypto)}return $w(BY)}const FY=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),x2={randomUUID:FY};function qY(e,t,n){var i;e=e||{};const r=e.random??((i=e.rng)==null?void 0:i.call(e))??$Y();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,DY(r)}function zY(e,t,n){return x2.randomUUID&&!e?x2.randomUUID():qY(e)}class UY extends Error{constructor(t,n,r,i,a){super(t),this.name="Base44Error",this.status=n,this.code=r,this.data=i,this.originalError=a}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code,data:this.data}}}function Jp({baseURL:e,headers:t={},token:n,interceptResponses:r=!0,onError:i}){const a=ni.create({baseURL:e,headers:{"Content-Type":"application/json",Accept:"application/json",...t}});return n&&(a.defaults.headers.common.Authorization=`Bearer ${n}`),a.interceptors.request.use(o=>{typeof window<"u"&&o.headers.set("X-Origin-URL",window.location.href);const s=zY();if(o.requestId=s,b2)try{window.parent.postMessage({type:"api-request-start",requestId:s,data:{url:e+o.url,method:o.method,body:o.data instanceof FormData?"[FormData object]":o.data}},"*")}catch{}return o}),r&&a.interceptors.response.use(o=>{var s;const c=(s=o.config)===null||s===void 0?void 0:s.requestId;try{b2&&c&&window.parent.postMessage({type:"api-request-end",requestId:c,data:{statusCode:o.status,response:o.data}},"*")}catch{}return o.data},o=>{var s,c,d,p,m,y,b,P;const x=((c=(s=o.response)===null||s===void 0?void 0:s.data)===null||c===void 0?void 0:c.message)||((p=(d=o.response)===null||d===void 0?void 0:d.data)===null||p===void 0?void 0:p.detail)||o.message,w=new UY(x,(m=o.response)===null||m===void 0?void 0:m.status,(b=(y=o.response)===null||y===void 0?void 0:y.data)===null||b===void 0?void 0:b.code,(P=o.response)===null||P===void 0?void 0:P.data,o);return i==null||i(w),Promise.reject(w)}),a}function w2(e){const{axios:t,appId:n,getSocket:r}=e;return new Proxy({},{get(i,a){if(!(typeof a!="string"||a==="then"||a.startsWith("_")))return WY(t,n,a,r)}})}function VY(e){var t;try{const n=JSON.parse(e);return{type:n.type,data:n.data,id:n.id||((t=n.data)===null||t===void 0?void 0:t.id),timestamp:n.timestamp||new Date().toISOString()}}catch(n){return console.warn("[Base44 SDK] Failed to parse realtime message:",n),null}}function WY(e,t,n,r){const i=`/apps/${t}/entities/${n}`;return{async list(a,o,s,c){const d={};return a&&(d.sort=a),o&&(d.limit=o),s&&(d.skip=s),c&&(d.fields=Array.isArray(c)?c.join(","):c),e.get(i,{params:d})},async filter(a,o,s,c,d){const p={q:JSON.stringify(a)};return o&&(p.sort=o),s&&(p.limit=s),c&&(p.skip=c),d&&(p.fields=Array.isArray(d)?d.join(","):d),e.get(i,{params:p})},async get(a){return e.get(`${i}/${a}`)},async create(a){return e.post(i,a)},async update(a,o){return e.put(`${i}/${a}`,o)},async delete(a){return e.delete(`${i}/${a}`)},async deleteMany(a){return e.delete(i,{data:a})},async bulkCreate(a){return e.post(`${i}/bulk`,a)},async importEntities(a){const o=new FormData;return o.append("file",a,a.name),e.post(`${i}/import`,o,{headers:{"Content-Type":"multipart/form-data"}})},subscribe(a){const o=`entities:${t}:${n}`;return r().subscribeToRoom(o,{update_model:d=>{const p=VY(d.data);if(p)try{a(p)}catch(m){console.error("[Base44 SDK] Subscription callback error:",m)}}})}}}function KY(e,t){return{async call(n,r,i){if(!(n!=null&&n.trim()))throw new Error("Integration slug is required and cannot be empty");if(!(r!=null&&r.trim()))throw new Error("Operation ID is required and cannot be empty");const{pathParams:a,queryParams:o,...s}=i??{},c={...s,...a&&{path_params:a},...o&&{query_params:o}};return await e.post(`/apps/${t}/integrations/custom/${n}/${r}`,c)}}}function _2(e,t){const n=KY(e,t);return new Proxy({},{get(r,i){if(!(typeof i!="string"||i==="then"||i.startsWith("_")))return i==="custom"?n:new Proxy({},{get(a,o){if(!(typeof o!="string"||o==="then"||o.startsWith("_")))return async s=>{if(typeof s=="string")throw new Error(`Integration ${o} must receive an object with named parameters, received: ${s}`);let c,d;return s instanceof FormData||s&&Object.values(s).some(p=>p instanceof File)?(c=new FormData,Object.keys(s).forEach(p=>{s[p]instanceof File?c.append(p,s[p],s[p].name):typeof s[p]=="object"&&s[p]!==null?c.append(p,JSON.stringify(s[p])):c.append(p,s[p])}),d="multipart/form-data"):(c=s,d="application/json"),i==="Core"?e.post(`/apps/${t}/integration-endpoints/Core/${o}`,c||s,{headers:{"Content-Type":d}}):e.post(`/apps/${t}/integration-endpoints/installable/${i}/integration-endpoints/${o}`,c||s,{headers:{"Content-Type":d}})}}})}})}function HY(e,t,n,r){return{async me(){return e.get(`/apps/${n}/entities/User/me`)},async updateMe(i){return e.put(`/apps/${n}/entities/User/me`,i)},redirectToLogin(i){if(typeof window>"u")throw new Error("Login method can only be used in a browser environment");const a=i?new URL(i,window.location.origin).toString():window.location.href,o=`${r.appBaseUrl}/login?from_url=${encodeURIComponent(a)}`;window.location.href=o},loginWithProvider(i,a="/"){const o=new URL(a,window.location.origin).toString(),s=i==="google"?"":`/${i}`,c=`${r.appBaseUrl}/api/apps/auth${s}/login?app_id=${n}&from_url=${encodeURIComponent(o)}`;window.location.href=c},logout(i){if(delete e.defaults.headers.common.Authorization,typeof window<"u"){if(window.localStorage)try{window.localStorage.removeItem("base44_access_token"),window.localStorage.removeItem("token")}catch(s){console.error("Failed to remove token from localStorage:",s)}const a=i||window.location.href,o=`${r.appBaseUrl}/api/apps/auth/logout?from_url=${encodeURIComponent(a)}`;window.location.href=o}},setToken(i,a=!0){if(i&&(e.defaults.headers.common.Authorization=`Bearer ${i}`,t.defaults.headers.common.Authorization=`Bearer ${i}`,a&&typeof window<"u"&&window.localStorage))try{window.localStorage.setItem("base44_access_token",i),window.localStorage.setItem("token",i)}catch(o){console.error("Failed to save token to localStorage:",o)}},async loginViaEmailPassword(i,a,o){var s;try{const c=await e.post(`/apps/${n}/auth/login`,{email:i,password:a,...o&&{turnstile_token:o}}),{access_token:d,user:p}=c;return d&&this.setToken(d),{access_token:d,user:p}}catch(c){throw((s=c.response)===null||s===void 0?void 0:s.status)===401&&await this.logout(),c}},async isAuthenticated(){try{return await this.me(),!0}catch{return!1}},inviteUser(i,a){return e.post(`/apps/${n}/users/invite-user`,{user_email:i,role:a})},register(i){return e.post(`/apps/${n}/auth/register`,i)},verifyOtp({email:i,otpCode:a}){return e.post(`/apps/${n}/auth/verify-otp`,{email:i,otp_code:a})},resendOtp(i){return e.post(`/apps/${n}/auth/resend-otp`,{email:i})},resetPasswordRequest(i){return e.post(`/apps/${n}/auth/reset-password-request`,{email:i})},resetPassword({resetToken:i,newPassword:a}){return e.post(`/apps/${n}/auth/reset-password`,{reset_token:i,new_password:a})},changePassword({userId:i,currentPassword:a,newPassword:o}){return e.post(`/apps/${n}/auth/change-password`,{user_id:i,current_password:a,new_password:o})}}}function GY(e,t,n){return{async getAccessToken(r){const i=`/apps/${t}/auth/sso/accesstoken/${r}`,a={};return n&&(a["on-behalf-of"]=`Bearer ${n}`),e.get(i,{headers:a})}}}function ZY(e,t){return{async getAccessToken(n){if(!n||typeof n!="string")throw new Error("Integration type is required and must be a string");return(await e.get(`/apps/${t}/external-auth/tokens/${n}`)).access_token}}}function yE(e={}){const{storageKey:t="base44_access_token",paramName:n="access_token",saveToStorage:r=!0,removeFromUrl:i=!0}=e;let a=null;if(typeof window<"u"&&window.location)try{const o=new URLSearchParams(window.location.search);if(a=o.get(n),a){if(r&&YY(a,{storageKey:t}),i){o.delete(n);const s=`${window.location.pathname}${o.toString()?`?${o.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,s)}return a}}catch(o){console.error("Error retrieving token from URL:",o)}if(typeof window<"u"&&window.localStorage)try{return a=window.localStorage.getItem(t),a}catch(o){console.error("Error retrieving token from local storage:",o)}return null}function YY(e,t){const{storageKey:n="base44_access_token"}=t;if(typeof window>"u"||!window.localStorage||!e)return!1;try{return window.localStorage.setItem(n,e),window.localStorage.setItem("token",e),!0}catch(r){return console.error("Error saving token to local storage:",r),!1}}function S2(e,t){return{async invoke(n,r){if(typeof r=="string")throw new Error(`Function ${n} must receive an object with named parameters, received: ${r}`);let i,a;return r instanceof FormData||r&&Object.values(r).some(o=>o instanceof File)?(i=new FormData,Object.keys(r).forEach(o=>{r[o]instanceof File?i.append(o,r[o],r[o].name):typeof r[o]=="object"&&r[o]!==null?i.append(o,JSON.stringify(r[o])):i.append(o,r[o])}),a="multipart/form-data"):(i=r,a="application/json"),e.post(`/apps/${t}/functions/${n}`,i||r,{headers:{"Content-Type":a}})}}}function P2({axios:e,getSocket:t,appId:n,serverUrl:r,token:i}){const a=`/apps/${n}/agents`,o={},s=()=>e.get(`${a}/conversations`),c=P=>e.get(`${a}/conversations/${P}`);return{getConversations:s,getConversation:c,listConversations:P=>e.get(`${a}/conversations`,{params:P}),createConversation:P=>e.post(`${a}/conversations`,P),addMessage:async(P,x)=>e.post(`${a}/conversations/v2/${P.id}/messages`,x),subscribeToConversation:(P,x)=>{const w=`/agent-conversations/${P}`,T=t(),E=c(P).then(k=>(o[P]=k,k));return T.subscribeToRoom(w,{connect:()=>{},update_model:async({data:k})=>{const D=JSON.parse(k);if(D._message){await E;const I=D._message,R=o[P];if(R){const $=R.messages||[],V=$.findIndex(Z=>Z.id===I.id),K=V!==-1?$.map((Z,ee)=>ee===V?I:Z):[...$,I];o[P]={...R,messages:K},x==null||x(o[P])}}}})},getWhatsAppConnectURL:P=>{const x=`${r}/api/apps/${n}/agents/${encodeURIComponent(P)}/whatsapp`,w=i??yE();return w?`${x}?token=${w}`:x}}}function j2(e,t){const n=`/app-logs/${t}`;return{async logUserInApp(r){await e.post(`${n}/log-user-in-app/${r}`)},async fetchLogs(r={}){return await e.get(n,{params:r})},async getStats(r={}){return await e.get(`${n}/stats`,{params:r})}}}function XY(e,t){return{async inviteUser(n,r){if(r!=="user"&&r!=="admin")throw new Error(`Invalid role: "${r}". Role must be either "user" or "admin".`);return await e.post(`/apps/${t}/runtime/users/invite-user`,{user_email:n,role:r})}}}const Ul=Object.create(null);Ul.open="0";Ul.close="1";Ul.ping="2";Ul.pong="3";Ul.message="4";Ul.upgrade="5";Ul.noop="6";const vy=Object.create(null);Object.keys(Ul).forEach(e=>{vy[Ul[e]]=e});const Hj={type:"error",data:"parser error"},y5=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",b5=typeof ArrayBuffer=="function",x5=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,bE=({type:e,data:t},n,r)=>y5&&t instanceof Blob?n?r(t):O2(t,r):b5&&(t instanceof ArrayBuffer||x5(t))?n?r(t):O2(new Blob([t]),r):r(Ul[e]+(t||"")),O2=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function T2(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Fw;function QY(e,t){if(y5&&e.data instanceof Blob)return e.data.arrayBuffer().then(T2).then(t);if(b5&&(e.data instanceof ArrayBuffer||x5(e.data)))return t(T2(e.data));bE(e,!1,n=>{Fw||(Fw=new TextEncoder),t(Fw.encode(n))})}const E2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",em=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<E2.length;e++)em[E2.charCodeAt(e)]=e;const JY=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const d=new ArrayBuffer(t),p=new Uint8Array(d);for(r=0;r<n;r+=4)a=em[e.charCodeAt(r)],o=em[e.charCodeAt(r+1)],s=em[e.charCodeAt(r+2)],c=em[e.charCodeAt(r+3)],p[i++]=a<<2|o>>4,p[i++]=(o&15)<<4|s>>2,p[i++]=(s&3)<<6|c&63;return d},eX=typeof ArrayBuffer=="function",xE=(e,t)=>{if(typeof e!="string")return{type:"message",data:w5(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:tX(e.substring(1),t)}:vy[n]?e.length>1?{type:vy[n],data:e.substring(1)}:{type:vy[n]}:Hj},tX=(e,t)=>{if(eX){const n=JY(e);return w5(n,t)}else return{base64:!0,data:e}},w5=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},_5="",nX=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((a,o)=>{bE(a,!1,s=>{r[o]=s,++i===n&&t(r.join(_5))})})},rX=(e,t)=>{const n=e.split(_5),r=[];for(let i=0;i<n.length;i++){const a=xE(n[i],t);if(r.push(a),a.type==="error")break}return r};function iX(){return new TransformStream({transform(e,t){QY(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,r)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let qw;function Bv(e){return e.reduce((t,n)=>t+n.length,0)}function $v(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function aX(e,t){qw||(qw=new TextDecoder);const n=[];let r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(Bv(n)<1)break;const c=$v(n,1);a=(c[0]&128)===128,i=c[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Bv(n)<2)break;const c=$v(n,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(Bv(n)<8)break;const c=$v(n,8),d=new DataView(c.buffer,c.byteOffset,c.length),p=d.getUint32(0);if(p>Math.pow(2,21)-1){s.enqueue(Hj);break}i=p*Math.pow(2,32)+d.getUint32(4),r=3}else{if(Bv(n)<i)break;const c=$v(n,i);s.enqueue(xE(a?c:qw.decode(c),t)),r=0}if(i===0||i>e){s.enqueue(Hj);break}}}})}const S5=4;function ui(e){if(e)return oX(e)}function oX(e){for(var t in ui.prototype)e[t]=ui.prototype[t];return e}ui.prototype.on=ui.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ui.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ui.prototype.off=ui.prototype.removeListener=ui.prototype.removeAllListeners=ui.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};ui.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};ui.prototype.emitReserved=ui.prototype.emit;ui.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ui.prototype.hasListeners=function(e){return!!this.listeners(e).length};const cb=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),ws=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),sX="arraybuffer";function P5(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const lX=ws.setTimeout,uX=ws.clearTimeout;function fb(e,t){t.useNativeTimers?(e.setTimeoutFn=lX.bind(ws),e.clearTimeoutFn=uX.bind(ws)):(e.setTimeoutFn=ws.setTimeout.bind(ws),e.clearTimeoutFn=ws.clearTimeout.bind(ws))}const cX=1.33;function fX(e){return typeof e=="string"?dX(e):Math.ceil((e.byteLength||e.size)*cX)}function dX(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function j5(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function hX(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function pX(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}class mX extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class wE extends ui{constructor(t){super(),this.writable=!1,fb(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new mX(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=xE(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=hX(t);return n.length?"?"+n:""}}class gX extends wE{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};rX(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,nX(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=j5()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let O5=!1;try{O5=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const vX=O5;function yX(){}class bX extends gX{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Ll extends ui{constructor(t,n,r){super(),this.createRequest=t,fb(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=P5(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=Ll.requestsCount++,Ll.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=yX,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ll.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ll.requestsCount=0;Ll.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",A2);else if(typeof addEventListener=="function"){const e="onpagehide"in ws?"pagehide":"unload";addEventListener(e,A2,!1)}}function A2(){for(let e in Ll.requests)Ll.requests.hasOwnProperty(e)&&Ll.requests[e].abort()}const xX=(function(){const e=T5({xdomain:!1});return e&&e.responseType!==null})();class wX extends bX{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=xX&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Ll(T5,this.uri(),t)}}function T5(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||vX))return new XMLHttpRequest}catch{}if(!t)try{return new ws[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const E5=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class _X extends wE{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=E5?{}:P5(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;bE(r,this.supportsBinary,a=>{try{this.doWrite(r,a)}catch{}i&&cb(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=j5()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const zw=ws.WebSocket||ws.MozWebSocket;class SX extends _X{createSocket(t,n,r){return E5?new zw(t,n,r):n?new zw(t,n):new zw(t)}doWrite(t,n){this.ws.send(n)}}class PX extends wE{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=aX(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=iX();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const a=()=>{r.read().then(({done:s,value:c})=>{s||(this.onPacket(c),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&cb(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const jX={websocket:SX,webtransport:PX,polling:wX},OX=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,TX=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Gj(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=OX.exec(e||""),a={},o=14;for(;o--;)a[TX[o]]=i[o]||"";return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=EX(a,a.path),a.queryKey=AX(a,a.query),a}function EX(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function AX(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}const Zj=typeof addEventListener=="function"&&typeof removeEventListener=="function",yy=[];Zj&&addEventListener("offline",()=>{yy.forEach(e=>e())},!1);class kc extends ui{constructor(t,n){if(super(),this.binaryType=sX,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Gj(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Gj(n.host).host);fb(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=pX(this.opts.query)),Zj&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},yy.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=S5,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&kc.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",kc.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=fX(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,cb(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:t,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(kc.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Zj&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=yy.indexOf(this._offlineEventListener);r!==-1&&yy.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}kc.protocol=S5;class kX extends kc{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;kc.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",m=>{if(!r)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;kc.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(p(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const y=new Error("probe error");y.transport=n.name,this.emitReserved("upgradeError",y)}}))};function a(){r||(r=!0,p(),n.close(),n=null)}const o=m=>{const y=new Error("probe error: "+m);y.transport=n.name,a(),this.emitReserved("upgradeError",y)};function s(){o("transport closed")}function c(){o("socket closed")}function d(m){n&&m.name!==n.name&&a()}const p=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",s),this.off("close",c),this.off("upgrading",d)};n.once("open",i),n.once("error",o),n.once("close",s),this.once("close",c),this.once("upgrading",d),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let CX=class extends kX{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>jX[i]).filter(i=>!!i)),super(t,r)}};function NX(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Gj(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+t,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const MX=typeof ArrayBuffer=="function",RX=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,A5=Object.prototype.toString,LX=typeof Blob=="function"||typeof Blob<"u"&&A5.call(Blob)==="[object BlobConstructor]",IX=typeof File=="function"||typeof File<"u"&&A5.call(File)==="[object FileConstructor]";function _E(e){return MX&&(e instanceof ArrayBuffer||RX(e))||LX&&e instanceof Blob||IX&&e instanceof File}function by(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(by(e[n]))return!0;return!1}if(_E(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return by(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&by(e[n]))return!0;return!1}function DX(e){const t=[],n=e.data,r=e;return r.data=Yj(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Yj(e,t){if(!e)return e;if(_E(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Yj(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Yj(e[r],t));return n}return e}function BX(e,t){return e.data=Xj(e.data,t),delete e.attachments,e}function Xj(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Xj(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Xj(e[n],t));return e}const $X=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Nn;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Nn||(Nn={}));class FX{constructor(t){this.replacer=t}encode(t){return(t.type===Nn.EVENT||t.type===Nn.ACK)&&by(t)?this.encodeAsBinary({type:t.type===Nn.EVENT?Nn.BINARY_EVENT:Nn.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Nn.BINARY_EVENT||t.type===Nn.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=DX(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class SE extends ui{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Nn.BINARY_EVENT;r||n.type===Nn.BINARY_ACK?(n.type=r?Nn.EVENT:Nn.ACK,this.reconstructor=new qX(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(_E(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Nn[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Nn.BINARY_EVENT||r.type===Nn.BINARY_ACK){const a=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(a,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(a,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(a,n+1))}if(t.charAt(++n)){const a=this.tryParse(t.substr(n));if(SE.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Nn.CONNECT:return k2(n);case Nn.DISCONNECT:return n===void 0;case Nn.CONNECT_ERROR:return typeof n=="string"||k2(n);case Nn.EVENT:case Nn.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&$X.indexOf(n[0])===-1);case Nn.ACK:case Nn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class qX{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=BX(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function k2(e){return Object.prototype.toString.call(e)==="[object Object]"}const zX=Object.freeze(Object.defineProperty({__proto__:null,Decoder:SE,Encoder:FX,get PacketType(){return Nn}},Symbol.toStringTag,{value:"Module"}));function nl(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const UX=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class k5 extends ui{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[nl(t,"open",this.onopen.bind(this)),nl(t,"packet",this.onpacket.bind(this)),nl(t,"error",this.onerror.bind(this)),nl(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,a;if(UX.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Nn.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const p=this.ids++,m=n.pop();this._registerAckCallback(p,m),o.id=p}const s=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((a=this.io.engine)===null||a===void 0)&&a._hasPingExpired());return this.flags.volatile&&!s||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i),o=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const a=(o,s)=>o?i(o):r(s);a.withError=!0,n.push(a),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...a)=>(this._queue[0],i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Nn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Nn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Nn.EVENT:case Nn.BINARY_EVENT:this.onevent(t);break;case Nn.ACK:case Nn.BINARY_ACK:this.onack(t);break;case Nn.DISCONNECT:this.ondisconnect();break;case Nn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Nn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Nn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function tp(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}tp.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};tp.prototype.reset=function(){this.attempts=0};tp.prototype.setMin=function(e){this.ms=e};tp.prototype.setMax=function(e){this.max=e};tp.prototype.setJitter=function(e){this.jitter=e};class Qj extends ui{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,fb(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new tp({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||zX;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new CX(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=nl(n,"open",function(){r.onopen(),t&&t()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=nl(n,"error",a);if(this._timeout!==!1){const s=this._timeout,c=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),n.close()},s);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(nl(t,"ping",this.onping.bind(this)),nl(t,"data",this.ondata.bind(this)),nl(t,"error",this.onerror.bind(this)),nl(t,"close",this.onclose.bind(this)),nl(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){cb(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new k5(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Bp={};function xy(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=NX(e,t.path||"/socket.io"),r=n.source,i=n.id,a=n.path,o=Bp[i]&&a in Bp[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let c;return s?c=new Qj(r,t):(Bp[i]||(Bp[i]=new Qj(r,t)),c=Bp[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(xy,{Manager:Qj,Socket:k5,io:xy,connect:xy});function C2(e,t){var n;const r=xy(e.serverUrl,{path:e.mountPath,transports:e.transports,query:{app_id:e.appId,token:(n=e.token)!==null&&n!==void 0?n:yE()}});return r.on("connect",async()=>{var i;return console.log("connect",r.id),(i=t.connect)===null||i===void 0?void 0:i.call(t)}),r.on("update_model",async i=>{var a;return(a=t.update_model)===null||a===void 0?void 0:a.call(t,i)}),r.on("error",async i=>{var a;return(a=t.error)===null||a===void 0?void 0:a.call(t,i)}),r.on("connect_error",async i=>{var a;return console.error("connect_error",i),(a=t.error)===null||a===void 0?void 0:a.call(t,i)}),r}function VX({config:e}){let t={...e};const n={},r={connect:async()=>{const b=[];Object.keys(n).forEach(P=>{c(P);const x=m(P);x==null||x.forEach(({connect:w})=>{const T=async()=>w==null?void 0:w();b.push(T())})}),await Promise.all(b)},update_model:async b=>{const x=m(b.room).map(w=>{var T;return(T=w.update_model)===null||T===void 0?void 0:T.call(w,b)});await Promise.all(x)},error:async b=>{console.error("error",b);const P=Object.values(n).flat().map(x=>{var w;return(w=x.error)===null||w===void 0?void 0:w.call(x,b)});await Promise.all(P)}};let i=C2(e,r);function a(){o()}function o(){i&&i.disconnect()}function s(b){a(),t={...t,...b},i=C2(t,r)}function c(b){i.emit("join",b)}function d(b){i.emit("leave",b)}async function p(b,P){var x;const w=JSON.stringify(P);return(x=r.update_model)===null||x===void 0?void 0:x.call(r,{room:b,data:w})}function m(b){return n[b]}return{socket:i,subscribeToRoom:(b,P)=>(n[b]||(c(b),n[b]=[]),n[b].push(P),()=>{var x,w;n[b]=(w=(x=n[b])===null||x===void 0?void 0:x.filter(T=>T!==P))!==null&&w!==void 0?w:[],n[b].length===0&&d(b)}),updateConfig:s,updateModel:p,disconnect:o}}const $p=typeof window<"u"?window:{base44SharedInstances:{}};function WX(e,t){return $p.base44SharedInstances||($p.base44SharedInstances={}),$p.base44SharedInstances[e]||($p.base44SharedInstances[e]={instance:t()}),$p.base44SharedInstances[e].instance}const KX="__user_heartbeat_event__",HX="__initialization_event__",GX="__session_duration_event__",N2="analytics-enable",M2="base44_analytics_session_id",ZX={enabled:!0,maxQueueSize:1e3,throttleTime:1e3,batchSize:30,heartBeatInterval:60*1e3},YX="analytics",lr=WX(YX,()=>({requestsQueue:[],isProcessing:!1,isHeartBeatProcessing:!1,wasInitializationTracked:!1,sessionContext:null,sessionStartTime:null,config:{...ZX,...iQ()}})),XX=({axiosClient:e,serverUrl:t,appId:n,userAuthModule:r})=>{var i;const{maxQueueSize:a,throttleTime:o,batchSize:s}=lr.config;if(!(!((i=lr.config)===null||i===void 0)&&i.enabled))return{track:()=>{},cleanup:()=>{}};let c;const d=`${t}/api/apps/${n}/analytics/track/batch`,p=async k=>{await e.request({method:"POST",url:`/apps/${n}/analytics/track/batch`,data:{events:k}})},m=k=>{try{const D=JSON.stringify({events:k}),I=new Blob([D],{type:"application/json"});return typeof navigator>"u"||D.length>6e4||!navigator.sendBeacon(d,I)}catch{return!1}},y=async(k,D={})=>{if(k.length===0)return;const I=await rQ(r),R=k.map(nQ(I));try{(!D.isBeacon||!m(R))&&await p(R)}catch{}},b=()=>{L2(y,{throttleTime:o,batchSize:s})},P=k=>{if(lr.requestsQueue.length>=a)return;const D=tQ();lr.requestsQueue.push({...k,...D}),b()},x=()=>{L2(y,{throttleTime:o,batchSize:s}),c=I2(P),JX()},w=()=>{R2(),c==null||c(),eQ(P);const k=lr.requestsQueue.splice(0);y(k,{isBeacon:!0})},T=()=>{typeof window>"u"||(document.visibilityState==="hidden"?w():document.visibilityState==="visible"&&x())},E=()=>{R2(),c==null||c(),typeof window<"u"&&window.removeEventListener("visibilitychange",T)};return b(),c=I2(P),QX(P),typeof window<"u"&&window.addEventListener("visibilitychange",T),{track:P,cleanup:E}};function R2(){lr.isProcessing=!1}async function L2(e,t){if(lr.isProcessing)return;lr.isProcessing=!0;const{throttleTime:n=1e3,batchSize:r=30}=t??{};for(;lr.isProcessing&&lr.requestsQueue.length>0;){const i=lr.requestsQueue.splice(0,r);i.length&&await e(i),await new Promise(a=>setTimeout(a,n))}lr.isProcessing=!1}function I2(e){var t;if(lr.isHeartBeatProcessing||((t=lr.config.heartBeatInterval)!==null&&t!==void 0?t:0)<10)return()=>{};lr.isHeartBeatProcessing=!0;const n=setInterval(()=>{e({eventName:KX})},lr.config.heartBeatInterval);return()=>{clearInterval(n),lr.isHeartBeatProcessing=!1}}function QX(e){typeof window>"u"||lr.wasInitializationTracked||(lr.wasInitializationTracked=!0,e({eventName:HX,properties:{referrer:document==null?void 0:document.referrer}}))}function JX(){typeof window>"u"||lr.sessionStartTime!==null||(lr.sessionStartTime=new Date().toISOString())}function eQ(e){if(typeof window>"u"||lr.sessionStartTime===null)return;const t=new Date().getTime()-new Date(lr.sessionStartTime).getTime();lr.sessionStartTime=null,e({eventName:GX,properties:{sessionDuration:t}})}function tQ(){return{timestamp:new Date().toISOString(),pageUrl:typeof window<"u"?window.location.pathname:null}}function nQ(e){return t=>({event_name:t.eventName,properties:t.properties,timestamp:t.timestamp,page_url:t.pageUrl,...e})}let Uw=null;async function rQ(e){if(!lr.sessionContext){if(!Uw){const t=aQ();Uw=e.me().then(n=>({user_id:n.id,session_id:t})).catch(()=>({user_id:null,session_id:t}))}lr.sessionContext=await Uw}return lr.sessionContext}function iQ(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get(N2);if(t==null||!t.length)return;const n=new URLSearchParams(window.location.search);n.delete(N2);const r=window.location.pathname+(n.toString()?"?"+n.toString():"");return window.history.replaceState({},"",r),{enabled:t==="true"}}function aQ(){if(typeof window>"u")return Bw();try{const e=localStorage.getItem(M2);if(!e){const t=Bw();return localStorage.setItem(M2,t),t}return e}catch{return Bw()}}function oQ(e){const{serverUrl:t="https://base44.app",appId:n,token:r,serviceToken:i,requiresAuth:a=!1,appBaseUrl:o,options:s,functionsVersion:c,headers:d}=e,p=typeof o=="string"?o:"",m={serverUrl:t,mountPath:"/ws-user-apps/socket.io/",transports:["websocket"],appId:n,token:r};let y=null;const b=()=>(y||(y=VX({config:m})),y),P={...d,"X-App-Id":String(n)},x=c?{...P,"Base44-Functions-Version":c}:P,w=Jp({baseURL:`${t}/api`,headers:P,token:r,onError:s==null?void 0:s.onError}),T=Jp({baseURL:`${t}/api`,headers:x,token:r,interceptResponses:!1,onError:s==null?void 0:s.onError}),E=Jp({baseURL:`${t}/api`,headers:P,token:i,onError:s==null?void 0:s.onError}),k=Jp({baseURL:`${t}/api`,headers:x,token:i,interceptResponses:!1}),D=HY(w,T,n,{appBaseUrl:p}),I={entities:w2({axios:w,appId:n,getSocket:b}),integrations:_2(w,n),auth:D,functions:S2(T,n),agents:P2({axios:w,getSocket:b,appId:n,serverUrl:t,token:r}),appLogs:j2(w,n),users:XY(w,n),analytics:XX({axiosClient:w,serverUrl:t,appId:n,userAuthModule:D}),cleanup:()=>{I.analytics.cleanup(),y&&y.disconnect()}},R={entities:w2({axios:E,appId:n,getSocket:b}),integrations:_2(E,n),sso:GY(E,n,r),connectors:ZY(E,n),functions:S2(k,n),agents:P2({axios:E,getSocket:b,appId:n,serverUrl:t,token:r}),appLogs:j2(E,n),cleanup:()=>{y&&y.disconnect()}};if(typeof window<"u"){const V=r||yE();V&&I.auth.setToken(V)}return a&&typeof window<"u"&&setTimeout(async()=>{try{await I.auth.isAuthenticated()||I.auth.redirectToLogin(window.location.href)}catch(V){console.error("Authentication check failed:",V),I.auth.redirectToLogin(window.location.href)}},0),{...I,setToken(V){I.auth.setToken(V),y&&y.updateConfig({token:V}),m.token=V},getConfig(){return{serverUrl:t,appId:n,requiresAuth:a}},get asServiceRole(){if(!i)throw new Error("Service token is required to use asServiceRole. Please provide a serviceToken when creating the client.");return R}}}const C5=typeof window>"u",sQ=C5?{localStorage:new Map}:window,dm=sQ.localStorage,lQ=e=>e.replace(/([A-Z])/g,"_$1").toLowerCase(),mf=(e,{defaultValue:t=void 0,removeFromUrl:n=!1}={})=>{if(C5)return t;const r=`base44_${lQ(e)}`,i=new URLSearchParams(window.location.search),a=i.get(e);if(console.log("App Param:",e,a),n){i.delete(e);const s=`${window.location.pathname}${i.toString()?`?${i.toString()}`:""}${window.location.hash}`;window.history.replaceState({},document.title,s)}if(a)return console.log("Search Param:",a),dm.setItem(r,a),a;if(t)return dm.setItem(r,t),t;const o=dm.getItem(r);return o||null},uQ=()=>(mf("clear_access_token")==="true"&&(dm.removeItem("base44_access_token"),dm.removeItem("token")),console.log("Current App Params:",mf("app_id",{defaultValue:"probindo.com"})),{appId:mf("app_id",{defaultValue:"probindo.com"}),token:mf("access_token",{removeFromUrl:!0}),fromUrl:mf("from_url",{defaultValue:window.location.href}),functionsVersion:mf("functions_version",{defaultValue:"v1"}),appBaseUrl:mf("app_base_url",{defaultValue:""})}),tm={...uQ()},{appId:cQ,token:fQ,functionsVersion:dQ}=tm,mt=oQ({appId:cQ,token:fQ,functionsVersion:dQ,serverUrl:"",requiresAuth:!1,appBaseUrl:"/api"}),N5=M.createContext(),hQ=({children:e})=>{const[t,n]=M.useState(null),[r,i]=M.useState(!1),[a,o]=M.useState(!0),[s,c]=M.useState(!0),[d,p]=M.useState(null),[m,y]=M.useState(null);M.useEffect(()=>{b()},[]);const b=async()=>{var T,E;try{c(!0),p(null);const k=Jp({baseURL:"http://10.0.2.2:5173/api/apps/public",headers:{"X-App-Id":tm.appId},token:tm.token,interceptResponses:!0});try{const D=await k.get(`/prod/public-settings/by-id/${tm.appId}`);y(D),tm.token?await P():(o(!1),i(!1)),c(!1)}catch(D){if(console.error("App state check failed:",D),D.status===403&&((E=(T=D.data)==null?void 0:T.extra_data)!=null&&E.reason)){const I=D.data.extra_data.reason;p(I==="auth_required"?{type:"auth_required",message:"Authentication required"}:I==="user_not_registered"?{type:"user_not_registered",message:"User not registered for this app"}:{type:I,message:D.message})}else p({type:"unknown",message:D.message||"Failed to load app"});c(!1),o(!1)}}catch(k){console.error("Unexpected error:",k),p({type:"unknown",message:k.message||"An unexpected error occurred"}),c(!1),o(!1)}},P=async()=>{try{o(!0);const T=await mt.auth.me();n(T),i(!0),o(!1)}catch(T){console.error("User auth check failed:",T),o(!1),i(!1),(T.status===401||T.status===403)&&p({type:"auth_required",message:"Authentication required"})}},x=(T=!0)=>{n(null),i(!1),T?mt.auth.logout(window.location.href):mt.auth.logout()},w=()=>{mt.auth.redirectToLogin(window.location.href)};return h.jsx(N5.Provider,{value:{user:t,isAuthenticated:r,isLoadingAuth:a,isLoadingPublicSettings:s,authError:d,appPublicSettings:m,logout:x,navigateToLogin:w,checkAppState:b},children:e})},PE=()=>{const e=M.useContext(N5);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},Tt=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Tt.displayName="Card";const Ti=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("flex flex-col space-y-1.5 p-6",e),...t}));Ti.displayName="CardHeader";const Ei=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("font-semibold leading-none tracking-tight",e),...t}));Ei.displayName="CardTitle";const pQ=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("text-sm text-muted-foreground",e),...t}));pQ.displayName="CardDescription";const Pn=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("p-6 pt-0",e),...t}));Pn.displayName="CardContent";const mQ=M.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:fn("flex items-center p-6 pt-0",e),...t}));mQ.displayName="CardFooter";function Fv({title:e,value:t,subtitle:n,icon:r,trend:i,trendUp:a,className:o}){return h.jsxs(Tt,{className:fn("relative overflow-hidden p-6 bg-white border-0 shadow-sm hover:shadow-md transition-shadow",o),children:[h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-sm font-medium text-slate-500 tracking-wide uppercase",children:e}),h.jsx("p",{className:"text-3xl font-bold text-slate-900",children:t}),n&&h.jsx("p",{className:"text-sm text-slate-500",children:n}),i&&h.jsxs("div",{className:fn("flex items-center gap-1 text-sm font-medium",a?"text-emerald-600":"text-rose-600"),children:[h.jsx("span",{children:a?"↑":"↓"}),h.jsx("span",{children:i})]})]}),r&&h.jsx("div",{className:"p-3 rounded-xl bg-emerald-50",children:h.jsx(r,{className:"w-6 h-6 text-emerald-600"})})]}),h.jsx("div",{className:"absolute -bottom-4 -right-4 w-24 h-24 rounded-full bg-gradient-to-br from-emerald-50 to-transparent opacity-60"})]})}var Vw,D2;function Oo(){if(D2)return Vw;D2=1;var e=Array.isArray;return Vw=e,Vw}var Ww,B2;function M5(){if(B2)return Ww;B2=1;var e=typeof Xp=="object"&&Xp&&Xp.Object===Object&&Xp;return Ww=e,Ww}var Kw,$2;function Kl(){if($2)return Kw;$2=1;var e=M5(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Kw=n,Kw}var Hw,F2;function Eg(){if(F2)return Hw;F2=1;var e=Kl(),t=e.Symbol;return Hw=t,Hw}var Gw,q2;function gQ(){if(q2)return Gw;q2=1;var e=Eg(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(o){var s=n.call(o,i),c=o[i];try{o[i]=void 0;var d=!0}catch{}var p=r.call(o);return d&&(s?o[i]=c:delete o[i]),p}return Gw=a,Gw}var Zw,z2;function vQ(){if(z2)return Zw;z2=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Zw=n,Zw}var Yw,U2;function Iu(){if(U2)return Yw;U2=1;var e=Eg(),t=gQ(),n=vQ(),r="[object Null]",i="[object Undefined]",a=e?e.toStringTag:void 0;function o(s){return s==null?s===void 0?i:r:a&&a in Object(s)?t(s):n(s)}return Yw=o,Yw}var Xw,V2;function Du(){if(V2)return Xw;V2=1;function e(t){return t!=null&&typeof t=="object"}return Xw=e,Xw}var Qw,W2;function np(){if(W2)return Qw;W2=1;var e=Iu(),t=Du(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return Qw=r,Qw}var Jw,K2;function jE(){if(K2)return Jw;K2=1;var e=Oo(),t=np(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){if(e(a))return!1;var s=typeof a;return s=="number"||s=="symbol"||s=="boolean"||a==null||t(a)?!0:r.test(a)||!n.test(a)||o!=null&&a in Object(o)}return Jw=i,Jw}var e_,H2;function Kc(){if(H2)return e_;H2=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return e_=e,e_}var t_,G2;function OE(){if(G2)return t_;G2=1;var e=Iu(),t=Kc(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(s){if(!t(s))return!1;var c=e(s);return c==r||c==i||c==n||c==a}return t_=o,t_}var n_,Z2;function yQ(){if(Z2)return n_;Z2=1;var e=Kl(),t=e["__core-js_shared__"];return n_=t,n_}var r_,Y2;function bQ(){if(Y2)return r_;Y2=1;var e=yQ(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return r_=n,r_}var i_,X2;function R5(){if(X2)return i_;X2=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return i_=n,i_}var a_,Q2;function xQ(){if(Q2)return a_;Q2=1;var e=OE(),t=bQ(),n=Kc(),r=R5(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,c=o.toString,d=s.hasOwnProperty,p=RegExp("^"+c.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(y){if(!n(y)||t(y))return!1;var b=e(y)?p:a;return b.test(r(y))}return a_=m,a_}var o_,J2;function wQ(){if(J2)return o_;J2=1;function e(t,n){return t==null?void 0:t[n]}return o_=e,o_}var s_,eM;function fd(){if(eM)return s_;eM=1;var e=xQ(),t=wQ();function n(r,i){var a=t(r,i);return e(a)?a:void 0}return s_=n,s_}var l_,tM;function db(){if(tM)return l_;tM=1;var e=fd(),t=e(Object,"create");return l_=t,l_}var u_,nM;function _Q(){if(nM)return u_;nM=1;var e=db();function t(){this.__data__=e?e(null):{},this.size=0}return u_=t,u_}var c_,rM;function SQ(){if(rM)return c_;rM=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return c_=e,c_}var f_,iM;function PQ(){if(iM)return f_;iM=1;var e=db(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(a){var o=this.__data__;if(e){var s=o[a];return s===t?void 0:s}return r.call(o,a)?o[a]:void 0}return f_=i,f_}var d_,aM;function jQ(){if(aM)return d_;aM=1;var e=db(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var a=this.__data__;return e?a[i]!==void 0:n.call(a,i)}return d_=r,d_}var h_,oM;function OQ(){if(oM)return h_;oM=1;var e=db(),t="__lodash_hash_undefined__";function n(r,i){var a=this.__data__;return this.size+=this.has(r)?0:1,a[r]=e&&i===void 0?t:i,this}return h_=n,h_}var p_,sM;function TQ(){if(sM)return p_;sM=1;var e=_Q(),t=SQ(),n=PQ(),r=jQ(),i=OQ();function a(o){var s=-1,c=o==null?0:o.length;for(this.clear();++s<c;){var d=o[s];this.set(d[0],d[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,p_=a,p_}var m_,lM;function EQ(){if(lM)return m_;lM=1;function e(){this.__data__=[],this.size=0}return m_=e,m_}var g_,uM;function TE(){if(uM)return g_;uM=1;function e(t,n){return t===n||t!==t&&n!==n}return g_=e,g_}var v_,cM;function hb(){if(cM)return v_;cM=1;var e=TE();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return v_=t,v_}var y_,fM;function AQ(){if(fM)return y_;fM=1;var e=hb(),t=Array.prototype,n=t.splice;function r(i){var a=this.__data__,o=e(a,i);if(o<0)return!1;var s=a.length-1;return o==s?a.pop():n.call(a,o,1),--this.size,!0}return y_=r,y_}var b_,dM;function kQ(){if(dM)return b_;dM=1;var e=hb();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return b_=t,b_}var x_,hM;function CQ(){if(hM)return x_;hM=1;var e=hb();function t(n){return e(this.__data__,n)>-1}return x_=t,x_}var w_,pM;function NQ(){if(pM)return w_;pM=1;var e=hb();function t(n,r){var i=this.__data__,a=e(i,n);return a<0?(++this.size,i.push([n,r])):i[a][1]=r,this}return w_=t,w_}var __,mM;function pb(){if(mM)return __;mM=1;var e=EQ(),t=AQ(),n=kQ(),r=CQ(),i=NQ();function a(o){var s=-1,c=o==null?0:o.length;for(this.clear();++s<c;){var d=o[s];this.set(d[0],d[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,__=a,__}var S_,gM;function EE(){if(gM)return S_;gM=1;var e=fd(),t=Kl(),n=e(t,"Map");return S_=n,S_}var P_,vM;function MQ(){if(vM)return P_;vM=1;var e=TQ(),t=pb(),n=EE();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return P_=r,P_}var j_,yM;function RQ(){if(yM)return j_;yM=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return j_=e,j_}var O_,bM;function mb(){if(bM)return O_;bM=1;var e=RQ();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return O_=t,O_}var T_,xM;function LQ(){if(xM)return T_;xM=1;var e=mb();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return T_=t,T_}var E_,wM;function IQ(){if(wM)return E_;wM=1;var e=mb();function t(n){return e(this,n).get(n)}return E_=t,E_}var A_,_M;function DQ(){if(_M)return A_;_M=1;var e=mb();function t(n){return e(this,n).has(n)}return A_=t,A_}var k_,SM;function BQ(){if(SM)return k_;SM=1;var e=mb();function t(n,r){var i=e(this,n),a=i.size;return i.set(n,r),this.size+=i.size==a?0:1,this}return k_=t,k_}var C_,PM;function AE(){if(PM)return C_;PM=1;var e=MQ(),t=LQ(),n=IQ(),r=DQ(),i=BQ();function a(o){var s=-1,c=o==null?0:o.length;for(this.clear();++s<c;){var d=o[s];this.set(d[0],d[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,C_=a,C_}var N_,jM;function L5(){if(jM)return N_;jM=1;var e=AE(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var a=function(){var o=arguments,s=i?i.apply(this,o):o[0],c=a.cache;if(c.has(s))return c.get(s);var d=r.apply(this,o);return a.cache=c.set(s,d)||c,d};return a.cache=new(n.Cache||e),a}return n.Cache=e,N_=n,N_}var M_,OM;function $Q(){if(OM)return M_;OM=1;var e=L5(),t=500;function n(r){var i=e(r,function(o){return a.size===t&&a.clear(),o}),a=i.cache;return i}return M_=n,M_}var R_,TM;function FQ(){if(TM)return R_;TM=1;var e=$Q(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(t,function(o,s,c,d){a.push(c?d.replace(n,"$1"):s||o)}),a});return R_=r,R_}var L_,EM;function kE(){if(EM)return L_;EM=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=Array(i);++r<i;)a[r]=n(t[r],r,t);return a}return L_=e,L_}var I_,AM;function qQ(){if(AM)return I_;AM=1;var e=Eg(),t=kE(),n=Oo(),r=np(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(s){if(typeof s=="string")return s;if(n(s))return t(s,o)+"";if(r(s))return a?a.call(s):"";var c=s+"";return c=="0"&&1/s==-1/0?"-0":c}return I_=o,I_}var D_,kM;function I5(){if(kM)return D_;kM=1;var e=qQ();function t(n){return n==null?"":e(n)}return D_=t,D_}var B_,CM;function D5(){if(CM)return B_;CM=1;var e=Oo(),t=jE(),n=FQ(),r=I5();function i(a,o){return e(a)?a:t(a,o)?[a]:n(r(a))}return B_=i,B_}var $_,NM;function gb(){if(NM)return $_;NM=1;var e=np();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return $_=t,$_}var F_,MM;function CE(){if(MM)return F_;MM=1;var e=D5(),t=gb();function n(r,i){i=e(i,r);for(var a=0,o=i.length;r!=null&&a<o;)r=r[t(i[a++])];return a&&a==o?r:void 0}return F_=n,F_}var q_,RM;function B5(){if(RM)return q_;RM=1;var e=CE();function t(n,r,i){var a=n==null?void 0:e(n,r);return a===void 0?i:a}return q_=t,q_}var zQ=B5();const Uo=In(zQ);var z_,LM;function UQ(){if(LM)return z_;LM=1;function e(t){return t==null}return z_=e,z_}var VQ=UQ();const _n=In(VQ);var U_,IM;function WQ(){if(IM)return U_;IM=1;var e=Iu(),t=Oo(),n=Du(),r="[object String]";function i(a){return typeof a=="string"||!t(a)&&n(a)&&e(a)==r}return U_=i,U_}var KQ=WQ();const Xf=In(KQ);var HQ=OE();const tn=In(HQ);var GQ=Kc();const rp=In(GQ);var V_={exports:{}},Yn={};/**
|
||
* @license React
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var DM;function ZQ(){if(DM)return Yn;DM=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),P;P=Symbol.for("react.module.reference");function x(w){if(typeof w=="object"&&w!==null){var T=w.$$typeof;switch(T){case e:switch(w=w.type,w){case n:case i:case r:case d:case p:return w;default:switch(w=w&&w.$$typeof,w){case s:case o:case c:case y:case m:case a:return w;default:return T}}case t:return T}}}return Yn.ContextConsumer=o,Yn.ContextProvider=a,Yn.Element=e,Yn.ForwardRef=c,Yn.Fragment=n,Yn.Lazy=y,Yn.Memo=m,Yn.Portal=t,Yn.Profiler=i,Yn.StrictMode=r,Yn.Suspense=d,Yn.SuspenseList=p,Yn.isAsyncMode=function(){return!1},Yn.isConcurrentMode=function(){return!1},Yn.isContextConsumer=function(w){return x(w)===o},Yn.isContextProvider=function(w){return x(w)===a},Yn.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===e},Yn.isForwardRef=function(w){return x(w)===c},Yn.isFragment=function(w){return x(w)===n},Yn.isLazy=function(w){return x(w)===y},Yn.isMemo=function(w){return x(w)===m},Yn.isPortal=function(w){return x(w)===t},Yn.isProfiler=function(w){return x(w)===i},Yn.isStrictMode=function(w){return x(w)===r},Yn.isSuspense=function(w){return x(w)===d},Yn.isSuspenseList=function(w){return x(w)===p},Yn.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===n||w===i||w===r||w===d||w===p||w===b||typeof w=="object"&&w!==null&&(w.$$typeof===y||w.$$typeof===m||w.$$typeof===a||w.$$typeof===o||w.$$typeof===c||w.$$typeof===P||w.getModuleId!==void 0)},Yn.typeOf=x,Yn}var BM;function YQ(){return BM||(BM=1,V_.exports=ZQ()),V_.exports}var XQ=YQ(),W_,$M;function $5(){if($M)return W_;$M=1;var e=Iu(),t=Du(),n="[object Number]";function r(i){return typeof i=="number"||t(i)&&e(i)==n}return W_=r,W_}var K_,FM;function QQ(){if(FM)return K_;FM=1;var e=$5();function t(n){return e(n)&&n!=+n}return K_=t,K_}var JQ=QQ();const Ag=In(JQ);var eJ=$5();const tJ=In(eJ);var Za=function(t){return t===0?0:t>0?1:-1},Ef=function(t){return Xf(t)&&t.indexOf("%")===t.length-1},ct=function(t){return tJ(t)&&!Ag(t)},nJ=function(t){return _n(t)},Ai=function(t){return ct(t)||Xf(t)},rJ=0,kg=function(t){var n=++rJ;return"".concat(t||"").concat(n)},Ya=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(!ct(t)&&!Xf(t))return r;var a;if(Ef(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return Ag(a)&&(a=r),i&&a>n&&(a=n),a},mc=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},iJ=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},hc=function(t,n){return ct(t)&&ct(n)?function(r){return t+r*(n-t)}:function(){return n}};function Jj(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Uo(r,t))===n})}var aJ=function(t,n){return ct(t)&&ct(n)?t-n:Xf(t)&&Xf(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Yd(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function eO(e){"@babel/helpers - typeof";return eO=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eO(e)}var oJ=["viewBox","children"],sJ=["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"],qM=["points","pathLength"],H_={svg:oJ,polygon:qM,polyline:qM},NE=["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"],Iy=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(M.isValidElement(t)&&(r=t.props),!rp(r))return null;var i={};return Object.keys(r).forEach(function(a){NE.includes(a)&&(i[a]=n||function(o){return r[a](r,o)})}),i},lJ=function(t,n,r){return function(i){return t(n,r,i),null}},Qf=function(t,n,r){if(!rp(t)||eO(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var o=t[a];NE.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=lJ(o,n,r))}),i},uJ=["children"],cJ=["children"];function zM(e,t){if(e==null)return{};var n=fJ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fJ(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}var UM={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Su=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},VM=null,G_=null,ME=function e(t){if(t===VM&&Array.isArray(G_))return G_;var n=[];return M.Children.forEach(t,function(r){_n(r)||(XQ.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),G_=n,VM=t,n};function Os(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return Su(i)}):r=[Su(t)],ME(e).forEach(function(i){var a=Uo(i,"type.displayName")||Uo(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function $o(e,t){var n=Os(e,t);return n&&n[0]}var WM=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ct(r)||r<=0||!ct(i)||i<=0)},dJ=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],hJ=function(t){return t&&t.type&&Xf(t.type)&&dJ.indexOf(t.type)>=0},pJ=function(t,n,r,i){var a,o=(a=H_==null?void 0:H_[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!tn(t)&&(i&&o.includes(n)||sJ.includes(n))||r&&NE.includes(n)},Jt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(M.isValidElement(t)&&(i=t.props),!rp(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;pJ((s=i)===null||s===void 0?void 0:s[o],o,n,r)&&(a[o]=i[o])}),a},tO=function e(t,n){if(t===n)return!0;var r=M.Children.count(t);if(r!==M.Children.count(n))return!1;if(r===0)return!0;if(r===1)return KM(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!KM(a,o))return!1}return!0},KM=function(t,n){if(_n(t)&&_n(n))return!0;if(!_n(t)&&!_n(n)){var r=t.props||{},i=r.children,a=zM(r,uJ),o=n.props||{},s=o.children,c=zM(o,cJ);return i&&s?Yd(a,c)&&tO(i,s):!i&&!s?Yd(a,c):!1}return!1},HM=function(t,n){var r=[],i={};return ME(t).forEach(function(a,o){if(hJ(a))r.push(a);else if(a){var s=Su(a.type),c=n[s]||{},d=c.handler,p=c.once;if(d&&(!p||!i[s])){var m=d(a,s,o);r.push(m),i[s]=!0}}}),r},mJ=function(t){var n=t&&t.type;return n&&UM[n]?UM[n]:null},gJ=function(t,n){return ME(n).indexOf(t)},vJ=["children","width","height","viewBox","className","style","title","desc"];function nO(){return nO=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},nO.apply(this,arguments)}function yJ(e,t){if(e==null)return{};var n=bJ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bJ(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 rO(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,c=e.desc,d=yJ(e,vJ),p=i||{width:n,height:r,x:0,y:0},m=pn("recharts-surface",a);return ce.createElement("svg",nO({},Jt(d,!0,"svg"),{className:m,width:n,height:r,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),ce.createElement("title",null,s),ce.createElement("desc",null,c),t)}var xJ=["children","className"];function iO(){return iO=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},iO.apply(this,arguments)}function wJ(e,t){if(e==null)return{};var n=_J(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _J(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}var tr=ce.forwardRef(function(e,t){var n=e.children,r=e.className,i=wJ(e,xJ),a=pn("recharts-layer",r);return ce.createElement("g",iO({className:a},Jt(i,!0),{ref:t}),n)}),cl=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]},Z_,GM;function SJ(){if(GM)return Z_;GM=1;function e(t,n,r){var i=-1,a=t.length;n<0&&(n=-n>a?0:a+n),r=r>a?a:r,r<0&&(r+=a),a=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(a);++i<a;)o[i]=t[i+n];return o}return Z_=e,Z_}var Y_,ZM;function PJ(){if(ZM)return Y_;ZM=1;var e=SJ();function t(n,r,i){var a=n.length;return i=i===void 0?a:i,!r&&i>=a?n:e(n,r,i)}return Y_=t,Y_}var X_,YM;function F5(){if(YM)return X_;YM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,a="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+e+i+a+"]");function c(d){return s.test(d)}return X_=c,X_}var Q_,XM;function jJ(){if(XM)return Q_;XM=1;function e(t){return t.split("")}return Q_=e,Q_}var J_,QM;function OJ(){if(QM)return J_;QM=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,a="\\ufe0e\\ufe0f",o="["+e+"]",s="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+s+"|"+c+")",p="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",b="\\u200d",P=d+"?",x="["+a+"]?",w="(?:"+b+"(?:"+[p,m,y].join("|")+")"+x+P+")*",T=x+P+w,E="(?:"+[p+s+"?",s,m,y,o].join("|")+")",k=RegExp(c+"(?="+c+")|"+E+T,"g");function D(I){return I.match(k)||[]}return J_=D,J_}var e1,JM;function TJ(){if(JM)return e1;JM=1;var e=jJ(),t=F5(),n=OJ();function r(i){return t(i)?n(i):e(i)}return e1=r,e1}var t1,eR;function EJ(){if(eR)return t1;eR=1;var e=PJ(),t=F5(),n=TJ(),r=I5();function i(a){return function(o){o=r(o);var s=t(o)?n(o):void 0,c=s?s[0]:o.charAt(0),d=s?e(s,1).join(""):o.slice(1);return c[a]()+d}}return t1=i,t1}var n1,tR;function AJ(){if(tR)return n1;tR=1;var e=EJ(),t=e("toUpperCase");return n1=t,n1}var kJ=AJ();const vb=In(kJ);function mr(e){return function(){return e}}const q5=Math.cos,Dy=Math.sin,pl=Math.sqrt,By=Math.PI,yb=2*By,aO=Math.PI,oO=2*aO,xf=1e-6,CJ=oO-xf;function z5(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function NJ(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return z5;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class MJ{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?z5:NJ(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,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,c=r-t,d=i-n,p=o-t,m=s-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>xf)if(!(Math.abs(m*c-d*p)>xf)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let b=r-o,P=i-s,x=c*c+d*d,w=b*b+P*P,T=Math.sqrt(x),E=Math.sqrt(y),k=a*Math.tan((aO-Math.acos((x+y-w)/(2*T*E)))/2),D=k/E,I=k/T;Math.abs(D-1)>xf&&this._append`L${t+D*p},${n+D*m}`,this._append`A${a},${a},0,0,${+(m*b>p*P)},${this._x1=t+I*c},${this._y1=n+I*d}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),c=r*Math.sin(i),d=t+s,p=n+c,m=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${d},${p}`:(Math.abs(this._x1-d)>xf||Math.abs(this._y1-p)>xf)&&this._append`L${d},${p}`,r&&(y<0&&(y=y%oO+oO),y>CJ?this._append`A${r},${r},0,1,${m},${t-s},${n-c}A${r},${r},0,1,${m},${this._x1=d},${this._y1=p}`:y>xf&&this._append`A${r},${r},0,${+(y>=aO)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}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 RE(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 MJ(t)}function LE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function U5(e){this._context=e}U5.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 bb(e){return new U5(e)}function V5(e){return e[0]}function W5(e){return e[1]}function K5(e,t){var n=mr(!0),r=null,i=bb,a=null,o=RE(s);e=typeof e=="function"?e:e===void 0?V5:mr(e),t=typeof t=="function"?t:t===void 0?W5:mr(t);function s(c){var d,p=(c=LE(c)).length,m,y=!1,b;for(r==null&&(a=i(b=o())),d=0;d<=p;++d)!(d<p&&n(m=c[d],d,c))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+e(m,d,c),+t(m,d,c));if(b)return a=null,b+""||null}return s.x=function(c){return arguments.length?(e=typeof c=="function"?c:mr(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:mr(+c),s):t},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:mr(!!c),s):n},s.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),s):i},s.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),s):r},s}function qv(e,t,n){var r=null,i=mr(!0),a=null,o=bb,s=null,c=RE(d);e=typeof e=="function"?e:e===void 0?V5:mr(+e),t=typeof t=="function"?t:mr(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?W5:mr(+n);function d(m){var y,b,P,x=(m=LE(m)).length,w,T=!1,E,k=new Array(x),D=new Array(x);for(a==null&&(s=o(E=c())),y=0;y<=x;++y){if(!(y<x&&i(w=m[y],y,m))===T)if(T=!T)b=y,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),P=y-1;P>=b;--P)s.point(k[P],D[P]);s.lineEnd(),s.areaEnd()}T&&(k[y]=+e(w,y,m),D[y]=+t(w,y,m),s.point(r?+r(w,y,m):k[y],n?+n(w,y,m):D[y]))}if(E)return s=null,E+""||null}function p(){return K5().defined(i).curve(o).context(a)}return d.x=function(m){return arguments.length?(e=typeof m=="function"?m:mr(+m),r=null,d):e},d.x0=function(m){return arguments.length?(e=typeof m=="function"?m:mr(+m),d):e},d.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:mr(+m),d):r},d.y=function(m){return arguments.length?(t=typeof m=="function"?m:mr(+m),n=null,d):t},d.y0=function(m){return arguments.length?(t=typeof m=="function"?m:mr(+m),d):t},d.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:mr(+m),d):n},d.lineX0=d.lineY0=function(){return p().x(e).y(t)},d.lineY1=function(){return p().x(e).y(n)},d.lineX1=function(){return p().x(r).y(t)},d.defined=function(m){return arguments.length?(i=typeof m=="function"?m:mr(!!m),d):i},d.curve=function(m){return arguments.length?(o=m,a!=null&&(s=o(a)),d):o},d.context=function(m){return arguments.length?(m==null?a=s=null:s=o(a=m),d):a},d}class H5{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 RJ(e){return new H5(e,!0)}function LJ(e){return new H5(e,!1)}const IE={draw(e,t){const n=pl(t/By);e.moveTo(n,0),e.arc(0,0,n,0,yb)}},IJ={draw(e,t){const n=pl(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()}},G5=pl(1/3),DJ=G5*2,BJ={draw(e,t){const n=pl(t/DJ),r=n*G5;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},$J={draw(e,t){const n=pl(t),r=-n/2;e.rect(r,r,n,n)}},FJ=.8908130915292852,Z5=Dy(By/10)/Dy(7*By/10),qJ=Dy(yb/10)*Z5,zJ=-q5(yb/10)*Z5,UJ={draw(e,t){const n=pl(t*FJ),r=qJ*n,i=zJ*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=yb*a/5,s=q5(o),c=Dy(o);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},r1=pl(3),VJ={draw(e,t){const n=-pl(t/(r1*3));e.moveTo(0,n*2),e.lineTo(-r1*n,-n),e.lineTo(r1*n,-n),e.closePath()}},hs=-.5,ps=pl(3)/2,sO=1/pl(12),WJ=(sO/2+1)*3,KJ={draw(e,t){const n=pl(t/WJ),r=n/2,i=n*sO,a=r,o=n*sO+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(hs*r-ps*i,ps*r+hs*i),e.lineTo(hs*a-ps*o,ps*a+hs*o),e.lineTo(hs*s-ps*c,ps*s+hs*c),e.lineTo(hs*r+ps*i,hs*i-ps*r),e.lineTo(hs*a+ps*o,hs*o-ps*a),e.lineTo(hs*s+ps*c,hs*c-ps*s),e.closePath()}};function HJ(e,t){let n=null,r=RE(i);e=typeof e=="function"?e:mr(e||IE),t=typeof t=="function"?t:mr(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:mr(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:mr(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function $y(){}function Fy(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 Y5(e){this._context=e}Y5.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:Fy(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:Fy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function GJ(e){return new Y5(e)}function X5(e){this._context=e}X5.prototype={areaStart:$y,areaEnd:$y,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:Fy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZJ(e){return new X5(e)}function Q5(e){this._context=e}Q5.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:Fy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YJ(e){return new Q5(e)}function J5(e){this._context=e}J5.prototype={areaStart:$y,areaEnd:$y,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 XJ(e){return new J5(e)}function nR(e){return e<0?-1:1}function rR(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(nR(a)+nR(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function iR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function i1(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function qy(e){this._context=e}qy.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:i1(this,this._t0,iR(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,i1(this,iR(this,n=rR(this,e,t)),n);break;default:i1(this,this._t0,n=rR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function eq(e){this._context=new tq(e)}(eq.prototype=Object.create(qy.prototype)).point=function(e,t){qy.prototype.point.call(this,t,e)};function tq(e){this._context=e}tq.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,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function QJ(e){return new qy(e)}function JJ(e){return new eq(e)}function nq(e){this._context=e}nq.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=aR(e),i=aR(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(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 aR(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function eee(e){return new nq(e)}function xb(e,t){this._context=e,this._t=t}xb.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 tee(e){return new xb(e,.5)}function nee(e){return new xb(e,0)}function ree(e){return new xb(e,1)}function yh(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function lO(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function iee(e,t){return e[t]}function aee(e){const t=[];return t.key=e,t}function oee(){var e=mr([]),t=lO,n=yh,r=iee;function i(a){var o=Array.from(e.apply(this,arguments),aee),s,c=o.length,d=-1,p;for(const m of a)for(s=0,++d;s<c;++s)(o[s][d]=[0,+r(m,o[s].key,d,a)]).data=m;for(s=0,p=LE(t(o));s<c;++s)o[p[s]].index=s;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:mr(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:mr(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?lO:typeof a=="function"?a:mr(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??yh,i):n},i}function see(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}yh(e,t)}}function lee(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}yh(e,t)}}function uee(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,d=0;s<o;++s){for(var p=e[t[s]],m=p[r][1]||0,y=p[r-1][1]||0,b=(m-y)/2,P=0;P<s;++P){var x=e[t[P]],w=x[r][1]||0,T=x[r-1][1]||0;b+=w-T}c+=m,d+=b*m}i[r-1][1]+=i[r-1][0]=n,c&&(n-=d/c)}i[r-1][1]+=i[r-1][0]=n,yh(e,t)}}function Tm(e){"@babel/helpers - typeof";return Tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tm(e)}var cee=["type","size","sizeType"];function uO(){return uO=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},uO.apply(this,arguments)}function oR(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 sR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oR(Object(n),!0).forEach(function(r){fee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fee(e,t,n){return t=dee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dee(e){var t=hee(e,"string");return Tm(t)=="symbol"?t:t+""}function hee(e,t){if(Tm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pee(e,t){if(e==null)return{};var n=mee(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function mee(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}var rq={symbolCircle:IE,symbolCross:IJ,symbolDiamond:BJ,symbolSquare:$J,symbolStar:UJ,symbolTriangle:VJ,symbolWye:KJ},gee=Math.PI/180,vee=function(t){var n="symbol".concat(vb(t));return rq[n]||IE},yee=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*gee;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},bee=function(t,n){rq["symbol".concat(vb(t))]=n},DE=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,c=pee(t,cee),d=sR(sR({},c),{},{type:r,size:a,sizeType:s}),p=function(){var w=vee(r),T=HJ().type(w).size(yee(a,s,r));return T()},m=d.className,y=d.cx,b=d.cy,P=Jt(d,!0);return y===+y&&b===+b&&a===+a?ce.createElement("path",uO({},P,{className:pn("recharts-symbols",m),transform:"translate(".concat(y,", ").concat(b,")"),d:p()})):null};DE.registerSymbol=bee;function bh(e){"@babel/helpers - typeof";return bh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bh(e)}function cO(){return cO=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},cO.apply(this,arguments)}function lR(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 xee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lR(Object(n),!0).forEach(function(r){Em(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,aq(r.key),r)}}function See(e,t,n){return t&&_ee(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pee(e,t,n){return t=zy(t),jee(e,iq()?Reflect.construct(t,n||[],zy(e).constructor):t.apply(e,n))}function jee(e,t){if(t&&(bh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oee(e)}function Oee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iq=function(){return!!e})()}function zy(e){return zy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zy(e)}function Tee(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fO(e,t)}function fO(e,t){return fO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},fO(e,t)}function Em(e,t,n){return t=aq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aq(e){var t=Eee(e,"string");return bh(t)=="symbol"?t:t+""}function Eee(e,t){if(bh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ms=32,BE=(function(e){function t(){return wee(this,t),Pee(this,t,arguments)}return Tee(t,e),See(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=ms/2,o=ms/6,s=ms/3,c=r.inactive?i:r.color;if(r.type==="plainline")return ce.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:ms,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return ce.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(s,`
|
||
A`).concat(o,",").concat(o,",0,1,1,").concat(2*s,",").concat(a,`
|
||
H`).concat(ms,"M").concat(2*s,",").concat(a,`
|
||
A`).concat(o,",").concat(o,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return ce.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ms/8,"h").concat(ms,"v").concat(ms*3/4,"h").concat(-ms,"z"),className:"recharts-legend-icon"});if(ce.isValidElement(r.legendIcon)){var d=xee({},r);return delete d.legendIcon,ce.cloneElement(r.legendIcon,d)}return ce.createElement(DE,{fill:c,cx:a,cy:a,size:ms,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,o=i.iconSize,s=i.layout,c=i.formatter,d=i.inactiveColor,p={x:0,y:0,width:ms,height:ms},m={display:s==="horizontal"?"inline-block":"block",marginRight:10},y={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(b,P){var x=b.formatter||c,w=pn(Em(Em({"recharts-legend-item":!0},"legend-item-".concat(P),!0),"inactive",b.inactive));if(b.type==="none")return null;var T=tn(b.value)?null:b.value;cl(!tn(b.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var E=b.inactive?d:b.color;return ce.createElement("li",cO({className:w,style:m,key:"legend-item-".concat(P)},Qf(r.props,b,P)),ce.createElement(rO,{width:o,height:o,viewBox:p,style:y},r.renderIcon(b)),ce.createElement("span",{className:"recharts-legend-item-text",style:{color:E}},x?x(T,b,P):T))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,o=r.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return ce.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])})(M.PureComponent);Em(BE,"displayName","Legend");Em(BE,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var a1,uR;function Aee(){if(uR)return a1;uR=1;var e=pb();function t(){this.__data__=new e,this.size=0}return a1=t,a1}var o1,cR;function kee(){if(cR)return o1;cR=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return o1=e,o1}var s1,fR;function Cee(){if(fR)return s1;fR=1;function e(t){return this.__data__.get(t)}return s1=e,s1}var l1,dR;function Nee(){if(dR)return l1;dR=1;function e(t){return this.__data__.has(t)}return l1=e,l1}var u1,hR;function Mee(){if(hR)return u1;hR=1;var e=pb(),t=EE(),n=AE(),r=200;function i(a,o){var s=this.__data__;if(s instanceof e){var c=s.__data__;if(!t||c.length<r-1)return c.push([a,o]),this.size=++s.size,this;s=this.__data__=new n(c)}return s.set(a,o),this.size=s.size,this}return u1=i,u1}var c1,pR;function oq(){if(pR)return c1;pR=1;var e=pb(),t=Aee(),n=kee(),r=Cee(),i=Nee(),a=Mee();function o(s){var c=this.__data__=new e(s);this.size=c.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=i,o.prototype.set=a,c1=o,c1}var f1,mR;function Ree(){if(mR)return f1;mR=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return f1=t,f1}var d1,gR;function Lee(){if(gR)return d1;gR=1;function e(t){return this.__data__.has(t)}return d1=e,d1}var h1,vR;function sq(){if(vR)return h1;vR=1;var e=AE(),t=Ree(),n=Lee();function r(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new e;++a<o;)this.add(i[a])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,h1=r,h1}var p1,yR;function lq(){if(yR)return p1;yR=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return p1=e,p1}var m1,bR;function uq(){if(bR)return m1;bR=1;function e(t,n){return t.has(n)}return m1=e,m1}var g1,xR;function cq(){if(xR)return g1;xR=1;var e=sq(),t=lq(),n=uq(),r=1,i=2;function a(o,s,c,d,p,m){var y=c&r,b=o.length,P=s.length;if(b!=P&&!(y&&P>b))return!1;var x=m.get(o),w=m.get(s);if(x&&w)return x==s&&w==o;var T=-1,E=!0,k=c&i?new e:void 0;for(m.set(o,s),m.set(s,o);++T<b;){var D=o[T],I=s[T];if(d)var R=y?d(I,D,T,s,o,m):d(D,I,T,o,s,m);if(R!==void 0){if(R)continue;E=!1;break}if(k){if(!t(s,function($,V){if(!n(k,V)&&(D===$||p(D,$,c,d,m)))return k.push(V)})){E=!1;break}}else if(!(D===I||p(D,I,c,d,m))){E=!1;break}}return m.delete(o),m.delete(s),E}return g1=a,g1}var v1,wR;function Iee(){if(wR)return v1;wR=1;var e=Kl(),t=e.Uint8Array;return v1=t,v1}var y1,_R;function Dee(){if(_R)return y1;_R=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,a){r[++n]=[a,i]}),r}return y1=e,y1}var b1,SR;function $E(){if(SR)return b1;SR=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return b1=e,b1}var x1,PR;function Bee(){if(PR)return x1;PR=1;var e=Eg(),t=Iee(),n=TE(),r=cq(),i=Dee(),a=$E(),o=1,s=2,c="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Map]",y="[object Number]",b="[object RegExp]",P="[object Set]",x="[object String]",w="[object Symbol]",T="[object ArrayBuffer]",E="[object DataView]",k=e?e.prototype:void 0,D=k?k.valueOf:void 0;function I(R,$,V,K,Z,ee,ne){switch(V){case E:if(R.byteLength!=$.byteLength||R.byteOffset!=$.byteOffset)return!1;R=R.buffer,$=$.buffer;case T:return!(R.byteLength!=$.byteLength||!ee(new t(R),new t($)));case c:case d:case y:return n(+R,+$);case p:return R.name==$.name&&R.message==$.message;case b:case x:return R==$+"";case m:var oe=i;case P:var he=K&o;if(oe||(oe=a),R.size!=$.size&&!he)return!1;var Se=ne.get(R);if(Se)return Se==$;K|=s,ne.set(R,$);var fe=r(oe(R),oe($),K,Z,ee,ne);return ne.delete(R),fe;case w:if(D)return D.call(R)==D.call($)}return!1}return x1=I,x1}var w1,jR;function fq(){if(jR)return w1;jR=1;function e(t,n){for(var r=-1,i=n.length,a=t.length;++r<i;)t[a+r]=n[r];return t}return w1=e,w1}var _1,OR;function $ee(){if(OR)return _1;OR=1;var e=fq(),t=Oo();function n(r,i,a){var o=i(r);return t(r)?o:e(o,a(r))}return _1=n,_1}var S1,TR;function Fee(){if(TR)return S1;TR=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,a=0,o=[];++r<i;){var s=t[r];n(s,r,t)&&(o[a++]=s)}return o}return S1=e,S1}var P1,ER;function qee(){if(ER)return P1;ER=1;function e(){return[]}return P1=e,P1}var j1,AR;function zee(){if(AR)return j1;AR=1;var e=Fee(),t=qee(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),e(i(o),function(s){return r.call(o,s)}))}:t;return j1=a,j1}var O1,kR;function Uee(){if(kR)return O1;kR=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return O1=e,O1}var T1,CR;function Vee(){if(CR)return T1;CR=1;var e=Iu(),t=Du(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return T1=r,T1}var E1,NR;function FE(){if(NR)return E1;NR=1;var e=Vee(),t=Du(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(o){return t(o)&&r.call(o,"callee")&&!i.call(o,"callee")};return E1=a,E1}var nm={exports:{}},A1,MR;function Wee(){if(MR)return A1;MR=1;function e(){return!1}return A1=e,A1}nm.exports;var RR;function dq(){return RR||(RR=1,(function(e,t){var n=Kl(),r=Wee(),i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===i,s=o?n.Buffer:void 0,c=s?s.isBuffer:void 0,d=c||r;e.exports=d})(nm,nm.exports)),nm.exports}var k1,LR;function qE(){if(LR)return k1;LR=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var a=typeof r;return i=i??e,!!i&&(a=="number"||a!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return k1=n,k1}var C1,IR;function zE(){if(IR)return C1;IR=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return C1=t,C1}var N1,DR;function Kee(){if(DR)return N1;DR=1;var e=Iu(),t=zE(),n=Du(),r="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",s="[object Error]",c="[object Function]",d="[object Map]",p="[object Number]",m="[object Object]",y="[object RegExp]",b="[object Set]",P="[object String]",x="[object WeakMap]",w="[object ArrayBuffer]",T="[object DataView]",E="[object Float32Array]",k="[object Float64Array]",D="[object Int8Array]",I="[object Int16Array]",R="[object Int32Array]",$="[object Uint8Array]",V="[object Uint8ClampedArray]",K="[object Uint16Array]",Z="[object Uint32Array]",ee={};ee[E]=ee[k]=ee[D]=ee[I]=ee[R]=ee[$]=ee[V]=ee[K]=ee[Z]=!0,ee[r]=ee[i]=ee[w]=ee[a]=ee[T]=ee[o]=ee[s]=ee[c]=ee[d]=ee[p]=ee[m]=ee[y]=ee[b]=ee[P]=ee[x]=!1;function ne(oe){return n(oe)&&t(oe.length)&&!!ee[e(oe)]}return N1=ne,N1}var M1,BR;function hq(){if(BR)return M1;BR=1;function e(t){return function(n){return t(n)}}return M1=e,M1}var rm={exports:{}};rm.exports;var $R;function Hee(){return $R||($R=1,(function(e,t){var n=M5(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,o=a&&n.process,s=(function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}})();e.exports=s})(rm,rm.exports)),rm.exports}var R1,FR;function pq(){if(FR)return R1;FR=1;var e=Kee(),t=hq(),n=Hee(),r=n&&n.isTypedArray,i=r?t(r):e;return R1=i,R1}var L1,qR;function Gee(){if(qR)return L1;qR=1;var e=Uee(),t=FE(),n=Oo(),r=dq(),i=qE(),a=pq(),o=Object.prototype,s=o.hasOwnProperty;function c(d,p){var m=n(d),y=!m&&t(d),b=!m&&!y&&r(d),P=!m&&!y&&!b&&a(d),x=m||y||b||P,w=x?e(d.length,String):[],T=w.length;for(var E in d)(p||s.call(d,E))&&!(x&&(E=="length"||b&&(E=="offset"||E=="parent")||P&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||i(E,T)))&&w.push(E);return w}return L1=c,L1}var I1,zR;function Zee(){if(zR)return I1;zR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return I1=t,I1}var D1,UR;function mq(){if(UR)return D1;UR=1;function e(t,n){return function(r){return t(n(r))}}return D1=e,D1}var B1,VR;function Yee(){if(VR)return B1;VR=1;var e=mq(),t=e(Object.keys,Object);return B1=t,B1}var $1,WR;function Xee(){if(WR)return $1;WR=1;var e=Zee(),t=Yee(),n=Object.prototype,r=n.hasOwnProperty;function i(a){if(!e(a))return t(a);var o=[];for(var s in Object(a))r.call(a,s)&&s!="constructor"&&o.push(s);return o}return $1=i,$1}var F1,KR;function Cg(){if(KR)return F1;KR=1;var e=OE(),t=zE();function n(r){return r!=null&&t(r.length)&&!e(r)}return F1=n,F1}var q1,HR;function wb(){if(HR)return q1;HR=1;var e=Gee(),t=Xee(),n=Cg();function r(i){return n(i)?e(i):t(i)}return q1=r,q1}var z1,GR;function Qee(){if(GR)return z1;GR=1;var e=$ee(),t=zee(),n=wb();function r(i){return e(i,n,t)}return z1=r,z1}var U1,ZR;function Jee(){if(ZR)return U1;ZR=1;var e=Qee(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(a,o,s,c,d,p){var m=s&t,y=e(a),b=y.length,P=e(o),x=P.length;if(b!=x&&!m)return!1;for(var w=b;w--;){var T=y[w];if(!(m?T in o:r.call(o,T)))return!1}var E=p.get(a),k=p.get(o);if(E&&k)return E==o&&k==a;var D=!0;p.set(a,o),p.set(o,a);for(var I=m;++w<b;){T=y[w];var R=a[T],$=o[T];if(c)var V=m?c($,R,T,o,a,p):c(R,$,T,a,o,p);if(!(V===void 0?R===$||d(R,$,s,c,p):V)){D=!1;break}I||(I=T=="constructor")}if(D&&!I){var K=a.constructor,Z=o.constructor;K!=Z&&"constructor"in a&&"constructor"in o&&!(typeof K=="function"&&K instanceof K&&typeof Z=="function"&&Z instanceof Z)&&(D=!1)}return p.delete(a),p.delete(o),D}return U1=i,U1}var V1,YR;function ete(){if(YR)return V1;YR=1;var e=fd(),t=Kl(),n=e(t,"DataView");return V1=n,V1}var W1,XR;function tte(){if(XR)return W1;XR=1;var e=fd(),t=Kl(),n=e(t,"Promise");return W1=n,W1}var K1,QR;function gq(){if(QR)return K1;QR=1;var e=fd(),t=Kl(),n=e(t,"Set");return K1=n,K1}var H1,JR;function nte(){if(JR)return H1;JR=1;var e=fd(),t=Kl(),n=e(t,"WeakMap");return H1=n,H1}var G1,eL;function rte(){if(eL)return G1;eL=1;var e=ete(),t=EE(),n=tte(),r=gq(),i=nte(),a=Iu(),o=R5(),s="[object Map]",c="[object Object]",d="[object Promise]",p="[object Set]",m="[object WeakMap]",y="[object DataView]",b=o(e),P=o(t),x=o(n),w=o(r),T=o(i),E=a;return(e&&E(new e(new ArrayBuffer(1)))!=y||t&&E(new t)!=s||n&&E(n.resolve())!=d||r&&E(new r)!=p||i&&E(new i)!=m)&&(E=function(k){var D=a(k),I=D==c?k.constructor:void 0,R=I?o(I):"";if(R)switch(R){case b:return y;case P:return s;case x:return d;case w:return p;case T:return m}return D}),G1=E,G1}var Z1,tL;function ite(){if(tL)return Z1;tL=1;var e=oq(),t=cq(),n=Bee(),r=Jee(),i=rte(),a=Oo(),o=dq(),s=pq(),c=1,d="[object Arguments]",p="[object Array]",m="[object Object]",y=Object.prototype,b=y.hasOwnProperty;function P(x,w,T,E,k,D){var I=a(x),R=a(w),$=I?p:i(x),V=R?p:i(w);$=$==d?m:$,V=V==d?m:V;var K=$==m,Z=V==m,ee=$==V;if(ee&&o(x)){if(!o(w))return!1;I=!0,K=!1}if(ee&&!K)return D||(D=new e),I||s(x)?t(x,w,T,E,k,D):n(x,w,$,T,E,k,D);if(!(T&c)){var ne=K&&b.call(x,"__wrapped__"),oe=Z&&b.call(w,"__wrapped__");if(ne||oe){var he=ne?x.value():x,Se=oe?w.value():w;return D||(D=new e),k(he,Se,T,E,D)}}return ee?(D||(D=new e),r(x,w,T,E,k,D)):!1}return Z1=P,Z1}var Y1,nL;function UE(){if(nL)return Y1;nL=1;var e=ite(),t=Du();function n(r,i,a,o,s){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,a,o,n,s)}return Y1=n,Y1}var X1,rL;function ate(){if(rL)return X1;rL=1;var e=oq(),t=UE(),n=1,r=2;function i(a,o,s,c){var d=s.length,p=d,m=!c;if(a==null)return!p;for(a=Object(a);d--;){var y=s[d];if(m&&y[2]?y[1]!==a[y[0]]:!(y[0]in a))return!1}for(;++d<p;){y=s[d];var b=y[0],P=a[b],x=y[1];if(m&&y[2]){if(P===void 0&&!(b in a))return!1}else{var w=new e;if(c)var T=c(P,x,b,a,o,w);if(!(T===void 0?t(x,P,n|r,c,w):T))return!1}}return!0}return X1=i,X1}var Q1,iL;function vq(){if(iL)return Q1;iL=1;var e=Kc();function t(n){return n===n&&!e(n)}return Q1=t,Q1}var J1,aL;function ote(){if(aL)return J1;aL=1;var e=vq(),t=wb();function n(r){for(var i=t(r),a=i.length;a--;){var o=i[a],s=r[o];i[a]=[o,s,e(s)]}return i}return J1=n,J1}var eS,oL;function yq(){if(oL)return eS;oL=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return eS=e,eS}var tS,sL;function ste(){if(sL)return tS;sL=1;var e=ate(),t=ote(),n=yq();function r(i){var a=t(i);return a.length==1&&a[0][2]?n(a[0][0],a[0][1]):function(o){return o===i||e(o,i,a)}}return tS=r,tS}var nS,lL;function lte(){if(lL)return nS;lL=1;function e(t,n){return t!=null&&n in Object(t)}return nS=e,nS}var rS,uL;function ute(){if(uL)return rS;uL=1;var e=D5(),t=FE(),n=Oo(),r=qE(),i=zE(),a=gb();function o(s,c,d){c=e(c,s);for(var p=-1,m=c.length,y=!1;++p<m;){var b=a(c[p]);if(!(y=s!=null&&d(s,b)))break;s=s[b]}return y||++p!=m?y:(m=s==null?0:s.length,!!m&&i(m)&&r(b,m)&&(n(s)||t(s)))}return rS=o,rS}var iS,cL;function cte(){if(cL)return iS;cL=1;var e=lte(),t=ute();function n(r,i){return r!=null&&t(r,i,e)}return iS=n,iS}var aS,fL;function fte(){if(fL)return aS;fL=1;var e=UE(),t=B5(),n=cte(),r=jE(),i=vq(),a=yq(),o=gb(),s=1,c=2;function d(p,m){return r(p)&&i(m)?a(o(p),m):function(y){var b=t(y,p);return b===void 0&&b===m?n(y,p):e(m,b,s|c)}}return aS=d,aS}var oS,dL;function ip(){if(dL)return oS;dL=1;function e(t){return t}return oS=e,oS}var sS,hL;function dte(){if(hL)return sS;hL=1;function e(t){return function(n){return n==null?void 0:n[t]}}return sS=e,sS}var lS,pL;function hte(){if(pL)return lS;pL=1;var e=CE();function t(n){return function(r){return e(r,n)}}return lS=t,lS}var uS,mL;function pte(){if(mL)return uS;mL=1;var e=dte(),t=hte(),n=jE(),r=gb();function i(a){return n(a)?e(r(a)):t(a)}return uS=i,uS}var cS,gL;function Hl(){if(gL)return cS;gL=1;var e=ste(),t=fte(),n=ip(),r=Oo(),i=pte();function a(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):i(o)}return cS=a,cS}var fS,vL;function bq(){if(vL)return fS;vL=1;function e(t,n,r,i){for(var a=t.length,o=r+(i?1:-1);i?o--:++o<a;)if(n(t[o],o,t))return o;return-1}return fS=e,fS}var dS,yL;function mte(){if(yL)return dS;yL=1;function e(t){return t!==t}return dS=e,dS}var hS,bL;function gte(){if(bL)return hS;bL=1;function e(t,n,r){for(var i=r-1,a=t.length;++i<a;)if(t[i]===n)return i;return-1}return hS=e,hS}var pS,xL;function vte(){if(xL)return pS;xL=1;var e=bq(),t=mte(),n=gte();function r(i,a,o){return a===a?n(i,a,o):e(i,t,o)}return pS=r,pS}var mS,wL;function yte(){if(wL)return mS;wL=1;var e=vte();function t(n,r){var i=n==null?0:n.length;return!!i&&e(n,r,0)>-1}return mS=t,mS}var gS,_L;function bte(){if(_L)return gS;_L=1;function e(t,n,r){for(var i=-1,a=t==null?0:t.length;++i<a;)if(r(n,t[i]))return!0;return!1}return gS=e,gS}var vS,SL;function xte(){if(SL)return vS;SL=1;function e(){}return vS=e,vS}var yS,PL;function wte(){if(PL)return yS;PL=1;var e=gq(),t=xte(),n=$E(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(a){return new e(a)}:t;return yS=i,yS}var bS,jL;function _te(){if(jL)return bS;jL=1;var e=sq(),t=yte(),n=bte(),r=uq(),i=wte(),a=$E(),o=200;function s(c,d,p){var m=-1,y=t,b=c.length,P=!0,x=[],w=x;if(p)P=!1,y=n;else if(b>=o){var T=d?null:i(c);if(T)return a(T);P=!1,y=r,w=new e}else w=d?[]:x;e:for(;++m<b;){var E=c[m],k=d?d(E):E;if(E=p||E!==0?E:0,P&&k===k){for(var D=w.length;D--;)if(w[D]===k)continue e;d&&w.push(k),x.push(E)}else y(w,k,p)||(w!==x&&w.push(k),x.push(E))}return x}return bS=s,bS}var xS,OL;function Ste(){if(OL)return xS;OL=1;var e=Hl(),t=_te();function n(r,i){return r&&r.length?t(r,e(i,2)):[]}return xS=n,xS}var Pte=Ste();const TL=In(Pte);function xq(e,t,n){return t===!0?TL(e,n):tn(t)?TL(e,t):e}function xh(e){"@babel/helpers - typeof";return xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xh(e)}var jte=["ref"];function EL(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 du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EL(Object(n),!0).forEach(function(r){_b(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ote(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_q(r.key),r)}}function Tte(e,t,n){return t&&AL(e.prototype,t),n&&AL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ete(e,t,n){return t=Uy(t),Ate(e,wq()?Reflect.construct(t,n||[],Uy(e).constructor):t.apply(e,n))}function Ate(e,t){if(t&&(xh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kte(e)}function kte(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wq=function(){return!!e})()}function Uy(e){return Uy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Uy(e)}function Cte(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dO(e,t)}function dO(e,t){return dO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dO(e,t)}function _b(e,t,n){return t=_q(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _q(e){var t=Nte(e,"string");return xh(t)=="symbol"?t:t+""}function Nte(e,t){if(xh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Mte(e,t){if(e==null)return{};var n=Rte(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rte(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 Lte(e){return e.value}function Ite(e,t){if(ce.isValidElement(e))return ce.cloneElement(e,t);if(typeof e=="function")return ce.createElement(e,t);t.ref;var n=Mte(t,jte);return ce.createElement(BE,n)}var kL=1,Cc=(function(e){function t(){var n;Ote(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Ete(this,t,[].concat(i)),_b(n,"lastBoundingBox",{width:-1,height:-1}),n}return Cte(t,e),Tte(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>kL||Math.abs(i.height-this.lastBoundingBox.height)>kL)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?du({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,c=i.margin,d=i.chartWidth,p=i.chartHeight,m,y;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var b=this.getBBoxSnapshot();m={left:((d||0)-b.width)/2}}else m=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(s==="middle"){var P=this.getBBoxSnapshot();y={top:((p||0)-P.height)/2}}else y=s==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return du(du({},m),y)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,o=i.width,s=i.height,c=i.wrapperStyle,d=i.payloadUniqBy,p=i.payload,m=du(du({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(c)),c);return ce.createElement("div",{className:"recharts-legend-wrapper",style:m,ref:function(b){r.wrapperNode=b}},Ite(a,du(du({},this.props),{},{payload:xq(p,d,Lte)})))}}],[{key:"getWithHeight",value:function(r,i){var a=du(du({},this.defaultProps),r.props),o=a.layout;return o==="vertical"&&ct(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||i}:null}}])})(M.PureComponent);_b(Cc,"displayName","Legend");_b(Cc,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var wS,CL;function Dte(){if(CL)return wS;CL=1;var e=Eg(),t=FE(),n=Oo(),r=e?e.isConcatSpreadable:void 0;function i(a){return n(a)||t(a)||!!(r&&a&&a[r])}return wS=i,wS}var _S,NL;function Sq(){if(NL)return _S;NL=1;var e=fq(),t=Dte();function n(r,i,a,o,s){var c=-1,d=r.length;for(a||(a=t),s||(s=[]);++c<d;){var p=r[c];i>0&&a(p)?i>1?n(p,i-1,a,o,s):e(s,p):o||(s[s.length]=p)}return s}return _S=n,_S}var SS,ML;function Bte(){if(ML)return SS;ML=1;function e(t){return function(n,r,i){for(var a=-1,o=Object(n),s=i(n),c=s.length;c--;){var d=s[t?c:++a];if(r(o[d],d,o)===!1)break}return n}}return SS=e,SS}var PS,RL;function $te(){if(RL)return PS;RL=1;var e=Bte(),t=e();return PS=t,PS}var jS,LL;function Pq(){if(LL)return jS;LL=1;var e=$te(),t=wb();function n(r,i){return r&&e(r,i,t)}return jS=n,jS}var OS,IL;function Fte(){if(IL)return OS;IL=1;var e=Cg();function t(n,r){return function(i,a){if(i==null)return i;if(!e(i))return n(i,a);for(var o=i.length,s=r?o:-1,c=Object(i);(r?s--:++s<o)&&a(c[s],s,c)!==!1;);return i}}return OS=t,OS}var TS,DL;function VE(){if(DL)return TS;DL=1;var e=Pq(),t=Fte(),n=t(e);return TS=n,TS}var ES,BL;function jq(){if(BL)return ES;BL=1;var e=VE(),t=Cg();function n(r,i){var a=-1,o=t(r)?Array(r.length):[];return e(r,function(s,c,d){o[++a]=i(s,c,d)}),o}return ES=n,ES}var AS,$L;function qte(){if($L)return AS;$L=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return AS=e,AS}var kS,FL;function zte(){if(FL)return kS;FL=1;var e=np();function t(n,r){if(n!==r){var i=n!==void 0,a=n===null,o=n===n,s=e(n),c=r!==void 0,d=r===null,p=r===r,m=e(r);if(!d&&!m&&!s&&n>r||s&&c&&p&&!d&&!m||a&&c&&p||!i&&p||!o)return 1;if(!a&&!s&&!m&&n<r||m&&i&&o&&!a&&!s||d&&i&&o||!c&&o||!p)return-1}return 0}return kS=t,kS}var CS,qL;function Ute(){if(qL)return CS;qL=1;var e=zte();function t(n,r,i){for(var a=-1,o=n.criteria,s=r.criteria,c=o.length,d=i.length;++a<c;){var p=e(o[a],s[a]);if(p){if(a>=d)return p;var m=i[a];return p*(m=="desc"?-1:1)}}return n.index-r.index}return CS=t,CS}var NS,zL;function Vte(){if(zL)return NS;zL=1;var e=kE(),t=CE(),n=Hl(),r=jq(),i=qte(),a=hq(),o=Ute(),s=ip(),c=Oo();function d(p,m,y){m.length?m=e(m,function(x){return c(x)?function(w){return t(w,x.length===1?x[0]:x)}:x}):m=[s];var b=-1;m=e(m,a(n));var P=r(p,function(x,w,T){var E=e(m,function(k){return k(x)});return{criteria:E,index:++b,value:x}});return i(P,function(x,w){return o(x,w,y)})}return NS=d,NS}var MS,UL;function Wte(){if(UL)return MS;UL=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return MS=e,MS}var RS,VL;function Kte(){if(VL)return RS;VL=1;var e=Wte(),t=Math.max;function n(r,i,a){return i=t(i===void 0?r.length-1:i,0),function(){for(var o=arguments,s=-1,c=t(o.length-i,0),d=Array(c);++s<c;)d[s]=o[i+s];s=-1;for(var p=Array(i+1);++s<i;)p[s]=o[s];return p[i]=a(d),e(r,this,p)}}return RS=n,RS}var LS,WL;function Hte(){if(WL)return LS;WL=1;function e(t){return function(){return t}}return LS=e,LS}var IS,KL;function Oq(){if(KL)return IS;KL=1;var e=fd(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return IS=t,IS}var DS,HL;function Gte(){if(HL)return DS;HL=1;var e=Hte(),t=Oq(),n=ip(),r=t?function(i,a){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:n;return DS=r,DS}var BS,GL;function Zte(){if(GL)return BS;GL=1;var e=800,t=16,n=Date.now;function r(i){var a=0,o=0;return function(){var s=n(),c=t-(s-o);if(o=s,c>0){if(++a>=e)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return BS=r,BS}var $S,ZL;function Yte(){if(ZL)return $S;ZL=1;var e=Gte(),t=Zte(),n=t(e);return $S=n,$S}var FS,YL;function Xte(){if(YL)return FS;YL=1;var e=ip(),t=Kte(),n=Yte();function r(i,a){return n(t(i,a,e),i+"")}return FS=r,FS}var qS,XL;function Sb(){if(XL)return qS;XL=1;var e=TE(),t=Cg(),n=qE(),r=Kc();function i(a,o,s){if(!r(s))return!1;var c=typeof o;return(c=="number"?t(s)&&n(o,s.length):c=="string"&&o in s)?e(s[o],a):!1}return qS=i,qS}var zS,QL;function Qte(){if(QL)return zS;QL=1;var e=Sq(),t=Vte(),n=Xte(),r=Sb(),i=n(function(a,o){if(a==null)return[];var s=o.length;return s>1&&r(a,o[0],o[1])?o=[]:s>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(a,e(o,1),[])});return zS=i,zS}var Jte=Qte();const WE=In(Jte);function Am(e){"@babel/helpers - typeof";return Am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Am(e)}function hO(){return hO=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},hO.apply(this,arguments)}function ene(e,t){return ine(e)||rne(e,t)||nne(e,t)||tne()}function tne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nne(e,t){if(e){if(typeof e=="string")return JL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JL(e,t)}}function JL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function ine(e){if(Array.isArray(e))return e}function eI(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 US(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eI(Object(n),!0).forEach(function(r){ane(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ane(e,t,n){return t=one(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function one(e){var t=sne(e,"string");return Am(t)=="symbol"?t:t+""}function sne(e,t){if(Am(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Am(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lne(e){return Array.isArray(e)&&Ai(e[0])&&Ai(e[1])?e.join(" ~ "):e}var une=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,a=i===void 0?{}:i,o=t.itemStyle,s=o===void 0?{}:o,c=t.labelStyle,d=c===void 0?{}:c,p=t.payload,m=t.formatter,y=t.itemSorter,b=t.wrapperClassName,P=t.labelClassName,x=t.label,w=t.labelFormatter,T=t.accessibilityLayer,E=T===void 0?!1:T,k=function(){if(p&&p.length){var ne={padding:0,margin:0},oe=(y?WE(p,y):p).map(function(he,Se){if(he.type==="none")return null;var fe=US({display:"block",paddingTop:4,paddingBottom:4,color:he.color||"#000"},s),Oe=he.formatter||m||lne,re=he.value,Ce=he.name,ae=re,ie=Ce;if(Oe&&ae!=null&&ie!=null){var de=Oe(re,Ce,he,Se,p);if(Array.isArray(de)){var He=ene(de,2);ae=He[0],ie=He[1]}else ae=de}return ce.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(Se),style:fe},Ai(ie)?ce.createElement("span",{className:"recharts-tooltip-item-name"},ie):null,Ai(ie)?ce.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,ce.createElement("span",{className:"recharts-tooltip-item-value"},ae),ce.createElement("span",{className:"recharts-tooltip-item-unit"},he.unit||""))});return ce.createElement("ul",{className:"recharts-tooltip-item-list",style:ne},oe)}return null},D=US({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),I=US({margin:0},d),R=!_n(x),$=R?x:"",V=pn("recharts-default-tooltip",b),K=pn("recharts-tooltip-label",P);R&&w&&p!==void 0&&p!==null&&($=w(x,p));var Z=E?{role:"status","aria-live":"assertive"}:{};return ce.createElement("div",hO({className:V,style:D},Z),ce.createElement("p",{className:K,style:I},ce.isValidElement($)?$:"".concat($)),k())};function km(e){"@babel/helpers - typeof";return km=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},km(e)}function zv(e,t,n){return t=cne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cne(e){var t=fne(e,"string");return km(t)=="symbol"?t:t+""}function fne(e,t){if(km(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(km(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fp="recharts-tooltip-wrapper",dne={visibility:"hidden"};function hne(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return pn(Fp,zv(zv(zv(zv({},"".concat(Fp,"-right"),ct(n)&&t&&ct(t.x)&&n>=t.x),"".concat(Fp,"-left"),ct(n)&&t&&ct(t.x)&&n<t.x),"".concat(Fp,"-bottom"),ct(r)&&t&&ct(t.y)&&r>=t.y),"".concat(Fp,"-top"),ct(r)&&t&&ct(t.y)&&r<t.y))}function tI(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,d=e.viewBoxDimension;if(a&&ct(a[r]))return a[r];var p=n[r]-s-i,m=n[r]+i;if(t[r])return o[r]?p:m;if(o[r]){var y=p,b=c[r];return y<b?Math.max(m,c[r]):Math.max(p,c[r])}var P=m+s,x=c[r]+d;return P>x?Math.max(p,c[r]):Math.max(m,c[r])}function pne(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function mne(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,c=e.viewBox,d,p,m;return o.height>0&&o.width>0&&n?(p=tI({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),m=tI({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),d=pne({translateX:p,translateY:m,useTranslate3d:s})):d=dne,{cssProperties:d,cssClasses:hne({translateX:p,translateY:m,coordinate:n})}}function wh(e){"@babel/helpers - typeof";return wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wh(e)}function nI(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 rI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nI(Object(n),!0).forEach(function(r){mO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Eq(r.key),r)}}function yne(e,t,n){return t&&vne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bne(e,t,n){return t=Vy(t),xne(e,Tq()?Reflect.construct(t,n||[],Vy(e).constructor):t.apply(e,n))}function xne(e,t){if(t&&(wh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wne(e)}function wne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tq=function(){return!!e})()}function Vy(e){return Vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vy(e)}function _ne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pO(e,t)}function pO(e,t){return pO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},pO(e,t)}function mO(e,t,n){return t=Eq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eq(e){var t=Sne(e,"string");return wh(t)=="symbol"?t:t+""}function Sne(e,t){if(wh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var iI=1,Pne=(function(e){function t(){var n;gne(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=bne(this,t,[].concat(i)),mO(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),mO(n,"handleKeyDown",function(o){if(o.key==="Escape"){var s,c,d,p;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(s=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&s!==void 0?s:0,y:(d=(p=n.props.coordinate)===null||p===void 0?void 0:p.y)!==null&&d!==void 0?d:0}})}}),n}return _ne(t,e),yne(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>iI||Math.abs(r.height-this.state.lastBoundingBox.height)>iI)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,c=i.animationEasing,d=i.children,p=i.coordinate,m=i.hasPayload,y=i.isAnimationActive,b=i.offset,P=i.position,x=i.reverseDirection,w=i.useTranslate3d,T=i.viewBox,E=i.wrapperStyle,k=mne({allowEscapeViewBox:o,coordinate:p,offsetTopLeft:b,position:P,reverseDirection:x,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:T}),D=k.cssClasses,I=k.cssProperties,R=rI(rI({transition:y&&a?"transform ".concat(s,"ms ").concat(c):void 0},I),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&m?"visible":"hidden",position:"absolute",top:0,left:0},E);return ce.createElement("div",{tabIndex:-1,className:D,style:R,ref:function(V){r.wrapperNode=V}},d)}}])})(M.PureComponent),jne=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ap={isSsr:jne()};function _h(e){"@babel/helpers - typeof";return _h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_h(e)}function aI(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 oI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aI(Object(n),!0).forEach(function(r){KE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function One(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kq(r.key),r)}}function Ene(e,t,n){return t&&Tne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ane(e,t,n){return t=Wy(t),kne(e,Aq()?Reflect.construct(t,n||[],Wy(e).constructor):t.apply(e,n))}function kne(e,t){if(t&&(_h(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cne(e)}function Cne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Aq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Aq=function(){return!!e})()}function Wy(e){return Wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wy(e)}function Nne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gO(e,t)}function gO(e,t){return gO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},gO(e,t)}function KE(e,t,n){return t=kq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kq(e){var t=Mne(e,"string");return _h(t)=="symbol"?t:t+""}function Mne(e,t){if(_h(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_h(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Rne(e){return e.dataKey}function Lne(e,t){return ce.isValidElement(e)?ce.cloneElement(e,t):typeof e=="function"?ce.createElement(e,t):ce.createElement(une,t)}var wo=(function(e){function t(){return One(this,t),Ane(this,t,arguments)}return Nne(t,e),Ene(t,[{key:"render",value:function(){var r=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,c=i.animationEasing,d=i.content,p=i.coordinate,m=i.filterNull,y=i.isAnimationActive,b=i.offset,P=i.payload,x=i.payloadUniqBy,w=i.position,T=i.reverseDirection,E=i.useTranslate3d,k=i.viewBox,D=i.wrapperStyle,I=P??[];m&&I.length&&(I=xq(P.filter(function($){return $.value!=null&&($.hide!==!0||r.props.includeHidden)}),x,Rne));var R=I.length>0;return ce.createElement(Pne,{allowEscapeViewBox:o,animationDuration:s,animationEasing:c,isAnimationActive:y,active:a,coordinate:p,hasPayload:R,offset:b,position:w,reverseDirection:T,useTranslate3d:E,viewBox:k,wrapperStyle:D},Lne(d,oI(oI({},this.props),{},{payload:I})))}}])})(M.PureComponent);KE(wo,"displayName","Tooltip");KE(wo,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ap.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var VS,sI;function Ine(){if(sI)return VS;sI=1;var e=Kl(),t=function(){return e.Date.now()};return VS=t,VS}var WS,lI;function Dne(){if(lI)return WS;lI=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return WS=t,WS}var KS,uI;function Bne(){if(uI)return KS;uI=1;var e=Dne(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return KS=n,KS}var HS,cI;function Cq(){if(cI)return HS;cI=1;var e=Bne(),t=Kc(),n=np(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function c(d){if(typeof d=="number")return d;if(n(d))return r;if(t(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=t(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=e(d);var m=a.test(d);return m||o.test(d)?s(d.slice(2),m?2:8):i.test(d)?r:+d}return HS=c,HS}var GS,fI;function $ne(){if(fI)return GS;fI=1;var e=Kc(),t=Ine(),n=Cq(),r="Expected a function",i=Math.max,a=Math.min;function o(s,c,d){var p,m,y,b,P,x,w=0,T=!1,E=!1,k=!0;if(typeof s!="function")throw new TypeError(r);c=n(c)||0,e(d)&&(T=!!d.leading,E="maxWait"in d,y=E?i(n(d.maxWait)||0,c):y,k="trailing"in d?!!d.trailing:k);function D(oe){var he=p,Se=m;return p=m=void 0,w=oe,b=s.apply(Se,he),b}function I(oe){return w=oe,P=setTimeout(V,c),T?D(oe):b}function R(oe){var he=oe-x,Se=oe-w,fe=c-he;return E?a(fe,y-Se):fe}function $(oe){var he=oe-x,Se=oe-w;return x===void 0||he>=c||he<0||E&&Se>=y}function V(){var oe=t();if($(oe))return K(oe);P=setTimeout(V,R(oe))}function K(oe){return P=void 0,k&&p?D(oe):(p=m=void 0,b)}function Z(){P!==void 0&&clearTimeout(P),w=0,p=x=m=P=void 0}function ee(){return P===void 0?b:K(t())}function ne(){var oe=t(),he=$(oe);if(p=arguments,m=this,x=oe,he){if(P===void 0)return I(x);if(E)return clearTimeout(P),P=setTimeout(V,c),D(x)}return P===void 0&&(P=setTimeout(V,c)),b}return ne.cancel=Z,ne.flush=ee,ne}return GS=o,GS}var ZS,dI;function Fne(){if(dI)return ZS;dI=1;var e=$ne(),t=Kc(),n="Expected a function";function r(i,a,o){var s=!0,c=!0;if(typeof i!="function")throw new TypeError(n);return t(o)&&(s="leading"in o?!!o.leading:s,c="trailing"in o?!!o.trailing:c),e(i,a,{leading:s,maxWait:a,trailing:c})}return ZS=r,ZS}var qne=Fne();const Nq=In(qne);function Cm(e){"@babel/helpers - typeof";return Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cm(e)}function hI(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 Uv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){zne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zne(e,t,n){return t=Une(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Une(e){var t=Vne(e,"string");return Cm(t)=="symbol"?t:t+""}function Vne(e,t){if(Cm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wne(e,t){return Zne(e)||Gne(e,t)||Hne(e,t)||Kne()}function Kne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hne(e,t){if(e){if(typeof e=="string")return pI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pI(e,t)}}function pI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function Zne(e){if(Array.isArray(e))return e}var hm=M.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,s=e.height,c=s===void 0?"100%":s,d=e.minWidth,p=d===void 0?0:d,m=e.minHeight,y=e.maxHeight,b=e.children,P=e.debounce,x=P===void 0?0:P,w=e.id,T=e.className,E=e.onResize,k=e.style,D=k===void 0?{}:k,I=M.useRef(null),R=M.useRef();R.current=E,M.useImperativeHandle(t,function(){return Object.defineProperty(I.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),I.current},configurable:!0})});var $=M.useState({containerWidth:i.width,containerHeight:i.height}),V=Wne($,2),K=V[0],Z=V[1],ee=M.useCallback(function(oe,he){Z(function(Se){var fe=Math.round(oe),Oe=Math.round(he);return Se.containerWidth===fe&&Se.containerHeight===Oe?Se:{containerWidth:fe,containerHeight:Oe}})},[]);M.useEffect(function(){var oe=function(Ce){var ae,ie=Ce[0].contentRect,de=ie.width,He=ie.height;ee(de,He),(ae=R.current)===null||ae===void 0||ae.call(R,de,He)};x>0&&(oe=Nq(oe,x,{trailing:!0,leading:!1}));var he=new ResizeObserver(oe),Se=I.current.getBoundingClientRect(),fe=Se.width,Oe=Se.height;return ee(fe,Oe),he.observe(I.current),function(){he.disconnect()}},[ee,x]);var ne=M.useMemo(function(){var oe=K.containerWidth,he=K.containerHeight;if(oe<0||he<0)return null;cl(Ef(o)||Ef(c),`The width(%s) and height(%s) are both fixed numbers,
|
||
maybe you don't need to use a ResponsiveContainer.`,o,c),cl(!n||n>0,"The aspect(%s) must be greater than zero.",n);var Se=Ef(o)?oe:o,fe=Ef(c)?he:c;n&&n>0&&(Se?fe=Se/n:fe&&(Se=fe*n),y&&fe>y&&(fe=y)),cl(Se>0||fe>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
||
please check the style of container, or the props width(%s) and height(%s),
|
||
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
||
height and width.`,Se,fe,o,c,p,m,n);var Oe=!Array.isArray(b)&&Su(b.type).endsWith("Chart");return ce.Children.map(b,function(re){return ce.isValidElement(re)?M.cloneElement(re,Uv({width:Se,height:fe},Oe?{style:Uv({height:"100%",width:"100%",maxHeight:fe,maxWidth:Se},re.props.style)}:{})):re})},[n,b,c,y,m,p,K,o]);return ce.createElement("div",{id:w?"".concat(w):void 0,className:pn("recharts-responsive-container",T),style:Uv(Uv({},D),{},{width:o,height:c,minWidth:p,minHeight:m,maxHeight:y}),ref:I},ne)}),Sh=function(t){return null};Sh.displayName="Cell";function Nm(e){"@babel/helpers - typeof";return Nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nm(e)}function mI(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 vO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){Yne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yne(e,t,n){return t=Xne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xne(e){var t=Qne(e,"string");return Nm(t)=="symbol"?t:t+""}function Qne(e,t){if(Nm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Md={widthCache:{},cacheCount:0},Jne=2e3,ere={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},gI="recharts_measurement_span";function tre(e){var t=vO({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var pm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ap.isSsr)return{width:0,height:0};var r=tre(n),i=JSON.stringify({text:t,copyStyle:r});if(Md.widthCache[i])return Md.widthCache[i];try{var a=document.getElementById(gI);a||(a=document.createElement("span"),a.setAttribute("id",gI),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=vO(vO({},ere),r);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),c={width:s.width,height:s.height};return Md.widthCache[i]=c,++Md.cacheCount>Jne&&(Md.cacheCount=0,Md.widthCache={}),c}catch{return{width:0,height:0}}},nre=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Mm(e){"@babel/helpers - typeof";return Mm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mm(e)}function Ky(e,t){return ore(e)||are(e,t)||ire(e,t)||rre()}function rre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ire(e,t){if(e){if(typeof e=="string")return vI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vI(e,t)}}function vI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function are(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function ore(e){if(Array.isArray(e))return e}function sre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ure(r.key),r)}}function lre(e,t,n){return t&&yI(e.prototype,t),n&&yI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ure(e){var t=cre(e,"string");return Mm(t)=="symbol"?t:t+""}function cre(e,t){if(Mm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Mm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,xI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fre=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,dre=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Mq={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},hre=Object.keys(Mq),Fd="NaN";function pre(e,t){return e*Mq[t]}var Vv=(function(){function e(t,n){sre(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!fre.test(n)&&(this.num=NaN,this.unit=""),hre.includes(n)&&(this.num=pre(t,n),this.unit="px")}return lre(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=dre.exec(n))!==null&&r!==void 0?r:[],a=Ky(i,3),o=a[1],s=a[2];return new e(parseFloat(o),s??"")}}])})();function Rq(e){if(e.includes(Fd))return Fd;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=bI.exec(t))!==null&&n!==void 0?n:[],i=Ky(r,4),a=i[1],o=i[2],s=i[3],c=Vv.parse(a??""),d=Vv.parse(s??""),p=o==="*"?c.multiply(d):c.divide(d);if(p.isNaN())return Fd;t=t.replace(bI,p.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var m,y=(m=xI.exec(t))!==null&&m!==void 0?m:[],b=Ky(y,4),P=b[1],x=b[2],w=b[3],T=Vv.parse(P??""),E=Vv.parse(w??""),k=x==="+"?T.add(E):T.subtract(E);if(k.isNaN())return Fd;t=t.replace(xI,k.toString())}return t}var wI=/\(([^()]*)\)/;function mre(e){for(var t=e;t.includes("(");){var n=wI.exec(t),r=Ky(n,2),i=r[1];t=t.replace(wI,Rq(i))}return t}function gre(e){var t=e.replace(/\s+/g,"");return t=mre(t),t=Rq(t),t}function vre(e){try{return gre(e)}catch{return Fd}}function YS(e){var t=vre(e.slice(5,-1));return t===Fd?"":t}var yre=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],bre=["dx","dy","angle","className","breakAll"];function yO(){return yO=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},yO.apply(this,arguments)}function _I(e,t){if(e==null)return{};var n=xre(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xre(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 SI(e,t){return Pre(e)||Sre(e,t)||_re(e,t)||wre()}function wre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _re(e,t){if(e){if(typeof e=="string")return PI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PI(e,t)}}function PI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function Pre(e){if(Array.isArray(e))return e}var Lq=/[ \f\n\r\t\v\u2028\u2029]+/,Iq=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var a=[];_n(n)||(r?a=n.toString().split(""):a=n.toString().split(Lq));var o=a.map(function(c){return{word:c,width:pm(c,i).width}}),s=r?0:pm(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:s}}catch{return null}},jre=function(t,n,r,i,a){var o=t.maxLines,s=t.children,c=t.style,d=t.breakAll,p=ct(o),m=s,y=function(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Se.reduce(function(fe,Oe){var re=Oe.word,Ce=Oe.width,ae=fe[fe.length-1];if(ae&&(i==null||a||ae.width+Ce+r<Number(i)))ae.words.push(re),ae.width+=Ce+r;else{var ie={words:[re],width:Ce};fe.push(ie)}return fe},[])},b=y(n),P=function(Se){return Se.reduce(function(fe,Oe){return fe.width>Oe.width?fe:Oe})};if(!p)return b;for(var x="…",w=function(Se){var fe=m.slice(0,Se),Oe=Iq({breakAll:d,style:c,children:fe+x}).wordsWithComputedWidth,re=y(Oe),Ce=re.length>o||P(re).width>Number(i);return[Ce,re]},T=0,E=m.length-1,k=0,D;T<=E&&k<=m.length-1;){var I=Math.floor((T+E)/2),R=I-1,$=w(R),V=SI($,2),K=V[0],Z=V[1],ee=w(I),ne=SI(ee,1),oe=ne[0];if(!K&&!oe&&(T=I+1),K&&oe&&(E=I-1),!K&&oe){D=Z;break}k++}return D||b},jI=function(t){var n=_n(t)?[]:t.toString().split(Lq);return[{words:n}]},Ore=function(t){var n=t.width,r=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((n||r)&&!ap.isSsr){var c,d,p=Iq({breakAll:o,children:i,style:a});if(p){var m=p.wordsWithComputedWidth,y=p.spaceWidth;c=m,d=y}else return jI(i);return jre({breakAll:o,children:i,maxLines:s,style:a},c,d,n,r)}return jI(i)},OI="#808080",Jf=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,c=t.capHeight,d=c===void 0?"0.71em":c,p=t.scaleToFit,m=p===void 0?!1:p,y=t.textAnchor,b=y===void 0?"start":y,P=t.verticalAnchor,x=P===void 0?"end":P,w=t.fill,T=w===void 0?OI:w,E=_I(t,yre),k=M.useMemo(function(){return Ore({breakAll:E.breakAll,children:E.children,maxLines:E.maxLines,scaleToFit:m,style:E.style,width:E.width})},[E.breakAll,E.children,E.maxLines,m,E.style,E.width]),D=E.dx,I=E.dy,R=E.angle,$=E.className,V=E.breakAll,K=_I(E,bre);if(!Ai(r)||!Ai(a))return null;var Z=r+(ct(D)?D:0),ee=a+(ct(I)?I:0),ne;switch(x){case"start":ne=YS("calc(".concat(d,")"));break;case"middle":ne=YS("calc(".concat((k.length-1)/2," * -").concat(s," + (").concat(d," / 2))"));break;default:ne=YS("calc(".concat(k.length-1," * -").concat(s,")"));break}var oe=[];if(m){var he=k[0].width,Se=E.width;oe.push("scale(".concat((ct(Se)?Se/he:1)/he,")"))}return R&&oe.push("rotate(".concat(R,", ").concat(Z,", ").concat(ee,")")),oe.length&&(K.transform=oe.join(" ")),ce.createElement("text",yO({},Jt(K,!0),{x:Z,y:ee,className:pn("recharts-text",$),textAnchor:b,fill:T.includes("url")?OI:T}),k.map(function(fe,Oe){var re=fe.words.join(V?"":" ");return ce.createElement("tspan",{x:Z,dy:Oe===0?ne:s,key:"".concat(re,"-").concat(Oe)},re)}))};function Nc(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Tre(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function HE(e){let t,n,r;e.length!==2?(t=Nc,n=(s,c)=>Nc(e(s),c),r=(s,c)=>e(s)-c):(t=e===Nc||e===Tre?e:Ere,n=e,r=e);function i(s,c,d=0,p=s.length){if(d<p){if(t(c,c)!==0)return p;do{const m=d+p>>>1;n(s[m],c)<0?d=m+1:p=m}while(d<p)}return d}function a(s,c,d=0,p=s.length){if(d<p){if(t(c,c)!==0)return p;do{const m=d+p>>>1;n(s[m],c)<=0?d=m+1:p=m}while(d<p)}return d}function o(s,c,d=0,p=s.length){const m=i(s,c,d,p-1);return m>d&&r(s[m-1],c)>-r(s[m],c)?m-1:m}return{left:i,center:o,right:a}}function Ere(){return 0}function Dq(e){return e===null?NaN:+e}function*Are(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const kre=HE(Nc),Ng=kre.right;HE(Dq).center;class TI extends Map{constructor(t,n=Mre){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(EI(this,t))}has(t){return super.has(EI(this,t))}set(t,n){return super.set(Cre(this,t),n)}delete(t){return super.delete(Nre(this,t))}}function EI({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Cre({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Nre({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Mre(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Rre(e=Nc){if(e===Nc)return Bq;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Bq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Lre=Math.sqrt(50),Ire=Math.sqrt(10),Dre=Math.sqrt(2);function Hy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Lre?10:a>=Ire?5:a>=Dre?2:1;let s,c,d;return i<0?(d=Math.pow(10,-i)/o,s=Math.round(e*d),c=Math.round(t*d),s/d<e&&++s,c/d>t&&--c,d=-d):(d=Math.pow(10,i)*o,s=Math.round(e/d),c=Math.round(t/d),s*d<e&&++s,c*d>t&&--c),c<s&&.5<=n&&n<2?Hy(e,t,n*2):[s,c,d]}function bO(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Hy(t,e,n):Hy(e,t,n);if(!(a>=i))return[];const s=a-i+1,c=new Array(s);if(r)if(o<0)for(let d=0;d<s;++d)c[d]=(a-d)/-o;else for(let d=0;d<s;++d)c[d]=(a-d)*o;else if(o<0)for(let d=0;d<s;++d)c[d]=(i+d)/-o;else for(let d=0;d<s;++d)c[d]=(i+d)*o;return c}function xO(e,t,n){return t=+t,e=+e,n=+n,Hy(e,t,n)[2]}function wO(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?xO(t,e,n):xO(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function AI(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function kI(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function $q(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Bq:Rre(i);r>n;){if(r-n>600){const c=r-n+1,d=t-n+1,p=Math.log(c),m=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*m*(c-m)/c)*(d-c/2<0?-1:1),b=Math.max(n,Math.floor(t-d*m/c+y)),P=Math.min(r,Math.floor(t+(c-d)*m/c+y));$q(e,t,b,P,i)}const a=e[t];let o=n,s=r;for(qp(e,n,t),i(e[r],a)>0&&qp(e,n,r);o<s;){for(qp(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?qp(e,n,s):(++s,qp(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function qp(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Bre(e,t,n){if(e=Float64Array.from(Are(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return kI(e);if(t>=1)return AI(e);var r,i=(r-1)*t,a=Math.floor(i),o=AI($q(e,a).subarray(0,a+1)),s=kI(e.subarray(a+1));return o+(s-o)*(i-a)}}function $re(e,t,n=Dq){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),s=+n(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function Fre(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function ks(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Bu(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const _O=Symbol("implicit");function GE(){var e=new TI,t=[],n=[],r=_O;function i(a){let o=e.get(a);if(o===void 0){if(r!==_O)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new TI;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return GE(t,n).unknown(r)},ks.apply(i,arguments),i}function Rm(){var e=GE().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,d=0,p=.5;delete e.unknown;function m(){var y=t().length,b=i<r,P=b?i:r,x=b?r:i;a=(x-P)/Math.max(1,y-c+d*2),s&&(a=Math.floor(a)),P+=(x-P-a*(y-c))*p,o=a*(1-c),s&&(P=Math.round(P),o=Math.round(o));var w=Fre(y).map(function(T){return P+a*T});return n(b?w.reverse():w)}return e.domain=function(y){return arguments.length?(t(y),m()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,s=!0,m()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(y){return arguments.length?(s=!!y,m()):s},e.padding=function(y){return arguments.length?(c=Math.min(1,d=+y),m()):c},e.paddingInner=function(y){return arguments.length?(c=Math.min(1,y),m()):c},e.paddingOuter=function(y){return arguments.length?(d=+y,m()):d},e.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),m()):p},e.copy=function(){return Rm(t(),[r,i]).round(s).paddingInner(c).paddingOuter(d).align(p)},ks.apply(m(),arguments)}function Fq(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Fq(t())},e}function mm(){return Fq(Rm.apply(null,arguments).paddingInner(1))}function ZE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qq(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Mg(){}var Lm=.7,Gy=1/Lm,Xd="\\s*([+-]?\\d+)\\s*",Im="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Il="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qre=/^#([0-9a-f]{3,8})$/,zre=new RegExp(`^rgb\\(${Xd},${Xd},${Xd}\\)$`),Ure=new RegExp(`^rgb\\(${Il},${Il},${Il}\\)$`),Vre=new RegExp(`^rgba\\(${Xd},${Xd},${Xd},${Im}\\)$`),Wre=new RegExp(`^rgba\\(${Il},${Il},${Il},${Im}\\)$`),Kre=new RegExp(`^hsl\\(${Im},${Il},${Il}\\)$`),Hre=new RegExp(`^hsla\\(${Im},${Il},${Il},${Im}\\)$`),CI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ZE(Mg,Dm,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:NI,formatHex:NI,formatHex8:Gre,formatHsl:Zre,formatRgb:MI,toString:MI});function NI(){return this.rgb().formatHex()}function Gre(){return this.rgb().formatHex8()}function Zre(){return zq(this).formatHsl()}function MI(){return this.rgb().formatRgb()}function Dm(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=qre.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?RI(t):n===3?new _o(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=zre.exec(e))?new _o(t[1],t[2],t[3],1):(t=Ure.exec(e))?new _o(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Vre.exec(e))?Wv(t[1],t[2],t[3],t[4]):(t=Wre.exec(e))?Wv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Kre.exec(e))?DI(t[1],t[2]/100,t[3]/100,1):(t=Hre.exec(e))?DI(t[1],t[2]/100,t[3]/100,t[4]):CI.hasOwnProperty(e)?RI(CI[e]):e==="transparent"?new _o(NaN,NaN,NaN,0):null}function RI(e){return new _o(e>>16&255,e>>8&255,e&255,1)}function Wv(e,t,n,r){return r<=0&&(e=t=n=NaN),new _o(e,t,n,r)}function Yre(e){return e instanceof Mg||(e=Dm(e)),e?(e=e.rgb(),new _o(e.r,e.g,e.b,e.opacity)):new _o}function SO(e,t,n,r){return arguments.length===1?Yre(e):new _o(e,t,n,r??1)}function _o(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ZE(_o,SO,qq(Mg,{brighter(e){return e=e==null?Gy:Math.pow(Gy,e),new _o(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lm:Math.pow(Lm,e),new _o(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _o(Vf(this.r),Vf(this.g),Vf(this.b),Zy(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:LI,formatHex:LI,formatHex8:Xre,formatRgb:II,toString:II}));function LI(){return`#${Af(this.r)}${Af(this.g)}${Af(this.b)}`}function Xre(){return`#${Af(this.r)}${Af(this.g)}${Af(this.b)}${Af((isNaN(this.opacity)?1:this.opacity)*255)}`}function II(){const e=Zy(this.opacity);return`${e===1?"rgb(":"rgba("}${Vf(this.r)}, ${Vf(this.g)}, ${Vf(this.b)}${e===1?")":`, ${e})`}`}function Zy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vf(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Af(e){return e=Vf(e),(e<16?"0":"")+e.toString(16)}function DI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new il(e,t,n,r)}function zq(e){if(e instanceof il)return new il(e.h,e.s,e.l,e.opacity);if(e instanceof Mg||(e=Dm(e)),!e)return new il;if(e instanceof il)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(t===a?o=(n-r)/s+(n<r)*6:n===a?o=(r-t)/s+2:o=(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new il(o,s,c,e.opacity)}function Qre(e,t,n,r){return arguments.length===1?zq(e):new il(e,t,n,r??1)}function il(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ZE(il,Qre,qq(Mg,{brighter(e){return e=e==null?Gy:Math.pow(Gy,e),new il(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lm:Math.pow(Lm,e),new il(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new _o(XS(e>=240?e-240:e+120,i,r),XS(e,i,r),XS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new il(BI(this.h),Kv(this.s),Kv(this.l),Zy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Zy(this.opacity);return`${e===1?"hsl(":"hsla("}${BI(this.h)}, ${Kv(this.s)*100}%, ${Kv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function BI(e){return e=(e||0)%360,e<0?e+360:e}function Kv(e){return Math.max(0,Math.min(1,e||0))}function XS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const YE=e=>()=>e;function Jre(e,t){return function(n){return e+n*t}}function eie(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function tie(e){return(e=+e)==1?Uq:function(t,n){return n-t?eie(t,n,e):YE(isNaN(t)?n:t)}}function Uq(e,t){var n=t-e;return n?Jre(e,n):YE(isNaN(e)?t:e)}const $I=(function e(t){var n=tie(t);function r(i,a){var o=n((i=SO(i)).r,(a=SO(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),d=Uq(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=s(p),i.b=c(p),i.opacity=d(p),i+""}}return r.gamma=e,r})(1);function nie(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function rie(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function iie(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=op(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(s){for(o=0;o<r;++o)a[o]=i[o](s);return a}}function aie(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Yy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function oie(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=op(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var PO=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,QS=new RegExp(PO.source,"g");function sie(e){return function(){return e}}function lie(e){return function(t){return e(t)+""}}function uie(e,t){var n=PO.lastIndex=QS.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=PO.exec(e))&&(i=QS.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Yy(r,i)})),n=QS.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?lie(c[0].x):sie(t):(t=c.length,function(d){for(var p=0,m;p<t;++p)s[(m=c[p]).i]=m.x(d);return s.join("")})}function op(e,t){var n=typeof t,r;return t==null||n==="boolean"?YE(t):(n==="number"?Yy:n==="string"?(r=Dm(t))?(t=r,$I):uie:t instanceof Dm?$I:t instanceof Date?aie:rie(t)?nie:Array.isArray(t)?iie:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?oie:Yy)(e,t)}function XE(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function cie(e,t){t===void 0&&(t=e,e=op);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var s=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[s](o-s)}}function fie(e){return function(){return e}}function Xy(e){return+e}var FI=[0,1];function Xa(e){return e}function jO(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:fie(isNaN(t)?NaN:.5)}function die(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function hie(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=jO(i,r),a=n(o,a)):(r=jO(r,i),a=n(a,o)),function(s){return a(r(s))}}function pie(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=jO(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(s){var c=Ng(e,s,1,r)-1;return a[c](i[c](s))}}function Rg(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Pb(){var e=FI,t=FI,n=op,r,i,a,o=Xa,s,c,d;function p(){var y=Math.min(e.length,t.length);return o!==Xa&&(o=die(e[0],e[y-1])),s=y>2?pie:hie,c=d=null,m}function m(y){return y==null||isNaN(y=+y)?a:(c||(c=s(e.map(r),t,n)))(r(o(y)))}return m.invert=function(y){return o(i((d||(d=s(t,e.map(r),Yy)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,Xy),p()):e.slice()},m.range=function(y){return arguments.length?(t=Array.from(y),p()):t.slice()},m.rangeRound=function(y){return t=Array.from(y),n=XE,p()},m.clamp=function(y){return arguments.length?(o=y?!0:Xa,p()):o!==Xa},m.interpolate=function(y){return arguments.length?(n=y,p()):n},m.unknown=function(y){return arguments.length?(a=y,m):a},function(y,b){return r=y,i=b,p()}}function QE(){return Pb()(Xa,Xa)}function mie(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qy(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ph(e){return e=Qy(Math.abs(e)),e?e[1]:NaN}function gie(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function vie(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var yie=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bm(e){if(!(t=yie.exec(e)))throw new Error("invalid format: "+e);var t;return new JE({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Bm.prototype=JE.prototype;function JE(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}JE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function bie(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Jy;function xie(e,t){var n=Qy(e,t);if(!n)return Jy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Jy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Qy(e,Math.max(0,t+a-1))[0]}function qI(e,t){var n=Qy(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const zI={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:mie,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>qI(e*100,t),r:qI,s:xie,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function UI(e){return e}var VI=Array.prototype.map,WI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function wie(e){var t=e.grouping===void 0||e.thousands===void 0?UI:gie(VI.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?UI:vie(VI.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(m,y){m=Bm(m);var b=m.fill,P=m.align,x=m.sign,w=m.symbol,T=m.zero,E=m.width,k=m.comma,D=m.precision,I=m.trim,R=m.type;R==="n"?(k=!0,R="g"):zI[R]||(D===void 0&&(D=12),I=!0,R="g"),(T||b==="0"&&P==="=")&&(T=!0,b="0",P="=");var $=(y&&y.prefix!==void 0?y.prefix:"")+(w==="$"?n:w==="#"&&/[boxX]/.test(R)?"0"+R.toLowerCase():""),V=(w==="$"?r:/[%p]/.test(R)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),K=zI[R],Z=/[defgprs%]/.test(R);D=D===void 0?6:/[gprs]/.test(R)?Math.max(1,Math.min(21,D)):Math.max(0,Math.min(20,D));function ee(ne){var oe=$,he=V,Se,fe,Oe;if(R==="c")he=K(ne)+he,ne="";else{ne=+ne;var re=ne<0||1/ne<0;if(ne=isNaN(ne)?c:K(Math.abs(ne),D),I&&(ne=bie(ne)),re&&+ne==0&&x!=="+"&&(re=!1),oe=(re?x==="("?x:s:x==="-"||x==="("?"":x)+oe,he=(R==="s"&&!isNaN(ne)&&Jy!==void 0?WI[8+Jy/3]:"")+he+(re&&x==="("?")":""),Z){for(Se=-1,fe=ne.length;++Se<fe;)if(Oe=ne.charCodeAt(Se),48>Oe||Oe>57){he=(Oe===46?i+ne.slice(Se+1):ne.slice(Se))+he,ne=ne.slice(0,Se);break}}}k&&!T&&(ne=t(ne,1/0));var Ce=oe.length+ne.length+he.length,ae=Ce<E?new Array(E-Ce+1).join(b):"";switch(k&&T&&(ne=t(ae+ne,ae.length?E-he.length:1/0),ae=""),P){case"<":ne=oe+ne+he+ae;break;case"=":ne=oe+ae+ne+he;break;case"^":ne=ae.slice(0,Ce=ae.length>>1)+oe+ne+he+ae.slice(Ce);break;default:ne=ae+oe+ne+he;break}return a(ne)}return ee.toString=function(){return m+""},ee}function p(m,y){var b=Math.max(-8,Math.min(8,Math.floor(Ph(y)/3)))*3,P=Math.pow(10,-b),x=d((m=Bm(m),m.type="f",m),{suffix:WI[8+b/3]});return function(w){return x(P*w)}}return{format:d,formatPrefix:p}}var Hv,eA,Vq;_ie({thousands:",",grouping:[3],currency:["$",""]});function _ie(e){return Hv=wie(e),eA=Hv.format,Vq=Hv.formatPrefix,Hv}function Sie(e){return Math.max(0,-Ph(Math.abs(e)))}function Pie(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ph(t)/3)))*3-Ph(Math.abs(e)))}function jie(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ph(t)-Ph(e))+1}function Wq(e,t,n,r){var i=wO(e,t,n),a;switch(r=Bm(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Pie(i,o))&&(r.precision=a),Vq(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=jie(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Sie(i))&&(r.precision=a-(r.type==="%")*2);break}}return eA(r)}function Hc(e){var t=e.domain;return e.ticks=function(n){var r=t();return bO(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Wq(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,d,p=10;for(s<o&&(d=o,o=s,s=d,d=i,i=a,a=d);p-- >0;){if(d=xO(o,s,n),d===c)return r[i]=o,r[a]=s,t(r);if(d>0)o=Math.floor(o/d)*d,s=Math.ceil(s/d)*d;else if(d<0)o=Math.ceil(o*d)/d,s=Math.floor(s*d)/d;else break;c=d}return e},e}function e0(){var e=QE();return e.copy=function(){return Rg(e,e0())},ks.apply(e,arguments),Hc(e)}function Kq(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Xy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Kq(e).unknown(t)},e=arguments.length?Array.from(e,Xy):[0,1],Hc(n)}function Hq(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function KI(e){return Math.log(e)}function HI(e){return Math.exp(e)}function Oie(e){return-Math.log(-e)}function Tie(e){return-Math.exp(-e)}function Eie(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Aie(e){return e===10?Eie:e===Math.E?Math.exp:t=>Math.pow(e,t)}function kie(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function GI(e){return(t,n)=>-e(-t,n)}function tA(e){const t=e(KI,HI),n=t.domain;let r=10,i,a;function o(){return i=kie(r),a=Aie(r),n()[0]<0?(i=GI(i),a=GI(a),e(Oie,Tie)):e(KI,HI),t}return t.base=function(s){return arguments.length?(r=+s,o()):r},t.domain=function(s){return arguments.length?(n(s),o()):n()},t.ticks=s=>{const c=n();let d=c[0],p=c[c.length-1];const m=p<d;m&&([d,p]=[p,d]);let y=i(d),b=i(p),P,x;const w=s==null?10:+s;let T=[];if(!(r%1)&&b-y<w){if(y=Math.floor(y),b=Math.ceil(b),d>0){for(;y<=b;++y)for(P=1;P<r;++P)if(x=y<0?P/a(-y):P*a(y),!(x<d)){if(x>p)break;T.push(x)}}else for(;y<=b;++y)for(P=r-1;P>=1;--P)if(x=y>0?P/a(-y):P*a(y),!(x<d)){if(x>p)break;T.push(x)}T.length*2<w&&(T=bO(d,p,w))}else T=bO(y,b,Math.min(b-y,w)).map(a);return m?T.reverse():T},t.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Bm(c)).precision==null&&(c.trim=!0),c=eA(c)),s===1/0)return c;const d=Math.max(1,r*s/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=d?c(p):""}},t.nice=()=>n(Hq(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function Gq(){const e=tA(Pb()).domain([1,10]);return e.copy=()=>Rg(e,Gq()).base(e.base()),ks.apply(e,arguments),e}function ZI(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function YI(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function nA(e){var t=1,n=e(ZI(t),YI(t));return n.constant=function(r){return arguments.length?e(ZI(t=+r),YI(t)):t},Hc(n)}function Zq(){var e=nA(Pb());return e.copy=function(){return Rg(e,Zq()).constant(e.constant())},ks.apply(e,arguments)}function XI(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Cie(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Nie(e){return e<0?-e*e:e*e}function rA(e){var t=e(Xa,Xa),n=1;function r(){return n===1?e(Xa,Xa):n===.5?e(Cie,Nie):e(XI(n),XI(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Hc(t)}function iA(){var e=rA(Pb());return e.copy=function(){return Rg(e,iA()).exponent(e.exponent())},ks.apply(e,arguments),e}function Mie(){return iA.apply(null,arguments).exponent(.5)}function QI(e){return Math.sign(e)*e*e}function Rie(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Yq(){var e=QE(),t=[0,1],n=!1,r;function i(a){var o=Rie(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(QI(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Xy)).map(QI)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Yq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ks.apply(i,arguments),Hc(i)}function Xq(){var e=[],t=[],n=[],r;function i(){var o=0,s=Math.max(1,t.length);for(n=new Array(s-1);++o<s;)n[o-1]=$re(e,o/s);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Ng(n,o)]}return a.invertExtent=function(o){var s=t.indexOf(o);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let s of o)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Nc),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return Xq().domain(e).range(t).unknown(r)},ks.apply(a,arguments)}function Qq(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Ng(r,c,0,n)]:a}function s(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,s()):[e,t]},o.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,s()):i.slice()},o.invertExtent=function(c){var d=i.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,r[0]]:d>=n?[r[n-1],t]:[r[d-1],r[d]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Qq().domain([e,t]).range(i).unknown(a)},ks.apply(Hc(o),arguments)}function Jq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Ng(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Jq().domain(e).range(t).unknown(n)},ks.apply(i,arguments)}const JS=new Date,eP=new Date;function ki(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const c=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return c;let d;do c.push(d=new Date(+a)),t(a,s),e(a);while(d<a&&a<o);return c},i.filter=a=>ki(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(JS.setTime(+a),eP.setTime(+o),e(JS),e(eP),Math.floor(n(JS,eP))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const t0=ki(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);t0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ki(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):t0);t0.range;const xu=1e3,Ps=xu*60,wu=Ps*60,Eu=wu*24,aA=Eu*7,JI=Eu*30,tP=Eu*365,kf=ki(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*xu)},(e,t)=>(t-e)/xu,e=>e.getUTCSeconds());kf.range;const oA=ki(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*xu)},(e,t)=>{e.setTime(+e+t*Ps)},(e,t)=>(t-e)/Ps,e=>e.getMinutes());oA.range;const sA=ki(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ps)},(e,t)=>(t-e)/Ps,e=>e.getUTCMinutes());sA.range;const lA=ki(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*xu-e.getMinutes()*Ps)},(e,t)=>{e.setTime(+e+t*wu)},(e,t)=>(t-e)/wu,e=>e.getHours());lA.range;const uA=ki(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*wu)},(e,t)=>(t-e)/wu,e=>e.getUTCHours());uA.range;const Lg=ki(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ps)/Eu,e=>e.getDate()-1);Lg.range;const jb=ki(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Eu,e=>e.getUTCDate()-1);jb.range;const ez=ki(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Eu,e=>Math.floor(e/Eu));ez.range;function dd(e){return ki(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ps)/aA)}const Ob=dd(0),n0=dd(1),Lie=dd(2),Iie=dd(3),jh=dd(4),Die=dd(5),Bie=dd(6);Ob.range;n0.range;Lie.range;Iie.range;jh.range;Die.range;Bie.range;function hd(e){return ki(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/aA)}const Tb=hd(0),r0=hd(1),$ie=hd(2),Fie=hd(3),Oh=hd(4),qie=hd(5),zie=hd(6);Tb.range;r0.range;$ie.range;Fie.range;Oh.range;qie.range;zie.range;const cA=ki(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());cA.range;const fA=ki(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());fA.range;const Au=ki(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Au.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ki(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Au.range;const ku=ki(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ku.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ki(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ku.range;function tz(e,t,n,r,i,a){const o=[[kf,1,xu],[kf,5,5*xu],[kf,15,15*xu],[kf,30,30*xu],[a,1,Ps],[a,5,5*Ps],[a,15,15*Ps],[a,30,30*Ps],[i,1,wu],[i,3,3*wu],[i,6,6*wu],[i,12,12*wu],[r,1,Eu],[r,2,2*Eu],[n,1,aA],[t,1,JI],[t,3,3*JI],[e,1,tP]];function s(d,p,m){const y=p<d;y&&([d,p]=[p,d]);const b=m&&typeof m.range=="function"?m:c(d,p,m),P=b?b.range(d,+p+1):[];return y?P.reverse():P}function c(d,p,m){const y=Math.abs(p-d)/m,b=HE(([,,w])=>w).right(o,y);if(b===o.length)return e.every(wO(d/tP,p/tP,m));if(b===0)return t0.every(Math.max(wO(d,p,m),1));const[P,x]=o[y/o[b-1][2]<o[b][2]/y?b-1:b];return P.every(x)}return[s,c]}const[Uie,Vie]=tz(ku,fA,Tb,ez,uA,sA),[Wie,Kie]=tz(Au,cA,Ob,Lg,lA,oA);function nP(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function rP(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function zp(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Hie(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,d=Up(i),p=Vp(i),m=Up(a),y=Vp(a),b=Up(o),P=Vp(o),x=Up(s),w=Vp(s),T=Up(c),E=Vp(c),k={a:Oe,A:re,b:Ce,B:ae,c:null,d:aD,e:aD,f:gae,g:Oae,G:Eae,H:hae,I:pae,j:mae,L:nz,m:vae,M:yae,p:ie,q:de,Q:lD,s:uD,S:bae,u:xae,U:wae,V:_ae,w:Sae,W:Pae,x:null,X:null,y:jae,Y:Tae,Z:Aae,"%":sD},D={a:He,A:je,b:$e,B:We,c:null,d:oD,e:oD,f:Mae,g:Uae,G:Wae,H:kae,I:Cae,j:Nae,L:iz,m:Rae,M:Lae,p:Ye,q:rt,Q:lD,s:uD,S:Iae,u:Dae,U:Bae,V:$ae,w:Fae,W:qae,x:null,X:null,y:zae,Y:Vae,Z:Kae,"%":sD},I={a:Z,A:ee,b:ne,B:oe,c:he,d:rD,e:rD,f:uae,g:nD,G:tD,H:iD,I:iD,j:aae,L:lae,m:iae,M:oae,p:K,q:rae,Q:fae,s:dae,S:sae,u:Qie,U:Jie,V:eae,w:Xie,W:tae,x:Se,X:fe,y:nD,Y:tD,Z:nae,"%":cae};k.x=R(n,k),k.X=R(r,k),k.c=R(t,k),D.x=R(n,D),D.X=R(r,D),D.c=R(t,D);function R(ze,Fe){return function(st){var Te=[],Dt=-1,Lt=0,dn=ze.length,xn,qn,Ar;for(st instanceof Date||(st=new Date(+st));++Dt<dn;)ze.charCodeAt(Dt)===37&&(Te.push(ze.slice(Lt,Dt)),(qn=eD[xn=ze.charAt(++Dt)])!=null?xn=ze.charAt(++Dt):qn=xn==="e"?" ":"0",(Ar=Fe[xn])&&(xn=Ar(st,qn)),Te.push(xn),Lt=Dt+1);return Te.push(ze.slice(Lt,Dt)),Te.join("")}}function $(ze,Fe){return function(st){var Te=zp(1900,void 0,1),Dt=V(Te,ze,st+="",0),Lt,dn;if(Dt!=st.length)return null;if("Q"in Te)return new Date(Te.Q);if("s"in Te)return new Date(Te.s*1e3+("L"in Te?Te.L:0));if(Fe&&!("Z"in Te)&&(Te.Z=0),"p"in Te&&(Te.H=Te.H%12+Te.p*12),Te.m===void 0&&(Te.m="q"in Te?Te.q:0),"V"in Te){if(Te.V<1||Te.V>53)return null;"w"in Te||(Te.w=1),"Z"in Te?(Lt=rP(zp(Te.y,0,1)),dn=Lt.getUTCDay(),Lt=dn>4||dn===0?r0.ceil(Lt):r0(Lt),Lt=jb.offset(Lt,(Te.V-1)*7),Te.y=Lt.getUTCFullYear(),Te.m=Lt.getUTCMonth(),Te.d=Lt.getUTCDate()+(Te.w+6)%7):(Lt=nP(zp(Te.y,0,1)),dn=Lt.getDay(),Lt=dn>4||dn===0?n0.ceil(Lt):n0(Lt),Lt=Lg.offset(Lt,(Te.V-1)*7),Te.y=Lt.getFullYear(),Te.m=Lt.getMonth(),Te.d=Lt.getDate()+(Te.w+6)%7)}else("W"in Te||"U"in Te)&&("w"in Te||(Te.w="u"in Te?Te.u%7:"W"in Te?1:0),dn="Z"in Te?rP(zp(Te.y,0,1)).getUTCDay():nP(zp(Te.y,0,1)).getDay(),Te.m=0,Te.d="W"in Te?(Te.w+6)%7+Te.W*7-(dn+5)%7:Te.w+Te.U*7-(dn+6)%7);return"Z"in Te?(Te.H+=Te.Z/100|0,Te.M+=Te.Z%100,rP(Te)):nP(Te)}}function V(ze,Fe,st,Te){for(var Dt=0,Lt=Fe.length,dn=st.length,xn,qn;Dt<Lt;){if(Te>=dn)return-1;if(xn=Fe.charCodeAt(Dt++),xn===37){if(xn=Fe.charAt(Dt++),qn=I[xn in eD?Fe.charAt(Dt++):xn],!qn||(Te=qn(ze,st,Te))<0)return-1}else if(xn!=st.charCodeAt(Te++))return-1}return Te}function K(ze,Fe,st){var Te=d.exec(Fe.slice(st));return Te?(ze.p=p.get(Te[0].toLowerCase()),st+Te[0].length):-1}function Z(ze,Fe,st){var Te=b.exec(Fe.slice(st));return Te?(ze.w=P.get(Te[0].toLowerCase()),st+Te[0].length):-1}function ee(ze,Fe,st){var Te=m.exec(Fe.slice(st));return Te?(ze.w=y.get(Te[0].toLowerCase()),st+Te[0].length):-1}function ne(ze,Fe,st){var Te=T.exec(Fe.slice(st));return Te?(ze.m=E.get(Te[0].toLowerCase()),st+Te[0].length):-1}function oe(ze,Fe,st){var Te=x.exec(Fe.slice(st));return Te?(ze.m=w.get(Te[0].toLowerCase()),st+Te[0].length):-1}function he(ze,Fe,st){return V(ze,t,Fe,st)}function Se(ze,Fe,st){return V(ze,n,Fe,st)}function fe(ze,Fe,st){return V(ze,r,Fe,st)}function Oe(ze){return o[ze.getDay()]}function re(ze){return a[ze.getDay()]}function Ce(ze){return c[ze.getMonth()]}function ae(ze){return s[ze.getMonth()]}function ie(ze){return i[+(ze.getHours()>=12)]}function de(ze){return 1+~~(ze.getMonth()/3)}function He(ze){return o[ze.getUTCDay()]}function je(ze){return a[ze.getUTCDay()]}function $e(ze){return c[ze.getUTCMonth()]}function We(ze){return s[ze.getUTCMonth()]}function Ye(ze){return i[+(ze.getUTCHours()>=12)]}function rt(ze){return 1+~~(ze.getUTCMonth()/3)}return{format:function(ze){var Fe=R(ze+="",k);return Fe.toString=function(){return ze},Fe},parse:function(ze){var Fe=$(ze+="",!1);return Fe.toString=function(){return ze},Fe},utcFormat:function(ze){var Fe=R(ze+="",D);return Fe.toString=function(){return ze},Fe},utcParse:function(ze){var Fe=$(ze+="",!0);return Fe.toString=function(){return ze},Fe}}}var eD={"-":"",_:" ",0:"0"},Vi=/^\s*\d+/,Gie=/^%/,Zie=/[\\^$*+?|[\]().{}]/g;function Hn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function Yie(e){return e.replace(Zie,"\\$&")}function Up(e){return new RegExp("^(?:"+e.map(Yie).join("|")+")","i")}function Vp(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Xie(e,t,n){var r=Vi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Qie(e,t,n){var r=Vi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Jie(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function eae(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function tae(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function tD(e,t,n){var r=Vi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function nD(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function nae(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function rae(e,t,n){var r=Vi.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function iae(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function rD(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function aae(e,t,n){var r=Vi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function iD(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function oae(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function sae(e,t,n){var r=Vi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function lae(e,t,n){var r=Vi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function uae(e,t,n){var r=Vi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function cae(e,t,n){var r=Gie.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function fae(e,t,n){var r=Vi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function dae(e,t,n){var r=Vi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function aD(e,t){return Hn(e.getDate(),t,2)}function hae(e,t){return Hn(e.getHours(),t,2)}function pae(e,t){return Hn(e.getHours()%12||12,t,2)}function mae(e,t){return Hn(1+Lg.count(Au(e),e),t,3)}function nz(e,t){return Hn(e.getMilliseconds(),t,3)}function gae(e,t){return nz(e,t)+"000"}function vae(e,t){return Hn(e.getMonth()+1,t,2)}function yae(e,t){return Hn(e.getMinutes(),t,2)}function bae(e,t){return Hn(e.getSeconds(),t,2)}function xae(e){var t=e.getDay();return t===0?7:t}function wae(e,t){return Hn(Ob.count(Au(e)-1,e),t,2)}function rz(e){var t=e.getDay();return t>=4||t===0?jh(e):jh.ceil(e)}function _ae(e,t){return e=rz(e),Hn(jh.count(Au(e),e)+(Au(e).getDay()===4),t,2)}function Sae(e){return e.getDay()}function Pae(e,t){return Hn(n0.count(Au(e)-1,e),t,2)}function jae(e,t){return Hn(e.getFullYear()%100,t,2)}function Oae(e,t){return e=rz(e),Hn(e.getFullYear()%100,t,2)}function Tae(e,t){return Hn(e.getFullYear()%1e4,t,4)}function Eae(e,t){var n=e.getDay();return e=n>=4||n===0?jh(e):jh.ceil(e),Hn(e.getFullYear()%1e4,t,4)}function Aae(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Hn(t/60|0,"0",2)+Hn(t%60,"0",2)}function oD(e,t){return Hn(e.getUTCDate(),t,2)}function kae(e,t){return Hn(e.getUTCHours(),t,2)}function Cae(e,t){return Hn(e.getUTCHours()%12||12,t,2)}function Nae(e,t){return Hn(1+jb.count(ku(e),e),t,3)}function iz(e,t){return Hn(e.getUTCMilliseconds(),t,3)}function Mae(e,t){return iz(e,t)+"000"}function Rae(e,t){return Hn(e.getUTCMonth()+1,t,2)}function Lae(e,t){return Hn(e.getUTCMinutes(),t,2)}function Iae(e,t){return Hn(e.getUTCSeconds(),t,2)}function Dae(e){var t=e.getUTCDay();return t===0?7:t}function Bae(e,t){return Hn(Tb.count(ku(e)-1,e),t,2)}function az(e){var t=e.getUTCDay();return t>=4||t===0?Oh(e):Oh.ceil(e)}function $ae(e,t){return e=az(e),Hn(Oh.count(ku(e),e)+(ku(e).getUTCDay()===4),t,2)}function Fae(e){return e.getUTCDay()}function qae(e,t){return Hn(r0.count(ku(e)-1,e),t,2)}function zae(e,t){return Hn(e.getUTCFullYear()%100,t,2)}function Uae(e,t){return e=az(e),Hn(e.getUTCFullYear()%100,t,2)}function Vae(e,t){return Hn(e.getUTCFullYear()%1e4,t,4)}function Wae(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Oh(e):Oh.ceil(e),Hn(e.getUTCFullYear()%1e4,t,4)}function Kae(){return"+0000"}function sD(){return"%"}function lD(e){return+e}function uD(e){return Math.floor(+e/1e3)}var Rd,oz,sz;Hae({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Hae(e){return Rd=Hie(e),oz=Rd.format,Rd.parse,sz=Rd.utcFormat,Rd.utcParse,Rd}function Gae(e){return new Date(e)}function Zae(e){return e instanceof Date?+e:+new Date(+e)}function dA(e,t,n,r,i,a,o,s,c,d){var p=QE(),m=p.invert,y=p.domain,b=d(".%L"),P=d(":%S"),x=d("%I:%M"),w=d("%I %p"),T=d("%a %d"),E=d("%b %d"),k=d("%B"),D=d("%Y");function I(R){return(c(R)<R?b:s(R)<R?P:o(R)<R?x:a(R)<R?w:r(R)<R?i(R)<R?T:E:n(R)<R?k:D)(R)}return p.invert=function(R){return new Date(m(R))},p.domain=function(R){return arguments.length?y(Array.from(R,Zae)):y().map(Gae)},p.ticks=function(R){var $=y();return e($[0],$[$.length-1],R??10)},p.tickFormat=function(R,$){return $==null?I:d($)},p.nice=function(R){var $=y();return(!R||typeof R.range!="function")&&(R=t($[0],$[$.length-1],R??10)),R?y(Hq($,R)):p},p.copy=function(){return Rg(p,dA(e,t,n,r,i,a,o,s,c,d))},p}function Yae(){return ks.apply(dA(Wie,Kie,Au,cA,Ob,Lg,lA,oA,kf,oz).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Xae(){return ks.apply(dA(Uie,Vie,ku,fA,Tb,jb,uA,sA,kf,sz).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Eb(){var e=0,t=1,n,r,i,a,o=Xa,s=!1,c;function d(m){return m==null||isNaN(m=+m)?c:o(i===0?.5:(m=(a(m)-n)*i,s?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),d):[e,t]},d.clamp=function(m){return arguments.length?(s=!!m,d):s},d.interpolator=function(m){return arguments.length?(o=m,d):o};function p(m){return function(y){var b,P;return arguments.length?([b,P]=y,o=m(b,P),d):[o(0),o(1)]}}return d.range=p(op),d.rangeRound=p(XE),d.unknown=function(m){return arguments.length?(c=m,d):c},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),d}}function Gc(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function lz(){var e=Hc(Eb()(Xa));return e.copy=function(){return Gc(e,lz())},Bu.apply(e,arguments)}function uz(){var e=tA(Eb()).domain([1,10]);return e.copy=function(){return Gc(e,uz()).base(e.base())},Bu.apply(e,arguments)}function cz(){var e=nA(Eb());return e.copy=function(){return Gc(e,cz()).constant(e.constant())},Bu.apply(e,arguments)}function hA(){var e=rA(Eb());return e.copy=function(){return Gc(e,hA()).exponent(e.exponent())},Bu.apply(e,arguments)}function Qae(){return hA.apply(null,arguments).exponent(.5)}function fz(){var e=[],t=Xa;function n(r){if(r!=null&&!isNaN(r=+r))return t((Ng(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Nc),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>Bre(e,a/r))},n.copy=function(){return fz(t).domain(e)},Bu.apply(n,arguments)}function Ab(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,d=Xa,p,m=!1,y;function b(x){return isNaN(x=+x)?y:(x=.5+((x=+p(x))-a)*(r*x<r*a?s:c),d(m?Math.max(0,Math.min(1,x)):x))}b.domain=function(x){return arguments.length?([e,t,n]=x,i=p(e=+e),a=p(t=+t),o=p(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,b):[e,t,n]},b.clamp=function(x){return arguments.length?(m=!!x,b):m},b.interpolator=function(x){return arguments.length?(d=x,b):d};function P(x){return function(w){var T,E,k;return arguments.length?([T,E,k]=w,d=cie(x,[T,E,k]),b):[d(0),d(.5),d(1)]}}return b.range=P(op),b.rangeRound=P(XE),b.unknown=function(x){return arguments.length?(y=x,b):y},function(x){return p=x,i=x(e),a=x(t),o=x(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,b}}function dz(){var e=Hc(Ab()(Xa));return e.copy=function(){return Gc(e,dz())},Bu.apply(e,arguments)}function hz(){var e=tA(Ab()).domain([.1,1,10]);return e.copy=function(){return Gc(e,hz()).base(e.base())},Bu.apply(e,arguments)}function pz(){var e=nA(Ab());return e.copy=function(){return Gc(e,pz()).constant(e.constant())},Bu.apply(e,arguments)}function pA(){var e=rA(Ab());return e.copy=function(){return Gc(e,pA()).exponent(e.exponent())},Bu.apply(e,arguments)}function Jae(){return pA.apply(null,arguments).exponent(.5)}const cD=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Rm,scaleDiverging:dz,scaleDivergingLog:hz,scaleDivergingPow:pA,scaleDivergingSqrt:Jae,scaleDivergingSymlog:pz,scaleIdentity:Kq,scaleImplicit:_O,scaleLinear:e0,scaleLog:Gq,scaleOrdinal:GE,scalePoint:mm,scalePow:iA,scaleQuantile:Xq,scaleQuantize:Qq,scaleRadial:Yq,scaleSequential:lz,scaleSequentialLog:uz,scaleSequentialPow:hA,scaleSequentialQuantile:fz,scaleSequentialSqrt:Qae,scaleSequentialSymlog:cz,scaleSqrt:Mie,scaleSymlog:Zq,scaleThreshold:Jq,scaleTime:Yae,scaleUtc:Xae,tickFormat:Wq},Symbol.toStringTag,{value:"Module"}));var iP,fD;function kb(){if(fD)return iP;fD=1;var e=np();function t(n,r,i){for(var a=-1,o=n.length;++a<o;){var s=n[a],c=r(s);if(c!=null&&(d===void 0?c===c&&!e(c):i(c,d)))var d=c,p=s}return p}return iP=t,iP}var aP,dD;function mz(){if(dD)return aP;dD=1;function e(t,n){return t>n}return aP=e,aP}var oP,hD;function eoe(){if(hD)return oP;hD=1;var e=kb(),t=mz(),n=ip();function r(i){return i&&i.length?e(i,n,t):void 0}return oP=r,oP}var toe=eoe();const Cb=In(toe);var sP,pD;function gz(){if(pD)return sP;pD=1;function e(t,n){return t<n}return sP=e,sP}var lP,mD;function noe(){if(mD)return lP;mD=1;var e=kb(),t=gz(),n=ip();function r(i){return i&&i.length?e(i,n,t):void 0}return lP=r,lP}var roe=noe();const Nb=In(roe);var uP,gD;function ioe(){if(gD)return uP;gD=1;var e=kE(),t=Hl(),n=jq(),r=Oo();function i(a,o){var s=r(a)?e:n;return s(a,t(o,3))}return uP=i,uP}var cP,vD;function aoe(){if(vD)return cP;vD=1;var e=Sq(),t=ioe();function n(r,i){return e(t(r,i),1)}return cP=n,cP}var ooe=aoe();const soe=In(ooe);var fP,yD;function loe(){if(yD)return fP;yD=1;var e=UE();function t(n,r){return e(n,r)}return fP=t,fP}var uoe=loe();const Mb=In(uoe);var sp=1e9,coe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},gA,Or=!0,Ts="[DecimalError] ",Wf=Ts+"Invalid argument: ",mA=Ts+"Exponent out of range: ",lp=Math.floor,wf=Math.pow,foe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,qo,zi=1e7,xr=7,vz=9007199254740991,i0=lp(vz/xr),Et={};Et.absoluteValue=Et.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Et.comparedTo=Et.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Et.decimalPlaces=Et.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*xr;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Et.dividedBy=Et.div=function(e){return Pu(this,new this.constructor(e))};Et.dividedToIntegerBy=Et.idiv=function(e){var t=this,n=t.constructor;return cr(Pu(t,new n(e),0,1),n.precision)};Et.equals=Et.eq=function(e){return!this.cmp(e)};Et.exponent=function(){return di(this)};Et.greaterThan=Et.gt=function(e){return this.cmp(e)>0};Et.greaterThanOrEqualTo=Et.gte=function(e){return this.cmp(e)>=0};Et.isInteger=Et.isint=function(){return this.e>this.d.length-2};Et.isNegative=Et.isneg=function(){return this.s<0};Et.isPositive=Et.ispos=function(){return this.s>0};Et.isZero=function(){return this.s===0};Et.lessThan=Et.lt=function(e){return this.cmp(e)<0};Et.lessThanOrEqualTo=Et.lte=function(e){return this.cmp(e)<1};Et.logarithm=Et.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(qo))throw Error(Ts+"NaN");if(n.s<1)throw Error(Ts+(n.s?"NaN":"-Infinity"));return n.eq(qo)?new r(0):(Or=!1,t=Pu($m(n,a),$m(e,a),a),Or=!0,cr(t,i))};Et.minus=Et.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?xz(t,e):yz(t,(e.s=-e.s,e))};Et.modulo=Et.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Ts+"NaN");return n.s?(Or=!1,t=Pu(n,e,0,1).times(e),Or=!0,n.minus(t)):cr(new r(n),i)};Et.naturalExponential=Et.exp=function(){return bz(this)};Et.naturalLogarithm=Et.ln=function(){return $m(this)};Et.negated=Et.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Et.plus=Et.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?yz(t,e):xz(t,(e.s=-e.s,e))};Et.precision=Et.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Wf+e);if(t=di(i)+1,r=i.d.length-1,n=r*xr+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Et.squareRoot=Et.sqrt=function(){var e,t,n,r,i,a,o,s=this,c=s.constructor;if(s.s<1){if(!s.s)return new c(0);throw Error(Ts+"NaN")}for(e=di(s),Or=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Ml(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=lp((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(Pu(s,a,o+2)).times(.5),Ml(a.d).slice(0,o)===(t=Ml(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(cr(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(t!="9999")break;o+=4}return Or=!0,cr(r,n)};Et.times=Et.mul=function(e){var t,n,r,i,a,o,s,c,d,p=this,m=p.constructor,y=p.d,b=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,c=y.length,d=b.length,c<d&&(a=y,y=b,b=a,o=c,c=d,d=o),a=[],o=c+d,r=o;r--;)a.push(0);for(r=d;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+b[r]*y[i-r-1]+t,a[i--]=s%zi|0,t=s/zi|0;a[i]=(a[i]+t)%zi|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Or?cr(e,m.precision):e};Et.toDecimalPlaces=Et.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Vl(e,0,sp),t===void 0?t=r.rounding:Vl(t,0,8),cr(n,e+di(n)+1,t))};Et.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ed(r,!0):(Vl(e,0,sp),t===void 0?t=i.rounding:Vl(t,0,8),r=cr(new i(r),e+1,t),n=ed(r,!0,e+1)),n};Et.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?ed(i):(Vl(e,0,sp),t===void 0?t=a.rounding:Vl(t,0,8),r=cr(new a(i),e+di(i)+1,t),n=ed(r.abs(),!1,e+di(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Et.toInteger=Et.toint=function(){var e=this,t=e.constructor;return cr(new t(e),di(e)+1,t.rounding)};Et.toNumber=function(){return+this};Et.toPower=Et.pow=function(e){var t,n,r,i,a,o,s=this,c=s.constructor,d=12,p=+(e=new c(e));if(!e.s)return new c(qo);if(s=new c(s),!s.s){if(e.s<1)throw Error(Ts+"Infinity");return s}if(s.eq(qo))return s;if(r=c.precision,e.eq(qo))return cr(s,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=s.s,o){if((n=p<0?-p:p)<=vz){for(i=new c(qo),t=Math.ceil(r/xr+4),Or=!1;n%2&&(i=i.times(s),xD(i.d,t)),n=lp(n/2),n!==0;)s=s.times(s),xD(s.d,t);return Or=!0,e.s<0?new c(qo).div(i):cr(i,r)}}else if(a<0)throw Error(Ts+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,Or=!1,i=e.times($m(s,r+d)),Or=!0,i=bz(i),i.s=a,i};Et.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=di(i),r=ed(i,n<=a.toExpNeg||n>=a.toExpPos)):(Vl(e,1,sp),t===void 0?t=a.rounding:Vl(t,0,8),i=cr(new a(i),e,t),n=di(i),r=ed(i,e<=n||n<=a.toExpNeg,e)),r};Et.toSignificantDigits=Et.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Vl(e,1,sp),t===void 0?t=r.rounding:Vl(t,0,8)),cr(new r(n),e,t)};Et.toString=Et.valueOf=Et.val=Et.toJSON=Et[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=di(e),n=e.constructor;return ed(e,t<=n.toExpNeg||t>=n.toExpPos)};function yz(e,t){var n,r,i,a,o,s,c,d,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Or?cr(t,m):t;if(c=e.d,d=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,s=d.length):(r=d,i=o,s=c.length),o=Math.ceil(m/xr),s=o>s?o+1:s+1,a>s&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(s=c.length,a=d.length,s-a<0&&(a=s,r=d,d=c,c=r),n=0;a;)n=(c[--a]=c[a]+d[a]+n)/zi|0,c[a]%=zi;for(n&&(c.unshift(n),++i),s=c.length;c[--s]==0;)c.pop();return t.d=c,t.e=i,Or?cr(t,m):t}function Vl(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Wf+e)}function Ml(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=xr-r.length,n&&(a+=pc(n)),a+=r;o=e[t],r=o+"",n=xr-r.length,n&&(a+=pc(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Pu=(function(){function e(r,i){var a,o=0,s=r.length;for(r=r.slice();s--;)a=r[s]*i+o,r[s]=a%zi|0,o=a/zi|0;return o&&r.unshift(o),r}function t(r,i,a,o){var s,c;if(a!=o)c=a>o?1:-1;else for(s=c=0;s<a;s++)if(r[s]!=i[s]){c=r[s]>i[s]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*zi+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var s,c,d,p,m,y,b,P,x,w,T,E,k,D,I,R,$,V,K=r.constructor,Z=r.s==i.s?1:-1,ee=r.d,ne=i.d;if(!r.s)return new K(r);if(!i.s)throw Error(Ts+"Division by zero");for(c=r.e-i.e,$=ne.length,I=ee.length,b=new K(Z),P=b.d=[],d=0;ne[d]==(ee[d]||0);)++d;if(ne[d]>(ee[d]||0)&&--c,a==null?E=a=K.precision:o?E=a+(di(r)-di(i))+1:E=a,E<0)return new K(0);if(E=E/xr+2|0,d=0,$==1)for(p=0,ne=ne[0],E++;(d<I||p)&&E--;d++)k=p*zi+(ee[d]||0),P[d]=k/ne|0,p=k%ne|0;else{for(p=zi/(ne[0]+1)|0,p>1&&(ne=e(ne,p),ee=e(ee,p),$=ne.length,I=ee.length),D=$,x=ee.slice(0,$),w=x.length;w<$;)x[w++]=0;V=ne.slice(),V.unshift(0),R=ne[0],ne[1]>=zi/2&&++R;do p=0,s=t(ne,x,$,w),s<0?(T=x[0],$!=w&&(T=T*zi+(x[1]||0)),p=T/R|0,p>1?(p>=zi&&(p=zi-1),m=e(ne,p),y=m.length,w=x.length,s=t(m,x,y,w),s==1&&(p--,n(m,$<y?V:ne,y))):(p==0&&(s=p=1),m=ne.slice()),y=m.length,y<w&&m.unshift(0),n(x,m,w),s==-1&&(w=x.length,s=t(ne,x,$,w),s<1&&(p++,n(x,$<w?V:ne,w))),w=x.length):s===0&&(p++,x=[0]),P[d++]=p,s&&x[0]?x[w++]=ee[D]||0:(x=[ee[D]],w=1);while((D++<I||x[0]!==void 0)&&E--)}return P[0]||P.shift(),b.e=c,cr(b,o?a+di(b)+1:a)}})();function bz(e,t){var n,r,i,a,o,s,c=0,d=0,p=e.constructor,m=p.precision;if(di(e)>16)throw Error(mA+di(e));if(!e.s)return new p(qo);for(Or=!1,s=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(r=Math.log(wf(2,d))/Math.LN10*2+5|0,s+=r,n=i=a=new p(qo),p.precision=s;;){if(i=cr(i.times(e),s),n=n.times(++c),o=a.plus(Pu(i,n,s)),Ml(o.d).slice(0,s)===Ml(a.d).slice(0,s)){for(;d--;)a=cr(a.times(a),s);return p.precision=m,t==null?(Or=!0,cr(a,m)):a}a=o}}function di(e){for(var t=e.e*xr,n=e.d[0];n>=10;n/=10)t++;return t}function dP(e,t,n){if(t>e.LN10.sd())throw Or=!0,n&&(e.precision=n),Error(Ts+"LN10 precision limit exceeded");return cr(new e(e.LN10),t)}function pc(e){for(var t="";e--;)t+="0";return t}function $m(e,t){var n,r,i,a,o,s,c,d,p,m=1,y=10,b=e,P=b.d,x=b.constructor,w=x.precision;if(b.s<1)throw Error(Ts+(b.s?"NaN":"-Infinity"));if(b.eq(qo))return new x(0);if(t==null?(Or=!1,d=w):d=t,b.eq(10))return t==null&&(Or=!0),dP(x,d);if(d+=y,x.precision=d,n=Ml(P),r=n.charAt(0),a=di(b),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)b=b.times(e),n=Ml(b.d),r=n.charAt(0),m++;a=di(b),r>1?(b=new x("0."+n),a++):b=new x(r+"."+n.slice(1))}else return c=dP(x,d+2,w).times(a+""),b=$m(new x(r+"."+n.slice(1)),d-y).plus(c),x.precision=w,t==null?(Or=!0,cr(b,w)):b;for(s=o=b=Pu(b.minus(qo),b.plus(qo),d),p=cr(b.times(b),d),i=3;;){if(o=cr(o.times(p),d),c=s.plus(Pu(o,new x(i),d)),Ml(c.d).slice(0,d)===Ml(s.d).slice(0,d))return s=s.times(2),a!==0&&(s=s.plus(dP(x,d+2,w).times(a+""))),s=Pu(s,new x(m),d),x.precision=w,t==null?(Or=!0,cr(s,w)):s;s=c,i+=2}}function bD(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=lp(n/xr),e.d=[],r=(n+1)%xr,n<0&&(r+=xr),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=xr;r<i;)e.d.push(+t.slice(r,r+=xr));t=t.slice(r),r=xr-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Or&&(e.e>i0||e.e<-i0))throw Error(mA+n)}else e.s=0,e.e=0,e.d=[0];return e}function cr(e,t,n){var r,i,a,o,s,c,d,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=xr,i=t,d=m[p=0];else{if(p=Math.ceil((r+1)/xr),a=m.length,p>=a)return e;for(d=a=m[p],o=1;a>=10;a/=10)o++;r%=xr,i=r-xr+o}if(n!==void 0&&(a=wf(10,o-i-1),s=d/a%10|0,c=t<0||m[p+1]!==void 0||d%a,c=n<4?(s||c)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||c||n==6&&(r>0?i>0?d/wf(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return c?(a=di(e),m.length=1,t=t-a-1,m[0]=wf(10,(xr-t%xr)%xr),e.e=lp(-t/xr)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=p,a=1,p--):(m.length=p+1,a=wf(10,xr-r),m[p]=i>0?(d/wf(10,o-i)%wf(10,i)|0)*a:0),c)for(;;)if(p==0){(m[0]+=a)==zi&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=zi)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(Or&&(e.e>i0||e.e<-i0))throw Error(mA+di(e));return e}function xz(e,t){var n,r,i,a,o,s,c,d,p,m,y=e.constructor,b=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),Or?cr(t,b):t;if(c=e.d,m=t.d,r=t.e,d=e.e,c=c.slice(),o=d-r,o){for(p=o<0,p?(n=c,o=-o,s=m.length):(n=m,r=d,s=c.length),i=Math.max(Math.ceil(b/xr),s)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,s=m.length,p=i<s,p&&(s=i),i=0;i<s;i++)if(c[i]!=m[i]){p=c[i]<m[i];break}o=0}for(p&&(n=c,c=m,m=n,t.s=-t.s),s=c.length,i=m.length-s;i>0;--i)c[s++]=0;for(i=m.length;i>o;){if(c[--i]<m[i]){for(a=i;a&&c[--a]===0;)c[a]=zi-1;--c[a],c[i]+=zi}c[i]-=m[i]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Or?cr(t,b):t):new y(0)}function ed(e,t,n){var r,i=di(e),a=Ml(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+pc(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+pc(-i-1)+a,n&&(r=n-o)>0&&(a+=pc(r))):i>=o?(a+=pc(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+pc(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=pc(r))),e.s<0?"-"+a:a}function xD(e,t){if(e.length>t)return e.length=t,!0}function wz(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Wf+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return bD(o,a.toString())}else if(typeof a!="string")throw Error(Wf+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,foe.test(a))bD(o,a);else throw Error(Wf+a)}if(i.prototype=Et,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=wz,i.config=i.set=doe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function doe(e){if(!e||typeof e!="object")throw Error(Ts+"Object expected");var t,n,r,i=["precision",1,sp,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(lp(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Wf+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Wf+n+": "+r);return this}var gA=wz(coe);qo=new gA(1);const ir=gA;function hoe(e){return voe(e)||goe(e)||moe(e)||poe()}function poe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function moe(e,t){if(e){if(typeof e=="string")return OO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OO(e,t)}}function goe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function voe(e){if(Array.isArray(e))return OO(e)}function OO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var yoe=function(t){return t},_z={},Sz=function(t){return t===_z},wD=function(t){return function n(){return arguments.length===0||arguments.length===1&&Sz(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},boe=function e(t,n){return t===1?n:wD(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i.filter(function(s){return s!==_z}).length;return o>=t?n.apply(void 0,i):e(t-o,wD(function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];var p=i.map(function(m){return Sz(m)?c.shift():m});return n.apply(void 0,hoe(p).concat(c))}))})},Rb=function(t){return boe(t.length,t)},TO=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},xoe=Rb(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),woe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return yoe;var i=n.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(s,c){return c(s)},a.apply(void 0,arguments))}},EO=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},Pz=function(t){var n=null,r=null;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n&&a.every(function(s,c){return s===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function _oe(e){var t;return e===0?t=1:t=Math.floor(new ir(e).abs().log(10).toNumber())+1,t}function Soe(e,t,n){for(var r=new ir(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var Poe=Rb(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),joe=Rb(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Ooe=Rb(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Lb={rangeStep:Soe,getDigitCount:_oe,interpolateNumber:Poe,uninterpolateNumber:joe,uninterpolateTruncation:Ooe};function AO(e){return Aoe(e)||Eoe(e)||jz(e)||Toe()}function Toe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eoe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Aoe(e){if(Array.isArray(e))return kO(e)}function Fm(e,t){return Noe(e)||Coe(e,t)||jz(e,t)||koe()}function koe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jz(e,t){if(e){if(typeof e=="string")return kO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kO(e,t)}}function kO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Coe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(c){i=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function Noe(e){if(Array.isArray(e))return e}function Oz(e){var t=Fm(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function Tz(e,t,n){if(e.lte(0))return new ir(0);var r=Lb.getDigitCount(e.toNumber()),i=new ir(10).pow(r),a=e.div(i),o=r!==1?.05:.1,s=new ir(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=s.mul(i);return t?c:new ir(Math.ceil(c))}function Moe(e,t,n){var r=1,i=new ir(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new ir(10).pow(Lb.getDigitCount(e)-1),i=new ir(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new ir(Math.floor(e)))}else e===0?i=new ir(Math.floor((t-1)/2)):n||(i=new ir(Math.floor(e)));var o=Math.floor((t-1)/2),s=woe(xoe(function(c){return i.add(new ir(c-o).mul(r)).toNumber()}),TO);return s(0,t)}function Ez(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new ir(0),tickMin:new ir(0),tickMax:new ir(0)};var a=Tz(new ir(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new ir(0):(o=new ir(e).add(t).div(2),o=o.sub(new ir(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new ir(t).sub(o).div(a).toNumber()),d=s+c+1;return d>n?Ez(e,t,n,r,i+1):(d<n&&(c=t>0?c+(n-d):c,s=t>0?s:s+(n-d)),{step:a,tickMin:o.sub(new ir(s).mul(a)),tickMax:o.add(new ir(c).mul(a))})}function Roe(e){var t=Fm(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=Oz([n,r]),c=Fm(s,2),d=c[0],p=c[1];if(d===-1/0||p===1/0){var m=p===1/0?[d].concat(AO(TO(0,i-1).map(function(){return 1/0}))):[].concat(AO(TO(0,i-1).map(function(){return-1/0})),[p]);return n>r?EO(m):m}if(d===p)return Moe(d,i,a);var y=Ez(d,p,o,a),b=y.step,P=y.tickMin,x=y.tickMax,w=Lb.rangeStep(P,x.add(new ir(.1).mul(b)),b);return n>r?EO(w):w}function Loe(e,t){var n=Fm(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Oz([r,i]),s=Fm(o,2),c=s[0],d=s[1];if(c===-1/0||d===1/0)return[r,i];if(c===d)return[c];var p=Math.max(t,2),m=Tz(new ir(d).sub(c).div(p-1),a,0),y=[].concat(AO(Lb.rangeStep(new ir(c),new ir(d).sub(new ir(.99).mul(m)),m)),[d]);return r>i?EO(y):y}var Ioe=Pz(Roe),Doe=Pz(Loe),Boe="Invariant failed";function td(e,t){throw new Error(Boe)}var $oe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Th(e){"@babel/helpers - typeof";return Th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Th(e)}function a0(){return a0=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},a0.apply(this,arguments)}function Foe(e,t){return Voe(e)||Uoe(e,t)||zoe(e,t)||qoe()}function qoe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zoe(e,t){if(e){if(typeof e=="string")return _D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _D(e,t)}}function _D(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Uoe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function Voe(e){if(Array.isArray(e))return e}function Woe(e,t){if(e==null)return{};var n=Koe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Koe(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 Hoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Goe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cz(r.key),r)}}function Zoe(e,t,n){return t&&Goe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yoe(e,t,n){return t=o0(t),Xoe(e,Az()?Reflect.construct(t,n||[],o0(e).constructor):t.apply(e,n))}function Xoe(e,t){if(t&&(Th(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qoe(e)}function Qoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Az(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Az=function(){return!!e})()}function o0(e){return o0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},o0(e)}function Joe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CO(e,t)}function CO(e,t){return CO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},CO(e,t)}function kz(e,t,n){return t=Cz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cz(e){var t=ese(e,"string");return Th(t)=="symbol"?t:t+""}function ese(e,t){if(Th(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Th(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ib=(function(e){function t(){return Hoe(this,t),Yoe(this,t,arguments)}return Joe(t,e),Zoe(t,[{key:"render",value:function(){var r=this.props,i=r.offset,a=r.layout,o=r.width,s=r.dataKey,c=r.data,d=r.dataPointFormatter,p=r.xAxis,m=r.yAxis,y=Woe(r,$oe),b=Jt(y,!1);this.props.direction==="x"&&p.type!=="number"&&td();var P=c.map(function(x){var w=d(x,s),T=w.x,E=w.y,k=w.value,D=w.errorVal;if(!D)return null;var I=[],R,$;if(Array.isArray(D)){var V=Foe(D,2);R=V[0],$=V[1]}else R=$=D;if(a==="vertical"){var K=p.scale,Z=E+i,ee=Z+o,ne=Z-o,oe=K(k-R),he=K(k+$);I.push({x1:he,y1:ee,x2:he,y2:ne}),I.push({x1:oe,y1:Z,x2:he,y2:Z}),I.push({x1:oe,y1:ee,x2:oe,y2:ne})}else if(a==="horizontal"){var Se=m.scale,fe=T+i,Oe=fe-o,re=fe+o,Ce=Se(k-R),ae=Se(k+$);I.push({x1:Oe,y1:ae,x2:re,y2:ae}),I.push({x1:fe,y1:Ce,x2:fe,y2:ae}),I.push({x1:Oe,y1:Ce,x2:re,y2:Ce})}return ce.createElement(tr,a0({className:"recharts-errorBar",key:"bar-".concat(I.map(function(ie){return"".concat(ie.x1,"-").concat(ie.x2,"-").concat(ie.y1,"-").concat(ie.y2)}))},b),I.map(function(ie){return ce.createElement("line",a0({},ie,{key:"line-".concat(ie.x1,"-").concat(ie.x2,"-").concat(ie.y1,"-").concat(ie.y2)}))}))});return ce.createElement(tr,{className:"recharts-errorBars"},P)}}])})(ce.Component);kz(Ib,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});kz(Ib,"displayName","ErrorBar");function qm(e){"@babel/helpers - typeof";return qm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qm(e)}function SD(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 gf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SD(Object(n),!0).forEach(function(r){tse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tse(e,t,n){return t=nse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nse(e){var t=rse(e,"string");return qm(t)=="symbol"?t:t+""}function rse(e,t){if(qm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nz=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,o=$o(n,Cc);if(!o)return null;var s=Cc.defaultProps,c=s!==void 0?gf(gf({},s),o.props):{},d;return o.props&&o.props.payload?d=o.props&&o.props.payload:a==="children"?d=(r||[]).reduce(function(p,m){var y=m.item,b=m.props,P=b.sectors||b.data||[];return p.concat(P.map(function(x){return{type:o.props.iconType||y.props.legendType,value:x.name,color:x.fill,payload:x}}))},[]):d=(r||[]).map(function(p){var m=p.item,y=m.type.defaultProps,b=y!==void 0?gf(gf({},y),m.props):{},P=b.dataKey,x=b.name,w=b.legendType,T=b.hide;return{inactive:T,dataKey:P,type:c.iconType||w||"square",color:vA(m),value:x||P,payload:b}}),gf(gf(gf({},c),Cc.getWithHeight(o,i)),{},{payload:d,item:o})};function zm(e){"@babel/helpers - typeof";return zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zm(e)}function PD(e){return sse(e)||ose(e)||ase(e)||ise()}function ise(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ase(e,t){if(e){if(typeof e=="string")return NO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NO(e,t)}}function ose(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sse(e){if(Array.isArray(e))return NO(e)}function NO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jD(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 Kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jD(Object(n),!0).forEach(function(r){Qd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qd(e,t,n){return t=lse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lse(e){var t=use(e,"string");return zm(t)=="symbol"?t:t+""}function use(e,t){if(zm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Aa(e,t,n){return _n(e)||_n(t)?n:Ai(t)?Uo(e,t,n):tn(t)?t(e):n}function gm(e,t,n,r){var i=soe(e,function(s){return Aa(s,t)});if(n==="number"){var a=i.filter(function(s){return ct(s)||parseFloat(s)});return a.length?[Nb(a),Cb(a)]:[1/0,-1/0]}var o=r?i.filter(function(s){return!_n(s)}):i;return o.map(function(s){return Ai(s)||s instanceof Date?s:""})}var cse=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,d=0;d<s;d++){var p=d>0?i[d-1].coordinate:i[s-1].coordinate,m=i[d].coordinate,y=d>=s-1?i[0].coordinate:i[d+1].coordinate,b=void 0;if(Za(m-p)!==Za(y-m)){var P=[];if(Za(y-m)===Za(c[1]-c[0])){b=y;var x=m+c[1]-c[0];P[0]=Math.min(x,(x+p)/2),P[1]=Math.max(x,(x+p)/2)}else{b=p;var w=y+c[1]-c[0];P[0]=Math.min(m,(w+m)/2),P[1]=Math.max(m,(w+m)/2)}var T=[Math.min(m,(b+m)/2),Math.max(m,(b+m)/2)];if(t>T[0]&&t<=T[1]||t>=P[0]&&t<=P[1]){o=i[d].index;break}}else{var E=Math.min(p,y),k=Math.max(p,y);if(t>(E+m)/2&&t<=(k+m)/2){o=i[d].index;break}}}else for(var D=0;D<s;D++)if(D===0&&t<=(r[D].coordinate+r[D+1].coordinate)/2||D>0&&D<s-1&&t>(r[D].coordinate+r[D-1].coordinate)/2&&t<=(r[D].coordinate+r[D+1].coordinate)/2||D===s-1&&t>(r[D].coordinate+r[D-1].coordinate)/2){o=r[D].index;break}return o},vA=function(t){var n,r=t,i=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Kr(Kr({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,c;switch(i){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:s;break;default:c=s;break}return c},fse=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),c=0,d=s.length;c<d;c++)for(var p=a[s[c]].stackGroups,m=Object.keys(p),y=0,b=m.length;y<b;y++){var P=p[m[y]],x=P.items,w=P.cateAxisId,T=x.filter(function($){return Su($.type).indexOf("Bar")>=0});if(T&&T.length){var E=T[0].type.defaultProps,k=E!==void 0?Kr(Kr({},E),T[0].props):T[0].props,D=k.barSize,I=k[w];o[I]||(o[I]=[]);var R=_n(D)?n:D;o[I].push({item:T[0],stackList:T.slice(1),barSize:_n(R)?void 0:Ya(R,r,0)})}}return o},dse=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,c=o.length;if(c<1)return null;var d=Ya(n,i,0,!0),p,m=[];if(o[0].barSize===+o[0].barSize){var y=!1,b=i/c,P=o.reduce(function(D,I){return D+I.barSize||0},0);P+=(c-1)*d,P>=i&&(P-=(c-1)*d,d=0),P>=i&&b>0&&(y=!0,b*=.9,P=c*b);var x=(i-P)/2>>0,w={offset:x-d,size:0};p=o.reduce(function(D,I){var R={item:I.item,position:{offset:w.offset+w.size+d,size:y?b:I.barSize}},$=[].concat(PD(D),[R]);return w=$[$.length-1].position,I.stackList&&I.stackList.length&&I.stackList.forEach(function(V){$.push({item:V,position:w})}),$},m)}else{var T=Ya(r,i,0,!0);i-2*T-(c-1)*d<=0&&(d=0);var E=(i-2*T-(c-1)*d)/c;E>1&&(E>>=0);var k=s===+s?Math.min(E,s):E;p=o.reduce(function(D,I,R){var $=[].concat(PD(D),[{item:I.item,position:{offset:T+(E+d)*R+(E-k)/2,size:k}}]);return I.stackList&&I.stackList.length&&I.stackList.forEach(function(V){$.push({item:V,position:$[$.length-1].position})}),$},m)}return p},hse=function(t,n,r,i){var a=r.children,o=r.width,s=r.margin,c=o-(s.left||0)-(s.right||0),d=Nz({children:a,legendWidth:c});if(d){var p=i||{},m=p.width,y=p.height,b=d.align,P=d.verticalAlign,x=d.layout;if((x==="vertical"||x==="horizontal"&&P==="middle")&&b!=="center"&&ct(t[b]))return Kr(Kr({},t),{},Qd({},b,t[b]+(m||0)));if((x==="horizontal"||x==="vertical"&&b==="center")&&P!=="middle"&&ct(t[P]))return Kr(Kr({},t),{},Qd({},P,t[P]+(y||0)))}return t},pse=function(t,n,r){return _n(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Mz=function(t,n,r,i,a){var o=n.props.children,s=Os(o,Ib).filter(function(d){return pse(i,a,d.props.direction)});if(s&&s.length){var c=s.map(function(d){return d.props.dataKey});return t.reduce(function(d,p){var m=Aa(p,r);if(_n(m))return d;var y=Array.isArray(m)?[Nb(m),Cb(m)]:[m,m],b=c.reduce(function(P,x){var w=Aa(p,x,0),T=y[0]-Math.abs(Array.isArray(w)?w[0]:w),E=y[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(T,P[0]),Math.max(E,P[1])]},[1/0,-1/0]);return[Math.min(b[0],d[0]),Math.max(b[1],d[1])]},[1/0,-1/0])}return null},mse=function(t,n,r,i,a){var o=n.map(function(s){return Mz(t,s,r,a,i)}).filter(function(s){return!_n(s)});return o&&o.length?o.reduce(function(s,c){return[Math.min(s[0],c[0]),Math.max(s[1],c[1])]},[1/0,-1/0]):null},Rz=function(t,n,r,i,a){var o=n.map(function(c){var d=c.props.dataKey;return r==="number"&&d&&Mz(t,c,d,i)||gm(t,d,r,a)});if(r==="number")return o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);var s={};return o.reduce(function(c,d){for(var p=0,m=d.length;p<m;p++)s[d[p]]||(s[d[p]]=!0,c.push(d[p]));return c},[])},Lz=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Iz=function(t,n,r,i){if(i)return t.map(function(c){return c.coordinate});var a,o,s=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||s.push(n),o||s.push(r),s},_u=function(t,n,r){if(!t)return null;var i=t.scale,a=t.duplicateDomain,o=t.type,s=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,d=(n||r)&&o==="category"&&i.bandwidth?i.bandwidth()/c:0;if(d=t.axisType==="angleAxis"&&(s==null?void 0:s.length)>=2?Za(s[0]-s[1])*2*d:d,n&&(t.ticks||t.niceTicks)){var p=(t.ticks||t.niceTicks).map(function(m){var y=a?a.indexOf(m):m;return{coordinate:i(y)+d,value:m,offset:d}});return p.filter(function(m){return!Ag(m.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(m,y){return{coordinate:i(m)+d,value:m,index:y,offset:d}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(m){return{coordinate:i(m)+d,value:m,offset:d}}):i.domain().map(function(m,y){return{coordinate:i(m)+d,value:a?a[m]:m,index:y,offset:d}})},hP=new WeakMap,Gv=function(t,n){if(typeof n!="function")return t;hP.has(t)||hP.set(t,new WeakMap);var r=hP.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},Dz=function(t,n,r){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Rm(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:e0(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:mm(),realScaleType:"point"}:a==="category"?{scale:Rm(),realScaleType:"band"}:{scale:e0(),realScaleType:"linear"};if(Xf(i)){var c="scale".concat(vb(i));return{scale:(cD[c]||mm)(),realScaleType:cD[c]?c:"point"}}return tn(i)?{scale:i}:{scale:mm(),realScaleType:"point"}},OD=1e-4,Bz=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),a=Math.min(i[0],i[1])-OD,o=Math.max(i[0],i[1])+OD,s=t(n[0]),c=t(n[r-1]);(s<a||s>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},gse=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},vse=function(t,n){if(!n||n.length!==2||!ct(n[0])||!ct(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!ct(t[0])||t[0]<r)&&(a[0]=r),(!ct(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},yse=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,o=0,s=0;s<n;++s){var c=Ag(t[s][r][1])?t[s][r][0]:t[s][r][1];c>=0?(t[s][r][0]=a,t[s][r][1]=a+c,a=t[s][r][1]):(t[s][r][0]=o,t[s][r][1]=o+c,o=t[s][r][1])}},bse=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,o=0;o<n;++o){var s=Ag(t[o][r][1])?t[o][r][0]:t[o][r][1];s>=0?(t[o][r][0]=a,t[o][r][1]=a+s,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},xse={sign:yse,expand:see,none:yh,silhouette:lee,wiggle:uee,positive:bse},wse=function(t,n,r){var i=n.map(function(s){return s.props.dataKey}),a=xse[r],o=oee().keys(i).value(function(s,c){return+Aa(s,c,0)}).order(lO).offset(a);return o(t)},_se=function(t,n,r,i,a,o){if(!t)return null;var s=o?n.reverse():n,c={},d=s.reduce(function(m,y){var b,P=(b=y.type)!==null&&b!==void 0&&b.defaultProps?Kr(Kr({},y.type.defaultProps),y.props):y.props,x=P.stackId,w=P.hide;if(w)return m;var T=P[r],E=m[T]||{hasStack:!1,stackGroups:{}};if(Ai(x)){var k=E.stackGroups[x]||{numericAxisId:r,cateAxisId:i,items:[]};k.items.push(y),E.hasStack=!0,E.stackGroups[x]=k}else E.stackGroups[kg("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[y]};return Kr(Kr({},m),{},Qd({},T,E))},c),p={};return Object.keys(d).reduce(function(m,y){var b=d[y];if(b.hasStack){var P={};b.stackGroups=Object.keys(b.stackGroups).reduce(function(x,w){var T=b.stackGroups[w];return Kr(Kr({},x),{},Qd({},w,{numericAxisId:r,cateAxisId:i,items:T.items,stackedData:wse(t,T.items,a)}))},P)}return Kr(Kr({},m),{},Qd({},y,b))},p)},$z=function(t,n){var r=n.realScaleType,i=n.type,a=n.tickCount,o=n.originalDomain,s=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var d=t.domain();if(!d.length)return null;var p=Ioe(d,a,s);return t.domain([Nb(p),Cb(p)]),{niceTicks:p}}if(a&&i==="number"){var m=t.domain(),y=Doe(m,a,s);return{niceTicks:y}}return null},TD=function(t){var n=t.axis,r=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(n.type==="category")return r[s]?r[s].coordinate+i:null;var c=Aa(o,n.dataKey,n.domain[s]);return _n(c)?null:n.scale(c)-a/2+i},Sse=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return i<=0&&a>=0?0:a<0?a:i}return r[0]},Pse=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Kr(Kr({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(Ai(a)){var o=n[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},jse=function(t){return t.reduce(function(n,r){return[Nb(r.concat([n[0]]).filter(ct)),Cb(r.concat([n[1]]).filter(ct))]},[1/0,-1/0])},Fz=function(t,n,r){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,c=s.reduce(function(d,p){var m=jse(p.slice(n,r+1));return[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},ED=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,AD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,MO=function(t,n,r){if(tn(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(ct(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(ED.test(t[0])){var a=+ED.exec(t[0])[1];i[0]=n[0]-a}else tn(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(ct(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(AD.test(t[1])){var o=+AD.exec(t[1])[1];i[1]=n[1]+o}else tn(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},s0=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var a=WE(n,function(m){return m.coordinate}),o=1/0,s=1,c=a.length;s<c;s++){var d=a[s],p=a[s-1];o=Math.min((d.coordinate||0)-(p.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},kD=function(t,n,r){return!t||!t.length||Mb(t,Uo(r,"type.defaultProps.domain"))?n:t},qz=function(t,n){var r=t.type.defaultProps?Kr(Kr({},t.type.defaultProps),t.props):t.props,i=r.dataKey,a=r.name,o=r.unit,s=r.formatter,c=r.tooltipType,d=r.chartType,p=r.hide;return Kr(Kr({},Jt(t,!1)),{},{dataKey:i,unit:o,formatter:s,name:a||i,color:vA(t),value:Aa(n,i),type:c,payload:n,chartType:d,hide:p})};function Um(e){"@babel/helpers - typeof";return Um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Um(e)}function CD(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 pu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CD(Object(n),!0).forEach(function(r){zz(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zz(e,t,n){return t=Ose(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ose(e){var t=Tse(e,"string");return Um(t)=="symbol"?t:t+""}function Tse(e,t){if(Um(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Um(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ese(e,t){return Nse(e)||Cse(e,t)||kse(e,t)||Ase()}function Ase(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kse(e,t){if(e){if(typeof e=="string")return ND(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ND(e,t)}}function ND(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function Nse(e){if(Array.isArray(e))return e}var l0=Math.PI/180,Mse=function(t){return t*180/Math.PI},gr=function(t,n,r,i){return{x:t+Math.cos(-l0*i)*r,y:n+Math.sin(-l0*i)*r}},Uz=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Rse=function(t,n,r,i,a){var o=t.width,s=t.height,c=t.startAngle,d=t.endAngle,p=Ya(t.cx,o,o/2),m=Ya(t.cy,s,s/2),y=Uz(o,s,r),b=Ya(t.innerRadius,y,0),P=Ya(t.outerRadius,y,y*.8),x=Object.keys(n);return x.reduce(function(w,T){var E=n[T],k=E.domain,D=E.reversed,I;if(_n(E.range))i==="angleAxis"?I=[c,d]:i==="radiusAxis"&&(I=[b,P]),D&&(I=[I[1],I[0]]);else{I=E.range;var R=I,$=Ese(R,2);c=$[0],d=$[1]}var V=Dz(E,a),K=V.realScaleType,Z=V.scale;Z.domain(k).range(I),Bz(Z);var ee=$z(Z,pu(pu({},E),{},{realScaleType:K})),ne=pu(pu(pu({},E),ee),{},{range:I,radius:P,realScaleType:K,scale:Z,cx:p,cy:m,innerRadius:b,outerRadius:P,startAngle:c,endAngle:d});return pu(pu({},w),{},zz({},T,ne))},{})},Lse=function(t,n){var r=t.x,i=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-o,2))},Ise=function(t,n){var r=t.x,i=t.y,a=n.cx,o=n.cy,s=Lse({x:r,y:i},{x:a,y:o});if(s<=0)return{radius:s};var c=(r-a)/s,d=Math.acos(c);return i>o&&(d=2*Math.PI-d),{radius:s,angle:Mse(d),angleInRadian:d}},Dse=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return{startAngle:n-o*360,endAngle:r-o*360}},Bse=function(t,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},MD=function(t,n){var r=t.x,i=t.y,a=Ise({x:r,y:i},n),o=a.radius,s=a.angle,c=n.innerRadius,d=n.outerRadius;if(o<c||o>d)return!1;if(o===0)return!0;var p=Dse(n),m=p.startAngle,y=p.endAngle,b=s,P;if(m<=y){for(;b>y;)b-=360;for(;b<m;)b+=360;P=b>=m&&b<=y}else{for(;b>m;)b-=360;for(;b<y;)b+=360;P=b>=y&&b<=m}return P?pu(pu({},n),{},{radius:o,angle:Bse(b,n)}):null},Vz=function(t){return!M.isValidElement(t)&&!tn(t)&&typeof t!="boolean"?t.className:""};function Vm(e){"@babel/helpers - typeof";return Vm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vm(e)}var $se=["offset"];function Fse(e){return Vse(e)||Use(e)||zse(e)||qse()}function qse(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zse(e,t){if(e){if(typeof e=="string")return RO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RO(e,t)}}function Use(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vse(e){if(Array.isArray(e))return RO(e)}function RO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wse(e,t){if(e==null)return{};var n=Kse(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Kse(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 RD(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 ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RD(Object(n),!0).forEach(function(r){Hse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hse(e,t,n){return t=Gse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gse(e){var t=Zse(e,"string");return Vm(t)=="symbol"?t:t+""}function Zse(e,t){if(Vm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wm(){return Wm=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},Wm.apply(this,arguments)}var Yse=function(t){var n=t.value,r=t.formatter,i=_n(t.children)?n:t.children;return tn(r)?r(i):i},Xse=function(t,n){var r=Za(n-t),i=Math.min(Math.abs(n-t),360);return r*i},Qse=function(t,n,r){var i=t.position,a=t.viewBox,o=t.offset,s=t.className,c=a,d=c.cx,p=c.cy,m=c.innerRadius,y=c.outerRadius,b=c.startAngle,P=c.endAngle,x=c.clockWise,w=(m+y)/2,T=Xse(b,P),E=T>=0?1:-1,k,D;i==="insideStart"?(k=b+E*o,D=x):i==="insideEnd"?(k=P-E*o,D=!x):i==="end"&&(k=P+E*o,D=x),D=T<=0?D:!D;var I=gr(d,p,w,k),R=gr(d,p,w,k+(D?1:-1)*359),$="M".concat(I.x,",").concat(I.y,`
|
||
A`).concat(w,",").concat(w,",0,1,").concat(D?0:1,`,
|
||
`).concat(R.x,",").concat(R.y),V=_n(t.id)?kg("recharts-radial-line-"):t.id;return ce.createElement("text",Wm({},r,{dominantBaseline:"central",className:pn("recharts-radial-bar-label",s)}),ce.createElement("defs",null,ce.createElement("path",{id:V,d:$})),ce.createElement("textPath",{xlinkHref:"#".concat(V)},n))},Jse=function(t){var n=t.viewBox,r=t.offset,i=t.position,a=n,o=a.cx,s=a.cy,c=a.innerRadius,d=a.outerRadius,p=a.startAngle,m=a.endAngle,y=(p+m)/2;if(i==="outside"){var b=gr(o,s,d+r,y),P=b.x,x=b.y;return{x:P,y:x,textAnchor:P>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var w=(c+d)/2,T=gr(o,s,w,y),E=T.x,k=T.y;return{x:E,y:k,textAnchor:"middle",verticalAnchor:"middle"}},ele=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,a=t.position,o=n,s=o.x,c=o.y,d=o.width,p=o.height,m=p>=0?1:-1,y=m*i,b=m>0?"end":"start",P=m>0?"start":"end",x=d>=0?1:-1,w=x*i,T=x>0?"end":"start",E=x>0?"start":"end";if(a==="top"){var k={x:s+d/2,y:c-m*i,textAnchor:"middle",verticalAnchor:b};return ji(ji({},k),r?{height:Math.max(c-r.y,0),width:d}:{})}if(a==="bottom"){var D={x:s+d/2,y:c+p+y,textAnchor:"middle",verticalAnchor:P};return ji(ji({},D),r?{height:Math.max(r.y+r.height-(c+p),0),width:d}:{})}if(a==="left"){var I={x:s-w,y:c+p/2,textAnchor:T,verticalAnchor:"middle"};return ji(ji({},I),r?{width:Math.max(I.x-r.x,0),height:p}:{})}if(a==="right"){var R={x:s+d+w,y:c+p/2,textAnchor:E,verticalAnchor:"middle"};return ji(ji({},R),r?{width:Math.max(r.x+r.width-R.x,0),height:p}:{})}var $=r?{width:d,height:p}:{};return a==="insideLeft"?ji({x:s+w,y:c+p/2,textAnchor:E,verticalAnchor:"middle"},$):a==="insideRight"?ji({x:s+d-w,y:c+p/2,textAnchor:T,verticalAnchor:"middle"},$):a==="insideTop"?ji({x:s+d/2,y:c+y,textAnchor:"middle",verticalAnchor:P},$):a==="insideBottom"?ji({x:s+d/2,y:c+p-y,textAnchor:"middle",verticalAnchor:b},$):a==="insideTopLeft"?ji({x:s+w,y:c+y,textAnchor:E,verticalAnchor:P},$):a==="insideTopRight"?ji({x:s+d-w,y:c+y,textAnchor:T,verticalAnchor:P},$):a==="insideBottomLeft"?ji({x:s+w,y:c+p-y,textAnchor:E,verticalAnchor:b},$):a==="insideBottomRight"?ji({x:s+d-w,y:c+p-y,textAnchor:T,verticalAnchor:b},$):rp(a)&&(ct(a.x)||Ef(a.x))&&(ct(a.y)||Ef(a.y))?ji({x:s+Ya(a.x,d),y:c+Ya(a.y,p),textAnchor:"end",verticalAnchor:"end"},$):ji({x:s+d/2,y:c+p/2,textAnchor:"middle",verticalAnchor:"middle"},$)},tle=function(t){return"cx"in t&&ct(t.cx)};function Ui(e){var t=e.offset,n=t===void 0?5:t,r=Wse(e,$se),i=ji({offset:n},r),a=i.viewBox,o=i.position,s=i.value,c=i.children,d=i.content,p=i.className,m=p===void 0?"":p,y=i.textBreakAll;if(!a||_n(s)&&_n(c)&&!M.isValidElement(d)&&!tn(d))return null;if(M.isValidElement(d))return M.cloneElement(d,i);var b;if(tn(d)){if(b=M.createElement(d,i),M.isValidElement(b))return b}else b=Yse(i);var P=tle(a),x=Jt(i,!0);if(P&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Qse(i,b,x);var w=P?Jse(i):ele(i);return ce.createElement(Jf,Wm({className:pn("recharts-label",m)},x,w,{breakAll:y}),b)}Ui.displayName="Label";var Wz=function(t){var n=t.cx,r=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,c=t.radius,d=t.innerRadius,p=t.outerRadius,m=t.x,y=t.y,b=t.top,P=t.left,x=t.width,w=t.height,T=t.clockWise,E=t.labelViewBox;if(E)return E;if(ct(x)&&ct(w)){if(ct(m)&&ct(y))return{x:m,y,width:x,height:w};if(ct(b)&&ct(P))return{x:b,y:P,width:x,height:w}}return ct(m)&&ct(y)?{x:m,y,width:0,height:0}:ct(n)&&ct(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:o||i||0,innerRadius:d||0,outerRadius:p||c||s||0,clockWise:T}:t.viewBox?t.viewBox:{}},nle=function(t,n){return t?t===!0?ce.createElement(Ui,{key:"label-implicit",viewBox:n}):Ai(t)?ce.createElement(Ui,{key:"label-implicit",viewBox:n,value:t}):M.isValidElement(t)?t.type===Ui?M.cloneElement(t,{key:"label-implicit",viewBox:n}):ce.createElement(Ui,{key:"label-implicit",content:t,viewBox:n}):tn(t)?ce.createElement(Ui,{key:"label-implicit",content:t,viewBox:n}):rp(t)?ce.createElement(Ui,Wm({viewBox:n},t,{key:"label-implicit"})):null:null},rle=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,a=Wz(t),o=Os(i,Ui).map(function(c,d){return M.cloneElement(c,{viewBox:n||a,key:"label-".concat(d)})});if(!r)return o;var s=nle(t.label,n||a);return[s].concat(Fse(o))};Ui.parseViewBox=Wz;Ui.renderCallByParent=rle;var pP,LD;function ile(){if(LD)return pP;LD=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return pP=e,pP}var ale=ile();const ole=In(ale);function Km(e){"@babel/helpers - typeof";return Km=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Km(e)}var sle=["valueAccessor"],lle=["data","dataKey","clockWise","id","textBreakAll"];function ule(e){return hle(e)||dle(e)||fle(e)||cle()}function cle(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fle(e,t){if(e){if(typeof e=="string")return LO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LO(e,t)}}function dle(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hle(e){if(Array.isArray(e))return LO(e)}function LO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u0(){return u0=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},u0.apply(this,arguments)}function ID(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 DD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ID(Object(n),!0).forEach(function(r){ple(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ID(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ple(e,t,n){return t=mle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mle(e){var t=gle(e,"string");return Km(t)=="symbol"?t:t+""}function gle(e,t){if(Km(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Km(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BD(e,t){if(e==null)return{};var n=vle(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vle(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}var yle=function(t){return Array.isArray(t.value)?ole(t.value):t.value};function Mc(e){var t=e.valueAccessor,n=t===void 0?yle:t,r=BD(e,sle),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,c=r.textBreakAll,d=BD(r,lle);return!i||!i.length?null:ce.createElement(tr,{className:"recharts-label-list"},i.map(function(p,m){var y=_n(a)?n(p,m):Aa(p&&p.payload,a),b=_n(s)?{}:{id:"".concat(s,"-").concat(m)};return ce.createElement(Ui,u0({},Jt(p,!0),d,b,{parentViewBox:p.parentViewBox,value:y,textBreakAll:c,viewBox:Ui.parseViewBox(_n(o)?p:DD(DD({},p),{},{clockWise:o})),key:"label-".concat(m),index:m}))}))}Mc.displayName="LabelList";function ble(e,t){return e?e===!0?ce.createElement(Mc,{key:"labelList-implicit",data:t}):ce.isValidElement(e)||tn(e)?ce.createElement(Mc,{key:"labelList-implicit",data:t,content:e}):rp(e)?ce.createElement(Mc,u0({data:t},e,{key:"labelList-implicit"})):null:null}function xle(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Os(r,Mc).map(function(o,s){return M.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!n)return i;var a=ble(e.label,t);return[a].concat(ule(i))}Mc.renderCallByParent=xle;function Hm(e){"@babel/helpers - typeof";return Hm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hm(e)}function IO(){return IO=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},IO.apply(this,arguments)}function $D(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 FD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(n),!0).forEach(function(r){wle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wle(e,t,n){return t=_le(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _le(e){var t=Sle(e,"string");return Hm(t)=="symbol"?t:t+""}function Sle(e,t){if(Hm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ple=function(t,n){var r=Za(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},Zv=function(t){var n=t.cx,r=t.cy,i=t.radius,a=t.angle,o=t.sign,s=t.isExternal,c=t.cornerRadius,d=t.cornerIsExternal,p=c*(s?1:-1)+i,m=Math.asin(c/p)/l0,y=d?a:a+o*m,b=gr(n,r,p,y),P=gr(n,r,i,y),x=d?a-o*m:a,w=gr(n,r,p*Math.cos(m*l0),x);return{center:b,circleTangency:P,lineTangency:w,theta:m}},Kz=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.startAngle,s=t.endAngle,c=Ple(o,s),d=o+c,p=gr(n,r,a,o),m=gr(n,r,a,d),y="M ".concat(p.x,",").concat(p.y,`
|
||
A `).concat(a,",").concat(a,`,0,
|
||
`).concat(+(Math.abs(c)>180),",").concat(+(o>d),`,
|
||
`).concat(m.x,",").concat(m.y,`
|
||
`);if(i>0){var b=gr(n,r,i,o),P=gr(n,r,i,d);y+="L ".concat(P.x,",").concat(P.y,`
|
||
A `).concat(i,",").concat(i,`,0,
|
||
`).concat(+(Math.abs(c)>180),",").concat(+(o<=d),`,
|
||
`).concat(b.x,",").concat(b.y," Z")}else y+="L ".concat(n,",").concat(r," Z");return y},jle=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,d=t.startAngle,p=t.endAngle,m=Za(p-d),y=Zv({cx:n,cy:r,radius:a,angle:d,sign:m,cornerRadius:o,cornerIsExternal:c}),b=y.circleTangency,P=y.lineTangency,x=y.theta,w=Zv({cx:n,cy:r,radius:a,angle:p,sign:-m,cornerRadius:o,cornerIsExternal:c}),T=w.circleTangency,E=w.lineTangency,k=w.theta,D=c?Math.abs(d-p):Math.abs(d-p)-x-k;if(D<0)return s?"M ".concat(P.x,",").concat(P.y,`
|
||
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
||
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
||
`):Kz({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:d,endAngle:p});var I="M ".concat(P.x,",").concat(P.y,`
|
||
A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(b.x,",").concat(b.y,`
|
||
A`).concat(a,",").concat(a,",0,").concat(+(D>180),",").concat(+(m<0),",").concat(T.x,",").concat(T.y,`
|
||
A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(E.x,",").concat(E.y,`
|
||
`);if(i>0){var R=Zv({cx:n,cy:r,radius:i,angle:d,sign:m,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),$=R.circleTangency,V=R.lineTangency,K=R.theta,Z=Zv({cx:n,cy:r,radius:i,angle:p,sign:-m,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),ee=Z.circleTangency,ne=Z.lineTangency,oe=Z.theta,he=c?Math.abs(d-p):Math.abs(d-p)-K-oe;if(he<0&&o===0)return"".concat(I,"L").concat(n,",").concat(r,"Z");I+="L".concat(ne.x,",").concat(ne.y,`
|
||
A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(ee.x,",").concat(ee.y,`
|
||
A`).concat(i,",").concat(i,",0,").concat(+(he>180),",").concat(+(m>0),",").concat($.x,",").concat($.y,`
|
||
A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(V.x,",").concat(V.y,"Z")}else I+="L".concat(n,",").concat(r,"Z");return I},Ole={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Hz=function(t){var n=FD(FD({},Ole),t),r=n.cx,i=n.cy,a=n.innerRadius,o=n.outerRadius,s=n.cornerRadius,c=n.forceCornerRadius,d=n.cornerIsExternal,p=n.startAngle,m=n.endAngle,y=n.className;if(o<a||p===m)return null;var b=pn("recharts-sector",y),P=o-a,x=Ya(s,P,0,!0),w;return x>0&&Math.abs(p-m)<360?w=jle({cx:r,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(x,P/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:p,endAngle:m}):w=Kz({cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:p,endAngle:m}),ce.createElement("path",IO({},Jt(n,!0),{className:b,d:w,role:"img"}))};function Gm(e){"@babel/helpers - typeof";return Gm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gm(e)}function DO(){return DO=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},DO.apply(this,arguments)}function qD(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 zD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qD(Object(n),!0).forEach(function(r){Tle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tle(e,t,n){return t=Ele(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ele(e){var t=Ale(e,"string");return Gm(t)=="symbol"?t:t+""}function Ale(e,t){if(Gm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UD={curveBasisClosed:ZJ,curveBasisOpen:YJ,curveBasis:GJ,curveBumpX:RJ,curveBumpY:LJ,curveLinearClosed:XJ,curveLinear:bb,curveMonotoneX:QJ,curveMonotoneY:JJ,curveNatural:eee,curveStep:tee,curveStepAfter:ree,curveStepBefore:nee},Yv=function(t){return t.x===+t.x&&t.y===+t.y},Wp=function(t){return t.x},Kp=function(t){return t.y},kle=function(t,n){if(tn(t))return t;var r="curve".concat(vb(t));return(r==="curveMonotone"||r==="curveBump")&&n?UD["".concat(r).concat(n==="vertical"?"Y":"X")]:UD[r]||bb},Cle=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,a=i===void 0?[]:i,o=t.baseLine,s=t.layout,c=t.connectNulls,d=c===void 0?!1:c,p=kle(r,s),m=d?a.filter(function(x){return Yv(x)}):a,y;if(Array.isArray(o)){var b=d?o.filter(function(x){return Yv(x)}):o,P=m.map(function(x,w){return zD(zD({},x),{},{base:b[w]})});return s==="vertical"?y=qv().y(Kp).x1(Wp).x0(function(x){return x.base.x}):y=qv().x(Wp).y1(Kp).y0(function(x){return x.base.y}),y.defined(Yv).curve(p),y(P)}return s==="vertical"&&ct(o)?y=qv().y(Kp).x1(Wp).x0(o):ct(o)?y=qv().x(Wp).y1(Kp).y0(o):y=K5().x(Wp).y(Kp),y.defined(Yv).curve(p),y(m)},BO=function(t){var n=t.className,r=t.points,i=t.path,a=t.pathRef;if((!r||!r.length)&&!i)return null;var o=r&&r.length?Cle(t):i;return M.createElement("path",DO({},Jt(t,!1),Iy(t),{className:pn("recharts-curve",n),d:o,ref:a}))},mP={exports:{}},gP,VD;function Nle(){if(VD)return gP;VD=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gP=e,gP}var vP,WD;function Mle(){if(WD)return vP;WD=1;var e=Nle();function t(){}function n(){}return n.resetWarningCache=t,vP=function(){function r(o,s,c,d,p,m){if(m!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function i(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a},vP}var KD;function Rle(){return KD||(KD=1,mP.exports=Mle()()),mP.exports}var Lle=Rle();const Xn=In(Lle),{getOwnPropertyNames:Ile,getOwnPropertySymbols:Dle}=Object,{hasOwnProperty:Ble}=Object.prototype;function yP(e,t){return function(r,i,a){return e(r,i,a)&&t(r,i,a)}}function Xv(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:a}=i,o=a.get(n),s=a.get(r);if(o&&s)return o===r&&s===n;a.set(n,r),a.set(r,n);const c=e(n,r,i);return a.delete(n),a.delete(r),c}}function $le(e){return e!=null?e[Symbol.toStringTag]:void 0}function HD(e){return Ile(e).concat(Dle(e))}const Fle=Object.hasOwn||((e,t)=>Ble.call(e,t));function pd(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const qle="__v",zle="__o",Ule="_owner",{getOwnPropertyDescriptor:GD,keys:ZD}=Object;function Vle(e,t){return e.byteLength===t.byteLength&&c0(new Uint8Array(e),new Uint8Array(t))}function Wle(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Kle(e,t){return e.byteLength===t.byteLength&&c0(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Hle(e,t){return pd(e.getTime(),t.getTime())}function Gle(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Zle(e,t){return e===t}function YD(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),a=e.entries();let o,s,c=0;for(;(o=a.next())&&!o.done;){const d=t.entries();let p=!1,m=0;for(;(s=d.next())&&!s.done;){if(i[m]){m++;continue}const y=o.value,b=s.value;if(n.equals(y[0],b[0],c,m,e,t,n)&&n.equals(y[1],b[1],y[0],b[0],e,t,n)){p=i[m]=!0;break}m++}if(!p)return!1;c++}return!0}const Yle=pd;function Xle(e,t,n){const r=ZD(e);let i=r.length;if(ZD(t).length!==i)return!1;for(;i-- >0;)if(!Gz(e,t,n,r[i]))return!1;return!0}function Hp(e,t,n){const r=HD(e);let i=r.length;if(HD(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!Gz(e,t,n,a)||(o=GD(e,a),s=GD(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Qle(e,t){return pd(e.valueOf(),t.valueOf())}function Jle(e,t){return e.source===t.source&&e.flags===t.flags}function XD(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const c=t.values();let d=!1,p=0;for(;(s=c.next())&&!s.done;){if(!i[p]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){d=i[p]=!0;break}p++}if(!d)return!1}return!0}function c0(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function eue(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Gz(e,t,n,r){return(r===Ule||r===zle||r===qle)&&(e.$$typeof||t.$$typeof)?!0:Fle(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const tue="[object ArrayBuffer]",nue="[object Arguments]",rue="[object Boolean]",iue="[object DataView]",aue="[object Date]",oue="[object Error]",sue="[object Map]",lue="[object Number]",uue="[object Object]",cue="[object RegExp]",fue="[object Set]",due="[object String]",hue={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},pue="[object URL]",mue=Object.prototype.toString;function gue({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:d,areRegExpsEqual:p,areSetsEqual:m,areTypedArraysEqual:y,areUrlsEqual:b,unknownTagComparators:P}){return function(w,T,E){if(w===T)return!0;if(w==null||T==null)return!1;const k=typeof w;if(k!==typeof T)return!1;if(k!=="object")return k==="number"?s(w,T,E):k==="function"?a(w,T,E):!1;const D=w.constructor;if(D!==T.constructor)return!1;if(D===Object)return c(w,T,E);if(Array.isArray(w))return t(w,T,E);if(D===Date)return r(w,T,E);if(D===RegExp)return p(w,T,E);if(D===Map)return o(w,T,E);if(D===Set)return m(w,T,E);const I=mue.call(w);if(I===aue)return r(w,T,E);if(I===cue)return p(w,T,E);if(I===sue)return o(w,T,E);if(I===fue)return m(w,T,E);if(I===uue)return typeof w.then!="function"&&typeof T.then!="function"&&c(w,T,E);if(I===pue)return b(w,T,E);if(I===oue)return i(w,T,E);if(I===nue)return c(w,T,E);if(hue[I])return y(w,T,E);if(I===tue)return e(w,T,E);if(I===iue)return n(w,T,E);if(I===rue||I===lue||I===due)return d(w,T,E);if(P){let R=P[I];if(!R){const $=$le(w);$&&(R=P[$])}if(R)return R(w,T,E)}return!1}}function vue({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Vle,areArraysEqual:n?Hp:Wle,areDataViewsEqual:Kle,areDatesEqual:Hle,areErrorsEqual:Gle,areFunctionsEqual:Zle,areMapsEqual:n?yP(YD,Hp):YD,areNumbersEqual:Yle,areObjectsEqual:n?Hp:Xle,arePrimitiveWrappersEqual:Qle,areRegExpsEqual:Jle,areSetsEqual:n?yP(XD,Hp):XD,areTypedArraysEqual:n?yP(c0,Hp):c0,areUrlsEqual:eue,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=Xv(r.areArraysEqual),a=Xv(r.areMapsEqual),o=Xv(r.areObjectsEqual),s=Xv(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return r}function yue(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function bue({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(s,c){const{cache:d=e?new WeakMap:void 0,meta:p}=n();return t(s,c,{cache:d,equals:r,meta:p,strict:i})};if(e)return function(s,c){return t(s,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const a={cache:void 0,equals:r,meta:void 0,strict:i};return function(s,c){return t(s,c,a)}}const xue=Zc();Zc({strict:!0});Zc({circular:!0});Zc({circular:!0,strict:!0});Zc({createInternalComparator:()=>pd});Zc({strict:!0,createInternalComparator:()=>pd});Zc({circular:!0,createInternalComparator:()=>pd});Zc({circular:!0,createInternalComparator:()=>pd,strict:!0});function Zc(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=vue(e),o=gue(a),s=n?n(o):yue(o);return bue({circular:t,comparator:o,createState:r,equals:s,strict:i})}function wue(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function QD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>t?(e(a),n=-1):wue(i)};requestAnimationFrame(r)}function $O(e){"@babel/helpers - typeof";return $O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$O(e)}function _ue(e){return Oue(e)||jue(e)||Pue(e)||Sue()}function Sue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pue(e,t){if(e){if(typeof e=="string")return JD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JD(e,t)}}function JD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oue(e){if(Array.isArray(e))return e}function Tue(){var e={},t=function(){return null},n=!1,r=function i(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,s=_ue(o),c=s[0],d=s.slice(1);if(typeof c=="number"){QD(i.bind(null,d),c);return}i(c),QD(i.bind(null,d));return}$O(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){n=!0},start:function(a){n=!1,r(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function Zm(e){"@babel/helpers - typeof";return Zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zm(e)}function eB(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 tB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eB(Object(n),!0).forEach(function(r){Zz(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zz(e,t,n){return t=Eue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eue(e){var t=Aue(e,"string");return Zm(t)==="symbol"?t:String(t)}function Aue(e,t){if(Zm(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zm(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kue=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},Cue=function(t){return t},Nue=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},vm=function(t,n){return Object.keys(n).reduce(function(r,i){return tB(tB({},r),{},Zz({},i,t(i,n[i])))},{})},nB=function(t,n,r){return t.map(function(i){return"".concat(Nue(i)," ").concat(n,"ms ").concat(r)}).join(",")};function Mue(e,t){return Iue(e)||Lue(e,t)||Yz(e,t)||Rue()}function Rue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lue(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function Iue(e){if(Array.isArray(e))return e}function Due(e){return Fue(e)||$ue(e)||Yz(e)||Bue()}function Bue(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yz(e,t){if(e){if(typeof e=="string")return FO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FO(e,t)}}function $ue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fue(e){if(Array.isArray(e))return FO(e)}function FO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f0=1e-4,Xz=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},Qz=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},rB=function(t,n){return function(r){var i=Xz(t,n);return Qz(i,r)}},que=function(t,n){return function(r){var i=Xz(t,n),a=[].concat(Due(i.map(function(o,s){return o*s}).slice(1)),[0]);return Qz(a,r)}},iB=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],a=n[1],o=n[2],s=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,a=0,o=1,s=1;break;case"ease":i=.25,a=.1,o=.25,s=1;break;case"ease-in":i=.42,a=0,o=1,s=1;break;case"ease-out":i=.42,a=0,o=.58,s=1;break;case"ease-in-out":i=0,a=0,o=.58,s=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var d=c[1].split(")")[0].split(",").map(function(w){return parseFloat(w)}),p=Mue(d,4);i=p[0],a=p[1],o=p[2],s=p[3]}}}var m=rB(i,o),y=rB(a,s),b=que(i,o),P=function(T){return T>1?1:T<0?0:T},x=function(T){for(var E=T>1?1:T,k=E,D=0;D<8;++D){var I=m(k)-E,R=b(k);if(Math.abs(I-E)<f0||R<f0)return y(k);k=P(k-I/R)}return y(k)};return x.isStepper=!1,x},zue=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,c=function(p,m,y){var b=-(p-m)*r,P=y*a,x=y+(b-P)*s/1e3,w=y*s/1e3+p;return Math.abs(w-m)<f0&&Math.abs(x)<f0?[m,0]:[w,x]};return c.isStepper=!0,c.dt=s,c},Uue=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return iB(i);case"spring":return zue();default:if(i.split("(")[0]==="cubic-bezier")return iB(i)}return typeof i=="function"?i:null};function Ym(e){"@babel/helpers - typeof";return Ym=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ym(e)}function aB(e){return Kue(e)||Wue(e)||Jz(e)||Vue()}function Vue(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Kue(e){if(Array.isArray(e))return zO(e)}function oB(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 aa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oB(Object(n),!0).forEach(function(r){qO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qO(e,t,n){return t=Hue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hue(e){var t=Gue(e,"string");return Ym(t)==="symbol"?t:String(t)}function Gue(e,t){if(Ym(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ym(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zue(e,t){return Que(e)||Xue(e,t)||Jz(e,t)||Yue()}function Yue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jz(e,t){if(e){if(typeof e=="string")return zO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zO(e,t)}}function zO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xue(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function Que(e){if(Array.isArray(e))return e}var d0=function(t,n,r){return t+(n-t)*r},UO=function(t){var n=t.from,r=t.to;return n!==r},Jue=function e(t,n,r){var i=vm(function(a,o){if(UO(o)){var s=t(o.from,o.to,o.velocity),c=Zue(s,2),d=c[0],p=c[1];return aa(aa({},o),{},{from:d,velocity:p})}return o},n);return r<1?vm(function(a,o){return UO(o)?aa(aa({},o),{},{velocity:d0(o.velocity,i[a].velocity,r),from:d0(o.from,i[a].from,r)}):o},n):e(t,i,r-1)};const ece=(function(e,t,n,r,i){var a=kue(e,t),o=a.reduce(function(w,T){return aa(aa({},w),{},qO({},T,[e[T],t[T]]))},{}),s=a.reduce(function(w,T){return aa(aa({},w),{},qO({},T,{from:e[T],velocity:0,to:t[T]}))},{}),c=-1,d,p,m=function(){return null},y=function(){return vm(function(T,E){return E.from},s)},b=function(){return!Object.values(s).filter(UO).length},P=function(T){d||(d=T);var E=T-d,k=E/n.dt;s=Jue(n,s,k),i(aa(aa(aa({},e),t),y())),d=T,b()||(c=requestAnimationFrame(m))},x=function(T){p||(p=T);var E=(T-p)/r,k=vm(function(I,R){return d0.apply(void 0,aB(R).concat([n(E)]))},o);if(i(aa(aa(aa({},e),t),k)),E<1)c=requestAnimationFrame(m);else{var D=vm(function(I,R){return d0.apply(void 0,aB(R).concat([n(1)]))},o);i(aa(aa(aa({},e),t),D))}};return m=n.isStepper?P:x,function(){return requestAnimationFrame(m),function(){cancelAnimationFrame(c)}}});function Eh(e){"@babel/helpers - typeof";return Eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eh(e)}var tce=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function nce(e,t){if(e==null)return{};var n=rce(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rce(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function bP(e){return sce(e)||oce(e)||ace(e)||ice()}function ice(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ace(e,t){if(e){if(typeof e=="string")return VO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VO(e,t)}}function oce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sce(e){if(Array.isArray(e))return VO(e)}function VO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sB(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 Xs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sB(Object(n),!0).forEach(function(r){im(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function im(e,t,n){return t=e6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,e6(r.key),r)}}function cce(e,t,n){return t&&uce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function e6(e){var t=fce(e,"string");return Eh(t)==="symbol"?t:String(t)}function fce(e,t){if(Eh(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Eh(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WO(e,t)}function WO(e,t){return WO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},WO(e,t)}function hce(e){var t=pce();return function(){var r=h0(e),i;if(t){var a=h0(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return KO(this,i)}}function KO(e,t){if(t&&(Eh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HO(e)}function HO(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h0(e){return h0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},h0(e)}var Cu=(function(e){dce(n,e);var t=hce(n);function n(r,i){var a;lce(this,n),a=t.call(this,r,i);var o=a.props,s=o.isActive,c=o.attributeName,d=o.from,p=o.to,m=o.steps,y=o.children,b=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(HO(a)),a.changeStyle=a.changeStyle.bind(HO(a)),!s||b<=0)return a.state={style:{}},typeof y=="function"&&(a.state={style:p}),KO(a);if(m&&m.length)a.state={style:m[0].style};else if(d){if(typeof y=="function")return a.state={style:d},KO(a);a.state={style:c?im({},c,d):d}}else a.state={style:{}};return a}return cce(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,c=a.attributeName,d=a.shouldReAnimate,p=a.to,m=a.from,y=this.state.style;if(s){if(!o){var b={style:c?im({},c,p):p};this.state&&y&&(c&&y[c]!==p||!c&&y!==p)&&this.setState(b);return}if(!(xue(i.to,p)&&i.canBegin&&i.isActive)){var P=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var x=P||d?m:i.to;if(this.state&&y){var w={style:c?im({},c,x):x};(c&&y[c]!==x||!c&&y!==x)&&this.setState(w)}this.runAnimation(Xs(Xs({},this.props),{},{from:x,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,c=i.duration,d=i.easing,p=i.begin,m=i.onAnimationEnd,y=i.onAnimationStart,b=ece(o,s,Uue(d),c,this.changeStyle),P=function(){a.stopJSAnimation=b()};this.manager.start([y,p,P,c,m])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,c=i.onAnimationStart,d=o[0],p=d.style,m=d.duration,y=m===void 0?0:m,b=function(x,w,T){if(T===0)return x;var E=w.duration,k=w.easing,D=k===void 0?"ease":k,I=w.style,R=w.properties,$=w.onAnimationEnd,V=T>0?o[T-1]:w,K=R||Object.keys(I);if(typeof D=="function"||D==="spring")return[].concat(bP(x),[a.runJSAnimation.bind(a,{from:V.style,to:I,duration:E,easing:D}),E]);var Z=nB(K,E,D),ee=Xs(Xs(Xs({},V.style),I),{},{transition:Z});return[].concat(bP(x),[ee,E,$]).filter(Cue)};return this.manager.start([c].concat(bP(o.reduce(b,[p,Math.max(y,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=Tue());var a=i.begin,o=i.duration,s=i.attributeName,c=i.to,d=i.easing,p=i.onAnimationStart,m=i.onAnimationEnd,y=i.steps,b=i.children,P=this.manager;if(this.unSubscribe=P.subscribe(this.handleStyleChange),typeof d=="function"||typeof b=="function"||d==="spring"){this.runJSAnimation(i);return}if(y.length>1){this.runStepAnimation(i);return}var x=s?im({},s,c):c,w=nB(Object.keys(x),o,d);P.start([p,a,Xs(Xs({},x),{},{transition:w}),o,m])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=nce(i,tce),d=M.Children.count(a),p=this.state.style;if(typeof a=="function")return a(p);if(!s||d===0||o<=0)return a;var m=function(b){var P=b.props,x=P.style,w=x===void 0?{}:x,T=P.className,E=M.cloneElement(b,Xs(Xs({},c),{},{style:Xs(Xs({},w),p),className:T}));return E};return d===1?m(M.Children.only(a)):ce.createElement("div",null,M.Children.map(a,function(y){return m(y)}))}}]),n})(M.PureComponent);Cu.displayName="Animate";Cu.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Cu.propTypes={from:Xn.oneOfType([Xn.object,Xn.string]),to:Xn.oneOfType([Xn.object,Xn.string]),attributeName:Xn.string,duration:Xn.number,begin:Xn.number,easing:Xn.oneOfType([Xn.string,Xn.func]),steps:Xn.arrayOf(Xn.shape({duration:Xn.number.isRequired,style:Xn.object.isRequired,easing:Xn.oneOfType([Xn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Xn.func]),properties:Xn.arrayOf("string"),onAnimationEnd:Xn.func})),children:Xn.oneOfType([Xn.node,Xn.func]),isActive:Xn.bool,canBegin:Xn.bool,onAnimationEnd:Xn.func,shouldReAnimate:Xn.bool,onAnimationStart:Xn.func,onAnimationReStart:Xn.func};function Xm(e){"@babel/helpers - typeof";return Xm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xm(e)}function p0(){return p0=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},p0.apply(this,arguments)}function mce(e,t){return bce(e)||yce(e,t)||vce(e,t)||gce()}function gce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vce(e,t){if(e){if(typeof e=="string")return lB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lB(e,t)}}function lB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function bce(e){if(Array.isArray(e))return e}function uB(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 cB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uB(Object(n),!0).forEach(function(r){xce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xce(e,t,n){return t=wce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wce(e){var t=_ce(e,"string");return Xm(t)=="symbol"?t:t+""}function _ce(e,t){if(Xm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fB=function(t,n,r,i,a){var o=Math.min(Math.abs(r)/2,Math.abs(i)/2),s=i>=0?1:-1,c=r>=0?1:-1,d=i>=0&&r>=0||i<0&&r<0?1:0,p;if(o>0&&a instanceof Array){for(var m=[0,0,0,0],y=0,b=4;y<b;y++)m[y]=a[y]>o?o:a[y];p="M".concat(t,",").concat(n+s*m[0]),m[0]>0&&(p+="A ".concat(m[0],",").concat(m[0],",0,0,").concat(d,",").concat(t+c*m[0],",").concat(n)),p+="L ".concat(t+r-c*m[1],",").concat(n),m[1]>0&&(p+="A ".concat(m[1],",").concat(m[1],",0,0,").concat(d,`,
|
||
`).concat(t+r,",").concat(n+s*m[1])),p+="L ".concat(t+r,",").concat(n+i-s*m[2]),m[2]>0&&(p+="A ".concat(m[2],",").concat(m[2],",0,0,").concat(d,`,
|
||
`).concat(t+r-c*m[2],",").concat(n+i)),p+="L ".concat(t+c*m[3],",").concat(n+i),m[3]>0&&(p+="A ".concat(m[3],",").concat(m[3],",0,0,").concat(d,`,
|
||
`).concat(t,",").concat(n+i-s*m[3])),p+="Z"}else if(o>0&&a===+a&&a>0){var P=Math.min(o,a);p="M ".concat(t,",").concat(n+s*P,`
|
||
A `).concat(P,",").concat(P,",0,0,").concat(d,",").concat(t+c*P,",").concat(n,`
|
||
L `).concat(t+r-c*P,",").concat(n,`
|
||
A `).concat(P,",").concat(P,",0,0,").concat(d,",").concat(t+r,",").concat(n+s*P,`
|
||
L `).concat(t+r,",").concat(n+i-s*P,`
|
||
A `).concat(P,",").concat(P,",0,0,").concat(d,",").concat(t+r-c*P,",").concat(n+i,`
|
||
L `).concat(t+c*P,",").concat(n+i,`
|
||
A `).concat(P,",").concat(P,",0,0,").concat(d,",").concat(t,",").concat(n+i-s*P," Z")}else p="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return p},Sce=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,a=n.x,o=n.y,s=n.width,c=n.height;if(Math.abs(s)>0&&Math.abs(c)>0){var d=Math.min(a,a+s),p=Math.max(a,a+s),m=Math.min(o,o+c),y=Math.max(o,o+c);return r>=d&&r<=p&&i>=m&&i<=y}return!1},Pce={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yA=function(t){var n=cB(cB({},Pce),t),r=M.useRef(),i=M.useState(-1),a=mce(i,2),o=a[0],s=a[1];M.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var D=r.current.getTotalLength();D&&s(D)}catch{}},[]);var c=n.x,d=n.y,p=n.width,m=n.height,y=n.radius,b=n.className,P=n.animationEasing,x=n.animationDuration,w=n.animationBegin,T=n.isAnimationActive,E=n.isUpdateAnimationActive;if(c!==+c||d!==+d||p!==+p||m!==+m||p===0||m===0)return null;var k=pn("recharts-rectangle",b);return E?ce.createElement(Cu,{canBegin:o>0,from:{width:p,height:m,x:c,y:d},to:{width:p,height:m,x:c,y:d},duration:x,animationEasing:P,isActive:E},function(D){var I=D.width,R=D.height,$=D.x,V=D.y;return ce.createElement(Cu,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:x,isActive:T,easing:P},ce.createElement("path",p0({},Jt(n,!0),{className:k,d:fB($,V,I,R,y),ref:r})))}):ce.createElement("path",p0({},Jt(n,!0),{className:k,d:fB(c,d,p,m,y)}))},jce=["points","className","baseLinePoints","connectNulls"];function qd(){return qd=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},qd.apply(this,arguments)}function Oce(e,t){if(e==null)return{};var n=Tce(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Tce(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 dB(e){return Cce(e)||kce(e)||Ace(e)||Ece()}function Ece(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ace(e,t){if(e){if(typeof e=="string")return GO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GO(e,t)}}function kce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cce(e){if(Array.isArray(e))return GO(e)}function GO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hB=function(t){return t&&t.x===+t.x&&t.y===+t.y},Nce=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){hB(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),hB(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},ym=function(t,n){var r=Nce(t);n&&(r=[r.reduce(function(a,o){return[].concat(dB(a),dB(o))},[])]);var i=r.map(function(a){return a.reduce(function(o,s,c){return"".concat(o).concat(c===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},Mce=function(t,n,r){var i=ym(t,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(ym(n.reverse(),r).slice(1))},Rce=function(t){var n=t.points,r=t.className,i=t.baseLinePoints,a=t.connectNulls,o=Oce(t,jce);if(!n||!n.length)return null;var s=pn("recharts-polygon",r);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",d=Mce(n,i,a);return ce.createElement("g",{className:s},ce.createElement("path",qd({},Jt(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",stroke:"none",d})),c?ce.createElement("path",qd({},Jt(o,!0),{fill:"none",d:ym(n,a)})):null,c?ce.createElement("path",qd({},Jt(o,!0),{fill:"none",d:ym(i,a)})):null)}var p=ym(n,a);return ce.createElement("path",qd({},Jt(o,!0),{fill:p.slice(-1)==="Z"?o.fill:"none",className:s,d:p}))};function ZO(){return ZO=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},ZO.apply(this,arguments)}var bA=function(t){var n=t.cx,r=t.cy,i=t.r,a=t.className,o=pn("recharts-dot",a);return n===+n&&r===+r&&i===+i?M.createElement("circle",ZO({},Jt(t,!1),Iy(t),{className:o,cx:n,cy:r,r:i})):null};function Qm(e){"@babel/helpers - typeof";return Qm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qm(e)}var Lce=["x","y","top","left","width","height","className"];function YO(){return YO=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},YO.apply(this,arguments)}function pB(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 Ice(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pB(Object(n),!0).forEach(function(r){Dce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dce(e,t,n){return t=Bce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bce(e){var t=$ce(e,"string");return Qm(t)=="symbol"?t:t+""}function $ce(e,t){if(Qm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fce(e,t){if(e==null)return{};var n=qce(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qce(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}var zce=function(t,n,r,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(n,"h").concat(r)},Uce=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,c=t.left,d=c===void 0?0:c,p=t.width,m=p===void 0?0:p,y=t.height,b=y===void 0?0:y,P=t.className,x=Fce(t,Lce),w=Ice({x:r,y:a,top:s,left:d,width:m,height:b},x);return!ct(r)||!ct(a)||!ct(m)||!ct(b)||!ct(s)||!ct(d)?null:ce.createElement("path",YO({},Jt(w,!0),{className:pn("recharts-cross",P),d:zce(r,a,m,b,s,d)}))},xP,mB;function Vce(){if(mB)return xP;mB=1;var e=kb(),t=mz(),n=Hl();function r(i,a){return i&&i.length?e(i,n(a,2),t):void 0}return xP=r,xP}var Wce=Vce();const Kce=In(Wce);var wP,gB;function Hce(){if(gB)return wP;gB=1;var e=kb(),t=Hl(),n=gz();function r(i,a){return i&&i.length?e(i,t(a,2),n):void 0}return wP=r,wP}var Gce=Hce();const Zce=In(Gce);var Yce=["cx","cy","angle","ticks","axisLine"],Xce=["ticks","tick","angle","tickFormatter","stroke"];function Ah(e){"@babel/helpers - typeof";return Ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ah(e)}function bm(){return bm=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},bm.apply(this,arguments)}function vB(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 vf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vB(Object(n),!0).forEach(function(r){Db(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yB(e,t){if(e==null)return{};var n=Qce(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qce(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 Jce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n6(r.key),r)}}function efe(e,t,n){return t&&bB(e.prototype,t),n&&bB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tfe(e,t,n){return t=m0(t),nfe(e,t6()?Reflect.construct(t,n||[],m0(e).constructor):t.apply(e,n))}function nfe(e,t){if(t&&(Ah(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rfe(e)}function rfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t6=function(){return!!e})()}function m0(e){return m0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},m0(e)}function ife(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&XO(e,t)}function XO(e,t){return XO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},XO(e,t)}function Db(e,t,n){return t=n6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n6(e){var t=afe(e,"string");return Ah(t)=="symbol"?t:t+""}function afe(e,t){if(Ah(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ah(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bb=(function(e){function t(){return Jce(this,t),tfe(this,t,arguments)}return ife(t,e),efe(t,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,a=this.props,o=a.angle,s=a.cx,c=a.cy;return gr(s,c,i,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.angle,s=r.ticks,c=Kce(s,function(p){return p.coordinate||0}),d=Zce(s,function(p){return p.coordinate||0});return{cx:i,cy:a,startAngle:o,endAngle:o,innerRadius:d.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.angle,s=r.ticks,c=r.axisLine,d=yB(r,Yce),p=s.reduce(function(P,x){return[Math.min(P[0],x.coordinate),Math.max(P[1],x.coordinate)]},[1/0,-1/0]),m=gr(i,a,p[0],o),y=gr(i,a,p[1],o),b=vf(vf(vf({},Jt(d,!1)),{},{fill:"none"},Jt(c,!1)),{},{x1:m.x,y1:m.y,x2:y.x,y2:y.y});return ce.createElement("line",bm({className:"recharts-polar-radius-axis-line"},b))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.angle,c=i.tickFormatter,d=i.stroke,p=yB(i,Xce),m=this.getTickTextAnchor(),y=Jt(p,!1),b=Jt(o,!1),P=a.map(function(x,w){var T=r.getTickValueCoord(x),E=vf(vf(vf(vf({textAnchor:m,transform:"rotate(".concat(90-s,", ").concat(T.x,", ").concat(T.y,")")},y),{},{stroke:"none",fill:d},b),{},{index:w},T),{},{payload:x});return ce.createElement(tr,bm({className:pn("recharts-polar-radius-axis-tick",Vz(o)),key:"tick-".concat(x.coordinate)},Qf(r.props,x,w)),t.renderTickItem(o,E,c?c(x.value,w):x.value))});return ce.createElement(tr,{className:"recharts-polar-radius-axis-ticks"},P)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.axisLine,o=r.tick;return!i||!i.length?null:ce.createElement(tr,{className:pn("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),Ui.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,a){var o;return ce.isValidElement(r)?o=ce.cloneElement(r,i):tn(r)?o=r(i):o=ce.createElement(Jf,bm({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])})(M.PureComponent);Db(Bb,"displayName","PolarRadiusAxis");Db(Bb,"axisType","radiusAxis");Db(Bb,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function kh(e){"@babel/helpers - typeof";return kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kh(e)}function jf(){return jf=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},jf.apply(this,arguments)}function xB(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 yf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xB(Object(n),!0).forEach(function(r){$b(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ofe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i6(r.key),r)}}function sfe(e,t,n){return t&&wB(e.prototype,t),n&&wB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lfe(e,t,n){return t=g0(t),ufe(e,r6()?Reflect.construct(t,n||[],g0(e).constructor):t.apply(e,n))}function ufe(e,t){if(t&&(kh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cfe(e)}function cfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r6=function(){return!!e})()}function g0(e){return g0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},g0(e)}function ffe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QO(e,t)}function QO(e,t){return QO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},QO(e,t)}function $b(e,t,n){return t=i6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i6(e){var t=dfe(e,"string");return kh(t)=="symbol"?t:t+""}function dfe(e,t){if(kh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hfe=Math.PI/180,_B=1e-5,Fb=(function(e){function t(){return ofe(this,t),lfe(this,t,arguments)}return ffe(t,e),sfe(t,[{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.cx,o=i.cy,s=i.radius,c=i.orientation,d=i.tickSize,p=d||8,m=gr(a,o,s,r.coordinate),y=gr(a,o,s+(c==="inner"?-1:1)*p,r.coordinate);return{x1:m.x,y1:m.y,x2:y.x,y2:y.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,a=Math.cos(-r.coordinate*hfe),o;return a>_B?o=i==="outer"?"start":"end":a<-_B?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.radius,s=r.axisLine,c=r.axisLineType,d=yf(yf({},Jt(this.props,!1)),{},{fill:"none"},Jt(s,!1));if(c==="circle")return ce.createElement(bA,jf({className:"recharts-polar-angle-axis-line"},d,{cx:i,cy:a,r:o}));var p=this.props.ticks,m=p.map(function(y){return gr(i,a,o,y.coordinate)});return ce.createElement(Rce,jf({className:"recharts-polar-angle-axis-line"},d,{points:m}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,c=i.tickFormatter,d=i.stroke,p=Jt(this.props,!1),m=Jt(o,!1),y=yf(yf({},p),{},{fill:"none"},Jt(s,!1)),b=a.map(function(P,x){var w=r.getTickLineCoord(P),T=r.getTickTextAnchor(P),E=yf(yf(yf({textAnchor:T},p),{},{stroke:"none",fill:d},m),{},{index:x,payload:P,x:w.x2,y:w.y2});return ce.createElement(tr,jf({className:pn("recharts-polar-angle-axis-tick",Vz(o)),key:"tick-".concat(P.coordinate)},Qf(r.props,P,x)),s&&ce.createElement("line",jf({className:"recharts-polar-angle-axis-tick-line"},y,w)),o&&t.renderTickItem(o,E,c?c(P.value,x):P.value))});return ce.createElement(tr,{className:"recharts-polar-angle-axis-ticks"},b)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!i||!i.length?null:ce.createElement(tr,{className:pn("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return ce.isValidElement(r)?o=ce.cloneElement(r,i):tn(r)?o=r(i):o=ce.createElement(Jf,jf({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(M.PureComponent);$b(Fb,"displayName","PolarAngleAxis");$b(Fb,"axisType","angleAxis");$b(Fb,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var _P,SB;function pfe(){if(SB)return _P;SB=1;var e=mq(),t=e(Object.getPrototypeOf,Object);return _P=t,_P}var SP,PB;function mfe(){if(PB)return SP;PB=1;var e=Iu(),t=pfe(),n=Du(),r="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,s=a.hasOwnProperty,c=o.call(Object);function d(p){if(!n(p)||e(p)!=r)return!1;var m=t(p);if(m===null)return!0;var y=s.call(m,"constructor")&&m.constructor;return typeof y=="function"&&y instanceof y&&o.call(y)==c}return SP=d,SP}var gfe=mfe();const vfe=In(gfe);var PP,jB;function yfe(){if(jB)return PP;jB=1;var e=Iu(),t=Du(),n="[object Boolean]";function r(i){return i===!0||i===!1||t(i)&&e(i)==n}return PP=r,PP}var bfe=yfe();const xfe=In(bfe);function Jm(e){"@babel/helpers - typeof";return Jm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jm(e)}function v0(){return v0=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},v0.apply(this,arguments)}function wfe(e,t){return jfe(e)||Pfe(e,t)||Sfe(e,t)||_fe()}function _fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sfe(e,t){if(e){if(typeof e=="string")return OB(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OB(e,t)}}function OB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pfe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function jfe(e){if(Array.isArray(e))return e}function TB(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 EB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TB(Object(n),!0).forEach(function(r){Ofe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ofe(e,t,n){return t=Tfe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tfe(e){var t=Efe(e,"string");return Jm(t)=="symbol"?t:t+""}function Efe(e,t){if(Jm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AB=function(t,n,r,i,a){var o=r-i,s;return s="M ".concat(t,",").concat(n),s+="L ".concat(t+r,",").concat(n),s+="L ".concat(t+r-o/2,",").concat(n+a),s+="L ".concat(t+r-o/2-i,",").concat(n+a),s+="L ".concat(t,",").concat(n," Z"),s},Afe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},kfe=function(t){var n=EB(EB({},Afe),t),r=M.useRef(),i=M.useState(-1),a=wfe(i,2),o=a[0],s=a[1];M.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var k=r.current.getTotalLength();k&&s(k)}catch{}},[]);var c=n.x,d=n.y,p=n.upperWidth,m=n.lowerWidth,y=n.height,b=n.className,P=n.animationEasing,x=n.animationDuration,w=n.animationBegin,T=n.isUpdateAnimationActive;if(c!==+c||d!==+d||p!==+p||m!==+m||y!==+y||p===0&&m===0||y===0)return null;var E=pn("recharts-trapezoid",b);return T?ce.createElement(Cu,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:y,x:c,y:d},to:{upperWidth:p,lowerWidth:m,height:y,x:c,y:d},duration:x,animationEasing:P,isActive:T},function(k){var D=k.upperWidth,I=k.lowerWidth,R=k.height,$=k.x,V=k.y;return ce.createElement(Cu,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:x,easing:P},ce.createElement("path",v0({},Jt(n,!0),{className:E,d:AB($,V,D,I,R),ref:r})))}):ce.createElement("g",null,ce.createElement("path",v0({},Jt(n,!0),{className:E,d:AB(c,d,p,m,y)})))},Cfe=["option","shapeType","propTransformer","activeClassName","isActive"];function eg(e){"@babel/helpers - typeof";return eg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eg(e)}function Nfe(e,t){if(e==null)return{};var n=Mfe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mfe(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 kB(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 y0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kB(Object(n),!0).forEach(function(r){Rfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rfe(e,t,n){return t=Lfe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lfe(e){var t=Ife(e,"string");return eg(t)=="symbol"?t:t+""}function Ife(e,t){if(eg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(eg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dfe(e,t){return y0(y0({},t),e)}function Bfe(e,t){return e==="symbols"}function CB(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return ce.createElement(yA,n);case"trapezoid":return ce.createElement(kfe,n);case"sector":return ce.createElement(Hz,n);case"symbols":if(Bfe(t))return ce.createElement(DE,n);break;default:return null}}function $fe(e){return M.isValidElement(e)?e.props:e}function a6(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?Dfe:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,s=e.isActive,c=Nfe(e,Cfe),d;if(M.isValidElement(t))d=M.cloneElement(t,y0(y0({},c),$fe(t)));else if(tn(t))d=t(c);else if(vfe(t)&&!xfe(t)){var p=i(t,c);d=ce.createElement(CB,{shapeType:n,elementProps:p})}else{var m=c;d=ce.createElement(CB,{shapeType:n,elementProps:m})}return s?ce.createElement(tr,{className:o},d):d}function qb(e,t){return t!=null&&"trapezoids"in e.props}function zb(e,t){return t!=null&&"sectors"in e.props}function tg(e,t){return t!=null&&"points"in e.props}function Ffe(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&a}function qfe(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function zfe(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function Ufe(e,t){var n;return qb(e,t)?n=Ffe:zb(e,t)?n=qfe:tg(e,t)&&(n=zfe),n}function Vfe(e,t){var n;return qb(e,t)?n="trapezoids":zb(e,t)?n="sectors":tg(e,t)&&(n="points"),n}function Wfe(e,t){if(qb(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(zb(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return tg(e,t)?t.payload:{}}function Kfe(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=Vfe(n,t),a=Wfe(n,t),o=r.filter(function(c,d){var p=Mb(a,c),m=n.props[i].filter(function(P){var x=Ufe(n,t);return x(P,t)}),y=n.props[i].indexOf(m[m.length-1]),b=d===y;return p&&b}),s=r.indexOf(o[o.length-1]);return s}var wy;function Ch(e){"@babel/helpers - typeof";return Ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ch(e)}function zd(){return zd=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},zd.apply(this,arguments)}function NB(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 pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NB(Object(n),!0).forEach(function(r){_s(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s6(r.key),r)}}function Gfe(e,t,n){return t&&MB(e.prototype,t),n&&MB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zfe(e,t,n){return t=b0(t),Yfe(e,o6()?Reflect.construct(t,n||[],b0(e).constructor):t.apply(e,n))}function Yfe(e,t){if(t&&(Ch(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xfe(e)}function Xfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o6=function(){return!!e})()}function b0(e){return b0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},b0(e)}function Qfe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JO(e,t)}function JO(e,t){return JO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},JO(e,t)}function _s(e,t,n){return t=s6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s6(e){var t=Jfe(e,"string");return Ch(t)=="symbol"?t:t+""}function Jfe(e,t){if(Ch(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ch(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Gl=(function(e){function t(n){var r;return Hfe(this,t),r=Zfe(this,t,[n]),_s(r,"pieRef",null),_s(r,"sectorRefs",[]),_s(r,"id",kg("recharts-pie-")),_s(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),tn(i)&&i()}),_s(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),tn(i)&&i()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Qfe(t,e),Gfe(t,[{key:"isActiveIndex",value:function(r){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(r)!==-1:r===i}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.label,s=a.labelLine,c=a.dataKey,d=a.valueKey,p=Jt(this.props,!1),m=Jt(o,!1),y=Jt(s,!1),b=o&&o.offsetRadius||20,P=r.map(function(x,w){var T=(x.startAngle+x.endAngle)/2,E=gr(x.cx,x.cy,x.outerRadius+b,T),k=pr(pr(pr(pr({},p),x),{},{stroke:"none"},m),{},{index:w,textAnchor:t.getTextAnchor(E.x,x.cx)},E),D=pr(pr(pr(pr({},p),x),{},{fill:"none",stroke:x.fill},y),{},{index:w,points:[gr(x.cx,x.cy,x.outerRadius,T),E]}),I=c;return _n(c)&&_n(d)?I="value":_n(c)&&(I=d),ce.createElement(tr,{key:"label-".concat(x.startAngle,"-").concat(x.endAngle,"-").concat(x.midAngle,"-").concat(w)},s&&t.renderLabelLineItem(s,D,"line"),t.renderLabelItem(o,k,Aa(x,I)))});return ce.createElement(tr,{className:"recharts-pie-labels"},P)}},{key:"renderSectorsStatically",value:function(r){var i=this,a=this.props,o=a.activeShape,s=a.blendStroke,c=a.inactiveShape;return r.map(function(d,p){if((d==null?void 0:d.startAngle)===0&&(d==null?void 0:d.endAngle)===0&&r.length!==1)return null;var m=i.isActiveIndex(p),y=c&&i.hasActiveIndex()?c:null,b=m?o:y,P=pr(pr({},d),{},{stroke:s?d.fill:d.stroke,tabIndex:-1});return ce.createElement(tr,zd({ref:function(w){w&&!i.sectorRefs.includes(w)&&i.sectorRefs.push(w)},tabIndex:-1,className:"recharts-pie-sector"},Qf(i.props,d,p),{key:"sector-".concat(d==null?void 0:d.startAngle,"-").concat(d==null?void 0:d.endAngle,"-").concat(d.midAngle,"-").concat(p)}),ce.createElement(a6,zd({option:b,isActive:m,shapeType:"sector"},P)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,i=this.props,a=i.sectors,o=i.isAnimationActive,s=i.animationBegin,c=i.animationDuration,d=i.animationEasing,p=i.animationId,m=this.state,y=m.prevSectors,b=m.prevIsAnimationActive;return ce.createElement(Cu,{begin:s,duration:c,isActive:o,easing:d,from:{t:0},to:{t:1},key:"pie-".concat(p,"-").concat(b),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(P){var x=P.t,w=[],T=a&&a[0],E=T.startAngle;return a.forEach(function(k,D){var I=y&&y[D],R=D>0?Uo(k,"paddingAngle",0):0;if(I){var $=hc(I.endAngle-I.startAngle,k.endAngle-k.startAngle),V=pr(pr({},k),{},{startAngle:E+R,endAngle:E+$(x)+R});w.push(V),E=V.endAngle}else{var K=k.endAngle,Z=k.startAngle,ee=hc(0,K-Z),ne=ee(x),oe=pr(pr({},k),{},{startAngle:E+R,endAngle:E+ne+R});w.push(oe),E=oe.endAngle}}),ce.createElement(tr,null,r.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,a=r.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Mb(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,c=i.label,d=i.cx,p=i.cy,m=i.innerRadius,y=i.outerRadius,b=i.isAnimationActive,P=this.state.isAnimationFinished;if(a||!o||!o.length||!ct(d)||!ct(p)||!ct(m)||!ct(y))return null;var x=pn("recharts-pie",s);return ce.createElement(tr,{tabIndex:this.props.rootTabIndex,className:x,ref:function(T){r.pieRef=T}},this.renderSectors(),c&&this.renderLabels(o),Ui.renderCallByParent(this.props,null,!1),(!b||P)&&Mc.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,i,a){if(ce.isValidElement(r))return ce.cloneElement(r,i);if(tn(r))return r(i);var o=pn("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return ce.createElement(BO,zd({},i,{key:a,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,i,a){if(ce.isValidElement(r))return ce.cloneElement(r,i);var o=a;if(tn(r)&&(o=r(i),ce.isValidElement(o)))return o;var s=pn("recharts-pie-label-text",typeof r!="boolean"&&!tn(r)?r.className:"");return ce.createElement(Jf,zd({},i,{alignmentBaseline:"middle",className:s}),o)}}])})(M.PureComponent);wy=Gl;_s(Gl,"displayName","Pie");_s(Gl,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!ap.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});_s(Gl,"parseDeltaAngle",function(e,t){var n=Za(t-e),r=Math.min(Math.abs(t-e),360);return n*r});_s(Gl,"getRealPieData",function(e){var t=e.data,n=e.children,r=Jt(e,!1),i=Os(n,Sh);return t&&t.length?t.map(function(a,o){return pr(pr(pr({payload:a},r),a),i&&i[o]&&i[o].props)}):i&&i.length?i.map(function(a){return pr(pr({},r),a.props)}):[]});_s(Gl,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,o=Uz(i,a),s=r+Ya(e.cx,i,i/2),c=n+Ya(e.cy,a,a/2),d=Ya(e.innerRadius,o,0),p=Ya(e.outerRadius,o,o*.8),m=e.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:s,cy:c,innerRadius:d,outerRadius:p,maxRadius:m}});_s(Gl,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?pr(pr({},t.type.defaultProps),t.props):t.props,i=wy.getRealPieData(r);if(!i||!i.length)return null;var a=r.cornerRadius,o=r.startAngle,s=r.endAngle,c=r.paddingAngle,d=r.dataKey,p=r.nameKey,m=r.valueKey,y=r.tooltipType,b=Math.abs(r.minAngle),P=wy.parseCoordinateOfPie(r,n),x=wy.parseDeltaAngle(o,s),w=Math.abs(x),T=d;_n(d)&&_n(m)?(cl(!1,`Use "dataKey" to specify the value of pie,
|
||
the props "valueKey" will be deprecated in 1.1.0`),T="value"):_n(d)&&(cl(!1,`Use "dataKey" to specify the value of pie,
|
||
the props "valueKey" will be deprecated in 1.1.0`),T=m);var E=i.filter(function(V){return Aa(V,T,0)!==0}).length,k=(w>=360?E:E-1)*c,D=w-E*b-k,I=i.reduce(function(V,K){var Z=Aa(K,T,0);return V+(ct(Z)?Z:0)},0),R;if(I>0){var $;R=i.map(function(V,K){var Z=Aa(V,T,0),ee=Aa(V,p,K),ne=(ct(Z)?Z:0)/I,oe;K?oe=$.endAngle+Za(x)*c*(Z!==0?1:0):oe=o;var he=oe+Za(x)*((Z!==0?b:0)+ne*D),Se=(oe+he)/2,fe=(P.innerRadius+P.outerRadius)/2,Oe=[{name:ee,value:Z,payload:V,dataKey:T,type:y}],re=gr(P.cx,P.cy,fe,Se);return $=pr(pr(pr({percent:ne,cornerRadius:a,name:ee,tooltipPayload:Oe,midAngle:Se,middleRadius:fe,tooltipPosition:re},V),P),{},{value:Aa(V,T),startAngle:oe,endAngle:he,payload:V,paddingAngle:Za(x)*c}),$})}return pr(pr({},P),{},{sectors:R,data:i})});var jP,RB;function ede(){if(RB)return jP;RB=1;var e=Math.ceil,t=Math.max;function n(r,i,a,o){for(var s=-1,c=t(e((i-r)/(a||1)),0),d=Array(c);c--;)d[o?c:++s]=r,r+=a;return d}return jP=n,jP}var OP,LB;function l6(){if(LB)return OP;LB=1;var e=Cq(),t=1/0,n=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var a=i<0?-1:1;return a*n}return i===i?i:0}return OP=r,OP}var TP,IB;function tde(){if(IB)return TP;IB=1;var e=ede(),t=Sb(),n=l6();function r(i){return function(a,o,s){return s&&typeof s!="number"&&t(a,o,s)&&(o=s=void 0),a=n(a),o===void 0?(o=a,a=0):o=n(o),s=s===void 0?a<o?1:-1:n(s),e(a,o,s,i)}}return TP=r,TP}var EP,DB;function nde(){if(DB)return EP;DB=1;var e=tde(),t=e();return EP=t,EP}var rde=nde();const x0=In(rde);function ng(e){"@babel/helpers - typeof";return ng=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ng(e)}function BB(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 $B(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BB(Object(n),!0).forEach(function(r){u6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u6(e,t,n){return t=ide(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ide(e){var t=ade(e,"string");return ng(t)=="symbol"?t:t+""}function ade(e,t){if(ng(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ng(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ode=["Webkit","Moz","O","ms"],sde=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=ode.reduce(function(a,o){return $B($B({},a),{},u6({},o+r,n))},{});return i[t]=n,i};function Nh(e){"@babel/helpers - typeof";return Nh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nh(e)}function w0(){return w0=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},w0.apply(this,arguments)}function FB(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 AP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FB(Object(n),!0).forEach(function(r){Bo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f6(r.key),r)}}function ude(e,t,n){return t&&qB(e.prototype,t),n&&qB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cde(e,t,n){return t=_0(t),fde(e,c6()?Reflect.construct(t,n||[],_0(e).constructor):t.apply(e,n))}function fde(e,t){if(t&&(Nh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dde(e)}function dde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c6=function(){return!!e})()}function _0(e){return _0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_0(e)}function hde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eT(e,t)}function eT(e,t){return eT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},eT(e,t)}function Bo(e,t,n){return t=f6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f6(e){var t=pde(e,"string");return Nh(t)=="symbol"?t:t+""}function pde(e,t){if(Nh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mde=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,a=t.x,o=t.width,s=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,d=mm().domain(x0(0,c)).range([a,a+o-s]),p=d.domain().map(function(m){return d(m)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(r),endX:d(i),scale:d,scaleValues:p}},zB=function(t){return t.changedTouches&&!!t.changedTouches.length},Mh=(function(e){function t(n){var r;return lde(this,t),r=cde(this,t,[n]),Bo(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Bo(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Bo(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),r.detachDragEndListener()}),Bo(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Bo(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Bo(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Bo(r,"handleSlideDragStart",function(i){var a=zB(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return hde(t,e),ude(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,o=this.state.scaleValues,s=this.props,c=s.gap,d=s.data,p=d.length-1,m=Math.min(i,a),y=Math.max(i,a),b=t.getIndexInRange(o,m),P=t.getIndexInRange(o,y);return{startIndex:b-b%c,endIndex:P===p?p:P-P%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,c=Aa(a[r],s,r);return tn(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,c=this.props,d=c.x,p=c.width,m=c.travellerWidth,y=c.startIndex,b=c.endIndex,P=c.onChange,x=r.pageX-a;x>0?x=Math.min(x,d+p-m-s,d+p-m-o):x<0&&(x=Math.max(x,d-o,d-s));var w=this.getIndex({startX:o+x,endX:s+x});(w.startIndex!==y||w.endIndex!==b)&&P&&P(w),this.setState({startX:o+x,endX:s+x,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=zB(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,c=i.startX,d=this.state[o],p=this.props,m=p.x,y=p.width,b=p.travellerWidth,P=p.onChange,x=p.gap,w=p.data,T={startX:this.state.startX,endX:this.state.endX},E=r.pageX-a;E>0?E=Math.min(E,m+y-b-d):E<0&&(E=Math.max(E,m-d)),T[o]=d+E;var k=this.getIndex(T),D=k.startIndex,I=k.endIndex,R=function(){var V=w.length-1;return o==="startX"&&(s>c?D%x===0:I%x===0)||s<c&&I===V||o==="endX"&&(s>c?I%x===0:D%x===0)||s>c&&I===V};this.setState(Bo(Bo({},o,d+E),"brushMoveStartX",r.pageX),function(){P&&R()&&P(k)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,o=this.state,s=o.scaleValues,c=o.startX,d=o.endX,p=this.state[i],m=s.indexOf(p);if(m!==-1){var y=m+r;if(!(y===-1||y>=s.length)){var b=s[y];i==="startX"&&b>=d||i==="endX"&&b<=c||this.setState(Bo({},i,b),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,c=r.fill,d=r.stroke;return ce.createElement("rect",{stroke:d,fill:c,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,c=r.data,d=r.children,p=r.padding,m=M.Children.only(d);return m?ce.cloneElement(m,{x:i,y:a,width:o,height:s,margin:p,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var a,o,s=this,c=this.props,d=c.y,p=c.travellerWidth,m=c.height,y=c.traveller,b=c.ariaLabel,P=c.data,x=c.startIndex,w=c.endIndex,T=Math.max(r,this.props.x),E=AP(AP({},Jt(this.props,!1)),{},{x:T,y:d,width:p,height:m}),k=b||"Min value: ".concat((a=P[x])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=P[w])===null||o===void 0?void 0:o.name);return ce.createElement(tr,{tabIndex:0,role:"slider","aria-label":k,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(I){["ArrowLeft","ArrowRight"].includes(I.key)&&(I.preventDefault(),I.stopPropagation(),s.handleTravellerMoveKeyboard(I.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(y,E))}},{key:"renderSlide",value:function(r,i){var a=this.props,o=a.y,s=a.height,c=a.stroke,d=a.travellerWidth,p=Math.min(r,i)+d,m=Math.max(Math.abs(i-r)-d,0);return ce.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:p,y:o,width:m,height:s})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,a=r.endIndex,o=r.y,s=r.height,c=r.travellerWidth,d=r.stroke,p=this.state,m=p.startX,y=p.endX,b=5,P={pointerEvents:"none",fill:d};return ce.createElement(tr,{className:"recharts-brush-texts"},ce.createElement(Jf,w0({textAnchor:"end",verticalAnchor:"middle",x:Math.min(m,y)-b,y:o+s/2},P),this.getTextOfTick(i)),ce.createElement(Jf,w0({textAnchor:"start",verticalAnchor:"middle",x:Math.max(m,y)+c+b,y:o+s/2},P),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=r.className,o=r.children,s=r.x,c=r.y,d=r.width,p=r.height,m=r.alwaysShowText,y=this.state,b=y.startX,P=y.endX,x=y.isTextActive,w=y.isSlideMoving,T=y.isTravellerMoving,E=y.isTravellerFocused;if(!i||!i.length||!ct(s)||!ct(c)||!ct(d)||!ct(p)||d<=0||p<=0)return null;var k=pn("recharts-brush",a),D=ce.Children.count(o)===1,I=sde("userSelect","none");return ce.createElement(tr,{className:k,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:I},this.renderBackground(),D&&this.renderPanorama(),this.renderSlide(b,P),this.renderTravellerLayer(b,"startX"),this.renderTravellerLayer(P,"endX"),(x||w||T||E||m)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,o=r.width,s=r.height,c=r.stroke,d=Math.floor(a+s/2)-1;return ce.createElement(ce.Fragment,null,ce.createElement("rect",{x:i,y:a,width:o,height:s,fill:c,stroke:"none"}),ce.createElement("line",{x1:i+1,y1:d,x2:i+o-1,y2:d,fill:"none",stroke:"#fff"}),ce.createElement("line",{x1:i+1,y1:d+2,x2:i+o-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return ce.isValidElement(r)?a=ce.cloneElement(r,i):tn(r)?a=r(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,o=r.width,s=r.x,c=r.travellerWidth,d=r.updateId,p=r.startIndex,m=r.endIndex;if(a!==i.prevData||d!==i.prevUpdateId)return AP({prevData:a,prevTravellerWidth:c,prevUpdateId:d,prevX:s,prevWidth:o},a&&a.length?mde({data:a,width:o,x:s,travellerWidth:c,startIndex:p,endIndex:m}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([s,s+o-c]);var y=i.scale.domain().map(function(b){return i.scale(b)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:d,prevX:s,prevWidth:o,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:y}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,o=0,s=a-1;s-o>1;){var c=Math.floor((o+s)/2);r[c]>i?s=c:o=c}return i>=r[s]?s:o}}])})(M.PureComponent);Bo(Mh,"displayName","Brush");Bo(Mh,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var kP,UB;function gde(){if(UB)return kP;UB=1;var e=VE();function t(n,r){var i;return e(n,function(a,o,s){return i=r(a,o,s),!i}),!!i}return kP=t,kP}var CP,VB;function vde(){if(VB)return CP;VB=1;var e=lq(),t=Hl(),n=gde(),r=Oo(),i=Sb();function a(o,s,c){var d=r(o)?e:n;return c&&i(o,s,c)&&(s=void 0),d(o,t(s,3))}return CP=a,CP}var yde=vde();const bde=In(yde);var Dl=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},NP,WB;function xde(){if(WB)return NP;WB=1;var e=Oq();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return NP=t,NP}var MP,KB;function wde(){if(KB)return MP;KB=1;var e=xde(),t=Pq(),n=Hl();function r(i,a){var o={};return a=n(a,3),t(i,function(s,c,d){e(o,c,a(s,c,d))}),o}return MP=r,MP}var _de=wde();const Sde=In(_de);var RP,HB;function Pde(){if(HB)return RP;HB=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(!n(t[r],r,t))return!1;return!0}return RP=e,RP}var LP,GB;function jde(){if(GB)return LP;GB=1;var e=VE();function t(n,r){var i=!0;return e(n,function(a,o,s){return i=!!r(a,o,s),i}),i}return LP=t,LP}var IP,ZB;function Ode(){if(ZB)return IP;ZB=1;var e=Pde(),t=jde(),n=Hl(),r=Oo(),i=Sb();function a(o,s,c){var d=r(o)?e:t;return c&&i(o,s,c)&&(s=void 0),d(o,n(s,3))}return IP=a,IP}var Tde=Ode();const d6=In(Tde);var Ede=["x","y"];function rg(e){"@babel/helpers - typeof";return rg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rg(e)}function tT(){return tT=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},tT.apply(this,arguments)}function YB(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 Gp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YB(Object(n),!0).forEach(function(r){Ade(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ade(e,t,n){return t=kde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kde(e){var t=Cde(e,"string");return rg(t)=="symbol"?t:t+""}function Cde(e,t){if(rg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nde(e,t){if(e==null)return{};var n=Mde(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mde(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 Rde(e,t){var n=e.x,r=e.y,i=Nde(e,Ede),a="".concat(n),o=parseInt(a,10),s="".concat(r),c=parseInt(s,10),d="".concat(t.height||i.height),p=parseInt(d,10),m="".concat(t.width||i.width),y=parseInt(m,10);return Gp(Gp(Gp(Gp(Gp({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:p,width:y,name:t.name,radius:t.radius})}function XB(e){return ce.createElement(a6,tT({shapeType:"rectangle",propTransformer:Rde,activeClassName:"recharts-active-bar"},e))}var Lde=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var a=ct(r)||nJ(r);return a?t(r,i):(a||td(),n)}},Ide=["value","background"],h6;function Rh(e){"@babel/helpers - typeof";return Rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rh(e)}function Dde(e,t){if(e==null)return{};var n=Bde(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Bde(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 S0(){return S0=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},S0.apply(this,arguments)}function QB(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 li(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QB(Object(n),!0).forEach(function(r){Oc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QB(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $de(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JB(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,m6(r.key),r)}}function Fde(e,t,n){return t&&JB(e.prototype,t),n&&JB(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qde(e,t,n){return t=P0(t),zde(e,p6()?Reflect.construct(t,n||[],P0(e).constructor):t.apply(e,n))}function zde(e,t){if(t&&(Rh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ude(e)}function Ude(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p6=function(){return!!e})()}function P0(e){return P0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},P0(e)}function Vde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nT(e,t)}function nT(e,t){return nT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},nT(e,t)}function Oc(e,t,n){return t=m6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m6(e){var t=Wde(e,"string");return Rh(t)=="symbol"?t:t+""}function Wde(e,t){if(Rh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Nu=(function(e){function t(){var n;$de(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=qde(this,t,[].concat(i)),Oc(n,"state",{isAnimationFinished:!1}),Oc(n,"id",kg("recharts-bar-")),Oc(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Oc(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return Vde(t,e),Fde(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,a=this.props,o=a.shape,s=a.dataKey,c=a.activeIndex,d=a.activeBar,p=Jt(this.props,!1);return r&&r.map(function(m,y){var b=y===c,P=b?d:o,x=li(li(li({},p),m),{},{isActive:b,option:P,index:y,dataKey:s,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return ce.createElement(tr,S0({className:"recharts-bar-rectangle"},Qf(i.props,m,y),{key:"rectangle-".concat(m==null?void 0:m.x,"-").concat(m==null?void 0:m.y,"-").concat(m==null?void 0:m.value,"-").concat(y)}),ce.createElement(XB,x))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,a=i.data,o=i.layout,s=i.isAnimationActive,c=i.animationBegin,d=i.animationDuration,p=i.animationEasing,m=i.animationId,y=this.state.prevData;return ce.createElement(Cu,{begin:c,duration:d,isActive:s,easing:p,from:{t:0},to:{t:1},key:"bar-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(b){var P=b.t,x=a.map(function(w,T){var E=y&&y[T];if(E){var k=hc(E.x,w.x),D=hc(E.y,w.y),I=hc(E.width,w.width),R=hc(E.height,w.height);return li(li({},w),{},{x:k(P),y:D(P),width:I(P),height:R(P)})}if(o==="horizontal"){var $=hc(0,w.height),V=$(P);return li(li({},w),{},{y:w.y+w.height-V,height:V})}var K=hc(0,w.width),Z=K(P);return li(li({},w),{},{width:Z})});return ce.createElement(tr,null,r.renderRectanglesStatically(x))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!Mb(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,a=i.data,o=i.dataKey,s=i.activeIndex,c=Jt(this.props.background,!1);return a.map(function(d,p){d.value;var m=d.background,y=Dde(d,Ide);if(!m)return null;var b=li(li(li(li(li({},y),{},{fill:"#eee"},m),c),Qf(r.props,d,p)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:p,className:"recharts-bar-background-rectangle"});return ce.createElement(XB,S0({key:"background-bar-".concat(p),option:r.props.background,isActive:p===s},b))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,s=a.xAxis,c=a.yAxis,d=a.layout,p=a.children,m=Os(p,Ib);if(!m)return null;var y=d==="vertical"?o[0].height/2:o[0].width/2,b=function(w,T){var E=Array.isArray(w.value)?w.value[1]:w.value;return{x:w.x,y:w.y,value:E,errorVal:Aa(w,T)}},P={clipPath:r?"url(#clipPath-".concat(i,")"):null};return ce.createElement(tr,P,m.map(function(x){return ce.cloneElement(x,{key:"error-bar-".concat(i,"-").concat(x.props.dataKey),data:o,xAxis:s,yAxis:c,layout:d,offset:y,dataPointFormatter:b})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,a=r.data,o=r.className,s=r.xAxis,c=r.yAxis,d=r.left,p=r.top,m=r.width,y=r.height,b=r.isAnimationActive,P=r.background,x=r.id;if(i||!a||!a.length)return null;var w=this.state.isAnimationFinished,T=pn("recharts-bar",o),E=s&&s.allowDataOverflow,k=c&&c.allowDataOverflow,D=E||k,I=_n(x)?this.id:x;return ce.createElement(tr,{className:T},E||k?ce.createElement("defs",null,ce.createElement("clipPath",{id:"clipPath-".concat(I)},ce.createElement("rect",{x:E?d:d-m/2,y:k?p:p-y/2,width:E?m:m*2,height:k?y:y*2}))):null,ce.createElement(tr,{className:"recharts-bar-rectangles",clipPath:D?"url(#clipPath-".concat(I,")"):null},P?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(D,I),(!b||w)&&Mc.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])})(M.PureComponent);h6=Nu;Oc(Nu,"displayName","Bar");Oc(Nu,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ap.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Oc(Nu,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,s=e.xAxisTicks,c=e.yAxisTicks,d=e.stackedData,p=e.dataStartIndex,m=e.displayedData,y=e.offset,b=gse(r,n);if(!b)return null;var P=t.layout,x=n.type.defaultProps,w=x!==void 0?li(li({},x),n.props):n.props,T=w.dataKey,E=w.children,k=w.minPointSize,D=P==="horizontal"?o:a,I=d?D.scale.domain():null,R=Sse({numericAxis:D}),$=Os(E,Sh),V=m.map(function(K,Z){var ee,ne,oe,he,Se,fe;d?ee=vse(d[p+Z],I):(ee=Aa(K,T),Array.isArray(ee)||(ee=[R,ee]));var Oe=Lde(k,h6.defaultProps.minPointSize)(ee[1],Z);if(P==="horizontal"){var re,Ce=[o.scale(ee[0]),o.scale(ee[1])],ae=Ce[0],ie=Ce[1];ne=TD({axis:a,ticks:s,bandSize:i,offset:b.offset,entry:K,index:Z}),oe=(re=ie??ae)!==null&&re!==void 0?re:void 0,he=b.size;var de=ae-ie;if(Se=Number.isNaN(de)?0:de,fe={x:ne,y:o.y,width:he,height:o.height},Math.abs(Oe)>0&&Math.abs(Se)<Math.abs(Oe)){var He=Za(Se||Oe)*(Math.abs(Oe)-Math.abs(Se));oe-=He,Se+=He}}else{var je=[a.scale(ee[0]),a.scale(ee[1])],$e=je[0],We=je[1];if(ne=$e,oe=TD({axis:o,ticks:c,bandSize:i,offset:b.offset,entry:K,index:Z}),he=We-$e,Se=b.size,fe={x:a.x,y:oe,width:a.width,height:Se},Math.abs(Oe)>0&&Math.abs(he)<Math.abs(Oe)){var Ye=Za(he||Oe)*(Math.abs(Oe)-Math.abs(he));he+=Ye}}return li(li(li({},K),{},{x:ne,y:oe,width:he,height:Se,value:d?ee:ee[1],payload:K,background:fe},$&&$[Z]&&$[Z].props),{},{tooltipPayload:[qz(n,K)],tooltipPosition:{x:ne+he/2,y:oe+Se/2}})});return li({data:V,layout:P},y)});function ig(e){"@babel/helpers - typeof";return ig=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ig(e)}function Kde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g6(r.key),r)}}function Hde(e,t,n){return t&&e4(e.prototype,t),n&&e4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function t4(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 rl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t4(Object(n),!0).forEach(function(r){Ub(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ub(e,t,n){return t=g6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g6(e){var t=Gde(e,"string");return ig(t)=="symbol"?t:t+""}function Gde(e,t){if(ig(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ig(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zde=function(t,n,r,i,a){var o=t.width,s=t.height,c=t.layout,d=t.children,p=Object.keys(n),m={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:s-r.bottom,bottomMirror:s-r.bottom},y=!!$o(d,Nu);return p.reduce(function(b,P){var x=n[P],w=x.orientation,T=x.domain,E=x.padding,k=E===void 0?{}:E,D=x.mirror,I=x.reversed,R="".concat(w).concat(D?"Mirror":""),$,V,K,Z,ee;if(x.type==="number"&&(x.padding==="gap"||x.padding==="no-gap")){var ne=T[1]-T[0],oe=1/0,he=x.categoricalDomain.sort(aJ);if(he.forEach(function(je,$e){$e>0&&(oe=Math.min((je||0)-(he[$e-1]||0),oe))}),Number.isFinite(oe)){var Se=oe/ne,fe=x.layout==="vertical"?r.height:r.width;if(x.padding==="gap"&&($=Se*fe/2),x.padding==="no-gap"){var Oe=Ya(t.barCategoryGap,Se*fe),re=Se*fe/2;$=re-Oe-(re-Oe)/fe*Oe}}}i==="xAxis"?V=[r.left+(k.left||0)+($||0),r.left+r.width-(k.right||0)-($||0)]:i==="yAxis"?V=c==="horizontal"?[r.top+r.height-(k.bottom||0),r.top+(k.top||0)]:[r.top+(k.top||0)+($||0),r.top+r.height-(k.bottom||0)-($||0)]:V=x.range,I&&(V=[V[1],V[0]]);var Ce=Dz(x,a,y),ae=Ce.scale,ie=Ce.realScaleType;ae.domain(T).range(V),Bz(ae);var de=$z(ae,rl(rl({},x),{},{realScaleType:ie}));i==="xAxis"?(ee=w==="top"&&!D||w==="bottom"&&D,K=r.left,Z=m[R]-ee*x.height):i==="yAxis"&&(ee=w==="left"&&!D||w==="right"&&D,K=m[R]-ee*x.width,Z=r.top);var He=rl(rl(rl({},x),de),{},{realScaleType:ie,x:K,y:Z,scale:ae,width:i==="xAxis"?r.width:x.width,height:i==="yAxis"?r.height:x.height});return He.bandSize=s0(He,de),!x.hide&&i==="xAxis"?m[R]+=(ee?-1:1)*He.height:x.hide||(m[R]+=(ee?-1:1)*He.width),rl(rl({},b),{},Ub({},P,He))},{})},v6=function(t,n){var r=t.x,i=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(i,o),width:Math.abs(a-r),height:Math.abs(o-i)}},Yde=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2;return v6({x:n,y:r},{x:i,y:a})},y6=(function(){function e(t){Kde(this,e),this.scale=t}return Hde(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])})();Ub(y6,"EPS",1e-4);var xA=function(t){var n=Object.keys(t).reduce(function(r,i){return rl(rl({},r),{},Ub({},i,y6.create(t[i])))},{});return rl(rl({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return Sde(i,function(c,d){return n[d].apply(c,{bandAware:o,position:s})})},isInRange:function(i){return d6(i,function(a,o){return n[o].isInRange(a)})}})};function Xde(e){return(e%180+180)%180}var Qde=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Xde(i),o=a*Math.PI/180,s=Math.atan(r/n),c=o>s&&o<Math.PI-s?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},DP,n4;function Jde(){if(n4)return DP;n4=1;var e=Hl(),t=Cg(),n=wb();function r(i){return function(a,o,s){var c=Object(a);if(!t(a)){var d=e(o,3);a=n(a),o=function(m){return d(c[m],m,c)}}var p=i(a,o,s);return p>-1?c[d?a[p]:p]:void 0}}return DP=r,DP}var BP,r4;function ehe(){if(r4)return BP;r4=1;var e=l6();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return BP=t,BP}var $P,i4;function the(){if(i4)return $P;i4=1;var e=bq(),t=Hl(),n=ehe(),r=Math.max;function i(a,o,s){var c=a==null?0:a.length;if(!c)return-1;var d=s==null?0:n(s);return d<0&&(d=r(c+d,0)),e(a,t(o,3),d)}return $P=i,$P}var FP,a4;function nhe(){if(a4)return FP;a4=1;var e=Jde(),t=the(),n=e(t);return FP=n,FP}var rhe=nhe();const ihe=In(rhe);var ahe=L5();const ohe=In(ahe);var she=ohe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),wA=M.createContext(void 0),_A=M.createContext(void 0),b6=M.createContext(void 0),x6=M.createContext({}),w6=M.createContext(void 0),_6=M.createContext(0),S6=M.createContext(0),o4=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,o=t.clipPathId,s=t.children,c=t.width,d=t.height,p=she(a);return ce.createElement(wA.Provider,{value:r},ce.createElement(_A.Provider,{value:i},ce.createElement(x6.Provider,{value:a},ce.createElement(b6.Provider,{value:p},ce.createElement(w6.Provider,{value:o},ce.createElement(_6.Provider,{value:d},ce.createElement(S6.Provider,{value:c},s)))))))},lhe=function(){return M.useContext(w6)},P6=function(t){var n=M.useContext(wA);n==null&&td();var r=n[t];return r==null&&td(),r},uhe=function(){var t=M.useContext(wA);return mc(t)},che=function(){var t=M.useContext(_A),n=ihe(t,function(r){return d6(r.domain,Number.isFinite)});return n||mc(t)},j6=function(t){var n=M.useContext(_A);n==null&&td();var r=n[t];return r==null&&td(),r},fhe=function(){var t=M.useContext(b6);return t},dhe=function(){return M.useContext(x6)},SA=function(){return M.useContext(S6)},PA=function(){return M.useContext(_6)};function Lh(e){"@babel/helpers - typeof";return Lh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lh(e)}function hhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function phe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,T6(r.key),r)}}function mhe(e,t,n){return t&&phe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ghe(e,t,n){return t=j0(t),vhe(e,O6()?Reflect.construct(t,n||[],j0(e).constructor):t.apply(e,n))}function vhe(e,t){if(t&&(Lh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yhe(e)}function yhe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(O6=function(){return!!e})()}function j0(e){return j0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},j0(e)}function bhe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rT(e,t)}function rT(e,t){return rT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},rT(e,t)}function s4(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 l4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s4(Object(n),!0).forEach(function(r){jA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jA(e,t,n){return t=T6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T6(e){var t=xhe(e,"string");return Lh(t)=="symbol"?t:t+""}function xhe(e,t){if(Lh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function whe(e,t){return jhe(e)||Phe(e,t)||She(e,t)||_he()}function _he(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function She(e,t){if(e){if(typeof e=="string")return u4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u4(e,t)}}function u4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Phe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function jhe(e){if(Array.isArray(e))return e}function iT(){return iT=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},iT.apply(this,arguments)}var Ohe=function(t,n){var r;return ce.isValidElement(t)?r=ce.cloneElement(t,n):tn(t)?r=t(n):r=ce.createElement("line",iT({},n,{className:"recharts-reference-line-line"})),r},The=function(t,n,r,i,a,o,s,c,d){var p=a.x,m=a.y,y=a.width,b=a.height;if(r){var P=d.y,x=t.y.apply(P,{position:o});if(Dl(d,"discard")&&!t.y.isInRange(x))return null;var w=[{x:p+y,y:x},{x:p,y:x}];return c==="left"?w.reverse():w}if(n){var T=d.x,E=t.x.apply(T,{position:o});if(Dl(d,"discard")&&!t.x.isInRange(E))return null;var k=[{x:E,y:m+b},{x:E,y:m}];return s==="top"?k.reverse():k}if(i){var D=d.segment,I=D.map(function(R){return t.apply(R,{position:o})});return Dl(d,"discard")&&bde(I,function(R){return!t.isInRange(R)})?null:I}return null};function Ehe(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,s=e.className,c=e.alwaysShow,d=lhe(),p=P6(i),m=j6(a),y=fhe();if(!d||!y)return null;cl(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var b=xA({x:p.scale,y:m.scale}),P=Ai(t),x=Ai(n),w=r&&r.length===2,T=The(b,P,x,w,y,e.position,p.orientation,m.orientation,e);if(!T)return null;var E=whe(T,2),k=E[0],D=k.x,I=k.y,R=E[1],$=R.x,V=R.y,K=Dl(e,"hidden")?"url(#".concat(d,")"):void 0,Z=l4(l4({clipPath:K},Jt(e,!0)),{},{x1:D,y1:I,x2:$,y2:V});return ce.createElement(tr,{className:pn("recharts-reference-line",s)},Ohe(o,Z),Ui.renderCallByParent(e,Yde({x1:D,y1:I,x2:$,y2:V})))}var OA=(function(e){function t(){return hhe(this,t),ghe(this,t,arguments)}return bhe(t,e),mhe(t,[{key:"render",value:function(){return ce.createElement(Ehe,this.props)}}])})(ce.Component);jA(OA,"displayName","ReferenceLine");jA(OA,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function aT(){return aT=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},aT.apply(this,arguments)}function Ih(e){"@babel/helpers - typeof";return Ih=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ih(e)}function c4(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 f4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c4(Object(n),!0).forEach(function(r){Vb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ahe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function khe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A6(r.key),r)}}function Che(e,t,n){return t&&khe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nhe(e,t,n){return t=O0(t),Mhe(e,E6()?Reflect.construct(t,n||[],O0(e).constructor):t.apply(e,n))}function Mhe(e,t){if(t&&(Ih(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rhe(e)}function Rhe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E6=function(){return!!e})()}function O0(e){return O0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},O0(e)}function Lhe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oT(e,t)}function oT(e,t){return oT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},oT(e,t)}function Vb(e,t,n){return t=A6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A6(e){var t=Ihe(e,"string");return Ih(t)=="symbol"?t:t+""}function Ihe(e,t){if(Ih(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ih(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Dhe=function(t){var n=t.x,r=t.y,i=t.xAxis,a=t.yAxis,o=xA({x:i.scale,y:a.scale}),s=o.apply({x:n,y:r},{bandAware:!0});return Dl(t,"discard")&&!o.isInRange(s)?null:s},Wb=(function(e){function t(){return Ahe(this,t),Nhe(this,t,arguments)}return Lhe(t,e),Che(t,[{key:"render",value:function(){var r=this.props,i=r.x,a=r.y,o=r.r,s=r.alwaysShow,c=r.clipPathId,d=Ai(i),p=Ai(a);if(cl(s===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!d||!p)return null;var m=Dhe(this.props);if(!m)return null;var y=m.x,b=m.y,P=this.props,x=P.shape,w=P.className,T=Dl(this.props,"hidden")?"url(#".concat(c,")"):void 0,E=f4(f4({clipPath:T},Jt(this.props,!0)),{},{cx:y,cy:b});return ce.createElement(tr,{className:pn("recharts-reference-dot",w)},t.renderDot(x,E),Ui.renderCallByParent(this.props,{x:y-o,y:b-o,width:2*o,height:2*o}))}}])})(ce.Component);Vb(Wb,"displayName","ReferenceDot");Vb(Wb,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Vb(Wb,"renderDot",function(e,t){var n;return ce.isValidElement(e)?n=ce.cloneElement(e,t):tn(e)?n=e(t):n=ce.createElement(bA,aT({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function sT(){return sT=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},sT.apply(this,arguments)}function Dh(e){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dh(e)}function d4(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 h4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d4(Object(n),!0).forEach(function(r){Kb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $he(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C6(r.key),r)}}function Fhe(e,t,n){return t&&$he(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qhe(e,t,n){return t=T0(t),zhe(e,k6()?Reflect.construct(t,n||[],T0(e).constructor):t.apply(e,n))}function zhe(e,t){if(t&&(Dh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uhe(e)}function Uhe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(k6=function(){return!!e})()}function T0(e){return T0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},T0(e)}function Vhe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lT(e,t)}function lT(e,t){return lT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},lT(e,t)}function Kb(e,t,n){return t=C6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C6(e){var t=Whe(e,"string");return Dh(t)=="symbol"?t:t+""}function Whe(e,t){if(Dh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Khe=function(t,n,r,i,a){var o=a.x1,s=a.x2,c=a.y1,d=a.y2,p=a.xAxis,m=a.yAxis;if(!p||!m)return null;var y=xA({x:p.scale,y:m.scale}),b={x:t?y.x.apply(o,{position:"start"}):y.x.rangeMin,y:r?y.y.apply(c,{position:"start"}):y.y.rangeMin},P={x:n?y.x.apply(s,{position:"end"}):y.x.rangeMax,y:i?y.y.apply(d,{position:"end"}):y.y.rangeMax};return Dl(a,"discard")&&(!y.isInRange(b)||!y.isInRange(P))?null:v6(b,P)},Hb=(function(e){function t(){return Bhe(this,t),qhe(this,t,arguments)}return Vhe(t,e),Fhe(t,[{key:"render",value:function(){var r=this.props,i=r.x1,a=r.x2,o=r.y1,s=r.y2,c=r.className,d=r.alwaysShow,p=r.clipPathId;cl(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=Ai(i),y=Ai(a),b=Ai(o),P=Ai(s),x=this.props.shape;if(!m&&!y&&!b&&!P&&!x)return null;var w=Khe(m,y,b,P,this.props);if(!w&&!x)return null;var T=Dl(this.props,"hidden")?"url(#".concat(p,")"):void 0;return ce.createElement(tr,{className:pn("recharts-reference-area",c)},t.renderRect(x,h4(h4({clipPath:T},Jt(this.props,!0)),w)),Ui.renderCallByParent(this.props,w))}}])})(ce.Component);Kb(Hb,"displayName","ReferenceArea");Kb(Hb,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Kb(Hb,"renderRect",function(e,t){var n;return ce.isValidElement(e)?n=ce.cloneElement(e,t):tn(e)?n=e(t):n=ce.createElement(yA,sT({},t,{className:"recharts-reference-area-rect"})),n});function N6(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function Hhe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Qde(r,n)}function Ghe(e,t,n){var r=n==="width",i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function E0(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function Zhe(e,t){return N6(e,t+1)}function Yhe(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,d=1,p=o,m=function(){var P=r==null?void 0:r[c];if(P===void 0)return{v:N6(r,d)};var x=c,w,T=function(){return w===void 0&&(w=n(P,x)),w},E=P.coordinate,k=c===0||E0(e,E,T,p,s);k||(c=0,p=o,d+=1),k&&(p=E+e*(T()/2+i),c+=d)},y;d<=a.length;)if(y=m(),y)return y.v;return[]}function ag(e){"@babel/helpers - typeof";return ag=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ag(e)}function p4(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 ja(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p4(Object(n),!0).forEach(function(r){Xhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xhe(e,t,n){return t=Qhe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qhe(e){var t=Jhe(e,"string");return ag(t)=="symbol"?t:t+""}function Jhe(e,t){if(ag(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ag(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function epe(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,s=t.start,c=t.end,d=function(y){var b=a[y],P,x=function(){return P===void 0&&(P=n(b,y)),P};if(y===o-1){var w=e*(b.coordinate+e*x()/2-c);a[y]=b=ja(ja({},b),{},{tickCoord:w>0?b.coordinate-w*e:b.coordinate})}else a[y]=b=ja(ja({},b),{},{tickCoord:b.coordinate});var T=E0(e,b.tickCoord,x,s,c);T&&(c=b.tickCoord-e*(x()/2+i),a[y]=ja(ja({},b),{},{isShow:!0}))},p=o-1;p>=0;p--)d(p);return a}function tpe(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,d=t.end;if(a){var p=r[s-1],m=n(p,s-1),y=e*(p.coordinate+e*m/2-d);o[s-1]=p=ja(ja({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate});var b=E0(e,p.tickCoord,function(){return m},c,d);b&&(d=p.tickCoord-e*(m/2+i),o[s-1]=ja(ja({},p),{},{isShow:!0}))}for(var P=a?s-1:s,x=function(E){var k=o[E],D,I=function(){return D===void 0&&(D=n(k,E)),D};if(E===0){var R=e*(k.coordinate-e*I()/2-c);o[E]=k=ja(ja({},k),{},{tickCoord:R<0?k.coordinate-R*e:k.coordinate})}else o[E]=k=ja(ja({},k),{},{tickCoord:k.coordinate});var $=E0(e,k.tickCoord,I,c,d);$&&(c=k.tickCoord+e*(I()/2+i),o[E]=ja(ja({},k),{},{isShow:!0}))},w=0;w<P;w++)x(w);return o}function TA(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,c=e.interval,d=e.tickFormatter,p=e.unit,m=e.angle;if(!i||!i.length||!r)return[];if(ct(c)||ap.isSsr)return Zhe(i,typeof c=="number"&&ct(c)?c:0);var y=[],b=s==="top"||s==="bottom"?"width":"height",P=p&&b==="width"?pm(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=function(k,D){var I=tn(d)?d(k.value,D):k.value;return b==="width"?Hhe(pm(I,{fontSize:t,letterSpacing:n}),P,m):pm(I,{fontSize:t,letterSpacing:n})[b]},w=i.length>=2?Za(i[1].coordinate-i[0].coordinate):1,T=Ghe(a,w,b);return c==="equidistantPreserveStart"?Yhe(w,T,x,i,o):(c==="preserveStart"||c==="preserveStartEnd"?y=tpe(w,T,x,i,o,c==="preserveStartEnd"):y=epe(w,T,x,i,o),y.filter(function(E){return E.isShow}))}var npe=["viewBox"],rpe=["viewBox"],ipe=["ticks"];function Bh(e){"@babel/helpers - typeof";return Bh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bh(e)}function Ud(){return Ud=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},Ud.apply(this,arguments)}function m4(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 Pi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m4(Object(n),!0).forEach(function(r){EA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qP(e,t){if(e==null)return{};var n=ape(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ape(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 ope(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,R6(r.key),r)}}function spe(e,t,n){return t&&g4(e.prototype,t),n&&g4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lpe(e,t,n){return t=A0(t),upe(e,M6()?Reflect.construct(t,n||[],A0(e).constructor):t.apply(e,n))}function upe(e,t){if(t&&(Bh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cpe(e)}function cpe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(M6=function(){return!!e})()}function A0(e){return A0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},A0(e)}function fpe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uT(e,t)}function uT(e,t){return uT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},uT(e,t)}function EA(e,t,n){return t=R6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R6(e){var t=dpe(e,"string");return Bh(t)=="symbol"?t:t+""}function dpe(e,t){if(Bh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var up=(function(e){function t(n){var r;return ope(this,t),r=lpe(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return fpe(t,e),spe(t,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,o=qP(r,npe),s=this.props,c=s.viewBox,d=qP(s,rpe);return!Yd(a,c)||!Yd(o,d)||!Yd(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,o=i.y,s=i.width,c=i.height,d=i.orientation,p=i.tickSize,m=i.mirror,y=i.tickMargin,b,P,x,w,T,E,k=m?-1:1,D=r.tickSize||p,I=ct(r.tickCoord)?r.tickCoord:r.coordinate;switch(d){case"top":b=P=r.coordinate,w=o+ +!m*c,x=w-k*D,E=x-k*y,T=I;break;case"left":x=w=r.coordinate,P=a+ +!m*s,b=P-k*D,T=b-k*y,E=I;break;case"right":x=w=r.coordinate,P=a+ +m*s,b=P+k*D,T=b+k*y,E=I;break;default:b=P=r.coordinate,w=o+ +m*c,x=w+k*D,E=x+k*y,T=I;break}return{line:{x1:b,y1:x,x2:P,y2:w},tick:{x:T,y:E}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,o=r.width,s=r.height,c=r.orientation,d=r.mirror,p=r.axisLine,m=Pi(Pi(Pi({},Jt(this.props,!1)),Jt(p,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var y=+(c==="top"&&!d||c==="bottom"&&d);m=Pi(Pi({},m),{},{x1:i,y1:a+y*s,x2:i+o,y2:a+y*s})}else{var b=+(c==="left"&&!d||c==="right"&&d);m=Pi(Pi({},m),{},{x1:i+b*o,y1:a,x2:i+b*o,y2:a+s})}return ce.createElement("line",Ud({},m,{className:pn("recharts-cartesian-axis-line",Uo(p,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var o=this,s=this.props,c=s.tickLine,d=s.stroke,p=s.tick,m=s.tickFormatter,y=s.unit,b=TA(Pi(Pi({},this.props),{},{ticks:r}),i,a),P=this.getTickTextAnchor(),x=this.getTickVerticalAnchor(),w=Jt(this.props,!1),T=Jt(p,!1),E=Pi(Pi({},w),{},{fill:"none"},Jt(c,!1)),k=b.map(function(D,I){var R=o.getTickLineCoord(D),$=R.line,V=R.tick,K=Pi(Pi(Pi(Pi({textAnchor:P,verticalAnchor:x},w),{},{stroke:"none",fill:d},T),V),{},{index:I,payload:D,visibleTicksCount:b.length,tickFormatter:m});return ce.createElement(tr,Ud({className:"recharts-cartesian-axis-tick",key:"tick-".concat(D.value,"-").concat(D.coordinate,"-").concat(D.tickCoord)},Qf(o.props,D,I)),c&&ce.createElement("line",Ud({},E,$,{className:pn("recharts-cartesian-axis-tick-line",Uo(c,"className"))})),p&&t.renderTickItem(p,K,"".concat(tn(m)?m(D.value,I):D.value).concat(y||"")))});return ce.createElement("g",{className:"recharts-cartesian-axis-ticks"},k)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,o=i.width,s=i.height,c=i.ticksGenerator,d=i.className,p=i.hide;if(p)return null;var m=this.props,y=m.ticks,b=qP(m,ipe),P=y;return tn(c)&&(P=y&&y.length>0?c(this.props):c(b)),o<=0||s<=0||!P||!P.length?null:ce.createElement(tr,{className:pn("recharts-cartesian-axis",d),ref:function(w){r.layerReference=w}},a&&this.renderAxisLine(),this.renderTicks(P,this.state.fontSize,this.state.letterSpacing),Ui.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var o,s=pn(i.className,"recharts-cartesian-axis-tick-value");return ce.isValidElement(r)?o=ce.cloneElement(r,Pi(Pi({},i),{},{className:s})):tn(r)?o=r(Pi(Pi({},i),{},{className:s})):o=ce.createElement(Jf,Ud({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(M.Component);EA(up,"displayName","CartesianAxis");EA(up,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var hpe=["x1","y1","x2","y2","key"],ppe=["offset"];function nd(e){"@babel/helpers - typeof";return nd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nd(e)}function v4(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 Ta(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v4(Object(n),!0).forEach(function(r){mpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mpe(e,t,n){return t=gpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gpe(e){var t=vpe(e,"string");return nd(t)=="symbol"?t:t+""}function vpe(e,t){if(nd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cf(){return Cf=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},Cf.apply(this,arguments)}function y4(e,t){if(e==null)return{};var n=ype(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ype(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}var bpe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,c=t.ry;return ce.createElement("rect",{x:i,y:a,ry:c,width:o,height:s,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function L6(e,t){var n;if(ce.isValidElement(e))n=ce.cloneElement(e,t);else if(tn(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,c=y4(t,hpe),d=Jt(c,!1);d.offset;var p=y4(d,ppe);n=ce.createElement("line",Cf({},p,{x1:r,y1:i,x2:a,y2:o,fill:"none",key:s}))}return n}function xpe(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,c){var d=Ta(Ta({},e),{},{x1:t,y1:s,x2:t+n,y2:s,key:"line-".concat(c),index:c});return L6(i,d)});return ce.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function wpe(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,c){var d=Ta(Ta({},e),{},{x1:s,y1:t,x2:s,y2:t+n,key:"line-".concat(c),index:c});return L6(i,d)});return ce.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function _pe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,c=e.horizontal,d=c===void 0?!0:c;if(!d||!t||!t.length)return null;var p=s.map(function(y){return Math.round(y+i-i)}).sort(function(y,b){return y-b});i!==p[0]&&p.unshift(0);var m=p.map(function(y,b){var P=!p[b+1],x=P?i+o-y:p[b+1]-y;if(x<=0)return null;var w=b%t.length;return ce.createElement("rect",{key:"react-".concat(b),y,x:r,height:x,width:a,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return ce.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function Spe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,c=e.height,d=e.verticalPoints;if(!n||!r||!r.length)return null;var p=d.map(function(y){return Math.round(y+a-a)}).sort(function(y,b){return y-b});a!==p[0]&&p.unshift(0);var m=p.map(function(y,b){var P=!p[b+1],x=P?a+s-y:p[b+1]-y;if(x<=0)return null;var w=b%r.length;return ce.createElement("rect",{key:"react-".concat(b),x:y,y:o,width:x,height:c,stroke:"none",fill:r[w],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return ce.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var Ppe=function(t,n){var r=t.xAxis,i=t.width,a=t.height,o=t.offset;return Iz(TA(Ta(Ta(Ta({},up.defaultProps),r),{},{ticks:_u(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,n)},jpe=function(t,n){var r=t.yAxis,i=t.width,a=t.height,o=t.offset;return Iz(TA(Ta(Ta(Ta({},up.defaultProps),r),{},{ticks:_u(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,n)},Ld={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function k0(e){var t,n,r,i,a,o,s=SA(),c=PA(),d=dhe(),p=Ta(Ta({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ld.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Ld.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Ld.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Ld.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Ld.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Ld.verticalFill,x:ct(e.x)?e.x:d.left,y:ct(e.y)?e.y:d.top,width:ct(e.width)?e.width:d.width,height:ct(e.height)?e.height:d.height}),m=p.x,y=p.y,b=p.width,P=p.height,x=p.syncWithTicks,w=p.horizontalValues,T=p.verticalValues,E=uhe(),k=che();if(!ct(b)||b<=0||!ct(P)||P<=0||!ct(m)||m!==+m||!ct(y)||y!==+y)return null;var D=p.verticalCoordinatesGenerator||Ppe,I=p.horizontalCoordinatesGenerator||jpe,R=p.horizontalPoints,$=p.verticalPoints;if((!R||!R.length)&&tn(I)){var V=w&&w.length,K=I({yAxis:k?Ta(Ta({},k),{},{ticks:V?w:k.ticks}):void 0,width:s,height:c,offset:d},V?!0:x);cl(Array.isArray(K),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(nd(K),"]")),Array.isArray(K)&&(R=K)}if((!$||!$.length)&&tn(D)){var Z=T&&T.length,ee=D({xAxis:E?Ta(Ta({},E),{},{ticks:Z?T:E.ticks}):void 0,width:s,height:c,offset:d},Z?!0:x);cl(Array.isArray(ee),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(nd(ee),"]")),Array.isArray(ee)&&($=ee)}return ce.createElement("g",{className:"recharts-cartesian-grid"},ce.createElement(bpe,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),ce.createElement(xpe,Cf({},p,{offset:d,horizontalPoints:R,xAxis:E,yAxis:k})),ce.createElement(wpe,Cf({},p,{offset:d,verticalPoints:$,xAxis:E,yAxis:k})),ce.createElement(_pe,Cf({},p,{horizontalPoints:R})),ce.createElement(Spe,Cf({},p,{verticalPoints:$})))}k0.displayName="CartesianGrid";function $h(e){"@babel/helpers - typeof";return $h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$h(e)}function Ope(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tpe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,B6(r.key),r)}}function Epe(e,t,n){return t&&Tpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ape(e,t,n){return t=C0(t),kpe(e,I6()?Reflect.construct(t,n||[],C0(e).constructor):t.apply(e,n))}function kpe(e,t){if(t&&($h(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cpe(e)}function Cpe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I6=function(){return!!e})()}function C0(e){return C0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},C0(e)}function Npe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cT(e,t)}function cT(e,t){return cT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},cT(e,t)}function D6(e,t,n){return t=B6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B6(e){var t=Mpe(e,"string");return $h(t)=="symbol"?t:t+""}function Mpe(e,t){if($h(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($h(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function fT(){return fT=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},fT.apply(this,arguments)}function Rpe(e){var t=e.xAxisId,n=SA(),r=PA(),i=P6(t);return i==null?null:M.createElement(up,fT({},i,{className:pn("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return _u(o,!0)}}))}var Fh=(function(e){function t(){return Ope(this,t),Ape(this,t,arguments)}return Npe(t,e),Epe(t,[{key:"render",value:function(){return M.createElement(Rpe,this.props)}}])})(M.Component);D6(Fh,"displayName","XAxis");D6(Fh,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function qh(e){"@babel/helpers - typeof";return qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qh(e)}function Lpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ipe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,q6(r.key),r)}}function Dpe(e,t,n){return t&&Ipe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bpe(e,t,n){return t=N0(t),$pe(e,$6()?Reflect.construct(t,n||[],N0(e).constructor):t.apply(e,n))}function $pe(e,t){if(t&&(qh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fpe(e)}function Fpe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($6=function(){return!!e})()}function N0(e){return N0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},N0(e)}function qpe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dT(e,t)}function dT(e,t){return dT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dT(e,t)}function F6(e,t,n){return t=q6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q6(e){var t=zpe(e,"string");return qh(t)=="symbol"?t:t+""}function zpe(e,t){if(qh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function hT(){return hT=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},hT.apply(this,arguments)}var Upe=function(t){var n=t.yAxisId,r=SA(),i=PA(),a=j6(n);return a==null?null:M.createElement(up,hT({},a,{className:pn("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(s){return _u(s,!0)}}))},zh=(function(e){function t(){return Lpe(this,t),Bpe(this,t,arguments)}return qpe(t,e),Dpe(t,[{key:"render",value:function(){return M.createElement(Upe,this.props)}}])})(M.Component);F6(zh,"displayName","YAxis");F6(zh,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function b4(e){return Hpe(e)||Kpe(e)||Wpe(e)||Vpe()}function Vpe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wpe(e,t){if(e){if(typeof e=="string")return pT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pT(e,t)}}function Kpe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hpe(e){if(Array.isArray(e))return pT(e)}function pT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mT=function(t,n,r,i,a){var o=Os(t,OA),s=Os(t,Wb),c=[].concat(b4(o),b4(s)),d=Os(t,Hb),p="".concat(i,"Id"),m=i[0],y=n;if(c.length&&(y=c.reduce(function(x,w){if(w.props[p]===r&&Dl(w.props,"extendDomain")&&ct(w.props[m])){var T=w.props[m];return[Math.min(x[0],T),Math.max(x[1],T)]}return x},y)),d.length){var b="".concat(m,"1"),P="".concat(m,"2");y=d.reduce(function(x,w){if(w.props[p]===r&&Dl(w.props,"extendDomain")&&ct(w.props[b])&&ct(w.props[P])){var T=w.props[b],E=w.props[P];return[Math.min(x[0],T,E),Math.max(x[1],T,E)]}return x},y)}return a&&a.length&&(y=a.reduce(function(x,w){return ct(w)?[Math.min(x[0],w),Math.max(x[1],w)]:x},y)),y},zP={exports:{}},x4;function Gpe(){return x4||(x4=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,d,p){this.fn=c,this.context=d,this.once=p||!1}function a(c,d,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var b=new i(p,m||c,y),P=n?n+d:d;return c._events[P]?c._events[P].fn?c._events[P]=[c._events[P],b]:c._events[P].push(b):(c._events[P]=b,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new r:delete c._events[d]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var d=[],p,m;if(this._eventsCount===0)return d;for(m in p=this._events)t.call(p,m)&&d.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},s.prototype.listeners=function(d){var p=n?n+d:d,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var y=0,b=m.length,P=new Array(b);y<b;y++)P[y]=m[y].fn;return P},s.prototype.listenerCount=function(d){var p=n?n+d:d,m=this._events[p];return m?m.fn?1:m.length:0},s.prototype.emit=function(d,p,m,y,b,P){var x=n?n+d:d;if(!this._events[x])return!1;var w=this._events[x],T=arguments.length,E,k;if(w.fn){switch(w.once&&this.removeListener(d,w.fn,void 0,!0),T){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,p),!0;case 3:return w.fn.call(w.context,p,m),!0;case 4:return w.fn.call(w.context,p,m,y),!0;case 5:return w.fn.call(w.context,p,m,y,b),!0;case 6:return w.fn.call(w.context,p,m,y,b,P),!0}for(k=1,E=new Array(T-1);k<T;k++)E[k-1]=arguments[k];w.fn.apply(w.context,E)}else{var D=w.length,I;for(k=0;k<D;k++)switch(w[k].once&&this.removeListener(d,w[k].fn,void 0,!0),T){case 1:w[k].fn.call(w[k].context);break;case 2:w[k].fn.call(w[k].context,p);break;case 3:w[k].fn.call(w[k].context,p,m);break;case 4:w[k].fn.call(w[k].context,p,m,y);break;default:if(!E)for(I=1,E=new Array(T-1);I<T;I++)E[I-1]=arguments[I];w[k].fn.apply(w[k].context,E)}}return!0},s.prototype.on=function(d,p,m){return a(this,d,p,m,!1)},s.prototype.once=function(d,p,m){return a(this,d,p,m,!0)},s.prototype.removeListener=function(d,p,m,y){var b=n?n+d:d;if(!this._events[b])return this;if(!p)return o(this,b),this;var P=this._events[b];if(P.fn)P.fn===p&&(!y||P.once)&&(!m||P.context===m)&&o(this,b);else{for(var x=0,w=[],T=P.length;x<T;x++)(P[x].fn!==p||y&&!P[x].once||m&&P[x].context!==m)&&w.push(P[x]);w.length?this._events[b]=w.length===1?w[0]:w:o(this,b)}return this},s.prototype.removeAllListeners=function(d){var p;return d?(p=n?n+d:d,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(zP)),zP.exports}var Zpe=Gpe();const Ype=In(Zpe);var UP=new Ype,VP="recharts.syncMouseEvents";function og(e){"@babel/helpers - typeof";return og=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},og(e)}function Xpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qpe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,z6(r.key),r)}}function Jpe(e,t,n){return t&&Qpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WP(e,t,n){return t=z6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z6(e){var t=eme(e,"string");return og(t)=="symbol"?t:t+""}function eme(e,t){if(og(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(og(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var tme=(function(){function e(){Xpe(this,e),WP(this,"activeIndex",0),WP(this,"coordinateList",[]),WP(this,"layout","horizontal")}return Jpe(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,a=i===void 0?null:i,o=n.container,s=o===void 0?null:o,c=n.layout,d=c===void 0?null:c,p=n.offset,m=p===void 0?null:p,y=n.mouseHandlerCallback,b=y===void 0?null:y;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=s??this.container,this.layout=d??this.layout,this.offset=m??this.offset,this.mouseHandlerCallback=b??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,o=i.y,s=i.height,c=this.coordinateList[this.activeIndex].coordinate,d=((n=window)===null||n===void 0?void 0:n.scrollX)||0,p=((r=window)===null||r===void 0?void 0:r.scrollY)||0,m=a+c+d,y=o+this.offset.top+s/2+p;this.mouseHandlerCallback({pageX:m,pageY:y})}}}])})();function nme(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&ct(r)&&ct(i))return!0}return!1}function rme(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function U6(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,o=gr(t,n,r,i),s=gr(t,n,r,a);return{points:[o,s],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function ime(e,t,n){var r,i,a,o;if(e==="horizontal")r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e==="vertical")i=t.y,o=i,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var s=t.cx,c=t.cy,d=t.innerRadius,p=t.outerRadius,m=t.angle,y=gr(s,c,d,m),b=gr(s,c,p,m);r=y.x,i=y.y,a=b.x,o=b.y}else return U6(t);return[{x:r,y:i},{x:a,y:o}]}function sg(e){"@babel/helpers - typeof";return sg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sg(e)}function w4(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 Qv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w4(Object(n),!0).forEach(function(r){ame(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ame(e,t,n){return t=ome(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ome(e){var t=sme(e,"string");return sg(t)=="symbol"?t:t+""}function sme(e,t){if(sg(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sg(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lme(e){var t,n,r=e.element,i=e.tooltipEventType,a=e.isActive,o=e.activeCoordinate,s=e.activePayload,c=e.offset,d=e.activeTooltipIndex,p=e.tooltipAxisBandSize,m=e.layout,y=e.chartName,b=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!b||!a||!o||y!=="ScatterChart"&&i!=="axis")return null;var P,x=BO;if(y==="ScatterChart")P=o,x=Uce;else if(y==="BarChart")P=rme(m,o,c,p),x=yA;else if(m==="radial"){var w=U6(o),T=w.cx,E=w.cy,k=w.radius,D=w.startAngle,I=w.endAngle;P={cx:T,cy:E,startAngle:D,endAngle:I,innerRadius:k,outerRadius:k},x=Hz}else P={points:ime(m,o,c)},x=BO;var R=Qv(Qv(Qv(Qv({stroke:"#ccc",pointerEvents:"none"},c),P),Jt(b,!1)),{},{payload:s,payloadIndex:d,className:pn("recharts-tooltip-cursor",b.className)});return M.isValidElement(b)?M.cloneElement(b,R):M.createElement(x,R)}var ume=["item"],cme=["children","className","width","height","style","compact","title","desc"];function Uh(e){"@babel/helpers - typeof";return Uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uh(e)}function Vd(){return Vd=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},Vd.apply(this,arguments)}function _4(e,t){return hme(e)||dme(e,t)||W6(e,t)||fme()}function fme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dme(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,o,s=[],c=!0,d=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(p){d=!0,i=p}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(d)throw i}}return s}}function hme(e){if(Array.isArray(e))return e}function S4(e,t){if(e==null)return{};var n=pme(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function pme(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 mme(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gme(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,K6(r.key),r)}}function vme(e,t,n){return t&&gme(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yme(e,t,n){return t=M0(t),bme(e,V6()?Reflect.construct(t,n||[],M0(e).constructor):t.apply(e,n))}function bme(e,t){if(t&&(Uh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xme(e)}function xme(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V6=function(){return!!e})()}function M0(e){return M0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},M0(e)}function wme(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gT(e,t)}function gT(e,t){return gT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},gT(e,t)}function Vh(e){return Pme(e)||Sme(e)||W6(e)||_me()}function _me(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W6(e,t){if(e){if(typeof e=="string")return vT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vT(e,t)}}function Sme(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pme(e){if(Array.isArray(e))return vT(e)}function vT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P4(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 Ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P4(Object(n),!0).forEach(function(r){Yt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yt(e,t,n){return t=K6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K6(e){var t=jme(e,"string");return Uh(t)=="symbol"?t:t+""}function jme(e,t){if(Uh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ome={xAxis:["bottom","top"],yAxis:["left","right"]},Tme={width:"100%",height:"100%"},H6={x:0,y:0};function Jv(e){return e}var Eme=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Ame=function(t,n,r,i){var a=n.find(function(p){return p&&p.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,s=i.radius;return Ke(Ke(Ke({},i),gr(i.cx,i.cy,s,o)),{},{angle:o,radius:s})}var c=a.coordinate,d=i.angle;return Ke(Ke(Ke({},i),gr(i.cx,i.cy,c,d)),{},{angle:d,radius:c})}return H6},Gb=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(s,c){var d=c.props.data;return d&&d.length?[].concat(Vh(s),Vh(d)):s},[]);return o.length>0?o:t&&t.length&&ct(i)&&ct(a)?t.slice(i,a+1):[]};function G6(e){return e==="number"?[0,"auto"]:void 0}var yT=function(t,n,r,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Gb(n,t);return r<0||!a||!a.length||r>=s.length?null:a.reduce(function(c,d){var p,m=(p=d.props.data)!==null&&p!==void 0?p:n;m&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(m=m.slice(t.dataStartIndex,t.dataEndIndex+1));var y;if(o.dataKey&&!o.allowDuplicatedCategory){var b=m===void 0?s:m;y=Jj(b,o.dataKey,i)}else y=m&&m[r]||s[r];return y?[].concat(Vh(c),[qz(d,y)]):c},[])},j4=function(t,n,r,i){var a=i||{x:t.chartX,y:t.chartY},o=Eme(a,r),s=t.orderedTooltipTicks,c=t.tooltipAxis,d=t.tooltipTicks,p=cse(o,s,d,c);if(p>=0&&d){var m=d[p]&&d[p].value,y=yT(t,n,p,m),b=Ame(r,s,p,a);return{activeTooltipIndex:p,activeLabel:m,activePayload:y,activeCoordinate:b}}return null},kme=function(t,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,o=n.axisIdKey,s=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,p=t.layout,m=t.children,y=t.stackOffset,b=Lz(p,a);return r.reduce(function(P,x){var w,T=x.type.defaultProps!==void 0?Ke(Ke({},x.type.defaultProps),x.props):x.props,E=T.type,k=T.dataKey,D=T.allowDataOverflow,I=T.allowDuplicatedCategory,R=T.scale,$=T.ticks,V=T.includeHidden,K=T[o];if(P[K])return P;var Z=Gb(t.data,{graphicalItems:i.filter(function(de){var He,je=o in de.props?de.props[o]:(He=de.type.defaultProps)===null||He===void 0?void 0:He[o];return je===K}),dataStartIndex:c,dataEndIndex:d}),ee=Z.length,ne,oe,he;nme(T.domain,D,E)&&(ne=MO(T.domain,null,D),b&&(E==="number"||R!=="auto")&&(he=gm(Z,k,"category")));var Se=G6(E);if(!ne||ne.length===0){var fe,Oe=(fe=T.domain)!==null&&fe!==void 0?fe:Se;if(k){if(ne=gm(Z,k,E),E==="category"&&b){var re=iJ(ne);I&&re?(oe=ne,ne=x0(0,ee)):I||(ne=kD(Oe,ne,x).reduce(function(de,He){return de.indexOf(He)>=0?de:[].concat(Vh(de),[He])},[]))}else if(E==="category")I?ne=ne.filter(function(de){return de!==""&&!_n(de)}):ne=kD(Oe,ne,x).reduce(function(de,He){return de.indexOf(He)>=0||He===""||_n(He)?de:[].concat(Vh(de),[He])},[]);else if(E==="number"){var Ce=mse(Z,i.filter(function(de){var He,je,$e=o in de.props?de.props[o]:(He=de.type.defaultProps)===null||He===void 0?void 0:He[o],We="hide"in de.props?de.props.hide:(je=de.type.defaultProps)===null||je===void 0?void 0:je.hide;return $e===K&&(V||!We)}),k,a,p);Ce&&(ne=Ce)}b&&(E==="number"||R!=="auto")&&(he=gm(Z,k,"category"))}else b?ne=x0(0,ee):s&&s[K]&&s[K].hasStack&&E==="number"?ne=y==="expand"?[0,1]:Fz(s[K].stackGroups,c,d):ne=Rz(Z,i.filter(function(de){var He=o in de.props?de.props[o]:de.type.defaultProps[o],je="hide"in de.props?de.props.hide:de.type.defaultProps.hide;return He===K&&(V||!je)}),E,p,!0);if(E==="number")ne=mT(m,ne,K,a,$),Oe&&(ne=MO(Oe,ne,D));else if(E==="category"&&Oe){var ae=Oe,ie=ne.every(function(de){return ae.indexOf(de)>=0});ie&&(ne=ae)}}return Ke(Ke({},P),{},Yt({},K,Ke(Ke({},T),{},{axisType:a,domain:ne,categoricalDomain:he,duplicateDomain:oe,originalDomain:(w=T.domain)!==null&&w!==void 0?w:Se,isCategorical:b,layout:p})))},{})},Cme=function(t,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,o=n.axisIdKey,s=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,p=t.layout,m=t.children,y=Gb(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:d}),b=y.length,P=Lz(p,a),x=-1;return r.reduce(function(w,T){var E=T.type.defaultProps!==void 0?Ke(Ke({},T.type.defaultProps),T.props):T.props,k=E[o],D=G6("number");if(!w[k]){x++;var I;return P?I=x0(0,b):s&&s[k]&&s[k].hasStack?(I=Fz(s[k].stackGroups,c,d),I=mT(m,I,k,a)):(I=MO(D,Rz(y,r.filter(function(R){var $,V,K=o in R.props?R.props[o]:($=R.type.defaultProps)===null||$===void 0?void 0:$[o],Z="hide"in R.props?R.props.hide:(V=R.type.defaultProps)===null||V===void 0?void 0:V.hide;return K===k&&!Z}),"number",p),i.defaultProps.allowDataOverflow),I=mT(m,I,k,a)),Ke(Ke({},w),{},Yt({},k,Ke(Ke({axisType:a},i.defaultProps),{},{hide:!0,orientation:Uo(Ome,"".concat(a,".").concat(x%2),null),domain:I,originalDomain:D,isCategorical:P,layout:p})))}return w},{})},Nme=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,s=n.stackGroups,c=n.dataStartIndex,d=n.dataEndIndex,p=t.children,m="".concat(i,"Id"),y=Os(p,a),b={};return y&&y.length?b=kme(t,{axes:y,graphicalItems:o,axisType:i,axisIdKey:m,stackGroups:s,dataStartIndex:c,dataEndIndex:d}):o&&o.length&&(b=Cme(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:m,stackGroups:s,dataStartIndex:c,dataEndIndex:d})),b},Mme=function(t){var n=mc(t),r=_u(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:WE(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:s0(n,r)}},O4=function(t){var n=t.children,r=t.defaultShowTooltip,i=$o(n,Mh),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},Rme=function(t){return!t||!t.length?!1:t.some(function(n){var r=Su(n&&n.type);return r&&r.indexOf("Bar")>=0})},T4=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Lme=function(t,n){var r=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,c=s===void 0?{}:s,d=r.width,p=r.height,m=r.children,y=r.margin||{},b=$o(m,Mh),P=$o(m,Cc),x=Object.keys(c).reduce(function(I,R){var $=c[R],V=$.orientation;return!$.mirror&&!$.hide?Ke(Ke({},I),{},Yt({},V,I[V]+$.width)):I},{left:y.left||0,right:y.right||0}),w=Object.keys(o).reduce(function(I,R){var $=o[R],V=$.orientation;return!$.mirror&&!$.hide?Ke(Ke({},I),{},Yt({},V,Uo(I,"".concat(V))+$.height)):I},{top:y.top||0,bottom:y.bottom||0}),T=Ke(Ke({},w),x),E=T.bottom;b&&(T.bottom+=b.props.height||Mh.defaultProps.height),P&&n&&(T=hse(T,i,r,n));var k=d-T.left-T.right,D=p-T.top-T.bottom;return Ke(Ke({brushBottom:E},T),{},{width:Math.max(k,0),height:Math.max(D,0)})},Ime=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Z6=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,c=t.axisComponents,d=t.legendContent,p=t.formatAxisMap,m=t.defaultProps,y=function(T,E){var k=E.graphicalItems,D=E.stackGroups,I=E.offset,R=E.updateId,$=E.dataStartIndex,V=E.dataEndIndex,K=T.barSize,Z=T.layout,ee=T.barGap,ne=T.barCategoryGap,oe=T.maxBarSize,he=T4(Z),Se=he.numericAxisName,fe=he.cateAxisName,Oe=Rme(k),re=[];return k.forEach(function(Ce,ae){var ie=Gb(T.data,{graphicalItems:[Ce],dataStartIndex:$,dataEndIndex:V}),de=Ce.type.defaultProps!==void 0?Ke(Ke({},Ce.type.defaultProps),Ce.props):Ce.props,He=de.dataKey,je=de.maxBarSize,$e=de["".concat(Se,"Id")],We=de["".concat(fe,"Id")],Ye={},rt=c.reduce(function(Bn,_r){var fr=E["".concat(_r.axisType,"Map")],To=de["".concat(_r.axisType,"Id")];fr&&fr[To]||_r.axisType==="zAxis"||td();var ua=fr[To];return Ke(Ke({},Bn),{},Yt(Yt({},_r.axisType,ua),"".concat(_r.axisType,"Ticks"),_u(ua)))},Ye),ze=rt[fe],Fe=rt["".concat(fe,"Ticks")],st=D&&D[$e]&&D[$e].hasStack&&Pse(Ce,D[$e].stackGroups),Te=Su(Ce.type).indexOf("Bar")>=0,Dt=s0(ze,Fe),Lt=[],dn=Oe&&fse({barSize:K,stackGroups:D,totalSize:Ime(rt,fe)});if(Te){var xn,qn,Ar=_n(je)?oe:je,Zr=(xn=(qn=s0(ze,Fe,!0))!==null&&qn!==void 0?qn:Ar)!==null&&xn!==void 0?xn:0;Lt=dse({barGap:ee,barCategoryGap:ne,bandSize:Zr!==Dt?Zr:Dt,sizeList:dn[We],maxBarSize:Ar}),Zr!==Dt&&(Lt=Lt.map(function(Bn){return Ke(Ke({},Bn),{},{position:Ke(Ke({},Bn.position),{},{offset:Bn.position.offset-Zr/2})})}))}var $r=Ce&&Ce.type&&Ce.type.getComposedData;$r&&re.push({props:Ke(Ke({},$r(Ke(Ke({},rt),{},{displayedData:ie,props:T,dataKey:He,item:Ce,bandSize:Dt,barPosition:Lt,offset:I,stackedData:st,layout:Z,dataStartIndex:$,dataEndIndex:V}))),{},Yt(Yt(Yt({key:Ce.key||"item-".concat(ae)},Se,rt[Se]),fe,rt[fe]),"animationId",R)),childIndex:gJ(Ce,T.children),item:Ce})}),re},b=function(T,E){var k=T.props,D=T.dataStartIndex,I=T.dataEndIndex,R=T.updateId;if(!WM({props:k}))return null;var $=k.children,V=k.layout,K=k.stackOffset,Z=k.data,ee=k.reverseStackOrder,ne=T4(V),oe=ne.numericAxisName,he=ne.cateAxisName,Se=Os($,r),fe=_se(Z,Se,"".concat(oe,"Id"),"".concat(he,"Id"),K,ee),Oe=c.reduce(function(de,He){var je="".concat(He.axisType,"Map");return Ke(Ke({},de),{},Yt({},je,Nme(k,Ke(Ke({},He),{},{graphicalItems:Se,stackGroups:He.axisType===oe&&fe,dataStartIndex:D,dataEndIndex:I}))))},{}),re=Lme(Ke(Ke({},Oe),{},{props:k,graphicalItems:Se}),E==null?void 0:E.legendBBox);Object.keys(Oe).forEach(function(de){Oe[de]=p(k,Oe[de],re,de.replace("Map",""),n)});var Ce=Oe["".concat(he,"Map")],ae=Mme(Ce),ie=y(k,Ke(Ke({},Oe),{},{dataStartIndex:D,dataEndIndex:I,updateId:R,graphicalItems:Se,stackGroups:fe,offset:re}));return Ke(Ke({formattedGraphicalItems:ie,graphicalItems:Se,offset:re,stackGroups:fe},ae),Oe)},P=(function(w){function T(E){var k,D,I;return mme(this,T),I=yme(this,T,[E]),Yt(I,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Yt(I,"accessibilityManager",new tme),Yt(I,"handleLegendBBoxUpdate",function(R){if(R){var $=I.state,V=$.dataStartIndex,K=$.dataEndIndex,Z=$.updateId;I.setState(Ke({legendBBox:R},b({props:I.props,dataStartIndex:V,dataEndIndex:K,updateId:Z},Ke(Ke({},I.state),{},{legendBBox:R}))))}}),Yt(I,"handleReceiveSyncEvent",function(R,$,V){if(I.props.syncId===R){if(V===I.eventEmitterSymbol&&typeof I.props.syncMethod!="function")return;I.applySyncEvent($)}}),Yt(I,"handleBrushChange",function(R){var $=R.startIndex,V=R.endIndex;if($!==I.state.dataStartIndex||V!==I.state.dataEndIndex){var K=I.state.updateId;I.setState(function(){return Ke({dataStartIndex:$,dataEndIndex:V},b({props:I.props,dataStartIndex:$,dataEndIndex:V,updateId:K},I.state))}),I.triggerSyncEvent({dataStartIndex:$,dataEndIndex:V})}}),Yt(I,"handleMouseEnter",function(R){var $=I.getMouseInfo(R);if($){var V=Ke(Ke({},$),{},{isTooltipActive:!0});I.setState(V),I.triggerSyncEvent(V);var K=I.props.onMouseEnter;tn(K)&&K(V,R)}}),Yt(I,"triggeredAfterMouseMove",function(R){var $=I.getMouseInfo(R),V=$?Ke(Ke({},$),{},{isTooltipActive:!0}):{isTooltipActive:!1};I.setState(V),I.triggerSyncEvent(V);var K=I.props.onMouseMove;tn(K)&&K(V,R)}),Yt(I,"handleItemMouseEnter",function(R){I.setState(function(){return{isTooltipActive:!0,activeItem:R,activePayload:R.tooltipPayload,activeCoordinate:R.tooltipPosition||{x:R.cx,y:R.cy}}})}),Yt(I,"handleItemMouseLeave",function(){I.setState(function(){return{isTooltipActive:!1}})}),Yt(I,"handleMouseMove",function(R){R.persist(),I.throttleTriggeredAfterMouseMove(R)}),Yt(I,"handleMouseLeave",function(R){I.throttleTriggeredAfterMouseMove.cancel();var $={isTooltipActive:!1};I.setState($),I.triggerSyncEvent($);var V=I.props.onMouseLeave;tn(V)&&V($,R)}),Yt(I,"handleOuterEvent",function(R){var $=mJ(R),V=Uo(I.props,"".concat($));if($&&tn(V)){var K,Z;/.*touch.*/i.test($)?Z=I.getMouseInfo(R.changedTouches[0]):Z=I.getMouseInfo(R),V((K=Z)!==null&&K!==void 0?K:{},R)}}),Yt(I,"handleClick",function(R){var $=I.getMouseInfo(R);if($){var V=Ke(Ke({},$),{},{isTooltipActive:!0});I.setState(V),I.triggerSyncEvent(V);var K=I.props.onClick;tn(K)&&K(V,R)}}),Yt(I,"handleMouseDown",function(R){var $=I.props.onMouseDown;if(tn($)){var V=I.getMouseInfo(R);$(V,R)}}),Yt(I,"handleMouseUp",function(R){var $=I.props.onMouseUp;if(tn($)){var V=I.getMouseInfo(R);$(V,R)}}),Yt(I,"handleTouchMove",function(R){R.changedTouches!=null&&R.changedTouches.length>0&&I.throttleTriggeredAfterMouseMove(R.changedTouches[0])}),Yt(I,"handleTouchStart",function(R){R.changedTouches!=null&&R.changedTouches.length>0&&I.handleMouseDown(R.changedTouches[0])}),Yt(I,"handleTouchEnd",function(R){R.changedTouches!=null&&R.changedTouches.length>0&&I.handleMouseUp(R.changedTouches[0])}),Yt(I,"handleDoubleClick",function(R){var $=I.props.onDoubleClick;if(tn($)){var V=I.getMouseInfo(R);$(V,R)}}),Yt(I,"handleContextMenu",function(R){var $=I.props.onContextMenu;if(tn($)){var V=I.getMouseInfo(R);$(V,R)}}),Yt(I,"triggerSyncEvent",function(R){I.props.syncId!==void 0&&UP.emit(VP,I.props.syncId,R,I.eventEmitterSymbol)}),Yt(I,"applySyncEvent",function(R){var $=I.props,V=$.layout,K=$.syncMethod,Z=I.state.updateId,ee=R.dataStartIndex,ne=R.dataEndIndex;if(R.dataStartIndex!==void 0||R.dataEndIndex!==void 0)I.setState(Ke({dataStartIndex:ee,dataEndIndex:ne},b({props:I.props,dataStartIndex:ee,dataEndIndex:ne,updateId:Z},I.state)));else if(R.activeTooltipIndex!==void 0){var oe=R.chartX,he=R.chartY,Se=R.activeTooltipIndex,fe=I.state,Oe=fe.offset,re=fe.tooltipTicks;if(!Oe)return;if(typeof K=="function")Se=K(re,R);else if(K==="value"){Se=-1;for(var Ce=0;Ce<re.length;Ce++)if(re[Ce].value===R.activeLabel){Se=Ce;break}}var ae=Ke(Ke({},Oe),{},{x:Oe.left,y:Oe.top}),ie=Math.min(oe,ae.x+ae.width),de=Math.min(he,ae.y+ae.height),He=re[Se]&&re[Se].value,je=yT(I.state,I.props.data,Se),$e=re[Se]?{x:V==="horizontal"?re[Se].coordinate:ie,y:V==="horizontal"?de:re[Se].coordinate}:H6;I.setState(Ke(Ke({},R),{},{activeLabel:He,activeCoordinate:$e,activePayload:je,activeTooltipIndex:Se}))}else I.setState(R)}),Yt(I,"renderCursor",function(R){var $,V=I.state,K=V.isTooltipActive,Z=V.activeCoordinate,ee=V.activePayload,ne=V.offset,oe=V.activeTooltipIndex,he=V.tooltipAxisBandSize,Se=I.getTooltipEventType(),fe=($=R.props.active)!==null&&$!==void 0?$:K,Oe=I.props.layout,re=R.key||"_recharts-cursor";return ce.createElement(lme,{key:re,activeCoordinate:Z,activePayload:ee,activeTooltipIndex:oe,chartName:n,element:R,isActive:fe,layout:Oe,offset:ne,tooltipAxisBandSize:he,tooltipEventType:Se})}),Yt(I,"renderPolarAxis",function(R,$,V){var K=Uo(R,"type.axisType"),Z=Uo(I.state,"".concat(K,"Map")),ee=R.type.defaultProps,ne=ee!==void 0?Ke(Ke({},ee),R.props):R.props,oe=Z&&Z[ne["".concat(K,"Id")]];return M.cloneElement(R,Ke(Ke({},oe),{},{className:pn(K,oe.className),key:R.key||"".concat($,"-").concat(V),ticks:_u(oe,!0)}))}),Yt(I,"renderPolarGrid",function(R){var $=R.props,V=$.radialLines,K=$.polarAngles,Z=$.polarRadius,ee=I.state,ne=ee.radiusAxisMap,oe=ee.angleAxisMap,he=mc(ne),Se=mc(oe),fe=Se.cx,Oe=Se.cy,re=Se.innerRadius,Ce=Se.outerRadius;return M.cloneElement(R,{polarAngles:Array.isArray(K)?K:_u(Se,!0).map(function(ae){return ae.coordinate}),polarRadius:Array.isArray(Z)?Z:_u(he,!0).map(function(ae){return ae.coordinate}),cx:fe,cy:Oe,innerRadius:re,outerRadius:Ce,key:R.key||"polar-grid",radialLines:V})}),Yt(I,"renderLegend",function(){var R=I.state.formattedGraphicalItems,$=I.props,V=$.children,K=$.width,Z=$.height,ee=I.props.margin||{},ne=K-(ee.left||0)-(ee.right||0),oe=Nz({children:V,formattedGraphicalItems:R,legendWidth:ne,legendContent:d});if(!oe)return null;var he=oe.item,Se=S4(oe,ume);return M.cloneElement(he,Ke(Ke({},Se),{},{chartWidth:K,chartHeight:Z,margin:ee,onBBoxUpdate:I.handleLegendBBoxUpdate}))}),Yt(I,"renderTooltip",function(){var R,$=I.props,V=$.children,K=$.accessibilityLayer,Z=$o(V,wo);if(!Z)return null;var ee=I.state,ne=ee.isTooltipActive,oe=ee.activeCoordinate,he=ee.activePayload,Se=ee.activeLabel,fe=ee.offset,Oe=(R=Z.props.active)!==null&&R!==void 0?R:ne;return M.cloneElement(Z,{viewBox:Ke(Ke({},fe),{},{x:fe.left,y:fe.top}),active:Oe,label:Se,payload:Oe?he:[],coordinate:oe,accessibilityLayer:K})}),Yt(I,"renderBrush",function(R){var $=I.props,V=$.margin,K=$.data,Z=I.state,ee=Z.offset,ne=Z.dataStartIndex,oe=Z.dataEndIndex,he=Z.updateId;return M.cloneElement(R,{key:R.key||"_recharts-brush",onChange:Gv(I.handleBrushChange,R.props.onChange),data:K,x:ct(R.props.x)?R.props.x:ee.left,y:ct(R.props.y)?R.props.y:ee.top+ee.height+ee.brushBottom-(V.bottom||0),width:ct(R.props.width)?R.props.width:ee.width,startIndex:ne,endIndex:oe,updateId:"brush-".concat(he)})}),Yt(I,"renderReferenceElement",function(R,$,V){if(!R)return null;var K=I,Z=K.clipPathId,ee=I.state,ne=ee.xAxisMap,oe=ee.yAxisMap,he=ee.offset,Se=R.type.defaultProps||{},fe=R.props,Oe=fe.xAxisId,re=Oe===void 0?Se.xAxisId:Oe,Ce=fe.yAxisId,ae=Ce===void 0?Se.yAxisId:Ce;return M.cloneElement(R,{key:R.key||"".concat($,"-").concat(V),xAxis:ne[re],yAxis:oe[ae],viewBox:{x:he.left,y:he.top,width:he.width,height:he.height},clipPathId:Z})}),Yt(I,"renderActivePoints",function(R){var $=R.item,V=R.activePoint,K=R.basePoint,Z=R.childIndex,ee=R.isRange,ne=[],oe=$.props.key,he=$.item.type.defaultProps!==void 0?Ke(Ke({},$.item.type.defaultProps),$.item.props):$.item.props,Se=he.activeDot,fe=he.dataKey,Oe=Ke(Ke({index:Z,dataKey:fe,cx:V.x,cy:V.y,r:4,fill:vA($.item),strokeWidth:2,stroke:"#fff",payload:V.payload,value:V.value},Jt(Se,!1)),Iy(Se));return ne.push(T.renderActiveDot(Se,Oe,"".concat(oe,"-activePoint-").concat(Z))),K?ne.push(T.renderActiveDot(Se,Ke(Ke({},Oe),{},{cx:K.x,cy:K.y}),"".concat(oe,"-basePoint-").concat(Z))):ee&&ne.push(null),ne}),Yt(I,"renderGraphicChild",function(R,$,V){var K=I.filterFormatItem(R,$,V);if(!K)return null;var Z=I.getTooltipEventType(),ee=I.state,ne=ee.isTooltipActive,oe=ee.tooltipAxis,he=ee.activeTooltipIndex,Se=ee.activeLabel,fe=I.props.children,Oe=$o(fe,wo),re=K.props,Ce=re.points,ae=re.isRange,ie=re.baseLine,de=K.item.type.defaultProps!==void 0?Ke(Ke({},K.item.type.defaultProps),K.item.props):K.item.props,He=de.activeDot,je=de.hide,$e=de.activeBar,We=de.activeShape,Ye=!!(!je&&ne&&Oe&&(He||$e||We)),rt={};Z!=="axis"&&Oe&&Oe.props.trigger==="click"?rt={onClick:Gv(I.handleItemMouseEnter,R.props.onClick)}:Z!=="axis"&&(rt={onMouseLeave:Gv(I.handleItemMouseLeave,R.props.onMouseLeave),onMouseEnter:Gv(I.handleItemMouseEnter,R.props.onMouseEnter)});var ze=M.cloneElement(R,Ke(Ke({},K.props),rt));function Fe(_r){return typeof oe.dataKey=="function"?oe.dataKey(_r.payload):null}if(Ye)if(he>=0){var st,Te;if(oe.dataKey&&!oe.allowDuplicatedCategory){var Dt=typeof oe.dataKey=="function"?Fe:"payload.".concat(oe.dataKey.toString());st=Jj(Ce,Dt,Se),Te=ae&&ie&&Jj(ie,Dt,Se)}else st=Ce==null?void 0:Ce[he],Te=ae&&ie&&ie[he];if(We||$e){var Lt=R.props.activeIndex!==void 0?R.props.activeIndex:he;return[M.cloneElement(R,Ke(Ke(Ke({},K.props),rt),{},{activeIndex:Lt})),null,null]}if(!_n(st))return[ze].concat(Vh(I.renderActivePoints({item:K,activePoint:st,basePoint:Te,childIndex:he,isRange:ae})))}else{var dn,xn=(dn=I.getItemByXY(I.state.activeCoordinate))!==null&&dn!==void 0?dn:{graphicalItem:ze},qn=xn.graphicalItem,Ar=qn.item,Zr=Ar===void 0?R:Ar,$r=qn.childIndex,Bn=Ke(Ke(Ke({},K.props),rt),{},{activeIndex:$r});return[M.cloneElement(Zr,Bn),null,null]}return ae?[ze,null,null]:[ze,null]}),Yt(I,"renderCustomized",function(R,$,V){return M.cloneElement(R,Ke(Ke({key:"recharts-customized-".concat(V)},I.props),I.state))}),Yt(I,"renderMap",{CartesianGrid:{handler:Jv,once:!0},ReferenceArea:{handler:I.renderReferenceElement},ReferenceLine:{handler:Jv},ReferenceDot:{handler:I.renderReferenceElement},XAxis:{handler:Jv},YAxis:{handler:Jv},Brush:{handler:I.renderBrush,once:!0},Bar:{handler:I.renderGraphicChild},Line:{handler:I.renderGraphicChild},Area:{handler:I.renderGraphicChild},Radar:{handler:I.renderGraphicChild},RadialBar:{handler:I.renderGraphicChild},Scatter:{handler:I.renderGraphicChild},Pie:{handler:I.renderGraphicChild},Funnel:{handler:I.renderGraphicChild},Tooltip:{handler:I.renderCursor,once:!0},PolarGrid:{handler:I.renderPolarGrid,once:!0},PolarAngleAxis:{handler:I.renderPolarAxis},PolarRadiusAxis:{handler:I.renderPolarAxis},Customized:{handler:I.renderCustomized}}),I.clipPathId="".concat((k=E.id)!==null&&k!==void 0?k:kg("recharts"),"-clip"),I.throttleTriggeredAfterMouseMove=Nq(I.triggeredAfterMouseMove,(D=E.throttleDelay)!==null&&D!==void 0?D:1e3/60),I.state={},I}return wme(T,w),vme(T,[{key:"componentDidMount",value:function(){var k,D;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(k=this.props.margin.left)!==null&&k!==void 0?k:0,top:(D=this.props.margin.top)!==null&&D!==void 0?D:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var k=this.props,D=k.children,I=k.data,R=k.height,$=k.layout,V=$o(D,wo);if(V){var K=V.props.defaultIndex;if(!(typeof K!="number"||K<0||K>this.state.tooltipTicks.length-1)){var Z=this.state.tooltipTicks[K]&&this.state.tooltipTicks[K].value,ee=yT(this.state,I,K,Z),ne=this.state.tooltipTicks[K].coordinate,oe=(this.state.offset.top+R)/2,he=$==="horizontal",Se=he?{x:ne,y:oe}:{y:ne,x:oe},fe=this.state.formattedGraphicalItems.find(function(re){var Ce=re.item;return Ce.type.name==="Scatter"});fe&&(Se=Ke(Ke({},Se),fe.props.points[K].tooltipPosition),ee=fe.props.points[K].tooltipPayload);var Oe={activeTooltipIndex:K,isTooltipActive:!0,activeLabel:Z,activePayload:ee,activeCoordinate:Se};this.setState(Oe),this.renderCursor(V),this.accessibilityManager.setIndex(K)}}}},{key:"getSnapshotBeforeUpdate",value:function(k,D){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==D.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==k.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==k.margin){var I,R;this.accessibilityManager.setDetails({offset:{left:(I=this.props.margin.left)!==null&&I!==void 0?I:0,top:(R=this.props.margin.top)!==null&&R!==void 0?R:0}})}return null}},{key:"componentDidUpdate",value:function(k){tO([$o(k.children,wo)],[$o(this.props.children,wo)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var k=$o(this.props.children,wo);if(k&&typeof k.props.shared=="boolean"){var D=k.props.shared?"axis":"item";return s.indexOf(D)>=0?D:a}return a}},{key:"getMouseInfo",value:function(k){if(!this.container)return null;var D=this.container,I=D.getBoundingClientRect(),R=nre(I),$={chartX:Math.round(k.pageX-R.left),chartY:Math.round(k.pageY-R.top)},V=I.width/D.offsetWidth||1,K=this.inRange($.chartX,$.chartY,V);if(!K)return null;var Z=this.state,ee=Z.xAxisMap,ne=Z.yAxisMap,oe=this.getTooltipEventType(),he=j4(this.state,this.props.data,this.props.layout,K);if(oe!=="axis"&&ee&&ne){var Se=mc(ee).scale,fe=mc(ne).scale,Oe=Se&&Se.invert?Se.invert($.chartX):null,re=fe&&fe.invert?fe.invert($.chartY):null;return Ke(Ke({},$),{},{xValue:Oe,yValue:re},he)}return he?Ke(Ke({},$),he):null}},{key:"inRange",value:function(k,D){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,R=this.props.layout,$=k/I,V=D/I;if(R==="horizontal"||R==="vertical"){var K=this.state.offset,Z=$>=K.left&&$<=K.left+K.width&&V>=K.top&&V<=K.top+K.height;return Z?{x:$,y:V}:null}var ee=this.state,ne=ee.angleAxisMap,oe=ee.radiusAxisMap;if(ne&&oe){var he=mc(ne);return MD({x:$,y:V},he)}return null}},{key:"parseEventsOfWrapper",value:function(){var k=this.props.children,D=this.getTooltipEventType(),I=$o(k,wo),R={};I&&D==="axis"&&(I.props.trigger==="click"?R={onClick:this.handleClick}:R={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var $=Iy(this.props,this.handleOuterEvent);return Ke(Ke({},$),R)}},{key:"addListener",value:function(){UP.on(VP,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){UP.removeListener(VP,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(k,D,I){for(var R=this.state.formattedGraphicalItems,$=0,V=R.length;$<V;$++){var K=R[$];if(K.item===k||K.props.key===k.key||D===Su(K.item.type)&&I===K.childIndex)return K}return null}},{key:"renderClipPath",value:function(){var k=this.clipPathId,D=this.state.offset,I=D.left,R=D.top,$=D.height,V=D.width;return ce.createElement("defs",null,ce.createElement("clipPath",{id:k},ce.createElement("rect",{x:I,y:R,height:$,width:V})))}},{key:"getXScales",value:function(){var k=this.state.xAxisMap;return k?Object.entries(k).reduce(function(D,I){var R=_4(I,2),$=R[0],V=R[1];return Ke(Ke({},D),{},Yt({},$,V.scale))},{}):null}},{key:"getYScales",value:function(){var k=this.state.yAxisMap;return k?Object.entries(k).reduce(function(D,I){var R=_4(I,2),$=R[0],V=R[1];return Ke(Ke({},D),{},Yt({},$,V.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(k){var D;return(D=this.state.xAxisMap)===null||D===void 0||(D=D[k])===null||D===void 0?void 0:D.scale}},{key:"getYScaleByAxisId",value:function(k){var D;return(D=this.state.yAxisMap)===null||D===void 0||(D=D[k])===null||D===void 0?void 0:D.scale}},{key:"getItemByXY",value:function(k){var D=this.state,I=D.formattedGraphicalItems,R=D.activeItem;if(I&&I.length)for(var $=0,V=I.length;$<V;$++){var K=I[$],Z=K.props,ee=K.item,ne=ee.type.defaultProps!==void 0?Ke(Ke({},ee.type.defaultProps),ee.props):ee.props,oe=Su(ee.type);if(oe==="Bar"){var he=(Z.data||[]).find(function(re){return Sce(k,re)});if(he)return{graphicalItem:K,payload:he}}else if(oe==="RadialBar"){var Se=(Z.data||[]).find(function(re){return MD(k,re)});if(Se)return{graphicalItem:K,payload:Se}}else if(qb(K,R)||zb(K,R)||tg(K,R)){var fe=Kfe({graphicalItem:K,activeTooltipItem:R,itemData:ne.data}),Oe=ne.activeIndex===void 0?fe:ne.activeIndex;return{graphicalItem:Ke(Ke({},K),{},{childIndex:Oe}),payload:tg(K,R)?ne.data[fe]:K.props.data[fe]}}}return null}},{key:"render",value:function(){var k=this;if(!WM(this))return null;var D=this.props,I=D.children,R=D.className,$=D.width,V=D.height,K=D.style,Z=D.compact,ee=D.title,ne=D.desc,oe=S4(D,cme),he=Jt(oe,!1);if(Z)return ce.createElement(o4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},ce.createElement(rO,Vd({},he,{width:$,height:V,title:ee,desc:ne}),this.renderClipPath(),HM(I,this.renderMap)));if(this.props.accessibilityLayer){var Se,fe;he.tabIndex=(Se=this.props.tabIndex)!==null&&Se!==void 0?Se:0,he.role=(fe=this.props.role)!==null&&fe!==void 0?fe:"application",he.onKeyDown=function(re){k.accessibilityManager.keyboardEvent(re)},he.onFocus=function(){k.accessibilityManager.focus()}}var Oe=this.parseEventsOfWrapper();return ce.createElement(o4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},ce.createElement("div",Vd({className:pn("recharts-wrapper",R),style:Ke({position:"relative",cursor:"default",width:$,height:V},K)},Oe,{ref:function(Ce){k.container=Ce}}),ce.createElement(rO,Vd({},he,{width:$,height:V,title:ee,desc:ne,style:Tme}),this.renderClipPath(),HM(I,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(M.Component);Yt(P,"displayName",n),Yt(P,"defaultProps",Ke({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},m)),Yt(P,"getDerivedStateFromProps",function(w,T){var E=w.dataKey,k=w.data,D=w.children,I=w.width,R=w.height,$=w.layout,V=w.stackOffset,K=w.margin,Z=T.dataStartIndex,ee=T.dataEndIndex;if(T.updateId===void 0){var ne=O4(w);return Ke(Ke(Ke({},ne),{},{updateId:0},b(Ke(Ke({props:w},ne),{},{updateId:0}),T)),{},{prevDataKey:E,prevData:k,prevWidth:I,prevHeight:R,prevLayout:$,prevStackOffset:V,prevMargin:K,prevChildren:D})}if(E!==T.prevDataKey||k!==T.prevData||I!==T.prevWidth||R!==T.prevHeight||$!==T.prevLayout||V!==T.prevStackOffset||!Yd(K,T.prevMargin)){var oe=O4(w),he={chartX:T.chartX,chartY:T.chartY,isTooltipActive:T.isTooltipActive},Se=Ke(Ke({},j4(T,k,$)),{},{updateId:T.updateId+1}),fe=Ke(Ke(Ke({},oe),he),Se);return Ke(Ke(Ke({},fe),b(Ke({props:w},fe),T)),{},{prevDataKey:E,prevData:k,prevWidth:I,prevHeight:R,prevLayout:$,prevStackOffset:V,prevMargin:K,prevChildren:D})}if(!tO(D,T.prevChildren)){var Oe,re,Ce,ae,ie=$o(D,Mh),de=ie&&(Oe=(re=ie.props)===null||re===void 0?void 0:re.startIndex)!==null&&Oe!==void 0?Oe:Z,He=ie&&(Ce=(ae=ie.props)===null||ae===void 0?void 0:ae.endIndex)!==null&&Ce!==void 0?Ce:ee,je=de!==Z||He!==ee,$e=!_n(k),We=$e&&!je?T.updateId:T.updateId+1;return Ke(Ke({updateId:We},b(Ke(Ke({props:w},T),{},{updateId:We,dataStartIndex:de,dataEndIndex:He}),T)),{},{prevChildren:D,dataStartIndex:de,dataEndIndex:He})}return null}),Yt(P,"renderActiveDot",function(w,T,E){var k;return M.isValidElement(w)?k=M.cloneElement(w,T):tn(w)?k=w(T):k=ce.createElement(bA,T),ce.createElement(tr,{className:"recharts-active-dot",key:E},k)});var x=M.forwardRef(function(T,E){return ce.createElement(P,Vd({},T,{ref:E}))});return x.displayName=P.displayName,x},bT=Z6({chartName:"BarChart",GraphicalChild:Nu,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Fh},{axisType:"yAxis",AxisComp:zh}],formatAxisMap:Zde}),Y6=Z6({chartName:"PieChart",GraphicalChild:Gl,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Fb},{axisType:"radiusAxis",AxisComp:Bb}],formatAxisMap:Rse,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function Dme({data:e,title:t}){return h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-2",children:h.jsx(Ei,{className:"text-lg font-semibold text-slate-800",children:t})}),h.jsx(Pn,{children:h.jsx("div",{className:"h-72",children:h.jsx(hm,{width:"100%",height:"100%",children:h.jsxs(bT,{data:e,layout:"vertical",margin:{left:20,right:20},children:[h.jsx(k0,{strokeDasharray:"3 3",horizontal:!0,vertical:!1,stroke:"#e2e8f0"}),h.jsx(Fh,{type:"number",tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),h.jsx(zh,{type:"category",dataKey:"name",tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1,width:100}),h.jsx(wo,{contentStyle:{backgroundColor:"white",border:"none",borderRadius:"12px",boxShadow:"0 4px 20px rgba(0,0,0,0.1)"}}),h.jsx(Nu,{dataKey:"value",fill:"#16a34a",radius:[0,6,6,0]})]})})})})]})}const E4=["#16a34a","#22c55e","#4ade80","#86efac","#bbf7d0","#dcfce7"];function Bme({data:e,title:t}){return h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-2",children:h.jsx(Ei,{className:"text-lg font-semibold text-slate-800",children:t})}),h.jsx(Pn,{children:h.jsx("div",{className:"h-72",children:h.jsx(hm,{width:"100%",height:"100%",children:h.jsxs(Y6,{children:[h.jsx(Gl,{data:e,cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:3,dataKey:"value",children:e.map((n,r)=>h.jsx(Sh,{fill:E4[r%E4.length]},`cell-${r}`))}),h.jsx(wo,{contentStyle:{backgroundColor:"white",border:"none",borderRadius:"12px",boxShadow:"0 4px 20px rgba(0,0,0,0.1)"}}),h.jsx(Cc,{verticalAlign:"bottom",height:36,formatter:n=>h.jsx("span",{className:"text-sm text-slate-600",children:n})})]})})})})]})}const X6=M.createContext({});function $me(e){const t=M.useRef(null);return t.current===null&&(t.current=e()),t.current}const AA=M.createContext(null),Q6=M.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Fme(e=!0){const t=M.useContext(AA);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=M.useId();M.useEffect(()=>{e&&i(a)},[e]);const o=M.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const kA=typeof window<"u",qme=kA?M.useLayoutEffect:M.useEffect,Vo=e=>e;let J6=Vo;function CA(e){let t;return()=>(t===void 0&&(t=e()),t)}const Wh=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},ju=e=>e*1e3,Ou=e=>e/1e3,zme={useManualTiming:!1};function Ume(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(d){a.has(d)&&(c.schedule(d),e()),d(o)}const c={schedule:(d,p=!1,m=!1)=>{const b=m&&r?t:n;return p&&a.add(d),b.has(d)||b.add(d),d},cancel:d=>{n.delete(d),a.delete(d)},process:d=>{if(o=d,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(d))}};return c}const ey=["read","resolveKeyframes","update","preRender","render","postRender"],Vme=40;function eU(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=ey.reduce((T,E)=>(T[E]=Ume(a),T),{}),{read:s,resolveKeyframes:c,update:d,preRender:p,render:m,postRender:y}=o,b=()=>{const T=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(T-i.timestamp,Vme),1),i.timestamp=T,i.isProcessing=!0,s.process(i),c.process(i),d.process(i),p.process(i),m.process(i),y.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(b))},P=()=>{n=!0,r=!0,i.isProcessing||e(b)};return{schedule:ey.reduce((T,E)=>{const k=o[E];return T[E]=(D,I=!1,R=!1)=>(n||P(),k.schedule(D,I,R)),T},{}),cancel:T=>{for(let E=0;E<ey.length;E++)o[ey[E]].cancel(T)},state:i,steps:o}}const{schedule:wr,cancel:Bc,state:oa,steps:KP}=eU(typeof requestAnimationFrame<"u"?requestAnimationFrame:Vo,!0),tU=M.createContext({strict:!1}),A4={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Kh={};for(const e in A4)Kh[e]={isEnabled:t=>A4[e].some(n=>!!t[n])};function Wme(e){for(const t in e)Kh[t]={...Kh[t],...e[t]}}const Kme=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function R0(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Kme.has(e)}let nU=e=>!R0(e);function Hme(e){e&&(nU=t=>t.startsWith("on")?!R0(t):e(t))}try{Hme(require("@emotion/is-prop-valid").default)}catch{}function Gme(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(nU(i)||n===!0&&R0(i)||!t&&!R0(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Zme(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Zb=M.createContext({});function lg(e){return typeof e=="string"||Array.isArray(e)}function Yb(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const NA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],MA=["initial",...NA];function Xb(e){return Yb(e.animate)||MA.some(t=>lg(e[t]))}function rU(e){return!!(Xb(e)||e.variants)}function Yme(e,t){if(Xb(e)){const{initial:n,animate:r}=e;return{initial:n===!1||lg(n)?n:void 0,animate:lg(r)?r:void 0}}return e.inherit!==!1?t:{}}function Xme(e){const{initial:t,animate:n}=Yme(e,M.useContext(Zb));return M.useMemo(()=>({initial:t,animate:n}),[k4(t),k4(n)])}function k4(e){return Array.isArray(e)?e.join(" "):e}const Qme=Symbol.for("motionComponentSymbol");function Wd(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Jme(e,t,n){return M.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Wd(n)&&(n.current=r))},[t])}const RA=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ege="framerAppearId",iU="data-"+RA(ege),{schedule:LA}=eU(queueMicrotask,!1),aU=M.createContext({});function tge(e,t,n,r,i){var a,o;const{visualElement:s}=M.useContext(Zb),c=M.useContext(tU),d=M.useContext(AA),p=M.useContext(Q6).reducedMotion,m=M.useRef(null);r=r||c.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:s,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:p}));const y=m.current,b=M.useContext(aU);y&&!y.projection&&i&&(y.type==="html"||y.type==="svg")&&nge(m.current,n,i,b);const P=M.useRef(!1);M.useInsertionEffect(()=>{y&&P.current&&y.update(n,d)});const x=n[iU],w=M.useRef(!!x&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,x))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,x)));return qme(()=>{y&&(P.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),LA.render(y.render),w.current&&y.animationState&&y.animationState.animateChanges())}),M.useEffect(()=>{y&&(!w.current&&y.animationState&&y.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)===null||T===void 0||T.call(window,x)}),w.current=!1))}),y}function nge(e,t,n,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:oU(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Wd(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:d})}function oU(e){if(e)return e.options.allowProjection!==!1?e.projection:oU(e.parent)}function rge({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var a,o;e&&Wme(e);function s(d,p){let m;const y={...M.useContext(Q6),...d,layoutId:ige(d)},{isStatic:b}=y,P=Xme(d),x=r(d,b);if(!b&&kA){age();const w=oge(y);m=w.MeasureLayout,P.visualElement=tge(i,x,y,t,w.ProjectionNode)}return h.jsxs(Zb.Provider,{value:P,children:[m&&P.visualElement?h.jsx(m,{visualElement:P.visualElement,...y}):null,n(i,d,Jme(x,P.visualElement,p),x,b,P.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${(o=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&o!==void 0?o:""})`}`;const c=M.forwardRef(s);return c[Qme]=i,c}function ige({layoutId:e}){const t=M.useContext(X6).id;return t&&e!==void 0?t+"-"+e:e}function age(e,t){M.useContext(tU).strict}function oge(e){const{drag:t,layout:n}=Kh;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const sge=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function IA(e){return typeof e!="string"||e.includes("-")?!1:!!(sge.indexOf(e)>-1||/[A-Z]/u.test(e))}function C4(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function DA(e,t,n,r){if(typeof t=="function"){const[i,a]=C4(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=C4(r);t=t(n!==void 0?n:e.custom,i,a)}return t}const xT=e=>Array.isArray(e),lge=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),uge=e=>xT(e)?e[e.length-1]||0:e,ka=e=>!!(e&&e.getVelocity);function _y(e){const t=ka(e)?e.get():e;return lge(t)?t.toValue():t}function cge({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){const o={latestValues:fge(r,i,a,e),renderState:t()};return n&&(o.onMount=s=>n({props:r,current:s,...o}),o.onUpdate=s=>n(s)),o}const sU=e=>(t,n)=>{const r=M.useContext(Zb),i=M.useContext(AA),a=()=>cge(e,t,r,i);return n?a():$me(a)};function fge(e,t,n,r){const i={},a=r(e,{});for(const y in a)i[y]=_y(a[y]);let{initial:o,animate:s}=e;const c=Xb(e),d=rU(e);t&&d&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let p=n?n.initial===!1:!1;p=p||o===!1;const m=p?s:o;if(m&&typeof m!="boolean"&&!Yb(m)){const y=Array.isArray(m)?m:[m];for(let b=0;b<y.length;b++){const P=DA(e,y[b]);if(P){const{transitionEnd:x,transition:w,...T}=P;for(const E in T){let k=T[E];if(Array.isArray(k)){const D=p?k.length-1:0;k=k[D]}k!==null&&(i[E]=k)}for(const E in x)i[E]=x[E]}}}return i}const cp=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],md=new Set(cp),lU=e=>t=>typeof t=="string"&&t.startsWith(e),uU=lU("--"),dge=lU("var(--"),BA=e=>dge(e)?hge.test(e.split("/*")[0].trim()):!1,hge=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,cU=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Mu=(e,t,n)=>n>t?t:n<e?e:n,fp={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ug={...fp,transform:e=>Mu(0,1,e)},ty={...fp,default:1},Ig=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),fc=Ig("deg"),Bl=Ig("%"),Xt=Ig("px"),pge=Ig("vh"),mge=Ig("vw"),N4={...Bl,parse:e=>Bl.parse(e)/100,transform:e=>Bl.transform(e*100)},gge={borderWidth:Xt,borderTopWidth:Xt,borderRightWidth:Xt,borderBottomWidth:Xt,borderLeftWidth:Xt,borderRadius:Xt,radius:Xt,borderTopLeftRadius:Xt,borderTopRightRadius:Xt,borderBottomRightRadius:Xt,borderBottomLeftRadius:Xt,width:Xt,maxWidth:Xt,height:Xt,maxHeight:Xt,top:Xt,right:Xt,bottom:Xt,left:Xt,padding:Xt,paddingTop:Xt,paddingRight:Xt,paddingBottom:Xt,paddingLeft:Xt,margin:Xt,marginTop:Xt,marginRight:Xt,marginBottom:Xt,marginLeft:Xt,backgroundPositionX:Xt,backgroundPositionY:Xt},vge={rotate:fc,rotateX:fc,rotateY:fc,rotateZ:fc,scale:ty,scaleX:ty,scaleY:ty,scaleZ:ty,skew:fc,skewX:fc,skewY:fc,distance:Xt,translateX:Xt,translateY:Xt,translateZ:Xt,x:Xt,y:Xt,z:Xt,perspective:Xt,transformPerspective:Xt,opacity:ug,originX:N4,originY:N4,originZ:Xt},M4={...fp,transform:Math.round},$A={...gge,...vge,zIndex:M4,size:Xt,fillOpacity:ug,strokeOpacity:ug,numOctaves:M4},yge={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},bge=cp.length;function xge(e,t,n){let r="",i=!0;for(let a=0;a<bge;a++){const o=cp[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s=="number"?c=s===(o.startsWith("scale")?1:0):c=parseFloat(s)===0,!c||n){const d=cU(s,$A[o]);if(!c){i=!1;const p=yge[o]||o;r+=`${p}(${d}) `}n&&(t[o]=d)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function FA(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const c in t){const d=t[c];if(md.has(c)){o=!0;continue}else if(uU(c)){i[c]=d;continue}else{const p=cU(d,$A[c]);c.startsWith("origin")?(s=!0,a[c]=p):r[c]=p}}if(t.transform||(o||n?r.transform=xge(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:c="50%",originY:d="50%",originZ:p=0}=a;r.transformOrigin=`${c} ${d} ${p}`}}const wge={offset:"stroke-dashoffset",array:"stroke-dasharray"},_ge={offset:"strokeDashoffset",array:"strokeDasharray"};function Sge(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?wge:_ge;e[a.offset]=Xt.transform(-r);const o=Xt.transform(t),s=Xt.transform(n);e[a.array]=`${o} ${s}`}function R4(e,t,n){return typeof e=="string"?e:Xt.transform(t+n*e)}function Pge(e,t,n){const r=R4(t,e.x,e.width),i=R4(n,e.y,e.height);return`${r} ${i}`}function qA(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:o,pathSpacing:s=1,pathOffset:c=0,...d},p,m){if(FA(e,d,m),p){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:b,dimensions:P}=e;y.transform&&(P&&(b.transform=y.transform),delete y.transform),P&&(i!==void 0||a!==void 0||b.transform)&&(b.transformOrigin=Pge(P,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),r!==void 0&&(y.scale=r),o!==void 0&&Sge(y,o,s,c,!1)}const zA=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),fU=()=>({...zA(),attrs:{}}),UA=e=>typeof e=="string"&&e.toLowerCase()==="svg";function dU(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const hU=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function pU(e,t,n,r){dU(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(hU.has(i)?i:RA(i),t.attrs[i])}const L0={};function jge(e){Object.assign(L0,e)}function mU(e,{layout:t,layoutId:n}){return md.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!L0[e]||e==="opacity")}function VA(e,t,n){var r;const{style:i}=e,a={};for(const o in i)(ka(i[o])||t.style&&ka(t.style[o])||mU(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[o]=i[o]);return a}function gU(e,t,n){const r=VA(e,t,n);for(const i in e)if(ka(e[i])||ka(t[i])){const a=cp.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function Oge(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const L4=["x","y","width","height","cx","cy","r"],Tge={useVisualState:sU({scrapeMotionValuesFromProps:gU,createRenderState:fU,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const s in i)if(md.has(s)){a=!0;break}}if(!a)return;let o=!t;if(t)for(let s=0;s<L4.length;s++){const c=L4[s];e[c]!==t[c]&&(o=!0)}o&&wr.read(()=>{Oge(n,r),wr.render(()=>{qA(r,i,UA(n.tagName),e.transformTemplate),pU(n,r)})})}})},Ege={useVisualState:sU({scrapeMotionValuesFromProps:VA,createRenderState:zA})};function vU(e,t,n){for(const r in t)!ka(t[r])&&!mU(r,n)&&(e[r]=t[r])}function Age({transformTemplate:e},t){return M.useMemo(()=>{const n=zA();return FA(n,t,e),Object.assign({},n.vars,n.style)},[t])}function kge(e,t){const n=e.style||{},r={};return vU(r,n,e),Object.assign(r,Age(e,t)),r}function Cge(e,t){const n={},r=kge(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Nge(e,t,n,r){const i=M.useMemo(()=>{const a=fU();return qA(a,t,UA(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};vU(a,e.style,e),i.style={...a,...i.style}}return i}function Mge(e=!1){return(n,r,i,{latestValues:a},o)=>{const c=(IA(n)?Nge:Cge)(r,a,o,n),d=Gme(r,typeof n=="string",e),p=n!==M.Fragment?{...d,...c,ref:i}:{},{children:m}=r,y=M.useMemo(()=>ka(m)?m.get():m,[m]);return M.createElement(n,{...p,children:y})}}function Rge(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...IA(r)?Tge:Ege,preloadedFeatures:e,useRender:Mge(i),createVisualElement:t,Component:r};return rge(o)}}function yU(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Qb(e,t,n){const r=e.getProps();return DA(r,t,n!==void 0?n:r.custom,e)}const Lge=CA(()=>window.ScrollTimeline!==void 0);class Ige{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Lge()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Dge extends Ige{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function WA(e,t){return e?e[t]||e.default||e:void 0}const wT=2e4;function bU(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<wT;)t+=n,r=e.next(t);return t>=wT?1/0:t}function KA(e){return typeof e=="function"}function I4(e,t){e.timeline=t,e.onfinish=null}const HA=e=>Array.isArray(e)&&typeof e[0]=="number",Bge={linearEasing:void 0};function $ge(e,t){const n=CA(e);return()=>{var r;return(r=Bge[t])!==null&&r!==void 0?r:n()}}const I0=$ge(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xU=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=e(Wh(0,i-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function wU(e){return!!(typeof e=="function"&&I0()||!e||typeof e=="string"&&(e in _T||I0())||HA(e)||Array.isArray(e)&&e.every(wU))}const am=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,_T={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:am([0,.65,.55,1]),circOut:am([.55,0,1,.45]),backIn:am([.31,.01,.66,-.59]),backOut:am([.33,1.53,.69,.99])};function _U(e,t){if(e)return typeof e=="function"&&I0()?xU(e,t):HA(e)?am(e):Array.isArray(e)?e.map(n=>_U(n,t)||_T.easeOut):_T[e]}const Qs={x:!1,y:!1};function SU(){return Qs.x||Qs.y}function Fge(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const a=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function PU(e,t){const n=Fge(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function D4(e){return t=>{t.pointerType==="touch"||SU()||e(t)}}function qge(e,t,n={}){const[r,i,a]=PU(e,n),o=D4(s=>{const{target:c}=s,d=t(s);if(typeof d!="function"||!c)return;const p=D4(m=>{d(m),c.removeEventListener("pointerleave",p)});c.addEventListener("pointerleave",p,i)});return r.forEach(s=>{s.addEventListener("pointerenter",o,i)}),a}const jU=(e,t)=>t?e===t?!0:jU(e,t.parentElement):!1,GA=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,zge=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Uge(e){return zge.has(e.tagName)||e.tabIndex!==-1}const om=new WeakSet;function B4(e){return t=>{t.key==="Enter"&&e(t)}}function HP(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Vge=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=B4(()=>{if(om.has(n))return;HP(n,"down");const i=B4(()=>{HP(n,"up")}),a=()=>HP(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function $4(e){return GA(e)&&!SU()}function Wge(e,t,n={}){const[r,i,a]=PU(e,n),o=s=>{const c=s.currentTarget;if(!$4(s)||om.has(c))return;om.add(c);const d=t(s),p=(b,P)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",y),!(!$4(b)||!om.has(c))&&(om.delete(c),typeof d=="function"&&d(b,{success:P}))},m=b=>{p(b,n.useGlobalTarget||jU(c,b.target))},y=b=>{p(b,!1)};window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",y,i)};return r.forEach(s=>{!Uge(s)&&s.getAttribute("tabindex")===null&&(s.tabIndex=0),(n.useGlobalTarget?window:s).addEventListener("pointerdown",o,i),s.addEventListener("focus",d=>Vge(d,i),i)}),a}function Kge(e){return e==="x"||e==="y"?Qs[e]?null:(Qs[e]=!0,()=>{Qs[e]=!1}):Qs.x||Qs.y?null:(Qs.x=Qs.y=!0,()=>{Qs.x=Qs.y=!1})}const OU=new Set(["width","height","top","left","right","bottom",...cp]);let Sy;function Hge(){Sy=void 0}const $l={now:()=>(Sy===void 0&&$l.set(oa.isProcessing||zme.useManualTiming?oa.timestamp:performance.now()),Sy),set:e=>{Sy=e,queueMicrotask(Hge)}};function ZA(e,t){e.indexOf(t)===-1&&e.push(t)}function YA(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class XA{constructor(){this.subscriptions=[]}add(t){return ZA(this.subscriptions,t),()=>YA(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function TU(e,t){return t?e*(1e3/t):0}const F4=30,Gge=e=>!isNaN(parseFloat(e));class Zge{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=$l.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=$l.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Gge(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new XA);const r=this.events[t].add(n);return t==="change"?()=>{r(),wr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=$l.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>F4)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,F4);return TU(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function cg(e,t){return new Zge(e,t)}function Yge(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,cg(n))}function Xge(e,t){const n=Qb(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=uge(a[o]);Yge(e,o,s)}}function Qge(e){return!!(ka(e)&&e.add)}function ST(e,t){const n=e.getValue("willChange");if(Qge(n))return n.add(t)}function EU(e){return e.props[iU]}const AU=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Jge=1e-7,eve=12;function tve(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=AU(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Jge&&++s<eve);return o}function Dg(e,t,n,r){if(e===t&&n===r)return Vo;const i=a=>tve(a,0,1,e,n);return a=>a===0||a===1?a:AU(i(a),t,r)}const kU=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,CU=e=>t=>1-e(1-t),NU=Dg(.33,1.53,.69,.99),QA=CU(NU),MU=kU(QA),RU=e=>(e*=2)<1?.5*QA(e):.5*(2-Math.pow(2,-10*(e-1))),JA=e=>1-Math.sin(Math.acos(e)),LU=CU(JA),IU=kU(JA),DU=e=>/^0[^.\s]+$/u.test(e);function nve(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||DU(e):!0}const xm=e=>Math.round(e*1e5)/1e5,ek=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rve(e){return e==null}const ive=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tk=(e,t)=>n=>!!(typeof n=="string"&&ive.test(n)&&n.startsWith(e)||t&&!rve(n)&&Object.prototype.hasOwnProperty.call(n,t)),BU=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(ek);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},ave=e=>Mu(0,255,e),GP={...fp,transform:e=>Math.round(ave(e))},Nf={test:tk("rgb","red"),parse:BU("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+GP.transform(e)+", "+GP.transform(t)+", "+GP.transform(n)+", "+xm(ug.transform(r))+")"};function ove(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const PT={test:tk("#"),parse:ove,transform:Nf.transform},Kd={test:tk("hsl","hue"),parse:BU("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Bl.transform(xm(t))+", "+Bl.transform(xm(n))+", "+xm(ug.transform(r))+")"},Oa={test:e=>Nf.test(e)||PT.test(e)||Kd.test(e),parse:e=>Nf.test(e)?Nf.parse(e):Kd.test(e)?Kd.parse(e):PT.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Nf.transform(e):Kd.transform(e)},sve=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function lve(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ek))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(sve))===null||n===void 0?void 0:n.length)||0)>0}const $U="number",FU="color",uve="var",cve="var(",q4="${}",fve=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function fg(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(fve,c=>(Oa.test(c)?(r.color.push(a),i.push(FU),n.push(Oa.parse(c))):c.startsWith(cve)?(r.var.push(a),i.push(uve),n.push(c)):(r.number.push(a),i.push($U),n.push(parseFloat(c))),++a,q4)).split(q4);return{values:n,split:s,indexes:r,types:i}}function qU(e){return fg(e).values}function zU(e){const{split:t,types:n}=fg(e),r=t.length;return i=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],i[o]!==void 0){const s=n[o];s===$U?a+=xm(i[o]):s===FU?a+=Oa.transform(i[o]):a+=i[o]}return a}}const dve=e=>typeof e=="number"?0:e;function hve(e){const t=qU(e);return zU(e)(t.map(dve))}const $c={test:lve,parse:qU,createTransformer:zU,getAnimatableNone:hve},pve=new Set(["brightness","contrast","saturate","opacity"]);function mve(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(ek)||[];if(!r)return e;const i=n.replace(r,"");let a=pve.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const gve=/\b([a-z-]*)\(.*?\)/gu,jT={...$c,getAnimatableNone:e=>{const t=e.match(gve);return t?t.map(mve).join(" "):e}},vve={...$A,color:Oa,backgroundColor:Oa,outlineColor:Oa,fill:Oa,stroke:Oa,borderColor:Oa,borderTopColor:Oa,borderRightColor:Oa,borderBottomColor:Oa,borderLeftColor:Oa,filter:jT,WebkitFilter:jT},nk=e=>vve[e];function UU(e,t){let n=nk(e);return n!==jT&&(n=$c),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yve=new Set(["auto","none","0"]);function bve(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!yve.has(a)&&fg(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=UU(n,i)}const z4=e=>e===fp||e===Xt,U4=(e,t)=>parseFloat(e.split(", ")[t]),V4=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return U4(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?U4(a[1],e):0}},xve=new Set(["x","y","z"]),wve=cp.filter(e=>!xve.has(e));function _ve(e){const t=[];return wve.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Hh={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:V4(4,13),y:V4(5,14)};Hh.translateX=Hh.x;Hh.translateY=Hh.y;const Kf=new Set;let OT=!1,TT=!1;function VU(){if(TT){const e=Array.from(Kf).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=_ve(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,o])=>{var s;(s=r.getValue(a))===null||s===void 0||s.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}TT=!1,OT=!1,Kf.forEach(e=>e.complete()),Kf.clear()}function WU(){Kf.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(TT=!0)})}function Sve(){WU(),VU()}class rk{constructor(t,n,r,i,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Kf.add(this),OT||(OT=!0,wr.read(WU),wr.resolveKeyframes(VU))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const o=i==null?void 0:i.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const c=r.readValue(n,s);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=s),i&&o===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Kf.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Kf.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const KU=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Pve=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function jve(e){const t=Pve.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function HU(e,t,n=1){const[r,i]=jve(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return KU(o)?parseFloat(o):o}return BA(i)?HU(i,t,n+1):i}const GU=e=>t=>t.test(e),Ove={test:e=>e==="auto",parse:e=>e},ZU=[fp,Xt,Bl,fc,mge,pge,Ove],W4=e=>ZU.find(GU(e));class YU extends rk{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),BA(d))){const p=HU(d,n.current);p!==void 0&&(t[c]=p),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!OU.has(r)||t.length!==2)return;const[i,a]=t,o=W4(i),s=W4(a);if(o!==s)if(z4(o)&&z4(s))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)nve(t[i])&&r.push(i);r.length&&bve(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hh[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=Hh[r](n.measureViewportBox(),window.getComputedStyle(n.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([c,d])=>{n.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const K4=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&($c.test(e)||e==="0")&&!e.startsWith("url("));function Tve(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Eve(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=K4(i,t),s=K4(a,t);return!o||!s?!1:Tve(e)||(n==="spring"||KA(n))&&r}const Ave=e=>e!==null;function Jb(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Ave),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const kve=40;class XU{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=$l.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>kve?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Sve(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=$l.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:o,onComplete:s,onUpdate:c,isGenerator:d}=this.options;if(!d&&!Eve(t,r,i,a))if(o)this.options.duration=0;else{c&&c(Jb(t,this.options,n)),s&&s(),this.resolveFinishedPromise();return}const p=this.initPlayback(t,n);p!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...p},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Ir=(e,t,n)=>e+(t-e)*n;function ZP(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Cve({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;i=ZP(c,s,e+1/3),a=ZP(c,s,e),o=ZP(c,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function D0(e,t){return n=>n>0?t:e}const YP=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Nve=[PT,Nf,Kd],Mve=e=>Nve.find(t=>t.test(e));function H4(e){const t=Mve(e);if(!t)return!1;let n=t.parse(e);return t===Kd&&(n=Cve(n)),n}const G4=(e,t)=>{const n=H4(e),r=H4(t);if(!n||!r)return D0(e,t);const i={...n};return a=>(i.red=YP(n.red,r.red,a),i.green=YP(n.green,r.green,a),i.blue=YP(n.blue,r.blue,a),i.alpha=Ir(n.alpha,r.alpha,a),Nf.transform(i))},Rve=(e,t)=>n=>t(e(n)),Bg=(...e)=>e.reduce(Rve),ET=new Set(["none","hidden"]);function Lve(e,t){return ET.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ive(e,t){return n=>Ir(e,t,n)}function ik(e){return typeof e=="number"?Ive:typeof e=="string"?BA(e)?D0:Oa.test(e)?G4:$ve:Array.isArray(e)?QU:typeof e=="object"?Oa.test(e)?G4:Dve:D0}function QU(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>ik(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function Dve(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ik(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function Bve(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],s=e.indexes[o][i[o]],c=(n=e.values[s])!==null&&n!==void 0?n:0;r[a]=c,i[o]++}return r}const $ve=(e,t)=>{const n=$c.createTransformer(t),r=fg(e),i=fg(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ET.has(e)&&!i.values.length||ET.has(t)&&!r.values.length?Lve(e,t):Bg(QU(Bve(r,i),i.values),n):D0(e,t)};function JU(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ir(e,t,n):ik(e)(e,t)}const Fve=5;function eV(e,t,n){const r=Math.max(t-Fve,0);return TU(n-e(r),t-r)}const Wr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},XP=.001;function qve({duration:e=Wr.duration,bounce:t=Wr.bounce,velocity:n=Wr.velocity,mass:r=Wr.mass}){let i,a,o=1-t;o=Mu(Wr.minDamping,Wr.maxDamping,o),e=Mu(Wr.minDuration,Wr.maxDuration,Ou(e)),o<1?(i=d=>{const p=d*o,m=p*e,y=p-n,b=AT(d,o),P=Math.exp(-m);return XP-y/b*P},a=d=>{const m=d*o*e,y=m*n+n,b=Math.pow(o,2)*Math.pow(d,2)*e,P=Math.exp(-m),x=AT(Math.pow(d,2),o);return(-i(d)+XP>0?-1:1)*((y-b)*P)/x}):(i=d=>{const p=Math.exp(-d*e),m=(d-n)*e+1;return-XP+p*m},a=d=>{const p=Math.exp(-d*e),m=(n-d)*(e*e);return p*m});const s=5/e,c=Uve(i,a,s);if(e=ju(e),isNaN(c))return{stiffness:Wr.stiffness,damping:Wr.damping,duration:e};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:e}}}const zve=12;function Uve(e,t,n){let r=n;for(let i=1;i<zve;i++)r=r-e(r)/t(r);return r}function AT(e,t){return e*Math.sqrt(1-t*t)}const Vve=["duration","bounce"],Wve=["stiffness","damping","mass"];function Z4(e,t){return t.some(n=>e[n]!==void 0)}function Kve(e){let t={velocity:Wr.velocity,stiffness:Wr.stiffness,damping:Wr.damping,mass:Wr.mass,isResolvedFromDuration:!1,...e};if(!Z4(e,Wve)&&Z4(e,Vve))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Mu(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Wr.mass,stiffness:i,damping:a}}else{const n=qve(e);t={...t,...n,mass:Wr.mass},t.isResolvedFromDuration=!0}return t}function tV(e=Wr.visualDuration,t=Wr.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:d,mass:p,duration:m,velocity:y,isResolvedFromDuration:b}=Kve({...n,velocity:-Ou(n.velocity||0)}),P=y||0,x=d/(2*Math.sqrt(c*p)),w=o-a,T=Ou(Math.sqrt(c/p)),E=Math.abs(w)<5;r||(r=E?Wr.restSpeed.granular:Wr.restSpeed.default),i||(i=E?Wr.restDelta.granular:Wr.restDelta.default);let k;if(x<1){const I=AT(T,x);k=R=>{const $=Math.exp(-x*T*R);return o-$*((P+x*T*w)/I*Math.sin(I*R)+w*Math.cos(I*R))}}else if(x===1)k=I=>o-Math.exp(-T*I)*(w+(P+T*w)*I);else{const I=T*Math.sqrt(x*x-1);k=R=>{const $=Math.exp(-x*T*R),V=Math.min(I*R,300);return o-$*((P+x*T*w)*Math.sinh(V)+I*w*Math.cosh(V))/I}}const D={calculatedDuration:b&&m||null,next:I=>{const R=k(I);if(b)s.done=I>=m;else{let $=0;x<1&&($=I===0?ju(P):eV(k,I,R));const V=Math.abs($)<=r,K=Math.abs(o-R)<=i;s.done=V&&K}return s.value=s.done?o:R,s},toString:()=>{const I=Math.min(bU(D),wT),R=xU($=>D.next(I*$).value,I,30);return I+"ms "+R}};return D}function Y4({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:d=.5,restSpeed:p}){const m=e[0],y={done:!1,value:m},b=V=>s!==void 0&&V<s||c!==void 0&&V>c,P=V=>s===void 0?c:c===void 0||Math.abs(s-V)<Math.abs(c-V)?s:c;let x=n*t;const w=m+x,T=o===void 0?w:o(w);T!==w&&(x=T-m);const E=V=>-x*Math.exp(-V/r),k=V=>T+E(V),D=V=>{const K=E(V),Z=k(V);y.done=Math.abs(K)<=d,y.value=y.done?T:Z};let I,R;const $=V=>{b(y.value)&&(I=V,R=tV({keyframes:[y.value,P(y.value)],velocity:eV(k,V,y.value),damping:i,stiffness:a,restDelta:d,restSpeed:p}))};return $(0),{calculatedDuration:null,next:V=>{let K=!1;return!R&&I===void 0&&(K=!0,D(V),$(V)),I!==void 0&&V>=I?R.next(V-I):(!K&&D(V),y)}}}const Hve=Dg(.42,0,1,1),Gve=Dg(0,0,.58,1),nV=Dg(.42,0,.58,1),Zve=e=>Array.isArray(e)&&typeof e[0]!="number",Yve={linear:Vo,easeIn:Hve,easeInOut:nV,easeOut:Gve,circIn:JA,circInOut:IU,circOut:LU,backIn:QA,backInOut:MU,backOut:NU,anticipate:RU},X4=e=>{if(HA(e)){J6(e.length===4);const[t,n,r,i]=e;return Dg(t,n,r,i)}else if(typeof e=="string")return Yve[e];return e};function Xve(e,t,n){const r=[],i=n||JU,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||Vo:t;s=Bg(c,s)}r.push(s)}return r}function Qve(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(J6(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=Xve(t,r,i),c=s.length,d=p=>{if(o&&p<e[0])return t[0];let m=0;if(c>1)for(;m<e.length-2&&!(p<e[m+1]);m++);const y=Wh(e[m],e[m+1],p);return s[m](y)};return n?p=>d(Mu(e[0],e[a-1],p)):d}function Jve(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Wh(0,t,r);e.push(Ir(n,1,i))}}function eye(e){const t=[0];return Jve(t,e.length-1),t}function tye(e,t){return e.map(n=>n*t)}function nye(e,t){return e.map(()=>t||nV).splice(0,e.length-1)}function B0({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Zve(r)?r.map(X4):X4(r),a={done:!1,value:t[0]},o=tye(n&&n.length===t.length?n:eye(t),e),s=Qve(o,t,{ease:Array.isArray(i)?i:nye(t,i)});return{calculatedDuration:e,next:c=>(a.value=s(c),a.done=c>=e,a)}}const rye=e=>{const t=({timestamp:n})=>e(n);return{start:()=>wr.update(t,!0),stop:()=>Bc(t),now:()=>oa.isProcessing?oa.timestamp:$l.now()}},iye={decay:Y4,inertia:Y4,tween:B0,keyframes:B0,spring:tV},aye=e=>e/100;class ak extends XU{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,o=(i==null?void 0:i.KeyframeResolver)||rk,s=(c,d)=>this.onKeyframesResolved(c,d);this.resolver=new o(a,s,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=this.options,s=KA(n)?n:iye[n]||B0;let c,d;s!==B0&&typeof t[0]!="number"&&(c=Bg(aye,JU(t[0],t[1])),t=[0,100]);const p=s({...this.options,keyframes:t});a==="mirror"&&(d=s({...this.options,keyframes:[...t].reverse(),velocity:-o})),p.calculatedDuration===null&&(p.calculatedDuration=bU(p));const{calculatedDuration:m}=p,y=m+i,b=y*(r+1)-i;return{generator:p,mirroredGenerator:d,mapPercentToKeyframes:c,calculatedDuration:m,resolvedDuration:y,totalDuration:b}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:V}=this.options;return{done:!0,value:V[V.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:s,keyframes:c,calculatedDuration:d,totalDuration:p,resolvedDuration:m}=r;if(this.startTime===null)return a.next(0);const{delay:y,repeat:b,repeatType:P,repeatDelay:x,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-p/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const T=this.currentTime-y*(this.speed>=0?1:-1),E=this.speed>=0?T<0:T>p;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=p);let k=this.currentTime,D=a;if(b){const V=Math.min(this.currentTime,p)/m;let K=Math.floor(V),Z=V%1;!Z&&V>=1&&(Z=1),Z===1&&K--,K=Math.min(K,b+1),!!(K%2)&&(P==="reverse"?(Z=1-Z,x&&(Z-=x/m)):P==="mirror"&&(D=o)),k=Mu(0,1,Z)*m}const I=E?{done:!1,value:c[0]}:D.next(k);s&&(I.value=s(I.value));let{done:R}=I;!E&&d!==null&&(R=this.speed>=0?this.currentTime>=p:this.currentTime<=0);const $=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return $&&i!==void 0&&(I.value=Jb(c,this.options,i)),w&&w(I.value),$&&this.finish(),I}get duration(){const{resolved:t}=this;return t?Ou(t.calculatedDuration):0}get time(){return Ou(this.currentTime)}set time(t){t=ju(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Ou(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=rye,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const oye=new Set(["opacity","clipPath","filter","transform"]);function sye(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeInOut",times:c}={}){const d={[t]:n};c&&(d.offset=c);const p=_U(s,i);return Array.isArray(p)&&(d.easing=p),e.animate(d,{delay:r,duration:i,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"})}const lye=CA(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),$0=10,uye=2e4;function cye(e){return KA(e.type)||e.type==="spring"||!wU(e.ease)}function fye(e,t){const n=new ak({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let a=0;for(;!r.done&&a<uye;)r=n.sample(a),i.push(r.value),a+=$0;return{times:void 0,keyframes:i,duration:a-$0,ease:"linear"}}const rV={anticipate:RU,backInOut:MU,circInOut:IU};function dye(e){return e in rV}class Q4 extends XU{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new YU(a,(o,s)=>this.onKeyframesResolved(o,s),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:a,type:o,motionValue:s,name:c,startTime:d}=this.options;if(!s.owner||!s.owner.current)return!1;if(typeof a=="string"&&I0()&&dye(a)&&(a=rV[a]),cye(this.options)){const{onComplete:m,onUpdate:y,motionValue:b,element:P,...x}=this.options,w=fye(t,x);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,i=w.times,a=w.ease,o="keyframes"}const p=sye(s.owner.current,c,t,{...this.options,duration:r,times:i,ease:a});return p.startTime=d??this.calcStartTime(),this.pendingTimeline?(I4(p,this.pendingTimeline),this.pendingTimeline=void 0):p.onfinish=()=>{const{onComplete:m}=this.options;s.set(Jb(t,this.options,n)),m&&m(),this.cancel(),this.resolveFinishedPromise()},{animation:p,duration:r,times:i,type:o,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Ou(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Ou(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=ju(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Vo;const{animation:r}=n;I4(r,t)}return Vo}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:a,ease:o,times:s}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:d,onUpdate:p,onComplete:m,element:y,...b}=this.options,P=new ak({...b,keyframes:r,duration:i,type:a,ease:o,times:s,isGenerator:!0}),x=ju(this.time);d.setWithVelocity(P.sample(x-$0).value,P.sample(x).value,$0)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:a,damping:o,type:s}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=n.owner.getProps();return lye()&&r&&oye.has(r)&&!c&&!d&&!i&&a!=="mirror"&&o!==0&&s!=="inertia"}}const hye={type:"spring",stiffness:500,damping:25,restSpeed:10},pye=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),mye={type:"keyframes",duration:.8},gye={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vye=(e,{keyframes:t})=>t.length>2?mye:md.has(e)?e.startsWith("scale")?pye(t[1]):hye:gye;function yye({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:d,...p}){return!!Object.keys(p).length}const ok=(e,t,n,r={},i,a)=>o=>{const s=WA(r,e)||{},c=s.delay||r.delay||0;let{elapsed:d=0}=r;d=d-ju(c);let p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-d,onUpdate:y=>{t.set(y),s.onUpdate&&s.onUpdate(y)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};yye(s)||(p={...p,...vye(e,p)}),p.duration&&(p.duration=ju(p.duration)),p.repeatDelay&&(p.repeatDelay=ju(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let m=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(p.duration=0,p.delay===0&&(m=!0)),m&&!a&&t.get()!==void 0){const y=Jb(p.keyframes,s);if(y!==void 0)return wr.update(()=>{p.onUpdate(y),p.onComplete()}),new Dge([])}return!a&&Q4.supports(p)?new Q4(p):new ak(p)};function bye({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function iV(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:o=e.getDefaultTransition(),transitionEnd:s,...c}=t;r&&(o=r);const d=[],p=i&&e.animationState&&e.animationState.getState()[i];for(const m in c){const y=e.getValue(m,(a=e.latestValues[m])!==null&&a!==void 0?a:null),b=c[m];if(b===void 0||p&&bye(p,m))continue;const P={delay:n,...WA(o||{},m)};let x=!1;if(window.MotionHandoffAnimation){const T=EU(e);if(T){const E=window.MotionHandoffAnimation(T,m,wr);E!==null&&(P.startTime=E,x=!0)}}ST(e,m),y.start(ok(m,y,b,e.shouldReduceMotion&&OU.has(m)?{type:!1}:P,e,x));const w=y.animation;w&&d.push(w)}return s&&Promise.all(d).then(()=>{wr.update(()=>{s&&Xge(e,s)})}),d}function kT(e,t,n={}){var r;const i=Qb(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const o=i?()=>Promise.all(iV(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:p=0,staggerChildren:m,staggerDirection:y}=a;return xye(e,t,p+d,m,y,n)}:()=>Promise.resolve(),{when:c}=a;if(c){const[d,p]=c==="beforeChildren"?[o,s]:[s,o];return d().then(()=>p())}else return Promise.all([o(),s(n.delay)])}function xye(e,t,n=0,r=0,i=1,a){const o=[],s=(e.variantChildren.size-1)*r,c=i===1?(d=0)=>d*r:(d=0)=>s-d*r;return Array.from(e.variantChildren).sort(wye).forEach((d,p)=>{d.notify("AnimationStart",t),o.push(kT(d,t,{...a,delay:n+c(p)}).then(()=>d.notify("AnimationComplete",t)))}),Promise.all(o)}function wye(e,t){return e.sortNodePosition(t)}function _ye(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>kT(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=kT(e,t,n);else{const i=typeof t=="function"?Qb(e,t,n.custom):t;r=Promise.all(iV(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Sye=MA.length;function aV(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?aV(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Sye;n++){const r=MA[n],i=e.props[r];(lg(i)||i===!1)&&(t[r]=i)}return t}const Pye=[...NA].reverse(),jye=NA.length;function Oye(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_ye(e,n,r)))}function Tye(e){let t=Oye(e),n=J4(),r=!0;const i=c=>(d,p)=>{var m;const y=Qb(e,p,c==="exit"?(m=e.presenceContext)===null||m===void 0?void 0:m.custom:void 0);if(y){const{transition:b,transitionEnd:P,...x}=y;d={...d,...x,...P}}return d};function a(c){t=c(e)}function o(c){const{props:d}=e,p=aV(e.parent)||{},m=[],y=new Set;let b={},P=1/0;for(let w=0;w<jye;w++){const T=Pye[w],E=n[T],k=d[T]!==void 0?d[T]:p[T],D=lg(k),I=T===c?E.isActive:null;I===!1&&(P=w);let R=k===p[T]&&k!==d[T]&&D;if(R&&r&&e.manuallyAnimateOnMount&&(R=!1),E.protectedKeys={...b},!E.isActive&&I===null||!k&&!E.prevProp||Yb(k)||typeof k=="boolean")continue;const $=Eye(E.prevProp,k);let V=$||T===c&&E.isActive&&!R&&D||w>P&&D,K=!1;const Z=Array.isArray(k)?k:[k];let ee=Z.reduce(i(T),{});I===!1&&(ee={});const{prevResolvedValues:ne={}}=E,oe={...ne,...ee},he=Oe=>{V=!0,y.has(Oe)&&(K=!0,y.delete(Oe)),E.needsAnimating[Oe]=!0;const re=e.getValue(Oe);re&&(re.liveStyle=!1)};for(const Oe in oe){const re=ee[Oe],Ce=ne[Oe];if(b.hasOwnProperty(Oe))continue;let ae=!1;xT(re)&&xT(Ce)?ae=!yU(re,Ce):ae=re!==Ce,ae?re!=null?he(Oe):y.add(Oe):re!==void 0&&y.has(Oe)?he(Oe):E.protectedKeys[Oe]=!0}E.prevProp=k,E.prevResolvedValues=ee,E.isActive&&(b={...b,...ee}),r&&e.blockInitialAnimation&&(V=!1),V&&(!(R&&$)||K)&&m.push(...Z.map(Oe=>({animation:Oe,options:{type:T}})))}if(y.size){const w={};y.forEach(T=>{const E=e.getBaseTarget(T),k=e.getValue(T);k&&(k.liveStyle=!0),w[T]=E??null}),m.push({animation:w})}let x=!!m.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(m):Promise.resolve()}function s(c,d){var p;if(n[c].isActive===d)return Promise.resolve();(p=e.variantChildren)===null||p===void 0||p.forEach(y=>{var b;return(b=y.animationState)===null||b===void 0?void 0:b.setActive(c,d)}),n[c].isActive=d;const m=o(c);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=J4(),r=!0}}}function Eye(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!yU(t,e):!1}function bf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function J4(){return{animate:bf(!0),whileInView:bf(),whileHover:bf(),whileTap:bf(),whileDrag:bf(),whileFocus:bf(),exit:bf()}}class Yc{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Aye extends Yc{constructor(t){super(t),t.animationState||(t.animationState=Tye(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yb(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let kye=0;class Cye extends Yc{constructor(){super(...arguments),this.id=kye++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Nye={animation:{Feature:Aye},exit:{Feature:Cye}};function dg(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function $g(e){return{point:{x:e.pageX,y:e.pageY}}}const Mye=e=>t=>GA(t)&&e(t,$g(t));function wm(e,t,n,r){return dg(e,t,Mye(n),r)}const e3=(e,t)=>Math.abs(e-t);function Rye(e,t){const n=e3(e.x,t.x),r=e3(e.y,t.y);return Math.sqrt(n**2+r**2)}class oV{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=JP(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,b=Rye(m.offset,{x:0,y:0})>=3;if(!y&&!b)return;const{point:P}=m,{timestamp:x}=oa;this.history.push({...P,timestamp:x});const{onStart:w,onMove:T}=this.handlers;y||(w&&w(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,m)},this.handlePointerMove=(m,y)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=QP(y,this.transformPagePoint),wr.update(this.updatePoint,!0)},this.handlePointerUp=(m,y)=>{this.end();const{onEnd:b,onSessionEnd:P,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=JP(m.type==="pointercancel"?this.lastMoveEventInfo:QP(y,this.transformPagePoint),this.history);this.startEvent&&b&&b(m,w),P&&P(m,w)},!GA(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=$g(t),s=QP(o,this.transformPagePoint),{point:c}=s,{timestamp:d}=oa;this.history=[{...c,timestamp:d}];const{onSessionStart:p}=n;p&&p(t,JP(s,this.history)),this.removeListeners=Bg(wm(this.contextWindow,"pointermove",this.handlePointerMove),wm(this.contextWindow,"pointerup",this.handlePointerUp),wm(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Bc(this.updatePoint)}}function QP(e,t){return t?{point:t(e.point)}:e}function t3(e,t){return{x:e.x-t.x,y:e.y-t.y}}function JP({point:e},t){return{point:e,delta:t3(e,sV(t)),offset:t3(e,Lye(t)),velocity:Iye(t,.1)}}function Lye(e){return e[0]}function sV(e){return e[e.length-1]}function Iye(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=sV(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>ju(t)));)n--;if(!r)return{x:0,y:0};const a=Ou(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const lV=1e-4,Dye=1-lV,Bye=1+lV,uV=.01,$ye=0-uV,Fye=0+uV;function Ko(e){return e.max-e.min}function qye(e,t,n){return Math.abs(e-t)<=n}function n3(e,t,n,r=.5){e.origin=r,e.originPoint=Ir(t.min,t.max,e.origin),e.scale=Ko(n)/Ko(t),e.translate=Ir(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Dye&&e.scale<=Bye||isNaN(e.scale))&&(e.scale=1),(e.translate>=$ye&&e.translate<=Fye||isNaN(e.translate))&&(e.translate=0)}function _m(e,t,n,r){n3(e.x,t.x,n.x,r?r.originX:void 0),n3(e.y,t.y,n.y,r?r.originY:void 0)}function r3(e,t,n){e.min=n.min+t.min,e.max=e.min+Ko(t)}function zye(e,t,n){r3(e.x,t.x,n.x),r3(e.y,t.y,n.y)}function i3(e,t,n){e.min=t.min-n.min,e.max=e.min+Ko(t)}function Sm(e,t,n){i3(e.x,t.x,n.x),i3(e.y,t.y,n.y)}function Uye(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ir(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ir(n,e,r.max):Math.min(e,n)),e}function a3(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Vye(e,{top:t,left:n,bottom:r,right:i}){return{x:a3(e.x,n,i),y:a3(e.y,t,r)}}function o3(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Wye(e,t){return{x:o3(e.x,t.x),y:o3(e.y,t.y)}}function Kye(e,t){let n=.5;const r=Ko(e),i=Ko(t);return i>r?n=Wh(t.min,t.max-r,e.min):r>i&&(n=Wh(e.min,e.max-i,t.min)),Mu(0,1,n)}function Hye(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const CT=.35;function Gye(e=CT){return e===!1?e=0:e===!0&&(e=CT),{x:s3(e,"left","right"),y:s3(e,"top","bottom")}}function s3(e,t,n){return{min:l3(e,t),max:l3(e,n)}}function l3(e,t){return typeof e=="number"?e:e[t]||0}const u3=()=>({translate:0,scale:1,origin:0,originPoint:0}),Hd=()=>({x:u3(),y:u3()}),c3=()=>({min:0,max:0}),Jr=()=>({x:c3(),y:c3()});function vs(e){return[e("x"),e("y")]}function cV({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Zye({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Yye(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ej(e){return e===void 0||e===1}function NT({scale:e,scaleX:t,scaleY:n}){return!ej(e)||!ej(t)||!ej(n)}function _f(e){return NT(e)||fV(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function fV(e){return f3(e.x)||f3(e.y)}function f3(e){return e&&e!=="0%"}function F0(e,t,n){const r=e-n,i=t*r;return n+i}function d3(e,t,n,r,i){return i!==void 0&&(e=F0(e,i,r)),F0(e,n,r)+t}function MT(e,t=0,n=1,r,i){e.min=d3(e.min,t,n,r,i),e.max=d3(e.max,t,n,r,i)}function dV(e,{x:t,y:n}){MT(e.x,t.translate,t.scale,t.originPoint),MT(e.y,n.translate,n.scale,n.originPoint)}const h3=.999999999999,p3=1.0000000000001;function Xye(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;const{visualElement:c}=a.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Zd(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,dV(e,o)),r&&_f(a.latestValues)&&Zd(e,a.latestValues))}t.x<p3&&t.x>h3&&(t.x=1),t.y<p3&&t.y>h3&&(t.y=1)}function Gd(e,t){e.min=e.min+t,e.max=e.max+t}function m3(e,t,n,r,i=.5){const a=Ir(e.min,e.max,i);MT(e,t,n,a,r)}function Zd(e,t){m3(e.x,t.x,t.scaleX,t.scale,t.originX),m3(e.y,t.y,t.scaleY,t.scale,t.originY)}function hV(e,t){return cV(Yye(e.getBoundingClientRect(),t))}function Qye(e,t,n){const r=hV(e,n),{scroll:i}=t;return i&&(Gd(r.x,i.offset.x),Gd(r.y,i.offset.y)),r}const pV=({current:e})=>e?e.ownerDocument.defaultView:null,Jye=new WeakMap;class e0e{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Jr(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=p=>{const{dragSnapToOrigin:m}=this.getProps();m?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor($g(p).point)},a=(p,m)=>{const{drag:y,dragPropagation:b,onDragStart:P}=this.getProps();if(y&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Kge(y),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vs(w=>{let T=this.getAxisMotionValue(w).get()||0;if(Bl.test(T)){const{projection:E}=this.visualElement;if(E&&E.layout){const k=E.layout.layoutBox[w];k&&(T=Ko(k)*(parseFloat(T)/100))}}this.originPoint[w]=T}),P&&wr.postRender(()=>P(p,m)),ST(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(p,m)=>{const{dragPropagation:y,dragDirectionLock:b,onDirectionLock:P,onDrag:x}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:w}=m;if(b&&this.currentDirection===null){this.currentDirection=t0e(w),this.currentDirection!==null&&P&&P(this.currentDirection);return}this.updateAxis("x",m.point,w),this.updateAxis("y",m.point,w),this.visualElement.render(),x&&x(p,m)},s=(p,m)=>this.stop(p,m),c=()=>vs(p=>{var m;return this.getAnimationState(p)==="paused"&&((m=this.getAxisMotionValue(p).animation)===null||m===void 0?void 0:m.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new oV(t,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:pV(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&wr.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!ny(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Uye(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&Wd(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Vye(i.layoutBox,n):this.constraints=!1,this.elastic=Gye(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&vs(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Hye(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Wd(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=Qye(r,i.root,this.visualElement.getTransformPagePoint());let o=Wye(i.layout.layoutBox,a);if(n){const s=n(Zye(o));this.hasMutatedConstraints=!!s,s&&(o=cV(s))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),c=this.constraints||{},d=vs(p=>{if(!ny(p,n,this.currentDirection))return;let m=c&&c[p]||{};o&&(m={min:0,max:0});const y=i?200:1e6,b=i?40:1e7,P={type:"inertia",velocity:r?t[p]:0,bounceStiffness:y,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...a,...m};return this.startAxisValueAnimation(p,P)});return Promise.all(d).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ST(this.visualElement,t),r.start(ok(t,r,0,n,this.visualElement,!1))}stopAnimation(){vs(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){vs(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){vs(n=>{const{drag:r}=this.getProps();if(!ny(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[n];a.set(t[n]-Ir(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Wd(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};vs(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const c=s.get();i[o]=Kye({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),vs(o=>{if(!ny(o,t,null))return;const s=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];s.set(Ir(c,d,i[o]))})}addListeners(){if(!this.visualElement.current)return;Jye.set(this.visualElement,this);const t=this.visualElement.current,n=wm(t,"pointerdown",c=>{const{drag:d,dragListener:p=!0}=this.getProps();d&&p&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Wd(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),wr.read(r);const o=dg(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(vs(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=c[p].translate,m.set(m.get()+c[p].translate))}),this.visualElement.render())}));return()=>{o(),n(),a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=CT,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function ny(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function t0e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class n0e extends Yc{constructor(t){super(t),this.removeGroupControls=Vo,this.removeListeners=Vo,this.controls=new e0e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Vo}unmount(){this.removeGroupControls(),this.removeListeners()}}const g3=e=>(t,n)=>{e&&wr.postRender(()=>e(t,n))};class r0e extends Yc{constructor(){super(...arguments),this.removePointerDownListener=Vo}onPointerDown(t){this.session=new oV(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pV(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:g3(t),onStart:g3(n),onMove:r,onEnd:(a,o)=>{delete this.session,i&&wr.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=wm(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Py={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function v3(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Zp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Xt.test(e))e=parseFloat(e);else return e;const n=v3(e,t.target.x),r=v3(e,t.target.y);return`${n}% ${r}%`}},i0e={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=$c.parse(e);if(i.length>5)return r;const a=$c.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;const d=Ir(s,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=d),typeof i[3+o]=="number"&&(i[3+o]/=d),a(i)}};class a0e extends M.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;jge(o0e),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),Py.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,o=r.projection;return o&&(o.isPresent=a,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||wr.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),LA.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function mV(e){const[t,n]=Fme(),r=M.useContext(X6);return h.jsx(a0e,{...e,layoutGroup:r,switchLayoutGroup:M.useContext(aU),isPresent:t,safeToRemove:n})}const o0e={borderRadius:{...Zp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Zp,borderTopRightRadius:Zp,borderBottomLeftRadius:Zp,borderBottomRightRadius:Zp,boxShadow:i0e};function s0e(e,t,n){const r=ka(e)?e:cg(e);return r.start(ok("",r,t,n)),r.animation}function l0e(e){return e instanceof SVGElement&&e.tagName!=="svg"}const u0e=(e,t)=>e.depth-t.depth;class c0e{constructor(){this.children=[],this.isDirty=!1}add(t){ZA(this.children,t),this.isDirty=!0}remove(t){YA(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(u0e),this.isDirty=!1,this.children.forEach(t)}}function f0e(e,t){const n=$l.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(Bc(r),e(a-t))};return wr.read(r,!0),()=>Bc(r)}const gV=["TopLeft","TopRight","BottomLeft","BottomRight"],d0e=gV.length,y3=e=>typeof e=="string"?parseFloat(e):e,b3=e=>typeof e=="number"||Xt.test(e);function h0e(e,t,n,r,i,a){i?(e.opacity=Ir(0,n.opacity!==void 0?n.opacity:1,p0e(r)),e.opacityExit=Ir(t.opacity!==void 0?t.opacity:1,0,m0e(r))):a&&(e.opacity=Ir(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<d0e;o++){const s=`border${gV[o]}Radius`;let c=x3(t,s),d=x3(n,s);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||b3(c)===b3(d)?(e[s]=Math.max(Ir(y3(c),y3(d),r),0),(Bl.test(d)||Bl.test(c))&&(e[s]+="%")):e[s]=d}(t.rotate||n.rotate)&&(e.rotate=Ir(t.rotate||0,n.rotate||0,r))}function x3(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const p0e=vV(0,.5,LU),m0e=vV(.5,.95,Vo);function vV(e,t,n){return r=>r<e?0:r>t?1:n(Wh(e,t,r))}function w3(e,t){e.min=t.min,e.max=t.max}function gs(e,t){w3(e.x,t.x),w3(e.y,t.y)}function _3(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function S3(e,t,n,r,i){return e-=t,e=F0(e,1/n,r),i!==void 0&&(e=F0(e,1/i,r)),e}function g0e(e,t=0,n=1,r=.5,i,a=e,o=e){if(Bl.test(t)&&(t=parseFloat(t),t=Ir(o.min,o.max,t/100)-o.min),typeof t!="number")return;let s=Ir(a.min,a.max,r);e===a&&(s-=t),e.min=S3(e.min,t,n,s,i),e.max=S3(e.max,t,n,s,i)}function P3(e,t,[n,r,i],a,o){g0e(e,t[n],t[r],t[i],t.scale,a,o)}const v0e=["x","scaleX","originX"],y0e=["y","scaleY","originY"];function j3(e,t,n,r){P3(e.x,t,v0e,n?n.x:void 0,r?r.x:void 0),P3(e.y,t,y0e,n?n.y:void 0,r?r.y:void 0)}function O3(e){return e.translate===0&&e.scale===1}function yV(e){return O3(e.x)&&O3(e.y)}function T3(e,t){return e.min===t.min&&e.max===t.max}function b0e(e,t){return T3(e.x,t.x)&&T3(e.y,t.y)}function E3(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function bV(e,t){return E3(e.x,t.x)&&E3(e.y,t.y)}function A3(e){return Ko(e.x)/Ko(e.y)}function k3(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class x0e{constructor(){this.members=[]}add(t){ZA(this.members,t),t.scheduleRender()}remove(t){if(YA(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function w0e(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:p,rotateX:m,rotateY:y,skewX:b,skewY:P}=n;d&&(r=`perspective(${d}px) ${r}`),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),y&&(r+=`rotateY(${y}deg) `),b&&(r+=`skewX(${b}deg) `),P&&(r+=`skewY(${P}deg) `)}const s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||"none"}const Sf={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},sm=typeof window<"u"&&window.MotionDebug!==void 0,tj=["","X","Y","Z"],_0e={visibility:"hidden"},C3=1e3;let S0e=0;function nj(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function xV(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=EU(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wr,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&xV(r)}function wV({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},s=t==null?void 0:t()){this.id=S0e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,sm&&(Sf.totalNodes=Sf.resolvedTargetDeltas=Sf.recalculatedProjection=0),this.nodes.forEach(O0e),this.nodes.forEach(C0e),this.nodes.forEach(N0e),this.nodes.forEach(T0e),sm&&window.MotionDebug.record(Sf)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new c0e)}addEventListener(o,s){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new XA),this.eventHandlers.get(o).add(s)}notifyListeners(o,...s){const c=this.eventHandlers.get(o);c&&c.notify(...s)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=l0e(o),this.instance=o;const{layoutId:c,layout:d,visualElement:p}=this.options;if(p&&!p.current&&p.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(d||c)&&(this.isLayoutDirty=!0),e){let m;const y=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=f0e(y,250),Py.hasAnimatedSinceResize&&(Py.hasAnimatedSinceResize=!1,this.nodes.forEach(M3))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&p&&(c||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeTargetChanged:b,layout:P})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||p.getDefaultTransition()||D0e,{onLayoutAnimationStart:w,onLayoutAnimationComplete:T}=p.getProps(),E=!this.targetLayout||!bV(this.targetLayout,P)||b,k=!y&&b;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||k||y&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,k);const D={...WA(x,"layout"),onPlay:w,onComplete:T};(p.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else y||M3(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=P})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Bc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(M0e),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xV(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const m=this.path[p];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:s,layout:c}=this.options;if(s===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(N3);return}this.isUpdating||this.nodes.forEach(A0e),this.isUpdating=!1,this.nodes.forEach(k0e),this.nodes.forEach(P0e),this.nodes.forEach(j0e),this.clearAllSnapshots();const s=$l.now();oa.delta=Mu(0,1e3/60,s-oa.timestamp),oa.timestamp=s,oa.isProcessing=!0,KP.update.process(oa),KP.preRender.process(oa),KP.render.process(oa),oa.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,LA.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(E0e),this.sharedNodes.forEach(R0e)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Jr(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(s=!1),s){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!yV(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,p=d!==this.prevTransformTemplateValue;o&&(s||_f(this.latestValues)||p)&&(i(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const s=this.measurePageBox();let c=this.removeElementScroll(s);return o&&(c=this.removeTransform(c)),B0e(c),{animationId:this.root.animationId,measuredBox:s,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:s}=this.options;if(!s)return Jr();const c=s.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some($0e))){const{scroll:p}=this.root;p&&(Gd(c.x,p.offset.x),Gd(c.y,p.offset.y))}return c}removeElementScroll(o){var s;const c=Jr();if(gs(c,o),!((s=this.scroll)===null||s===void 0)&&s.wasRoot)return c;for(let d=0;d<this.path.length;d++){const p=this.path[d],{scroll:m,options:y}=p;p!==this.root&&m&&y.layoutScroll&&(m.wasRoot&&gs(c,o),Gd(c.x,m.offset.x),Gd(c.y,m.offset.y))}return c}applyTransform(o,s=!1){const c=Jr();gs(c,o);for(let d=0;d<this.path.length;d++){const p=this.path[d];!s&&p.options.layoutScroll&&p.scroll&&p!==p.root&&Zd(c,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),_f(p.latestValues)&&Zd(c,p.latestValues)}return _f(this.latestValues)&&Zd(c,this.latestValues),c}removeTransform(o){const s=Jr();gs(s,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!_f(d.latestValues))continue;NT(d.latestValues)&&d.updateSnapshot();const p=Jr(),m=d.measurePageBox();gs(p,m),j3(s,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,p)}return _f(this.latestValues)&&j3(s,this.latestValues),s}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==oa.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var s;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(o||d&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:y}=this.options;if(!(!this.layout||!(m||y))){if(this.resolvedRelativeTargetAt=oa.timestamp,!this.targetDelta&&!this.relativeTarget){const b=this.getClosestProjectingParent();b&&b.layout&&this.animationProgress!==1?(this.relativeParent=b,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Jr(),this.relativeTargetOrigin=Jr(),Sm(this.relativeTargetOrigin,this.layout.layoutBox,b.layout.layoutBox),gs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Jr(),this.targetWithTransforms=Jr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zye(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):gs(this.target,this.layout.layoutBox),dV(this.target,this.targetDelta)):gs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const b=this.getClosestProjectingParent();b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?(this.relativeParent=b,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Jr(),this.relativeTargetOrigin=Jr(),Sm(this.relativeTargetOrigin,this.target,b.target),gs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}sm&&Sf.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||NT(this.parent.latestValues)||fV(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const s=this.getLead(),c=!!this.resumingFrom||this!==s;let d=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===oa.timestamp&&(d=!1),d)return;const{layout:p,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||m))return;gs(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,b=this.treeScale.y;Xye(this.layoutCorrected,this.treeScale,this.path,c),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=Jr());const{target:P}=s;if(!P){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_3(this.prevProjectionDelta.x,this.projectionDelta.x),_3(this.prevProjectionDelta.y,this.projectionDelta.y)),_m(this.projectionDelta,this.layoutCorrected,P,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==b||!k3(this.projectionDelta.x,this.prevProjectionDelta.x)||!k3(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",P)),sm&&Sf.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var s;if((s=this.options.visualElement)===null||s===void 0||s.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Hd(),this.projectionDelta=Hd(),this.projectionDeltaWithTransform=Hd()}setAnimationOrigin(o,s=!1){const c=this.snapshot,d=c?c.latestValues:{},p={...this.latestValues},m=Hd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const y=Jr(),b=c?c.source:void 0,P=this.layout?this.layout.source:void 0,x=b!==P,w=this.getStack(),T=!w||w.members.length<=1,E=!!(x&&!T&&this.options.crossfade===!0&&!this.path.some(I0e));this.animationProgress=0;let k;this.mixTargetDelta=D=>{const I=D/1e3;R3(m.x,o.x,I),R3(m.y,o.y,I),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Sm(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),L0e(this.relativeTarget,this.relativeTargetOrigin,y,I),k&&b0e(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Jr()),gs(k,this.relativeTarget)),x&&(this.animationValues=p,h0e(p,d,this.latestValues,I,E,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Bc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wr.update(()=>{Py.hasAnimatedSinceResize=!0,this.currentAnimation=s0e(0,C3,{...o,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(C3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:c,layout:d,latestValues:p}=o;if(!(!s||!c||!d)){if(this!==o&&this.layout&&d&&_V(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Jr();const m=Ko(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+m;const y=Ko(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+y}gs(s,c),Zd(s,p),_m(this.projectionDeltaWithTransform,this.layoutCorrected,s,p)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new x0e),this.sharedNodes.get(o).add(s);const d=s.options.initialPromotionConfig;s.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(s=!0),!s)return;const d={};c.z&&nj("z",o,d,this.animationValues);for(let p=0;p<tj.length;p++)nj(`rotate${tj[p]}`,o,d,this.animationValues),nj(`skew${tj[p]}`,o,d,this.animationValues);o.render();for(const p in d)o.setStaticValue(p,d[p]),this.animationValues&&(this.animationValues[p]=d[p]);o.scheduleRender()}getProjectionStyles(o){var s,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return _0e;const d={visibility:""},p=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,d.opacity="",d.pointerEvents=_y(o==null?void 0:o.pointerEvents)||"",d.transform=p?p(this.latestValues,""):"none",d;const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){const x={};return this.options.layoutId&&(x.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,x.pointerEvents=_y(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!_f(this.latestValues)&&(x.transform=p?p({},""):"none",this.hasProjected=!1),x}const y=m.animationValues||m.latestValues;this.applyTransformsToTarget(),d.transform=w0e(this.projectionDeltaWithTransform,this.treeScale,y),p&&(d.transform=p(y,d.transform));const{x:b,y:P}=this.projectionDelta;d.transformOrigin=`${b.origin*100}% ${P.origin*100}% 0`,m.animationValues?d.opacity=m===this?(c=(s=y.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:d.opacity=m===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const x in L0){if(y[x]===void 0)continue;const{correct:w,applyTo:T}=L0[x],E=d.transform==="none"?y[x]:w(y[x],m);if(T){const k=T.length;for(let D=0;D<k;D++)d[T[D]]=E}else d[x]=E}return this.options.layoutId&&(d.pointerEvents=m===this?_y(o==null?void 0:o.pointerEvents)||"":"none"),d}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var s;return(s=o.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(N3),this.root.sharedNodes.clear()}}}function P0e(e){e.updateLayout()}function j0e(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;a==="size"?vs(m=>{const y=o?n.measuredBox[m]:n.layoutBox[m],b=Ko(y);y.min=r[m].min,y.max=y.min+b}):_V(a,n.layoutBox,r)&&vs(m=>{const y=o?n.measuredBox[m]:n.layoutBox[m],b=Ko(r[m]);y.max=y.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+b)});const s=Hd();_m(s,r,n.layoutBox);const c=Hd();o?_m(c,e.applyTransform(i,!0),n.measuredBox):_m(c,r,n.layoutBox);const d=!yV(s);let p=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:y,layout:b}=m;if(y&&b){const P=Jr();Sm(P,n.layoutBox,y.layoutBox);const x=Jr();Sm(x,r,b.layoutBox),bV(P,x)||(p=!0),m.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=P,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:s,hasLayoutChanged:d,hasRelativeTargetChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function O0e(e){sm&&Sf.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function T0e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function E0e(e){e.clearSnapshot()}function N3(e){e.clearMeasurements()}function A0e(e){e.isLayoutDirty=!1}function k0e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function M3(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function C0e(e){e.resolveTargetDelta()}function N0e(e){e.calcProjection()}function M0e(e){e.resetSkewAndRotation()}function R0e(e){e.removeLeadSnapshot()}function R3(e,t,n){e.translate=Ir(t.translate,0,n),e.scale=Ir(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function L3(e,t,n,r){e.min=Ir(t.min,n.min,r),e.max=Ir(t.max,n.max,r)}function L0e(e,t,n,r){L3(e.x,t.x,n.x,r),L3(e.y,t.y,n.y,r)}function I0e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const D0e={duration:.45,ease:[.4,0,.1,1]},I3=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),D3=I3("applewebkit/")&&!I3("chrome/")?Math.round:Vo;function B3(e){e.min=D3(e.min),e.max=D3(e.max)}function B0e(e){B3(e.x),B3(e.y)}function _V(e,t,n){return e==="position"||e==="preserve-aspect"&&!qye(A3(t),A3(n),.2)}function $0e(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const F0e=wV({attachResizeListener:(e,t)=>dg(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rj={current:void 0},SV=wV({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rj.current){const e=new F0e({});e.mount(window),e.setOptions({layoutScroll:!0}),rj.current=e}return rj.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),q0e={pan:{Feature:r0e},drag:{Feature:n0e,ProjectionNode:SV,MeasureLayout:mV}};function $3(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=r[i];a&&wr.postRender(()=>a(t,$g(t)))}class z0e extends Yc{mount(){const{current:t}=this.node;t&&(this.unmount=qge(t,n=>($3(this.node,n,"Start"),r=>$3(this.node,r,"End"))))}unmount(){}}class U0e extends Yc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Bg(dg(this.node.current,"focus",()=>this.onFocus()),dg(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function F3(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=r[i];a&&wr.postRender(()=>a(t,$g(t)))}class V0e extends Yc{mount(){const{current:t}=this.node;t&&(this.unmount=Wge(t,n=>(F3(this.node,n,"Start"),(r,{success:i})=>F3(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const RT=new WeakMap,ij=new WeakMap,W0e=e=>{const t=RT.get(e.target);t&&t(e)},K0e=e=>{e.forEach(W0e)};function H0e({root:e,...t}){const n=e||document;ij.has(n)||ij.set(n,{});const r=ij.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(K0e,{root:e,...t})),r[i]}function G0e(e,t,n){const r=H0e(t);return RT.set(e,n),r.observe(e),()=>{RT.delete(e),r.unobserve(e)}}const Z0e={some:0,all:1};class Y0e extends Yc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Z0e[i]},s=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,a&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),y=d?p:m;y&&y(c)};return G0e(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(X0e(t,n))&&this.startObserver()}unmount(){}}function X0e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Q0e={inView:{Feature:Y0e},tap:{Feature:V0e},focus:{Feature:U0e},hover:{Feature:z0e}},J0e={layout:{ProjectionNode:SV,MeasureLayout:mV}},LT={current:null},PV={current:!1};function ebe(){if(PV.current=!0,!!kA)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>LT.current=e.matches;e.addListener(t),t()}else LT.current=!1}const tbe=[...ZU,Oa,$c],nbe=e=>tbe.find(GU(e)),q3=new WeakMap;function rbe(e,t,n){for(const r in t){const i=t[r],a=n[r];if(ka(i))e.addValue(r,i);else if(ka(a))e.addValue(r,cg(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,cg(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const z3=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ibe{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=rk,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=$l.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,wr.render(this.render,!1,!0))};const{latestValues:c,renderState:d,onUpdate:p}=o;this.onUpdate=p,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Xb(n),this.isVariantNode=rU(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:m,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const b in y){const P=y[b];c[b]!==void 0&&ka(P)&&P.set(c[b],!1)}}mount(t){this.current=t,q3.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),PV.current||ebe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:LT.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){q3.delete(this.current),this.projection&&this.projection.unmount(),Bc(this.notifyUpdate),Bc(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=md.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&wr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Kh){const n=Kh[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Jr()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<z3.length;r++){const i=z3[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=rbe(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=cg(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(KU(i)||DU(i))?i=parseFloat(i):!nbe(i)&&$c.test(n)&&(i=UU(t,n)),this.setBaseTarget(t,ka(i)?i.get():i)),ka(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=DA(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!ka(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new XA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class jV extends ibe{constructor(){super(...arguments),this.KeyframeResolver=YU}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ka(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function abe(e){return window.getComputedStyle(e)}class obe extends jV{constructor(){super(...arguments),this.type="html",this.renderInstance=dU}readValueFromInstance(t,n){if(md.has(n)){const r=nk(n);return r&&r.default||0}else{const r=abe(t),i=(uU(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return hV(t,n)}build(t,n,r){FA(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return VA(t,n,r)}}class sbe extends jV{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Jr}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(md.has(n)){const r=nk(n);return r&&r.default||0}return n=hU.has(n)?n:RA(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return gU(t,n,r)}build(t,n,r){qA(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){pU(t,n,r,i)}mount(t){this.isSVGTag=UA(t.tagName),super.mount(t)}}const lbe=(e,t)=>IA(e)?new sbe(t):new obe(t,{allowProjection:e!==M.Fragment}),ube=Rge({...Nye,...Q0e,...q0e,...J0e},lbe),Rt=Zme(ube),cbe=[{id:1,full_name:"Petani Lokal A",village:"Desa Sukamaju",verification_status:"verified"},{id:2,full_name:"Petani Lokal B",village:"Desa Sukamurni",verification_status:"pending"}],fbe=[{id:1,area_hectares:2.5,regency:"Kabupaten Bogor",validation_status:"valid"},{id:2,area_hectares:1.2,regency:"Kabupaten Cianjur",validation_status:"pending"}],dbe=[{id:1,commodity_name:"Padi",status:"alive"},{id:2,commodity_name:"Jagung",status:"sick"}];function hbe(){const{data:e=[]}=bn({queryKey:["farmers"],queryFn:()=>mt.entities.Farmer.list(),retry:!1}),{data:t=[]}=bn({queryKey:["lands"],queryFn:()=>mt.entities.Land.list(),retry:!1}),{data:n=[]}=bn({queryKey:["plants"],queryFn:()=>mt.entities.Plant.list(),retry:!1}),r=Array.isArray(e)&&e.length>0?e:cbe||[],i=Array.isArray(t)&&t.length>0?t:fbe||[],a=Array.isArray(n)&&n.length>0?n:dbe||[],o=Array.isArray(r)?r:[],s=Array.isArray(i)?i:[],c=Array.isArray(i)?i.filter(T=>T.validation_status==="valid").length:0,d=Array.isArray(a)?a.filter(T=>T.status==="alive").length:0,p=s.reduce((T,E)=>T+(Number(E.area_hectares)||0),0),m=o.filter(T=>T.verification_status==="verified").length,y=s.reduce((T,E)=>{const k=E.regency||"Tidak Diketahui",D=T.find(I=>I.name===k);return D?D.value+=Number(E.area_hectares)||0:T.push({name:k,value:Number(E.area_hectares)||0}),T},[]).sort((T,E)=>E.value-T.value).slice(0,5),b=a.reduce((T,E)=>{const k=E.commodity_name||"Lainnya",D=T.find(I=>I.name===k);return D?D.value+=1:T.push({name:k,value:1}),T},[]).sort((T,E)=>E.value-T.value).slice(0,6),P=i.filter(T=>T.validation_status==="pending"||T.validation_status==="need_review").length,x=r.filter(T=>T.verification_status==="pending").length,w=a.filter(T=>T.status==="sick"||T.productivity_status==="less_productive"||T.productivity_status==="not_productive").length;return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-7xl mx-auto p-6 space-y-8",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"space-y-1",children:[h.jsx("h1",{className:"text-3xl font-bold text-slate-900",children:"Dashboard Monev"}),h.jsx("p",{className:"text-slate-500",children:"Monitoring & Evaluasi Pertanian Wilayah"})]}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-5",children:[h.jsx(Fv,{title:"Total Petani",value:r.length,subtitle:`${m} terverifikasi`,icon:ll,trend:m>0?`${Math.round(m/r.length*100)}% verified`:void 0,trendUp:!0}),h.jsx(Fv,{title:"Total Lahan",value:i.length,subtitle:`${c} tervalidasi`,icon:js}),h.jsx(Fv,{title:"Luas Total",value:`${p.toFixed(1)} Ha`,subtitle:"Area terdata",icon:_j}),h.jsx(Fv,{title:"Jumlah Tanaman",value:a.length,subtitle:`${d} hidup`,icon:sa})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx(Rt.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.2},children:h.jsx(Dme,{data:y,title:"Luas Lahan per Wilayah (Ha)"})}),h.jsx(Rt.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},children:h.jsx(Bme,{data:b,title:"Distribusi Komoditas"})})]}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-4",children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(ul,{className:"w-5 h-5 text-amber-500"}),"Perlu Perhatian"]})}),h.jsx(Pn,{children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"p-4 rounded-xl bg-amber-50 border border-amber-100",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-sm font-medium text-amber-800",children:"Lahan Pending"}),h.jsx("span",{className:"text-2xl font-bold text-amber-600",children:P})]}),h.jsx("p",{className:"text-xs text-amber-600",children:"Perlu validasi wilayah"})]}),h.jsxs("div",{className:"p-4 rounded-xl bg-blue-50 border border-blue-100",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-sm font-medium text-blue-800",children:"Petani Pending"}),h.jsx("span",{className:"text-2xl font-bold text-blue-600",children:x})]}),h.jsx("p",{className:"text-xs text-blue-600",children:"Menunggu verifikasi"})]}),h.jsxs("div",{className:"p-4 rounded-xl bg-rose-50 border border-rose-100",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-sm font-medium text-rose-800",children:"Tanaman Sakit"}),h.jsx("span",{className:"text-2xl font-bold text-rose-600",children:w})]}),h.jsx("p",{className:"text-xs text-rose-600",children:"Perlu inspeksi lapangan"})]})]})})]})}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-4",children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(oF,{className:"w-5 h-5 text-emerald-600"}),"Aktivitas Terkini"]})}),h.jsx(Pn,{children:h.jsxs("div",{className:"space-y-3",children:[r.slice(0,5).map((T,E)=>{var k,D;return h.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg hover:bg-slate-50 transition-colors",children:[h.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-emerald-100 to-emerald-200 flex items-center justify-center",children:h.jsx("span",{className:"text-sm font-bold text-emerald-700",children:(D=(k=T.full_name)==null?void 0:k.charAt(0))==null?void 0:D.toUpperCase()})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"font-medium text-slate-900 truncate",children:T.full_name}),h.jsxs("p",{className:"text-sm text-slate-500",children:[T.village,", ",T.district]})]}),h.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${T.verification_status==="verified"?"bg-emerald-100 text-emerald-700":"bg-amber-100 text-amber-700"}`,children:T.verification_status==="verified"?"Terverifikasi":"Pending"})]},T.id)}),r.length===0&&h.jsx("p",{className:"text-center text-slate-500 py-8",children:"Belum ada data petani"})]})})]})})]})})}function ei(e){return"/"+e.replace(/ /g,"-")}const pbe=Q0("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ur({className:e,variant:t,...n}){return h.jsx("div",{className:fn(pbe({variant:t}),e),...n})}function U3(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dp(...e){return t=>{let n=!1;const r=e.map(i=>{const a=U3(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():U3(e[i],null)}}}}function Er(...e){return M.useCallback(dp(...e),e)}var mbe=Symbol.for("react.lazy"),q0=X0[" use ".trim().toString()];function gbe(e){return typeof e=="object"&&e!==null&&"then"in e}function OV(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===mbe&&"_payload"in e&&gbe(e._payload)}function sk(e){const t=ybe(e),n=M.forwardRef((r,i)=>{let{children:a,...o}=r;OV(a)&&typeof q0=="function"&&(a=q0(a._payload));const s=M.Children.toArray(a),c=s.find(xbe);if(c){const d=c.props.children,p=s.map(m=>m===c?M.Children.count(d)>1?M.Children.only(null):M.isValidElement(d)?d.props.children:null:m);return h.jsx(t,{...o,ref:i,children:M.isValidElement(d)?M.cloneElement(d,void 0,p):null})}return h.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var vbe=sk("Slot");function ybe(e){const t=M.forwardRef((n,r)=>{let{children:i,...a}=n;if(OV(i)&&typeof q0=="function"&&(i=q0(i._payload)),M.isValidElement(i)){const o=_be(i),s=wbe(a,i.props);return i.type!==M.Fragment&&(s.ref=r?dp(r,o):o),M.cloneElement(i,s)}return M.Children.count(i)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bbe=Symbol("radix.slottable");function xbe(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bbe}function wbe(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{const c=a(...s);return i(...s),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function _be(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Sbe=Q0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),pt=M.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?vbe:"button";return h.jsx(o,{className:fn(Sbe({variant:t,size:n,className:e})),ref:a,...i})});pt.displayName="Button";const Pbe={pending:"bg-amber-100 text-amber-700 border-amber-200",verified:"bg-emerald-100 text-emerald-700 border-emerald-200",rejected:"bg-rose-100 text-rose-700 border-rose-200"},jbe={pending:"Menunggu Verifikasi",verified:"Terverifikasi",rejected:"Ditolak"};function Obe({farmer:e}){var t,n;return h.jsx(Tt,{className:"border-0 shadow-sm hover:shadow-md transition-all p-5 bg-white group",children:h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("div",{className:"w-14 h-14 rounded-full bg-gradient-to-br from-emerald-100 to-emerald-200 flex items-center justify-center flex-shrink-0",children:e.photo_url?h.jsx("img",{src:e.photo_url,alt:e.full_name,className:"w-full h-full rounded-full object-cover"}):h.jsx("span",{className:"text-xl font-bold text-emerald-700",children:((n=(t=e.full_name)==null?void 0:t.charAt(0))==null?void 0:n.toUpperCase())||"P"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-slate-900 truncate",children:e.full_name}),h.jsxs("p",{className:"text-sm text-slate-500",children:["NIK: ",e.nik]})]}),h.jsx(ur,{className:`${Pbe[e.verification_status]} border font-medium text-xs`,children:jbe[e.verification_status]})]}),h.jsxs("div",{className:"space-y-1.5 text-sm text-slate-600",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(So,{className:"w-4 h-4 text-slate-400"}),h.jsxs("span",{className:"truncate",children:[e.village,", ",e.district]})]}),e.farmer_group&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ll,{className:"w-4 h-4 text-slate-400"}),h.jsx("span",{className:"truncate",children:e.farmer_group})]}),e.phone&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Yh,{className:"w-4 h-4 text-slate-400"}),h.jsx("span",{children:e.phone})]})]})]}),h.jsx(zo,{to:ei("FarmerDetail")+`?id=${e.id}`,children:h.jsx(pt,{variant:"ghost",size:"icon",className:"opacity-0 group-hover:opacity-100 transition-opacity",children:h.jsx(tb,{className:"w-5 h-5 text-slate-400"})})})]})})}function Qa({icon:e,title:t,description:n,action:r,actionLabel:i,className:a}){return h.jsxs("div",{className:fn("flex flex-col items-center justify-center py-16 px-6 text-center",a),children:[e&&h.jsx("div",{className:"w-16 h-16 rounded-full bg-slate-100 flex items-center justify-center mb-4",children:h.jsx(e,{className:"w-8 h-8 text-slate-400"})}),h.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-2",children:t}),n&&h.jsx("p",{className:"text-sm text-slate-500 max-w-sm mb-6",children:n}),r&&i&&h.jsx(pt,{onClick:r,className:"bg-emerald-600 hover:bg-emerald-700",children:i})]})}const nn=M.forwardRef(({className:e,type:t,...n},r)=>h.jsx("input",{type:t,className:fn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));nn.displayName="Input";function V3(e,[t,n]){return Math.min(n,Math.max(t,e))}function Mn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Tbe(e,t){const n=M.createContext(t),r=a=>{const{children:o,...s}=a,c=M.useMemo(()=>s,Object.values(s));return h.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(a){const o=M.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function gd(e,t=[]){let n=[];function r(a,o){const s=M.createContext(o),c=n.length;n=[...n,o];const d=m=>{var T;const{scope:y,children:b,...P}=m,x=((T=y==null?void 0:y[e])==null?void 0:T[c])||s,w=M.useMemo(()=>P,Object.values(P));return h.jsx(x.Provider,{value:w,children:b})};d.displayName=a+"Provider";function p(m,y){var x;const b=((x=y==null?void 0:y[e])==null?void 0:x[c])||s,P=M.useContext(b);if(P)return P;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[d,p]}const i=()=>{const a=n.map(o=>M.createContext(o));return function(s){const c=(s==null?void 0:s[e])||a;return M.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return i.scopeName=e,[r,Ebe(i,...t)]}function Ebe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:c,scopeName:d})=>{const m=c(a)[`__scope${d}`];return{...s,...m}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function W3(e){const t=Abe(e),n=M.forwardRef((r,i)=>{const{children:a,...o}=r,s=M.Children.toArray(a),c=s.find(Cbe);if(c){const d=c.props.children,p=s.map(m=>m===c?M.Children.count(d)>1?M.Children.only(null):M.isValidElement(d)?d.props.children:null:m);return h.jsx(t,{...o,ref:i,children:M.isValidElement(d)?M.cloneElement(d,void 0,p):null})}return h.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function Abe(e){const t=M.forwardRef((n,r)=>{const{children:i,...a}=n;if(M.isValidElement(i)){const o=Mbe(i),s=Nbe(a,i.props);return i.type!==M.Fragment&&(s.ref=r?dp(r,o):o),M.cloneElement(i,s)}return M.Children.count(i)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kbe=Symbol("radix.slottable");function Cbe(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kbe}function Nbe(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{const c=a(...s);return i(...s),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Mbe(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function TV(e){const t=e+"CollectionProvider",[n,r]=gd(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=x=>{const{scope:w,children:T}=x,E=ce.useRef(null),k=ce.useRef(new Map).current;return h.jsx(i,{scope:w,itemMap:k,collectionRef:E,children:T})};o.displayName=t;const s=e+"CollectionSlot",c=W3(s),d=ce.forwardRef((x,w)=>{const{scope:T,children:E}=x,k=a(s,T),D=Er(w,k.collectionRef);return h.jsx(c,{ref:D,children:E})});d.displayName=s;const p=e+"CollectionItemSlot",m="data-radix-collection-item",y=W3(p),b=ce.forwardRef((x,w)=>{const{scope:T,children:E,...k}=x,D=ce.useRef(null),I=Er(w,D),R=a(p,T);return ce.useEffect(()=>(R.itemMap.set(D,{ref:D,...k}),()=>void R.itemMap.delete(D))),h.jsx(y,{[m]:"",ref:I,children:E})});b.displayName=p;function P(x){const w=a(e+"CollectionConsumer",x);return ce.useCallback(()=>{const E=w.collectionRef.current;if(!E)return[];const k=Array.from(E.querySelectorAll(`[${m}]`));return Array.from(w.itemMap.values()).sort((R,$)=>k.indexOf(R.ref.current)-k.indexOf($.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:o,Slot:d,ItemSlot:b},P,r]}var Rbe=M.createContext(void 0);function lk(e){const t=M.useContext(Rbe);return e||t||"ltr"}function Lbe(e){const t=Ibe(e),n=M.forwardRef((r,i)=>{const{children:a,...o}=r,s=M.Children.toArray(a),c=s.find(Bbe);if(c){const d=c.props.children,p=s.map(m=>m===c?M.Children.count(d)>1?M.Children.only(null):M.isValidElement(d)?d.props.children:null:m);return h.jsx(t,{...o,ref:i,children:M.isValidElement(d)?M.cloneElement(d,void 0,p):null})}return h.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function Ibe(e){const t=M.forwardRef((n,r)=>{const{children:i,...a}=n;if(M.isValidElement(i)){const o=Fbe(i),s=$be(a,i.props);return i.type!==M.Fragment&&(s.ref=r?dp(r,o):o),M.cloneElement(i,s)}return M.Children.count(i)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dbe=Symbol("radix.slottable");function Bbe(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dbe}function $be(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{const c=a(...s);return i(...s),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Fbe(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qbe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dn=qbe.reduce((e,t)=>{const n=Lbe(`Primitive.${t}`),r=M.forwardRef((i,a)=>{const{asChild:o,...s}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function zbe(e,t){e&&Qh.flushSync(()=>e.dispatchEvent(t))}function Fc(e){const t=M.useRef(e);return M.useEffect(()=>{t.current=e}),M.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ube(e,t=globalThis==null?void 0:globalThis.document){const n=Fc(e);M.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Vbe="DismissableLayer",IT="dismissableLayer.update",Wbe="dismissableLayer.pointerDownOutside",Kbe="dismissableLayer.focusOutside",K3,EV=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uk=M.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,d=M.useContext(EV),[p,m]=M.useState(null),y=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=M.useState({}),P=Er(t,$=>m($)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),T=x.indexOf(w),E=p?x.indexOf(p):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,D=E>=T,I=Zbe($=>{const V=$.target,K=[...d.branches].some(Z=>Z.contains(V));!D||K||(i==null||i($),o==null||o($),$.defaultPrevented||s==null||s())},y),R=Ybe($=>{const V=$.target;[...d.branches].some(Z=>Z.contains(V))||(a==null||a($),o==null||o($),$.defaultPrevented||s==null||s())},y);return Ube($=>{E===d.layers.size-1&&(r==null||r($),!$.defaultPrevented&&s&&($.preventDefault(),s()))},y),M.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(K3=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),H3(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=K3)}},[p,y,n,d]),M.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),H3())},[p,d]),M.useEffect(()=>{const $=()=>b({});return document.addEventListener(IT,$),()=>document.removeEventListener(IT,$)},[]),h.jsx(Dn.div,{...c,ref:P,style:{pointerEvents:k?D?"auto":"none":void 0,...e.style},onFocusCapture:Mn(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Mn(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Mn(e.onPointerDownCapture,I.onPointerDownCapture)})});uk.displayName=Vbe;var Hbe="DismissableLayerBranch",Gbe=M.forwardRef((e,t)=>{const n=M.useContext(EV),r=M.useRef(null),i=Er(t,r);return M.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),h.jsx(Dn.div,{...e,ref:i})});Gbe.displayName=Hbe;function Zbe(e,t=globalThis==null?void 0:globalThis.document){const n=Fc(e),r=M.useRef(!1),i=M.useRef(()=>{});return M.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let c=function(){AV(Wbe,n,d,{discrete:!0})};const d={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ybe(e,t=globalThis==null?void 0:globalThis.document){const n=Fc(e),r=M.useRef(!1);return M.useEffect(()=>{const i=a=>{a.target&&!r.current&&AV(Kbe,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function H3(){const e=new CustomEvent(IT);document.dispatchEvent(e)}function AV(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?zbe(i,a):i.dispatchEvent(a)}var aj=0;function kV(){M.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??G3()),document.body.insertAdjacentElement("beforeend",e[1]??G3()),aj++,()=>{aj===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),aj--}},[])}function G3(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var oj="focusScope.autoFocusOnMount",sj="focusScope.autoFocusOnUnmount",Z3={bubbles:!1,cancelable:!0},Xbe="FocusScope",ck=M.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=M.useState(null),d=Fc(i),p=Fc(a),m=M.useRef(null),y=Er(t,x=>c(x)),b=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let x=function(k){if(b.paused||!s)return;const D=k.target;s.contains(D)?m.current=D:dc(m.current,{select:!0})},w=function(k){if(b.paused||!s)return;const D=k.relatedTarget;D!==null&&(s.contains(D)||dc(m.current,{select:!0}))},T=function(k){if(document.activeElement===document.body)for(const I of k)I.removedNodes.length>0&&dc(s)};document.addEventListener("focusin",x),document.addEventListener("focusout",w);const E=new MutationObserver(T);return s&&E.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",w),E.disconnect()}}},[r,s,b.paused]),M.useEffect(()=>{if(s){X3.add(b);const x=document.activeElement;if(!s.contains(x)){const T=new CustomEvent(oj,Z3);s.addEventListener(oj,d),s.dispatchEvent(T),T.defaultPrevented||(Qbe(rxe(CV(s)),{select:!0}),document.activeElement===x&&dc(s))}return()=>{s.removeEventListener(oj,d),setTimeout(()=>{const T=new CustomEvent(sj,Z3);s.addEventListener(sj,p),s.dispatchEvent(T),T.defaultPrevented||dc(x??document.body,{select:!0}),s.removeEventListener(sj,p),X3.remove(b)},0)}}},[s,d,p,b]);const P=M.useCallback(x=>{if(!n&&!r||b.paused)return;const w=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,T=document.activeElement;if(w&&T){const E=x.currentTarget,[k,D]=Jbe(E);k&&D?!x.shiftKey&&T===D?(x.preventDefault(),n&&dc(k,{select:!0})):x.shiftKey&&T===k&&(x.preventDefault(),n&&dc(D,{select:!0})):T===E&&x.preventDefault()}},[n,r,b.paused]);return h.jsx(Dn.div,{tabIndex:-1,...o,ref:y,onKeyDown:P})});ck.displayName=Xbe;function Qbe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(dc(r,{select:t}),document.activeElement!==n)return}function Jbe(e){const t=CV(e),n=Y3(t,e),r=Y3(t.reverse(),e);return[n,r]}function CV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Y3(e,t){for(const n of e)if(!exe(n,{upTo:t}))return n}function exe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function txe(e){return e instanceof HTMLInputElement&&"select"in e}function dc(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&txe(e)&&t&&e.select()}}var X3=nxe();function nxe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Q3(e,t),e.unshift(t)},remove(t){var n;e=Q3(e,t),(n=e[0])==null||n.resume()}}}function Q3(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rxe(e){return e.filter(t=>t.tagName!=="A")}var Ca=globalThis!=null&&globalThis.document?M.useLayoutEffect:()=>{},ixe=X0[" useId ".trim().toString()]||(()=>{}),axe=0;function Rc(e){const[t,n]=M.useState(ixe());return Ca(()=>{n(r=>r??String(axe++))},[e]),t?`radix-${t}`:""}const oxe=["top","right","bottom","left"],qc=Math.min,Fo=Math.max,z0=Math.round,ry=Math.floor,Fl=e=>({x:e,y:e}),sxe={left:"right",right:"left",bottom:"top",top:"bottom"},lxe={start:"end",end:"start"};function DT(e,t,n){return Fo(e,qc(t,n))}function Ru(e,t){return typeof e=="function"?e(t):e}function Lu(e){return e.split("-")[0]}function hp(e){return e.split("-")[1]}function fk(e){return e==="x"?"y":"x"}function dk(e){return e==="y"?"height":"width"}const uxe=new Set(["top","bottom"]);function Rl(e){return uxe.has(Lu(e))?"y":"x"}function hk(e){return fk(Rl(e))}function cxe(e,t,n){n===void 0&&(n=!1);const r=hp(e),i=hk(e),a=dk(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=U0(o)),[o,U0(o)]}function fxe(e){const t=U0(e);return[BT(e),t,BT(t)]}function BT(e){return e.replace(/start|end/g,t=>lxe[t])}const J3=["left","right"],e$=["right","left"],dxe=["top","bottom"],hxe=["bottom","top"];function pxe(e,t,n){switch(e){case"top":case"bottom":return n?t?e$:J3:t?J3:e$;case"left":case"right":return t?dxe:hxe;default:return[]}}function mxe(e,t,n,r){const i=hp(e);let a=pxe(Lu(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(BT)))),a}function U0(e){return e.replace(/left|right|bottom|top/g,t=>sxe[t])}function gxe(e){return{top:0,right:0,bottom:0,left:0,...e}}function NV(e){return typeof e!="number"?gxe(e):{top:e,right:e,bottom:e,left:e}}function V0(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function t$(e,t,n){let{reference:r,floating:i}=e;const a=Rl(t),o=hk(t),s=dk(o),c=Lu(t),d=a==="y",p=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,y=r[s]/2-i[s]/2;let b;switch(c){case"top":b={x:p,y:r.y-i.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-i.width,y:m};break;default:b={x:r.x,y:r.y}}switch(hp(t)){case"start":b[o]-=y*(n&&d?-1:1);break;case"end":b[o]+=y*(n&&d?-1:1);break}return b}async function vxe(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:y=!1,padding:b=0}=Ru(t,e),P=NV(b),w=s[y?m==="floating"?"reference":"floating":m],T=V0(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(w)))==null||n?w:w.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:d,rootBoundary:p,strategy:c})),E=m==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),D=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},I=V0(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:E,offsetParent:k,strategy:c}):E);return{top:(T.top-I.top+P.top)/D.y,bottom:(I.bottom-T.bottom+P.bottom)/D.y,left:(T.left-I.left+P.left)/D.x,right:(I.right-T.right+P.right)/D.x}}const yxe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:m}=t$(d,r,c),y=r,b={},P=0;for(let w=0;w<s.length;w++){var x;const{name:T,fn:E}=s[w],{x:k,y:D,data:I,reset:R}=await E({x:p,y:m,initialPlacement:r,placement:y,strategy:i,middlewareData:b,rects:d,platform:{...o,detectOverflow:(x=o.detectOverflow)!=null?x:vxe},elements:{reference:e,floating:t}});p=k??p,m=D??m,b={...b,[T]:{...b[T],...I}},R&&P<=50&&(P++,typeof R=="object"&&(R.placement&&(y=R.placement),R.rects&&(d=R.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):R.rects),{x:p,y:m}=t$(d,y,c)),w=-1)}return{x:p,y:m,placement:y,strategy:i,middlewareData:b}},bxe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:d,padding:p=0}=Ru(e,t)||{};if(d==null)return{};const m=NV(p),y={x:n,y:r},b=hk(i),P=dk(b),x=await o.getDimensions(d),w=b==="y",T=w?"top":"left",E=w?"bottom":"right",k=w?"clientHeight":"clientWidth",D=a.reference[P]+a.reference[b]-y[b]-a.floating[P],I=y[b]-a.reference[b],R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let $=R?R[k]:0;(!$||!await(o.isElement==null?void 0:o.isElement(R)))&&($=s.floating[k]||a.floating[P]);const V=D/2-I/2,K=$/2-x[P]/2-1,Z=qc(m[T],K),ee=qc(m[E],K),ne=Z,oe=$-x[P]-ee,he=$/2-x[P]/2+V,Se=DT(ne,he,oe),fe=!c.arrow&&hp(i)!=null&&he!==Se&&a.reference[P]/2-(he<ne?Z:ee)-x[P]/2<0,Oe=fe?he<ne?he-ne:he-oe:0;return{[b]:y[b]+Oe,data:{[b]:Se,centerOffset:he-Se-Oe,...fe&&{alignmentOffset:Oe}},reset:fe}}}),xxe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:c,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:P="none",flipAlignment:x=!0,...w}=Ru(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const T=Lu(i),E=Rl(s),k=Lu(s)===s,D=await(c.isRTL==null?void 0:c.isRTL(d.floating)),I=y||(k||!x?[U0(s)]:fxe(s)),R=P!=="none";!y&&R&&I.push(...mxe(s,x,P,D));const $=[s,...I],V=await c.detectOverflow(t,w),K=[];let Z=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&K.push(V[T]),m){const he=cxe(i,o,D);K.push(V[he[0]],V[he[1]])}if(Z=[...Z,{placement:i,overflows:K}],!K.every(he=>he<=0)){var ee,ne;const he=(((ee=a.flip)==null?void 0:ee.index)||0)+1,Se=$[he];if(Se&&(!(m==="alignment"?E!==Rl(Se):!1)||Z.every(re=>Rl(re.placement)===E?re.overflows[0]>0:!0)))return{data:{index:he,overflows:Z},reset:{placement:Se}};let fe=(ne=Z.filter(Oe=>Oe.overflows[0]<=0).sort((Oe,re)=>Oe.overflows[1]-re.overflows[1])[0])==null?void 0:ne.placement;if(!fe)switch(b){case"bestFit":{var oe;const Oe=(oe=Z.filter(re=>{if(R){const Ce=Rl(re.placement);return Ce===E||Ce==="y"}return!0}).map(re=>[re.placement,re.overflows.filter(Ce=>Ce>0).reduce((Ce,ae)=>Ce+ae,0)]).sort((re,Ce)=>re[1]-Ce[1])[0])==null?void 0:oe[0];Oe&&(fe=Oe);break}case"initialPlacement":fe=s;break}if(i!==fe)return{reset:{placement:fe}}}return{}}}};function n$(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function r$(e){return oxe.some(t=>e[t]>=0)}const wxe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=Ru(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),s=n$(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:r$(s)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),s=n$(o,n.floating);return{data:{escapedOffsets:s,escaped:r$(s)}}}default:return{}}}}},MV=new Set(["left","top"]);async function _xe(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Lu(n),s=hp(n),c=Rl(n)==="y",d=MV.has(o)?-1:1,p=a&&c?-1:1,m=Ru(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:P}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return s&&typeof P=="number"&&(b=s==="end"?P*-1:P),c?{x:b*p,y:y*d}:{x:y*d,y:b*p}}const Sxe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,c=await _xe(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},Pxe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:T=>{let{x:E,y:k}=T;return{x:E,y:k}}},...d}=Ru(e,t),p={x:n,y:r},m=await a.detectOverflow(t,d),y=Rl(Lu(i)),b=fk(y);let P=p[b],x=p[y];if(o){const T=b==="y"?"top":"left",E=b==="y"?"bottom":"right",k=P+m[T],D=P-m[E];P=DT(k,P,D)}if(s){const T=y==="y"?"top":"left",E=y==="y"?"bottom":"right",k=x+m[T],D=x-m[E];x=DT(k,x,D)}const w=c.fn({...t,[b]:P,[y]:x});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[b]:o,[y]:s}}}}}},jxe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:d=!0}=Ru(e,t),p={x:n,y:r},m=Rl(i),y=fk(m);let b=p[y],P=p[m];const x=Ru(s,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(c){const k=y==="y"?"height":"width",D=a.reference[y]-a.floating[k]+w.mainAxis,I=a.reference[y]+a.reference[k]-w.mainAxis;b<D?b=D:b>I&&(b=I)}if(d){var T,E;const k=y==="y"?"width":"height",D=MV.has(Lu(i)),I=a.reference[m]-a.floating[k]+(D&&((T=o.offset)==null?void 0:T[m])||0)+(D?0:w.crossAxis),R=a.reference[m]+a.reference[k]+(D?0:((E=o.offset)==null?void 0:E[m])||0)-(D?w.crossAxis:0);P<I?P=I:P>R&&(P=R)}return{[y]:b,[m]:P}}}},Oxe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...d}=Ru(e,t),p=await o.detectOverflow(t,d),m=Lu(i),y=hp(i),b=Rl(i)==="y",{width:P,height:x}=a.floating;let w,T;m==="top"||m==="bottom"?(w=m,T=y===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(T=m,w=y==="end"?"top":"bottom");const E=x-p.top-p.bottom,k=P-p.left-p.right,D=qc(x-p[w],E),I=qc(P-p[T],k),R=!t.middlewareData.shift;let $=D,V=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(V=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&($=E),R&&!y){const Z=Fo(p.left,0),ee=Fo(p.right,0),ne=Fo(p.top,0),oe=Fo(p.bottom,0);b?V=P-2*(Z!==0||ee!==0?Z+ee:Fo(p.left,p.right)):$=x-2*(ne!==0||oe!==0?ne+oe:Fo(p.top,p.bottom))}await c({...t,availableWidth:V,availableHeight:$});const K=await o.getDimensions(s.floating);return P!==K.width||x!==K.height?{reset:{rects:!0}}:{}}}};function ex(){return typeof window<"u"}function pp(e){return RV(e)?(e.nodeName||"").toLowerCase():"#document"}function Wo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zl(e){var t;return(t=(RV(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function RV(e){return ex()?e instanceof Node||e instanceof Wo(e).Node:!1}function fl(e){return ex()?e instanceof Element||e instanceof Wo(e).Element:!1}function Wl(e){return ex()?e instanceof HTMLElement||e instanceof Wo(e).HTMLElement:!1}function i$(e){return!ex()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wo(e).ShadowRoot}const Txe=new Set(["inline","contents"]);function Fg(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=dl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Txe.has(i)}const Exe=new Set(["table","td","th"]);function Axe(e){return Exe.has(pp(e))}const kxe=[":popover-open",":modal"];function tx(e){return kxe.some(t=>{try{return e.matches(t)}catch{return!1}})}const Cxe=["transform","translate","scale","rotate","perspective"],Nxe=["transform","translate","scale","rotate","perspective","filter"],Mxe=["paint","layout","strict","content"];function pk(e){const t=mk(),n=fl(e)?dl(e):e;return Cxe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Nxe.some(r=>(n.willChange||"").includes(r))||Mxe.some(r=>(n.contain||"").includes(r))}function Rxe(e){let t=zc(e);for(;Wl(t)&&!Gh(t);){if(pk(t))return t;if(tx(t))return null;t=zc(t)}return null}function mk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Lxe=new Set(["html","body","#document"]);function Gh(e){return Lxe.has(pp(e))}function dl(e){return Wo(e).getComputedStyle(e)}function nx(e){return fl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zc(e){if(pp(e)==="html")return e;const t=e.assignedSlot||e.parentNode||i$(e)&&e.host||Zl(e);return i$(t)?t.host:t}function LV(e){const t=zc(e);return Gh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wl(t)&&Fg(t)?t:LV(t)}function hg(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=LV(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Wo(i);if(a){const s=$T(o);return t.concat(o,o.visualViewport||[],Fg(i)?i:[],s&&n?hg(s):[])}return t.concat(i,hg(i,[],n))}function $T(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function IV(e){const t=dl(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Wl(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=z0(n)!==a||z0(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function gk(e){return fl(e)?e:e.contextElement}function Jd(e){const t=gk(e);if(!Wl(t))return Fl(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=IV(t);let o=(a?z0(n.width):n.width)/r,s=(a?z0(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Ixe=Fl(0);function DV(e){const t=Wo(e);return!mk()||!t.visualViewport?Ixe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dxe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wo(e)?!1:t}function rd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=gk(e);let o=Fl(1);t&&(r?fl(r)&&(o=Jd(r)):o=Jd(e));const s=Dxe(a,n,r)?DV(a):Fl(0);let c=(i.left+s.x)/o.x,d=(i.top+s.y)/o.y,p=i.width/o.x,m=i.height/o.y;if(a){const y=Wo(a),b=r&&fl(r)?Wo(r):r;let P=y,x=$T(P);for(;x&&r&&b!==P;){const w=Jd(x),T=x.getBoundingClientRect(),E=dl(x),k=T.left+(x.clientLeft+parseFloat(E.paddingLeft))*w.x,D=T.top+(x.clientTop+parseFloat(E.paddingTop))*w.y;c*=w.x,d*=w.y,p*=w.x,m*=w.y,c+=k,d+=D,P=Wo(x),x=$T(P)}}return V0({width:p,height:m,x:c,y:d})}function rx(e,t){const n=nx(e).scrollLeft;return t?t.left+n:rd(Zl(e)).left+n}function BV(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rx(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Bxe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Zl(r),s=t?tx(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},d=Fl(1);const p=Fl(0),m=Wl(r);if((m||!m&&!a)&&((pp(r)!=="body"||Fg(o))&&(c=nx(r)),Wl(r))){const b=rd(r);d=Jd(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const y=o&&!m&&!a?BV(o,c):Fl(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+p.x+y.x,y:n.y*d.y-c.scrollTop*d.y+p.y+y.y}}function $xe(e){return Array.from(e.getClientRects())}function Fxe(e){const t=Zl(e),n=nx(e),r=e.ownerDocument.body,i=Fo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Fo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+rx(e);const s=-n.scrollTop;return dl(r).direction==="rtl"&&(o+=Fo(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}const a$=25;function qxe(e,t){const n=Wo(e),r=Zl(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;const p=mk();(!p||p&&t==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}const d=rx(r);if(d<=0){const p=r.ownerDocument,m=p.body,y=getComputedStyle(m),b=p.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,P=Math.abs(r.clientWidth-m.clientWidth-b);P<=a$&&(a-=P)}else d<=a$&&(a+=d);return{width:a,height:o,x:s,y:c}}const zxe=new Set(["absolute","fixed"]);function Uxe(e,t){const n=rd(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Wl(e)?Jd(e):Fl(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,c=i*a.x,d=r*a.y;return{width:o,height:s,x:c,y:d}}function o$(e,t,n){let r;if(t==="viewport")r=qxe(e,n);else if(t==="document")r=Fxe(Zl(e));else if(fl(t))r=Uxe(t,n);else{const i=DV(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return V0(r)}function $V(e,t){const n=zc(e);return n===t||!fl(n)||Gh(n)?!1:dl(n).position==="fixed"||$V(n,t)}function Vxe(e,t){const n=t.get(e);if(n)return n;let r=hg(e,[],!1).filter(s=>fl(s)&&pp(s)!=="body"),i=null;const a=dl(e).position==="fixed";let o=a?zc(e):e;for(;fl(o)&&!Gh(o);){const s=dl(o),c=pk(o);!c&&s.position==="fixed"&&(i=null),(a?!c&&!i:!c&&s.position==="static"&&!!i&&zxe.has(i.position)||Fg(o)&&!c&&$V(e,o))?r=r.filter(p=>p!==o):i=s,o=zc(o)}return t.set(e,r),r}function Wxe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?tx(t)?[]:Vxe(t,this._c):[].concat(n),r],s=o[0],c=o.reduce((d,p)=>{const m=o$(t,p,i);return d.top=Fo(m.top,d.top),d.right=qc(m.right,d.right),d.bottom=qc(m.bottom,d.bottom),d.left=Fo(m.left,d.left),d},o$(t,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Kxe(e){const{width:t,height:n}=IV(e);return{width:t,height:n}}function Hxe(e,t,n){const r=Wl(t),i=Zl(t),a=n==="fixed",o=rd(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const c=Fl(0);function d(){c.x=rx(i)}if(r||!r&&!a)if((pp(t)!=="body"||Fg(i))&&(s=nx(t)),r){const b=rd(t,!0,a,t);c.x=b.x+t.clientLeft,c.y=b.y+t.clientTop}else i&&d();a&&!r&&i&&d();const p=i&&!r&&!a?BV(i,s):Fl(0),m=o.left+s.scrollLeft-c.x-p.x,y=o.top+s.scrollTop-c.y-p.y;return{x:m,y,width:o.width,height:o.height}}function lj(e){return dl(e).position==="static"}function s$(e,t){if(!Wl(e)||dl(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Zl(e)===n&&(n=n.ownerDocument.body),n}function FV(e,t){const n=Wo(e);if(tx(e))return n;if(!Wl(e)){let i=zc(e);for(;i&&!Gh(i);){if(fl(i)&&!lj(i))return i;i=zc(i)}return n}let r=s$(e,t);for(;r&&Axe(r)&&lj(r);)r=s$(r,t);return r&&Gh(r)&&lj(r)&&!pk(r)?n:r||Rxe(e)||n}const Gxe=async function(e){const t=this.getOffsetParent||FV,n=this.getDimensions,r=await n(e.floating);return{reference:Hxe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zxe(e){return dl(e).direction==="rtl"}const Yxe={convertOffsetParentRelativeRectToViewportRelativeRect:Bxe,getDocumentElement:Zl,getClippingRect:Wxe,getOffsetParent:FV,getElementRects:Gxe,getClientRects:$xe,getDimensions:Kxe,getScale:Jd,isElement:fl,isRTL:Zxe};function qV(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Xxe(e,t){let n=null,r;const i=Zl(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();const d=e.getBoundingClientRect(),{left:p,top:m,width:y,height:b}=d;if(s||t(),!y||!b)return;const P=ry(m),x=ry(i.clientWidth-(p+y)),w=ry(i.clientHeight-(m+b)),T=ry(p),k={rootMargin:-P+"px "+-x+"px "+-w+"px "+-T+"px",threshold:Fo(0,qc(1,c))||1};let D=!0;function I(R){const $=R[0].intersectionRatio;if($!==c){if(!D)return o();$?o(!1,$):r=setTimeout(()=>{o(!1,1e-7)},1e3)}$===1&&!qV(d,e.getBoundingClientRect())&&o(),D=!1}try{n=new IntersectionObserver(I,{...k,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,k)}n.observe(e)}return o(!0),a}function Qxe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=gk(e),p=i||a?[...d?hg(d):[],...hg(t)]:[];p.forEach(T=>{i&&T.addEventListener("scroll",n,{passive:!0}),a&&T.addEventListener("resize",n)});const m=d&&s?Xxe(d,n):null;let y=-1,b=null;o&&(b=new ResizeObserver(T=>{let[E]=T;E&&E.target===d&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=b)==null||k.observe(t)})),n()}),d&&!c&&b.observe(d),b.observe(t));let P,x=c?rd(e):null;c&&w();function w(){const T=rd(e);x&&!qV(x,T)&&n(),x=T,P=requestAnimationFrame(w)}return n(),()=>{var T;p.forEach(E=>{i&&E.removeEventListener("scroll",n),a&&E.removeEventListener("resize",n)}),m==null||m(),(T=b)==null||T.disconnect(),b=null,c&&cancelAnimationFrame(P)}}const Jxe=Sxe,ewe=Pxe,twe=xxe,nwe=Oxe,rwe=wxe,l$=bxe,iwe=jxe,awe=(e,t,n)=>{const r=new Map,i={platform:Yxe,...n},a={...i.platform,_c:r};return yxe(e,t,{...i,platform:a})};var owe=typeof document<"u",swe=function(){},jy=owe?M.useLayoutEffect:swe;function W0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!W0(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!W0(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function zV(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function u$(e,t){const n=zV(e);return Math.round(t*n)/n}function uj(e){const t=M.useRef(e);return jy(()=>{t.current=e}),t}function lwe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:d}=e,[p,m]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=M.useState(r);W0(y,r)||b(r);const[P,x]=M.useState(null),[w,T]=M.useState(null),E=M.useCallback(re=>{re!==R.current&&(R.current=re,x(re))},[]),k=M.useCallback(re=>{re!==$.current&&($.current=re,T(re))},[]),D=a||P,I=o||w,R=M.useRef(null),$=M.useRef(null),V=M.useRef(p),K=c!=null,Z=uj(c),ee=uj(i),ne=uj(d),oe=M.useCallback(()=>{if(!R.current||!$.current)return;const re={placement:t,strategy:n,middleware:y};ee.current&&(re.platform=ee.current),awe(R.current,$.current,re).then(Ce=>{const ae={...Ce,isPositioned:ne.current!==!1};he.current&&!W0(V.current,ae)&&(V.current=ae,Qh.flushSync(()=>{m(ae)}))})},[y,t,n,ee,ne]);jy(()=>{d===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,m(re=>({...re,isPositioned:!1})))},[d]);const he=M.useRef(!1);jy(()=>(he.current=!0,()=>{he.current=!1}),[]),jy(()=>{if(D&&(R.current=D),I&&($.current=I),D&&I){if(Z.current)return Z.current(D,I,oe);oe()}},[D,I,oe,Z,K]);const Se=M.useMemo(()=>({reference:R,floating:$,setReference:E,setFloating:k}),[E,k]),fe=M.useMemo(()=>({reference:D,floating:I}),[D,I]),Oe=M.useMemo(()=>{const re={position:n,left:0,top:0};if(!fe.floating)return re;const Ce=u$(fe.floating,p.x),ae=u$(fe.floating,p.y);return s?{...re,transform:"translate("+Ce+"px, "+ae+"px)",...zV(fe.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Ce,top:ae}},[n,s,fe.floating,p.x,p.y]);return M.useMemo(()=>({...p,update:oe,refs:Se,elements:fe,floatingStyles:Oe}),[p,oe,Se,fe,Oe])}const uwe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?l$({element:r.current,padding:i}).fn(n):{}:r?l$({element:r,padding:i}).fn(n):{}}}},cwe=(e,t)=>({...Jxe(e),options:[e,t]}),fwe=(e,t)=>({...ewe(e),options:[e,t]}),dwe=(e,t)=>({...iwe(e),options:[e,t]}),hwe=(e,t)=>({...twe(e),options:[e,t]}),pwe=(e,t)=>({...nwe(e),options:[e,t]}),mwe=(e,t)=>({...rwe(e),options:[e,t]}),gwe=(e,t)=>({...uwe(e),options:[e,t]});var vwe="Arrow",UV=M.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return h.jsx(Dn.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});UV.displayName=vwe;var ywe=UV;function VV(e){const[t,n]=M.useState(void 0);return Ca(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,s;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,s=d.blockSize}else o=e.offsetWidth,s=e.offsetHeight;n({width:o,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var vk="Popper",[WV,KV]=gd(vk),[bwe,HV]=WV(vk),GV=e=>{const{__scopePopper:t,children:n}=e,[r,i]=M.useState(null);return h.jsx(bwe,{scope:t,anchor:r,onAnchorChange:i,children:n})};GV.displayName=vk;var ZV="PopperAnchor",YV=M.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=HV(ZV,n),o=M.useRef(null),s=Er(t,o),c=M.useRef(null);return M.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||o.current,d!==c.current&&a.onAnchorChange(c.current)}),r?null:h.jsx(Dn.div,{...i,ref:s})});YV.displayName=ZV;var yk="PopperContent",[xwe,wwe]=WV(yk),XV=M.forwardRef((e,t)=>{var Ye,rt,ze,Fe,st,Te;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:b="optimized",onPlaced:P,...x}=e,w=HV(yk,n),[T,E]=M.useState(null),k=Er(t,Dt=>E(Dt)),[D,I]=M.useState(null),R=VV(D),$=(R==null?void 0:R.width)??0,V=(R==null?void 0:R.height)??0,K=r+(a!=="center"?"-"+a:""),Z=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},ee=Array.isArray(d)?d:[d],ne=ee.length>0,oe={padding:Z,boundary:ee.filter(Swe),altBoundary:ne},{refs:he,floatingStyles:Se,placement:fe,isPositioned:Oe,middlewareData:re}=lwe({strategy:"fixed",placement:K,whileElementsMounted:(...Dt)=>Qxe(...Dt,{animationFrame:b==="always"}),elements:{reference:w.anchor},middleware:[cwe({mainAxis:i+V,alignmentAxis:o}),c&&fwe({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?dwe():void 0,...oe}),c&&hwe({...oe}),pwe({...oe,apply:({elements:Dt,rects:Lt,availableWidth:dn,availableHeight:xn})=>{const{width:qn,height:Ar}=Lt.reference,Zr=Dt.floating.style;Zr.setProperty("--radix-popper-available-width",`${dn}px`),Zr.setProperty("--radix-popper-available-height",`${xn}px`),Zr.setProperty("--radix-popper-anchor-width",`${qn}px`),Zr.setProperty("--radix-popper-anchor-height",`${Ar}px`)}}),D&&gwe({element:D,padding:s}),Pwe({arrowWidth:$,arrowHeight:V}),y&&mwe({strategy:"referenceHidden",...oe})]}),[Ce,ae]=e8(fe),ie=Fc(P);Ca(()=>{Oe&&(ie==null||ie())},[Oe,ie]);const de=(Ye=re.arrow)==null?void 0:Ye.x,He=(rt=re.arrow)==null?void 0:rt.y,je=((ze=re.arrow)==null?void 0:ze.centerOffset)!==0,[$e,We]=M.useState();return Ca(()=>{T&&We(window.getComputedStyle(T).zIndex)},[T]),h.jsx("div",{ref:he.setFloating,"data-radix-popper-content-wrapper":"",style:{...Se,transform:Oe?Se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$e,"--radix-popper-transform-origin":[(Fe=re.transformOrigin)==null?void 0:Fe.x,(st=re.transformOrigin)==null?void 0:st.y].join(" "),...((Te=re.hide)==null?void 0:Te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(xwe,{scope:n,placedSide:Ce,onArrowChange:I,arrowX:de,arrowY:He,shouldHideArrow:je,children:h.jsx(Dn.div,{"data-side":Ce,"data-align":ae,...x,ref:k,style:{...x.style,animation:Oe?void 0:"none"}})})})});XV.displayName=yk;var QV="PopperArrow",_we={top:"bottom",right:"left",bottom:"top",left:"right"},JV=M.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=wwe(QV,r),o=_we[a.placedSide];return h.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:h.jsx(ywe,{...i,ref:n,style:{...i.style,display:"block"}})})});JV.displayName=QV;function Swe(e){return e!==null}var Pwe=e=>({name:"transformOrigin",options:e,fn(t){var w,T,E;const{placement:n,rects:r,middlewareData:i}=t,o=((w=i.arrow)==null?void 0:w.centerOffset)!==0,s=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,p]=e8(n),m={start:"0%",center:"50%",end:"100%"}[p],y=(((T=i.arrow)==null?void 0:T.x)??0)+s/2,b=(((E=i.arrow)==null?void 0:E.y)??0)+c/2;let P="",x="";return d==="bottom"?(P=o?m:`${y}px`,x=`${-c}px`):d==="top"?(P=o?m:`${y}px`,x=`${r.floating.height+c}px`):d==="right"?(P=`${-c}px`,x=o?m:`${b}px`):d==="left"&&(P=`${r.floating.width+c}px`,x=o?m:`${b}px`),{data:{x:P,y:x}}}});function e8(e){const[t,n="center"]=e.split("-");return[t,n]}var jwe=GV,Owe=YV,Twe=XV,Ewe=JV,Awe="Portal",bk=M.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,a]=M.useState(!1);Ca(()=>a(!0),[]);const o=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return o?iG.createPortal(h.jsx(Dn.div,{...r,ref:t}),o):null});bk.displayName=Awe;function kwe(e){const t=Cwe(e),n=M.forwardRef((r,i)=>{const{children:a,...o}=r,s=M.Children.toArray(a),c=s.find(Mwe);if(c){const d=c.props.children,p=s.map(m=>m===c?M.Children.count(d)>1?M.Children.only(null):M.isValidElement(d)?d.props.children:null:m);return h.jsx(t,{...o,ref:i,children:M.isValidElement(d)?M.cloneElement(d,void 0,p):null})}return h.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function Cwe(e){const t=M.forwardRef((n,r)=>{const{children:i,...a}=n;if(M.isValidElement(i)){const o=Lwe(i),s=Rwe(a,i.props);return i.type!==M.Fragment&&(s.ref=r?dp(r,o):o),M.cloneElement(i,s)}return M.Children.count(i)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nwe=Symbol("radix.slottable");function Mwe(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nwe}function Rwe(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{const c=a(...s);return i(...s),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Lwe(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Iwe=X0[" useInsertionEffect ".trim().toString()]||Ca;function Zh({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=Dwe({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{const p=M.useRef(e!==void 0);M.useEffect(()=>{const m=p.current;m!==s&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=s},[s,r])}const d=M.useCallback(p=>{var m;if(s){const y=Bwe(p)?p(e):p;y!==e&&((m=o.current)==null||m.call(o,y))}else a(p)},[s,e,a,o]);return[c,d]}function Dwe({defaultProp:e,onChange:t}){const[n,r]=M.useState(e),i=M.useRef(n),a=M.useRef(t);return Iwe(()=>{a.current=t},[t]),M.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,r,a]}function Bwe(e){return typeof e=="function"}function t8(e){const t=M.useRef({value:e,previous:e});return M.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var n8=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$we="VisuallyHidden",Fwe=M.forwardRef((e,t)=>h.jsx(Dn.span,{...e,ref:t,style:{...n8,...e.style}}));Fwe.displayName=$we;var qwe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Id=new WeakMap,iy=new WeakMap,ay={},cj=0,r8=function(e){return e&&(e.host||r8(e.parentNode))},zwe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=r8(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Uwe=function(e,t,n,r){var i=zwe(t,Array.isArray(e)?e:[e]);ay[n]||(ay[n]=new WeakMap);var a=ay[n],o=[],s=new Set,c=new Set(i),d=function(m){!m||s.has(m)||(s.add(m),d(m.parentNode))};i.forEach(d);var p=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(y){if(s.has(y))p(y);else try{var b=y.getAttribute(r),P=b!==null&&b!=="false",x=(Id.get(y)||0)+1,w=(a.get(y)||0)+1;Id.set(y,x),a.set(y,w),o.push(y),x===1&&P&&iy.set(y,!0),w===1&&y.setAttribute(n,"true"),P||y.setAttribute(r,"true")}catch(T){console.error("aria-hidden: cannot operate on ",y,T)}})};return p(t),s.clear(),cj++,function(){o.forEach(function(m){var y=Id.get(m)-1,b=a.get(m)-1;Id.set(m,y),a.set(m,b),y||(iy.has(m)||m.removeAttribute(r),iy.delete(m)),b||m.removeAttribute(n)}),cj--,cj||(Id=new WeakMap,Id=new WeakMap,iy=new WeakMap,ay={})}},i8=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=qwe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Uwe(r,i,n,"aria-hidden")):function(){return null}},kl=function(){return kl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},kl.apply(this,arguments)};function a8(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Vwe(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Oy="right-scroll-bar-position",Ty="width-before-scroll-bar",Wwe="with-scroll-bars-hidden",Kwe="--removed-body-scroll-bar-size";function fj(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Hwe(e,t){var n=M.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Gwe=typeof window<"u"?M.useLayoutEffect:M.useEffect,c$=new WeakMap;function Zwe(e,t){var n=Hwe(null,function(r){return e.forEach(function(i){return fj(i,r)})});return Gwe(function(){var r=c$.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||fj(s,null)}),a.forEach(function(s){i.has(s)||fj(s,o)})}c$.set(n,e)},[e]),n}function Ywe(e){return e}function Xwe(e,t){t===void 0&&(t=Ywe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(s){return s!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var s=n;n=[],s.forEach(a),o=n}var c=function(){var p=o;o=[],p.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(p){o.push(p),d()},filter:function(p){return o=o.filter(p),n}}}};return i}function Qwe(e){e===void 0&&(e={});var t=Xwe(null);return t.options=kl({async:!0,ssr:!1},e),t}var o8=function(e){var t=e.sideCar,n=a8(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return M.createElement(r,kl({},n))};o8.isSideCarExport=!0;function Jwe(e,t){return e.useMedium(t),o8}var s8=Qwe(),dj=function(){},ix=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:dj,onWheelCapture:dj,onTouchMoveCapture:dj}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,b=e.noRelative,P=e.noIsolation,x=e.inert,w=e.allowPinchZoom,T=e.as,E=T===void 0?"div":T,k=e.gapMode,D=a8(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=y,R=Zwe([n,t]),$=kl(kl({},D),i);return M.createElement(M.Fragment,null,p&&M.createElement(I,{sideCar:s8,removeScrollBar:d,shards:m,noRelative:b,noIsolation:P,inert:x,setCallbacks:a,allowPinchZoom:!!w,lockRef:n,gapMode:k}),o?M.cloneElement(M.Children.only(s),kl(kl({},$),{ref:R})):M.createElement(E,kl({},$,{className:c,ref:R}),s))});ix.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ix.classNames={fullWidth:Ty,zeroRight:Oy};var e_e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function t_e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=e_e();return t&&e.setAttribute("nonce",t),e}function n_e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function r_e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var i_e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=t_e())&&(n_e(t,n),r_e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},a_e=function(){var e=i_e();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},l8=function(){var e=a_e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},o_e={left:0,top:0,right:0,gap:0},hj=function(e){return parseInt(e||"",10)||0},s_e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[hj(n),hj(r),hj(i)]},l_e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return o_e;var t=s_e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},u_e=l8(),eh="data-scroll-locked",c_e=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(Wwe,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(s,"px ").concat(r,`;
|
||
}
|
||
body[`).concat(eh,`] {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(i,`px;
|
||
padding-top: `).concat(a,`px;
|
||
padding-right: `).concat(o,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(s,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Oy,` {
|
||
right: `).concat(s,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Ty,` {
|
||
margin-right: `).concat(s,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Oy," .").concat(Oy,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Ty," .").concat(Ty,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body[`).concat(eh,`] {
|
||
`).concat(Kwe,": ").concat(s,`px;
|
||
}
|
||
`)},f$=function(){var e=parseInt(document.body.getAttribute(eh)||"0",10);return isFinite(e)?e:0},f_e=function(){M.useEffect(function(){return document.body.setAttribute(eh,(f$()+1).toString()),function(){var e=f$()-1;e<=0?document.body.removeAttribute(eh):document.body.setAttribute(eh,e.toString())}},[])},d_e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;f_e();var a=M.useMemo(function(){return l_e(i)},[i]);return M.createElement(u_e,{styles:c_e(a,!t,i,n?"":"!important")})},FT=!1;if(typeof window<"u")try{var oy=Object.defineProperty({},"passive",{get:function(){return FT=!0,!0}});window.addEventListener("test",oy,oy),window.removeEventListener("test",oy,oy)}catch{FT=!1}var Dd=FT?{passive:!1}:!1,h_e=function(e){return e.tagName==="TEXTAREA"},u8=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!h_e(e)&&n[t]==="visible")},p_e=function(e){return u8(e,"overflowY")},m_e=function(e){return u8(e,"overflowX")},d$=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=c8(e,r);if(i){var a=f8(e,r),o=a[1],s=a[2];if(o>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},g_e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},v_e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},c8=function(e,t){return e==="v"?p_e(t):m_e(t)},f8=function(e,t){return e==="v"?g_e(t):v_e(t)},y_e=function(e,t){return e==="h"&&t==="rtl"?-1:1},b_e=function(e,t,n,r,i){var a=y_e(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),d=!1,p=o>0,m=0,y=0;do{if(!s)break;var b=f8(e,s),P=b[0],x=b[1],w=b[2],T=x-w-a*P;(P||T)&&c8(e,s)&&(m+=T,y+=P);var E=s.parentNode;s=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(d=!0),d},sy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},h$=function(e){return[e.deltaX,e.deltaY]},p$=function(e){return e&&"current"in e?e.current:e},x_e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},w_e=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},__e=0,Bd=[];function S_e(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(__e++)[0],a=M.useState(l8)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=Vwe([e.lockRef.current],(e.shards||[]).map(p$),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=M.useCallback(function(x,w){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!o.current.allowPinchZoom;var T=sy(x),E=n.current,k="deltaX"in x?x.deltaX:E[0]-T[0],D="deltaY"in x?x.deltaY:E[1]-T[1],I,R=x.target,$=Math.abs(k)>Math.abs(D)?"h":"v";if("touches"in x&&$==="h"&&R.type==="range")return!1;var V=window.getSelection(),K=V&&V.anchorNode,Z=K?K===R||K.contains(R):!1;if(Z)return!1;var ee=d$($,R);if(!ee)return!0;if(ee?I=$:(I=$==="v"?"h":"v",ee=d$($,R)),!ee)return!1;if(!r.current&&"changedTouches"in x&&(k||D)&&(r.current=I),!I)return!0;var ne=r.current||I;return b_e(ne,w,x,ne==="h"?k:D)},[]),c=M.useCallback(function(x){var w=x;if(!(!Bd.length||Bd[Bd.length-1]!==a)){var T="deltaY"in w?h$(w):sy(w),E=t.current.filter(function(I){return I.name===w.type&&(I.target===w.target||w.target===I.shadowParent)&&x_e(I.delta,T)})[0];if(E&&E.should){w.cancelable&&w.preventDefault();return}if(!E){var k=(o.current.shards||[]).map(p$).filter(Boolean).filter(function(I){return I.contains(w.target)}),D=k.length>0?s(w,k[0]):!o.current.noIsolation;D&&w.cancelable&&w.preventDefault()}}},[]),d=M.useCallback(function(x,w,T,E){var k={name:x,delta:w,target:T,should:E,shadowParent:P_e(T)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(D){return D!==k})},1)},[]),p=M.useCallback(function(x){n.current=sy(x),r.current=void 0},[]),m=M.useCallback(function(x){d(x.type,h$(x),x.target,s(x,e.lockRef.current))},[]),y=M.useCallback(function(x){d(x.type,sy(x),x.target,s(x,e.lockRef.current))},[]);M.useEffect(function(){return Bd.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",c,Dd),document.addEventListener("touchmove",c,Dd),document.addEventListener("touchstart",p,Dd),function(){Bd=Bd.filter(function(x){return x!==a}),document.removeEventListener("wheel",c,Dd),document.removeEventListener("touchmove",c,Dd),document.removeEventListener("touchstart",p,Dd)}},[]);var b=e.removeScrollBar,P=e.inert;return M.createElement(M.Fragment,null,P?M.createElement(a,{styles:w_e(i)}):null,b?M.createElement(d_e,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function P_e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const j_e=Jwe(s8,S_e);var xk=M.forwardRef(function(e,t){return M.createElement(ix,kl({},e,{ref:t,sideCar:j_e}))});xk.classNames=ix.classNames;var O_e=[" ","Enter","ArrowUp","ArrowDown"],T_e=[" ","Enter"],id="Select",[ax,ox,E_e]=TV(id),[mp]=gd(id,[E_e,KV]),sx=KV(),[A_e,Xc]=mp(id),[k_e,C_e]=mp(id),d8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:d,name:p,autoComplete:m,disabled:y,required:b,form:P}=e,x=sx(t),[w,T]=M.useState(null),[E,k]=M.useState(null),[D,I]=M.useState(!1),R=lk(d),[$,V]=Zh({prop:r,defaultProp:i??!1,onChange:a,caller:id}),[K,Z]=Zh({prop:o,defaultProp:s,onChange:c,caller:id}),ee=M.useRef(null),ne=w?P||!!w.closest("form"):!0,[oe,he]=M.useState(new Set),Se=Array.from(oe).map(fe=>fe.props.value).join(";");return h.jsx(jwe,{...x,children:h.jsxs(A_e,{required:b,scope:t,trigger:w,onTriggerChange:T,valueNode:E,onValueNodeChange:k,valueNodeHasChildren:D,onValueNodeHasChildrenChange:I,contentId:Rc(),value:K,onValueChange:Z,open:$,onOpenChange:V,dir:R,triggerPointerDownPosRef:ee,disabled:y,children:[h.jsx(ax.Provider,{scope:t,children:h.jsx(k_e,{scope:e.__scopeSelect,onNativeOptionAdd:M.useCallback(fe=>{he(Oe=>new Set(Oe).add(fe))},[]),onNativeOptionRemove:M.useCallback(fe=>{he(Oe=>{const re=new Set(Oe);return re.delete(fe),re})},[]),children:n})}),ne?h.jsxs(I8,{"aria-hidden":!0,required:b,tabIndex:-1,name:p,autoComplete:m,value:K,onChange:fe=>Z(fe.target.value),disabled:y,form:P,children:[K===void 0?h.jsx("option",{value:""}):null,Array.from(oe)]},Se):null]})})};d8.displayName=id;var h8="SelectTrigger",p8=M.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=sx(n),o=Xc(h8,n),s=o.disabled||r,c=Er(t,o.onTriggerChange),d=ox(n),p=M.useRef("touch"),[m,y,b]=B8(x=>{const w=d().filter(k=>!k.disabled),T=w.find(k=>k.value===o.value),E=$8(w,x,T);E!==void 0&&o.onValueChange(E.value)}),P=x=>{s||(o.onOpenChange(!0),b()),x&&(o.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return h.jsx(Owe,{asChild:!0,...a,children:h.jsx(Dn.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":D8(o.value)?"":void 0,...i,ref:c,onClick:Mn(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&P(x)}),onPointerDown:Mn(i.onPointerDown,x=>{p.current=x.pointerType;const w=x.target;w.hasPointerCapture(x.pointerId)&&w.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(P(x),x.preventDefault())}),onKeyDown:Mn(i.onKeyDown,x=>{const w=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&y(x.key),!(w&&x.key===" ")&&O_e.includes(x.key)&&(P(),x.preventDefault())})})})});p8.displayName=h8;var m8="SelectValue",g8=M.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...s}=e,c=Xc(m8,n),{onValueNodeHasChildrenChange:d}=c,p=a!==void 0,m=Er(t,c.onValueNodeChange);return Ca(()=>{d(p)},[d,p]),h.jsx(Dn.span,{...s,ref:m,style:{pointerEvents:"none"},children:D8(c.value)?h.jsx(h.Fragment,{children:o}):a})});g8.displayName=m8;var N_e="SelectIcon",v8=M.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return h.jsx(Dn.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});v8.displayName=N_e;var M_e="SelectPortal",y8=e=>h.jsx(bk,{asChild:!0,...e});y8.displayName=M_e;var ad="SelectContent",b8=M.forwardRef((e,t)=>{const n=Xc(ad,e.__scopeSelect),[r,i]=M.useState();if(Ca(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Qh.createPortal(h.jsx(x8,{scope:e.__scopeSelect,children:h.jsx(ax.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),a):null}return h.jsx(w8,{...e,ref:t})});b8.displayName=ad;var Js=10,[x8,Qc]=mp(ad),R_e="SelectContentImpl",L_e=kwe("SelectContent.RemoveScroll"),w8=M.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:y,collisionPadding:b,sticky:P,hideWhenDetached:x,avoidCollisions:w,...T}=e,E=Xc(ad,n),[k,D]=M.useState(null),[I,R]=M.useState(null),$=Er(t,Ye=>D(Ye)),[V,K]=M.useState(null),[Z,ee]=M.useState(null),ne=ox(n),[oe,he]=M.useState(!1),Se=M.useRef(!1);M.useEffect(()=>{if(k)return i8(k)},[k]),kV();const fe=M.useCallback(Ye=>{const[rt,...ze]=ne().map(Te=>Te.ref.current),[Fe]=ze.slice(-1),st=document.activeElement;for(const Te of Ye)if(Te===st||(Te==null||Te.scrollIntoView({block:"nearest"}),Te===rt&&I&&(I.scrollTop=0),Te===Fe&&I&&(I.scrollTop=I.scrollHeight),Te==null||Te.focus(),document.activeElement!==st))return},[ne,I]),Oe=M.useCallback(()=>fe([V,k]),[fe,V,k]);M.useEffect(()=>{oe&&Oe()},[oe,Oe]);const{onOpenChange:re,triggerPointerDownPosRef:Ce}=E;M.useEffect(()=>{if(k){let Ye={x:0,y:0};const rt=Fe=>{var st,Te;Ye={x:Math.abs(Math.round(Fe.pageX)-(((st=Ce.current)==null?void 0:st.x)??0)),y:Math.abs(Math.round(Fe.pageY)-(((Te=Ce.current)==null?void 0:Te.y)??0))}},ze=Fe=>{Ye.x<=10&&Ye.y<=10?Fe.preventDefault():k.contains(Fe.target)||re(!1),document.removeEventListener("pointermove",rt),Ce.current=null};return Ce.current!==null&&(document.addEventListener("pointermove",rt),document.addEventListener("pointerup",ze,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",rt),document.removeEventListener("pointerup",ze,{capture:!0})}}},[k,re,Ce]),M.useEffect(()=>{const Ye=()=>re(!1);return window.addEventListener("blur",Ye),window.addEventListener("resize",Ye),()=>{window.removeEventListener("blur",Ye),window.removeEventListener("resize",Ye)}},[re]);const[ae,ie]=B8(Ye=>{const rt=ne().filter(st=>!st.disabled),ze=rt.find(st=>st.ref.current===document.activeElement),Fe=$8(rt,Ye,ze);Fe&&setTimeout(()=>Fe.ref.current.focus())}),de=M.useCallback((Ye,rt,ze)=>{const Fe=!Se.current&&!ze;(E.value!==void 0&&E.value===rt||Fe)&&(K(Ye),Fe&&(Se.current=!0))},[E.value]),He=M.useCallback(()=>k==null?void 0:k.focus(),[k]),je=M.useCallback((Ye,rt,ze)=>{const Fe=!Se.current&&!ze;(E.value!==void 0&&E.value===rt||Fe)&&ee(Ye)},[E.value]),$e=r==="popper"?qT:_8,We=$e===qT?{side:s,sideOffset:c,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:y,collisionPadding:b,sticky:P,hideWhenDetached:x,avoidCollisions:w}:{};return h.jsx(x8,{scope:n,content:k,viewport:I,onViewportChange:R,itemRefCallback:de,selectedItem:V,onItemLeave:He,itemTextRefCallback:je,focusSelectedItem:Oe,selectedItemText:Z,position:r,isPositioned:oe,searchRef:ae,children:h.jsx(xk,{as:L_e,allowPinchZoom:!0,children:h.jsx(ck,{asChild:!0,trapped:E.open,onMountAutoFocus:Ye=>{Ye.preventDefault()},onUnmountAutoFocus:Mn(i,Ye=>{var rt;(rt=E.trigger)==null||rt.focus({preventScroll:!0}),Ye.preventDefault()}),children:h.jsx(uk,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:Ye=>Ye.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:h.jsx($e,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:Ye=>Ye.preventDefault(),...T,...We,onPlaced:()=>he(!0),ref:$,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Mn(T.onKeyDown,Ye=>{const rt=Ye.ctrlKey||Ye.altKey||Ye.metaKey;if(Ye.key==="Tab"&&Ye.preventDefault(),!rt&&Ye.key.length===1&&ie(Ye.key),["ArrowUp","ArrowDown","Home","End"].includes(Ye.key)){let Fe=ne().filter(st=>!st.disabled).map(st=>st.ref.current);if(["ArrowUp","End"].includes(Ye.key)&&(Fe=Fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Ye.key)){const st=Ye.target,Te=Fe.indexOf(st);Fe=Fe.slice(Te+1)}setTimeout(()=>fe(Fe)),Ye.preventDefault()}})})})})})})});w8.displayName=R_e;var I_e="SelectItemAlignedPosition",_8=M.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Xc(ad,n),o=Qc(ad,n),[s,c]=M.useState(null),[d,p]=M.useState(null),m=Er(t,$=>p($)),y=ox(n),b=M.useRef(!1),P=M.useRef(!0),{viewport:x,selectedItem:w,selectedItemText:T,focusSelectedItem:E}=o,k=M.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&d&&x&&w&&T){const $=a.trigger.getBoundingClientRect(),V=d.getBoundingClientRect(),K=a.valueNode.getBoundingClientRect(),Z=T.getBoundingClientRect();if(a.dir!=="rtl"){const st=Z.left-V.left,Te=K.left-st,Dt=$.left-Te,Lt=$.width+Dt,dn=Math.max(Lt,V.width),xn=window.innerWidth-Js,qn=V3(Te,[Js,Math.max(Js,xn-dn)]);s.style.minWidth=Lt+"px",s.style.left=qn+"px"}else{const st=V.right-Z.right,Te=window.innerWidth-K.right-st,Dt=window.innerWidth-$.right-Te,Lt=$.width+Dt,dn=Math.max(Lt,V.width),xn=window.innerWidth-Js,qn=V3(Te,[Js,Math.max(Js,xn-dn)]);s.style.minWidth=Lt+"px",s.style.right=qn+"px"}const ee=y(),ne=window.innerHeight-Js*2,oe=x.scrollHeight,he=window.getComputedStyle(d),Se=parseInt(he.borderTopWidth,10),fe=parseInt(he.paddingTop,10),Oe=parseInt(he.borderBottomWidth,10),re=parseInt(he.paddingBottom,10),Ce=Se+fe+oe+re+Oe,ae=Math.min(w.offsetHeight*5,Ce),ie=window.getComputedStyle(x),de=parseInt(ie.paddingTop,10),He=parseInt(ie.paddingBottom,10),je=$.top+$.height/2-Js,$e=ne-je,We=w.offsetHeight/2,Ye=w.offsetTop+We,rt=Se+fe+Ye,ze=Ce-rt;if(rt<=je){const st=ee.length>0&&w===ee[ee.length-1].ref.current;s.style.bottom="0px";const Te=d.clientHeight-x.offsetTop-x.offsetHeight,Dt=Math.max($e,We+(st?He:0)+Te+Oe),Lt=rt+Dt;s.style.height=Lt+"px"}else{const st=ee.length>0&&w===ee[0].ref.current;s.style.top="0px";const Dt=Math.max(je,Se+x.offsetTop+(st?de:0)+We)+ze;s.style.height=Dt+"px",x.scrollTop=rt-je+x.offsetTop}s.style.margin=`${Js}px 0`,s.style.minHeight=ae+"px",s.style.maxHeight=ne+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[y,a.trigger,a.valueNode,s,d,x,w,T,a.dir,r]);Ca(()=>k(),[k]);const[D,I]=M.useState();Ca(()=>{d&&I(window.getComputedStyle(d).zIndex)},[d]);const R=M.useCallback($=>{$&&P.current===!0&&(k(),E==null||E(),P.current=!1)},[k,E]);return h.jsx(B_e,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:b,onScrollButtonChange:R,children:h.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:h.jsx(Dn.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});_8.displayName=I_e;var D_e="SelectPopperPosition",qT=M.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Js,...a}=e,o=sx(n);return h.jsx(Twe,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qT.displayName=D_e;var[B_e,wk]=mp(ad,{}),zT="SelectViewport",S8=M.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=Qc(zT,n),o=wk(zT,n),s=Er(t,a.onViewportChange),c=M.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(ax.Slot,{scope:n,children:h.jsx(Dn.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Mn(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:y}=o;if(y!=null&&y.current&&m){const b=Math.abs(c.current-p.scrollTop);if(b>0){const P=window.innerHeight-Js*2,x=parseFloat(m.style.minHeight),w=parseFloat(m.style.height),T=Math.max(x,w);if(T<P){const E=T+b,k=Math.min(P,E),D=E-k;m.style.height=k+"px",m.style.bottom==="0px"&&(p.scrollTop=D>0?D:0,m.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});S8.displayName=zT;var P8="SelectGroup",[$_e,F_e]=mp(P8),q_e=M.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Rc();return h.jsx($_e,{scope:n,id:i,children:h.jsx(Dn.div,{role:"group","aria-labelledby":i,...r,ref:t})})});q_e.displayName=P8;var j8="SelectLabel",O8=M.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=F_e(j8,n);return h.jsx(Dn.div,{id:i.id,...r,ref:t})});O8.displayName=j8;var K0="SelectItem",[z_e,T8]=mp(K0),E8=M.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Xc(K0,n),c=Qc(K0,n),d=s.value===r,[p,m]=M.useState(a??""),[y,b]=M.useState(!1),P=Er(t,E=>{var k;return(k=c.itemRefCallback)==null?void 0:k.call(c,E,r,i)}),x=Rc(),w=M.useRef("touch"),T=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(z_e,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:M.useCallback(E=>{m(k=>k||((E==null?void 0:E.textContent)??"").trim())},[]),children:h.jsx(ax.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:h.jsx(Dn.div,{role:"option","aria-labelledby":x,"data-highlighted":y?"":void 0,"aria-selected":d&&y,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:P,onFocus:Mn(o.onFocus,()=>b(!0)),onBlur:Mn(o.onBlur,()=>b(!1)),onClick:Mn(o.onClick,()=>{w.current!=="mouse"&&T()}),onPointerUp:Mn(o.onPointerUp,()=>{w.current==="mouse"&&T()}),onPointerDown:Mn(o.onPointerDown,E=>{w.current=E.pointerType}),onPointerMove:Mn(o.onPointerMove,E=>{var k;w.current=E.pointerType,i?(k=c.onItemLeave)==null||k.call(c):w.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Mn(o.onPointerLeave,E=>{var k;E.currentTarget===document.activeElement&&((k=c.onItemLeave)==null||k.call(c))}),onKeyDown:Mn(o.onKeyDown,E=>{var D;((D=c.searchRef)==null?void 0:D.current)!==""&&E.key===" "||(T_e.includes(E.key)&&T(),E.key===" "&&E.preventDefault())})})})})});E8.displayName=K0;var lm="SelectItemText",A8=M.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=Xc(lm,n),s=Qc(lm,n),c=T8(lm,n),d=C_e(lm,n),[p,m]=M.useState(null),y=Er(t,T=>m(T),c.onItemTextChange,T=>{var E;return(E=s.itemTextRefCallback)==null?void 0:E.call(s,T,c.value,c.disabled)}),b=p==null?void 0:p.textContent,P=M.useMemo(()=>h.jsx("option",{value:c.value,disabled:c.disabled,children:b},c.value),[c.disabled,c.value,b]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=d;return Ca(()=>(x(P),()=>w(P)),[x,w,P]),h.jsxs(h.Fragment,{children:[h.jsx(Dn.span,{id:c.textId,...a,ref:y}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Qh.createPortal(a.children,o.valueNode):null]})});A8.displayName=lm;var k8="SelectItemIndicator",C8=M.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return T8(k8,n).isSelected?h.jsx(Dn.span,{"aria-hidden":!0,...r,ref:t}):null});C8.displayName=k8;var UT="SelectScrollUpButton",N8=M.forwardRef((e,t)=>{const n=Qc(UT,e.__scopeSelect),r=wk(UT,e.__scopeSelect),[i,a]=M.useState(!1),o=Er(t,r.onScrollButtonChange);return Ca(()=>{if(n.viewport&&n.isPositioned){let s=function(){const d=c.scrollTop>0;a(d)};const c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(R8,{...e,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=n;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});N8.displayName=UT;var VT="SelectScrollDownButton",M8=M.forwardRef((e,t)=>{const n=Qc(VT,e.__scopeSelect),r=wk(VT,e.__scopeSelect),[i,a]=M.useState(!1),o=Er(t,r.onScrollButtonChange);return Ca(()=>{if(n.viewport&&n.isPositioned){let s=function(){const d=c.scrollHeight-c.clientHeight,p=Math.ceil(c.scrollTop)<d;a(p)};const c=n.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?h.jsx(R8,{...e,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=n;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});M8.displayName=VT;var R8=M.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Qc("SelectScrollButton",n),o=M.useRef(null),s=ox(n),c=M.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return M.useEffect(()=>()=>c(),[c]),Ca(()=>{var p;const d=s().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[s]),h.jsx(Dn.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Mn(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Mn(i.onPointerMove,()=>{var d;(d=a.onItemLeave)==null||d.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Mn(i.onPointerLeave,()=>{c()})})}),U_e="SelectSeparator",L8=M.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(Dn.div,{"aria-hidden":!0,...r,ref:t})});L8.displayName=U_e;var WT="SelectArrow",V_e=M.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=sx(n),a=Xc(WT,n),o=Qc(WT,n);return a.open&&o.position==="popper"?h.jsx(Ewe,{...i,...r,ref:t}):null});V_e.displayName=WT;var W_e="SelectBubbleInput",I8=M.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=M.useRef(null),a=Er(r,i),o=t8(t);return M.useEffect(()=>{const s=i.current;if(!s)return;const c=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&p){const m=new Event("change",{bubbles:!0});p.call(s,t),s.dispatchEvent(m)}},[o,t]),h.jsx(Dn.select,{...n,style:{...n8,...n.style},ref:a,defaultValue:t})});I8.displayName=W_e;function D8(e){return e===""||e===void 0}function B8(e){const t=Fc(e),n=M.useRef(""),r=M.useRef(0),i=M.useCallback(o=>{const s=n.current+o;t(s),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(s)},[t]),a=M.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return M.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function $8(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=K_e(e,Math.max(a,0));i.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function K_e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var H_e=d8,F8=p8,G_e=g8,Z_e=v8,Y_e=y8,q8=b8,X_e=S8,z8=O8,U8=E8,Q_e=A8,J_e=C8,V8=N8,W8=M8,K8=L8;const Hr=H_e,Gr=G_e,Dr=M.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(F8,{ref:r,className:fn("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,h.jsx(Z_e,{asChild:!0,children:h.jsx(X$,{className:"h-4 w-4 opacity-50"})})]}));Dr.displayName=F8.displayName;const H8=M.forwardRef(({className:e,...t},n)=>h.jsx(V8,{ref:n,className:fn("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(OH,{className:"h-4 w-4"})}));H8.displayName=V8.displayName;const G8=M.forwardRef(({className:e,...t},n)=>h.jsx(W8,{ref:n,className:fn("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(X$,{className:"h-4 w-4"})}));G8.displayName=W8.displayName;const Br=M.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>h.jsx(Y_e,{children:h.jsxs(q8,{ref:i,className:fn("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[h.jsx(H8,{}),h.jsx(X_e,{className:fn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),h.jsx(G8,{})]})}));Br.displayName=q8.displayName;const e1e=M.forwardRef(({className:e,...t},n)=>h.jsx(z8,{ref:n,className:fn("px-2 py-1.5 text-sm font-semibold",e),...t}));e1e.displayName=z8.displayName;const Kt=M.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(U8,{ref:r,className:fn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[h.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(J_e,{children:h.jsx(Y$,{className:"h-4 w-4"})})}),h.jsx(Q_e,{children:t})]}));Kt.displayName=U8.displayName;const t1e=M.forwardRef(({className:e,...t},n)=>h.jsx(K8,{ref:n,className:fn("-mx-1 my-1 h-px bg-muted",e),...t}));t1e.displayName=K8.displayName;var pj={exports:{}},m$;function n1e(){return m$||(m$=1,(function(e,t){var n=void 0,r=function(i){return n||(n=new Promise(function(a,o){var Xi,Rs;var s=typeof i<"u"?i:{},c=s.onAbort;s.onAbort=function(A){o(new Error(A)),c&&c(A)},s.postRun=s.postRun||[],s.postRun.push(function(){a(s)}),e=void 0;var d;d||(d=typeof s<"u"?s:{});var p=!!globalThis.window,m=!!globalThis.WorkerGlobalScope;d.onRuntimeInitialized=function(){function A(Ne,Ze){switch(typeof Ze){case"boolean":Jl(Ne,Ze?1:0);break;case"number":qa(Ne,Ze);break;case"string":rs(Ne,Ze,-1,-1);break;case"object":if(Ze===null)$s(Ne);else if(Ze.length!=null){var jt=oo(Ze.length);R.set(Ze,jt),va(Ne,jt,Ze.length,-1),sr(jt)}else Qi(Ne,"Wrong API use : tried to return a value of an unknown type ("+Ze+").",-1);break;default:$s(Ne)}}function q(Ne,Ze){for(var jt=[],$t=0;$t<Ne;$t+=1){var an=Ye(Ze+4*$t,"i32"),Tn=Bs(an);if(Tn===1||Tn===2)an=Ql(an);else if(Tn===3)an=qu(an);else if(Tn===4){Tn=an,an=Fu(Tn),Tn=ns(Tn);for(var Ji=new Uint8Array(an),Gn=0;Gn<an;Gn+=1)Ji[Gn]=R[Tn+Gn];an=Ji}else an=null;jt.push(an)}return jt}function H(Ne,Ze){this.Qa=Ne,this.db=Ze,this.Oa=1,this.xb=[]}function X(Ne,Ze){if(this.db=Ze,this.nb=Un(Ne),this.nb===null)throw Error("Unable to allocate memory for the SQL string");this.tb=this.nb,this.fb=this.Cb=null}function xe(Ne){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),Ne!=null){var Ze=this.filename,jt="/",$t=Ze;if(jt&&(jt=typeof jt=="string"?jt:Go(jt),$t=Ze?Lt(jt+"/"+Ze):jt),Ze=Na(!0,!0),$t=ha($t,Ze),Ne){if(typeof Ne=="string"){jt=Array(Ne.length);for(var an=0,Tn=Ne.length;an<Tn;++an)jt[an]=Ne.charCodeAt(an);Ne=jt}hi($t,Ze|146),jt=ko($t,577),Xo(jt,Ne,0,Ne.length,0),pa(jt),hi($t,Ze)}}this.handleError(zt(this.filename,Le)),this.db=Ye(Le,"i32"),Fs(this.db),this.ob={},this.Sa={}}var Le=kr(4),Ge=d.cwrap,zt=Ge("sqlite3_open","number",["string","number"]),Sn=Ge("sqlite3_close_v2","number",["number"]),Zt=Ge("sqlite3_exec","number",["number","string","number","number","number"]),Ln=Ge("sqlite3_changes","number",["number"]),Jn=Ge("sqlite3_prepare_v2","number",["number","string","number","number","number"]),rn=Ge("sqlite3_sql","string",["number"]),ga=Ge("sqlite3_normalized_sql","string",["number"]),ii=Ge("sqlite3_prepare_v2","number",["number","number","number","number","number"]),so=Ge("sqlite3_bind_text","number",["number","number","number","number","number"]),yl=Ge("sqlite3_bind_blob","number",["number","number","number","number","number"]),Jo=Ge("sqlite3_bind_double","number",["number","number","number"]),lo=Ge("sqlite3_bind_int","number",["number","number","number"]),Xl=Ge("sqlite3_bind_parameter_index","number",["number","string"]),Cr=Ge("sqlite3_step","number",["number"]),Fa=Ge("sqlite3_errmsg","string",["number"]),es=Ge("sqlite3_column_count","number",["number"]),uo=Ge("sqlite3_data_count","number",["number"]),Jc=Ge("sqlite3_column_double","number",["number","number"]),Pr=Ge("sqlite3_column_text","string",["number","number"]),Ls=Ge("sqlite3_column_blob","number",["number","number"]),co=Ge("sqlite3_column_bytes","number",["number","number"]),vi=Ge("sqlite3_column_type","number",["number","number"]),Is=Ge("sqlite3_column_name","string",["number","number"]),Nr=Ge("sqlite3_reset","number",["number"]),Mo=Ge("sqlite3_clear_bindings","number",["number"]),Ds=Ge("sqlite3_finalize","number",["number"]),ts=Ge("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),Bs=Ge("sqlite3_value_type","number",["number"]),Fu=Ge("sqlite3_value_bytes","number",["number"]),qu=Ge("sqlite3_value_text","string",["number"]),ns=Ge("sqlite3_value_blob","number",["number"]),Ql=Ge("sqlite3_value_double","number",["number"]),qa=Ge("sqlite3_result_double","",["number","number"]),$s=Ge("sqlite3_result_null","",["number"]),rs=Ge("sqlite3_result_text","",["number","string","number","number"]),va=Ge("sqlite3_result_blob","",["number","number","number","number"]),Jl=Ge("sqlite3_result_int","",["number","number"]),Qi=Ge("sqlite3_result_error","",["number","string","number"]),yi=Ge("sqlite3_aggregate_context","number",["number","number"]),Fs=Ge("RegisterExtensionFunctions","number",["number"]),is=Ge("sqlite3_update_hook","number",["number","number","number"]);H.prototype.bind=function(Ne){if(!this.Qa)throw"Statement closed";return this.reset(),Array.isArray(Ne)?this.Qb(Ne):Ne!=null&&typeof Ne=="object"?this.Rb(Ne):!0},H.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var Ne=Cr(this.Qa);switch(Ne){case 100:return!0;case 101:return!1;default:throw this.db.handleError(Ne)}},H.prototype.Jb=function(Ne){return Ne==null&&(Ne=this.Oa,this.Oa+=1),Jc(this.Qa,Ne)},H.prototype.Xb=function(Ne){if(Ne==null&&(Ne=this.Oa,this.Oa+=1),Ne=Pr(this.Qa,Ne),typeof BigInt!="function")throw Error("BigInt is not supported");return BigInt(Ne)},H.prototype.Yb=function(Ne){return Ne==null&&(Ne=this.Oa,this.Oa+=1),Pr(this.Qa,Ne)},H.prototype.getBlob=function(Ne){Ne==null&&(Ne=this.Oa,this.Oa+=1);var Ze=co(this.Qa,Ne);Ne=Ls(this.Qa,Ne);for(var jt=new Uint8Array(Ze),$t=0;$t<Ze;$t+=1)jt[$t]=R[Ne+$t];return jt},H.prototype.get=function(Ne,Ze){Ze=Ze||{},Ne!=null&&this.bind(Ne)&&this.step(),Ne=[];for(var jt=uo(this.Qa),$t=0;$t<jt;$t+=1)switch(vi(this.Qa,$t)){case 1:var an=Ze.useBigInt?this.Xb($t):this.Jb($t);Ne.push(an);break;case 2:Ne.push(this.Jb($t));break;case 3:Ne.push(this.Yb($t));break;case 4:Ne.push(this.getBlob($t));break;default:Ne.push(null)}return Ne},H.prototype.getColumnNames=function(){for(var Ne=[],Ze=es(this.Qa),jt=0;jt<Ze;jt+=1)Ne.push(Is(this.Qa,jt));return Ne},H.prototype.getAsObject=function(Ne,Ze){Ne=this.get(Ne,Ze),Ze=this.getColumnNames();for(var jt={},$t=0;$t<Ze.length;$t+=1)jt[Ze[$t]]=Ne[$t];return jt},H.prototype.getSQL=function(){return rn(this.Qa)},H.prototype.getNormalizedSQL=function(){return ga(this.Qa)},H.prototype.run=function(Ne){return Ne!=null&&this.bind(Ne),this.step(),this.reset()},H.prototype.Gb=function(Ne,Ze){Ze==null&&(Ze=this.Oa,this.Oa+=1),Ne=Un(Ne),this.xb.push(Ne),this.db.handleError(so(this.Qa,Ze,Ne,-1,0))},H.prototype.Pb=function(Ne,Ze){Ze==null&&(Ze=this.Oa,this.Oa+=1);var jt=oo(Ne.length);R.set(Ne,jt),this.xb.push(jt),this.db.handleError(yl(this.Qa,Ze,jt,Ne.length,0))},H.prototype.Fb=function(Ne,Ze){Ze==null&&(Ze=this.Oa,this.Oa+=1),this.db.handleError((Ne===(Ne|0)?lo:Jo)(this.Qa,Ze,Ne))},H.prototype.Sb=function(Ne){Ne==null&&(Ne=this.Oa,this.Oa+=1),yl(this.Qa,Ne,0,0,0)},H.prototype.Hb=function(Ne,Ze){switch(Ze==null&&(Ze=this.Oa,this.Oa+=1),typeof Ne){case"string":this.Gb(Ne,Ze);return;case"number":this.Fb(Ne,Ze);return;case"bigint":this.Gb(Ne.toString(),Ze);return;case"boolean":this.Fb(Ne+0,Ze);return;case"object":if(Ne===null){this.Sb(Ze);return}if(Ne.length!=null){this.Pb(Ne,Ze);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+Ne+")."},H.prototype.Rb=function(Ne){var Ze=this;return Object.keys(Ne).forEach(function(jt){var $t=Xl(Ze.Qa,jt);$t!==0&&Ze.Hb(Ne[jt],$t)}),!0},H.prototype.Qb=function(Ne){for(var Ze=0;Ze<Ne.length;Ze+=1)this.Hb(Ne[Ze],Ze+1);return!0},H.prototype.reset=function(){return this.freemem(),Mo(this.Qa)===0&&Nr(this.Qa)===0},H.prototype.freemem=function(){for(var Ne;(Ne=this.xb.pop())!==void 0;)sr(Ne)},H.prototype.free=function(){this.freemem();var Ne=Ds(this.Qa)===0;return delete this.db.ob[this.Qa],this.Qa=0,Ne},X.prototype.next=function(){if(this.nb===null)return{done:!0};if(this.fb!==null&&(this.fb.free(),this.fb=null),!this.db.db)throw this.zb(),Error("Database closed");var Ne=Ba(),Ze=kr(4);ze(Le),ze(Ze);try{this.db.handleError(ii(this.db.db,this.tb,-1,Le,Ze)),this.tb=Ye(Ze,"i32");var jt=Ye(Le,"i32");return jt===0?(this.zb(),{done:!0}):(this.fb=new H(jt,this.db),this.db.ob[jt]=this.fb,{value:this.fb,done:!1})}catch($t){throw this.Cb=Te(this.tb),this.zb(),$t}finally{yr(Ne)}},X.prototype.zb=function(){sr(this.nb),this.nb=null},X.prototype.getRemainingSQL=function(){return this.Cb!==null?this.Cb:Te(this.tb)},typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"&&(X.prototype[Symbol.iterator]=function(){return this}),xe.prototype.run=function(Ne,Ze){if(!this.db)throw"Database closed";if(Ze){Ne=this.prepare(Ne,Ze);try{Ne.step()}finally{Ne.free()}}else this.handleError(Zt(this.db,Ne,0,0,Le));return this},xe.prototype.exec=function(Ne,Ze,jt){if(!this.db)throw"Database closed";var $t=Ze=null,an=null;try{an=$t=Un(Ne);var Tn=kr(4);for(Ne=[];Ye(an,"i8")!==0;){ze(Le),ze(Tn),this.handleError(ii(this.db,an,-1,Le,Tn));var Ji=Ye(Le,"i32");if(an=Ye(Tn,"i32"),Ji!==0){var Gn=null;for(Ze=new H(Ji,this);Ze.step();)Gn===null&&(Gn={lc:Ze.getColumnNames(),values:[]},Ne.push(Gn)),Gn.values.push(Ze.get(null,jt));Ze.free()}}return Ne}catch(Mr){throw Ze&&Ze.free(),Mr}finally{$t&&sr($t)}},xe.prototype.each=function(Ne,Ze,jt,$t,an){typeof Ze=="function"&&($t=jt,jt=Ze,Ze=void 0),Ne=this.prepare(Ne,Ze);try{for(;Ne.step();)jt(Ne.getAsObject(null,an))}finally{Ne.free()}if(typeof $t=="function")return $t()},xe.prototype.prepare=function(Ne){if(ze(Le),this.handleError(Jn(this.db,Ne,-1,Le,0)),Ne=Ye(Le,"i32"),Ne===0)throw"Nothing to prepare";var Ze=new H(Ne,this);return this.ob[Ne]=Ze},xe.prototype.iterateStatements=function(Ne){return new X(Ne,this)},xe.prototype.export=function(){Object.values(this.ob).forEach(function(Ze){Ze.free()}),Object.values(this.Sa).forEach(ri),this.Sa={},this.handleError(Sn(this.db));var Ne=Ri(this.filename);return this.handleError(zt(this.filename,Le)),this.db=Ye(Le,"i32"),Fs(this.db),Ne},xe.prototype.close=function(){this.db!==null&&(Object.values(this.ob).forEach(function(Ne){Ne.free()}),Object.values(this.Sa).forEach(ri),this.Sa={},this.eb&&(ri(this.eb),this.eb=void 0),this.handleError(Sn(this.db)),vl("/"+this.filename),this.db=null)},xe.prototype.handleError=function(Ne){if(Ne===0)return null;throw Ne=Fa(this.db),Error(Ne)},xe.prototype.getRowsModified=function(){return Ln(this.db)},xe.prototype.create_function=function(Ne,Ze){Object.prototype.hasOwnProperty.call(this.Sa,Ne)&&(ri(this.Sa[Ne]),delete this.Sa[Ne]);var jt=ao(function($t,an,Tn){an=q(an,Tn);try{var Ji=Ze.apply(null,an)}catch(Gn){Qi($t,Gn,-1);return}A($t,Ji)},"viii");return this.Sa[Ne]=jt,this.handleError(ts(this.db,Ne,Ze.length,1,0,jt,0,0,0)),this},xe.prototype.create_aggregate=function(Ne,Ze){var jt=Ze.init||function(){return null},$t=Ze.finalize||function(Mr){return Mr},an=Ze.step;if(!an)throw"An aggregate function must have a step function in "+Ne;var Tn={};Object.hasOwnProperty.call(this.Sa,Ne)&&(ri(this.Sa[Ne]),delete this.Sa[Ne]),Ze=Ne+"__finalize",Object.hasOwnProperty.call(this.Sa,Ze)&&(ri(this.Sa[Ze]),delete this.Sa[Ze]);var Ji=ao(function(Mr,ai,bi){var za=yi(Mr,1);Object.hasOwnProperty.call(Tn,za)||(Tn[za]=jt()),ai=q(ai,bi),ai=[Tn[za]].concat(ai);try{Tn[za]=an.apply(null,ai)}catch(fo){delete Tn[za],Qi(Mr,fo,-1)}},"viii"),Gn=ao(function(Mr){var ai=yi(Mr,1);try{var bi=$t(Tn[ai])}catch(za){delete Tn[ai],Qi(Mr,za,-1);return}A(Mr,bi),delete Tn[ai]},"vi");return this.Sa[Ne]=Ji,this.Sa[Ze]=Gn,this.handleError(ts(this.db,Ne,an.length-1,1,0,0,Ji,Gn,0)),this},xe.prototype.updateHook=function(Ne){return this.eb&&(is(this.db,0,0),ri(this.eb),this.eb=void 0),Ne?(this.eb=ao(function(Ze,jt,$t,an,Tn){switch(jt){case 18:Ze="insert";break;case 23:Ze="update";break;case 9:Ze="delete";break;default:throw"unknown operationCode in updateHook callback: "+jt}if($t=Te($t),an=Te(an),Tn>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";Ne(Ze,$t,an,Number(Tn))},"viiiij"),is(this.db,this.eb,0),this):this},d.Database=xe};var y="./this.program",b=(Rs=(Xi=globalThis.document)==null?void 0:Xi.currentScript)==null?void 0:Rs.src;m&&(b=self.location.href);var P="",x,w;if(p||m){try{P=new URL(".",b).href}catch{}m&&(w=A=>{var q=new XMLHttpRequest;return q.open("GET",A,!1),q.responseType="arraybuffer",q.send(null),new Uint8Array(q.response)}),x=async A=>{if(A=await fetch(A,{credentials:"same-origin"}),A.ok)return A.arrayBuffer();throw Error(A.status+" : "+A.url)}}var T=console.log.bind(console),E=console.error.bind(console),k,D=!1,I,R,$,V,K,Z,ee,ne,oe;function he(){var A=xt.buffer;R=new Int8Array(A),V=new Int16Array(A),$=new Uint8Array(A),K=new Int32Array(A),Z=new Uint32Array(A),ee=new Float32Array(A),ne=new Float64Array(A),oe=new BigInt64Array(A),new BigUint64Array(A)}function Se(A){var q;throw(q=d.onAbort)==null||q.call(d,A),A="Aborted("+A+")",E(A),D=!0,new WebAssembly.RuntimeError(A+". Build with -sASSERTIONS for more info.")}var fe;async function Oe(A){if(!k)try{var q=await x(A);return new Uint8Array(q)}catch{}if(A==fe&&k)A=new Uint8Array(k);else if(w)A=w(A);else throw"both async and sync fetching of the wasm failed";return A}async function re(A,q){try{var H=await Oe(A);return await WebAssembly.instantiate(H,q)}catch(X){E(`failed to asynchronously prepare wasm: ${X}`),Se(X)}}async function Ce(A){var q=fe;if(!k)try{var H=fetch(q,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(H,A)}catch(X){E(`wasm streaming compile failed: ${X}`),E("falling back to ArrayBuffer instantiation")}return re(q,A)}class ae{constructor(q){oc(this,"name","ExitStatus");this.message=`Program terminated with exit(${q})`,this.status=q}}var ie=A=>{for(;0<A.length;)A.shift()(d)},de=[],He=[],je=()=>{var A=d.preRun.shift();He.push(A)},$e=0,We=null;function Ye(A,q="i8"){switch(q.endsWith("*")&&(q="*"),q){case"i1":return R[A];case"i8":return R[A];case"i16":return V[A>>1];case"i32":return K[A>>2];case"i64":return oe[A>>3];case"float":return ee[A>>2];case"double":return ne[A>>3];case"*":return Z[A>>2];default:Se(`invalid type for getValue: ${q}`)}}var rt=!0;function ze(A){var q="i32";switch(q.endsWith("*")&&(q="*"),q){case"i1":R[A]=0;break;case"i8":R[A]=0;break;case"i16":V[A>>1]=0;break;case"i32":K[A>>2]=0;break;case"i64":oe[A>>3]=BigInt(0);break;case"float":ee[A>>2]=0;break;case"double":ne[A>>3]=0;break;case"*":Z[A>>2]=0;break;default:Se(`invalid type for setValue: ${q}`)}}var Fe=new TextDecoder,st=(A,q,H,X)=>{if(H=q+H,X)return H;for(;A[q]&&!(q>=H);)++q;return q},Te=(A,q,H)=>A?Fe.decode($.subarray(A,st($,A,q,H))):"",Dt=(A,q)=>{for(var H=0,X=A.length-1;0<=X;X--){var xe=A[X];xe==="."?A.splice(X,1):xe===".."?(A.splice(X,1),H++):H&&(A.splice(X,1),H--)}if(q)for(;H;H--)A.unshift("..");return A},Lt=A=>{var q=A.charAt(0)==="/",H=A.slice(-1)==="/";return(A=Dt(A.split("/").filter(X=>!!X),!q).join("/"))||q||(A="."),A&&H&&(A+="/"),(q?"/":"")+A},dn=A=>{var q=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(A).slice(1);return A=q[0],q=q[1],!A&&!q?".":(q&&(q=q.slice(0,-1)),A+q)},xn=A=>A&&A.match(/([^\/]+|\/)\/*$/)[1],qn=()=>A=>crypto.getRandomValues(A),Ar=A=>{(Ar=qn())(A)},Zr=(...A)=>{for(var q="",H=!1,X=A.length-1;-1<=X&&!H;X--){if(H=0<=X?A[X]:"/",typeof H!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!H)return"";q=H+"/"+q,H=H.charAt(0)==="/"}return q=Dt(q.split("/").filter(xe=>!!xe),!H).join("/"),(H?"/":"")+q||"."},$r=A=>{var q=st(A,0);return Fe.decode(A.buffer?A.subarray(0,q):new Uint8Array(A.slice(0,q)))},Bn=[],_r=A=>{for(var q=0,H=0;H<A.length;++H){var X=A.charCodeAt(H);127>=X?q++:2047>=X?q+=2:55296<=X&&57343>=X?(q+=4,++H):q+=3}return q},fr=(A,q,H,X)=>{if(!(0<X))return 0;var xe=H;X=H+X-1;for(var Le=0;Le<A.length;++Le){var Ge=A.codePointAt(Le);if(127>=Ge){if(H>=X)break;q[H++]=Ge}else if(2047>=Ge){if(H+1>=X)break;q[H++]=192|Ge>>6,q[H++]=128|Ge&63}else if(65535>=Ge){if(H+2>=X)break;q[H++]=224|Ge>>12,q[H++]=128|Ge>>6&63,q[H++]=128|Ge&63}else{if(H+3>=X)break;q[H++]=240|Ge>>18,q[H++]=128|Ge>>12&63,q[H++]=128|Ge>>6&63,q[H++]=128|Ge&63,Le++}}return q[H]=0,H-xe},To=[];function ua(A,q){To[A]={input:[],output:[],jb:q},Hi(A,Fr)}var Fr={open(A){var q=To[A.node.mb];if(!q)throw new lt(43);A.Va=q,A.seekable=!1},close(A){A.Va.jb.kb(A.Va)},kb(A){A.Va.jb.kb(A.Va)},read(A,q,H,X){if(!A.Va||!A.Va.jb.Kb)throw new lt(60);for(var xe=0,Le=0;Le<X;Le++){try{var Ge=A.Va.jb.Kb(A.Va)}catch{throw new lt(29)}if(Ge===void 0&&xe===0)throw new lt(6);if(Ge==null)break;xe++,q[H+Le]=Ge}return xe&&(A.node.$a=Date.now()),xe},write(A,q,H,X){if(!A.Va||!A.Va.jb.Db)throw new lt(60);try{for(var xe=0;xe<X;xe++)A.Va.jb.Db(A.Va,q[H+xe])}catch{throw new lt(29)}return X&&(A.node.Ua=A.node.Ta=Date.now()),xe}},ca={Kb(){var H;e:{if(!Bn.length){var A=null;if((H=globalThis.window)!=null&&H.prompt&&(A=window.prompt("Input: "),A!==null&&(A+=`
|
||
`)),!A){var q=null;break e}q=Array(_r(A)+1),A=fr(A,q,0,q.length),q.length=A,Bn=q}q=Bn.shift()}return q},Db(A,q){q===null||q===10?(T($r(A.output)),A.output=[]):q!=0&&A.output.push(q)},kb(A){var q;0<((q=A.output)==null?void 0:q.length)&&(T($r(A.output)),A.output=[])},oc(){return{ic:25856,kc:5,hc:191,jc:35387,fc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},pc(){return 0},qc(){return[24,80]}},Eo={Db(A,q){q===null||q===10?(E($r(A.output)),A.output=[]):q!=0&&A.output.push(q)},kb(A){var q;0<((q=A.output)==null?void 0:q.length)&&(E($r(A.output)),A.output=[])}},Vt={Za:null,ab(){return Vt.createNode(null,"/",16895,0)},createNode(A,q,H,X){if((H&61440)===24576||(H&61440)===4096)throw new lt(63);return Vt.Za||(Vt.Za={dir:{node:{Wa:Vt.La.Wa,Xa:Vt.La.Xa,lb:Vt.La.lb,qb:Vt.La.qb,Nb:Vt.La.Nb,wb:Vt.La.wb,ub:Vt.La.ub,Eb:Vt.La.Eb,vb:Vt.La.vb},stream:{Ya:Vt.Ma.Ya}},file:{node:{Wa:Vt.La.Wa,Xa:Vt.La.Xa},stream:{Ya:Vt.Ma.Ya,read:Vt.Ma.read,write:Vt.Ma.write,rb:Vt.Ma.rb,sb:Vt.Ma.sb}},link:{node:{Wa:Vt.La.Wa,Xa:Vt.La.Xa,cb:Vt.La.cb},stream:{}},Ib:{node:{Wa:Vt.La.Wa,Xa:Vt.La.Xa},stream:$u}}),H=Yl(A,q,H,X),ar(H.mode)?(H.La=Vt.Za.dir.node,H.Ma=Vt.Za.dir.stream,H.Na={}):(H.mode&61440)===32768?(H.La=Vt.Za.file.node,H.Ma=Vt.Za.file.stream,H.Ra=0,H.Na=null):(H.mode&61440)===40960?(H.La=Vt.Za.link.node,H.Ma=Vt.Za.link.stream):(H.mode&61440)===8192&&(H.La=Vt.Za.Ib.node,H.Ma=Vt.Za.Ib.stream),H.$a=H.Ua=H.Ta=Date.now(),A&&(A.Na[q]=H,A.$a=A.Ua=A.Ta=H.$a),H},nc(A){return A.Na?A.Na.subarray?A.Na.subarray(0,A.Ra):new Uint8Array(A.Na):new Uint8Array(0)},La:{Wa(A){var q={};return q.Vb=(A.mode&61440)===8192?A.id:1,q.$b=A.id,q.mode=A.mode,q.bc=1,q.uid=0,q.Zb=0,q.mb=A.mb,ar(A.mode)?q.size=4096:(A.mode&61440)===32768?q.size=A.Ra:(A.mode&61440)===40960?q.size=A.link.length:q.size=0,q.$a=new Date(A.$a),q.Ua=new Date(A.Ua),q.Ta=new Date(A.Ta),q.Tb=4096,q.Ub=Math.ceil(q.size/q.Tb),q},Xa(A,q){for(var H of["mode","atime","mtime","ctime"])q[H]!=null&&(A[H]=q[H]);q.size!==void 0&&(q=q.size,A.Ra!=q&&(q==0?(A.Na=null,A.Ra=0):(H=A.Na,A.Na=new Uint8Array(q),H&&A.Na.set(H.subarray(0,Math.min(q,A.Ra))),A.Ra=q)))},lb(){throw Vt.yb||(Vt.yb=new lt(44),Vt.yb.stack="<generic error, no stack>"),Vt.yb},qb(A,q,H,X){return Vt.createNode(A,q,H,X)},Nb(A,q,H){try{var X=eo(q,H)}catch{}if(X){if(ar(A.mode))for(var xe in X.Na)throw new lt(55);Zo(X)}delete A.parent.Na[A.name],q.Na[H]=A,A.name=H,q.Ta=q.Ua=A.parent.Ta=A.parent.Ua=Date.now()},wb(A,q){delete A.Na[q],A.Ta=A.Ua=Date.now()},ub(A,q){var H=eo(A,q),X;for(X in H.Na)throw new lt(55);delete A.Na[q],A.Ta=A.Ua=Date.now()},Eb(A){return[".","..",...Object.keys(A.Na)]},vb(A,q,H){return A=Vt.createNode(A,q,41471,0),A.link=H,A},cb(A){if((A.mode&61440)!==40960)throw new lt(28);return A.link}},Ma:{read(A,q,H,X,xe){var Le=A.node.Na;if(xe>=A.node.Ra)return 0;if(A=Math.min(A.node.Ra-xe,X),8<A&&Le.subarray)q.set(Le.subarray(xe,xe+A),H);else for(X=0;X<A;X++)q[H+X]=Le[xe+X];return A},write(A,q,H,X,xe,Le){if(q.buffer===R.buffer&&(Le=!1),!X)return 0;if(A=A.node,A.Ua=A.Ta=Date.now(),q.subarray&&(!A.Na||A.Na.subarray)){if(Le)return A.Na=q.subarray(H,H+X),A.Ra=X;if(A.Ra===0&&xe===0)return A.Na=q.slice(H,H+X),A.Ra=X;if(xe+X<=A.Ra)return A.Na.set(q.subarray(H,H+X),xe),X}Le=xe+X;var Ge=A.Na?A.Na.length:0;if(Ge>=Le||(Le=Math.max(Le,Ge*(1048576>Ge?2:1.125)>>>0),Ge!=0&&(Le=Math.max(Le,256)),Ge=A.Na,A.Na=new Uint8Array(Le),0<A.Ra&&A.Na.set(Ge.subarray(0,A.Ra),0)),A.Na.subarray&&q.subarray)A.Na.set(q.subarray(H,H+X),xe);else for(Le=0;Le<X;Le++)A.Na[xe+Le]=q[H+Le];return A.Ra=Math.max(A.Ra,xe+X),X},Ya(A,q,H){if(H===1?q+=A.position:H===2&&(A.node.mode&61440)===32768&&(q+=A.node.Ra),0>q)throw new lt(28);return q},rb(A,q,H,X,xe){if((A.node.mode&61440)!==32768)throw new lt(43);if(A=A.node.Na,xe&2||!A||A.buffer!==R.buffer){xe=!0,X=65536*Math.ceil(q/65536);var Le=Ii(65536,X);if(Le&&$.fill(0,Le,Le+X),X=Le,!X)throw new lt(48);A&&((0<H||H+q<A.length)&&(A.subarray?A=A.subarray(H,H+q):A=Array.prototype.slice.call(A,H,H+q)),R.set(A,X))}else xe=!1,X=A.byteOffset;return{dc:X,Ob:xe}},sb(A,q,H,X){return Vt.Ma.write(A,q,0,X,H,!1),0}}},Na=(A,q)=>{var H=0;return A&&(H|=365),q&&(H|=146),H},Wi=null,Ja={},Ki=[],Ho=1,qr=null,Pt=!1,Ci=!0,fa={},lt=class{constructor(A){oc(this,"name","ErrnoError");this.Pa=A}},ht=class{constructor(){oc(this,"pb",{});oc(this,"node",null)}get flags(){return this.pb.flags}set flags(A){this.pb.flags=A}get position(){return this.pb.position}set position(A){this.pb.position=A}},Ma=class{constructor(A,q,H,X){oc(this,"La",{});oc(this,"Ma",{});oc(this,"hb",null);A||(A=this),this.parent=A,this.ab=A.ab,this.id=Ho++,this.name=q,this.mode=H,this.mb=X,this.$a=this.Ua=this.Ta=Date.now()}get read(){return(this.mode&365)===365}set read(A){A?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(A){A?this.mode|=146:this.mode&=-147}};function vr(A,q={}){if(!A)throw new lt(44);q.Ab??(q.Ab=!0),A.charAt(0)==="/"||(A="//"+A);var H=0;e:for(;40>H;H++){A=A.split("/").filter(zt=>!!zt);for(var X=Wi,xe="/",Le=0;Le<A.length;Le++){var Ge=Le===A.length-1;if(Ge&&q.parent)break;if(A[Le]!==".")if(A[Le]==="..")if(xe=dn(xe),X===X.parent){A=xe+"/"+A.slice(Le+1).join("/"),H--;continue e}else X=X.parent;else{xe=Lt(xe+"/"+A[Le]);try{X=eo(X,A[Le])}catch(zt){if((zt==null?void 0:zt.Pa)===44&&Ge&&q.cc)return{path:xe};throw zt}if(!X.hb||Ge&&!q.Ab||(X=X.hb.root),(X.mode&61440)===40960&&(!Ge||q.gb)){if(!X.La.cb)throw new lt(52);X=X.La.cb(X),X.charAt(0)==="/"||(X=dn(xe)+"/"+X),A=X+"/"+A.slice(Le+1).join("/");continue e}}}return{path:xe,node:X}}throw new lt(32)}function Go(A){for(var q;;){if(A===A.parent)return A=A.ab.Mb,q?A[A.length-1]!=="/"?`${A}/${q}`:A+q:A;q=q?`${A.name}/${q}`:A.name,A=A.parent}}function Cs(A,q){for(var H=0,X=0;X<q.length;X++)H=(H<<5)-H+q.charCodeAt(X)|0;return(A+H>>>0)%qr.length}function Zo(A){var q=Cs(A.parent.id,A.name);if(qr[q]===A)qr[q]=A.ib;else for(q=qr[q];q;){if(q.ib===A){q.ib=A.ib;break}q=q.ib}}function eo(A,q){var H=ar(A.mode)?(H=Ni(A,"x"))?H:A.La.lb?0:2:54;if(H)throw new lt(H);for(H=qr[Cs(A.id,q)];H;H=H.ib){var X=H.name;if(H.parent.id===A.id&&X===q)return H}return A.La.lb(A,q)}function Yl(A,q,H,X){return A=new Ma(A,q,H,X),q=Cs(A.parent.id,A.name),A.ib=qr[q],qr[q]=A}function ar(A){return(A&61440)===16384}function da(A){var q=["r","w","rw"][A&3];return A&512&&(q+="w"),q}function Ni(A,q){if(Ci)return 0;if(!q.includes("r")||A.mode&292){if(q.includes("w")&&!(A.mode&146)||q.includes("x")&&!(A.mode&73))return 2}else return 2;return 0}function Ao(A,q){if(!ar(A.mode))return 54;try{return eo(A,q),20}catch{}return Ni(A,"wx")}function An(A,q,H){try{var X=eo(A,q)}catch(xe){return xe.Pa}if(A=Ni(A,"wx"))return A;if(H){if(!ar(X.mode))return 54;if(X===X.parent||Go(X)==="/")return 10}else if(ar(X.mode))return 31;return 0}function or(A){if(!A)throw new lt(63);return A}function Rn(A){if(A=Ki[A],!A)throw new lt(8);return A}function _t(A,q=-1){if(A=Object.assign(new ht,A),q==-1)e:{for(q=0;4096>=q;q++)if(!Ki[q])break e;throw new lt(33)}return A.bb=q,Ki[q]=A}function to(A,q=-1){var H,X;return A=_t(A,q),(X=(H=A.Ma)==null?void 0:H.mc)==null||X.call(H,A),A}function Ra(A,q,H){var X=A==null?void 0:A.Ma.Xa;A=X?A:q,X??(X=q.La.Xa),or(X),X(A,H)}var $u={open(A){var q,H;A.Ma=Ja[A.node.mb].Ma,(H=(q=A.Ma).open)==null||H.call(q,A)},Ya(){throw new lt(70)}};function Hi(A,q){Ja[A]={Ma:q}}function La(A,q){var H=q==="/";if(H&&Wi)throw new lt(10);if(!H&&q){var X=vr(q,{Ab:!1});if(q=X.path,X=X.node,X.hb)throw new lt(10);if(!ar(X.mode))throw new lt(54)}q={type:A,rc:{},Mb:q,ac:[]},A=A.ab(q),A.ab=q,q.root=A,H?Wi=A:X&&(X.hb=q,X.ab&&X.ab.ac.push(q))}function Sr(A,q,H){var X=vr(A,{parent:!0}).node;if(A=xn(A),!A)throw new lt(28);if(A==="."||A==="..")throw new lt(20);var xe=Ao(X,A);if(xe)throw new lt(xe);if(!X.La.qb)throw new lt(63);return X.La.qb(X,A,q,H)}function ha(A,q=438){return Sr(A,q&4095|32768,0)}function Mi(A,q=511){return Sr(A,q&1023|16384,0)}function Gi(A,q,H){typeof H>"u"&&(H=q,q=438),Sr(A,q|8192,H)}function Ns(A,q){if(!Zr(A))throw new lt(44);var H=vr(q,{parent:!0}).node;if(!H)throw new lt(44);q=xn(q);var X=Ao(H,q);if(X)throw new lt(X);if(!H.La.vb)throw new lt(63);H.La.vb(H,q,A)}function Ia(A){var q=vr(A,{parent:!0}).node;A=xn(A);var H=eo(q,A),X=An(q,A,!0);if(X)throw new lt(X);if(!q.La.ub)throw new lt(63);if(H.hb)throw new lt(10);q.La.ub(q,A),Zo(H)}function vl(A){var q=vr(A,{parent:!0}).node;if(!q)throw new lt(44);A=xn(A);var H=eo(q,A),X=An(q,A,!1);if(X)throw new lt(X);if(!q.La.wb)throw new lt(63);if(H.hb)throw new lt(10);q.La.wb(q,A),Zo(H)}function Da(A,q){return A=vr(A,{gb:!q}).node,or(A.La.Wa)(A)}function nr(A,q,H,X){Ra(A,q,{mode:H&4095|q.mode&-4096,Ta:Date.now(),Wb:X})}function hi(A,q){A=typeof A=="string"?vr(A,{gb:!0}).node:A,nr(null,A,q)}function jn(A,q,H){if(ar(q.mode))throw new lt(31);if((q.mode&61440)!==32768)throw new lt(28);var X=Ni(q,"w");if(X)throw new lt(X);Ra(A,q,{size:H,timestamp:Date.now()})}function ko(A,q,H=438){if(A==="")throw new lt(44);if(typeof q=="string"){var X={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[q];if(typeof X>"u")throw Error(`Unknown file open mode: ${q}`);q=X}if(H=q&64?H&4095|32768:0,typeof A=="object")X=A;else{var xe=A.endsWith("/");A=vr(A,{gb:!(q&131072),cc:!0}),X=A.node,A=A.path}var Le=!1;if(q&64)if(X){if(q&128)throw new lt(20)}else{if(xe)throw new lt(31);X=Sr(A,H|511,0),Le=!0}if(!X)throw new lt(44);if((X.mode&61440)===8192&&(q&=-513),q&65536&&!ar(X.mode))throw new lt(54);if(!Le&&(xe=X?(X.mode&61440)===40960?32:ar(X.mode)&&(da(q)!=="r"||q&576)?31:Ni(X,da(q)):44))throw new lt(xe);return q&512&&!Le&&(xe=X,xe=typeof xe=="string"?vr(xe,{gb:!0}).node:xe,jn(null,xe,0)),q&=-131713,xe=_t({node:X,path:Go(X),flags:q,seekable:!0,position:0,Ma:X.Ma,ec:[],error:!1}),xe.Ma.open&&xe.Ma.open(xe),Le&&hi(X,H&511),!d.logReadFiles||q&1||A in fa||(fa[A]=1),xe}function pa(A){if(A.bb===null)throw new lt(8);A.Bb&&(A.Bb=null);try{A.Ma.close&&A.Ma.close(A)}catch(q){throw q}finally{Ki[A.bb]=null}A.bb=null}function Yo(A,q,H){if(A.bb===null)throw new lt(8);if(!A.seekable||!A.Ma.Ya)throw new lt(70);if(H!=0&&H!=1&&H!=2)throw new lt(28);A.position=A.Ma.Ya(A,q,H),A.ec=[]}function Co(A,q,H,X,xe){if(0>X||0>xe)throw new lt(28);if(A.bb===null)throw new lt(8);if((A.flags&2097155)===1)throw new lt(8);if(ar(A.node.mode))throw new lt(31);if(!A.Ma.read)throw new lt(28);var Le=typeof xe<"u";if(!Le)xe=A.position;else if(!A.seekable)throw new lt(70);return q=A.Ma.read(A,q,H,X,xe),Le||(A.position+=q),q}function Xo(A,q,H,X,xe){if(0>X||0>xe)throw new lt(28);if(A.bb===null)throw new lt(8);if((A.flags&2097155)===0)throw new lt(8);if(ar(A.node.mode))throw new lt(31);if(!A.Ma.write)throw new lt(28);A.seekable&&A.flags&1024&&Yo(A,0,2);var Le=typeof xe<"u";if(!Le)xe=A.position;else if(!A.seekable)throw new lt(70);return q=A.Ma.write(A,q,H,X,xe,void 0),Le||(A.position+=q),q}function Ri(A){var q=q||0;q=ko(A,q),A=Da(A).size;var H=new Uint8Array(A);return Co(q,H,0,A,0),pa(q),H}function pi(A,q,H){A=Lt("/dev/"+A);var X=Na(!!q,!!H);pi.Lb??(pi.Lb=64);var xe=pi.Lb++<<8|0;Hi(xe,{open(Le){Le.seekable=!1},close(){var Le;(Le=H==null?void 0:H.buffer)!=null&&Le.length&&H(10)},read(Le,Ge,zt,Sn){for(var Zt=0,Ln=0;Ln<Sn;Ln++){try{var Jn=q()}catch{throw new lt(29)}if(Jn===void 0&&Zt===0)throw new lt(6);if(Jn==null)break;Zt++,Ge[zt+Ln]=Jn}return Zt&&(Le.node.$a=Date.now()),Zt},write(Le,Ge,zt,Sn){for(var Zt=0;Zt<Sn;Zt++)try{H(Ge[zt+Zt])}catch{throw new lt(29)}return Sn&&(Le.node.Ua=Le.node.Ta=Date.now()),Zt}}),Gi(A,X,xe)}var ln={};function Li(A,q,H){if(q.charAt(0)==="/")return q;if(A=A===-100?"/":Rn(A).path,q.length==0){if(!H)throw new lt(44);return A}return A+"/"+q}function ft(A,q){Z[A>>2]=q.Vb,Z[A+4>>2]=q.mode,Z[A+8>>2]=q.bc,Z[A+12>>2]=q.uid,Z[A+16>>2]=q.Zb,Z[A+20>>2]=q.mb,oe[A+24>>3]=BigInt(q.size),K[A+32>>2]=4096,K[A+36>>2]=q.Ub;var H=q.$a.getTime(),X=q.Ua.getTime(),xe=q.Ta.getTime();return oe[A+40>>3]=BigInt(Math.floor(H/1e3)),Z[A+48>>2]=H%1e3*1e6,oe[A+56>>3]=BigInt(Math.floor(X/1e3)),Z[A+64>>2]=X%1e3*1e6,oe[A+72>>3]=BigInt(Math.floor(xe/1e3)),Z[A+80>>2]=xe%1e3*1e6,oe[A+88>>3]=BigInt(q.$b),0}var $n=void 0,no=()=>{var A=K[+$n>>2];return $n+=4,A},Zi=0,mi=[0,31,60,91,121,152,182,213,244,274,305,335],No=[0,31,59,90,120,151,181,212,243,273,304,334],qt={},zn=A=>{if(!(A instanceof ae||A=="unwind"))throw A},kn=A=>{var q;throw I=A,rt||0<Zi||((q=d.onExit)==null||q.call(d,A),D=!0),new ae(A)},ro=A=>{if(!D)try{A()}catch(q){zn(q)}finally{if(!(rt||0<Zi))try{I=A=I,kn(A)}catch(q){zn(q)}}},dr={},io=()=>{var X;if(!ma){var A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((X=globalThis.navigator)==null?void 0:X.language)??"C").replace("-","_")+".UTF-8",_:y||"./this.program"},q;for(q in dr)dr[q]===void 0?delete A[q]:A[q]=dr[q];var H=[];for(q in A)H.push(`${q}=${A[q]}`);ma=H}return ma},ma,gi=(A,q,H,X)=>{var xe={string:Zt=>{var Ln=0;if(Zt!=null&&Zt!==0){Ln=_r(Zt)+1;var Jn=kr(Ln);fr(Zt,$,Jn,Ln),Ln=Jn}return Ln},array:Zt=>{var Ln=kr(Zt.length);return R.set(Zt,Ln),Ln}};A=d["_"+A];var Le=[],Ge=0;if(X)for(var zt=0;zt<X.length;zt++){var Sn=xe[H[zt]];Sn?(Ge===0&&(Ge=Ba()),Le[zt]=Sn(X[zt])):Le[zt]=X[zt]}return H=A(...Le),H=(function(Zt){return Ge!==0&&yr(Ge),q==="string"?Te(Zt):q==="boolean"?!!Zt:Zt})(H)},Un=A=>{var q=_r(A)+1,H=oo(q);return H&&fr(A,$,H,q),H},zr,un=[],ri=A=>{zr.delete(gn.get(A)),gn.set(A,null),un.push(A)},Ms=A=>{const q=A.length;return[q%128|128,q>>7,...A]},cn={i:127,p:127,j:126,f:125,d:124,e:111},Qo=A=>Ms(Array.from(A,q=>cn[q])),ao=(A,q)=>{if(!zr){zr=new WeakMap;var H=gn.length;if(zr)for(var X=0;X<0+H;X++){var xe=gn.get(X);xe&&zr.set(xe,X)}}if(H=zr.get(A)||0)return H;H=un.length?un.pop():gn.grow(1);try{gn.set(H,A)}catch(Le){if(!(Le instanceof TypeError))throw Le;q=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Ms([1,96,...Qo(q.slice(1)),...Qo(q[0]==="v"?"":q[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),q=new WebAssembly.Module(q),q=new WebAssembly.Instance(q,{e:{f:A}}).exports.f,gn.set(H,q)}return zr.set(A,H),H};if(qr=Array(4096),La(Vt,"/"),Mi("/tmp"),Mi("/home"),Mi("/home/web_user"),(function(){Mi("/dev"),Hi(259,{read:()=>0,write:(X,xe,Le,Ge)=>Ge,Ya:()=>0}),Gi("/dev/null",259),ua(1280,ca),ua(1536,Eo),Gi("/dev/tty",1280),Gi("/dev/tty1",1536);var A=new Uint8Array(1024),q=0,H=()=>(q===0&&(Ar(A),q=A.byteLength),A[--q]);pi("random",H),pi("urandom",H),Mi("/dev/shm"),Mi("/dev/shm/tmp")})(),(function(){Mi("/proc");var A=Mi("/proc/self");Mi("/proc/self/fd"),La({ab(){var q=Yl(A,"fd",16895,73);return q.Ma={Ya:Vt.Ma.Ya},q.La={lb(H,X){H=+X;var xe=Rn(H);return H={parent:null,ab:{Mb:"fake"},La:{cb:()=>xe.path},id:H+1},H.parent=H},Eb(){return Array.from(Ki.entries()).filter(([,H])=>H).map(([H])=>H.toString())}},q}},"/proc/self/fd")})(),d.noExitRuntime&&(rt=d.noExitRuntime),d.print&&(T=d.print),d.printErr&&(E=d.printErr),d.wasmBinary&&(k=d.wasmBinary),d.thisProgram&&(y=d.thisProgram),d.preInit)for(typeof d.preInit=="function"&&(d.preInit=[d.preInit]);0<d.preInit.length;)d.preInit.shift()();d.stackSave=()=>Ba(),d.stackRestore=A=>yr(A),d.stackAlloc=A=>kr(A),d.cwrap=(A,q,H,X)=>{var xe=!H||H.every(Le=>Le==="number"||Le==="boolean");return q!=="string"&&xe&&!X?d["_"+A]:(...Le)=>gi(A,q,H,Le)},d.addFunction=ao,d.removeFunction=ri,d.UTF8ToString=Te,d.stringToNewUTF8=Un,d.writeArrayToMemory=(A,q)=>{R.set(A,q)};var oo,sr,Ii,Yr,yr,kr,Ba,xt,gn,On={a:(A,q,H,X)=>Se(`Assertion failed: ${Te(A)}, at: `+[q?Te(q):"unknown filename",H,X?Te(X):"unknown function"]),i:function(A,q){try{return A=Te(A),hi(A,q),0}catch(H){if(typeof ln>"u"||H.name!=="ErrnoError")throw H;return-H.Pa}},L:function(A,q,H){try{if(q=Te(q),q=Li(A,q),H&-8)return-28;var X=vr(q,{gb:!0}).node;return X?(A="",H&4&&(A+="r"),H&2&&(A+="w"),H&1&&(A+="x"),A&&Ni(X,A)?-2:0):-44}catch(xe){if(typeof ln>"u"||xe.name!=="ErrnoError")throw xe;return-xe.Pa}},j:function(A,q){try{var H=Rn(A);return nr(H,H.node,q,!1),0}catch(X){if(typeof ln>"u"||X.name!=="ErrnoError")throw X;return-X.Pa}},h:function(A){try{var q=Rn(A);return Ra(q,q.node,{timestamp:Date.now(),Wb:!1}),0}catch(H){if(typeof ln>"u"||H.name!=="ErrnoError")throw H;return-H.Pa}},b:function(A,q,H){$n=H;try{var X=Rn(A);switch(q){case 0:var xe=no();if(0>xe)break;for(;Ki[xe];)xe++;return to(X,xe).bb;case 1:case 2:return 0;case 3:return X.flags;case 4:return xe=no(),X.flags|=xe,0;case 12:return xe=no(),V[xe+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(Le){if(typeof ln>"u"||Le.name!=="ErrnoError")throw Le;return-Le.Pa}},g:function(A,q){try{var H=Rn(A),X=H.node,xe=H.Ma.Wa;A=xe?H:X,xe??(xe=X.La.Wa),or(xe);var Le=xe(A);return ft(q,Le)}catch(Ge){if(typeof ln>"u"||Ge.name!=="ErrnoError")throw Ge;return-Ge.Pa}},H:function(A,q){q=-9007199254740992>q||9007199254740992<q?NaN:Number(q);try{if(isNaN(q))return-61;var H=Rn(A);if(0>q||(H.flags&2097155)===0)throw new lt(28);return jn(H,H.node,q),0}catch(X){if(typeof ln>"u"||X.name!=="ErrnoError")throw X;return-X.Pa}},G:function(A,q){try{if(q===0)return-28;var H=_r("/")+1;return q<H?-68:(fr("/",$,A,q),H)}catch(X){if(typeof ln>"u"||X.name!=="ErrnoError")throw X;return-X.Pa}},K:function(A,q){try{return A=Te(A),ft(q,Da(A,!0))}catch(H){if(typeof ln>"u"||H.name!=="ErrnoError")throw H;return-H.Pa}},C:function(A,q,H){try{return q=Te(q),q=Li(A,q),Mi(q,H),0}catch(X){if(typeof ln>"u"||X.name!=="ErrnoError")throw X;return-X.Pa}},J:function(A,q,H,X){try{q=Te(q);var xe=X&256;return q=Li(A,q,X&4096),ft(H,xe?Da(q,!0):Da(q))}catch(Le){if(typeof ln>"u"||Le.name!=="ErrnoError")throw Le;return-Le.Pa}},x:function(A,q,H,X){$n=X;try{q=Te(q),q=Li(A,q);var xe=X?no():0;return ko(q,H,xe).bb}catch(Le){if(typeof ln>"u"||Le.name!=="ErrnoError")throw Le;return-Le.Pa}},v:function(A,q,H,X){try{if(q=Te(q),q=Li(A,q),0>=X)return-28;var xe=vr(q).node;if(!xe)throw new lt(44);if(!xe.La.cb)throw new lt(28);var Le=xe.La.cb(xe),Ge=Math.min(X,_r(Le)),zt=R[H+Ge];return fr(Le,$,H,X+1),R[H+Ge]=zt,Ge}catch(Sn){if(typeof ln>"u"||Sn.name!=="ErrnoError")throw Sn;return-Sn.Pa}},u:function(A){try{return A=Te(A),Ia(A),0}catch(q){if(typeof ln>"u"||q.name!=="ErrnoError")throw q;return-q.Pa}},f:function(A,q){try{return A=Te(A),ft(q,Da(A))}catch(H){if(typeof ln>"u"||H.name!=="ErrnoError")throw H;return-H.Pa}},r:function(A,q,H){try{if(q=Te(q),q=Li(A,q),H)if(H===512)Ia(q);else return-28;else vl(q);return 0}catch(X){if(typeof ln>"u"||X.name!=="ErrnoError")throw X;return-X.Pa}},q:function(A,q,H){try{q=Te(q),q=Li(A,q,!0);var X=Date.now(),xe,Le;if(H){var Ge=Z[H>>2]+4294967296*K[H+4>>2],zt=K[H+8>>2];zt==1073741823?xe=X:zt==1073741822?xe=null:xe=1e3*Ge+zt/1e6,H+=16,Ge=Z[H>>2]+4294967296*K[H+4>>2],zt=K[H+8>>2],zt==1073741823?Le=X:zt==1073741822?Le=null:Le=1e3*Ge+zt/1e6}else Le=xe=X;if((Le??xe)!==null){A=xe;var Sn=vr(q,{gb:!0}).node;or(Sn.La.Xa)(Sn,{$a:A,Ua:Le})}return 0}catch(Zt){if(typeof ln>"u"||Zt.name!=="ErrnoError")throw Zt;return-Zt.Pa}},m:()=>Se(""),l:()=>{rt=!1,Zi=0},A:function(A,q){A=-9007199254740992>A||9007199254740992<A?NaN:Number(A),A=new Date(1e3*A),K[q>>2]=A.getSeconds(),K[q+4>>2]=A.getMinutes(),K[q+8>>2]=A.getHours(),K[q+12>>2]=A.getDate(),K[q+16>>2]=A.getMonth(),K[q+20>>2]=A.getFullYear()-1900,K[q+24>>2]=A.getDay();var H=A.getFullYear();K[q+28>>2]=(H%4!==0||H%100===0&&H%400!==0?No:mi)[A.getMonth()]+A.getDate()-1|0,K[q+36>>2]=-(60*A.getTimezoneOffset()),H=new Date(A.getFullYear(),6,1).getTimezoneOffset();var X=new Date(A.getFullYear(),0,1).getTimezoneOffset();K[q+32>>2]=(H!=X&&A.getTimezoneOffset()==Math.min(X,H))|0},y:function(A,q,H,X,xe,Le,Ge){xe=-9007199254740992>xe||9007199254740992<xe?NaN:Number(xe);try{var zt=Rn(X);if((q&2)!==0&&(H&2)===0&&(zt.flags&2097155)!==2)throw new lt(2);if((zt.flags&2097155)===1)throw new lt(2);if(!zt.Ma.rb)throw new lt(43);if(!A)throw new lt(28);var Sn=zt.Ma.rb(zt,A,xe,q,H),Zt=Sn.dc;return K[Le>>2]=Sn.Ob,Z[Ge>>2]=Zt,0}catch(Ln){if(typeof ln>"u"||Ln.name!=="ErrnoError")throw Ln;return-Ln.Pa}},z:function(A,q,H,X,xe,Le){Le=-9007199254740992>Le||9007199254740992<Le?NaN:Number(Le);try{var Ge=Rn(xe);if(H&2){if((Ge.node.mode&61440)!==32768)throw new lt(43);X&2||Ge.Ma.sb&&Ge.Ma.sb(Ge,$.slice(A,A+q),Le,q,X)}}catch(zt){if(typeof ln>"u"||zt.name!=="ErrnoError")throw zt;return-zt.Pa}},n:(A,q)=>{if(qt[A]&&(clearTimeout(qt[A].id),delete qt[A]),!q)return 0;var H=setTimeout(()=>{delete qt[A],ro(()=>Yr(A,performance.now()))},q);return qt[A]={id:H,sc:q},0},B:(A,q,H,X)=>{var xe=new Date().getFullYear(),Le=new Date(xe,0,1).getTimezoneOffset();xe=new Date(xe,6,1).getTimezoneOffset(),Z[A>>2]=60*Math.max(Le,xe),K[q>>2]=+(Le!=xe),q=Ge=>{var zt=Math.abs(Ge);return`UTC${0<=Ge?"-":"+"}${String(Math.floor(zt/60)).padStart(2,"0")}${String(zt%60).padStart(2,"0")}`},A=q(Le),q=q(xe),xe<Le?(fr(A,$,H,17),fr(q,$,X,17)):(fr(A,$,X,17),fr(q,$,H,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:A=>{var q=$.length;if(A>>>=0,2147483648<A)return!1;for(var H=1;4>=H;H*=2){var X=q*(1+.2/H);X=Math.min(X,A+100663296);e:{X=(Math.min(2147483648,65536*Math.ceil(Math.max(A,X)/65536))-xt.buffer.byteLength+65535)/65536|0;try{xt.grow(X),he();var xe=1;break e}catch{}xe=void 0}if(xe)return!0}return!1},E:(A,q)=>{var H=0,X=0,xe;for(xe of io()){var Le=q+H;Z[A+X>>2]=Le,H+=fr(xe,$,Le,1/0)+1,X+=4}return 0},F:(A,q)=>{var H=io();Z[A>>2]=H.length,A=0;for(var X of H)A+=_r(X)+1;return Z[q>>2]=A,0},e:function(A){try{var q=Rn(A);return pa(q),0}catch(H){if(typeof ln>"u"||H.name!=="ErrnoError")throw H;return H.Pa}},p:function(A,q){try{var H=Rn(A);return R[q]=H.Va?2:ar(H.mode)?3:(H.mode&61440)===40960?7:4,V[q+2>>1]=0,oe[q+8>>3]=BigInt(0),oe[q+16>>3]=BigInt(0),0}catch(X){if(typeof ln>"u"||X.name!=="ErrnoError")throw X;return X.Pa}},w:function(A,q,H,X){try{e:{var xe=Rn(A);A=q;for(var Le,Ge=q=0;Ge<H;Ge++){var zt=Z[A>>2],Sn=Z[A+4>>2];A+=8;var Zt=Co(xe,R,zt,Sn,Le);if(0>Zt){var Ln=-1;break e}if(q+=Zt,Zt<Sn)break;typeof Le<"u"&&(Le+=Zt)}Ln=q}return Z[X>>2]=Ln,0}catch(Jn){if(typeof ln>"u"||Jn.name!=="ErrnoError")throw Jn;return Jn.Pa}},D:function(A,q,H,X){q=-9007199254740992>q||9007199254740992<q?NaN:Number(q);try{if(isNaN(q))return 61;var xe=Rn(A);return Yo(xe,q,H),oe[X>>3]=BigInt(xe.position),xe.Bb&&q===0&&H===0&&(xe.Bb=null),0}catch(Le){if(typeof ln>"u"||Le.name!=="ErrnoError")throw Le;return Le.Pa}},I:function(A){var H,X;try{var q=Rn(A);return(X=(H=q.Ma)==null?void 0:H.kb)==null?void 0:X.call(H,q)}catch(xe){if(typeof ln>"u"||xe.name!=="ErrnoError")throw xe;return xe.Pa}},t:function(A,q,H,X){try{e:{var xe=Rn(A);A=q;for(var Le,Ge=q=0;Ge<H;Ge++){var zt=Z[A>>2],Sn=Z[A+4>>2];A+=8;var Zt=Xo(xe,R,zt,Sn,Le);if(0>Zt){var Ln=-1;break e}if(q+=Zt,Zt<Sn)break;typeof Le<"u"&&(Le+=Zt)}Ln=q}return Z[X>>2]=Ln,0}catch(Jn){if(typeof ln>"u"||Jn.name!=="ErrnoError")throw Jn;return Jn.Pa}},k:kn};function $a(){function A(){var xe;if(d.calledRun=!0,!D){if(!d.noFSInit&&!Pt){var q,H;Pt=!0,q??(q=d.stdin),H??(H=d.stdout),X??(X=d.stderr),q?pi("stdin",q):Ns("/dev/tty","/dev/stdin"),H?pi("stdout",null,H):Ns("/dev/tty","/dev/stdout"),X?pi("stderr",null,X):Ns("/dev/tty1","/dev/stderr"),ko("/dev/stdin",0),ko("/dev/stdout",1),ko("/dev/stderr",1)}if(Yi.N(),Ci=!1,(xe=d.onRuntimeInitialized)==null||xe.call(d),d.postRun)for(typeof d.postRun=="function"&&(d.postRun=[d.postRun]);d.postRun.length;){var X=d.postRun.shift();de.push(X)}ie(de)}}if(0<$e)We=$a;else{if(d.preRun)for(typeof d.preRun=="function"&&(d.preRun=[d.preRun]);d.preRun.length;)je();ie(He),0<$e?We=$a:d.setStatus?(d.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>d.setStatus(""),1),A()},1)):A()}}var Yi;return(async function(){var H;function A(X){var xe;return X=Yi=X.exports,d._sqlite3_free=X.P,d._sqlite3_value_text=X.Q,d._sqlite3_prepare_v2=X.R,d._sqlite3_step=X.S,d._sqlite3_reset=X.T,d._sqlite3_exec=X.U,d._sqlite3_finalize=X.V,d._sqlite3_column_name=X.W,d._sqlite3_column_text=X.X,d._sqlite3_column_type=X.Y,d._sqlite3_errmsg=X.Z,d._sqlite3_clear_bindings=X._,d._sqlite3_value_blob=X.$,d._sqlite3_value_bytes=X.aa,d._sqlite3_value_double=X.ba,d._sqlite3_value_int=X.ca,d._sqlite3_value_type=X.da,d._sqlite3_result_blob=X.ea,d._sqlite3_result_double=X.fa,d._sqlite3_result_error=X.ga,d._sqlite3_result_int=X.ha,d._sqlite3_result_int64=X.ia,d._sqlite3_result_null=X.ja,d._sqlite3_result_text=X.ka,d._sqlite3_aggregate_context=X.la,d._sqlite3_column_count=X.ma,d._sqlite3_data_count=X.na,d._sqlite3_column_blob=X.oa,d._sqlite3_column_bytes=X.pa,d._sqlite3_column_double=X.qa,d._sqlite3_bind_blob=X.ra,d._sqlite3_bind_double=X.sa,d._sqlite3_bind_int=X.ta,d._sqlite3_bind_text=X.ua,d._sqlite3_bind_parameter_index=X.va,d._sqlite3_sql=X.wa,d._sqlite3_normalized_sql=X.xa,d._sqlite3_changes=X.ya,d._sqlite3_close_v2=X.za,d._sqlite3_create_function_v2=X.Aa,d._sqlite3_update_hook=X.Ba,d._sqlite3_open=X.Ca,oo=d._malloc=X.Da,sr=d._free=X.Ea,d._RegisterExtensionFunctions=X.Fa,Ii=X.Ga,Yr=X.Ha,yr=X.Ia,kr=X.Ja,Ba=X.Ka,xt=X.M,gn=X.O,he(),$e--,(xe=d.monitorRunDependencies)==null||xe.call(d,$e),$e==0&&We&&(X=We,We=null,X()),Yi}$e++,(H=d.monitorRunDependencies)==null||H.call(d,$e);var q={a:On};return d.instantiateWasm?new Promise(X=>{d.instantiateWasm(q,(xe,Le)=>{X(A(xe))})}):(fe??(fe=d.locateFile?d.locateFile("sql-wasm-browser.wasm",P):P+"sql-wasm-browser.wasm"),A((await Ce(q)).instance))})(),$a(),s}),n)};e.exports=r,e.exports.default=r})(pj)),pj.exports}var r1e=n1e();const i1e=In(r1e);let mj=!1,Ol=null;const Z8="pertanian_sqlite";let Yp=null;async function _k(){return Ol||Yp||(mj?(await new Promise(e=>setTimeout(e,100)),_k()):(mj=!0,Yp=(async()=>{try{const e=await i1e({locateFile:()=>"/sql-wasm.wasm"}),t=localStorage.getItem(Z8);let n;if(t){const i=Uint8Array.from(atob(t),a=>a.charCodeAt(0));Ol=new e.Database(i),console.log("✅ DB loaded from storage"),Ol.run("DROP TABLE IF EXISTS farmer;"),console.log("⚠️ Tabel Farmer lama dihapus untuk sinkronisasi skema")}else Ol=new e.Database,console.log("🆕 DB created");Ol.run(`
|
||
CREATE TABLE IF NOT EXISTS farmer (
|
||
id TEXT PRIMARY KEY,
|
||
nik TEXT,
|
||
full_name TEXT NOT NULL,
|
||
phone TEXT,
|
||
farmer_group TEXT, -- Tambahkan kolom ini
|
||
village TEXT,
|
||
district TEXT,
|
||
regency TEXT,
|
||
province TEXT,
|
||
verification_status TEXT,
|
||
sync_status TEXT DEFAULT 'pending',
|
||
created_date TEXT DEFAULT CURRENT_TIMESTAMP,
|
||
updated_date TEXT DEFAULT CURRENT_TIMESTAMP
|
||
);
|
||
`);const r=Ol.exec("PRAGMA table_info(farmer);");return console.log("🔍 KOLOM YANG TERDETEKSI DI SQLITE:",JSON.stringify(r[0].values.map(i=>i[1]))),Ol.run(`
|
||
CREATE TABLE IF NOT EXISTS land (
|
||
id TEXT PRIMARY KEY,
|
||
farmer_id TEXT,
|
||
name TEXT,
|
||
area_hectares REAL,
|
||
validation_status TEXT DEFAULT 'pending',
|
||
sync_status TEXT DEFAULT 'synced'
|
||
);
|
||
`),Ol.run(`
|
||
CREATE TABLE IF NOT EXISTS pending_sync (
|
||
id TEXT PRIMARY KEY,
|
||
entity_type TEXT,
|
||
operation TEXT,
|
||
payload TEXT,
|
||
created_at TEXT
|
||
);
|
||
`),Ol}catch(e){throw Yp=null,e}finally{mj=!1}})(),Yp))}function a1e(e){const t=e.export(),n=btoa(String.fromCharCode(...t));localStorage.setItem(Z8,n)}var Ey={exports:{}},o1e=Ey.exports,g$;function s1e(){return g$||(g$=1,(function(e,t){((n,r)=>{e.exports=r()})(o1e,function(){var n=function(_,O){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(B,z){B.__proto__=z}:function(B,z){for(var W in z)Object.prototype.hasOwnProperty.call(z,W)&&(B[W]=z[W])}))(_,O)},r=function(){return(r=Object.assign||function(_){for(var O,B=1,z=arguments.length;B<z;B++)for(var W in O=arguments[B])Object.prototype.hasOwnProperty.call(O,W)&&(_[W]=O[W]);return _}).apply(this,arguments)};function i(_,O,B){for(var z,W=0,G=O.length;W<G;W++)!z&&W in O||((z=z||Array.prototype.slice.call(O,0,W))[W]=O[W]);return _.concat(z||Array.prototype.slice.call(O))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Xp,o=Object.keys,s=Array.isArray;function c(_,O){return typeof O=="object"&&o(O).forEach(function(B){_[B]=O[B]}),_}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var d=Object.getPrototypeOf,p={}.hasOwnProperty;function m(_,O){return p.call(_,O)}function y(_,O){typeof O=="function"&&(O=O(d(_))),(typeof Reflect>"u"?o:Reflect.ownKeys)(O).forEach(function(B){P(_,B,O[B])})}var b=Object.defineProperty;function P(_,O,B,z){b(_,O,c(B&&m(B,"get")&&typeof B.get=="function"?{get:B.get,set:B.set,configurable:!0}:{value:B,configurable:!0,writable:!0},z))}function x(_){return{from:function(O){return _.prototype=Object.create(O.prototype),P(_.prototype,"constructor",_),{extend:y.bind(null,_.prototype)}}}}var w=Object.getOwnPropertyDescriptor,T=[].slice;function E(_,O,B){return T.call(_,O,B)}function k(_,O){return O(_)}function D(_){if(!_)throw new Error("Assertion Failed")}function I(_){a.setImmediate?setImmediate(_):setTimeout(_,0)}function R(_,O){if(typeof O=="string"&&m(_,O))return _[O];if(!O)return _;if(typeof O!="string"){for(var B=[],z=0,W=O.length;z<W;++z){var G=R(_,O[z]);B.push(G)}return B}var J,te=O.indexOf(".");return te===-1||(J=_[O.substr(0,te)])==null?void 0:R(J,O.substr(te+1))}function $(_,O,B){if(_&&O!==void 0&&!("isFrozen"in Object&&Object.isFrozen(_)))if(typeof O!="string"&&"length"in O){D(typeof B!="string"&&"length"in B);for(var z=0,W=O.length;z<W;++z)$(_,O[z],B[z])}else{var G,J,te=O.indexOf(".");te!==-1?(G=O.substr(0,te),(te=O.substr(te+1))===""?B===void 0?s(_)&&!isNaN(parseInt(G))?_.splice(G,1):delete _[G]:_[G]=B:$(J=(J=_[G])&&m(_,G)?J:_[G]={},te,B)):B===void 0?s(_)&&!isNaN(parseInt(O))?_.splice(O,1):delete _[O]:_[O]=B}}function V(_){var O,B={};for(O in _)m(_,O)&&(B[O]=_[O]);return B}var K=[].concat;function Z(_){return K.apply([],_)}var de="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Z([8,16,32,64].map(function(_){return["Int","Uint","Float"].map(function(O){return O+_+"Array"})}))).filter(function(_){return a[_]}),ee=new Set(de.map(function(_){return a[_]})),ne=null;function oe(_){return ne=new WeakMap,_=(function O(B){if(!B||typeof B!="object")return B;var z=ne.get(B);if(z)return z;if(s(B)){z=[],ne.set(B,z);for(var W=0,G=B.length;W<G;++W)z.push(O(B[W]))}else if(ee.has(B.constructor))z=B;else{var J,te=d(B);for(J in z=te===Object.prototype?{}:Object.create(te),ne.set(B,z),B)m(B,J)&&(z[J]=O(B[J]))}return z})(_),ne=null,_}var he={}.toString;function Se(_){return he.call(_).slice(8,-1)}var fe=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Oe=typeof fe=="symbol"?function(_){var O;return _!=null&&(O=_[fe])&&O.apply(_)}:function(){return null};function re(_,O){O=_.indexOf(O),0<=O&&_.splice(O,1)}var Ce={};function ae(_){var O,B,z,W;if(arguments.length===1){if(s(_))return _.slice();if(this===Ce&&typeof _=="string")return[_];if(W=Oe(_))for(B=[];!(z=W.next()).done;)B.push(z.value);else{if(_==null)return[_];if(typeof(O=_.length)!="number")return[_];for(B=new Array(O);O--;)B[O]=_[O]}}else for(O=arguments.length,B=new Array(O);O--;)B[O]=arguments[O];return B}var ie=typeof Symbol<"u"?function(_){return _[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},de=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Fr=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(de),He={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function je(_,O){this.name=_,this.message=O}function $e(_,O){return _+". Errors: "+Object.keys(O).map(function(B){return O[B].toString()}).filter(function(B,z,W){return W.indexOf(B)===z}).join(`
|
||
`)}function We(_,O,B,z){this.failures=O,this.failedKeys=z,this.successCount=B,this.message=$e(_,O)}function Ye(_,O){this.name="BulkError",this.failures=Object.keys(O).map(function(B){return O[B]}),this.failuresByPos=O,this.message=$e(_,this.failures)}x(je).from(Error).extend({toString:function(){return this.name+": "+this.message}}),x(We).from(je),x(Ye).from(je);var rt=Fr.reduce(function(_,O){return _[O]=O+"Error",_},{}),ze=je,Fe=Fr.reduce(function(_,O){var B=O+"Error";function z(W,G){this.name=B,W?typeof W=="string"?(this.message="".concat(W).concat(G?`
|
||
`+G:""),this.inner=G||null):typeof W=="object"&&(this.message="".concat(W.name," ").concat(W.message),this.inner=W):(this.message=He[O]||B,this.inner=null)}return x(z).from(ze),_[O]=z,_},{}),st=(Fe.Syntax=SyntaxError,Fe.Type=TypeError,Fe.Range=RangeError,de.reduce(function(_,O){return _[O+"Error"]=Fe[O],_},{}));de=Fr.reduce(function(_,O){return["Syntax","Type","Range"].indexOf(O)===-1&&(_[O+"Error"]=Fe[O]),_},{});function Te(){}function Dt(_){return _}function Lt(_,O){return _==null||_===Dt?O:function(B){return O(_(B))}}function dn(_,O){return function(){_.apply(this,arguments),O.apply(this,arguments)}}function xn(_,O){return _===Te?O:function(){var B=_.apply(this,arguments),z=(B!==void 0&&(arguments[0]=B),this.onsuccess),W=this.onerror,G=(this.onsuccess=null,this.onerror=null,O.apply(this,arguments));return z&&(this.onsuccess=this.onsuccess?dn(z,this.onsuccess):z),W&&(this.onerror=this.onerror?dn(W,this.onerror):W),G!==void 0?G:B}}function qn(_,O){return _===Te?O:function(){_.apply(this,arguments);var B=this.onsuccess,z=this.onerror;this.onsuccess=this.onerror=null,O.apply(this,arguments),B&&(this.onsuccess=this.onsuccess?dn(B,this.onsuccess):B),z&&(this.onerror=this.onerror?dn(z,this.onerror):z)}}function Ar(_,O){return _===Te?O:function(W){var z=_.apply(this,arguments),W=(c(W,z),this.onsuccess),G=this.onerror,J=(this.onsuccess=null,this.onerror=null,O.apply(this,arguments));return W&&(this.onsuccess=this.onsuccess?dn(W,this.onsuccess):W),G&&(this.onerror=this.onerror?dn(G,this.onerror):G),z===void 0?J===void 0?void 0:J:c(z,J)}}function Zr(_,O){return _===Te?O:function(){return O.apply(this,arguments)!==!1&&_.apply(this,arguments)}}function $r(_,O){return _===Te?O:function(){var B=_.apply(this,arguments);if(B&&typeof B.then=="function"){for(var z=this,W=arguments.length,G=new Array(W);W--;)G[W]=arguments[W];return B.then(function(){return O.apply(z,G)})}return O.apply(this,arguments)}}de.ModifyError=We,de.DexieError=je,de.BulkError=Ye;var Bn=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function _r(_){Bn=_}var fr={},To=100,ua=typeof Promise>"u"?[]:(Fr=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[ua=crypto.subtle.digest("SHA-512",new Uint8Array([0])),d(ua),Fr]:[Fr,d(Fr),Fr]),Fr=ua[0],zs=ua[1],zs=zs&&zs.then,ca=Fr&&Fr.constructor,Eo=!!ua[2],Vt=function(_,O){Ci.push([_,O]),Wi&&(queueMicrotask(Yl),Wi=!1)},Na=!0,Wi=!0,Ja=[],Ki=[],Ho=Dt,qr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Te,pgp:!1,env:{},finalize:Te},Pt=qr,Ci=[],fa=0,lt=[];function ht(_){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var O=this._PSD=Pt;if(typeof _!="function"){if(_!==fr)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Go(this,this._value)}else this._state=null,this._value=null,++O.ref,(function B(z,W){try{W(function(G){if(z._state===null){if(G===z)throw new TypeError("A promise cannot be resolved with itself.");var J=z._lib&&ar();G&&typeof G.then=="function"?B(z,function(te,be){G instanceof ht?G._then(te,be):G.then(te,be)}):(z._state=!0,z._value=G,Cs(z)),J&&da()}},Go.bind(null,z))}catch(G){Go(z,G)}})(this,_)}var Ma={get:function(){var _=Pt,O=Ra;function B(z,W){var G=this,J=!_.global&&(_!==Pt||O!==Ra),te=J&&!Sr(),be=new ht(function(Ee,pe){Zo(G,new vr(vl(z,_,J,te),vl(W,_,J,te),Ee,pe,_))});return this._consoleTask&&(be._consoleTask=this._consoleTask),be}return B.prototype=fr,B},set:function(_){P(this,"then",_&&_.prototype===fr?Ma:{get:function(){return _},set:Ma.set})}};function vr(_,O,B,z,W){this.onFulfilled=typeof _=="function"?_:null,this.onRejected=typeof O=="function"?O:null,this.resolve=B,this.reject=z,this.psd=W}function Go(_,O){var B,z;Ki.push(O),_._state===null&&(B=_._lib&&ar(),O=Ho(O),_._state=!1,_._value=O,z=_,Ja.some(function(W){return W._value===z._value})||Ja.push(z),Cs(_),B)&&da()}function Cs(_){var O=_._listeners;_._listeners=[];for(var B=0,z=O.length;B<z;++B)Zo(_,O[B]);var W=_._PSD;--W.ref||W.finalize(),fa===0&&(++fa,Vt(function(){--fa==0&&Ni()},[]))}function Zo(_,O){if(_._state===null)_._listeners.push(O);else{var B=_._state?O.onFulfilled:O.onRejected;if(B===null)return(_._state?O.resolve:O.reject)(_._value);++O.psd.ref,++fa,Vt(eo,[B,_,O])}}function eo(_,O,B){try{var z,W=O._value;!O._state&&Ki.length&&(Ki=[]),z=Bn&&O._consoleTask?O._consoleTask.run(function(){return _(W)}):_(W),O._state||Ki.indexOf(W)!==-1||(G=>{for(var J=Ja.length;J;)if(Ja[--J]._value===G._value)return Ja.splice(J,1)})(O),B.resolve(z)}catch(G){B.reject(G)}finally{--fa==0&&Ni(),--B.psd.ref||B.psd.finalize()}}function Yl(){Ia(qr,function(){ar()&&da()})}function ar(){var _=Na;return Wi=Na=!1,_}function da(){var _,O,B;do for(;0<Ci.length;)for(_=Ci,Ci=[],B=_.length,O=0;O<B;++O){var z=_[O];z[0].apply(null,z[1])}while(0<Ci.length);Wi=Na=!0}function Ni(){for(var _=Ja,O=(Ja=[],_.forEach(function(z){z._PSD.onunhandled.call(null,z._value,z)}),lt.slice(0)),B=O.length;B;)O[--B]()}function Ao(_){return new ht(fr,!1,_)}function An(_,O){var B=Pt;return function(){var z=ar(),W=Pt;try{return Gi(B,!0),_.apply(this,arguments)}catch(G){O&&O(G)}finally{Gi(W,!1),z&&da()}}}y(ht.prototype,{then:Ma,_then:function(_,O){Zo(this,new vr(null,null,_,O,Pt))},catch:function(_){var O,B;return arguments.length===1?this.then(null,_):(O=_,B=arguments[1],typeof O=="function"?this.then(null,function(z){return(z instanceof O?B:Ao)(z)}):this.then(null,function(z){return(z&&z.name===O?B:Ao)(z)}))},finally:function(_){return this.then(function(O){return ht.resolve(_()).then(function(){return O})},function(O){return ht.resolve(_()).then(function(){return Ao(O)})})},timeout:function(_,O){var B=this;return _<1/0?new ht(function(z,W){var G=setTimeout(function(){return W(new Fe.Timeout(O))},_);B.then(z,W).finally(clearTimeout.bind(null,G))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&P(ht.prototype,Symbol.toStringTag,"Dexie.Promise"),qr.env=Ns(),y(ht,{all:function(){var _=ae.apply(null,arguments).map(ha);return new ht(function(O,B){_.length===0&&O([]);var z=_.length;_.forEach(function(W,G){return ht.resolve(W).then(function(J){_[G]=J,--z||O(_)},B)})})},resolve:function(_){return _ instanceof ht?_:_&&typeof _.then=="function"?new ht(function(O,B){_.then(O,B)}):new ht(fr,!0,_)},reject:Ao,race:function(){var _=ae.apply(null,arguments).map(ha);return new ht(function(O,B){_.map(function(z){return ht.resolve(z).then(O,B)})})},PSD:{get:function(){return Pt},set:function(_){return Pt=_}},totalEchoes:{get:function(){return Ra}},newPSD:Hi,usePSD:Ia,scheduler:{get:function(){return Vt},set:function(_){Vt=_}},rejectionMapper:{get:function(){return Ho},set:function(_){Ho=_}},follow:function(_,O){return new ht(function(B,z){return Hi(function(W,G){var J=Pt;J.unhandleds=[],J.onunhandled=G,J.finalize=dn(function(){var te,be=this;te=function(){be.unhandleds.length===0?W():G(be.unhandleds[0])},lt.push(function Ee(){te(),lt.splice(lt.indexOf(Ee),1)}),++fa,Vt(function(){--fa==0&&Ni()},[])},J.finalize),_()},O,B,z)})}}),ca&&(ca.allSettled&&P(ht,"allSettled",function(){var _=ae.apply(null,arguments).map(ha);return new ht(function(O){_.length===0&&O([]);var B=_.length,z=new Array(B);_.forEach(function(W,G){return ht.resolve(W).then(function(J){return z[G]={status:"fulfilled",value:J}},function(J){return z[G]={status:"rejected",reason:J}}).then(function(){return--B||O(z)})})})}),ca.any&&typeof AggregateError<"u"&&P(ht,"any",function(){var _=ae.apply(null,arguments).map(ha);return new ht(function(O,B){_.length===0&&B(new AggregateError([]));var z=_.length,W=new Array(z);_.forEach(function(G,J){return ht.resolve(G).then(function(te){return O(te)},function(te){W[J]=te,--z||B(new AggregateError(W))})})})}),ca.withResolvers)&&(ht.withResolvers=ca.withResolvers);var or={awaits:0,echoes:0,id:0},Rn=0,_t=[],to=0,Ra=0,$u=0;function Hi(_,J,B,z){var W=Pt,G=Object.create(W),J=(G.parent=W,G.ref=0,G.global=!1,G.id=++$u,qr.env,G.env=Eo?{Promise:ht,PromiseProp:{value:ht,configurable:!0,writable:!0},all:ht.all,race:ht.race,allSettled:ht.allSettled,any:ht.any,resolve:ht.resolve,reject:ht.reject}:{},J&&c(G,J),++W.ref,G.finalize=function(){--this.parent.ref||this.parent.finalize()},Ia(G,_,B,z));return G.ref===0&&G.finalize(),J}function La(){return or.id||(or.id=++Rn),++or.awaits,or.echoes+=To,or.id}function Sr(){return!!or.awaits&&(--or.awaits==0&&(or.id=0),or.echoes=or.awaits*To,!0)}function ha(_){return or.echoes&&_&&_.constructor===ca?(La(),_.then(function(O){return Sr(),O},function(O){return Sr(),nr(O)})):_}function Mi(){var _=_t[_t.length-1];_t.pop(),Gi(_,!1)}function Gi(_,O){var B,z,W=Pt;(O?!or.echoes||to++&&_===Pt:!to||--to&&_===Pt)||queueMicrotask(O?(function(G){++Ra,or.echoes&&--or.echoes!=0||(or.echoes=or.awaits=or.id=0),_t.push(Pt),Gi(G,!0)}).bind(null,_):Mi),_!==Pt&&(Pt=_,W===qr&&(qr.env=Ns()),Eo)&&(B=qr.env.Promise,z=_.env,W.global||_.global)&&(Object.defineProperty(a,"Promise",z.PromiseProp),B.all=z.all,B.race=z.race,B.resolve=z.resolve,B.reject=z.reject,z.allSettled&&(B.allSettled=z.allSettled),z.any)&&(B.any=z.any)}function Ns(){var _=a.Promise;return Eo?{Promise:_,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:_.all,race:_.race,allSettled:_.allSettled,any:_.any,resolve:_.resolve,reject:_.reject}:{}}function Ia(_,O,B,z,W){var G=Pt;try{return Gi(_,!0),O(B,z,W)}finally{Gi(G,!1)}}function vl(_,O,B,z){return typeof _!="function"?_:function(){var W=Pt;B&&La(),Gi(O,!0);try{return _.apply(this,arguments)}finally{Gi(W,!1),z&&queueMicrotask(Sr)}}}function Da(_){Promise===ca&&or.echoes===0?to===0?_():enqueueNativeMicroTask(_):setTimeout(_,0)}(""+zs).indexOf("[native code]")===-1&&(La=Sr=Te);var nr=ht.reject,hi="",jn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",ko="String expected.",pa=[],Yo="__dbnames",Co="readonly",Xo="readwrite";function Ri(_,O){return _?O?function(){return _.apply(this,arguments)&&O.apply(this,arguments)}:_:O}var pi={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ln(_){return typeof _!="string"||/\./.test(_)?function(O){return O}:function(O){return O[_]===void 0&&_ in O&&delete(O=oe(O))[_],O}}function Li(){throw Fe.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ft(_,O){try{var B=$n(_),z=$n(O);if(B!==z)return B==="Array"?1:z==="Array"?-1:B==="binary"?1:z==="binary"?-1:B==="string"?1:z==="string"?-1:B==="Date"?1:z!=="Date"?NaN:-1;switch(B){case"number":case"Date":case"string":return O<_?1:_<O?-1:0;case"binary":for(var W=no(_),G=no(O),J=W.length,te=G.length,be=J<te?J:te,Ee=0;Ee<be;++Ee)if(W[Ee]!==G[Ee])return W[Ee]<G[Ee]?-1:1;return J===te?0:J<te?-1:1;case"Array":for(var pe=_,me=O,we=pe.length,_e=me.length,ye=we<_e?we:_e,ve=0;ve<ye;++ve){var ke=ft(pe[ve],me[ve]);if(ke!==0)return ke}return we===_e?0:we<_e?-1:1}}catch{}return NaN}function $n(_){var O=typeof _;return O=="object"&&(ArrayBuffer.isView(_)||(O=Se(_))==="ArrayBuffer")?"binary":O}function no(_){return _ instanceof Uint8Array?_:ArrayBuffer.isView(_)?new Uint8Array(_.buffer,_.byteOffset,_.byteLength):new Uint8Array(_)}function Zi(_,O,B){var z=_.schema.yProps;return z?(O&&0<B.numFailures&&(O=O.filter(function(W,G){return!B.failures[G]})),Promise.all(z.map(function(W){return W=W.updatesTable,O?_.db.table(W).where("k").anyOf(O).delete():_.db.table(W).clear()})).then(function(){return B})):B}No.prototype.execute=function(_){var O=this["@@propmod"];if(O.add!==void 0){var B=O.add;if(s(B))return i(i([],s(_)?_:[],!0),B).sort();if(typeof B=="number")return(Number(_)||0)+B;if(typeof B=="bigint")try{return BigInt(_)+B}catch{return BigInt(0)+B}throw new TypeError("Invalid term ".concat(B))}if(O.remove!==void 0){var z=O.remove;if(s(z))return s(_)?_.filter(function(W){return!z.includes(W)}).sort():[];if(typeof z=="number")return Number(_)-z;if(typeof z=="bigint")try{return BigInt(_)-z}catch{return BigInt(0)-z}throw new TypeError("Invalid subtrahend ".concat(z))}return B=(B=O.replacePrefix)==null?void 0:B[0],B&&typeof _=="string"&&_.startsWith(B)?O.replacePrefix[1]+_.substring(B.length):_};var mi=No;function No(_){this["@@propmod"]=_}function qt(_,O){for(var B=o(O),z=B.length,W=!1,G=0;G<z;++G){var J=B[G],te=O[J],be=R(_,J);te instanceof mi?($(_,J,te.execute(be)),W=!0):be!==te&&($(_,J,te),W=!0)}return W}kn.prototype._trans=function(_,O,B){var z=this._tx||Pt.trans,W=this.name,G=Bn&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(_==="readonly"?"read":"write"," ").concat(this.name));function J(Ee,pe,me){if(me.schema[W])return O(me.idbtrans,me);throw new Fe.NotFound("Table "+W+" not part of transaction")}var te=ar();try{var be=z&&z.db._novip===this.db._novip?z===Pt.trans?z._promise(_,J,B):Hi(function(){return z._promise(_,J,B)},{trans:z,transless:Pt.transless||Pt}):(function Ee(pe,me,we,_e){if(pe.idbdb&&(pe._state.openComplete||Pt.letThrough||pe._vip)){var ye=pe._createTransaction(me,we,pe._dbSchema);try{ye.create(),pe._state.PR1398_maxLoop=3}catch(ve){return ve.name===rt.InvalidState&&pe.isOpen()&&0<--pe._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),pe.close({disableAutoOpen:!1}),pe.open().then(function(){return Ee(pe,me,we,_e)})):nr(ve)}return ye._promise(me,function(ve,ke){return Hi(function(){return Pt.trans=ye,_e(ve,ke,ye)})}).then(function(ve){if(me==="readwrite")try{ye.idbtrans.commit()}catch{}return me==="readonly"?ve:ye._completion.then(function(){return ve})})}if(pe._state.openComplete)return nr(new Fe.DatabaseClosed(pe._state.dbOpenError));if(!pe._state.isBeingOpened){if(!pe._state.autoOpen)return nr(new Fe.DatabaseClosed);pe.open().catch(Te)}return pe._state.dbReadyPromise.then(function(){return Ee(pe,me,we,_e)})})(this.db,_,[this.name],J);return G&&(be._consoleTask=G,be=be.catch(function(Ee){return console.trace(Ee),nr(Ee)})),be}finally{te&&da()}},kn.prototype.get=function(_,O){var B=this;return _&&_.constructor===Object?this.where(_).first(O):_==null?nr(new Fe.Type("Invalid argument to Table.get()")):this._trans("readonly",function(z){return B.core.get({trans:z,key:_}).then(function(W){return B.hook.reading.fire(W)})}).then(O)},kn.prototype.where=function(_){if(typeof _=="string")return new this.db.WhereClause(this,_);if(s(_))return new this.db.WhereClause(this,"[".concat(_.join("+"),"]"));var O=o(_);if(O.length===1)return this.where(O[0]).equals(_[O[0]]);var B=this.schema.indexes.concat(this.schema.primKey).filter(function(te){if(te.compound&&O.every(function(Ee){return 0<=te.keyPath.indexOf(Ee)})){for(var be=0;be<O.length;++be)if(O.indexOf(te.keyPath[be])===-1)return!1;return!0}return!1}).sort(function(te,be){return te.keyPath.length-be.keyPath.length})[0];if(B&&this.db._maxKey!==hi)return J=B.keyPath.slice(0,O.length),this.where(J).equals(J.map(function(te){return _[te]}));!B&&Bn&&console.warn("The query ".concat(JSON.stringify(_)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(O.join("+"),"]"));var z=this.schema.idxByName;function W(te,be){return ft(te,be)===0}var J=O.reduce(function(pe,be){var Ee=pe[0],pe=pe[1],me=z[be],we=_[be];return[Ee||me,Ee||!me?Ri(pe,me&&me.multi?function(_e){return _e=R(_e,be),s(_e)&&_e.some(function(ye){return W(we,ye)})}:function(_e){return W(we,R(_e,be))}):pe]},[null,null]),G=J[0],J=J[1];return G?this.where(G.name).equals(_[G.keyPath]).filter(J):B?this.filter(J):this.where(O).equals("")},kn.prototype.filter=function(_){return this.toCollection().and(_)},kn.prototype.count=function(_){return this.toCollection().count(_)},kn.prototype.offset=function(_){return this.toCollection().offset(_)},kn.prototype.limit=function(_){return this.toCollection().limit(_)},kn.prototype.each=function(_){return this.toCollection().each(_)},kn.prototype.toArray=function(_){return this.toCollection().toArray(_)},kn.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},kn.prototype.orderBy=function(_){return new this.db.Collection(new this.db.WhereClause(this,s(_)?"[".concat(_.join("+"),"]"):_))},kn.prototype.reverse=function(){return this.toCollection().reverse()},kn.prototype.mapToClass=function(_){for(var O=this.db,B=this.name,z=((this.schema.mappedClass=_).prototype instanceof Li&&(_=(J=>{var te=pe,be=J;if(typeof be!="function"&&be!==null)throw new TypeError("Class extends value "+String(be)+" is not a constructor or null");function Ee(){this.constructor=te}function pe(){return J!==null&&J.apply(this,arguments)||this}return n(te,be),te.prototype=be===null?Object.create(be):(Ee.prototype=be.prototype,new Ee),Object.defineProperty(pe.prototype,"db",{get:function(){return O},enumerable:!1,configurable:!0}),pe.prototype.table=function(){return B},pe})(_)),new Set),W=_.prototype;W;W=d(W))Object.getOwnPropertyNames(W).forEach(function(J){return z.add(J)});function G(J){if(!J)return J;var te,be=Object.create(_.prototype);for(te in J)if(!z.has(te))try{be[te]=J[te]}catch{}return be}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=G,this.hook("reading",G),_},kn.prototype.defineClass=function(){return this.mapToClass(function(_){c(this,_)})},kn.prototype.add=function(_,O){var B=this,z=this.schema.primKey,W=z.auto,G=z.keyPath,J=_;return G&&W&&(J=ln(G)(_)),this._trans("readwrite",function(te){return B.core.mutate({trans:te,type:"add",keys:O!=null?[O]:null,values:[J]})}).then(function(te){return te.numFailures?ht.reject(te.failures[0]):te.lastResult}).then(function(te){if(G)try{$(_,G,te)}catch{}return te})},kn.prototype.upsert=function(_,O){var B=this,z=this.schema.primKey.keyPath;return this._trans("readwrite",function(W){return B.core.get({trans:W,key:_}).then(function(G){var J=G??{};return qt(J,O),z&&$(J,z,_),B.core.mutate({trans:W,type:"put",values:[J],keys:[_],upsert:!0,updates:{keys:[_],changeSpecs:[O]}}).then(function(te){return te.numFailures?ht.reject(te.failures[0]):!!G})})})},kn.prototype.update=function(_,O){return typeof _!="object"||s(_)?this.where(":id").equals(_).modify(O):(_=R(_,this.schema.primKey.keyPath))===void 0?nr(new Fe.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(_).modify(O)},kn.prototype.put=function(_,O){var B=this,z=this.schema.primKey,W=z.auto,G=z.keyPath,J=_;return G&&W&&(J=ln(G)(_)),this._trans("readwrite",function(te){return B.core.mutate({trans:te,type:"put",values:[J],keys:O!=null?[O]:null})}).then(function(te){return te.numFailures?ht.reject(te.failures[0]):te.lastResult}).then(function(te){if(G)try{$(_,G,te)}catch{}return te})},kn.prototype.delete=function(_){var O=this;return this._trans("readwrite",function(B){return O.core.mutate({trans:B,type:"delete",keys:[_]}).then(function(z){return Zi(O,[_],z)}).then(function(z){return z.numFailures?ht.reject(z.failures[0]):void 0})})},kn.prototype.clear=function(){var _=this;return this._trans("readwrite",function(O){return _.core.mutate({trans:O,type:"deleteRange",range:pi}).then(function(B){return Zi(_,null,B)})}).then(function(O){return O.numFailures?ht.reject(O.failures[0]):void 0})},kn.prototype.bulkGet=function(_){var O=this;return this._trans("readonly",function(B){return O.core.getMany({keys:_,trans:B}).then(function(z){return z.map(function(W){return O.hook.reading.fire(W)})})})},kn.prototype.bulkAdd=function(_,O,B){var z=this,W=Array.isArray(O)?O:void 0,G=(B=B||(W?void 0:O))?B.allKeys:void 0;return this._trans("readwrite",function(J){var te=z.schema.primKey,Ee=te.auto,te=te.keyPath;if(te&&W)throw new Fe.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(W&&W.length!==_.length)throw new Fe.InvalidArgument("Arguments objects and keys must have the same length");var be=_.length,Ee=te&&Ee?_.map(ln(te)):_;return z.core.mutate({trans:J,type:"add",keys:W,values:Ee,wantResults:G}).then(function(pe){var me=pe.numFailures,we=pe.failures;if(me===0)return G?pe.results:pe.lastResult;throw new Ye("".concat(z.name,".bulkAdd(): ").concat(me," of ").concat(be," operations failed"),we)})})},kn.prototype.bulkPut=function(_,O,B){var z=this,W=Array.isArray(O)?O:void 0,G=(B=B||(W?void 0:O))?B.allKeys:void 0;return this._trans("readwrite",function(J){var te=z.schema.primKey,Ee=te.auto,te=te.keyPath;if(te&&W)throw new Fe.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(W&&W.length!==_.length)throw new Fe.InvalidArgument("Arguments objects and keys must have the same length");var be=_.length,Ee=te&&Ee?_.map(ln(te)):_;return z.core.mutate({trans:J,type:"put",keys:W,values:Ee,wantResults:G}).then(function(pe){var me=pe.numFailures,we=pe.failures;if(me===0)return G?pe.results:pe.lastResult;throw new Ye("".concat(z.name,".bulkPut(): ").concat(me," of ").concat(be," operations failed"),we)})})},kn.prototype.bulkUpdate=function(_){var O=this,B=this.core,z=_.map(function(J){return J.key}),W=_.map(function(J){return J.changes}),G=[];return this._trans("readwrite",function(J){return B.getMany({trans:J,keys:z,cache:"clone"}).then(function(te){var be=[],Ee=[],pe=(_.forEach(function(me,we){var _e=me.key,ye=me.changes,ve=te[we];if(ve){for(var ke=0,Ie=Object.keys(ye);ke<Ie.length;ke++){var Ae=Ie[ke],Ve=ye[Ae];if(Ae===O.schema.primKey.keyPath){if(ft(Ve,_e)!==0)throw new Fe.Constraint("Cannot update primary key in bulkUpdate()")}else $(ve,Ae,Ve)}G.push(we),be.push(_e),Ee.push(ve)}}),be.length);return B.mutate({trans:J,type:"put",keys:be,values:Ee,updates:{keys:z,changeSpecs:W}}).then(function(me){var we=me.numFailures,_e=me.failures;if(we===0)return pe;for(var ye=0,ve=Object.keys(_e);ye<ve.length;ye++){var ke,Ie=ve[ye],Ae=G[Number(Ie)];Ae!=null&&(ke=_e[Ie],delete _e[Ie],_e[Ae]=ke)}throw new Ye("".concat(O.name,".bulkUpdate(): ").concat(we," of ").concat(pe," operations failed"),_e)})})})},kn.prototype.bulkDelete=function(_){var O=this,B=_.length;return this._trans("readwrite",function(z){return O.core.mutate({trans:z,type:"delete",keys:_}).then(function(W){return Zi(O,_,W)})}).then(function(z){var W=z.numFailures,G=z.failures;if(W===0)return z.lastResult;throw new Ye("".concat(O.name,".bulkDelete(): ").concat(W," of ").concat(B," operations failed"),G)})};var zn=kn;function kn(){}function ro(_){function O(J,te){if(te){for(var be=arguments.length,Ee=new Array(be-1);--be;)Ee[be-1]=arguments[be];return B[J].subscribe.apply(null,Ee),_}if(typeof J=="string")return B[J]}var B={};O.addEventType=G;for(var z=1,W=arguments.length;z<W;++z)G(arguments[z]);return O;function G(J,te,be){var Ee,pe;if(typeof J!="object")return te=te||Zr,pe={subscribers:[],fire:be=be||Te,subscribe:function(me){pe.subscribers.indexOf(me)===-1&&(pe.subscribers.push(me),pe.fire=te(pe.fire,me))},unsubscribe:function(me){pe.subscribers=pe.subscribers.filter(function(we){return we!==me}),pe.fire=pe.subscribers.reduce(te,be)}},B[J]=O[J]=pe;o(Ee=J).forEach(function(me){var we=Ee[me];if(s(we))G(me,Ee[me][0],Ee[me][1]);else{if(we!=="asap")throw new Fe.InvalidArgument("Invalid event config");var _e=G(me,Dt,function(){for(var ye=arguments.length,ve=new Array(ye);ye--;)ve[ye]=arguments[ye];_e.subscribers.forEach(function(ke){I(function(){ke.apply(null,ve)})})})}})}}function dr(_,O){return x(O).from({prototype:_}),O}function io(_,O){return!(_.filter||_.algorithm||_.or)&&(O?_.justLimit:!_.replayFilter)}function ma(_,O){_.filter=Ri(_.filter,O)}function gi(_,O,B){var z=_.replayFilter;_.replayFilter=z?function(){return Ri(z(),O())}:O,_.justLimit=B&&!z}function Un(_,O){if(_.isPrimKey)return O.primaryKey;var B=O.getIndexByKeyPath(_.index);if(B)return B;throw new Fe.Schema("KeyPath "+_.index+" on object store "+O.name+" is not indexed")}function zr(_,O,B){var z=Un(_,O.schema);return O.openCursor({trans:B,values:!_.keysOnly,reverse:_.dir==="prev",unique:!!_.unique,query:{index:z,range:_.range}})}function un(_,O,B,z){var W,G,J=_.replayFilter?Ri(_.filter,_.replayFilter()):_.filter;return _.or?(W={},G=function(te,be,Ee){var pe,me;J&&!J(be,Ee,function(we){return be.stop(we)},function(we){return be.fail(we)})||((me=""+(pe=be.primaryKey))=="[object ArrayBuffer]"&&(me=""+new Uint8Array(pe)),m(W,me))||(W[me]=!0,O(te,be,Ee))},Promise.all([_.or._iterate(G,B),ri(zr(_,z,B),_.algorithm,G,!_.keysOnly&&_.valueMapper)])):ri(zr(_,z,B),Ri(_.algorithm,J),O,!_.keysOnly&&_.valueMapper)}function ri(_,O,B,z){var W=An(z?function(G,J,te){return B(z(G),J,te)}:B);return _.then(function(G){if(G)return G.start(function(){var J=function(){return G.continue()};O&&!O(G,function(te){return J=te},function(te){G.stop(te),J=Te},function(te){G.fail(te),J=Te})||W(G.value,G,function(te){return J=te}),J()})})}cn.prototype._read=function(_,O){var B=this._ctx;return B.error?B.table._trans(null,nr.bind(null,B.error)):B.table._trans("readonly",_).then(O)},cn.prototype._write=function(_){var O=this._ctx;return O.error?O.table._trans(null,nr.bind(null,O.error)):O.table._trans("readwrite",_,"locked")},cn.prototype._addAlgorithm=function(_){var O=this._ctx;O.algorithm=Ri(O.algorithm,_)},cn.prototype._iterate=function(_,O){return un(this._ctx,_,O,this._ctx.table.core)},cn.prototype.clone=function(_){var O=Object.create(this.constructor.prototype),B=Object.create(this._ctx);return _&&c(B,_),O._ctx=B,O},cn.prototype.raw=function(){return this._ctx.valueMapper=null,this},cn.prototype.each=function(_){var O=this._ctx;return this._read(function(B){return un(O,_,B,O.table.core)})},cn.prototype.count=function(_){var O=this;return this._read(function(B){var z,W=O._ctx,G=W.table.core;return io(W,!0)?G.count({trans:B,query:{index:Un(W,G.schema),range:W.range}}).then(function(J){return Math.min(J,W.limit)}):(z=0,un(W,function(){return++z,!1},B,G).then(function(){return z}))}).then(_)},cn.prototype.sortBy=function(_,O){var B=_.split(".").reverse(),z=B[0],W=B.length-1;function G(be,Ee){return Ee?G(be[B[Ee]],Ee-1):be[z]}var J=this._ctx.dir==="next"?1:-1;function te(be,Ee){return ft(G(be,W),G(Ee,W))*J}return this.toArray(function(be){return be.sort(te)}).then(O)},cn.prototype.toArray=function(_){var O=this;return this._read(function(B){var z,W,G,J=O._ctx;return J.dir==="next"&&io(J,!0)&&0<J.limit?(z=J.valueMapper,W=Un(J,J.table.core.schema),J.table.core.query({trans:B,limit:J.limit,values:!0,query:{index:W,range:J.range}}).then(function(te){return te=te.result,z?te.map(z):te})):(G=[],un(J,function(te){return G.push(te)},B,J.table.core).then(function(){return G}))},_)},cn.prototype.offset=function(_){var O=this._ctx;return _<=0||(O.offset+=_,io(O)?gi(O,function(){var B=_;return function(z,W){return B===0||(B===1?--B:W(function(){z.advance(B),B=0}),!1)}}):gi(O,function(){var B=_;return function(){return--B<0}})),this},cn.prototype.limit=function(_){return this._ctx.limit=Math.min(this._ctx.limit,_),gi(this._ctx,function(){var O=_;return function(B,z,W){return--O<=0&&z(W),0<=O}},!0),this},cn.prototype.until=function(_,O){return ma(this._ctx,function(B,z,W){return!_(B.value)||(z(W),O)}),this},cn.prototype.first=function(_){return this.limit(1).toArray(function(O){return O[0]}).then(_)},cn.prototype.last=function(_){return this.reverse().first(_)},cn.prototype.filter=function(_){var O;return ma(this._ctx,function(B){return _(B.value)}),(O=this._ctx).isMatch=Ri(O.isMatch,_),this},cn.prototype.and=function(_){return this.filter(_)},cn.prototype.or=function(_){return new this.db.WhereClause(this._ctx.table,_,this)},cn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},cn.prototype.desc=function(){return this.reverse()},cn.prototype.eachKey=function(_){var O=this._ctx;return O.keysOnly=!O.isMatch,this.each(function(B,z){_(z.key,z)})},cn.prototype.eachUniqueKey=function(_){return this._ctx.unique="unique",this.eachKey(_)},cn.prototype.eachPrimaryKey=function(_){var O=this._ctx;return O.keysOnly=!O.isMatch,this.each(function(B,z){_(z.primaryKey,z)})},cn.prototype.keys=function(_){var O=this._ctx,B=(O.keysOnly=!O.isMatch,[]);return this.each(function(z,W){B.push(W.key)}).then(function(){return B}).then(_)},cn.prototype.primaryKeys=function(_){var O=this._ctx;if(O.dir==="next"&&io(O,!0)&&0<O.limit)return this._read(function(z){var W=Un(O,O.table.core.schema);return O.table.core.query({trans:z,values:!1,limit:O.limit,query:{index:W,range:O.range}})}).then(function(z){return z.result}).then(_);O.keysOnly=!O.isMatch;var B=[];return this.each(function(z,W){B.push(W.primaryKey)}).then(function(){return B}).then(_)},cn.prototype.uniqueKeys=function(_){return this._ctx.unique="unique",this.keys(_)},cn.prototype.firstKey=function(_){return this.limit(1).keys(function(O){return O[0]}).then(_)},cn.prototype.lastKey=function(_){return this.reverse().firstKey(_)},cn.prototype.distinct=function(){var _,O=this._ctx,O=O.index&&O.table.schema.idxByName[O.index];return O&&O.multi&&(_={},ma(this._ctx,function(z){var z=z.primaryKey.toString(),W=m(_,z);return _[z]=!0,!W})),this},cn.prototype.modify=function(_){var O=this,B=this._ctx;return this._write(function(z){function W(ve,ke){var Ie=ke.failures;we+=ve-ke.numFailures;for(var Ae=0,Ve=o(Ie);Ae<Ve.length;Ae++){var Je=Ve[Ae];me.push(Ie[Je])}}var G=typeof _=="function"?_:function(ve){return qt(ve,_)},J=B.table.core,pe=J.schema.primaryKey,te=pe.outbound,be=pe.extractKey,Ee=200,pe=O.db._options.modifyChunkSize,me=(pe&&(Ee=typeof pe=="object"?pe[J.name]||pe["*"]||200:pe),[]),we=0,_e=[],ye=_===Qo;return O.clone().primaryKeys().then(function(ve){function ke(Ae){var Ve=Math.min(Ee,ve.length-Ae),Je=ve.slice(Ae,Ae+Ve);return(ye?Promise.resolve([]):J.getMany({trans:z,keys:Je,cache:"immutable"})).then(function(at){var ut=[],Qe=[],gt=te?[]:null,dt=ye?Je:[];if(!ye)for(var it=0;it<Ve;++it){var vt=at[it],vn={value:oe(vt),primKey:ve[Ae+it]};G.call(vn,vn.value,vn)!==!1&&(vn.value==null?dt.push(ve[Ae+it]):te||ft(be(vt),be(vn.value))===0?(Qe.push(vn.value),te&>.push(ve[Ae+it])):(dt.push(ve[Ae+it]),ut.push(vn.value)))}return Promise.resolve(0<ut.length&&J.mutate({trans:z,type:"add",values:ut}).then(function(on){for(var Bt in on.failures)dt.splice(parseInt(Bt),1);W(ut.length,on)})).then(function(){return(0<Qe.length||Ie&&typeof _=="object")&&J.mutate({trans:z,type:"put",keys:gt,values:Qe,criteria:Ie,changeSpec:typeof _!="function"&&_,isAdditionalChunk:0<Ae}).then(function(on){return W(Qe.length,on)})}).then(function(){return(0<dt.length||Ie&&ye)&&J.mutate({trans:z,type:"delete",keys:dt,criteria:Ie,isAdditionalChunk:0<Ae}).then(function(on){return Zi(B.table,dt,on)}).then(function(on){return W(dt.length,on)})}).then(function(){return ve.length>Ae+Ve&&ke(Ae+Ee)})})}var Ie=io(B)&&B.limit===1/0&&(typeof _!="function"||ye)&&{index:B.index,range:B.range};return ke(0).then(function(){if(0<me.length)throw new We("Error modifying one or more objects",me,we,_e);return ve.length})})})},cn.prototype.delete=function(){var _=this._ctx,O=_.range;return!io(_)||_.table.schema.yProps||!_.isPrimKey&&O.type!==3?this.modify(Qo):this._write(function(B){var z=_.table.core.schema.primaryKey,W=O;return _.table.core.count({trans:B,query:{index:z,range:W}}).then(function(G){return _.table.core.mutate({trans:B,type:"deleteRange",range:W}).then(function(be){var te=be.failures,be=be.numFailures;if(be)throw new We("Could not delete some values",Object.keys(te).map(function(Ee){return te[Ee]}),G-be);return G-be})})})};var Ms=cn;function cn(){}var Qo=function(_,O){return O.value=null};function ao(_,O){return _<O?-1:_===O?0:1}function oo(_,O){return O<_?-1:_===O?0:1}function sr(_,O,B){return _=_ instanceof Ba?new _.Collection(_):_,_._ctx.error=new(B||TypeError)(O),_}function Ii(_){return new _.Collection(_,function(){return kr("")}).limit(0)}function Yr(_e,O,B,z){var W,G,J,te,be,Ee,pe,me=B.length;if(!B.every(function(ve){return typeof ve=="string"}))return sr(_e,ko);function we(ve){W=ve==="next"?function(Ie){return Ie.toUpperCase()}:function(Ie){return Ie.toLowerCase()},G=ve==="next"?function(Ie){return Ie.toLowerCase()}:function(Ie){return Ie.toUpperCase()},J=ve==="next"?ao:oo;var ke=B.map(function(Ie){return{lower:G(Ie),upper:W(Ie)}}).sort(function(Ie,Ae){return J(Ie.lower,Ae.lower)});te=ke.map(function(Ie){return Ie.upper}),be=ke.map(function(Ie){return Ie.lower}),pe=(Ee=ve)==="next"?"":z}we("next");var _e=new _e.Collection(_e,function(){return yr(te[0],be[me-1]+z)}),ye=(_e._ondirectionchange=function(ve){we(ve)},0);return _e._addAlgorithm(function(ve,ke,Ie){var Ae=ve.key;if(typeof Ae=="string"){var Ve=G(Ae);if(O(Ve,be,ye))return!0;for(var Je=null,at=ye;at<me;++at){var ut=((Qe,gt,dt,it,vt,vn)=>{for(var on=Math.min(Qe.length,it.length),Bt=-1,sn=0;sn<on;++sn){var Wn=gt[sn];if(Wn!==it[sn])return vt(Qe[sn],dt[sn])<0?Qe.substr(0,sn)+dt[sn]+dt.substr(sn+1):vt(Qe[sn],it[sn])<0?Qe.substr(0,sn)+it[sn]+dt.substr(sn+1):0<=Bt?Qe.substr(0,Bt)+gt[Bt]+dt.substr(Bt+1):null;vt(Qe[sn],Wn)<0&&(Bt=sn)}return on<it.length&&vn==="next"?Qe+dt.substr(Qe.length):on<Qe.length&&vn==="prev"?Qe.substr(0,dt.length):Bt<0?null:Qe.substr(0,Bt)+it[Bt]+dt.substr(Bt+1)})(Ae,Ve,te[at],be[at],J,Ee);ut===null&&Je===null?ye=at+1:(Je===null||0<J(Je,ut))&&(Je=ut)}ke(Je!==null?function(){ve.continue(Je+pe)}:Ie)}return!1}),_e}function yr(_,O,B,z){return{type:2,lower:_,upper:O,lowerOpen:B,upperOpen:z}}function kr(_){return{type:1,lower:_,upper:_}}Object.defineProperty(xt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),xt.prototype.between=function(_,O,B,z){B=B!==!1,z=z===!0;try{return 0<this._cmp(_,O)||this._cmp(_,O)===0&&(B||z)&&(!B||!z)?Ii(this):new this.Collection(this,function(){return yr(_,O,!B,!z)})}catch{return sr(this,jn)}},xt.prototype.equals=function(_){return _==null?sr(this,jn):new this.Collection(this,function(){return kr(_)})},xt.prototype.above=function(_){return _==null?sr(this,jn):new this.Collection(this,function(){return yr(_,void 0,!0)})},xt.prototype.aboveOrEqual=function(_){return _==null?sr(this,jn):new this.Collection(this,function(){return yr(_,void 0,!1)})},xt.prototype.below=function(_){return _==null?sr(this,jn):new this.Collection(this,function(){return yr(void 0,_,!1,!0)})},xt.prototype.belowOrEqual=function(_){return _==null?sr(this,jn):new this.Collection(this,function(){return yr(void 0,_)})},xt.prototype.startsWith=function(_){return typeof _!="string"?sr(this,ko):this.between(_,_+hi,!0,!0)},xt.prototype.startsWithIgnoreCase=function(_){return _===""?this.startsWith(_):Yr(this,function(O,B){return O.indexOf(B[0])===0},[_],hi)},xt.prototype.equalsIgnoreCase=function(_){return Yr(this,function(O,B){return O===B[0]},[_],"")},xt.prototype.anyOfIgnoreCase=function(){var _=ae.apply(Ce,arguments);return _.length===0?Ii(this):Yr(this,function(O,B){return B.indexOf(O)!==-1},_,"")},xt.prototype.startsWithAnyOfIgnoreCase=function(){var _=ae.apply(Ce,arguments);return _.length===0?Ii(this):Yr(this,function(O,B){return B.some(function(z){return O.indexOf(z)===0})},_,hi)},xt.prototype.anyOf=function(){var _,O,B=this,z=ae.apply(Ce,arguments),W=this._cmp;try{z.sort(W)}catch{return sr(this,jn)}return z.length===0?Ii(this):((_=new this.Collection(this,function(){return yr(z[0],z[z.length-1])}))._ondirectionchange=function(G){W=G==="next"?B._ascending:B._descending,z.sort(W)},O=0,_._addAlgorithm(function(G,J,te){for(var be=G.key;0<W(be,z[O]);)if(++O===z.length)return J(te),!1;return W(be,z[O])===0||(J(function(){G.continue(z[O])}),!1)}),_)},xt.prototype.notEqual=function(_){return this.inAnyRange([[-1/0,_],[_,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},xt.prototype.noneOf=function(){var _=ae.apply(Ce,arguments);if(_.length===0)return new this.Collection(this);try{_.sort(this._ascending)}catch{return sr(this,jn)}var O=_.reduce(function(B,z){return B?B.concat([[B[B.length-1][1],z]]):[[-1/0,z]]},null);return O.push([_[_.length-1],this.db._maxKey]),this.inAnyRange(O,{includeLowers:!1,includeUppers:!1})},xt.prototype.inAnyRange=function(_,Ie){var B=this,z=this._cmp,W=this._ascending,G=this._descending,J=this._min,te=this._max;if(_.length===0)return Ii(this);if(!_.every(function(Ae){return Ae[0]!==void 0&&Ae[1]!==void 0&&W(Ae[0],Ae[1])<=0}))return sr(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Fe.InvalidArgument);var be=!Ie||Ie.includeLowers!==!1,Ee=Ie&&Ie.includeUppers===!0,pe,me=W;function we(Ae,Ve){return me(Ae[0],Ve[0])}try{(pe=_.reduce(function(Ae,Ve){for(var Je=0,at=Ae.length;Je<at;++Je){var ut=Ae[Je];if(z(Ve[0],ut[1])<0&&0<z(Ve[1],ut[0])){ut[0]=J(ut[0],Ve[0]),ut[1]=te(ut[1],Ve[1]);break}}return Je===at&&Ae.push(Ve),Ae},[])).sort(we)}catch{return sr(this,jn)}var _e=0,ye=Ee?function(Ae){return 0<W(Ae,pe[_e][1])}:function(Ae){return 0<=W(Ae,pe[_e][1])},ve=be?function(Ae){return 0<G(Ae,pe[_e][0])}:function(Ae){return 0<=G(Ae,pe[_e][0])},ke=ye,Ie=new this.Collection(this,function(){return yr(pe[0][0],pe[pe.length-1][1],!be,!Ee)});return Ie._ondirectionchange=function(Ae){me=Ae==="next"?(ke=ye,W):(ke=ve,G),pe.sort(we)},Ie._addAlgorithm(function(Ae,Ve,Je){for(var at,ut=Ae.key;ke(ut);)if(++_e===pe.length)return Ve(Je),!1;return!ye(at=ut)&&!ve(at)||(B._cmp(ut,pe[_e][1])===0||B._cmp(ut,pe[_e][0])===0||Ve(function(){me===W?Ae.continue(pe[_e][0]):Ae.continue(pe[_e][1])}),!1)}),Ie},xt.prototype.startsWithAnyOf=function(){var _=ae.apply(Ce,arguments);return _.every(function(O){return typeof O=="string"})?_.length===0?Ii(this):this.inAnyRange(_.map(function(O){return[O,O+hi]})):sr(this,"startsWithAnyOf() only works with strings")};var Ba=xt;function xt(){}function gn(_){return An(function(O){return On(O),_(O.target.error),!1})}function On(_){_.stopPropagation&&_.stopPropagation(),_.preventDefault&&_.preventDefault()}var $a="storagemutated",Yi="x-storagemutated-1",Xi=ro(null,$a),Rs=(A.prototype._lock=function(){return D(!Pt.global),++this._reculock,this._reculock!==1||Pt.global||(Pt.lockOwnerFor=this),this},A.prototype._unlock=function(){if(D(!Pt.global),--this._reculock==0)for(Pt.global||(Pt.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var _=this._blockedFuncs.shift();try{Ia(_[1],_[0])}catch{}}return this},A.prototype._locked=function(){return this._reculock&&Pt.lockOwnerFor!==this},A.prototype.create=function(_){var O=this;if(this.mode){var B=this.db.idbdb,z=this.db._state.dbOpenError;if(D(!this.idbtrans),!_&&!B)switch(z&&z.name){case"DatabaseClosedError":throw new Fe.DatabaseClosed(z);case"MissingAPIError":throw new Fe.MissingAPI(z.message,z);default:throw new Fe.OpenFailed(z)}if(!this.active)throw new Fe.TransactionInactive;D(this._completion._state===null),(_=this.idbtrans=_||(this.db.core||B).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=An(function(W){On(W),O._reject(_.error)}),_.onabort=An(function(W){On(W),O.active&&O._reject(new Fe.Abort(_.error)),O.active=!1,O.on("abort").fire(W)}),_.oncomplete=An(function(){O.active=!1,O._resolve(),"mutatedParts"in _&&Xi.storagemutated.fire(_.mutatedParts)})}return this},A.prototype._promise=function(_,O,B){var z,W=this;return _==="readwrite"&&this.mode!=="readwrite"?nr(new Fe.ReadOnly("Transaction is readonly")):this.active?this._locked()?new ht(function(G,J){W._blockedFuncs.push([function(){W._promise(_,O,B).then(G,J)},Pt])}):B?Hi(function(){var G=new ht(function(J,te){W._lock();var be=O(J,te,W);be&&be.then&&be.then(J,te)});return G.finally(function(){return W._unlock()}),G._lib=!0,G}):((z=new ht(function(G,J){var te=O(G,J,W);te&&te.then&&te.then(G,J)}))._lib=!0,z):nr(new Fe.TransactionInactive)},A.prototype._root=function(){return this.parent?this.parent._root():this},A.prototype.waitFor=function(_){var O,B=this._root(),z=ht.resolve(_),W=(B._waitingFor?B._waitingFor=B._waitingFor.then(function(){return z}):(B._waitingFor=z,B._waitingQueue=[],O=B.idbtrans.objectStore(B.storeNames[0]),(function G(){for(++B._spinCount;B._waitingQueue.length;)B._waitingQueue.shift()();B._waitingFor&&(O.get(-1/0).onsuccess=G)})()),B._waitingFor);return new ht(function(G,J){z.then(function(te){return B._waitingQueue.push(An(G.bind(null,te)))},function(te){return B._waitingQueue.push(An(J.bind(null,te)))}).finally(function(){B._waitingFor===W&&(B._waitingFor=null)})})},A.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Fe.Abort))},A.prototype.table=function(_){var O=this._memoizedTables||(this._memoizedTables={});if(m(O,_))return O[_];var B=this.schema[_];if(B)return(B=new this.db.Table(_,B,this)).core=this.db.core.table(_),O[_]=B;throw new Fe.NotFound("Table "+_+" not part of transaction")},A);function A(){}function q(_,O,B,z,W,G,J,te){return{name:_,keyPath:O,unique:B,multi:z,auto:W,compound:G,src:(B&&!J?"&":"")+(z?"*":"")+(W?"++":"")+H(O),type:te}}function H(_){return typeof _=="string"?_:_?"["+[].join.call(_,"+")+"]":""}function X(_,O,B){return{name:_,primKey:O,indexes:B,mappedClass:null,idxByName:(z=function(W){return[W.name,W]},B.reduce(function(W,G,J){return G=z(G,J),G&&(W[G[0]]=G[1]),W},{}))};var z}var xe=function(_){try{return _.only([[]]),xe=function(){return[[]]},[[]]}catch{return xe=function(){return hi},hi}};function Le(_){return _==null?function(){}:typeof _=="string"?(O=_).split(".").length===1?function(B){return B[O]}:function(B){return R(B,O)}:function(B){return R(B,_)};var O}function Ge(_){return[].slice.call(_)}var zt=0;function Sn(_){return _==null?":id":typeof _=="string"?_:"[".concat(_.join("+"),"]")}function Zt(_,O,be){function z(ye){if(ye.type===3)return null;if(ye.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var me=ye.lower,we=ye.upper,_e=ye.lowerOpen,ye=ye.upperOpen;return me===void 0?we===void 0?null:O.upperBound(we,!!ye):we===void 0?O.lowerBound(me,!!_e):O.bound(me,we,!!_e,!!ye)}function W(pe){var me,we=pe.name;return{name:we,schema:pe,mutate:function(_e){var ye=_e.trans,ve=_e.type,ke=_e.keys,Ie=_e.values,Ae=_e.range;return new Promise(function(Ve,Je){Ve=An(Ve);var at=ye.objectStore(we),ut=at.keyPath==null,Qe=ve==="put"||ve==="add";if(!Qe&&ve!=="delete"&&ve!=="deleteRange")throw new Error("Invalid operation type: "+ve);var gt,dt=(ke||Ie||{length:1}).length;if(ke&&Ie&&ke.length!==Ie.length)throw new Error("Given keys array must have same length as given values array.");if(dt===0)return Ve({numFailures:0,failures:{},results:[],lastResult:void 0});function it(En){++on,On(En)}var vt=[],vn=[],on=0;if(ve==="deleteRange"){if(Ae.type===4)return Ve({numFailures:on,failures:vn,results:[],lastResult:void 0});Ae.type===3?vt.push(gt=at.clear()):vt.push(gt=at.delete(z(Ae)))}else{var ut=Qe?ut?[Ie,ke]:[Ie,null]:[ke,null],Bt=ut[0],sn=ut[1];if(Qe)for(var Wn=0;Wn<dt;++Wn)vt.push(gt=sn&&sn[Wn]!==void 0?at[ve](Bt[Wn],sn[Wn]):at[ve](Bt[Wn])),gt.onerror=it;else for(Wn=0;Wn<dt;++Wn)vt.push(gt=at[ve](Bt[Wn])),gt.onerror=it}function ea(En){En=En.target.result,vt.forEach(function(ta,wl){return ta.error!=null&&(vn[wl]=ta.error)}),Ve({numFailures:on,failures:vn,results:ve==="delete"?ke:vt.map(function(ta){return ta.result}),lastResult:En})}gt.onerror=function(En){it(En),ea(En)},gt.onsuccess=ea})},getMany:function(_e){var ye=_e.trans,ve=_e.keys;return new Promise(function(ke,Ie){ke=An(ke);for(var Ae,Ve=ye.objectStore(we),Je=ve.length,at=new Array(Je),ut=0,Qe=0,gt=function(vt){vt=vt.target,at[vt._pos]=vt.result,++Qe===ut&&ke(at)},dt=gn(Ie),it=0;it<Je;++it)ve[it]!=null&&((Ae=Ve.get(ve[it]))._pos=it,Ae.onsuccess=gt,Ae.onerror=dt,++ut);ut===0&&ke(at)})},get:function(_e){var ye=_e.trans,ve=_e.key;return new Promise(function(ke,Ie){ke=An(ke);var Ae=ye.objectStore(we).get(ve);Ae.onsuccess=function(Ve){return ke(Ve.target.result)},Ae.onerror=gn(Ie)})},query:(me=te,function(_e){return new Promise(function(ye,ve){ye=An(ye);var ke,Ie,Ae,Qe=_e.trans,Ve=_e.values,Je=_e.limit,ut=_e.query,at=Je===1/0?void 0:Je,gt=ut.index,ut=ut.range,Qe=Qe.objectStore(we),Qe=gt.isPrimaryKey?Qe:Qe.index(gt.name),gt=z(ut);if(Je===0)return ye({result:[]});me?((ut=Ve?Qe.getAll(gt,at):Qe.getAllKeys(gt,at)).onsuccess=function(dt){return ye({result:dt.target.result})},ut.onerror=gn(ve)):(ke=0,Ie=!Ve&&"openKeyCursor"in Qe?Qe.openKeyCursor(gt):Qe.openCursor(gt),Ae=[],Ie.onsuccess=function(dt){var it=Ie.result;return!it||(Ae.push(Ve?it.value:it.primaryKey),++ke===Je)?ye({result:Ae}):void it.continue()},Ie.onerror=gn(ve))})}),openCursor:function(_e){var ye=_e.trans,ve=_e.values,ke=_e.query,Ie=_e.reverse,Ae=_e.unique;return new Promise(function(Ve,Je){Ve=An(Ve);var Qe=ke.index,at=ke.range,ut=ye.objectStore(we),ut=Qe.isPrimaryKey?ut:ut.index(Qe.name),Qe=Ie?Ae?"prevunique":"prev":Ae?"nextunique":"next",gt=!ve&&"openKeyCursor"in ut?ut.openKeyCursor(z(at),Qe):ut.openCursor(z(at),Qe);gt.onerror=gn(Je),gt.onsuccess=An(function(dt){var it,vt,vn,on,Bt=gt.result;Bt?(Bt.___id=++zt,Bt.done=!1,it=Bt.continue.bind(Bt),vt=(vt=Bt.continuePrimaryKey)&&vt.bind(Bt),vn=Bt.advance.bind(Bt),on=function(){throw new Error("Cursor not stopped")},Bt.trans=ye,Bt.stop=Bt.continue=Bt.continuePrimaryKey=Bt.advance=function(){throw new Error("Cursor not started")},Bt.fail=An(Je),Bt.next=function(){var sn=this,Wn=1;return this.start(function(){return Wn--?sn.continue():sn.stop()}).then(function(){return sn})},Bt.start=function(sn){function Wn(){if(gt.result)try{sn()}catch(En){Bt.fail(En)}else Bt.done=!0,Bt.start=function(){throw new Error("Cursor behind last entry")},Bt.stop()}var ea=new Promise(function(En,ta){En=An(En),gt.onerror=gn(ta),Bt.fail=ta,Bt.stop=function(wl){Bt.stop=Bt.continue=Bt.continuePrimaryKey=Bt.advance=on,En(wl)}});return gt.onsuccess=An(function(En){gt.onsuccess=Wn,Wn()}),Bt.continue=it,Bt.continuePrimaryKey=vt,Bt.advance=vn,Wn(),ea},Ve(Bt)):Ve(null)},Je)})},count:function(_e){var ye=_e.query,ve=_e.trans,ke=ye.index,Ie=ye.range;return new Promise(function(Ae,Ve){var Je=ve.objectStore(we),Je=ke.isPrimaryKey?Je:Je.index(ke.name),at=z(Ie),at=at?Je.count(at):Je.count();at.onsuccess=An(function(ut){return Ae(ut.target.result)}),at.onerror=gn(Ve)})}}}G=be,J=Ge((be=_).objectStoreNames);var G,be={schema:{name:be.name,tables:J.map(function(pe){return G.objectStore(pe)}).map(function(pe){var me=pe.keyPath,we=pe.autoIncrement,ye=s(me),_e={},ye={name:pe.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:me==null,compound:ye,keyPath:me,autoIncrement:we,unique:!0,extractKey:Le(me)},indexes:Ge(pe.indexNames).map(function(ve){return pe.index(ve)}).map(function(Ae){var Ve=Ae.name,ke=Ae.unique,Ie=Ae.multiEntry,Ae=Ae.keyPath,Ve={name:Ve,compound:s(Ae),keyPath:Ae,unique:ke,multiEntry:Ie,extractKey:Le(Ae)};return _e[Sn(Ae)]=Ve}),getIndexByKeyPath:function(ve){return _e[Sn(ve)]}};return _e[":id"]=ye.primaryKey,me!=null&&(_e[Sn(me)]=ye.primaryKey),ye})},hasGetAll:0<J.length&&"getAll"in G.objectStore(J[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)},J=be.schema,te=be.hasGetAll,be=J.tables.map(W),Ee={};return be.forEach(function(pe){return Ee[pe.name]=pe}),{stack:"dbcore",transaction:_.transaction.bind(_),table:function(pe){if(Ee[pe])return Ee[pe];throw new Error("Table '".concat(pe,"' not found"))},MIN_KEY:-1/0,MAX_KEY:xe(O),schema:J}}function Ln(_,O,B,z){return B=B.IDBKeyRange,O=Zt(O,B,z),{dbcore:_.dbcore.reduce(function(W,G){return G=G.create,r(r({},W),G(W))},O)}}function Jn(_,O){var B=O.db,B=Ln(_._middlewares,B,_._deps,O);_.core=B.dbcore,_.tables.forEach(function(z){var W=z.name;_.core.schema.tables.some(function(G){return G.name===W})&&(z.core=_.core.table(W),_[W]instanceof _.Table)&&(_[W].core=z.core)})}function rn(_,O,B,z){B.forEach(function(W){var G=z[W];O.forEach(function(J){var te=(function be(Ee,pe){return w(Ee,pe)||(Ee=d(Ee))&&be(Ee,pe)})(J,W);(!te||"value"in te&&te.value===void 0)&&(J===_.Transaction.prototype||J instanceof _.Transaction?P(J,W,{get:function(){return this.table(W)},set:function(be){b(this,W,{value:be,writable:!0,configurable:!0,enumerable:!0})}}):J[W]=new _.Table(W,G))})})}function ga(_,O){O.forEach(function(B){for(var z in B)B[z]instanceof _.Table&&delete B[z]})}function ii(_,O){return _._cfg.version-O._cfg.version}function so(_,O,B,z){var W=_._dbSchema,G=(B.objectStoreNames.contains("$meta")&&!W.$meta&&(W.$meta=X("$meta",uo("")[0],[]),_._storeNames.push("$meta")),_._createTransaction("readwrite",_._storeNames,W)),J=(G.create(B),G._completion.catch(z),G._reject.bind(G)),te=Pt.transless||Pt;Hi(function(){if(Pt.trans=G,Pt.transless=te,O!==0)return Jn(_,B),Ee=O,((be=G).storeNames.includes("$meta")?be.table("$meta").get("version").then(function(pe){return pe??Ee}):ht.resolve(Ee)).then(function(ke){var me=_,we=ke,_e=G,ye=B,ve=[],ke=me._versions,Ie=me._dbSchema=Fa(0,me.idbdb,ye);return(ke=ke.filter(function(Ae){return Ae._cfg.version>=we})).length===0?ht.resolve():(ke.forEach(function(Ae){ve.push(function(){var Ve,Je,at,ut=Ie,Qe=Ae._cfg.dbschema,gt=(es(me,ut,ye),es(me,Qe,ye),Ie=me._dbSchema=Qe,Jo(ut,Qe)),dt=(gt.add.forEach(function(it){lo(ye,it[0],it[1].primKey,it[1].indexes)}),gt.change.forEach(function(it){if(it.recreate)throw new Fe.Upgrade("Not yet support for changing primary key");var vt=ye.objectStore(it.name);it.add.forEach(function(vn){return Cr(vt,vn)}),it.change.forEach(function(vn){vt.deleteIndex(vn.name),Cr(vt,vn)}),it.del.forEach(function(vn){return vt.deleteIndex(vn)})}),Ae._cfg.contentUpgrade);if(dt&&Ae._cfg.version>we)return Jn(me,ye),_e._memoizedTables={},Ve=V(Qe),gt.del.forEach(function(it){Ve[it]=ut[it]}),ga(me,[me.Transaction.prototype]),rn(me,[me.Transaction.prototype],o(Ve),Ve),_e.schema=Ve,(Je=ie(dt))&&La(),Qe=ht.follow(function(){var it;(at=dt(_e))&&Je&&(it=Sr.bind(null,null),at.then(it,it))}),at&&typeof at.then=="function"?ht.resolve(at):Qe.then(function(){return at})}),ve.push(function(Ve){var Je,at,ut=Ae._cfg.dbschema;Je=ut,at=Ve,[].slice.call(at.db.objectStoreNames).forEach(function(Qe){return Je[Qe]==null&&at.db.deleteObjectStore(Qe)}),ga(me,[me.Transaction.prototype]),rn(me,[me.Transaction.prototype],me._storeNames,me._dbSchema),_e.schema=me._dbSchema}),ve.push(function(Ve){me.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(me.idbdb.version/10)===Ae._cfg.version?(me.idbdb.deleteObjectStore("$meta"),delete me._dbSchema.$meta,me._storeNames=me._storeNames.filter(function(Je){return Je!=="$meta"})):Ve.objectStore("$meta").put(Ae._cfg.version,"version"))})}),(function Ae(){return ve.length?ht.resolve(ve.shift()(_e.idbtrans)).then(Ae):ht.resolve()})().then(function(){Xl(Ie,ye)}))}).catch(J);var be,Ee;o(W).forEach(function(pe){lo(B,pe,W[pe].primKey,W[pe].indexes)}),Jn(_,B),ht.follow(function(){return _.on.populate.fire(G)}).catch(J)})}function yl(_,O){Xl(_._dbSchema,O),O.db.version%10!=0||O.objectStoreNames.contains("$meta")||O.db.createObjectStore("$meta").add(Math.ceil(O.db.version/10-1),"version");var B=Fa(0,_.idbdb,O);es(_,_._dbSchema,O);for(var z=0,W=Jo(B,_._dbSchema).change;z<W.length;z++){var G=(J=>{if(J.change.length||J.recreate)return console.warn("Unable to patch indexes of table ".concat(J.name," because it has changes on the type of index or primary key.")),{value:void 0};var te=O.objectStore(J.name);J.add.forEach(function(be){Bn&&console.debug("Dexie upgrade patch: Creating missing index ".concat(J.name,".").concat(be.src)),Cr(te,be)})})(W[z]);if(typeof G=="object")return G.value}}function Jo(_,O){var B,z={del:[],add:[],change:[]};for(B in _)O[B]||z.del.push(B);for(B in O){var W=_[B],G=O[B];if(W){var J={name:B,def:G,recreate:!1,del:[],add:[],change:[]};if(""+(W.primKey.keyPath||"")!=""+(G.primKey.keyPath||"")||W.primKey.auto!==G.primKey.auto)J.recreate=!0,z.change.push(J);else{var te=W.idxByName,be=G.idxByName,Ee=void 0;for(Ee in te)be[Ee]||J.del.push(Ee);for(Ee in be){var pe=te[Ee],me=be[Ee];pe?pe.src!==me.src&&J.change.push(me):J.add.push(me)}(0<J.del.length||0<J.add.length||0<J.change.length)&&z.change.push(J)}}else z.add.push([B,G])}return z}function lo(_,O,B,z){var W=_.db.createObjectStore(O,B.keyPath?{keyPath:B.keyPath,autoIncrement:B.auto}:{autoIncrement:B.auto});z.forEach(function(G){return Cr(W,G)})}function Xl(_,O){o(_).forEach(function(B){O.db.objectStoreNames.contains(B)||(Bn&&console.debug("Dexie: Creating missing table",B),lo(O,B,_[B].primKey,_[B].indexes))})}function Cr(_,O){_.createIndex(O.name,O.keyPath,{unique:O.unique,multiEntry:O.multi})}function Fa(_,O,B){var z={};return E(O.objectStoreNames,0).forEach(function(W){for(var G=B.objectStore(W),J=q(H(Ee=G.keyPath),Ee||"",!0,!1,!!G.autoIncrement,Ee&&typeof Ee!="string",!0),te=[],be=0;be<G.indexNames.length;++be){var pe=G.index(G.indexNames[be]),Ee=pe.keyPath,pe=q(pe.name,Ee,!!pe.unique,!!pe.multiEntry,!1,Ee&&typeof Ee!="string",!1);te.push(pe)}z[W]=X(W,J,te)}),z}function es(_,O,B){for(var z=B.db.objectStoreNames,W=0;W<z.length;++W){var G=z[W],J=B.objectStore(G);_._hasGetAll="getAll"in J;for(var te=0;te<J.indexNames.length;++te){var be,Ee=J.indexNames[te],pe=J.index(Ee).keyPath,pe=typeof pe=="string"?pe:"["+E(pe).join("+")+"]";O[G]&&(be=O[G].idxByName[pe])&&(be.name=Ee,delete O[G].idxByName[pe],O[G].idxByName[Ee]=be)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(_._hasGetAll=!1)}function uo(_){return _.split(",").map(function(O,B){var W=O.split(":"),z=(z=W[1])==null?void 0:z.trim(),W=(O=W[0].trim()).replace(/([&*]|\+\+)/g,""),G=/^\[/.test(W)?W.match(/^\[(.*)\]$/)[1].split("+"):W;return q(W,G||null,/\&/.test(O),/\*/.test(O),/\+\+/.test(O),s(G),B===0,z)})}Pr.prototype._createTableSchema=X,Pr.prototype._parseIndexSyntax=uo,Pr.prototype._parseStoresSpec=function(_,O){var B=this;o(_).forEach(function(z){if(_[z]!==null){var W=B._parseIndexSyntax(_[z]),G=W.shift();if(!G)throw new Fe.Schema("Invalid schema for table "+z+": "+_[z]);if(G.unique=!0,G.multi)throw new Fe.Schema("Primary key cannot be multiEntry*");W.forEach(function(J){if(J.auto)throw new Fe.Schema("Only primary key can be marked as autoIncrement (++)");if(!J.keyPath)throw new Fe.Schema("Index must have a name and cannot be an empty string")}),G=B._createTableSchema(z,G,W),O[z]=G}})},Pr.prototype.stores=function(B){var O=this.db,B=(this._cfg.storesSource=this._cfg.storesSource?c(this._cfg.storesSource,B):B,O._versions),z={},W={};return B.forEach(function(G){c(z,G._cfg.storesSource),W=G._cfg.dbschema={},G._parseStoresSpec(z,W)}),O._dbSchema=W,ga(O,[O._allTables,O,O.Transaction.prototype]),rn(O,[O._allTables,O,O.Transaction.prototype,this._cfg.tables],o(W),W),O._storeNames=o(W),this},Pr.prototype.upgrade=function(_){return this._cfg.contentUpgrade=$r(this._cfg.contentUpgrade||Te,_),this};var Jc=Pr;function Pr(){}function Ls(_,O){var B=_._dbNamesDB;return B||(B=_._dbNamesDB=new Ro(Yo,{addons:[],indexedDB:_,IDBKeyRange:O})).version(1).stores({dbnames:"name"}),B.table("dbnames")}function co(_){return _&&typeof _.databases=="function"}function vi(_){return Hi(function(){return Pt.letThrough=!0,_()})}function Is(_){return!("from"in _)}var Nr=function(_,O){var B;if(!this)return B=new Nr,_&&"d"in _&&c(B,_),B;c(this,arguments.length?{d:1,from:_,to:1<arguments.length?O:_}:{d:0})};function Mo(_,O,B){var z=ft(O,B);if(!isNaN(z)){if(0<z)throw RangeError();if(Is(_))return c(_,{from:O,to:B,d:1});var z=_.l,W=_.r;if(ft(B,_.from)<0)return z?Mo(z,O,B):_.l={from:O,to:B,d:1,l:null,r:null},Fu(_);if(0<ft(O,_.to))return W?Mo(W,O,B):_.r={from:O,to:B,d:1,l:null,r:null},Fu(_);ft(O,_.from)<0&&(_.from=O,_.l=null,_.d=W?W.d+1:1),0<ft(B,_.to)&&(_.to=B,_.r=null,_.d=_.l?_.l.d+1:1),O=!_.r,z&&!_.l&&Ds(_,z),W&&O&&Ds(_,W)}}function Ds(_,O){Is(O)||(function B(z,W){var G=W.from,J=W.l,te=W.r;Mo(z,G,W.to),J&&B(z,J),te&&B(z,te)})(_,O)}function ts(_,O){var B=Bs(O),z=B.next();if(!z.done)for(var W=z.value,G=Bs(_),J=G.next(W.from),te=J.value;!z.done&&!J.done;){if(ft(te.from,W.to)<=0&&0<=ft(te.to,W.from))return!0;ft(W.from,te.from)<0?W=(z=B.next(te.from)).value:te=(J=G.next(W.from)).value}return!1}function Bs(_){var O=Is(_)?null:{s:0,n:_};return{next:function(B){for(var z=0<arguments.length;O;)switch(O.s){case 0:if(O.s=1,z)for(;O.n.l&&ft(B,O.n.from)<0;)O={up:O,n:O.n.l,s:1};else for(;O.n.l;)O={up:O,n:O.n.l,s:1};case 1:if(O.s=2,!z||ft(B,O.n.to)<=0)return{value:O.n,done:!1};case 2:if(O.n.r){O.s=3,O={up:O,n:O.n.r,s:0};continue}case 3:O=O.up}return{done:!0}}}}function Fu(_){var O,B,z,W=(((W=_.r)==null?void 0:W.d)||0)-(((W=_.l)==null?void 0:W.d)||0),W=1<W?"r":W<-1?"l":"";W&&(O=W=="r"?"l":"r",B=r({},_),z=_[W],_.from=z.from,_.to=z.to,_[W]=z[W],B[W]=z[O],(_[O]=B).d=qu(B)),_.d=qu(_)}function qu(B){var O=B.r,B=B.l;return(O?B?Math.max(O.d,B.d):O.d:B?B.d:0)+1}function ns(_,O){return o(O).forEach(function(B){_[B]?Ds(_[B],O[B]):_[B]=(function z(W){var G,J,te={};for(G in W)m(W,G)&&(J=W[G],te[G]=!J||typeof J!="object"||ee.has(J.constructor)?J:z(J));return te})(O[B])}),_}function Ql(_,O){return _.all||O.all||Object.keys(_).some(function(B){return O[B]&&ts(O[B],_[B])})}y(Nr.prototype,((Fr={add:function(_){return Ds(this,_),this},addKey:function(_){return Mo(this,_,_),this},addKeys:function(_){var O=this;return _.forEach(function(B){return Mo(O,B,B)}),this},hasKey:function(_){var O=Bs(this).next(_).value;return O&&ft(O.from,_)<=0&&0<=ft(O.to,_)}})[fe]=function(){return Bs(this)},Fr));var qa={},$s={},rs=!1;function va(_){ns($s,_),rs||(rs=!0,setTimeout(function(){rs=!1,Jl($s,!($s={}))},0))}function Jl(_,O){O===void 0&&(O=!1);var B=new Set;if(_.all)for(var z=0,W=Object.values(qa);z<W.length;z++)Qi(te=W[z],_,B,O);else for(var G in _){var J,te,G=/^idb\:\/\/(.*)\/(.*)\//.exec(G);G&&(J=G[1],G=G[2],te=qa["idb://".concat(J,"/").concat(G)])&&Qi(te,_,B,O)}B.forEach(function(be){return be()})}function Qi(_,O,B,z){for(var W=[],G=0,J=Object.entries(_.queries.query);G<J.length;G++){for(var te=J[G],be=te[0],Ee=[],pe=0,me=te[1];pe<me.length;pe++){var we=me[pe];Ql(O,we.obsSet)?we.subscribers.forEach(function(ke){return B.add(ke)}):z&&Ee.push(we)}z&&W.push([be,Ee])}if(z)for(var _e=0,ye=W;_e<ye.length;_e++){var ve=ye[_e],be=ve[0],Ee=ve[1];_.queries.query[be]=Ee}}function yi(_){var O=_._state,B=_._deps.indexedDB;if(O.isBeingOpened||_.idbdb)return O.dbReadyPromise.then(function(){return O.dbOpenError?nr(O.dbOpenError):_});O.isBeingOpened=!0,O.dbOpenError=null,O.openComplete=!1;var z=O.openCanceller,W=Math.round(10*_.verno),G=!1;function J(){if(O.openCanceller!==z)throw new Fe.DatabaseClosed("db.open() was cancelled")}function te(){return new ht(function(we,_e){if(J(),!B)throw new Fe.MissingAPI;var ye=_.name,ve=O.autoSchema||!W?B.open(ye):B.open(ye,W);if(!ve)throw new Fe.MissingAPI;ve.onerror=gn(_e),ve.onblocked=An(_._fireOnBlocked),ve.onupgradeneeded=An(function(ke){var Ie;pe=ve.transaction,O.autoSchema&&!_._options.allowEmptyDB?(ve.onerror=On,pe.abort(),ve.result.close(),(Ie=B.deleteDatabase(ye)).onsuccess=Ie.onerror=An(function(){_e(new Fe.NoSuchDatabase("Database ".concat(ye," doesnt exist")))})):(pe.onerror=gn(_e),Ie=ke.oldVersion>Math.pow(2,62)?0:ke.oldVersion,me=Ie<1,_.idbdb=ve.result,G&&yl(_,pe),so(_,Ie/10,pe,_e))},_e),ve.onsuccess=An(function(){pe=null;var ke,Ie,Ae,Ve,Je,at,ut=_.idbdb=ve.result,Qe=E(ut.objectStoreNames);if(0<Qe.length)try{var gt=ut.transaction((Je=Qe).length===1?Je[0]:Je,"readonly");if(O.autoSchema)at=ut,Ve=gt,(Ae=_).verno=at.version/10,Ve=Ae._dbSchema=Fa(0,at,Ve),Ae._storeNames=E(at.objectStoreNames,0),rn(Ae,[Ae._allTables],o(Ve),Ve);else if(es(_,_._dbSchema,gt),Ie=gt,((Ie=Jo(Fa(0,(ke=_).idbdb,Ie),ke._dbSchema)).add.length||Ie.change.some(function(dt){return dt.add.length||dt.change.length}))&&!G)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ut.close(),W=ut.version+1,G=!0,we(te());Jn(_,gt)}catch{}pa.push(_),ut.onversionchange=An(function(dt){O.vcFired=!0,_.on("versionchange").fire(dt)}),ut.onclose=An(function(){_.close({disableAutoOpen:!1})}),me&&(Qe=_._deps,Je=ye,co(at=Qe.indexedDB)||Je===Yo||Ls(at,Qe.IDBKeyRange).put({name:Je}).catch(Te)),we()},_e)}).catch(function(we){switch(we==null?void 0:we.name){case"UnknownError":if(0<O.PR1398_maxLoop)return O.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),te();break;case"VersionError":if(0<W)return W=0,te()}return ht.reject(we)})}var be,Ee=O.dbReadyResolve,pe=null,me=!1;return ht.race([z,(typeof navigator>"u"?ht.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(we){function _e(){return indexedDB.databases().finally(we)}be=setInterval(_e,100),_e()}).finally(function(){return clearInterval(be)}):Promise.resolve()).then(te)]).then(function(){return J(),O.onReadyBeingFired=[],ht.resolve(vi(function(){return _.on.ready.fire(_.vip)})).then(function we(){var _e;if(0<O.onReadyBeingFired.length)return _e=O.onReadyBeingFired.reduce($r,Te),O.onReadyBeingFired=[],ht.resolve(vi(function(){return _e(_.vip)})).then(we)})}).finally(function(){O.openCanceller===z&&(O.onReadyBeingFired=null,O.isBeingOpened=!1)}).catch(function(we){O.dbOpenError=we;try{pe&&pe.abort()}catch{}return z===O.openCanceller&&_._close(),nr(we)}).finally(function(){O.openComplete=!0,Ee()}).then(function(){var we;return me&&(we={},_.tables.forEach(function(_e){_e.schema.indexes.forEach(function(ye){ye.name&&(we["idb://".concat(_.name,"/").concat(_e.name,"/").concat(ye.name)]=new Nr(-1/0,[[[]]]))}),we["idb://".concat(_.name,"/").concat(_e.name,"/")]=we["idb://".concat(_.name,"/").concat(_e.name,"/:dels")]=new Nr(-1/0,[[[]]])}),Xi($a).fire(we),Jl(we,!0)),_})}function Fs(_){function O(G){return _.next(G)}var B=W(O),z=W(function(G){return _.throw(G)});function W(G){return function(te){var te=G(te),be=te.value;return te.done?be:be&&typeof be.then=="function"?be.then(B,z):s(be)?Promise.all(be).then(B,z):B(be)}}return W(O)()}function is(_,O,B){for(var z=s(_)?_.slice():[_],W=0;W<B;++W)z.push(O);return z}var Ne={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(_){return r(r({},_),{table:function(z){var B=_.table(z),z=B.schema,W={},G=[];function J(we,_e,ye){var Ae=Sn(we),ve=W[Ae]=W[Ae]||[],ke=we==null?0:typeof we=="string"?1:we.length,Ie=0<_e,Ae=r(r({},ye),{name:Ie?"".concat(Ae,"(virtual-from:").concat(ye.name,")"):ye.name,lowLevelIndex:ye,isVirtual:Ie,keyTail:_e,keyLength:ke,extractKey:Le(we),unique:!Ie&&ye.unique});return ve.push(Ae),Ae.isPrimaryKey||G.push(Ae),1<ke&&J(ke===2?we[0]:we.slice(0,ke-1),_e+1,ye),ve.sort(function(Ve,Je){return Ve.keyTail-Je.keyTail}),Ae}var te=J(z.primaryKey.keyPath,0,z.primaryKey);W[":id"]=[te];for(var be=0,Ee=z.indexes;be<Ee.length;be++){var pe=Ee[be];J(pe.keyPath,0,pe)}function me(we){var _e,ye=we.query.index;return ye.isVirtual?r(r({},we),{query:{index:ye.lowLevelIndex,range:(_e=we.query.range,ye=ye.keyTail,{type:_e.type===1?2:_e.type,lower:is(_e.lower,_e.lowerOpen?_.MAX_KEY:_.MIN_KEY,ye),lowerOpen:!0,upper:is(_e.upper,_e.upperOpen?_.MIN_KEY:_.MAX_KEY,ye),upperOpen:!0})}}):we}return r(r({},B),{schema:r(r({},z),{primaryKey:te,indexes:G,getIndexByKeyPath:function(we){return(we=W[Sn(we)])&&we[0]}}),count:function(we){return B.count(me(we))},query:function(we){return B.query(me(we))},openCursor:function(we){var _e=we.query.index,ye=_e.keyTail,ve=_e.keyLength;return _e.isVirtual?B.openCursor(me(we)).then(function(Ie){return Ie&&ke(Ie)}):B.openCursor(we);function ke(Ie){return Object.create(Ie,{continue:{value:function(Ae){Ae!=null?Ie.continue(is(Ae,we.reverse?_.MAX_KEY:_.MIN_KEY,ye)):we.unique?Ie.continue(Ie.key.slice(0,ve).concat(we.reverse?_.MIN_KEY:_.MAX_KEY,ye)):Ie.continue()}},continuePrimaryKey:{value:function(Ae,Ve){Ie.continuePrimaryKey(is(Ae,_.MAX_KEY,ye),Ve)}},primaryKey:{get:function(){return Ie.primaryKey}},key:{get:function(){var Ae=Ie.key;return ve===1?Ae[0]:Ae.slice(0,ve)}},value:{get:function(){return Ie.value}}})}}})}})}};function Ze(_,O,B,z){return B=B||{},z=z||"",o(_).forEach(function(W){var G,J,te;m(O,W)?(G=_[W],J=O[W],typeof G=="object"&&typeof J=="object"&&G&&J?(te=Se(G))!==Se(J)?B[z+W]=O[W]:te==="Object"?Ze(G,J,B,z+W+"."):G!==J&&(B[z+W]=O[W]):G!==J&&(B[z+W]=O[W])):B[z+W]=void 0}),o(O).forEach(function(W){m(_,W)||(B[z+W]=O[W])}),B}function jt(_,O){return O.type==="delete"?O.keys:O.keys||O.values.map(_.extractKey)}var $t={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(_){return r(r({},_),{table:function(O){var B=_.table(O),z=B.schema.primaryKey;return r(r({},B),{mutate:function(W){var G=Pt.trans,J=G.table(O).hook,te=J.deleting,be=J.creating,Ee=J.updating;switch(W.type){case"add":if(be.fire===Te)break;return G._promise("readwrite",function(){return pe(W)},!0);case"put":if(be.fire===Te&&Ee.fire===Te)break;return G._promise("readwrite",function(){return pe(W)},!0);case"delete":if(te.fire===Te)break;return G._promise("readwrite",function(){return pe(W)},!0);case"deleteRange":if(te.fire===Te)break;return G._promise("readwrite",function(){return(function me(we,_e,ye){return B.query({trans:we,values:!1,query:{index:z,range:_e},limit:ye}).then(function(ve){var ke=ve.result;return pe({type:"delete",keys:ke,trans:we}).then(function(Ie){return 0<Ie.numFailures?Promise.reject(Ie.failures[0]):ke.length<ye?{failures:[],numFailures:0,lastResult:void 0}:me(we,r(r({},_e),{lower:ke[ke.length-1],lowerOpen:!0}),ye)})})})(W.trans,W.range,1e4)},!0)}return B.mutate(W);function pe(me){var we,_e,ye,ve=Pt.trans,ke=me.keys||jt(z,me);if(ke)return(me=me.type==="add"||me.type==="put"?r(r({},me),{keys:ke}):r({},me)).type!=="delete"&&(me.values=i([],me.values)),me.keys&&(me.keys=i([],me.keys)),we=B,ye=ke,((_e=me).type==="add"?Promise.resolve([]):we.getMany({trans:_e.trans,keys:ye,cache:"immutable"})).then(function(Ie){var Ae=ke.map(function(Ve,Je){var at,ut,Qe,gt=Ie[Je],dt={onerror:null,onsuccess:null};return me.type==="delete"?te.fire.call(dt,Ve,gt,ve):me.type==="add"||gt===void 0?(at=be.fire.call(dt,Ve,me.values[Je],ve),Ve==null&&at!=null&&(me.keys[Je]=Ve=at,z.outbound||$(me.values[Je],z.keyPath,Ve))):(at=Ze(gt,me.values[Je]),(ut=Ee.fire.call(dt,at,Ve,gt,ve))&&(Qe=me.values[Je],Object.keys(ut).forEach(function(it){m(Qe,it)?Qe[it]=ut[it]:$(Qe,it,ut[it])}))),dt});return B.mutate(me).then(function(Ve){for(var Je=Ve.failures,at=Ve.results,ut=Ve.numFailures,Ve=Ve.lastResult,Qe=0;Qe<ke.length;++Qe){var gt=(at||ke)[Qe],dt=Ae[Qe];gt==null?dt.onerror&&dt.onerror(Je[Qe]):dt.onsuccess&&dt.onsuccess(me.type==="put"&&Ie[Qe]?me.values[Qe]:gt)}return{failures:Je,results:at,numFailures:ut,lastResult:Ve}}).catch(function(Ve){return Ae.forEach(function(Je){return Je.onerror&&Je.onerror(Ve)}),Promise.reject(Ve)})});throw new Error("Keys missing")}}})}})}};function an(_,O,B){try{if(!O||O.keys.length<_.length)return null;for(var z=[],W=0,G=0;W<O.keys.length&&G<_.length;++W)ft(O.keys[W],_[G])===0&&(z.push(B?oe(O.values[W]):O.values[W]),++G);return z.length===_.length?z:null}catch{return null}}var Tn={stack:"dbcore",level:-1,create:function(_){return{table:function(O){var B=_.table(O);return r(r({},B),{getMany:function(z){var W;return z.cache?(W=an(z.keys,z.trans._cache,z.cache==="clone"))?ht.resolve(W):B.getMany(z).then(function(G){return z.trans._cache={keys:z.keys,values:z.cache==="clone"?oe(G):G},G}):B.getMany(z)},mutate:function(z){return z.type!=="add"&&(z.trans._cache=null),B.mutate(z)}})}}}};function Ji(_,O){return _.trans.mode==="readonly"&&!!_.subscr&&!_.trans.explicit&&_.trans.db._options.cache!=="disabled"&&!O.schema.primaryKey.outbound}function Gn(_,O){switch(_){case"query":return O.values&&!O.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Mr={stack:"dbcore",level:0,name:"Observability",create:function(_){var O=_.schema.name,B=new Nr(_.MIN_KEY,_.MAX_KEY);return r(r({},_),{transaction:function(z,W,G){if(Pt.subscr&&W!=="readonly")throw new Fe.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Pt.querier));return _.transaction(z,W,G)},table:function(z){function W(ke){var ve,ke=ke.query;return[ve=ke.index,new Nr((ve=(ke=ke.range).lower)!=null?ve:_.MIN_KEY,(ve=ke.upper)!=null?ve:_.MAX_KEY)]}var G=_.table(z),J=G.schema,te=J.primaryKey,be=J.indexes,Ee=te.extractKey,pe=te.outbound,me=te.autoIncrement&&be.filter(function(ye){return ye.compound&&ye.keyPath.includes(te.keyPath)}),we=r(r({},G),{mutate:function(ye){function ve(vt){return vt="idb://".concat(O,"/").concat(z,"/").concat(vt),Je[vt]||(Je[vt]=new Nr)}var ke,Ie,Ae,Ve=ye.trans,Je=ye.mutatedParts||(ye.mutatedParts={}),at=ve(""),ut=ve(":dels"),Qe=ye.type,dt=ye.type==="deleteRange"?[ye.range]:ye.type==="delete"?[ye.keys]:ye.values.length<50?[jt(te,ye).filter(function(vt){return vt}),ye.values]:[],gt=dt[0],dt=dt[1],it=ye.trans._cache;return s(gt)?(at.addKeys(gt),(Qe=Qe==="delete"||gt.length===dt.length?an(gt,it):null)||ut.addKeys(gt),(Qe||dt)&&(ke=ve,Ie=Qe,Ae=dt,J.indexes.forEach(function(vt){var vn=ke(vt.name||"");function on(sn){return sn!=null?vt.extractKey(sn):null}function Bt(sn){vt.multiEntry&&s(sn)?sn.forEach(function(Wn){return vn.addKey(Wn)}):vn.addKey(sn)}(Ie||Ae).forEach(function(sn,En){var ea=Ie&&on(Ie[En]),En=Ae&&on(Ae[En]);ft(ea,En)!==0&&(ea!=null&&Bt(ea),En!=null)&&Bt(En)})}))):gt?(dt={from:(it=gt.lower)!=null?it:_.MIN_KEY,to:(Qe=gt.upper)!=null?Qe:_.MAX_KEY},ut.add(dt),at.add(dt)):(at.add(B),ut.add(B),J.indexes.forEach(function(vt){return ve(vt.name).add(B)})),G.mutate(ye).then(function(vt){return!gt||ye.type!=="add"&&ye.type!=="put"||(at.addKeys(vt.results),me&&me.forEach(function(vn){for(var on=ye.values.map(function(ea){return vn.extractKey(ea)}),Bt=vn.keyPath.findIndex(function(ea){return ea===te.keyPath}),sn=0,Wn=vt.results.length;sn<Wn;++sn)on[sn][Bt]=vt.results[sn];ve(vn.name).addKeys(on)})),Ve.mutatedParts=ns(Ve.mutatedParts||{},Je),vt})}}),_e={get:function(ye){return[te,new Nr(ye.key)]},getMany:function(ye){return[te,new Nr().addKeys(ye.keys)]},count:W,query:W,openCursor:W};return o(_e).forEach(function(ye){we[ye]=function(ve){var ke=Pt.subscr,Ie=!!ke,Ae=Ji(Pt,G)&&Gn(ye,ve)?ve.obsSet={}:ke;if(Ie){var Ve,ke=function(dt){return dt="idb://".concat(O,"/").concat(z,"/").concat(dt),Ae[dt]||(Ae[dt]=new Nr)},Je=ke(""),at=ke(":dels"),Ie=_e[ye](ve),ut=Ie[0],Ie=Ie[1];if((ye==="query"&&ut.isPrimaryKey&&!ve.values?at:ke(ut.name||"")).add(Ie),!ut.isPrimaryKey){if(ye!=="count")return Ve=ye==="query"&&pe&&ve.values&&G.query(r(r({},ve),{values:!1})),G[ye].apply(this,arguments).then(function(dt){if(ye==="query"){if(pe&&ve.values)return Ve.then(function(on){return on=on.result,Je.addKeys(on),dt});var it=ve.values?dt.result.map(Ee):dt.result;(ve.values?Je:at).addKeys(it)}else{var vt,vn;if(ye==="openCursor")return vn=ve.values,(vt=dt)&&Object.create(vt,{key:{get:function(){return at.addKey(vt.primaryKey),vt.key}},primaryKey:{get:function(){var on=vt.primaryKey;return at.addKey(on),on}},value:{get:function(){return vn&&Je.addKey(vt.primaryKey),vt.value}}})}return dt});at.add(B)}}return G[ye].apply(this,arguments)}}),we}})}};function ai(_,O,B){var z;return B.numFailures===0?O:O.type==="deleteRange"||(z=O.keys?O.keys.length:"values"in O&&O.values?O.values.length:1,B.numFailures===z)?null:(z=r({},O),s(z.keys)&&(z.keys=z.keys.filter(function(W,G){return!(G in B.failures)})),"values"in z&&s(z.values)&&(z.values=z.values.filter(function(W,G){return!(G in B.failures)})),z)}function bi(_,O){return B=_,((z=O).lower===void 0||(z.lowerOpen?0<ft(B,z.lower):0<=ft(B,z.lower)))&&(B=_,(z=O).upper===void 0||(z.upperOpen?ft(B,z.upper)<0:ft(B,z.upper)<=0));var B,z}function za(_,O,B,z,W,G){var J,te,be,Ee,pe,me;return!B||B.length===0||(J=O.query.index,te=J.multiEntry,be=O.query.range,Ee=z.schema.primaryKey.extractKey,pe=J.extractKey,me=(J.lowLevelIndex||J).extractKey,(z=B.reduce(function(we,_e){var ye=we,ve=[];if(_e.type==="add"||_e.type==="put")for(var ke=new Nr,Ie=_e.values.length-1;0<=Ie;--Ie){var Ae,Ve=_e.values[Ie],Je=Ee(Ve);!ke.hasKey(Je)&&(Ae=pe(Ve),te&&s(Ae)?Ae.some(function(dt){return bi(dt,be)}):bi(Ae,be))&&(ke.addKey(Je),ve.push(Ve))}switch(_e.type){case"add":var at=new Nr().addKeys(O.values?we.map(function(it){return Ee(it)}):we),ye=we.concat(O.values?ve.filter(function(it){return it=Ee(it),!at.hasKey(it)&&(at.addKey(it),!0)}):ve.map(function(it){return Ee(it)}).filter(function(it){return!at.hasKey(it)&&(at.addKey(it),!0)}));break;case"put":var ut=new Nr().addKeys(_e.values.map(function(it){return Ee(it)}));ye=we.filter(function(it){return!ut.hasKey(O.values?Ee(it):it)}).concat(O.values?ve:ve.map(function(it){return Ee(it)}));break;case"delete":var Qe=new Nr().addKeys(_e.keys);ye=we.filter(function(it){return!Qe.hasKey(O.values?Ee(it):it)});break;case"deleteRange":var gt=_e.range;ye=we.filter(function(it){return!bi(Ee(it),gt)})}return ye},_))===_)?_:(z.sort(function(we,_e){return ft(me(we),me(_e))||ft(Ee(we),Ee(_e))}),O.limit&&O.limit<1/0&&(z.length>O.limit?z.length=O.limit:_.length===O.limit&&z.length<O.limit&&(W.dirty=!0)),G?Object.freeze(z):z)}function fo(_,O){return ft(_.lower,O.lower)===0&&ft(_.upper,O.upper)===0&&!!_.lowerOpen==!!O.lowerOpen&&!!_.upperOpen==!!O.upperOpen}function vd(_,O){return((B,z,W,G)=>{if(B===void 0)return z!==void 0?-1:0;if(z===void 0)return 1;if((B=ft(B,z))===0){if(W&&G)return 0;if(W)return 1;if(G)return-1}return B})(_.lower,O.lower,_.lowerOpen,O.lowerOpen)<=0&&0<=((B,z,W,G)=>{if(B===void 0)return z!==void 0?1:0;if(z===void 0)return-1;if((B=ft(B,z))===0){if(W&&G)return 0;if(W)return-1;if(G)return 1}return B})(_.upper,O.upper,_.upperOpen,O.upperOpen)}function bl(_,O,B,z){_.subscribers.add(B),z.addEventListener("abort",function(){var W,G;_.subscribers.delete(B),_.subscribers.size===0&&(W=_,G=O,setTimeout(function(){W.subscribers.size===0&&re(G,W)},3e3))})}var ef={stack:"dbcore",level:0,name:"Cache",create:function(_){var O=_.schema.name;return r(r({},_),{transaction:function(B,z,W){var G,J,te=_.transaction(B,z,W);return z==="readwrite"&&(W=(G=new AbortController).signal,te.addEventListener("abort",(J=function(be){return function(){if(G.abort(),z==="readwrite"){for(var Ee=new Set,pe=0,me=B;pe<me.length;pe++){var we=me[pe],_e=qa["idb://".concat(O,"/").concat(we)];if(_e){var ye=_.table(we),ve=_e.optimisticOps.filter(function(vt){return vt.trans===te});if(te._explicit&&be&&te.mutatedParts)for(var ke=0,Ie=Object.values(_e.queries.query);ke<Ie.length;ke++)for(var Ae=0,Ve=(ut=Ie[ke]).slice();Ae<Ve.length;Ae++)Ql((Qe=Ve[Ae]).obsSet,te.mutatedParts)&&(re(ut,Qe),Qe.subscribers.forEach(function(vt){return Ee.add(vt)}));else if(0<ve.length){_e.optimisticOps=_e.optimisticOps.filter(function(vt){return vt.trans!==te});for(var Je=0,at=Object.values(_e.queries.query);Je<at.length;Je++)for(var ut,Qe,gt,dt=0,it=(ut=at[Je]).slice();dt<it.length;dt++)(Qe=it[dt]).res!=null&&te.mutatedParts&&(be&&!Qe.dirty?(gt=Object.isFrozen(Qe.res),gt=za(Qe.res,Qe.req,ve,ye,Qe,gt),Qe.dirty?(re(ut,Qe),Qe.subscribers.forEach(function(vt){return Ee.add(vt)})):gt!==Qe.res&&(Qe.res=gt,Qe.promise=ht.resolve({result:gt}))):(Qe.dirty&&re(ut,Qe),Qe.subscribers.forEach(function(vt){return Ee.add(vt)})))}}}Ee.forEach(function(vt){return vt()})}}})(!1),{signal:W}),te.addEventListener("error",J(!1),{signal:W}),te.addEventListener("complete",J(!0),{signal:W})),te},table:function(B){var z=_.table(B),W=z.schema.primaryKey;return r(r({},z),{mutate:function(G){var J,te=Pt.trans;return!W.outbound&&te.db._options.cache!=="disabled"&&!te.explicit&&te.idbtrans.mode==="readwrite"&&(J=qa["idb://".concat(O,"/").concat(B)])?(te=z.mutate(G),G.type!=="add"&&G.type!=="put"||!(50<=G.values.length||jt(W,G).some(function(be){return be==null}))?(J.optimisticOps.push(G),G.mutatedParts&&va(G.mutatedParts),te.then(function(be){0<be.numFailures&&(re(J.optimisticOps,G),(be=ai(0,G,be))&&J.optimisticOps.push(be),G.mutatedParts)&&va(G.mutatedParts)}),te.catch(function(){re(J.optimisticOps,G),G.mutatedParts&&va(G.mutatedParts)})):te.then(function(be){var Ee=ai(0,r(r({},G),{values:G.values.map(function(pe,me){var we;return be.failures[me]?pe:($(we=(we=W.keyPath)!=null&&we.includes(".")?oe(pe):r({},pe),W.keyPath,be.results[me]),we)})}),be);J.optimisticOps.push(Ee),queueMicrotask(function(){return G.mutatedParts&&va(G.mutatedParts)})}),te):z.mutate(G)},query:function(G){var J,te,be,Ee,pe,me,we;return Ji(Pt,z)&&Gn("query",G)?(J=((be=Pt.trans)==null?void 0:be.db._options.cache)==="immutable",te=(be=Pt).requery,be=be.signal,me=((_e,ye,ve,ke)=>{var Ie=qa["idb://".concat(_e,"/").concat(ye)];if(!Ie)return[];if(!(_e=Ie.queries[ve]))return[null,!1,Ie,null];var Ae=_e[(ke.query?ke.query.index.name:null)||""];if(!Ae)return[null,!1,Ie,null];switch(ve){case"query":var Ve=Ae.find(function(Je){return Je.req.limit===ke.limit&&Je.req.values===ke.values&&fo(Je.req.query.range,ke.query.range)});return Ve?[Ve,!0,Ie,Ae]:[Ae.find(function(Je){return("limit"in Je.req?Je.req.limit:1/0)>=ke.limit&&(!ke.values||Je.req.values)&&vd(Je.req.query.range,ke.query.range)}),!1,Ie,Ae];case"count":return Ve=Ae.find(function(Je){return fo(Je.req.query.range,ke.query.range)}),[Ve,!!Ve,Ie,Ae]}})(O,B,"query",G),we=me[0],Ee=me[2],pe=me[3],we&&me[1]?we.obsSet=G.obsSet:(me=z.query(G).then(function(_e){var ye=_e.result;if(we&&(we.res=ye),J){for(var ve=0,ke=ye.length;ve<ke;++ve)Object.freeze(ye[ve]);Object.freeze(ye)}else _e.result=oe(ye);return _e}).catch(function(_e){return pe&&we&&re(pe,we),Promise.reject(_e)}),we={obsSet:G.obsSet,promise:me,subscribers:new Set,type:"query",req:G,dirty:!1},pe?pe.push(we):(pe=[we],(Ee=Ee||(qa["idb://".concat(O,"/").concat(B)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[G.query.index.name||""]=pe)),bl(we,pe,te,be),we.promise.then(function(_e){return{result:za(_e.result,G,Ee==null?void 0:Ee.optimisticOps,z,we,J)}})):z.query(G)}})}})}};function ya(_,O){return new Proxy(_,{get:function(B,z,W){return z==="db"?O:Reflect.get(B,z,W)}})}Vn.prototype.version=function(_){if(isNaN(_)||_<.1)throw new Fe.Type("Given version is not a positive number");if(_=Math.round(10*_)/10,this.idbdb||this._state.isBeingOpened)throw new Fe.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,_);var O=this._versions,B=O.filter(function(z){return z._cfg.version===_})[0];return B||(B=new this.Version(_),O.push(B),O.sort(ii),B.stores({}),this._state.autoSchema=!1),B},Vn.prototype._whenReady=function(_){var O=this;return this.idbdb&&(this._state.openComplete||Pt.letThrough||this._vip)?_():new ht(function(B,z){if(O._state.openComplete)return z(new Fe.DatabaseClosed(O._state.dbOpenError));if(!O._state.isBeingOpened){if(!O._state.autoOpen)return void z(new Fe.DatabaseClosed);O.open().catch(Te)}O._state.dbReadyPromise.then(B,z)}).then(_)},Vn.prototype.use=function(W){var O=W.stack,B=W.create,z=W.level,W=W.name,G=(W&&this.unuse({stack:O,name:W}),this._middlewares[O]||(this._middlewares[O]=[]));return G.push({stack:O,create:B,level:z??10,name:W}),G.sort(function(J,te){return J.level-te.level}),this},Vn.prototype.unuse=function(_){var O=_.stack,B=_.name,z=_.create;return O&&this._middlewares[O]&&(this._middlewares[O]=this._middlewares[O].filter(function(W){return z?W.create!==z:!!B&&W.name!==B})),this},Vn.prototype.open=function(){var _=this;return Ia(qr,function(){return yi(_)})},Vn.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var _=this._state,O=pa.indexOf(this);if(0<=O&&pa.splice(O,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}_.isBeingOpened||(_.dbReadyPromise=new ht(function(B){_.dbReadyResolve=B}),_.openCanceller=new ht(function(B,z){_.cancelOpen=z}))},Vn.prototype.close=function(O){var O=(O===void 0?{disableAutoOpen:!0}:O).disableAutoOpen,B=this._state;O?(B.isBeingOpened&&B.cancelOpen(new Fe.DatabaseClosed),this._close(),B.autoOpen=!1,B.dbOpenError=new Fe.DatabaseClosed):(this._close(),B.autoOpen=this._options.autoOpen||B.isBeingOpened,B.openComplete=!1,B.dbOpenError=null)},Vn.prototype.delete=function(_){var O=this,B=(_===void 0&&(_={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),z=this._state;return new ht(function(W,G){function J(){O.close(_);var te=O._deps.indexedDB.deleteDatabase(O.name);te.onsuccess=An(function(){var be,Ee,pe;be=O._deps,Ee=O.name,co(pe=be.indexedDB)||Ee===Yo||Ls(pe,be.IDBKeyRange).delete(Ee).catch(Te),W()}),te.onerror=gn(G),te.onblocked=O._fireOnBlocked}if(B)throw new Fe.InvalidArgument("Invalid closeOptions argument to db.delete()");z.isBeingOpened?z.dbReadyPromise.then(J):J()})},Vn.prototype.backendDB=function(){return this.idbdb},Vn.prototype.isOpen=function(){return this.idbdb!==null},Vn.prototype.hasBeenClosed=function(){var _=this._state.dbOpenError;return _&&_.name==="DatabaseClosed"},Vn.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Vn.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Vn.prototype,"tables",{get:function(){var _=this;return o(this._allTables).map(function(O){return _._allTables[O]})},enumerable:!1,configurable:!0}),Vn.prototype.transaction=function(){var _=(function(O,B,z){var W=arguments.length;if(W<2)throw new Fe.InvalidArgument("Too few arguments");for(var G=new Array(W-1);--W;)G[W-1]=arguments[W];return z=G.pop(),[O,Z(G),z]}).apply(this,arguments);return this._transaction.apply(this,_)},Vn.prototype._transaction=function(_,O,B){var z,W,G=this,J=Pt.trans,te=(J&&J.db===this&&_.indexOf("!")===-1||(J=null),_.indexOf("?")!==-1);_=_.replace("!","").replace("?","");try{if(W=O.map(function(Ee){if(Ee=Ee instanceof G.Table?Ee.name:Ee,typeof Ee!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return Ee}),_=="r"||_===Co)z=Co;else{if(_!="rw"&&_!=Xo)throw new Fe.InvalidArgument("Invalid transaction mode: "+_);z=Xo}if(J){if(J.mode===Co&&z===Xo){if(!te)throw new Fe.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");J=null}J&&W.forEach(function(Ee){if(J&&J.storeNames.indexOf(Ee)===-1){if(!te)throw new Fe.SubTransaction("Table "+Ee+" not included in parent transaction.");J=null}}),te&&J&&!J.active&&(J=null)}}catch(Ee){return J?J._promise(null,function(pe,me){me(Ee)}):nr(Ee)}var be=(function Ee(pe,me,we,_e,ye){return ht.resolve().then(function(){var Ae=Pt.transless||Pt,ve=pe._createTransaction(me,we,pe._dbSchema,_e),Ae=(ve.explicit=!0,{trans:ve,transless:Ae});if(_e)ve.idbtrans=_e.idbtrans;else try{ve.create(),ve.idbtrans._explicit=!0,pe._state.PR1398_maxLoop=3}catch(Ve){return Ve.name===rt.InvalidState&&pe.isOpen()&&0<--pe._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),pe.close({disableAutoOpen:!1}),pe.open().then(function(){return Ee(pe,me,we,null,ye)})):nr(Ve)}var ke,Ie=ie(ye),Ae=(Ie&&La(),ht.follow(function(){var Ve;(ke=ye.call(ve,ve))&&(Ie?(Ve=Sr.bind(null,null),ke.then(Ve,Ve)):typeof ke.next=="function"&&typeof ke.throw=="function"&&(ke=Fs(ke)))},Ae));return(ke&&typeof ke.then=="function"?ht.resolve(ke).then(function(Ve){return ve.active?Ve:nr(new Fe.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):Ae.then(function(){return ke})).then(function(Ve){return _e&&ve._resolve(),ve._completion.then(function(){return Ve})}).catch(function(Ve){return ve._reject(Ve),nr(Ve)})})}).bind(null,this,z,W,J,B);return J?J._promise(z,be,"lock"):Pt.trans?Ia(Pt.transless,function(){return G._whenReady(be)}):this._whenReady(be)},Vn.prototype.table=function(_){if(m(this._allTables,_))return this._allTables[_];throw new Fe.InvalidTable("Table ".concat(_," does not exist"))};var Ro=Vn;function Vn(_,O){var B,z,W,G,J,te=this,be=(this._middlewares={},this.verno=0,Vn.dependencies),be=(this._options=O=r({addons:Vn.addons,autoOpen:!0,indexedDB:be.indexedDB,IDBKeyRange:be.IDBKeyRange,cache:"cloned"},O),this._deps={indexedDB:O.indexedDB,IDBKeyRange:O.IDBKeyRange},O.addons),Ee=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Te,dbReadyPromise:null,cancelOpen:Te,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:O.autoOpen}),pe=(Ee.dbReadyPromise=new ht(function(me){Ee.dbReadyResolve=me}),Ee.openCanceller=new ht(function(me,we){Ee.cancelOpen=we}),this._state=Ee,this.name=_,this.on=ro(this,"populate","blocked","versionchange","close",{ready:[$r,Te]}),this.once=function(me,we){var _e=function(){for(var ye=[],ve=0;ve<arguments.length;ve++)ye[ve]=arguments[ve];te.on(me).unsubscribe(_e),we.apply(te,ye)};return te.on(me,_e)},this.on.ready.subscribe=k(this.on.ready.subscribe,function(me){return function(we,_e){Vn.vip(function(){var ye,ve=te._state;ve.openComplete?(ve.dbOpenError||ht.resolve().then(we),_e&&me(we)):ve.onReadyBeingFired?(ve.onReadyBeingFired.push(we),_e&&me(we)):(me(we),ye=te,_e||me(function ke(){ye.on.ready.unsubscribe(we),ye.on.ready.unsubscribe(ke)}))})}}),this.Collection=(B=this,dr(Ms.prototype,function(ke,ve){this.db=B;var _e=pi,ye=null;if(ve)try{_e=ve()}catch(Ae){ye=Ae}var ve=ke._ctx,ke=ve.table,Ie=ke.hook.reading.fire;this._ctx={table:ke,index:ve.index,isPrimKey:!ve.index||ke.schema.primKey.keyPath&&ve.index===ke.schema.primKey.name,range:_e,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:ye,or:ve.or,valueMapper:Ie!==Dt?Ie:null}})),this.Table=(z=this,dr(zn.prototype,function(me,we,_e){this.db=z,this._tx=_e,this.name=me,this.schema=we,this.hook=z._allTables[me]?z._allTables[me].hook:ro(null,{creating:[xn,Te],reading:[Lt,Dt],updating:[Ar,Te],deleting:[qn,Te]})})),this.Transaction=(W=this,dr(Rs.prototype,function(me,we,_e,ye,ve){var ke=this;me!=="readonly"&&we.forEach(function(Ie){Ie=(Ie=_e[Ie])==null?void 0:Ie.yProps,Ie&&(we=we.concat(Ie.map(function(Ae){return Ae.updatesTable})))}),this.db=W,this.mode=me,this.storeNames=we,this.schema=_e,this.chromeTransactionDurability=ye,this.idbtrans=null,this.on=ro(this,"complete","error","abort"),this.parent=ve||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ht(function(Ie,Ae){ke._resolve=Ie,ke._reject=Ae}),this._completion.then(function(){ke.active=!1,ke.on.complete.fire()},function(Ie){var Ae=ke.active;return ke.active=!1,ke.on.error.fire(Ie),ke.parent?ke.parent._reject(Ie):Ae&&ke.idbtrans&&ke.idbtrans.abort(),nr(Ie)})})),this.Version=(G=this,dr(Jc.prototype,function(me){this.db=G,this._cfg={version:me,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(J=this,dr(Ba.prototype,function(me,we,_e){if(this.db=J,this._ctx={table:me,index:we===":id"?null:we,or:_e},this._cmp=this._ascending=ft,this._descending=function(ye,ve){return ft(ve,ye)},this._max=function(ye,ve){return 0<ft(ye,ve)?ye:ve},this._min=function(ye,ve){return ft(ye,ve)<0?ye:ve},this._IDBKeyRange=J._deps.IDBKeyRange,!this._IDBKeyRange)throw new Fe.MissingAPI})),this.on("versionchange",function(me){0<me.newVersion?console.warn("Another connection wants to upgrade database '".concat(te.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(te.name,"'. Closing db now to resume the delete request.")),te.close({disableAutoOpen:!1})}),this.on("blocked",function(me){!me.newVersion||me.newVersion<me.oldVersion?console.warn("Dexie.delete('".concat(te.name,"') was blocked")):console.warn("Upgrade '".concat(te.name,"' blocked by other connection holding version ").concat(me.oldVersion/10))}),this._maxKey=xe(O.IDBKeyRange),this._createTransaction=function(me,we,_e,ye){return new te.Transaction(me,we,_e,te._options.chromeTransactionDurability,ye)},this._fireOnBlocked=function(me){te.on("blocked").fire(me),pa.filter(function(we){return we.name===te.name&&we!==te&&!we._state.vcFired}).map(function(we){return we.on("versionchange").fire(me)})},this.use(Tn),this.use(ef),this.use(Mr),this.use(Ne),this.use($t),new Proxy(this,{get:function(me,we,_e){var ye;return we==="_vip"||(we==="table"?function(ve){return ya(te.table(ve),pe)}:(ye=Reflect.get(me,we,_e))instanceof zn?ya(ye,pe):we==="tables"?ye.map(function(ve){return ya(ve,pe)}):we==="_createTransaction"?function(){return ya(ye.apply(this,arguments),pe)}:ye)}}));this.vip=pe,be.forEach(function(me){return me(te)})}var qs,zs=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",zu=(Us.prototype.subscribe=function(_,O,B){return this._subscribe(_&&typeof _!="function"?_:{next:_,error:O,complete:B})},Us.prototype[zs]=function(){return this},Us);function Us(_){this._subscribe=_}try{qs={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{qs={indexedDB:null,IDBKeyRange:null}}function Di(_){var O,B=!1,z=new zu(function(W){var G=ie(_),J,te=!1,be={},Ee={},pe={get closed(){return te},unsubscribe:function(){te||(te=!0,J&&J.abort(),me&&Xi.storagemutated.unsubscribe(_e))}},me=(W.start&&W.start(pe),!1),we=function(){return Da(ye)},_e=function(ve){ns(be,ve),Ql(Ee,be)&&we()},ye=function(){var ve,ke,Ie;!te&&qs.indexedDB&&(be={},ve={},J&&J.abort(),J=new AbortController,Ie=(Ae=>{var Ve=ar();try{G&&La();var Je=Hi(_,Ae);return Je=G?Je.finally(Sr):Je}finally{Ve&&da()}})(ke={subscr:ve,signal:J.signal,requery:we,querier:_,trans:null}),Promise.resolve(Ie).then(function(Ae){B=!0,O=Ae,te||ke.signal.aborted||(be={},(Ve=>{for(var Je in Ve)if(m(Ve,Je))return;return 1})(Ee=ve)||me||(Xi($a,_e),me=!0),Da(function(){return!te&&W.next&&W.next(Ae)}))},function(Ae){B=!1,["DatabaseClosedError","AbortError"].includes(Ae==null?void 0:Ae.name)||te||Da(function(){te||W.error&&W.error(Ae)})}))};return setTimeout(we,0),pe});return z.hasValue=function(){return B},z.getValue=function(){return O},z}var Vs=Ro;function Ua(_){var O=Xr;try{Xr=!0,Xi.storagemutated.fire(_),Jl(_,!0)}finally{Xr=O}}y(Vs,r(r({},de),{delete:function(_){return new Vs(_,{addons:[]}).delete()},exists:function(_){return new Vs(_,{addons:[]}).open().then(function(O){return O.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(_){try{return O=Vs.dependencies,B=O.indexedDB,O=O.IDBKeyRange,(co(B)?Promise.resolve(B.databases()).then(function(z){return z.map(function(W){return W.name}).filter(function(W){return W!==Yo})}):Ls(B,O).toCollection().primaryKeys()).then(_)}catch{return nr(new Fe.MissingAPI)}var O,B},defineClass:function(){return function(_){c(this,_)}},ignoreTransaction:function(_){return Pt.trans?Ia(Pt.transless,_):_()},vip:vi,async:function(_){return function(){try{var O=Fs(_.apply(this,arguments));return O&&typeof O.then=="function"?O:ht.resolve(O)}catch(B){return nr(B)}}},spawn:function(_,O,B){try{var z=Fs(_.apply(B,O||[]));return z&&typeof z.then=="function"?z:ht.resolve(z)}catch(W){return nr(W)}},currentTransaction:{get:function(){return Pt.trans||null}},waitFor:function(_,O){return _=ht.resolve(typeof _=="function"?Vs.ignoreTransaction(_):_).timeout(O||6e4),Pt.trans?Pt.trans.waitFor(_):_},Promise:ht,debug:{get:function(){return Bn},set:function(_){_r(_)}},derive:x,extend:c,props:y,override:k,Events:ro,on:Xi,liveQuery:Di,extendObservabilitySet:ns,getByKeyPath:R,setByKeyPath:$,delByKeyPath:function(_,O){typeof O=="string"?$(_,O,void 0):"length"in O&&[].map.call(O,function(B){$(_,B,void 0)})},shallowClone:V,deepClone:oe,getObjectDiff:Ze,cmp:ft,asap:I,minKey:-1/0,addons:[],connections:pa,errnames:rt,dependencies:qs,cache:qa,semVer:"4.3.0",version:"4.3.0".split(".").map(function(_){return parseInt(_)}).reduce(function(_,O,B){return _+O/Math.pow(10,2*B)})})),Vs.maxKey=xe(Vs.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Xi($a,function(_){Xr||(_=new CustomEvent(Yi,{detail:_}),Xr=!0,dispatchEvent(_),Xr=!1)}),addEventListener(Yi,function(_){_=_.detail,Xr||Ua(_)}));var xl,Xr=!1,Ws=function(){};return typeof BroadcastChannel<"u"&&((Ws=function(){(xl=new BroadcastChannel(Yi)).onmessage=function(_){return _.data&&Ua(_.data)}})(),typeof xl.unref=="function"&&xl.unref(),Xi($a,function(_){Xr||xl.postMessage(_)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(_){if(!Ro.disableBfCache&&_.persisted){Bn&&console.debug("Dexie: handling persisted pagehide"),xl!=null&&xl.close();for(var O=0,B=pa;O<B.length;O++)B[O].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(_){!Ro.disableBfCache&&_.persisted&&(Bn&&console.debug("Dexie: handling persisted pageshow"),Ws(),Ua({all:new Nr(-1/0,[[]])}))})),ht.rejectionMapper=function(_,O){return!_||_ instanceof je||_ instanceof TypeError||_ instanceof SyntaxError||!_.name||!st[_.name]?_:(O=new st[_.name](O||_.message,_),"stack"in _&&P(O,"stack",{get:function(){return this.inner.stack}}),O)},_r(Bn),r(Ro,Object.freeze({__proto__:null,Dexie:Ro,Entity:Li,PropModification:mi,RangeSet:Nr,add:function(_){return new mi({add:_})},cmp:ft,default:Ro,liveQuery:Di,mergeRanges:Ds,rangesOverlap:ts,remove:function(_){return new mi({remove:_})},replacePrefix:function(_,O){return new mi({replacePrefix:[_,O]})}}),{default:Ro}),Ro})})(Ey)),Ey.exports}var l1e=s1e();const KT=In(l1e),v$=Symbol.for("Dexie"),H0=globalThis[v$]||(globalThis[v$]=KT);if(KT.semVer!==H0.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${KT.semVer} and ${H0.semVer}`);const{liveQuery:zOe,mergeRanges:UOe,rangesOverlap:VOe,RangeSet:WOe,cmp:KOe,Entity:HOe,PropModification:GOe,replacePrefix:ZOe,add:YOe,remove:XOe,DexieYProvider:QOe}=H0,um=new H0("PertanianDB");um.version(1).stores({farmers:"id, nik, sync_status",lands:"id, province,regency,district,village,farmer_id",plants:"id,land_id, farmer_id",validators:"id",offtakers:"id",pending_sync:"id, entity_type"});const pg=()=>navigator.onLine,Tr={saveEntityLocally:async(e,t)=>{const n=e.toLowerCase().endsWith("s")?e.toLowerCase():`${e.toLowerCase()}s`,r=t.id||`off_${Date.now()}`,i={...t,id:r,sync_status:"pending",created_at:new Date().toISOString()};try{return await um[n].put(i),await um.pending_sync.add({id:`q_${Date.now()}`,entity_type:e,operation:"CREATE",payload:i,created_at:new Date().toISOString()}),console.log(`✅ Dexie: Data ${e} tersimpan aman!`),r}catch(a){throw console.error("❌ Dexie Error:",a),a}},getEntities:async(e,t={})=>{try{if(!e)return[];const n=e.toLowerCase().endsWith("s")?e.toLowerCase():`${e.toLowerCase()}s`,r=um[n];return r?t&&typeof t=="object"&&Object.keys(t).length>0?(console.log(`🔍 Fetching ${n} with filter:`,t),await r.where(t).toArray()):(console.log(`🔍 Fetching all from ${n}`),await r.reverse().toArray()):(console.error(`Tabel ${n} tidak ditemukan di Dexie`),[])}catch(n){return console.error("❌ Gagal ambil data dari Dexie:",n),[]}},getPendingCount:async()=>{try{return await um.pending_sync.count()}catch(e){return console.error("Gagal hitung antrean:",e),0}}};function u1e(){const[e,t]=M.useState(""),[n,r]=M.useState("all"),[i,a]=M.useState("all"),{data:o=[],isLoading:s}=bn({queryKey:["farmers"],queryFn:async()=>{let y=[];try{y=await mt.entities.Farmer.list("-created_date")}catch{console.warn("Server unreachable, loading local data only")}const b=await Tr.getEntities("farmers"),P=new Map;return c(y).forEach(x=>P.set(x.id,x)),c(b).forEach(x=>P.set(x.id,x)),Array.from(P.values()).sort((x,w)=>new Date(w.created_date||w.created_at)-new Date(x.created_date||x.created_at))}}),c=y=>Array.isArray(y)?y:[],d=c(o),p=[...new Set(d.map(y=>y.regency).filter(Boolean))],m=d.filter(y=>{var w,T,E;const b=!e||((w=y.full_name)==null?void 0:w.toLowerCase().includes(e.toLowerCase()))||((T=y.nik)==null?void 0:T.includes(e))||((E=y.farmer_group)==null?void 0:E.toLowerCase().includes(e.toLowerCase())),P=n==="all"||y.verification_status===n,x=i==="all"||y.regency===i;return b&&P&&x});return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-7xl mx-auto p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-3xl font-bold text-slate-900",children:"Daftar Petani"}),h.jsxs("p",{className:"text-slate-500",children:[o.length," petani terdaftar"]})]}),h.jsx(zo,{to:ei("FarmerRegister"),children:h.jsxs(pt,{className:"bg-emerald-600 hover:bg-emerald-700 h-11",children:[h.jsx(Dc,{className:"w-5 h-5 mr-2"}),"Tambah Petani"]})})]}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"flex flex-col md:flex-row gap-3",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(tE,{className:"w-5 h-5 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),h.jsx(nn,{placeholder:"Cari nama, NIK, atau kelompok tani...",value:e,onChange:y=>t(y.target.value),className:"h-11 pl-11 bg-white border-0 shadow-sm"})]}),h.jsxs(Hr,{value:n,onValueChange:r,children:[h.jsxs(Dr,{className:"w-full md:w-48 h-11 bg-white border-0 shadow-sm",children:[h.jsx(eE,{className:"w-4 h-4 mr-2 text-slate-400"}),h.jsx(Gr,{placeholder:"Status"})]}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"all",children:"Semua Status"}),h.jsx(Kt,{value:"pending",children:"Pending"}),h.jsx(Kt,{value:"verified",children:"Terverifikasi"}),h.jsx(Kt,{value:"rejected",children:"Ditolak"})]})]}),h.jsxs(Hr,{value:i,onValueChange:a,children:[h.jsx(Dr,{className:"w-full md:w-48 h-11 bg-white border-0 shadow-sm",children:h.jsx(Gr,{placeholder:"Kabupaten"})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"all",children:"Semua Kabupaten"}),p.map(y=>h.jsx(Kt,{value:y,children:y},y))]})]})]}),s?h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3,4,5,6].map(y=>h.jsx("div",{className:"h-48 bg-white rounded-xl animate-pulse"},y))}):m.length>0?h.jsx(Rt.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.map((y,b)=>h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:b*.05},children:h.jsx(Obe,{farmer:y})},y.id))}):h.jsx(Qa,{icon:ll,title:"Tidak ada petani ditemukan",description:e||n!=="all"||i!=="all"?"Coba ubah filter pencarian Anda":"Mulai dengan mendaftarkan petani baru",action:()=>window.location.href=ei("FarmerRegister"),actionLabel:"Tambah Petani Pertama"})]})})}var c1e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],f1e=c1e.reduce((e,t)=>{const n=sk(`Primitive.${t}`),r=M.forwardRef((i,a)=>{const{asChild:o,...s}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),d1e="Label",Y8=M.forwardRef((e,t)=>h.jsx(f1e.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Y8.displayName=d1e;var X8=Y8;const h1e=Q0("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),St=M.forwardRef(({className:e,...t},n)=>h.jsx(X8,{ref:n,className:fn(h1e(),e),...t}));St.displayName=X8.displayName;function Q8({initialData:e,onSubmit:t,isLoading:n}){const[r,i]=M.useState(e||{nik:"",full_name:"",phone:"",farmer_group:"",village:"",district:"",regency:"",province:"",verification_status:"pending",sync_status:"pending"}),{data:a}=bn({queryKey:["provinces"],queryFn:()=>mt.entities.Province.list()}),o=Array.isArray(a)?a:a!=null&&a.data&&Array.isArray(a.data)?a.data:[],s=(d,p)=>{i(m=>({...m,[d]:p}))},c=d=>{d.preventDefault(),t(r)};return M.useEffect(()=>{Array.isArray(o)&&o.length>0&&i(d=>({...d,province:o[0].name}))},[o]),h.jsxs("form",{onSubmit:c,className:"space-y-6",children:[h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-4",children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(zf,{className:"w-5 h-5 text-emerald-600"}),"Data Identitas"]})}),h.jsxs(Pn,{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{htmlFor:"nik",children:"NIK (Nomor Induk Kependudukan)"}),h.jsx(nn,{id:"nik",value:r.nik,onChange:d=>s("nik",d.target.value),placeholder:"16 digit NIK",maxLength:16,required:!0,className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{htmlFor:"full_name",children:"Nama Lengkap"}),h.jsx(nn,{id:"full_name",value:r.full_name,onChange:d=>s("full_name",d.target.value),placeholder:"Nama sesuai KTP",required:!0,className:"h-11"})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{htmlFor:"phone",children:"Nomor Telepon"}),h.jsxs("div",{className:"relative",children:[h.jsx(Yh,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),h.jsx(nn,{id:"phone",value:r.phone,onChange:d=>s("phone",d.target.value),placeholder:"08xxxxxxxxxx",className:"h-11 pl-10"})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{htmlFor:"farmer_group",children:"Kelompok Tani"}),h.jsxs("div",{className:"relative",children:[h.jsx(ll,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),h.jsx(nn,{id:"farmer_group",value:r.farmer_group,onChange:d=>s("farmer_group",d.target.value),placeholder:"Nama kelompok tani",className:"h-11 pl-10"})]})]})]})]})]}),h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-4",children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(So,{className:"w-5 h-5 text-emerald-600"}),"Alamat Domisili"]})}),h.jsxs(Pn,{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{htmlFor:"province",children:"Provinsi"}),h.jsxs(Hr,{value:r.province,onValueChange:d=>s("province",d),children:[h.jsx(Dr,{className:"h-11",children:h.jsx(Gr,{placeholder:"Pilih provinsi"})}),h.jsx(Br,{children:o.length>0?o.map((d,p)=>h.jsx(Kt,{value:d.nama||d.name,children:d.nama||d.name},d.id||p)):h.jsx(Kt,{value:"none",disabled:!0,children:"Data tidak tersedia"})})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{htmlFor:"regency",children:"Kabupaten/Kota"}),h.jsx(nn,{id:"regency",value:r.regency,onChange:d=>s("regency",d.target.value),placeholder:"Nama kabupaten/kota",required:!0,className:"h-11"})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{htmlFor:"district",children:"Kecamatan"}),h.jsx(nn,{id:"district",value:r.district,onChange:d=>s("district",d.target.value),placeholder:"Nama kecamatan",required:!0,className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{htmlFor:"village",children:"Desa/Kelurahan"}),h.jsx(nn,{id:"village",value:r.village,onChange:d=>s("village",d.target.value),placeholder:"Nama desa/kelurahan",required:!0,className:"h-11"})]})]})]})]}),h.jsx("div",{className:"flex justify-end gap-3",children:h.jsxs(pt,{type:"submit",disabled:n,className:"bg-emerald-600 hover:bg-emerald-700 h-11 px-8",children:[n&&h.jsx(ti,{className:"w-4 h-4 mr-2 animate-spin"}),e?"Simpan Perubahan":"Daftarkan Petani"]})})]})}function p1e(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let HT=1;class m1e{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:HT++,o=this.toasts.find(c=>c.id===a),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...t,id:a,title:r}),{...c,...t,id:a,dismissible:s,title:r}):c):this.addToast({title:r,...i,dismissible:s,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,o;const s=i.then(async d=>{if(o=["resolve",d],ce.isValidElement(d))a=!1,this.create({id:r,type:"default",message:d});else if(v1e(d)&&!d.ok){a=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,P=typeof m=="object"&&!ce.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:y,...P})}else if(d instanceof Error){a=!1;const m=typeof n.error=="function"?await n.error(d):n.error,y=typeof n.description=="function"?await n.description(d):n.description,P=typeof m=="object"&&!ce.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:y,...P})}else if(n.success!==void 0){a=!1;const m=typeof n.success=="function"?await n.success(d):n.success,y=typeof n.description=="function"?await n.description(d):n.description,P=typeof m=="object"&&!ce.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:y,...P})}}).catch(async d=>{if(o=["reject",d],n.error!==void 0){a=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,b=typeof p=="object"&&!ce.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...b})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,p)=>s.then(()=>o[0]==="reject"?p(o[1]):d(o[1])).catch(p));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||HT++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ys=new m1e,g1e=(e,t)=>{const n=(t==null?void 0:t.id)||HT++;return ys.addToast({title:e,...t,id:n}),n},v1e=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",y1e=g1e,b1e=()=>ys.toasts,x1e=()=>ys.getActiveToasts(),Mt=Object.assign(y1e,{success:ys.success,info:ys.info,warning:ys.warning,error:ys.error,custom:ys.custom,message:ys.message,promise:ys.promise,dismiss:ys.dismiss,loading:ys.loading},{getHistory:b1e,getToasts:x1e});p1e("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function w1e(){const e=dE(),t=As(),n=ci({mutationFn:async r=>{console.log("1. Memulai proses simpan...",r);try{const i=await mt.entities.Farmer.create(r);if(typeof i=="string"&&i.includes("<!doctype html>"))throw new Error("Menerima HTML, bukan JSON. Endpoint mungkin salah.");return console.log("2. Berhasil simpan ke server",i),i}catch(i){throw console.log("2. Gagal ke server, beralih ke offline mode",i),{type:"OFFLINE_SAVE",data:r}}},onSuccess:r=>{t.invalidateQueries({queryKey:["farmers"]}),Mt.success("Petani berhasil didaftarkan ke server!"),e(ei("Farmers"))},onError:async(r,i)=>{if(r.type==="OFFLINE_SAVE")try{const o=await Tr.saveEntityLocally("farmer",i),s={...i,id:o,sync_status:"pending"};t.setQueryData(["farmers"],c=>c?[s,...c]:[s]),Mt.info("Tersimpan secara lokal"),setTimeout(()=>{e(ei("Farmers"))},500)}catch(a){console.error("SQLite Error:",a),Mt.error("Gagal simpan lokal")}}});return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-3xl mx-auto p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center gap-4",children:[h.jsx(zo,{to:ei("Farmers"),children:h.jsx(pt,{variant:"outline",size:"icon",className:"h-10 w-10",children:h.jsx(J0,{className:"w-5 h-5"})})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Registrasi Petani Baru"}),h.jsx("p",{className:"text-slate-500",children:"Isi data identitas dan alamat petani"})]})]}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:h.jsx(Q8,{onSubmit:r=>n.mutate(r),isLoading:n.isPending})})]})})}const _1e={valid:"bg-emerald-100 text-emerald-700 border-emerald-200",invalid:"bg-rose-100 text-rose-700 border-rose-200",need_review:"bg-amber-100 text-amber-700 border-amber-200",pending:"bg-slate-100 text-slate-600 border-slate-200"},S1e={valid:"Tervalidasi",invalid:"Tidak Valid",need_review:"Perlu Review",pending:"Menunggu"},P1e={owned:"Milik Sendiri",rented:"Sewa",shared:"Bagi Hasil",government:"Tanah Negara"};function Sk({land:e,farmerName:t,plantCount:n=0}){return h.jsxs(Tt,{className:"border-0 shadow-sm hover:shadow-md transition-all p-5 bg-white group",children:[h.jsxs("div",{className:"flex items-start justify-between mb-4",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-slate-900",children:e.name}),t&&h.jsx("p",{className:"text-sm text-slate-500",children:t})]}),h.jsx(ur,{className:`${_1e[e.validation_status]} border font-medium text-xs`,children:S1e[e.validation_status]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[h.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[h.jsxs("div",{className:"flex items-center gap-2 text-slate-500 text-xs mb-1",children:[h.jsx(eF,{className:"w-3.5 h-3.5"}),h.jsx("span",{children:"Luas Lahan"})]}),h.jsx("p",{className:"font-semibold text-slate-900",children:e.area_hectares?`${e.area_hectares.toFixed(2)} Ha`:"-"})]}),h.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[h.jsxs("div",{className:"flex items-center gap-2 text-slate-500 text-xs mb-1",children:[h.jsx(sa,{className:"w-3.5 h-3.5"}),h.jsx("span",{children:"Jumlah Pohon"})]}),h.jsx("p",{className:"font-semibold text-slate-900",children:n})]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[h.jsx(So,{className:"w-4 h-4"}),h.jsxs("span",{className:"truncate",children:[e.village,", ",e.district]})]}),h.jsx(zo,{to:ei("LandDetail")+`?id=${e.id}`,children:h.jsxs(pt,{variant:"ghost",size:"sm",className:"opacity-0 group-hover:opacity-100 transition-opacity text-emerald-600",children:["Detail",h.jsx(tb,{className:"w-4 h-4 ml-1"})]})})]}),e.land_status&&h.jsx("div",{className:"mt-3 pt-3 border-t border-slate-100",children:h.jsxs("span",{className:"text-xs text-slate-500",children:["Status: ",P1e[e.land_status]]})})]})}const y$={pending:{icon:Q$,label:"Belum Disinkronkan",className:"bg-amber-100 text-amber-700 border-amber-200"},syncing:{icon:ti,label:"Menyinkronkan...",className:"bg-blue-100 text-blue-700 border-blue-200"},synced:{icon:JT,label:"Tersinkronkan",className:"bg-emerald-100 text-emerald-700 border-emerald-200"},failed:{icon:EH,label:"Gagal Sinkronisasi",className:"bg-rose-100 text-rose-700 border-rose-200"}};function J8({status:e="pending",showLabel:t=!0,size:n="default"}){const r=y$[e]||y$.pending,i=r.icon;return h.jsxs(ur,{className:`${r.className} border font-medium ${n==="sm"?"text-xs px-2 py-0.5":""}`,children:[h.jsx(i,{className:`${n==="sm"?"w-3 h-3":"w-4 h-4"} ${t?"mr-1.5":""} ${e==="syncing"?"animate-spin":""}`}),t&&r.label]})}function j1e({farmerId:e,onLinked:t}){const[n,r]=M.useState(""),i=ci({mutationFn:async o=>{await mt.entities.Farmer.update(e,{user_email:o})},onSuccess:()=>{Mt.success("Akun berhasil dihubungkan!"),r(""),t==null||t()},onError:()=>{Mt.error("Gagal menghubungkan akun")}}),a=o=>{if(o.preventDefault(),!n){Mt.error("Masukkan email user");return}i.mutate(n)};return h.jsxs("form",{onSubmit:a,className:"space-y-3",children:[h.jsx(St,{className:"text-sm text-slate-600",children:"Hubungkan Akun User"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(nn,{type:"email",value:n,onChange:o=>r(o.target.value),placeholder:"Email user petani",className:"flex-1 h-9 text-sm"}),h.jsx(pt,{type:"submit",size:"sm",disabled:i.isPending,className:"bg-emerald-600 hover:bg-emerald-700",children:i.isPending?h.jsx(ti,{className:"w-4 h-4 animate-spin"}):h.jsx(S9,{className:"w-4 h-4"})})]}),h.jsx("p",{className:"text-xs text-slate-400",children:"Petani dapat login dengan email ini untuk mengelola data sendiri"})]})}function O1e(){var k,D;const t=new URLSearchParams(window.location.search).get("id"),n=As(),{id:r}=WF(),i=r||t,[a,o]=M.useState(!1),{data:s=[]}=bn({queryKey:["farmers"],queryFn:()=>mt.entities.Farmer.list("-created_date"),enabled:!0}),{data:c=[],isLoading:d}=bn({queryKey:["farmer",i],queryFn:async I=>{if(!i)return null;try{const $=await mt.entities.Farmer.get(i);if(typeof $=="string"&&$.includes("<!doctype html>"))console.warn("API returned HTML instead of JSON. Falling back to local.");else if($&&!$.error)return $}catch{console.warn("Server unreachable, searching locally...")}const R=await Tr.getEntities("farmers",{id:i});return R&&R.length>0?{...R[0],isOffline:!0}:null},enabled:!!i,initialData:null});console.log("Farmer Detail",c);const{data:p=[]}=bn({queryKey:["lands"],queryFn:async()=>{let I=[];try{const K=await mt.entities.Land.list("-created_date");typeof K=="string"&&K.includes("<!doctype html>")?console.warn("Server returned HTML for Land list"):Array.isArray(K)&&(I=K)}catch{console.warn("Server lands unreachable")}const R=await Tr.getEntities("lands"),$=new js;I.forEach(K=>{K.id&&$.set(K.id,K)}),R.forEach(K=>{K.id&&$.set(K.id,K)});const V=Array.from($.values());return console.log("🔍 Dexie & Server Merge:",V.length,"items"),V}}),m=M.useMemo(()=>{const I=Array.isArray(p)?p:[];return console.log("Filtering lands for farmer ID:",i),I.filter(R=>R.farmer_id==i)},[p,i]),{data:y=[]}=bn({queryKey:["plants",i],queryFn:async()=>{try{const I=await mt.entities.Plant.filter({farmer_id:i});return Array.isArray(I)?I:[]}catch{return await Tr.getEntities("plants",{farmer_id:i})}},enabled:!!i}),b=Array.isArray(y)?y:[],P=ci({mutationFn:I=>mt.entities.Farmer.update(i,{verification_status:I}),onSuccess:()=>{n.invalidateQueries({queryKey:["farmer",i]}),Mt.success("Status verifikasi diperbarui!")}}),x=ci({mutationFn:I=>mt.entities.Farmer.update(i,I),onSuccess:()=>{n.invalidateQueries({queryKey:["farmer",i]}),Mt.success("Data petani diperbarui!"),o(!1)}});if(d)return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 flex items-center justify-center",children:h.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-emerald-600 border-t-transparent rounded-full"})});if(!c)return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-6",children:h.jsx(Qa,{icon:ll,title:"Petani tidak ditemukan",description:"Data petani yang Anda cari tidak tersedia",action:()=>window.location.href=ei("Farmers"),actionLabel:"Kembali ke Daftar"})});const w={pending:{bg:"bg-amber-50",border:"border-amber-200",text:"text-amber-700",icon:Hf},verified:{bg:"bg-emerald-50",border:"border-emerald-200",text:"text-emerald-700",icon:la},rejected:{bg:"bg-rose-50",border:"border-rose-200",text:"text-rose-700",icon:ph}},T=w[c.verification_status]||w.pending,E=T.icon;return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-5xl mx-auto p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx(zo,{to:ei("Farmers"),children:h.jsx(pt,{variant:"outline",size:"icon",className:"h-10 w-10",children:h.jsx(J0,{className:"w-5 h-5"})})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:c.full_name}),h.jsxs("p",{className:"text-slate-500",children:["NIK: ",c.nik]})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(J8,{status:c.sync_status}),h.jsxs(pt,{variant:"outline",size:"sm",onClick:()=>o(!0),children:[h.jsx(aF,{className:"w-4 h-4 mr-2"}),"Edit"]})]})]}),a&&h.jsxs(Rt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:[h.jsx(Q8,{initialData:c,isLoading:x.isLoading,onSubmit:I=>x.mutate(I)}),h.jsx("div",{className:"flex justify-end mt-4",children:h.jsx(pt,{variant:"ghost",onClick:()=>o(!1),children:"Batal"})})]}),!a&&h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[h.jsx(Rt.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1},className:"lg:col-span-1",children:h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsxs(Pn,{className:"p-6",children:[h.jsxs("div",{className:"flex flex-col items-center text-center mb-6",children:[h.jsx("div",{className:"w-24 h-24 rounded-full bg-gradient-to-br from-emerald-100 to-emerald-200 flex items-center justify-center mb-4",children:c.photo_url?h.jsx("img",{src:c.photo_url,alt:c.full_name,className:"w-full h-full rounded-full object-cover"}):h.jsx("span",{className:"text-3xl font-bold text-emerald-700",children:(D=(k=c.full_name)==null?void 0:k.charAt(0))==null?void 0:D.toUpperCase()})}),h.jsx("h3",{className:"font-semibold text-lg text-slate-900",children:c.full_name}),h.jsxs("div",{className:`flex items-center gap-2 mt-2 px-3 py-1.5 rounded-full ${T.bg} ${T.border} border`,children:[h.jsx(E,{className:`w-4 h-4 ${T.text}`}),h.jsx("span",{className:`text-sm font-medium ${T.text}`,children:c.verification_status==="verified"?"Terverifikasi":c.verification_status==="rejected"?"Ditolak":"Menunggu Verifikasi"})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx($H,{className:"w-5 h-5 text-slate-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"NIK"}),h.jsx("p",{className:"font-medium text-slate-900",children:c.nik})]})]}),c.phone&&h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(Yh,{className:"w-5 h-5 text-slate-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Telepon"}),h.jsx("p",{className:"font-medium text-slate-900",children:c.phone})]})]}),c.farmer_group&&h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(ll,{className:"w-5 h-5 text-slate-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Kelompok Tani"}),h.jsx("p",{className:"font-medium text-slate-900",children:c.farmer_group})]})]}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(So,{className:"w-5 h-5 text-slate-400 mt-0.5"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Alamat"}),h.jsxs("p",{className:"font-medium text-slate-900",children:[c.village,", ",c.district,h.jsx("br",{}),c.regency,", ",c.province]})]})]})]}),c.verification_status==="pending"&&h.jsxs("div",{className:"mt-6 pt-6 border-t border-slate-100 space-y-2",children:[h.jsx("p",{className:"text-sm text-slate-500 text-center mb-3",children:"Tindakan Verifikasi"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(pt,{className:"flex-1 bg-emerald-600 hover:bg-emerald-700",onClick:()=>P.mutate("verified"),disabled:P.isPending,children:[h.jsx(la,{className:"w-4 h-4 mr-2"}),"Terima"]}),h.jsxs(pt,{variant:"destructive",className:"flex-1",onClick:()=>P.mutate("rejected"),disabled:P.isPending,children:[h.jsx(ph,{className:"w-4 h-4 mr-2"}),"Tolak"]})]})]}),!c.user_email&&h.jsx("div",{className:"mt-6 pt-6 border-t border-slate-100",children:h.jsx(j1e,{farmerId:c.id,onLinked:()=>n.invalidateQueries({queryKey:["farmer",i]})})}),c.user_email&&h.jsxs("div",{className:"mt-6 pt-6 border-t border-slate-100",children:[h.jsx("p",{className:"text-xs text-slate-500 text-center mb-2",children:"Akun Terhubung"}),h.jsx("p",{className:"text-sm font-medium text-center text-emerald-600",children:c.user_email})]})]})})}),h.jsxs(Rt.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:"lg:col-span-2 space-y-6",children:[h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsxs(Ti,{className:"flex flex-row items-center justify-between pb-4",children:[h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(js,{className:"w-5 h-5 text-emerald-600"}),"Lahan Terdaftar"]}),h.jsx(zo,{to:ei("LandRegister")+`?farmer_id=${i}`,children:h.jsxs(pt,{size:"sm",variant:"outline",children:[h.jsx(Dc,{className:"w-4 h-4 mr-2"}),"Tambah Lahan"]})})]}),h.jsx(Pn,{children:m.length>0?h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:m.map(I=>h.jsx(Sk,{land:I,plantCount:b.filter(R=>R.land_id===I.id).length},I.id))}):h.jsxs("div",{className:"text-center py-8 text-slate-500",children:[h.jsx(js,{className:"w-12 h-12 mx-auto text-slate-300 mb-3"}),h.jsx("p",{children:"Belum ada lahan terdaftar"})]})})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsxs(Tt,{className:"border-0 shadow-sm p-4",children:[h.jsx("p",{className:"text-sm text-slate-500",children:"Total Lahan"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:m.length})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4",children:[h.jsx("p",{className:"text-sm text-slate-500",children:"Total Luas"}),h.jsxs("p",{className:"text-2xl font-bold text-slate-900",children:[m.reduce((I,R)=>I+(R.area_hectares||0),0).toFixed(2)," Ha"]})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4",children:[h.jsx("p",{className:"text-sm text-slate-500",children:"Total Tanaman"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:b.length})]})]})]})]})]})})}function eW(e,t){const n=M.useRef(t);M.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}const T1e=1;function E1e(e){return Object.freeze({__version:T1e,map:e})}function tW(e,t){return Object.freeze({...e,...t})}const nW=M.createContext(null),rW=nW.Provider;function lx(){const e=M.useContext(nW);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of <MapContainer>");return e}function iW(e){function t(n,r){const{instance:i,context:a}=e(n).current;return M.useImperativeHandle(r,()=>i),n.children==null?null:ce.createElement(rW,{value:a},n.children)}return M.forwardRef(t)}function A1e(e){function t(n,r){const[i,a]=M.useState(!1),{instance:o}=e(n,a).current;M.useImperativeHandle(r,()=>o),M.useEffect(function(){i&&o.update()},[o,i,n.children]);const s=o._contentNode;return s?Qh.createPortal(n.children,s):null}return M.forwardRef(t)}function k1e(e){function t(n,r){const{instance:i}=e(n).current;return M.useImperativeHandle(r,()=>i),null}return M.forwardRef(t)}function Pk(e,t){const n=M.useRef();M.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function ux(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function C1e(e,t){return function(r,i){const a=lx(),o=e(ux(r,a),a);return eW(a.map,r.attribution),Pk(o.current,r.eventHandlers),t(o.current,a,r,i),o}}var cm={exports:{}};/* @preserve
|
||
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
||
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||
*/var N1e=cm.exports,b$;function M1e(){return b$||(b$=1,(function(e,t){(function(n,r){r(t)})(N1e,(function(n){var r="1.9.4";function i(u){var g,S,C,U;for(S=1,C=arguments.length;S<C;S++){U=arguments[S];for(g in U)u[g]=U[g]}return u}var a=Object.create||(function(){function u(){}return function(g){return u.prototype=g,new u}})();function o(u,g){var S=Array.prototype.slice;if(u.bind)return u.bind.apply(u,S.call(arguments,1));var C=S.call(arguments,2);return function(){return u.apply(g,C.length?C.concat(S.call(arguments)):arguments)}}var s=0;function c(u){return"_leaflet_id"in u||(u._leaflet_id=++s),u._leaflet_id}function d(u,g,S){var C,U,Q,le;return le=function(){C=!1,U&&(Q.apply(S,U),U=!1)},Q=function(){C?U=arguments:(u.apply(S,arguments),setTimeout(le,g),C=!0)},Q}function p(u,g,S){var C=g[1],U=g[0],Q=C-U;return u===C&&S?u:((u-U)%Q+Q)%Q+U}function m(){return!1}function y(u,g){if(g===!1)return u;var S=Math.pow(10,g===void 0?6:g);return Math.round(u*S)/S}function b(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function P(u){return b(u).split(/\s+/)}function x(u,g){Object.prototype.hasOwnProperty.call(u,"options")||(u.options=u.options?a(u.options):{});for(var S in g)u.options[S]=g[S];return u.options}function w(u,g,S){var C=[];for(var U in u)C.push(encodeURIComponent(S?U.toUpperCase():U)+"="+encodeURIComponent(u[U]));return(!g||g.indexOf("?")===-1?"?":"&")+C.join("&")}var T=/\{ *([\w_ -]+) *\}/g;function E(u,g){return u.replace(T,function(S,C){var U=g[C];if(U===void 0)throw new Error("No value provided for variable "+S);return typeof U=="function"&&(U=U(g)),U})}var k=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"};function D(u,g){for(var S=0;S<u.length;S++)if(u[S]===g)return S;return-1}var I="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function R(u){return window["webkit"+u]||window["moz"+u]||window["ms"+u]}var $=0;function V(u){var g=+new Date,S=Math.max(0,16-(g-$));return $=g+S,window.setTimeout(u,S)}var K=window.requestAnimationFrame||R("RequestAnimationFrame")||V,Z=window.cancelAnimationFrame||R("CancelAnimationFrame")||R("CancelRequestAnimationFrame")||function(u){window.clearTimeout(u)};function ee(u,g,S){if(S&&K===V)u.call(g);else return K.call(window,o(u,g))}function ne(u){u&&Z.call(window,u)}var oe={__proto__:null,extend:i,create:a,bind:o,get lastId(){return s},stamp:c,throttle:d,wrapNum:p,falseFn:m,formatNum:y,trim:b,splitWords:P,setOptions:x,getParamString:w,template:E,isArray:k,indexOf:D,emptyImageUrl:I,requestFn:K,cancelFn:Z,requestAnimFrame:ee,cancelAnimFrame:ne};function he(){}he.extend=function(u){var g=function(){x(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},S=g.__super__=this.prototype,C=a(S);C.constructor=g,g.prototype=C;for(var U in this)Object.prototype.hasOwnProperty.call(this,U)&&U!=="prototype"&&U!=="__super__"&&(g[U]=this[U]);return u.statics&&i(g,u.statics),u.includes&&(Se(u.includes),i.apply(null,[C].concat(u.includes))),i(C,u),delete C.statics,delete C.includes,C.options&&(C.options=S.options?a(S.options):{},i(C.options,u.options)),C._initHooks=[],C.callInitHooks=function(){if(!this._initHooksCalled){S.callInitHooks&&S.callInitHooks.call(this),this._initHooksCalled=!0;for(var Q=0,le=C._initHooks.length;Q<le;Q++)C._initHooks[Q].call(this)}},g},he.include=function(u){var g=this.prototype.options;return i(this.prototype,u),u.options&&(this.prototype.options=g,this.mergeOptions(u.options)),this},he.mergeOptions=function(u){return i(this.prototype.options,u),this},he.addInitHook=function(u){var g=Array.prototype.slice.call(arguments,1),S=typeof u=="function"?u:function(){this[u].apply(this,g)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(S),this};function Se(u){if(!(typeof L>"u"||!L||!L.Mixin)){u=k(u)?u:[u];for(var g=0;g<u.length;g++)u[g]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var fe={on:function(u,g,S){if(typeof u=="object")for(var C in u)this._on(C,u[C],g);else{u=P(u);for(var U=0,Q=u.length;U<Q;U++)this._on(u[U],g,S)}return this},off:function(u,g,S){if(!arguments.length)delete this._events;else if(typeof u=="object")for(var C in u)this._off(C,u[C],g);else{u=P(u);for(var U=arguments.length===1,Q=0,le=u.length;Q<le;Q++)U?this._off(u[Q]):this._off(u[Q],g,S)}return this},_on:function(u,g,S,C){if(typeof g!="function"){console.warn("wrong listener type: "+typeof g);return}if(this._listens(u,g,S)===!1){S===this&&(S=void 0);var U={fn:g,ctx:S};C&&(U.once=!0),this._events=this._events||{},this._events[u]=this._events[u]||[],this._events[u].push(U)}},_off:function(u,g,S){var C,U,Q;if(this._events&&(C=this._events[u],!!C)){if(arguments.length===1){if(this._firingCount)for(U=0,Q=C.length;U<Q;U++)C[U].fn=m;delete this._events[u];return}if(typeof g!="function"){console.warn("wrong listener type: "+typeof g);return}var le=this._listens(u,g,S);if(le!==!1){var Me=C[le];this._firingCount&&(Me.fn=m,this._events[u]=C=C.slice()),C.splice(le,1)}}},fire:function(u,g,S){if(!this.listens(u,S))return this;var C=i({},g,{type:u,target:this,sourceTarget:g&&g.sourceTarget||this});if(this._events){var U=this._events[u];if(U){this._firingCount=this._firingCount+1||1;for(var Q=0,le=U.length;Q<le;Q++){var Me=U[Q],Be=Me.fn;Me.once&&this.off(u,Be,Me.ctx),Be.call(Me.ctx||this,C)}this._firingCount--}}return S&&this._propagateEvent(C),this},listens:function(u,g,S,C){typeof u!="string"&&console.warn('"string" type argument expected');var U=g;typeof g!="function"&&(C=!!g,U=void 0,S=void 0);var Q=this._events&&this._events[u];if(Q&&Q.length&&this._listens(u,U,S)!==!1)return!0;if(C){for(var le in this._eventParents)if(this._eventParents[le].listens(u,g,S,C))return!0}return!1},_listens:function(u,g,S){if(!this._events)return!1;var C=this._events[u]||[];if(!g)return!!C.length;S===this&&(S=void 0);for(var U=0,Q=C.length;U<Q;U++)if(C[U].fn===g&&C[U].ctx===S)return U;return!1},once:function(u,g,S){if(typeof u=="object")for(var C in u)this._on(C,u[C],g,!0);else{u=P(u);for(var U=0,Q=u.length;U<Q;U++)this._on(u[U],g,S,!0)}return this},addEventParent:function(u){return this._eventParents=this._eventParents||{},this._eventParents[c(u)]=u,this},removeEventParent:function(u){return this._eventParents&&delete this._eventParents[c(u)],this},_propagateEvent:function(u){for(var g in this._eventParents)this._eventParents[g].fire(u.type,i({layer:u.target,propagatedFrom:u.target},u),!0)}};fe.addEventListener=fe.on,fe.removeEventListener=fe.clearAllEventListeners=fe.off,fe.addOneTimeEventListener=fe.once,fe.fireEvent=fe.fire,fe.hasEventListeners=fe.listens;var Oe=he.extend(fe);function re(u,g,S){this.x=S?Math.round(u):u,this.y=S?Math.round(g):g}var Ce=Math.trunc||function(u){return u>0?Math.floor(u):Math.ceil(u)};re.prototype={clone:function(){return new re(this.x,this.y)},add:function(u){return this.clone()._add(ae(u))},_add:function(u){return this.x+=u.x,this.y+=u.y,this},subtract:function(u){return this.clone()._subtract(ae(u))},_subtract:function(u){return this.x-=u.x,this.y-=u.y,this},divideBy:function(u){return this.clone()._divideBy(u)},_divideBy:function(u){return this.x/=u,this.y/=u,this},multiplyBy:function(u){return this.clone()._multiplyBy(u)},_multiplyBy:function(u){return this.x*=u,this.y*=u,this},scaleBy:function(u){return new re(this.x*u.x,this.y*u.y)},unscaleBy:function(u){return new re(this.x/u.x,this.y/u.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Ce(this.x),this.y=Ce(this.y),this},distanceTo:function(u){u=ae(u);var g=u.x-this.x,S=u.y-this.y;return Math.sqrt(g*g+S*S)},equals:function(u){return u=ae(u),u.x===this.x&&u.y===this.y},contains:function(u){return u=ae(u),Math.abs(u.x)<=Math.abs(this.x)&&Math.abs(u.y)<=Math.abs(this.y)},toString:function(){return"Point("+y(this.x)+", "+y(this.y)+")"}};function ae(u,g,S){return u instanceof re?u:k(u)?new re(u[0],u[1]):u==null?u:typeof u=="object"&&"x"in u&&"y"in u?new re(u.x,u.y):new re(u,g,S)}function ie(u,g){if(u)for(var S=g?[u,g]:u,C=0,U=S.length;C<U;C++)this.extend(S[C])}ie.prototype={extend:function(u){var g,S;if(!u)return this;if(u instanceof re||typeof u[0]=="number"||"x"in u)g=S=ae(u);else if(u=de(u),g=u.min,S=u.max,!g||!S)return this;return!this.min&&!this.max?(this.min=g.clone(),this.max=S.clone()):(this.min.x=Math.min(g.x,this.min.x),this.max.x=Math.max(S.x,this.max.x),this.min.y=Math.min(g.y,this.min.y),this.max.y=Math.max(S.y,this.max.y)),this},getCenter:function(u){return ae((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,u)},getBottomLeft:function(){return ae(this.min.x,this.max.y)},getTopRight:function(){return ae(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(u){var g,S;return typeof u[0]=="number"||u instanceof re?u=ae(u):u=de(u),u instanceof ie?(g=u.min,S=u.max):g=S=u,g.x>=this.min.x&&S.x<=this.max.x&&g.y>=this.min.y&&S.y<=this.max.y},intersects:function(u){u=de(u);var g=this.min,S=this.max,C=u.min,U=u.max,Q=U.x>=g.x&&C.x<=S.x,le=U.y>=g.y&&C.y<=S.y;return Q&&le},overlaps:function(u){u=de(u);var g=this.min,S=this.max,C=u.min,U=u.max,Q=U.x>g.x&&C.x<S.x,le=U.y>g.y&&C.y<S.y;return Q&&le},isValid:function(){return!!(this.min&&this.max)},pad:function(u){var g=this.min,S=this.max,C=Math.abs(g.x-S.x)*u,U=Math.abs(g.y-S.y)*u;return de(ae(g.x-C,g.y-U),ae(S.x+C,S.y+U))},equals:function(u){return u?(u=de(u),this.min.equals(u.getTopLeft())&&this.max.equals(u.getBottomRight())):!1}};function de(u,g){return!u||u instanceof ie?u:new ie(u,g)}function He(u,g){if(u)for(var S=g?[u,g]:u,C=0,U=S.length;C<U;C++)this.extend(S[C])}He.prototype={extend:function(u){var g=this._southWest,S=this._northEast,C,U;if(u instanceof $e)C=u,U=u;else if(u instanceof He){if(C=u._southWest,U=u._northEast,!C||!U)return this}else return u?this.extend(We(u)||je(u)):this;return!g&&!S?(this._southWest=new $e(C.lat,C.lng),this._northEast=new $e(U.lat,U.lng)):(g.lat=Math.min(C.lat,g.lat),g.lng=Math.min(C.lng,g.lng),S.lat=Math.max(U.lat,S.lat),S.lng=Math.max(U.lng,S.lng)),this},pad:function(u){var g=this._southWest,S=this._northEast,C=Math.abs(g.lat-S.lat)*u,U=Math.abs(g.lng-S.lng)*u;return new He(new $e(g.lat-C,g.lng-U),new $e(S.lat+C,S.lng+U))},getCenter:function(){return new $e((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new $e(this.getNorth(),this.getWest())},getSouthEast:function(){return new $e(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(u){typeof u[0]=="number"||u instanceof $e||"lat"in u?u=We(u):u=je(u);var g=this._southWest,S=this._northEast,C,U;return u instanceof He?(C=u.getSouthWest(),U=u.getNorthEast()):C=U=u,C.lat>=g.lat&&U.lat<=S.lat&&C.lng>=g.lng&&U.lng<=S.lng},intersects:function(u){u=je(u);var g=this._southWest,S=this._northEast,C=u.getSouthWest(),U=u.getNorthEast(),Q=U.lat>=g.lat&&C.lat<=S.lat,le=U.lng>=g.lng&&C.lng<=S.lng;return Q&&le},overlaps:function(u){u=je(u);var g=this._southWest,S=this._northEast,C=u.getSouthWest(),U=u.getNorthEast(),Q=U.lat>g.lat&&C.lat<S.lat,le=U.lng>g.lng&&C.lng<S.lng;return Q&&le},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(u,g){return u?(u=je(u),this._southWest.equals(u.getSouthWest(),g)&&this._northEast.equals(u.getNorthEast(),g)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function je(u,g){return u instanceof He?u:new He(u,g)}function $e(u,g,S){if(isNaN(u)||isNaN(g))throw new Error("Invalid LatLng object: ("+u+", "+g+")");this.lat=+u,this.lng=+g,S!==void 0&&(this.alt=+S)}$e.prototype={equals:function(u,g){if(!u)return!1;u=We(u);var S=Math.max(Math.abs(this.lat-u.lat),Math.abs(this.lng-u.lng));return S<=(g===void 0?1e-9:g)},toString:function(u){return"LatLng("+y(this.lat,u)+", "+y(this.lng,u)+")"},distanceTo:function(u){return rt.distance(this,We(u))},wrap:function(){return rt.wrapLatLng(this)},toBounds:function(u){var g=180*u/40075017,S=g/Math.cos(Math.PI/180*this.lat);return je([this.lat-g,this.lng-S],[this.lat+g,this.lng+S])},clone:function(){return new $e(this.lat,this.lng,this.alt)}};function We(u,g,S){return u instanceof $e?u:k(u)&&typeof u[0]!="object"?u.length===3?new $e(u[0],u[1],u[2]):u.length===2?new $e(u[0],u[1]):null:u==null?u:typeof u=="object"&&"lat"in u?new $e(u.lat,"lng"in u?u.lng:u.lon,u.alt):g===void 0?null:new $e(u,g,S)}var Ye={latLngToPoint:function(u,g){var S=this.projection.project(u),C=this.scale(g);return this.transformation._transform(S,C)},pointToLatLng:function(u,g){var S=this.scale(g),C=this.transformation.untransform(u,S);return this.projection.unproject(C)},project:function(u){return this.projection.project(u)},unproject:function(u){return this.projection.unproject(u)},scale:function(u){return 256*Math.pow(2,u)},zoom:function(u){return Math.log(u/256)/Math.LN2},getProjectedBounds:function(u){if(this.infinite)return null;var g=this.projection.bounds,S=this.scale(u),C=this.transformation.transform(g.min,S),U=this.transformation.transform(g.max,S);return new ie(C,U)},infinite:!1,wrapLatLng:function(u){var g=this.wrapLng?p(u.lng,this.wrapLng,!0):u.lng,S=this.wrapLat?p(u.lat,this.wrapLat,!0):u.lat,C=u.alt;return new $e(S,g,C)},wrapLatLngBounds:function(u){var g=u.getCenter(),S=this.wrapLatLng(g),C=g.lat-S.lat,U=g.lng-S.lng;if(C===0&&U===0)return u;var Q=u.getSouthWest(),le=u.getNorthEast(),Me=new $e(Q.lat-C,Q.lng-U),Be=new $e(le.lat-C,le.lng-U);return new He(Me,Be)}},rt=i({},Ye,{wrapLng:[-180,180],R:6371e3,distance:function(u,g){var S=Math.PI/180,C=u.lat*S,U=g.lat*S,Q=Math.sin((g.lat-u.lat)*S/2),le=Math.sin((g.lng-u.lng)*S/2),Me=Q*Q+Math.cos(C)*Math.cos(U)*le*le,Be=2*Math.atan2(Math.sqrt(Me),Math.sqrt(1-Me));return this.R*Be}}),ze=6378137,Fe={R:ze,MAX_LATITUDE:85.0511287798,project:function(u){var g=Math.PI/180,S=this.MAX_LATITUDE,C=Math.max(Math.min(S,u.lat),-S),U=Math.sin(C*g);return new re(this.R*u.lng*g,this.R*Math.log((1+U)/(1-U))/2)},unproject:function(u){var g=180/Math.PI;return new $e((2*Math.atan(Math.exp(u.y/this.R))-Math.PI/2)*g,u.x*g/this.R)},bounds:(function(){var u=ze*Math.PI;return new ie([-u,-u],[u,u])})()};function st(u,g,S,C){if(k(u)){this._a=u[0],this._b=u[1],this._c=u[2],this._d=u[3];return}this._a=u,this._b=g,this._c=S,this._d=C}st.prototype={transform:function(u,g){return this._transform(u.clone(),g)},_transform:function(u,g){return g=g||1,u.x=g*(this._a*u.x+this._b),u.y=g*(this._c*u.y+this._d),u},untransform:function(u,g){return g=g||1,new re((u.x/g-this._b)/this._a,(u.y/g-this._d)/this._c)}};function Te(u,g,S,C){return new st(u,g,S,C)}var Dt=i({},rt,{code:"EPSG:3857",projection:Fe,transformation:(function(){var u=.5/(Math.PI*Fe.R);return Te(u,.5,-u,.5)})()}),Lt=i({},Dt,{code:"EPSG:900913"});function dn(u){return document.createElementNS("http://www.w3.org/2000/svg",u)}function xn(u,g){var S="",C,U,Q,le,Me,Be;for(C=0,Q=u.length;C<Q;C++){for(Me=u[C],U=0,le=Me.length;U<le;U++)Be=Me[U],S+=(U?"L":"M")+Be.x+" "+Be.y;S+=g?_t.svg?"z":"x":""}return S||"M0 0"}var qn=document.documentElement.style,Ar="ActiveXObject"in window,Zr=Ar&&!document.addEventListener,$r="msLaunchUri"in navigator&&!("documentMode"in document),Bn=Rn("webkit"),_r=Rn("android"),fr=Rn("android 2")||Rn("android 3"),To=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ua=_r&&Rn("Google")&&To<537&&!("AudioNode"in window),Fr=!!window.opera,ca=!$r&&Rn("chrome"),Eo=Rn("gecko")&&!Bn&&!Fr&&!Ar,Vt=!ca&&Rn("safari"),Na=Rn("phantom"),Wi="OTransition"in qn,Ja=navigator.platform.indexOf("Win")===0,Ki=Ar&&"transition"in qn,Ho="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!fr,qr="MozPerspective"in qn,Pt=!window.L_DISABLE_3D&&(Ki||Ho||qr)&&!Wi&&!Na,Ci=typeof orientation<"u"||Rn("mobile"),fa=Ci&&Bn,lt=Ci&&Ho,ht=!window.PointerEvent&&window.MSPointerEvent,Ma=!!(window.PointerEvent||ht),vr="ontouchstart"in window||!!window.TouchEvent,Go=!window.L_NO_TOUCH&&(vr||Ma),Cs=Ci&&Fr,Zo=Ci&&Eo,eo=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Yl=(function(){var u=!1;try{var g=Object.defineProperty({},"passive",{get:function(){u=!0}});window.addEventListener("testPassiveEventSupport",m,g),window.removeEventListener("testPassiveEventSupport",m,g)}catch{}return u})(),ar=(function(){return!!document.createElement("canvas").getContext})(),da=!!(document.createElementNS&&dn("svg").createSVGRect),Ni=!!da&&(function(){var u=document.createElement("div");return u.innerHTML="<svg/>",(u.firstChild&&u.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ao=!da&&(function(){try{var u=document.createElement("div");u.innerHTML='<v:shape adj="1"/>';var g=u.firstChild;return g.style.behavior="url(#default#VML)",g&&typeof g.adj=="object"}catch{return!1}})(),An=navigator.platform.indexOf("Mac")===0,or=navigator.platform.indexOf("Linux")===0;function Rn(u){return navigator.userAgent.toLowerCase().indexOf(u)>=0}var _t={ie:Ar,ielt9:Zr,edge:$r,webkit:Bn,android:_r,android23:fr,androidStock:ua,opera:Fr,chrome:ca,gecko:Eo,safari:Vt,phantom:Na,opera12:Wi,win:Ja,ie3d:Ki,webkit3d:Ho,gecko3d:qr,any3d:Pt,mobile:Ci,mobileWebkit:fa,mobileWebkit3d:lt,msPointer:ht,pointer:Ma,touch:Go,touchNative:vr,mobileOpera:Cs,mobileGecko:Zo,retina:eo,passiveEvents:Yl,canvas:ar,svg:da,vml:Ao,inlineSvg:Ni,mac:An,linux:or},to=_t.msPointer?"MSPointerDown":"pointerdown",Ra=_t.msPointer?"MSPointerMove":"pointermove",$u=_t.msPointer?"MSPointerUp":"pointerup",Hi=_t.msPointer?"MSPointerCancel":"pointercancel",La={touchstart:to,touchmove:Ra,touchend:$u,touchcancel:Hi},Sr={touchstart:jn,touchmove:hi,touchend:hi,touchcancel:hi},ha={},Mi=!1;function Gi(u,g,S){return g==="touchstart"&&nr(),Sr[g]?(S=Sr[g].bind(this,S),u.addEventListener(La[g],S,!1),S):(console.warn("wrong event specified:",g),m)}function Ns(u,g,S){if(!La[g]){console.warn("wrong event specified:",g);return}u.removeEventListener(La[g],S,!1)}function Ia(u){ha[u.pointerId]=u}function vl(u){ha[u.pointerId]&&(ha[u.pointerId]=u)}function Da(u){delete ha[u.pointerId]}function nr(){Mi||(document.addEventListener(to,Ia,!0),document.addEventListener(Ra,vl,!0),document.addEventListener($u,Da,!0),document.addEventListener(Hi,Da,!0),Mi=!0)}function hi(u,g){if(g.pointerType!==(g.MSPOINTER_TYPE_MOUSE||"mouse")){g.touches=[];for(var S in ha)g.touches.push(ha[S]);g.changedTouches=[g],u(g)}}function jn(u,g){g.MSPOINTER_TYPE_TOUCH&&g.pointerType===g.MSPOINTER_TYPE_TOUCH&&X(g),hi(u,g)}function ko(u){var g={},S,C;for(C in u)S=u[C],g[C]=S&&S.bind?S.bind(u):S;return u=g,g.type="dblclick",g.detail=2,g.isTrusted=!1,g._simulated=!0,g}var pa=200;function Yo(u,g){u.addEventListener("dblclick",g);var S=0,C;function U(Q){if(Q.detail!==1){C=Q.detail;return}if(!(Q.pointerType==="mouse"||Q.sourceCapabilities&&!Q.sourceCapabilities.firesTouchEvents)){var le=Le(Q);if(!(le.some(function(Be){return Be instanceof HTMLLabelElement&&Be.attributes.for})&&!le.some(function(Be){return Be instanceof HTMLInputElement||Be instanceof HTMLSelectElement}))){var Me=Date.now();Me-S<=pa?(C++,C===2&&g(ko(Q))):C=1,S=Me}}}return u.addEventListener("click",U),{dblclick:g,simDblclick:U}}function Co(u,g){u.removeEventListener("dblclick",g.dblclick),u.removeEventListener("click",g.simDblclick)}var Xo=ma(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Ri=ma(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),pi=Ri==="webkitTransition"||Ri==="OTransition"?Ri+"End":"transitionend";function ln(u){return typeof u=="string"?document.getElementById(u):u}function Li(u,g){var S=u.style[g]||u.currentStyle&&u.currentStyle[g];if((!S||S==="auto")&&document.defaultView){var C=document.defaultView.getComputedStyle(u,null);S=C?C[g]:null}return S==="auto"?null:S}function ft(u,g,S){var C=document.createElement(u);return C.className=g||"",S&&S.appendChild(C),C}function $n(u){var g=u.parentNode;g&&g.removeChild(u)}function no(u){for(;u.firstChild;)u.removeChild(u.firstChild)}function Zi(u){var g=u.parentNode;g&&g.lastChild!==u&&g.appendChild(u)}function mi(u){var g=u.parentNode;g&&g.firstChild!==u&&g.insertBefore(u,g.firstChild)}function No(u,g){if(u.classList!==void 0)return u.classList.contains(g);var S=ro(u);return S.length>0&&new RegExp("(^|\\s)"+g+"(\\s|$)").test(S)}function qt(u,g){if(u.classList!==void 0)for(var S=P(g),C=0,U=S.length;C<U;C++)u.classList.add(S[C]);else if(!No(u,g)){var Q=ro(u);kn(u,(Q?Q+" ":"")+g)}}function zn(u,g){u.classList!==void 0?u.classList.remove(g):kn(u,b((" "+ro(u)+" ").replace(" "+g+" "," ")))}function kn(u,g){u.className.baseVal===void 0?u.className=g:u.className.baseVal=g}function ro(u){return u.correspondingElement&&(u=u.correspondingElement),u.className.baseVal===void 0?u.className:u.className.baseVal}function dr(u,g){"opacity"in u.style?u.style.opacity=g:"filter"in u.style&&io(u,g)}function io(u,g){var S=!1,C="DXImageTransform.Microsoft.Alpha";try{S=u.filters.item(C)}catch{if(g===1)return}g=Math.round(g*100),S?(S.Enabled=g!==100,S.Opacity=g):u.style.filter+=" progid:"+C+"(opacity="+g+")"}function ma(u){for(var g=document.documentElement.style,S=0;S<u.length;S++)if(u[S]in g)return u[S];return!1}function gi(u,g,S){var C=g||new re(0,0);u.style[Xo]=(_t.ie3d?"translate("+C.x+"px,"+C.y+"px)":"translate3d("+C.x+"px,"+C.y+"px,0)")+(S?" scale("+S+")":"")}function Un(u,g){u._leaflet_pos=g,_t.any3d?gi(u,g):(u.style.left=g.x+"px",u.style.top=g.y+"px")}function zr(u){return u._leaflet_pos||new re(0,0)}var un,ri,Ms;if("onselectstart"in document)un=function(){xt(window,"selectstart",X)},ri=function(){On(window,"selectstart",X)};else{var cn=ma(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);un=function(){if(cn){var u=document.documentElement.style;Ms=u[cn],u[cn]="none"}},ri=function(){cn&&(document.documentElement.style[cn]=Ms,Ms=void 0)}}function Qo(){xt(window,"dragstart",X)}function ao(){On(window,"dragstart",X)}var oo,sr;function Ii(u){for(;u.tabIndex===-1;)u=u.parentNode;u.style&&(Yr(),oo=u,sr=u.style.outlineStyle,u.style.outlineStyle="none",xt(window,"keydown",Yr))}function Yr(){oo&&(oo.style.outlineStyle=sr,oo=void 0,sr=void 0,On(window,"keydown",Yr))}function yr(u){do u=u.parentNode;while((!u.offsetWidth||!u.offsetHeight)&&u!==document.body);return u}function kr(u){var g=u.getBoundingClientRect();return{x:g.width/u.offsetWidth||1,y:g.height/u.offsetHeight||1,boundingClientRect:g}}var Ba={__proto__:null,TRANSFORM:Xo,TRANSITION:Ri,TRANSITION_END:pi,get:ln,getStyle:Li,create:ft,remove:$n,empty:no,toFront:Zi,toBack:mi,hasClass:No,addClass:qt,removeClass:zn,setClass:kn,getClass:ro,setOpacity:dr,testProp:ma,setTransform:gi,setPosition:Un,getPosition:zr,get disableTextSelection(){return un},get enableTextSelection(){return ri},disableImageDrag:Qo,enableImageDrag:ao,preventOutline:Ii,restoreOutline:Yr,getSizedParentNode:yr,getScale:kr};function xt(u,g,S,C){if(g&&typeof g=="object")for(var U in g)Xi(u,U,g[U],S);else{g=P(g);for(var Q=0,le=g.length;Q<le;Q++)Xi(u,g[Q],S,C)}return this}var gn="_leaflet_events";function On(u,g,S,C){if(arguments.length===1)$a(u),delete u[gn];else if(g&&typeof g=="object")for(var U in g)Rs(u,U,g[U],S);else if(g=P(g),arguments.length===2)$a(u,function(Me){return D(g,Me)!==-1});else for(var Q=0,le=g.length;Q<le;Q++)Rs(u,g[Q],S,C);return this}function $a(u,g){for(var S in u[gn]){var C=S.split(/\d/)[0];(!g||g(C))&&Rs(u,C,null,null,S)}}var Yi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Xi(u,g,S,C){var U=g+c(S)+(C?"_"+c(C):"");if(u[gn]&&u[gn][U])return this;var Q=function(Me){return S.call(C||u,Me||window.event)},le=Q;!_t.touchNative&&_t.pointer&&g.indexOf("touch")===0?Q=Gi(u,g,Q):_t.touch&&g==="dblclick"?Q=Yo(u,Q):"addEventListener"in u?g==="touchstart"||g==="touchmove"||g==="wheel"||g==="mousewheel"?u.addEventListener(Yi[g]||g,Q,_t.passiveEvents?{passive:!1}:!1):g==="mouseenter"||g==="mouseleave"?(Q=function(Me){Me=Me||window.event,Zt(u,Me)&&le(Me)},u.addEventListener(Yi[g],Q,!1)):u.addEventListener(g,le,!1):u.attachEvent("on"+g,Q),u[gn]=u[gn]||{},u[gn][U]=Q}function Rs(u,g,S,C,U){U=U||g+c(S)+(C?"_"+c(C):"");var Q=u[gn]&&u[gn][U];if(!Q)return this;!_t.touchNative&&_t.pointer&&g.indexOf("touch")===0?Ns(u,g,Q):_t.touch&&g==="dblclick"?Co(u,Q):"removeEventListener"in u?u.removeEventListener(Yi[g]||g,Q,!1):u.detachEvent("on"+g,Q),u[gn][U]=null}function A(u){return u.stopPropagation?u.stopPropagation():u.originalEvent?u.originalEvent._stopped=!0:u.cancelBubble=!0,this}function q(u){return Xi(u,"wheel",A),this}function H(u){return xt(u,"mousedown touchstart dblclick contextmenu",A),u._leaflet_disable_click=!0,this}function X(u){return u.preventDefault?u.preventDefault():u.returnValue=!1,this}function xe(u){return X(u),A(u),this}function Le(u){if(u.composedPath)return u.composedPath();for(var g=[],S=u.target;S;)g.push(S),S=S.parentNode;return g}function Ge(u,g){if(!g)return new re(u.clientX,u.clientY);var S=kr(g),C=S.boundingClientRect;return new re((u.clientX-C.left)/S.x-g.clientLeft,(u.clientY-C.top)/S.y-g.clientTop)}var zt=_t.linux&&_t.chrome?window.devicePixelRatio:_t.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Sn(u){return _t.edge?u.wheelDeltaY/2:u.deltaY&&u.deltaMode===0?-u.deltaY/zt:u.deltaY&&u.deltaMode===1?-u.deltaY*20:u.deltaY&&u.deltaMode===2?-u.deltaY*60:u.deltaX||u.deltaZ?0:u.wheelDelta?(u.wheelDeltaY||u.wheelDelta)/2:u.detail&&Math.abs(u.detail)<32765?-u.detail*20:u.detail?u.detail/-32765*60:0}function Zt(u,g){var S=g.relatedTarget;if(!S)return!0;try{for(;S&&S!==u;)S=S.parentNode}catch{return!1}return S!==u}var Ln={__proto__:null,on:xt,off:On,stopPropagation:A,disableScrollPropagation:q,disableClickPropagation:H,preventDefault:X,stop:xe,getPropagationPath:Le,getMousePosition:Ge,getWheelDelta:Sn,isExternalTarget:Zt,addListener:xt,removeListener:On},Jn=Oe.extend({run:function(u,g,S,C){this.stop(),this._el=u,this._inProgress=!0,this._duration=S||.25,this._easeOutPower=1/Math.max(C||.5,.2),this._startPos=zr(u),this._offset=g.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=ee(this._animate,this),this._step()},_step:function(u){var g=+new Date-this._startTime,S=this._duration*1e3;g<S?this._runFrame(this._easeOut(g/S),u):(this._runFrame(1),this._complete())},_runFrame:function(u,g){var S=this._startPos.add(this._offset.multiplyBy(u));g&&S._round(),Un(this._el,S),this.fire("step")},_complete:function(){ne(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(u){return 1-Math.pow(1-u,this._easeOutPower)}}),rn=Oe.extend({options:{crs:Dt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(u,g){g=x(this,g),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(u),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),g.maxBounds&&this.setMaxBounds(g.maxBounds),g.zoom!==void 0&&(this._zoom=this._limitZoom(g.zoom)),g.center&&g.zoom!==void 0&&this.setView(We(g.center),g.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Ri&&_t.any3d&&!_t.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),xt(this._proxy,pi,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(u,g,S){if(g=g===void 0?this._zoom:this._limitZoom(g),u=this._limitCenter(We(u),g,this.options.maxBounds),S=S||{},this._stop(),this._loaded&&!S.reset&&S!==!0){S.animate!==void 0&&(S.zoom=i({animate:S.animate},S.zoom),S.pan=i({animate:S.animate,duration:S.duration},S.pan));var C=this._zoom!==g?this._tryAnimatedZoom&&this._tryAnimatedZoom(u,g,S.zoom):this._tryAnimatedPan(u,S.pan);if(C)return clearTimeout(this._sizeTimer),this}return this._resetView(u,g,S.pan&&S.pan.noMoveStart),this},setZoom:function(u,g){return this._loaded?this.setView(this.getCenter(),u,{zoom:g}):(this._zoom=u,this)},zoomIn:function(u,g){return u=u||(_t.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+u,g)},zoomOut:function(u,g){return u=u||(_t.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-u,g)},setZoomAround:function(u,g,S){var C=this.getZoomScale(g),U=this.getSize().divideBy(2),Q=u instanceof re?u:this.latLngToContainerPoint(u),le=Q.subtract(U).multiplyBy(1-1/C),Me=this.containerPointToLatLng(U.add(le));return this.setView(Me,g,{zoom:S})},_getBoundsCenterZoom:function(u,g){g=g||{},u=u.getBounds?u.getBounds():je(u);var S=ae(g.paddingTopLeft||g.padding||[0,0]),C=ae(g.paddingBottomRight||g.padding||[0,0]),U=this.getBoundsZoom(u,!1,S.add(C));if(U=typeof g.maxZoom=="number"?Math.min(g.maxZoom,U):U,U===1/0)return{center:u.getCenter(),zoom:U};var Q=C.subtract(S).divideBy(2),le=this.project(u.getSouthWest(),U),Me=this.project(u.getNorthEast(),U),Be=this.unproject(le.add(Me).divideBy(2).add(Q),U);return{center:Be,zoom:U}},fitBounds:function(u,g){if(u=je(u),!u.isValid())throw new Error("Bounds are not valid.");var S=this._getBoundsCenterZoom(u,g);return this.setView(S.center,S.zoom,g)},fitWorld:function(u){return this.fitBounds([[-90,-180],[90,180]],u)},panTo:function(u,g){return this.setView(u,this._zoom,{pan:g})},panBy:function(u,g){if(u=ae(u).round(),g=g||{},!u.x&&!u.y)return this.fire("moveend");if(g.animate!==!0&&!this.getSize().contains(u))return this._resetView(this.unproject(this.project(this.getCenter()).add(u)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Jn,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),g.noMoveStart||this.fire("movestart"),g.animate!==!1){qt(this._mapPane,"leaflet-pan-anim");var S=this._getMapPanePos().subtract(u).round();this._panAnim.run(this._mapPane,S,g.duration||.25,g.easeLinearity)}else this._rawPanBy(u),this.fire("move").fire("moveend");return this},flyTo:function(u,g,S){if(S=S||{},S.animate===!1||!_t.any3d)return this.setView(u,g,S);this._stop();var C=this.project(this.getCenter()),U=this.project(u),Q=this.getSize(),le=this._zoom;u=We(u),g=g===void 0?le:g;var Me=Math.max(Q.x,Q.y),Be=Me*this.getZoomScale(le,g),Xe=U.distanceTo(C)||1,yt=1.42,Wt=yt*yt;function hn(Zn){var Hu=Zn?-1:1,xx=Zn?Be:Me,wx=Be*Be-Me*Me+Hu*Wt*Wt*Xe*Xe,tu=2*xx*Wt*Xe,nu=wx/tu,ru=Math.sqrt(nu*nu+1)-nu,yd=ru<1e-9?-18:Math.log(ru);return yd}function xi(Zn){return(Math.exp(Zn)-Math.exp(-Zn))/2}function oi(Zn){return(Math.exp(Zn)+Math.exp(-Zn))/2}function Va(Zn){return xi(Zn)/oi(Zn)}var ba=hn(0);function Wu(Zn){return Me*(oi(ba)/oi(ba+yt*Zn))}function xp(Zn){return Me*(oi(ba)*Va(ba+yt*Zn)-xi(ba))/Wt}function _l(Zn){return 1-Math.pow(1-Zn,1.5)}var Kg=Date.now(),eu=(hn(1)-ba)/yt,as=S.duration?1e3*S.duration:1e3*eu*.8;function Ku(){var Zn=(Date.now()-Kg)/as,Hu=_l(Zn)*eu;Zn<=1?(this._flyToFrame=ee(Ku,this),this._move(this.unproject(C.add(U.subtract(C).multiplyBy(xp(Hu)/Xe)),le),this.getScaleZoom(Me/Wu(Hu),le),{flyTo:!0})):this._move(u,g)._moveEnd(!0)}return this._moveStart(!0,S.noMoveStart),Ku.call(this),this},flyToBounds:function(u,g){var S=this._getBoundsCenterZoom(u,g);return this.flyTo(S.center,S.zoom,g)},setMaxBounds:function(u){return u=je(u),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),u.isValid()?(this.options.maxBounds=u,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(u){var g=this.options.minZoom;return this.options.minZoom=u,this._loaded&&g!==u&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(u):this},setMaxZoom:function(u){var g=this.options.maxZoom;return this.options.maxZoom=u,this._loaded&&g!==u&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(u):this},panInsideBounds:function(u,g){this._enforcingBounds=!0;var S=this.getCenter(),C=this._limitCenter(S,this._zoom,je(u));return S.equals(C)||this.panTo(C,g),this._enforcingBounds=!1,this},panInside:function(u,g){g=g||{};var S=ae(g.paddingTopLeft||g.padding||[0,0]),C=ae(g.paddingBottomRight||g.padding||[0,0]),U=this.project(this.getCenter()),Q=this.project(u),le=this.getPixelBounds(),Me=de([le.min.add(S),le.max.subtract(C)]),Be=Me.getSize();if(!Me.contains(Q)){this._enforcingBounds=!0;var Xe=Q.subtract(Me.getCenter()),yt=Me.extend(Q).getSize().subtract(Be);U.x+=Xe.x<0?-yt.x:yt.x,U.y+=Xe.y<0?-yt.y:yt.y,this.panTo(this.unproject(U),g),this._enforcingBounds=!1}return this},invalidateSize:function(u){if(!this._loaded)return this;u=i({animate:!1,pan:!0},u===!0?{animate:!0}:u);var g=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var S=this.getSize(),C=g.divideBy(2).round(),U=S.divideBy(2).round(),Q=C.subtract(U);return!Q.x&&!Q.y?this:(u.animate&&u.pan?this.panBy(Q):(u.pan&&this._rawPanBy(Q),this.fire("move"),u.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:g,newSize:S}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(u){if(u=this._locateOptions=i({timeout:1e4,watch:!1},u),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var g=o(this._handleGeolocationResponse,this),S=o(this._handleGeolocationError,this);return u.watch?this._locationWatchId=navigator.geolocation.watchPosition(g,S,u):navigator.geolocation.getCurrentPosition(g,S,u),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(u){if(this._container._leaflet_id){var g=u.code,S=u.message||(g===1?"permission denied":g===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:g,message:"Geolocation error: "+S+"."})}},_handleGeolocationResponse:function(u){if(this._container._leaflet_id){var g=u.coords.latitude,S=u.coords.longitude,C=new $e(g,S),U=C.toBounds(u.coords.accuracy*2),Q=this._locateOptions;if(Q.setView){var le=this.getBoundsZoom(U);this.setView(C,Q.maxZoom?Math.min(le,Q.maxZoom):le)}var Me={latlng:C,bounds:U,timestamp:u.timestamp};for(var Be in u.coords)typeof u.coords[Be]=="number"&&(Me[Be]=u.coords[Be]);this.fire("locationfound",Me)}},addHandler:function(u,g){if(!g)return this;var S=this[u]=new g(this);return this._handlers.push(S),this.options[u]&&S.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),$n(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ne(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var u;for(u in this._layers)this._layers[u].remove();for(u in this._panes)$n(this._panes[u]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(u,g){var S="leaflet-pane"+(u?" leaflet-"+u.replace("Pane","")+"-pane":""),C=ft("div",S,g||this._mapPane);return u&&(this._panes[u]=C),C},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var u=this.getPixelBounds(),g=this.unproject(u.getBottomLeft()),S=this.unproject(u.getTopRight());return new He(g,S)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(u,g,S){u=je(u),S=ae(S||[0,0]);var C=this.getZoom()||0,U=this.getMinZoom(),Q=this.getMaxZoom(),le=u.getNorthWest(),Me=u.getSouthEast(),Be=this.getSize().subtract(S),Xe=de(this.project(Me,C),this.project(le,C)).getSize(),yt=_t.any3d?this.options.zoomSnap:1,Wt=Be.x/Xe.x,hn=Be.y/Xe.y,xi=g?Math.max(Wt,hn):Math.min(Wt,hn);return C=this.getScaleZoom(xi,C),yt&&(C=Math.round(C/(yt/100))*(yt/100),C=g?Math.ceil(C/yt)*yt:Math.floor(C/yt)*yt),Math.max(U,Math.min(Q,C))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new re(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(u,g){var S=this._getTopLeftPoint(u,g);return new ie(S,S.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(u){return this.options.crs.getProjectedBounds(u===void 0?this.getZoom():u)},getPane:function(u){return typeof u=="string"?this._panes[u]:u},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(u,g){var S=this.options.crs;return g=g===void 0?this._zoom:g,S.scale(u)/S.scale(g)},getScaleZoom:function(u,g){var S=this.options.crs;g=g===void 0?this._zoom:g;var C=S.zoom(u*S.scale(g));return isNaN(C)?1/0:C},project:function(u,g){return g=g===void 0?this._zoom:g,this.options.crs.latLngToPoint(We(u),g)},unproject:function(u,g){return g=g===void 0?this._zoom:g,this.options.crs.pointToLatLng(ae(u),g)},layerPointToLatLng:function(u){var g=ae(u).add(this.getPixelOrigin());return this.unproject(g)},latLngToLayerPoint:function(u){var g=this.project(We(u))._round();return g._subtract(this.getPixelOrigin())},wrapLatLng:function(u){return this.options.crs.wrapLatLng(We(u))},wrapLatLngBounds:function(u){return this.options.crs.wrapLatLngBounds(je(u))},distance:function(u,g){return this.options.crs.distance(We(u),We(g))},containerPointToLayerPoint:function(u){return ae(u).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(u){return ae(u).add(this._getMapPanePos())},containerPointToLatLng:function(u){var g=this.containerPointToLayerPoint(ae(u));return this.layerPointToLatLng(g)},latLngToContainerPoint:function(u){return this.layerPointToContainerPoint(this.latLngToLayerPoint(We(u)))},mouseEventToContainerPoint:function(u){return Ge(u,this._container)},mouseEventToLayerPoint:function(u){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(u))},mouseEventToLatLng:function(u){return this.layerPointToLatLng(this.mouseEventToLayerPoint(u))},_initContainer:function(u){var g=this._container=ln(u);if(g){if(g._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");xt(g,"scroll",this._onScroll,this),this._containerId=c(g)},_initLayout:function(){var u=this._container;this._fadeAnimated=this.options.fadeAnimation&&_t.any3d,qt(u,"leaflet-container"+(_t.touch?" leaflet-touch":"")+(_t.retina?" leaflet-retina":"")+(_t.ielt9?" leaflet-oldie":"")+(_t.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var g=Li(u,"position");g!=="absolute"&&g!=="relative"&&g!=="fixed"&&g!=="sticky"&&(u.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var u=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Un(this._mapPane,new re(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(qt(u.markerPane,"leaflet-zoom-hide"),qt(u.shadowPane,"leaflet-zoom-hide"))},_resetView:function(u,g,S){Un(this._mapPane,new re(0,0));var C=!this._loaded;this._loaded=!0,g=this._limitZoom(g),this.fire("viewprereset");var U=this._zoom!==g;this._moveStart(U,S)._move(u,g)._moveEnd(U),this.fire("viewreset"),C&&this.fire("load")},_moveStart:function(u,g){return u&&this.fire("zoomstart"),g||this.fire("movestart"),this},_move:function(u,g,S,C){g===void 0&&(g=this._zoom);var U=this._zoom!==g;return this._zoom=g,this._lastCenter=u,this._pixelOrigin=this._getNewPixelOrigin(u),C?S&&S.pinch&&this.fire("zoom",S):((U||S&&S.pinch)&&this.fire("zoom",S),this.fire("move",S)),this},_moveEnd:function(u){return u&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ne(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(u){Un(this._mapPane,this._getMapPanePos().subtract(u))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(u){this._targets={},this._targets[c(this._container)]=this;var g=u?On:xt;g(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&g(window,"resize",this._onResize,this),_t.any3d&&this.options.transform3DLimit&&(u?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ne(this._resizeRequest),this._resizeRequest=ee(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var u=this._getMapPanePos();Math.max(Math.abs(u.x),Math.abs(u.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(u,g){for(var S=[],C,U=g==="mouseout"||g==="mouseover",Q=u.target||u.srcElement,le=!1;Q;){if(C=this._targets[c(Q)],C&&(g==="click"||g==="preclick")&&this._draggableMoved(C)){le=!0;break}if(C&&C.listens(g,!0)&&(U&&!Zt(Q,u)||(S.push(C),U))||Q===this._container)break;Q=Q.parentNode}return!S.length&&!le&&!U&&this.listens(g,!0)&&(S=[this]),S},_isClickDisabled:function(u){for(;u&&u!==this._container;){if(u._leaflet_disable_click)return!0;u=u.parentNode}},_handleDOMEvent:function(u){var g=u.target||u.srcElement;if(!(!this._loaded||g._leaflet_disable_events||u.type==="click"&&this._isClickDisabled(g))){var S=u.type;S==="mousedown"&&Ii(g),this._fireDOMEvent(u,S)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(u,g,S){if(u.type==="click"){var C=i({},u);C.type="preclick",this._fireDOMEvent(C,C.type,S)}var U=this._findEventTargets(u,g);if(S){for(var Q=[],le=0;le<S.length;le++)S[le].listens(g,!0)&&Q.push(S[le]);U=Q.concat(U)}if(U.length){g==="contextmenu"&&X(u);var Me=U[0],Be={originalEvent:u};if(u.type!=="keypress"&&u.type!=="keydown"&&u.type!=="keyup"){var Xe=Me.getLatLng&&(!Me._radius||Me._radius<=10);Be.containerPoint=Xe?this.latLngToContainerPoint(Me.getLatLng()):this.mouseEventToContainerPoint(u),Be.layerPoint=this.containerPointToLayerPoint(Be.containerPoint),Be.latlng=Xe?Me.getLatLng():this.layerPointToLatLng(Be.layerPoint)}for(le=0;le<U.length;le++)if(U[le].fire(g,Be,!0),Be.originalEvent._stopped||U[le].options.bubblingMouseEvents===!1&&D(this._mouseEvents,g)!==-1)return}},_draggableMoved:function(u){return u=u.dragging&&u.dragging.enabled()?u:this,u.dragging&&u.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var u=0,g=this._handlers.length;u<g;u++)this._handlers[u].disable()},whenReady:function(u,g){return this._loaded?u.call(g||this,{target:this}):this.on("load",u,g),this},_getMapPanePos:function(){return zr(this._mapPane)||new re(0,0)},_moved:function(){var u=this._getMapPanePos();return u&&!u.equals([0,0])},_getTopLeftPoint:function(u,g){var S=u&&g!==void 0?this._getNewPixelOrigin(u,g):this.getPixelOrigin();return S.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(u,g){var S=this.getSize()._divideBy(2);return this.project(u,g)._subtract(S)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(u,g,S){var C=this._getNewPixelOrigin(S,g);return this.project(u,g)._subtract(C)},_latLngBoundsToNewLayerBounds:function(u,g,S){var C=this._getNewPixelOrigin(S,g);return de([this.project(u.getSouthWest(),g)._subtract(C),this.project(u.getNorthWest(),g)._subtract(C),this.project(u.getSouthEast(),g)._subtract(C),this.project(u.getNorthEast(),g)._subtract(C)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(u){return this.latLngToLayerPoint(u).subtract(this._getCenterLayerPoint())},_limitCenter:function(u,g,S){if(!S)return u;var C=this.project(u,g),U=this.getSize().divideBy(2),Q=new ie(C.subtract(U),C.add(U)),le=this._getBoundsOffset(Q,S,g);return Math.abs(le.x)<=1&&Math.abs(le.y)<=1?u:this.unproject(C.add(le),g)},_limitOffset:function(u,g){if(!g)return u;var S=this.getPixelBounds(),C=new ie(S.min.add(u),S.max.add(u));return u.add(this._getBoundsOffset(C,g))},_getBoundsOffset:function(u,g,S){var C=de(this.project(g.getNorthEast(),S),this.project(g.getSouthWest(),S)),U=C.min.subtract(u.min),Q=C.max.subtract(u.max),le=this._rebound(U.x,-Q.x),Me=this._rebound(U.y,-Q.y);return new re(le,Me)},_rebound:function(u,g){return u+g>0?Math.round(u-g)/2:Math.max(0,Math.ceil(u))-Math.max(0,Math.floor(g))},_limitZoom:function(u){var g=this.getMinZoom(),S=this.getMaxZoom(),C=_t.any3d?this.options.zoomSnap:1;return C&&(u=Math.round(u/C)*C),Math.max(g,Math.min(S,u))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){zn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(u,g){var S=this._getCenterOffset(u)._trunc();return(g&&g.animate)!==!0&&!this.getSize().contains(S)?!1:(this.panBy(S,g),!0)},_createAnimProxy:function(){var u=this._proxy=ft("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(u),this.on("zoomanim",function(g){var S=Xo,C=this._proxy.style[S];gi(this._proxy,this.project(g.center,g.zoom),this.getZoomScale(g.zoom,1)),C===this._proxy.style[S]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){$n(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var u=this.getCenter(),g=this.getZoom();gi(this._proxy,this.project(u,g),this.getZoomScale(g,1))},_catchTransitionEnd:function(u){this._animatingZoom&&u.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(u,g,S){if(this._animatingZoom)return!0;if(S=S||{},!this._zoomAnimated||S.animate===!1||this._nothingToAnimate()||Math.abs(g-this._zoom)>this.options.zoomAnimationThreshold)return!1;var C=this.getZoomScale(g),U=this._getCenterOffset(u)._divideBy(1-1/C);return S.animate!==!0&&!this.getSize().contains(U)?!1:(ee(function(){this._moveStart(!0,S.noMoveStart||!1)._animateZoom(u,g,!0)},this),!0)},_animateZoom:function(u,g,S,C){this._mapPane&&(S&&(this._animatingZoom=!0,this._animateToCenter=u,this._animateToZoom=g,qt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:u,zoom:g,noUpdate:C}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&zn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ga(u,g){return new rn(u,g)}var ii=he.extend({options:{position:"topright"},initialize:function(u){x(this,u)},getPosition:function(){return this.options.position},setPosition:function(u){var g=this._map;return g&&g.removeControl(this),this.options.position=u,g&&g.addControl(this),this},getContainer:function(){return this._container},addTo:function(u){this.remove(),this._map=u;var g=this._container=this.onAdd(u),S=this.getPosition(),C=u._controlCorners[S];return qt(g,"leaflet-control"),S.indexOf("bottom")!==-1?C.insertBefore(g,C.firstChild):C.appendChild(g),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?($n(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(u){this._map&&u&&u.screenX>0&&u.screenY>0&&this._map.getContainer().focus()}}),so=function(u){return new ii(u)};rn.include({addControl:function(u){return u.addTo(this),this},removeControl:function(u){return u.remove(),this},_initControlPos:function(){var u=this._controlCorners={},g="leaflet-",S=this._controlContainer=ft("div",g+"control-container",this._container);function C(U,Q){var le=g+U+" "+g+Q;u[U+Q]=ft("div",le,S)}C("top","left"),C("top","right"),C("bottom","left"),C("bottom","right")},_clearControlPos:function(){for(var u in this._controlCorners)$n(this._controlCorners[u]);$n(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var yl=ii.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(u,g,S,C){return S<C?-1:C<S?1:0}},initialize:function(u,g,S){x(this,S),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var C in u)this._addLayer(u[C],C);for(C in g)this._addLayer(g[C],C,!0)},onAdd:function(u){this._initLayout(),this._update(),this._map=u,u.on("zoomend",this._checkDisabledLayers,this);for(var g=0;g<this._layers.length;g++)this._layers[g].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(u){return ii.prototype.addTo.call(this,u),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var u=0;u<this._layers.length;u++)this._layers[u].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(u,g){return this._addLayer(u,g),this._map?this._update():this},addOverlay:function(u,g){return this._addLayer(u,g,!0),this._map?this._update():this},removeLayer:function(u){u.off("add remove",this._onLayerChange,this);var g=this._getLayer(c(u));return g&&this._layers.splice(this._layers.indexOf(g),1),this._map?this._update():this},expand:function(){qt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var u=this._map.getSize().y-(this._container.offsetTop+50);return u<this._section.clientHeight?(qt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=u+"px"):zn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return zn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var u="leaflet-control-layers",g=this._container=ft("div",u),S=this.options.collapsed;g.setAttribute("aria-haspopup",!0),H(g),q(g);var C=this._section=ft("section",u+"-list");S&&(this._map.on("click",this.collapse,this),xt(g,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var U=this._layersLink=ft("a",u+"-toggle",g);U.href="#",U.title="Layers",U.setAttribute("role","button"),xt(U,{keydown:function(Q){Q.keyCode===13&&this._expandSafely()},click:function(Q){X(Q),this._expandSafely()}},this),S||this.expand(),this._baseLayersList=ft("div",u+"-base",C),this._separator=ft("div",u+"-separator",C),this._overlaysList=ft("div",u+"-overlays",C),g.appendChild(C)},_getLayer:function(u){for(var g=0;g<this._layers.length;g++)if(this._layers[g]&&c(this._layers[g].layer)===u)return this._layers[g]},_addLayer:function(u,g,S){this._map&&u.on("add remove",this._onLayerChange,this),this._layers.push({layer:u,name:g,overlay:S}),this.options.sortLayers&&this._layers.sort(o(function(C,U){return this.options.sortFunction(C.layer,U.layer,C.name,U.name)},this)),this.options.autoZIndex&&u.setZIndex&&(this._lastZIndex++,u.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;no(this._baseLayersList),no(this._overlaysList),this._layerControlInputs=[];var u,g,S,C,U=0;for(S=0;S<this._layers.length;S++)C=this._layers[S],this._addItem(C),g=g||C.overlay,u=u||!C.overlay,U+=C.overlay?0:1;return this.options.hideSingleBase&&(u=u&&U>1,this._baseLayersList.style.display=u?"":"none"),this._separator.style.display=g&&u?"":"none",this},_onLayerChange:function(u){this._handlingClick||this._update();var g=this._getLayer(c(u.target)),S=g.overlay?u.type==="add"?"overlayadd":"overlayremove":u.type==="add"?"baselayerchange":null;S&&this._map.fire(S,g)},_createRadioElement:function(u,g){var S='<input type="radio" class="leaflet-control-layers-selector" name="'+u+'"'+(g?' checked="checked"':"")+"/>",C=document.createElement("div");return C.innerHTML=S,C.firstChild},_addItem:function(u){var g=document.createElement("label"),S=this._map.hasLayer(u.layer),C;u.overlay?(C=document.createElement("input"),C.type="checkbox",C.className="leaflet-control-layers-selector",C.defaultChecked=S):C=this._createRadioElement("leaflet-base-layers_"+c(this),S),this._layerControlInputs.push(C),C.layerId=c(u.layer),xt(C,"click",this._onInputClick,this);var U=document.createElement("span");U.innerHTML=" "+u.name;var Q=document.createElement("span");g.appendChild(Q),Q.appendChild(C),Q.appendChild(U);var le=u.overlay?this._overlaysList:this._baseLayersList;return le.appendChild(g),this._checkDisabledLayers(),g},_onInputClick:function(){if(!this._preventClick){var u=this._layerControlInputs,g,S,C=[],U=[];this._handlingClick=!0;for(var Q=u.length-1;Q>=0;Q--)g=u[Q],S=this._getLayer(g.layerId).layer,g.checked?C.push(S):g.checked||U.push(S);for(Q=0;Q<U.length;Q++)this._map.hasLayer(U[Q])&&this._map.removeLayer(U[Q]);for(Q=0;Q<C.length;Q++)this._map.hasLayer(C[Q])||this._map.addLayer(C[Q]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var u=this._layerControlInputs,g,S,C=this._map.getZoom(),U=u.length-1;U>=0;U--)g=u[U],S=this._getLayer(g.layerId).layer,g.disabled=S.options.minZoom!==void 0&&C<S.options.minZoom||S.options.maxZoom!==void 0&&C>S.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var u=this._section;this._preventClick=!0,xt(u,"click",X),this.expand();var g=this;setTimeout(function(){On(u,"click",X),g._preventClick=!1})}}),Jo=function(u,g,S){return new yl(u,g,S)},lo=ii.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(u){var g="leaflet-control-zoom",S=ft("div",g+" leaflet-bar"),C=this.options;return this._zoomInButton=this._createButton(C.zoomInText,C.zoomInTitle,g+"-in",S,this._zoomIn),this._zoomOutButton=this._createButton(C.zoomOutText,C.zoomOutTitle,g+"-out",S,this._zoomOut),this._updateDisabled(),u.on("zoomend zoomlevelschange",this._updateDisabled,this),S},onRemove:function(u){u.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(u){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(u.shiftKey?3:1))},_zoomOut:function(u){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(u.shiftKey?3:1))},_createButton:function(u,g,S,C,U){var Q=ft("a",S,C);return Q.innerHTML=u,Q.href="#",Q.title=g,Q.setAttribute("role","button"),Q.setAttribute("aria-label",g),H(Q),xt(Q,"click",xe),xt(Q,"click",U,this),xt(Q,"click",this._refocusOnMap,this),Q},_updateDisabled:function(){var u=this._map,g="leaflet-disabled";zn(this._zoomInButton,g),zn(this._zoomOutButton,g),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||u._zoom===u.getMinZoom())&&(qt(this._zoomOutButton,g),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||u._zoom===u.getMaxZoom())&&(qt(this._zoomInButton,g),this._zoomInButton.setAttribute("aria-disabled","true"))}});rn.mergeOptions({zoomControl:!0}),rn.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new lo,this.addControl(this.zoomControl))});var Xl=function(u){return new lo(u)},Cr=ii.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(u){var g="leaflet-control-scale",S=ft("div",g),C=this.options;return this._addScales(C,g+"-line",S),u.on(C.updateWhenIdle?"moveend":"move",this._update,this),u.whenReady(this._update,this),S},onRemove:function(u){u.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(u,g,S){u.metric&&(this._mScale=ft("div",g,S)),u.imperial&&(this._iScale=ft("div",g,S))},_update:function(){var u=this._map,g=u.getSize().y/2,S=u.distance(u.containerPointToLatLng([0,g]),u.containerPointToLatLng([this.options.maxWidth,g]));this._updateScales(S)},_updateScales:function(u){this.options.metric&&u&&this._updateMetric(u),this.options.imperial&&u&&this._updateImperial(u)},_updateMetric:function(u){var g=this._getRoundNum(u),S=g<1e3?g+" m":g/1e3+" km";this._updateScale(this._mScale,S,g/u)},_updateImperial:function(u){var g=u*3.2808399,S,C,U;g>5280?(S=g/5280,C=this._getRoundNum(S),this._updateScale(this._iScale,C+" mi",C/S)):(U=this._getRoundNum(g),this._updateScale(this._iScale,U+" ft",U/g))},_updateScale:function(u,g,S){u.style.width=Math.round(this.options.maxWidth*S)+"px",u.innerHTML=g},_getRoundNum:function(u){var g=Math.pow(10,(Math.floor(u)+"").length-1),S=u/g;return S=S>=10?10:S>=5?5:S>=3?3:S>=2?2:1,g*S}}),Fa=function(u){return new Cr(u)},es='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',uo=ii.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(_t.inlineSvg?es+" ":"")+"Leaflet</a>"},initialize:function(u){x(this,u),this._attributions={}},onAdd:function(u){u.attributionControl=this,this._container=ft("div","leaflet-control-attribution"),H(this._container);for(var g in u._layers)u._layers[g].getAttribution&&this.addAttribution(u._layers[g].getAttribution());return this._update(),u.on("layeradd",this._addAttribution,this),this._container},onRemove:function(u){u.off("layeradd",this._addAttribution,this)},_addAttribution:function(u){u.layer.getAttribution&&(this.addAttribution(u.layer.getAttribution()),u.layer.once("remove",function(){this.removeAttribution(u.layer.getAttribution())},this))},setPrefix:function(u){return this.options.prefix=u,this._update(),this},addAttribution:function(u){return u?(this._attributions[u]||(this._attributions[u]=0),this._attributions[u]++,this._update(),this):this},removeAttribution:function(u){return u?(this._attributions[u]&&(this._attributions[u]--,this._update()),this):this},_update:function(){if(this._map){var u=[];for(var g in this._attributions)this._attributions[g]&&u.push(g);var S=[];this.options.prefix&&S.push(this.options.prefix),u.length&&S.push(u.join(", ")),this._container.innerHTML=S.join(' <span aria-hidden="true">|</span> ')}}});rn.mergeOptions({attributionControl:!0}),rn.addInitHook(function(){this.options.attributionControl&&new uo().addTo(this)});var Jc=function(u){return new uo(u)};ii.Layers=yl,ii.Zoom=lo,ii.Scale=Cr,ii.Attribution=uo,so.layers=Jo,so.zoom=Xl,so.scale=Fa,so.attribution=Jc;var Pr=he.extend({initialize:function(u){this._map=u},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Pr.addTo=function(u,g){return u.addHandler(g,this),this};var Ls={Events:fe},co=_t.touch?"touchstart mousedown":"mousedown",vi=Oe.extend({options:{clickTolerance:3},initialize:function(u,g,S,C){x(this,C),this._element=u,this._dragStartTarget=g||u,this._preventOutline=S},enable:function(){this._enabled||(xt(this._dragStartTarget,co,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vi._dragging===this&&this.finishDrag(!0),On(this._dragStartTarget,co,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(u){if(this._enabled&&(this._moved=!1,!No(this._element,"leaflet-zoom-anim"))){if(u.touches&&u.touches.length!==1){vi._dragging===this&&this.finishDrag();return}if(!(vi._dragging||u.shiftKey||u.which!==1&&u.button!==1&&!u.touches)&&(vi._dragging=this,this._preventOutline&&Ii(this._element),Qo(),un(),!this._moving)){this.fire("down");var g=u.touches?u.touches[0]:u,S=yr(this._element);this._startPoint=new re(g.clientX,g.clientY),this._startPos=zr(this._element),this._parentScale=kr(S);var C=u.type==="mousedown";xt(document,C?"mousemove":"touchmove",this._onMove,this),xt(document,C?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(u){if(this._enabled){if(u.touches&&u.touches.length>1){this._moved=!0;return}var g=u.touches&&u.touches.length===1?u.touches[0]:u,S=new re(g.clientX,g.clientY)._subtract(this._startPoint);!S.x&&!S.y||Math.abs(S.x)+Math.abs(S.y)<this.options.clickTolerance||(S.x/=this._parentScale.x,S.y/=this._parentScale.y,X(u),this._moved||(this.fire("dragstart"),this._moved=!0,qt(document.body,"leaflet-dragging"),this._lastTarget=u.target||u.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),qt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(S),this._moving=!0,this._lastEvent=u,this._updatePosition())}},_updatePosition:function(){var u={originalEvent:this._lastEvent};this.fire("predrag",u),Un(this._element,this._newPos),this.fire("drag",u)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(u){zn(document.body,"leaflet-dragging"),this._lastTarget&&(zn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),On(document,"mousemove touchmove",this._onMove,this),On(document,"mouseup touchend touchcancel",this._onUp,this),ao(),ri();var g=this._moved&&this._moving;this._moving=!1,vi._dragging=!1,g&&this.fire("dragend",{noInertia:u,distance:this._newPos.distanceTo(this._startPos)})}});function Is(u,g,S){var C,U=[1,4,2,8],Q,le,Me,Be,Xe,yt,Wt,hn;for(Q=0,yt=u.length;Q<yt;Q++)u[Q]._code=va(u[Q],g);for(Me=0;Me<4;Me++){for(Wt=U[Me],C=[],Q=0,yt=u.length,le=yt-1;Q<yt;le=Q++)Be=u[Q],Xe=u[le],Be._code&Wt?Xe._code&Wt||(hn=rs(Xe,Be,Wt,g,S),hn._code=va(hn,g),C.push(hn)):(Xe._code&Wt&&(hn=rs(Xe,Be,Wt,g,S),hn._code=va(hn,g),C.push(hn)),C.push(Be));u=C}return u}function Nr(u,g){var S,C,U,Q,le,Me,Be,Xe,yt;if(!u||u.length===0)throw new Error("latlngs not passed");yi(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var Wt=We([0,0]),hn=je(u),xi=hn.getNorthWest().distanceTo(hn.getSouthWest())*hn.getNorthEast().distanceTo(hn.getNorthWest());xi<1700&&(Wt=Mo(u));var oi=u.length,Va=[];for(S=0;S<oi;S++){var ba=We(u[S]);Va.push(g.project(We([ba.lat-Wt.lat,ba.lng-Wt.lng])))}for(Me=Be=Xe=0,S=0,C=oi-1;S<oi;C=S++)U=Va[S],Q=Va[C],le=U.y*Q.x-Q.y*U.x,Be+=(U.x+Q.x)*le,Xe+=(U.y+Q.y)*le,Me+=le*3;Me===0?yt=Va[0]:yt=[Be/Me,Xe/Me];var Wu=g.unproject(ae(yt));return We([Wu.lat+Wt.lat,Wu.lng+Wt.lng])}function Mo(u){for(var g=0,S=0,C=0,U=0;U<u.length;U++){var Q=We(u[U]);g+=Q.lat,S+=Q.lng,C++}return We([g/C,S/C])}var Ds={__proto__:null,clipPolygon:Is,polygonCenter:Nr,centroid:Mo};function ts(u,g){if(!g||!u.length)return u.slice();var S=g*g;return u=Ql(u,S),u=qu(u,S),u}function Bs(u,g,S){return Math.sqrt(Qi(u,g,S,!0))}function Fu(u,g,S){return Qi(u,g,S)}function qu(u,g){var S=u.length,C=typeof Uint8Array<"u"?Uint8Array:Array,U=new C(S);U[0]=U[S-1]=1,ns(u,U,g,0,S-1);var Q,le=[];for(Q=0;Q<S;Q++)U[Q]&&le.push(u[Q]);return le}function ns(u,g,S,C,U){var Q=0,le,Me,Be;for(Me=C+1;Me<=U-1;Me++)Be=Qi(u[Me],u[C],u[U],!0),Be>Q&&(le=Me,Q=Be);Q>S&&(g[le]=1,ns(u,g,S,C,le),ns(u,g,S,le,U))}function Ql(u,g){for(var S=[u[0]],C=1,U=0,Q=u.length;C<Q;C++)Jl(u[C],u[U])>g&&(S.push(u[C]),U=C);return U<Q-1&&S.push(u[Q-1]),S}var qa;function $s(u,g,S,C,U){var Q=C?qa:va(u,S),le=va(g,S),Me,Be,Xe;for(qa=le;;){if(!(Q|le))return[u,g];if(Q&le)return!1;Me=Q||le,Be=rs(u,g,Me,S,U),Xe=va(Be,S),Me===Q?(u=Be,Q=Xe):(g=Be,le=Xe)}}function rs(u,g,S,C,U){var Q=g.x-u.x,le=g.y-u.y,Me=C.min,Be=C.max,Xe,yt;return S&8?(Xe=u.x+Q*(Be.y-u.y)/le,yt=Be.y):S&4?(Xe=u.x+Q*(Me.y-u.y)/le,yt=Me.y):S&2?(Xe=Be.x,yt=u.y+le*(Be.x-u.x)/Q):S&1&&(Xe=Me.x,yt=u.y+le*(Me.x-u.x)/Q),new re(Xe,yt,U)}function va(u,g){var S=0;return u.x<g.min.x?S|=1:u.x>g.max.x&&(S|=2),u.y<g.min.y?S|=4:u.y>g.max.y&&(S|=8),S}function Jl(u,g){var S=g.x-u.x,C=g.y-u.y;return S*S+C*C}function Qi(u,g,S,C){var U=g.x,Q=g.y,le=S.x-U,Me=S.y-Q,Be=le*le+Me*Me,Xe;return Be>0&&(Xe=((u.x-U)*le+(u.y-Q)*Me)/Be,Xe>1?(U=S.x,Q=S.y):Xe>0&&(U+=le*Xe,Q+=Me*Xe)),le=u.x-U,Me=u.y-Q,C?le*le+Me*Me:new re(U,Q)}function yi(u){return!k(u[0])||typeof u[0][0]!="object"&&typeof u[0][0]<"u"}function Fs(u){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),yi(u)}function is(u,g){var S,C,U,Q,le,Me,Be,Xe;if(!u||u.length===0)throw new Error("latlngs not passed");yi(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var yt=We([0,0]),Wt=je(u),hn=Wt.getNorthWest().distanceTo(Wt.getSouthWest())*Wt.getNorthEast().distanceTo(Wt.getNorthWest());hn<1700&&(yt=Mo(u));var xi=u.length,oi=[];for(S=0;S<xi;S++){var Va=We(u[S]);oi.push(g.project(We([Va.lat-yt.lat,Va.lng-yt.lng])))}for(S=0,C=0;S<xi-1;S++)C+=oi[S].distanceTo(oi[S+1])/2;if(C===0)Xe=oi[0];else for(S=0,Q=0;S<xi-1;S++)if(le=oi[S],Me=oi[S+1],U=le.distanceTo(Me),Q+=U,Q>C){Be=(Q-C)/U,Xe=[Me.x-Be*(Me.x-le.x),Me.y-Be*(Me.y-le.y)];break}var ba=g.unproject(ae(Xe));return We([ba.lat+yt.lat,ba.lng+yt.lng])}var Ne={__proto__:null,simplify:ts,pointToSegmentDistance:Bs,closestPointOnSegment:Fu,clipSegment:$s,_getEdgeIntersection:rs,_getBitCode:va,_sqClosestPointOnSegment:Qi,isFlat:yi,_flat:Fs,polylineCenter:is},Ze={project:function(u){return new re(u.lng,u.lat)},unproject:function(u){return new $e(u.y,u.x)},bounds:new ie([-180,-90],[180,90])},jt={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ie([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(u){var g=Math.PI/180,S=this.R,C=u.lat*g,U=this.R_MINOR/S,Q=Math.sqrt(1-U*U),le=Q*Math.sin(C),Me=Math.tan(Math.PI/4-C/2)/Math.pow((1-le)/(1+le),Q/2);return C=-S*Math.log(Math.max(Me,1e-10)),new re(u.lng*g*S,C)},unproject:function(u){for(var g=180/Math.PI,S=this.R,C=this.R_MINOR/S,U=Math.sqrt(1-C*C),Q=Math.exp(-u.y/S),le=Math.PI/2-2*Math.atan(Q),Me=0,Be=.1,Xe;Me<15&&Math.abs(Be)>1e-7;Me++)Xe=U*Math.sin(le),Xe=Math.pow((1-Xe)/(1+Xe),U/2),Be=Math.PI/2-2*Math.atan(Q*Xe)-le,le+=Be;return new $e(le*g,u.x*g/S)}},$t={__proto__:null,LonLat:Ze,Mercator:jt,SphericalMercator:Fe},an=i({},rt,{code:"EPSG:3395",projection:jt,transformation:(function(){var u=.5/(Math.PI*jt.R);return Te(u,.5,-u,.5)})()}),Tn=i({},rt,{code:"EPSG:4326",projection:Ze,transformation:Te(1/180,1,-1/180,.5)}),Ji=i({},Ye,{projection:Ze,transformation:Te(1,0,-1,0),scale:function(u){return Math.pow(2,u)},zoom:function(u){return Math.log(u)/Math.LN2},distance:function(u,g){var S=g.lng-u.lng,C=g.lat-u.lat;return Math.sqrt(S*S+C*C)},infinite:!0});Ye.Earth=rt,Ye.EPSG3395=an,Ye.EPSG3857=Dt,Ye.EPSG900913=Lt,Ye.EPSG4326=Tn,Ye.Simple=Ji;var Gn=Oe.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(u){return u.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(u){return u&&u.removeLayer(this),this},getPane:function(u){return this._map.getPane(u?this.options[u]||u:this.options.pane)},addInteractiveTarget:function(u){return this._map._targets[c(u)]=this,this},removeInteractiveTarget:function(u){return delete this._map._targets[c(u)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(u){var g=u.target;if(g.hasLayer(this)){if(this._map=g,this._zoomAnimated=g._zoomAnimated,this.getEvents){var S=this.getEvents();g.on(S,this),this.once("remove",function(){g.off(S,this)},this)}this.onAdd(g),this.fire("add"),g.fire("layeradd",{layer:this})}}});rn.include({addLayer:function(u){if(!u._layerAdd)throw new Error("The provided object is not a Layer.");var g=c(u);return this._layers[g]?this:(this._layers[g]=u,u._mapToAdd=this,u.beforeAdd&&u.beforeAdd(this),this.whenReady(u._layerAdd,u),this)},removeLayer:function(u){var g=c(u);return this._layers[g]?(this._loaded&&u.onRemove(this),delete this._layers[g],this._loaded&&(this.fire("layerremove",{layer:u}),u.fire("remove")),u._map=u._mapToAdd=null,this):this},hasLayer:function(u){return c(u)in this._layers},eachLayer:function(u,g){for(var S in this._layers)u.call(g,this._layers[S]);return this},_addLayers:function(u){u=u?k(u)?u:[u]:[];for(var g=0,S=u.length;g<S;g++)this.addLayer(u[g])},_addZoomLimit:function(u){(!isNaN(u.options.maxZoom)||!isNaN(u.options.minZoom))&&(this._zoomBoundLayers[c(u)]=u,this._updateZoomLevels())},_removeZoomLimit:function(u){var g=c(u);this._zoomBoundLayers[g]&&(delete this._zoomBoundLayers[g],this._updateZoomLevels())},_updateZoomLevels:function(){var u=1/0,g=-1/0,S=this._getZoomSpan();for(var C in this._zoomBoundLayers){var U=this._zoomBoundLayers[C].options;u=U.minZoom===void 0?u:Math.min(u,U.minZoom),g=U.maxZoom===void 0?g:Math.max(g,U.maxZoom)}this._layersMaxZoom=g===-1/0?void 0:g,this._layersMinZoom=u===1/0?void 0:u,S!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Mr=Gn.extend({initialize:function(u,g){x(this,g),this._layers={};var S,C;if(u)for(S=0,C=u.length;S<C;S++)this.addLayer(u[S])},addLayer:function(u){var g=this.getLayerId(u);return this._layers[g]=u,this._map&&this._map.addLayer(u),this},removeLayer:function(u){var g=u in this._layers?u:this.getLayerId(u);return this._map&&this._layers[g]&&this._map.removeLayer(this._layers[g]),delete this._layers[g],this},hasLayer:function(u){var g=typeof u=="number"?u:this.getLayerId(u);return g in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(u){var g=Array.prototype.slice.call(arguments,1),S,C;for(S in this._layers)C=this._layers[S],C[u]&&C[u].apply(C,g);return this},onAdd:function(u){this.eachLayer(u.addLayer,u)},onRemove:function(u){this.eachLayer(u.removeLayer,u)},eachLayer:function(u,g){for(var S in this._layers)u.call(g,this._layers[S]);return this},getLayer:function(u){return this._layers[u]},getLayers:function(){var u=[];return this.eachLayer(u.push,u),u},setZIndex:function(u){return this.invoke("setZIndex",u)},getLayerId:function(u){return c(u)}}),ai=function(u,g){return new Mr(u,g)},bi=Mr.extend({addLayer:function(u){return this.hasLayer(u)?this:(u.addEventParent(this),Mr.prototype.addLayer.call(this,u),this.fire("layeradd",{layer:u}))},removeLayer:function(u){return this.hasLayer(u)?(u in this._layers&&(u=this._layers[u]),u.removeEventParent(this),Mr.prototype.removeLayer.call(this,u),this.fire("layerremove",{layer:u})):this},setStyle:function(u){return this.invoke("setStyle",u)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var u=new He;for(var g in this._layers){var S=this._layers[g];u.extend(S.getBounds?S.getBounds():S.getLatLng())}return u}}),za=function(u,g){return new bi(u,g)},fo=he.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(u){x(this,u)},createIcon:function(u){return this._createIcon("icon",u)},createShadow:function(u){return this._createIcon("shadow",u)},_createIcon:function(u,g){var S=this._getIconUrl(u);if(!S){if(u==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var C=this._createImg(S,g&&g.tagName==="IMG"?g:null);return this._setIconStyles(C,u),(this.options.crossOrigin||this.options.crossOrigin==="")&&(C.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),C},_setIconStyles:function(u,g){var S=this.options,C=S[g+"Size"];typeof C=="number"&&(C=[C,C]);var U=ae(C),Q=ae(g==="shadow"&&S.shadowAnchor||S.iconAnchor||U&&U.divideBy(2,!0));u.className="leaflet-marker-"+g+" "+(S.className||""),Q&&(u.style.marginLeft=-Q.x+"px",u.style.marginTop=-Q.y+"px"),U&&(u.style.width=U.x+"px",u.style.height=U.y+"px")},_createImg:function(u,g){return g=g||document.createElement("img"),g.src=u,g},_getIconUrl:function(u){return _t.retina&&this.options[u+"RetinaUrl"]||this.options[u+"Url"]}});function vd(u){return new fo(u)}var bl=fo.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(u){return typeof bl.imagePath!="string"&&(bl.imagePath=this._detectIconPath()),(this.options.imagePath||bl.imagePath)+fo.prototype._getIconUrl.call(this,u)},_stripUrl:function(u){var g=function(S,C,U){var Q=C.exec(S);return Q&&Q[U]};return u=g(u,/^url\((['"])?(.+)\1\)$/,2),u&&g(u,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var u=ft("div","leaflet-default-icon-path",document.body),g=Li(u,"background-image")||Li(u,"backgroundImage");if(document.body.removeChild(u),g=this._stripUrl(g),g)return g;var S=document.querySelector('link[href$="leaflet.css"]');return S?S.href.substring(0,S.href.length-11-1):""}}),ef=Pr.extend({initialize:function(u){this._marker=u},addHooks:function(){var u=this._marker._icon;this._draggable||(this._draggable=new vi(u,u,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),qt(u,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&zn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(u){var g=this._marker,S=g._map,C=this._marker.options.autoPanSpeed,U=this._marker.options.autoPanPadding,Q=zr(g._icon),le=S.getPixelBounds(),Me=S.getPixelOrigin(),Be=de(le.min._subtract(Me).add(U),le.max._subtract(Me).subtract(U));if(!Be.contains(Q)){var Xe=ae((Math.max(Be.max.x,Q.x)-Be.max.x)/(le.max.x-Be.max.x)-(Math.min(Be.min.x,Q.x)-Be.min.x)/(le.min.x-Be.min.x),(Math.max(Be.max.y,Q.y)-Be.max.y)/(le.max.y-Be.max.y)-(Math.min(Be.min.y,Q.y)-Be.min.y)/(le.min.y-Be.min.y)).multiplyBy(C);S.panBy(Xe,{animate:!1}),this._draggable._newPos._add(Xe),this._draggable._startPos._add(Xe),Un(g._icon,this._draggable._newPos),this._onDrag(u),this._panRequest=ee(this._adjustPan.bind(this,u))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(u){this._marker.options.autoPan&&(ne(this._panRequest),this._panRequest=ee(this._adjustPan.bind(this,u)))},_onDrag:function(u){var g=this._marker,S=g._shadow,C=zr(g._icon),U=g._map.layerPointToLatLng(C);S&&Un(S,C),g._latlng=U,u.latlng=U,u.oldLatLng=this._oldLatLng,g.fire("move",u).fire("drag",u)},_onDragEnd:function(u){ne(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",u)}}),ya=Gn.extend({options:{icon:new bl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(u,g){x(this,g),this._latlng=We(u)},onAdd:function(u){this._zoomAnimated=this._zoomAnimated&&u.options.markerZoomAnimation,this._zoomAnimated&&u.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(u){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&u.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(u){var g=this._latlng;return this._latlng=We(u),this.update(),this.fire("move",{oldLatLng:g,latlng:this._latlng})},setZIndexOffset:function(u){return this.options.zIndexOffset=u,this.update()},getIcon:function(){return this.options.icon},setIcon:function(u){return this.options.icon=u,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var u=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(u)}return this},_initIcon:function(){var u=this.options,g="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),S=u.icon.createIcon(this._icon),C=!1;S!==this._icon&&(this._icon&&this._removeIcon(),C=!0,u.title&&(S.title=u.title),S.tagName==="IMG"&&(S.alt=u.alt||"")),qt(S,g),u.keyboard&&(S.tabIndex="0",S.setAttribute("role","button")),this._icon=S,u.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&xt(S,"focus",this._panOnFocus,this);var U=u.icon.createShadow(this._shadow),Q=!1;U!==this._shadow&&(this._removeShadow(),Q=!0),U&&(qt(U,g),U.alt=""),this._shadow=U,u.opacity<1&&this._updateOpacity(),C&&this.getPane().appendChild(this._icon),this._initInteraction(),U&&Q&&this.getPane(u.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&On(this._icon,"focus",this._panOnFocus,this),$n(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&$n(this._shadow),this._shadow=null},_setPos:function(u){this._icon&&Un(this._icon,u),this._shadow&&Un(this._shadow,u),this._zIndex=u.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(u){this._icon&&(this._icon.style.zIndex=this._zIndex+u)},_animateZoom:function(u){var g=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center).round();this._setPos(g)},_initInteraction:function(){if(this.options.interactive&&(qt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),ef)){var u=this.options.draggable;this.dragging&&(u=this.dragging.enabled(),this.dragging.disable()),this.dragging=new ef(this),u&&this.dragging.enable()}},setOpacity:function(u){return this.options.opacity=u,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var u=this.options.opacity;this._icon&&dr(this._icon,u),this._shadow&&dr(this._shadow,u)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var u=this._map;if(u){var g=this.options.icon.options,S=g.iconSize?ae(g.iconSize):ae(0,0),C=g.iconAnchor?ae(g.iconAnchor):ae(0,0);u.panInside(this._latlng,{paddingTopLeft:C,paddingBottomRight:S.subtract(C)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Ro(u,g){return new ya(u,g)}var Vn=Gn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(u){this._renderer=u.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(u){return x(this,u),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&u&&Object.prototype.hasOwnProperty.call(u,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),qs=Vn.extend({options:{fill:!0,radius:10},initialize:function(u,g){x(this,g),this._latlng=We(u),this._radius=this.options.radius},setLatLng:function(u){var g=this._latlng;return this._latlng=We(u),this.redraw(),this.fire("move",{oldLatLng:g,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(u){return this.options.radius=this._radius=u,this.redraw()},getRadius:function(){return this._radius},setStyle:function(u){var g=u&&u.radius||this._radius;return Vn.prototype.setStyle.call(this,u),this.setRadius(g),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var u=this._radius,g=this._radiusY||u,S=this._clickTolerance(),C=[u+S,g+S];this._pxBounds=new ie(this._point.subtract(C),this._point.add(C))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(u){return u.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function zs(u,g){return new qs(u,g)}var zu=qs.extend({initialize:function(u,g,S){if(typeof g=="number"&&(g=i({},S,{radius:g})),x(this,g),this._latlng=We(u),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(u){return this._mRadius=u,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var u=[this._radius,this._radiusY||this._radius];return new He(this._map.layerPointToLatLng(this._point.subtract(u)),this._map.layerPointToLatLng(this._point.add(u)))},setStyle:Vn.prototype.setStyle,_project:function(){var u=this._latlng.lng,g=this._latlng.lat,S=this._map,C=S.options.crs;if(C.distance===rt.distance){var U=Math.PI/180,Q=this._mRadius/rt.R/U,le=S.project([g+Q,u]),Me=S.project([g-Q,u]),Be=le.add(Me).divideBy(2),Xe=S.unproject(Be).lat,yt=Math.acos((Math.cos(Q*U)-Math.sin(g*U)*Math.sin(Xe*U))/(Math.cos(g*U)*Math.cos(Xe*U)))/U;(isNaN(yt)||yt===0)&&(yt=Q/Math.cos(Math.PI/180*g)),this._point=Be.subtract(S.getPixelOrigin()),this._radius=isNaN(yt)?0:Be.x-S.project([Xe,u-yt]).x,this._radiusY=Be.y-le.y}else{var Wt=C.unproject(C.project(this._latlng).subtract([this._mRadius,0]));this._point=S.latLngToLayerPoint(this._latlng),this._radius=this._point.x-S.latLngToLayerPoint(Wt).x}this._updateBounds()}});function Us(u,g,S){return new zu(u,g,S)}var Di=Vn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(u,g){x(this,g),this._setLatLngs(u)},getLatLngs:function(){return this._latlngs},setLatLngs:function(u){return this._setLatLngs(u),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(u){for(var g=1/0,S=null,C=Qi,U,Q,le=0,Me=this._parts.length;le<Me;le++)for(var Be=this._parts[le],Xe=1,yt=Be.length;Xe<yt;Xe++){U=Be[Xe-1],Q=Be[Xe];var Wt=C(u,U,Q,!0);Wt<g&&(g=Wt,S=C(u,U,Q))}return S&&(S.distance=Math.sqrt(g)),S},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return is(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(u,g){return g=g||this._defaultShape(),u=We(u),g.push(u),this._bounds.extend(u),this.redraw()},_setLatLngs:function(u){this._bounds=new He,this._latlngs=this._convertLatLngs(u)},_defaultShape:function(){return yi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(u){for(var g=[],S=yi(u),C=0,U=u.length;C<U;C++)S?(g[C]=We(u[C]),this._bounds.extend(g[C])):g[C]=this._convertLatLngs(u[C]);return g},_project:function(){var u=new ie;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,u),this._bounds.isValid()&&u.isValid()&&(this._rawPxBounds=u,this._updateBounds())},_updateBounds:function(){var u=this._clickTolerance(),g=new re(u,u);this._rawPxBounds&&(this._pxBounds=new ie([this._rawPxBounds.min.subtract(g),this._rawPxBounds.max.add(g)]))},_projectLatlngs:function(u,g,S){var C=u[0]instanceof $e,U=u.length,Q,le;if(C){for(le=[],Q=0;Q<U;Q++)le[Q]=this._map.latLngToLayerPoint(u[Q]),S.extend(le[Q]);g.push(le)}else for(Q=0;Q<U;Q++)this._projectLatlngs(u[Q],g,S)},_clipPoints:function(){var u=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}var g=this._parts,S,C,U,Q,le,Me,Be;for(S=0,U=0,Q=this._rings.length;S<Q;S++)for(Be=this._rings[S],C=0,le=Be.length;C<le-1;C++)Me=$s(Be[C],Be[C+1],u,C,!0),Me&&(g[U]=g[U]||[],g[U].push(Me[0]),(Me[1]!==Be[C+1]||C===le-2)&&(g[U].push(Me[1]),U++))}},_simplifyPoints:function(){for(var u=this._parts,g=this.options.smoothFactor,S=0,C=u.length;S<C;S++)u[S]=ts(u[S],g)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(u,g){var S,C,U,Q,le,Me,Be=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(u))return!1;for(S=0,Q=this._parts.length;S<Q;S++)for(Me=this._parts[S],C=0,le=Me.length,U=le-1;C<le;U=C++)if(!(!g&&C===0)&&Bs(u,Me[U],Me[C])<=Be)return!0;return!1}});function Vs(u,g){return new Di(u,g)}Di._flat=Fs;var Ua=Di.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Nr(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(u){var g=Di.prototype._convertLatLngs.call(this,u),S=g.length;return S>=2&&g[0]instanceof $e&&g[0].equals(g[S-1])&&g.pop(),g},_setLatLngs:function(u){Di.prototype._setLatLngs.call(this,u),yi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return yi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var u=this._renderer._bounds,g=this.options.weight,S=new re(g,g);if(u=new ie(u.min.subtract(S),u.max.add(S)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}for(var C=0,U=this._rings.length,Q;C<U;C++)Q=Is(this._rings[C],u,!0),Q.length&&this._parts.push(Q)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(u){var g=!1,S,C,U,Q,le,Me,Be,Xe;if(!this._pxBounds||!this._pxBounds.contains(u))return!1;for(Q=0,Be=this._parts.length;Q<Be;Q++)for(S=this._parts[Q],le=0,Xe=S.length,Me=Xe-1;le<Xe;Me=le++)C=S[le],U=S[Me],C.y>u.y!=U.y>u.y&&u.x<(U.x-C.x)*(u.y-C.y)/(U.y-C.y)+C.x&&(g=!g);return g||Di.prototype._containsPoint.call(this,u,!0)}});function xl(u,g){return new Ua(u,g)}var Xr=bi.extend({initialize:function(u,g){x(this,g),this._layers={},u&&this.addData(u)},addData:function(u){var g=k(u)?u:u.features,S,C,U;if(g){for(S=0,C=g.length;S<C;S++)U=g[S],(U.geometries||U.geometry||U.features||U.coordinates)&&this.addData(U);return this}var Q=this.options;if(Q.filter&&!Q.filter(u))return this;var le=Ws(u,Q);return le?(le.feature=J(u),le.defaultOptions=le.options,this.resetStyle(le),Q.onEachFeature&&Q.onEachFeature(u,le),this.addLayer(le)):this},resetStyle:function(u){return u===void 0?this.eachLayer(this.resetStyle,this):(u.options=i({},u.defaultOptions),this._setLayerStyle(u,this.options.style),this)},setStyle:function(u){return this.eachLayer(function(g){this._setLayerStyle(g,u)},this)},_setLayerStyle:function(u,g){u.setStyle&&(typeof g=="function"&&(g=g(u.feature)),u.setStyle(g))}});function Ws(u,g){var S=u.type==="Feature"?u.geometry:u,C=S?S.coordinates:null,U=[],Q=g&&g.pointToLayer,le=g&&g.coordsToLatLng||O,Me,Be,Xe,yt;if(!C&&!S)return null;switch(S.type){case"Point":return Me=le(C),_(Q,u,Me,g);case"MultiPoint":for(Xe=0,yt=C.length;Xe<yt;Xe++)Me=le(C[Xe]),U.push(_(Q,u,Me,g));return new bi(U);case"LineString":case"MultiLineString":return Be=B(C,S.type==="LineString"?0:1,le),new Di(Be,g);case"Polygon":case"MultiPolygon":return Be=B(C,S.type==="Polygon"?1:2,le),new Ua(Be,g);case"GeometryCollection":for(Xe=0,yt=S.geometries.length;Xe<yt;Xe++){var Wt=Ws({geometry:S.geometries[Xe],type:"Feature",properties:u.properties},g);Wt&&U.push(Wt)}return new bi(U);case"FeatureCollection":for(Xe=0,yt=S.features.length;Xe<yt;Xe++){var hn=Ws(S.features[Xe],g);hn&&U.push(hn)}return new bi(U);default:throw new Error("Invalid GeoJSON object.")}}function _(u,g,S,C){return u?u(g,S):new ya(S,C&&C.markersInheritOptions&&C)}function O(u){return new $e(u[1],u[0],u[2])}function B(u,g,S){for(var C=[],U=0,Q=u.length,le;U<Q;U++)le=g?B(u[U],g-1,S):(S||O)(u[U]),C.push(le);return C}function z(u,g){return u=We(u),u.alt!==void 0?[y(u.lng,g),y(u.lat,g),y(u.alt,g)]:[y(u.lng,g),y(u.lat,g)]}function W(u,g,S,C){for(var U=[],Q=0,le=u.length;Q<le;Q++)U.push(g?W(u[Q],yi(u[Q])?0:g-1,S,C):z(u[Q],C));return!g&&S&&U.length>0&&U.push(U[0].slice()),U}function G(u,g){return u.feature?i({},u.feature,{geometry:g}):J(g)}function J(u){return u.type==="Feature"||u.type==="FeatureCollection"?u:{type:"Feature",properties:{},geometry:u}}var te={toGeoJSON:function(u){return G(this,{type:"Point",coordinates:z(this.getLatLng(),u)})}};ya.include(te),zu.include(te),qs.include(te),Di.include({toGeoJSON:function(u){var g=!yi(this._latlngs),S=W(this._latlngs,g?1:0,!1,u);return G(this,{type:(g?"Multi":"")+"LineString",coordinates:S})}}),Ua.include({toGeoJSON:function(u){var g=!yi(this._latlngs),S=g&&!yi(this._latlngs[0]),C=W(this._latlngs,S?2:g?1:0,!0,u);return g||(C=[C]),G(this,{type:(S?"Multi":"")+"Polygon",coordinates:C})}}),Mr.include({toMultiPoint:function(u){var g=[];return this.eachLayer(function(S){g.push(S.toGeoJSON(u).geometry.coordinates)}),G(this,{type:"MultiPoint",coordinates:g})},toGeoJSON:function(u){var g=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(g==="MultiPoint")return this.toMultiPoint(u);var S=g==="GeometryCollection",C=[];return this.eachLayer(function(U){if(U.toGeoJSON){var Q=U.toGeoJSON(u);if(S)C.push(Q.geometry);else{var le=J(Q);le.type==="FeatureCollection"?C.push.apply(C,le.features):C.push(le)}}}),S?G(this,{geometries:C,type:"GeometryCollection"}):{type:"FeatureCollection",features:C}}});function be(u,g){return new Xr(u,g)}var Ee=be,pe=Gn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(u,g,S){this._url=u,this._bounds=je(g),x(this,S)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(qt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){$n(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(u){return this.options.opacity=u,this._image&&this._updateOpacity(),this},setStyle:function(u){return u.opacity&&this.setOpacity(u.opacity),this},bringToFront:function(){return this._map&&Zi(this._image),this},bringToBack:function(){return this._map&&mi(this._image),this},setUrl:function(u){return this._url=u,this._image&&(this._image.src=u),this},setBounds:function(u){return this._bounds=je(u),this._map&&this._reset(),this},getEvents:function(){var u={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var u=this._url.tagName==="IMG",g=this._image=u?this._url:ft("img");if(qt(g,"leaflet-image-layer"),this._zoomAnimated&&qt(g,"leaflet-zoom-animated"),this.options.className&&qt(g,this.options.className),g.onselectstart=m,g.onmousemove=m,g.onload=o(this.fire,this,"load"),g.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),u){this._url=g.src;return}g.src=this._url,g.alt=this.options.alt},_animateZoom:function(u){var g=this._map.getZoomScale(u.zoom),S=this._map._latLngBoundsToNewLayerBounds(this._bounds,u.zoom,u.center).min;gi(this._image,S,g)},_reset:function(){var u=this._image,g=new ie(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),S=g.getSize();Un(u,g.min),u.style.width=S.x+"px",u.style.height=S.y+"px"},_updateOpacity:function(){dr(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var u=this.options.errorOverlayUrl;u&&this._url!==u&&(this._url=u,this._image.src=u)},getCenter:function(){return this._bounds.getCenter()}}),me=function(u,g,S){return new pe(u,g,S)},we=pe.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var u=this._url.tagName==="VIDEO",g=this._image=u?this._url:ft("video");if(qt(g,"leaflet-image-layer"),this._zoomAnimated&&qt(g,"leaflet-zoom-animated"),this.options.className&&qt(g,this.options.className),g.onselectstart=m,g.onmousemove=m,g.onloadeddata=o(this.fire,this,"load"),u){for(var S=g.getElementsByTagName("source"),C=[],U=0;U<S.length;U++)C.push(S[U].src);this._url=S.length>0?C:[g.src];return}k(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(g.style,"objectFit")&&(g.style.objectFit="fill"),g.autoplay=!!this.options.autoplay,g.loop=!!this.options.loop,g.muted=!!this.options.muted,g.playsInline=!!this.options.playsInline;for(var Q=0;Q<this._url.length;Q++){var le=ft("source");le.src=this._url[Q],g.appendChild(le)}}});function _e(u,g,S){return new we(u,g,S)}var ye=pe.extend({_initImage:function(){var u=this._image=this._url;qt(u,"leaflet-image-layer"),this._zoomAnimated&&qt(u,"leaflet-zoom-animated"),this.options.className&&qt(u,this.options.className),u.onselectstart=m,u.onmousemove=m}});function ve(u,g,S){return new ye(u,g,S)}var ke=Gn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(u,g){u&&(u instanceof $e||k(u))?(this._latlng=We(u),x(this,g)):(x(this,u),this._source=g),this.options.content&&(this._content=this.options.content)},openOn:function(u){return u=arguments.length?u:this._source._map,u.hasLayer(this)||u.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(u){return this._map?this.close():(arguments.length?this._source=u:u=this._source,this._prepareOpen(),this.openOn(u._map)),this},onAdd:function(u){this._zoomAnimated=u._zoomAnimated,this._container||this._initLayout(),u._fadeAnimated&&dr(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),u._fadeAnimated&&dr(this._container,1),this.bringToFront(),this.options.interactive&&(qt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(u){u._fadeAnimated?(dr(this._container,0),this._removeTimeout=setTimeout(o($n,void 0,this._container),200)):$n(this._container),this.options.interactive&&(zn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(u){return this._latlng=We(u),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(u){return this._content=u,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var u={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Zi(this._container),this},bringToBack:function(){return this._map&&mi(this._container),this},_prepareOpen:function(u){var g=this._source;if(!g._map)return!1;if(g instanceof bi){g=null;var S=this._source._layers;for(var C in S)if(S[C]._map){g=S[C];break}if(!g)return!1;this._source=g}if(!u)if(g.getCenter)u=g.getCenter();else if(g.getLatLng)u=g.getLatLng();else if(g.getBounds)u=g.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(u),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var u=this._contentNode,g=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof g=="string")u.innerHTML=g;else{for(;u.hasChildNodes();)u.removeChild(u.firstChild);u.appendChild(g)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var u=this._map.latLngToLayerPoint(this._latlng),g=ae(this.options.offset),S=this._getAnchor();this._zoomAnimated?Un(this._container,u.add(S)):g=g.add(u).add(S);var C=this._containerBottom=-g.y,U=this._containerLeft=-Math.round(this._containerWidth/2)+g.x;this._container.style.bottom=C+"px",this._container.style.left=U+"px"}},_getAnchor:function(){return[0,0]}});rn.include({_initOverlay:function(u,g,S,C){var U=g;return U instanceof u||(U=new u(C).setContent(g)),S&&U.setLatLng(S),U}}),Gn.include({_initOverlay:function(u,g,S,C){var U=S;return U instanceof u?(x(U,C),U._source=this):(U=g&&!C?g:new u(C,this),U.setContent(S)),U}});var Ie=ke.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(u){return u=arguments.length?u:this._source._map,!u.hasLayer(this)&&u._popup&&u._popup.options.autoClose&&u.removeLayer(u._popup),u._popup=this,ke.prototype.openOn.call(this,u)},onAdd:function(u){ke.prototype.onAdd.call(this,u),u.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Vn||this._source.on("preclick",A))},onRemove:function(u){ke.prototype.onRemove.call(this,u),u.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Vn||this._source.off("preclick",A))},getEvents:function(){var u=ke.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(u.preclick=this.close),this.options.keepInView&&(u.moveend=this._adjustPan),u},_initLayout:function(){var u="leaflet-popup",g=this._container=ft("div",u+" "+(this.options.className||"")+" leaflet-zoom-animated"),S=this._wrapper=ft("div",u+"-content-wrapper",g);if(this._contentNode=ft("div",u+"-content",S),H(g),q(this._contentNode),xt(g,"contextmenu",A),this._tipContainer=ft("div",u+"-tip-container",g),this._tip=ft("div",u+"-tip",this._tipContainer),this.options.closeButton){var C=this._closeButton=ft("a",u+"-close-button",g);C.setAttribute("role","button"),C.setAttribute("aria-label","Close popup"),C.href="#close",C.innerHTML='<span aria-hidden="true">×</span>',xt(C,"click",function(U){X(U),this.close()},this)}},_updateLayout:function(){var u=this._contentNode,g=u.style;g.width="",g.whiteSpace="nowrap";var S=u.offsetWidth;S=Math.min(S,this.options.maxWidth),S=Math.max(S,this.options.minWidth),g.width=S+1+"px",g.whiteSpace="",g.height="";var C=u.offsetHeight,U=this.options.maxHeight,Q="leaflet-popup-scrolled";U&&C>U?(g.height=U+"px",qt(u,Q)):zn(u,Q),this._containerWidth=this._container.offsetWidth},_animateZoom:function(u){var g=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center),S=this._getAnchor();Un(this._container,g.add(S))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var u=this._map,g=parseInt(Li(this._container,"marginBottom"),10)||0,S=this._container.offsetHeight+g,C=this._containerWidth,U=new re(this._containerLeft,-S-this._containerBottom);U._add(zr(this._container));var Q=u.layerPointToContainerPoint(U),le=ae(this.options.autoPanPadding),Me=ae(this.options.autoPanPaddingTopLeft||le),Be=ae(this.options.autoPanPaddingBottomRight||le),Xe=u.getSize(),yt=0,Wt=0;Q.x+C+Be.x>Xe.x&&(yt=Q.x+C-Xe.x+Be.x),Q.x-yt-Me.x<0&&(yt=Q.x-Me.x),Q.y+S+Be.y>Xe.y&&(Wt=Q.y+S-Xe.y+Be.y),Q.y-Wt-Me.y<0&&(Wt=Q.y-Me.y),(yt||Wt)&&(this.options.keepInView&&(this._autopanning=!0),u.fire("autopanstart").panBy([yt,Wt]))}},_getAnchor:function(){return ae(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ae=function(u,g){return new Ie(u,g)};rn.mergeOptions({closePopupOnClick:!0}),rn.include({openPopup:function(u,g,S){return this._initOverlay(Ie,u,g,S).openOn(this),this},closePopup:function(u){return u=arguments.length?u:this._popup,u&&u.close(),this}}),Gn.include({bindPopup:function(u,g){return this._popup=this._initOverlay(Ie,this._popup,u,g),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(u){return this._popup&&(this instanceof bi||(this._popup._source=this),this._popup._prepareOpen(u||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(u){return this._popup&&this._popup.setContent(u),this},getPopup:function(){return this._popup},_openPopup:function(u){if(!(!this._popup||!this._map)){xe(u);var g=u.layer||u.target;if(this._popup._source===g&&!(g instanceof Vn)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(u.latlng);return}this._popup._source=g,this.openPopup(u.latlng)}},_movePopup:function(u){this._popup.setLatLng(u.latlng)},_onKeyPress:function(u){u.originalEvent.keyCode===13&&this._openPopup(u)}});var Ve=ke.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(u){ke.prototype.onAdd.call(this,u),this.setOpacity(this.options.opacity),u.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(u){ke.prototype.onRemove.call(this,u),u.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var u=ke.prototype.getEvents.call(this);return this.options.permanent||(u.preclick=this.close),u},_initLayout:function(){var u="leaflet-tooltip",g=u+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=ft("div",g),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(u){var g,S,C=this._map,U=this._container,Q=C.latLngToContainerPoint(C.getCenter()),le=C.layerPointToContainerPoint(u),Me=this.options.direction,Be=U.offsetWidth,Xe=U.offsetHeight,yt=ae(this.options.offset),Wt=this._getAnchor();Me==="top"?(g=Be/2,S=Xe):Me==="bottom"?(g=Be/2,S=0):Me==="center"?(g=Be/2,S=Xe/2):Me==="right"?(g=0,S=Xe/2):Me==="left"?(g=Be,S=Xe/2):le.x<Q.x?(Me="right",g=0,S=Xe/2):(Me="left",g=Be+(yt.x+Wt.x)*2,S=Xe/2),u=u.subtract(ae(g,S,!0)).add(yt).add(Wt),zn(U,"leaflet-tooltip-right"),zn(U,"leaflet-tooltip-left"),zn(U,"leaflet-tooltip-top"),zn(U,"leaflet-tooltip-bottom"),qt(U,"leaflet-tooltip-"+Me),Un(U,u)},_updatePosition:function(){var u=this._map.latLngToLayerPoint(this._latlng);this._setPosition(u)},setOpacity:function(u){this.options.opacity=u,this._container&&dr(this._container,u)},_animateZoom:function(u){var g=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center);this._setPosition(g)},_getAnchor:function(){return ae(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Je=function(u,g){return new Ve(u,g)};rn.include({openTooltip:function(u,g,S){return this._initOverlay(Ve,u,g,S).openOn(this),this},closeTooltip:function(u){return u.close(),this}}),Gn.include({bindTooltip:function(u,g){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ve,this._tooltip,u,g),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(u){if(!(!u&&this._tooltipHandlersAdded)){var g=u?"off":"on",S={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?S.add=this._openTooltip:(S.mouseover=this._openTooltip,S.mouseout=this.closeTooltip,S.click=this._openTooltip,this._map?this._addFocusListeners():S.add=this._addFocusListeners),this._tooltip.options.sticky&&(S.mousemove=this._moveTooltip),this[g](S),this._tooltipHandlersAdded=!u}},openTooltip:function(u){return this._tooltip&&(this instanceof bi||(this._tooltip._source=this),this._tooltip._prepareOpen(u)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(u){return this._tooltip&&this._tooltip.setContent(u),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(u){var g=typeof u.getElement=="function"&&u.getElement();g&&(xt(g,"focus",function(){this._tooltip._source=u,this.openTooltip()},this),xt(g,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(u){var g=typeof u.getElement=="function"&&u.getElement();g&&g.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(u){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var g=this;this._map.once("moveend",function(){g._openOnceFlag=!1,g._openTooltip(u)});return}this._tooltip._source=u.layer||u.target,this.openTooltip(this._tooltip.options.sticky?u.latlng:void 0)}},_moveTooltip:function(u){var g=u.latlng,S,C;this._tooltip.options.sticky&&u.originalEvent&&(S=this._map.mouseEventToContainerPoint(u.originalEvent),C=this._map.containerPointToLayerPoint(S),g=this._map.layerPointToLatLng(C)),this._tooltip.setLatLng(g)}});var at=fo.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(u){var g=u&&u.tagName==="DIV"?u:document.createElement("div"),S=this.options;if(S.html instanceof Element?(no(g),g.appendChild(S.html)):g.innerHTML=S.html!==!1?S.html:"",S.bgPos){var C=ae(S.bgPos);g.style.backgroundPosition=-C.x+"px "+-C.y+"px"}return this._setIconStyles(g,"icon"),g},createShadow:function(){return null}});function ut(u){return new at(u)}fo.Default=bl;var Qe=Gn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:_t.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(u){x(this,u)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(u){u._addZoomLimit(this)},onRemove:function(u){this._removeAllTiles(),$n(this._container),u._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Zi(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(mi(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(u){return this.options.opacity=u,this._updateOpacity(),this},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var u=this._clampZoom(this._map.getZoom());u!==this._tileZoom&&(this._tileZoom=u,this._updateLevels()),this._update()}return this},getEvents:function(){var u={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),u.move=this._onMove),this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},createTile:function(){return document.createElement("div")},getTileSize:function(){var u=this.options.tileSize;return u instanceof re?u:new re(u,u)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(u){for(var g=this.getPane().children,S=-u(-1/0,1/0),C=0,U=g.length,Q;C<U;C++)Q=g[C].style.zIndex,g[C]!==this._container&&Q&&(S=u(S,+Q));isFinite(S)&&(this.options.zIndex=S+u(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!_t.ielt9){dr(this._container,this.options.opacity);var u=+new Date,g=!1,S=!1;for(var C in this._tiles){var U=this._tiles[C];if(!(!U.current||!U.loaded)){var Q=Math.min(1,(u-U.loaded)/200);dr(U.el,Q),Q<1?g=!0:(U.active?S=!0:this._onOpaqueTile(U),U.active=!0)}}S&&!this._noPrune&&this._pruneTiles(),g&&(ne(this._fadeFrame),this._fadeFrame=ee(this._updateOpacity,this))}},_onOpaqueTile:m,_initContainer:function(){this._container||(this._container=ft("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var u=this._tileZoom,g=this.options.maxZoom;if(u!==void 0){for(var S in this._levels)S=Number(S),this._levels[S].el.children.length||S===u?(this._levels[S].el.style.zIndex=g-Math.abs(u-S),this._onUpdateLevel(S)):($n(this._levels[S].el),this._removeTilesAtZoom(S),this._onRemoveLevel(S),delete this._levels[S]);var C=this._levels[u],U=this._map;return C||(C=this._levels[u]={},C.el=ft("div","leaflet-tile-container leaflet-zoom-animated",this._container),C.el.style.zIndex=g,C.origin=U.project(U.unproject(U.getPixelOrigin()),u).round(),C.zoom=u,this._setZoomTransform(C,U.getCenter(),U.getZoom()),m(C.el.offsetWidth),this._onCreateLevel(C)),this._level=C,C}},_onUpdateLevel:m,_onRemoveLevel:m,_onCreateLevel:m,_pruneTiles:function(){if(this._map){var u,g,S=this._map.getZoom();if(S>this.options.maxZoom||S<this.options.minZoom){this._removeAllTiles();return}for(u in this._tiles)g=this._tiles[u],g.retain=g.current;for(u in this._tiles)if(g=this._tiles[u],g.current&&!g.active){var C=g.coords;this._retainParent(C.x,C.y,C.z,C.z-5)||this._retainChildren(C.x,C.y,C.z,C.z+2)}for(u in this._tiles)this._tiles[u].retain||this._removeTile(u)}},_removeTilesAtZoom:function(u){for(var g in this._tiles)this._tiles[g].coords.z===u&&this._removeTile(g)},_removeAllTiles:function(){for(var u in this._tiles)this._removeTile(u)},_invalidateAll:function(){for(var u in this._levels)$n(this._levels[u].el),this._onRemoveLevel(Number(u)),delete this._levels[u];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(u,g,S,C){var U=Math.floor(u/2),Q=Math.floor(g/2),le=S-1,Me=new re(+U,+Q);Me.z=+le;var Be=this._tileCoordsToKey(Me),Xe=this._tiles[Be];return Xe&&Xe.active?(Xe.retain=!0,!0):(Xe&&Xe.loaded&&(Xe.retain=!0),le>C?this._retainParent(U,Q,le,C):!1)},_retainChildren:function(u,g,S,C){for(var U=2*u;U<2*u+2;U++)for(var Q=2*g;Q<2*g+2;Q++){var le=new re(U,Q);le.z=S+1;var Me=this._tileCoordsToKey(le),Be=this._tiles[Me];if(Be&&Be.active){Be.retain=!0;continue}else Be&&Be.loaded&&(Be.retain=!0);S+1<C&&this._retainChildren(U,Q,S+1,C)}},_resetView:function(u){var g=u&&(u.pinch||u.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),g,g)},_animateZoom:function(u){this._setView(u.center,u.zoom,!0,u.noUpdate)},_clampZoom:function(u){var g=this.options;return g.minNativeZoom!==void 0&&u<g.minNativeZoom?g.minNativeZoom:g.maxNativeZoom!==void 0&&g.maxNativeZoom<u?g.maxNativeZoom:u},_setView:function(u,g,S,C){var U=Math.round(g);this.options.maxZoom!==void 0&&U>this.options.maxZoom||this.options.minZoom!==void 0&&U<this.options.minZoom?U=void 0:U=this._clampZoom(U);var Q=this.options.updateWhenZooming&&U!==this._tileZoom;(!C||Q)&&(this._tileZoom=U,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),U!==void 0&&this._update(u),S||this._pruneTiles(),this._noPrune=!!S),this._setZoomTransforms(u,g)},_setZoomTransforms:function(u,g){for(var S in this._levels)this._setZoomTransform(this._levels[S],u,g)},_setZoomTransform:function(u,g,S){var C=this._map.getZoomScale(S,u.zoom),U=u.origin.multiplyBy(C).subtract(this._map._getNewPixelOrigin(g,S)).round();_t.any3d?gi(u.el,U,C):Un(u.el,U)},_resetGrid:function(){var u=this._map,g=u.options.crs,S=this._tileSize=this.getTileSize(),C=this._tileZoom,U=this._map.getPixelWorldBounds(this._tileZoom);U&&(this._globalTileRange=this._pxBoundsToTileRange(U)),this._wrapX=g.wrapLng&&!this.options.noWrap&&[Math.floor(u.project([0,g.wrapLng[0]],C).x/S.x),Math.ceil(u.project([0,g.wrapLng[1]],C).x/S.y)],this._wrapY=g.wrapLat&&!this.options.noWrap&&[Math.floor(u.project([g.wrapLat[0],0],C).y/S.x),Math.ceil(u.project([g.wrapLat[1],0],C).y/S.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(u){var g=this._map,S=g._animatingZoom?Math.max(g._animateToZoom,g.getZoom()):g.getZoom(),C=g.getZoomScale(S,this._tileZoom),U=g.project(u,this._tileZoom).floor(),Q=g.getSize().divideBy(C*2);return new ie(U.subtract(Q),U.add(Q))},_update:function(u){var g=this._map;if(g){var S=this._clampZoom(g.getZoom());if(u===void 0&&(u=g.getCenter()),this._tileZoom!==void 0){var C=this._getTiledPixelBounds(u),U=this._pxBoundsToTileRange(C),Q=U.getCenter(),le=[],Me=this.options.keepBuffer,Be=new ie(U.getBottomLeft().subtract([Me,-Me]),U.getTopRight().add([Me,-Me]));if(!(isFinite(U.min.x)&&isFinite(U.min.y)&&isFinite(U.max.x)&&isFinite(U.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Xe in this._tiles){var yt=this._tiles[Xe].coords;(yt.z!==this._tileZoom||!Be.contains(new re(yt.x,yt.y)))&&(this._tiles[Xe].current=!1)}if(Math.abs(S-this._tileZoom)>1){this._setView(u,S);return}for(var Wt=U.min.y;Wt<=U.max.y;Wt++)for(var hn=U.min.x;hn<=U.max.x;hn++){var xi=new re(hn,Wt);if(xi.z=this._tileZoom,!!this._isValidTile(xi)){var oi=this._tiles[this._tileCoordsToKey(xi)];oi?oi.current=!0:le.push(xi)}}if(le.sort(function(ba,Wu){return ba.distanceTo(Q)-Wu.distanceTo(Q)}),le.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Va=document.createDocumentFragment();for(hn=0;hn<le.length;hn++)this._addTile(le[hn],Va);this._level.el.appendChild(Va)}}}},_isValidTile:function(u){var g=this._map.options.crs;if(!g.infinite){var S=this._globalTileRange;if(!g.wrapLng&&(u.x<S.min.x||u.x>S.max.x)||!g.wrapLat&&(u.y<S.min.y||u.y>S.max.y))return!1}if(!this.options.bounds)return!0;var C=this._tileCoordsToBounds(u);return je(this.options.bounds).overlaps(C)},_keyToBounds:function(u){return this._tileCoordsToBounds(this._keyToTileCoords(u))},_tileCoordsToNwSe:function(u){var g=this._map,S=this.getTileSize(),C=u.scaleBy(S),U=C.add(S),Q=g.unproject(C,u.z),le=g.unproject(U,u.z);return[Q,le]},_tileCoordsToBounds:function(u){var g=this._tileCoordsToNwSe(u),S=new He(g[0],g[1]);return this.options.noWrap||(S=this._map.wrapLatLngBounds(S)),S},_tileCoordsToKey:function(u){return u.x+":"+u.y+":"+u.z},_keyToTileCoords:function(u){var g=u.split(":"),S=new re(+g[0],+g[1]);return S.z=+g[2],S},_removeTile:function(u){var g=this._tiles[u];g&&($n(g.el),delete this._tiles[u],this.fire("tileunload",{tile:g.el,coords:this._keyToTileCoords(u)}))},_initTile:function(u){qt(u,"leaflet-tile");var g=this.getTileSize();u.style.width=g.x+"px",u.style.height=g.y+"px",u.onselectstart=m,u.onmousemove=m,_t.ielt9&&this.options.opacity<1&&dr(u,this.options.opacity)},_addTile:function(u,g){var S=this._getTilePos(u),C=this._tileCoordsToKey(u),U=this.createTile(this._wrapCoords(u),o(this._tileReady,this,u));this._initTile(U),this.createTile.length<2&&ee(o(this._tileReady,this,u,null,U)),Un(U,S),this._tiles[C]={el:U,coords:u,current:!0},g.appendChild(U),this.fire("tileloadstart",{tile:U,coords:u})},_tileReady:function(u,g,S){g&&this.fire("tileerror",{error:g,tile:S,coords:u});var C=this._tileCoordsToKey(u);S=this._tiles[C],S&&(S.loaded=+new Date,this._map._fadeAnimated?(dr(S.el,0),ne(this._fadeFrame),this._fadeFrame=ee(this._updateOpacity,this)):(S.active=!0,this._pruneTiles()),g||(qt(S.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:S.el,coords:u})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),_t.ielt9||!this._map._fadeAnimated?ee(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(u){return u.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(u){var g=new re(this._wrapX?p(u.x,this._wrapX):u.x,this._wrapY?p(u.y,this._wrapY):u.y);return g.z=u.z,g},_pxBoundsToTileRange:function(u){var g=this.getTileSize();return new ie(u.min.unscaleBy(g).floor(),u.max.unscaleBy(g).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var u in this._tiles)if(!this._tiles[u].loaded)return!1;return!0}});function gt(u){return new Qe(u)}var dt=Qe.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(u,g){this._url=u,g=x(this,g),g.detectRetina&&_t.retina&&g.maxZoom>0?(g.tileSize=Math.floor(g.tileSize/2),g.zoomReverse?(g.zoomOffset--,g.minZoom=Math.min(g.maxZoom,g.minZoom+1)):(g.zoomOffset++,g.maxZoom=Math.max(g.minZoom,g.maxZoom-1)),g.minZoom=Math.max(0,g.minZoom)):g.zoomReverse?g.minZoom=Math.min(g.maxZoom,g.minZoom):g.maxZoom=Math.max(g.minZoom,g.maxZoom),typeof g.subdomains=="string"&&(g.subdomains=g.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(u,g){return this._url===u&&g===void 0&&(g=!0),this._url=u,g||this.redraw(),this},createTile:function(u,g){var S=document.createElement("img");return xt(S,"load",o(this._tileOnLoad,this,g,S)),xt(S,"error",o(this._tileOnError,this,g,S)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(S.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(S.referrerPolicy=this.options.referrerPolicy),S.alt="",S.src=this.getTileUrl(u),S},getTileUrl:function(u){var g={r:_t.retina?"@2x":"",s:this._getSubdomain(u),x:u.x,y:u.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var S=this._globalTileRange.max.y-u.y;this.options.tms&&(g.y=S),g["-y"]=S}return E(this._url,i(g,this.options))},_tileOnLoad:function(u,g){_t.ielt9?setTimeout(o(u,this,null,g),0):u(null,g)},_tileOnError:function(u,g,S){var C=this.options.errorTileUrl;C&&g.getAttribute("src")!==C&&(g.src=C),u(S,g)},_onTileRemove:function(u){u.tile.onload=null},_getZoomForUrl:function(){var u=this._tileZoom,g=this.options.maxZoom,S=this.options.zoomReverse,C=this.options.zoomOffset;return S&&(u=g-u),u+C},_getSubdomain:function(u){var g=Math.abs(u.x+u.y)%this.options.subdomains.length;return this.options.subdomains[g]},_abortLoading:function(){var u,g;for(u in this._tiles)if(this._tiles[u].coords.z!==this._tileZoom&&(g=this._tiles[u].el,g.onload=m,g.onerror=m,!g.complete)){g.src=I;var S=this._tiles[u].coords;$n(g),delete this._tiles[u],this.fire("tileabort",{tile:g,coords:S})}},_removeTile:function(u){var g=this._tiles[u];if(g)return g.el.setAttribute("src",I),Qe.prototype._removeTile.call(this,u)},_tileReady:function(u,g,S){if(!(!this._map||S&&S.getAttribute("src")===I))return Qe.prototype._tileReady.call(this,u,g,S)}});function it(u,g){return new dt(u,g)}var vt=dt.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(u,g){this._url=u;var S=i({},this.defaultWmsParams);for(var C in g)C in this.options||(S[C]=g[C]);g=x(this,g);var U=g.detectRetina&&_t.retina?2:1,Q=this.getTileSize();S.width=Q.x*U,S.height=Q.y*U,this.wmsParams=S},onAdd:function(u){this._crs=this.options.crs||u.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var g=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[g]=this._crs.code,dt.prototype.onAdd.call(this,u)},getTileUrl:function(u){var g=this._tileCoordsToNwSe(u),S=this._crs,C=de(S.project(g[0]),S.project(g[1])),U=C.min,Q=C.max,le=(this._wmsVersion>=1.3&&this._crs===Tn?[U.y,U.x,Q.y,Q.x]:[U.x,U.y,Q.x,Q.y]).join(","),Me=dt.prototype.getTileUrl.call(this,u);return Me+w(this.wmsParams,Me,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+le},setParams:function(u,g){return i(this.wmsParams,u),g||this.redraw(),this}});function vn(u,g){return new vt(u,g)}dt.WMS=vt,it.wms=vn;var on=Gn.extend({options:{padding:.1},initialize:function(u){x(this,u),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),qt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var u={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(u.zoomanim=this._onAnimZoom),u},_onAnimZoom:function(u){this._updateTransform(u.center,u.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(u,g){var S=this._map.getZoomScale(g,this._zoom),C=this._map.getSize().multiplyBy(.5+this.options.padding),U=this._map.project(this._center,g),Q=C.multiplyBy(-S).add(U).subtract(this._map._getNewPixelOrigin(u,g));_t.any3d?gi(this._container,Q,S):Un(this._container,Q)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var u in this._layers)this._layers[u]._reset()},_onZoomEnd:function(){for(var u in this._layers)this._layers[u]._project()},_updatePaths:function(){for(var u in this._layers)this._layers[u]._update()},_update:function(){var u=this.options.padding,g=this._map.getSize(),S=this._map.containerPointToLayerPoint(g.multiplyBy(-u)).round();this._bounds=new ie(S,S.add(g.multiplyBy(1+u*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Bt=on.extend({options:{tolerance:0},getEvents:function(){var u=on.prototype.getEvents.call(this);return u.viewprereset=this._onViewPreReset,u},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){on.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var u=this._container=document.createElement("canvas");xt(u,"mousemove",this._onMouseMove,this),xt(u,"click dblclick mousedown mouseup contextmenu",this._onClick,this),xt(u,"mouseout",this._handleMouseOut,this),u._leaflet_disable_events=!0,this._ctx=u.getContext("2d")},_destroyContainer:function(){ne(this._redrawRequest),delete this._ctx,$n(this._container),On(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var u;this._redrawBounds=null;for(var g in this._layers)u=this._layers[g],u._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){on.prototype._update.call(this);var u=this._bounds,g=this._container,S=u.getSize(),C=_t.retina?2:1;Un(g,u.min),g.width=C*S.x,g.height=C*S.y,g.style.width=S.x+"px",g.style.height=S.y+"px",_t.retina&&this._ctx.scale(2,2),this._ctx.translate(-u.min.x,-u.min.y),this.fire("update")}},_reset:function(){on.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(u){this._updateDashArray(u),this._layers[c(u)]=u;var g=u._order={layer:u,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=g),this._drawLast=g,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(u){this._requestRedraw(u)},_removePath:function(u){var g=u._order,S=g.next,C=g.prev;S?S.prev=C:this._drawLast=C,C?C.next=S:this._drawFirst=S,delete u._order,delete this._layers[c(u)],this._requestRedraw(u)},_updatePath:function(u){this._extendRedrawBounds(u),u._project(),u._update(),this._requestRedraw(u)},_updateStyle:function(u){this._updateDashArray(u),this._requestRedraw(u)},_updateDashArray:function(u){if(typeof u.options.dashArray=="string"){var g=u.options.dashArray.split(/[, ]+/),S=[],C,U;for(U=0;U<g.length;U++){if(C=Number(g[U]),isNaN(C))return;S.push(C)}u.options._dashArray=S}else u.options._dashArray=u.options.dashArray},_requestRedraw:function(u){this._map&&(this._extendRedrawBounds(u),this._redrawRequest=this._redrawRequest||ee(this._redraw,this))},_extendRedrawBounds:function(u){if(u._pxBounds){var g=(u.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new ie,this._redrawBounds.extend(u._pxBounds.min.subtract([g,g])),this._redrawBounds.extend(u._pxBounds.max.add([g,g]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var u=this._redrawBounds;if(u){var g=u.getSize();this._ctx.clearRect(u.min.x,u.min.y,g.x,g.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var u,g=this._redrawBounds;if(this._ctx.save(),g){var S=g.getSize();this._ctx.beginPath(),this._ctx.rect(g.min.x,g.min.y,S.x,S.y),this._ctx.clip()}this._drawing=!0;for(var C=this._drawFirst;C;C=C.next)u=C.layer,(!g||u._pxBounds&&u._pxBounds.intersects(g))&&u._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(u,g){if(this._drawing){var S,C,U,Q,le=u._parts,Me=le.length,Be=this._ctx;if(Me){for(Be.beginPath(),S=0;S<Me;S++){for(C=0,U=le[S].length;C<U;C++)Q=le[S][C],Be[C?"lineTo":"moveTo"](Q.x,Q.y);g&&Be.closePath()}this._fillStroke(Be,u)}}},_updateCircle:function(u){if(!(!this._drawing||u._empty())){var g=u._point,S=this._ctx,C=Math.max(Math.round(u._radius),1),U=(Math.max(Math.round(u._radiusY),1)||C)/C;U!==1&&(S.save(),S.scale(1,U)),S.beginPath(),S.arc(g.x,g.y/U,C,0,Math.PI*2,!1),U!==1&&S.restore(),this._fillStroke(S,u)}},_fillStroke:function(u,g){var S=g.options;S.fill&&(u.globalAlpha=S.fillOpacity,u.fillStyle=S.fillColor||S.color,u.fill(S.fillRule||"evenodd")),S.stroke&&S.weight!==0&&(u.setLineDash&&u.setLineDash(g.options&&g.options._dashArray||[]),u.globalAlpha=S.opacity,u.lineWidth=S.weight,u.strokeStyle=S.color,u.lineCap=S.lineCap,u.lineJoin=S.lineJoin,u.stroke())},_onClick:function(u){for(var g=this._map.mouseEventToLayerPoint(u),S,C,U=this._drawFirst;U;U=U.next)S=U.layer,S.options.interactive&&S._containsPoint(g)&&(!(u.type==="click"||u.type==="preclick")||!this._map._draggableMoved(S))&&(C=S);this._fireEvent(C?[C]:!1,u)},_onMouseMove:function(u){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var g=this._map.mouseEventToLayerPoint(u);this._handleMouseHover(u,g)}},_handleMouseOut:function(u){var g=this._hoveredLayer;g&&(zn(this._container,"leaflet-interactive"),this._fireEvent([g],u,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(u,g){if(!this._mouseHoverThrottled){for(var S,C,U=this._drawFirst;U;U=U.next)S=U.layer,S.options.interactive&&S._containsPoint(g)&&(C=S);C!==this._hoveredLayer&&(this._handleMouseOut(u),C&&(qt(this._container,"leaflet-interactive"),this._fireEvent([C],u,"mouseover"),this._hoveredLayer=C)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,u),this._mouseHoverThrottled=!0,setTimeout(o(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(u,g,S){this._map._fireDOMEvent(g,S||g.type,u)},_bringToFront:function(u){var g=u._order;if(g){var S=g.next,C=g.prev;if(S)S.prev=C;else return;C?C.next=S:S&&(this._drawFirst=S),g.prev=this._drawLast,this._drawLast.next=g,g.next=null,this._drawLast=g,this._requestRedraw(u)}},_bringToBack:function(u){var g=u._order;if(g){var S=g.next,C=g.prev;if(C)C.next=S;else return;S?S.prev=C:C&&(this._drawLast=C),g.prev=null,g.next=this._drawFirst,this._drawFirst.prev=g,this._drawFirst=g,this._requestRedraw(u)}}});function sn(u){return _t.canvas?new Bt(u):null}var Wn=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(u){return document.createElement("<lvml:"+u+' class="lvml">')}}catch{}return function(u){return document.createElement("<"+u+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),ea={_initContainer:function(){this._container=ft("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(on.prototype._update.call(this),this.fire("update"))},_initPath:function(u){var g=u._container=Wn("shape");qt(g,"leaflet-vml-shape "+(this.options.className||"")),g.coordsize="1 1",u._path=Wn("path"),g.appendChild(u._path),this._updateStyle(u),this._layers[c(u)]=u},_addPath:function(u){var g=u._container;this._container.appendChild(g),u.options.interactive&&u.addInteractiveTarget(g)},_removePath:function(u){var g=u._container;$n(g),u.removeInteractiveTarget(g),delete this._layers[c(u)]},_updateStyle:function(u){var g=u._stroke,S=u._fill,C=u.options,U=u._container;U.stroked=!!C.stroke,U.filled=!!C.fill,C.stroke?(g||(g=u._stroke=Wn("stroke")),U.appendChild(g),g.weight=C.weight+"px",g.color=C.color,g.opacity=C.opacity,C.dashArray?g.dashStyle=k(C.dashArray)?C.dashArray.join(" "):C.dashArray.replace(/( *, *)/g," "):g.dashStyle="",g.endcap=C.lineCap.replace("butt","flat"),g.joinstyle=C.lineJoin):g&&(U.removeChild(g),u._stroke=null),C.fill?(S||(S=u._fill=Wn("fill")),U.appendChild(S),S.color=C.fillColor||C.color,S.opacity=C.fillOpacity):S&&(U.removeChild(S),u._fill=null)},_updateCircle:function(u){var g=u._point.round(),S=Math.round(u._radius),C=Math.round(u._radiusY||S);this._setPath(u,u._empty()?"M0 0":"AL "+g.x+","+g.y+" "+S+","+C+" 0,"+65535*360)},_setPath:function(u,g){u._path.v=g},_bringToFront:function(u){Zi(u._container)},_bringToBack:function(u){mi(u._container)}},En=_t.vml?Wn:dn,ta=on.extend({_initContainer:function(){this._container=En("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=En("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){$n(this._container),On(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){on.prototype._update.call(this);var u=this._bounds,g=u.getSize(),S=this._container;(!this._svgSize||!this._svgSize.equals(g))&&(this._svgSize=g,S.setAttribute("width",g.x),S.setAttribute("height",g.y)),Un(S,u.min),S.setAttribute("viewBox",[u.min.x,u.min.y,g.x,g.y].join(" ")),this.fire("update")}},_initPath:function(u){var g=u._path=En("path");u.options.className&&qt(g,u.options.className),u.options.interactive&&qt(g,"leaflet-interactive"),this._updateStyle(u),this._layers[c(u)]=u},_addPath:function(u){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(u._path),u.addInteractiveTarget(u._path)},_removePath:function(u){$n(u._path),u.removeInteractiveTarget(u._path),delete this._layers[c(u)]},_updatePath:function(u){u._project(),u._update()},_updateStyle:function(u){var g=u._path,S=u.options;g&&(S.stroke?(g.setAttribute("stroke",S.color),g.setAttribute("stroke-opacity",S.opacity),g.setAttribute("stroke-width",S.weight),g.setAttribute("stroke-linecap",S.lineCap),g.setAttribute("stroke-linejoin",S.lineJoin),S.dashArray?g.setAttribute("stroke-dasharray",S.dashArray):g.removeAttribute("stroke-dasharray"),S.dashOffset?g.setAttribute("stroke-dashoffset",S.dashOffset):g.removeAttribute("stroke-dashoffset")):g.setAttribute("stroke","none"),S.fill?(g.setAttribute("fill",S.fillColor||S.color),g.setAttribute("fill-opacity",S.fillOpacity),g.setAttribute("fill-rule",S.fillRule||"evenodd")):g.setAttribute("fill","none"))},_updatePoly:function(u,g){this._setPath(u,xn(u._parts,g))},_updateCircle:function(u){var g=u._point,S=Math.max(Math.round(u._radius),1),C=Math.max(Math.round(u._radiusY),1)||S,U="a"+S+","+C+" 0 1,0 ",Q=u._empty()?"M0 0":"M"+(g.x-S)+","+g.y+U+S*2+",0 "+U+-S*2+",0 ";this._setPath(u,Q)},_setPath:function(u,g){u._path.setAttribute("d",g)},_bringToFront:function(u){Zi(u._path)},_bringToBack:function(u){mi(u._path)}});_t.vml&&ta.include(ea);function wl(u){return _t.svg||_t.vml?new ta(u):null}rn.include({getRenderer:function(u){var g=u.options.renderer||this._getPaneRenderer(u.options.pane)||this.options.renderer||this._renderer;return g||(g=this._renderer=this._createRenderer()),this.hasLayer(g)||this.addLayer(g),g},_getPaneRenderer:function(u){if(u==="overlayPane"||u===void 0)return!1;var g=this._paneRenderers[u];return g===void 0&&(g=this._createRenderer({pane:u}),this._paneRenderers[u]=g),g},_createRenderer:function(u){return this.options.preferCanvas&&sn(u)||wl(u)}});var Ug=Ua.extend({initialize:function(u,g){Ua.prototype.initialize.call(this,this._boundsToLatLngs(u),g)},setBounds:function(u){return this.setLatLngs(this._boundsToLatLngs(u))},_boundsToLatLngs:function(u){return u=je(u),[u.getSouthWest(),u.getNorthWest(),u.getNorthEast(),u.getSouthEast()]}});function bx(u,g){return new Ug(u,g)}ta.create=En,ta.pointsToPath=xn,Xr.geometryToLayer=Ws,Xr.coordsToLatLng=O,Xr.coordsToLatLngs=B,Xr.latLngToCoords=z,Xr.latLngsToCoords=W,Xr.getFeature=G,Xr.asFeature=J,rn.mergeOptions({boxZoom:!0});var Uu=Pr.extend({initialize:function(u){this._map=u,this._container=u._container,this._pane=u._panes.overlayPane,this._resetStateTimeout=0,u.on("unload",this._destroy,this)},addHooks:function(){xt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){On(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){$n(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(u){if(!u.shiftKey||u.which!==1&&u.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),un(),Qo(),this._startPoint=this._map.mouseEventToContainerPoint(u),xt(document,{contextmenu:xe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(u){this._moved||(this._moved=!0,this._box=ft("div","leaflet-zoom-box",this._container),qt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(u);var g=new ie(this._point,this._startPoint),S=g.getSize();Un(this._box,g.min),this._box.style.width=S.x+"px",this._box.style.height=S.y+"px"},_finish:function(){this._moved&&($n(this._box),zn(this._container,"leaflet-crosshair")),ri(),ao(),On(document,{contextmenu:xe,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(u){if(!(u.which!==1&&u.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var g=new He(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(g).fire("boxzoomend",{boxZoomBounds:g})}},_onKeyDown:function(u){u.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});rn.addInitHook("addHandler","boxZoom",Uu),rn.mergeOptions({doubleClickZoom:!0});var Vg=Pr.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(u){var g=this._map,S=g.getZoom(),C=g.options.zoomDelta,U=u.originalEvent.shiftKey?S-C:S+C;g.options.doubleClickZoom==="center"?g.setZoom(U):g.setZoomAround(u.containerPoint,U)}});rn.addInitHook("addHandler","doubleClickZoom",Vg),rn.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var vp=Pr.extend({addHooks:function(){if(!this._draggable){var u=this._map;this._draggable=new vi(u._mapPane,u._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),u.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),u.on("zoomend",this._onZoomEnd,this),u.whenReady(this._onZoomEnd,this))}qt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){zn(this._map._container,"leaflet-grab"),zn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var u=this._map;if(u._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var g=je(this._map.options.maxBounds);this._offsetLimit=de(this._map.latLngToContainerPoint(g.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(g.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;u.fire("movestart").fire("dragstart"),u.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(u){if(this._map.options.inertia){var g=this._lastTime=+new Date,S=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(S),this._times.push(g),this._prunePositions(g)}this._map.fire("move",u).fire("drag",u)},_prunePositions:function(u){for(;this._positions.length>1&&u-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var u=this._map.getSize().divideBy(2),g=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=g.subtract(u).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(u,g){return u-(u-g)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var u=this._draggable._newPos.subtract(this._draggable._startPos),g=this._offsetLimit;u.x<g.min.x&&(u.x=this._viscousLimit(u.x,g.min.x)),u.y<g.min.y&&(u.y=this._viscousLimit(u.y,g.min.y)),u.x>g.max.x&&(u.x=this._viscousLimit(u.x,g.max.x)),u.y>g.max.y&&(u.y=this._viscousLimit(u.y,g.max.y)),this._draggable._newPos=this._draggable._startPos.add(u)}},_onPreDragWrap:function(){var u=this._worldWidth,g=Math.round(u/2),S=this._initialWorldOffset,C=this._draggable._newPos.x,U=(C-g+S)%u+g-S,Q=(C+g+S)%u-g-S,le=Math.abs(U+S)<Math.abs(Q+S)?U:Q;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=le},_onDragEnd:function(u){var g=this._map,S=g.options,C=!S.inertia||u.noInertia||this._times.length<2;if(g.fire("dragend",u),C)g.fire("moveend");else{this._prunePositions(+new Date);var U=this._lastPos.subtract(this._positions[0]),Q=(this._lastTime-this._times[0])/1e3,le=S.easeLinearity,Me=U.multiplyBy(le/Q),Be=Me.distanceTo([0,0]),Xe=Math.min(S.inertiaMaxSpeed,Be),yt=Me.multiplyBy(Xe/Be),Wt=Xe/(S.inertiaDeceleration*le),hn=yt.multiplyBy(-Wt/2).round();!hn.x&&!hn.y?g.fire("moveend"):(hn=g._limitOffset(hn,g.options.maxBounds),ee(function(){g.panBy(hn,{duration:Wt,easeLinearity:le,noMoveStart:!0,animate:!0})}))}}});rn.addInitHook("addHandler","dragging",vp),rn.mergeOptions({keyboard:!0,keyboardPanDelta:80});var yp=Pr.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(u){this._map=u,this._setPanDelta(u.options.keyboardPanDelta),this._setZoomDelta(u.options.zoomDelta)},addHooks:function(){var u=this._map._container;u.tabIndex<=0&&(u.tabIndex="0"),xt(u,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),On(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var u=document.body,g=document.documentElement,S=u.scrollTop||g.scrollTop,C=u.scrollLeft||g.scrollLeft;this._map._container.focus(),window.scrollTo(C,S)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(u){var g=this._panKeys={},S=this.keyCodes,C,U;for(C=0,U=S.left.length;C<U;C++)g[S.left[C]]=[-1*u,0];for(C=0,U=S.right.length;C<U;C++)g[S.right[C]]=[u,0];for(C=0,U=S.down.length;C<U;C++)g[S.down[C]]=[0,u];for(C=0,U=S.up.length;C<U;C++)g[S.up[C]]=[0,-1*u]},_setZoomDelta:function(u){var g=this._zoomKeys={},S=this.keyCodes,C,U;for(C=0,U=S.zoomIn.length;C<U;C++)g[S.zoomIn[C]]=u;for(C=0,U=S.zoomOut.length;C<U;C++)g[S.zoomOut[C]]=-u},_addHooks:function(){xt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){On(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(u){if(!(u.altKey||u.ctrlKey||u.metaKey)){var g=u.keyCode,S=this._map,C;if(g in this._panKeys){if(!S._panAnim||!S._panAnim._inProgress)if(C=this._panKeys[g],u.shiftKey&&(C=ae(C).multiplyBy(3)),S.options.maxBounds&&(C=S._limitOffset(ae(C),S.options.maxBounds)),S.options.worldCopyJump){var U=S.wrapLatLng(S.unproject(S.project(S.getCenter()).add(C)));S.panTo(U)}else S.panBy(C)}else if(g in this._zoomKeys)S.setZoom(S.getZoom()+(u.shiftKey?3:1)*this._zoomKeys[g]);else if(g===27&&S._popup&&S._popup.options.closeOnEscapeKey)S.closePopup();else return;xe(u)}}});rn.addInitHook("addHandler","keyboard",yp),rn.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var rr=Pr.extend({addHooks:function(){xt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){On(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(u){var g=Sn(u),S=this._map.options.wheelDebounceTime;this._delta+=g,this._lastMousePos=this._map.mouseEventToContainerPoint(u),this._startTime||(this._startTime=+new Date);var C=Math.max(S-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),C),xe(u)},_performZoom:function(){var u=this._map,g=u.getZoom(),S=this._map.options.zoomSnap||0;u._stop();var C=this._delta/(this._map.options.wheelPxPerZoomLevel*4),U=4*Math.log(2/(1+Math.exp(-Math.abs(C))))/Math.LN2,Q=S?Math.ceil(U/S)*S:U,le=u._limitZoom(g+(this._delta>0?Q:-Q))-g;this._delta=0,this._startTime=null,le&&(u.options.scrollWheelZoom==="center"?u.setZoom(g+le):u.setZoomAround(this._lastMousePos,g+le))}});rn.addInitHook("addHandler","scrollWheelZoom",rr);var bp=600;rn.mergeOptions({tapHold:_t.touchNative&&_t.safari&&_t.mobile,tapTolerance:15});var tf=Pr.extend({addHooks:function(){xt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){On(this._map._container,"touchstart",this._onDown,this)},_onDown:function(u){if(clearTimeout(this._holdTimeout),u.touches.length===1){var g=u.touches[0];this._startPos=this._newPos=new re(g.clientX,g.clientY),this._holdTimeout=setTimeout(o(function(){this._cancel(),this._isTapValid()&&(xt(document,"touchend",X),xt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",g))},this),bp),xt(document,"touchend touchcancel contextmenu",this._cancel,this),xt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function u(){On(document,"touchend",X),On(document,"touchend touchcancel",u)},_cancel:function(){clearTimeout(this._holdTimeout),On(document,"touchend touchcancel contextmenu",this._cancel,this),On(document,"touchmove",this._onMove,this)},_onMove:function(u){var g=u.touches[0];this._newPos=new re(g.clientX,g.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(u,g){var S=new MouseEvent(u,{bubbles:!0,cancelable:!0,view:window,screenX:g.screenX,screenY:g.screenY,clientX:g.clientX,clientY:g.clientY});S._simulated=!0,g.target.dispatchEvent(S)}});rn.addInitHook("addHandler","tapHold",tf),rn.mergeOptions({touchZoom:_t.touch,bounceAtZoomLimits:!0});var Vu=Pr.extend({addHooks:function(){qt(this._map._container,"leaflet-touch-zoom"),xt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){zn(this._map._container,"leaflet-touch-zoom"),On(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(u){var g=this._map;if(!(!u.touches||u.touches.length!==2||g._animatingZoom||this._zooming)){var S=g.mouseEventToContainerPoint(u.touches[0]),C=g.mouseEventToContainerPoint(u.touches[1]);this._centerPoint=g.getSize()._divideBy(2),this._startLatLng=g.containerPointToLatLng(this._centerPoint),g.options.touchZoom!=="center"&&(this._pinchStartLatLng=g.containerPointToLatLng(S.add(C)._divideBy(2))),this._startDist=S.distanceTo(C),this._startZoom=g.getZoom(),this._moved=!1,this._zooming=!0,g._stop(),xt(document,"touchmove",this._onTouchMove,this),xt(document,"touchend touchcancel",this._onTouchEnd,this),X(u)}},_onTouchMove:function(u){if(!(!u.touches||u.touches.length!==2||!this._zooming)){var g=this._map,S=g.mouseEventToContainerPoint(u.touches[0]),C=g.mouseEventToContainerPoint(u.touches[1]),U=S.distanceTo(C)/this._startDist;if(this._zoom=g.getScaleZoom(U,this._startZoom),!g.options.bounceAtZoomLimits&&(this._zoom<g.getMinZoom()&&U<1||this._zoom>g.getMaxZoom()&&U>1)&&(this._zoom=g._limitZoom(this._zoom)),g.options.touchZoom==="center"){if(this._center=this._startLatLng,U===1)return}else{var Q=S._add(C)._divideBy(2)._subtract(this._centerPoint);if(U===1&&Q.x===0&&Q.y===0)return;this._center=g.unproject(g.project(this._pinchStartLatLng,this._zoom).subtract(Q),this._zoom)}this._moved||(g._moveStart(!0,!1),this._moved=!0),ne(this._animRequest);var le=o(g._move,g,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ee(le,this,!0),X(u)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ne(this._animRequest),On(document,"touchmove",this._onTouchMove,this),On(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});rn.addInitHook("addHandler","touchZoom",Vu),rn.BoxZoom=Uu,rn.DoubleClickZoom=Vg,rn.Drag=vp,rn.Keyboard=yp,rn.ScrollWheelZoom=rr,rn.TapHold=tf,rn.TouchZoom=Vu,n.Bounds=ie,n.Browser=_t,n.CRS=Ye,n.Canvas=Bt,n.Circle=zu,n.CircleMarker=qs,n.Class=he,n.Control=ii,n.DivIcon=at,n.DivOverlay=ke,n.DomEvent=Ln,n.DomUtil=Ba,n.Draggable=vi,n.Evented=Oe,n.FeatureGroup=bi,n.GeoJSON=Xr,n.GridLayer=Qe,n.Handler=Pr,n.Icon=fo,n.ImageOverlay=pe,n.LatLng=$e,n.LatLngBounds=He,n.Layer=Gn,n.LayerGroup=Mr,n.LineUtil=Ne,n.Map=rn,n.Marker=ya,n.Mixin=Ls,n.Path=Vn,n.Point=re,n.PolyUtil=Ds,n.Polygon=Ua,n.Polyline=Di,n.Popup=Ie,n.PosAnimation=Jn,n.Projection=$t,n.Rectangle=Ug,n.Renderer=on,n.SVG=ta,n.SVGOverlay=ye,n.TileLayer=dt,n.Tooltip=Ve,n.Transformation=st,n.Util=oe,n.VideoOverlay=we,n.bind=o,n.bounds=de,n.canvas=sn,n.circle=Us,n.circleMarker=zs,n.control=so,n.divIcon=ut,n.extend=i,n.featureGroup=za,n.geoJSON=be,n.geoJson=Ee,n.gridLayer=gt,n.icon=vd,n.imageOverlay=me,n.latLng=We,n.latLngBounds=je,n.layerGroup=ai,n.map=ga,n.marker=Ro,n.point=ae,n.polygon=xl,n.polyline=Vs,n.popup=Ae,n.rectangle=bx,n.setOptions=x,n.stamp=c,n.svg=wl,n.svgOverlay=ve,n.tileLayer=it,n.tooltip=Je,n.transformation=Te,n.version=r,n.videoOverlay=_e;var Wg=window.L;n.noConflict=function(){return window.L=Wg,this},window.L=n}))})(cm,cm.exports)),cm.exports}var gp=M1e();const Es=In(gp);function cx(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function fx(e,t){return t==null?function(r,i){const a=M.useRef();return a.current||(a.current=e(r,i)),a}:function(r,i){const a=M.useRef();a.current||(a.current=e(r,i));const o=M.useRef(r),{instance:s}=a.current;return M.useEffect(function(){o.current!==r&&(t(s,r,o.current),o.current=r)},[s,r,i]),a}}function aW(e,t){M.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var a;(a=t.layerContainer)==null||a.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function oW(e){return function(n){const r=lx(),i=e(ux(n,r),r);return eW(r.map,n.attribution),Pk(i.current,n.eventHandlers),aW(i.current,r),i}}function R1e(e,t){const n=M.useRef();M.useEffect(function(){if(t.pathOptions!==n.current){const i=t.pathOptions??{};e.instance.setStyle(i),n.current=i}},[e,t])}function L1e(e){return function(n){const r=lx(),i=e(ux(n,r),r);return Pk(i.current,n.eventHandlers),aW(i.current,r),R1e(i.current,n),i}}function I1e(e,t){const n=fx(e,t),r=oW(n);return iW(r)}function D1e(e,t){const n=fx(e),r=C1e(n,t);return A1e(r)}function B1e(e,t){const n=fx(e,t),r=L1e(n);return iW(r)}function $1e(e,t){const n=fx(e,t),r=oW(n);return k1e(r)}function F1e(e,t,n){const{opacity:r,zIndex:i}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function dx(){return lx().map}function q1e(e){const t=dx();return M.useEffect(function(){return t.on(e),function(){t.off(e)}},[t,e]),t}function GT(){return GT=Object.assign||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},GT.apply(this,arguments)}function z1e({bounds:e,boundsOptions:t,center:n,children:r,className:i,id:a,placeholder:o,style:s,whenReady:c,zoom:d,...p},m){const[y]=M.useState({className:i,id:a,style:s}),[b,P]=M.useState(null);M.useImperativeHandle(m,()=>(b==null?void 0:b.map)??null,[b]);const x=M.useCallback(T=>{if(T!==null&&b===null){const E=new gp.Map(T,p);n!=null&&d!=null?E.setView(n,d):e!=null&&E.fitBounds(e,t),c!=null&&E.whenReady(c),P(E1e(E))}},[]);M.useEffect(()=>()=>{b==null||b.map.remove()},[b]);const w=b?ce.createElement(rW,{value:b},r):o??null;return ce.createElement("div",GT({},y,{ref:x}),w)}const jk=M.forwardRef(z1e),Lc=I1e(function({position:t,...n},r){const i=new gp.Marker(t,n);return cx(i,tW(r,{overlayContainer:i}))},function(t,n,r){n.position!==r.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())}),hx=B1e(function({positions:t,...n},r){const i=new gp.Polygon(t,n);return cx(i,tW(r,{overlayContainer:i}))},function(t,n,r){n.positions!==r.positions&&t.setLatLngs(n.positions)}),Ay=D1e(function(t,n){const r=new gp.Popup(t,n.overlayContainer);return cx(r,n)},function(t,n,{position:r},i){M.useEffect(function(){const{instance:o}=t;function s(d){d.popup===o&&(o.update(),i(!0))}function c(d){d.popup===o&&i(!1)}return n.map.on({popupopen:s,popupclose:c}),n.overlayContainer==null?(r!=null&&o.setLatLng(r),o.openOn(n.map)):n.overlayContainer.bindPopup(o),function(){var p;n.map.off({popupopen:s,popupclose:c}),(p=n.overlayContainer)==null||p.unbindPopup(),n.map.removeLayer(o)}},[t,n,i,r])}),Ok=$1e(function({url:t,...n},r){const i=new gp.TileLayer(t,ux(n,r));return cx(i,r)},function(t,n,r){F1e(t,n,r);const{url:i}=n;i!=null&&i!==r.url&&t.setUrl(i)});delete Es.Icon.Default.prototype._getIconUrl;Es.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png"});const gj="ABCDEFGHIJKLMNOPQRSTUVWXYZ",U1e={"Kopi Arabika":"#7c3aed",Kakao:"#b45309","Kelapa Sawit":"#15803d",Padi:"#facc15",Jagung:"#f97316"},sW=e=>e<26?gj[e]:gj[Math.floor(e/26)-1]+gj[e%26],V1e=e=>new Es.DivIcon({className:"",html:`
|
||
<div style="
|
||
width:28px;
|
||
height:28px;
|
||
background:#15803d;
|
||
color:white;
|
||
border-radius:50%;
|
||
display:flex;
|
||
align-items:center;
|
||
justify-content:center;
|
||
font-weight:bold;
|
||
border:2px solid white;
|
||
box-shadow:0 2px 6px rgba(0,0,0,0.3);
|
||
">
|
||
${e}
|
||
</div>
|
||
`,iconSize:[28,28],iconAnchor:[14,14]}),W1e=(e,t)=>{const n=U1e[e]||"#16a34a",r="#64748b",i=1;return new Es.DivIcon({className:"",html:`
|
||
<div style="
|
||
width:22px;
|
||
height:22px;
|
||
background:${n};
|
||
border-radius:50%;
|
||
border:3px solid ${r};
|
||
opacity:${i};
|
||
box-shadow:0 2px 4px rgba(0,0,0,0.3);
|
||
"></div>
|
||
`,iconSize:[22,22],iconAnchor:[11,11]})};function K1e({onLocationFound:e}){const t=dx();return M.useEffect(()=>{t.locate(),t.on("locationfound",n=>{t.flyTo(n.latlng,16),e&&e(n.latlng)})},[t,e]),null}function H1e({points:e,setPoints:t,isDrawing:n}){return q1e({click(r){n&&t(i=>[...i,[r.latlng.lat,r.latlng.lng]])}}),e.length>0?h.jsxs(h.Fragment,{children:[h.jsx(hx,{positions:e,pathOptions:{color:"#16a34a",fillColor:"#16a34a",fillOpacity:.3,weight:2}}),e.map((r,i)=>h.jsx(Lc,{position:r,children:h.jsxs(Ay,{children:["Titik ",sW(i)]})},i))]}):null}function G1e(e){if(e.length<3)return 0;let t=0;for(let o=0;o<e.length;o++){const s=(o+1)%e.length;t+=e[o][1]*e[s][0],t-=e[s][1]*e[o][0]}t=Math.abs(t)/2;const n=e.reduce((o,s)=>o+s[0],0)/e.length,r=111320,i=111320*Math.cos(n*Math.PI/180);return t*r*i/1e4}function Tk({center:e=[-6.2,106.8],zoom:t=20,existingPolygon:n=null,onSave:r,readOnly:i=!1,lands:a=[],plants:o=[]}){const[s,c]=M.useState(n||[]),[d,p]=M.useState(!1),[m,y]=M.useState(null),b=G1e(s),P=()=>{c([]),p(!1)},x=()=>{if(s.length>=3&&r){const w=s.reduce((E,k)=>E+k[0],0)/s.length,T=s.reduce((E,k)=>E+k[1],0)/s.length;r({polygon_coordinates:s.map(E=>[E[1],E[0]]),center_lat:w,center_lng:T,area_hectares:b})}};return h.jsxs(Tt,{className:"border-0 shadow-sm overflow-hidden",children:[!i&&h.jsxs("div",{className:"p-4 border-b flex justify-between bg-slate-50",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsx(pt,{variant:d?"default":"outline",size:"sm",onClick:()=>p(!d),children:d?"Sedang Menggambar...":"Mulai Gambar Polygon"}),h.jsxs(pt,{variant:"outline",size:"sm",onClick:P,children:[h.jsx(nb,{className:"w-4 h-4 mr-2"}),"Reset"]})]}),h.jsxs("div",{className:"flex gap-3 items-center",children:[b>0&&h.jsxs("span",{className:"text-sm",children:["Luas:"," ",h.jsxs("b",{className:"text-emerald-600",children:[b.toFixed(4)," Ha"]})]}),h.jsxs(pt,{size:"sm",onClick:x,disabled:s.length<3,children:[h.jsx(nF,{className:"w-4 h-4 mr-2"}),"Simpan"]})]})]}),h.jsx("div",{className:"h-[500px]",children:h.jsxs(jk,{center:e,zoom:t,maxZoom:22,className:"h-full w-full",children:[h.jsx(Ok,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",maxZoom:22,maxNativeZoom:19}),h.jsx(K1e,{onLocationFound:y}),!i&&h.jsx(H1e,{points:s,setPoints:c,isDrawing:d}),a.map(w=>{var k;if(!w.polygon_coordinates)return null;const E=(w.polygon_coordinates.length>1&&w.polygon_coordinates[0][0]===w.polygon_coordinates[w.polygon_coordinates.length-1][0]&&w.polygon_coordinates[0][1]===w.polygon_coordinates[w.polygon_coordinates.length-1][1]?w.polygon_coordinates.slice(0,-1):w.polygon_coordinates).map(D=>[D[1],D[0]]);return h.jsxs(h.Fragment,{children:[h.jsx(hx,{positions:E,pathOptions:{color:w.validation_status==="valid"?"#16a34a":"#f59e0b",fillOpacity:.2,weight:2},children:h.jsx(Ay,{children:h.jsxs("div",{children:[h.jsx("b",{children:w.name}),h.jsx("br",{}),(k=w.area_hectares)==null?void 0:k.toFixed(2)," Ha"]})})},w.id),E.map((D,I)=>h.jsx(Lc,{position:D,icon:V1e(sW(I))},`${w.id}-${I}`))]})}),o.map(w=>h.jsx(Lc,{position:[w.latitude,w.longitude],icon:W1e(w.status),children:h.jsxs(Ay,{children:[h.jsx("b",{children:w.commodity_name}),h.jsx("br",{}),"Status: ",w.status]})},w.id)),m&&h.jsx(Lc,{position:m,children:h.jsx(Ay,{children:"Lokasi Anda"})})]})})]})}var vj="rovingFocusGroup.onEntryFocus",Z1e={bubbles:!1,cancelable:!0},qg="RovingFocusGroup",[ZT,lW,Y1e]=TV(qg),[X1e,uW]=gd(qg,[Y1e]),[Q1e,J1e]=X1e(qg),cW=M.forwardRef((e,t)=>h.jsx(ZT.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(ZT.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(eSe,{...e,ref:t})})}));cW.displayName=qg;var eSe=M.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,y=M.useRef(null),b=Er(t,y),P=lk(a),[x,w]=Zh({prop:o,defaultProp:s??null,onChange:c,caller:qg}),[T,E]=M.useState(!1),k=Fc(d),D=lW(n),I=M.useRef(!1),[R,$]=M.useState(0);return M.useEffect(()=>{const V=y.current;if(V)return V.addEventListener(vj,k),()=>V.removeEventListener(vj,k)},[k]),h.jsx(Q1e,{scope:n,orientation:r,dir:P,loop:i,currentTabStopId:x,onItemFocus:M.useCallback(V=>w(V),[w]),onItemShiftTab:M.useCallback(()=>E(!0),[]),onFocusableItemAdd:M.useCallback(()=>$(V=>V+1),[]),onFocusableItemRemove:M.useCallback(()=>$(V=>V-1),[]),children:h.jsx(Dn.div,{tabIndex:T||R===0?-1:0,"data-orientation":r,...m,ref:b,style:{outline:"none",...e.style},onMouseDown:Mn(e.onMouseDown,()=>{I.current=!0}),onFocus:Mn(e.onFocus,V=>{const K=!I.current;if(V.target===V.currentTarget&&K&&!T){const Z=new CustomEvent(vj,Z1e);if(V.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const ee=D().filter(fe=>fe.focusable),ne=ee.find(fe=>fe.active),oe=ee.find(fe=>fe.id===x),Se=[ne,oe,...ee].filter(Boolean).map(fe=>fe.ref.current);hW(Se,p)}}I.current=!1}),onBlur:Mn(e.onBlur,()=>E(!1))})})}),fW="RovingFocusGroupItem",dW=M.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Rc(),d=a||c,p=J1e(fW,n),m=p.currentTabStopId===d,y=lW(n),{onFocusableItemAdd:b,onFocusableItemRemove:P,currentTabStopId:x}=p;return M.useEffect(()=>{if(r)return b(),()=>P()},[r,b,P]),h.jsx(ZT.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:h.jsx(Dn.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...s,ref:t,onMouseDown:Mn(e.onMouseDown,w=>{r?p.onItemFocus(d):w.preventDefault()}),onFocus:Mn(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Mn(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const T=rSe(w,p.orientation,p.dir);if(T!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let k=y().filter(D=>D.focusable).map(D=>D.ref.current);if(T==="last")k.reverse();else if(T==="prev"||T==="next"){T==="prev"&&k.reverse();const D=k.indexOf(w.currentTarget);k=p.loop?iSe(k,D+1):k.slice(D+1)}setTimeout(()=>hW(k))}}),children:typeof o=="function"?o({isCurrentTabStop:m,hasTabStop:x!=null}):o})})});dW.displayName=fW;var tSe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nSe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rSe(e,t,n){const r=nSe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return tSe[r]}function hW(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function iSe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aSe=cW,oSe=dW;function sSe(e,t){return M.useReducer((n,r)=>t[n][r]??n,e)}var zg=e=>{const{present:t,children:n}=e,r=lSe(t),i=typeof n=="function"?n({present:r.isPresent}):M.Children.only(n),a=Er(r.ref,uSe(i));return typeof n=="function"||r.isPresent?M.cloneElement(i,{ref:a}):null};zg.displayName="Presence";function lSe(e){const[t,n]=M.useState(),r=M.useRef(null),i=M.useRef(e),a=M.useRef("none"),o=e?"mounted":"unmounted",[s,c]=sSe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const d=ly(r.current);a.current=s==="mounted"?d:"none"},[s]),Ca(()=>{const d=r.current,p=i.current;if(p!==e){const y=a.current,b=ly(d);e?c("MOUNT"):b==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(p&&y!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Ca(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=b=>{const x=ly(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&x&&(c("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},y=b=>{b.target===t&&(a.current=ly(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:M.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function ly(e){return(e==null?void 0:e.animationName)||"none"}function uSe(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var px="Tabs",[cSe]=gd(px,[uW]),pW=uW(),[fSe,Ek]=cSe(px),mW=M.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:s,activationMode:c="automatic",...d}=e,p=lk(s),[m,y]=Zh({prop:r,onChange:i,defaultProp:a??"",caller:px});return h.jsx(fSe,{scope:n,baseId:Rc(),value:m,onValueChange:y,orientation:o,dir:p,activationMode:c,children:h.jsx(Dn.div,{dir:p,"data-orientation":o,...d,ref:t})})});mW.displayName=px;var gW="TabsList",vW=M.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=Ek(gW,n),o=pW(n);return h.jsx(aSe,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:h.jsx(Dn.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});vW.displayName=gW;var yW="TabsTrigger",bW=M.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Ek(yW,n),s=pW(n),c=_W(o.baseId,r),d=SW(o.baseId,r),p=r===o.value;return h.jsx(oSe,{asChild:!0,...s,focusable:!i,active:p,children:h.jsx(Dn.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Mn(e.onMouseDown,m=>{!i&&m.button===0&&m.ctrlKey===!1?o.onValueChange(r):m.preventDefault()}),onKeyDown:Mn(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&o.onValueChange(r)}),onFocus:Mn(e.onFocus,()=>{const m=o.activationMode!=="manual";!p&&!i&&m&&o.onValueChange(r)})})})});bW.displayName=yW;var xW="TabsContent",wW=M.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Ek(xW,n),c=_W(s.baseId,r),d=SW(s.baseId,r),p=r===s.value,m=M.useRef(p);return M.useEffect(()=>{const y=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(y)},[]),h.jsx(zg,{present:i||p,children:({present:y})=>h.jsx(Dn.div,{"data-state":p?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":c,hidden:!y,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:y&&a})})});wW.displayName=xW;function _W(e,t){return`${e}-trigger-${t}`}function SW(e,t){return`${e}-content-${t}`}var dSe=mW,PW=vW,jW=bW,OW=wW;const Ak=dSe,mx=M.forwardRef(({className:e,...t},n)=>h.jsx(PW,{ref:n,className:fn("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));mx.displayName=PW.displayName;const al=M.forwardRef(({className:e,...t},n)=>h.jsx(jW,{ref:n,className:fn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));al.displayName=jW.displayName;const ol=M.forwardRef(({className:e,...t},n)=>h.jsx(OW,{ref:n,className:fn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ol.displayName=OW.displayName;function hSe(){const[e,t]=M.useState(""),[n,r]=M.useState("all"),[i,a]=M.useState("grid"),{data:o=[],isLoading:s}=bn({queryKey:["lands"],queryFn:async()=>{let x=[];try{const k=await mt.entities.Land.list("-created_date");Array.isArray(k)&&(x=k)}catch{console.warn("Server lands offline/error")}const w=await Tr.getEntities("lands"),T=new Map;x.forEach(k=>{k.id&&T.set(k.id,k)}),w.forEach(k=>{k.id&&T.set(k.id,k)});const E=Array.from(T.values());return console.log("🔍 Total Lands Loaded (Server + Local):",E.length),E}}),{data:c=[]}=bn({queryKey:["farmers"],queryFn:async()=>{let x=[];try{const E=await mt.entities.Farmer.list();x=Array.isArray(E)?E:[]}catch{}const w=await Tr.getEntities("farmers"),T=new Map;return x.forEach(E=>T.set(E.id,E)),w.forEach(E=>T.set(E.id,E)),Array.from(T.values())}}),{data:d=[]}=bn({queryKey:["plants"],queryFn:()=>mt.entities.Plant.list()}),p=Array.isArray(o)?o:[],m=Array.isArray(c)?c:[],y=Array.isArray(d)?d:[],b=M.useMemo(()=>{const x={};return m.forEach(w=>{w!=null&&w.id&&(x[w.id]=w.full_name)}),x},[m]),P=M.useMemo(()=>Array.isArray(p)?p.filter(x=>{var $,V,K;if(!x)return!1;const w=(($=x.name)==null?void 0:$.toLowerCase())||"",T=((V=x.village)==null?void 0:V.toLowerCase())||"",E=((K=b[x.farmer_id])==null?void 0:K.toLowerCase())||"",k=e.toLowerCase(),D=!e||w.includes(k)||T.includes(k)||E.includes(k),I=n==="all"||x.validation_status===n,R=D&&I;return!R&&e===""&&console.log("Data ada tapi tidak lolos status filter:",x),R}):[],[p,e,n,b]);return M.useMemo(()=>{const x={};return y.forEach(w=>{w!=null&&w.land_id&&(x[w.land_id]=(x[w.land_id]||0)+1)}),x},[y]),h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-7xl mx-auto p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-3xl font-bold text-slate-900",children:"Pemetaan Lahan"}),h.jsxs("p",{className:"text-slate-500",children:[p.length," lahan terdaftar"]})]}),h.jsx(zo,{to:ei("LandRegister"),children:h.jsxs(pt,{className:"bg-emerald-600 hover:bg-emerald-700 h-11",children:[h.jsx(Dc,{className:"w-5 h-5 mr-2"}),"Tambah Lahan"]})})]}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"flex flex-col md:flex-row gap-3",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(tE,{className:"w-5 h-5 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),h.jsx(nn,{placeholder:"Cari nama lahan, desa, atau petani...",value:e,onChange:x=>t(x.target.value),className:"h-11 pl-11 bg-white border-0 shadow-sm"})]}),h.jsxs(Hr,{value:n,onValueChange:r,children:[h.jsxs(Dr,{className:"w-full md:w-48 h-11 bg-white border-0 shadow-sm",children:[h.jsx(eE,{className:"w-4 h-4 mr-2 text-slate-400"}),h.jsx(Gr,{placeholder:"Validasi"})]}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"all",children:"Semua Status"}),h.jsx(Kt,{value:"valid",children:"Tervalidasi"}),h.jsx(Kt,{value:"invalid",children:"Tidak Valid"}),h.jsx(Kt,{value:"need_review",children:"Perlu Review"}),h.jsx(Kt,{value:"pending",children:"Pending"})]})]}),h.jsxs("div",{className:"flex bg-white rounded-lg shadow-sm p-1",children:[h.jsx(pt,{variant:i==="grid"?"default":"ghost",size:"sm",onClick:()=>a("grid"),className:i==="grid"?"bg-emerald-600 hover:bg-emerald-700":"",children:h.jsx(WH,{className:"w-4 h-4"})}),h.jsx(pt,{variant:i==="map"?"default":"ghost",size:"sm",onClick:()=>a("map"),className:i==="map"?"bg-emerald-600 hover:bg-emerald-700":"",children:h.jsx(XH,{className:"w-4 h-4"})})]})]}),s?h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3,4,5,6].map(x=>h.jsx("div",{className:"h-48 bg-white rounded-xl animate-pulse"},x))}):i==="map"?h.jsx(Rt.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:h.jsx(Tk,{lands:P,plants:y,readOnly:!0,center:p.length>0?[p[0].center_lat||-6.2,p[0].center_lng||106.8]:[-6.2,106.8],zoom:10})}):P.length>0?h.jsx(Rt.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:P.map((x,w)=>h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:w*.05},children:h.jsx(Sk,{land:x,farmerName:b[x.farmer_id],plantCount:y.filter(T=>T.land_id===x.id).length})},x.id))}):h.jsx(Qa,{icon:js,title:"Tidak ada lahan ditemukan",description:e||n!=="all"?"Coba ubah filter pencarian Anda":"Mulai dengan mendaftarkan lahan baru",action:()=>window.location.href=ei("LandRegister"),actionLabel:"Tambah Lahan Pertama"})]})})}delete Es.Icon.Default.prototype._getIconUrl;Es.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png"});const x$=e=>{const t=["#ef4444","#f59e0b","#22c55e","#3b82f6","#8b5cf6","#ec4899","#14b8a6"];return t[e%t.length]};function pSe({center:e,zoom:t}){const n=dx();return M.useEffect(()=>{e&&n.flyTo(e,t||18)},[e,n,t]),null}function mSe(e){if(e.length<3)return 0;let t=0;for(let o=0;o<e.length;o++){const s=(o+1)%e.length;t+=e[o][1]*e[s][0],t-=e[s][1]*e[o][0]}t=Math.abs(t)/2;const n=e.reduce((o,s)=>o+s[0],0)/e.length,r=111320,i=111320*Math.cos(n*Math.PI/180);return t*r*i/1e4}function kk({existingPolygon:e,onSave:t,readOnly:n=!1}){const[r,i]=M.useState(e||[]),[a,o]=M.useState(null),[s,c]=M.useState(!1),[d,p]=M.useState(null),[m,y]=M.useState(null),b=mSe(r);M.useEffect(()=>{if(e&&e.length>0){const R=e.map($=>[$[1],$[0]]);i(R)}else i([])},[e]);const P=()=>{if(!navigator.geolocation){Mt.error("GPS tidak didukung di perangkat ini");return}c(!0);const R=navigator.geolocation.watchPosition($=>{const{latitude:V,longitude:K,accuracy:Z}=$.coords;o([V,K]),p(Z),c(!1)},$=>{switch(c(!1),$.code){case $.PERMISSION_DENIED:Mt.error("Izin GPS ditolak. Aktifkan GPS di pengaturan.");break;case $.POSITION_UNAVAILABLE:Mt.error("Lokasi tidak tersedia. Pastikan GPS aktif.");break;case $.TIMEOUT:Mt.error("Waktu pencarian lokasi habis. Coba lagi.");break;default:Mt.error("Gagal mendapatkan lokasi")}},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0});y(R)},x=()=>{m!==null&&(navigator.geolocation.clearWatch(m),y(null))};M.useEffect(()=>(P(),()=>x()),[]);const w=()=>{if(!a){Mt.error("Tunggu GPS menemukan lokasi Anda");return}const R=[...r,a];i(R),Mt.success(`Titik ${R.length} ditandai!`)},T=()=>{if(r.length>0){const R=r.slice(0,-1);i(R),Mt.info("Titik terakhir dihapus")}},E=()=>{i([]),Mt.info("Semua titik dihapus")},k=()=>{if(r.length<3){Mt.error("Minimal 3 titik untuk membentuk lahan");return}const R=r.reduce((V,K)=>V+K[0],0)/r.length,$=r.reduce((V,K)=>V+K[1],0)/r.length;t({polygon_coordinates:r.map(V=>[V[1],V[0]]),center_lat:R,center_lng:$,area_hectares:b})},D=R=>new Es.DivIcon({className:"custom-corner-icon",html:`<div style="
|
||
width: 32px;
|
||
height: 32px;
|
||
background: ${x$(R)};
|
||
border-radius: 50%;
|
||
border: 3px solid white;
|
||
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: white;
|
||
font-weight: bold;
|
||
font-size: 14px;
|
||
">${R+1}</div>`,iconSize:[32,32],iconAnchor:[16,16]}),I=new Es.DivIcon({className:"current-location-icon",html:`<div style="
|
||
width: 20px;
|
||
height: 20px;
|
||
background: #3b82f6;
|
||
border-radius: 50%;
|
||
border: 4px solid white;
|
||
box-shadow: 0 0 0 2px #3b82f6, 0 2px 8px rgba(0,0,0,0.3);
|
||
animation: pulse 2s infinite;
|
||
"></div>
|
||
<style>
|
||
@keyframes pulse {
|
||
0% { box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.4); }
|
||
50% { box-shadow: 0 0 0 2px #3b82f6, 0 0 0 12px rgba(59, 130, 246, 0); }
|
||
100% { box-shadow: 0 0 0 2px #3b82f6, 0 0 0 4px rgba(59, 130, 246, 0.4); }
|
||
}
|
||
</style>`,iconSize:[20,20],iconAnchor:[10,10]});return h.jsxs(Tt,{className:"border-0 shadow-sm overflow-hidden",children:[h.jsxs("div",{className:"p-4 bg-slate-50 border-b border-slate-100 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-3 h-3 rounded-full ${a?"bg-emerald-500 animate-pulse":"bg-amber-500"}`}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-slate-700",children:s?"Mencari lokasi GPS...":a?"GPS Aktif":"GPS Tidak Aktif"}),d&&h.jsxs("p",{className:"text-xs text-slate-500",children:["Akurasi: ±",d.toFixed(0)," meter"]})]})]}),a&&h.jsxs(ur,{variant:"outline",className:"text-xs",children:[a[0].toFixed(6),", ",a[1].toFixed(6)]})]}),h.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((R,$)=>h.jsxs("div",{className:"px-3 py-1.5 rounded-full text-sm font-medium text-white",style:{backgroundColor:x$($)},children:["Titik ",$+1]},$))}),!n&&h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsxs(pt,{onClick:w,disabled:!a||r.length>=4,className:"flex-1 bg-emerald-600 hover:bg-emerald-700 h-12 text-base",children:[h.jsx(r9,{className:"w-5 h-5 mr-2"}),"Tandai Titik ",r.length+1]}),h.jsx(pt,{variant:"outline",onClick:T,disabled:r.length===0,className:"h-12",children:h.jsx(u9,{className:"w-5 h-5"})}),h.jsx(pt,{variant:"outline",onClick:E,disabled:r.length===0,className:"h-12",children:h.jsx(nb,{className:"w-5 h-5"})})]}),r.length>=3&&h.jsx("div",{className:"p-4 bg-emerald-50 rounded-xl border border-emerald-100",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-emerald-600 font-medium",children:"Luas Lahan Terhitung"}),h.jsxs("p",{className:"text-3xl font-bold text-emerald-700",children:[b.toFixed(4)," Ha"]}),h.jsxs("p",{className:"text-xs text-emerald-500 mt-1",children:[(b*1e4).toFixed(0)," m²"]})]}),!n&&h.jsxs(pt,{onClick:k,className:"bg-emerald-600 hover:bg-emerald-700 h-12 px-6",children:[h.jsx(nF,{className:"w-5 h-5 mr-2"}),"Simpan Lahan"]})]})})]}),h.jsxs("div",{className:"h-[400px] relative",children:[h.jsxs(jk,{center:a||[-6.2,106.8],zoom:18,className:"h-full w-full z-0",scrollWheelZoom:!0,children:[h.jsx(Ok,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),a&&h.jsx(pSe,{center:a,zoom:18}),a&&h.jsx(Lc,{position:a,icon:I}),r.map((R,$)=>h.jsx(Lc,{position:R,icon:D($)},$)),r.length>=3&&h.jsx(hx,{positions:r,pathOptions:{color:"#16a34a",fillColor:"#16a34a",fillOpacity:.3,weight:3}})]}),!n&&h.jsx("div",{className:"absolute bottom-4 left-4 right-4 bg-white/95 backdrop-blur rounded-xl p-4 shadow-lg z-[1000]",children:h.jsxs("p",{className:"text-sm text-slate-700",children:[h.jsx("span",{className:"font-semibold",children:"Petunjuk:"}),"Berdiri di setiap sudut lahan lalu tekan",h.jsxs("span",{className:"font-semibold text-emerald-600",children:[" ","Tandai Titik ",r.length+1]}),".",r.length<3&&" Minimal 3 titik untuk membentuk polygon.",r.length>=3&&" Anda dapat menambahkan titik tambahan mengikuti bentuk lahan."]})})]})]})}function gSe(){const e=dE(),t=As(),r=new URLSearchParams(window.location.search).get("farmer_id"),[i,a]=M.useState({farmer_id:r||"",name:"",land_status:"owned",village:"",district:"",regency:"",polygon_coordinates:null,center_lat:null,center_lng:null,area_hectares:null,validation_status:"pending",sync_status:"pending"}),{data:o=[]}=bn({queryKey:["farmers"],queryFn:async()=>{try{const y=await mt.entities.Farmer.list(),b=Array.isArray(y)?y:[],P=await Tr.getEntities("farmers"),x=new js;return b.forEach(w=>x.set(w.id,w)),P.forEach(w=>x.set(w.id,w)),Array.from(x.values())}catch{return console.warn("Gagal ambil petani dari server, mencoba ambil lokal..."),await Tr.getEntities("farmers")}}}),s=Array.isArray(o)?o:[],c=ci({mutationFn:async y=>{try{const b=await mt.entities.Land.create(y);if(typeof b=="string"&&b.includes("<!doctype html>"))throw new Error("Menerima HTML, bukan JSON. Endpoint mungkin salah.");return console.log("2. Berhasil simpan ke server",b),b}catch(b){throw console.log("2. Gagal ke server, beralih ke offline mode",b),{type:"OFFLINE_SAVE",data:y}}},onSuccess:y=>{t.invalidateQueries({queryKey:["lands"]}),Mt.success("Lahan berhasil didaftarkan!"),e(ei("LandDetail")+`?id=${y.id}`)},onError:async(y,b)=>{if(y.type==="OFFLINE_SAVE")try{const x=await Tr.saveEntityLocally("land",b);t.invalidateQueries({queryKey:["lands"]}),Mt.info("Tersimpan secara lokal"),setTimeout(()=>{e(ei("Lands"))},500),e(ei("Lands"))}catch(P){console.error("SQLite Error:",P),Mt.error("Gagal simpan lokal")}}}),d=(y,b)=>{a(P=>({...P,[y]:b}))},p=y=>{const b=JSON.parse(JSON.stringify(y.polygon_coordinates));a(P=>({...P,polygon_coordinates:b,center_lat:Number(y.center_lat),center_lng:Number(y.center_lng),area_hectares:Number(y.area_hectares)})),Mt.success(`Polygon disimpan! Luas: ${y.area_hectares.toFixed(4)} Ha`)},m=y=>{if(y.preventDefault(),!i.farmer_id){Mt.error("Pilih petani terlebih dahulu");return}if(!i.center_lat||!i.center_lng){Mt.error("Gambar polygon lahan di peta");return}console.log("🚀 SUBMIT formData:",i),c.mutate(i)};return Array.isArray(s)&&s.find(y=>y.id===i.farmer_id),h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-5xl mx-auto p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center gap-4",children:[h.jsx(zo,{to:ei("Lands"),children:h.jsx(pt,{variant:"outline",size:"icon",className:"h-10 w-10",children:h.jsx(J0,{className:"w-5 h-5"})})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Registrasi Lahan Baru"}),h.jsx("p",{className:"text-slate-500",children:"Gambar polygon dan isi data lahan"})]})]}),h.jsxs("form",{onSubmit:m,className:"space-y-6",children:[h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-4",children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(zf,{className:"w-5 h-5 text-emerald-600"}),"Pemilik Lahan"]})}),h.jsx(Pn,{children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Pilih Petani"}),h.jsxs(Hr,{value:i.farmer_id,onValueChange:y=>d("farmer_id",y),children:[h.jsx(Dr,{className:"h-11",children:h.jsx(Gr,{placeholder:"Cari dan pilih petani..."})}),h.jsx(Br,{children:s.map(y=>h.jsxs(Kt,{value:y.id,children:[y.full_name," - ",y.village,", ",y.district]},y.id))})]})]})})]})}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.15},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-4",children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(js,{className:"w-5 h-5 text-emerald-600"}),"Informasi Lahan"]})}),h.jsxs(Pn,{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Nama/Label Lahan"}),h.jsx(nn,{value:i.name,onChange:y=>d("name",y.target.value),placeholder:"Contoh: Kebun Kopi Utara",required:!0,className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Status Kepemilikan"}),h.jsxs(Hr,{value:i.land_status,onValueChange:y=>d("land_status",y),children:[h.jsx(Dr,{className:"h-11",children:h.jsx(Gr,{})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"owned",children:"Milik Sendiri"}),h.jsx(Kt,{value:"rented",children:"Sewa"}),h.jsx(Kt,{value:"shared",children:"Bagi Hasil"}),h.jsx(Kt,{value:"government",children:"Tanah Negara"})]})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Desa"}),h.jsx(nn,{value:i.village,onChange:y=>d("village",y.target.value),placeholder:"Nama desa",className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Kecamatan"}),h.jsx(nn,{value:i.district,onChange:y=>d("district",y.target.value),placeholder:"Nama kecamatan",className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Kabupaten"}),h.jsx(nn,{value:i.regency,onChange:y=>d("regency",y.target.value),placeholder:"Nama kabupaten",className:"h-11"})]})]}),i.area_hectares&&h.jsxs("div",{className:"p-4 bg-emerald-50 rounded-lg border border-emerald-100",children:[h.jsx("p",{className:"text-sm text-emerald-600",children:"Luas Lahan Terhitung"}),h.jsxs("p",{className:"text-2xl font-bold text-emerald-700",children:[i.area_hectares.toFixed(4)," Hektar"]})]})]})]})}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:h.jsx(kk,{onSave:p})}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.25},className:"flex justify-end",children:h.jsxs(pt,{type:"submit",disabled:c.isPending||!i.farmer_id,className:"bg-emerald-600 hover:bg-emerald-700 h-11 px-8",children:[c.isPending&&h.jsx(ti,{className:"w-4 h-4 mr-2 animate-spin"}),"Daftarkan Lahan"]})})]})]})})}function vSe(e){const t=ySe(e),n=M.forwardRef((r,i)=>{const{children:a,...o}=r,s=M.Children.toArray(a),c=s.find(xSe);if(c){const d=c.props.children,p=s.map(m=>m===c?M.Children.count(d)>1?M.Children.only(null):M.isValidElement(d)?d.props.children:null:m);return h.jsx(t,{...o,ref:i,children:M.isValidElement(d)?M.cloneElement(d,void 0,p):null})}return h.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function ySe(e){const t=M.forwardRef((n,r)=>{const{children:i,...a}=n;if(M.isValidElement(i)){const o=_Se(i),s=wSe(a,i.props);return i.type!==M.Fragment&&(s.ref=r?dp(r,o):o),M.cloneElement(i,s)}return M.Children.count(i)>1?M.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bSe=Symbol("radix.slottable");function xSe(e){return M.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bSe}function wSe(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{const c=a(...s);return i(...s),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function _Se(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gx="Dialog",[TW]=gd(gx),[SSe,ml]=TW(gx),EW=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=M.useRef(null),c=M.useRef(null),[d,p]=Zh({prop:r,defaultProp:i??!1,onChange:a,caller:gx});return h.jsx(SSe,{scope:t,triggerRef:s,contentRef:c,contentId:Rc(),titleId:Rc(),descriptionId:Rc(),open:d,onOpenChange:p,onOpenToggle:M.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};EW.displayName=gx;var AW="DialogTrigger",kW=M.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ml(AW,n),a=Er(t,i.triggerRef);return h.jsx(Dn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Mk(i.open),...r,ref:a,onClick:Mn(e.onClick,i.onOpenToggle)})});kW.displayName=AW;var Ck="DialogPortal",[PSe,CW]=TW(Ck,{forceMount:void 0}),NW=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ml(Ck,t);return h.jsx(PSe,{scope:t,forceMount:n,children:M.Children.map(r,o=>h.jsx(zg,{present:n||a.open,children:h.jsx(bk,{asChild:!0,container:i,children:o})}))})};NW.displayName=Ck;var G0="DialogOverlay",MW=M.forwardRef((e,t)=>{const n=CW(G0,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ml(G0,e.__scopeDialog);return a.modal?h.jsx(zg,{present:r||a.open,children:h.jsx(OSe,{...i,ref:t})}):null});MW.displayName=G0;var jSe=vSe("DialogOverlay.RemoveScroll"),OSe=M.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ml(G0,n);return h.jsx(xk,{as:jSe,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Dn.div,{"data-state":Mk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),od="DialogContent",RW=M.forwardRef((e,t)=>{const n=CW(od,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ml(od,e.__scopeDialog);return h.jsx(zg,{present:r||a.open,children:a.modal?h.jsx(TSe,{...i,ref:t}):h.jsx(ESe,{...i,ref:t})})});RW.displayName=od;var TSe=M.forwardRef((e,t)=>{const n=ml(od,e.__scopeDialog),r=M.useRef(null),i=Er(t,n.contentRef,r);return M.useEffect(()=>{const a=r.current;if(a)return i8(a)},[]),h.jsx(LW,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mn(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Mn(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:Mn(e.onFocusOutside,a=>a.preventDefault())})}),ESe=M.forwardRef((e,t)=>{const n=ml(od,e.__scopeDialog),r=M.useRef(!1),i=M.useRef(!1);return h.jsx(LW,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),LW=M.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ml(od,n),c=M.useRef(null),d=Er(t,c);return kV(),h.jsxs(h.Fragment,{children:[h.jsx(ck,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:h.jsx(uk,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Mk(s.open),...o,ref:d,onDismiss:()=>s.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(ASe,{titleId:s.titleId}),h.jsx(CSe,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Nk="DialogTitle",IW=M.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ml(Nk,n);return h.jsx(Dn.h2,{id:i.titleId,...r,ref:t})});IW.displayName=Nk;var DW="DialogDescription",BW=M.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ml(DW,n);return h.jsx(Dn.p,{id:i.descriptionId,...r,ref:t})});BW.displayName=DW;var $W="DialogClose",FW=M.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ml($W,n);return h.jsx(Dn.button,{type:"button",...r,ref:t,onClick:Mn(e.onClick,()=>i.onOpenChange(!1))})});FW.displayName=$W;function Mk(e){return e?"open":"closed"}var qW="DialogTitleWarning",[JOe,zW]=Tbe(qW,{contentName:od,titleName:Nk,docsSlug:"dialog"}),ASe=({titleId:e})=>{const t=zW(qW),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return M.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},kSe="DialogDescriptionWarning",CSe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zW(kSe).contentName}}.`;return M.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},NSe=EW,MSe=kW,RSe=NW,UW=MW,VW=RW,WW=IW,KW=BW,LSe=FW;const sl=NSe,HW=MSe,ISe=RSe,GW=M.forwardRef(({className:e,...t},n)=>h.jsx(UW,{ref:n,className:fn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));GW.displayName=UW.displayName;const Ss=M.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(ISe,{children:[h.jsx(GW,{}),h.jsxs(VW,{ref:r,className:fn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(LSe,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(rb,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ss.displayName=VW.displayName;const ql=({className:e,...t})=>h.jsx("div",{className:fn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ql.displayName="DialogHeader";const zl=M.forwardRef(({className:e,...t},n)=>h.jsx(WW,{ref:n,className:fn("text-lg font-semibold leading-none tracking-tight",e),...t}));zl.displayName=WW.displayName;const DSe=M.forwardRef(({className:e,...t},n)=>h.jsx(KW,{ref:n,className:fn("text-sm text-muted-foreground",e),...t}));DSe.displayName=KW.displayName;function gl(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function sd(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const ZW=6048e5,BSe=864e5;let $Se={};function vx(){return $Se}function mg(e,t){var s,c,d,p;const n=vx(),r=(t==null?void 0:t.weekStartsOn)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((p=(d=n.locale)==null?void 0:d.options)==null?void 0:p.weekStartsOn)??0,i=gl(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Z0(e){return mg(e,{weekStartsOn:1})}function YW(e){const t=gl(e),n=t.getFullYear(),r=sd(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Z0(r),a=sd(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const o=Z0(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function w$(e){const t=gl(e);return t.setHours(0,0,0,0),t}function _$(e){const t=gl(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function FSe(e,t){const n=w$(e),r=w$(t),i=+n-_$(n),a=+r-_$(r);return Math.round((i-a)/BSe)}function qSe(e){const t=YW(e),n=sd(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Z0(n)}function zSe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function USe(e){if(!zSe(e)&&typeof e!="number")return!1;const t=gl(e);return!isNaN(Number(t))}function VSe(e){const t=gl(e),n=sd(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const WSe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},KSe=(e,t,n)=>{let r;const i=WSe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function th(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const HSe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},GSe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ZSe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},YSe={date:th({formats:HSe,defaultWidth:"full"}),time:th({formats:GSe,defaultWidth:"full"}),dateTime:th({formats:ZSe,defaultWidth:"full"})},XSe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},QSe=(e,t,n,r)=>XSe[e];function Cl(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,s=n!=null&&n.width?String(n.width):o;i=e.formattingValues[s]||e.formattingValues[o]}else{const o=e.defaultWidth,s=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[s]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const JSe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ePe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tPe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nPe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},rPe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},iPe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},aPe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},oPe={ordinalNumber:aPe,era:Cl({values:JSe,defaultWidth:"wide"}),quarter:Cl({values:ePe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Cl({values:tPe,defaultWidth:"wide"}),day:Cl({values:nPe,defaultWidth:"wide"}),dayPeriod:Cl({values:rPe,defaultWidth:"wide",formattingValues:iPe,defaultFormattingWidth:"wide"})};function Nl(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?lPe(s,m=>m.test(o)):sPe(s,m=>m.test(o));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const p=t.slice(o.length);return{value:d,rest:p}}}function sPe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lPe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function XW(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;const s=t.slice(i.length);return{value:o,rest:s}}}const uPe=/^(\d+)(th|st|nd|rd)?/i,cPe=/\d+/i,fPe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},dPe={any:[/^b/i,/^(a|c)/i]},hPe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pPe={any:[/1/i,/2/i,/3/i,/4/i]},mPe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gPe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},vPe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},yPe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bPe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},xPe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},wPe={ordinalNumber:XW({matchPattern:uPe,parsePattern:cPe,valueCallback:e=>parseInt(e,10)}),era:Nl({matchPatterns:fPe,defaultMatchWidth:"wide",parsePatterns:dPe,defaultParseWidth:"any"}),quarter:Nl({matchPatterns:hPe,defaultMatchWidth:"wide",parsePatterns:pPe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nl({matchPatterns:mPe,defaultMatchWidth:"wide",parsePatterns:gPe,defaultParseWidth:"any"}),day:Nl({matchPatterns:vPe,defaultMatchWidth:"wide",parsePatterns:yPe,defaultParseWidth:"any"}),dayPeriod:Nl({matchPatterns:bPe,defaultMatchWidth:"any",parsePatterns:xPe,defaultParseWidth:"any"})},_Pe={code:"en-US",formatDistance:KSe,formatLong:YSe,formatRelative:QSe,localize:oPe,match:wPe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function SPe(e){const t=gl(e);return FSe(t,VSe(t))+1}function PPe(e){const t=gl(e),n=+Z0(t)-+qSe(t);return Math.round(n/ZW)+1}function QW(e,t){var p,m,y,b;const n=gl(e),r=n.getFullYear(),i=vx(),a=(t==null?void 0:t.firstWeekContainsDate)??((m=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??i.firstWeekContainsDate??((b=(y=i.locale)==null?void 0:y.options)==null?void 0:b.firstWeekContainsDate)??1,o=sd(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);const s=mg(o,t),c=sd(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const d=mg(c,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function jPe(e,t){var s,c,d,p;const n=vx(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(s=t==null?void 0:t.locale)==null?void 0:s.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(d=n.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??1,i=QW(e,t),a=sd(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),mg(a,t)}function OPe(e,t){const n=gl(e),r=+mg(n,t)-+jPe(n,t);return Math.round(r/ZW)+1}function er(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const uc={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return er(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):er(n+1,2)},d(e,t){return er(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return er(e.getHours()%12||12,t.length)},H(e,t){return er(e.getHours(),t.length)},m(e,t){return er(e.getMinutes(),t.length)},s(e,t){return er(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return er(i,t.length)}},$d={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},S$={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return uc.y(e,t)},Y:function(e,t,n,r){const i=QW(e,r),a=i>0?i:1-i;if(t==="YY"){const o=a%100;return er(o,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):er(a,t.length)},R:function(e,t){const n=YW(e);return er(n,t.length)},u:function(e,t){const n=e.getFullYear();return er(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return er(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return er(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return uc.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return er(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=OPe(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):er(i,t.length)},I:function(e,t,n){const r=PPe(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):er(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):uc.d(e,t)},D:function(e,t,n){const r=SPe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):er(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return er(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return er(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return er(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=$d.noon:r===0?i=$d.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=$d.evening:r>=12?i=$d.afternoon:r>=4?i=$d.morning:i=$d.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return uc.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):uc.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):er(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):er(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):uc.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):uc.s(e,t)},S:function(e,t){return uc.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return j$(r);case"XXXX":case"XX":return Pf(r);case"XXXXX":case"XXX":default:return Pf(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return j$(r);case"xxxx":case"xx":return Pf(r);case"xxxxx":case"xxx":default:return Pf(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+P$(r,":");case"OOOO":default:return"GMT"+Pf(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+P$(r,":");case"zzzz":default:return"GMT"+Pf(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return er(r,t.length)},T:function(e,t,n){const r=e.getTime();return er(r,t.length)}};function P$(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+er(a,2)}function j$(e,t){return e%60===0?(e>0?"-":"+")+er(Math.abs(e)/60,2):Pf(e,t)}function Pf(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=er(Math.trunc(r/60),2),a=er(r%60,2);return n+i+t+a}const O$=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},JW=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},TPe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return O$(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",O$(r,t)).replace("{{time}}",JW(i,t))},EPe={p:JW,P:TPe},APe=/^D+$/,kPe=/^Y+$/,CPe=["D","DD","YY","YYYY"];function NPe(e){return APe.test(e)}function MPe(e){return kPe.test(e)}function RPe(e,t,n){const r=LPe(e,t,n);if(console.warn(r),CPe.includes(e))throw new RangeError(r)}function LPe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const IPe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,DPe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,BPe=/^'([^]*?)'?$/,$Pe=/''/g,FPe=/[a-zA-Z]/;function Uc(e,t,n){var p,m,y,b,P,x,w,T;const r=vx(),i=(n==null?void 0:n.locale)??r.locale??_Pe,a=(n==null?void 0:n.firstWeekContainsDate)??((m=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((b=(y=r.locale)==null?void 0:y.options)==null?void 0:b.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((x=(P=n==null?void 0:n.locale)==null?void 0:P.options)==null?void 0:x.weekStartsOn)??r.weekStartsOn??((T=(w=r.locale)==null?void 0:w.options)==null?void 0:T.weekStartsOn)??0,s=gl(e);if(!USe(s))throw new RangeError("Invalid time value");let c=t.match(DPe).map(E=>{const k=E[0];if(k==="p"||k==="P"){const D=EPe[k];return D(E,i.formatLong)}return E}).join("").match(IPe).map(E=>{if(E==="''")return{isToken:!1,value:"'"};const k=E[0];if(k==="'")return{isToken:!1,value:qPe(E)};if(S$[k])return{isToken:!0,value:E};if(k.match(FPe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:E}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));const d={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(E=>{if(!E.isToken)return E.value;const k=E.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&MPe(k)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&NPe(k))&&RPe(k,t,String(e));const D=S$[k[0]];return D(s,k,i.localize,d)}).join("")}function qPe(e){const t=e.match(BPe);return t?t[1].replace($Pe,"'"):e}delete Es.Icon.Default.prototype._getIconUrl;Es.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png"});const zPe=[{name:"Kopi Arabika",category:"perkebunan"},{name:"Kopi Robusta",category:"perkebunan"},{name:"Kakao",category:"perkebunan"},{name:"Kelapa Sawit",category:"perkebunan"},{name:"Karet",category:"perkebunan"},{name:"Padi",category:"pangan"},{name:"Jagung",category:"pangan"},{name:"Kedelai",category:"pangan"},{name:"Cabai",category:"hortikultura"},{name:"Tomat",category:"hortikultura"},{name:"Bawang Merah",category:"hortikultura"},{name:"Jati",category:"kehutanan"},{name:"Sengon",category:"kehutanan"}];function UPe({center:e}){const t=dx();return M.useEffect(()=>{e&&t.flyTo(e,19)},[e,t]),null}function eK({landId:e,farmerId:t,landPolygon:n,existingPlants:r=[],onTagPlant:i,isLoading:a}){const[o,s]=M.useState(null),[c,d]=M.useState(!1),[p,m]=M.useState(null),[y,b]=M.useState(null),[P,x]=M.useState(!1),[w,T]=M.useState({commodity_name:"",plant_date:Uc(new Date,"yyyy-MM-dd"),notes:""}),E=()=>{if(!navigator.geolocation){Mt.error("GPS tidak didukung di perangkat ini");return}d(!0);const K=navigator.geolocation.watchPosition(Z=>{const{latitude:ee,longitude:ne,accuracy:oe}=Z.coords;s([ee,ne]),m(oe),d(!1)},Z=>{switch(d(!1),Z.code){case Z.PERMISSION_DENIED:Mt.error("Izin GPS ditolak. Aktifkan GPS di pengaturan.");break;case Z.POSITION_UNAVAILABLE:Mt.error("Lokasi tidak tersedia. Pastikan GPS aktif.");break;case Z.TIMEOUT:Mt.error("Waktu pencarian lokasi habis. Coba lagi.");break;default:Mt.error("Gagal mendapatkan lokasi")}},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0});b(K)},k=()=>{y!==null&&(navigator.geolocation.clearWatch(y),b(null))};M.useEffect(()=>(E(),()=>k()),[]);const D=()=>{if(!o){Mt.error("Tunggu GPS menemukan lokasi Anda");return}x(!0)},I=()=>{if(!w.commodity_name){Mt.error("Pilih jenis tanaman");return}i({land_id:e,farmer_id:t,commodity_name:w.commodity_name,latitude:o[0],longitude:o[1],plant_date:w.plant_date,status:"alive",notes:w.notes,sync_status:"pending"}),x(!1),T({commodity_name:"",plant_date:Uc(new Date,"yyyy-MM-dd"),notes:""})},R=new Es.DivIcon({className:"current-location-icon",html:`<div style="
|
||
width: 24px;
|
||
height: 24px;
|
||
background: #3b82f6;
|
||
border-radius: 50%;
|
||
border: 4px solid white;
|
||
box-shadow: 0 0 0 2px #3b82f6, 0 2px 8px rgba(0,0,0,0.3);
|
||
animation: pulse 2s infinite;
|
||
"></div>`,iconSize:[24,24],iconAnchor:[12,12]}),$=new Es.DivIcon({className:"plant-icon",html:`<div style="
|
||
width: 28px;
|
||
height: 28px;
|
||
background: #16a34a;
|
||
border-radius: 50%;
|
||
border: 3px solid white;
|
||
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
">🌱</div>`,iconSize:[28,28],iconAnchor:[14,14]}),V=(n==null?void 0:n.map(K=>[K[1],K[0]]))||[];return h.jsxs(h.Fragment,{children:[h.jsxs(Tt,{className:"border-0 shadow-sm overflow-hidden",children:[h.jsxs("div",{className:"p-4 bg-slate-50 border-b border-slate-100 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-3 h-3 rounded-full ${o?"bg-emerald-500 animate-pulse":"bg-amber-500"}`}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-slate-700",children:c?"Mencari lokasi GPS...":o?"GPS Aktif":"GPS Tidak Aktif"}),p&&h.jsxs("p",{className:"text-xs text-slate-500",children:["Akurasi: ±",p.toFixed(0)," meter"]})]})]}),h.jsxs(ur,{variant:"secondary",className:"bg-emerald-100 text-emerald-700",children:[r.length," tanaman"]})]}),h.jsxs(pt,{onClick:D,disabled:!o||a,className:"w-full bg-emerald-600 hover:bg-emerald-700 h-14 text-lg",children:[a?h.jsx(ti,{className:"w-6 h-6 mr-2 animate-spin"}):h.jsx(sa,{className:"w-6 h-6 mr-2"}),"Tag Tanaman di Lokasi Ini"]}),o&&h.jsxs("p",{className:"text-xs text-slate-500 text-center",children:["Koordinat: ",o[0].toFixed(6),", ",o[1].toFixed(6)]})]}),h.jsxs("div",{className:"h-[350px] relative",children:[h.jsxs(jk,{center:o||(V.length>0?V[0]:[-6.2,106.8]),zoom:18,className:"h-full w-full z-0",scrollWheelZoom:!0,children:[h.jsx(Ok,{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),o&&h.jsx(UPe,{center:o}),V.length>=3&&h.jsx(hx,{positions:V,pathOptions:{color:"#16a34a",fillColor:"#16a34a",fillOpacity:.15,weight:2,dashArray:"5, 5"}}),o&&h.jsx(Lc,{position:o,icon:R}),r.map((K,Z)=>h.jsx(Lc,{position:[K.latitude,K.longitude],icon:$},K.id||Z))]}),h.jsx("div",{className:"absolute bottom-4 left-4 right-4 bg-white/95 backdrop-blur rounded-xl p-3 shadow-lg z-[1000]",children:h.jsxs("p",{className:"text-sm text-slate-700 text-center",children:[h.jsx("span",{className:"font-semibold",children:"Petunjuk:"})," Berdiri di dekat tanaman, lalu tekan tombol",h.jsx("span",{className:"font-semibold text-emerald-600",children:' "Tag Tanaman"'})," untuk menandai posisi."]})})]})]}),h.jsx(sl,{open:P,onOpenChange:x,children:h.jsxs(Ss,{className:"max-w-sm",children:[h.jsx(ql,{children:h.jsxs(zl,{className:"flex items-center gap-2",children:[h.jsx(sa,{className:"w-5 h-5 text-emerald-600"}),"Tag Tanaman Baru"]})}),h.jsxs("div",{className:"space-y-4 pt-2",children:[o&&h.jsxs("div",{className:"p-3 bg-slate-50 rounded-lg",children:[h.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Koordinat GPS"}),h.jsxs("p",{className:"text-sm font-mono font-medium text-slate-700",children:[o[0].toFixed(6),", ",o[1].toFixed(6)]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Jenis Tanaman *"}),h.jsxs(Hr,{value:w.commodity_name,onValueChange:K=>T(Z=>({...Z,commodity_name:K})),children:[h.jsx(Dr,{className:"h-11",children:h.jsx(Gr,{placeholder:"Pilih jenis tanaman"})}),h.jsx(Br,{children:zPe.map(K=>h.jsx(Kt,{value:K.name,children:K.name},K.name))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Tanggal Tanam"}),h.jsx(nn,{type:"date",value:w.plant_date,onChange:K=>T(Z=>({...Z,plant_date:K.target.value})),className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Catatan (Opsional)"}),h.jsx(nn,{value:w.notes,onChange:K=>T(Z=>({...Z,notes:K.target.value})),placeholder:"Contoh: Bibit dari kebun sendiri",className:"h-11"})]}),h.jsxs("div",{className:"flex gap-3 pt-2",children:[h.jsx(pt,{variant:"outline",className:"flex-1",onClick:()=>x(!1),children:"Batal"}),h.jsxs(pt,{className:"flex-1 bg-emerald-600 hover:bg-emerald-700",onClick:I,disabled:!w.commodity_name||a,children:[a&&h.jsx(ti,{className:"w-4 h-4 mr-2 animate-spin"}),"Simpan Tag"]})]})]})]})})]})}const T$={valid:{bg:"bg-emerald-50",border:"border-emerald-200",text:"text-emerald-700",icon:la},invalid:{bg:"bg-rose-50",border:"border-rose-200",text:"text-rose-700",icon:ph},need_review:{bg:"bg-amber-50",border:"border-amber-200",text:"text-amber-700",icon:ul},pending:{bg:"bg-slate-50",border:"border-slate-200",text:"text-slate-600",icon:Hf}},VPe={valid:"Tervalidasi",invalid:"Tidak Valid",need_review:"Perlu Review",pending:"Menunggu Validasi"};function WPe(){const t=new URLSearchParams(window.location.search).get("id"),n=As(),[r,i]=M.useState(!1),[a,o]=M.useState(!1),{id:s}=WF(),c=s||t,[d,p]=M.useState(null),m=(Z,ee)=>{p(ne=>({...ne,[Z]:ee}))},y=Z=>{p(ee=>({...ee,...Z})),Mt.success(`Polygon disimpan! Luas: ${Z.area_hectares.toFixed(4)} Ha`)},b=ci({mutationFn:Z=>mt.entities.Land.update(c,Z),onSuccess:()=>{n.invalidateQueries({queryKey:["lands"]}),n.invalidateQueries({queryKey:["land",c]}),Mt.success("Lahan berhasil diperbarui!"),o(!1)},onError:Z=>{console.error("Update land error:",Z),Mt.error("Gagal memperbarui lahan")}}),{data:P=[],isLoading:x,isError:w}=bn({queryKey:["land",c],queryFn:async()=>{try{const ee=await mt.entities.Land.get(c);if(ee&&!ee.error)return ee}catch{console.warn("Server unreachable, searching locally...")}const Z=await Tr.getEntities("lands",{id:c});if(Z&&Z.length>0)return{...Z[0],isOffline:!0};throw new Error("Lahan tidak ditemukan")},enabled:!!c}),{data:T}=bn({queryKey:["farmer",P==null?void 0:P.farmer_id],queryFn:async()=>{if(!(P!=null&&P.farmer_id))return null;try{return await mt.entities.Farmer.get(P.farmer_id)}catch{return(await Tr.getEntities("farmers",{id:P.farmer_id}))[0]||null}},enabled:!!(P!=null&&P.farmer_id)}),{data:E=[]}=bn({queryKey:["plants",c],queryFn:async()=>{try{const Z=await mt.entities.Plant.list({q:JSON.stringify({land_id:c})});return Array.isArray(Z)?Z:[]}catch{const ee=await Tr.getEntities("plants",{land_id:c});return Array.isArray(ee)?ee:[]}}}),{data:k=[]}=bn({queryKey:["inspections",c],queryFn:async()=>{try{const Z=await mt.entities.PlantInspection.list();return Array.isArray(Z)?Z:[]}catch{const ee=await Tr.getEntities("plant_inspections");return Array.isArray(ee)?ee:[]}}});E.filter(Z=>(Z==null?void 0:Z.status)!=="harvested");const D=M.useMemo(()=>{const Z=new Map;return k.forEach(ee=>{const ne=`${ee.farmer_id}_${ee.land_id}_${ee.plant_id}`;(!Z.has(ne)||new Date(ee.created_date)>new Date(Z.get(ne).created_date))&&Z.set(ne,ee)}),E.map(ee=>{const ne=`${ee.farmer_id}_${ee.land_id}_${ee.id}`,oe=Z.get(ne),he=(oe==null?void 0:oe.productivity_status)||ee.productivity_status||"alive";return{...ee,display_status:he.toLowerCase(),last_inspection_date:(oe==null?void 0:oe.inspection_date)||ee.plant_date,has_issue:(oe==null?void 0:oe.health_status)==="mild_issue"||(oe==null?void 0:oe.health_status)==="unhealthy"||(oe==null?void 0:oe.health_status)==="sick"}})},[E,k]),I=ci({mutationFn:Z=>mt.entities.Land.update(c,{validation_status:Z}),onSuccess:()=>{n.invalidateQueries({queryKey:["land",c]}),Mt.success("Status validasi diperbarui!")}}),R=ci({mutationFn:Z=>mt.entities.Plant.create(Z),onSuccess:()=>{n.invalidateQueries({queryKey:["plants",c]}),setShowPlantForm(!1),Mt.success("Tanaman berhasil ditambahkan!")}});console.log(D);const $=M.useMemo(()=>D?D.reduce((Z,ee)=>(ee.display_status==="alive"||ee.display_status==="productive"?Z.alive++:ee.display_status==="sick"||ee.display_status==="less_productive"||ee.has_issue?Z.sick++:(ee.display_status==="dead"||ee.display_status==="unproductive")&&Z.dead++,Z),{alive:0,sick:0,dead:0}):{alive:0,sick:0,dead:0},[D]);if(M.useEffect(()=>{P&&a&&p({id:P.id,farmer_id:P.farmer_id,name:P.name,land_status:P.land_status,village:P.village,district:P.district,regency:P.regency,polygon_coordinates:P.polygon_coordinates,center_lat:P.center_lat,center_lng:P.center_lng,area_hectares:P.area_hectares,validation_status:P.validation_status,sync_status:P.sync_status})},[P,a]),x)return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 flex items-center justify-center",children:h.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-emerald-600 border-t-transparent rounded-full"})});if(!P)return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 p-6",children:h.jsxs("div",{className:"max-w-5xl mx-auto text-center py-16",children:[h.jsx("p",{className:"text-slate-500",children:"Lahan tidak ditemukan"}),h.jsx(zo,{to:ei("Lands"),children:h.jsx(pt,{variant:"outline",className:"mt-4",children:"Kembali ke Daftar"})})]})});const V=T$[P.validation_status]||T$.pending,K=V.icon;return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-6xl mx-auto p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx(zo,{to:ei("Lands"),children:h.jsx(pt,{variant:"outline",size:"icon",className:"h-10 w-10",children:h.jsx(J0,{className:"w-5 h-5"})})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:P.name}),h.jsxs("p",{className:"text-slate-500",children:[P.village,", ",P.district]})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(J8,{status:P.sync_status}),h.jsxs(pt,{variant:"outline",size:"sm",onClick:()=>o(!0),children:[h.jsx(aF,{className:"w-4 h-4 mr-2"}),"Edit"]})]})]}),a&&d&&h.jsxs("form",{onSubmit:Z=>{if(Z.preventDefault(),!d.center_lat||!d.center_lng){Mt.error("Polygon lahan belum digambar");return}b.mutate({...d,id:c})},className:"space-y-6",children:[h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-4",children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(zf,{className:"w-5 h-5 text-emerald-600"}),"Pemilik Lahan"]})}),h.jsx(Pn,{children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Pilih Petani"}),h.jsxs(Hr,{value:d.farmer_id,onValueChange:Z=>m("farmer_id",Z),children:[h.jsx(Dr,{className:"h-11",children:h.jsx(Gr,{placeholder:"Cari dan pilih petani..."})}),h.jsx(Br,{children:farmers.map(Z=>h.jsxs(Kt,{value:Z.id,children:[Z.full_name," - ",Z.village,", ",Z.district]},Z.id))})]})]})})]})}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.15},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{className:"pb-4",children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(So,{className:"w-5 h-5 text-emerald-600"}),"Informasi Lahan"]})}),h.jsxs(Pn,{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Nama/Label Lahan"}),h.jsx(nn,{value:d.name,onChange:Z=>m("name",Z.target.value),placeholder:"Contoh: Kebun Kopi Utara",required:!0,className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Status Kepemilikan"}),h.jsxs(Hr,{value:d.land_status,onValueChange:Z=>m("land_status",Z),children:[h.jsx(Dr,{className:"h-11",children:h.jsx(Gr,{})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"owned",children:"Milik Sendiri"}),h.jsx(Kt,{value:"rented",children:"Sewa"}),h.jsx(Kt,{value:"shared",children:"Bagi Hasil"}),h.jsx(Kt,{value:"government",children:"Tanah Negara"})]})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Desa"}),h.jsx(nn,{value:d.village,onChange:Z=>m("village",Z.target.value),placeholder:"Nama desa",className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Kecamatan"}),h.jsx(nn,{value:d.district,onChange:Z=>m("district",Z.target.value),placeholder:"Nama kecamatan",className:"h-11"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Kabupaten"}),h.jsx(nn,{value:d.regency,onChange:Z=>m("regency",Z.target.value),placeholder:"Nama kabupaten",className:"h-11"})]})]}),d.area_hectares&&h.jsxs("div",{className:"p-4 bg-emerald-50 rounded-lg border border-emerald-100",children:[h.jsx("p",{className:"text-sm text-emerald-600",children:"Luas Lahan Terhitung"}),h.jsxs("p",{className:"text-2xl font-bold text-emerald-700",children:[d.area_hectares.toFixed(4)," Hektar"]})]})]})]})}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:h.jsx(kk,{onSave:y})}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.25},className:"flex justify-end",children:h.jsxs(pt,{type:"submit",disabled:b.isPending||!d.farmer_id,className:"bg-emerald-600 hover:bg-emerald-700 h-11 px-8",children:[b.isPending&&h.jsx(ti,{className:"w-4 h-4 mr-2 animate-spin"}),"Daftarkan Lahan"]})})]}),!a&&h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1},className:"space-y-6",children:[h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsxs(Pn,{className:"p-6 space-y-4",children:[h.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg ${V.bg} ${V.border} border`,children:[h.jsx(K,{className:`w-5 h-5 ${V.text}`}),h.jsx("span",{className:`font-medium ${V.text}`,children:VPe[P.validation_status]})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[h.jsx(eF,{className:"w-5 h-5 text-slate-400"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Luas Lahan"}),h.jsx("p",{className:"font-semibold text-slate-900",children:P.area_hectares?`${P.area_hectares.toFixed(2)} Hektar`:"-"})]})]}),h.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[h.jsx(So,{className:"w-5 h-5 text-slate-400"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Lokasi"}),h.jsxs("p",{className:"font-medium text-slate-900",children:[P.village,", ",P.district,h.jsx("br",{}),P.regency]})]})]}),T&&h.jsx(zo,{to:ei("FarmerDetail")+`?id=${T.id}`,children:h.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg hover:bg-slate-100 transition-colors cursor-pointer",children:[h.jsx("div",{className:"w-10 h-10 rounded-full bg-emerald-100 flex items-center justify-center",children:h.jsx(zf,{className:"w-5 h-5 text-emerald-600"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Pemilik"}),h.jsx("p",{className:"font-medium text-slate-900",children:T.full_name})]})]})})]}),(P.validation_status==="pending"||P.validation_status==="need_review")&&h.jsxs("div",{className:"pt-4 border-t border-slate-100 space-y-2",children:[h.jsx("p",{className:"text-sm text-slate-500 text-center",children:"Tindakan Validasi"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(pt,{className:"flex-1 bg-emerald-600 hover:bg-emerald-700",size:"sm",onClick:()=>I.mutate("valid"),disabled:I.isPending,children:[h.jsx(la,{className:"w-4 h-4 mr-1"}),"Valid"]}),h.jsxs(pt,{variant:"destructive",className:"flex-1",size:"sm",onClick:()=>I.mutate("invalid"),disabled:I.isPending,children:[h.jsx(ph,{className:"w-4 h-4 mr-1"}),"Invalid"]})]})]})]})}),h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsxs(Ti,{className:"flex flex-row items-center justify-between pb-2",children:[h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(sa,{className:"w-5 h-5 text-emerald-600"}),"Tanaman"]}),h.jsxs(pt,{size:"sm",variant:"outline",onClick:()=>i(!0),children:[h.jsx(Dc,{className:"w-4 h-4 mr-1"}),"Tag via GPS"]})]}),h.jsxs(Pn,{children:[h.jsxs("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[h.jsxs("div",{className:"text-center p-3 bg-emerald-50 rounded-lg",children:[h.jsx("p",{className:"text-2xl font-bold text-emerald-600",children:$.alive}),h.jsx("p",{className:"text-xs text-emerald-600",children:"Hidup"})]}),h.jsxs("div",{className:"text-center p-3 bg-amber-50 rounded-lg",children:[h.jsx("p",{className:"text-2xl font-bold text-amber-600",children:$.sick}),h.jsx("p",{className:"text-xs text-amber-600",children:"Sakit"})]}),h.jsxs("div",{className:"text-center p-3 bg-slate-100 rounded-lg",children:[h.jsx("p",{className:"text-2xl font-bold text-slate-500",children:$.dead}),h.jsx("p",{className:"text-xs text-slate-500",children:"Mati"})]})]}),D.length>0?h.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:D.map(Z=>h.jsxs("div",{className:"flex items-center justify-between p-2 bg-slate-50 rounded-lg",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${Z.productivity_status==="productive"||Z.display_status==="alive"?"bg-emerald-500":Z.display_status==="less_productive"?"bg-amber-500":"bg-rose-500"}`}),h.jsx("span",{className:"text-sm font-medium",children:Z.commodity_name})]}),h.jsx("span",{className:"text-xs text-slate-500",children:Z.plant_date})]},Z.id))}):h.jsx("p",{className:"text-center text-slate-500 text-sm py-4",children:"Belum ada tanaman"})]})]})]}),h.jsx(Rt.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:"lg:col-span-2",children:r?h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h3",{className:"font-semibold text-slate-900",children:"Tag Tanaman dengan GPS"}),h.jsx(pt,{variant:"outline",size:"sm",onClick:()=>i(!1),children:"Tutup"})]}),h.jsx(eK,{landId:c,farmerId:P.farmer_id,landPolygon:P.polygon_coordinates,existingPlants:E,onTagPlant:R.mutate,isLoading:R.isPending})]}):h.jsx(Tk,{center:[P.center_lat||-6.2,P.center_lng||106.8],zoom:16,lands:[P],plants:E,readOnly:!0})})]})]})})}var yx="Switch",[KPe]=gd(yx),[HPe,GPe]=KPe(yx),tK=M.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c="on",onCheckedChange:d,form:p,...m}=e,[y,b]=M.useState(null),P=Er(t,k=>b(k)),x=M.useRef(!1),w=y?p||!!y.closest("form"):!0,[T,E]=Zh({prop:i,defaultProp:a??!1,onChange:d,caller:yx});return h.jsxs(HPe,{scope:n,checked:T,disabled:s,children:[h.jsx(Dn.button,{type:"button",role:"switch","aria-checked":T,"aria-required":o,"data-state":aK(T),"data-disabled":s?"":void 0,disabled:s,value:c,...m,ref:P,onClick:Mn(e.onClick,k=>{E(D=>!D),w&&(x.current=k.isPropagationStopped(),x.current||k.stopPropagation())})}),w&&h.jsx(iK,{control:y,bubbles:!x.current,name:r,value:c,checked:T,required:o,disabled:s,form:p,style:{transform:"translateX(-100%)"}})]})});tK.displayName=yx;var nK="SwitchThumb",rK=M.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=GPe(nK,n);return h.jsx(Dn.span,{"data-state":aK(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});rK.displayName=nK;var ZPe="SwitchBubbleInput",iK=M.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{const o=M.useRef(null),s=Er(o,a),c=t8(n),d=VV(t);return M.useEffect(()=>{const p=o.current;if(!p)return;const m=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(m,"checked").set;if(c!==n&&b){const P=new Event("click",{bubbles:r});b.call(p,n),p.dispatchEvent(P)}},[c,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});iK.displayName=ZPe;function aK(e){return e?"checked":"unchecked"}var oK=tK,YPe=rK;const Rk=M.forwardRef(({className:e,...t},n)=>h.jsx(oK,{className:fn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:h.jsx(YPe,{className:fn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Rk.displayName=oK.displayName;const XPe={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},QPe=(e,t,n)=>{let r;const i=XPe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dalam waktu "+r:r+" yang lalu":r},JPe={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},eje={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},tje={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nje={date:th({formats:JPe,defaultWidth:"full"}),time:th({formats:eje,defaultWidth:"full"}),dateTime:th({formats:tje,defaultWidth:"full"})},rje={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},ije=(e,t,n,r)=>rje[e],aje={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},oje={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},sje={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},lje={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},uje={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},cje={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},fje=(e,t)=>"ke-"+Number(e),dje={ordinalNumber:fje,era:Cl({values:aje,defaultWidth:"wide"}),quarter:Cl({values:oje,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Cl({values:sje,defaultWidth:"wide"}),day:Cl({values:lje,defaultWidth:"wide"}),dayPeriod:Cl({values:uje,defaultWidth:"wide",formattingValues:cje,defaultFormattingWidth:"wide"})},hje=/^ke-(\d+)?/i,pje=/\d+/i,mje={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},gje={any:[/^s/i,/^(m|e)/i]},vje={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},yje={any:[/1/i,/2/i,/3/i,/4/i]},bje={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},xje={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},wje={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},_je={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},Sje={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},Pje={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},jje={ordinalNumber:XW({matchPattern:hje,parsePattern:pje,valueCallback:e=>parseInt(e,10)}),era:Nl({matchPatterns:mje,defaultMatchWidth:"wide",parsePatterns:gje,defaultParseWidth:"any"}),quarter:Nl({matchPatterns:vje,defaultMatchWidth:"wide",parsePatterns:yje,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nl({matchPatterns:bje,defaultMatchWidth:"wide",parsePatterns:xje,defaultParseWidth:"any"}),day:Nl({matchPatterns:wje,defaultMatchWidth:"wide",parsePatterns:_je,defaultParseWidth:"any"}),dayPeriod:Nl({matchPatterns:Sje,defaultMatchWidth:"any",parsePatterns:Pje,defaultParseWidth:"any"})},gg={code:"id",formatDistance:QPe,formatLong:nje,formatRelative:ije,localize:dje,match:jje,options:{weekStartsOn:1,firstWeekContainsDate:1}},Oje={kepala_desa:"Kepala Desa",kepala_dusun:"Kepala Dusun",rt:"Ketua RT",rw:"Ketua RW"};function Tje(){const e=As(),[t,n]=M.useState(!1),[r,i]=M.useState({user_email:"",full_name:"",role:"kepala_desa",village:"",district:"",regency:"",province:"",phone:"",is_active:!0}),{data:a=[]}=bn({queryKey:["provinces"],queryFn:()=>{try{const b=mt.entities.Province.list();return Array.isArray(b)?b:[]}catch{return[]}}}),{data:o=[],isLoading:s,error:c}=bn({queryKey:["validators"],queryFn:()=>{try{const b=mt.entities.Validator.list();return Array.isArray(b)?b:[]}catch{return[]}}}),d=(b,P)=>{i(x=>({...x,[b]:P}))};if(c)return h.jsx("div",{className:"p-6 text-red-600",children:"Gagal memuat validator (offline mock belum siap)"});const p=ci({mutationFn:b=>mt.entities.Validator.create(b),onSuccess:()=>{e.invalidateQueries({queryKey:["validators"]}),n(!1),i({user_email:"",full_name:"",role:"kepala_desa",village:"",district:"",regency:"",phone:"",is_active:!0}),Mt.success("Validator berhasil ditambahkan!")}}),m=ci({mutationFn:({id:b,is_active:P})=>mt.entities.Validator.update(b,{is_active:P}),onSuccess:()=>{e.invalidateQueries({queryKey:["validators"]}),Mt.success("Status validator diperbarui")}}),y=ci({mutationFn:b=>mt.entities.Validator.delete(b),onSuccess:()=>{e.invalidateQueries({queryKey:["validators"]}),Mt.success("Validator dihapus")}});return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Validator Lahan"}),h.jsx("p",{className:"text-slate-500",children:"Kelola validator untuk verifikasi lahan"})]}),h.jsxs(sl,{open:t,onOpenChange:n,children:[h.jsx(HW,{asChild:!0,children:h.jsxs(pt,{className:"bg-blue-600 hover:bg-blue-700",children:[h.jsx(Dc,{className:"w-4 h-4 mr-2"}),"Tambah Validator"]})}),h.jsxs(Ss,{children:[h.jsx(ql,{children:h.jsx(zl,{children:"Tambah Validator Baru"})}),h.jsxs("div",{className:"space-y-4 pt-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Email *"}),h.jsx(nn,{type:"email",value:r.user_email,onChange:b=>i(P=>({...P,user_email:b.target.value})),placeholder:"email@example.com"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Nama Lengkap *"}),h.jsx(nn,{value:r.full_name,onChange:b=>i(P=>({...P,full_name:b.target.value})),placeholder:"Nama lengkap"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Jabatan *"}),h.jsxs(Hr,{value:r.role,onValueChange:b=>i(P=>({...P,role:b})),children:[h.jsx(Dr,{children:h.jsx(Gr,{})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"kepala_desa",children:"Kepala Desa"}),h.jsx(Kt,{value:"kepala_dusun",children:"Kepala Dusun"}),h.jsx(Kt,{value:"rt",children:"Ketua RT"}),h.jsx(Kt,{value:"rw",children:"Ketua RW"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Telepon"}),h.jsx(nn,{value:r.phone,onChange:b=>i(P=>({...P,phone:b.target.value})),placeholder:"08xxx"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Desa *"}),h.jsx(nn,{value:r.village,onChange:b=>i(P=>({...P,village:b.target.value})),placeholder:"Nama desa"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Kecamatan"}),h.jsx(nn,{value:r.district,onChange:b=>i(P=>({...P,district:b.target.value})),placeholder:"Kecamatan"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Kabupaten"}),h.jsx(nn,{value:r.regency,onChange:b=>i(P=>({...P,regency:b.target.value})),placeholder:"Kabupaten"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Provinsi"}),h.jsxs(Hr,{value:r.province,onValueChange:b=>d("province",b),children:[h.jsx(Dr,{children:h.jsx(Gr,{placeholder:"Pilih provinsi"})}),h.jsx(Br,{children:a.map(b=>h.jsx(Kt,{value:b.id,children:b.nama},b.id))})]})]})]}),h.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[h.jsx(pt,{variant:"outline",onClick:()=>n(!1),children:"Batal"}),h.jsxs(pt,{onClick:()=>p.mutate(r),disabled:!r.user_email||!r.full_name||!r.village||p.isPending,className:"bg-blue-600 hover:bg-blue-700",children:[p.isPending&&h.jsx(ti,{className:"w-4 h-4 mr-2 animate-spin"}),"Simpan"]})]})]})]})]})]}),s?h.jsx("div",{className:"flex justify-center py-12",children:h.jsx(ti,{className:"w-8 h-8 animate-spin text-blue-600"})}):o.length>0?h.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:o.map(b=>{var P;return h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsxs(Pn,{className:"p-4",children:[h.jsxs("div",{className:"flex items-start justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center",children:h.jsx(gh,{className:"w-5 h-5 text-blue-600"})}),h.jsxs("div",{children:[h.jsx("p",{className:"font-semibold text-slate-900",children:b.full_name}),h.jsx(ur,{className:"bg-blue-100 text-blue-700 text-xs",children:Oje[b.role]})]})]}),h.jsx(Rk,{checked:b.is_active,onCheckedChange:x=>m.mutate({id:b.id,is_active:x})})]}),h.jsxs("div",{className:"space-y-2 text-sm text-slate-600",children:[h.jsxs("p",{className:"flex items-center gap-2",children:[h.jsx(So,{className:"w-4 h-4"}),b.village,", ",b.district,", ",b.regency,",",(P=a.find(x=>x.id===b.province))==null?void 0:P.nama]}),b.phone&&h.jsxs("p",{className:"flex items-center gap-2",children:[h.jsx(Yh,{className:"w-4 h-4"})," ",b.phone]}),h.jsx("p",{className:"text-xs text-slate-400",children:b.user_email})]}),h.jsxs(pt,{variant:"ghost",size:"sm",className:"w-full mt-3 text-red-600 hover:bg-red-50",onClick:()=>y.mutate(b.id),children:[h.jsx(nb,{className:"w-4 h-4 mr-2"}),"Hapus"]})]})},b.id)})}):h.jsx(Qa,{icon:gh,title:"Belum ada validator",description:"Tambahkan validator untuk memverifikasi lahan di wilayah tertentu",action:()=>n(!0),actionLabel:"Tambah Validator"})]})}const Ic=M.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{className:fn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Ic.displayName="Textarea";const Eje={kepala_desa:"Kepala Desa",kepala_dusun:"Kepala Dusun",rt:"Ketua RT",rw:"Ketua RW"},yj={pending:{bg:"bg-amber-100",text:"text-amber-700",label:"Menunggu Validasi"},valid:{bg:"bg-emerald-100",text:"text-emerald-700",label:"Valid"},invalid:{bg:"bg-red-100",text:"text-red-700",label:"Tidak Valid"},need_review:{bg:"bg-blue-100",text:"text-blue-700",label:"Perlu Review"}};function Aje(){var k;const e=As(),[t,n]=M.useState(null),[r,i]=M.useState(null),[a,o]=M.useState(!0),[s,c]=M.useState(null),[d,p]=M.useState("");M.useEffect(()=>{(async()=>{try{const I=await mt.auth.me();n(I);const R=await mt.entities.Validator.filter({user_email:I.email});R.length>0&&R[0].is_active&&i(R[0])}catch{}finally{o(!1)}})()},[]);const{data:m=[]}=bn({queryKey:["validator-lands",r==null?void 0:r.village],queryFn:()=>mt.entities.Land.filter({village:r.village}),enabled:!!(r!=null&&r.village)}),{data:y=[]}=bn({queryKey:["farmers"],queryFn:()=>mt.entities.Farmer.list(),enabled:!!r}),{data:b=[]}=bn({queryKey:["validations",r==null?void 0:r.id],queryFn:()=>mt.entities.LandValidation.filter({validator_email:r.user_email}),enabled:!!r}),P=ci({mutationFn:async({landId:D,status:I})=>{const R=I==="approved"?"valid":"invalid";await mt.entities.Land.update(D,{validation_status:R,validation_notes:d}),await mt.entities.LandValidation.create({land_id:D,validator_role:r.role,validator_name:r.full_name,validator_email:r.user_email,status:I,notes:d,validated_at:new Date().toISOString()})},onSuccess:()=>{e.invalidateQueries({queryKey:["validator-lands"]}),e.invalidateQueries({queryKey:["validations"]}),c(null),p(""),Mt.success("Validasi berhasil disimpan!")}}),x=()=>{mt.auth.redirectToLogin(window.location.href)},w=()=>{mt.auth.logout()},T=D=>{const I=y.find(R=>R.id===D);return(I==null?void 0:I.full_name)||"Tidak diketahui"},E=m.filter(D=>D.validation_status==="pending"||D.validation_status==="need_review");return m.filter(D=>D.validation_status==="valid"||D.validation_status==="invalid"),a?h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-slate-100 flex items-center justify-center",children:h.jsx(ti,{className:"w-8 h-8 animate-spin text-blue-600"})}):t?r?h.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-slate-100",children:[h.jsxs("div",{className:"max-w-4xl mx-auto p-4 md:p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("div",{className:"w-14 h-14 rounded-full bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center shadow-lg",children:h.jsx(gh,{className:"w-7 h-7 text-white"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-bold text-slate-900",children:r.full_name}),h.jsxs(ur,{className:"bg-blue-100 text-blue-700 border-blue-200",children:[Eje[r.role]," - ",r.village]})]})]}),h.jsx(pt,{variant:"outline",size:"sm",onClick:w,children:h.jsx(mh,{className:"w-4 h-4"})})]}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"grid grid-cols-3 gap-3",children:[h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(Hf,{className:"w-6 h-6 mx-auto text-amber-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:E.length}),h.jsx("p",{className:"text-xs text-slate-500",children:"Perlu Validasi"})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(la,{className:"w-6 h-6 mx-auto text-emerald-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:b.filter(D=>D.status==="approved").length}),h.jsx("p",{className:"text-xs text-slate-500",children:"Disetujui"})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(ph,{className:"w-6 h-6 mx-auto text-red-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:b.filter(D=>D.status==="rejected").length}),h.jsx("p",{className:"text-xs text-slate-500",children:"Ditolak"})]})]}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:h.jsxs(Ak,{defaultValue:"pending",className:"space-y-4",children:[h.jsxs(mx,{className:"w-full bg-white shadow-sm p-1 h-auto",children:[h.jsxs(al,{value:"pending",className:"flex-1 py-3 data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700",children:[h.jsx(Hf,{className:"w-4 h-4 mr-2"}),"Perlu Validasi (",E.length,")"]}),h.jsxs(al,{value:"history",className:"flex-1 py-3 data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700",children:[h.jsx(AN,{className:"w-4 h-4 mr-2"}),"Riwayat"]})]}),h.jsx(ol,{value:"pending",className:"space-y-4",children:E.length>0?h.jsx("div",{className:"grid gap-4",children:E.map(D=>{var I,R,$,V;return h.jsx(Tt,{className:"border-0 shadow-sm overflow-hidden",children:h.jsxs(Pn,{className:"p-4",children:[h.jsxs("div",{className:"flex items-start justify-between mb-3",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-slate-900",children:D.name}),h.jsxs("p",{className:"text-sm text-slate-500",children:["Pemilik: ",T(D.farmer_id)]})]}),h.jsx(ur,{className:`${(I=yj[D.validation_status])==null?void 0:I.bg} ${(R=yj[D.validation_status])==null?void 0:R.text}`,children:($=yj[D.validation_status])==null?void 0:$.label})]}),h.jsxs("div",{className:"flex items-center gap-4 text-sm text-slate-600 mb-4",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(So,{className:"w-4 h-4"}),D.village,", ",D.district]}),h.jsxs("span",{children:[(V=D.area_hectares)==null?void 0:V.toFixed(2)," Ha"]})]}),h.jsx(pt,{className:"w-full bg-blue-600 hover:bg-blue-700",onClick:()=>c(D),children:"Validasi Lahan"})]})},D.id)})}):h.jsx(Qa,{icon:la,title:"Semua lahan sudah divalidasi",description:"Tidak ada lahan yang perlu divalidasi saat ini"})}),h.jsx(ol,{value:"history",className:"space-y-4",children:b.length>0?h.jsx("div",{className:"grid gap-3",children:b.map(D=>{const I=m.find(R=>R.id===D.land_id);return h.jsxs(Tt,{className:"border-0 shadow-sm p-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-medium text-slate-900",children:(I==null?void 0:I.name)||"Lahan"}),h.jsx("p",{className:"text-sm text-slate-500",children:D.validated_at?Uc(new Date(D.validated_at),"dd MMM yyyy, HH:mm",{locale:gg}):"-"})]}),h.jsx(ur,{className:D.status==="approved"?"bg-emerald-100 text-emerald-700":"bg-red-100 text-red-700",children:D.status==="approved"?"Disetujui":"Ditolak"})]}),D.notes&&h.jsx("p",{className:"text-sm text-slate-600 mt-2 bg-slate-50 p-2 rounded",children:D.notes})]},D.id)})}):h.jsx(Qa,{icon:AN,title:"Belum ada riwayat",description:"Riwayat validasi akan muncul di sini"})})]})})]}),h.jsx(sl,{open:!!s,onOpenChange:()=>c(null),children:h.jsxs(Ss,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[h.jsx(ql,{children:h.jsxs(zl,{children:["Validasi Lahan: ",s==null?void 0:s.name]})}),s&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[h.jsxs("div",{className:"p-3 bg-slate-50 rounded-lg",children:[h.jsx("p",{className:"text-slate-500",children:"Pemilik"}),h.jsx("p",{className:"font-medium",children:T(s.farmer_id)})]}),h.jsxs("div",{className:"p-3 bg-slate-50 rounded-lg",children:[h.jsx("p",{className:"text-slate-500",children:"Luas"}),h.jsxs("p",{className:"font-medium",children:[(k=s.area_hectares)==null?void 0:k.toFixed(4)," Ha"]})]}),h.jsxs("div",{className:"p-3 bg-slate-50 rounded-lg col-span-2",children:[h.jsx("p",{className:"text-slate-500",children:"Lokasi"}),h.jsxs("p",{className:"font-medium",children:[s.village,", ",s.district,", ",s.regency]})]})]}),h.jsx("div",{className:"h-[300px] rounded-lg overflow-hidden",children:h.jsx(Tk,{center:[s.center_lat||-6.2,s.center_lng||106.8],zoom:17,lands:[s],readOnly:!0})}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("label",{className:"text-sm font-medium text-slate-700",children:"Catatan Validasi"}),h.jsx(Ic,{value:d,onChange:D=>p(D.target.value),placeholder:"Tambahkan catatan validasi (opsional)",rows:3})]}),h.jsxs("div",{className:"flex gap-3 pt-2",children:[h.jsxs(pt,{variant:"outline",className:"flex-1 h-12 border-red-200 text-red-600 hover:bg-red-50",onClick:()=>P.mutate({landId:s.id,status:"rejected"}),disabled:P.isPending,children:[h.jsx(ph,{className:"w-5 h-5 mr-2"}),"Tolak"]}),h.jsxs(pt,{className:"flex-1 h-12 bg-emerald-600 hover:bg-emerald-700",onClick:()=>P.mutate({landId:s.id,status:"approved"}),disabled:P.isPending,children:[P.isPending?h.jsx(ti,{className:"w-5 h-5 mr-2 animate-spin"}):h.jsx(la,{className:"w-5 h-5 mr-2"}),"Setujui"]})]})]})]})})]}):h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-slate-100 flex items-center justify-center p-6",children:h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:h.jsx(Tt,{className:"border-0 shadow-xl max-w-md w-full",children:h.jsxs(Pn,{className:"p-8 text-center",children:[h.jsx("div",{className:"w-20 h-20 rounded-full bg-amber-100 flex items-center justify-center mx-auto mb-6",children:h.jsx(ul,{className:"w-10 h-10 text-amber-600"})}),h.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Akses Ditolak"}),h.jsxs("p",{className:"text-slate-500 mb-4",children:["Email ",h.jsx("span",{className:"font-medium",children:t.email})," tidak terdaftar sebagai validator."]}),h.jsx("p",{className:"text-sm text-slate-400 mb-8",children:"Hubungi admin untuk mendaftarkan Anda sebagai validator wilayah."}),h.jsxs(pt,{variant:"outline",onClick:w,className:"w-full h-12",children:[h.jsx(mh,{className:"w-5 h-5 mr-2"}),"Keluar"]})]})})})}):h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-slate-100 flex items-center justify-center p-6",children:h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:h.jsx(Tt,{className:"border-0 shadow-xl max-w-md w-full",children:h.jsxs(Pn,{className:"p-8 text-center",children:[h.jsx("div",{className:"w-20 h-20 rounded-full bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center mx-auto mb-6",children:h.jsx(gh,{className:"w-10 h-10 text-white"})}),h.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Portal Validator"}),h.jsx("p",{className:"text-slate-500 mb-8",children:"Masuk untuk memvalidasi lahan di wilayah Anda"}),h.jsx(pt,{onClick:x,className:"w-full h-12 bg-blue-600 hover:bg-blue-700 text-lg",children:"Masuk"})]})})})})}const kje={alive:"bg-emerald-100 text-emerald-700 border-emerald-200",sick:"bg-amber-100 text-amber-700 border-amber-200",dead:"bg-slate-100 text-slate-600 border-slate-200",harvested:"bg-blue-100 text-blue-700 border-blue-200"},Cje={alive:"Hidup",sick:"Sakit",dead:"Mati",harvested:"Dipanen"};function Nje(){const[e,t]=M.useState(""),[n,r]=M.useState("all"),[i,a]=M.useState("all"),{data:o=[],isLoading:s}=bn({queryKey:["plants"],queryFn:()=>mt.entities.Plant.list("-created_date")}),{data:c=[]}=bn({queryKey:["lands"],queryFn:()=>mt.entities.Land.list()}),{data:d=[]}=bn({queryKey:["farmers"],queryFn:()=>mt.entities.Farmer.list()}),p=Array.isArray(c)?c:[],m=Array.isArray(d)?d:[],y=Array.isArray(o)?o:[],b=M.useMemo(()=>{const E={};return p.forEach(k=>{k!=null&&k.id&&(E[k.id]=k)}),E},[p]),P=M.useMemo(()=>{const E={};return m.forEach(k=>{k!=null&&k.id&&(E[k.id]=k.full_name)}),E},[m]),x=M.useMemo(()=>[...new Set(y.map(E=>E.commodity_name).filter(Boolean))],[y]),w=M.useMemo(()=>{const E=e.toLowerCase();return y.filter(k=>{var $,V,K,Z;if(!k)return!1;const D=!e||(($=k.commodity_name)==null?void 0:$.toLowerCase().includes(E))||((K=(V=b[k.land_id])==null?void 0:V.name)==null?void 0:K.toLowerCase().includes(E))||((Z=P[k.farmer_id])==null?void 0:Z.toLowerCase().includes(E)),I=n==="all"||k.status===n,R=i==="all"||k.commodity_name===i;return D&&I&&R})},[y,e,n,i,b,P]),T=M.useMemo(()=>{const E={};return w.forEach(k=>{const D=k.commodity_name||"Lainnya";E[D]||(E[D]=[]),E[D].push(k)}),E},[w]);return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-7xl mx-auto p-6 space-y-6",children:[h.jsx(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:h.jsxs("div",{children:[h.jsx("h1",{className:"text-3xl font-bold text-slate-900",children:"Daftar Tanaman"}),h.jsxs("p",{className:"text-slate-500",children:[y.length," tanaman terdaftar"]})]})}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[h.jsx(Tt,{className:"border-0 shadow-sm p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-100 flex items-center justify-center",children:h.jsx("div",{className:"w-3 h-3 rounded-full bg-emerald-500"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:y.filter(E=>E.status==="alive").length}),h.jsx("p",{className:"text-sm text-slate-500",children:"Hidup"})]})]})}),h.jsx(Tt,{className:"border-0 shadow-sm p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-100 flex items-center justify-center",children:h.jsx("div",{className:"w-3 h-3 rounded-full bg-amber-500"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:y.filter(E=>E.status==="sick"||E.productivity_status==="less_productive").length}),h.jsx("p",{className:"text-sm text-slate-500",children:"Sakit"})]})]})}),h.jsx(Tt,{className:"border-0 shadow-sm p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-100 flex items-center justify-center",children:h.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:y.filter(E=>E.status==="harvested").length}),h.jsx("p",{className:"text-sm text-slate-500",children:"Dipanen"})]})]})}),h.jsx(Tt,{className:"border-0 shadow-sm p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-xl bg-slate-100 flex items-center justify-center",children:h.jsx("div",{className:"w-3 h-3 rounded-full bg-slate-400"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:y.filter(E=>E.status==="dead").length}),h.jsx("p",{className:"text-sm text-slate-500",children:"Mati"})]})]})})]}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.15},className:"flex flex-col md:flex-row gap-3",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(tE,{className:"w-5 h-5 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),h.jsx(nn,{placeholder:"Cari komoditas, lahan, atau petani...",value:e,onChange:E=>t(E.target.value),className:"h-11 pl-11 bg-white border-0 shadow-sm"})]}),h.jsxs(Hr,{value:n,onValueChange:r,children:[h.jsxs(Dr,{className:"w-full md:w-40 h-11 bg-white border-0 shadow-sm",children:[h.jsx(eE,{className:"w-4 h-4 mr-2 text-slate-400"}),h.jsx(Gr,{placeholder:"Status"})]}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"all",children:"Semua Status"}),h.jsx(Kt,{value:"alive",children:"Hidup"}),h.jsx(Kt,{value:"sick",children:"Sakit"}),h.jsx(Kt,{value:"harvested",children:"Dipanen"}),h.jsx(Kt,{value:"dead",children:"Mati"})]})]}),h.jsxs(Hr,{value:i,onValueChange:a,children:[h.jsx(Dr,{className:"w-full md:w-48 h-11 bg-white border-0 shadow-sm",children:h.jsx(Gr,{placeholder:"Komoditas"})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"all",children:"Semua Komoditas"}),x.map(E=>h.jsx(Kt,{value:E,children:E},E))]})]})]}),s?h.jsx("div",{className:"space-y-4",children:[1,2,3].map(E=>h.jsx("div",{className:"h-24 bg-white rounded-xl animate-pulse"},E))}):w.length>0?h.jsx(Rt.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:"space-y-6",children:Object.entries(T).map(([E,k])=>h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-emerald-100 flex items-center justify-center",children:h.jsx(sa,{className:"w-4 h-4 text-emerald-600"})}),h.jsx("h3",{className:"font-semibold text-slate-900",children:E}),h.jsx(ur,{variant:"secondary",className:"bg-slate-100 text-slate-600",children:k.length})]}),h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:k.map((D,I)=>{const R=b[D.land_id];return h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:I*.03},children:h.jsxs(Tt,{className:"border-0 shadow-sm hover:shadow-md transition-all p-4 bg-white group",children:[h.jsx("div",{className:"flex items-start justify-between mb-3",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`w-2 h-2 rounded-full ${D.status==="alive"?"bg-emerald-500":D.status==="sick"?"bg-amber-500":D.status==="harvested"?"bg-blue-500":"bg-slate-400"}`}),h.jsx(ur,{className:`${kje[D.status]} border text-xs font-medium`,children:Cje[D.status]})]})}),h.jsxs("div",{className:"space-y-2 text-sm",children:[h.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[h.jsx(So,{className:"w-4 h-4 text-slate-400"}),h.jsx("span",{className:"truncate",children:(R==null?void 0:R.name)||"Lahan tidak diketahui"})]}),h.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[h.jsx(Z$,{className:"w-4 h-4 text-slate-400"}),h.jsx("span",{children:D.plant_date?Uc(new Date(D.plant_date),"dd MMM yyyy"):"-"})]})]}),R&&h.jsx(zo,{to:ei("LandDetail")+`?id=${R.id}`,children:h.jsxs(pt,{variant:"ghost",size:"sm",className:"w-full mt-3 opacity-0 group-hover:opacity-100 transition-opacity text-emerald-600",children:["Lihat Lahan",h.jsx(tb,{className:"w-4 h-4 ml-1"})]})})]})},D.id)})})]},E))}):h.jsx(Qa,{icon:sa,title:"Tidak ada tanaman ditemukan",description:e||n!=="all"||i!=="all"?"Coba ubah filter pencarian Anda":"Tanaman dapat ditambahkan melalui halaman detail lahan"})]})})}function bj(e){const[t,n]=M.useState(!1),r=M.useCallback(async()=>{n(!0);try{return pg()?await mt.entities[e].list():await Tr.getEntities(e)}catch{return await Tr.getEntities(e)}finally{n(!1)}},[e]),i=M.useCallback(async a=>{if(pg())try{return await mt.entities[e].create(a)}catch{console.warn("Switching to offline mode...")}if(e==="Farmer"){const o=await Tr.saveFarmerLocally(a);return Mt.info("Tersimpan di database lokal (Offline)"),{...a,id:o,sync_status:"pending"}}return await Tr.addToQueue(e,"CREATE",a),Mt.info("Data masuk antrean sinkronisasi"),{...a,sync_status:"pending"}},[e]);return{list:r,create:i,loading:t}}function Mje(){const[e,t]=M.useState(pg()),[n,r]=M.useState(!1),[i,a]=M.useState(0);M.useEffect(()=>{const s=()=>{t(!0),Mt.success("Koneksi internet tersambung"),o()},c=()=>{t(!1),Mt.warning("Mode offline - data disimpan di SQLite")};return window.addEventListener("online",s),window.addEventListener("offline",c),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",c)}},[]),M.useEffect(()=>{const s=async()=>{const d=await Tr.getPendingCount();a(d)};s();const c=setInterval(s,3e3);return()=>clearInterval(c)},[]);const o=M.useCallback(async()=>{if(!(!pg()||n)){r(!0);try{await Tr.syncAll(mt);const s=await Tr.getPendingCount();a(s)}catch(s){console.error("Sync failed:",s)}finally{r(!1)}}},[n]);return{online:e,syncing:n,pendingCount:i,syncPendingData:o,forceSync:o}}async function Rje(){try{const e=new AbortController;return setTimeout(()=>e.abort(),3e3),await fetch("https://www.google.com/favicon.ico",{method:"HEAD",mode:"no-cors",cache:"no-store",signal:e.signal}),!0}catch{return!1}}function Lje({compact:e=!1}){const{syncing:t,pendingCount:n,lastSync:r,forceSync:i}=Mje(),[a,o]=M.useState(!1);return M.useEffect(()=>{const s=new AbortController;return(async()=>{try{const d=await Rje(s.signal);o(d)}catch{}})(),()=>s.abort()},[]),e?h.jsxs("div",{className:"flex items-center gap-2",children:[a?h.jsxs(ur,{variant:"outline",className:"bg-emerald-50 text-emerald-700 border-emerald-200",children:[h.jsx(Pj,{className:"w-3 h-3 mr-1"}),"Online"]}):h.jsxs(ur,{variant:"outline",className:"bg-amber-50 text-amber-700 border-amber-200",children:[h.jsx(Sj,{className:"w-3 h-3 mr-1"}),"Offline"]}),n>0&&h.jsxs(ur,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200",children:[h.jsx(Q$,{className:"w-3 h-3 mr-1"}),n," pending"]})]}):h.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-xl border border-slate-200 shadow-sm",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center ${a?"bg-emerald-100":"bg-amber-100"}`,children:a?h.jsx(Pj,{className:"w-5 h-5 text-emerald-600"}):h.jsx(Sj,{className:"w-5 h-5 text-amber-600"})}),h.jsxs("div",{children:[h.jsx("p",{className:"font-medium text-slate-900",children:a?"Terhubung ke Internet":"Mode Offline"}),h.jsx("p",{className:"text-xs text-slate-500",children:r?`Sync terakhir: ${Uc(new Date(r),"dd MMM, HH:mm",{locale:gg})}`:"Belum pernah sync"})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[n>0&&h.jsxs(ur,{className:"bg-amber-100 text-amber-700 border-amber-200",children:[n," data menunggu sync"]}),t?h.jsxs(pt,{disabled:!0,size:"sm",variant:"outline",children:[h.jsx(ti,{className:"w-4 h-4 mr-2 animate-spin"}),"Syncing..."]}):a&&n>0?h.jsxs(pt,{size:"sm",onClick:i,className:"bg-emerald-600 hover:bg-emerald-700",children:[h.jsx(tF,{className:"w-4 h-4 mr-2"}),"Sync Sekarang"]}):a?h.jsxs(ur,{className:"bg-emerald-100 text-emerald-700",children:[h.jsx(Y$,{className:"w-3 h-3 mr-1"}),"Tersinkronisasi"]}):null]})]})}const Ije=[{value:"healthy",label:"Sehat",icon:la,color:"text-emerald-600"},{value:"mild_issue",label:"Masalah Ringan",icon:ul,color:"text-amber-500"},{value:"moderate_issue",label:"Masalah Sedang",icon:ul,color:"text-orange-500"},{value:"severe_issue",label:"Masalah Berat",icon:ul,color:"text-red-500"}],Dje=[{value:"productive",label:"Produktif"},{value:"less_productive",label:"Kurang Produktif"},{value:"not_productive",label:"Tidak Produktif"}],Bje=[{value:"none",label:"Tidak Ada Masalah",icon:la},{value:"pest",label:"Hama",icon:eb},{value:"disease",label:"Penyakit",icon:ky},{value:"weather",label:"Cuaca Buruk",icon:JT},{value:"nutrient_deficiency",label:"Kekurangan Nutrisi",icon:ky},{value:"water_shortage",label:"Kekurangan Air",icon:J$},{value:"other",label:"Lainnya",icon:ul}];function $je({plant:e,onClose:t,onSuccess:n}){const r=As(),[i,a]=M.useState({health_status:"healthy",productivity_status:"productive",issue_type:"none",issue_description:"",recommendation:"",notes:""}),o=ci({mutationFn:async()=>{await mt.entities.PlantInspection.create({plant_id:e.id,land_id:e.land_id,farmer_id:e.farmer_id,inspection_date:new Date().toISOString().split("T")[0],...i});const s=i.health_status==="severe_issue"?"sick":(i.health_status==="healthy","alive");await mt.entities.Plant.update(e.id,{status:s,productivity_status:i.productivity_status,issue_type:i.issue_type,issue_description:i.issue_description,last_inspection_date:new Date().toISOString().split("T")[0]})},onSuccess:()=>{r.invalidateQueries({queryKey:["plants"]}),r.invalidateQueries({queryKey:["farmer-plants"]}),Mt.success("Inspeksi berhasil disimpan!"),n==null||n(),t==null||t()}});return h.jsxs(Tt,{className:"border-0 shadow-lg",children:[h.jsxs(Ti,{className:"pb-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(Ei,{className:"text-lg",children:"Inspeksi Tanaman"}),h.jsx(pt,{variant:"ghost",size:"icon",onClick:t,children:h.jsx(rb,{className:"w-5 h-5"})})]}),h.jsx("p",{className:"text-sm text-slate-500",children:e.commodity_name})]}),h.jsxs(Pn,{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Status Kesehatan *"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:Ije.map(s=>{const c=s.icon;return h.jsxs(pt,{type:"button",variant:i.health_status===s.value?"default":"outline",className:`justify-start h-auto py-3 ${i.health_status===s.value?"bg-slate-800":""}`,onClick:()=>a(d=>({...d,health_status:s.value})),children:[h.jsx(c,{className:`w-4 h-4 mr-2 ${i.health_status===s.value?"text-white":s.color}`}),s.label]},s.value)})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Status Produktivitas *"}),h.jsxs(Hr,{value:i.productivity_status,onValueChange:s=>a(c=>({...c,productivity_status:s})),children:[h.jsx(Dr,{children:h.jsx(Gr,{})}),h.jsx(Br,{children:Dje.map(s=>h.jsx(Kt,{value:s.value,children:s.label},s.value))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Jenis Masalah"}),h.jsxs(Hr,{value:i.issue_type,onValueChange:s=>a(c=>({...c,issue_type:s})),children:[h.jsx(Dr,{children:h.jsx(Gr,{})}),h.jsx(Br,{children:Bje.map(s=>{const c=s.icon;return h.jsx(Kt,{value:s.value,children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(c,{className:"w-4 h-4"}),s.label]})},s.value)})})]})]}),i.issue_type!=="none"&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Deskripsi Masalah"}),h.jsx(Ic,{value:i.issue_description,onChange:s=>a(c=>({...c,issue_description:s.target.value})),placeholder:"Jelaskan kondisi masalah yang ditemukan...",rows:3})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Rekomendasi Tindakan"}),h.jsx(Ic,{value:i.recommendation,onChange:s=>a(c=>({...c,recommendation:s.target.value})),placeholder:"Saran penanganan atau perawatan...",rows:2})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Catatan Tambahan"}),h.jsx(Ic,{value:i.notes,onChange:s=>a(c=>({...c,notes:s.target.value})),placeholder:"Catatan lainnya...",rows:2})]}),h.jsxs("div",{className:"flex gap-3 pt-2",children:[h.jsx(pt,{variant:"outline",className:"flex-1",onClick:t,children:"Batal"}),h.jsxs(pt,{className:"flex-1 bg-emerald-600 hover:bg-emerald-700",onClick:()=>o.mutate(),disabled:o.isPending,children:[o.isPending?h.jsx(ti,{className:"w-4 h-4 mr-2 animate-spin"}):h.jsx(la,{className:"w-4 h-4 mr-2"}),"Simpan Inspeksi"]})]})]})]})}const E$={A:{label:"Grade A - Premium",color:"text-emerald-600"},B:{label:"Grade B - Baik",color:"text-green-600"},C:{label:"Grade C - Standar",color:"text-amber-600"},D:{label:"Grade D - Rendah",color:"text-orange-600"}};function Fje({farmer:e,onSuccess:t,onClose:n,harvests:r=[]}){var m,y;const[i,a]=M.useState(!1),[o,s]=M.useState({offtaker_id:"",harvest_id:"",commodity_name:"",quantity_kg:"",farmer_grade:"",distribution_date:new Date().toISOString().split("T")[0],notes:""}),{data:c=[]}=bn({queryKey:["offtakers-active"],queryFn:()=>mt.entities.Offtaker.filter({is_active:!0})}),d=b=>{const P=r.find(x=>x.id===b);s(P?x=>({...x,harvest_id:b,commodity_name:P.commodity_name,quantity_kg:P.weight_kg.toString()}):x=>({...x,harvest_id:""}))},p=async()=>{if(!o.offtaker_id||!o.commodity_name||!o.quantity_kg||!o.farmer_grade){Mt.error("Lengkapi semua field yang wajib");return}a(!0);try{const b=c.find(P=>P.id===o.offtaker_id);await mt.entities.Distribution.create({farmer_id:e.id,farmer_name:e.full_name,offtaker_id:o.offtaker_id,offtaker_name:(b==null?void 0:b.company_name)||"",harvest_id:o.harvest_id,commodity_name:o.commodity_name,quantity_kg:parseFloat(o.quantity_kg),farmer_grade:o.farmer_grade,distribution_date:o.distribution_date,notes:o.notes,status:"pending"}),Mt.success("Distribusi berhasil dikirim!"),t==null||t(),n==null||n()}catch{Mt.error("Gagal mengirim distribusi")}finally{a(!1)}};return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[h.jsx("div",{className:"w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center",children:h.jsx(Tc,{className:"w-5 h-5 text-indigo-600"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-slate-900",children:"Kirim ke Offtaker"}),h.jsxs("p",{className:"text-sm text-slate-500",children:["Petani: ",e==null?void 0:e.full_name]})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2 p-3 bg-slate-50 rounded-lg border border-slate-100",children:[h.jsxs(St,{className:"text-indigo-700 flex items-center gap-2",children:[h.jsx(RH,{className:"w-4 h-4"})," Pilih dari Data Panen (Opsional)"]}),h.jsxs(Hr,{value:o.harvest_id,onValueChange:d,children:[h.jsx(Dr,{className:"w-full bg-white border-indigo-200 focus:ring-indigo-500",children:h.jsx(Gr,{placeholder:r&&r.length>0?"Pilih hasil panen...":"Tidak ada data panen tersedia"})}),h.jsx(Br,{children:Array.isArray(r)&&r.length>0?h.jsxs(h.Fragment,{children:[h.jsx(Kt,{value:"manual",className:"text-slate-400 italic",children:"-- Tanpa Referensi Panen --"}),r.map(b=>h.jsx(Kt,{value:b.id.toString(),children:h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-medium",children:b.commodity_name}),h.jsxs("span",{className:"text-xs text-slate-500",children:[b.weight_kg," Kg • ",b.notes]})]})},b.id))]}):h.jsxs("div",{className:"p-4 text-center text-sm text-slate-500",children:["Belum ada data panen terdaftar. ",h.jsx("br",{}),h.jsx("span",{className:"text-xs",children:"Catat panen terlebih dahulu di tab Panen."})]})})]}),h.jsx("p",{className:"text-[10px] text-slate-400",children:"Memilih data panen akan mengisi nama komoditas dan berat secara otomatis."})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Pilih Offtaker *"}),h.jsxs(Hr,{value:o.offtaker_id,onValueChange:b=>s(P=>({...P,offtaker_id:b})),children:[h.jsx(Dr,{children:h.jsx(Gr,{placeholder:"Pilih offtaker tujuan"})}),h.jsx(Br,{children:c.map(b=>h.jsxs(Kt,{value:b.id,children:[b.company_name," - ",b.contact_name]},b.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Komoditas *"}),h.jsx(nn,{value:o.commodity_name,onChange:b=>s(P=>({...P,commodity_name:b.target.value})),placeholder:"Contoh: Kopi Robusta"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Jumlah (Kg) *"}),h.jsx(nn,{type:"number",value:o.quantity_kg,onChange:b=>s(P=>({...P,quantity_kg:b.target.value})),placeholder:"0"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Tanggal Kirim *"}),h.jsx(nn,{type:"date",value:o.distribution_date,onChange:b=>s(P=>({...P,distribution_date:b.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Grade Barang (Klaim Petani) *"}),h.jsx("div",{className:"grid grid-cols-4 gap-2",children:["A","B","C","D"].map(b=>h.jsx(pt,{type:"button",variant:o.farmer_grade===b?"default":"outline",className:`h-12 ${o.farmer_grade===b?"bg-indigo-600":""}`,onClick:()=>s(P=>({...P,farmer_grade:b})),children:b},b))}),o.farmer_grade&&h.jsx("p",{className:`text-sm font-medium ${(m=E$[o.farmer_grade])==null?void 0:m.color}`,children:(y=E$[o.farmer_grade])==null?void 0:y.label})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Catatan"}),h.jsx(Ic,{value:o.notes,onChange:b=>s(P=>({...P,notes:b.target.value})),placeholder:"Catatan tambahan (kondisi kemasan, supir, dll)...",rows:2})]}),h.jsxs(pt,{className:"w-full h-12 bg-indigo-600 hover:bg-indigo-700 text-white font-semibold",onClick:p,disabled:i,children:[i?h.jsx(ti,{className:"w-5 h-5 mr-2 animate-spin"}):h.jsx(iF,{className:"w-5 h-5 mr-2"}),"Konfirmasi Pengiriman"]})]})]})}function qje({lands:e,plants:t,onSubmit:n,onCancel:r,isLoading:i}){const[a,o]=M.useState({land_id:"",plant_id:"general",commodity_name:"",weight_kg:"",harvest_date:new Date().toISOString().split("T")[0],notes:""}),s=M.useMemo(()=>a.land_id?t.filter(d=>d.land_id===a.land_id):[],[t,a.land_id]),c=d=>{d.preventDefault(),!(!a.land_id||!a.weight_kg||!a.commodity_name)&&n({...a,weight_kg:parseFloat(a.weight_kg)})};return h.jsxs("form",{onSubmit:c,className:"space-y-5",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(St,{className:"flex items-center gap-2",children:[h.jsx(So,{className:"w-4 h-4 text-emerald-600"})," Pilih Lahan"]}),h.jsxs(Hr,{value:a.land_id,onValueChange:d=>o(p=>({...p,land_id:d})),children:[h.jsx(Dr,{children:h.jsx(Gr,{placeholder:"Pilih lahan panen..."})}),h.jsx(Br,{children:e.map(d=>h.jsx(Kt,{value:d.id,children:d.name},d.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(St,{className:"flex items-center gap-2",children:[h.jsx(sa,{className:"w-4 h-4 text-emerald-600"})," Spesifik Tanaman (Opsional)"]}),h.jsxs(Hr,{disabled:!a.land_id,value:a.plant_id,onValueChange:d=>{const p=s.find(m=>m.id===d);o(m=>({...m,plant_id:d,commodity_name:p?p.commodity_name:m.commodity_name}))},children:[h.jsx(Dr,{children:h.jsx(Gr,{placeholder:a.land_id?"Pilih tanaman atau biarkan umum":"Pilih lahan dahulu"})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"general",children:"Hasil Lahan Umum"}),s.map(d=>h.jsxs(Kt,{value:d.id,children:[d.commodity_name," (ID: ",d.id.slice(-4),")"]},d.id))]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Nama Komoditas"}),h.jsx(nn,{placeholder:"Contoh: Kopi Arabika, Jagung, dll",value:a.commodity_name,onChange:d=>o(p=>({...p,commodity_name:d.target.value})),required:!0})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsxs(St,{className:"flex items-center gap-2",children:[h.jsx(rF,{className:"w-4 h-4 text-emerald-600"})," Berat (Kg)"]}),h.jsx(nn,{type:"number",step:"0.1",placeholder:"0.0",value:a.weight_kg,onChange:d=>o(p=>({...p,weight_kg:d.target.value})),required:!0})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(St,{className:"flex items-center gap-2",children:[h.jsx(Z$,{className:"w-4 h-4 text-emerald-600"})," Tanggal"]}),h.jsx(nn,{type:"date",value:a.harvest_date,onChange:d=>o(p=>({...p,harvest_date:d.target.value})),required:!0})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Catatan (Opsional)"}),h.jsx(nn,{placeholder:"Kualitas bagus, cuaca cerah, dll",value:a.notes,onChange:d=>o(p=>({...p,notes:d.target.value}))})]}),h.jsxs("div",{className:"flex gap-3 pt-2",children:[h.jsx(pt,{type:"button",variant:"outline",className:"flex-1",onClick:r,disabled:i,children:"Batal"}),h.jsxs(pt,{type:"submit",className:"flex-1 bg-emerald-600 hover:bg-emerald-700",disabled:i,children:[i?h.jsx(ti,{className:"w-4 h-4 animate-spin mr-2"}):null,"Simpan Panen"]})]})]})}async function zje(e){const t=await _k();if(console.log("🛠 DB Instance Check:",t),!t||typeof t.run!="function")throw console.error("❌ Database instance tidak valid!"),new Error("Database not initialized correctly");const n=crypto.randomUUID(),r=new Date().toISOString();if(!e.farmer_id)throw new Error("farmer_id is required");if(!e.center_lat||!e.center_lng)throw new Error("center coordinate is required");console.log("📦 createLand data:",e);try{const i=`INSERT INTO land (
|
||
id, farmer_id, name, polygon_coordinates,
|
||
center_lat, center_lng, area_hectares,
|
||
land_status, village, district, regency,
|
||
validation_status, sync_status, created_at
|
||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,a=[n,e.farmer_id,e.name,JSON.stringify(e.polygon_coordinates),e.center_lat,e.center_lng,e.area_hectares,e.land_status,e.village,e.district,e.regency,e.validation_status||"pending",e.sync_status||"pending",r];return console.log("📦 createLand values:",a),console.log("📡 Menjalankan query dengan nilai:",a),t.run(i,a),a1e(t),console.log("✅ Land inserted:",n),{id:n}}catch(i){throw console.error("❌ INSERT GAGAL",i),i}}async function Uje(e){const t=await _k();try{const n=t.exec("SELECT id, name, farmer_id FROM land");n[0]&&console.table(n[0].values.map(s=>({id:s[0],name:s[1],farmer_id_in_db:s[2]}))),console.log("Mencari farmerId:",e);const i=t.exec("SELECT * FROM land");if(!i||i.length===0||!i[0].values)return console.log(`ℹ️ Tidak ada lahan untuk farmerId: ${e}`),[];const{columns:a,values:o}=i[0];return o.map(s=>Object.fromEntries(a.map((c,d)=>[c,s[d]])))}catch(n){return console.error("❌ SQL Error:",n.message),[]}}function Vje(){var de,He;const e=As(),[t,n]=M.useState(null),[r,i]=M.useState(null),[a,o]=M.useState(!0),[s,c]=M.useState(!1),[d,p]=M.useState(!1),[m,y]=M.useState(null),[b,P]=M.useState({name:"",land_status:"owned",village:"",district:"",regency:""}),[x,w]=M.useState(null),[T,E]=M.useState(!1),[k,D]=M.useState(!1),[I,R]=M.useState(null),{data:$=[]}=bn({queryKey:["farmer-distributions",r==null?void 0:r.id],queryFn:()=>mt.entities.Distribution.filter({farmer_id:r==null?void 0:r.id}),enabled:!!(r!=null&&r.id)}),{data:V=[]}=bn({queryKey:["farmer-harvests",r==null?void 0:r.id],queryFn:()=>mt.entities.Harvest.filter({farmer_id:r==null?void 0:r.id}),enabled:!!(r!=null&&r.id)}),K=bj("Land"),Z=bj("Plant"),ee=bj("Harvest");M.useEffect(()=>{Uje().then(console.log),(async()=>{try{const $e=await mt.auth.me();n($e);const We=await mt.entities.Farmer.filter({user_email:$e.email});We.length>0&&i(We[0])}catch{}finally{o(!1)}})()},[]);const{data:ne=[]}=bn({queryKey:["farmer-lands",r==null?void 0:r.id],queryFn:()=>K.filter({farmer_id:r.id}),enabled:!!(r!=null&&r.id)});console.log("lands",ne);const{data:oe=[]}=bn({queryKey:["farmer-plants",r==null?void 0:r.id],queryFn:()=>Z.filter({farmer_id:r.id}),enabled:!!(r!=null&&r.id)}),he=ci({mutationFn:je=>zje({...je,farmer_id:r.id,validation_status:"pending",sync_status:"pending"}),onSuccess:()=>{e.invalidateQueries({queryKey:["farmer-lands"]}),c(!1),P({name:"",land_status:"owned",village:"",district:"",regency:""}),Mt.success("Lahan berhasil ditambahkan!")},onError:je=>{Mt.error(je.message)}}),Se=ci({mutationFn:je=>Z.create(je),onSuccess:()=>{e.invalidateQueries({queryKey:["farmer-plants"]}),Mt.success("Tanaman berhasil ditag!")}}),fe=ci({mutationFn:je=>ee.create({...je,farmer_id:r.id,sync_status:"pending",created_at:new Date().toISOString()}),onSuccess:()=>{e.invalidateQueries({queryKey:["farmer-harvests"]}),D(!1),R(null),Mt.success("Data panen berhasil disimpan!")}}),Oe=()=>{mt.auth.redirectToLogin(window.location.href)},re=()=>{mt.auth.logout()},Ce=je=>{if(!b.name){Mt.error("Masukkan nama lahan terlebih dahulu");return}he.mutate({...b,...je})};if(a)return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 to-slate-100 flex items-center justify-center",children:h.jsx(ti,{className:"w-8 h-8 animate-spin text-emerald-600"})});if(!t)return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 to-slate-100 flex items-center justify-center p-6",children:h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:h.jsx(Tt,{className:"border-0 shadow-xl max-w-md w-full",children:h.jsxs(Pn,{className:"p-8 text-center",children:[h.jsx("div",{className:"w-20 h-20 rounded-full bg-gradient-to-br from-emerald-500 to-emerald-600 flex items-center justify-center mx-auto mb-6",children:h.jsx(sa,{className:"w-10 h-10 text-white"})}),h.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Portal Petani"}),h.jsx("p",{className:"text-slate-500 mb-8",children:"Masuk untuk mengelola lahan dan tanaman Anda"}),h.jsx(pt,{onClick:Oe,className:"w-full h-12 bg-emerald-600 hover:bg-emerald-700 text-lg",children:"Masuk / Daftar"})]})})})});if(!r)return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 to-slate-100 flex items-center justify-center p-6",children:h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:h.jsx(Tt,{className:"border-0 shadow-xl max-w-md w-full",children:h.jsxs(Pn,{className:"p-8 text-center",children:[h.jsx("div",{className:"w-20 h-20 rounded-full bg-amber-100 flex items-center justify-center mx-auto mb-6",children:h.jsx(zf,{className:"w-10 h-10 text-amber-600"})}),h.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Akun Belum Terdaftar"}),h.jsxs("p",{className:"text-slate-500 mb-4",children:["Email ",h.jsx("span",{className:"font-medium",children:t.email})," belum terhubung dengan data petani."]}),h.jsx("p",{className:"text-sm text-slate-400 mb-8",children:"Hubungi admin untuk mendaftarkan akun Anda sebagai petani."}),h.jsxs(pt,{variant:"outline",onClick:re,className:"w-full h-12",children:[h.jsx(mh,{className:"w-5 h-5 mr-2"}),"Keluar"]})]})})})});const ae=oe.filter(je=>je.status==="alive").length,ie=ne.reduce((je,$e)=>je+($e.area_hectares||0),0);return h.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 to-slate-100",children:[h.jsxs("div",{className:"max-w-4xl mx-auto p-4 md:p-6 space-y-6",children:[h.jsx(Lje,{}),h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("div",{className:"w-14 h-14 rounded-full bg-gradient-to-br from-emerald-500 to-emerald-600 flex items-center justify-center shadow-lg",children:r.photo_url?h.jsx("img",{src:r.photo_url,alt:r.full_name,className:"w-full h-full rounded-full object-cover"}):h.jsx("span",{className:"text-xl font-bold text-white",children:(He=(de=r.full_name)==null?void 0:de.charAt(0))==null?void 0:He.toUpperCase()})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-bold text-slate-900",children:r.full_name}),h.jsx("div",{className:"flex items-center gap-2",children:r.verification_status==="verified"?h.jsxs(ur,{className:"bg-emerald-100 text-emerald-700 border-emerald-200 text-xs",children:[h.jsx(la,{className:"w-3 h-3 mr-1"}),"Terverifikasi"]}):h.jsxs(ur,{className:"bg-amber-100 text-amber-700 border-amber-200 text-xs",children:[h.jsx(Hf,{className:"w-3 h-3 mr-1"}),"Menunggu Verifikasi"]})})]})]}),h.jsx(pt,{variant:"outline",size:"sm",onClick:re,children:h.jsx(mh,{className:"w-4 h-4"})})]}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"grid grid-cols-3 gap-3",children:[h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(js,{className:"w-6 h-6 mx-auto text-emerald-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:ne.length}),h.jsx("p",{className:"text-xs text-slate-500",children:"Lahan"})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(sa,{className:"w-6 h-6 mx-auto text-emerald-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:ae}),h.jsx("p",{className:"text-xs text-slate-500",children:"Tanaman"})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(So,{className:"w-6 h-6 mx-auto text-emerald-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:ie.toFixed(1)}),h.jsx("p",{className:"text-xs text-slate-500",children:"Hektar"})]})]}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:h.jsxs(Ak,{defaultValue:"lands",className:"space-y-4",children:[h.jsxs(mx,{className:"w-full bg-white shadow-sm p-1 h-auto flex-wrap",children:[h.jsxs(al,{value:"lands",className:"flex-1 py-3 data-[state=active]:bg-emerald-50 data-[state=active]:text-emerald-700",children:[h.jsx(js,{className:"w-4 h-4 mr-2"}),"Lahan"]}),h.jsxs(al,{value:"plants",className:"flex-1 py-3 data-[state=active]:bg-emerald-50 data-[state=active]:text-emerald-700",children:[h.jsx(sa,{className:"w-4 h-4 mr-2"}),"Tanaman"]}),h.jsxs(al,{value:"harvest",className:"flex-1 py-3 data-[state=active]:bg-emerald-50 data-[state=active]:text-emerald-700",children:[h.jsx(Tc,{className:"w-4 h-4 mr-2"}),"Panen"]}),h.jsxs(al,{value:"distribution",className:"flex-1 py-3 data-[state=active]:bg-emerald-50 data-[state=active]:text-emerald-700",children:[h.jsx(fy,{className:"w-4 h-4 mr-2"}),"Distribusi"]}),h.jsxs(al,{value:"profile",className:"flex-1 py-3 data-[state=active]:bg-emerald-50 data-[state=active]:text-emerald-700",children:[h.jsx(zf,{className:"w-4 h-4 mr-2"}),"Profil"]})]}),h.jsxs(ol,{value:"lands",className:"space-y-4",children:[h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Daftar Lahan"}),h.jsxs(pt,{size:"sm",onClick:()=>c(!0),className:"bg-emerald-600 hover:bg-emerald-700",children:[h.jsx(Dc,{className:"w-4 h-4 mr-2"}),"Tambah Lahan"]})]}),ne.length>0?h.jsx("div",{className:"grid gap-4",children:ne.map(je=>h.jsxs("div",{className:"relative",children:[h.jsx(Sk,{land:je,plantCount:oe.filter($e=>$e.land_id===je.id).length}),h.jsxs(pt,{size:"sm",variant:"outline",className:"absolute top-4 right-4",onClick:()=>{y(je),p(!0)},children:[h.jsx(sa,{className:"w-4 h-4 mr-1"}),"Tag Tanaman"]})]},je.id))}):h.jsx(Qa,{icon:js,title:"Belum ada lahan",description:"Tambahkan lahan pertama Anda dengan menggunakan GPS",action:()=>c(!0),actionLabel:"Tambah Lahan"})]}),h.jsxs(ol,{value:"plants",className:"space-y-4",children:[h.jsxs("h2",{className:"text-lg font-semibold text-slate-900",children:["Daftar Tanaman (",oe.length,")"]}),oe.length>0?h.jsx("div",{className:"grid gap-3",children:oe.map(je=>{const $e=ne.find(Ye=>Ye.id===je.land_id),We=je.issue_type&&je.issue_type!=="none";return h.jsx(Tt,{className:"border-0 shadow-sm p-4",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:`w-3 h-3 rounded-full ${je.status==="alive"&&je.productivity_status==="productive"?"bg-emerald-500":je.status==="alive"&&je.productivity_status==="less_productive"?"bg-amber-500":je.status==="sick"?"bg-red-500":je.status==="dead"?"bg-slate-400":"bg-emerald-500"}`}),h.jsxs("div",{children:[h.jsx("p",{className:"font-medium text-slate-900",children:je.commodity_name}),h.jsx("p",{className:"text-sm text-slate-500",children:($e==null?void 0:$e.name)||"Lahan tidak diketahui"}),We&&h.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[h.jsx(eb,{className:"w-3 h-3 text-amber-500"}),h.jsx("span",{className:"text-xs text-amber-600",children:je.issue_type==="pest"?"Hama":je.issue_type==="disease"?"Penyakit":je.issue_type==="weather"?"Cuaca":je.issue_type==="nutrient_deficiency"?"Nutrisi":je.issue_type==="water_shortage"?"Air":"Masalah"})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ur,{variant:"outline",className:`text-xs ${je.productivity_status==="not_productive"?"border-red-200 text-red-600":je.productivity_status==="less_productive"?"border-amber-200 text-amber-600":"border-emerald-200 text-emerald-600"}`,children:je.productivity_status==="productive"||!je.productivity_status?"Produktif":je.productivity_status==="less_productive"?"Kurang Produktif":"Tidak Produktif"}),h.jsx(pt,{size:"sm",variant:"outline",className:"h-8",onClick:()=>w(je),children:h.jsx(NH,{className:"w-4 h-4"})})]})]})},je.id)})}):h.jsx(Qa,{icon:sa,title:"Belum ada tanaman",description:"Tag tanaman Anda melalui menu lahan"})]}),h.jsxs(ol,{value:"harvest",className:"space-y-4",children:[h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Catatan Panen"}),h.jsxs(pt,{size:"sm",onClick:()=>D(!0),className:"bg-emerald-600",children:[h.jsx(Dc,{className:"w-4 h-4 mr-2"}),"Catat Panen"]})]}),V.length>0?h.jsx("div",{className:"grid gap-3",children:V.map(je=>{var $e;return h.jsxs(Tt,{className:"border-0 shadow-sm p-4",children:[h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-bold text-slate-900",children:je.commodity_name||"Komoditas"}),h.jsx("p",{className:"text-sm text-slate-500",children:new Date(je.harvest_date).toLocaleDateString("id-ID",{day:"numeric",month:"long",year:"numeric"})})]}),h.jsxs(ur,{className:"bg-emerald-100 text-emerald-700",children:[je.weight_kg," Kg"]})]}),h.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-slate-400",children:[h.jsx(So,{className:"w-3 h-3"}),(($e=ne.find(We=>We.id===je.land_id))==null?void 0:$e.name)||"Lahan Umum"]})]},je.id)})}):h.jsx(Qa,{icon:Tc,title:"Belum ada catatan panen",description:"Mulai catat hasil panen Anda untuk melacak produktivitas",action:()=>D(!0),actionLabel:"Catat Panen Sekarang"})]}),h.jsxs(ol,{value:"distribution",className:"space-y-4",children:[h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Distribusi ke Offtaker"}),h.jsxs(pt,{size:"sm",onClick:()=>E(!0),className:"bg-emerald-600 hover:bg-emerald-700",children:[h.jsx(iF,{className:"w-4 h-4 mr-2"}),"Kirim Baru"]})]}),$.length>0?h.jsx("div",{className:"grid gap-3",children:$.map(je=>{var Ye,rt;const $e={pending:{label:"Pending",color:"bg-amber-100 text-amber-700"},in_transit:{label:"Dalam Pengiriman",color:"bg-blue-100 text-blue-700"},received:{label:"Diterima",color:"bg-indigo-100 text-indigo-700"},graded:{label:"Sudah Grade",color:"bg-emerald-100 text-emerald-700"},completed:{label:"Selesai",color:"bg-emerald-100 text-emerald-700"},rejected:{label:"Ditolak",color:"bg-red-100 text-red-700"}},We=je.offtaker_grade&&je.offtaker_grade!==je.farmer_grade;return h.jsxs(Tt,{className:"border-0 shadow-sm p-4",children:[h.jsxs("div",{className:"flex items-start justify-between mb-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-medium text-slate-900",children:je.commodity_name}),h.jsxs("p",{className:"text-sm text-slate-500",children:["Ke: ",je.offtaker_name]})]}),h.jsx(ur,{className:((Ye=$e[je.status])==null?void 0:Ye.color)||"bg-slate-100",children:((rt=$e[je.status])==null?void 0:rt.label)||je.status})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-slate-500",children:"Jumlah"}),h.jsxs("p",{className:"font-medium",children:[je.quantity_kg," Kg"]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-slate-500",children:"Grade Klaim"}),h.jsx("p",{className:"font-medium",children:je.farmer_grade})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-slate-500",children:"Grade Final"}),h.jsxs("p",{className:`font-medium ${We?"text-amber-600":"text-emerald-600"}`,children:[je.offtaker_grade||"-",We&&" ↓"]})]})]}),je.grade_difference_reason&&h.jsxs("div",{className:"mt-2 p-2 bg-amber-50 rounded text-sm text-amber-700",children:[h.jsx("strong",{children:"Alasan:"})," ",je.grade_difference_reason]}),je.total_value&&h.jsxs("p",{className:"mt-2 text-sm font-semibold text-emerald-600",children:["Total: Rp ",je.total_value.toLocaleString()]})]},je.id)})}):h.jsx(Qa,{icon:Tc,title:"Belum ada distribusi",description:"Kirim hasil panen ke offtaker untuk mendapatkan grading",action:()=>E(!0),actionLabel:"Kirim Distribusi"})]}),h.jsx(ol,{value:"profile",children:h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsxs(Pn,{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[h.jsx(zf,{className:"w-5 h-5 text-slate-400"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Nama Lengkap"}),h.jsx("p",{className:"font-medium text-slate-900",children:r.full_name})]})]}),h.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[h.jsx(So,{className:"w-5 h-5 text-slate-400"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Alamat"}),h.jsxs("p",{className:"font-medium text-slate-900",children:[r.village,", ",r.district,", ",r.regency]})]})]}),r.phone&&h.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[h.jsx(Yh,{className:"w-5 h-5 text-slate-400"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Telepon"}),h.jsx("p",{className:"font-medium text-slate-900",children:r.phone})]})]}),r.farmer_group&&h.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[h.jsx(ll,{className:"w-5 h-5 text-slate-400"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-slate-500",children:"Kelompok Tani"}),h.jsx("p",{className:"font-medium text-slate-900",children:r.farmer_group})]})]})]})})})]})})]}),h.jsx(sl,{open:s,onOpenChange:c,children:h.jsxs(Ss,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[h.jsx(ql,{children:h.jsx(zl,{children:"Tambah Lahan Baru"})}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Nama Lahan *"}),h.jsx(nn,{value:b.name,onChange:je=>P($e=>({...$e,name:je.target.value})),placeholder:"Contoh: Kebun Kopi Utara"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Status Kepemilikan"}),h.jsxs(Hr,{value:b.land_status,onValueChange:je=>P($e=>({...$e,land_status:je})),children:[h.jsx(Dr,{children:h.jsx(Gr,{})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"owned",children:"Milik Sendiri"}),h.jsx(Kt,{value:"rented",children:"Sewa"}),h.jsx(Kt,{value:"shared",children:"Bagi Hasil"})]})]})]})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Desa"}),h.jsx(nn,{value:b.village,onChange:je=>P($e=>({...$e,village:je.target.value})),placeholder:"Nama desa"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Kecamatan"}),h.jsx(nn,{value:b.district,onChange:je=>P($e=>({...$e,district:je.target.value})),placeholder:"Nama kecamatan"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Kabupaten"}),h.jsx(nn,{value:b.regency,onChange:je=>P($e=>({...$e,regency:je.target.value})),placeholder:"Nama kabupaten"})]})]}),h.jsx(kk,{onSave:Ce})]})]})}),h.jsx(sl,{open:d,onOpenChange:p,children:h.jsxs(Ss,{className:"max-w-lg max-h-[90vh] overflow-y-auto",children:[h.jsx(ql,{children:h.jsxs(zl,{children:["Tag Tanaman - ",m==null?void 0:m.name]})}),m&&h.jsx(eK,{landId:m.id,farmerId:r.id,landPolygon:m.polygon_coordinates,existingPlants:oe.filter(je=>je.land_id===m.id),onTagPlant:Se.mutate,isLoading:Se.isPending})]})}),h.jsx(sl,{open:!!x,onOpenChange:()=>w(null),children:h.jsx(Ss,{className:"max-w-md max-h-[90vh] overflow-y-auto p-0",children:x&&h.jsx($je,{plant:x,onClose:()=>w(null),onSuccess:()=>{e.invalidateQueries({queryKey:["farmer-plants"]})}})})}),h.jsx(sl,{open:T,onOpenChange:E,children:h.jsx(Ss,{className:"max-w-md max-h-[90vh] overflow-y-auto p-0",children:h.jsx(Fje,{farmer:r,onSuccess:()=>{e.invalidateQueries({queryKey:["farmer-distributions"]})},onClose:()=>E(!1),harvests:V})})}),h.jsx(sl,{open:k,onOpenChange:D,children:h.jsxs(Ss,{className:"max-w-md p-0 overflow-hidden",children:[h.jsx(ql,{className:"p-6 pb-0",children:h.jsx(zl,{children:"Input Hasil Panen"})}),h.jsx("div",{className:"p-6",children:h.jsx(qje,{lands:ne,plants:oe,onSubmit:je=>fe.mutate(je),onCancel:()=>D(!1),isLoading:fe.isPending})})]})})]})}function Wje(){const e=As(),[t,n]=M.useState(!1),[r,i]=M.useState({user_email:"",company_name:"",contact_name:"",phone:"",address:"",is_active:!0}),{data:a=[],isLoading:o}=bn({queryKey:["offtakers"],queryFn:()=>{try{const p=mt.entities.Offtaker.list();return Array.isArray(p)?p:[]}catch{return[]}}}),s=ci({mutationFn:p=>mt.entities.Offtaker.create(p),onSuccess:()=>{e.invalidateQueries({queryKey:["offtakers"]}),n(!1),i({user_email:"",company_name:"",contact_name:"",phone:"",address:"",is_active:!0}),Mt.success("Offtaker berhasil ditambahkan!")}}),c=ci({mutationFn:({id:p,is_active:m})=>mt.entities.Offtaker.update(p,{is_active:m}),onSuccess:()=>{e.invalidateQueries({queryKey:["offtakers"]}),Mt.success("Status offtaker diperbarui")}}),d=ci({mutationFn:p=>mt.entities.Offtaker.delete(p),onSuccess:()=>{e.invalidateQueries({queryKey:["offtakers"]}),Mt.success("Offtaker dihapus")}});return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Offtaker"}),h.jsx("p",{className:"text-slate-500",children:"Kelola pembeli hasil panen"})]}),h.jsxs(sl,{open:t,onOpenChange:n,children:[h.jsx(HW,{asChild:!0,children:h.jsxs(pt,{className:"bg-indigo-600 hover:bg-indigo-700",children:[h.jsx(Dc,{className:"w-4 h-4 mr-2"}),"Tambah Offtaker"]})}),h.jsxs(Ss,{children:[h.jsx(ql,{children:h.jsx(zl,{children:"Tambah Offtaker Baru"})}),h.jsxs("div",{className:"space-y-4 pt-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Email *"}),h.jsx(nn,{type:"email",value:r.user_email,onChange:p=>i(m=>({...m,user_email:p.target.value})),placeholder:"email@company.com"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Nama Perusahaan *"}),h.jsx(nn,{value:r.company_name,onChange:p=>i(m=>({...m,company_name:p.target.value})),placeholder:"PT. Example"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Nama Kontak *"}),h.jsx(nn,{value:r.contact_name,onChange:p=>i(m=>({...m,contact_name:p.target.value})),placeholder:"Nama PIC"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Telepon"}),h.jsx(nn,{value:r.phone,onChange:p=>i(m=>({...m,phone:p.target.value})),placeholder:"08xxx"})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Alamat"}),h.jsx(nn,{value:r.address,onChange:p=>i(m=>({...m,address:p.target.value})),placeholder:"Alamat lengkap"})]}),h.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[h.jsx(pt,{variant:"outline",onClick:()=>n(!1),children:"Batal"}),h.jsxs(pt,{onClick:()=>s.mutate(r),disabled:!r.user_email||!r.company_name||!r.contact_name||s.isPending,className:"bg-indigo-600 hover:bg-indigo-700",children:[s.isPending&&h.jsx(ti,{className:"w-4 h-4 mr-2 animate-spin"}),"Simpan"]})]})]})]})]})]}),o?h.jsx("div",{className:"flex justify-center py-12",children:h.jsx(ti,{className:"w-8 h-8 animate-spin text-indigo-600"})}):a.length>0?h.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(p=>h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsxs(Pn,{className:"p-4",children:[h.jsxs("div",{className:"flex items-start justify-between mb-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center",children:h.jsx(Tc,{className:"w-5 h-5 text-indigo-600"})}),h.jsxs("div",{children:[h.jsx("p",{className:"font-semibold text-slate-900",children:p.company_name}),h.jsx("p",{className:"text-sm text-slate-500",children:p.contact_name})]})]}),h.jsx(Rk,{checked:p.is_active,onCheckedChange:m=>c.mutate({id:p.id,is_active:m})})]}),h.jsxs("div",{className:"space-y-2 text-sm text-slate-600",children:[p.phone&&h.jsxs("p",{className:"flex items-center gap-2",children:[h.jsx(Yh,{className:"w-4 h-4"})," ",p.phone]}),p.address&&h.jsxs("p",{className:"flex items-center gap-2",children:[h.jsx(So,{className:"w-4 h-4"})," ",p.address]}),h.jsx("p",{className:"text-xs text-slate-400",children:p.user_email})]}),h.jsxs(pt,{variant:"ghost",size:"sm",className:"w-full mt-3 text-red-600 hover:bg-red-50",onClick:()=>d.mutate(p.id),children:[h.jsx(nb,{className:"w-4 h-4 mr-2"}),"Hapus"]})]})},p.id))}):h.jsx(Qa,{icon:Tc,title:"Belum ada offtaker",description:"Tambahkan offtaker untuk grading hasil panen",action:()=>n(!0),actionLabel:"Tambah Offtaker"})]})}const xj={A:{label:"Grade A",color:"bg-emerald-100 text-emerald-700",value:4},B:{label:"Grade B",color:"bg-green-100 text-green-700",value:3},C:{label:"Grade C",color:"bg-amber-100 text-amber-700",value:2},D:{label:"Grade D",color:"bg-orange-100 text-orange-700",value:1},rejected:{label:"Rejected",color:"bg-red-100 text-red-700",value:0}};function Kje({distribution:e,offtaker:t,onSuccess:n,onClose:r}){var y,b,P;const[i,a]=M.useState(!1),[o,s]=M.useState({offtaker_grade:(e==null?void 0:e.farmer_grade)||"",grade_difference_reason:"",price_per_kg:""}),c=((y=xj[e==null?void 0:e.farmer_grade])==null?void 0:y.value)||0,d=((b=xj[o.offtaker_grade])==null?void 0:b.value)||0,p=o.offtaker_grade&&d<c,m=async()=>{if(!o.offtaker_grade||!o.price_per_kg){Mt.error("Lengkapi grade dan harga");return}if(p&&!o.grade_difference_reason){Mt.error("Berikan alasan penurunan grade");return}a(!0);try{const x=parseFloat(o.price_per_kg)*e.quantity_kg;await mt.entities.Distribution.update(e.id,{offtaker_grade:o.offtaker_grade,grade_difference_reason:o.grade_difference_reason,price_per_kg:parseFloat(o.price_per_kg),total_value:x,received_date:new Date().toISOString().split("T")[0],status:o.offtaker_grade==="rejected"?"rejected":"graded"}),Mt.success("Grading berhasil disimpan!"),n==null||n(),r==null||r()}catch{Mt.error("Gagal menyimpan grading")}finally{a(!1)}};return h.jsxs("div",{className:"space-y-4 p-4",children:[h.jsxs("div",{className:"p-4 bg-slate-50 rounded-lg space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-semibold text-slate-900",children:e==null?void 0:e.commodity_name}),h.jsxs("p",{className:"text-sm text-slate-500",children:["Dari: ",e==null?void 0:e.farmer_name]})]}),h.jsxs(ur,{className:(P=xj[e==null?void 0:e.farmer_grade])==null?void 0:P.color,children:["Klaim: ",e==null?void 0:e.farmer_grade]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-slate-500",children:"Jumlah"}),h.jsxs("p",{className:"font-semibold",children:[e==null?void 0:e.quantity_kg," Kg"]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-slate-500",children:"Tanggal Kirim"}),h.jsx("p",{className:"font-semibold",children:e!=null&&e.distribution_date?Uc(new Date(e.distribution_date),"dd MMM yyyy",{locale:gg}):"-"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Grade Setelah Diterima *"}),h.jsx("div",{className:"grid grid-cols-5 gap-2",children:["A","B","C","D","rejected"].map(x=>h.jsx(pt,{type:"button",variant:o.offtaker_grade===x?"default":"outline",className:`h-12 ${o.offtaker_grade===x?x==="rejected"?"bg-red-600":"bg-indigo-600":""}`,onClick:()=>s(w=>({...w,offtaker_grade:x})),children:x==="rejected"?"X":x},x))})]}),p&&h.jsxs("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-lg",children:[h.jsxs("div",{className:"flex items-center gap-2 text-amber-700 mb-2",children:[h.jsx(G$,{className:"w-4 h-4"}),h.jsx("span",{className:"font-medium",children:"Grade Diturunkan"})]}),h.jsxs("p",{className:"text-sm text-amber-600 mb-3",children:["Grade petani: ",e==null?void 0:e.farmer_grade," → Grade Anda: ",o.offtaker_grade]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{className:"text-amber-700",children:"Alasan Penurunan Grade *"}),h.jsx(Ic,{value:o.grade_difference_reason,onChange:x=>s(w=>({...w,grade_difference_reason:x.target.value})),placeholder:"Contoh: Kondisi barang rusak saat pengiriman, kematangan tidak sesuai, dll",rows:2,className:"border-amber-200"})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Harga per Kg (Rp) *"}),h.jsx(nn,{type:"number",value:o.price_per_kg,onChange:x=>s(w=>({...w,price_per_kg:x.target.value})),placeholder:"0"}),o.price_per_kg&&h.jsxs("p",{className:"text-sm text-emerald-600 font-medium",children:["Total: Rp ",(parseFloat(o.price_per_kg)*e.quantity_kg).toLocaleString()]})]}),h.jsxs(pt,{className:"w-full h-12 bg-indigo-600 hover:bg-indigo-700",onClick:m,disabled:i,children:[i?h.jsx(ti,{className:"w-5 h-5 mr-2 animate-spin"}):h.jsx(la,{className:"w-5 h-5 mr-2"}),"Simpan Grading"]})]})}const wj={A:{label:"Grade A",color:"bg-emerald-100 text-emerald-700",description:"Kualitas Premium"},B:{label:"Grade B",color:"bg-green-100 text-green-700",description:"Kualitas Baik"},C:{label:"Grade C",color:"bg-amber-100 text-amber-700",description:"Kualitas Standar"},D:{label:"Grade D",color:"bg-orange-100 text-orange-700",description:"Kualitas Rendah"},rejected:{label:"Rejected",color:"bg-red-100 text-red-700",description:"Tidak Memenuhi Standar"}};function Hje(){var R;const e=As(),[t,n]=M.useState(null),[r,i]=M.useState(null),[a,o]=M.useState(!0),[s,c]=M.useState(null),[d,p]=M.useState({grade:"",notes:"",price_per_kg:""}),[m,y]=M.useState(null);M.useEffect(()=>{(async()=>{try{const V=await mt.auth.me();n(V);const K=await mt.entities.Offtaker.filter({user_email:V.email});K.length>0&&K[0].is_active&&i(K[0])}catch{}finally{o(!1)}})()},[]);const{data:b=[]}=bn({queryKey:["pending-harvests"],queryFn:()=>mt.entities.Harvest.filter({status:"pending_grade"}),enabled:!!r}),{data:P=[]}=bn({queryKey:["graded-harvests",r==null?void 0:r.user_email],queryFn:()=>mt.entities.Harvest.filter({graded_by:r.user_email}),enabled:!!r}),{data:x=[]}=bn({queryKey:["pending-distributions",r==null?void 0:r.id],queryFn:()=>mt.entities.Distribution.filter({offtaker_id:r.id,status:"pending"}),enabled:!!(r!=null&&r.id)}),{data:w=[]}=bn({queryKey:["graded-distributions",r==null?void 0:r.id],queryFn:()=>mt.entities.Distribution.filter({offtaker_id:r.id}),enabled:!!(r!=null&&r.id)}),{data:T=[]}=bn({queryKey:["farmers"],queryFn:()=>mt.entities.Farmer.list(),enabled:!!r}),E=ci({mutationFn:async()=>{const $=parseFloat(d.price_per_kg)*s.quantity_kg;await mt.entities.Harvest.update(s.id,{grade:d.grade,grade_notes:d.notes,price_per_kg:parseFloat(d.price_per_kg),total_value:$,graded_by:r.user_email,graded_by_name:r.contact_name,graded_at:new Date().toISOString(),status:d.grade==="rejected"?"rejected":"graded"})},onSuccess:()=>{e.invalidateQueries({queryKey:["pending-harvests"]}),e.invalidateQueries({queryKey:["graded-harvests"]}),c(null),p({grade:"",notes:"",price_per_kg:""}),Mt.success("Grading berhasil disimpan!")}}),k=()=>{mt.auth.redirectToLogin(window.location.href)},D=()=>{mt.auth.logout()},I=$=>{const V=T.find(K=>K.id===$);return(V==null?void 0:V.full_name)||"Tidak diketahui"};return a?h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-indigo-50 to-slate-100 flex items-center justify-center",children:h.jsx(ti,{className:"w-8 h-8 animate-spin text-indigo-600"})}):t?r?h.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-indigo-50 to-slate-100",children:[h.jsxs("div",{className:"max-w-4xl mx-auto p-4 md:p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("div",{className:"w-14 h-14 rounded-full bg-gradient-to-br from-indigo-500 to-indigo-600 flex items-center justify-center shadow-lg",children:h.jsx(Tc,{className:"w-7 h-7 text-white"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-xl font-bold text-slate-900",children:r.company_name}),h.jsx("p",{className:"text-sm text-slate-500",children:r.contact_name})]})]}),h.jsx(pt,{variant:"outline",size:"sm",onClick:D,children:h.jsx(mh,{className:"w-4 h-4"})})]}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"grid grid-cols-4 gap-3",children:[h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(fy,{className:"w-6 h-6 mx-auto text-indigo-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:x.length}),h.jsx("p",{className:"text-xs text-slate-500",children:"Distribusi Masuk"})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(Hf,{className:"w-6 h-6 mx-auto text-amber-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:b.length}),h.jsx("p",{className:"text-xs text-slate-500",children:"Panen Pending"})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(la,{className:"w-6 h-6 mx-auto text-emerald-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:w.filter($=>$.status==="graded").length}),h.jsx("p",{className:"text-xs text-slate-500",children:"Sudah Grade"})]}),h.jsxs(Tt,{className:"border-0 shadow-sm p-4 text-center",children:[h.jsx(rF,{className:"w-6 h-6 mx-auto text-blue-600 mb-2"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:w.reduce(($,V)=>$+(V.quantity_kg||0),0).toLocaleString()}),h.jsx("p",{className:"text-xs text-slate-500",children:"Total Kg"})]})]}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:h.jsxs(Ak,{defaultValue:"distributions",className:"space-y-4",children:[h.jsxs(mx,{className:"w-full bg-white shadow-sm p-1 h-auto",children:[h.jsxs(al,{value:"distributions",className:"flex-1 py-3 data-[state=active]:bg-indigo-50 data-[state=active]:text-indigo-700",children:[h.jsx(fy,{className:"w-4 h-4 mr-2"}),"Distribusi (",x.length,")"]}),h.jsxs(al,{value:"pending",className:"flex-1 py-3 data-[state=active]:bg-indigo-50 data-[state=active]:text-indigo-700",children:[h.jsx(Hf,{className:"w-4 h-4 mr-2"}),"Panen (",b.length,")"]}),h.jsxs(al,{value:"graded",className:"flex-1 py-3 data-[state=active]:bg-indigo-50 data-[state=active]:text-indigo-700",children:[h.jsx(Mv,{className:"w-4 h-4 mr-2"}),"Riwayat"]})]}),h.jsx(ol,{value:"distributions",className:"space-y-4",children:x.length>0?h.jsx("div",{className:"grid gap-4",children:x.map($=>h.jsx(Tt,{className:"border-0 shadow-sm overflow-hidden",children:h.jsxs(Pn,{className:"p-4",children:[h.jsxs("div",{className:"flex items-start justify-between mb-3",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-slate-900",children:$.commodity_name}),h.jsxs("p",{className:"text-sm text-slate-500",children:["Dari: ",$.farmer_name]})]}),h.jsxs(ur,{className:"bg-indigo-100 text-indigo-700",children:["Klaim: Grade ",$.farmer_grade]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm mb-4",children:[h.jsxs("div",{className:"p-2 bg-slate-50 rounded",children:[h.jsx("p",{className:"text-slate-500",children:"Jumlah"}),h.jsxs("p",{className:"font-semibold",children:[$.quantity_kg," Kg"]})]}),h.jsxs("div",{className:"p-2 bg-slate-50 rounded",children:[h.jsx("p",{className:"text-slate-500",children:"Tanggal Kirim"}),h.jsx("p",{className:"font-semibold",children:$.distribution_date?Uc(new Date($.distribution_date),"dd MMM yyyy",{locale:gg}):"-"})]})]}),$.notes&&h.jsxs("p",{className:"text-sm text-slate-600 bg-slate-50 p-2 rounded mb-4",children:["Catatan: ",$.notes]}),h.jsxs(pt,{className:"w-full bg-indigo-600 hover:bg-indigo-700",onClick:()=>y($),children:[h.jsx(Mv,{className:"w-4 h-4 mr-2"}),"Validasi & Grading"]})]})},$.id))}):h.jsx(Qa,{icon:fy,title:"Tidak ada distribusi pending",description:"Distribusi dari petani akan muncul di sini"})}),h.jsx(ol,{value:"pending",className:"space-y-4",children:b.length>0?h.jsx("div",{className:"grid gap-4",children:b.map($=>h.jsx(Tt,{className:"border-0 shadow-sm overflow-hidden",children:h.jsxs(Pn,{className:"p-4",children:[h.jsxs("div",{className:"flex items-start justify-between mb-3",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-slate-900",children:$.commodity_name}),h.jsxs("p",{className:"text-sm text-slate-500",children:["Petani: ",I($.farmer_id)]})]}),h.jsx(ur,{className:"bg-amber-100 text-amber-700",children:"Pending Grade"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm mb-4",children:[h.jsxs("div",{className:"p-2 bg-slate-50 rounded",children:[h.jsx("p",{className:"text-slate-500",children:"Jumlah"}),h.jsxs("p",{className:"font-semibold",children:[$.quantity_kg," Kg"]})]}),h.jsxs("div",{className:"p-2 bg-slate-50 rounded",children:[h.jsx("p",{className:"text-slate-500",children:"Tanggal Panen"}),h.jsx("p",{className:"font-semibold",children:$.harvest_date?Uc(new Date($.harvest_date),"dd MMM yyyy",{locale:gg}):"-"})]})]}),h.jsxs(pt,{className:"w-full bg-indigo-600 hover:bg-indigo-700",onClick:()=>{c($),p({grade:"",notes:"",price_per_kg:""})},children:[h.jsx(Mv,{className:"w-4 h-4 mr-2"}),"Lakukan Grading"]})]})},$.id))}):h.jsx(Qa,{icon:la,title:"Tidak ada hasil panen pending",description:"Semua hasil panen sudah di-grading"})}),h.jsxs(ol,{value:"graded",className:"space-y-4",children:[h.jsx("h3",{className:"font-medium text-slate-700",children:"Riwayat Distribusi"}),w.filter($=>$.status==="graded"||$.status==="rejected").length>0?h.jsx("div",{className:"grid gap-3",children:w.filter($=>$.status==="graded"||$.status==="rejected").map($=>{var K,Z;const V=$.offtaker_grade&&$.offtaker_grade!==$.farmer_grade;return h.jsxs(Tt,{className:"border-0 shadow-sm p-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-medium text-slate-900",children:$.commodity_name}),h.jsxs("p",{className:"text-sm text-slate-500",children:[$.quantity_kg," Kg • Dari: ",$.farmer_name]})]}),h.jsxs("div",{className:"text-right",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[V&&h.jsxs(ur,{variant:"outline",className:"text-amber-600 border-amber-200",children:[$.farmer_grade," ",h.jsx(G$,{className:"w-3 h-3 mx-1"})," ",$.offtaker_grade]}),!V&&h.jsx(ur,{className:((K=wj[$.offtaker_grade])==null?void 0:K.color)||"bg-slate-100 text-slate-700",children:((Z=wj[$.offtaker_grade])==null?void 0:Z.label)||$.offtaker_grade})]}),$.total_value&&h.jsxs("p",{className:"text-sm font-semibold text-emerald-600 mt-1",children:["Rp ",$.total_value.toLocaleString()]})]})]}),$.grade_difference_reason&&h.jsxs("p",{className:"text-sm text-amber-700 mt-2 bg-amber-50 p-2 rounded",children:[h.jsx("strong",{children:"Alasan:"})," ",$.grade_difference_reason]})]},$.id)})}):h.jsx(Qa,{icon:Mv,title:"Belum ada riwayat",description:"Riwayat grading akan muncul di sini"})]})]})})]}),h.jsx(sl,{open:!!s,onOpenChange:()=>c(null),children:h.jsxs(Ss,{className:"max-w-md",children:[h.jsx(ql,{children:h.jsx(zl,{children:"Grading Hasil Panen"})}),s&&h.jsxs("div",{className:"space-y-4",children:[h.jsx("div",{className:"p-4 bg-slate-50 rounded-lg",children:h.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-slate-500",children:"Komoditas"}),h.jsx("p",{className:"font-semibold",children:s.commodity_name})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-slate-500",children:"Jumlah"}),h.jsxs("p",{className:"font-semibold",children:[s.quantity_kg," Kg"]})]})]})}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Pilih Grade *"}),h.jsx("div",{className:"grid grid-cols-5 gap-2",children:["A","B","C","D","rejected"].map($=>h.jsx(pt,{type:"button",variant:d.grade===$?"default":"outline",className:`h-12 ${d.grade===$?"bg-indigo-600":""}`,onClick:()=>p(V=>({...V,grade:$})),children:$==="rejected"?"X":$},$))}),d.grade&&h.jsx("p",{className:"text-sm text-slate-500",children:(R=wj[d.grade])==null?void 0:R.description})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Harga per Kg (Rp) *"}),h.jsx(nn,{type:"number",value:d.price_per_kg,onChange:$=>p(V=>({...V,price_per_kg:$.target.value})),placeholder:"0"}),d.price_per_kg&&h.jsxs("p",{className:"text-sm text-emerald-600 font-medium",children:["Total: Rp ",(parseFloat(d.price_per_kg)*s.quantity_kg).toLocaleString()]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(St,{children:"Catatan"}),h.jsx(Ic,{value:d.notes,onChange:$=>p(V=>({...V,notes:$.target.value})),placeholder:"Catatan kualitas, kondisi, dll",rows:3})]}),h.jsxs(pt,{className:"w-full h-12 bg-indigo-600 hover:bg-indigo-700",onClick:()=>E.mutate(),disabled:!d.grade||!d.price_per_kg||E.isPending,children:[E.isPending?h.jsx(ti,{className:"w-5 h-5 mr-2 animate-spin"}):h.jsx(la,{className:"w-5 h-5 mr-2"}),"Simpan Grading"]})]})]})}),h.jsx(sl,{open:!!m,onOpenChange:()=>y(null),children:h.jsxs(Ss,{className:"max-w-md p-0",children:[h.jsx(ql,{className:"p-4 pb-0",children:h.jsx(zl,{children:"Validasi & Grading Distribusi"})}),m&&h.jsx(Kje,{distribution:m,offtaker:r,onSuccess:()=>{e.invalidateQueries({queryKey:["pending-distributions"]}),e.invalidateQueries({queryKey:["graded-distributions"]})},onClose:()=>y(null)})]})})]}):h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-indigo-50 to-slate-100 flex items-center justify-center p-6",children:h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:h.jsx(Tt,{className:"border-0 shadow-xl max-w-md w-full",children:h.jsxs(Pn,{className:"p-8 text-center",children:[h.jsx("div",{className:"w-20 h-20 rounded-full bg-amber-100 flex items-center justify-center mx-auto mb-6",children:h.jsx(ul,{className:"w-10 h-10 text-amber-600"})}),h.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Akses Ditolak"}),h.jsxs("p",{className:"text-slate-500 mb-4",children:["Email ",h.jsx("span",{className:"font-medium",children:t.email})," tidak terdaftar sebagai offtaker."]}),h.jsx("p",{className:"text-sm text-slate-400 mb-8",children:"Hubungi admin untuk mendaftarkan Anda sebagai offtaker."}),h.jsxs(pt,{variant:"outline",onClick:D,className:"w-full h-12",children:[h.jsx(mh,{className:"w-5 h-5 mr-2"}),"Keluar"]})]})})})}):h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-indigo-50 to-slate-100 flex items-center justify-center p-6",children:h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},children:h.jsx(Tt,{className:"border-0 shadow-xl max-w-md w-full",children:h.jsxs(Pn,{className:"p-8 text-center",children:[h.jsx("div",{className:"w-20 h-20 rounded-full bg-gradient-to-br from-indigo-500 to-indigo-600 flex items-center justify-center mx-auto mb-6",children:h.jsx(Tc,{className:"w-10 h-10 text-white"})}),h.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Portal Offtaker"}),h.jsx("p",{className:"text-slate-500 mb-8",children:"Masuk untuk melakukan grading hasil panen"}),h.jsx(pt,{onClick:k,className:"w-full h-12 bg-indigo-600 hover:bg-indigo-700 text-lg",children:"Masuk"})]})})})})}function Gje(e,t=[]){let n=[];function r(a,o){const s=M.createContext(o);s.displayName=a+"Context";const c=n.length;n=[...n,o];const d=m=>{var T;const{scope:y,children:b,...P}=m,x=((T=y==null?void 0:y[e])==null?void 0:T[c])||s,w=M.useMemo(()=>P,Object.values(P));return h.jsx(x.Provider,{value:w,children:b})};d.displayName=a+"Provider";function p(m,y){var x;const b=((x=y==null?void 0:y[e])==null?void 0:x[c])||s,P=M.useContext(b);if(P)return P;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[d,p]}const i=()=>{const a=n.map(o=>M.createContext(o));return function(s){const c=(s==null?void 0:s[e])||a;return M.useMemo(()=>({[`__scope${e}`]:{...s,[e]:c}}),[s,c])}};return i.scopeName=e,[r,Zje(i,...t)]}function Zje(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:c,scopeName:d})=>{const m=c(a)[`__scope${d}`];return{...s,...m}},{});return M.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Yje=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sK=Yje.reduce((e,t)=>{const n=sk(`Primitive.${t}`),r=M.forwardRef((i,a)=>{const{asChild:o,...s}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(c,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Lk="Progress",Ik=100,[Xje]=Gje(Lk),[Qje,Jje]=Xje(Lk),lK=M.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=eOe,...o}=e;(i||i===0)&&!A$(i)&&console.error(tOe(`${i}`,"Progress"));const s=A$(i)?i:Ik;r!==null&&!k$(r,s)&&console.error(nOe(`${r}`,"Progress"));const c=k$(r,s)?r:null,d=Y0(c)?a(c,s):void 0;return h.jsx(Qje,{scope:n,value:c,max:s,children:h.jsx(sK.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":Y0(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":fK(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});lK.displayName=Lk;var uK="ProgressIndicator",cK=M.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=Jje(uK,n);return h.jsx(sK.div,{"data-state":fK(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});cK.displayName=uK;function eOe(e,t){return`${Math.round(e/t*100)}%`}function fK(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Y0(e){return typeof e=="number"}function A$(e){return Y0(e)&&!isNaN(e)&&e>0}function k$(e,t){return Y0(e)&&!isNaN(e)&&e<=t&&e>=0}function tOe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ik}\`.`}function nOe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${Ik} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var dK=lK,rOe=cK;const YT=M.forwardRef(({className:e,value:t,...n},r)=>h.jsx(dK,{ref:r,className:fn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:h.jsx(rOe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));YT.displayName=dK.displayName;const C$=["#10b981","#f59e0b","#ef4444","#6b7280"],iOe={none:la,pest:eb,disease:ky,weather:JT,nutrient_deficiency:ky,water_shortage:J$,other:ul},aOe={none:"Tidak Ada Masalah",pest:"Hama",disease:"Penyakit",weather:"Cuaca",nutrient_deficiency:"Kekurangan Nutrisi",water_shortage:"Kekurangan Air",other:"Lainnya"};function oOe(){const[e,t]=M.useState("regency"),[n,r]=M.useState("all"),{data:i=[]}=bn({queryKey:["farmers"],queryFn:async()=>{let R=[];try{const K=await mt.entities.Farmer.list();R=Array.isArray(K)?K:[]}catch{}const $=await Tr.getEntities("farmers"),V=new Map;return R.forEach(K=>V.set(K.id,K)),$.array.forEach(K=>V.set(K.id,K)),Array.from(V.values())}}),{data:a=[]}=bn({queryKey:["plants"],queryFn:async()=>{let R=[];try{const K=await mt.entities.Plant.list();R=Array.isArray(K)?K:[]}catch{}const $=await Tr.getEntities("plants"),V=new Map;return R.forEach(K=>V.set(K.id,K)),$.forEach(K=>V.set(K.id,K)),Array.from(V.values())}}),o=Array.isArray(i)?i:[],s=Array.isArray(a)?a:[],{data:c=[]}=bn({queryKey:["harvests"],queryFn:async()=>{try{const R=await mt.entities.Harvest.list();return Array.isArray(R)?R:[]}catch{return[]}}}),d=Array.isArray(c)?c:[],p={regency:[...new Set(o.map(R=>R.regency).filter(Boolean))],district:[...new Set(o.map(R=>R.district).filter(Boolean))],village:[...new Set(o.map(R=>R.village).filter(Boolean))]},m=n==="all"?o:o.filter(R=>R[e]===n),y=m.map(R=>R.id),b=s.filter(R=>y.includes(R.land_id)),P=()=>{if(m.length===0)return{avg:0,distribution:[]};const $=m.filter(Z=>Z.productivity_percentage!==void 0),V=$.length>0?$.reduce((Z,ee)=>Z+(ee.productivity_percentage||0),0)/$.length:0,K=[{name:"Sangat Produktif (>80%)",value:m.filter(Z=>(Z.productivity_percentage||0)>80).length,color:"#10b981"},{name:"Produktif (60-80%)",value:m.filter(Z=>(Z.productivity_percentage||0)>=60&&(Z.productivity_percentage||0)<=80).length,color:"#22c55e"},{name:"Kurang Produktif (40-60%)",value:m.filter(Z=>(Z.productivity_percentage||0)>=40&&(Z.productivity_percentage||0)<60).length,color:"#f59e0b"},{name:"Tidak Produktif (<40%)",value:m.filter(Z=>(Z.productivity_percentage||0)<40).length,color:"#ef4444"}];return{avg:V,distribution:K}},x=()=>{if(b.length===0)return{statusDist:[],issueDist:[]};const $=[{name:"Produktif",value:b.filter(Z=>Z.productivity_status==="productive"||!Z.productivity_status).length},{name:"Kurang Produktif",value:b.filter(Z=>Z.productivity_status==="less_productive").length},{name:"Tidak Produktif",value:b.filter(Z=>Z.productivity_status==="not_productive").length}],V=b.reduce((Z,ee)=>{const ne=ee.issue_type||"none";return Z[ne]=(Z[ne]||0)+1,Z},{}),K=Object.entries(V).filter(([Z])=>Z!=="none").map(([Z,ee])=>({name:aOe[Z],value:ee,type:Z}));return{statusDist:$,issueDist:K}},w=()=>{const R=e==="regency"?"regency":e==="district"?"district":"village",$=o.reduce((V,K)=>{const Z=K[R]||"Tidak Diketahui";return V[Z]||(V[Z]={totalLands:0,totalArea:0,totalProductivity:0,landsWithProductivity:0}),V[Z].totalLands++,V[Z].totalArea+=K.area_hectares||0,K.productivity_percentage!==void 0&&(V[Z].totalProductivity+=K.productivity_percentage,V[Z].landsWithProductivity++),V},{});return Object.entries($).map(([V,K])=>({name:V,productivity:K.landsWithProductivity>0?Math.round(K.totalProductivity/K.landsWithProductivity):0,area:K.totalArea,lands:K.totalLands})).sort((V,K)=>K.productivity-V.productivity)},T=P(),E=x(),k=w(),D=d.reduce((R,$)=>($.grade&&(R[$.grade]=(R[$.grade]||0)+1),R),{}),I=["A","B","C","D","rejected"].map(R=>({name:R==="rejected"?"Rejected":`Grade ${R}`,value:D[R]||0}));return h.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 to-slate-100",children:h.jsxs("div",{className:"max-w-7xl mx-auto p-6 space-y-6",children:[h.jsxs(Rt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Monitoring Produktivitas"}),h.jsx("p",{className:"text-slate-500",children:"Pantau produktivitas lahan dan tanaman"})]}),h.jsxs("div",{className:"flex gap-3",children:[h.jsxs(Hr,{value:e,onValueChange:R=>{t(R),r("all")},children:[h.jsx(Dr,{className:"w-40",children:h.jsx(Gr,{})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"regency",children:"Kabupaten"}),h.jsx(Kt,{value:"district",children:"Kecamatan"}),h.jsx(Kt,{value:"village",children:"Desa"})]})]}),h.jsxs(Hr,{value:n,onValueChange:r,children:[h.jsx(Dr,{className:"w-48",children:h.jsx(Gr,{placeholder:"Semua Wilayah"})}),h.jsxs(Br,{children:[h.jsx(Kt,{value:"all",children:"Semua Wilayah"}),p[e].map(R=>h.jsx(Kt,{value:R,children:R},R))]})]})]})]}),h.jsxs(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsx(Pn,{className:"p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-12 h-12 rounded-xl bg-emerald-100 flex items-center justify-center",children:h.jsx(oF,{className:"w-6 h-6 text-emerald-600"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-slate-500",children:"Avg Produktivitas"}),h.jsxs("p",{className:"text-2xl font-bold text-slate-900",children:[T.avg.toFixed(0),"%"]})]})]})})}),h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsx(Pn,{className:"p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-100 flex items-center justify-center",children:h.jsx(js,{className:"w-6 h-6 text-blue-600"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-slate-500",children:"Total Lahan"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:m.length})]})]})})}),h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsx(Pn,{className:"p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-100 flex items-center justify-center",children:h.jsx(sa,{className:"w-6 h-6 text-green-600"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-slate-500",children:"Total Tanaman"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:b.length})]})]})})}),h.jsx(Tt,{className:"border-0 shadow-sm",children:h.jsx(Pn,{className:"p-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-100 flex items-center justify-center",children:h.jsx(ul,{className:"w-6 h-6 text-amber-600"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm text-slate-500",children:"Bermasalah"}),h.jsx("p",{className:"text-2xl font-bold text-slate-900",children:b.filter(R=>R.issue_type&&R.issue_type!=="none").length})]})]})})})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx(Rt.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.2},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{children:h.jsx(Ei,{className:"text-lg",children:"Produktivitas per Wilayah"})}),h.jsx(Pn,{children:h.jsx("div",{className:"h-[300px]",children:h.jsx(hm,{width:"100%",height:"100%",children:h.jsxs(bT,{data:k.slice(0,8),layout:"vertical",children:[h.jsx(k0,{strokeDasharray:"3 3"}),h.jsx(Fh,{type:"number",domain:[0,100]}),h.jsx(zh,{dataKey:"name",type:"category",width:100,tick:{fontSize:12}}),h.jsx(wo,{formatter:R=>`${R}%`}),h.jsx(Nu,{dataKey:"productivity",fill:"#10b981",radius:[0,4,4,0]})]})})})})]})}),h.jsx(Rt.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{children:h.jsx(Ei,{className:"text-lg",children:"Distribusi Produktivitas Lahan"})}),h.jsx(Pn,{children:h.jsx("div",{className:"h-[300px]",children:h.jsx(hm,{width:"100%",height:"100%",children:h.jsxs(Y6,{children:[h.jsx(Gl,{data:T.distribution,cx:"50%",cy:"50%",outerRadius:100,dataKey:"value",label:({name:R,percent:$})=>`${($*100).toFixed(0)}%`,children:T.distribution.map((R,$)=>h.jsx(Sh,{fill:R.color},`cell-${$}`))}),h.jsx(wo,{}),h.jsx(Cc,{})]})})})})]})})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(eb,{className:"w-5 h-5 text-amber-500"}),"Masalah Tanaman"]})}),h.jsx(Pn,{children:E.issueDist.length>0?h.jsx("div",{className:"space-y-3",children:E.issueDist.map(R=>{const $=iOe[R.type]||ul,V=(R.value/b.length*100).toFixed(1);return h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-100 flex items-center justify-center",children:h.jsx($,{className:"w-5 h-5 text-amber-600"})}),h.jsxs("div",{className:"flex-1",children:[h.jsxs("div",{className:"flex justify-between mb-1",children:[h.jsx("span",{className:"text-sm font-medium",children:R.name}),h.jsxs("span",{className:"text-sm text-slate-500",children:[R.value," (",V,"%)"]})]}),h.jsx(YT,{value:parseFloat(V),className:"h-2"})]})]},R.type)})}):h.jsxs("div",{className:"text-center py-8 text-slate-500",children:[h.jsx(la,{className:"w-12 h-12 mx-auto text-emerald-500 mb-2"}),h.jsx("p",{children:"Tidak ada masalah terdeteksi"})]})})]})}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{children:h.jsxs(Ei,{className:"text-lg flex items-center gap-2",children:[h.jsx(_j,{className:"w-5 h-5 text-blue-500"}),"Distribusi Grade Hasil Panen"]})}),h.jsx(Pn,{children:d.length>0?h.jsx("div",{className:"h-[250px]",children:h.jsx(hm,{width:"100%",height:"100%",children:h.jsxs(bT,{data:I,children:[h.jsx(k0,{strokeDasharray:"3 3"}),h.jsx(Fh,{dataKey:"name"}),h.jsx(zh,{}),h.jsx(wo,{}),h.jsx(Nu,{dataKey:"value",radius:[4,4,0,0],children:I.map((R,$)=>h.jsx(Sh,{fill:C$[Math.min($,C$.length-1)]},`cell-${$}`))})]})})}):h.jsxs("div",{className:"text-center py-8 text-slate-500",children:[h.jsx(_j,{className:"w-12 h-12 mx-auto text-slate-300 mb-2"}),h.jsx("p",{children:"Belum ada data hasil panen"})]})})]})})]}),h.jsx(Rt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},children:h.jsxs(Tt,{className:"border-0 shadow-sm",children:[h.jsx(Ti,{children:h.jsx(Ei,{className:"text-lg",children:"Detail Produktivitas per Wilayah"})}),h.jsx(Pn,{children:h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-sm",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b",children:[h.jsx("th",{className:"text-left py-3 px-4 font-medium text-slate-600",children:"Wilayah"}),h.jsx("th",{className:"text-center py-3 px-4 font-medium text-slate-600",children:"Jumlah Lahan"}),h.jsx("th",{className:"text-center py-3 px-4 font-medium text-slate-600",children:"Luas (Ha)"}),h.jsx("th",{className:"text-center py-3 px-4 font-medium text-slate-600",children:"Produktivitas"}),h.jsx("th",{className:"text-center py-3 px-4 font-medium text-slate-600",children:"Status"})]})}),h.jsx("tbody",{children:k.map(R=>h.jsxs("tr",{className:"border-b hover:bg-slate-50",children:[h.jsx("td",{className:"py-3 px-4 font-medium",children:R.name}),h.jsx("td",{className:"text-center py-3 px-4",children:R.lands}),h.jsx("td",{className:"text-center py-3 px-4",children:R.area.toFixed(2)}),h.jsx("td",{className:"text-center py-3 px-4",children:h.jsxs("div",{className:"flex items-center justify-center gap-2",children:[h.jsx(YT,{value:R.productivity,className:"w-20 h-2"}),h.jsxs("span",{className:"text-xs font-medium",children:[R.productivity,"%"]})]})}),h.jsx("td",{className:"text-center py-3 px-4",children:h.jsx(ur,{className:R.productivity>80?"bg-emerald-100 text-emerald-700":R.productivity>=60?"bg-green-100 text-green-700":R.productivity>=40?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700",children:R.productivity>80?"Sangat Produktif":R.productivity>=60?"Produktif":R.productivity>=40?"Kurang Produktif":"Tidak Produktif"})})]},R.name))})]})})})]})})]})})}function sOe(){const[e,t]=M.useState(pg()),[n,r]=M.useState(0);M.useEffect(()=>{let a=!0;const o=async()=>{const d=await lOe(),p=await Tr.getPendingCount();a&&(t(d),r(p))};o();const s=()=>o();window.addEventListener("online",s),window.addEventListener("offline",s);const c=setInterval(o,3e3);return()=>{a=!1,window.removeEventListener("online",s),window.removeEventListener("offline",s),clearInterval(c)}},[]);const i=e&&n>0;return h.jsxs("div",{className:fn("flex items-center gap-3 px-4 py-3 rounded-xl transition-colors",!e&&"bg-amber-50",e&&i&&"bg-yellow-50",e&&!i&&"bg-emerald-50"),children:[!e&&h.jsx(Sj,{className:"w-5 h-5 text-amber-600"}),e&&i&&h.jsx(tF,{className:"w-5 h-5 text-yellow-600 animate-spin"}),e&&!i&&h.jsx(Pj,{className:"w-5 h-5 text-emerald-600"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:fn("text-sm font-medium",e?i?"text-yellow-700":"text-emerald-700":"text-amber-700"),children:e?i?"Online (Sinkronisasi...)":"Online":"Offline"}),h.jsx("p",{className:"text-xs truncate opacity-80",children:e?i?`${n} data diproses`:"Data sinkron":"Data disimpan lokal"})]})]})}async function lOe(){if(!navigator.onLine)return!1;try{const e=new AbortController;return setTimeout(()=>e.abort(),3e3),await fetch("https://www.google.com/favicon.ico",{method:"HEAD",mode:"no-cors",cache:"no-store",signal:e.signal}),!0}catch{return!1}}const uOe=[{name:"Dashboard",page:"Dashboard",icon:kN},{name:"Petani",page:"Farmers",icon:ll},{name:"Lahan",page:"Lands",icon:js},{name:"Tanaman",page:"Plants",icon:sa},{name:"Produktivitas",page:"ProductivityMonitoring",icon:kN},{name:"Validator",page:"Validators",icon:gh},{name:"Offtaker",page:"Offtakers",icon:ll},{name:"Portal Petani",page:"FarmerPortal",icon:ll},{name:"Portal Validator",page:"ValidatorPortal",icon:gh},{name:"Portal Offtaker",page:"OfftakerPortal",icon:ll}];function cOe({children:e,currentPageName:t}){const[n,r]=M.useState(!1),i=cd(),a=o=>t===o||i.pathname.includes(o.toLowerCase());return h.jsxs("div",{className:"min-h-screen bg-slate-50",children:[h.jsx("div",{className:"lg:hidden fixed top-0 left-0 right-0 h-16 bg-white border-b border-slate-200 z-50 flex items-center justify-between px-4",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(pt,{variant:"ghost",size:"icon",onClick:()=>r(!0),children:h.jsx(t9,{className:"w-6 h-6"})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-emerald-500 to-emerald-600 flex items-center justify-center",children:h.jsx(sa,{className:"w-5 h-5 text-white"})}),h.jsx("span",{className:"font-bold text-slate-900",children:"AgroMonev"})]})]})}),n&&h.jsx("div",{className:"lg:hidden fixed inset-0 bg-black/50 z-50",onClick:()=>r(!1)}),h.jsxs("aside",{className:fn("fixed top-0 left-0 h-full w-64 bg-white border-r border-slate-200 z-50 transition-transform duration-300","lg:translate-x-0",n?"translate-x-0":"-translate-x-full"),children:[h.jsxs("div",{className:"p-6",children:[h.jsxs("div",{className:"flex items-center justify-between mb-8",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-emerald-500 to-emerald-600 flex items-center justify-center shadow-lg shadow-emerald-500/25",children:h.jsx(sa,{className:"w-6 h-6 text-white"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"font-bold text-slate-900",children:"AgroMonev"}),h.jsx("p",{className:"text-xs text-slate-500",children:"Monitoring Pertanian"})]})]}),h.jsx(pt,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:()=>r(!1),children:h.jsx(rb,{className:"w-5 h-5"})})]}),h.jsx("nav",{className:"space-y-1",children:uOe.map(o=>{const s=a(o.page);return h.jsxs(zo,{to:ei(o.page),onClick:()=>r(!1),className:fn("flex items-center gap-3 px-4 py-3 rounded-xl transition-all duration-200 group",s?"bg-emerald-50 text-emerald-700":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),children:[h.jsx(o.icon,{className:fn("w-5 h-5 transition-colors",s?"text-emerald-600":"text-slate-400 group-hover:text-slate-600")}),h.jsx("span",{className:"font-medium",children:o.name}),s&&h.jsx(tb,{className:"w-4 h-4 ml-auto text-emerald-600"})]},o.page)})})]}),h.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-4 border-t border-slate-100",children:h.jsx(sOe,{})})]}),h.jsx("main",{className:"lg:ml-64 pt-16 lg:pt-0 min-h-screen",children:e})]})}const fOe={Dashboard:hbe,Farmers:u1e,FarmerRegister:w1e,FarmerDetail:O1e,Lands:hSe,LandRegister:gSe,LandDetail:WPe,Plants:Nje,FarmerPortal:Vje,Validators:Tje,ValidatorPortal:Aje,Offtakers:Wje,OfftakerPortal:Hje,ProductivityMonitoring:oOe},Dk={mainPage:"Dashboard",Pages:fOe,Layout:cOe};function dOe(){const e=cd(),{isAuthenticated:t}=PE(),{Pages:n,mainPage:r}=Dk,i=r;return M.useEffect(()=>{const a=e.pathname;let o;if(a==="/"||a==="")o=i;else{const s=a.replace(/^\//,"").split("/")[0];o=Object.keys(n).find(p=>p.toLowerCase()===s.toLowerCase())||null}t&&o&&mt.appLogs.logUserInApp(o).catch(()=>{})},[e,t,n,i]),null}function hOe(){const e=cd(),{isAuthenticated:t}=PE(),{Pages:n,mainPage:r}=Dk,i=r,[a,o]=M.useState(!1);return M.useEffect(()=>{const s=e.pathname;let c;if(s==="/"||s==="")c=i;else{const d=s.replace(/^\//,"").split("/")[0];c=Object.keys(n).find(m=>m.toLowerCase()===d.toLowerCase())??null}t&&c&&(o(!0),mt.appLogs.logUserInApp(c).finally(()=>{setTimeout(()=>o(!1),600)}))},[e.pathname]),a?h.jsx("div",{className:"fixed bottom-4 right-4 z-50 rounded-xl bg-slate-900 text-white px-4 py-2 text-xs shadow-lg",children:"Mencatat aktivitas halaman…"}):null}const pOe=()=>h.jsx("div",{className:"flex flex-col items-center justify-center min-h-screen bg-gradient-to-b from-white to-slate-50",children:h.jsx("div",{className:"max-w-md w-full p-8 bg-white rounded-lg shadow-lg border border-slate-100",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 mb-6 rounded-full bg-orange-100",children:h.jsx("svg",{className:"w-8 h-8 text-orange-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),h.jsx("h1",{className:"text-3xl font-bold text-slate-900 mb-4",children:"Access Restricted"}),h.jsx("p",{className:"text-slate-600 mb-8",children:"You are not registered to use this application. Please contact the app administrator to request access."}),h.jsxs("div",{className:"p-4 bg-slate-50 rounded-md text-sm text-slate-600",children:[h.jsx("p",{children:"If you believe this is an error, you can:"}),h.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[h.jsx("li",{children:"Verify you are logged in with the correct account"}),h.jsx("li",{children:"Contact the app administrator for access"}),h.jsx("li",{children:"Try logging out and back in again"})]})]})]})})}),{Pages:hK,Layout:N$,mainPage:mOe}=Dk,pK=mOe,gOe=hK[pK],M$=({children:e,currentPageName:t})=>N$?h.jsx(N$,{currentPageName:t,children:e}):h.jsx(h.Fragment,{children:e}),vOe=()=>{const{isLoadingAuth:e,isLoadingPublicSettings:t,authError:n,navigateToLogin:r}=PE();if(t||e)return h.jsx("div",{className:"fixed inset-0 flex items-center justify-center",children:h.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-slate-800 rounded-full animate-spin"})});if(n){if(n.type==="user_not_registered")return h.jsx(pOe,{});if(n.type==="auth_required")return r(),null}return h.jsxs(YG,{children:[h.jsx(hy,{path:"/",element:h.jsx(M$,{currentPageName:pK,children:h.jsx(gOe,{})})}),Object.entries(hK).map(([i,a])=>h.jsx(hy,{path:`/${i}`,element:h.jsx(M$,{currentPageName:i,children:h.jsx(a,{})})},i)),h.jsx(hy,{path:"*",element:h.jsx(hOe,{})})]})};function yOe(){return h.jsx(hQ,{children:h.jsxs(W7,{client:rG,children:[h.jsxs(rZ,{children:[h.jsx(dOe,{}),h.jsx(vOe,{})]}),h.jsx(x7,{})]})})}sH.createRoot(document.getElementById("root")).render(h.jsx(yOe,{}));
|