vendor: 4,419 bytes, lines 1-9
1var PY=Object.defineProperty;var BP=e=>{throw TypeError(e)};var TY=(e,t,n)=>t in e?PY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zi=(e,t,n)=>TY(e,typeof t!="symbol"?t+"":t,n),Rw=(e,t,n)=>t.has(e)||BP("Cannot "+n);var K=(e,t,n)=>(Rw(e,t,"read from private field"),n?n.call(e):t.get(e)),Ee=(e,t,n)=>t.has(e)?BP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),be=(e,t,n,r)=>(Rw(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ue=(e,t,n)=>(Rw(e,t,"access private method"),n);var Eg=(e,t,n,r)=>({set _(s){be(e,t,s,n)},get _(){return K(e,t,r)}});function OY(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)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(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Po=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function it(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p3={exports:{}},Ab={},g3={exports:{}},Je={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Vp=Symbol.for("react.element"),RY=Symbol.for("react.portal"),MY=Symbol.for("react.fragment"),IY=Symbol.for("react.strict_mode"),$Y=Symbol.for("react.profiler"),LY=Symbol.for("react.provider"),DY=Symbol.for("react.context"),FY=Symbol.for("react.forward_ref"),BY=Symbol.for("react.suspense"),zY=Symbol.for("react.memo"),UY=Symbol.for("react.lazy"),zP=Symbol.iterator;function VY(e){return e===null||typeof e!="object"?null:(e=zP&&e[zP]||e["@@iterator"],typeof e=="function"?e:null)}var y3={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x3=Object.assign,v3={};function ah(e,t,n){this.props=e,this.context=t,this.refs=v3,this.updater=n||y3}ah.prototype.isReactComponent={};ah.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ah.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function b3(){}b3.prototype=ah.prototype;function pC(e,t,n){this.props=e,this.context=t,this.refs=v3,this.updater=n||y3}var gC=pC.prototype=new b3;gC.constructor=pC;x3(gC,ah.prototype);gC.isPureReactComponent=!0;var UP=Array.isArray,w3=Object.prototype.hasOwnProperty,yC={current:null},j3={key:!0,ref:!0,__self:!0,__source:!0};function S3(e,t,n){var r,s={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)w3.call(t,r)&&!j3.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Vp,type:e,key:a,ref:o,props:s,_owner:yC.current}}function WY(e,t){return{$$typeof:Vp,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function xC(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vp}function HY(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var VP=/\/+/g;function Mw(e,t){return typeof e=="object"&&e!==null&&e.key!=null?HY(""+e.key):t.toString(36)}
vendor: 4,786 bytes, lines 9-17
9function Yy(e,t,n,r,s){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Vp:case RY:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Mw(o,0):r,UP(s)?(n="",e!=null&&(n=e.replace(VP,"$&/")+"/"),Yy(s,t,n,"",function(u){return u})):s!=null&&(xC(s)&&(s=WY(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(VP,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",UP(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+Mw(a,l);o+=Yy(a,t,n,c,s)}else if(c=VY(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+Mw(a,l++),o+=Yy(a,t,n,c,s);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ag(e,t,n){if(e==null)return e;var r=[],s=0;return Yy(e,r,"","",function(a){return t.call(n,a,s++)}),r}function qY(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ur={current:null},Xy={transition:null},KY={ReactCurrentDispatcher:ur,ReactCurrentBatchConfig:Xy,ReactCurrentOwner:yC};function N3(){throw Error("act(...) is not supported in production builds of React.")}Je.Children={map:Ag,forEach:function(e,t,n){Ag(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ag(e,function(){t++}),t},toArray:function(e){return Ag(e,function(t){return t})||[]},only:function(e){if(!xC(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Je.Component=ah;Je.Fragment=MY;Je.Profiler=$Y;Je.PureComponent=pC;Je.StrictMode=IY;Je.Suspense=BY;Je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KY;Je.act=N3;Je.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=x3({},e.props),s=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=yC.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)w3.call(t,c)&&!j3.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Vp,type:e.type,key:s,ref:a,props:r,_owner:o}};Je.createContext=function(e){return e={$$typeof:DY,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:LY,_context:e},e.Consumer=e};Je.createElement=S3;Je.createFactory=function(e){var t=S3.bind(null,e);return t.type=e,t};Je.createRef=function(){return{current:null}};Je.forwardRef=function(e){return{$$typeof:FY,render:e}};Je.isValidElement=xC;Je.lazy=function(e){return{$$typeof:UY,_payload:{_status:-1,_result:e},_init:qY}};Je.memo=function(e,t){return{$$typeof:zY,type:e,compare:t===void 0?null:t}};Je.startTransition=function(e){var t=Xy.transition;Xy.transition={};try{e()}finally{Xy.transition=t}};Je.unstable_act=N3;Je.useCallback=function(e,t){return ur.current.useCallback(e,t)};Je.useContext=function(e){return ur.current.useContext(e)};Je.useDebugValue=function(){};Je.useDeferredValue=function(e){return ur.current.useDeferredValue(e)};Je.useEffect=function(e,t){return ur.current.useEffect(e,t)};Je.useId=function(){return ur.current.useId()};Je.useImperativeHandle=function(e,t,n){return ur.current.useImperativeHandle(e,t,n)};Je.useInsertionEffect=function(e,t){return ur.current.useInsertionEffect(e,t)};Je.useLayoutEffect=function(e,t){return ur.current.useLayoutEffect(e,t)};Je.useMemo=function(e,t){return ur.current.useMemo(e,t)};Je.useReducer=function(e,t,n){return ur.current.useReducer(e,t,n)};Je.useRef=function(e){return ur.current.useRef(e)};Je.useState=function(e){return ur.current.useState(e)};Je.useSyncExternalStore=function(e,t,n){return ur.current.useSyncExternalStore(e,t,n)};Je.useTransition=function(){return ur.current.useTransition()};Je.version="18.3.1";g3.exports=Je;var y=g3.exports;const F=it(y),k3=OY({__proto__:null,default:F},[y]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var GY=y,YY=Symbol.for("react.element"),XY=Symbol.for("react.fragment"),JY=Object.prototype.hasOwnProperty,QY=GY.__SECRET_INT
vendor: 11,389 bytes, lines 17-34
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ZY={key:!0,ref:!0,__self:!0,__source:!0};function _3(e,t,n){var r,s={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)JY.call(t,r)&&!ZY.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:YY,type:e,key:a,ref:o,props:s,_owner:QY.current}}Ab.Fragment=XY;Ab.jsx=_3;Ab.jsxs=_3;p3.exports=Ab;var i=p3.exports,C3={exports:{}},Qr={},E3={exports:{}},A3={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(e){function t(M,H){var T=M.length;M.push(H);e:for(;0<T;){var B=T-1>>>1,Y=M[B];if(0<s(Y,H))M[B]=H,M[T]=Y,T=B;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var H=M[0],T=M.pop();if(T!==H){M[0]=T;e:for(var B=0,Y=M.length,O=Y>>>1;B<O;){var W=2*(B+1)-1,X=M[W],J=W+1,G=M[J];if(0>s(X,T))J<Y&&0>s(G,X)?(M[B]=G,M[J]=T,B=J):(M[B]=X,M[W]=T,B=W);else if(J<Y&&0>s(G,T))M[B]=G,M[J]=T,B=J;else break e}}return H}function s(M,H){var T=M.sortIndex-H.sortIndex;return T!==0?T:M.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,f=3,m=!1,g=!1,p=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var H=n(u);H!==null;){if(H.callback===null)r(u);else if(H.startTime<=M)r(u),H.sortIndex=H.expirationTime,t(c,H);else break;H=n(u)}}function j(M){if(p=!1,w(M),!g)if(n(c)!==null)g=!0,D(S);else{var H=n(u);H!==null&&I(j,H.startTime-M)}}function S(M,H){g=!1,p&&(p=!1,v(_),_=-1),m=!0;var T=f;try{for(w(H),h=n(c);h!==null&&(!(h.expirationTime>H)||M&&!E());){var B=h.callback;if(typeof B=="function"){h.callback=null,f=h.priorityLevel;var Y=B(h.expirationTime<=H);H=e.unstable_now(),typeof Y=="function"?h.callback=Y:h===n(c)&&r(c),w(H)}else r(c);h=n(c)}if(h!==null)var O=!0;else{var W=n(u);W!==null&&I(j,W.startTime-H),O=!1}return O}finally{h=null,f=T,m=!1}}var N=!1,k=null,_=-1,C=5,A=-1;function E(){return!(e.unstable_now()-A<C)}function P(){if(k!==null){var M=e.unstable_now();A=M;var H=!0;try{H=k(!0,M)}finally{H?$():(N=!1,k=null)}}else N=!1}var $;if(typeof b=="function")$=function(){b(P)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,L=R.port2;R.port1.onmessage=P,$=function(){L.postMessage(null)}}else $=function(){x(P,0)};function D(M){k=M,N||(N=!0,$())}function I(M,H){_=x(function(){M(e.unstable_now())},H)}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(M){M.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,D(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(M){switch(f){case 1:case 2:case 3:var H=3;break;default:H=f}var T=f;f=H;try{return M()}finally{f=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,H){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var T=f;f=M;try{return H()}finally{f=T}},e.unstable_scheduleCallback=function(M,H,T){var B=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?B+T:B):T=B,M){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=T+Y,M={id:d++,callback:H,priorityLevel:M,startTime:T,expirationTime:Y,sortIndex:-1},T>B?(M.sortIndex=T,t(u,M),n(c)===null&&M===n(u)&&(p?(v(_),_=-1):p=!0,I(j,T-B))):(M.sortIndex=Y,t(c,M),g||m||(g=!0,D(S))),M},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(M){var H=f;return function(){var T=f;f=H;try{return M.apply(this,arguments)}finally{f=T}}}})(A3);E3.exports=A3;var eX=E3.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var tX=y,Yr=eX;function ue(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var P3=new Set,fm={};function Ic(e,t){bd(e,t),bd(e+"Capture",t)}function bd(e,t){for(fm[e]=t,e=0;e<t.length;e++)P3.add(t[e])}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),X1=Object.prototype.hasOwnProperty,nX=/^[: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]*$/,WP={},HP={};function rX(e){return X1.call(HP,e)?!0:X1.call(WP,e)?!1:nX.test(e)?HP[e]=!0:(WP[e]=!0,!1)}function sX(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function iX(e,t,n,r){if(t===null||typeof t>"u"||sX(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function dr(e,t,n,r,s,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var zn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){zn[e]=new dr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];zn[t]=new dr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){zn[e]=new dr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){zn[e]=new dr(e,2,!1,e,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(e){zn[e]=new dr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){zn[e]=new dr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){zn[e]=new dr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){zn[e]=new dr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){zn[e]=new dr(e,5,!1,e.toLowerCase(),null,!1,!1)});var vC=/[\-:]([a-z])/g;function bC(e){return e[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(e){var t=e.replace(vC,bC);zn[t]=new dr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vC,bC);zn[t]=new dr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vC,bC);zn[t]=new dr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){zn[e]=new dr(e,1,!1,e.toLowerCase(),null,!1,!1)});zn.xlinkHref=new dr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){zn[e]=new dr(e,1,!1,e.toLowerCase(),null,!0,!0)});function wC(e,t,n,r){var s=zn.hasOwnProperty(t)?zn[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(iX(t,n,s,r)&&(n=null),r||s===null?rX(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var za=tX.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pg=Symbol.for("react.element"),vu=Symbol.for("react.portal"),bu=Symbol.for("react.fragment"),jC=Symbol.for("react.strict_mode"),J1=Symbol.for("react.profiler"),T3=Symbol.for("react.provider"),O3=Symbol.for("react.context"),SC=Symbol.for("react.forward_ref"),Q1=Symbol.for("react.suspense"),Z1=Symbol.for("react.suspense_list"),NC=Symbol.for("react.memo"),lo=Symbol.for("react.lazy"),R3=Symbol.for("react.offscreen"),qP=Symbol.iterator;function Vh(e){return e===null||typeof e!="object"?null:(e=qP&&e[qP]||e["@@iterator"],typeof e=="function"?e:null)}var Gt=Object.assign,Iw;function wf(e){if(Iw===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Iw=t&&t[1]||""}return` 34`+Iw+e}var $w=!1;function Lw(e,t){if(!e||$w)return"";$w=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}
vendor: 5,499 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(` 35`),a=r.stack.split(` 36`),o=s.length-1,l=a.length-1;1<=o&&0<=l&&s[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==a[l]){var c=` 37`+s[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{$w=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wf(e):""}function aX(e){switch(e.tag){case 5:return wf(e.type);case 16:return wf("Lazy");case 13:return wf("Suspense");case 19:return wf("SuspenseList");case 0:case 2:case 15:return e=Lw(e.type,!1),e;case 11:return e=Lw(e.type.render,!1),e;case 1:return e=Lw(e.type,!0),e;default:return""}}function eS(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case bu:return"Fragment";case vu:return"Portal";case J1:return"Profiler";case jC:return"StrictMode";case Q1:return"Suspense";case Z1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O3:return(e.displayName||"Context")+".Consumer";case T3:return(e._context.displayName||"Context")+".Provider";case SC:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case NC:return t=e.displayName||null,t!==null?t:eS(e.type)||"Memo";case lo:t=e._payload,e=e._init;try{return eS(e(t))}catch{}}return null}function oX(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return eS(t);case 8:return t===jC?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Xo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function M3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lX(e){var t=M3(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tg(e){e._valueTracker||(e._valueTracker=lX(e))}function I3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=M3(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function _x(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tS(e,t){var n=t.checked;return Gt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function KP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Xo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $3(e,t){t=t.checked,t!=null&&wC(e,"checked",t,!1)}function nS(e,t){$3(e,t);var n=Xo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?rS(e,t.type,n):t.hasOwnProperty("defaultValue")&&rS(e,t.type,Xo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function GP(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function rS(e,t,n){(t!=="number"||_x(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jf=Array.isArray;function Fu(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Xo(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function sS(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ue(91));return Gt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function YP(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ue(92));
vendor: 10,114 bytes, line 37
37if(jf(n)){if(1<n.length)throw Error(ue(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Xo(n)}}function L3(e,t){var n=Xo(t.value),r=Xo(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function XP(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function D3(e){switch(e){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 iS(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?D3(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Og,F3=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Og=Og||document.createElement("div"),Og.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Og.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mm(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mf={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},cX=["Webkit","ms","Moz","O"];Object.keys(Mf).forEach(function(e){cX.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mf[t]=Mf[e]})});function B3(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mf.hasOwnProperty(e)&&Mf[e]?(""+t).trim():t+"px"}function z3(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=B3(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var uX=Gt({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 aS(e,t){if(t){if(uX[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ue(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ue(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ue(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ue(62))}}function oS(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 lS=null;function kC(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cS=null,Bu=null,zu=null;function JP(e){if(e=qp(e)){if(typeof cS!="function")throw Error(ue(280));var t=e.stateNode;t&&(t=Mb(t),cS(e.stateNode,e.type,t))}}function U3(e){Bu?zu?zu.push(e):zu=[e]:Bu=e}function V3(){if(Bu){var e=Bu,t=zu;if(zu=Bu=null,JP(e),t)for(e=0;e<t.length;e++)JP(t[e])}}function W3(e,t){return e(t)}function H3(){}var Dw=!1;function q3(e,t,n){if(Dw)return e(t,n);Dw=!0;try{return W3(e,t,n)}finally{Dw=!1,(Bu!==null||zu!==null)&&(H3(),V3())}}function pm(e,t){var n=e.stateNode;if(n===null)return null;var r=Mb(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ue(231,t,typeof n));return n}var uS=!1;if(Ca)try{var Wh={};Object.defineProperty(Wh,"passive",{get:function(){uS=!0}}),window.addEventListener("test",Wh,Wh),window.removeEventListener("test",Wh,Wh)}catch{uS=!1}function dX(e,t,n,r,s,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var If=!1,Cx=null,Ex=!1,dS=null,hX={onError:function(e){If=!0,Cx=e}};function fX(e,t,n,r,s,a,o,l,c){If=!1,Cx=null,dX.apply(hX,arguments)}function mX(e,t,n,r,s,a,o,l,c){if(fX.apply(this,arguments),If){if(If){var u=Cx;If=!1,Cx=null}else throw Error(ue(198));Ex||(Ex=!0,dS=u)}}function $c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function K3(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function QP(e){if($c(e)!==e)throw Error(ue(188))}function pX(e){var t=e.alternate;if(!t){if(t=$c(e),t===null)throw Error(ue(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var a=s.alternate;if(a===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===n)return QP(s),e;if(a===r)return QP(s),t;a=a.sibling}throw Error(ue(188))}if(n.return!==r.return)n=s,r=a;else{for(var o=!1,l=s.child;l;){if(l===n){o=!0,n=s,r=a;break}if(l===r){o=!0,r=s,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,r=s;break}if(l===r){o=!0,r=a,n=s;break}l=l.sibling}if(!o)throw Error(ue(189))}}if(n.alternate!==r)throw Error(ue(190))}if(n.tag!==3)throw Error(ue(188));return n.stateNode.current===n?e:t}function G3(e){return e=pX(e),e!==null?Y3(e):null}function Y3(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Y3(e);if(t!==null)return t;e=e.sibling}return null}var X3=Yr.unstable_scheduleCallback,ZP=Yr.unstable_cancelCallback,gX=Yr.unstable_shouldYield,yX=Yr.unstable_requestPaint,en=Yr.unstable_now,xX=Yr.unstable_getCurrentPriorityLevel,_C=Yr.unstable_ImmediatePriority,J3=Yr.unstable_UserBlockingPriority,Ax=Yr.unstable_NormalPriority,vX=Yr.unstable_LowPriority,Q3=Yr.unstable_IdlePriority,Pb=null,Ri=null;function bX(e){if(Ri&&typeof Ri.onCommitFiberRoot=="function")try{Ri.onCommitFiberRoot(Pb,e,void 0,(e.current.flags&128)===128)}catch{}}var Xs=Math.clz32?Math.clz32:SX,wX=Math.log,jX=Math.LN2;function SX(e){return e>>>=0,e===0?32:31-(wX(e)/jX|0)|0}var Rg=64,Mg=4194304;function Sf(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Px(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=Sf(l):(a&=o,a!==0&&(r=Sf(a)))}else o=n&~s,o!==0?r=Sf(o):a!==0&&(r=Sf(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Xs(t),s=1<<n,r|=e[n],t&=~s;return r}function NX(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 kX(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Xs(a),l=1<<o,c=s[o];c===-1?(!(l&n)||l&r)&&(s[o]=NX(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function hS(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Z3(){var e=Rg;return Rg<<=1,!(Rg&4194240)&&(Rg=64),e}function Fw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Wp(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xs(t),e[t]=n}function _X(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Xs(n),a=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~a}}function CC(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Xs(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var gt=0;function eF(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var tF,EC,nF,rF,sF,fS=!1,Ig=[],Lo=null,Do=null,Fo=null,gm=new Map,ym=new Map,ho=[],CX="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 eT(e,t){switch(e){case"focusin":case"focusout":Lo=null;break;case"dragenter":case"dragleave":Do=null;break;case"mouseover":case"mouseout":Fo=null;break;case"pointerover":case"pointerout":gm.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ym.delete(t.pointerId)}}function Hh(e,t,n,r,s,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[s]},t!==null&&(t=qp(t),t!==null&&EC(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}
vendor: 12,981 bytes, line 37
37function EX(e,t,n,r,s){switch(t){case"focusin":return Lo=Hh(Lo,e,t,n,r,s),!0;case"dragenter":return Do=Hh(Do,e,t,n,r,s),!0;case"mouseover":return Fo=Hh(Fo,e,t,n,r,s),!0;case"pointerover":var a=s.pointerId;return gm.set(a,Hh(gm.get(a)||null,e,t,n,r,s)),!0;case"gotpointercapture":return a=s.pointerId,ym.set(a,Hh(ym.get(a)||null,e,t,n,r,s)),!0}return!1}function iF(e){var t=Bl(e.target);if(t!==null){var n=$c(t);if(n!==null){if(t=n.tag,t===13){if(t=K3(n),t!==null){e.blockedOn=t,sF(e.priority,function(){nF(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Jy(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=mS(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);lS=r,n.target.dispatchEvent(r),lS=null}else return t=qp(n),t!==null&&EC(t),e.blockedOn=n,!1;t.shift()}return!0}function tT(e,t,n){Jy(e)&&n.delete(t)}function AX(){fS=!1,Lo!==null&&Jy(Lo)&&(Lo=null),Do!==null&&Jy(Do)&&(Do=null),Fo!==null&&Jy(Fo)&&(Fo=null),gm.forEach(tT),ym.forEach(tT)}function qh(e,t){e.blockedOn===t&&(e.blockedOn=null,fS||(fS=!0,Yr.unstable_scheduleCallback(Yr.unstable_NormalPriority,AX)))}function xm(e){function t(s){return qh(s,e)}if(0<Ig.length){qh(Ig[0],e);for(var n=1;n<Ig.length;n++){var r=Ig[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Lo!==null&&qh(Lo,e),Do!==null&&qh(Do,e),Fo!==null&&qh(Fo,e),gm.forEach(t),ym.forEach(t),n=0;n<ho.length;n++)r=ho[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ho.length&&(n=ho[0],n.blockedOn===null);)iF(n),n.blockedOn===null&&ho.shift()}var Uu=za.ReactCurrentBatchConfig,Tx=!0;function PX(e,t,n,r){var s=gt,a=Uu.transition;Uu.transition=null;try{gt=1,AC(e,t,n,r)}finally{gt=s,Uu.transition=a}}function TX(e,t,n,r){var s=gt,a=Uu.transition;Uu.transition=null;try{gt=4,AC(e,t,n,r)}finally{gt=s,Uu.transition=a}}function AC(e,t,n,r){if(Tx){var s=mS(e,t,n,r);if(s===null)Yw(e,t,r,Ox,n),eT(e,r);else if(EX(s,e,t,n,r))r.stopPropagation();else if(eT(e,r),t&4&&-1<CX.indexOf(e)){for(;s!==null;){var a=qp(s);if(a!==null&&tF(a),a=mS(e,t,n,r),a===null&&Yw(e,t,r,Ox,n),a===s)break;s=a}s!==null&&r.stopPropagation()}else Yw(e,t,r,null,n)}}var Ox=null;function mS(e,t,n,r){if(Ox=null,e=kC(r),e=Bl(e),e!==null)if(t=$c(e),t===null)e=null;else if(n=t.tag,n===13){if(e=K3(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ox=e,null}function aF(e){switch(e){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(xX()){case _C:return 1;case J3:return 4;case Ax:case vX:return 16;case Q3:return 536870912;default:return 16}default:return 16}}var To=null,PC=null,Qy=null;function oF(){if(Qy)return Qy;var e,t=PC,n=t.length,r,s="value"in To?To.value:To.textContent,a=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[a-r];r++);return Qy=s.slice(e,1<r?1-r:void 0)}function Zy(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $g(){return!0}function nT(){return!1}function Zr(e){function t(n,r,s,a,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?$g:nT,this.isPropagationStopped=nT,this}return Gt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=$g)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$g)},persist:function(){},isPersistent:$g}),t}var oh={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},TC=Zr(oh),Hp=Gt({},oh,{view:0,detail:0}),OX=Zr(Hp),Bw,zw,Kh,Tb=Gt({},Hp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:OC,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Kh&&(Kh&&e.type==="mousemove"?(Bw=e.screenX-Kh.screenX,zw=e.screenY-Kh.screenY):zw=Bw=0,Kh=e),Bw)},movementY:function(e){return"movementY"in e?e.movementY:zw}}),rT=Zr(Tb),RX=Gt({},Tb,{dataTransfer:0}),MX=Zr(RX),IX=Gt({},Hp,{relatedTarget:0}),Uw=Zr(IX),$X=Gt({},oh,{animationName:0,elapsedTime:0,pseudoElement:0}),LX=Zr($X),DX=Gt({},oh,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),FX=Zr(DX),BX=Gt({},oh,{data:0}),sT=Zr(BX),zX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UX={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"},VX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function WX(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=VX[e])?!!t[e]:!1}function OC(){return WX}var HX=Gt({},Hp,{key:function(e){if(e.key){var t=zX[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zy(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?UX[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:OC,charCode:function(e){return e.type==="keypress"?Zy(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zy(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qX=Zr(HX),KX=Gt({},Tb,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iT=Zr(KX),GX=Gt({},Hp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:OC}),YX=Zr(GX),XX=Gt({},oh,{propertyName:0,elapsedTime:0,pseudoElement:0}),JX=Zr(XX),QX=Gt({},Tb,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ZX=Zr(QX),eJ=[9,13,27,32],RC=Ca&&"CompositionEvent"in window,$f=null;Ca&&"documentMode"in document&&($f=document.documentMode);var tJ=Ca&&"TextEvent"in window&&!$f,lF=Ca&&(!RC||$f&&8<$f&&11>=$f),aT=" ",oT=!1;function cF(e,t){switch(e){case"keyup":return eJ.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uF(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wu=!1;function nJ(e,t){switch(e){case"compositionend":return uF(t);case"keypress":return t.which!==32?null:(oT=!0,aT);case"textInput":return e=t.data,e===aT&&oT?null:e;default:return null}}function rJ(e,t){if(wu)return e==="compositionend"||!RC&&cF(e,t)?(e=oF(),Qy=PC=To=null,wu=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return lF&&t.locale!=="ko"?null:t.data;default:return null}}var sJ={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 lT(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!sJ[e.type]:t==="textarea"}function dF(e,t,n,r){U3(r),t=Rx(t,"onChange"),0<t.length&&(n=new TC("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Lf=null,vm=null;function iJ(e){jF(e,0)}function Ob(e){var t=Nu(e);if(I3(t))return e}function aJ(e,t){if(e==="change")return t}var hF=!1;if(Ca){var Vw;if(Ca){var Ww="oninput"in document;if(!Ww){var cT=document.createElement("div");cT.setAttribute("oninput","return;"),Ww=typeof cT.oninput=="function"}Vw=Ww}else Vw=!1;hF=Vw&&(!document.documentMode||9<document.documentMode)}function uT(){Lf&&(Lf.detachEvent("onpropertychange",fF),vm=Lf=null)}function fF(e){if(e.propertyName==="value"&&Ob(vm)){var t=[];dF(t,vm,e,kC(e)),q3(iJ,t)}}function oJ(e,t,n){e==="focusin"?(uT(),Lf=t,vm=n,Lf.attachEvent("onpropertychange",fF)):e==="focusout"&&uT()}function lJ(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ob(vm)}function cJ(e,t){if(e==="click")return Ob(t)}function uJ(e,t){if(e==="input"||e==="change")return Ob(t)}function dJ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ti=typeof Object.is=="function"?Object.is:dJ;function bm(e,t){if(ti(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!X1.call(t,s)||!ti(e[s],t[s]))return!1}return!0}function dT(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hT(e,t){var n=dT(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dT(n)}}function mF(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mF(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pF(){for(var e=window,t=_x();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_x(e.document)}return t}function MC(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function hJ(e){var t=pF(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mF(n.ownerDocument.documentElement,n)){if(r!==null&&MC(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,a=Math.min(r.start,s);r=r.end===void 0?a:Math.min(r.end,s),!e.extend&&a>r&&(s=r,r=a,a=s),s=hT(n,a);var o=hT(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var fJ=Ca&&"documentMode"in document&&11>=document.documentMode,ju=null,pS=null,Df=null,gS=!1;function fT(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gS||ju==null||ju!==_x(r)||(r=ju,"selectionStart"in r&&MC(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,101 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),Df&&bm(Df,r)||(Df=r,r=Rx(pS,"onSelect"),0<r.length&&(t=new TC("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ju)))}function Lg(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Su={animationend:Lg("Animation","AnimationEnd"),animationiteration:Lg("Animation","AnimationIteration"),animationstart:Lg("Animation","AnimationStart"),transitionend:Lg("Transition","TransitionEnd")},Hw={},gF={};Ca&&(gF=document.createElement("div").style,"AnimationEvent"in window||(delete Su.animationend.animation,delete Su.animationiteration.animation,delete Su.animationstart.animation),"TransitionEvent"in window||delete Su.transitionend.transition);function Rb(e){if(Hw[e])return Hw[e];if(!Su[e])return e;var t=Su[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in gF)return Hw[e]=t[n];return e}var yF=Rb("animationend"),xF=Rb("animationiteration"),vF=Rb("animationstart"),bF=Rb("transitionend"),wF=new Map,mT="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 sl(e,t){wF.set(e,t),Ic(t,[e])}for(var qw=0;qw<mT.length;qw++){var Kw=mT[qw],mJ=Kw.toLowerCase(),pJ=Kw[0].toUpperCase()+Kw.slice(1);sl(mJ,"on"+pJ)}sl(yF,"onAnimationEnd");sl(xF,"onAnimationIteration");sl(vF,"onAnimationStart");sl("dblclick","onDoubleClick");sl("focusin","onFocus");sl("focusout","onBlur");sl(bF,"onTransitionEnd");bd("onMouseEnter",["mouseout","mouseover"]);bd("onMouseLeave",["mouseout","mouseover"]);bd("onPointerEnter",["pointerout","pointerover"]);bd("onPointerLeave",["pointerout","pointerover"]);Ic("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ic("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ic("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ic("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ic("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ic("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nf="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(" "),gJ=new Set("cancel close invalid load scroll toggle".split(" ").concat(Nf));function pT(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,mX(r,t,void 0,e),e.currentTarget=null}function jF(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&s.isPropagationStopped())break e;pT(s,l,u),a=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&s.isPropagationStopped())break e;pT(s,l,u),a=c}}}if(Ex)throw e=dS,Ex=!1,dS=null,e}function $t(e,t){var n=t[wS];n===void 0&&(n=t[wS]=new Set);var r=e+"__bubble";n.has(r)||(SF(t,e,2,!1),n.add(r))}function Gw(e,t,n){var r=0;t&&(r|=4),SF(n,e,r,t)}var Dg="_reactListening"+Math.random().toString(36).slice(2);function wm(e){if(!e[Dg]){e[Dg]=!0,P3.forEach(function(n){n!=="selectionchange"&&(gJ.has(n)||Gw(n,!1,e),Gw(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dg]||(t[Dg]=!0,Gw("selectionchange",!1,t))}}function SF(e,t,n,r){switch(aF(t)){case 1:var s=PX;break;case 4:s=TX;break;default:s=AC}
vendor: 4,705 bytes, line 37
37n=s.bind(null,t,n,e),s=void 0,!uS||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Yw(e,t,n,r,s){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=Bl(l),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue e}l=l.parentNode}}r=r.return}q3(function(){var u=a,d=kC(n),h=[];e:{var f=wF.get(e);if(f!==void 0){var m=TC,g=e;switch(e){case"keypress":if(Zy(n)===0)break e;case"keydown":case"keyup":m=qX;break;case"focusin":g="focus",m=Uw;break;case"focusout":g="blur",m=Uw;break;case"beforeblur":case"afterblur":m=Uw;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=rT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=MX;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=YX;break;case yF:case xF:case vF:m=LX;break;case bF:m=JX;break;case"scroll":m=OX;break;case"wheel":m=ZX;break;case"copy":case"cut":case"paste":m=FX;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=iT}var p=(t&4)!==0,x=!p&&e==="scroll",v=p?f!==null?f+"Capture":null:f;p=[];for(var b=u,w;b!==null;){w=b;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,v!==null&&(j=pm(b,v),j!=null&&p.push(jm(b,j,w)))),x)break;b=b.return}0<p.length&&(f=new m(f,g,null,n,d),h.push({event:f,listeners:p}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==lS&&(g=n.relatedTarget||n.fromElement)&&(Bl(g)||g[Ea]))break e;if((m||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Bl(g):null,g!==null&&(x=$c(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(p=rT,j="onMouseLeave",v="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(p=iT,j="onPointerLeave",v="onPointerEnter",b="pointer"),x=m==null?f:Nu(m),w=g==null?f:Nu(g),f=new p(j,b+"leave",m,n,d),f.target=x,f.relatedTarget=w,j=null,Bl(d)===u&&(p=new p(v,b+"enter",g,n,d),p.target=w,p.relatedTarget=x,j=p),x=j,m&&g)t:{for(p=m,v=g,b=0,w=p;w;w=Vc(w))b++;for(w=0,j=v;j;j=Vc(j))w++;for(;0<b-w;)p=Vc(p),b--;for(;0<w-b;)v=Vc(v),w--;for(;b--;){if(p===v||v!==null&&p===v.alternate)break t;p=Vc(p),v=Vc(v)}p=null}else p=null;m!==null&&gT(h,f,m,p,!1),g!==null&&x!==null&&gT(h,x,g,p,!0)}}e:{if(f=u?Nu(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var S=aJ;else if(lT(f))if(hF)S=uJ;else{S=lJ;var N=oJ}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=cJ);if(S&&(S=S(e,u))){dF(h,S,n,d);break e}N&&N(e,f,u),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&rS(f,"number",f.value)}switch(N=u?Nu(u):window,e){case"focusin":(lT(N)||N.contentEditable==="true")&&(ju=N,pS=u,Df=null);break;case"focusout":Df=pS=ju=null;break;case"mousedown":gS=!0;break;case"contextmenu":case"mouseup":case"dragend":gS=!1,fT(h,n,d);break;case"selectionchange":if(fJ)break;case"keydown":case"keyup":fT(h,n,d)}var k;if(RC)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else wu?cF(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(lF&&n.locale!=="ko"&&(wu||_!=="onCompositionStart"?_==="onCompositionEnd"&&wu&&(k=oF()):(To=d,PC="value"in To?To.value:To.textContent,wu=!0)),N=Rx(u,_),0<N.length&&(_=new sT(_,e,null,n,d),h.push({event:_,listeners:N}),k?_.data=k:(k=uF(n),k!==null&&(_.data=k)))),(k=tJ?nJ(e,n):rJ(e,n))&&(u=Rx(u,"onBeforeInput"),0<u.length&&(d=new sT("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=k))}jF(h,t)})}function jm(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rx(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,a=s.stateNode;s.tag===5&&a!==null&&(s=a,a=pm(e,n),a!=null&&r.unshift(jm(e,a,s)),a=pm(e,t),a!=null&&r.push(jm(e,a,s))),e=e.return}return r}function Vc(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}
vendor: 4,599 bytes, lines 37-38
37function gT(e,t,n,r,s){for(var a=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,s?(c=pm(n,a),c!=null&&o.unshift(jm(n,c,l))):s||(c=pm(n,a),c!=null&&o.push(jm(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var yJ=/\r\n?/g,xJ=/\u0000|\uFFFD/g;function yT(e){return(typeof e=="string"?e:""+e).replace(yJ,` 38`).replace(xJ,"")}function Fg(e,t,n){if(t=yT(t),yT(e)!==t&&n)throw Error(ue(425))}function Mx(){}var yS=null,xS=null;function vS(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bS=typeof setTimeout=="function"?setTimeout:void 0,vJ=typeof clearTimeout=="function"?clearTimeout:void 0,xT=typeof Promise=="function"?Promise:void 0,bJ=typeof queueMicrotask=="function"?queueMicrotask:typeof xT<"u"?function(e){return xT.resolve(null).then(e).catch(wJ)}:bS;function wJ(e){setTimeout(function(){throw e})}function Xw(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),xm(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);xm(t)}function Bo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function vT(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var lh=Math.random().toString(36).slice(2),_i="__reactFiber$"+lh,Sm="__reactProps$"+lh,Ea="__reactContainer$"+lh,wS="__reactEvents$"+lh,jJ="__reactListeners$"+lh,SJ="__reactHandles$"+lh;function Bl(e){var t=e[_i];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ea]||n[_i]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vT(e);e!==null;){if(n=e[_i])return n;e=vT(e)}return t}e=n,n=e.parentNode}return null}function qp(e){return e=e[_i]||e[Ea],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Nu(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ue(33))}function Mb(e){return e[Sm]||null}var jS=[],ku=-1;function il(e){return{current:e}}function Bt(e){0>ku||(e.current=jS[ku],jS[ku]=null,ku--)}function At(e,t){ku++,jS[ku]=e.current,e.current=t}var Jo={},Xn=il(Jo),br=il(!1),yc=Jo;function wd(e,t){var n=e.type.contextTypes;if(!n)return Jo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in n)s[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function wr(e){return e=e.childContextTypes,e!=null}function Ix(){Bt(br),Bt(Xn)}function bT(e,t,n){if(Xn.current!==Jo)throw Error(ue(168));At(Xn,t),At(br,n)}function NF(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(ue(108,oX(e)||"Unknown",s));return Gt({},n,r)}function $x(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jo,yc=Xn.current,At(Xn,e),At(br,br.current),!0}function wT(e,t,n){var r=e.stateNode;if(!r)throw Error(ue(169));n?(e=NF(e,t,yc),r.__reactInternalMemoizedMergedChildContext=e,Bt(br),Bt(Xn),At(Xn,e)):Bt(br),At(br,n)}var la=null,Ib=!1,Jw=!1;function kF(e){la===null?la=[e]:la.push(e)}function NJ(e){Ib=!0,kF(e)}function al(){if(!Jw&&la!==null){Jw=!0;var e=0,t=gt;try{var n=la;for(gt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}la=null,Ib=!1}catch(s){throw la!==null&&(la=la.slice(e+1)),X3(_C,al),s}finally{gt=t,Jw=!1}}return null}var _u=[],Cu=0,Lx=null,Dx=0,hs=[],fs=0,xc=null,ua=1,da="";function Ol(e,t){_u[Cu++]=Dx,_u[Cu++]=Lx,Lx=e,Dx=t}function _F(e,t,n){hs[fs++]=ua,hs[fs++]=da,hs[fs++]=xc,xc=e;var r=ua;e=da;var s=32-Xs(r)-1;r&=~(1<<s),n+=1;var a=32-Xs(t)+s;if(30<a){var o=s-s%5;a=(r&(1<<o)-1).toString(32),r>>=o,s-=o,ua=1<<32-Xs(t)+s|n<<s|r,da=a+e}else ua=1<<a|n<<s|r,da=e}function IC(e){e.return!==null&&(Ol(e,1),_F(e,1,0))}function $C(e){for(;e===Lx;)Lx=_u[--Cu],_u[Cu]=null,Dx=_u[--Cu],_u[Cu]=null;for(;e===xc;)xc=hs[--fs],hs[fs]=null,da=hs[--fs],hs[fs]=null,ua=hs[--fs],hs[fs]=null}var Hr=null,Vr=null,Ut=!1,Vs=null;function CF(e,t){var n=gs(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function jT(e,t){switch(e.tag){case 5:var n=e.type;
vendor: 8,978 bytes, line 38
38return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Hr=e,Vr=Bo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Hr=e,Vr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=xc!==null?{id:ua,overflow:da}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gs(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Hr=e,Vr=null,!0):!1;default:return!1}}function SS(e){return(e.mode&1)!==0&&(e.flags&128)===0}function NS(e){if(Ut){var t=Vr;if(t){var n=t;if(!jT(e,t)){if(SS(e))throw Error(ue(418));t=Bo(n.nextSibling);var r=Hr;t&&jT(e,t)?CF(r,n):(e.flags=e.flags&-4097|2,Ut=!1,Hr=e)}}else{if(SS(e))throw Error(ue(418));e.flags=e.flags&-4097|2,Ut=!1,Hr=e}}}function ST(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Hr=e}function Bg(e){if(e!==Hr)return!1;if(!Ut)return ST(e),Ut=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!vS(e.type,e.memoizedProps)),t&&(t=Vr)){if(SS(e))throw EF(),Error(ue(418));for(;t;)CF(e,t),t=Bo(t.nextSibling)}if(ST(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ue(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Vr=Bo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Vr=null}}else Vr=Hr?Bo(e.stateNode.nextSibling):null;return!0}function EF(){for(var e=Vr;e;)e=Bo(e.nextSibling)}function jd(){Vr=Hr=null,Ut=!1}function LC(e){Vs===null?Vs=[e]:Vs.push(e)}var kJ=za.ReactCurrentBatchConfig;function Gh(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ue(309));var r=n.stateNode}if(!r)throw Error(ue(147,e));var s=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=s.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(ue(284));if(!n._owner)throw Error(ue(290,e))}return e}function zg(e,t){throw e=Object.prototype.toString.call(t),Error(ue(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function NT(e){var t=e._init;return t(e._payload)}function AF(e){function t(v,b){if(e){var w=v.deletions;w===null?(v.deletions=[b],v.flags|=16):w.push(b)}}function n(v,b){if(!e)return null;for(;b!==null;)t(v,b),b=b.sibling;return null}function r(v,b){for(v=new Map;b!==null;)b.key!==null?v.set(b.key,b):v.set(b.index,b),b=b.sibling;return v}function s(v,b){return v=Wo(v,b),v.index=0,v.sibling=null,v}function a(v,b,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<b?(v.flags|=2,b):w):(v.flags|=2,b)):(v.flags|=1048576,b)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,b,w,j){return b===null||b.tag!==6?(b=sj(w,v.mode,j),b.return=v,b):(b=s(b,w),b.return=v,b)}function c(v,b,w,j){var S=w.type;return S===bu?d(v,b,w.props.children,j,w.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===lo&&NT(S)===b.type)?(j=s(b,w.props),j.ref=Gh(v,b,w),j.return=v,j):(j=ax(w.type,w.key,w.props,null,v.mode,j),j.ref=Gh(v,b,w),j.return=v,j)}function u(v,b,w,j){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=ij(w,v.mode,j),b.return=v,b):(b=s(b,w.children||[]),b.return=v,b)}function d(v,b,w,j,S){return b===null||b.tag!==7?(b=lc(w,v.mode,j,S),b.return=v,b):(b=s(b,w),b.return=v,b)}function h(v,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=sj(""+b,v.mode,w),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Pg:return w=ax(b.type,b.key,b.props,null,v.mode,w),w.ref=Gh(v,null,b),w.return=v,w;case vu:return b=ij(b,v.mode,w),b.return=v,b;case lo:var j=b._init;return h(v,j(b._payload),w)}if(jf(b)||Vh(b))return b=lc(b,v.mode,w,null),b.return=v,b;zg(v,b)}return null}function f(v,b,w,j){var S=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:l(v,b,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Pg:return w.key===S?c(v,b,w,j):null;case vu:return w.key===S?u(v,b,w,j):null;case lo:return S=w._init,f(v,b,S(w._payload),j)}if(jf(w)||Vh(w))return S!==null?null:d(v,b,w,j,null);zg(v,w)}return null}function m(v,b,w,j,S){if(typeof j=="string"&&j!==""||typeof j=="number")return v=v.get(w)||null,l(b,v,""+j,S);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Pg:return v=v.get(j.key===null?w:j.key)||null,c(b,v,j,S);case vu:return v=v.get(j.key===null?w:j.key)||null,u(b,v,j,S);case lo:var N=j._init;return m(v,b,w,N(j._payload),S)}if(jf(j)||Vh(j))return v=v.get(w)||null,d(b,v,j,S,null);zg(b,j)}return null}function g(v,b,w,j){for(var S=null,N=null,k=b,_=b=0,C=null;k!==null&&_<w.length;_++){k.index>_?(C=k,k=null):C=k.sibling;var A=f(v,k,w[_],j);if(A===null){k===null&&(k=C);break}e&&k&&A.alternate===null&&t(v,k),b=a(A,b,_),N===null?S=A:N.sibling=A,N=A,k=C}if(_===w.length)return n(v,k),Ut&&Ol(v,_),S;if(k===null){for(;_<w.length;_++)k=h(v,w[_],j),k!==null&&(b=a(k,b,_),N===null?S=k:N.sibling=k,N=k);return Ut&&Ol(v,_),S}for(k=r(v,k);_<w.length;_++)C=m(k,v,_,w[_],j),C!==null&&(e&&C.alternate!==null&&k.delete(C.key===null?_:C.key),b=a(C,b,_),N===null?S=C:N.sibling=C,N=C);return e&&k.forEach(function(E){return t(v,E)}),Ut&&Ol(v,_),S}function p(v,b,w,j){var S=Vh(w);if(typeof S!="function")throw Error(ue(150));if(w=S.call(w),w==null)throw Error(ue(151));for(var N=S=null,k=b,_=b=0,C=null,A=w.next();k!==null&&!A.done;_++,A=w.next()){k.index>_?(C=k,k=null):C=k.sibling;var E=f(v,k,A.value,j);if(E===null){k===null&&(k=C);break}e&&k&&E.alternate===null&&t(v,k),b=a(E,b,_),N===null?S=E:N.sibling=E,N=E,k=C}if(A.done)return n(v,k),Ut&&Ol(v,_),S;if(k===null){for(;!A.done;_++,A=w.next())A=h(v,A.value,j),A!==null&&(b=a(A,b,_),N===null?S=A:N.sibling=A,N=A);return Ut&&Ol(v,_),S}for(k=r(v,k);!A.done;_++,A=w.next())A=m(k,v,_,A.value,j),A!==null&&(e&&A.alternate!==null&&k.delete(A.key===null?_:A.key),b=a(A,b,_),N===null?S=A:N.sibling=A,N=A);return e&&k.forEach(function(P){return t(v,P)}),Ut&&Ol(v,_),S}function x(v,b,w,j){if(typeof w=="object"&&w!==null&&w.type===bu&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Pg:e:{for(var S=w.key,N=b;N!==null;){if(N.key===S){if(S=w.type,S===bu){if(N.tag===7){n(v,N.sibling),b=s(N,w.props.children),b.return=v,v=b;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===lo&&NT(S)===N.type){n(v,N.sibling),b=s(N,w.props),b.ref=Gh(v,N,w),b.return=v,v=b;break e}n(v,N);break}else t(v,N);N=N.sibling}w.type===bu?(b=lc(w.props.children,v.mode,j,w.key),b.return=v,v=b):(j=ax(w.type,w.key,w.props,null,v.mode,j),j.ref=Gh(v,b,w),j.return=v,v=j)}return o(v);case vu:e:{for(N=w.key;b!==null;){if(b.key===N)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(v,b.sibling),b=s(b,w.children||[]),b.return=v,v=b;break e}else{n(v,b);break}else t(v,b);b=b.sibling}b=ij(w,v.mode,j),b.return=v,v=b}return o(v);case lo:return N=w._init,x(v,b,N(w._payload),j)}if(jf(w))return g(v,b,w,j);if(Vh(w))return p(v,b,w,j);zg(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(v,b.sibling),b=s(b,w),b.return=v,v=b):(n(v,b),b=sj(w,v.mode,j),b.return=v,v=b),o(v)):n(v,b)}return x}var Sd=AF(!0),PF=AF(!1),Fx=il(null),Bx=null,Eu=null,DC=null;function FC(){DC=Eu=Bx=null}function BC(e){var t=Fx.current;Bt(Fx),e._currentValue=t}function kS(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Vu(e,t){Bx=e,DC=Eu=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xr=!0),e.firstContext=null)}function ks(e){var t=e._currentValue;if(DC!==e)if(e={context:e,memoizedValue:t,next:null},Eu===null){if(Bx===null)throw Error(ue(308));Eu=e,Bx.dependencies={lanes:0,firstContext:e}}else Eu=Eu.next=e;return t}var zl=null;function zC(e){zl===null?zl=[e]:zl.push(e)}function TF(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,zC(t)):(n.next=s.next,s.next=n),t.interleaved=n,Aa(e,r)}function Aa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var co=!1;function UC(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function OF(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ga(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,st&2){var s=r.pending;
vendor: 2,383 bytes, line 38
38return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Aa(e,n)}return s=r.interleaved,s===null?(t.next=t,zC(r)):(t.next=s.next,s.next=t),r.interleaved=t,Aa(e,n)}function ex(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,CC(e,n)}}function kT(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?s=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?s=a=t:a=a.next=t}else s=a=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function zx(e,t,n,r){var s=e.updateQueue;co=!1;var a=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var h=s.baseState;o=0,d=u=c=null,l=a;do{var f=l.lane,m=l.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,p=l;switch(f=t,m=n,p.tag){case 1:if(g=p.payload,typeof g=="function"){h=g.call(m,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,f=typeof g=="function"?g.call(m,h,f):g,f==null)break e;h=Gt({},h,f);break e;case 2:co=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else m={eventTime:m,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=h):d=d.next=m,o|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(c=h),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);bc|=o,e.lanes=o,e.memoizedState=h}}function _T(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(ue(191,s));s.call(r)}}}var Kp={}
vendor: 5,865 bytes, line 38
38,Mi=il(Kp),Nm=il(Kp),km=il(Kp);function Ul(e){if(e===Kp)throw Error(ue(174));return e}function VC(e,t){switch(At(km,t),At(Nm,e),At(Mi,Kp),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:iS(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=iS(t,e)}Bt(Mi),At(Mi,t)}function Nd(){Bt(Mi),Bt(Nm),Bt(km)}function RF(e){Ul(km.current);var t=Ul(Mi.current),n=iS(t,e.type);t!==n&&(At(Nm,e),At(Mi,n))}function WC(e){Nm.current===e&&(Bt(Mi),Bt(Nm))}var qt=il(0);function Ux(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qw=[];function HC(){for(var e=0;e<Qw.length;e++)Qw[e]._workInProgressVersionPrimary=null;Qw.length=0}var tx=za.ReactCurrentDispatcher,Zw=za.ReactCurrentBatchConfig,vc=0,Kt=null,pn=null,Nn=null,Vx=!1,Ff=!1,_m=0,_J=0;function Vn(){throw Error(ue(321))}function qC(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ti(e[n],t[n]))return!1;return!0}function KC(e,t,n,r,s,a){if(vc=a,Kt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,tx.current=e===null||e.memoizedState===null?PJ:TJ,e=n(r,s),Ff){a=0;do{if(Ff=!1,_m=0,25<=a)throw Error(ue(301));a+=1,Nn=pn=null,t.updateQueue=null,tx.current=OJ,e=n(r,s)}while(Ff)}if(tx.current=Wx,t=pn!==null&&pn.next!==null,vc=0,Nn=pn=Kt=null,Vx=!1,t)throw Error(ue(300));return e}function GC(){var e=_m!==0;return _m=0,e}function gi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?Kt.memoizedState=Nn=e:Nn=Nn.next=e,Nn}function _s(){if(pn===null){var e=Kt.alternate;e=e!==null?e.memoizedState:null}else e=pn.next;var t=Nn===null?Kt.memoizedState:Nn.next;if(t!==null)Nn=t,pn=e;else{if(e===null)throw Error(ue(310));pn=e,e={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},Nn===null?Kt.memoizedState=Nn=e:Nn=Nn.next=e}return Nn}function Cm(e,t){return typeof t=="function"?t(e):t}function ej(e){var t=_s(),n=t.queue;if(n===null)throw Error(ue(311));n.lastRenderedReducer=e;var r=pn,s=r.baseQueue,a=n.pending;if(a!==null){if(s!==null){var o=s.next;s.next=a.next,a.next=o}r.baseQueue=s=a,n.pending=null}if(s!==null){a=s.next,r=r.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((vc&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=h,o=r):c=c.next=h,Kt.lanes|=d,bc|=d}u=u.next}while(u!==null&&u!==a);c===null?o=r:c.next=l,ti(r,t.memoizedState)||(xr=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do a=s.lane,Kt.lanes|=a,bc|=a,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function tj(e){var t=_s(),n=t.queue;if(n===null)throw Error(ue(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,a=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do a=e(a,o.action),o=o.next;while(o!==s);ti(a,t.memoizedState)||(xr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function MF(){}function IF(e,t){var n=Kt,r=_s(),s=t(),a=!ti(r.memoizedState,s);if(a&&(r.memoizedState=s,xr=!0),r=r.queue,YC(DF.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Nn!==null&&Nn.memoizedState.tag&1){if(n.flags|=2048,Em(9,LF.bind(null,n,r,s,t),void 0,null),Cn===null)throw Error(ue(349));vc&30||$F(n,t,s)}return s}function $F(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Kt.updateQueue,t===null?(t={lastEffect:null,stores:null},Kt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function LF(e,t,n,r){t.value=n,t.getSnapshot=r,FF(t)&&BF(e)}function DF(e,t,n){return n(function(){FF(t)&&BF(e)})}function FF(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ti(e,n)}catch{return!0}}function BF(e){var t=Aa(e,1);t!==null&&Js(t,e,1,-1)}function CT(e){var t=gi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Cm,lastRenderedState:e},t.queue=e,e=e.dispatch=AJ.bind(null,Kt,e),[t.memoizedState,e]}function Em(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Kt.updateQueue,t===null?(t={lastEffect:null,stores:null},Kt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function zF(){return _s().memoizedState}function nx(e,t,n,r){var s=gi();Kt.flags|=e,s.memoizedState=Em(1|t,n,void 0,r===void 0?null:r)}function $b(e,t,n,r){var s=_s();r=r===void 0?null:r;var a=void 0;if(pn!==null){var o=pn.memoizedState;if(a=o.destroy,r!==null&&qC(r,o.deps)){s.memoizedState=Em(t,n,a,r);return}}Kt.flags|=e,s.memoizedState=Em(1|t,n,a,r)}function ET(e,t){return nx(8390656,8,e,t)}function YC(e,t){return $b(2048,8,e,t)}function UF(e,t){return $b(4,2,e,t)}function VF(e,t){return $b(4,4,e,t)}function WF(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function HF(e,t,n){return n=n!=null?n.concat([e]):null,$b(4,4,WF.bind(null,t,e),n)}function XC(){}function qF(e,t){var n=_s();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qC(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function KF(e,t){var n=_s();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&qC(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}
vendor: 9,634 bytes, lines 38-40
38function GF(e,t,n){return vc&21?(ti(n,t)||(n=Z3(),Kt.lanes|=n,bc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,xr=!0),e.memoizedState=n)}function CJ(e,t){var n=gt;gt=n!==0&&4>n?n:4,e(!0);var r=Zw.transition;Zw.transition={};try{e(!1),t()}finally{gt=n,Zw.transition=r}}function YF(){return _s().memoizedState}function EJ(e,t,n){var r=Vo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},XF(e))JF(t,n);else if(n=TF(e,t,n,r),n!==null){var s=or();Js(n,e,r,s),QF(n,t,r)}}function AJ(e,t,n){var r=Vo(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(XF(e))JF(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(s.hasEagerState=!0,s.eagerState=l,ti(l,o)){var c=t.interleaved;c===null?(s.next=s,zC(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=TF(e,t,s,r),n!==null&&(s=or(),Js(n,e,r,s),QF(n,t,r))}}function XF(e){var t=e.alternate;return e===Kt||t!==null&&t===Kt}function JF(e,t){Ff=Vx=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function QF(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,CC(e,n)}}var Wx={readContext:ks,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useInsertionEffect:Vn,useLayoutEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useMutableSource:Vn,useSyncExternalStore:Vn,useId:Vn,unstable_isNewReconciler:!1},PJ={readContext:ks,useCallback:function(e,t){return gi().memoizedState=[e,t===void 0?null:t],e},useContext:ks,useEffect:ET,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,nx(4194308,4,WF.bind(null,t,e),n)},useLayoutEffect:function(e,t){return nx(4194308,4,e,t)},useInsertionEffect:function(e,t){return nx(4,2,e,t)},useMemo:function(e,t){var n=gi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=gi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=EJ.bind(null,Kt,e),[r.memoizedState,e]},useRef:function(e){var t=gi();return e={current:e},t.memoizedState=e},useState:CT,useDebugValue:XC,useDeferredValue:function(e){return gi().memoizedState=e},useTransition:function(){var e=CT(!1),t=e[0];return e=CJ.bind(null,e[1]),gi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Kt,s=gi();if(Ut){if(n===void 0)throw Error(ue(407));n=n()}else{if(n=t(),Cn===null)throw Error(ue(349));vc&30||$F(r,t,n)}s.memoizedState=n;var a={value:n,getSnapshot:t};return s.queue=a,ET(DF.bind(null,r,a,e),[e]),r.flags|=2048,Em(9,LF.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=gi(),t=Cn.identifierPrefix;if(Ut){var n=da,r=ua;n=(r&~(1<<32-Xs(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_m++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=_J++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},TJ={readContext:ks,useCallback:qF,useContext:ks,useEffect:YC,useImperativeHandle:HF,useInsertionEffect:UF,useLayoutEffect:VF,useMemo:KF,useReducer:ej,useRef:zF,useState:function(){return ej(Cm)},useDebugValue:XC,useDeferredValue:function(e){var t=_s();return GF(t,pn.memoizedState,e)},useTransition:function(){var e=ej(Cm)[0],t=_s().memoizedState;return[e,t]},useMutableSource:MF,useSyncExternalStore:IF,useId:YF,unstable_isNewReconciler:!1},OJ={readContext:ks,useCallback:qF,useContext:ks,useEffect:YC,useImperativeHandle:HF,useInsertionEffect:UF,useLayoutEffect:VF,useMemo:KF,useReducer:tj,useRef:zF,useState:function(){return tj(Cm)},useDebugValue:XC,useDeferredValue:function(e){var t=_s();return pn===null?t.memoizedState=e:GF(t,pn.memoizedState,e)},useTransition:function(){var e=tj(Cm)[0],t=_s().memoizedState;return[e,t]},useMutableSource:MF,useSyncExternalStore:IF,useId:YF,unstable_isNewReconciler:!1};function Ls(e,t){if(e&&e.defaultProps){t=Gt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _S(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Gt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Lb={isMounted:function(e){return(e=e._reactInternals)?$c(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=or(),s=Vo(e),a=ga(r,s);a.payload=t,n!=null&&(a.callback=n),t=zo(e,a,s),t!==null&&(Js(t,e,s,r),ex(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=or(),s=Vo(e),a=ga(r,s);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=zo(e,a,s),t!==null&&(Js(t,e,s,r),ex(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=or(),r=Vo(e),s=ga(n,r);s.tag=2,t!=null&&(s.callback=t),t=zo(e,s,r),t!==null&&(Js(t,e,r,n),ex(t,e,r))}};function AT(e,t,n,r,s,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!bm(n,r)||!bm(s,a):!0}function ZF(e,t,n){var r=!1,s=Jo,a=t.contextType;return typeof a=="object"&&a!==null?a=ks(a):(s=wr(t)?yc:Xn.current,r=t.contextTypes,a=(r=r!=null)?wd(e,s):Jo),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Lb,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=a),t}function PT(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Lb.enqueueReplaceState(t,t.state,null)}function CS(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},UC(e);var a=t.contextType;typeof a=="object"&&a!==null?s.context=ks(a):(a=wr(t)?yc:Xn.current,s.context=wd(e,a)),s.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(_S(e,t,a,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Lb.enqueueReplaceState(s,s.state,null),zx(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function kd(e,t){try{var n="",r=t;do n+=aX(r),r=r.return;while(r);var s=n}catch(a){s=` 39Error generating stack: `+a.message+` 40`+a.stack}return{value:e,source:t,stack:s,digest:null}}function nj(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ES(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var RJ=typeof WeakMap=="function"?WeakMap:Map;function e6(e,t,n){n=ga(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){qx||(qx=!0,DS=r),ES(e,t)},n}function t6(e,t,n){n=ga(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){ES(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ES(e,t),typeof r!="function"&&(Uo===null?Uo=new Set([this]):Uo.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function TT(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new RJ;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=KJ.bind(null,e,t,n),t.then(e,e))}function OT(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function RT(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ga(-1,1),t.tag=2,zo(n,t,1))),n.lanes|=1),e)}var MJ=za.ReactCurrentOwner,xr=!1;function nr(e,t,n,r){t.child=e===null?PF(t,null,n,r):Sd(t,e.child,n,r)}function MT(e,t,n,r,s){n=n.render;var a=t.ref;return Vu(t,s),r=KC(e,t,n,r,a,s),n=GC(),e!==null&&!xr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Pa(e,t,s)):(Ut&&n&&IC(t),t.flags|=1,nr(e,t,r,s),t.child)}function IT(e,t,n,r,s){if(e===null){var a=n.type;return typeof a=="function"&&!sE(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,n6(e,t,a,r,s)):(e=ax(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&s)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:bm,n(o,r)&&e.ref===t.ref)return Pa(e,t,s)}return t.flags|=1,e=Wo(a,r),e.ref=t.ref,e.return=t,t.child=e}function n6(e,t,n,r,s){if(e!==null){var a=e.memoizedProps;if(bm(a,r)&&e.ref===t.ref)if(xr=!1,t.pendingProps=r=a,(e.lanes&s)!==0)e.flags&131072&&(xr=!0);else return t.lanes=e.lanes,Pa(e,t,s)}return AS(e,t,n,r,s)}function r6(e,t,n){var r=t.pendingProps,s=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},At(Pu,Ir),Ir|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,At(Pu,Ir),Ir|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,At(Pu,Ir),Ir|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,At(Pu,Ir),Ir|=r;return nr(e,t,s,n),t.child}function s6(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 5,685 bytes, line 40
40function AS(e,t,n,r,s){var a=wr(n)?yc:Xn.current;return a=wd(t,a),Vu(t,s),n=KC(e,t,n,r,a,s),r=GC(),e!==null&&!xr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Pa(e,t,s)):(Ut&&r&&IC(t),t.flags|=1,nr(e,t,n,s),t.child)}function $T(e,t,n,r,s){if(wr(n)){var a=!0;$x(t)}else a=!1;if(Vu(t,s),t.stateNode===null)rx(e,t),ZF(t,n,r),CS(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=ks(u):(u=wr(n)?yc:Xn.current,u=wd(t,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&PT(t,o,r,u),co=!1;var f=t.memoizedState;o.state=f,zx(t,r,o,s),c=t.memoizedState,l!==r||f!==c||br.current||co?(typeof d=="function"&&(_S(t,n,d,r),c=t.memoizedState),(l=co||AT(t,n,l,r,f,c,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,OF(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Ls(t.type,l),o.props=u,h=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=ks(c):(c=wr(n)?yc:Xn.current,c=wd(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||f!==c)&&PT(t,o,r,c),co=!1,f=t.memoizedState,o.state=f,zx(t,r,o,s);var g=t.memoizedState;l!==h||f!==g||br.current||co?(typeof m=="function"&&(_S(t,n,m,r),g=t.memoizedState),(u=co||AT(t,n,u,r,f,g,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return PS(e,t,n,r,a,s)}function PS(e,t,n,r,s,a){s6(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&wT(t,n,!1),Pa(e,t,a);r=t.stateNode,MJ.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Sd(t,e.child,null,a),t.child=Sd(t,null,l,a)):nr(e,t,l,a),t.memoizedState=r.state,s&&wT(t,n,!0),t.child}function i6(e){var t=e.stateNode;t.pendingContext?bT(e,t.pendingContext,t.pendingContext!==t.context):t.context&&bT(e,t.context,!1),VC(e,t.containerInfo)}function LT(e,t,n,r,s){return jd(),LC(s),t.flags|=256,nr(e,t,n,r),t.child}var TS={dehydrated:null,treeContext:null,retryLane:0};function OS(e){return{baseLanes:e,cachePool:null,transitions:null}}function a6(e,t,n){var r=t.pendingProps,s=qt.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),At(qt,s&1),e===null)return NS(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:"hidden",children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Bb(o,r,0,null),e=lc(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=OS(n),t.memoizedState=TS,e):JC(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return IJ(e,t,o,r,l,s,n);if(a){a=r.fallback,o=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Wo(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?a=Wo(l,a):(a=lc(a,o,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?OS(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=TS,r}return a=e.child,e=a.sibling,r=Wo(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function JC(e,t){return t=Bb({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ug(e,t,n,r){return r!==null&&LC(r),Sd(t,e.child,null,n),e=JC(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function IJ(e,t,n,r,s,a,o){if(n)return t.flags&256?(t.flags&=-257,r=nj(Error(ue(422))),Ug(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,s=t.mode,r=Bb({mode:"visible",children:r.children},s,0,null),a=lc(a,s,o,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Sd(t,e.child,null,o),t.child.memoizedState=OS(o),t.memoizedState=TS,a);
vendor: 6,426 bytes, line 40
40if(!(t.mode&1))return Ug(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(ue(419)),r=nj(a,r,void 0),Ug(e,t,o,r)}if(l=(o&e.childLanes)!==0,xr||l){if(r=Cn,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,Aa(e,s),Js(r,e,s,-1))}return rE(),r=nj(Error(ue(421))),Ug(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=GJ.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,Vr=Bo(s.nextSibling),Hr=t,Ut=!0,Vs=null,e!==null&&(hs[fs++]=ua,hs[fs++]=da,hs[fs++]=xc,ua=e.id,da=e.overflow,xc=t),t=JC(t,r.children),t.flags|=4096,t)}function DT(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),kS(e.return,t,n)}function rj(e,t,n,r,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=s)}function o6(e,t,n){var r=t.pendingProps,s=r.revealOrder,a=r.tail;if(nr(e,t,r.children,n),r=qt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&DT(e,n,t);else if(e.tag===19)DT(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(At(qt,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Ux(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),rj(t,!1,s,n,a);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ux(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}rj(t,!0,n,null,a);break;case"together":rj(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rx(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bc|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ue(153));if(t.child!==null){for(e=t.child,n=Wo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function $J(e,t,n){switch(t.tag){case 3:i6(t),jd();break;case 5:RF(t);break;case 1:wr(t.type)&&$x(t);break;case 4:VC(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;At(Fx,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(At(qt,qt.current&1),t.flags|=128,null):n&t.child.childLanes?a6(e,t,n):(At(qt,qt.current&1),e=Pa(e,t,n),e!==null?e.sibling:null);At(qt,qt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return o6(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),At(qt,qt.current),r)break;return null;case 22:case 23:return t.lanes=0,r6(e,t,n)}return Pa(e,t,n)}var l6,RS,c6,u6;l6=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};RS=function(){};c6=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Ul(Mi.current);var a=null;switch(n){case"input":s=tS(e,s),r=tS(e,r),a=[];break;case"select":s=Gt({},s,{value:void 0}),r=Gt({},r,{value:void 0}),a=[];break;case"textarea":s=sS(e,s),r=sS(e,r),a=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Mx)}aS(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(fm.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(fm.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&$t("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};u6=function(e,t,n,r){n!==r&&(t.flags|=4)};function Yh(e,t){if(!Ut)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Wn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function LJ(e,t,n){var r=t.pendingProps;switch($C(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wn(t),null;case 1:return wr(t.type)&&Ix(),Wn(t),null;case 3:return r=t.stateNode,Nd(),Bt(br),Bt(Xn),HC(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Bg(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vs!==null&&(zS(Vs),Vs=null))),RS(e,t),Wn(t),null;case 5:WC(t);var s=Ul(km.current);
vendor: 29,806 bytes, line 40
40if(n=t.type,e!==null&&t.stateNode!=null)c6(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ue(166));return Wn(t),null}if(e=Ul(Mi.current),Bg(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[_i]=t,r[Sm]=a,e=(t.mode&1)!==0,n){case"dialog":$t("cancel",r),$t("close",r);break;case"iframe":case"object":case"embed":$t("load",r);break;case"video":case"audio":for(s=0;s<Nf.length;s++)$t(Nf[s],r);break;case"source":$t("error",r);break;case"img":case"image":case"link":$t("error",r),$t("load",r);break;case"details":$t("toggle",r);break;case"input":KP(r,a),$t("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},$t("invalid",r);break;case"textarea":YP(r,a),$t("invalid",r)}aS(n,a),s=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?r.textContent!==l&&(a.suppressHydrationWarning!==!0&&Fg(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Fg(r.textContent,l,e),s=["children",""+l]):fm.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&$t("scroll",r)}switch(n){case"input":Tg(r),GP(r,a,!0);break;case"textarea":Tg(r),XP(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Mx)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=D3(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[_i]=t,e[Sm]=r,l6(e,t,!1,!1),t.stateNode=e;e:{switch(o=oS(n,r),n){case"dialog":$t("cancel",e),$t("close",e),s=r;break;case"iframe":case"object":case"embed":$t("load",e),s=r;break;case"video":case"audio":for(s=0;s<Nf.length;s++)$t(Nf[s],e);s=r;break;case"source":$t("error",e),s=r;break;case"img":case"image":case"link":$t("error",e),$t("load",e),s=r;break;case"details":$t("toggle",e),s=r;break;case"input":KP(e,r),s=tS(e,r),$t("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Gt({},r,{value:void 0}),$t("invalid",e);break;case"textarea":YP(e,r),s=sS(e,r),$t("invalid",e);break;default:s=r}aS(n,s),l=s;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?z3(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&F3(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&mm(e,c):typeof c=="number"&&mm(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(fm.hasOwnProperty(a)?c!=null&&a==="onScroll"&&$t("scroll",e):c!=null&&wC(e,a,c,o))}switch(n){case"input":Tg(e),GP(e,r,!1);break;case"textarea":Tg(e),XP(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Xo(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Fu(e,!!r.multiple,a,!1):r.defaultValue!=null&&Fu(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Mx)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Wn(t),null;case 6:if(e&&t.stateNode!=null)u6(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ue(166));if(n=Ul(km.current),Ul(Mi.current),Bg(t)){if(r=t.stateNode,n=t.memoizedProps,r[_i]=t,(a=r.nodeValue!==n)&&(e=Hr,e!==null))switch(e.tag){case 3:Fg(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Fg(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[_i]=t,t.stateNode=r}return Wn(t),null;case 13:if(Bt(qt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ut&&Vr!==null&&t.mode&1&&!(t.flags&128))EF(),jd(),t.flags|=98560,a=!1;else if(a=Bg(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(ue(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ue(317));a[_i]=t}else jd(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wn(t),a=!1}else Vs!==null&&(zS(Vs),Vs=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||qt.current&1?yn===0&&(yn=3):rE())),t.updateQueue!==null&&(t.flags|=4),Wn(t),null);case 4:return Nd(),RS(e,t),e===null&&wm(t.stateNode.containerInfo),Wn(t),null;case 10:return BC(t.type._context),Wn(t),null;case 17:return wr(t.type)&&Ix(),Wn(t),null;case 19:if(Bt(qt),a=t.memoizedState,a===null)return Wn(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)Yh(a,!1);else{if(yn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ux(e),o!==null){for(t.flags|=128,Yh(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return At(qt,qt.current&1|2),t.child}e=e.sibling}a.tail!==null&&en()>_d&&(t.flags|=128,r=!0,Yh(a,!1),t.lanes=4194304)}else{if(!r)if(e=Ux(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Yh(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Ut)return Wn(t),null}else 2*en()-a.renderingStartTime>_d&&n!==1073741824&&(t.flags|=128,r=!0,Yh(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=en(),t.sibling=null,n=qt.current,At(qt,r?n&1|2:n&1),t):(Wn(t),null);case 22:case 23:return nE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ir&1073741824&&(Wn(t),t.subtreeFlags&6&&(t.flags|=8192)):Wn(t),null;case 24:return null;case 25:return null}throw Error(ue(156,t.tag))}function DJ(e,t){switch($C(t),t.tag){case 1:return wr(t.type)&&Ix(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nd(),Bt(br),Bt(Xn),HC(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return WC(t),null;case 13:if(Bt(qt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ue(340));jd()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bt(qt),null;case 4:return Nd(),null;case 10:return BC(t.type._context),null;case 22:case 23:return nE(),null;case 24:return null;default:return null}}var Vg=!1,Kn=!1,FJ=typeof WeakSet=="function"?WeakSet:Set,we=null;function Au(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Zt(e,t,r)}else n.current=null}function MS(e,t,n){try{n()}catch(r){Zt(e,t,r)}}var FT=!1;function BJ(e,t){if(yS=Tx,e=pF(),MC(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,f=null;t:for(;;){for(var m;h!==n||s!==0&&h.nodeType!==3||(l=o+s),h!==a||r!==0&&h.nodeType!==3||(c=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(m=h.firstChild)!==null;)f=h,h=m;for(;;){if(h===e)break t;if(f===n&&++u===s&&(l=o),f===a&&++d===r&&(c=o),(m=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(xS={focusedElem:e,selectionRange:n},Tx=!1,we=t;we!==null;)if(t=we,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,we=e;else for(;we!==null;){t=we;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,x=g.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?p:Ls(t.type,p),x);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ue(163))}}catch(j){Zt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,we=e;break}we=t.return}return g=FT,FT=!1,g}function Bf(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&MS(t,n,a)}s=s.next}while(s!==r)}}function Db(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function IS(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function d6(e){var t=e.alternate;t!==null&&(e.alternate=null,d6(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_i],delete t[Sm],delete t[wS],delete t[jJ],delete t[SJ])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function h6(e){return e.tag===5||e.tag===3||e.tag===4}function BT(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||h6(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $S(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Mx));else if(r!==4&&(e=e.child,e!==null))for($S(e,t,n),e=e.sibling;e!==null;)$S(e,t,n),e=e.sibling}function LS(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(LS(e,t,n),e=e.sibling;e!==null;)LS(e,t,n),e=e.sibling}var In=null,Bs=!1;function Xa(e,t,n){for(n=n.child;n!==null;)f6(e,t,n),n=n.sibling}function f6(e,t,n){if(Ri&&typeof Ri.onCommitFiberUnmount=="function")try{Ri.onCommitFiberUnmount(Pb,n)}catch{}switch(n.tag){case 5:Kn||Au(n,t);case 6:var r=In,s=Bs;In=null,Xa(e,t,n),In=r,Bs=s,In!==null&&(Bs?(e=In,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):In.removeChild(n.stateNode));break;case 18:In!==null&&(Bs?(e=In,n=n.stateNode,e.nodeType===8?Xw(e.parentNode,n):e.nodeType===1&&Xw(e,n),xm(e)):Xw(In,n.stateNode));break;case 4:r=In,s=Bs,In=n.stateNode.containerInfo,Bs=!0,Xa(e,t,n),In=r,Bs=s;break;case 0:case 11:case 14:case 15:if(!Kn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var a=s,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&MS(n,t,o),s=s.next}while(s!==r)}Xa(e,t,n);break;case 1:if(!Kn&&(Au(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Zt(n,t,l)}Xa(e,t,n);break;case 21:Xa(e,t,n);break;case 22:n.mode&1?(Kn=(r=Kn)||n.memoizedState!==null,Xa(e,t,n),Kn=r):Xa(e,t,n);break;default:Xa(e,t,n)}}function zT(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new FJ),t.forEach(function(r){var s=YJ.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Os(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:In=l.stateNode,Bs=!1;break e;case 3:In=l.stateNode.containerInfo,Bs=!0;break e;case 4:In=l.stateNode.containerInfo,Bs=!0;break e}l=l.return}if(In===null)throw Error(ue(160));f6(a,o,s),In=null,Bs=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){Zt(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)m6(t,e),t=t.sibling}function m6(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Os(t,e),fi(e),r&4){try{Bf(3,e,e.return),Db(3,e)}catch(p){Zt(e,e.return,p)}try{Bf(5,e,e.return)}catch(p){Zt(e,e.return,p)}}break;case 1:Os(t,e),fi(e),r&512&&n!==null&&Au(n,n.return);break;case 5:if(Os(t,e),fi(e),r&512&&n!==null&&Au(n,n.return),e.flags&32){var s=e.stateNode;try{mm(s,"")}catch(p){Zt(e,e.return,p)}}if(r&4&&(s=e.stateNode,s!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&$3(s,a),oS(l,o);var u=oS(l,a);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?z3(s,h):d==="dangerouslySetInnerHTML"?F3(s,h):d==="children"?mm(s,h):wC(s,d,h,u)}switch(l){case"input":nS(s,a);break;case"textarea":L3(s,a);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?Fu(s,!!a.multiple,m,!1):f!==!!a.multiple&&(a.defaultValue!=null?Fu(s,!!a.multiple,a.defaultValue,!0):Fu(s,!!a.multiple,a.multiple?[]:"",!1))}s[Sm]=a}catch(p){Zt(e,e.return,p)}}break;case 6:if(Os(t,e),fi(e),r&4){if(e.stateNode===null)throw Error(ue(162));s=e.stateNode,a=e.memoizedProps;try{s.nodeValue=a}catch(p){Zt(e,e.return,p)}}break;case 3:if(Os(t,e),fi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{xm(t.containerInfo)}catch(p){Zt(e,e.return,p)}break;case 4:Os(t,e),fi(e);break;case 13:Os(t,e),fi(e),s=e.child,s.flags&8192&&(a=s.memoizedState!==null,s.stateNode.isHidden=a,!a||s.alternate!==null&&s.alternate.memoizedState!==null||(eE=en())),r&4&&zT(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Kn=(u=Kn)||d,Os(t,e),Kn=u):Os(t,e),fi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(we=e,d=e.child;d!==null;){for(h=we=d;we!==null;){switch(f=we,m=f.child,f.tag){case 0:case 11:case 14:case 15:Bf(4,f,f.return);break;case 1:Au(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(p){Zt(r,n,p)}}break;case 5:Au(f,f.return);break;case 22:if(f.memoizedState!==null){VT(h);continue}}m!==null?(m.return=f,we=m):VT(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{s=h.stateNode,u?(a=s.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=B3("display",o))}catch(p){Zt(e,e.return,p)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(p){Zt(e,e.return,p)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Os(t,e),fi(e),r&4&&zT(e);break;case 21:break;default:Os(t,e),fi(e)}}function fi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(h6(n)){var r=n;break e}n=n.return}throw Error(ue(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(mm(s,""),r.flags&=-33);var a=BT(e);LS(e,a,s);break;case 3:case 4:var o=r.stateNode.containerInfo,l=BT(e);$S(e,l,o);break;default:throw Error(ue(161))}}catch(c){Zt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zJ(e,t,n){we=e,p6(e)}function p6(e,t,n){for(var r=(e.mode&1)!==0;we!==null;){var s=we,a=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Vg;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||Kn;l=Vg;var u=Kn;if(Vg=o,(Kn=c)&&!u)for(we=s;we!==null;)o=we,c=o.child,o.tag===22&&o.memoizedState!==null?WT(s):c!==null?(c.return=o,we=c):WT(s);for(;a!==null;)we=a,p6(a),a=a.sibling;we=s,Vg=l,Kn=u}UT(e)}else s.subtreeFlags&8772&&a!==null?(a.return=s,we=a):UT(e)}}function UT(e){for(;we!==null;){var t=we;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Kn||Db(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Kn)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Ls(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&_T(t,a,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}_T(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&xm(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ue(163))}Kn||t.flags&512&&IS(t)}catch(f){Zt(t,t.return,f)}}if(t===e){we=null;break}if(n=t.sibling,n!==null){n.return=t.return,we=n;break}we=t.return}}function VT(e){for(;we!==null;){var t=we;if(t===e){we=null;break}var n=t.sibling;if(n!==null){n.return=t.return,we=n;break}we=t.return}}function WT(e){for(;we!==null;){var t=we;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Db(4,t)}catch(c){Zt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){Zt(t,s,c)}}var a=t.return;try{IS(t)}catch(c){Zt(t,a,c)}break;case 5:var o=t.return;try{IS(t)}catch(c){Zt(t,o,c)}}}catch(c){Zt(t,t.return,c)}if(t===e){we=null;break}var l=t.sibling;if(l!==null){l.return=t.return,we=l;break}we=t.return}}var UJ=Math.ceil,Hx=za.ReactCurrentDispatcher,QC=za.ReactCurrentOwner,ws=za.ReactCurrentBatchConfig,st=0,Cn=null,dn=null,Bn=0,Ir=0,Pu=il(0),yn=0,Am=null,bc=0,Fb=0,ZC=0,zf=null,yr=null,eE=0,_d=1/0,sa=null,qx=!1,DS=null,Uo=null,Wg=!1,Oo=null,Kx=0,Uf=0,FS=null,sx=-1,ix=0;function or(){return st&6?en():sx!==-1?sx:sx=en()}function Vo(e){return e.mode&1?st&2&&Bn!==0?Bn&-Bn:kJ.transition!==null?(ix===0&&(ix=Z3()),ix):(e=gt,e!==0||(e=window.event,e=e===void 0?16:aF(e.type)),e):1}function Js(e,t,n,r){if(50<Uf)throw Uf=0,FS=null,Error(ue(185));Wp(e,n,r),(!(st&2)||e!==Cn)&&(e===Cn&&(!(st&2)&&(Fb|=n),yn===4&&fo(e,Bn)),jr(e,r),n===1&&st===0&&!(t.mode&1)&&(_d=en()+500,Ib&&al()))}function jr(e,t){var n=e.callbackNode;kX(e,t);var r=Px(e,e===Cn?Bn:0);if(r===0)n!==null&&ZP(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ZP(n),t===1)e.tag===0?NJ(HT.bind(null,e)):kF(HT.bind(null,e)),bJ(function(){!(st&6)&&al()}),n=null;else{switch(eF(r)){case 1:n=_C;break;case 4:n=J3;break;case 16:n=Ax;break;case 536870912:n=Q3;break;default:n=Ax}n=S6(n,g6.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function g6(e,t){if(sx=-1,ix=0,st&6)throw Error(ue(327));var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var r=Px(e,e===Cn?Bn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Gx(e,r);else{t=r;var s=st;st|=2;var a=x6();(Cn!==e||Bn!==t)&&(sa=null,_d=en()+500,oc(e,t));do try{HJ();break}catch(l){y6(e,l)}while(!0);FC(),Hx.current=a,st=s,dn!==null?t=0:(Cn=null,Bn=0,t=yn)}if(t!==0){if(t===2&&(s=hS(e),s!==0&&(r=s,t=BS(e,s))),t===1)throw n=Am,oc(e,0),fo(e,r),jr(e,en()),n;if(t===6)fo(e,r);else{if(s=e.current.alternate,!(r&30)&&!VJ(s)&&(t=Gx(e,r),t===2&&(a=hS(e),a!==0&&(r=a,t=BS(e,a))),t===1))throw n=Am,oc(e,0),fo(e,r),jr(e,en()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(ue(345));case 2:Rl(e,yr,sa);break;case 3:if(fo(e,r),(r&130023424)===r&&(t=eE+500-en(),10<t)){if(Px(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){or(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=bS(Rl.bind(null,e,yr,sa),t);break}Rl(e,yr,sa);break;case 4:if(fo(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-Xs(r);a=1<<o,o=t[o],o>s&&(s=o),r&=~a}if(r=s,r=en()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*UJ(r/1960))-r,10<r){e.timeoutHandle=bS(Rl.bind(null,e,yr,sa),r);break}Rl(e,yr,sa);break;case 5:Rl(e,yr,sa);break;default:throw Error(ue(329))}}}return jr(e,en()),e.callbackNode===n?g6.bind(null,e):null}function BS(e,t){var n=zf;return e.current.memoizedState.isDehydrated&&(oc(e,t).flags|=256),e=Gx(e,t),e!==2&&(t=yr,yr=n,t!==null&&zS(t)),e}function zS(e){yr===null?yr=e:yr.push.apply(yr,e)}function VJ(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],a=s.getSnapshot;s=s.value;try{if(!ti(a(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function fo(e,t){for(t&=~ZC,t&=~Fb,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Xs(t),r=1<<n;e[n]=-1,t&=~r}}function HT(e){if(st&6)throw Error(ue(327));Wu();var t=Px(e,0);if(!(t&1))return jr(e,en()),null;var n=Gx(e,t);if(e.tag!==0&&n===2){var r=hS(e);r!==0&&(t=r,n=BS(e,r))}if(n===1)throw n=Am,oc(e,0),fo(e,t),jr(e,en()),n;if(n===6)throw Error(ue(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rl(e,yr,sa),jr(e,en()),null}function tE(e,t){var n=st;st|=1;try{return e(t)}finally{st=n,st===0&&(_d=en()+500,Ib&&al())}}function wc(e){Oo!==null&&Oo.tag===0&&!(st&6)&&Wu();var t=st;st|=1;var n=ws.transition,r=gt;try{if(ws.transition=null,gt=1,e)return e()}finally{gt=r,ws.transition=n,st=t,!(st&6)&&al()}}function nE(){Ir=Pu.current,Bt(Pu)}function oc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,vJ(n)),dn!==null)for(n=dn.return;n!==null;){var r=n;switch($C(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ix();break;case 3:Nd(),Bt(br),Bt(Xn),HC();break;case 5:WC(r);break;case 4:Nd();break;case 13:Bt(qt);break;case 19:Bt(qt);break;case 10:BC(r.type._context);break;case 22:case 23:nE()}n=n.return}if(Cn=e,dn=e=Wo(e.current,null),Bn=Ir=t,yn=0,Am=null,ZC=Fb=bc=0,yr=zf=null,zl!==null){for(t=0;t<zl.length;t++)if(n=zl[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=s,r.next=o}n.pending=r}zl=null}return e}function y6(e,t){do{var n=dn;try{if(FC(),tx.current=Wx,Vx){for(var r=Kt.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Vx=!1}if(vc=0,Nn=pn=Kt=null,Ff=!1,_m=0,QC.current=null,n===null||n.return===null){yn=1,Am=t,dn=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=Bn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=OT(o);if(m!==null){m.flags&=-257,RT(m,o,l,a,t),m.mode&1&&TT(a,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var p=new Set;p.add(c),t.updateQueue=p}else g.add(c);break e}else{if(!(t&1)){TT(a,u,t),rE();break e}c=Error(ue(426))}}else if(Ut&&l.mode&1){var x=OT(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),RT(x,o,l,a,t),LC(kd(c,l));break e}}a=c=kd(c,l),yn!==4&&(yn=2),zf===null?zf=[a]:zf.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=e6(a,c,t);kT(a,v);break e;case 1:l=c;var b=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Uo===null||!Uo.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=t6(a,l,t);kT(a,j);break e}}a=a.return}while(a!==null)}b6(n)}catch(S){t=S,dn===n&&n!==null&&(dn=n=n.return);continue}break}while(!0)}function x6(){var e=Hx.current;return Hx.current=Wx,e===null?Wx:e}function rE(){(yn===0||yn===3||yn===2)&&(yn=4),Cn===null||!(bc&268435455)&&!(Fb&268435455)||fo(Cn,Bn)}function Gx(e,t){var n=st;st|=2;var r=x6();(Cn!==e||Bn!==t)&&(sa=null,oc(e,t));do try{WJ();break}catch(s){y6(e,s)}while(!0);if(FC(),st=n,Hx.current=r,dn!==null)throw Error(ue(261));return Cn=null,Bn=0,yn}function WJ(){for(;dn!==null;)v6(dn)}function HJ(){for(;dn!==null&&!gX();)v6(dn)}function v6(e){var t=j6(e.alternate,e,Ir);e.memoizedProps=e.pendingProps,t===null?b6(e):dn=t,QC.current=null}function b6(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=DJ(n,t),n!==null){n.flags&=32767,dn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{yn=6,dn=null;return}}else if(n=LJ(n,t,Ir),n!==null){dn=n;return}if(t=t.sibling,t!==null){dn=t;return}dn=t=e}while(t!==null);yn===0&&(yn=5)}function Rl(e,t,n){var r=gt,s=ws.transition;try{ws.transition=null,gt=1,qJ(e,t,n,r)}finally{ws.transition=s,gt=r}return null}function qJ(e,t,n,r){do Wu();while(Oo!==null);if(st&6)throw Error(ue(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ue(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(_X(e,a),e===Cn&&(dn=Cn=null,Bn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Wg||(Wg=!0,S6(Ax,function(){return Wu(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=ws.transition,ws.transition=null;var o=gt;gt=1;var l=st;st|=4,QC.current=null,BJ(e,n),m6(n,e),hJ(xS),Tx=!!yS,xS=yS=null,e.current=n,zJ(n),yX(),st=l,gt=o,ws.transition=a}else e.current=n;if(Wg&&(Wg=!1,Oo=e,Kx=s),a=e.pendingLanes,a===0&&(Uo=null),bX(n.stateNode),jr(e,en()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(qx)throw qx=!1,e=DS,DS=null,e;return Kx&1&&e.tag!==0&&Wu(),a=e.pendingLanes,a&1?e===FS?Uf++:(Uf=0,FS=e):Uf=0,al(),null}function Wu(){if(Oo!==null){var e=eF(Kx),t=ws.transition,n=gt;try{if(ws.transition=null,gt=16>e?16:e,Oo===null)var r=!1;else{if(e=Oo,Oo=null,Kx=0,st&6)throw Error(ue(331));var s=st;for(st|=4,we=e.current;we!==null;){var a=we,o=a.child;if(we.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(we=u;we!==null;){var d=we;switch(d.tag){case 0:case 11:case 15:Bf(8,d,a)}var h=d.child;if(h!==null)h.return=d,we=h;else for(;we!==null;){d=we;var f=d.sibling,m=d.return;if(d6(d),d===u){we=null;break}if(f!==null){f.return=m,we=f;break}we=m}}}var g=a.alternate;if(g!==null){var p=g.child;if(p!==null){g.child=null;do{var x=p.sibling;p.sibling=null,p=x}while(p!==null)}}we=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,we=o;else e:for(;we!==null;){if(a=we,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Bf(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,we=v;break e}we=a.return}}var b=e.current;for(we=b;we!==null;){o=we;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,we=w;else e:for(o=b;we!==null;){if(l=we,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Db(9,l)}}catch(S){Zt(l,l.return,S)}if(l===o){we=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,we=j;break e}we=l.return}}if(st=s,al(),Ri&&typeof Ri.onPostCommitFiberRoot=="function")try{Ri.onPostCommitFiberRoot(Pb,e)}catch{}r=!0}return r}finally{gt=n,ws.transition=t}}return!1}function qT(e,t,n){t=kd(n,t),t=e6(e,t,1),e=zo(e,t,1),t=or(),e!==null&&(Wp(e,1,t),jr(e,t))}function Zt(e,t,n){if(e.tag===3)qT(e,e,n);else for(;t!==null;){if(t.tag===3){qT(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Uo===null||!Uo.has(r))){e=kd(n,e),e=t6(t,e,1),t=zo(t,e,1),e=or(),t!==null&&(Wp(t,1,e),jr(t,e));break}}t=t.return}}function KJ(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=or(),e.pingedLanes|=e.suspendedLanes&n,Cn===e&&(Bn&n)===n&&(yn===4||yn===3&&(Bn&130023424)===Bn&&500>en()-eE?oc(e,0):ZC|=n),jr(e,t)}function w6(e,t){t===0&&(e.mode&1?(t=Mg,Mg<<=1,!(Mg&130023424)&&(Mg=4194304)):t=1);var n=or();e=Aa(e,t),e!==null&&(Wp(e,t,n),jr(e,n))}function GJ(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),w6(e,n)}function YJ(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ue(314))}r!==null&&r.delete(t),w6(e,n)}var j6;j6=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||br.current)xr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xr=!1,$J(e,t,n);xr=!!(e.flags&131072)}else xr=!1,Ut&&t.flags&1048576&&_F(t,Dx,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;rx(e,t),e=t.pendingProps;var s=wd(t,Xn.current);Vu(t,n),s=KC(null,t,r,e,s,n);var a=GC();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,wr(r)?(a=!0,$x(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,UC(t),s.updater=Lb,t.stateNode=s,s._reactInternals=t,CS(t,r,e,n),t=PS(null,t,r,!0,a,n)):(t.tag=0,Ut&&a&&IC(t),nr(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(rx(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=JJ(r),e=Ls(r,e),s){case 0:t=AS(null,t,r,e,n);break e;case 1:t=$T(null,t,r,e,n);break e;case 11:t=MT(null,t,r,e,n);break e;case 14:t=IT(null,t,r,Ls(r.type,e),n);break e}throw Error(ue(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),AS(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),$T(e,t,r,s,n);case 3:e:{if(i6(t),e===null)throw Error(ue(387));
vendor: 4,917 bytes, line 40
40r=t.pendingProps,a=t.memoizedState,s=a.element,OF(e,t),zx(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=kd(Error(ue(423)),t),t=LT(e,t,r,n,s);break e}else if(r!==s){s=kd(Error(ue(424)),t),t=LT(e,t,r,n,s);break e}else for(Vr=Bo(t.stateNode.containerInfo.firstChild),Hr=t,Ut=!0,Vs=null,n=PF(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jd(),r===s){t=Pa(e,t,n);break e}nr(e,t,r,n)}t=t.child}return t;case 5:return RF(t),e===null&&NS(t),r=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,o=s.children,vS(r,s)?o=null:a!==null&&vS(r,a)&&(t.flags|=32),s6(e,t),nr(e,t,o,n),t.child;case 6:return e===null&&NS(t),null;case 13:return a6(e,t,n);case 4:return VC(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Sd(t,null,r,n):nr(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),MT(e,t,r,s,n);case 7:return nr(e,t,t.pendingProps,n),t.child;case 8:return nr(e,t,t.pendingProps.children,n),t.child;case 12:return nr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,a=t.memoizedProps,o=s.value,At(Fx,r._currentValue),r._currentValue=o,a!==null)if(ti(a.value,o)){if(a.children===s.children&&!br.current){t=Pa(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=ga(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),kS(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(ue(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),kS(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}nr(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Vu(t,n),s=ks(s),r=r(s),t.flags|=1,nr(e,t,r,n),t.child;case 14:return r=t.type,s=Ls(r,t.pendingProps),s=Ls(r.type,s),IT(e,t,r,s,n);case 15:return n6(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ls(r,s),rx(e,t),t.tag=1,wr(r)?(e=!0,$x(t)):e=!1,Vu(t,n),ZF(t,r,s),CS(t,r,s,n),PS(null,t,r,!0,e,n);case 19:return o6(e,t,n);case 22:return r6(e,t,n)}throw Error(ue(156,t.tag))};function S6(e,t){return X3(e,t)}function XJ(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gs(e,t,n,r){return new XJ(e,t,n,r)}function sE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JJ(e){if(typeof e=="function")return sE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===SC)return 11;if(e===NC)return 14}return 2}function Wo(e,t){var n=e.alternate;return n===null?(n=gs(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ax(e,t,n,r,s,a){var o=2;if(r=e,typeof e=="function")sE(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case bu:return lc(n.children,s,a,t);case jC:o=8,s|=8;break;case J1:return e=gs(12,n,t,s|2),e.elementType=J1,e.lanes=a,e;case Q1:return e=gs(13,n,t,s),e.elementType=Q1,e.lanes=a,e;case Z1:return e=gs(19,n,t,s),e.elementType=Z1,e.lanes=a,e;case R3:return Bb(n,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T3:o=10;break e;case O3:o=9;break e;case SC:o=11;break e;case NC:o=14;break e;case lo:o=16,r=null;break e}throw Error(ue(130,e==null?e:typeof e,""))}return t=gs(o,n,t,s),t.elementType=e,t.type=r,t.lanes=a,t}function lc(e,t,n,r){return e=gs(7,e,r,t),e.lanes=n,e}function Bb(e,t,n,r){return e=gs(22,e,r,t),e.elementType=R3,e.lanes=n,e.stateNode={isHidden:!1},e}function sj(e,t,n){return e=gs(6,e,null,t),e.lanes=n,e}function ij(e,t,n){return t=gs(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}
vendor: 5,457 bytes, line 40
40function QJ(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fw(0),this.expirationTimes=Fw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fw(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function iE(e,t,n,r,s,a,o,l,c){return e=new QJ(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=gs(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},UC(a),e}function ZJ(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vu,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function N6(e){if(!e)return Jo;e=e._reactInternals;e:{if($c(e)!==e||e.tag!==1)throw Error(ue(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(wr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ue(171))}if(e.tag===1){var n=e.type;if(wr(n))return NF(e,n,t)}return t}function k6(e,t,n,r,s,a,o,l,c){return e=iE(n,r,!0,e,s,a,o,l,c),e.context=N6(null),n=e.current,r=or(),s=Vo(n),a=ga(r,s),a.callback=t??null,zo(n,a,s),e.current.lanes=s,Wp(e,s,r),jr(e,r),e}function zb(e,t,n,r){var s=t.current,a=or(),o=Vo(s);return n=N6(n),t.context===null?t.context=n:t.pendingContext=n,t=ga(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=zo(s,t,o),e!==null&&(Js(e,s,o,a),ex(e,s,o)),o}function Yx(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function KT(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function aE(e,t){KT(e,t),(e=e.alternate)&&KT(e,t)}function eQ(){return null}var _6=typeof reportError=="function"?reportError:function(e){console.error(e)};function oE(e){this._internalRoot=e}Ub.prototype.render=oE.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ue(409));zb(e,t,null,null)};Ub.prototype.unmount=oE.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wc(function(){zb(null,e,null,null)}),t[Ea]=null}};function Ub(e){this._internalRoot=e}Ub.prototype.unstable_scheduleHydration=function(e){if(e){var t=rF();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ho.length&&t!==0&&t<ho[n].priority;n++);ho.splice(n,0,e),n===0&&iF(e)}};function lE(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Vb(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function GT(){}function tQ(e,t,n,r,s){if(s){if(typeof r=="function"){var a=r;r=function(){var u=Yx(o);a.call(u)}}var o=k6(t,r,e,0,null,!1,!1,"",GT);return e._reactRootContainer=o,e[Ea]=o.current,wm(e.nodeType===8?e.parentNode:e),wc(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var u=Yx(c);l.call(u)}}var c=iE(e,0,!1,null,null,!1,!1,"",GT);return e._reactRootContainer=c,e[Ea]=c.current,wm(e.nodeType===8?e.parentNode:e),wc(function(){zb(t,c,n,r)}),c}function Wb(e,t,n,r,s){var a=n._reactRootContainer;if(a){var o=a;if(typeof s=="function"){var l=s;s=function(){var c=Yx(o);l.call(c)}}zb(t,o,e,s)}else o=tQ(n,t,e,s,r);return Yx(o)}tF=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Sf(t.pendingLanes);n!==0&&(CC(t,n|1),jr(t,en()),!(st&6)&&(_d=en()+500,al()))}break;case 13:wc(function(){var r=Aa(e,1);if(r!==null){var s=or();Js(r,e,1,s)}}),aE(e,1)}};EC=function(e){if(e.tag===13){var t=Aa(e,134217728);if(t!==null){var n=or();Js(t,e,134217728,n)}aE(e,134217728)}};nF=function(e){if(e.tag===13){var t=Vo(e),n=Aa(e,t);if(n!==null){var r=or();Js(n,e,t,r)}aE(e,t)}};rF=function(){return gt};sF=function(e,t){var n=gt;try{return gt=e,t()}finally{gt=n}};cS=function(e,t,n){switch(t){case"input":if(nS(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Mb(r);if(!s)throw Error(ue(90));I3(r),nS(r,s)}}}break;case"textarea":L3(e,n);break;case"select":t=n.value,t!=null&&Fu(e,!!n.multiple,t,!1)}};W3=tE;H3=wc;var nQ={usingClientEntryPoint:!1,Events:[qp,Nu,Mb,U3,V3,tE]},Xh={findFiberByHostInstance:Bl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rQ={bundleType:Xh.bundleType,version:Xh.version,rendererPackageName:Xh.rendererPackageName,rendererConfig:Xh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:za.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=G3(e),e===null?null:e.stateNode},findFiberByHostInstance:Xh.findFiberByHostInstance||eQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hg.isDisabled&&Hg.supportsFiber)try{Pb=Hg.inject(rQ),Ri=Hg}catch{}}Qr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nQ;Qr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!lE(t))throw Error(ue(200));return ZJ(e,t,null,n)};Qr.createRoot=function(e,t){if(!lE(e))throw Error(ue(299));var n=!1,r="",s=_6;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=iE(e,1,!1,null,null,n,!1,r,s),e[Ea]=t.current,wm(e.nodeType===8?e.parentNode:e),new oE(t)};Qr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ue(188)):(e=Object.keys(e).join(","),Error(ue(268,e)));return e=G3(t),e=e===null?null:e.stateNode,e};Qr.flushSync=function(e){return wc(e)};Qr.hydrate=function(e,t,n){if(!Vb(t))throw Error(ue(200));return Wb(null,e,t,!0,n)};Qr.hydrateRoot=function(e,t,n){if(!lE(e))throw Error(ue(405));var r=n!=null&&n.hydratedSources||null,s=!1,a="",o=_6;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=k6(t,null,e,1,n??null,s,!1,a,o),e[Ea]=t.current,wm(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Ub(t)};Qr.render=function(e,t,n){if(!Vb(t))throw Error(ue(200));return Wb(null,e,t,!1,n)};Qr.unmountComponentAtNode=function(e){if(!Vb(e))throw Error(ue(40));return e._reactRootContainer?(wc(function(){Wb(null,null,e,!1,function(){e._reactRootContainer=null,e[Ea]=null})}),!0):!1};Qr.unstable_batchedUpdates=tE;Qr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Vb(n))throw Error(ue(200));if(e==null||e._reactInternals===void 0)throw Error(ue(38));return Wb(e,t,n,!1,r)};Qr.version="18.3.1-next-f1338f8080-20240426";function C6(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(C6)}catch(e){console.error(e)}}C6(),C3.exports=Qr;var ol=C3.exports;const ch=it(ol);var E6,YT=ol;E6=YT.createRoot,YT.hydrateRoot;var sQ=typeof Element<"u",iQ=typeof Map=="function",aQ=typeof Set=="function",oQ=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ox(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ox(e[r],t[r]))return!1;return!0}var a;if(iQ&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;for(a=e.entries();!(r=a.next()).done;)if(!ox(r.value[1],t.get(r.value[0])))return!1;return!0}if(aQ&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(r=a.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(oQ&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;if(sQ&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&e.$$typeof)&&!ox(e[s[r]],t[s[r]]))return!1;return!0}return e!==e&&t!==t}var lQ=function(t,n){try{return ox(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const cQ=it(lQ);var uQ=function(e,t,n,r,s,a,o,l){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,s,a,o,l],d=0;c=new Error(t.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},dQ=uQ;const XT=it(dQ);var hQ=function(t,n,r,s){var a=r?r.call(s,t,n):void 0;if(a!==void 0)return!!a;if(t===n)return!0;
40if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var o=Object.keys(t),l=Object.keys(n);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),u=0;u<o.length;u++){var d=o[u];if(!c(d))return!1;var h=t[d],f=n[d];if(a=r?r.call(s,h,f,d):void 0,a===!1||a===void 0&&h!==f)return!1}return!0};const fQ=it(hQ);var A6=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(A6||{}),aj={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},JT=Object.values(A6),Hb={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},P6=Object.entries(Hb).reduce((e,[t,n])=>(e[n]=t,e),{}),Gs="data-rh",Hu={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},qu=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},mQ=e=>{let t=qu(e,"title");const n=qu(e,Hu.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=qu(e,Hu.DEFAULT_TITLE);return t||r||void 0},pQ=e=>qu(e,Hu.ON_CHANGE_CLIENT_STATE)||(()=>{}),oj=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),gQ=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let a=0;a<s.length;a+=1){const l=s[a].toLowerCase();if(e.indexOf(l)!==-1&&r[l])return n.concat(r)}}return n},[]),yQ=e=>console&&typeof console.warn=="function"&&console.warn(e),Jh=(e,t,n)=>{const r={};return n.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&yQ(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,a)=>{const o={};a.filter(c=>{let u;const d=Object.keys(c);for(let f=0;f<d.length;f+=1){const m=d[f],g=m.toLowerCase();t.indexOf(g)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(g==="rel"&&c[g].toLowerCase()==="stylesheet")&&(u=g),t.indexOf(m)!==-1&&(m==="innerHTML"||m==="cssText"||m==="itemprop")&&(u=m)}if(!u||!c[u])return!1;const h=c[u].toLowerCase();return r[u]||(r[u]={}),o[u]||(o[u]={}),r[u][h]?!1:(o[u][h]=!0,!0)}).reverse().forEach(c=>s.push(c));const l=Object.keys(o);for(let c=0;c<l.length;c+=1){const u=l[c],d={...r[u],...o[u]};r[u]=d}return s},[]).reverse()},xQ=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},vQ=e=>({baseTag:gQ(["href"],e),bodyAttributes:oj("bodyAttributes",e),defer:qu(e,Hu.DEFER),encode:qu(e,Hu.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:oj("htmlAttributes",e),linkTags:Jh("link",["rel","href"],e),metaTags:Jh("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Jh("noscript",["innerHTML"],e),onChangeClientState:pQ(e),scriptTags:Jh("script",["src","innerHTML"],e),styleTags:Jh("style",["cssText"],e),title:mQ(e),titleAttributes:oj("titleAttributes",e),prioritizeSeoTags:xQ(e,Hu.PRIORITIZE_SEO_TAGS)}),T6=e=>Array.isArray(e)?e.join(""):e,bQ=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},lj=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(bQ(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},QT=(e,t)=>({...e,[t]:void 0}),wQ=["noscript","script","style"],US=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),O6=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),jQ=(e,t,n,r)=>{const s=O6(n),a=T6(t);return s?`<${e} ${Gs}="true" ${s}>${US(a,r)}</${e}>`:`<${e} ${Gs}="true">${US(a,r)}</${e}>`},SQ=(e,t,n=!0)=>t.reduce((r,s)=>{const a=s,o=Object.keys(a).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const h=typeof a[d]>"u"?d:`${d}="${US(a[d],n)}"`;return u?`${u} ${h}`:h},""),l=a.innerHTML||a.cssText||"",c=wQ.indexOf(e)===-1;return`${r}<${e} ${Gs}="true" ${o}${c?"/>":`>${l}</${e}>`}`},""),R6=(e,t={})=>Object.keys(e).reduce((n,r)=>{const s=Hb[r];return n[s||r]=e[r],n},t),NQ=(e,t,n)=>{const r={key:t,[Gs]:!0},s=R6(n,r);return[F.createElement("title",s,t)]},lx=(e,t)=>t.map((n,r)=>{const s={key:r,[Gs]:!0};
40return Object.keys(n).forEach(a=>{const l=Hb[a]||a;if(l==="innerHTML"||l==="cssText"){const c=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=n[a]}),F.createElement(e,s)}),ls=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>NQ(e,t.title,t.titleAttributes),toString:()=>jQ(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>R6(t),toString:()=>O6(t)};default:return{toComponent:()=>lx(e,t),toString:()=>SQ(e,t,n)}}},kQ=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const s=lj(e,aj.meta),a=lj(t,aj.link),o=lj(n,aj.script);return{priorityMethods:{toComponent:()=>[...lx("meta",s.priority),...lx("link",a.priority),...lx("script",o.priority)],toString:()=>`${ls("meta",s.priority,r)} ${ls("link",a.priority,r)} ${ls("script",o.priority,r)}`},metaTags:s.default,linkTags:a.default,scriptTags:o.default}},_Q=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:a,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:h,scriptTags:f}=e,m={toComponent:()=>[],toString:()=>""};return u&&({priorityMethods:m,linkTags:d,metaTags:h,scriptTags:f}=kQ(e)),{priority:m,base:ls("base",t,r),bodyAttributes:ls("bodyAttributes",n,r),htmlAttributes:ls("htmlAttributes",s,r),link:ls("link",d,r),meta:ls("meta",h,r),noscript:ls("noscript",a,r),script:ls("script",f,r),style:ls("style",o,r),title:ls("title",{title:l,titleAttributes:c},r)}},VS=_Q,qg=[],cE=!!(typeof window<"u"&&window.document&&window.document.createElement),WS=class{constructor(e,t){Zi(this,"instances",[]);Zi(this,"canUseDOM",cE);Zi(this,"context");Zi(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?qg:this.instances,add:e=>{(this.canUseDOM?qg:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?qg:this.instances).indexOf(e);(this.canUseDOM?qg:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=VS({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},CQ=parseInt(F.version.split(".")[0],10),HS=CQ>=19,EQ={},M6=F.createContext(EQ),Zl,I6=(Zl=class extends y.Component{constructor(n){super(n);Zi(this,"helmetData");HS?this.helmetData=null:this.helmetData=new WS(this.props.context||{},Zl.canUseDOM)}render(){return HS?F.createElement(F.Fragment,null,this.props.children):F.createElement(M6.Provider,{value:this.helmetData.value},this.props.children)}},Zi(Zl,"canUseDOM",cE),Zl),Wc=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${Gs}]`),s=[].slice.call(r),a=[];let o;return t&&t.length&&t.forEach(l=>{const c=document.createElement(e);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText"){const d=l.cssText;c.appendChild(document.createTextNode(d))}else{const d=u,h=typeof l[d]>"u"?"":l[d];c.setAttribute(u,h)}c.setAttribute(Gs,"true"),s.some((u,d)=>(o=d,c.isEqualNode(u)))?s.splice(o,1):a.push(c)}),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),a.forEach(l=>n.appendChild(l)),{oldTags:s,newTags:a}},qS=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Gs),s=r?r.split(","):[],a=[...s],o=Object.keys(t);for(const l of o){const c=t[l]||"";n.getAttribute(l)!==c&&n.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const u=a.indexOf(l);u!==-1&&a.splice(u,1)}for(let l=a.length-1;l>=0;l-=1)n.removeAttribute(a[l]);s.length===a.length?n.removeAttribute(Gs):n.getAttribute(Gs)!==o.join(",")&&n.setAttribute(Gs,o.join(","))},AQ=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=T6(e)),qS("title",t)},ZT=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:a,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:h,titleAttributes:f}=e;qS("body",r),qS("html",s),AQ(h,f);const m={baseTag:Wc("base",n),linkTags:Wc("link",a),metaTags:Wc("meta",o),noscriptTags:Wc("noscript",l),scriptTags:Wc("script",u),styleTags:Wc("style",d)},g={},p={};Object.keys(m).forEach(x=>{const{newTags:v,oldTags:b}=m[x];v.length&&(g[x]=v),b.length&&(p[x]=m[x].oldTags)}),t&&t(),c(e,g,p)},Qh=null,PQ=e=>{Qh&&cancelAnimationFrame(Qh),e.defer?Qh=requestAnimationFrame(()=>{ZT(e,()=>{Qh=null})}):(ZT(e),Qh=null)},TQ=PQ,eO=class extends y.Component{constructor(){super(...arguments);Zi(this,"rendered",!1)}shouldComponentUpdate(t){return!fQ(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const s=vQ(t.get().map(a=>{const{context:o,...l}=a.props;return l}));I6.canUseDOM?TQ(s):VS&&(r=VS(s)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},cx=[],tO=e=>{const t={};for(const n of Object.keys(e))t[P6[n]||n]=e[n];return t},Cl=e=>{const t={};for(const n of Object.keys(e)){const r=Hb[n];t[r||n]=e[n]}return t},nO=(e,t)=>
40{if(!cE)return;const n=document.getElementsByTagName(e)[0];if(!n)return;const r="data-rh-managed",s=n.getAttribute(r),a=s?s.split(","):[],o=Object.keys(t);for(const l of a)o.includes(l)||n.removeAttribute(l);for(const l of o){const c=t[l];c==null||c===!1?n.removeAttribute(l):c===!0?n.setAttribute(l,""):n.setAttribute(l,String(c))}o.length>0?n.setAttribute(r,o.join(",")):n.removeAttribute(r)},cj=()=>{const e={},t={};for(const n of cx){const{htmlAttributes:r,bodyAttributes:s}=n.props;r&&Object.assign(e,tO(r)),s&&Object.assign(t,tO(s))}nO("html",e),nO("body",t)},OQ=class extends y.Component{componentDidMount(){cx.push(this),cj()}componentDidUpdate(){cj()}componentWillUnmount(){const e=cx.indexOf(this);e!==-1&&cx.splice(e,1),cj()}resolveTitle(){const{title:e,titleTemplate:t,defaultTitle:n}=this.props;return e&&t?t.replace(/%s/g,()=>Array.isArray(e)?e.join(""):e):e||n||void 0}renderTitle(){const e=this.resolveTitle();if(e===void 0)return null;const t=this.props.titleAttributes||{};return F.createElement("title",Cl(t),e)}renderBase(){const{base:e}=this.props;return e?F.createElement("base",Cl(e)):null}renderMeta(){const{meta:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>F.createElement("meta",{key:n,...Cl(t)}))}renderLink(){const{link:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>F.createElement("link",{key:n,...Cl(t)}))}renderScript(){const{script:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>{const{innerHTML:r,...s}=t,a=Cl(s);return r&&(a.dangerouslySetInnerHTML={__html:r}),F.createElement("script",{key:n,...a})})}renderStyle(){const{style:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>{const{cssText:r,...s}=t,a=Cl(s);return r&&(a.dangerouslySetInnerHTML={__html:r}),F.createElement("style",{key:n,...a})})}renderNoscript(){const{noscript:e}=this.props;return!e||!Array.isArray(e)?null:e.map((t,n)=>{const{innerHTML:r,...s}=t,a=Cl(s);return r&&(a.dangerouslySetInnerHTML={__html:r}),F.createElement("noscript",{key:n,...a})})}render(){return F.createElement(F.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},Y1,RQ=(Y1=class extends y.Component{shouldComponentUpdate(e){return!cQ(QT(this.props,"helmetData"),QT(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return XT(JT.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${JT.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),XT(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return F.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:s,...a}=r.props,o=Object.keys(a).reduce((c,u)=>(c[P6[u]||u]=a[u],c),{});let{type:l}=r;
40switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(r,s),l){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,o,s);break;default:t=this.mapObjectTypeChildren(r,t,o,s);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof WS)){const s=r;r=new WS(s.context,!0),delete n.helmetData}return HS?F.createElement(OQ,{...n}):r?F.createElement(eO,{...n,context:r.value}):F.createElement(M6.Consumer,null,s=>F.createElement(eO,{...n,context:s}))}},Zi(Y1,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Y1);const MQ=1,IQ=1e6;let uj=0;function $Q(){return uj=(uj+1)%Number.MAX_SAFE_INTEGER,uj.toString()}const dj=new Map,rO=e=>{if(dj.has(e))return;const t=setTimeout(()=>{dj.delete(e),Vf({type:"REMOVE_TOAST",toastId:e})},IQ);dj.set(e,t)},LQ=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,MQ)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?rO(n):e.toasts.forEach(r=>{rO(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ux=[];let dx={toasts:[]};function Vf(e){dx=LQ(dx,e),ux.forEach(t=>{t(dx)})}function Ws({...e}){const t=$Q(),n=s=>Vf({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Vf({type:"DISMISS_TOAST",toastId:t});return Vf({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function We(){const[e,t]=y.useState(dx);return y.useEffect(()=>(ux.push(t),()=>{const n=ux.indexOf(t);n>-1&&ux.splice(n,1)}),[e]),{...e,toast:Ws,dismiss:n=>Vf({type:"DISMISS_TOAST",toastId:n})}}function ge(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function DQ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function $6(...e){return t=>e.forEach(n=>DQ(n,t))}function Ce(...e){return y.useCallback($6(...e),e)}function FQ(e,t){const n=y.createContext(t);function r(a){const{children:o,...l}=a,c=y.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:c,children:o})}function s(a){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function kr(e,t=[]){let n=[];function r(a,o){const l=y.createContext(o),c=n.length;n=[...n,o];function u(h){const{scope:f,children:m,...g}=h,p=(f==null?void 0:f[e][c])||l,x=y.useMemo(()=>g,Object.values(g));return i.jsx(p.Provider,{value:x,children:m})}function d(h,f){const m=(f==null?void 0:f[e][c])||l,g=y.useContext(m);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const s=()=>{const a=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,BQ(s,...t)]}function BQ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const h=c(a)[`__scope${u}`];return{...l,...h}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Ta=y.forwardRef((e,t)=>{const{children:n,...r}=e,s=y.Children.toArray(n),a=s.find(zQ);if(a){const o=a.props.children,l=s.map(c=>c===a?y.Children.count(o)>1?y.Children.only(null):y.isValidElement(o)?o.props.children:null:c);return i.jsx(KS,{...r,ref:t,children:y.isValidElement(o)?y.cloneElement(o,void 0,l):null})}return i.jsx(KS,{...r,ref:t,children:n})});Ta.displayName="Slot";var KS=y.forwardRef((e,t)=>{const{children:n,...r}=e;if(y.isValidElement(n)){const s=VQ(n);return y.cloneElement(n,{...UQ(r,n.props),ref:t?$6(t,s):s})}return y.Children.count(n)>1?y.Children.only(null):null});KS.displayName="SlotClone";var uE=({children:e})=>i.jsx(i.Fragment,{children:e});function zQ(e){return y.isValidElement(e)&&e.type===uE}function UQ(e,t){const n={...t};for(const r in t){const s=e[r],a=t[r];/^on[A-Z]/.test(r)?s&&a?n[r]=(...l)=>{a(...l),s(...l)}:s&&(n[r]=s):r==="style"?n[r]={...s,...a}
vendor: 9,349 bytes, line 40
40:r==="className"&&(n[r]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function VQ(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function dE(e){const t=e+"CollectionProvider",[n,r]=kr(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:g,children:p}=m,x=F.useRef(null),v=F.useRef(new Map).current;return i.jsx(s,{scope:g,itemMap:v,collectionRef:x,children:p})};o.displayName=t;const l=e+"CollectionSlot",c=F.forwardRef((m,g)=>{const{scope:p,children:x}=m,v=a(l,p),b=Ce(g,v.collectionRef);return i.jsx(Ta,{ref:b,children:x})});c.displayName=l;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=F.forwardRef((m,g)=>{const{scope:p,children:x,...v}=m,b=F.useRef(null),w=Ce(g,b),j=a(u,p);return F.useEffect(()=>(j.itemMap.set(b,{ref:b,...v}),()=>void j.itemMap.delete(b))),i.jsx(Ta,{[d]:"",ref:w,children:x})});h.displayName=u;function f(m){const g=a(e+"CollectionConsumer",m);return F.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const v=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((j,S)=>v.indexOf(j.ref.current)-v.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},f,r]}var WQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ve=WQ.reduce((e,t)=>{const n=y.forwardRef((r,s)=>{const{asChild:a,...o}=r,l=a?Ta:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(l,{...o,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function uh(e,t){e&&ol.flushSync(()=>e.dispatchEvent(t))}function dt(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Gp(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e);y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var HQ="DismissableLayer",GS="dismissableLayer.update",qQ="dismissableLayer.pointerDownOutside",KQ="dismissableLayer.focusOutside",sO,L6=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),D6=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=y.useContext(L6),[d,h]=y.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),g=Ce(t,k=>h(k)),p=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(x),b=d?p.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=v,S=YQ(k=>{const _=k.target,C=[...u.branches].some(A=>A.contains(_));!j||C||(s==null||s(k),o==null||o(k),k.defaultPrevented||l==null||l())},f),N=XQ(k=>{const _=k.target;[...u.branches].some(A=>A.contains(_))||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},f);return Gp(k=>{b===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(sO=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),iO(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=sO)}},[d,f,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),iO())},[d,u]),y.useEffect(()=>{const k=()=>m({});return document.addEventListener(GS,k),()=>document.removeEventListener(GS,k)},[]),i.jsx(ve.div,{...c,ref:g,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ge(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ge(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ge(e.onPointerDownCapture,S.onPointerDownCapture)})});D6.displayName=HQ;var GQ="DismissableLayerBranch",F6=y.forwardRef((e,t)=>{const n=y.useContext(L6),r=y.useRef(null),s=Ce(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(ve.div,{...e,ref:s})});F6.displayName=GQ;function YQ(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){B6(qQ,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function XQ(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&B6(KQ,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function iO(){const e=new CustomEvent(GS);document.dispatchEvent(e)}function B6(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?uh(s,a):s.dispatchEvent(a)}var JQ=D6,QQ=F6,Nt=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},ZQ="Portal",z6=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=y.useState(!1);Nt(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ch.createPortal(i.jsx(ve.div,{...r,ref:t}),o):null});z6.displayName=ZQ;function eZ(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var es=e=>{const{present:t,children:n}=e,r=tZ(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Ce(r.ref,nZ(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:a}):null};es.displayName="Presence";function tZ(e){const[t,n]=y.useState(),r=y.useRef({}),s=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=eZ(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=Kg(r.current);a.current=l==="mounted"?u:"none"},[l]),Nt(()=>{const u=r.current,d=s.current;if(d!==e){const f=a.current,m=Kg(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Nt(()=>{if(t){const u=h=>{const m=Kg(r.current).includes(h.animationName);h.target===t&&m&&ol.flushSync(()=>c("ANIMATION_END"))},d=h=>{h.target===t&&(a.current=Kg(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Kg(e){return(e==null?void 0:e.animationName)||"none"}function nZ(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ni({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=rZ({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,l=dt(n),c=y.useCallback(u=>{if(a){const h=typeof u=="function"?u(e):u;h!==e&&l(h)}else s(u)},[a,e,s,l]);return[o,c]}function rZ({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,s=y.useRef(r),a=dt(t);return y.useEffect(()=>{s.current!==r&&(a(r),s.current=r)},[r,s,a]),n}var sZ="VisuallyHidden",Yp=y.forwardRef((e,t)=>i.jsx(ve.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Yp.displayName=sZ;var iZ=Yp,hE="ToastProvider",[fE,aZ,oZ]=dE("Toast"),[U6,x7e]=kr("Toast",[oZ]),[lZ,qb]=U6(hE),V6=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:a=50,children:o}=e,[l,c]=y.useState(null),[u,d]=y.useState(0),h=y.useRef(!1),f=y.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${hE}\`. Expected non-empty \`string\`.`),i.jsx(fE.Provider,{scope:t,children:i.jsx(lZ,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:y.useCallback(()=>d(m=>m+1),[]),onToastRemove:y.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};V6.displayName=hE;var W6="ToastViewport",cZ=["F8"],YS="toast.viewportPause",XS="toast.viewportResume",H6=y.forwardRef((e,t)=>
40{const{__scopeToast:n,hotkey:r=cZ,label:s="Notifications ({hotkey})",...a}=e,o=qb(W6,n),l=aZ(n),c=y.useRef(null),u=y.useRef(null),d=y.useRef(null),h=y.useRef(null),f=Ce(t,h,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;y.useEffect(()=>{const x=v=>{var w;r.every(j=>v[j]||v.code===j)&&((w=h.current)==null||w.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),y.useEffect(()=>{const x=c.current,v=h.current;if(g&&x&&v){const b=()=>{if(!o.isClosePausedRef.current){const N=new CustomEvent(YS);v.dispatchEvent(N),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const N=new CustomEvent(XS);v.dispatchEvent(N),o.isClosePausedRef.current=!1}},j=N=>{!x.contains(N.relatedTarget)&&w()},S=()=>{x.contains(document.activeElement)||w()};return x.addEventListener("focusin",b),x.addEventListener("focusout",j),x.addEventListener("pointermove",b),x.addEventListener("pointerleave",S),window.addEventListener("blur",b),window.addEventListener("focus",w),()=>{x.removeEventListener("focusin",b),x.removeEventListener("focusout",j),x.removeEventListener("pointermove",b),x.removeEventListener("pointerleave",S),window.removeEventListener("blur",b),window.removeEventListener("focus",w)}}},[g,o.isClosePausedRef]);const p=y.useCallback(({tabbingDirection:x})=>{const b=l().map(w=>{const j=w.ref.current,S=[j,...jZ(j)];return x==="forwards"?S:S.reverse()});return(x==="forwards"?b.reverse():b).flat()},[l]);return y.useEffect(()=>{const x=h.current;if(x){const v=b=>{var S,N,k;const w=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!w){const _=document.activeElement,C=b.shiftKey;if(b.target===x&&C){(S=u.current)==null||S.focus();return}const P=p({tabbingDirection:C?"backwards":"forwards"}),$=P.findIndex(R=>R===_);hj(P.slice($+1))?b.preventDefault():C?(N=u.current)==null||N.focus():(k=d.current)==null||k.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[l,p]),i.jsxs(QQ,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&i.jsx(JS,{ref:u,onFocusFromOutsideViewport:()=>{const x=p({tabbingDirection:"forwards"});hj(x)}}),i.jsx(fE.Slot,{scope:n,children:i.jsx(ve.ol,{tabIndex:-1,...a,ref:f})}),g&&i.jsx(JS,{ref:d,onFocusFromOutsideViewport:()=>{const x=p({tabbingDirection:"backwards"});hj(x)}})]})});H6.displayName=W6;var q6="ToastFocusProxy",JS=y.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,a=qb(q6,n);return i.jsx(Yp,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});JS.displayName=q6;var Kb="Toast",uZ="toast.swipeStart",dZ="toast.swipeMove",hZ="toast.swipeCancel",fZ="toast.swipeEnd",K6=y.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:a,...o}=e,[l=!0,c]=ni({prop:r,defaultProp:s,onChange:a});return i.jsx(es,{present:n||l,children:i.jsx(gZ,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:dt(e.onPause),onResume:dt(e.onResume),onSwipeStart:ge(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ge(e.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ge(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ge(e.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});K6.displayName=Kb;var[mZ,pZ]=U6(Kb,{onClose(){}}),gZ=y.forwardRef((e,t)=>
40{const{__scopeToast:n,type:r="foreground",duration:s,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:m,...g}=e,p=qb(Kb,n),[x,v]=y.useState(null),b=Ce(t,R=>v(R)),w=y.useRef(null),j=y.useRef(null),S=s||p.duration,N=y.useRef(0),k=y.useRef(S),_=y.useRef(0),{onToastAdd:C,onToastRemove:A}=p,E=dt(()=>{var L;(x==null?void 0:x.contains(document.activeElement))&&((L=p.viewport)==null||L.focus()),o()}),P=y.useCallback(R=>{!R||R===1/0||(window.clearTimeout(_.current),N.current=new Date().getTime(),_.current=window.setTimeout(E,R))},[E]);y.useEffect(()=>{const R=p.viewport;if(R){const L=()=>{P(k.current),u==null||u()},D=()=>{const I=new Date().getTime()-N.current;k.current=k.current-I,window.clearTimeout(_.current),c==null||c()};return R.addEventListener(YS,D),R.addEventListener(XS,L),()=>{R.removeEventListener(YS,D),R.removeEventListener(XS,L)}}},[p.viewport,S,c,u,P]),y.useEffect(()=>{a&&!p.isClosePausedRef.current&&P(S)},[a,S,p.isClosePausedRef,P]),y.useEffect(()=>(C(),()=>A()),[C,A]);const $=y.useMemo(()=>x?eB(x):null,[x]);return p.viewport?i.jsxs(i.Fragment,{children:[$&&i.jsx(yZ,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:$}),i.jsx(mZ,{scope:n,onClose:E,children:ol.createPortal(i.jsx(fE.ItemSlot,{scope:n,children:i.jsx(JQ,{asChild:!0,onEscapeKeyDown:ge(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||E(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...g,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ge(e.onKeyDown,R=>{R.key==="Escape"&&(l==null||l(R.nativeEvent),R.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:ge(e.onPointerDown,R=>{R.button===0&&(w.current={x:R.clientX,y:R.clientY})}),onPointerMove:ge(e.onPointerMove,R=>{if(!w.current)return;const L=R.clientX-w.current.x,D=R.clientY-w.current.y,I=!!j.current,M=["left","right"].includes(p.swipeDirection),H=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,T=M?H(0,L):0,B=M?0:H(0,D),Y=R.pointerType==="touch"?10:2,O={x:T,y:B},W={originalEvent:R,delta:O};I?(j.current=O,Gg(dZ,h,W,{discrete:!1})):aO(O,p.swipeDirection,Y)?(j.current=O,Gg(uZ,d,W,{discrete:!1}),R.target.setPointerCapture(R.pointerId)):(Math.abs(L)>Y||Math.abs(D)>Y)&&(w.current=null)}),onPointerUp:ge(e.onPointerUp,R=>{const L=j.current,D=R.target;if(D.hasPointerCapture(R.pointerId)&&D.releasePointerCapture(R.pointerId),j.current=null,w.current=null,L){const I=R.currentTarget,M={originalEvent:R,delta:L};aO(L,p.swipeDirection,p.swipeThreshold)?Gg(fZ,m,M,{discrete:!0}):Gg(hZ,f,M,{discrete:!0}),I.addEventListener("click",H=>H.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),yZ=e=>{const{__scopeToast:t,children:n,...r}=e,s=qb(Kb,t),[a,o]=y.useState(!1),[l,c]=y.useState(!1);return bZ(()=>o(!0)),y.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:i.jsx(z6,{asChild:!0,children:i.jsx(Yp,{...r,children:a&&i.jsxs(i.Fragment,{children:[s.label," ",n]})})})},xZ="ToastTitle",G6=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(ve.div,{...r,ref:t})});G6.displayName=xZ;var vZ="ToastDescription",Y6=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return i.jsx(ve.div,{...r,ref:t})});Y6.displayName=vZ;var X6="ToastAction",J6=y.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?i.jsx(Z6,{altText:n,asChild:!0,children:i.jsx(mE,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${X6}\`. Expected non-empty \`string\`.`),null)});J6.displayName=X6;var Q6="ToastClose",mE=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=pZ(Q6,n);return i.jsx(Z6,{asChild:!0,children:i.jsx(ve.button,{type:"button",...r,ref:t,onClick:ge(e.onClick,s.onClose)})})});mE.displayName=Q6;var Z6=y.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return i.jsx(ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function eB(e){const t=[];
vendor: 4,147 bytes, lines 40-64
40return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),wZ(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...eB(r))}}),t}function Gg(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?uh(s,a):s.dispatchEvent(a)}var aO=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),a=r>s;return t==="left"||t==="right"?a&&r>n:!a&&s>n};function bZ(e=()=>{}){const t=dt(e);Nt(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function wZ(e){return e.nodeType===e.ELEMENT_NODE}function jZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function hj(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var SZ=V6,tB=H6,nB=K6,rB=G6,sB=Y6,iB=J6,aB=mE;function oB(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=oB(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ze(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=oB(e))&&(r&&(r+=" "),r+=t);return r}const oO=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lO=Ze,Xp=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return lO(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:a}=t,o=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],h=a==null?void 0:a[u];if(d===null)return null;const f=oO(d)||oO(h);return s[u][f]}),l=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...m}=d;return Object.entries(m).every(g=>{let[p,x]=g;return Array.isArray(x)?x.includes({...a,...l}[p]):{...a,...l}[p]===x})?[...u,h,f]:u},[]);return lO(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/** 41 * @license lucide-react v0.462.0 - ISC 42 * 43 * This source code is licensed under the ISC license. 44 * See the LICENSE file in the root directory of this source tree. 45 */const NZ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lB=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** 46 * @license lucide-react v0.462.0 - ISC 47 * 48 * This source code is licensed under the ISC license. 49 * See the LICENSE file in the root directory of this source tree. 50 */var kZ={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"};/** 51 * @license lucide-react v0.462.0 - ISC 52 * 53 * This source code is licensed under the ISC license. 54 * See the LICENSE file in the root directory of this source tree. 55 */const _Z=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>y.createElement("svg",{ref:c,...kZ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:lB("lucide",s),...l},[...o.map(([u,d])=>y.createElement(u,d)),...Array.isArray(a)?a:[a]]));/** 56 * @license lucide-react v0.462.0 - ISC 57 * 58 * This source code is licensed under the ISC license. 59 * See the LICENSE file in the root directory of this source tree. 60 */const Z=(e,t)=>{const n=y.forwardRef(({className:r,...s},a)=>y.createElement(_Z,{ref:a,iconNode:t,className:lB(`lucide-${NZ(e)}`,r),...s}));return n.displayName=`${e}`,n};/** 61 * @license lucide-react v0.462.0 - ISC 62 * 63 * This source code is licensed under the ISC license. 64 * See the LICENSE file in the root directory of this source tree.
65 */const pE=Z("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 66 * @license lucide-react v0.462.0 - ISC 67 * 68 * This source code is licensed under the ISC license. 69 * See the LICENSE file in the root directory of this source tree. 70 */const CZ=Z("Apple",[["path",{d:"M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z",key:"3s7exb"}],["path",{d:"M10 2c1 .5 2 2 2 5",key:"fcco2y"}]]);/** 71 * @license lucide-react v0.462.0 - ISC 72 * 73 * This source code is licensed under the ISC license. 74 * See the LICENSE file in the root directory of this source tree. 75 */const jt=Z("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 76 * @license lucide-react v0.462.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const ya=Z("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 81 * @license lucide-react v0.462.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */const EZ=Z("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** 86 * @license lucide-react v0.462.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const Fr=Z("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 91 * @license lucide-react v0.462.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const jc=Z("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 96 * @license lucide-react v0.462.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const Ho=Z("Bird",[["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20",key:"oj1oa8"}],["path",{d:"m20 7 2 .5-2 .5",key:"12nv4d"}],["path",{d:"M10 18v3",key:"1yea0a"}],["path",{d:"M14 17.75V21",key:"1pymcb"}],["path",{d:"M7 18a6 6 0 0 0 3.84-10.61",key:"1npnn0"}]]);/** 101 * @license lucide-react v0.462.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const AZ=Z("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/** 106 * @license lucide-react v0.462.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const tn=Z("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 111 * @license lucide-react v0.462.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const cO=Z("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/** 116 * @license lucide-react v0.462.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const PZ=Z("Box",[["path",{d:"M21 8a2 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.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** 121 * @license lucide-react v0.462.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const TZ=Z("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** 126 * @license lucide-react v0.462.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const OZ=Z("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 131 * @license lucide-react v0.462.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const dh=Z("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
135],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 136 * @license lucide-react v0.462.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const RZ=Z("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const cB=Z("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const ys=Z("Calendar",[["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"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const xa=Z("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const Xr=Z("ChartColumn",[["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"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const MZ=Z("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const uB=Z("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const IZ=Z("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const $r=Z("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const gE=Z("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const dB=Z("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const Qs=Z("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const $Z=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const QS=Z("CircleAlert",[["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"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const Dt=Z("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const qr=Z("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const hB=Z("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const LZ=Z("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const Jp=Z("CircleX",[["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"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const DZ=Z("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree.
240 */const cc=Z("ClipboardList",[["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"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const js=Z("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const FZ=Z("CloudRain",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 14v6",key:"1j4efv"}],["path",{d:"M8 14v6",key:"17c4r9"}],["path",{d:"M12 16v6",key:"c8a4gj"}]]);/** 251 * @license lucide-react v0.462.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const fB=Z("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 256 * @license lucide-react v0.462.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree. 260 */const ZS=Z("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 261 * @license lucide-react v0.462.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const BZ=Z("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 266 * @license lucide-react v0.462.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const Sc=Z("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 271 * @license lucide-react v0.462.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const qo=Z("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 276 * @license lucide-react v0.462.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree. 280 */const mB=Z("Droplets",[["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"}]]);/** 281 * @license lucide-react v0.462.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const zZ=Z("Drumstick",[["path",{d:"M15.4 15.63a7.875 6 135 1 1 6.23-6.23 4.5 3.43 135 0 0-6.23 6.23",key:"1dtqwm"}],["path",{d:"m8.29 12.71-2.6 2.6a2.5 2.5 0 1 0-1.65 4.65A2.5 2.5 0 1 0 8.7 18.3l2.59-2.59",key:"1oq1fw"}]]);/** 286 * @license lucide-react v0.462.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree. 290 */const yE=Z("Egg",[["path",{d:"M12 22c6.23-.05 7.87-5.57 7.5-10-.36-4.34-3.95-9.96-7.5-10-3.55.04-7.14 5.66-7.5 10-.37 4.43 1.27 9.95 7.5 10z",key:"1c39pg"}]]);/** 291 * @license lucide-react v0.462.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree. 295 */const pB=Z("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 296 * @license lucide-react v0.462.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const UZ=Z("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 301 * @license lucide-react v0.462.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const En=Z("FileText",[["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:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 306 * @license lucide-react v0.462.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const gB=Z("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 311 * @license lucide-react v0.462.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const VZ=Z("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** 316 * @license lucide-react v0.462.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const Cd=Z("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 321 * @license lucide-react v0.462.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const Oa=Z("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** 326 * @license lucide-react v0.462.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const WZ=Z("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/** 331 * @license lucide-react v0.462.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const HZ=Z("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/** 336 * @license lucide-react v0.462.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const Zs=Z("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 341 * @license lucide-react v0.462.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const xE=Z("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 346 * @license lucide-react v0.462.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const yB=Z("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 351 * @license lucide-react v0.462.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const qZ=Z("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 356 * @license lucide-react v0.462.0 - ISC 357 * 358 * This source code is licensed under the ISC license. 359 * See the LICENSE file in the root directory of this source tree. 360 */const KZ=Z("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** 361 * @license lucide-react v0.462.0 - ISC 362 * 363 * This source code is licensed under the ISC license. 364 * See the LICENSE file in the root directory of this source tree. 365 */const GZ=Z("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 366 * @license lucide-react v0.462.0 - ISC 367 * 368 * This source code is licensed under the ISC license. 369 * See the LICENSE file in the root directory of this source tree. 370 */const xB=Z("Leaf",[["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"}]]);/** 371 * @license lucide-react v0.462.0 - ISC 372 * 373 * This source code is licensed under the ISC license. 374 * See the LICENSE file in the root directory of this source tree. 375 */const an=Z("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** 376 * @license lucide-react v0.462.0 - ISC 377 * 378 * This source code is licensed under the ISC license. 379 * See the LICENSE file in the root directory of this source tree.
380 */const YZ=Z("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** 381 * @license lucide-react v0.462.0 - ISC 382 * 383 * This source code is licensed under the ISC license. 384 * See the LICENSE file in the root directory of this source tree. 385 */const Jr=Z("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 386 * @license lucide-react v0.462.0 - ISC 387 * 388 * This source code is licensed under the ISC license. 389 * See the LICENSE file in the root directory of this source tree. 390 */const XZ=Z("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 391 * @license lucide-react v0.462.0 - ISC 392 * 393 * This source code is licensed under the ISC license. 394 * See the LICENSE file in the root directory of this source tree. 395 */const JZ=Z("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** 396 * @license lucide-react v0.462.0 - ISC 397 * 398 * This source code is licensed under the ISC license. 399 * See the LICENSE file in the root directory of this source tree. 400 */const vE=Z("LogOut",[["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"}]]);/** 401 * @license lucide-react v0.462.0 - ISC 402 * 403 * This source code is licensed under the ISC license. 404 * See the LICENSE file in the root directory of this source tree. 405 */const QZ=Z("MailX",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h9",key:"1j9vog"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m17 17 4 4",key:"1b3523"}],["path",{d:"m21 17-4 4",key:"uinynz"}]]);/** 406 * @license lucide-react v0.462.0 - ISC 407 * 408 * This source code is licensed under the ISC license. 409 * See the LICENSE file in the root directory of this source tree. 410 */const Ua=Z("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 411 * @license lucide-react v0.462.0 - ISC 412 * 413 * This source code is licensed under the ISC license. 414 * See the LICENSE file in the root directory of this source tree. 415 */const ts=Z("MapPin",[["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"}]]);/** 416 * @license lucide-react v0.462.0 - ISC 417 * 418 * This source code is licensed under the ISC license. 419 * See the LICENSE file in the root directory of this source tree. 420 */const ZZ=Z("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 421 * @license lucide-react v0.462.0 - ISC 422 * 423 * This source code is licensed under the ISC license. 424 * See the LICENSE file in the root directory of this source tree. 425 */const Ko=Z("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 426 * @license lucide-react v0.462.0 - ISC 427 * 428 * This source code is licensed under the ISC license. 429 * See the LICENSE file in the root directory of this source tree. 430 */const Pm=Z("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 431 * @license lucide-react v0.462.0 - ISC 432 * 433 * This source code is licensed under the ISC license. 434 * See the LICENSE file in the root directory of this source tree. 435 */const vB=Z("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 436 * @license lucide-react v0.462.0 - ISC 437 * 438 * This source code is licensed under the ISC license. 439 * See the LICENSE file in the root directory of this source tree. 440 */const eee=Z("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** 441 * @license lucide-react v0.462.0 - ISC 442 * 443 * This source code is licensed under the ISC license. 444 * See the LICENSE file in the root directory of this source tree. 445 */const bB=Z("Package",[["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"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** 446 * @license lucide-react v0.462.0 - ISC 447 * 448 * This source code is licensed under the ISC license. 449 * See the LICENSE file in the root directory of this source tree. 450 */const wB=Z("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/** 451 * @license lucide-react v0.462.0 - ISC 452 * 453 * This source code is licensed under the ISC license. 454 * See the LICENSE file in the root directory of this source tree. 455 */const tee=Z("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 456 * @license lucide-react v0.462.0 - ISC 457 * 458 * This source code is licensed under the ISC license. 459 * See the LICENSE file in the root directory of this source tree. 460 */const nee=Z("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** 461 * @license lucide-react v0.462.0 - ISC 462 * 463 * This source code is licensed under the ISC license. 464 * See the LICENSE file in the root directory of this source tree. 465 */const ri=Z("Phone",[["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"}]]);/** 466 * @license lucide-react v0.462.0 - ISC 467 * 468 * This source code is licensed under the ISC license. 469 * See the LICENSE file in the root directory of this source tree. 470 */const ree=Z("Pill",[["path",{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z",key:"wa1lgi"}],["path",{d:"m8.5 8.5 7 7",key:"rvfmvr"}]]);/** 471 * @license lucide-react v0.462.0 - ISC 472 * 473 * This source code is licensed under the ISC license. 474 * See the LICENSE file in the root directory of this source tree. 475 */const bE=Z("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 476 * @license lucide-react v0.462.0 - ISC 477 * 478 * This source code is licensed under the ISC license. 479 * See the LICENSE file in the root directory of this source tree. 480 */const rn=Z("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 481 * @license lucide-react v0.462.0 - ISC 482 * 483 * This source code is licensed under the ISC license. 484 * See the LICENSE file in the root directory of this source tree. 485 */const jB=Z("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/** 486 * @license lucide-react v0.462.0 - ISC 487 * 488 * This source code is licensed under the ISC license. 489 * See the LICENSE file in the root directory of this source tree. 490 */const SB=Z("RotateCcw",[["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"}]]);/** 491 * @license lucide-react v0.462.0 - ISC 492 * 493 * This source code is licensed under the ISC license. 494 * See the LICENSE file in the root directory of this source tree. 495 */const NB=Z("Save",[["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"}]]);/** 496 * @license lucide-react v0.462.0 - ISC 497 * 498 * This source code is licensed under the ISC license. 499 * See the LICENSE file in the root directory of this source tree. 500 */const wE=Z("Scale",[["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"}
500],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** 501 * @license lucide-react v0.462.0 - ISC 502 * 503 * This source code is licensed under the ISC license. 504 * See the LICENSE file in the root directory of this source tree. 505 */const Qp=Z("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 506 * @license lucide-react v0.462.0 - ISC 507 * 508 * This source code is licensed under the ISC license. 509 * See the LICENSE file in the root directory of this source tree. 510 */const Ed=Z("Send",[["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"}]]);/** 511 * @license lucide-react v0.462.0 - ISC 512 * 513 * This source code is licensed under the ISC license. 514 * See the LICENSE file in the root directory of this source tree. 515 */const eN=Z("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 516 * @license lucide-react v0.462.0 - ISC 517 * 518 * This source code is licensed under the ISC license. 519 * See the LICENSE file in the root directory of this source tree. 520 */const kB=Z("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 521 * @license lucide-react v0.462.0 - ISC 522 * 523 * This source code is licensed under the ISC license. 524 * See the LICENSE file in the root directory of this source tree. 525 */const see=Z("ShieldAlert",[["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"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** 526 * @license lucide-react v0.462.0 - ISC 527 * 528 * This source code is licensed under the ISC license. 529 * See the LICENSE file in the root directory of this source tree. 530 */const Ad=Z("ShieldCheck",[["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"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 531 * @license lucide-react v0.462.0 - ISC 532 * 533 * This source code is licensed under the ISC license. 534 * See the LICENSE file in the root directory of this source tree. 535 */const iee=Z("ShieldX",[["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"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);/** 536 * @license lucide-react v0.462.0 - ISC 537 * 538 * This source code is licensed under the ISC license. 539 * See the LICENSE file in the root directory of this source tree. 540 */const ll=Z("Shield",[["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"}]]);/** 541 * @license lucide-react v0.462.0 - ISC 542 * 543 * This source code is licensed under the ISC license. 544 * See the LICENSE file in the root directory of this source tree. 545 */const mo=Z("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",ke
545y:"9zh506"}]]);/** 546 * @license lucide-react v0.462.0 - ISC 547 * 548 * This source code is licensed under the ISC license. 549 * See the LICENSE file in the root directory of this source tree. 550 */const uO=Z("Skull",[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]]);/** 551 * @license lucide-react v0.462.0 - ISC 552 * 553 * This source code is licensed under the ISC license. 554 * See the LICENSE file in the root directory of this source tree. 555 */const Tm=Z("Sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);/** 556 * @license lucide-react v0.462.0 - ISC 557 * 558 * This source code is licensed under the ISC license. 559 * See the LICENSE file in the root directory of this source tree. 560 */const jE=Z("SquarePen",[["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"}]]);/** 561 * @license lucide-react v0.462.0 - ISC 562 * 563 * This source code is licensed under the ISC license. 564 * See the LICENSE file in the root directory of this source tree. 565 */const Xx=Z("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 566 * @license lucide-react v0.462.0 - ISC 567 * 568 * This source code is licensed under the ISC license. 569 * See the LICENSE file in the root directory of this source tree. 570 */const Tu=Z("Star",[["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"}]]);/** 571 * @license lucide-react v0.462.0 - ISC 572 * 573 * This source code is licensed under the ISC license. 574 * See the LICENSE file in the root directory of this source tree. 575 */const Pd=Z("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/** 576 * @license lucide-react v0.462.0 - ISC 577 * 578 * This source code is licensed under the ISC license. 579 * See the LICENSE file in the root directory of this source tree. 580 */const aee=Z("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** 581 * @license lucide-react v0.462.0 - ISC 582 * 583 * This source code is licensed under the ISC license. 584 * See the LICENSE file in the root directory of this source tree. 585 */const Gb=Z("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 586 * @license lucide-react v0.462.0 - ISC 587 * 588 * This source code is licensed under the ISC license. 589 * See the LICENSE file in the root directory of this source tree. 590 */const oee=Z("ThermometerSun",[["path",{d:"M12 9a4 4 0 0 0-2 7.5",key:"1jvsq6"}],["path",{d:"M12 3v2",key:"1w22ol"}],["path",{d:"m6.6 18.4-1.4 1.4",key:"w2yidj"}],["path",{d:"M20 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"iof6y5"}],["path",{d:"M4 13H2",key:"118le4"}],["path",{d:"M6.34 7.34 4.93 5.93",key:"1brd51"}
590]]);/** 591 * @license lucide-react v0.462.0 - ISC 592 * 593 * This source code is licensed under the ISC license. 594 * See the LICENSE file in the root directory of this source tree. 595 */const lee=Z("Thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);/** 596 * @license lucide-react v0.462.0 - ISC 597 * 598 * This source code is licensed under the ISC license. 599 * See the LICENSE file in the root directory of this source tree. 600 */const cee=Z("Tractor",[["path",{d:"m10 11 11 .9a1 1 0 0 1 .8 1.1l-.665 4.158a1 1 0 0 1-.988.842H20",key:"she1j9"}],["path",{d:"M16 18h-5",key:"bq60fd"}],["path",{d:"M18 5a1 1 0 0 0-1 1v5.573",key:"1kv8ia"}],["path",{d:"M3 4h8.129a1 1 0 0 1 .99.863L13 11.246",key:"1q1ert"}],["path",{d:"M4 11V4",key:"9ft8pt"}],["path",{d:"M7 15h.01",key:"k5ht0j"}],["path",{d:"M8 10.1V4",key:"1jgyzo"}],["circle",{cx:"18",cy:"18",r:"2",key:"1emm8v"}],["circle",{cx:"7",cy:"15",r:"5",key:"ddtuc"}]]);/** 601 * @license lucide-react v0.462.0 - ISC 602 * 603 * This source code is licensed under the ISC license. 604 * See the LICENSE file in the root directory of this source tree. 605 */const cl=Z("Trash2",[["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"}]]);/** 606 * @license lucide-react v0.462.0 - ISC 607 * 608 * This source code is licensed under the ISC license. 609 * See the LICENSE file in the root directory of this source tree. 610 */const uee=Z("Trees",[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"1l6gj6"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]]);/** 611 * @license lucide-react v0.462.0 - ISC 612 * 613 * This source code is licensed under the ISC license. 614 * See the LICENSE file in the root directory of this source tree. 615 */const tN=Z("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** 616 * @license lucide-react v0.462.0 - ISC 617 * 618 * This source code is licensed under the ISC license. 619 * See the LICENSE file in the root directory of this source tree. 620 */const Wt=Z("TrendingUp",[["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"}]]);/** 621 * @license lucide-react v0.462.0 - ISC 622 * 623 * This source code is licensed under the ISC license. 624 * See the LICENSE file in the root directory of this source tree. 625 */const Ra=Z("TriangleAlert",[["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"}]]);/** 626 * @license lucide-react v0.462.0 - ISC 627 * 628 * This source code is licensed under the ISC license. 629 * See the LICENSE file in the root directory of this source tree. 630 */const dee=Z("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 631 * @license lucide-react v0.462.0 - ISC 632 * 633 * This source code is licensed under the ISC license. 634 * See the LICENSE file in the root directory of this source tree. 635 */const _B=Z("Truck",[["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"}]]);/** 636 * @license lucide-react v0.462.0 - ISC 637 * 638 * This source code is licensed under the ISC license. 639 * See the LICENSE file in the root directory of this source tree. 640 */const Yb=Z("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 641 * @license lucide-react v0.462.0 - ISC 642 * 643 * This source code is licensed under the ISC license. 644 * See the LICENSE file in the root directory of this source tree. 645 */const dO=Z("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);/** 646 * @license lucide-react v0.462.0 - ISC 647 * 648 * This source code is licensed under the ISC license. 649 * See the LICENSE file in the root directory of this source tree. 650 */const CB=Z("UserPlus",[["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"}]]);/** 651 * @license lucide-react v0.462.0 - ISC 652 * 653 * This source code is licensed under the ISC license. 654 * See the LICENSE file in the root directory of this source tree. 655 */const Xb=Z("User",[["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"}]]);/** 656 * @license lucide-react v0.462.0 - ISC 657 * 658 * This source code is licensed under the ISC license. 659 * See the LICENSE file in the root directory of this source tree. 660 */const ht=Z("Users",[["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"}]]);/** 661 * @license lucide-react v0.462.0 - ISC 662 * 663 * This source code is licensed under the ISC license. 664 * See the LICENSE file in the root directory of this source tree. 665 */const EB=Z("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** 666 * @license lucide-react v0.462.0 - ISC 667 * 668 * This source code is licensed under the ISC license. 669 * See the LICENSE file in the root directory of this source tree. 670 */const hee=Z("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** 671 * @license lucide-react v0.462.0 - ISC 672 * 673 * This source code is licensed under the ISC license. 674 * See the LICENSE file in the root directory of this source tree. 675 */const hO=Z("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/** 676 * @license lucide-react v0.462.0 - ISC 677 * 678 * This source code is licensed under the ISC license. 679 * See the LICENSE file in the root directory of this source tree. 680 */const fee=Z("Warehouse",[["path",{d:"M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z",key:"gksnxg"}],["path",{d:"M6 18h12",key:"9pbo8z"}],["path",{d:"M6 14h12",key:"4cwo0f"}],["rect",{width:"12",height:"12",x:"6",y:"10",key:"apd30q"}]]);/** 681 * @license lucide-react v0.462.0 - ISC 682 * 683 * This source code is licensed under the ISC license. 684 * See the LICENSE file in the root directory of this source tree. 685 */const SE=Z("Wheat",[["path",{d:"M2 22 16 8",key:"60hf96"}],["path",{d:"M3.47 12.53 5 11l1.53 1.53a3.5 3.5 0 0 1 0 4.94L5 19l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1rdhi6"}],["path",{d:"M7.47 8.53 9 7l1.53 1.53a3.5 3.5 0 0 1 0 4.94L9 15l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"1sdzmb"}],["path",{d:"M11.47 4.53 13 3l1.53 1.53a3.5 3.5 0 0 1 0 4.94L13 11l-1.53-1.53a3.5 3.5 0 0 1 0-4.94Z",key:"eoatbi"}],["path",{d:"M20 2h2v2a4 4 0 0 1-4 4h-2V6a4 4 0 0 1 4-4Z",key:"19rau1"}],["path",{d:"M11.47 17.47 13 19l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L5 19l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"tc8ph9"}],["path",{d:"M15.47 13.47 17 15l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L9 15l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"2m8kc5"}],["path",{d:"M19.47 9.47 21 11l-1.53 1.53a3.5 3.5 0 0 1-4.94 0L13 11l1.53-1.53a3.5 3.5 0 0 1 4.94 0Z",key:"vex3ng"}]]);/** 686 * @license lucide-react v0.462.0 - ISC 687 * 688 * This source code is licensed under the ISC license. 689 * See the LICENSE file in the root directory of this source tree. 690 */const mee=Z("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}
vendor: 5,815 bytes, lines 690-700
690],["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"}]]);/** 691 * @license lucide-react v0.462.0 - ISC 692 * 693 * This source code is licensed under the ISC license. 694 * See the LICENSE file in the root directory of this source tree. 695 */const hh=Z("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 696 * @license lucide-react v0.462.0 - ISC 697 * 698 * This source code is licensed under the ISC license. 699 * See the LICENSE file in the root directory of this source tree. 700 */const Wf=Z("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),NE="-",pee=e=>{const t=yee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(NE);return l[0]===""&&l.length!==1&&l.shift(),AB(l,t)||gee(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},AB=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?AB(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(NE);return(o=t.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},fO=/^\[(.+)\]$/,gee=e=>{if(fO.test(e)){const t=fO.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},yee=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return vee(Object.entries(e.classGroups),n).forEach(([a,o])=>{nN(o,r,a,t)}),r},nN=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:mO(t,s);a.classGroupId=n;return}if(typeof s=="function"){if(xee(s)){nN(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,o])=>{nN(o,mO(t,a),n,r)})})},mO=(e,t)=>{let n=e;return t.split(NE).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},xee=e=>e.isThemeGetter,vee=(e,t)=>t?e.map(([n,r])=>{const s=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[t+o,l])):a);return[n,s]}):e,bee=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let o=n.get(a);if(o!==void 0)return o;if((o=r.get(a))!==void 0)return s(a,o),o},set(a,o){n.has(a)?n.set(a,o):s(a,o)}}},PB="!",wee=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],a=t.length,o=l=>{const c=[];let u=0,d=0,h;for(let x=0;x<l.length;x++){let v=l[x];if(u===0){if(v===s&&(r||l.slice(x,x+a)===t)){c.push(l.slice(d,x)),d=x+a;continue}if(v==="/"){h=x;continue}}v==="["?u++:v==="]"&&u--}const f=c.length===0?l:l.substring(d),m=f.startsWith(PB),g=m?f.substring(1):f,p=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:p}};return n?l=>n({className:l,parseClassName:o}):o},jee=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},See=e=>({cache:bee(e.cacheSize),parseClassName:wee(e),...pee(e)}),Nee=/\s+/,kee=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,a=[],o=e.trim().split(Nee);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:m}=n(u);let g=!!m,p=r(g?f.substring(0,m):f);if(!p){if(!g){l=u+(l.length>0?" "+l:l);continue}if(p=r(f),!p){l=u+(l.length>0?" "+l:l);continue}g=!1}const x=jee(d).join(":"),v=h?x+PB:x,b=v+p;if(a.includes(b))continue;a.push(b);const w=s(p,g);for(let j=0;j<w.length;++j){const S=w[j];a.push(v+S)}l=u+(l.length>0?" "+l:l)}return l};function _ee(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=TB(t))&&(r&&(r+=" "),r+=n);return r}const TB=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=TB(e[r]))&&(n&&(n+=" "),n+=t);return n};function Cee(e,...t){let n,r,s,a=o;function o(c){const u=t.reduce((d,h)=>h(d),e());return n=See(u),r=n.cache.get,s=n.cache.set,a=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=kee(c,n);return s(c,d),d}return function(){return a(_ee.apply(null,arguments))}}const It=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},OB=/^\[(?:([a-z-]+):)?(.+)\]$/i,Eee=/^\d+\/\d+$/,Aee=new Set(["px","full","screen"]),Pee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tee=/\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$/,Oee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ree=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ea=e=>Ku(e)||Aee.has(e)||Eee.test(e),Ja=e=>fh(e,"length",Uee),Ku=e=>!!e&&!Number.isNaN(Number(e)),fj=e=>fh(e,"number",Ku),Zh=e=>!!e&&Number.isInteger(Number(e)),Iee=e=>e.endsWith("%")&&Ku(e.slice(0,-1)),De=e=>OB.test(e),Qa=e=>Pee.test(e),$ee=new Set(["length","size","percentage"]),Lee=e=>fh(e,$ee,RB),Dee=e=>fh(e,"position",RB),Fee=new Set(["image","url"]),Bee=e=>fh(e,Fee,Wee),zee=e=>fh(e,"",Vee),ef=()=>!0,fh=(e,t,n)=>{const r=OB.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Uee=e=>Tee.test(e)&&!Oee.test(e),RB=()=>!1,Vee=e=>Ree.test(e),Wee=e=>Mee.test(e),Hee=()=>{const e=It("colors"),t=It("spacing"),n=It("blur"),r=It("brightness"),s=It("borderColor"),a=It("borderRadius"),o=It("borderSpacing"),l=It("borderWidth"),c=It("contrast"),u=It("grayscale"),d=It("hueRotate"),h=It("invert"),f=It("gap"),m=It("gradientColorStops"),g=It("gradientColorStopPositions"),p=It("inset"),x=It("margin"),v=
vendor: 12,375 bytes, line 700
700It("opacity"),b=It("padding"),w=It("saturate"),j=It("scale"),S=It("sepia"),N=It("skew"),k=It("space"),_=It("translate"),C=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",De,t],P=()=>[De,t],$=()=>["",ea,Ja],R=()=>["auto",Ku,De],L=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],H=()=>["","0",De],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Ku,De];return{cacheSize:500,separator:":",theme:{colors:[ef],spacing:[ea,Ja],blur:["none","",Qa,De],brightness:B(),borderColor:[e],borderRadius:["none","","full",Qa,De],borderSpacing:P(),borderWidth:$(),contrast:B(),grayscale:H(),hueRotate:B(),invert:H(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[Iee,Ja],inset:E(),margin:E(),opacity:B(),padding:P(),saturate:B(),scale:B(),sepia:H(),skew:B(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",De]}],container:["container"],columns:[{columns:[Qa]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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"],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:[...L(),De]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zh,De]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",De]}],grow:[{grow:H()}],shrink:[{shrink:H()}],order:[{order:["first","last","none",Zh,De]}],"grid-cols":[{"grid-cols":[ef]}],"col-start-end":[{col:["auto",{span:["full",Zh,De]},De]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[ef]}],"row-start-end":[{row:["auto",{span:[Zh,De]},De]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",De]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",De]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",De,t]}],"min-w":[{"min-w":[De,t,"min","max","fit"]}],"max-w":[{"max-w":[De,t,"none","full","min","max","fit","prose",{screen:[Qa]},Qa]}],h:[{h:[De,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[De,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[De,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[De,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Qa,Ja]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fj]}],"font-family":[{font:[ef]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",De]}],"line-clamp":[{"line-clamp":["none",Ku,fj]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ea,De]}],"list-image":[{"list-image":["none",De]}],"list-style-type":[{list:["none","disc","decimal",De]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ea,Ja]}],"underline-offset":[{"underline-offset":["auto",ea,De]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...L(),Dee]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Lee]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Bee]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:D()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[ea,De]}],"outline-w":[{outline:[ea,Ja]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ea,Ja]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Qa,zee]}],"shadow-color":[{shadow:[ef]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Qa,De]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[w]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",De]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",De]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",De]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[Zh,De]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",De]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",De]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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"]}
vendor: 4,622 bytes, line 700
700],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",De]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ea,Ja,fj]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},qee=Cee(Hee);function fe(...e){return qee(Ze(e))}const Kee=SZ,MB=y.forwardRef(({className:e,...t},n)=>i.jsx(tB,{ref:n,className:fe("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),...t}));MB.displayName=tB.displayName;const Gee=Xp("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"}}),IB=y.forwardRef(({className:e,variant:t,...n},r)=>i.jsx(nB,{ref:r,className:fe(Gee({variant:t}),e),...n}));IB.displayName=nB.displayName;const Yee=y.forwardRef(({className:e,...t},n)=>i.jsx(iB,{ref:n,className:fe("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}));Yee.displayName=iB.displayName;const $B=y.forwardRef(({className:e,...t},n)=>i.jsx(aB,{ref:n,className:fe("absolute right-2 top-2 rounded-md p-1 text-foreground
700/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:i.jsx(hh,{className:"h-4 w-4"})}));$B.displayName=aB.displayName;const LB=y.forwardRef(({className:e,...t},n)=>i.jsx(rB,{ref:n,className:fe("text-sm font-semibold",e),...t}));LB.displayName=rB.displayName;const DB=y.forwardRef(({className:e,...t},n)=>i.jsx(sB,{ref:n,className:fe("text-sm opacity-90",e),...t}));DB.displayName=sB.displayName;function Xee(){const{toasts:e}=We();return i.jsxs(Kee,{children:[e.map(function({id:t,title:n,description:r,action:s,...a}){return i.jsxs(IB,{...a,children:[i.jsxs("div",{className:"grid gap-1",children:[n&&i.jsx(LB,{children:n}),r&&i.jsx(DB,{children:r})]}),s,i.jsx($B,{})]},t)}),i.jsx(MB,{})]})}var pO=["light","dark"],Jee="(prefers-color-scheme: dark)",Qee=y.createContext(void 0),Zee={setTheme:e=>{},themes:[]},ete=()=>{var e;return(e=y.useContext(Qee))!=null?e:Zee};y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:a,value:o,attrs:l,nonce:c})=>{let u=a==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=s?pO.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(g,p=!1,x=!0)=>{let v=o?o[g]:g,b=p?g+"|| ''":`'${v}'`,w="";return s&&x&&!p&&pO.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?p||v?w+=`c.add(${b})`:w+="null":v&&(w+=`d[s](n,${b})`),w},m=e?`!function(){${d}${f(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${Jee}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(a,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(a,!1,!1)};}${h}}catch(t){}}();`;return y.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var tte=e=>{switch(e){case"success":return ste;case"info":return ate;case"warning":return ite;case"error":return ote;default:return null}},nte=Array(12).fill(0),rte=({visible:e})=>F.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},F.createElement("div",{className:"sonner-spinner"},nte.map((t,n)=>F.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),ste=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ite=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ate=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ote=F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},F.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),lte=()=>{let[e,t]=F.useState(document.hidden);return F.useEffect(()=>{let n=()=>{t(document.hidden)};
700return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},rN=1,cte=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:rN++,a=this.toasts.find(l=>l.id===s),o=e.dismissible===void 0?!0:e.dismissible;return a?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
700this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0;return r.then(async a=>{if(dte(a)&&!a.ok){s=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${a.status}`):t.error,l=typeof t.description=="function"?await t.description(`HTTP error! status: ${a.status}`):t.description;this.create({id:n,type:"error",message:o,description:l})}else if(t.success!==void 0){s=!1;let o=typeof t.success=="function"?await t.success(a):t.success,l=typeof t.description=="function"?await t.description(a):t.description;this.create({id:n,type:"success",message:o,description:l})}}).catch(async a=>{if(t.error!==void 0){s=!1;let o=typeof t.error=="function"?await t.error(a):t.error,l=typeof t.description=="function"?await t.description(a):t.description;this.create({id:n,type:"error",message:o,description:l})}}).finally(()=>{var a;s&&(this.dismiss(n),n=void 0),(a=t.finally)==null||a.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||rN++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},Mr=new cte,ute=(e,t)=>{let n=(t==null?void 0:t.id)||rN++;return Mr.addToast({title:e,...t,id:n}),n},dte=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",hte=ute,fte=()=>Mr.toasts;Object.assign(hte,{success:Mr.success,info:Mr.info,warning:Mr.warning,error:Mr.error,custom:Mr.custom,message:Mr.message,promise:Mr.promise,dismiss:Mr.dismiss,loading:Mr.loading},{getHistory:fte});function mte(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}mte(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
700left: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;background:var(--gray1);color:var(--gray12);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}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
700:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-rich-colors=true][data-sonner-toast][data-type=success],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)} 701`);function Yg(e){return e.label!==void 0}var pte=3,gte="32px",yte=4e3,xte=356,vte=14,bte=20,wte=200;function jte(...e){return e.filter(Boolean).join(" ")}var Ste=e=>{var t,n,r,s,a,o,l,c,u,d;let{invert:h,toast:f,unstyled:m,interacting:g,setHeights:p,visibleToasts:x,heights:v,index:b,toasts:w,expanded:j,removeToast:S,defaultRichColors:N,closeButton:k,style:_,cancelButtonStyle:C,actionButtonStyle:A,className:E="",descriptionClassName:P="",duration:$,position:R,gap:L,loadingIcon:D,expandByDefault:I,classNames:M,icons:H,closeButtonAriaLabel:T="Close toast",pauseWhenPageIsHidden:B,cn:Y}=e,[O,W]=F.useState(!1),[X,J]=F.useState(!1),[G,ce]=F.useState(!1),[ee,le]=F.useState(!1),[he,Q]=F.useState(0),[Re,Te]=F.useState(0),ot=F.useRef(null),Qe=F.useRef(null),zt=b===0,Qn=b+1<=x,Rt=f.type,Tn=f.dismissible!==!1,Ts=f.className||"",kl=f.descriptionClassName||"",Ji=F.useMemo(()=>v.findIndex(_e=>_e.toastId===f.id)||0,[v,f.id]),Uc=F.useMemo(()=>{var _e;return(_e=f.closeButton)!=null?_e:k},[f.closeButton,k]),_g=F.useMemo(()=>f.duration||$||yte,[f.duration,$]),te=F.useRef(0),me=F.useRef(0),$e=F.useRef(0),Le=F.useRef(null),[ut,Ar]=R.split("-"),ui=F.useMemo(()=>v.reduce((_e,Mt,kt)=>kt>=Ji?_e:_e+Mt.height,0),[v,Ji]),rs=lte(),_l=f.invert||h,Qi=Rt==="loading";me.current=F.useMemo(()=>Ji*L+ui,[Ji,ui]),F.useEffect(()=>{W(!0)},[]),F.useLayoutEffect(()=>{if(!O)return;let _e=Qe.current,Mt=_e.style.height;_e.style.height="auto";let kt=_e.getBoundingClientRect().height;_e.style.height=Mt,Te(kt),p(di=>di.find(hi=>hi.toastId===f.id)?di.map(hi=>hi.toastId===f.id?{...hi,height:kt}:hi):[{toastId:f.id,height:kt,position:f.position},...di])},[O,f.title,f.description,p,f.id]);let Xt=F.useCallback(()=>{J(!0),Q(me.current),p(_e=>_e.filter(Mt=>Mt.toastId!==f.id)),setTimeout(()=>{S(f)},wte)},[f,S,p,me]);F.useEffect(()=>{if(f.promise&&Rt==="loading"||f.duration===1/0||f.type==="loading")return;let _e,Mt=_g;return j||g||B&&rs?(()=>{if($e.current<te.current){let kt=new Date().getTime()-te.current;Mt=Mt-kt}
701$e.current=new Date().getTime()})():Mt!==1/0&&(te.current=new Date().getTime(),_e=setTimeout(()=>{var kt;(kt=f.onAutoClose)==null||kt.call(f,f),Xt()},Mt)),()=>clearTimeout(_e)},[j,g,I,f,_g,Xt,f.promise,Rt,B,rs]),F.useEffect(()=>{let _e=Qe.current;if(_e){let Mt=_e.getBoundingClientRect().height;return Te(Mt),p(kt=>[{toastId:f.id,height:Mt,position:f.position},...kt]),()=>p(kt=>kt.filter(di=>di.toastId!==f.id))}},[p,f.id]),F.useEffect(()=>{f.delete&&Xt()},[Xt,f.delete]);function Ya(){return H!=null&&H.loading?F.createElement("div",{className:"sonner-loader","data-visible":Rt==="loading"},H.loading):D?F.createElement("div",{className:"sonner-loader","data-visible":Rt==="loading"},D):F.createElement(rte,{visible:Rt==="loading"})}return F.createElement("li",{"aria-live":f.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Qe,className:Y(E,Ts,M==null?void 0:M.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[Rt],(n=f==null?void 0:f.classNames)==null?void 0:n[Rt]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:N,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":O,"data-
701promise":!!f.promise,"data-removed":X,"data-visible":Qn,"data-y-position":ut,"data-x-position":Ar,"data-index":b,"data-front":zt,"data-swiping":G,"data-dismissible":Tn,"data-type":Rt,"data-invert":_l,"data-swipe-out":ee,"data-expanded":!!(j||I&&O),style:{"--index":b,"--toasts-before":b,"--z-index":w.length-b,"--offset":`${X?he:me.current}px`,"--initial-height":I?"auto":`${Re}px`,..._,...f.style},onPointerDown:_e=>{Qi||!Tn||(ot.current=new Date,Q(me.current),_e.target.setPointerCapture(_e.pointerId),_e.target.tagName!=="BUTTON"&&(ce(!0),Le.current={x:_e.clientX,y:_e.clientY}))},onPointerUp:()=>{var _e,Mt,kt,di;if(ee||!Tn)return;Le.current=null;let hi=Number(((_e=Qe.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Cg=new Date().getTime()-((Mt=ot.current)==null?void 0:Mt.getTime()),AY=Math.abs(hi)/Cg;if(Math.abs(hi)>=bte||AY>.11){Q(me.current),(kt=f.onDismiss)==null||kt.call(f,f),Xt(),le(!0);return}(di=Qe.current)==null||di.style.setProperty("--swipe-amount","0px"),ce(!1)},onPointerMove:_e=>{var Mt;if(!Le.current||!Tn)return;let kt=_e.clientY-Le.current.y,di=_e.clientX-Le.current.x,hi=(ut==="top"?Math.min:Math.max)(0,kt),Cg=_e.pointerType==="touch"?10:2;Math.abs(hi)>Cg?(Mt=Qe.current)==null||Mt.style.setProperty("--swipe-amount",`${kt}px`):Math.abs(di)>Cg&&(Le.current=null)}},Uc&&!f.jsx?F.createElement("button",{"aria-label":T,"data-disabled":Qi,"data-close-button":!0,onClick:Qi||!Tn?()=>{}:()=>{var _e;Xt(),(_e=f.onDismiss)==null||_e.call(f,f)},className:Y(M==null?void 0:M.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},F.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),F.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,f.jsx||F.isValidElement(f.title)?f.jsx||f.title:F.createElement(F.Fragment,null,Rt||f.icon||f.promise?F.createElement("div",{"data-icon":"",className:Y(M==null?void 0:M.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Ya():null,f.type!=="loading"?f.icon||(H==null?void 0:H[Rt])||tte(Rt):null):null,F.createElement("div",{"data-content":"",className:Y(M==null?void 0:M.content,(o=f==null?void 0:f.classNames)==null?void 0:o.content)},F.createElement("div",{"data-title":"",className:Y(M==null?void 0:M.title,(l=f==null?void 0:f.classNames)==null?void 0:l.title)},f.title),f.description?F.createElement("div",{"data-description":"",className:Y(P,kl,M==null?void 0:M.description,(c=f==null?void 0:f.classNames)==null?void 0:c.description)},f.description):null),F.isValidElement(f.cancel)?f.cancel:f.cancel&&Yg(f.cancel)?F.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||C,onClick:_e=>{var Mt,kt;Yg(f.cancel)&&Tn&&((kt=(Mt=f.cancel).onClick)==null||kt.call(Mt,_e),Xt())},className:Y(M==null?void 0:M.cancelButton,(u=f==null?void 0:f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,F.isValidElement(f.action)?f.action:f.action&&Yg(f.action)?F.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||A,onClick:_e=>{var Mt,kt;Yg(f.action)&&(_e.defaultPrevented||((kt=(Mt=f.action).onClick)==null||kt.call(Mt,_e),Xt()))},className:Y(M==null?void 0:M.actionButton,(d=f==null?void 0:f.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function gO(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var Nte=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:l,theme:c="light",richColors:u,duration:d,style:h,visibleToasts:f=pte,toastOptions:m,dir:g=gO(),gap:p=vte,loadingIcon:x,icons:v,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:w,cn:j=jte}=e,[S,N]=F.useState([]),k=F.useMemo(()=>
701Array.from(new Set([n].concat(S.filter(B=>B.position).map(B=>B.position)))),[S,n]),[_,C]=F.useState([]),[A,E]=F.useState(!1),[P,$]=F.useState(!1),[R,L]=F.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=F.useRef(null),I=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=F.useRef(null),H=F.useRef(!1),T=F.useCallback(B=>{var Y;(Y=S.find(O=>O.id===B.id))!=null&&Y.delete||Mr.dismiss(B.id),N(O=>O.filter(({id:W})=>W!==B.id))},[S]);return F.useEffect(()=>Mr.subscribe(B=>{if(B.dismiss){N(Y=>Y.map(O=>O.id===B.id?{...O,delete:!0}:O));return}setTimeout(()=>{ch.flushSync(()=>{N(Y=>{let O=Y.findIndex(W=>W.id===B.id);return O!==-1?[...Y.slice(0,O),{...Y[O],...B},...Y.slice(O+1)]:[B,...Y]})})})}),[]),F.useEffect(()=>{if(c!=="system"){L(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:B})=>{L(B?"dark":"light")})},[c]),F.useEffect(()=>{S.length<=1&&E(!1)},[S]),F.useEffect(()=>{let B=Y=>{var O,W;r.every(X=>Y[X]||Y.code===X)&&(E(!0),(O=D.current)==null||O.focus()),Y.code==="Escape"&&(document.activeElement===D.current||(W=D.current)!=null&&W.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[r]),F.useEffect(()=>{if(D.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,H.current=!1)}},[D.current]),S.length?F.createElement("section",{"aria-label":`${b} ${I}`,tabIndex:-1},k.map((B,Y)=>{var O;let[W,X]=B.split("-");return F.createElement("ol",{key:B,dir:g==="auto"?gO():g,tabIndex:-1,ref:D,className:o,"data-sonner-toaster":!0,"data-theme":R,"data-y-position":W,"data-x-position":X,style:{"--front-toast-height":`${((O=_[0])==null?void 0:O.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||gte,"--width":`${xte}px`,"--gap":`${p}px`,...h},onBlur:J=>{H.current&&!J.currentTarget.contains(J.relatedTarget)&&(H.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||H.current||(H.current=!0,M.current=J.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{P||E(!1)},onPointerDown:J=>{J.target instanceof HTMLElement&&J.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},S.filter(J=>!J.position&&Y===0||J.position===B).map((J,G)=>{var ce,ee;return F.createElement(Ste,{key:J.id,icons:v,index:G,toast:J,defaultRichColors:u,duration:(ce=m==null?void 0:m.duration)!=null?ce:d,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:t,visibleToasts:f,closeButton:(ee=m==null?void 0:m.closeButton)!=null?ee:a,interacting:P,position:B,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:T,toasts:S.filter(le=>le.position==J.position),heights:_.filter(le=>le.position==J.position),setHeights:C,expandByDefault:s,gap:p,loadingIcon:x,expanded:A,pauseWhenPageIsHidden:w,cn:j})}))})):null};const kte=({...e})=>{const{theme:t="system"}=ete();return i.jsx(Nte,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};function _te(e,t=[]){let n=[];function r(a,o){const l=y.createContext(o),c=n.length;n=[...n,o];const u=h=>{var v;const{scope:f,children:m,...g}=h,p=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,x=y.useMemo(()=>g,Object.values(g));return i.jsx(p.Provider,{value:x,children:m})};u.displayName=a+"Provider";function d(h,f){var p;const m=((p=f==null?void 0:f[e])==null?void 0:p[c])||l,g=y.useContext(m);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[u,d]}const s=()=>{const a=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,Cte(s,...t)]}function Cte(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));
vendor: 15,618 bytes, line 701
701return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const h=c(a)[`__scope${u}`];return{...l,...h}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Ete="DismissableLayer",sN="dismissableLayer.update",Ate="dismissableLayer.pointerDownOutside",Pte="dismissableLayer.focusOutside",yO,FB=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kE=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=y.useContext(FB),[d,h]=y.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),g=Ce(t,k=>h(k)),p=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(x),b=d?p.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=v,S=Rte(k=>{const _=k.target,C=[...u.branches].some(A=>A.contains(_));!j||C||(s==null||s(k),o==null||o(k),k.defaultPrevented||l==null||l())},f),N=Mte(k=>{const _=k.target;[...u.branches].some(A=>A.contains(_))||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},f);return Gp(k=>{b===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(yO=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),xO(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=yO)}},[d,f,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),xO())},[d,u]),y.useEffect(()=>{const k=()=>m({});return document.addEventListener(sN,k),()=>document.removeEventListener(sN,k)},[]),i.jsx(ve.div,{...c,ref:g,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ge(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ge(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ge(e.onPointerDownCapture,S.onPointerDownCapture)})});kE.displayName=Ete;var Tte="DismissableLayerBranch",Ote=y.forwardRef((e,t)=>{const n=y.useContext(FB),r=y.useRef(null),s=Ce(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(ve.div,{...e,ref:s})});Ote.displayName=Tte;function Rte(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){BB(Ate,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mte(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&BB(Pte,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xO(){const e=new CustomEvent(sN);document.dispatchEvent(e)}function BB(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?uh(s,a):s.dispatchEvent(a)}var Ite=k3.useId||(()=>{}),$te=0;function Kr(e){const[t,n]=y.useState(Ite());return Nt(()=>{n(r=>r??String($te++))},[e]),t?`radix-${t}`:""}const Lte=["top","right","bottom","left"],Qo=Math.min,Br=Math.max,Jx=Math.round,Xg=Math.floor,Zo=e=>({x:e,y:e}),Dte={left:"right",right:"left",bottom:"top",top:"bottom"},Fte={start:"end",end:"start"};function iN(e,t,n){return Br(e,Qo(t,n))}function Ma(e,t){return typeof e=="function"?e(t):e}function Ia(e){return e.split("-")[0]}function mh(e){return e.split("-")[1]}function _E(e){return e==="x"?"y":"x"}function CE(e){return e==="y"?"height":"width"}function el(e){return["top","bottom"].includes(Ia(e))?"y":"x"}function EE(e){return _E(el(e))}function Bte(e,t,n){n===void 0&&(n=!1);const r=mh(e),s=EE(e),a=CE(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Qx(o)),[o,Qx(o)]}function zte(e){const t=Qx(e);return[aN(e),t,aN(t)]}function aN(e){return e.replace(/start|end/g,t=>Fte[t])}function Ute(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:o;default:return[]}}function Vte(e,t,n,r){const s=mh(e);let a=Ute(Ia(e),n==="start",r);return s&&(a=a.map(o=>o+"-"+s),t&&(a=a.concat(a.map(aN)))),a}function Qx(e){return e.replace(/left|right|bottom|top/g,t=>Dte[t])}function Wte(e){return{top:0,right:0,bottom:0,left:0,...e}}function zB(e){return typeof e!="number"?Wte(e):{top:e,right:e,bottom:e,left:e}}function Zx(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function vO(e,t,n){let{reference:r,floating:s}=e;const a=el(t),o=EE(t),l=CE(o),c=Ia(t),u=a==="y",d=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,f=r[l]/2-s[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-s.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-s.width,y:h};break;default:m={x:r.x,y:r.y}}switch(mh(t)){case"start":m[o]-=f*(n&&u?-1:1);break;case"end":m[o]+=f*(n&&u?-1:1);break}return m}const Hte=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:o}=n,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:h}=vO(u,r,c),f=r,m={},g=0;for(let p=0;p<l.length;p++){const{name:x,fn:v}=l[p],{x:b,y:w,data:j,reset:S}=await v({x:d,y:h,initialPlacement:r,placement:f,strategy:s,middlewareData:m,rects:u,platform:o,elements:{reference:e,floating:t}});d=b??d,h=w??h,m={...m,[x]:{...m[x],...j}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(u=S.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):S.rects),{x:d,y:h}=vO(u,f,c)),p=-1)}return{x:d,y:h,placement:f,strategy:s,middlewareData:m}};async function Om(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:a,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:m=0}=Ma(t,e),g=zB(m),x=l[f?h==="floating"?"reference":"floating":h],v=Zx(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(x)))==null||n?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),b=h==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),j=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},S=Zx(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:w,strategy:c}):b);return{top:(v.top-S.top+g.top)/j.y,bottom:(S.bottom-v.bottom+g.bottom)/j.y,left:(v.left-S.left+g.left)/j.x,right:(S.right-v.right+g.right)/j.x}}const qte=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Ma(e,t)||{};if(u==null)return{};const h=zB(d),f={x:n,y:r},m=EE(s),g=CE(m),p=await o.getDimensions(u),x=m==="y",v=x?"top":"left",b=x?"bottom":"right",w=x?"clientHeight":"clientWidth",j=a.reference[g]+a.reference[m]-f[m]-a.floating[g],S=f[m]-a.reference[m],N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=N?N[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(N)))&&(k=l.floating[w]||a.floating[g]);const _=j/2-S/2,C=k/2-p[g]/2-1,A=Qo(h[v],C),E=Qo(h[b],C),P=A,$=k-p[g]-E,R=k/2-p[g]/2+_,L=iN(P,R,$),D=!c.arrow&&mh(s)!=null&&R!==L&&a.reference[g]/2-(R<P?A:E)-p[g]/2<0,I=D?R<P?R-P:R-$:0;return{[m]:f[m]+I,data:{[m]:L,centerOffset:R-L-I,...D&&{alignmentOffset:I}},reset:D}}}),Kte=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...x}=Ma(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=Ia(s),b=el(l),w=Ia(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(u.floating)),S=f||(w||!p?[Qx(l)]:zte(l)),N=g!=="none";!f&&N&&S.push(...Vte(l,p,g,j));const k=[l,...S],_=await Om(t,x),C=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&C.push(_[v]),h){const R=Bte(s,o,j);C.push(_[R[0]],_[R[1]])}if(A=[...A,{placement:s,overflows:C}],!C.every(R=>R<=0)){var E,P;const R=(((E=a.flip)==null?void 0:E.index)||0)+1,L=k[R];if(L)return{data:{index:R,overflows:A},reset:{placement:L}};let D=(P=A.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:P.placement;if(!D)switch(m){case"bestFit":{var $;const I=($=A.filter(M=>{if(N){const H=el(M.placement);return H===b||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,T)=>H+T,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:$[0];I&&(D=I);break}case"initialPlacement":D=l;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function bO(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wO(e){return Lte.some(t=>e[t]>=0)}const Gte=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Ma(e,t);switch(r){case"referenceHidden":{const a=await Om(t,{...s,elementContext:"reference"}),o=bO(a,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:wO(o)}}}case"escaped":{const a=await Om(t,{...s,altBoundary:!0}),o=bO(a,n.floating);return{data:{escapedOffsets:o,escaped:wO(o)}}}default:return{}}}}};async function Yte(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Ia(n),l=mh(n),c=el(n)==="y",u=["left","top"].includes(o)?-1:1,d=a&&c?-1:1,h=Ma(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:f*u}:{x:f*u,y:m*d}}const Xte=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:o,middlewareData:l}=t,c=await Yte(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:a+c.y,data:{...c,placement:o}}}}},Jte=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:x=>{let{x:v,y:b}=x;return{x:v,y:b}}},...c}=Ma(e,t),u={x:n,y:r},d=await Om(t,c),h=el(Ia(s)),f=_E(h);let m=u[f],g=u[h];if(a){const x=f==="y"?"top":"left",v=f==="y"?"bottom":"right",b=m+d[x],w=m-d[v];m=iN(b,m,w)}if(o){const x=h==="y"?"top":"left",v=h==="y"?"bottom":"right",b=g+d[x],w=g-d[v];g=iN(b,g,w)}const p=l.fn({...t,[f]:m,[h]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:a,[h]:o}}}}}},Qte=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Ma(e,t),d={x:n,y:r},h=el(s),f=_E(h);let m=d[f],g=d[h];const p=Ma(l,t),x=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=f==="y"?"height":"width",j=a.reference[f]-a.floating[w]+x.mainAxis,S=a.reference[f]+a.reference[w]-x.mainAxis;m<j?m=j:m>S&&(m=S)}if(u){var v,b;const w=f==="y"?"width":"height",j=["top","left"].includes(Ia(s)),S=a.reference[h]-a.floating[w]+(j&&((v=o.offset)==null?void 0:v[h])||0)+(j?0:x.crossAxis),N=a.reference[h]+a.reference[w]+(j?0:((b=o.offset)==null?void 0:b[h])||0)-(j?x.crossAxis:0);g<S?g=S:g>N&&(g=N)}return{[f]:m,[h]:g}}}},Zte=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:o,elements:l}=t,{apply:c=()=>{},...u}=Ma(e,t),d=await Om(t,u),h=Ia(s),f=mh(s),m=el(s)==="y",{width:g,height:p}=a.floating;let x,v;h==="top"||h==="bottom"?(x=h,v=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(v=h,x=f==="end"?"top":"bottom");const b=p-d.top-d.bottom,w=g-d.left-d.right,j=Qo(p-d[x],b),S=Qo(g-d[v],w),N=!t.middlewareData.shift;let k=j,_=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=b),N&&!f){const A=Br(d.left,0),E=Br(d.right,0),P=Br(d.top,0),$=Br(d.bottom,0);m?_=g-2*(A!==0||E!==0?A+E:Br(d.left,d.right)):k=p-2*(P!==0||$!==0?P+$:Br(d.top,d.bottom))}await c({...t,availableWidth:_,availableHeight:k});const C=await o.getDimensions(l.floating);return g!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function Jb(){return typeof window<"u"}function ph(e){return UB(e)?(e.nodeName||"").toLowerCase():"#document"}function Gr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qi(e){var t;return(t=(UB(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function UB(e){return Jb()?e instanceof Node||e instanceof Gr(e).Node:!1}function si(e){return Jb()?e instanceof Element||e instanceof Gr(e).Element:!1}function Bi(e){return Jb()?e instanceof HTMLElement||e instanceof Gr(e).HTMLElement:!1}function jO(e){return!Jb()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Gr(e).ShadowRoot}function Zp(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ii(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function ene(e){return["table","td","th"].includes(ph(e))}function Qb(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function AE(e){const t=PE(),n=si(e)?ii(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function tne(e){let t=tl(e);for(;Bi(t)&&!Td(t);){if(AE(t))return t;if(Qb(t))return null;t=tl(t)}return null}function PE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Td(e){return["html","body","#document"].includes(ph(e))}function ii(e){return Gr(e).getComputedStyle(e)}function Zb(e){return si(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tl(e){if(ph(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jO(e)&&e.host||qi(e);return jO(t)?t.host:t}function VB(e){const t=tl(e);return Td(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bi(t)&&Zp(t)?t:VB(t)}function Rm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=VB(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),o=Gr(s);if(a){const l=oN(o);
vendor: 5,073 bytes, line 701
701return t.concat(o,o.visualViewport||[],Zp(s)?s:[],l&&n?Rm(l):[])}return t.concat(s,Rm(s,[],n))}function oN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function WB(e){const t=ii(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Bi(e),a=s?e.offsetWidth:n,o=s?e.offsetHeight:r,l=Jx(n)!==a||Jx(r)!==o;return l&&(n=a,r=o),{width:n,height:r,$:l}}function TE(e){return si(e)?e:e.contextElement}function Gu(e){const t=TE(e);if(!Bi(t))return Zo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=WB(t);let o=(a?Jx(n.width):n.width)/r,l=(a?Jx(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const nne=Zo(0);function HB(e){const t=Gr(e);return!PE()||!t.visualViewport?nne:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rne(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Gr(e)?!1:t}function Nc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=TE(e);let o=Zo(1);t&&(r?si(r)&&(o=Gu(r)):o=Gu(e));const l=rne(a,n,r)?HB(a):Zo(0);let c=(s.left+l.x)/o.x,u=(s.top+l.y)/o.y,d=s.width/o.x,h=s.height/o.y;if(a){const f=Gr(a),m=r&&si(r)?Gr(r):r;let g=f,p=oN(g);for(;p&&r&&m!==g;){const x=Gu(p),v=p.getBoundingClientRect(),b=ii(p),w=v.left+(p.clientLeft+parseFloat(b.paddingLeft))*x.x,j=v.top+(p.clientTop+parseFloat(b.paddingTop))*x.y;c*=x.x,u*=x.y,d*=x.x,h*=x.y,c+=w,u+=j,g=Gr(p),p=oN(g)}}return Zx({width:d,height:h,x:c,y:u})}function sne(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",o=qi(r),l=t?Qb(t.floating):!1;if(r===o||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=Zo(1);const d=Zo(0),h=Bi(r);if((h||!h&&!a)&&((ph(r)!=="body"||Zp(o))&&(c=Zb(r)),Bi(r))){const f=Nc(r);u=Gu(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function ine(e){return Array.from(e.getClientRects())}function lN(e,t){const n=Zb(e).scrollLeft;return t?t.left+n:Nc(qi(e)).left+n}function ane(e){const t=qi(e),n=Zb(e),r=e.ownerDocument.body,s=Br(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Br(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+lN(e);const l=-n.scrollTop;return ii(r).direction==="rtl"&&(o+=Br(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:o,y:l}}function one(e,t){const n=Gr(e),r=qi(e),s=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,l=0,c=0;if(s){a=s.width,o=s.height;const u=PE();(!u||u&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:a,height:o,x:l,y:c}}function lne(e,t){const n=Nc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=Bi(e)?Gu(e):Zo(1),o=e.clientWidth*a.x,l=e.clientHeight*a.y,c=s*a.x,u=r*a.y;return{width:o,height:l,x:c,y:u}}function SO(e,t,n){let r;if(t==="viewport")r=one(e,n);else if(t==="document")r=ane(qi(e));else if(si(t))r=lne(t,n);else{const s=HB(e);r={...t,x:t.x-s.x,y:t.y-s.y}}return Zx(r)}function qB(e,t){const n=tl(e);return n===t||!si(n)||Td(n)?!1:ii(n).position==="fixed"||qB(n,t)}function cne(e,t){const n=t.get(e);if(n)return n;let r=Rm(e,[],!1).filter(l=>si(l)&&ph(l)!=="body"),s=null;const a=ii(e).position==="fixed";let o=a?tl(e):e;for(;si(o)&&!Td(o);){const l=ii(o),c=AE(o);!c&&l.position==="fixed"&&(s=null),(a?!c&&!s:!c&&l.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Zp(o)&&!c&&qB(e,o))?r=r.filter(d=>d!==o):s=l,o=tl(o)}return t.set(e,r),r}function une(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?Qb(t)?[]:cne(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const h=SO(t,d,s);return u.top=Br(h.top,u.top),u.right=Qo(h.right,u.right),u.bottom=Qo(h.bottom,u.bottom),u.left=Br(h.left,u.left),u},SO(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function dne(e){const{width:t,height:n}=WB(e);return{width:t,height:n}}function hne(e,t,n){const r=Bi(t),s=qi(t),a=n==="fixed",o=Nc(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Zo(0);if(r||!r&&!a)if((ph(t)!=="body"||Zp(s))&&(l=Zb(t)),r){const m=Nc(t,!0,a,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&(c.x=lN(s));let u=0,d=0;if(s&&!r&&!a){const m=s.getBoundingClientRect();d=m.top+l.scrollTop,u=m.left+l.scrollLeft-lN(s,m)}const h=o.left+l.scrollLeft-c.x-u,f=o.top+l.scrollTop-c.y-d;return{x:h,y:f,width:o.width,height:o.height}}function mj(e){return ii(e).position==="static"}function NO(e,t){if(!Bi(e)||ii(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qi(e)===n&&(n=n.ownerDocument.body),n}function KB(e,t){const n=Gr(e);if(Qb(e))return n;if(!Bi(e)){let s=tl(e);for(;s&&!Td(s);){if(si(s)&&!mj(s))return s;s=tl(s)}return n}let r=NO(e,t);for(;r&&ene(r)&&mj(r);)r=NO(r,t);return r&&Td(r)&&mj(r)&&!AE(r)?n:r||tne(e)||n}const fne=async function(e){const t=this.getOffsetParent||KB,n=this.getDimensions,r=await n(e.floating);return{reference:hne(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mne(e){return ii(e).direction==="rtl"}
vendor: 9,971 bytes, line 701
701const pne={convertOffsetParentRelativeRectToViewportRelativeRect:sne,getDocumentElement:qi,getClippingRect:une,getOffsetParent:KB,getElementRects:fne,getClientRects:ine,getDimensions:dne,getScale:Gu,isElement:si,isRTL:mne};function gne(e,t){let n=null,r;const s=qi(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const{left:u,top:d,width:h,height:f}=e.getBoundingClientRect();if(l||t(),!h||!f)return;const m=Xg(d),g=Xg(s.clientWidth-(u+h)),p=Xg(s.clientHeight-(d+f)),x=Xg(u),b={rootMargin:-m+"px "+-g+"px "+-p+"px "+-x+"px",threshold:Br(0,Qo(1,c))||1};let w=!0;function j(S){const N=S[0].intersectionRatio;if(N!==c){if(!w)return o();N?o(!1,N):r=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(j,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,b)}n.observe(e)}return o(!0),a}function yne(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=TE(e),d=s||a?[...u?Rm(u):[],...Rm(t)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const h=u&&l?gne(u,n):null;let f=-1,m=null;o&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,p=c?Nc(e):null;c&&x();function x(){const v=Nc(e);p&&(v.x!==p.x||v.y!==p.y||v.width!==p.width||v.height!==p.height)&&n(),p=v,g=requestAnimationFrame(x)}return n(),()=>{var v;d.forEach(b=>{s&&b.removeEventListener("scroll",n),a&&b.removeEventListener("resize",n)}),h==null||h(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const xne=Xte,vne=Jte,bne=Kte,wne=Zte,jne=Gte,kO=qte,Sne=Qte,Nne=(e,t,n)=>{const r=new Map,s={platform:pne,...n},a={...s.platform,_c:r};return Hte(e,t,{...s,platform:a})};var hx=typeof document<"u"?y.useLayoutEffect:y.useEffect;function ev(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,s;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(!ev(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const a=s[r];if(!(a==="_owner"&&e.$$typeof)&&!ev(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function GB(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _O(e,t){const n=GB(e);return Math.round(t*n)/n}function pj(e){const t=y.useRef(e);return hx(()=>{t.current=e}),t}function kne(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=y.useState(r);ev(f,r)||m(r);const[g,p]=y.useState(null),[x,v]=y.useState(null),b=y.useCallback(M=>{M!==N.current&&(N.current=M,p(M))},[]),w=y.useCallback(M=>{M!==k.current&&(k.current=M,v(M))},[]),j=a||g,S=o||x,N=y.useRef(null),k=y.useRef(null),_=y.useRef(d),C=c!=null,A=pj(c),E=pj(s),P=pj(u),$=y.useCallback(()=>{if(!N.current||!k.current)return;const M={placement:t,strategy:n,middleware:f};E.current&&(M.platform=E.current),Nne(N.current,k.current,M).then(H=>{const T={...H,isPositioned:P.current!==!1};R.current&&!ev(_.current,T)&&(_.current=T,ol.flushSync(()=>{h(T)}))})},[f,t,n,E,P]);hx(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,h(M=>({...M,isPositioned:!1})))},[u]);const R=y.useRef(!1);hx(()=>(R.current=!0,()=>{R.current=!1}),[]),hx(()=>{if(j&&(N.current=j),S&&(k.current=S),j&&S){if(A.current)return A.current(j,S,$);$()}},[j,S,$,A,C]);const L=y.useMemo(()=>({reference:N,floating:k,setReference:b,setFloating:w}),[b,w]),D=y.useMemo(()=>({reference:j,floating:S}),[j,S]),I=y.useMemo(()=>{const M={position:n,left:0,top:0};if(!D.floating)return M;const H=_O(D.floating,d.x),T=_O(D.floating,d.y);return l?{...M,transform:"translate("+H+"px, "+T+"px)",...GB(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:T}},[n,l,D.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:$,refs:L,elements:D,floatingStyles:I}),[d,$,L,D,I])}const _ne=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?kO({element:r.current,padding:s}).fn(n):{}:r?kO({element:r,padding:s}).fn(n):{}}}},Cne=(e,t)=>({...xne(e),options:[e,t]}),Ene=(e,t)=>({...vne(e),options:[e,t]}),Ane=(e,t)=>({...Sne(e),options:[e,t]}),Pne=(e,t)=>({...bne(e),options:[e,t]}),Tne=(e,t)=>({...wne(e),options:[e,t]}),One=(e,t)=>({...jne(e),options:[e,t]}),Rne=(e,t)=>({..._ne(e),options:[e,t]});var Mne="Arrow",YB=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...a}=e;return i.jsx(ve.svg,{...a,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});YB.displayName=Mne;var Ine=YB;function OE(e){const[t,n]=y.useState(void 0);return Nt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var RE="Popper",[XB,gh]=kr(RE),[$ne,JB]=XB(RE),QB=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null);return i.jsx($ne,{scope:t,anchor:r,onAnchorChange:s,children:n})};QB.displayName=RE;var ZB="PopperAnchor",ez=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,a=JB(ZB,n),o=y.useRef(null),l=Ce(t,o);return y.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:i.jsx(ve.div,{...s,ref:l})});ez.displayName=ZB;var ME="PopperContent",[Lne,Dne]=XB(ME),tz=y.forwardRef((e,t)=>{var G,ce,ee,le,he,Q;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:g,...p}=e,x=JB(ME,n),[v,b]=y.useState(null),w=Ce(t,Re=>b(Re)),[j,S]=y.useState(null),N=OE(j),k=(N==null?void 0:N.width)??0,_=(N==null?void 0:N.height)??0,C=r+(a!=="center"?"-"+a:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},E=Array.isArray(u)?u:[u],P=E.length>0,$={padding:A,boundary:E.filter(Bne),altBoundary:P},{refs:R,floatingStyles:L,placement:D,isPositioned:I,middlewareData:M}=kne({strategy:"fixed",placement:C,whileElementsMounted:(...Re)=>yne(...Re,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[Cne({mainAxis:s+_,alignmentAxis:o}),c&&Ene({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Ane():void 0,...$}),c&&Pne({...$}),Tne({...$,apply:({elements:Re,rects:Te,availableWidth:ot,availableHeight:Qe})=>{const{width:zt,height:Qn}=Te.reference,Rt=Re.floating.style;Rt.setProperty("--radix-popper-available-width",`${ot}px`),Rt.setProperty("--radix-popper-available-height",`${Qe}px`),Rt.setProperty("--radix-popper-anchor-width",`${zt}px`),Rt.setProperty("--radix-popper-anchor-height",`${Qn}px`)}}),j&&Rne({element:j,padding:l}),zne({arrowWidth:k,arrowHeight:_}),f&&One({strategy:"referenceHidden",...$})]}),[H,T]=sz(D),B=dt(g);Nt(()=>{I&&(B==null||B())},[I,B]);const Y=(G=M.arrow)==null?void 0:G.x,O=(ce=M.arrow)==null?void 0:ce.y,W=((ee=M.arrow)==null?void 0:ee.centerOffset)!==0,[X,J]=y.useState();return Nt(()=>{v&&J(window.getComputedStyle(v).zIndex)},[v]),i.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:I?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(le=M.transformOrigin)==null?void 0:le.x,(he=M.transformOrigin)==null?void 0:he.y].join(" "),...((Q=M.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(Lne,{scope:n,placedSide:H,onArrowChange:S,arrowX:Y,arrowY:O,shouldHideArrow:W,children:i.jsx(ve.div,{"data-side":H,"data-align":T,...p,ref:w,style:{...p.style,animation:I?void 0:"none"}})})})});tz.displayName=ME;var nz="PopperArrow",Fne={top:"bottom",right:"left",bottom:"top",left:"right"},rz=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,a=Dne(nz,r),o=Fne[a.placedSide];return i.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:i.jsx(Ine,{...s,ref:n,style:{...s.style,display:"block"}})})});rz.displayName=nz;function Bne(e){return e!==null}var zne=e=>({name:"transformOrigin",options:e,fn(t){var x,v,b;const{placement:n,rects:r,middlewareData:s}=t,o=((x=s.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=sz(n),h={start:"0%",center:"50%",end:"100%"}[d],f=(((v=s.arrow)==null?void 0:v.x)??0)+l/2,m=(((b=s.arrow)==null?void 0:b.y)??0)+c/2;let g="",p="";return u==="bottom"?(g=o?h:`${f}px`,p=`${-c}px`):u==="top"?(g=o?h:`${f}px`,p=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,p=o?h:`${m}px`):u==="left"&&(g=`${r.floating.width+c}px`,p=o?h:`${m}px`),{data:{x:g,y:p}}}});function sz(e){const[t,n="center"]=e.split("-");return[t,n]}var IE=QB,e0=ez,$E=tz,LE=rz,Une="Portal",iz=y.forwardRef((e,t)=>
701{var l;const{container:n,...r}=e,[s,a]=y.useState(!1);Nt(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ch.createPortal(i.jsx(ve.div,{...r,ref:t}),o):null});iz.displayName=Une;function Vne(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var az=e=>{const{present:t,children:n}=e,r=Wne(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Ce(r.ref,Hne(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:a}):null};az.displayName="Presence";function Wne(e){const[t,n]=y.useState(),r=y.useRef({}),s=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Vne(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=Jg(r.current);a.current=l==="mounted"?u:"none"},[l]),Nt(()=>{const u=r.current,d=s.current;if(d!==e){const f=a.current,m=Jg(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Nt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=m=>{const p=Jg(r.current).includes(m.animationName);if(m.target===t&&p&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=m=>{m.target===t&&(a.current=Jg(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Jg(e){return(e==null?void 0:e.animationName)||"none"}function Hne(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var[t0,v7e]=_te("Tooltip",[gh]),n0=gh(),oz="TooltipProvider",qne=700,cN="tooltip.open",[Kne,DE]=t0(oz),lz=e=>{const{__scopeTooltip:t,delayDuration:n=qne,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:a}=e,[o,l]=y.useState(!0),c=y.useRef(!1),u=y.useRef(0);return y.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),i.jsx(Kne,{scope:t,isOpenDelayed:o,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(u.current),l(!1)},[]),onClose:y.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:y.useCallback(d=>{c.current=d},[]),disableHoverableContent:s,children:a})};lz.displayName=oz;var r0="Tooltip",[Gne,s0]=t0(r0),cz=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,c=DE(r0,e.__scopeTooltip),u=n0(t),[d,h]=y.useState(null),f=Kr(),m=y.useRef(0),g=o??c.disableHoverableContent,p=l??c.delayDuration,x=y.useRef(!1),[v=!1,b]=ni({prop:r,defaultProp:s,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(cN))):c.onClose(),a==null||a(k)}}),w=y.useMemo(()=>v?x.current?"delayed-open":"instant-open":"closed",[v]),j=y.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x.current=!1,b(!0)},[b]),S=y.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),N=y.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,b(!0),m.current=0},p)},[p,b]);return y.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),i.jsx(IE,{...u,children:i.jsx(Gne,{scope:t,contentId:f,open:v,stateAttribute:w,trigger:d,onTriggerChange:h,onTriggerEnter:y.useCallback(()=>{c.isOpenDelayed?N():j()},[c.isOpenDelayed,N,j]),onTriggerLeave:y.useCallback(()=>{g?S():(window.clearTimeout(m.current),m.current=0)},[S,g]),onOpen:j,onClose:S,disableHoverableContent:g,children:n})})};cz.displayName=r0;var uN="TooltipTrigger",uz=y.forwardRef((e,t)=>
vendor: 5,237 bytes, line 701
701{const{__scopeTooltip:n,...r}=e,s=s0(uN,n),a=DE(uN,n),o=n0(n),l=y.useRef(null),c=Ce(t,l,s.onTriggerChange),u=y.useRef(!1),d=y.useRef(!1),h=y.useCallback(()=>u.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),i.jsx(e0,{asChild:!0,...o,children:i.jsx(ve.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:ge(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ge(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ge(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ge(e.onFocus,()=>{u.current||s.onOpen()}),onBlur:ge(e.onBlur,s.onClose),onClick:ge(e.onClick,s.onClose)})})});uz.displayName=uN;var Yne="TooltipPortal",[b7e,Xne]=t0(Yne,{forceMount:void 0}),Od="TooltipContent",dz=y.forwardRef((e,t)=>{const n=Xne(Od,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...a}=e,o=s0(Od,e.__scopeTooltip);return i.jsx(az,{present:r||o.open,children:o.disableHoverableContent?i.jsx(hz,{side:s,...a,ref:t}):i.jsx(Jne,{side:s,...a,ref:t})})}),Jne=y.forwardRef((e,t)=>{const n=s0(Od,e.__scopeTooltip),r=DE(Od,e.__scopeTooltip),s=y.useRef(null),a=Ce(t,s),[o,l]=y.useState(null),{trigger:c,onClose:u}=n,d=s.current,{onPointerInTransitChange:h}=r,f=y.useCallback(()=>{l(null),h(!1)},[h]),m=y.useCallback((g,p)=>{const x=g.currentTarget,v={x:g.clientX,y:g.clientY},b=tre(v,x.getBoundingClientRect()),w=nre(v,b),j=rre(p.getBoundingClientRect()),S=ire([...w,...j]);l(S),h(!0)},[h]);return y.useEffect(()=>()=>f(),[f]),y.useEffect(()=>{if(c&&d){const g=x=>m(x,d),p=x=>m(x,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",p),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",p)}}},[c,d,m,f]),y.useEffect(()=>{if(o){const g=p=>{const x=p.target,v={x:p.clientX,y:p.clientY},b=(c==null?void 0:c.contains(x))||(d==null?void 0:d.contains(x)),w=!sre(v,o);b?f():w&&(f(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,o,u,f]),i.jsx(hz,{...e,ref:a})}),[Qne,Zne]=t0(r0,{isInside:!1}),hz=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=e,c=s0(Od,n),u=n0(n),{onClose:d}=c;return y.useEffect(()=>(document.addEventListener(cN,d),()=>document.removeEventListener(cN,d)),[d]),y.useEffect(()=>{if(c.trigger){const h=f=>{const m=f.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),i.jsx(kE,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:i.jsxs($E,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(uE,{children:r}),i.jsx(Qne,{scope:n,isInside:!0,children:i.jsx(iZ,{id:c.contentId,role:"tooltip",children:s||r})})]})})});dz.displayName=Od;var fz="TooltipArrow",ere=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=n0(n);return Zne(fz,n).isInside?null:i.jsx(LE,{...s,...r,ref:t})});ere.displayName=fz;function tre(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,s,a)){case a:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function nre(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function rre(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function sre(e,t){const{x:n,y:r}=e;let s=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const l=t[a].x,c=t[a].y,u=t[o].x,d=t[o].y;c>r!=d>r&&n<(u-l)*(r-c)/(d-c)+l&&(s=!s)}return s}function ire(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),are(t)}function are(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(s.y-o.y)>=(a.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var ore=lz,lre=cz,cre=uz,mz=dz;const pz=ore,ure=lre,dre=cre,gz=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>
vendor: 40,423 bytes, lines 701-710
701i.jsx(mz,{ref:r,sideOffset:t,className:fe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));gz.displayName=mz.displayName;var yh=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(){}},Rd=typeof window>"u"||"Deno"in globalThis;function us(){}function hre(e,t){return typeof e=="function"?e(t):e}function dN(e){return typeof e=="number"&&e>=0&&e!==1/0}function yz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yu(e,t){return typeof e=="function"?e(t):e}function Hs(e,t){return typeof e=="function"?e(t):e}function CO(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:a,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==FE(o,t.options))return!1}else if(!Mm(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||a&&!a(t))}function EO(e,t){const{exact:n,status:r,predicate:s,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(kc(t.options.mutationKey)!==kc(a))return!1}else if(!Mm(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function FE(e,t){return((t==null?void 0:t.queryKeyHashFn)||kc)(e)}function kc(e){return JSON.stringify(e,(t,n)=>hN(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Mm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Mm(e[n],t[n])):!1}function xz(e,t){if(e===t)return e;const n=AO(e)&&AO(t);if(n||hN(e)&&hN(t)){const r=n?e:Object.keys(e),s=r.length,a=n?t:Object.keys(t),o=a.length,l=n?[]:{};let c=0;for(let u=0;u<o;u++){const d=n?u:a[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(l[d]=void 0,c++):(l[d]=xz(e[d],t[d]),l[d]===e[d]&&e[d]!==void 0&&c++)}return s===o&&c===s?e:l}return t}function tv(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 AO(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hN(e){if(!PO(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!PO(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function PO(e){return Object.prototype.toString.call(e)==="[object Object]"}function fre(e){return new Promise(t=>{setTimeout(t,e)})}function fN(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xz(e,t):t}function mre(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pre(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vz=Symbol();function bz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===vz?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ec,jo,od,i3,gre=(i3=class extends yh{constructor(){super();Ee(this,ec);Ee(this,jo);Ee(this,od);be(this,od,t=>{if(!Rd&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,jo)||this.setEventListener(K(this,od))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,jo))==null||t.call(this),be(this,jo,void 0))}setEventListener(t){var n;be(this,od,t),(n=K(this,jo))==null||n.call(this),be(this,jo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,ec)!==t&&(be(this,ec,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof K(this,ec)=="boolean"?K(this,ec):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ec=new WeakMap,jo=new WeakMap,od=new WeakMap,i3),BE=new gre,ld,So,cd,a3,yre=(a3=class extends yh{constructor(){super();Ee(this,ld,!0);Ee(this,So);Ee(this,cd);be(this,cd,t=>{if(!Rd&&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(){K(this,So)||this.setEventListener(K(this,cd))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,So))==null||t.call(this),be(this,So,void 0))}setEventListener(t){var n;be(this,cd,t),(n=K(this,So))==null||n.call(this),be(this,So,t(this.setOnline.bind(this)))}setOnline(t){K(this,ld)!==t&&(be(this,ld,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return K(this,ld)}},ld=new WeakMap,So=new WeakMap,cd=new WeakMap,a3),nv=new yre;function xre(e){return Math.min(1e3*2**e,3e4)}function wz(e){return(e??"online")==="online"?nv.isOnline():!0}var jz=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function gj(e){return e instanceof jz}function Sz(e){let t=!1,n=0,r=!1,s,a,o;const l=new Promise((v,b)=>{a=v,o=b}),c=v=>{var b;r||(g(new jz(v)),(b=e.abort)==null||b.call(e))},u=()=>{t=!0},d=()=>{t=!1},h=()=>BE.isFocused()&&(e.networkMode==="always"||nv.isOnline())&&e.canRun(),f=()=>wz(e.networkMode)&&e.canRun(),m=v=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,v),s==null||s(),a(v))},g=v=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,v),s==null||s(),o(v))},p=()=>new Promise(v=>{var b;s=w=>{(r||h())&&v(w)},(b=e.onPause)==null||b.call(e)}).then(()=>{var v;s=void 0,r||(v=e.onContinue)==null||v.call(e)}),x=()=>{if(r)return;let v;const b=n===0?e.initialPromise:void 0;try{v=b??e.fn()}catch(w){v=Promise.reject(w)}Promise.resolve(v).then(m).catch(w=>{var _;if(r)return;const j=e.retry??(Rd?0:3),S=e.retryDelay??xre,N=typeof S=="function"?S(n,w):S,k=j===!0||typeof j=="number"&&n<j||typeof j=="function"&&j(n,w);if(t||!k){g(w);return}n++,(_=e.onFail)==null||_.call(e,n,w),fre(N).then(()=>h()?void 0:p()).then(()=>{t?g(w):x()})})};return{promise:l,cancel:c,continue:()=>(s==null||s(),l),cancelRetry:u,continueRetry:d,canStart:f,start:()=>(f()?x():p().then(x),l)}}function vre(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=l=>setTimeout(l,0);const a=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var gn=vre(),tc,o3,Nz=(o3=class{constructor(){Ee(this,tc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dN(this.gcTime)&&be(this,tc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Rd?1/0:5*60*1e3))}clearGcTimeout(){K(this,tc)&&(clearTimeout(K(this,tc)),be(this,tc,void 0))}},tc=new WeakMap,o3),ud,dd,cs,Hn,Fp,nc,Fs,ra,l3,bre=(l3=class extends Nz{constructor(t){super();Ee(this,Fs);Ee(this,ud);Ee(this,dd);Ee(this,cs);Ee(this,Hn);Ee(this,Fp);Ee(this,nc);be(this,nc,!1),be(this,Fp,t.defaultOptions),this.setOptions(t.options),this.observers=[],be(this,cs,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,be(this,ud,wre(this.options)),this.state=t.state??K(this,ud),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=K(this,Hn))==null?void 0:t.promise}setOptions(t){this.options={...K(this,Fp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&K(this,cs).remove(this)}setData(t,n){const r=fN(this.state.data,t,this.options);return Ue(this,Fs,ra).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ue(this,Fs,ra).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=K(this,Hn))==null?void 0:r.promise;return(s=K(this,Hn))==null||s.cancel(t),n?n.then(us).catch(us):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,ud))}isActive(){return this.observers.some(t=>Hs(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!yz(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Hn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Hn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),K(this,cs).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(K(this,Hn)&&(K(this,nc)?K(this,Hn).cancel({revert:!0}):K(this,Hn).cancelRetry()),this.scheduleGc()),K(this,cs).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ue(this,Fs,ra).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,Hn))return K(this,Hn).continueRetry(),K(this,Hn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(be(this,nc,!0),r.signal)})},a=()=>{const h=bz(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return s(f),be(this,nc,!1),this.options.persister?this.options.persister(h,f,this):h(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};s(o),(c=this.options.behavior)==null||c.onFetch(o,this),be(this,dd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&Ue(this,Fs,ra).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const l=h=>{var f,m,g,p;gj(h)&&h.silent||Ue(this,Fs,ra).call(this,{type:"error",error:h}),gj(h)||((m=(f=K(this,cs).config).onError)==null||m.call(f,h,this),(p=(g=K(this,cs).config).onSettled)==null||p.call(g,this.state.data,h,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return be(this,Hn,Sz({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var f,m,g,p;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(x){l(x);return}(m=(f=K(this,cs).config).onSuccess)==null||m.call(f,h,this),(p=(g=K(this,cs).config).onSettled)==null||p.call(g,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(h,f)=>{Ue(this,Fs,ra).call(this,{type:"failed",failureCount:h,error:f})},onPause:()=>{Ue(this,Fs,ra).call(this,{type:"pause"})},onContinue:()=>{Ue(this,Fs,ra).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),K(this,Hn).start()}},ud=new WeakMap,dd=new WeakMap,cs=new WeakMap,Hn=new WeakMap,Fp=new WeakMap,nc=new WeakMap,Fs=new WeakSet,ra=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,...kz(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return gj(s)&&s.revert&&K(this,dd)?{...K(this,dd),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),gn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),K(this,cs).notify({query:this,type:"updated",action:t})})},l3);function kz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wre(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 bi,c3,jre=(c3=class extends yh{constructor(t={}){super();Ee(this,bi);this.config=t,be(this,bi,new Map)}build(t,n,r){const s=n.queryKey,a=n.queryHash??FE(s,n);let o=this.get(a);return o||(o=new bre({cache:this,queryKey:s,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){K(this,bi).has(t.queryHash)||(K(this,bi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,bi).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,bi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){gn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,bi).get(t)}getAll(){return[...K(this,bi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>CO(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>CO(t,r)):n}notify(t){gn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){gn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){gn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},bi=new WeakMap,c3),wi,er,rc,ji,no,u3,Sre=(u3=class extends Nz{constructor(t){super();Ee(this,ji);Ee(this,wi);Ee(this,er);Ee(this,rc);this.mutationId=t.mutationId,be(this,er,t.mutationCache),be(this,wi,[]),this.state=t.state||_z(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,wi).includes(t)||(K(this,wi).push(t),this.clearGcTimeout(),K(this,er).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){be(this,wi,K(this,wi).filter(n=>n!==t)),this.scheduleGc(),K(this,er).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,wi).length||(this.state.status==="pending"?this.scheduleGc():K(this,er).remove(this))}continue(){var t;return((t=K(this,rc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,o,l,c,u,d,h,f,m,g,p,x,v,b,w,j,S,N,k;be(this,rc,Sz({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,C)=>{Ue(this,ji,no).call(this,{type:"failed",failureCount:_,error:C})},onPause:()=>{Ue(this,ji,no).call(this,{type:"pause"})},onContinue:()=>{Ue(this,ji,no).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>K(this,er).canRun(this)}));const n=this.state.status==="pending",r=!K(this,rc).canStart();try{if(!n){Ue(this,ji,no).call(this,{type:"pending",variables:t,isPaused:r}),await((a=(s=K(this,er).config).onMutate)==null?void 0:a.call(s,t,this));const C=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));C!==this.state.context&&Ue(this,ji,no).call(this,{type:"pending",context:C,variables:t,isPaused:r})}const _=await K(this,rc).start();return await((u=(c=K(this,er).config).onSuccess)==null?void 0:u.call(c,_,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,_,t,this.state.context)),await((m=(f=K(this,er).config).onSettled)==null?void 0:m.call(f,_,null,this.state.variables,this.state.context,this)),await((p=(g=this.options).onSettled)==null?void 0:p.call(g,_,null,t,this.state.context)),Ue(this,ji,no).call(this,{type:"success",data:_}),_}catch(_){try{throw await((v=(x=K(this,er).config).onError)==null?void 0:v.call(x,_,t,this.state.context,this)),await((w=(b=this.options).onError)==null?void 0:w.call(b,_,t,this.state.context)),await((S=(j=K(this,er).config).onSettled)==null?void 0:S.call(j,void 0,_,this.state.variables,this.state.context,this)),await((k=(N=this.options).onSettled)==null?void 0:k.call(N,void 0,_,t,this.state.context)),_}finally{Ue(this,ji,no).call(this,{type:"error",error:_})}}finally{K(this,er).runNext(this)}}},wi=new WeakMap,er=new WeakMap,rc=new WeakMap,ji=new WeakSet,no=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),gn.batch(()=>{K(this,wi).forEach(r=>{r.onMutationUpdate(t)}),K(this,er).notify({mutation:this,type:"updated",action:t})})},u3);function _z(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Rr,Bp,d3,Nre=(d3=class extends yh{constructor(t={}){super();Ee(this,Rr);Ee(this,Bp);this.config=t,be(this,Rr,new Map),be(this,Bp,Date.now())}build(t,n,r){const s=new Sre({mutationCache:this,mutationId:++Eg(this,Bp)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){const n=Qg(t),r=K(this,Rr).get(n)??[];r.push(t),K(this,Rr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Qg(t);if(K(this,Rr).has(n)){const s=(r=K(this,Rr).get(n))==null?void 0:r.filter(a=>a!==t);s&&(s.length===0?K(this,Rr).delete(n):K(this,Rr).set(n,s))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=K(this,Rr).get(Qg(t)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=K(this,Rr).get(Qg(t)))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){gn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...K(this,Rr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>EO(n,r))}findAll(t={}){return this.getAll().filter(n=>EO(t,n))}notify(t){gn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return gn.batch(()=>Promise.all(t.map(n=>n.continue().catch(us))))}},Rr=new WeakMap,Bp=new WeakMap,d3);function Qg(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function TO(e){return{onFetch:(t,n)=>{var d,h,f,m,g;const r=t.options,s=(f=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,a=((m=t.state.data)==null?void 0:m.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},v=bz(t.options,t.fetchOptions),b=async(w,j,S)=>{if(p)return Promise.reject();if(j==null&&w.pages.length)return Promise.resolve(w);const N={queryKey:t.queryKey,pageParam:j,direction:S?"backward":"forward",meta:t.options.meta};x(N);const k=await v(N),{maxPages:_}=t.options,C=S?pre:mre;return{pages:C(w.pages,k,_),pageParams:C(w.pageParams,j,_)}};if(s&&a.length){const w=s==="backward",j=w?kre:OO,S={pages:a,pageParams:o},N=j(r,S);l=await b(S,N,w)}else{const w=e??a.length;do{const j=c===0?o[0]??r.initialPageParam:OO(r,l);if(c>0&&j==null)break;l=await b(l,j),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var p,x;return(x=(p=t.options).persister)==null?void 0:x.call(p,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function OO(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 kre(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 Jt,No,ko,hd,fd,_o,md,pd,h3,_re=(h3=class{constructor(e={}){Ee(this,Jt);Ee(this,No);Ee(this,ko);Ee(this,hd);Ee(this,fd);Ee(this,_o);Ee(this,md);Ee(this,pd);be(this,Jt,e.queryCache||new jre),be(this,No,e.mutationCache||new Nre),be(this,ko,e.defaultOptions||{}),be(this,hd,new Map),be(this,fd,new Map),be(this,_o,0)}mount(){Eg(this,_o)._++,K(this,_o)===1&&(be(this,md,BE.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,Jt).onFocus())})),be(this,pd,nv.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,Jt).onOnline())})))}unmount(){var e,t;Eg(this,_o)._--,K(this,_o)===0&&((e=K(this,md))==null||e.call(this),be(this,md,void 0),(t=K(this,pd))==null||t.call(this),be(this,pd,void 0))}isFetching(e){return K(this,Jt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,No).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,Jt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=K(this,Jt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Yu(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return K(this,Jt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=K(this,Jt).get(r.queryHash),a=s==null?void 0:s.state.data,o=hre(t,a);if(o!==void 0)return K(this,Jt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return gn.batch(()=>K(this,Jt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,Jt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=K(this,Jt);gn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,Jt),r={type:"active",...e};return gn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=gn.batch(()=>K(this,Jt).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(us).catch(us)}invalidateQueries(e={},t={}){return gn.batch(()=>{if(K(this,Jt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=gn.batch(()=>K(this,Jt).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let a=s.fetch(void 0,n);return n.throwOnError||(a=a.catch(us)),s.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(us)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=K(this,Jt).build(this,t);return n.isStaleByTime(Yu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(us).catch(us)}fetchInfiniteQuery(e){return e.behavior=TO(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(us).catch(us)}ensureInfiniteQueryData(e){return e.behavior=TO(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return nv.isOnline()?K(this,No).resumePausedMutations():Promise.resolve()}getQueryCache(){return K(this,Jt)}getMutationCache(){return K(this,No)}getDefaultOptions(){return K(this,ko)}setDefaultOptions(e){be(this,ko,e)}setQueryDefaults(e,t){K(this,hd).set(kc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,hd).values()];let n={};return t.forEach(r=>{Mm(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){K(this,fd).set(kc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,fd).values()];let n={};return t.forEach(r=>{Mm(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...K(this,ko).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=FE(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.enabled!==!0&&t.queryFn===vz&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...K(this,ko).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,Jt).clear(),K(this,No).clear()}},Jt=new WeakMap,No=new WeakMap,ko=new WeakMap,hd=new WeakMap,fd=new WeakMap,_o=new WeakMap,md=new WeakMap,pd=new WeakMap,h3),pr,et,zp,tr,sc,gd,Si,Up,yd,xd,ic,ac,Co,vd,ft,kf,mN,pN,gN,yN,xN,vN,bN,Cz,f3,Cre=(f3=class extends yh{constructor(t,n){super();Ee(this,ft);Ee(this,pr);Ee(this,et);Ee(this,zp);Ee(this,tr);Ee(this,sc);Ee(this,gd);Ee(this,Si);Ee(this,Up);Ee(this,yd);Ee(this,xd);Ee(this,ic);Ee(this,ac);Ee(this,Co);Ee(this,vd,new Set);this.options=n,be(this,pr,t),be(this,Si,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,et).addObserver(this),RO(K(this,et),this.options)?Ue(this,ft,kf).call(this):this.updateResult(),Ue(this,ft,yN).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wN(K(this,et),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wN(K(this,et),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ue(this,ft,xN).call(this),Ue(this,ft,vN).call(this),K(this,et).removeObserver(this)}setOptions(t,n){const r=this.options,s=K(this,et);if(this.options=K(this,pr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hs(this.options.enabled,K(this,et))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ue(this,ft,bN).call(this),K(this,et).setOptions(this.options),r._defaulted&&!tv(this.options,r)&&K(this,pr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,et),observer:this});const a=this.hasListeners();a&&MO(K(this,et),s,this.options,r)&&Ue(this,ft,kf).call(this),this.updateResult(n),a&&(K(this,et)!==s||Hs(this.options.enabled,K(this,et))!==Hs(r.enabled,K(this,et))||Yu(this.options.staleTime,K(this,et))!==Yu(r.staleTime,K(this,et)))&&Ue(this,ft,mN).call(this);const o=Ue(this,ft,pN).call(this);a&&(K(this,et)!==s||Hs(this.options.enabled,K(this,et))!==Hs(r.enabled,K(this,et))||o!==K(this,Co))&&Ue(this,ft,gN).call(this,o)}getOptimisticResult(t){const n=K(this,pr).getQueryCache().build(K(this,pr),t),r=this.createResult(n,t);return Are(this,r)&&(be(this,tr,r),be(this,gd,this.options),be(this,sc,K(this,et).state)),r}getCurrentResult(){return K(this,tr)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){K(this,vd).add(t)}getCurrentQuery(){return K(this,et)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,pr).defaultQueryOptions(t),r=K(this,pr).getQueryCache().build(K(this,pr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ue(this,ft,kf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,tr)))}createResult(t,n){var k;const r=K(this,et),s=this.options,a=K(this,tr),o=K(this,sc),l=K(this,gd),u=t!==r?t.state:K(this,zp),{state:d}=t;let h={...d},f=!1,m;if(n._optimisticResults){const _=this.hasListeners(),C=!_&&RO(t,n),A=_&&MO(t,r,n,s);(C||A)&&(h={...h,...kz(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:x}=h;if(n.select&&h.data!==void 0)if(a&&h.data===(o==null?void 0:o.data)&&n.select===K(this,Up))m=K(this,yd);else try{be(this,Up,n.select),m=n.select(h.data),m=fN(a==null?void 0:a.data,m,n),be(this,yd,m),be(this,Si,null)}catch(_){be(this,Si,_)}else m=h.data;if(n.placeholderData!==void 0&&m===void 0&&x==="pending"){let _;if(a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))_=a.data;else if(_=typeof n.placeholderData=="function"?n.placeholderData((k=K(this,xd))==null?void 0:k.state.data,K(this,xd)):n.placeholderData,n.select&&_!==void 0)try{_=n.select(_),be(this,Si,null)}catch(C){be(this,Si,C)}_!==void 0&&(x="success",m=fN(a==null?void 0:a.data,_,n),f=!0)}K(this,Si)&&(g=K(this,Si),m=K(this,yd),p=Date.now(),x="error");const v=h.fetchStatus==="fetching",b=x==="pending",w=x==="error",j=b&&v,S=m!==void 0;return{status:x,fetchStatus:h.fetchStatus,isPending:b,isSuccess:x==="success",isError:w,isInitialLoading:j,isLoading:j,data:m,dataUpdatedAt:h.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!b,isLoadingError:w&&!S,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&S,isStale:zE(t,n),refetch:this.refetch}}updateResult(t){const n=K(this,tr),r=this.createResult(K(this,et),this.options);if(be(this,sc,K(this,et).state),be(this,gd,this.options),K(this,sc).data!==void 0&&be(this,xd,K(this,et)),tv(r,n))return;be(this,tr,r);const s={},a=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!K(this,vd).size)return!0;const c=new Set(l??K(this,vd));return this.options.throwOnError&&c.add("error"),Object.keys(K(this,tr)).some(u=>{const d=u;return K(this,tr)[d]!==n[d]&&c.has(d)})};(t==null?void 0:t.listeners)!==!1&&a()&&(s.listeners=!0),Ue(this,ft,Cz).call(this,{...s,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ue(this,ft,yN).call(this)}},pr=new WeakMap,et=new WeakMap,zp=new WeakMap,tr=new WeakMap,sc=new WeakMap,gd=new WeakMap,Si=new WeakMap,Up=new WeakMap,yd=new WeakMap,xd=new WeakMap,ic=new WeakMap,ac=new WeakMap,Co=new WeakMap,vd=new WeakMap,ft=new WeakSet,kf=function(t){Ue(this,ft,bN).call(this);let n=K(this,et).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(us)),n},mN=function(){Ue(this,ft,xN).call(this);const t=Yu(this.options.staleTime,K(this,et));if(Rd||K(this,tr).isStale||!dN(t))return;const r=yz(K(this,tr).dataUpdatedAt,t)+1;be(this,ic,setTimeout(()=>{K(this,tr).isStale||this.updateResult()},r))},pN=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,et)):this.options.refetchInterval)??!1},gN=function(t){Ue(this,ft,vN).call(this),be(this,Co,t),!(Rd||Hs(this.options.enabled,K(this,et))===!1||!dN(K(this,Co))||K(this,Co)===0)&&be(this,ac,setInterval(()=>{(this.options.refetchIntervalInBackground||BE.isFocused())&&Ue(this,ft,kf).call(this)},K(this,Co)))},yN=function(){Ue(this,ft,mN).call(this),Ue(this,ft,gN).call(this,Ue(this,ft,pN).call(this))},xN=function(){K(this,ic)&&(clearTimeout(K(this,ic)),be(this,ic,void 0))},vN=function(){K(this,ac)&&(clearInterval(K(this,ac)),be(this,ac,void 0))},bN=function(){const t=K(this,pr).getQueryCache().build(K(this,pr),this.options);if(t===K(this,et))return;const n=K(this,et);be(this,et,t),be(this,zp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Cz=function(t){gn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,tr))}),K(this,pr).getQueryCache().notify({query:K(this,et),type:"observerResultsUpdated"})})},f3);function Ere(e,t){return Hs(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function RO(e,t){return Ere(e,t)||e.state.data!==void 0&&wN(e,t,t.refetchOnMount)}function wN(e,t,n){if(Hs(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&zE(e,t)}return!1}function MO(e,t,n,r){return(e!==t||Hs(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&zE(e,n)}function zE(e,t){return Hs(t.enabled,e)!==!1&&e.isStaleByTime(Yu(t.staleTime,e))}function Are(e,t){return!tv(e.getCurrentResult(),t)}var Eo,Ao,gr,ca,_a,fx,jN,m3,Pre=(m3=class extends yh{constructor(n,r){super();Ee(this,_a);Ee(this,Eo);Ee(this,Ao);Ee(this,gr);Ee(this,ca);be(this,Eo,n),this.setOptions(r),this.bindMethods(),Ue(this,_a,fx).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=K(this,Eo).defaultMutationOptions(n),tv(this.options,r)||K(this,Eo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:K(this,gr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&kc(r.mutationKey)!==kc(this.options.mutationKey)?this.reset():((s=K(this,gr))==null?void 0:s.state.status)==="pending"&&K(this,gr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=K(this,gr))==null||n.removeObserver(this)}onMutationUpdate(n){Ue(this,_a,fx).call(this),Ue(this,_a,jN).call(this,n)}getCurrentResult(){return K(this,Ao)}reset(){var n;(n=K(this,gr))==null||n.removeObserver(this),be(this,gr,void 0),Ue(this,_a,fx).call(this),Ue(this,_a,jN).call(this)}mutate(n,r){var s;return be(this,ca,r),(s=K(this,gr))==null||s.removeObserver(this),be(this,gr,K(this,Eo).getMutationCache().build(K(this,Eo),this.options)),K(this,gr).addObserver(this),K(this,gr).execute(n)}},Eo=new WeakMap,Ao=new WeakMap,gr=new WeakMap,ca=new WeakMap,_a=new WeakSet,fx=function(){var r;const n=((r=K(this,gr))==null?void 0:r.state)??_z();be(this,Ao,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},jN=function(n){gn.batch(()=>{var r,s,a,o,l,c,u,d;if(K(this,ca)&&this.hasListeners()){const h=K(this,Ao).variables,f=K(this,Ao).context;(n==null?void 0:n.type)==="success"?((s=(r=K(this,ca)).onSuccess)==null||s.call(r,n.data,h,f),(o=(a=K(this,ca)).onSettled)==null||o.call(a,n.data,null,h,f)):(n==null?void 0:n.type)==="error"&&((c=(l=K(this,ca)).onError)==null||c.call(l,n.error,h,f),(d=(u=K(this,ca)).onSettled)==null||d.call(u,void 0,n.error,h,f))}this.listeners.forEach(h=>{h(K(this,Ao))})})},m3),Ez=y.createContext(void 0),UE=e=>{const t=y.useContext(Ez);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Tre=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),i.jsx(Ez.Provider,{value:e,children:t})),Az=y.createContext(!1),Ore=()=>y.useContext(Az);Az.Provider;function Rre(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Mre=y.createContext(Rre()),Ire=()=>y.useContext(Mre);function Pz(e,t){return typeof e=="function"?e(...t):!!e}function $re(){}var Lre=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},Dre=e=>{y.useEffect(()=>{e.clearReset()},[e])},Fre=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Pz(n,[e.error,r]),Bre=e=>{e.suspense&&(typeof e.staleTime!="number"&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},zre=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ure=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Vre(e,t,n){var u,d,h,f;const r=UE(),s=Ore(),a=Ire(),o=r.defaultQueryOptions(e);(d=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||d.call(u,o),o._optimisticResults=s?"isRestoring":"optimistic",Bre(o),Lre(o,a),Dre(a);const[l]=y.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(y.useSyncExternalStore(y.useCallback(m=>{const g=s?()=>{}:l.subscribe(gn.batchCalls(m));return l.updateResult(),g},[l,s]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),y.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),zre(o,c))throw Ure(o,l,a);if(Fre({result:c,errorResetBoundary:a,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;return(f=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||f.call(h,o,c),o.notifyOnChangeProps?c:l.trackResult(c)}function Wre(e,t){return Vre(e,Cre)}function IO(e,t){const n=UE(),[r]=y.useState(()=>new Pre(n,e));y.useEffect(()=>{r.setOptions(e)},[r,e]);const s=y.useSyncExternalStore(y.useCallback(o=>r.subscribe(gn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=y.useCallback((o,l)=>{r.mutate(o,l).catch($re)},[r]);if(s.error&&Pz(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}/** 702 * @remix-run/router v1.19.2 703 * 704 * Copyright (c) Remix Software Inc. 705 * 706 * This source code is licensed under the MIT license found in the 707 * LICENSE.md file in the root directory of this source tree. 708 * 709 * @license MIT 710 */function Im(){return Im=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},Im.apply(this,arguments)}var Ro;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ro||(Ro={}));const $O="popstate";function Hre(e){e===void 0&&(e={});function t(r,s){let{pathname:a,search:o,hash:l}=r.location;return SN("",{pathname:a,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:rv(s)}return Kre(t,n,null,e)}function sn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tz(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qre(){return Math.random().toString(36).substr(2,8)}function LO(e,t){return{usr:e.state,key:e.key,idx:t}}function SN(e,t,n,r){return n===void 0&&(n=null),Im({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?xh(t):t,{state:n,key:t&&t.key||r||qre()})}function rv(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 xh(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 Kre(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:a=!1}=r,o=s.history,l=Ro.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Im({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){l=Ro.Pop;let x=d(),v=x==null?null:x-u;u=x,c&&c({action:l,location:p.location,delta:v})}function f(x,v){l=Ro.Push;let b=SN(p.location,x,v);u=d()+1;let w=LO(b,u),j=p.createHref(b);try{o.pushState(w,"",j)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(j)}a&&c&&c({action:l,location:p.location,delta:1})}function m(x,v){l=Ro.Replace;let b=SN(p.location,x,v);u=d();let w=LO(b,u),j=p.createHref(b);o.replaceState(w,"",j),a&&c&&c({action:l,location:p.location,delta:0})}function g(x){let v=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof x=="str
710ing"?x:rv(x);return b=b.replace(/ $/,"%20"),sn(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let p={get action(){return l},get location(){return e(s,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener($O,h),c=x,()=>{s.removeEventListener($O,h),c=null}},createHref(x){return t(s,x)},createURL:g,encodeLocation(x){let v=g(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:m,go(x){return o.go(x)}};return p}var DO;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(DO||(DO={}));function Gre(e,t,n){return n===void 0&&(n="/"),Yre(e,t,n,!1)}function Yre(e,t,n,r){let s=typeof t=="string"?xh(t):t,a=VE(s.pathname||"/",n);if(a==null)return null;let o=Oz(e);Xre(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=ose(a);l=ise(o[c],u,r)}return l}function Oz(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(sn(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 u=Go([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(sn(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Oz(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:rse(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))s(a,o);else for(let c of Rz(a.path))s(a,o,c)}),t}function Rz(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let o=Rz(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),s&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Xre(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:sse(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Jre=/^:[\w-]+$/,Qre=3,Zre=2,ese=1,tse=10,nse=-2,FO=e=>e==="*";function rse(e,t){let n=e.split("/"),r=n.length;return n.some(FO)&&(r+=nse),t&&(r+=Zre),n.filter(s=>!FO(s)).reduce((s,a)=>s+(Jre.test(a)?Qre:a===""?ese:tse),r)}function sse(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function ise(e,t,n){let{routesMeta:r}=e,s={},a="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",h=BO({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=BO({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;
vendor: 6,948 bytes, lines 710-719
710Object.assign(s,h.params),o.push({params:s,pathname:Go([a,h.pathname]),pathnameBase:dse(Go([a,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(a=Go([a,h.pathnameBase]))}return o}function BO(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ase(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],o=a.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:f,isOptional:m}=d;if(f==="*"){let p=l[h]||"";o=a.slice(0,a.length-p.length).replace(/(.)\/+$/,"$1")}const g=l[h];return m&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function ase(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Tz(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function ose(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tz(!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 VE(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)||"/"}function lse(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?xh(e):e;return{pathname:n?n.startsWith("/")?n:cse(n,t):t,search:hse(r),hash:fse(s)}}function cse(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function yj(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 use(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function WE(e,t){let n=use(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function HE(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=xh(e):(s=Im({},e),sn(!s.pathname||!s.pathname.includes("?"),yj("?","pathname","search",s)),sn(!s.pathname||!s.pathname.includes("#"),yj("#","pathname","hash",s)),sn(!s.search||!s.search.includes("#"),yj("#","search","hash",s)));let a=e===""||s.pathname==="",o=a?"/":s.pathname,l;if(o==null)l=n;else{let h=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}l=h>=0?t[h]:"/"}let c=lse(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Go=e=>e.join("/").replace(/\/\/+/g,"/"),dse=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hse=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fse=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function mse(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Mz=["post","put","patch","delete"];new Set(Mz);const pse=["get",...Mz];new Set(pse);/** 711 * React Router v6.26.2 712 * 713 * Copyright (c) Remix Software Inc. 714 * 715 * This source code is licensed under the MIT license found in the 716 * LICENSE.md file in the root directory of this source tree. 717 * 718 * @license MIT 719 */function $m(){return $m=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},$m.apply(this,arguments)}const qE=y.createContext(null),gse=y.createContext(null),ul=y.createContext(null),i0=y.createContext(null),Va=y.createContext({outlet:null,matches:[],isDataRoute:!1}),Iz=y.createContext(null);function yse(e,t){let{relative:n}=t===void 0?{}:t;vh()||sn(!1);let{basename:r,navigator:s}=y.useContext(ul),{hash:a,pathname:o,search:l}=Dz(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Go([r,o])),s.createHref({pathname:c,search:l,hash:a})}function vh(){return y.useContext(i0)!=null}function dl(){return vh()||sn(!1),y.useContext(i0).location}function $z(e){y.useContext(ul).static||y.useLayoutEffect(e)}function Ki(){let{isDataRoute:e}=y.useContext(Va);return e?Pse():xse()}function xse(){vh()||sn(!1);let e=y.useContext(qE),{basename:t,future:n,navigator:r}=y.useContext(ul),{matches:s}=y.useContext(Va),{pathname:a}=dl(),o=JSON.stringify(WE(s,n.v7_relativeSplatPath)),l=y.useRef(!1);return $z(()=>{l.current=!0}),y.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let h=HE(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Go([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,o,a,e])}function Lz(){let{matches:e}=y.useContext(Va),t=e[e.length-1];return t?t.params:{}}function Dz(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(ul),{matches:s}=y.useContext(Va),{pathname:a}=dl(),o=JSON.stringify(WE(s,r.v7_relativeSplatPath));return y.useMemo(()=>HE(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function vse(e,t){return bse(e,t)}function bse(e,t,n,r){vh()||sn(!1);let{navigator:s}=y.useContext(ul),{matches:a}=y.useContext(Va),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=dl(),d;if(t){var h;let x=typeof t=="string"?xh(t):t;c==="/"||(h=x.pathname)!=null&&h.startsWith(c)||sn(!1),d=x}else d=u;let f=d.pathname||"/",m=f;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=Gre(e,{pathname:m}),p=kse(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Go([c,s.encodeLocation?s.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Go([c,s.encodeLocation?s.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,n,r);return t&&p?y.createElement(i0.Provider,{value:{location:$m({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Ro.Pop}},p):p}function wse(){let e=Ase(),t=mse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application
719Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:s},n):null,null)}const jse=y.createElement(wse,null);class Sse extends y.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?y.createElement(Va.Provider,{value:this.props.routeContext},y.createElement(Iz.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Nse(e){let{routeContext:t,match:n,children:r}=e,s=y.useContext(qE);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Va.Provider,{value:t},r)}function kse(e,t,n,r){var s;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,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||sn(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:m}=n,g=h.route.loader&&f[h.route.id]===void 0&&(!m||m[h.route.id]===void 0);if(h.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let m,g=!1,p=null,x=null;n&&(m=l&&h.route.id?l[h.route.id]:void 0,p=h.route.errorElement||jse,c&&(u<0&&f===0?(g=!0,x=null):u===f&&(g=!0,x=h.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,f+1)),b=()=>{let w;return m?w=p:g?w=x:h.route.Component?w=y.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=d,y.createElement(Nse,{match:h,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?y.createElement(Sse,{location:n.location,revalidation:n.revalidation,component:p,error:m,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var Fz=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Fz||{}),sv=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}(sv||{});function _se(e){let t=y.useContext(qE);return t||sn(!1),t}function Cse(e){let t=y.useContext(gse);return t||sn(!1),t}function Ese(e){let t=y.useContext(Va);return t||sn(!1),t}function Bz(e){let t=Ese(),n=t.matches[t.matches.length-1];return n.route.id||sn(!1),n.route.id}function Ase(){var e;let t=y.useContext(Iz),n=Cse(sv.UseRouteError),r=Bz(sv.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Pse(){let{router:e}=_se(Fz.UseNavigateStable),t=Bz(sv.UseNavigateStable),n=y.useRef(!1);return $z(()=>{n.current=!0}),y.useCallback(function(s,a){a===void 0&&(a={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,$m({fromRouteId:t},a)))},[e,t])}function Tse(e){let{to:t,replace:n,state:r,relative:s}=e;vh()||sn(!1);let{future:a,static:o}=y.useContext(ul),{matches:l}=y.useContext(Va),{pathname:c}=dl(),u=Ki(),d=HE(t,WE(l,a.v7_relativeSplatPath),c,s==="path"),h=JSON.stringify(d);return y.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:s}),[u,h,s,n,r]),null}function lt(e){sn(!1)}function Ose(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Ro.Pop,navigator:a,static:o=!1,future:l}=e;vh()&&sn(!1);let c=t.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:c,navigator:a,static:o,future:$m({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=xh(r));let{pathname:d="/",search:h="",hash:f="",state:m=null,key:g="default"}=r,p=y.useMemo(()=>{let x=VE(d,c);return x==null?null:{location:{pathname:x,search:h,hash:f,state:m,ke
719y:g},navigationType:s}},[c,d,h,f,m,g,s]);return p==null?null:y.createElement(ul.Provider,{value:u},y.createElement(i0.Provider,{children:n,value:p}))}function Rse(e){let{children:t,location:n}=e;return vse(NN(t),n)}new Promise(()=>{});function NN(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,s)=>{if(!y.isValidElement(r))return;let a=[...t,s];if(r.type===y.Fragment){n.push.apply(n,NN(r.props.children,a));return}r.type!==lt&&sn(!1),!r.props.index||!r.props.children||sn(!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=NN(r.props.children,a)),n.push(o)}),n}/** 720 * React Router DOM v6.26.2 721 * 722 * Copyright (c) Remix Software Inc. 723 * 724 * This source code is licensed under the MIT license found in the 725 * LICENSE.md file in the root directory of this source tree. 726 * 727 * @license MIT 728 */function kN(){return kN=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},kN.apply(this,arguments)}function Mse(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Ise(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function $se(e,t){return e.button===0&&(!t||t==="_self")&&!Ise(e)}function _N(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Lse(e,t){let n=_N(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(a=>{n.append(s,a)})}),n}const Dse=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Fse="6";try{window.__reactRouterVersion=Fse}catch{}const Bse="startTransition",zO=k3[Bse];function zse(e){let{basename:t,children:n,future:r,window:s}=e,a=y.useRef();a.current==null&&(a.current=Hre({window:s,v5Compat:!0}));let o=a.current,[l,c]=y.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=y.useCallback(h=>{u&&zO?zO(()=>c(h)):c(h)},[c,u]);return y.useLayoutEffect(()=>o.listen(d),[o,d]),y.createElement(Ose,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const Use=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vse=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ke=y.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=t,f=Mse(t,Dse),{basename:m}=y.useContext(ul),g,p=!1;if(typeof u=="string"&&Vse.test(u)&&(g=u,Use))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),S=VE(j.pathname,m);j.origin===w.origin&&S!=null?u=S+j.search+j.hash:p=!0}catch{}let x=yse(u,{relative:s}),v=Wse(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,unstable_viewTransition:h});function b(w){r&&r(w),w.defaultPrevented||v(w)}return y.createElement("a",kN({},f,{href:g||x,onClick:p||a?r:b,ref:n,target:c}))});var UO;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(UO||(UO={}));var VO;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(VO||(VO={}));function Wse(e,t){let{target:n,replace:r,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l}=t===void 0?{}:t,c=Ki(),u=dl(),d=Dz(e,{relative:o});return y.useCallback(h=>{if($se(h,n)){h.preventDefault();let f=r!==void 0?r:rv(u)===rv(d);c(e,{replace:f,state:s,preventScrollReset:a,relative:o,unstable_viewTransition:l})}},[u,c,d,r,s,n,e,a,o,l])}function eg(e){let t=y.useRef(_N(e)),n=y.useRef(!1),r=dl(),s=y.useMemo(()=>Lse(r.search,n.current?null:t.current),[r.search]),a=Ki(),o=y.useCallback((l,c)=>{const u=_N(typeof l=="function"?l(s):l);n.current=!0,a("?"+u,c)},[a,s]);return[s,o]}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Md;
728(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Md||(Md={}));class Vl extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const Hse=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},qse=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},r=n.Plugins=n.Plugins||{},s=()=>t!==null?t.name:Hse(e),a=()=>s()!=="web",o=h=>{const f=u.get(h);return!!(f!=null&&f.platforms.has(s())||l(h))},l=h=>{var f;return(f=n.PluginHeaders)===null||f===void 0?void 0:f.find(m=>m.name===h)},c=h=>e.console.error(h),u=new Map,d=(h,f={})=>{const m=u.get(h);if(m)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),m.proxy;const g=s(),p=l(h);let x;const v=async()=>(!x&&g in f?x=typeof f[g]=="function"?x=await f[g]():x=f[g]:t!==null&&!x&&"web"in f&&(x=typeof f.web=="function"?x=await f.web():x=f.web),x),b=(_,C)=>{var A,E;if(p){const P=p==null?void 0:p.methods.find($=>C===$.name);if(P)return P.rtype==="promise"?$=>n.nativePromise(h,C.toString(),$):($,R)=>n.nativeCallback(h,C.toString(),$,R);if(_)return(A=_[C])===null||A===void 0?void 0:A.bind(_)}else{if(_)return(E=_[C])===null||E===void 0?void 0:E.bind(_);throw new Vl(`"${h}" plugin is not implemented on ${g}`,Md.Unimplemented)}},w=_=>{let C;const A=(...E)=>{const P=v().then($=>{const R=b($,_);if(R){const L=R(...E);return C=L==null?void 0:L.remove,L}else throw new Vl(`"${h}.${_}()" is not implemented on ${g}`,Md.Unimplemented)});return _==="addListener"&&(P.remove=async()=>C()),P};return A.toString=()=>`${_.toString()}() { [capacitor code] }`,Object.defineProperty(A,"name",{value:_,writable:!1,configurable:!1}),A},j=w("addListener"),S=w("removeListener"),N=(_,C)=>{const A=j({eventName:_},C),E=async()=>{const $=await A;S({eventName:_,callbackId:$},C)},P=new Promise($=>A.then(()=>$({remove:E})));return P.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await E()},P},k=new Proxy({},{get(_,C){switch(C){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return p?N:j;case"removeListener":return S;default:return w(C)}}});return r[h]=k,u.set(h,{name:h,proxy:k,platforms:new Set([...Object.keys(f),...p?[g]:[]])}),k};return n.convertFileSrc||(n.convertFileSrc=h=>h),n.getPlatform=s,n.handleError=c,n.isNativePlatform=a,n.isPluginAvailable=o,n.registerPlugin=d,n.Exception=Vl,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},Kse=e=>e.Capacitor=qse(e),iv=Kse(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),tg=iv.registerPlugin;class KE{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),r&&this.sendRetainedArgumentsForEvent(t);const o=async()=>this.removeListener(t,n);return Promise.resolve({remove:o})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,r){const s=this.listeners[t];if(!s){if(r){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}s.forEach(a=>a(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new iv.Exception(t,Md.Unimplemented)}unavailable(t="not available"){return new iv.Exception(t,Md.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const s=r.indexOf(n);this.listeners[t].splice(s,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];
728n&&(delete this.retainedEventArguments[t],n.forEach(r=>{this.notifyListeners(t,r)}))}}const WO=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),HO=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Gse extends KE{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[s,a]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");s=HO(s).trim(),a=HO(a).trim(),n[s]=a}),n}async setCookie(t){try{const n=WO(t.key),r=WO(t.value),s=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",a=(t.path||"/").replace("path=",""),o=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${s}; path=${a}; ${o};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}tg("CapacitorCookies",{web:()=>new Gse});const Yse=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const s=r.result;t(s.indexOf(",")>=0?s.split(",")[1]:s)},r.onerror=s=>n(s),r.readAsDataURL(e)}),Xse=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(s=>s.toLocaleLowerCase()).reduce((s,a,o)=>(s[a]=e[t[o]],s),{})},Jse=(e,t=!0)=>e?Object.entries(e).reduce((r,s)=>{const[a,o]=s;let l,c;return Array.isArray(o)?(c="",o.forEach(u=>{l=t?encodeURIComponent(u):u,c+=`${a}=${l}&`}),c.slice(0,-1)):(l=t?encodeURIComponent(o):o,c=`${a}=${l}`),`${r}&${c}`},"").substr(1):null,Qse=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),s=Xse(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(s.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[o,l]of Object.entries(e.data||{}))a.set(o,l);n.body=a.toString()}else if(s.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((l,c)=>{a.append(c,l)});else for(const l of Object.keys(e.data))a.append(l,e.data[l]);n.body=a;const o=new Headers(n.headers);o.delete("content-type"),n.headers=o}else(s.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class Zse extends KE{async request(t){const n=Qse(t,t.webFetchExtra),r=Jse(t.params,t.shouldEncodeUrlParams),s=r?`${t.url}?${r}`:t.url,a=await fetch(s,n),o=a.headers.get("content-type")||"";let{responseType:l="text"}=a.ok?t:{};o.includes("application/json")&&(l="json");let c,u;switch(l){case"arraybuffer":case"blob":u=await a.blob(),c=await Yse(u);break;case"json":c=await a.json();break;case"document":case"text":default:c=await a.text()}const d={};return a.headers.forEach((h,f)=>{d[f]=h}),{data:c,headers:d,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}tg("CapacitorHttp",{web:()=>new Zse});const eie="modulepreload",tie=function(e){return"/"+e},qO={},Lm=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=tie(c),c in qO)return;qO[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":eie,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((f,m)=>{h.addEventListener("load",f),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},nie=tg("SplashScreen",{web:()=>Lm(()=>import("./web-DXw8j_MM.js"),[]).then(e=>new e.SplashScreenWeb)});var CN;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(CN||(CN={}));var KO;(function(e){e.None="NONE",e.Slide="SLIDE",e.Fade="FADE"})(KO||(KO={}));const GO=tg("StatusBar");function a0(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function rie(e,t,n,r){function s(a){return a instanceof n?a:new n(function(o){o(a)})}
728return new(n||(n=Promise))(function(a,o){function l(d){try{u(r.next(d))}catch(h){o(h)}}function c(d){try{u(r.throw(d))}catch(h){o(h)}}function u(d){d.done?a(d.value):s(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}const sie=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class GE extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class iie extends GE{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class YO extends GE{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class XO extends GE{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var EN;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(EN||(EN={}));class aie{constructor(t,{headers:n={},customFetch:r,region:s=EN.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=sie(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return rie(this,arguments,void 0,function*(n,r={}){var s;let a,o;try{const{headers:l,method:c,body:u,signal:d,timeout:h}=r;let f={},{region:m}=r;m||(m=this.region);const g=new URL(`${this.url}/${n}`);m&&m!=="any"&&(f["x-region"]=m,g.searchParams.set("forceFunctionRegion",m));let p;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",p=u):typeof u=="string"?(f["Content-Type"]="text/plain",p=u):typeof FormData<"u"&&u instanceof FormData?p=u:(f["Content-Type"]="application/json",p=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?p=JSON.stringify(u):p=u;let x=d;h&&(o=new AbortController,a=setTimeout(()=>o.abort(),h),d?(x=o.signal,d.addEventListener("abort",()=>o.abort())):x=o.signal);const v=yield this.fetch(g.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),l),body:p,signal:x}).catch(S=>{throw new iie(S)}),b=v.headers.get("x-relay-error");if(b&&b==="true")throw new YO(v);if(!v.ok)throw new XO(v);let w=((s=v.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),j;return w==="application/json"?j=yield v.json():w==="application/octet-stream"||w==="application/pdf"?j=yield v.blob():w==="text/event-stream"?j=v:w==="multipart/form-data"?j=yield v.formData():j=yield v.text(),{data:j,error:null,response:v}}catch(l){return{data:null,error:l,response:l instanceof XO||l instanceof YO?l.context:void 0}}finally{a&&clearTimeout(a)}})}}const zz=3,JO=e=>Math.min(1e3*2**e,3e4),oie=[520,503],Uz=["GET","HEAD","OPTIONS"];var lie=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
728de=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function QO(e,t){return new Promise(n=>{if(t!=null&&t.aborted){n();return}const r=setTimeout(()=>{t==null||t.removeEventListener("abort",s),n()},e);function s(){clearTimeout(r),n()}t==null||t.addEventListener("abort",s)})}function cie(e,t,n,r){return!(!r||n>=zz||!Uz.includes(e)||!oie.includes(t))}var uie=class{constructor(e){var t,n,r,s,a;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=e.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(a=e.retry)!==null&&a!==void 0?a:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let a=(async()=>{let o=0;for(;;){const u=new Headers(n.headers);o>0&&u.set("X-Retry-Count",String(o));let d;try{d=await r(n.url.toString(),{method:n.method,headers:u,body:JSON.stringify(n.body,(h,f)=>typeof f=="bigint"?f.toString():f),signal:n.signal})}catch(h){if(h instanceof Error&&(h.name==="AbortError"||"code"in h&&h.code==="ABORT_ERR")||!Uz.includes(n.method))throw h;if(n.retryEnabled&&o<zz){const f=JO(o);o++,await QO(f,n.signal);continue}throw h}if(cie(n.method,d.status,o,n.retryEnabled)){var l,c;const h=(l=(c=d.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&l!==void 0?l:null,f=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:JO(o);await d.text(),o++,await QO(f,n.signal);continue}return await n.processResponse(d)}})();return this.shouldThrowOnError||(a=a.catch(o=>{var l;let c="",u="",d="";const h=o==null?void 0:o.cause;if(h){var f,m,g,p;const b=(f=h==null?void 0:h.message)!==null&&f!==void 0?f:"",w=(m=h==null?void 0:h.code)!==null&&m!==void 0?m:"";c=`${(g=o==null?void 0:o.name)!==null&&g!==void 0?g:"FetchError"}: ${o==null?void 0:o.message}`,c+=` 729 730Caused by: ${(p=h==null?void 0:h.name)!==null&&p!==void 0?p:"Error"}: ${b}`,w&&(c+=` (${w})`),h!=null&&h.stack&&(c+=` 731${h.stack}`)}else{var x;c=(x=o==null?void 0:o.stack)!==null&&x!==void 0?x:""}const v=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(d="",u="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${v} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",u="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(u+=`. Your request URL is ${v} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(l=o==null?void 0:o.name)!==null&&l!==void 0?l:"FetchError"}: ${o==null?void 0:o.message}`,details:c,hint:u,code:d},data:null,count:null,status:0,statusText:""}}
731)),a.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,s=null,a=e.status,o=e.statusText;if(e.ok){var l,c;if(t.method!=="HEAD"){var u;const f=await e.text();f===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((u=t.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?r=f:r=JSON.parse(f))}const d=(l=t.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),h=(c=e.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");d&&h&&h.length>1&&(s=parseInt(h[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,s=null,a=406,o="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const d=await e.text();try{n=JSON.parse(d),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o="OK")}catch{e.status===404&&d===""?(a=204,o="No Content"):n={message:d}}if(n&&t.shouldThrowOnError)throw new lie(n)}return{success:n===null,error:n,data:r,count:s,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},die=class extends uie{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const a=s?`${s}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:a="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${c}"; options=${l};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const ZO=new RegExp("[,()]");var mu=class extends die{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&ZO.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&ZO.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const a=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>
731n!==void 0).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},hie=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=n?"HEAD":"GET";let a=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!a?"":(u==='"'&&(a=!a),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",o),r&&c.append("Prefer",`count=${r}`),new mu({method:s,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="POST",{url:a,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),n||o.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);a.searchParams.set("columns",c.join(","))}}return new mu({method:s,url:a,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var a;const o="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),s||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);l.searchParams.set("columns",d.join(","))}}return new mu({method:o,url:l,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var n;const r="PATCH",{url:s,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new mu({method:r,url:s,headers:a,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new mu({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Dm(e){"@babel/helpers - typeof";return Dm=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},Dm(e)}function fie(e,t){if(Dm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mie(e){var t=fie(e,"string");return Dm(t)=="symbol"?t:t+""}function pie(e,t,n){return(t=mie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eR(Object(n),!0).forEach(function(r){pie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var gie=class Vz{constructor(t,{headers:n={},schema:r,fetch:s,timeout:a,urlLengthLimit:o=8e3,retry:l}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=o;const c=s??globalThis.fetch;a!==void 0&&a>0?this.fetch=(u,d)=>{const h=new AbortController,f=setTimeout(()=>h.abort(),a),m=d==null?void 0:d.signal;if(m){if(m.aborted)return clearTimeout(f),c(u,d);const g=()=>{clearTimeout(f),h.abort()};return m.addEventListener("abort",g,{once:!0}),c(u,Zg(Zg({},d),{},{signal:h.signal})).finally(()=>{clearTimeout(f),m.removeEventListener("abort",g)})}return c(u,Zg(Zg({},d),{},{signal:h.signal})).finally(()=>clearTimeout(f))}:this.fetch=c,this.retry=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new hie(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new Vz(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,n={},{head:r=!1,get:s=!1,count:a}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(d)),h=r&&Object.values(n).some(d);h?(l="POST",u=n):r||s?(l=r?"HEAD":"GET",Object.entries(n).filter(([m,g])=>g!==void 0).map(([m,g])=>[m,Array.isArray(g)?`{${g.join(",")}}`:`${g}
731`]).forEach(([m,g])=>{c.searchParams.append(m,g)})):(l="POST",u=n);const f=new Headers(this.headers);return h?f.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&f.set("Prefer",`count=${a}`),new mu({method:l,url:c,headers:f,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class yie{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const n=globalThis;if(typeof globalThis<"u"&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof n.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&n.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const a=s.versions;if(a&&a.node){const o=a.node,l=parseInt(o.replace(/^v/,"").split(".")[0]);return l>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${l} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${l} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 732import ws from "ws" 733new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=` 734 735Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const xie="2.105.3",vie=`realtime-js/${xie}`,bie="1.0.0",Wz="2.0.0",wie=Wz,jie=1e4,Sie=100,po={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Hz={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},AN={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class Nie{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,r){var s,a;const o=t.topic,l=(s=t.ref)!==null&&s!==void 0?s:"",c=(a=t.join_ref)!==null&&a!==void 0?a:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+u.length+h.length,m=new ArrayBuffer(this.HEADER_LENGTH+f);let g=new DataView(m),p=0;g.setUint8(p++,this.KINDS.userBroadcastPush),g.setUint8(p++,c.length),g.setUint8(p++,l.length),g.setUint8(p++,o.length),g.setUint8(p++,u.length),g.setUint8(p++,h.length),g.setUint8(p++,n),Array.from(c,v=>g.setUint8(p++,v.charCodeAt(0))),Array.from(l,v=>g.setUint8(p++,v.charCodeAt(0))),Array.from(o,v=>g.setUint8(p++,v.charCodeAt(0))),Array.from(u,v=>g.setUint8(p++,v.charCodeAt(0))),Array.from(h,v=>g.setUint8(p++,v.charCodeAt(0)));var x=new Uint8Array(m.byteLength+r.byteLength);return x.set(new Uint8Array(m),0),x.set(new Uint8Array(r),m.byteLength),x.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,a,o,l,c]=r;
735return n({join_ref:s,ref:a,topic:o,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,s)}}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),a=n.getUint8(2),o=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+s));c=c+s;const d=r.decode(t.slice(c,c+a));c=c+a;const h=r.decode(t.slice(c,c+o));c=c+o;const f=t.slice(c,t.byteLength),m=l===this.JSON_ENCODING?JSON.parse(r.decode(f)):f,g={type:this.BROADCAST_EVENT,event:d,payload:m};return o>0&&(g.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:g}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}var _t;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(_t||(_t={}));const tR=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((a,o)=>(a[o]=kie(o,e,t,s),a),{}):{}},kie=(e,t,n,r)=>{const s=t.find(l=>
vendor: 5,540 bytes, line 735
735l.name===e),a=s==null?void 0:s.type,o=n[e];return a&&!r.includes(a)?qz(a,o):PN(o)},qz=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return Aie(t,n)}switch(e){case _t.bool:return _ie(t);case _t.float4:case _t.float8:case _t.int2:case _t.int4:case _t.int8:case _t.numeric:case _t.oid:return Cie(t);case _t.json:case _t.jsonb:return Eie(t);case _t.timestamp:return Pie(t);case _t.abstime:case _t.date:case _t.daterange:case _t.int4range:case _t.int8range:case _t.money:case _t.reltime:case _t.text:case _t.time:case _t.timestamptz:case _t.timetz:case _t.tsrange:case _t.tstzrange:return PN(t);default:return PN(t)}},PN=e=>e,_ie=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Cie=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Eie=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},Aie=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let a;const o=e.slice(1,n);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(l=>qz(t,l))}return e},Pie=e=>typeof e=="string"?e.replace(" ","T"):e,Kz=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var Hf=e=>typeof e=="function"?e:function(){return e},Tie=typeof self<"u"?self:null,pu=typeof window<"u"?window:null,vi=Tie||pu||globalThis,Oie="2.0.0",Rie=1e4,Mie=1e3,Ni={connecting:0,open:1,closing:2,closed:3},hr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},ia={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},TN={longpoll:"longpoll",websocket:"websocket"},Iie={complete:4},ON="base64url.bearer.phx.",ey=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(r=>r.status===e).forEach(r=>r.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},Gz=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},$ie=class{constructor(e,t,n){this.state=hr.closed,this.topic=e,this.params=Hf(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ey(this,ia.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Gz(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=hr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=hr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=hr.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=hr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new ey(this,ia.leave,Hf({}),this.timeout).send(),this.state=hr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(ia.reply,(r,s)=>{this.trigger(this.replyEventName(s),r)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,265 bytes, line 735
735teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=hr.closed,this.bindings=[]}onClose(e){this.on(ia.close,e)}onError(e){return this.on(ia.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(typeof t>"u"||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new ey(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=hr.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(ia.close,"leave")},n=new ey(this,ia.leave,Hf({}),e);return n.receive("ok",()=>t()).receive("timeout",()=>t()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic!==e?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=hr.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let s=this.onMessage(e,t,n,r);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let a=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,n));for(let o=0;o<a.length;o++)a[o].callback(s,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===hr.closed}isErrored(){return this.state===hr.errored}isJoined(){return this.state===hr.joined}isJoining(){return this.state===hr.joining}isLeaving(){return this.state===hr.leaving}},av=class{static request(e,t,n,r,s,a,o){if(vi.XDomainRequest){let l=new vi.XDomainRequest;return this.xdomainRequest(l,e,t,r,s,a,o)}else if(vi.XMLHttpRequest){let l=new vi.XMLHttpRequest;return this.xhrRequest(l,e,t,n,r,s,a,o)}else{if(vi.fetch&&vi.AbortController)return this.fetchRequest(e,t,n,r,s,a,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,r,s,a,o){let l={method:e,headers:n,body:r},c=null;return s&&(c=new AbortController,setTimeout(()=>c.abort(),s),l.signal=c.signal),vi.fetch(t,l).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,s,a,o){return e.timeout=s,e.open(t,n),e.onload=()=>{let l=this.parseJSON(e.responseText);o&&o(l)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,s,a,o,l){e.open(t,n,!0),e.timeout=a;for(let[c,u]of Object.entries(r))e.setRequestHeader(c,u);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===Iie.complete&&l){let c=this.parseJSON(e.responseText);l(c)}},o&&(e.ontimeout=o),e.send(s),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let s=t?`${t}[${r}]`:r,a=e[r];typeof a=="object"?n.push(this.serialize(a,s)):n.push(encodeURIComponent(s)+"="+encodeURIComponent(a))}return n.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},Lie=e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let s=0;s<r;s++)t+=String.fromCharCode(n[s]);return btoa(t)},Hc=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(ON)&&(this.authToken=atob(t[1].slice(ON.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Ni.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+TN.websocket),"$1/"+TN.longpoll)}endpointURL(){return av.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=Ni.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Ni.open||this.readyState===Ni.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:n,token:r,messages:s}=t;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:s.forEach(a=>{setTimeout(()=>this.onmessage({data:a}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Ni.open,this.onopen({}),this.poll();break;
735case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(e){typeof e!="string"&&(e=Lie(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(` 736`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let s of this.reqs)s.abort();this.readyState=Ni.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,s){let a,o=()=>{this.reqs.delete(a),r()};a=av.request(e,this.endpointURL(),t,n,this.timeout,o,l=>{this.reqs.delete(a),this.isActive()&&s(l)}),this.reqs.add(a)}},Die=class _f{constructor(t,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,s=>{let{onJoin:a,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=_f.syncState(this.state,s,a,o),this.pendingDiffs.forEach(c=>{this.state=_f.syncDiff(this.state,c,a,o)}),this.pendingDiffs=[],l()}),this.channel.on(r.diff,s=>{let{onJoin:a,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=_f.syncDiff(this.state,s,a,o),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return _f.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,r,s){let a=this.clone(t),o={},l={};return this.map(a,(c,u)=>{n[c]||(l[c]=u)}),this.map(n,(c,u)=>{let d=a[c];if(d){let h=u.metas.map(p=>p.phx_ref),f=d.metas.map(p=>p.phx_ref),m=u.metas.filter(p=>f.indexOf(p.phx_ref)<0),g=d.metas.filter(p=>h.indexOf(p.phx_ref)<0);m.length>0&&(o[c]=u,o[c].metas=m),g.length>0&&(l[c]=this.clone(d),l[c].metas=g)}else o[c]=u}),this.syncDiff(a,{joins:o,leaves:l},r,s)}static syncDiff(t,n,r,s){let{joins:a,leaves:o}=this.clone(n);return r||(r=function(){}),s||(s=function(){}),this.map(a,(l,c)=>{let u=t[l];if(t[l]=this.clone(c),u){let d=t[l].metas.map(f=>f.phx_ref),h=u.metas.filter(f=>d.indexOf(f.phx_ref)<0);t[l].metas.unshift(...h)}r(l,u,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;let d=c.metas.map(h=>h.phx_ref);u.metas=u.metas.filter(h=>d.indexOf(h.phx_ref)<0),s(l,u,c),u.metas.length===0&&delete t[l]}),t}static list(t,n){return n||(n=function(r,s){return s}),this.map(t,(r,s)=>n(r,s))}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},ty={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,s,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:s,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:s,payload:a}=e,o=this.META_LENGTH+t.length+n.length+s.length+r.length,l=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(l),u=0;c.setUint8(u++,this.KINDS.push),c.setUint8(u++,t.length),c.setUint8(u++,n.length),c.setUint8(u++,s.length),c.setUint8(u++,r.length),Array.from(t,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(n,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(s,h=>c.setUint8(u++,h.charCodeAt(0))),Array.from(r,h=>c.setUint8(u++,h.charCodeAt(0)));var d=new Uint8Array(l.byteLength+a.byteLength);return d.set(new Uint8Array(l),0),d.set(new Uint8Array(a),l.byteLength),d.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}}
vendor: 8,463 bytes, line 736
736,decodePush(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(e.slice(o,o+r));o=o+r;let c=n.decode(e.slice(o,o+s));o=o+s;let u=n.decode(e.slice(o,o+a));o=o+a;let d=e.slice(o,e.byteLength);return{join_ref:l,ref:null,topic:c,event:u,payload:d}},decodeReply(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(l,l+r));l=l+r;let u=n.decode(e.slice(l,l+s));l=l+s;let d=n.decode(e.slice(l,l+a));l=l+a;let h=n.decode(e.slice(l,l+o));l=l+o;let f=e.slice(l,e.byteLength),m={status:h,response:f};return{join_ref:c,ref:u,topic:d,event:ia.reply,payload:m}},decodeBroadcast(e,t,n){let r=t.getUint8(1),s=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a=a+r;let l=n.decode(e.slice(a,a+s));a=a+s;let c=e.slice(a,e.byteLength);return{join_ref:null,ref:null,topic:o,event:l,payload:c}}},Fie=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||Rie,this.transport=t.transport||vi.WebSocket||Hc,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||vi&&vi.sessionStorage,this.establishedConnections=0,this.defaultEncoder=ty.encode.bind(ty),this.defaultDecoder=ty.decode.bind(ty),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Hc?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;pu&&pu.addEventListener&&(pu.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),n=this.connectClock)}),pu.addEventListener("pageshow",r=>{n===this.connectClock&&(n=null,this.connect())}),pu.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=r=>t.rejoinAfterMs?t.rejoinAfterMs(r):[1e3,2e3,5e3][r-1]||1e4,this.reconnectAfterMs=r=>t.reconnectAfterMs?t.reconnectAfterMs(r):[10,50,100,150,200,250,500,1e3,2e3][r-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(r,s,a)=>{console.log(`${r}: ${s}`,a)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Hf(t.params||{}),this.endPoint=`${e}/${TN.websocket}`,this.vsn=t.vsn||Oie,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Gz(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Hc}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=av.appendParams(av.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Hf(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Hc?this.connectWithFallback(Hc,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage(s=>{s.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case Hc:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${ON}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,s,a,o=this.transportName(e),l=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([s,a]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),a=this.onError(c=>{this.log("transport","error",c),r&&!n&&(clearTimeout(this.fallbackTimer),l(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),Mie,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();const r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===Ni.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}
vendor: 4,134 bytes, line 736
736triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(ia.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Ni.connecting:return"connecting";case Ni.open:return"open";case Ni.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([n])=>e.indexOf(n)===-1)}channel(e,t={}){let n=new $ie(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:s,join_ref:a}=e;this.log("push",`${t} ${n} (${a}, ${s})`,r)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:n,event:r,payload:s,ref:a,join_ref:o}=t;if(a&&a===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",l)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${n} ${r} ${a&&"("+a+")"||""}`.trim(),s);for(let l=0;l<this.channels.length;l++){const c=this.channels[l];c.isMember(n,r,s,o)&&c.trigger(r,s,a,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}leaveOpenTopic(e){let t=this.channels.find(n=>n.topic===e&&(n.isJoined()||n.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class qf{constructor(t,n){const r=zie(n);this.presence=new Die(t.getChannel(),r),this.presence.onJoin((s,a,o)=>{const l=qf.onJoinPayload(s,a,o);t.getChannel().trigger("presence",l)}),this.presence.onLeave((s,a,o)=>{const l=qf.onLeavePayload(s,a,o);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return qf.transformState(this.presence.state)}static transformState(t){return t=Bie(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return n[r]=mx(s),n},{})}static onJoinPayload(t,n,r){const s=nR(n),a=mx(r);return{event:"join",key:t,currentPresences:s,newPresences:a}}static onLeavePayload(t,n,r){const s=nR(n),a=mx(r);return{event:"leave",key:t,currentPresences:s,leftPresences:a}}}function mx(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function Bie(e){return JSON.parse(JSON.stringify(e))}function zie(e){return(e==null?void 0:e.events)&&{events:e.events}}function nR(e){return e!=null&&e.metas?mx(e):[]}var rR;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(rR||(rR={}));class Uie{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new qf(this.channel.channelAdapter,n)}}function Vie(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
736if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const n=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${n}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class Wie{constructor(t,n,r){const s=Hie(r);this.channel=t.getSocket().channel(n,s),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,n){return this.channel.on(t,n)}off(t,n){this.channel.off(t,n)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,n,r){let s;try{s=this.channel.push(t,n,r)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>Sie){const a=this.channel.pushBuffer.shift();a.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload())}return s}updateJoinPayload(t){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),t)}canPush(){return this.socket.isConnected()&&this.state===po.joined}isJoined(){return this.state===po.joined}isJoining(){return this.state===po.joining}isClosed(){return this.state===po.closed}isLeaving(){return this.state===po.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function Hie(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var sR;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(sR||(sR={}));var Ou;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ou||(Ou={}));var aa;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(aa||(aa={}));class Kf{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,n={config:{}},r){var s,a;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new Wie(this.socket.socketAdapter,t,this.params),this.presence=new Uie(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Kz(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((a=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||a===void 0)&&a.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,n=this.timeout){var r,s,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(m=>m.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[Ou.PRESENCE]&&this.bindings[Ou.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,h={},f={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(m=>{t==null||t(aa.CHANNEL_ERROR,Vie(m))}),this._onClose(()=>t==null?void 0:t(aa.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:m})=>
736{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){t==null||t(aa.SUBSCRIBED);return}this._updatePostgresBindings(m,t)}).receive("error",m=>{this.state=po.errored;const g=Object.values(m).join(", ")||"error";t==null||t(aa.CHANNEL_ERROR,new Error(g,{cause:m}))}).receive("timeout",()=>{t==null||t(aa.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var r;const s=this.bindings.postgres_changes,a=(r=s==null?void 0:s.length)!==null&&r!==void 0?r:0,o=[];for(let l=0;l<a;l++){const c=s[l],{filter:{event:u,schema:d,table:h,filter:f}}=c,m=t&&t[l];if(m&&m.event===u&&Kf.isFilterValueEqual(m.schema,d)&&Kf.isFilterValueEqual(m.table,h)&&Kf.isFilterValueEqual(m.filter,f))o.push(Object.assign(Object.assign({},c),{id:m.id}));else{this.unsubscribe(),this.state=po.errored,n==null||n(aa.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=po.errored&&n&&n(aa.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),a=t===Ou.PRESENCE||t===Ou.POSTGRES_CHANGES;if(s&&a)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,n,r)}async httpSend(t,n,r={}){var s;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var r,s;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated
736in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:o}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u instanceof Error&&u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,l,c;const u=this.channelAdapter.push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,n,r){const s=new AbortController,a=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(a),o}_on(t,n,r){const s=t.toLocaleLowerCase(),a=this.channelAdapter.on(t,r),o={type:s,filter:n,callback:r,ref:a};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,r)=>{var s,a,o,l,c,u,d;const h=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(h,r))return!1;const f=(s=this.bindings[h])===null||s===void 0?void 0:s.find(m=>m.ref===t.ref);if(!f)return!0;if(["broadcast","presence","postgres_changes"].includes(h))if("id"in f){const m=f.id,g=(a=f.filter)===null||a===void 0?void 0:a.event;return m&&((o=n.ids)===null||o===void 0?void 0:o.includes(m))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((l=n.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const m=(u=(c=f==null?void 0:f.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return m==="*"||m===((d=n==null?void 0:n.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===h})}_notThisChannelEvent(t,n){const{close:r,error:s,leave:a,join:o}=Hz;return n&&[r,s,a,o].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,r)=>{if(typeof n=="object"&&"ids"in n){const s=n.data,{schema:a,table:o,commit_timestamp:l,type:c,errors:u}=s;return Object.assign(Object.assign({},{schema:a,table:o,commit_timestamp:l,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return n})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in t.bindings)for(const r of t.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=tR(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=tR(t.columns,t.old_record)),n}}class qie{constructor(t,n){this.socket=new Fie(t,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,n,r,s=1e4){return new Promise(a=>{setTimeout(()=>a("timeout"),s),this.socket.disconnect(()=>{t(),a("ok")},n,r)})}push(t){this.socket.push(t)}log(t,n,r){this.socket.log(t,n,r)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==AN.connecting}isDisconnecting(){return this.socket.connectionState()==AN.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const iR={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Kie=[1e3,2e3,5e3,1e4],Gie=1e4,Yie=` 737 addEventListener("message", (e) => { 738 if (e.data.event === "start") { 739 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 740 } 741 });`;class Xie{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
741,this.ref=0,this.serializer=new Nie,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=a=>a?(...o)=>a(...o):(...o)=>fetch(...o),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const s=this._initializeOptions(n);this.socketAdapter=new qie(t,s),this.httpEndpoint=Kz(t),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const n=t.message;throw n.includes("Node.js")?new Error(`${n} 742 743To use Realtime in Node.js, you need to provide a WebSocket implementation: 744 745Option 1: Use Node.js 22+ which has native WebSocket support 746Option 2: Install and provide the "ws" package: 747 748 npm install ws 749 750 import ws from "ws" 751 const client = new RealtimeClient(url, { 752 ...options, 753 transport: ws 754 })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,n)}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return n==="ok"&&t.teardown(),n}async removeAllChannels(){const t=this.channels.map(async r=>{const s=await r.unsubscribe();return r.teardown(),s}),n=await Promise.all(t);return await this.disconnect(),n}log(t,n,r){this.socketAdapter.log(t,n,r)}connectionState(){return this.socketAdapter.connectionState()||AN.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(a=>a.topic===r);if(s)return s;{const a=new Kf(`realtime:${t}`,n,this);return this._cancelPendingDisconnect(),this.channels.push(a),a}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
754this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const a={access_token:n,version:vie};n&&s.updateJoinPayload(a),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(Hz.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(n,r)=>{n=="sent"&&this._setAuthSafely(),t&&t(n,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([Yie],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(t){var n,r,s,a,o,l,c,u,d,h,f;this.worker=(n=t==null?void 0:t.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=t==null?void 0:t.accessToken)!==null&&r!==void 0?r:null;const m={};m.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:jie,m.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:iR.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((l=t==null?void 0:t.heartbeatIntervalMs)!==null&&l!==void 0?l:iR.HEARTBEAT_INTERVAL),m.transport=(c=t==null?void 0:t.transport)!==null&&c!==void 0?c:yie.getWebSocketConstructor(),m.params=t==null?void 0:t.params,m.logger=t==null?void 0:t.logger,m.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),m.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:v=>Kie[v-1]||Gie;let g,p;const x=(d=t==null?void 0:t.vsn)!==null&&d!==void 0?d:wie;switch(x){case bie:g=(v,b)=>b(JSON.stringify(v)),p=(v,b)=>b(JSON.parse(v));break;case Wz:g=this.serializer.encode.bind(this.serializer),p=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${m.vsn}`)}if(m.vsn=x,m.encode=(h=t==null?void 0:t.encode)!==null&&h!==void 0?h:g,m.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:p,m.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,m.params=Object.assign(Object.assign({},m.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,m.autoSendHeartbeat=!this.worker}return m}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
754var Fm=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function Jie(e,t,n){const r=new URL(t,e);if(n)for(const[s,a]of Object.entries(n))a!==void 0&&r.searchParams.set(s,a);return r.toString()}async function Qie(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function Zie(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:a,headers:o}){const l=Jie(e.baseUrl,r,s),c=await Qie(e.auth),u=await t(l,{method:n,headers:{...a?{"Content-Type":"application/json"}:{},...c,...o},body:a?JSON.stringify(a):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),f=h&&d?JSON.parse(d):d;if(!u.ok){const m=h?f:void 0,g=m==null?void 0:m.error;throw new Fm((g==null?void 0:g.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:g==null?void 0:g.type,icebergCode:g==null?void 0:g.code,details:m})}return{status:u.status,headers:u.headers,data:f}}}}function ny(e){return e.join("�")}var eae=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:ny(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ny(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ny(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ny(e.namespace)}`}),!0}catch(t){if(t instanceof Fm&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Fm&&n.status===409)return;throw n}}};function qc(e){return e.join("�")}var tae=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${qc(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${qc(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${qc(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${qc(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${qc(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${qc(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Fm&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Fm&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},nae=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=Zie({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new eae(this.client,t),this.tableOps=new tae(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
754async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function Bm(e){"@babel/helpers - typeof";return Bm=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},Bm(e)}function rae(e,t){if(Bm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Bm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sae(e){var t=rae(e,"string");return Bm(t)=="symbol"?t:t+""}function iae(e,t,n){return(t=sae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aR(Object(n),!0).forEach(function(r){iae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var o0=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function l0(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var RN=class extends o0{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return Ae({},super.toJSON())}},Yz=class extends o0{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function ov(e,t,n){const r=Ae({},e),s=t.toLowerCase();for(const a of Object.keys(r))a.toLowerCase()===s&&delete r[a];return r[s]=n,r}function aae(e){const t={};for(const[n,r]of Object.entries(e))t[n.toLowerCase()]=r;return t}const oae=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),lae=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},MN=e=>{if(Array.isArray(e))return e.map(n=>MN(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[s]=MN(r)}),t},cae=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),oR=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const n=t.error;if(typeof n.message=="string")return n.message}}return JSON.stringify(e)},uae=async(e,t,n,r)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const s=e;let a=parseInt(String(s.status),10);Number.isFinite(a)||(a=500),s.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";t(new RN(oR(o),a,l,r))}).catch(()=>{const o=a+"";t(new RN(s.statusText||`HTTP ${a} error`,a,o,r))})}else t(new Yz(oR(e),e,r))},dae=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!r)return Ae(Ae({},s),n);if(lae(r)){var a;const o=(t==null?void 0:t.headers)||{};let l;for(const[c,u]of Object.entries(o))c.toLowerCase()==="content-type"&&(l=u);s.headers=ov(o,"Content-Type",(a=l)!==null&&a!==void 0?a:"application/json"),s.body=JSON.stringify(r)}else s.body=r;return t!=null&&t.duplex&&(s.duplex=t.duplex),Ae(Ae({},s),n)};async function tf(e,t,n,r,s,a,o){return new Promise((l,c)=>{e(n,dae(t,r,s,a)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>uae(u,c,r,o))})}function Xz(e="storage"){return{get:async(t,n,r,s)=>tf(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,a)=>tf(t,"POST",n,s,a,r,e),put:async(t,n,r,s,a)=>tf(t,"PUT",n,s,a,r,e),head:async(t,n,r,s)=>tf(t,"HEAD",n,Ae(Ae({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,a)=>tf(t,"DELETE",n,s,a,r,e)}}const hae=Xz("storage"),{get:zm,post:Ds,put:IN,head:fae,remove:YE}=hae,zr=Xz("vectors");var bh=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=aae(t),this.fetch=oae(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=ov(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(l0(n))return{data:null,error:n};throw n}}},mae=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(l0(t))return{data:null,error:t};throw t}}};let Jz;Jz=Symbol.toStringTag;var pae=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Jz]="BlobDownloadBuilder",this.promise=null}asStream(){return new mae(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(l0(t))return{data:null,error:t};throw t}}};const gae={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},lR={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var yae=class extends bh{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let a;const o=Ae(Ae({},lR),r);let l=Ae(Ae({},s.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;if(typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",s.encodeMetadata(c)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),c&&!a.has("metadata")&&a.append("metadata",s.encodeMetadata(c))):(a=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=s.toBase64(s.encodeMetadata(c))),(typeof ReadableStream<"u"&&a
754instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers)for(const[f,m]of Object.entries(r.headers))l=ov(l,f,m);const u=s._removeEmptyFolders(t),d=s._getFinalPath(u),h=await(e=="PUT"?IN:Ds)(s.fetch,`${s.url}/object/${d}`,a,Ae({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const a=s._removeEmptyFolders(e),o=s._getFinalPath(a),l=new URL(s.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",t),s.handleOperation(async()=>{let c;const u=Ae(Ae({},lR),r);let d=Ae(Ae({},s.headers),{"x-upsert":String(u.upsert)});const h=u.metadata;if(typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),h&&c.append("metadata",s.encodeMetadata(h)),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.has("cacheControl")||c.append("cacheControl",u.cacheControl),h&&!c.has("metadata")&&c.append("metadata",s.encodeMetadata(h))):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType,h&&(d["x-metadata"]=s.toBase64(s.encodeMetadata(h))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!u.duplex&&(u.duplex="half")),r!=null&&r.headers)for(const[f,m]of Object.entries(r.headers))d=ov(d,f,m);return{path:a,fullPath:(await IN(s.fetch,l.toString(),c,Ae({headers:d},u!=null&&u.duplex?{duplex:u.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=Ae({},n.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const a=await Ds(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+a.url),l=o.searchParams.get("token");if(!l)throw new o0("No token returned by API");return{signedUrl:o.toString(),path:e,token:l}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Ds(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
754stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Ds(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e);const a=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let o=await Ds(r.fetch,`${r.url}/object/sign/${s}`,Ae({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers});const l=new URLSearchParams;n!=null&&n.download&&l.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&l.set("cacheNonce",String(n.cacheNonce));const c=l.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await Ds(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n!=null&&n.download&&a.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&a.set("cacheNonce",String(n.cacheNonce));const o=a.toString();return s.map(l=>Ae(Ae({},l),{},{signedUrl:l.signedURL?encodeURI(`${r.url}${l.signedURL}${o?`&${o}`:""}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const a=s.toString(),o=this._getFinalPath(e),l=()=>zm(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new pae(l,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>MN(await zm(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await fae(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(l0(s)){var r;const a=s instanceof RN?s.status:s instanceof Yz?(r=s.originalError)===null||r===void 0?void 0:r.status:void 0;if(a!==void 0&&[400,404].includes(a))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=new URLSearchParams;t!=null&&t.download&&r.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(r,t.transform),(t==null?void 0:t.cacheNonce)!=null&&r.set("cacheNonce",String(t.cacheNonce));const s=r.toString(),a=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await YE(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=Ae(Ae(Ae({},gae),t),{},{prefix:e||""});return await Ds(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=Ae({},e);return await Ds(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const xae="2.105.3",ng={"X-Client-Info":`storage-js/${xae}`};var vae=class extends bh{constructor(e,t={},n,r){const s=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const a=s.href.replace(/\/$/,""),o=Ae(Ae({},ng),t);super(a,o,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await zm(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await zm(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Ds(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await IN(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Ds(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await YE(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},bae=class extends bh{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Ae(Ae({},ng),t);super(r,s,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ds(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await zm(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await YE(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!cae(e))throw new o0("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new nae({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}
754),r=this.shouldThrowOnError;return new Proxy(n,{get(s,a){const o=s[a];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(s,l),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},wae=class extends bh{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Ae(Ae({},ng),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await zr.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await zr.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},jae=class extends bh{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Ae(Ae({},ng),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},Sae=class extends bh{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=Ae(Ae({},ng),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await zr.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},Nae=class extends Sae{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new kae(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},kae=class extends wae{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,Ae(Ae({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,Ae(Ae({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new _ae(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}
754,_ae=class extends jae{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,Ae(Ae({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,Ae(Ae({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,Ae(Ae({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,Ae(Ae({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,Ae(Ae({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},Cae=class extends vae{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new yae(this.url,this.headers,e,this.fetch)}get vectors(){return new Nae(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new bae(this.url+"/iceberg",this.headers,this.fetch)}};const Qz="2.105.3",gu=30*1e3,$N=3,xj=$N*gu,Eae="http://localhost:9999",Aae="supabase.auth.token",Pae={"X-Client-Info":`gotrue-js/${Qz}`},LN="X-Supabase-Api-Version",Zz={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Tae=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Oae=10*60*1e3;class Um extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function xe(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class Rae extends Um{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function Mae(e){return xe(e)&&e.name==="AuthApiError"}class qs extends Um{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Wa extends Um{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class bn extends Wa{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function ry(e){return xe(e)&&e.name==="AuthSessionMissingError"}class Kc extends Wa{constructor(){super("Auth session or user missing","AuthInvalidToken
754ResponseError",500,void 0)}}class sy extends Wa{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class iy extends Wa{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Iae(e){return xe(e)&&e.name==="AuthImplicitGrantRedirectError"}class cR extends Wa{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class $ae extends Wa{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class DN extends Wa{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function vj(e){return xe(e)&&e.name==="AuthRetryableFetchError"}class uR extends Wa{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class FN extends Wa{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const lv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),dR=`
755\r=`.split(""),Lae=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<dR.length;t+=1)e[dR[t].charCodeAt(0)]=-2;for(let t=0;t<lv.length;t+=1)e[lv[t].charCodeAt(0)]=t;return e})();function hR(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(lv[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(lv[r]),t.queuedBits-=6}}function e8(e,t,n){const r=Lae[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function fR(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},a=o=>{Bae(o,r,n)};for(let o=0;o<e.length;o+=1)e8(e.charCodeAt(o),s,a);return t.join("")}function Dae(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Fae(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}Dae(r,t)}}function Bae(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Xu(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)e8(e.charCodeAt(s),n,r);return new Uint8Array(t)}function zae(e){const t=[];return Fae(e,n=>t.push(n)),new Uint8Array(t)}function Wl(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>hR(s,n,r)),hR(null,n,r),t.join("")}function Uae(e){return Math.round(Date.now()/1e3)+e}function Vae(){return Symbol("auth-callback")}const Rn=()=>typeof window<"u"&&typeof document<"u",El={tested:!1,writable:!1},t8=()=>{if(!Rn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(El.tested)return El.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),El.tested=!0,El.writable=!0}catch{El.tested=!0,El.writable=!1}return El.writable};function Wae(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,a)=>{t[a]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const n8=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Hae=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",yu=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Al=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},On=async(e,t)=>{await e.removeItem(t)};class c0{constructor(){this.promise=new c0.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}c0.promiseConstructor=Promise;function ay(e){const t=e.split(".");if(t.length!==3)throw new FN("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!Tae.test(t[r]))throw new FN("JWT not in base64url format");return{header:JSON.parse(fR(t[0])),payload:JSON.parse(fR(t[1])),signature:Xu(t[2]),raw:{header:t[0],payload:t[1]}}}async function qae(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function Kae(e,t){return new Promise((r,s)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await e(a);if(!t(a,null,o)){r(o);return}}catch(o){if(!t(a,o)){s(o);return}}})()})}function Gae(e){return("0"+e.toString(16)).substr(-2)}function Yae(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let a=0;a<56;a++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,Gae).join("")}async function Xae(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",
755n),s=new Uint8Array(r);return Array.from(s).map(a=>String.fromCharCode(a)).join("")}async function Jae(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await Xae(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Gc(e,t,n=!1){const r=Yae();let s=r;n&&(s+="/recovery"),await yu(e,`${t}-code-verifier`,s);const a=await Jae(r);return[a,r===a?"plain":"s256"]}const Qae=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Zae(e){const t=e.headers.get(LN);if(!t||!t.match(Qae))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function eoe(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function toe(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const noe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ta(e){if(!noe.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Is(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function bj(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function roe(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const a=r.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,s)}})}function mR(e){return JSON.parse(JSON.stringify(e))}const Ml=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},soe=[502,503,504,520,521,522,523,524,530];async function pR(e){var t;if(!Hae(e))throw new DN(Ml(e),0);if(soe.includes(e.status))throw new DN(Ml(e),e.status);let n;try{n=await e.json()}catch(a){throw new qs(Ml(a),a)}let r;const s=Zae(e);if(s&&s.getTime()>=Zz["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new uR(Ml(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new bn}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((a,o)=>
755a&&typeof o=="string",!0))throw new uR(Ml(n),e.status,n.weak_password.reasons);throw new Rae(Ml(n),e.status||500,r)}const ioe=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function Ne(e,t,n,r){var s;const a=Object.assign({},r==null?void 0:r.headers);a[LN]||(a[LN]=Zz["2024-01-01"].name),r!=null&&r.jwt&&(a.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await aoe(e,t,n+l,{headers:a,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function aoe(e,t,n,r,s,a){const o=ioe(t,r,s,a);let l;try{l=await e(n,Object.assign({},o))}catch(c){throw console.error(c),new DN(Ml(c),0)}if(l.ok||await pR(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await pR(c)}}function os(e){var t;let n=null;coe(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=Uae(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function gR(e){const t=os(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function go(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function ooe(e){return{data:e,error:null}}function loe(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:a}=e,o=a0(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:a},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function yR(e){return e}function coe(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const wj=["global","local","others"];class uoe{constructor({url:t="",headers:n={},fetch:r,experimental:s}){this.url=t,this.headers=n,this.fetch=n8(r),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,n=wj[0]){if(wj.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${wj.join(", ")}`);try{return await Ne(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(xe(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Ne(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:go})}catch(r){if(xe(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=a0(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await Ne(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:loe,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(xe(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Ne(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:go})}catch(n){if(xe(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Ne(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:yR});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(g.split(";")[1].split("=")[1]);u[`${x}Page`]=p}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(xe(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){ta(t);try{return await Ne(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:go})}catch(n){if(xe(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){ta(t);try{return await Ne(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:go})}catch(r){if(xe(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){ta(t);
755try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:go})}catch(r){if(xe(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){ta(t.userId);try{const{data:n,error:r}=await Ne(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _deleteFactor(t){ta(t.userId),ta(t.id);try{return{data:await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Ne(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(a=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""},xform:yR});if(d.error)throw d.error;const h=await d.json(),f=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,m=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return m.length>0&&(m.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(g.split(";")[1].split("=")[1]);u[`${x}Page`]=p}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(xe(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await Ne(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await Ne(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await Ne(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(xe(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await Ne(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await Ne(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var s;return{data:{providers:(s=r==null?void 0:r.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(n){if(xe(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await Ne(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await Ne(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await Ne(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(xe(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _adminListPasskeys(t){Is(this.experimental),ta(t.userId);try{return await Ne(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(xe(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(t){Is(this.experimental),ta(t.userId),ta(t.passkeyId);
755try{return await Ne(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(xe(n))return{data:null,error:n};throw n}}}function xR(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const mi={debug:!!(globalThis&&t8()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class r8 extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class vR extends r8{}async function doe(e,t,n){mi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;let s;t>0&&(s=setTimeout(()=>{r.abort(),mi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async a=>{if(a){clearTimeout(s),mi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{mi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw mi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new vR(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(mi.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(s),await n()}})}catch(a){if(t>0&&clearTimeout(s),a!==null&&typeof a=="object"&&"name"in a&&a.name==="AbortError"&&t>0){if(r.signal.aborted)return mi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async o=>{if(o){mi.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await n()}finally{mi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw mi.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new vR(`Lock "${e}" was released because another request stole it`)}throw a}}function hoe(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function s8(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function foe(e){return parseInt(e,16)}function moe(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function poe(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:a=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:h,version:f}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 756`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const m=s8(e.address),g=d?`${d}://${r}`:r,p=e.statement?`${e.statement} 757`:"",x=`${g} wants you to sign in with your Ethereum account: 758${m} 759 760${p}`;let v=`URI: ${h} 761Version: ${f} 762Chain ID: ${n}${o?` 763Nonce: ${o}`:""} 764Issued At: ${a.toISOString()}`;if(s&&(v+=` 765Expiration Time: ${s.toISOString()}`),l&&(v+=` 766Not Before: ${l.toISOString()}
766`),c&&(v+=` 767Request ID: ${c}`),u){let b=` 768Resources:`;for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);b+=` 769- ${w}`}v+=b}return`${x} 770${v}`}class cn extends Error{constructor({message:t,code:n,cause:r,name:s}){var a;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(a=s??(r instanceof Error?r.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=n}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class cv extends cn{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function goe({error:e,options:t}){var n,r,s;const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new cn({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=a.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new cn({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=a.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new cn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=a.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new cn({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new cn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new cn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new cn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new cn({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(i8(o)){if(a.rp.id!==o)return new cn({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new cn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new cn({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new cn({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new cn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function yoe({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new cn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new cn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(i8(r)){if(n.rpId!==r)return new cn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new cn({message:`${window.location.hostname}
770 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new cn({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new cn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class xoe{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const BN=new xoe;function bR(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=a0(e,["challenge","user","excludeCredentials"]),a=Xu(t).buffer,o=Object.assign(Object.assign({},n),{id:Xu(n.id).buffer}),l=Object.assign(Object.assign({},s),{challenge:a,user:o});if(r&&r.length>0){l.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Xu(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function wR(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=a0(e,["challenge","allowCredentials"]),s=Xu(t).buffer,a=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){a.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const l=n[o];a.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Xu(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function jR(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:Wl(new Uint8Array(e.response.attestationObject)),clientDataJSON:Wl(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function SR(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Wl(new Uint8Array(s.authenticatorData)),clientDataJSON:Wl(new Uint8Array(s.clientDataJSON)),signature:Wl(new Uint8Array(s.signature)),userHandle:s.userHandle?Wl(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function i8(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function uv(){var e,t;return!!(Rn()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function a8(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new cv("Browser returned unexpected credential type",t)}:{data:null,error:new cv("Empty credential response",t)}}catch(t){return{data:null,error:goe({error:t,options:e})}}}async function o8(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new cv("Browser returned unexpected credential type",t)}:{data:null,error:new cv("Empty credential response",t)}}
770catch(t){return{data:null,error:yoe({error:t,options:e})}}}const voe={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},boe={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function dv(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const a in s){const o=s[a];if(o!==void 0)if(Array.isArray(o))r[a]=o;else if(n(o))r[a]=o;else if(t(o)){const l=r[a];t(l)?r[a]=dv(l,o):r[a]=dv(o)}else r[a]=o}return r}function woe(e,t){return dv(voe,e,t||{})}function joe(e,t){return dv(boe,e,t||{})}class Soe{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:s},a){var o;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!l)return{data:null,error:c};const u=s??BN.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:d}=l.webauthn.credential_options.publicKey;if(!d.name){const h=r;if(h)d.name=`${d.id}:${h}`;else{const m=(await this.client.getUser()).data.user,g=((o=m==null?void 0:m.user_metadata)===null||o===void 0?void 0:o.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";d.name=`${d.id}:${g}`}}d.displayName||(d.displayName=d.name)}switch(l.webauthn.type){case"create":{const d=woe(l.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:h,error:f}=await a8({publicKey:d,signal:u});return h?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:h}},error:null}:{data:null,error:f}}case"request":{const d=joe(l.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:h,error:f}=await o8(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:d,signal:u}));return h?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:h}},error:null}:{data:null,error:f}}}}catch(l){return xe(l)?{data:null,error:l}:{data:null,error:new qs("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!n)return{data:null,error:new Um("rpId is required for WebAuthn authentication")};try{if(!uv())return{data:null,error:new qs("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:a});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(o){return xe(o)?{data:null,error:o}:{data:null,error:new qs("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},a){if(!n)return{data:null,error:new Um("rpId is required for WebAuthn registration")};try{if(!uv())return{data:null,error:new qs("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:a});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return xe(o)?{data:null,error:o}:{data:null,error:new qs("Unexpected error in register",o)}}}}hoe();const Noe={url:Eae,storageKey:Aae,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Pae,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function NR(e,t,n){return await n()}const Yc={};class Vm{get jwks(){var t,n;return(n=(t=Yc[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Yc[this.storageKey]=Object.assign(Object.assign({},Yc[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Yc[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Yc[this.storageKey]=Object.assign(Object.assign({},Yc[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},Noe),t);if(this.storageKey=o.storageKey,this.instanceID=(n=Vm.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Vm.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&Rn()){const l=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(l),this.logDebugMessages&&console.trace(l)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(r=o.experimental)!==null&&r!==void 0?r:{},this.admin=new uoe({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=n8(o.fetch),this.lock=o.lock||NR,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&Rn()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=doe:this.lock=NR,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Soe(this)}
770,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:t8()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=xR(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=xR(this.memoryStorage)),Rn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(l){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",l)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async l=>{this._debug("received broadcast notification from other tab or client",l);try{await this._notifyAllSubscribers(l.data.event,l.data.session,!1)}catch(c){this._debug("#broadcastChannel","error",c)}})}o.skipAutoInitialize||this.initialize().catch(l=>{this._debug("#initialize()","error",l)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Qz}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";if(Rn()&&(n=Wae(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Rn()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:a}=await this._getSessionFromURL(n,r);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),Iae(a)){const c=(t=a.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:o,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return xe(n)?this._returnResult({error:n}):this._returnResult({error:new qs("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const a=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:os}),{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(xe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var n,r,s;try{let a;if("email"in t){const{email:d,password:h,options:f}=t;let m=null,g=null;this.flowType==="pkce"&&([m,g]=await Gc(this.storage,this.storageKey)),a=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:d,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:m,code_challenge_method:g},xform:os})}else if("phone"in t){const{phone:d,password:h,options:f}=t;a=await Ne(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},channel:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:os})}else throw new sy("You must provide either an email or phone number and a password");const{data:o,error:l}=a;if(l||!o)return await On(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(await On(this.storage,`${this.storageKey}-code-verifier`),xe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let n;if("email"in t){const{email:a,password:o,options:l}=t;n=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:gR})}else if("phone"in t){const{phone:a,password:o,options:l}=t;n=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:gR})}else throw new sy("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const a=new Kc;return this._returnResult({data:{user:null,session:null},error:a})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(xe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(a=t.o
770ptions)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,s,a,o,l,c,u,d,h,f;let m,g;if("message"in t)m=t.message,g=t.signature;else{const{chain:p,wallet:x,statement:v,options:b}=t;let w;if(Rn())if(typeof x=="object")w=x;else{const C=window;if("ethereum"in C&&typeof C.ethereum=="object"&&"request"in C.ethereum&&typeof C.ethereum.request=="function")w=C.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=x}const j=new URL((n=b==null?void 0:b.url)!==null&&n!==void 0?n:window.location.href),S=await w.request({method:"eth_requestAccounts"}).then(C=>C).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!S||S.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const N=s8(S[0]);let k=(r=b==null?void 0:b.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!k){const C=await w.request({method:"eth_chainId"});k=foe(C)}const _={domain:j.host,address:N,statement:v,uri:j.href,version:"1",chainId:k,nonce:(s=b==null?void 0:b.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=b==null?void 0:b.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=b==null?void 0:b.signInWithEthereum)===null||d===void 0?void 0:d.resources};m=poe(_),g=await w.request({method:"personal_sign",params:[moe(m),N]})}try{const{data:p,error:x}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:g},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:os});if(x)throw x;if(!p||!p.session||!p.user){const v=new Kc;return this._returnResult({data:{user:null,session:null},error:v})}return p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),this._returnResult({data:Object.assign({},p),error:x})}catch(p){if(xe(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}}async signInWithSolana(t){var n,r,s,a,o,l,c,u,d,h,f,m;let g,p;if("message"in t)g=t.message,p=t.signature;else{const{chain:x,wallet:v,statement:b,options:w}=t;let j;if(Rn())if(typeof v=="object")j=v;else{const N=window;if("solana"in N&&typeof N.solana=="object"&&("signIn"in N.solana&&typeof N.solana.signIn=="function"||"signMessage"in N.solana&&typeof N.solana.signMessage=="function"))j=N.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=v}const S=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in j&&j.signIn){const N=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),b?{statement:b}:null));let k;if(Array.isArray(N)&&N[0]&&typeof N[0]=="object")k=N[0];else if(N&&typeof N=="object"&&"signedMessage"in N&&"signature"in N)k=N;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in k&&"signature"in k&&(typeof k.signedMessage=="string"||k.signedMessage instanceof Uint8Array)&&k.signature instanceof Uint8Array)g=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),p=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${S.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(s=(r=w==null?void 0:w.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((h=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...w.sign
770InWithSolana.resources.map(k=>`- ${k}`)]:[]].join(` 771`);const N=await j.signMessage(new TextEncoder().encode(g),"utf8");if(!N||!(N instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");p=N}}try{const{data:x,error:v}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:Wl(p)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:os});if(v)throw v;if(!x||!x.session||!x.user){const b=new Kc;return this._returnResult({data:{user:null,session:null},error:b})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:v})}catch(x){if(xe(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(t){const n=await Al(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new $ae;const{data:a,error:o}=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:os});if(await On(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const l=new Kc;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:s??null}),error:o})}catch(a){if(await On(this.storage,`${this.storageKey}-code-verifier`),xe(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:a,nonce:o}=t,l=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:os}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Kc;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(xe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,a,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Gc(this.storage,this.storageKey));const{error:h}=await Ne(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await Ne(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=c==null?void 0:c.data)!==null&&s!==void 0?s:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new sy("You must provide either an email or phone number.")}catch(l){if(await On(this.storage,`${this.storageKey}-code-verifier`),xe(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,r;try{let s,a;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,a=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:l}=await Ne(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:s,xform:os});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(xe(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,a,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Gc(this.storage,this.storageKey));const u=await Ne(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:ooe});return!((a=u.data)===null||a===void 0)&&a.url&&Rn()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await On(this.storage,`${this.storageKey}-code-verifier`),xe(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new bn;const{error:s}=await Ne(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(xe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:s,options:a}=t,{error:o}=await Ne(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:r,type:s,options:a}=t,{data:o,error:l}=await Ne(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new sy("You must provide either an email or phone number and a type")}catch(n){if(xe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await Al(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
771id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<xj:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await Al(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=bj()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=roe(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await Ne(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:go}):await this._useSession(async n=>{var r,s,a;const{data:o,error:l}=n;if(l)throw l;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new bn}:await Ne(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&a!==void 0?a:void 0,xform:go})})}catch(n){if(xe(n))return ry(n)&&(await this._removeSession(),await On(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:s,error:a}=r;if(a)throw a;if(!s.session)throw new bn;const o=s.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Gc(this.storage,this.storageKey));const{data:u,error:d}=await Ne(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:go});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await On(this.storage,`${this.storageKey}-code-verifier`),xe(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new bn;const n=Date.now()/1e3;let r=n,s=!0,a=null;const{payload:o}=ay(t.access_token);if(o.exp&&(r=o.exp,s=r<=n),s){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};a=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});a={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(n){if(xe(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:l}=n;if(l)throw l;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new bn;const{data:s,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(xe(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){var r;try{if(!Rn())throw new iy("No browser detected.");
771if(t.error||t.error_description||t.error_code)throw new iy(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new cR("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new iy("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new cR("No code detected.");const{data:w,error:j}=await this._exchangeCodeForSession(t.code);if(j)throw j;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:w.session,redirectType:(r=w.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:s,provider_refresh_token:a,access_token:o,refresh_token:l,expires_in:c,expires_at:u,token_type:d}=t;if(!o||!c||!l||!d)throw new iy("No session defined in URL");const h=Math.round(Date.now()/1e3),f=parseInt(c);let m=h+f;u&&(m=parseInt(u));const g=m-h;g*1e3<=gu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${f}s`);const p=m-f;h-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,m,h):h-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",p,m,h);const{data:x,error:v}=await this._getUser(o);if(v)throw v;const b={provider_token:s,provider_refresh_token:a,access_token:o,expires_in:f,expires_at:m,refresh_token:l,token_type:d,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:b,redirectType:t.type},error:null})}catch(s){if(xe(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await Al(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:a}=n;if(a&&!ry(a))return this._returnResult({error:a});const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(Mae(l)&&(l.status===404||l.status===401||l.status===403)||ry(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await On(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=Vae(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,s;try{const{data:{session:a},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),ry(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Gc(this.storage,this.storageKey,!0));try{return await Ne(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(a){if(await On(this.storage,`${this.storageKey}-code-verifier`),xe(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:s}=await this._useSession(async a=>{var o,l,c,u,d;const{data:h,error:f}=a;if(f)throw f;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Ne(this.fetch,"GET",m,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return Rn()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(xe(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:a}}=n;if(s)throw s;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,h=await Ne(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=a==null?void 0:a.access_token)!==null&&r!==void 0?r:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:os}),{data:f,error:m}=h;return m?this._returnResult({data:{user:null,session:null},error:m}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new Kc}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:m}))}catch(s){if(await On(this.storage,`${this.storageKey}-code-verifier`),xe(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:a,error:o}=n;
771if(o)throw o;return await Ne(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await Kae(async s=>(s>0&&await qae(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await Ne(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:os})),(s,a)=>{const o=200*Math.pow(2,s);return a&&vj(a)&&Date.now()+o-r<gu})}catch(r){if(this._debug(n,"error",r),xe(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),Rn()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await Al(this.storage,this.storageKey);if(s&&this.userStorage){let o=await Al(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await yu(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:bj()}else if(s&&!s.user&&!s.user){const o=await Al(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await On(this.storage,this.storageKey+"-user"),await yu(this.storage,this.storageKey,s)):s.user=bj()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const a=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<xj;if(this._debug(r,`session has${a?"":" not"} expired with margin of ${xj}s`),a){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),vj(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(s.access_token);!l&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new bn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new c0;const{data:a,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!a.session)throw new bn;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const l={data:a.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(a){if(this._debug(s,"error",a),xe(a)){const o={data:null,error:a};return vj(a)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(a),a}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){a.push(c)}});if(await Promise.all(o),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await On(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await yu(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const a=mR(s);await yu(this.storage,this.storageKey,a)}else{const s=mR(n);await yu(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await On(this.storage,this.storageKey),await On(this.storage,this.storageKey+"-code-verifier"),await On(this.storage,this.storageKey+"-user"),this.userStorage&&await On(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Rn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
771catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),gu);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-t)/gu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${gu}ms, refresh threshold is ${$N} ticks`),s<=$N&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof r8)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Rn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[a,o]=await Gc(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(l.toString())}if(r!=null&&r.queryParams){const a=new URLSearchParams(r.queryParams);s.push(a.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:a}=n;return a?this._returnResult({data:null,error:a}):await Ne(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:a,error:o}=n;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await Ne(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((s=c==null?void 0:c.totp)===null||s===void 0)&&s.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:a}=n;
771if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?jR(t.webauthn.credential_response):SR(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await Ne(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=await Ne(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:bR(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:wR(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])s.all.push(a),a.status==="verified"&&s[a.factor_type].push(a);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,s,a;if(t)try{const{payload:m}=ay(t);let g=null;m.aal&&(g=m.aal);let p=g;const{data:{user:x},error:v}=await this.getUser(t);if(v)return this._returnResult({data:null,error:v});((r=(n=x==null?void 0:x.factors)===null||n===void 0?void 0:n.filter(j=>j.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(p="aal2");const w=m.amr||[];return{data:{currentLevel:g,nextLevel:p,currentAuthenticationMethods:w},error:null}}catch(m){if(xe(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:o},error:l}
771=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=ay(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((a=(s=o.user.factors)===null||s===void 0?void 0:s.filter(m=>m.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(d="aal2");const f=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await Ne(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new bn})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new bn});const o=await Ne(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Rn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(xe(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new bn});const o=await Ne(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Rn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(xe(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Ne(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new bn})})}catch(t){if(xe(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await Ne(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new bn})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(l=>l.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+Oae>s)return r;const{data:a,error:o}=await Ne(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=s,r=a.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:m,error:g}
771=await this.getSession();if(g||!m.session)return this._returnResult({data:null,error:g});r=m.session.access_token}const{header:s,payload:a,signature:o,raw:{header:l,payload:c}}=ay(r);n!=null&&n.allowExpired||eoe(a.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:a,header:s,signature:o},error:null}}const d=toe(s.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,o,zae(`${l}.${c}`)))throw new FN("Invalid JWT signature");return{data:{claims:a,header:s,signature:o},error:null}}catch(r){if(xe(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(t){var n,r,s;Is(this.experimental);try{if(!uv())return this._returnResult({data:null,error:new qs("Browser does not support WebAuthn",null)});const{data:a,error:o}=await this._startPasskeyAuthentication({options:{captchaToken:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}});if(o||!a)return this._returnResult({data:null,error:o});const l=wR(a.options),c=(s=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&s!==void 0?s:BN.createNewAbortSignal(),{data:u,error:d}=await o8({publicKey:l,signal:c});if(d||!u)return this._returnResult({data:null,error:d??new qs("WebAuthn ceremony failed",null)});const h=SR(u);return this._verifyPasskeyAuthentication({challengeId:a.challenge_id,credential:h})}catch(a){if(xe(a))return this._returnResult({data:null,error:a});throw a}}async registerPasskey(t){var n,r;Is(this.experimental);try{if(!uv())return this._returnResult({data:null,error:new qs("Browser does not support WebAuthn",null)});const{data:s,error:a}=await this._startPasskeyRegistration();if(a||!s)return this._returnResult({data:null,error:a});const o=bR(s.options),l=(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&r!==void 0?r:BN.createNewAbortSignal(),{data:c,error:u}=await a8({publicKey:o,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new qs("WebAuthn ceremony failed",null)});const d=jR(c);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:d})}catch(s){if(xe(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){Is(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new bn});const{data:s,error:a}=await Ne(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:n.access_token,body:{}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:s,error:null})})}catch(t){if(xe(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){Is(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new bn});const{data:a,error:o}=await Ne(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:a,error:null})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(t){var n;Is(this.experimental);try{const{data:r,error:s}=await Ne(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:r,error:null})}catch(r){if(xe(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(t){Is(this.experimental);try{const{data:n,error:r}=await Ne(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:os});return r?this._returnResult({data:null,error:r}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){Is(this.experimental);try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new bn});const{data:s,error:a}=await Ne(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})});return a?this._returnResult({data:null,error:a}):this._returnResult({data:s,error:null})})}catch(t){if(xe(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){Is(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new bn});const{data:a,error:o}=await Ne(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:t.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:a,error:null})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(t){Is(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;if(s)return this._returnResult({data:null,error:s});if(!r)return this._returnResult({data:null,error:new bn});const{error:a}
771=await Ne(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return a?this._returnResult({data:null,error:a}):this._returnResult({data:null,error:null})})}catch(n){if(xe(n))return this._returnResult({data:null,error:n});throw n}}}Vm.nextInstanceID={};const koe=Vm,_oe="2.105.3";let Cf="";typeof Deno<"u"?Cf="deno":typeof document<"u"?Cf="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Cf="react-native":Cf="node";const Coe={"X-Client-Info":`supabase-js-${Cf}/${_oe}`},Eoe={headers:Coe},Aoe={schema:"public"},Poe={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Toe={};function Wm(e){"@babel/helpers - typeof";return Wm=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},Wm(e)}function Ooe(e,t){if(Wm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Roe(e){var t=Ooe(e,"string");return Wm(t)=="symbol"?t:t+""}function Moe(e,t,n){return(t=Roe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){Moe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const Ioe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),$oe=()=>Headers,Loe=(e,t,n)=>{const r=Ioe(n),s=$oe();return async(a,o)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(a,Qt(Qt({},o),{},{headers:u}))}};function Doe(e){return e.endsWith("/")?e:e+"/"}function Foe(e,t){var n,r;const{db:s,auth:a,realtime:o,global:l}=e,{db:c,auth:u,realtime:d,global:h}=t,f={db:Qt(Qt({},c),s),auth:Qt(Qt({},u),a),realtime:Qt(Qt({},d),o),storage:{},global:Qt(Qt(Qt({},h),l),{},{headers:Qt(Qt({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=l==null?void 0:l.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function Boe(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Doe(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var zoe=class extends koe{constructor(e){super(e)}},Uoe=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const a=Boe(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l={db:Aoe,realtime:Toe,auth:Qt(Qt({},Poe),{},{storageKey:o}),global:Eoe},c=Foe(n??{},l);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=c.global.headers)!==null&&s!==void 0?s:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=Loe(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Qt({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new gie(new URL("rest/v1",a).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new Cae(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new aie(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}
771channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:a,flowType:o,lock:l,debug:c,throwOnError:u,experimental:d,lockAcquireTimeout:h,skipAutoInitialize:f},m,g){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new zoe({url:this.authUrl.href,headers:Qt(Qt({},p),m),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:l,debug:c,throwOnError:u,experimental:d,fetch:g,lockAcquireTimeout:h,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(x=>x.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new Xie(this.realtimeUrl.href,Qt(Qt({},e),{},{params:Qt(Qt({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Voe=(e,t,n)=>new Uoe(e,t,n);function Woe(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}Woe()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Hoe="https://mrmmozypopayflmybqvx.supabase.co",qoe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1ybW1venlwb3BheWZsbXlicXZ4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI5NzYxNDgsImV4cCI6MjA4ODU1MjE0OH0.GrsUdY1-jwVy4gGt10hILm6qPJgZ6B592MqqLpLPrD0",q=Voe(Hoe,qoe,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),l8="https://flockify.lovable.app",Koe=`${l8}/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png`;function u0({title:e,description:t,path:n,image:r=Koe,type:s="website",jsonLd:a}){const o=`${l8}${n}`,l=a?Array.isArray(a)?a:[a]:[];return i.jsxs(RQ,{children:[i.jsx("title",{children:e}),i.jsx("meta",{name:"description",content:t}),i.jsx("link",{rel:"canonical",href:o}),i.jsx("meta",{property:"og:title",content:e}),i.jsx("meta",{property:"og:description",content:t}),i.jsx("meta",{property:"og:url",content:o}),i.jsx("meta",{property:"og:type",content:s}),i.jsx("meta",{property:"og:image",content:r}),i.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),i.jsx("meta",{name:"twitter:title",content:e}),i.jsx("meta",{name:"twitter:description",content:t}),i.jsx("meta",{name:"twitter:image",content:r}),l.map((c,u)=>i.jsx("script",{type:"application/ld+json",children:JSON.stringify(c)},u))]})}const XE=y.createContext({});function nl(e){const t=y.useRef(null);return t.current===null&&(t.current=e()),t.current}const Goe=typeof window<"u",d0=Goe?y.useLayoutEffect:y.useEffect,h0=y.createContext(null);function JE(e,t){e.indexOf(t)===-1&&e.push(t)}function Id(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ai=(e,t,n)=>n>t?t:n<e?e:n;let f0=()=>{},zi=()=>{};const rl={},c8=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function u8(e){return typeof e=="object"&&e!==null}const d8=e=>/^0[^.\s]+$/u.test(e);function h8(e){let t;return()=>(t===void 0&&(t=e()),t)}const Sr=e=>e,Yoe=(e,t)=>n=>t(e(n)),rg=(...e)=>e.reduce(Yoe),_c=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class QE{constructor(){this.subscriptions=[]}add(t){return JE(this.subscriptions,t),()=>Id(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let a=0;a<s;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const lr=e=>e*1e3,xs=e=>e/1e3;function ZE(e,t){return t?e*(1e3/t):0}const Xoe=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e}
vendor: 8,650 bytes, line 771
771,f8=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Joe=1e-7,Qoe=12;function Zoe(e,t,n,r,s){let a,o,l=0;do o=t+(n-t)/2,a=f8(o,r,s)-e,a>0?n=o:t=o;while(Math.abs(a)>Joe&&++l<Qoe);return o}function sg(e,t,n,r){if(e===t&&n===r)return Sr;const s=a=>Zoe(a,0,1,e,n);return a=>a===0||a===1?a:f8(s(a),t,r)}const m8=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,p8=e=>t=>1-e(1-t),g8=sg(.33,1.53,.69,.99),e2=p8(g8),y8=m8(e2),x8=e=>e>=1?1:(e*=2)<1?.5*e2(e):.5*(2-Math.pow(2,-10*(e-1))),t2=e=>1-Math.sin(Math.acos(e)),v8=p8(t2),b8=m8(t2),ele=sg(.42,0,1,1),tle=sg(0,0,.58,1),w8=sg(.42,0,.58,1),j8=e=>Array.isArray(e)&&typeof e[0]!="number";function S8(e,t){return j8(e)?e[Xoe(0,e.length,t)]:e}const N8=e=>Array.isArray(e)&&typeof e[0]=="number",_R={linear:Sr,easeIn:ele,easeInOut:w8,easeOut:tle,circIn:t2,circInOut:b8,circOut:v8,backIn:e2,backInOut:y8,backOut:g8,anticipate:x8},nle=e=>typeof e=="string",CR=e=>{if(N8(e)){zi(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,s]=e;return sg(t,n,r,s)}else if(nle(e))return zi(_R[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),_R[e];return e},oy=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],ER={value:null,addProjectionMetrics:null};function rle(e,t){let n=new Set,r=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(h){o.has(h)&&(d.schedule(h),e()),c++,h(l)}const d={schedule:(h,f=!1,m=!1)=>{const p=m&&s?n:r;return f&&o.add(h),p.add(h),h},cancel:h=>{r.delete(h),o.delete(h)},process:h=>{if(l=h,s){a=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(u),t&&ER.value&&ER.value.frameloop[t].push(c),c=0,n.clear(),s=!1,a&&(a=!1,d.process(h))}};return d}const sle=40;function k8(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=oy.reduce((w,j)=>(w[j]=rle(a,t?j:void 0),w),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:h,preRender:f,render:m,postRender:g}=o,p=()=>{const w=rl.useManualTiming,j=w?s.timestamp:performance.now();n=!1,w||(s.delta=r?1e3/60:Math.max(Math.min(j-s.timestamp,sle),1)),s.timestamp=j,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),h.process(s),f.process(s),m.process(s),g.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(p))},x=()=>{n=!0,r=!0,s.isProcessing||e(p)};return{schedule:oy.reduce((w,j)=>{const S=o[j];return w[j]=(N,k=!1,_=!1)=>(n||x(),S.schedule(N,k,_)),w},{}),cancel:w=>{for(let j=0;j<oy.length;j++)o[oy[j]].cancel(w)},state:s,steps:o}}const{schedule:nt,cancel:Cs,state:jn,steps:jj}=k8(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sr,!0);let px;function ile(){px=void 0}const sr={now:()=>(px===void 0&&sr.set(jn.isProcessing||rl.useManualTiming?jn.timestamp:performance.now()),px),set:e=>{px=e,queueMicrotask(ile)}},_8=e=>t=>typeof t=="string"&&t.startsWith(e),C8=_8("--"),ale=_8("var(--"),n2=e=>ale(e)?ole.test(e.split("/*")[0].trim()):!1,ole=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function AR(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const wh={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hm={...wh,transform:e=>ai(0,1,e)},ly={...wh,default:1},Gf=e=>Math.round(e*1e5)/1e5,r2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function lle(e){return e==null}const cle=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,s2=(e,t)=>n=>!!(typeof n=="string"&&cle.test(n)&&n.startsWith(e)||t&&!lle(n)&&Object.prototype.hasOwnProperty.call(n,t)),E8=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(r2);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},ule=e=>ai(0,255,e),Sj={...wh,transform:e=>Math.round(ule(e))},Hl={test:s2("rgb","red"),parse:E8("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Sj.transform(e)+", "+Sj.transform(t)+", "+Sj.transform(n)+", "+Gf(Hm.transform(r))+")"};function dle(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const zN={test:s2("#"),parse:dle,transform:Hl.transform},ig=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ro=ig("deg"),Ii=ig("%"),Se=ig("px"),hle=ig("vh"),fle=ig("vw"),PR={...Ii,parse:e=>Ii.parse(e)/100,transform:e=>Ii.transform(e*100)},Ru={test:s2("hsl","hue"),parse:E8("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ii.transform(Gf(t))+", "+Ii.transform(Gf(n))+", "+Gf(Hm.transform(r))+")"},un={test:e=>Hl.test(e)||zN.test(e)||Ru.test(e),parse:e=>Hl.test(e)?Hl.parse(e):Ru.test(e)?Ru.parse(e):zN.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hl.transform(e):Ru.transform(e),getAnimatableNone:e=>{const t=un.parse(e);return t.alpha=0,un.transform(t)}},mle=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ple(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(r2))==null?void 0:t.length)||0)+(((n=e.match(mle))==null?void 0:n.length)||0)>0}const A8="number",P8="color",gle="var",yle="var(",TR="${}",xle=/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 $d(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=t.replace(xle,c=>(un.test(c)?(r.color.push(a),s.push(P8),n.push(un.parse(c))):c.startsWith(yle)?(r.var.push(a),s.push(gle),n.push(c)):(r.number.push(a),s.push(A8),n.push(parseFloat(c))),++a,TR)).split(TR);return{values:n,split:l,indexes:r,types:s}}function vle(e){return $d(e).values}function T8({split:e,types:t}){const n=e.length;return r=>{let s="";for(let a=0;a<n;a++)if(s+=e[a],r[a]!==void 0){const o=t[a];o===A8?s+=Gf(r[a]):o===P8?s+=un.transform(r[a]):s+=r[a]}return s}}function ble(e){return T8($d(e))}const wle=e=>typeof e=="number"?0:un.test(e)?un.getAnimatableNone(e):e,jle=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:wle(e);function Sle(e){const t=$d(e);return T8(t)(t.values.map((r,s)=>jle(r,t.split[s])))}const ei={test:ple,parse:vle,createTransformer:ble,getAnimatableNone:Sle};function Nj(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 Nle({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,a=0,o=0;if(!t)s=a=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;s=Nj(c,l,e+1/3),a=Nj(c,l,e),o=Nj(c,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function hv(e,t){return n=>n>0?t:e}const Pt=(e,t,n)=>e+(t-e)*n,kj=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},kle=[zN,Hl,Ru],_le=e=>kle.find(t=>t.test(e));function OR(e){const t=_le(e);if(f0(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===Ru&&(n=Nle(n)),n}const RR=(e,t)=>{const n=OR(e),r=OR(t);if(!n||!r)return hv(e,t);const s={...n};return a=>(s.red=kj(n.red,r.red,a),s.green=kj(n.green,r.green,a),s.blue=kj(n.blue,r.blue,a),s.alpha=Pt(n.alpha,r.alpha,a),Hl.transform(s))},UN=new Set(["none","hidden"]);function Cle(e,t){return UN.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Ele(e,t){return n=>Pt(e,t,n)}function i2(e){return typeof e=="number"?Ele:typeof e=="string"?n2(e)?hv:un.test(e)?RR:Tle:Array.isArray(e)?O8:typeof e=="object"?un.test(e)?RR:Ale:hv}function O8(e,t){const n=[...e],r=n.length,s=e.map((a,o)=>i2(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=s[o](a);return n}}function Ale(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=i2(e[s])(e[s],t[s]));return s=>{for(const a in r)n[a]=r[a](s);return n}}function Ple(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],o=e.indexes[a][r[a]],l=e.values[o]??0;n[s]=l,r[a]++}return n}const Tle=(e,t)=>{const n=ei.createTransformer(t),r=$d(e),s=$d(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?UN.has(e)&&!s.values.length||UN.has(t)&&!r.values.length?Cle(e,t):rg(O8(Ple(r,s),s.values),n):(f0(!0,`Complex values '${e}' and '${t}
771' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),hv(e,t))};function R8(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Pt(e,t,n):i2(e)(e,t)}const Ole=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>nt.update(t,n),stop:()=>Cs(t),now:()=>jn.isProcessing?jn.timestamp:sr.now()}},M8=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)r+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},fv=2e4;function a2(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<fv;)t+=n,r=e.next(t);return t>=fv?1/0:t}function I8(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(a2(r),fv);return{type:"keyframes",ease:a=>r.next(s*a).value/t,duration:xs(s)}}const Ht={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};function VN(e,t){return e*Math.sqrt(1-t*t)}const Rle=12;function Mle(e,t,n){let r=n;for(let s=1;s<Rle;s++)r=r-e(r)/t(r);return r}const _j=.001;function Ile({duration:e=Ht.duration,bounce:t=Ht.bounce,velocity:n=Ht.velocity,mass:r=Ht.mass}){let s,a;f0(e<=lr(Ht.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=ai(Ht.minDamping,Ht.maxDamping,o),e=ai(Ht.minDuration,Ht.maxDuration,xs(e)),o<1?(s=u=>{const d=u*o,h=d*e,f=d-n,m=VN(u,o),g=Math.exp(-h);return _j-f/m*g},a=u=>{const h=u*o*e,f=h*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,g=Math.exp(-h),p=VN(Math.pow(u,2),o);return(-s(u)+_j>0?-1:1)*((f-m)*g)/p}):(s=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-_j+d*h},a=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const l=5/e,c=Mle(s,a,l);if(e=lr(e),isNaN(c))return{stiffness:Ht.stiffness,damping:Ht.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const $le=["duration","bounce"],Lle=["stiffness","damping","mass"];function MR(e,t){return t.some(n=>e[n]!==void 0)}function Dle(e){let t={velocity:Ht.velocity,stiffness:Ht.stiffness,damping:Ht.damping,mass:Ht.mass,isResolvedFromDuration:!1,...e};if(!MR(e,Lle)&&MR(e,$le))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,a=2*ai(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ht.mass,stiffness:s,damping:a}}else{const n=Ile({...e,velocity:0});t={...t,...n,mass:Ht.mass},t.isResolvedFromDuration=!0}return t}function qm(e=Ht.visualDuration,t=Ht.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:m}=Dle({...n,velocity:-xs(n.velocity||0)}),g=f||0,p=u/(2*Math.sqrt(c*d)),x=o-a,v=xs(Math.sqrt(c/d)),b=Math.abs(x)<5;r||(r=b?Ht.restSpeed.granular:Ht.restSpeed.default),s||(s=b?Ht.restDelta.granular:Ht.restDelta.default);let w,j,S,N,k,_;if(p<1)S=VN(v,p),N=(g+p*v*x)/S,w=A=>{const E=Math.exp(-p*v*A);return o-E*(N*Math.sin(S*A)+x*Math.cos(S*A))},k=p*v*N+x*S,_=p*v*x-N*S,j=A=>Math.exp(-p*v*A)*(k*Math.sin(S*A)+_*Math.cos(S*A));else if(p===1){w=E=>o-Math.exp(-v*E)*(x+(g+v*x)*E);const A=g+v*x;j=E=>Math.exp(-v*E)*(v*A*E-g)}else{const A=v*Math.sqrt(p*p-1);w=R=>{const L=Math.exp(-p*v*R),D=Math.min(A*R,300);return o-L*((g+p*v*x)*Math.sinh(D)+A*x*Math.cosh(D))/A};const E=(g+p*v*x)/A,P=p*v*E-x*A,$=p*v*x-E*A;j=R=>{const L=Math.exp(-p*v*R),D=Math.min(A*R,300);return L*(P*Math.sinh(D)+$*Math.cosh(D))}}const C={calculatedDuration:m&&h||null,velocity:A=>lr(j(A)),next:A=>{if(!m&&p<1){const P=Math.exp(-p*v*A),$=Math.sin(S*A),R=Math.cos(S*A),L=o-P*(N*$+x*R),D=lr(P*(k*$+_*R));return l.done=Math.abs(D)<=r&&Math.abs(o-L)<=s,l.value=l.done?o:L,l}const E=w(A);if(m)l.done=A>=h;else{const P=lr(j(A));l.done=Math.abs(P)<=r&&Math.abs(o-E)<=s}return l.value=l.done?o:E,l},toString:()=>{const A=Math.min(a2(C),fv),E=M8(P=>C.next(A*P).value,A,30);return A+"ms "+E},toTransition:()=>{}};return C}qm.applyToOptions=e=>{const t=I8(e,100,qm);return e.ease=t.ease,e.duration=lr(t.duration),e.type="keyframes",e};const Fle=5;function $8(e,t,n){const r=Math.max(t-Fle,0);return ZE(n-e(r),t-r)}function WN({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=
vendor: 5,310 bytes, line 771
771500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const h=e[0],f={done:!1,value:h},m=_=>l!==void 0&&_<l||c!==void 0&&_>c,g=_=>l===void 0?c:c===void 0||Math.abs(l-_)<Math.abs(c-_)?l:c;let p=n*t;const x=h+p,v=o===void 0?x:o(x);v!==x&&(p=v-h);const b=_=>-p*Math.exp(-_/r),w=_=>v+b(_),j=_=>{const C=b(_),A=w(_);f.done=Math.abs(C)<=u,f.value=f.done?v:A};let S,N;const k=_=>{m(f.value)&&(S=_,N=qm({keyframes:[f.value,g(f.value)],velocity:$8(w,_,f.value),damping:s,stiffness:a,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:_=>{let C=!1;return!N&&S===void 0&&(C=!0,j(_),k(_)),S!==void 0&&_>=S?N.next(_-S):(!C&&j(_),f)}}}function Ble(e,t,n){const r=[],s=n||rl.mix||R8,a=e.length-1;for(let o=0;o<a;o++){let l=s(e[o],e[o+1]);if(t){const c=Array.isArray(t)?t[o]||Sr:t;l=rg(c,l)}r.push(l)}return r}function o2(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const a=e.length;if(zi(a===t.length,"Both input and output ranges must be the same length","range-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 l=Ble(t,r,s),c=l.length,u=d=>{if(o&&d<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const f=_c(e[h],e[h+1],d);return l[h](f)};return n?d=>u(ai(e[0],e[a-1],d)):u}function L8(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=_c(0,t,r);e.push(Pt(n,1,s))}}function l2(e){const t=[0];return L8(t,e.length-1),t}function zle(e,t){return e.map(n=>n*t)}function Ule(e,t){return e.map(()=>t||w8).splice(0,e.length-1)}function Yf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=j8(r)?r.map(CR):CR(r),a={done:!1,value:t[0]},o=zle(n&&n.length===t.length?n:l2(t),e),l=o2(o,t,{ease:Array.isArray(s)?s:Ule(t,s)});return{calculatedDuration:e,next:c=>(a.value=l(c),a.done=c>=e,a)}}const Vle=e=>e!==null;function m0(e,{repeat:t,repeatType:n="loop"},r,s=1){const a=e.filter(Vle),l=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const Wle={decay:WN,inertia:WN,tween:Yf,keyframes:Yf,spring:qm};function D8(e){typeof e.type=="string"&&(e.type=Wle[e.type])}class c2{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Hle=e=>e/100;class Km extends c2{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==sr.now()&&this.tick(sr.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;D8(t);const{type:n=Yf,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=t;let{keyframes:l}=t;const c=n||Yf;c!==Yf&&typeof l[0]!="number"&&(this.mixKeyframes=rg(Hle,R8(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=a2(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:f,repeatDelay:m,type:g,onUpdate:p,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?v<0:v>s;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let w=this.currentTime,j=r;if(h){const _=Math.min(this.currentTime,s)/l;let C=Math.floor(_),A=_%1;!A&&_>=1&&(A=1),A===1&&C--,C=Math.min(C,h+1),!!(C%2)&&(f==="reverse"?(A=1-A,m&&(A-=m/l)):f==="mirror"&&(j=o)),w=ai(0,1,A)*l}let S;b?(this.delayState.value=d[0],S=this.delayState):S=j.next(w),a&&!b&&(S.value=a(S.value));let{done:N}=S;!b&&c!==null&&(N=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return k&&g!==WN&&(S.value=m0(d,this.options,x,this.speed)),p&&p(S.value),k&&this.finish(),S}then(t,n){return this.finished.then(t,n)}get duration(){return xs(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+xs(t)}get time(){return xs(this.currentTime)}set time(t){t=lr(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;
771if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return $8(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(sr.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=xs(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:t=Ole,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(sr.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function qle(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ql=e=>e*180/Math.PI,HN=e=>
vendor: 8,980 bytes, line 771
771{const t=ql(Math.atan2(e[1],e[0]));return qN(t)},Kle={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:HN,rotateZ:HN,skewX:e=>ql(Math.atan(e[1])),skewY:e=>ql(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},qN=e=>(e=e%360,e<0&&(e+=360),e),IR=HN,$R=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),LR=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Gle={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$R,scaleY:LR,scale:e=>($R(e)+LR(e))/2,rotateX:e=>qN(ql(Math.atan2(e[6],e[5]))),rotateY:e=>qN(ql(Math.atan2(-e[2],e[0]))),rotateZ:IR,rotate:IR,skewX:e=>ql(Math.atan(e[4])),skewY:e=>ql(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function KN(e){return e.includes("scale")?1:0}function GN(e,t){if(!e||e==="none")return KN(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=Gle,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Kle,s=l}if(!s)return KN(t);const a=r[t],o=s[1].split(",").map(Xle);return typeof a=="function"?a(o):o[a]}const Yle=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return GN(n,t)};function Xle(e){return parseFloat(e.trim())}const jh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Sh=new Set(jh),DR=e=>e===wh||e===Se,Jle=new Set(["x","y","z"]),Qle=jh.filter(e=>!Jle.has(e));function Zle(e){const t=[];return Qle.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Mo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-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:(e,{transform:t})=>GN(t,"x"),y:(e,{transform:t})=>GN(t,"y")};Mo.translateX=Mo.x;Mo.translateY=Mo.y;const uc=new Set;let YN=!1,XN=!1,JN=!1;function F8(){if(XN){const e=Array.from(uc).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Zle(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}XN=!1,YN=!1,uc.forEach(e=>e.complete(JN)),uc.clear()}function B8(){uc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(XN=!0)})}function ece(){JN=!0,B8(),F8(),JN=!1}class u2{constructor(t,n,r,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(uc.add(this),YN||(YN=!0,nt.read(B8),nt.resolveKeyframes(F8))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const a=s==null?void 0:s.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const l=r.readValue(n,o);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=o),s&&a===void 0&&s.set(t[0])}qle(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),uc.delete(this)}cancel(){this.state==="scheduled"&&(uc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const tce=e=>e.startsWith("--");function z8(e,t,n){tce(t)?e.style.setProperty(t,n):e.style[t]=n}const nce={};function d2(e,t){const n=h8(e);return()=>nce[t]??n()}const h2=d2(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),U8=d2(()=>window.ViewTimeline!==void 0,"viewTimeline"),V8=d2(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ef=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,FR={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ef([0,.65,.55,1]),circOut:Ef([.55,0,1,.45]),backIn:Ef([.31,.01,.66,-.59]),backOut:Ef([.33,1.53,.69,.99])};function W8(e,t){if(e)return typeof e=="function"?V8()?M8(e,t):"ease-out":N8(e)?Ef(e):Array.isArray(e)?e.map(n=>W8(n,t)||FR.easeOut):FR[e]}function rce(e,t,n,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const h=W8(l,s);Array.isArray(h)&&(d.easing=h);const f={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(d,f)}function f2(e){return typeof e=="function"&&"applyToOptions"in e}function sce({type:e,...t}){return f2(e)&&V8()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class H8 extends c2{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,zi(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=sce(t);this.animation=rce(n,r,s,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const d=m0(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(d),z8(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return xs(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+xs(t)}get time(){return xs(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=lr(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&h2()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Sr):s(this)}}const q8={anticipate:x8,backInOut:y8,circInOut:b8};function ice(e){return e in q8}function ace(e){typeof e.ease=="string"&&ice(e.ease)&&(e.ease=q8[e.ease])}const Cj=10;class oce extends H8{constructor(t){ace(t),D8(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new Km({...o,autoplay:!1}),c=Math.max(Cj,sr.now()-this.startTime),u=ai(0,Cj,c-Cj),d=l.sample(c).value,{name:h}=this.options;a&&h&&z8(a,h,d),n.setWithVelocity(l.sample(Math.max(0,c-u)).value,d,u),l.stop()}}const BR=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ei.test(e)||e==="0")&&!e.startsWith("url("));function lce(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 cce(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=BR(s,t),l=BR(a,t);return f0(o===l,`You are trying to animate ${t} from "${s}" to "${a}". "${o?a:s}" is not an animatable value.`,"value-not-animatable"),!o||!l?!1:lce(e)||(n==="spring"||f2(n))&&r}function QN(e){e.duration=0,e.type="keyframes"}const K8=new Set(["opacity","clipPath","filter","transform"]),uce=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function dce(e){for(let t=0;t<e.length;
771t++)if(typeof e[t]=="string"&&uce.test(e[t]))return!0;return!1}const hce=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),fce=h8(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function mce(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:a,type:o,keyframes:l}=e;if(!(((h=t==null?void 0:t.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=t.owner.getProps();return fce()&&n&&(K8.has(n)||hce.has(n)&&dce(l))&&(n!=="transform"||!d)&&!u&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const pce=40;class gce extends c2{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...h}){var g;super(),this.stop=()=>{var p,x;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=sr.now();const f={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:u,element:d,...h},m=(d==null?void 0:d.KeyframeResolver)||u2;this.keyframeResolver=new m(l,(p,x,v)=>this.onKeyframesResolved(p,x,f,!v),c,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,s){var v,b;this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=sr.now();let h=!0;cce(t,a,o,l)||(h=!1,(rl.instantAnimations||!c)&&(d==null||d(m0(t,r,n))),t[0]=t[t.length-1],QN(r),r.repeat=0);const m={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>pce?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},g=h&&!u&&mce(m),p=(b=(v=m.motionValue)==null?void 0:v.owner)==null?void 0:b.current;let x;if(g)try{x=new oce({...m,element:p})}catch{x=new Km(m)}else x=new Km(m);x.finished.then(()=>{this.notifyFinished()}).catch(Sr),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),ece()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}class yce{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}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){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].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 state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return zR(this.animations,"duration")}get iterationDuration(){return zR(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function zR(e,t){let n=0;for(let r=0;r<e.length;r++){const s=e[r][t];s!==null&&s>n&&(n=s)}return n}class xce extends yce{then(t,n){return this.finished.finally(t).then(()=>{})}}function G8(e,t,n,r=0,s=1){const a=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),o=e.size,l=(o-1)*r;return typeof n=="function"?n(a,o):s===1?a*r:l-a*r}const vce=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bce(e){const t=vce.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const wce=4;function Y8(e,t,n=1){zi(n<=wce,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,s]=bce(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return c8(o)?parseFloat(o):o}return n2(s)?Y8(s,t,n+1):s}const jce={type:"spring",stiffness:500,damping:25,restSpeed:10},Sce=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nce={type:"keyframes",duration:.8},kce={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_ce=(e,{keyframes:t})=>t.length>2?Nce:Sh.has(e)?e.startsWith("scale")?Sce(t[1]):jce:kce;function X8(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function m2(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?X8(n,e):n}const Cce=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Ece(e){for(const t in e)if(!Cce.has(t))return!0;return!1}const p2=(e,t,n,r={},s,a)=>o=>{const l=m2(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-lr(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:f=>{t.set(f),l.onUpdate&&l.onUpdate(f)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:a?void 0:s};Ece(l)||Object.assign(d,_ce(e,d)),d.duration&&(d.duration=lr(d.duration)),d.repeatDelay&&(d.repeatDelay=lr(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(QN(d),d.delay===0&&(h=!0)),(rl.instantAnimations||rl.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(h=!0,QN(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,h&&!a&&t.get()!==void 0){const f=m0(d.keyframes,l);if(f!==void 0){nt.update(()=>{d.onUpdate(f),d.onComplete()});return}}return l.isSync?new Km(d):new gce(d)};function UR(e){const t=[{},{}];
vendor: 11,941 bytes, line 771
771return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function g2(e,t,n,r){if(typeof t=="function"){const[s,a]=UR(r);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=UR(r);t=t(n!==void 0?n:e.custom,s,a)}return t}function dc(e,t,n){const r=e.getProps();return g2(r,t,n!==void 0?n:r.custom,e)}const J8=new Set(["width","height","top","left","right","bottom",...jh]),VR=30,Ace=e=>!isNaN(parseFloat(e)),Xf={current:void 0};class Pce{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=sr.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Ace(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 QE);const r=this.events[t].add(n);return t==="change"?()=>{r(),nt.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){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}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()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Xf.current&&Xf.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=sr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>VR)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,VR);return ZE(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(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function vs(e,t){return new Pce(e,t)}const ZN=e=>Array.isArray(e);function Tce(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,vs(n))}function Oce(e){return ZN(e)?e[e.length-1]||0:e}function Rce(e,t){const n=dc(e,t);let{transitionEnd:r={},transition:s={},...a}=n||{};a={...a,...r};for(const o in a){const l=Oce(a[o]);Tce(e,o,l)}}const nn=e=>!!(e&&e.getVelocity);function Mce(e){return!!(nn(e)&&e.add)}function ek(e,t){const n=e.getValue("willChange");if(Mce(n))return n.add(t);if(!n&&rl.WillChange){const r=new rl.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function y2(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ice="framerAppearId",Q8="data-"+y2(Ice);function Z8(e){return e.props[Q8]}function $ce({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function x2(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:a,transitionEnd:o,...l}=t;const c=e.getDefaultTransition();a=a?X8(a,c):c;const u=a==null?void 0:a.reduceMotion;r&&(a=r);const d=[],h=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const m=e.getValue(f,e.latestValues[f]??null),g=l[f];if(g===void 0||h&&$ce(h,f))continue;const p={delay:n,...m2(a||{},f)},x=m.get();if(x!==void 0&&!m.isAnimating()&&!Array.isArray(g)&&g===x&&!p.velocity){nt.update(()=>m.set(g));continue}let v=!1;if(window.MotionHandoffAnimation){const j=Z8(e);if(j){const S=window.MotionHandoffAnimation(j,f,nt);S!==null&&(p.startTime=S,v=!0)}}ek(e,f);const b=u??e.shouldReduceMotion;m.start(p2(f,m,g,b&&J8.has(f)?{type:!1}:p,e,v));const w=m.animation;w&&d.push(w)}if(o){const f=()=>nt.update(()=>{o&&Rce(e,o)});d.length?Promise.all(d).then(f):f()}return d}function tk(e,t,n={}){var c;const r=dc(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const a=r?()=>Promise.all(x2(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:f}=s;return Lce(e,t,u,d,h,f,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[a,o]:[o,a];return u().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function Lce(e,t,n=0,r=0,s=0,a=1,o){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(tk(c,t,{...o,delay:n+(typeof r=="function"?0:r)+G8(e.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function Dce(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(a=>tk(e,a,n));r=Promise.all(s)}else if(typeof t=="string")r=tk(e,t,n);else{const s=typeof t=="function"?dc(e,t,n.custom):t;r=Promise.all(x2(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Fce={test:e=>e==="auto",parse:e=>e},eU=e=>t=>t.test(e),tU=[wh,Se,Ii,ro,fle,hle,Fce],WR=e=>tU.find(eU(e));function Bce(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||d8(e):!0}const zce=new Set(["brightness","contrast","saturate","opacity"]);function Uce(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(r2)||[];if(!r)return e;const s=n.replace(r,"");let a=zce.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+s+")"}const Vce=/\b([a-z-]*)\(.*?\)/gu,nk={...ei,getAnimatableNone:e=>{const t=e.match(Vce);return t?t.map(Uce).join(" "):e}},rk={...ei,getAnimatableNone:e=>{const t=ei.parse(e);return ei.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},HR={...wh,transform:Math.round},Wce={rotate:ro,rotateX:ro,rotateY:ro,rotateZ:ro,scale:ly,scaleX:ly,scaleY:ly,scaleZ:ly,skew:ro,skewX:ro,skewY:ro,distance:Se,translateX:Se,translateY:Se,translateZ:Se,x:Se,y:Se,z:Se,perspective:Se,transformPerspective:Se,opacity:Hm,originX:PR,originY:PR,originZ:Se},v2={borderWidth:Se,borderTopWidth:Se,borderRightWidth:Se,borderBottomWidth:Se,borderLeftWidth:Se,borderRadius:Se,borderTopLeftRadius:Se,borderTopRightRadius:Se,borderBottomRightRadius:Se,borderBottomLeftRadius:Se,width:Se,maxWidth:Se,height:Se,maxHeight:Se,top:Se,right:Se,bottom:Se,left:Se,inset:Se,insetBlock:Se,insetBlockStart:Se,insetBlockEnd:Se,insetInline:Se,insetInlineStart:Se,insetInlineEnd:Se,padding:Se,paddingTop:Se,paddingRight:Se,paddingBottom:Se,paddingLeft:Se,paddingBlock:Se,paddingBlockStart:Se,paddingBlockEnd:Se,paddingInline:Se,paddingInlineStart:Se,paddingInlineEnd:Se,margin:Se,marginTop:Se,marginRight:Se,marginBottom:Se,marginLeft:Se,marginBlock:Se,marginBlockStart:Se,marginBlockEnd:Se,marginInline:Se,marginInlineStart:Se,marginInlineEnd:Se,fontSize:Se,backgroundPositionX:Se,backgroundPositionY:Se,...Wce,zIndex:HR,fillOpacity:Hm,strokeOpacity:Hm,numOctaves:HR},Hce={...v2,color:un,backgroundColor:un,outlineColor:un,fill:un,stroke:un,borderColor:un,borderTopColor:un,borderRightColor:un,borderBottomColor:un,borderLeftColor:un,filter:nk,WebkitFilter:nk,mask:rk,WebkitMask:rk},nU=e=>Hce[e],qce=new Set([nk,rk]);function rU(e,t){let n=nU(e);return qce.has(n)||(n=ei),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Kce=new Set(["auto","none","0"]);function Gce(e,t,n){let r=0,s;for(;r<e.length&&!s;){const a=e[r];typeof a=="string"&&!Kce.has(a)&&$d(a).values.length&&(s=e[r]),r++}if(s&&n)for(const a of t)e[a]=rU(n,s)}class Yce extends u2{constructor(t,n,r,s,a){super(t,n,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let h=t[d];if(typeof h=="string"&&(h=h.trim(),n2(h))){const f=Y8(h,n.current);f!==void 0&&(t[d]=f),d===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!J8.has(r)||t.length!==2)return;const[s,a]=t,o=WR(s),l=WR(a),c=AR(s),u=AR(a);if(c!==u&&Mo[r]){this.needsMeasurement=!0;return}if(o!==l)if(DR(o)&&DR(l))for(let d=0;d<t.length;d++){const h=t[d];typeof h=="string"&&(t[d]=parseFloat(h))}else Mo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||Bce(t[s]))&&r.push(s);r.length&&Gce(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=Mo[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=Mo[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function p0(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const sU=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Jf(e){return u8(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:b2,cancel:j7e}=k8(queueMicrotask,!1),$s={x:!1,y:!1};function iU(){return $s.x||$s.y}function Xce(e){return e==="x"||e==="y"?$s[e]?null:($s[e]=!0,()=>{$s[e]=!1}):$s.x||$s.y?null:($s.x=$s.y=!0,()=>{$s.x=$s.y=!1})}function aU(e,t){const n=p0(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Jce(e){return!(e.pointerType==="touch"||iU())}function Qce(e,t,n={}){const[r,s,a]=aU(e,n);return r.forEach(o=>{let l=!1,c=!1,u;const d=()=>{o.removeEventListener("pointerleave",g)},h=x=>{u&&(u(x),u=void 0),d()},f=x=>{l=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,h(x))},m=()=>{l=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},g=x=>{if(x.pointerType!=="touch"){if(l){c=!0;return}h(x)}},p=x=>{if(!Jce(x))return;c=!1;const v=t(o,x);typeof v=="function"&&(u=v,o.addEventListener("pointerleave",g,s))};o.addEventListener("pointerenter",p,s),o.addEventListener("pointerdown",m,s)}),a}const oU=(e,t)=>t?e===t?!0:oU(e,t.parentElement):!1,w2=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Zce=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function eue(e){return Zce.has(e.tagName)||e.isContentEditable===!0}const tue=new Set(["INPUT","SELECT","TEXTAREA"]);function nue(e){return tue.has(e.tagName)||e.isContentEditable===!0}const gx=new WeakSet;function qR(e){return t=>{t.key==="Enter"&&e(t)}}function Ej(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const rue=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=qR(()=>
771{if(gx.has(n))return;Ej(n,"down");const s=qR(()=>{Ej(n,"up")}),a=()=>Ej(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function KR(e){return w2(e)&&!iU()}const GR=new WeakSet;function sue(e,t,n={}){const[r,s,a]=aU(e,n),o=l=>{const c=l.currentTarget;if(!KR(l)||GR.has(l))return;gx.add(c),n.stopPropagation&&GR.add(l);const u=t(c,l),d=(m,g)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),gx.has(c)&&gx.delete(c),KR(m)&&typeof u=="function"&&u(m,{success:g})},h=m=>{d(m,c===window||c===document||n.useGlobalTarget||oU(c,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",f,s)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),Jf(l)&&(l.addEventListener("focus",u=>rue(u,s)),!eue(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function g0(e){return u8(e)&&"ownerSVGElement"in e}const yx=new WeakMap;let so;const lU=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:g0(r)&&"getBBox"in r?r.getBBox()[t]:r[n],iue=lU("inline","width","offsetWidth"),aue=lU("block","height","offsetHeight");function oue({target:e,borderBoxSize:t}){var n;(n=yx.get(e))==null||n.forEach(r=>{r(e,{get width(){return iue(e,t)},get height(){return aue(e,t)}})})}function lue(e){e.forEach(oue)}function cue(){typeof ResizeObserver>"u"||(so=new ResizeObserver(lue))}function uue(e,t){so||cue();const n=p0(e);return n.forEach(r=>{let s=yx.get(r);s||(s=new Set,yx.set(r,s)),s.add(t),so==null||so.observe(r)}),()=>{n.forEach(r=>{const s=yx.get(r);s==null||s.delete(t),s!=null&&s.size||so==null||so.unobserve(r)})}}const xx=new Set;let Mu;function due(){Mu=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};xx.forEach(t=>t(e))},window.addEventListener("resize",Mu)}function hue(e){return xx.add(e),Mu||due(),()=>{xx.delete(e),!xx.size&&typeof Mu=="function"&&(window.removeEventListener("resize",Mu),Mu=void 0)}}function sk(e,t){return typeof e=="function"?hue(e):uue(e,t)}function cU(e,t){let n;const r=()=>{const{currentTime:s}=t,o=(s===null?0:s.value)/100;n!==o&&e(o),n=o};return nt.preUpdate(r,!0),()=>Cs(r)}function uU(e){return g0(e)&&e.tagName==="svg"}function fue(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],a=e[2+n],o=e[3+n],l=o2(s,a,o);return t?l(r):l}function mue(e,t,n={}){const r=e.get();let s=null,a=r,o;const l=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,c=()=>{s&&(s.stop(),s=null),e.animation=void 0},u=()=>{const h=YR(e.get()),f=YR(a);if(h===f){c();return}const m=s?s.getGeneratorVelocity():e.getVelocity();c(),s=new Km({keyframes:[h,f],velocity:m,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},d=()=>{var h;u(),e.animation=s??void 0,(h=e.events.animationStart)==null||h.notify(),s==null||s.then(()=>{var f;e.animation=void 0,(f=e.events.animationComplete)==null||f.notify()})};if(e.attach((h,f)=>{a=h,o=m=>f(Aj(m,l)),nt.postRender(d)},c),nn(t)){let h=n.skipInitialAnimation===!0;const f=t.on("change",g=>{h?(h=!1,e.jump(Aj(g,l),!1)):e.set(Aj(g,l))}),m=e.on("destroy",f);return()=>{f(),m()}}return c}function Aj(e,t){return t?e+t:e}function YR(e){return typeof e=="number"?e:parseFloat(e)}const pue=[...tU,un,ei],gue=e=>pue.find(eU(e)),XR=()=>({translate:0,scale:1,origin:0,originPoint:0}),Iu=()=>({x:XR(),y:XR()}),JR=()=>({min:0,max:0}),on=()=>({x:JR(),y:JR()}),Gm=new WeakMap;function y0(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ym(e){return typeof e=="string"||Array.isArray(e)}const j2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],S2=["initial",...j2];function x0(e){return y0(e.animate)||S2.some(t=>Ym(e[t]))}function dU(e){return!!(x0(e)||e.variants)}function yue(e,t,n){for(const r in t){const s=t[r],a=n[r];if(nn(s))e.addValue(r,s);else if(nn(a))e.addValue(r,vs(s,{owner:e}));else if(a!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,vs(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const ik={current:null},hU={current:!1},xue=typeof window<"u";function vue(){if(hU.current=!0,!!xue)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ik.current=e.matches;e.addEventListener("change",t),t()}else ik.current=!1}const QR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let mv={};function fU(e){mv=e}function bue(){return mv}class mU{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:a,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=u2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 m=sr.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,nt.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=l;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=a,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=x0(n),this.isVariantNode=dU(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const g=f[m];u[m]!==void 0&&nn(g)&&g.set(u[m])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,Gm.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.forEac
vendor: 43,809 bytes, line 771
771h((s,a)=>this.bindToMotionValue(a,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(hU.current||vue(),this.shouldReduceMotion=ik.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Cs(this.notifyUpdate),Cs(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&K8.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:u,duration:d}=n.accelerate,h=new H8({element:this.current,name:t,keyframes:l,times:c,ease:u,duration:lr(d)}),f=o(h);this.valueSubscriptions.set(t,()=>{f(),h.cancel()});return}const r=Sh.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&nt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),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 mv){const n=mv[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(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):on()}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<QR.length;r++){const s=QR[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=t[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=yue(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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=vs(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(c8(r)||d8(r))?r=parseFloat(r):!gue(r)&&ei.test(n)&&(r=rU(t,n)),this.setBaseTarget(t,nn(r)?r.get():r)),nn(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var a;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=g2(this.props,n,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!nn(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new QE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){b2.render(this.render)}}class pU extends mU{constructor(){super(...arguments),this.KeyframeResolver=Yce}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[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;nn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class hl{constructor(t){this.isMounted=!1,this.node=t}update(){}}function gU({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function wue({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function jue(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 Pj(e){return e===void 0||e===1}function ak({scale:e,scaleX:t,scaleY:n}){return!Pj(e)||!Pj(t)||!Pj(n)}function Il(e){return ak(e)||yU(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yU(e){return ZR(e.x)||ZR(e.y)}function ZR(e){return e&&e!=="0%"}function pv(e,t,n){const r=e-n,s=t*r;return n+s}function eM(e,t,n,r,s){return s!==void 0&&(e=pv(e,s,r)),pv(e,n,r)+t}function ok(e,t=0,n=1,r,s){e.min=eM(e.min,t,n,r,s),e.max=eM(e.max,t,n,r,s)}function xU(e,{x:t,y:n}){ok(e.x,t.translate,t.scale,t.originPoint),ok(e.y,n.translate,n.scale,n.originPoint)}const tM=.999999999999,nM=1.0000000000001;function Sue(e,t,n,r=!1){var l;const s=n.length;if(!s)return;t.x=t.y=1;let a,o;for(let c=0;c<s;c++){a=n[c],o=a.projectionDelta;const{visualElement:u}=a.options;u&&u.props.style&&u.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(ki(e.x,-a.scroll.offset.x),ki(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,xU(e,o)),r&&Il(a.latestValues)&&vx(e,a.latestValues,(l=a.layout)==null?void 0:l.layoutBox))}t.x<nM&&t.x>tM&&(t.x=1),t.y<nM&&t.y>tM&&(t.y=1)}function ki(e,t){e.min+=t,e.max+=t}function rM(e,t,n,r,s=.5){const a=Pt(e.min,e.max,s);ok(e,t,n,a,r)}function sM(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function vx(e,t,n){const r=n??e;rM(e.x,sM(t.x,r.x),t.scaleX,t.scale,t.originX),rM(e.y,sM(t.y,r.y),t.scaleY,t.scale,t.originY)}function vU(e,t){return gU(jue(e.getBoundingClientRect(),t))}function Nue(e,t,n){const r=vU(e,n),{scroll:s}=t;return s&&(ki(r.x,s.offset.x),ki(r.y,s.offset.y)),r}const kue={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_ue=jh.length;function Cue(e,t,n){let r="",s=!0;for(let a=0;a<_ue;a++){const o=jh[a],l=e[o];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(o.startsWith("scale")?1:0);else{const u=parseFloat(l);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=sU(l,v2[o]);if(!c){s=!1;const d=kue[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function N2(e,t,n){const{style:r,vars:s,transformOrigin:a}=e;let o=!1,l=!1;for(const c in t){const u=t[c];if(Sh.has(c)){o=!0;continue}else if(C8(c)){s[c]=u;continue}else{const d=sU(u,v2[c]);c.startsWith("origin")?(l=!0,a[c]=d):r[c]=d}}if(t.transform||(o||n?r.transform=Cue(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=a;r.transformOrigin=`${c} ${u} ${d}`}}function bU(e,{style:t,vars:n},r,s){const a=e.style;let o;for(o in t)a[o]=t[o];s==null||s.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function iM(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const nf={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Se.test(e))e=parseFloat(e);else return e;const n=iM(e,t.target.x),r=iM(e,t.target.y);return`${n}% ${r}%`}},Eue={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ei.parse(e);if(s.length>5)return r;const a=ei.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=c;const u=Pt(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),a(s)}},lk={borderRadius:{...nf,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nf,borderTopRightRadius:nf,borderBottomLeftRadius:nf,borderBottomRightRadius:nf,boxShadow:Eue};function wU(e,{layout:t,layoutId:n}){return Sh.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!lk[e]||e==="opacity")}function k2(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,a={};if(!r)return a;for(const l in r)(nn(r[l])||s&&nn(s[l])||wU(l,e)||((o=n==null?void 0:n.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(a[l]=r[l]);return a}function Aue(e){return window.getComputedStyle(e)}class jU extends pU{constructor(){super(...arguments),this.type="html",this.renderInstance=bU}readValueFromInstance(t,n){var r;if(Sh.has(n))return(r=this.projection)!=null&&r.isProjecting?KN(n):Yle(t,n);{const s=Aue(t),a=(C8(n)?s.getPropertyValue(n):s[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:n}){return vU(t,n)}build(t,n,r){N2(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return k2(t,n,r)}}function Pue(e,t){return e in t}class Tue extends mU{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(Pue(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return on()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const Oue={offset:"stroke-dashoffset",array:"stroke-dasharray"},Rue={offset:"strokeDashoffset",array:"strokeDasharray"};function Mue(e,t,n=1,r=0,s=!0){e.pathLength=1;const a=s?Oue:Rue;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Iue=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function SU(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,u,d){if(N2(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:f}=e;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const m of Iue)h[m]!==void 0&&(f[m]=h[m],delete h[m]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&Mue(h,s,a,o,!1)}const NU=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"]),kU=e=>typeof e=="string"&&e.toLowerCase()==="svg";function $ue(e,t,n,r){bU(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(NU.has(s)?s:y2(s),t.attrs[s])}function _U(e,t,n){const r=k2(e,t,n);for(const s in e)if(nn(e[s])||nn(t[s])){const a=jh.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=e[s]}return r}class CU extends pU{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=on}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Sh.has(n)){const r=nU(n);return r&&r.default||0}return n=NU.has(n)?n:y2(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return _U(t,n,r)}build(t,n,r){SU(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){$ue(t,n,r,s)}mount(t){this.isSVGTag=kU(t.tagName),super.mount(t)}}const Lue=S2.length;function EU(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?EU(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Lue;n++){const r=S2[n],s=e.props[r];(Ym(s)||s===!1)&&(t[r]=s)}return t}function AU(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}const Due=[...j2].reverse(),Fue=j2.length;function Bue(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Dce(e,n,r)))}function zue(e){let t=Bue(e),n=aM(),r=!0,s=!1;const a=u=>(d,h)=>{var m;const f=dc(e,h,u==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(f){const{transition:g,transitionEnd:p,...x}=f;d={...d,...x,...p}}return d};function o(u){t=u(e)}function l(u){const{props:d}=e,h=EU(e.parent)||{},f=[],m=new Set;let g={},p=1/0;for(let v=0;v<Fue;v++){const b=Due[v],w=n[b],j=d[b]!==void 0?d[b]:h[b],S=Ym(j),N=b===u?w.isActive:null;N===!1&&(p=v);let k=j===h[b]&&j!==d[b]&&S;if(k&&(r||s)&&e.manuallyAnimateOnMount&&(k=!1),w.protectedKeys={...g},!w.isActive&&N===null||!j&&!w.prevProp||y0(j)||typeof j=="boolean")continue;if(b==="exit"&&w.isActive&&N!==!0){w.prevResolvedValues&&(g={...g,...w.prevResolvedValues});continue}const _=Uue(w.prevProp,j);let C=_||b===u&&w.isActive&&!k&&S||v>p&&S,A=!1;const E=Array.isArray(j)?j:[j];let P=E.reduce(a(b),{});N===!1&&(P={});const{prevResolvedValues:$={}}=w,R={...$,...P},L=M=>{C=!0,m.has(M)&&(A=!0,m.delete(M)),w.needsAnimating[M]=!0;const H=e.getValue(M);H&&(H.liveStyle=!1)};for(const M in R){const H=P[M],T=$[M];if(g.hasOwnProperty(M))continue;let B=!1;ZN(H)&&ZN(T)?B=!AU(H,T):B=H!==T,B?H!=null?L(M):m.add(M):H!==void 0&&m.has(M)?L(M):w.protectedKeys[M]=!0}w.prevProp=j,w.prevResolvedValues=P,w.isActive&&(g={...g,...P}),(r||s)&&e.blockInitialAnimation&&(C=!1);const D=k&&_;C&&(!D||A)&&f.push(...E.map(M=>{const H={type:b};if(typeof M=="string"&&(r||s)&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:T}=e,B=dc(T,M);if(T.enteringChildren&&B){const{delayChildren:Y}=B.transition||{};H.delay=G8(T.enteringChildren,e,Y)}}return{animation:M,options:H}}))}if(m.size){const v={};if(typeof d.initial!="boolean"){const b=dc(e,Array.isArray(d.initial)?d.initial[0]:d.initial);b&&b.transition&&(v.transition=b.transition)}m.forEach(b=>{const w=e.getBaseTarget(b),j=e.getValue(b);j&&(j.liveStyle=!0),v[b]=w??null}),f.push({animation:v})}let x=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?t(f):Promise.resolve()}function c(u,d){var f;if(n[u].isActive===d)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(m=>{var g;return(g=m.animationState)==null?void 0:g.setActive(u,d)}),n[u].isActive=d;const h=l(u);for(const m in n)n[m].protectedKeys={};return h}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=aM(),s=!0}}}function Uue(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!AU(t,e):!1}function Pl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function aM(){return{animate:Pl(!0),whileInView:Pl(),whileHover:Pl(),whileTap:Pl(),whileDrag:Pl(),whileFocus:Pl(),exit:Pl()}}function ck(e,t){e.min=t.min,e.max=t.max}function Rs(e,t){ck(e.x,t.x),ck(e.y,t.y)}function oM(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const PU=1e-4,Vue=1-PU,Wue=1+PU,TU=.01,Hue=0-TU,que=0+TU;function ir(e){return e.max-e.min}function Kue(e,t,n){return Math.abs(e-t)<=n}function lM(e,t,n,r=.5){e.origin=r,e.originPoint=Pt(t.min,t.max,e.origin),e.scale=ir(n)/ir(t),e.translate=Pt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Vue&&e.scale<=Wue||isNaN(e.scale))&&(e.scale=1),(e.translate>=Hue&&e.translate<=que||isNaN(e.translate))&&(e.translate=0)}function Qf(e,t,n,r){lM(e.x,t.x,n.x,r?r.originX:void 0),lM(e.y,t.y,n.y,r?r.originY:void 0)}function cM(e,t,n,r=0){const s=r?Pt(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+ir(t)}function Gue(e,t,n,r){cM(e.x,t.x,n.x,r==null?void 0:r.x),cM(e.y,t.y,n.y,r==null?void 0:r.y)}function uM(e,t,n,r=0){const s=r?Pt(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+ir(t)}function gv(e,t,n,r){uM(e.x,t.x,n.x,r==null?void 0:r.x),uM(e.y,t.y,n.y,r==null?void 0:r.y)}function dM(e,t,n,r,s){return e-=t,e=pv(e,1/n,r),s!==void 0&&(e=pv(e,1/s,r)),e}function Yue(e,t=0,n=1,r=.5,s,a=e,o=e){if(Ii.test(t)&&(t=parseFloat(t),t=Pt(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=Pt(a.min,a.max,r);e===a&&(l-=t),e.min=dM(e.min,t,n,l,s),e.max=dM(e.max,t,n,l,s)}function hM(e,t,[n,r,s],a,o){Yue(e,t[n],t[r],t[s],t.scale,a,o)}const Xue=["x","scaleX","originX"],Jue=["y","scaleY","originY"];function fM(e,t,n,r){hM(e.x,t,Xue,n?n.x:void 0,r?r.x:void 0),hM(e.y,t,Jue,n?n.y:void 0,r?r.y:void 0)}function mM(e){return e.translate===0&&e.scale===1}function OU(e){return mM(e.x)&&mM(e.y)}function pM(e,t){return e.min===t.min&&e.max===t.max}function Que(e,t){return pM(e.x,t.x)&&pM(e.y,t.y)}function gM(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function RU(e,t){return gM(e.x,t.x)&&gM(e.y,t.y)}function yM(e){return ir(e.x)/ir(e.y)}function xM(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function yi(e){return[e("x"),e("y")]}function Zue(e,t,n){let r="";const s=e.x.translate/t.x,a=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:f,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const MU=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],ede=MU.length,vM=e=>typeof e=="string"?parseFloat(e):e,bM=e=>typeof e=="number"||Se.test(e);function tde(e,t,n,r,s,a){s?(e.opacity=Pt(0,n.opacity??1,nde(r)),e.opacityExit=Pt(t.opacity??1,0,rde(r))):a&&(e.opacity=Pt(t.opacity??1,n.opacity??1,r));for(let o=0;o<ede;o++){const l=MU[o];let c=wM(t,l),u=wM(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||bM(c)===bM(u)?(e[l]=Math.max(Pt(vM(c),vM(u),r),0),(Ii.test(u)||Ii.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Pt(t.rotate||0,n.rotate||0,r))}function wM(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const nde=IU(0,.5,v8),rde=IU(.5,.95,Sr);function IU(e,t,n){return r=>r<e?0:r>t?1:n(_c(e,t,r))}function $U(e,t,n){const r=nn(e)?e:vs(e);return r.start(p2("",r,t,n)),r.animation}function Xm(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const sde=(e,t)=>e.depth-t.depth;class ide{constructor(){this.children=[],this.isDirty=!1}add(t){JE(this.children,t),this.isDirty=!0}remove(t){Id(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sde),this.isDirty=!1,this.children.forEach(t)}}function ade(e,t){const n=sr.now(),r=({timestamp:s})=>{const a=s-n;a>=t&&(Cs(r),e(a-t))};return nt.setup(r,!0),()=>Cs(r)}function bx(e){return nn(e)?e.get():e}class ode{constructor(){this.members=[]}add(t){JE(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Id(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Id(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){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:a}=r.options,{layoutDependency:o}=t.options;(a===void 0||a!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,a,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(a=s.options).onExitComplete)==null||o.call(a)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const wx={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Tj=["","X","Y","Z"],lde=1e3;let cde=0;function Oj(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function LU(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Z8(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",nt,!(s||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&LU(r)}function DU({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=cde++,this.animationId=0,this.animationCommitId=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.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(hde),this.nodes.forEach(xde),this.nodes.forEach(vde),this.nodes.forEach(fde)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new ide)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new QE),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=g0(o)&&!uU(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),e){let d,h=0;const f=()=>this.root.updateBlockedByResize=!1;nt.read(()=>{h=window.innerWidth}),e(o,()=>{const m=window.innerWidth;m!==h&&(h=m,this.root.updateBlockedByResize=!0,d&&d(),d=ade(f,250),wx.hasAnimatedSinceResize&&(wx.hasAnimatedSinceResize=!1,this.nodes.forEach(NM)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||Nde,{onLayoutAnimationStart:p,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!RU(this.targetLayout,m),b=!h&&f;if(this.options.layoutRoot||this.resumeFrom||b||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...m2(g,"layout"),onPlay:p,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(d,b)}else h||NM(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}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,this.eventHandlers.clear(),Cs(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(bde),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&&LU(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(pde),this.nodes.forEach(jM);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(SM);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(gde),this.nodes.forEach(yde),this.nodes.forEach(ude),this.nodes.forEach(dde)):this.nodes.forEach(SM),this.clearAllSnapshots();const l=sr.now();jn.delta=ai(0,1e3/60,l-jn.timestamp),jn.timestamp=l,jn.isProcessing=!0,jj.update.process(jn),jj.preRender.process(jn),jj.render.process(jn),jn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,b2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(mde),this.sharedNodes.forEach(wde)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,nt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){nt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ir(this.snapshot.measuredBox.x)&&!ir(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}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.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=on()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){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(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!OU(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||Il(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),kde(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return on();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(_de))){const{scroll:d}=this.root;d&&(ki(l.x,d.offset.x),ki(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=on();if(Rs(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:h,options:f}=d;d!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&Rs(l,o),ki(l.x,h.offset.x),ki(l.y,h.offset.y))}return l}applyTransform(o,l=!1,c){var d,h;const u=c||on();Rs(u,o);for(let f=0;f<this.path.length;f++){const m=this.path[f];!l&&m.options.layoutScroll&&m.scroll&&m!==m.root&&(ki(u.x,-m.scroll.offset.x),ki(u.y,-m.scroll.offset.y)),Il(m.latestValues)&&vx(u,m.latestValues,(d=m.layout)==null?void 0:d.layoutBox)}return Il(this.latestValues)&&vx(u,this.latestValues,(h=this.layout)==null?void 0:h.layoutBox),u}removeTransform(o){var c;const l=on();Rs(l,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!Il(d.latestValues))continue;let h;d.instance&&(ak(d.latestValues)&&d.updateSnapshot(),h=on(),Rs(h,d.measurePageBox())),fM(l,d.latestValues,(c=d.snapshot)==null?void 0:c.layoutBox,h)}return Il(this.latestValues)&&fM(l,this.latestValues),l}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!==jn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var m;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!this.layout||!(d||h))return;this.resolvedRelativeTargetAt=jn.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=on(),this.targetWithTransforms=on()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Gue(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Rs(this.target,this.layout.layoutBox),xU(this.target,this.targetDelta)):Rs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||ak(this.parent.latestValues)||yU(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=on(),this.relativeTargetOrigin=on(),gv(this.relativeTargetOrigin,l,c,this.options.layoutAnchor||void 0),Rs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var g;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(g=this.parent)!=null&&g.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===jn.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Rs(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Sue(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=on());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(oM(this.prevProjectionDelta.x,this.projectionDelta.x),oM(this.prevProjectionDelta.y,this.projectionDelta.y)),Qf(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!xM(this.projectionDelta.x,this.prevProjectionDelta.x)||!xM(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Iu(),this.projectionDelta=Iu(),this.projectionDeltaWithTransform=Iu()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=Iu();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const f=on(),m=c?c.source:void 0,g=this.layout?this.layout.source:void 0,p=m!==g,x=this.getStack(),v=!x||x.members.length<=1,b=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(Sde));this.animationProgress=0;let w;this.mixTargetDelta=j=>{const S=j/1e3;kM(h.x,o.x,S),kM(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gv(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),jde(this.relativeTarget,this.relativeTargetOrigin,f,S),w&&Que(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=on()),Rs(w,this.relativeTarget)),p&&(this.animationValues=d,tde(d,u,this.latestValues,S,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Cs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=nt.update(()=>{wx.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=vs(0)),this.motionValue.jump(0,!1),this.currentAnimation=$U(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},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(lde),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&FU(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||on();const h=ir(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=ir(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}Rs(l,c),vx(l,d),Qf(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ode),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Oj("z",o,u,this.animationValues);for(let d=0;d<Tj.length;d++)Oj(`rotate${Tj[d]}`,o,u,this.animationValues),Oj(`skew${Tj[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=bx(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=bx(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Il(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Zue(this.projectionDeltaWithTransform,this.treeScale,d);c&&(h=c(d,h)),o.transform=h;const{x:f,y:m}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${m.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const g in lk){if(d[g]===void 0)continue;const{correct:p,applyTo:x,isCSSVariable:v}=lk[g],b=h==="none"?d[g]:p(d[g],u);if(x){const w=x.length;for(let j=0;j<w;j++)o[x[j]]=b}else v?this.options.visualElement.renderState.vars[g]=b:o[g]=b}this.options.layoutId&&(o.pointerEvents=u===this?bx(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(jM),this.root.sharedNodes.clear()}}}function ude(e){e.updateLayout()}function dde(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if(a==="size")yi(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],m=ir(f);f.min=r[h].min,f.max=f.min+m});else if(a==="x"||a==="y"){const h=a==="x"?"y":"x";ck(o?t.measuredBox[h]:t.layoutBox[h],r[h])}else FU(a,t.layoutBox,r)&&yi(h=>{const f=o?t.measuredBox[h]:t.layoutBox[h],m=ir(r[h]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+m)});const l=Iu();Qf(l,r,t.layoutBox);const c=Iu();o?Qf(c,e.applyTransform(s,!0),t.measuredBox):Qf(c,r,t.layoutBox);const u=!OU(l);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:m}=h;if(f&&m){const g=e.options.layoutAnchor||void 0,p=on();gv(p,t.layoutBox,f.layoutBox,g);const x=on();gv(x,r,m.layoutBox,g),RU(p,x)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=p,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function hde(e){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 fde(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function mde(e){e.clearSnapshot()}function jM(e){e.clearMeasurements()}function pde(e){e.isLayoutDirty=!0,e.updateLayout()}function SM(e){e.isLayoutDirty=!1}function gde(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function yde(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function NM(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function xde(e){e.resolveTargetDelta()}function vde(e){e.calcProjection()}
771function bde(e){e.resetSkewAndRotation()}function wde(e){e.removeLeadSnapshot()}function kM(e,t,n){e.translate=Pt(t.translate,0,n),e.scale=Pt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function _M(e,t,n,r){e.min=Pt(t.min,n.min,r),e.max=Pt(t.max,n.max,r)}function jde(e,t,n,r){_M(e.x,t.x,n.x,r),_M(e.y,t.y,n.y,r)}function Sde(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Nde={duration:.45,ease:[.4,0,.1,1]},CM=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),EM=CM("applewebkit/")&&!CM("chrome/")?Math.round:Sr;function AM(e){e.min=EM(e.min),e.max=EM(e.max)}function kde(e){AM(e.x),AM(e.y)}function FU(e,t,n){return e==="position"||e==="preserve-aspect"&&!Kue(yM(t),yM(n),.2)}function _de(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Cde=DU({attachResizeListener:(e,t)=>Xm(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Rj={current:void 0},BU=DU({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rj.current){const e=new Cde({});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"}),ag=y.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function PM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ede(...e){return t=>{let n=!1;const r=e.map(s=>{const a=PM(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():PM(e[s],null)}}}}function Ade(...e){return y.useCallback(Ede(...e),e)}class Pde extends y.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Jf(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Jf(r)&&r.offsetWidth||0,a=Jf(r)&&r.offsetHeight||0,o=getComputedStyle(n),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=n.offsetTop,l.left=n.offsetLeft,l.right=s-l.width-l.left,l.bottom=a-l.height-l.top}return null}componentDidUpdate(){}render(){return this.props.children}}function Tde({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:a}){var f;const o=y.useId(),l=y.useRef(null),c=y.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=y.useContext(ag),d=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),h=Ade(l,d);return y.useInsertionEffect(()=>{const{width:m,height:g,top:p,left:x,right:v,bottom:b}=c.current;if(t||a===!1||!l.current||!m||!g)return;const w=n==="left"?`left: ${x}`:`right: ${v}`,j=r==="bottom"?`bottom: ${b}`:`top: ${p}`;l.current.dataset.motionPopId=o;const S=document.createElement("style");u&&(S.nonce=u);const N=s??document.head;return N.appendChild(S),S.sheet&&S.sheet.insertRule(` 772 [data-motion-pop-id="${o}"] { 773 position: absolute !important; 774 width: ${m}px !important; 775 height: ${g}px !important; 776 ${w}px !important; 777 ${j}px !important; 778 } 779 `),()=>{var k;(k=l.current)==null||k.removeAttribute("data-motion-pop-id"),N.contains(S)&&N.removeChild(S)}},[t]),i.jsx(Pde,{isPresent:t,childRef:l,sizeRef:c,pop:a,children:a===!1?e:y.cloneElement(e,{ref:h})})}const Ode=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:o,anchorX:l,anchorY:c,root:u})=>{const d=nl(Rde),h=y.useId();let f=!0,m=y.useMemo(()=>(f=!1,{id:h,initial:t,isPresent:n,custom:s,onExitComplete:g=>{d.set(g,!0);for(const p of d.values())if(!p)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return a&&f&&(m={...m}),y.useMemo(()=>{d.forEach((g,p)=>d.set(p,!1))},[n]),y.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=i.jsx(Tde,{pop:o==="popLayout",isPresent:n,anchorX:l,anchorY:c,root:u,children:e}),i.jsx(h0.Provider,{value:m,children:e})};function Rde(){return new Map}function zU(e=!0){const t=y.useContext(h0);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,a=y.useId();y.useEffect(()=>{if(e)return s(a)},[e]);const o=y.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const cy=e=>e.key||"";function TM(e){const t=[];
vendor: 4,891 bytes, line 779
779return y.Children.forEach(e,n=>{y.isValidElement(n)&&t.push(n)}),t}const Mde=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:a="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[d,h]=zU(o),f=y.useMemo(()=>TM(e),[e]),m=o&&!d?[]:f.map(cy),g=y.useRef(!0),p=y.useRef(f),x=nl(()=>new Map),v=y.useRef(new Set),[b,w]=y.useState(f),[j,S]=y.useState(f);d0(()=>{g.current=!1,p.current=f;for(let _=0;_<j.length;_++){const C=cy(j[_]);m.includes(C)?(x.delete(C),v.current.delete(C)):x.get(C)!==!0&&x.set(C,!1)}},[j,m.length,m.join("-")]);const N=[];if(f!==b){let _=[...f];for(let C=0;C<j.length;C++){const A=j[C],E=cy(A);m.includes(E)||(_.splice(C,0,A),N.push(A))}return a==="wait"&&N.length&&(_=N),S(TM(_)),w(f),null}const{forceRender:k}=y.useContext(XE);return i.jsx(i.Fragment,{children:j.map(_=>{const C=cy(_),A=o&&!d?!1:f===j||m.includes(C),E=()=>{if(v.current.has(C))return;if(x.has(C))v.current.add(C),x.set(C,!0);else return;let P=!0;x.forEach($=>{$||(P=!1)}),P&&(k==null||k(),S(p.current),o&&(h==null||h()),r&&r())};return i.jsx(Ode,{isPresent:A,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:u,onExitComplete:A?void 0:E,anchorX:l,anchorY:c,children:_},C)})})},UU=y.createContext({strict:!1}),OM={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"]};let RM=!1;function Ide(){if(RM)return;const e={};for(const t in OM)e[t]={isEnabled:n=>OM[t].some(r=>!!n[r])};fU(e),RM=!0}function VU(){return Ide(),bue()}function $de(e){const t=VU();for(const n in e)t[n]={...t[n],...e[n]};fU(t)}const Lde=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","propagate","ignoreStrict","viewport"]);function yv(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Lde.has(e)}let WU=e=>!yv(e);function Dde(e){typeof e=="function"&&(WU=t=>t.startsWith("on")?!yv(t):e(t))}try{Dde(require("@emotion/is-prop-valid").default)}catch{}function Fde(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||nn(e[s])||(WU(s)||n===!0&&yv(s)||!t&&!yv(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const v0=y.createContext({});function Bde(e,t){if(x0(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ym(n)?n:void 0,animate:Ym(r)?r:void 0}}return e.inherit!==!1?t:{}}function zde(e){const{initial:t,animate:n}=Bde(e,y.useContext(v0));return y.useMemo(()=>({initial:t,animate:n}),[MM(t),MM(n)])}function MM(e){return Array.isArray(e)?e.join(" "):e}const _2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HU(e,t,n){for(const r in t)!nn(t[r])&&!wU(r,n)&&(e[r]=t[r])}function Ude({transformTemplate:e},t){return y.useMemo(()=>{const n=_2();return N2(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Vde(e,t){const n=e.style||{},r={};return HU(r,n,e),Object.assign(r,Ude(e,t)),r}function Wde(e,t){const n={},r=Vde(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}const qU=()=>({..._2(),attrs:{}});function Hde(e,t,n,r){const s=y.useMemo(()=>{const a=qU();return SU(a,t,kU(r),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};HU(a,e.style,e),s.style={...a,...s.style}}return s}const qde=["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 C2(e){return typeof e!="string"||e.includes("-")?!1:!!(qde.indexOf(e)>-1||/[A-Z]/u.test(e))}function Kde(e,t,n,{latestValues:r},s,a=!1,o){const c=(o??C2(e)?Hde:Wde)(t,r,s,e),u=Fde(t,typeof e=="string",a),d=e!==y.Fragment?{...u,...c,ref:n}:{},{children:h}=t,f=y.useMemo(()=>nn(h)?h.get():h,[h]);return y.createElement(e,{...d,children:f})}function Gde({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:Yde(n,r,s,e),renderState:t()}}function Yde(e,t,n,r){const s={}
vendor: 21,381 bytes, line 779
779,a=r(e,{});for(const f in a)s[f]=bx(a[f]);let{initial:o,animate:l}=e;const c=x0(e),u=dU(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const h=d?l:o;if(h&&typeof h!="boolean"&&!y0(h)){const f=Array.isArray(h)?h:[h];for(let m=0;m<f.length;m++){const g=g2(e,f[m]);if(g){const{transitionEnd:p,transition:x,...v}=g;for(const b in v){let w=v[b];if(Array.isArray(w)){const j=d?w.length-1:0;w=w[j]}w!==null&&(s[b]=w)}for(const b in p)s[b]=p[b]}}}return s}const KU=e=>(t,n)=>{const r=y.useContext(v0),s=y.useContext(h0),a=()=>Gde(e,t,r,s);return n?a():nl(a)},Xde=KU({scrapeMotionValuesFromProps:k2,createRenderState:_2}),Jde=KU({scrapeMotionValuesFromProps:_U,createRenderState:qU}),Qde=Symbol.for("motionComponentSymbol");function Zde(e,t,n){const r=y.useRef(n);y.useInsertionEffect(()=>{r.current=n});const s=y.useRef(null);return y.useCallback(a=>{var l;a&&((l=e.onMount)==null||l.call(e,a));const o=r.current;if(typeof o=="function")if(a){const c=o(a);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):o(a);else o&&(o.current=a);t&&(a?t.mount(a):t.unmount())},[t])}const GU=y.createContext({});function xu(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function ehe(e,t,n,r,s,a){var w,j;const{visualElement:o}=y.useContext(v0),l=y.useContext(UU),c=y.useContext(h0),u=y.useContext(ag),d=u.reducedMotion,h=u.skipAnimations,f=y.useRef(null),m=y.useRef(!1);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:a}),m.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const g=f.current,p=y.useContext(GU);g&&!g.projection&&s&&(g.type==="html"||g.type==="svg")&&the(f.current,n,s,p);const x=y.useRef(!1);y.useInsertionEffect(()=>{g&&x.current&&g.update(n,c)});const v=n[Q8],b=y.useRef(!!v&&typeof window<"u"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,v))&&((j=window.MotionHasOptimisedAnimation)==null?void 0:j.call(window,v)));return d0(()=>{m.current=!0,g&&(x.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),g.scheduleRenderMicrotask(),b.current&&g.animationState&&g.animationState.animateChanges())}),y.useEffect(()=>{g&&(!b.current&&g.animationState&&g.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,v)}),b.current=!1),g.enteringChildren=void 0)}),g}function the(e,t,n,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutAnchor:d,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:YU(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&xu(l),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:c,layoutRoot:u,layoutAnchor:d})}function YU(e){if(e)return e.options.allowProjection!==!1?e.projection:YU(e.parent)}function Mj(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&$de(r);const a=n?n==="svg":C2(e),o=a?Jde:Xde;function l(u,d){let h;const f={...y.useContext(ag),...u,layoutId:nhe(u)},{isStatic:m}=f,g=zde(u),p=o(u,m);if(!m&&typeof window<"u"){rhe();const x=she(f);h=x.MeasureLayout,g.visualElement=ehe(e,p,f,s,x.ProjectionNode,a)}return i.jsxs(v0.Provider,{value:g,children:[h&&g.visualElement?i.jsx(h,{visualElement:g.visualElement,...f}):null,Kde(e,u,Zde(p,g.visualElement,d),p,m,t,a)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=y.forwardRef(l);return c[Qde]=e,c}function nhe({layoutId:e}){const t=y.useContext(XE).id;return t&&e!==void 0?t+"-"+e:e}function rhe(e,t){y.useContext(UU).strict}function she(e){const t=VU(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function ihe(e,t){if(typeof Proxy>"u")return Mj;const n=new Map,r=(a,o)=>Mj(a,o,e,t),s=(a,o)=>r(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?r:(n.has(o)||n.set(o,Mj(o,void 0,e,t)),n.get(o))})}const ahe=(e,t)=>t.isSVG??C2(e)?new CU(t):new jU(t,{allowProjection:e!==y.Fragment});class ohe extends hl{constructor(t){super(t),t.animationState||(t.animationState=zue(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();y0(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.call(this)}}let lhe=0;class che extends hl{constructor(){super(...arguments),this.id=lhe++,this.isExitComplete=!1}update(){var a;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;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"){const c=dc(this.node,o,l);if(c){const{transition:u,transitionEnd:d,...h}=c;for(const f in h)(a=this.node.getValue(f))==null||a.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const uhe={animation:{Feature:ohe},exit:{Feature:che}};function og(e){return{point:{x:e.pageX,y:e.pageY}}}const dhe=e=>t=>w2(t)&&e(t,og(t));function Zf(e,t,n,r){return Xm(e,t,dhe(n),r)}const XU=({current:e})=>e?e.ownerDocument.defaultView:null,IM=(e,t)=>Math.abs(e-t);function hhe(e,t){const n=IM(e.x,t.x),r=IM(e.y,t.y);return Math.sqrt(n**2+r**2)}const $M=new Set(["auto","scroll"]);class JU{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=uy(this.lastRawMoveEventInfo,this.transformPagePoint));const m=Ij(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,p=hhe(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!p)return;const{point:x}=m,{timestamp:v}=jn;this.history.push({...x,timestamp:v});const{onStart:b,onMove:w}=this.handlers;g||(b&&b(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=uy(g,this.transformPagePoint),nt.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:p,onSessionEnd:x,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Ij(m.type==="pointercancel"?this.lastMoveEventInfo:uy(g,this.transformPagePoint),this.history);this.startEvent&&p&&p(m,b),x&&x(m,b)},!w2(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=og(t),u=uy(c,this.transformPagePoint),{point:d}=u,{timestamp:h}=jn;this.history=[{...d,timestamp:h}];const{onSessionStart:f}=n;f&&f(t,Ij(u,this.history)),this.removeListeners=rg(Zf(this.contextWindow,"pointermove",this.handlePointerMove),Zf(this.contextWindow,"pointerup",this.handlePointerUp),Zf(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);($M.has(r.overflowX)||$M.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:s.x-n.x,y:s.y-n.y};a.x===0&&a.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,s),nt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Cs(this.updatePoint)}}function uy(e,t){return t?{point:t(e.point)}:e}function LM(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ij({point:e},t){return{point:e,delta:LM(e,QU(t)),offset:LM(e,fhe(t)),velocity:mhe(t,.1)}}function fhe(e){return e[0]}function QU(e){return e[e.length-1]}function mhe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=QU(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>lr(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>lr(t)*2&&(r=e[1]);const a=xs(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function phe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Pt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Pt(n,e,r.max):Math.min(e,n)),e}function DM(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 ghe(e,{top:t,left:n,bottom:r,right:s}){return{x:DM(e.x,n,s),y:DM(e.y,t,r)}}function FM(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 yhe(e,t){return{x:FM(e.x,t.x),y:FM(e.y,t.y)}}function xhe(e,t){let n=.5;const r=ir(e),s=ir(t);return s>r?n=_c(t.min,t.max-r,e.min):r>s&&(n=_c(e.min,e.max-s,t.min)),ai(0,1,n)}function vhe(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 uk=.35;function bhe(e=uk){return e===!1?e=0:e===!0&&(e=uk),{x:BM(e,"left","right"),y:BM(e,"top","bottom")}}function BM(e,t,n){return{min:zM(e,t),max:zM(e,n)}}function zM(e,t){return typeof e=="number"?e:e[t]||0}const whe=new WeakMap;class jhe{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=on(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=h=>{n&&this.snapToCursor(og(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:m,dragPropagation:g,onDragStart:p}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Xce(m),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yi(v=>{let b=this.getAxisMotionValue(v).get()||0;if(Ii.test(b)){const{projection:w}=this.visualElement;if(w&&w.layout){const j=w.layout.layoutBox[v];j&&(b=ir(j)*(parseFloat(b)/100))}}this.originPoint[v]=b}),p&&nt.update(()=>p(h,f),!1,!0),ek(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:p,onDrag:x}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:v}=f;if(g&&this.currentDirection===null){this.currentDirection=Nhe(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),x&&nt.update(()=>x(h,f),!1,!0)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new JU(t,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:XU(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&nt.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!dy(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=phe(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;t&&xu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=ghe(r.layoutBox,t):this.constraints=!1,this.elastic=bhe(n),s!==this.constraints&&!xu(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&yi(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vhe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xu(t))return!1;const r=t.current;zi(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=Nue(r,s.root,this.visualElement.getTransformPagePoint());let o=yhe(s.layout.layoutBox,a);if(n){const l=n(wue(o));this.hasMutatedConstraints=!!l,l&&(o=gU(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=yi(d=>{if(!dy(d,n,this.currentDirection))return;let h=c&&c[d]||{};(o===!0||o===d)&&(h={min:0,max:0});const f=s?200:1e6,m=s?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...a,...h};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ek(this.visualElement,t),r.start(p2(t,r,0,n,this.visualElement,!1))}stopAnimation(){yi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){yi(n=>{const{drag:r}=this.getProps();if(!dy(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n],c=a.get()||0;a.set(t[n]-Pt(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};yi(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=xhe({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.constraints=!1,this.resolveConstraints(),yi(o=>{if(!dy(o,t,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Pt(c,u,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;whe.set(this.visualElement,this);const t=this.visualElement.current,n=Zf(t,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps(),f=u.target,m=f!==t&&nue(f);d&&h&&!m&&this.start(u)});let r;const s=()=>{const{dragConstraints:u}=this.getProps();xu(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=She(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,o=a.addEventListener("measure",s);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),nt.read(s);const l=Xm(window,"resize",()=>this.scalePositionWithinConstraints()),c=a.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(yi(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())});return()=>{l(),n(),o(),c&&c(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=uk,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function UM(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function She(e,t,n){const r=sk(e,UM(n)),s=sk(t,UM(n));return()=>{r(),s()}}function dy(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Nhe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class khe extends hl{constructor(t){super(t),this.removeGroupControls=Sr,this.removeListeners=Sr,this.controls=new jhe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sr}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const $j=e=>(t,n)=>{e&&nt.update(()=>e(t,n),!1,!0)};class _he extends hl{constructor(){super(...arguments),this.removePointerDownListener=Sr}onPointerDown(t){this.session=new JU(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:XU(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:$j(t),onStart:$j(n),onMove:$j(r),onEnd:(a,o)=>{delete this.session,s&&nt.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=Zf(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Lj=!1;class Che extends y.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=t;a&&(n.group&&n.group.add(a),r&&r.register&&s&&r.register(a),Lj&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),wx.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Lj=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||nt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),b2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Lj=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function ZU(e){const[t,n]=zU(),r=y.useContext(XE);return i.jsx(Che,{...e,layoutGroup:r,switchLayoutGroup:y.useContext(GU),isPresent:t,safeToRemove:n})}const Ehe={pan:{Feature:_he},drag:{Feature:khe,ProjectionNode:BU,MeasureLayout:ZU}};
779function VM(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=r[s];a&&nt.postRender(()=>a(t,og(t)))}class Ahe extends hl{mount(){const{current:t}=this.node;t&&(this.unmount=Qce(t,(n,r)=>(VM(this.node,r,"Start"),s=>VM(this.node,s,"End"))))}unmount(){}}class Phe extends hl{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=rg(Xm(this.node.current,"focus",()=>this.onFocus()),Xm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function WM(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=r[s];a&&nt.postRender(()=>a(t,og(t)))}class The extends hl{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=sue(t,(s,a)=>(WM(this.node,a,"Start"),(o,{success:l})=>WM(this.node,o,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const dk=new WeakMap,Dj=new WeakMap,Ohe=e=>{const t=dk.get(e.target);t&&t(e)},Rhe=e=>{e.forEach(Ohe)};function Mhe({root:e,...t}){const n=e||document;Dj.has(n)||Dj.set(n,{});const r=Dj.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(Rhe,{root:e,...t})),r[s]}function Ihe(e,t,n){const r=Mhe(t);return dk.set(e,n),r.observe(e),()=>{dk.delete(e),r.unobserve(e)}}const $he={some:0,all:1};class Lhe extends hl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:a}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:$he[s]},l=u=>{const{isIntersecting:d}=u;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:h,onViewportLeave:f}=this.node.getProps(),m=d?h:f;m&&m(u)};this.stopObserver=Ihe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Dhe(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Dhe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Fhe={inView:{Feature:Lhe},tap:{Feature:The},focus:{Feature:Phe},hover:{Feature:Ahe}},Bhe={layout:{ProjectionNode:BU,MeasureLayout:ZU}},zhe={...uhe,...Fhe,...Ehe,...Bhe},Ln=ihe(zhe,ahe);function xv(e){return typeof window>"u"?!1:e?U8():h2()}const Uhe=50,HM=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),Vhe=()=>({time:0,x:HM(),y:HM()}),Whe={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function qM(e,t,n,r){const s=n[t],{length:a,position:o}=Whe[t],l=s.current,c=n.time;s.current=Math.abs(e[`scroll${o}`]),s.scrollLength=e[`scroll${a}`]-e[`client${a}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=_c(0,s.scrollLength,s.current);const u=r-c;s.velocity=u>Uhe?0:ZE(s.current-l,u)}function Hhe(e,t,n){qM(e,"x",t,n),qM(e,"y",t,n),t.time=n}function qhe(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(Jf(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const s=r.getBoundingClientRect();r=r.parentElement;const a=r.getBoundingClientRect();n.x+=s.left-a.left,n.y+=s.top-a.top}else if(r instanceof SVGGraphicsElement){const{x:s,y:a}=r.getBBox();n.x+=s,n.y+=a;let o=null,l=r.parentNode;for(;!o;)l.tagName==="svg"&&(o=l),l=r.parentNode;r=o}else break;return n}const hk={start:0,center:.5,end:1};function KM(e,t,n=0){let r=0;if(e in hk&&(e=hk[e]),typeof e=="string"){const s=parseFloat(e);e.endsWith("px")?r=s:e.endsWith("%")?e=s/100:e.endsWith("vw")?r=s/100*document.documentElement.clientWidth:e.endsWith("vh")?r=s/100*document.documentElement.clientHeight:e=s}return typeof e=="number"&&(r=t*e),n+r}const Khe=[0,0];function Ghe(e,t,n,r){let s=Array.isArray(e)?e:Khe,a=0,o=0;return typeof e=="number"?s=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?s=e.split(" "):s=[e,hk[e]?e:"0"]),a=KM(s[0],n,r),o=KM(s[1],t),a-o}const Af={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Yhe={x:0,y:0};function Xhe(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function Jhe(e,t,n){const{offset:r=Af.All}=n,{target:s=e,axis:a="y"}=n,o=a==="y"?"height":"width",l=s!==e?qhe(s,e):Yhe,c=s===e?{width:e.scrollWidth,height:e.scrollHeight}:Xhe(s),u={width:e.clientWidth,height:e.clientHeight};t[a].offset.length=0;let d=!t[a].interpolate;const h=r.length;for(let f=0;f<h;f++){const m=Ghe(r[f],u[o],c[o],l[a]);
779!d&&m!==t[a].interpolatorOffsets[f]&&(d=!0),t[a].offset[f]=m}d&&(t[a].interpolate=o2(t[a].offset,l2(r),{clamp:!1}),t[a].interpolatorOffsets=[...t[a].offset]),t[a].progress=ai(0,1,t[a].interpolate(t[a].current))}function Qhe(e,t=e,n){if(n.x.targetOffset=0,n.y.targetOffset=0,t!==e){let r=t;for(;r&&r!==e;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=t===e?t.scrollWidth:t.clientWidth,n.y.targetLength=t===e?t.scrollHeight:t.clientHeight,n.x.containerLength=e.clientWidth,n.y.containerLength=e.clientHeight}function Zhe(e,t,n,r={}){return{measure:s=>{Qhe(e,r.target,n),Hhe(e,n,s),(r.offset||r.target)&&Jhe(e,n,r)},notify:()=>t(n)}}const Xc=new WeakMap,GM=new WeakMap,Fj=new WeakMap,YM=new WeakMap,hy=new WeakMap,XM=e=>e===document.scrollingElement?window:e;function eV(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return Sr;let s=Fj.get(t);s||(s=new Set,Fj.set(t,s));const a=Vhe(),o=Zhe(t,e,a,r);if(s.add(o),!Xc.has(t)){const c=()=>{for(const f of s)f.measure(jn.timestamp);nt.preUpdate(u)},u=()=>{for(const f of s)f.notify()},d=()=>nt.read(c);Xc.set(t,d);const h=XM(t);window.addEventListener("resize",d),t!==document.documentElement&&GM.set(t,sk(t,d)),h.addEventListener("scroll",d),d()}if(n&&!hy.has(t)){const c=Xc.get(t),u={width:t.scrollWidth,height:t.scrollHeight};YM.set(t,u);const d=()=>{const f=t.scrollWidth,m=t.scrollHeight;(u.width!==f||u.height!==m)&&(c(),u.width=f,u.height=m)},h=nt.read(d,!0);hy.set(t,h)}const l=Xc.get(t);return nt.read(l,!1,!0),()=>{var h;Cs(l);const c=Fj.get(t);if(!c||(c.delete(o),c.size))return;const u=Xc.get(t);Xc.delete(t),u&&(XM(t).removeEventListener("scroll",u),(h=GM.get(t))==null||h(),window.removeEventListener("resize",u));const d=hy.get(t);d&&(Cs(d),hy.delete(t)),YM.delete(t)}}const efe=[[Af.Enter,"entry"],[Af.Exit,"exit"],[Af.Any,"cover"],[Af.All,"contain"]],JM={start:0,end:1};function tfe(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const n=JM[t[0]],r=JM[t[1]];if(!(n===void 0||r===void 0))return[n,r]}function nfe(e){if(e.length!==2)return;const t=[];for(const n of e)if(Array.isArray(n))t.push(n);else if(typeof n=="string"){const r=tfe(n);if(!r)return;t.push(r)}else return;return t}function rfe(e,t){const n=nfe(e);if(!n)return!1;for(let r=0;r<2;r++){const s=n[r],a=t[r];if(s[0]!==a[0]||s[1]!==a[1])return!1}return!0}function E2(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of efe)if(rfe(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const QM=new Map;function ZM(e){const t={value:0},n=eV(r=>
779{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function tV({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=QM.get(t);s||(s=new Map,QM.set(t,s));const a=n.target??"self";let o=s.get(a);o||(o={},s.set(a,o));const l=r+(n.offset??[]).join(",");return o[l]||(n.target&&xv(n.target)?E2(n.offset)?o[l]=new ViewTimeline({subject:n.target,axis:r}):o[l]=ZM({container:t,...n}):xv()?o[l]=new ScrollTimeline({source:t,axis:r}):o[l]=ZM({container:t,...n})),o[l]}function sfe(e,t){const n=tV(t),r=t.target?E2(t.offset):void 0,s=t.target?xv(t.target)&&!!r:xv();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:a=>(a.pause(),cU(o=>{a.time=a.iterationDuration*o},n))})}function ife(e){return e.length===2}function afe(e,t){return ife(e)?eV(n=>{e(n[t.axis].progress,n)},t):cU(e,tV(t))}function nV(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return Sr;const s={axis:t,container:n,...r};return typeof e=="function"?afe(e,s):sfe(e,s)}const ofe=()=>({scrollX:vs(0),scrollY:vs(0),scrollXProgress:vs(0),scrollYProgress:vs(0)}),fy=e=>e?!e.current:!1;function eI(e,t,n,r){return{factory:s=>nV(s,{...t,axis:e,container:(n==null?void 0:n.current)||void 0,target:(r==null?void 0:r.current)||void 0}),times:[0,1],keyframes:[0,1],ease:s=>s,duration:1}}function lfe(e,t){return typeof window>"u"?!1:e?U8()&&!!E2(t):h2()}function cfe({container:e,target:t,...n}={}){const r=nl(ofe);lfe(t,n.offset)&&(r.scrollXProgress.accelerate=eI("x",n,e,t),r.scrollYProgress.accelerate=eI("y",n,e,t));const s=y.useRef(null),a=y.useRef(!1),o=y.useCallback(()=>(s.current=nV((l,{x:c,y:u})=>{r.scrollX.set(c.current),r.scrollXProgress.set(c.progress),r.scrollY.set(u.current),r.scrollYProgress.set(u.progress)},{...n,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var l;(l=s.current)==null||l.call(s)}),[e,t,JSON.stringify(n.offset)]);return d0(()=>{if(a.current=!1,fy(e)||fy(t)){a.current=!0;return}else return o()},[o]),y.useEffect(()=>{if(a.current)return zi(!fy(e),"Container ref is defined but not hydrated","use-scroll-ref"),zi(!fy(t),"Target ref is defined but not hydrated","use-scroll-ref"),o()},[o]),r}function vv(e){const t=nl(()=>vs(e)),{isStatic:n}=y.useContext(ag);if(n){const[,r]=y.useState(e);y.useEffect(()=>t.on("change",r),[])}return t}function rV(e,t){const n=vv(t()),r=()=>n.set(t());return r(),d0(()=>{const s=()=>nt.preRender(r,!1,!0),a=e.map(o=>o.on("change",s));return()=>{a.forEach(o=>o()),Cs(r)}}),n}function ufe(e){Xf.current=[],e();const t=rV(Xf.current,e);return Xf.current=void 0,t}function em(e,t,n,r){if(typeof e=="function")return ufe(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!="function")return dfe(e,t,n,r);const o=typeof t=="function"?t:fue(t,n,r),l=Array.isArray(e)?tI(e,o):tI([e],([u])=>o(u)),c=Array.isArray(e)?void 0:e.accelerate;return c&&!c.isTransformed&&typeof t!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(l.accelerate={...c,times:t,keyframes:n,isTransformed:!0}),l}function tI(e,t){const n=nl(()=>[]);return rV(e,()=>{n.length=0;const r=e.length;for(let s=0;s<r;s++)n[s]=e[s].get();return t(n)})}function dfe(e,t,n,r){const s=nl(()=>Object.keys(n)),a=nl(()=>({}));for(const o of s)a[o]=em(e,t,n[o],r);return a}function hfe(e,t={}){const{isStatic:n}=y.useContext(ag),r=()=>nn(e)?e.get():e;if(n)return em(r);const s=vv(r());return y.useInsertionEffect(()=>mue(s,e,t),[s,JSON.stringify(t)]),s}function nI(e,t={}){return hfe(e,{type:"spring",...t})}function A2(e){return typeof e=="object"&&!Array.isArray(e)}function sV(e,t,n,r){return e==null?[]:typeof e=="string"&&A2(t)?p0(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(s=>s!=null):[e]}function ffe(e,t,n){return e*(t+1)}function rI(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function mfe(e,t,n){for(let r=0;r<e.length;r++){const s=e[r];s.at>
vendor: 4,445 bytes, line 779
779t&&s.at<n&&(Id(e,s),r--)}}function pfe(e,t,n,r,s,a){mfe(e,s,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Pt(s,a,r[o]),easing:S8(n,o)})}function gfe(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function yfe(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const xfe="easeInOut",vfe=20;function bfe(e,{defaultTransition:t={},...n}={},r,s){const a=t.duration||.3,o=new Map,l=new Map,c={},u=new Map;let d=0,h=0,f=0;for(let m=0;m<e.length;m++){const g=e[m];if(typeof g=="string"){u.set(g,h);continue}else if(!Array.isArray(g)){u.set(g.name,rI(h,g.at,d,u));continue}let[p,x,v={}]=g;v.at!==void 0&&(h=rI(h,v.at,d,u));let b=0;const w=(j,S,N,k=0,_=0)=>{const C=wfe(j),{delay:A=0,times:E=l2(C),type:P=t.type||"keyframes",repeat:$,repeatType:R,repeatDelay:L=0,...D}=S;let{ease:I=t.ease||"easeOut",duration:M}=S;const H=typeof A=="function"?A(k,_):A,T=C.length,B=f2(P)?P:s==null?void 0:s[P||"keyframes"];if(T<=2&&B){let X=100;if(T===2&&Nfe(C)){const ce=C[1]-C[0];X=Math.abs(ce)}const J={...t,...D};M!==void 0&&(J.duration=lr(M));const G=I8(J,X,B);I=G.ease,M=G.duration}M??(M=a);const Y=h+H;E.length===1&&E[0]===0&&(E[1]=1);const O=E.length-C.length;if(O>0&&L8(E,O),C.length===1&&C.unshift(null),$){zi($<vfe,"Repeat count too high, must be less than 20","repeat-count-high"),M=ffe(M,$);const X=[...C],J=[...E];I=Array.isArray(I)?[...I]:[I];const G=[...I];for(let ce=0;ce<$;ce++){C.push(...X);for(let ee=0;ee<X.length;ee++)E.push(J[ee]+(ce+1)),I.push(ee===0?"linear":S8(G,ee-1))}gfe(E,$)}const W=Y+M;pfe(N,C,I,E,Y,W),b=Math.max(H+M,b),f=Math.max(W,f)};if(nn(p)){const j=sI(p,l);w(x,v,iI("default",j))}else{const j=sV(p,x,r,c),S=j.length;for(let N=0;N<S;N++){x=x,v=v;const k=j[N],_=sI(k,l);for(const C in x)w(x[C],jfe(v,C),iI(C,_),N,S)}}d=h,h+=b}return l.forEach((m,g)=>{for(const p in m){const x=m[p];x.sort(yfe);const v=[],b=[],w=[];for(let k=0;k<x.length;k++){const{at:_,value:C,easing:A}=x[k];v.push(C),b.push(_c(0,f,_)),w.push(A||"easeOut")}b[0]!==0&&(b.unshift(0),v.unshift(v[0]),w.unshift(xfe)),b[b.length-1]!==1&&(b.push(1),v.push(null)),o.has(g)||o.set(g,{keyframes:{},transition:{}});const j=o.get(g);j.keyframes[p]=v;const{type:S,...N}=t;j.transition[p]={...N,duration:f,ease:w,times:b,...n}}}),o}function sI(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function iI(e,t){return t[e]||(t[e]=[]),t[e]}function wfe(e){return Array.isArray(e)?e:[e]}function jfe(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const Sfe=e=>typeof e=="number",Nfe=e=>e.every(Sfe);function kfe(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=g0(e)&&!uU(e)?new CU(t):new jU(t);n.mount(e),Gm.set(e,n)}function _fe(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Tue(t);n.mount(e),Gm.set(e,n)}function Cfe(e,t){return nn(e)||typeof e=="number"||typeof e=="string"&&!A2(t)}function iV(e,t,n,r){const s=[];if(Cfe(e,t))s.push($U(e,A2(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return s;const a=sV(e,t,r),o=a.length;zi(!!o,"No valid elements provided.","no-valid-elements");for(let l=0;l<o;l++){const c=a[l],u=c instanceof Element?kfe:_fe;Gm.has(c)||u(c);const d=Gm.get(c),h={...n};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(l,o)),s.push(...x2(d,{...t,transition:h},{}))}}return s}function Efe(e,t,n){const r=[],s=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const l=o[0],c=vs(0);return c.on("change",l),o.length===1?[c,[0,1]]:o.length===2?[c,[0,1],o[1]]:[c,o[1],o[2]]}return o});return bfe(s,t,n,{spring:qm}).forEach(({keyframes:o,transition:l},c)=>{r.push(...iV(c,o,l))}),r}function Afe(e){return Array.isArray(e)&&e.some(Array.isArray)}function Pfe(e={}){const{scope:t,reduceMotion:n}=e;function r(s,a,o){let l=[],c;if(Afe(s)){const{onComplete:d,...h}=a||{};typeof d=="function"&&(c=d),l=Efe(s,n!==void 0?{reduceMotion:n,...h}:h,t)}else{const{onComplete:d,...h}=o||{};typeof d=="function"&&(c=d),l=iV(s,a,n!==void 0?{reduceMotion:n,...h}:h,t)}const u=new xce(l);return c&&u.finished.then(c),t&&(t.animations.push(u),u.finished.then(()=>{Id(t.animations,u)})),u}return r}const Tfe=Pfe(),Ofe={some:0,all:1};function Rfe(e,t,{root:n,margin:r,amount:s="some"}={}){const a=p0(e),o=new WeakMap,l=u=>{u.forEach(d=>{const h=o.get(d.target);if(d.isIntersecting!==!!h)if(d.isIntersecting){const f=t(d.target,d);typeof f=="function"?o.set(d.target,f):c.unobserve(d.target)}
779else typeof h=="function"&&(h(d),o.delete(d.target))})},c=new IntersectionObserver(l,{root:n,rootMargin:r,threshold:typeof s=="number"?s:Ofe[s]});return a.forEach(u=>c.observe(u)),()=>c.disconnect()}function Mfe(e,{root:t,margin:n,amount:r,once:s=!1,initial:a=!1}={}){const[o,l]=y.useState(a);return y.useEffect(()=>{if(!e.current||s&&o)return;const c=()=>(l(!0),s?void 0:()=>l(!1)),u={root:t&&t.current||void 0,margin:n,amount:r};return Rfe(e.current,c,u)},[t,e,n,s,r]),o}const P2=Xp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-semibold ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 transform hover:scale-[1.02] active:scale-[0.98]",{variants:{variant:{default:"bg-gradient-primary text-primary-foreground hover:opacity-90 shadow-elegant hover:shadow-glow backdrop-blur-sm",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-lg",outline:"border-2 border-primary/50 bg-background/50 text-primary hover:bg-gradient-primary hover:text-primary-foreground backdrop-blur-sm",secondary:"bg-gradient-secondary text-secondary-foreground hover:opacity-90 shadow-purple backdrop-blur-sm",ghost:"hover:bg-accent/20 hover:text-accent-foreground backdrop-blur-sm",link:"text-primary underline-offset-4 hover:underline",success:"bg-gradient-cyber text-success-foreground hover:opacity-90 shadow-lg backdrop-blur-sm",warning:"bg-warning text-warning-foreground hover:bg-warning/90 shadow-lg",premium:"bg-gradient-primary text-primary-foreground shadow-glow hover:shadow-[0_0_50px_hsl(213_100%_68%/0.6)] backdrop-blur-sm border border-primary/20"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),U=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},a)=>{const o=r?Ta:"button";return i.jsx(o,{className:fe(P2({variant:t,size:n,className:e})),ref:a,...s})});U.displayName="Button";const z=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:fe("rounded-xl border border-border/50 bg-card text-card-foreground shadow-sm transition-all duration-300 hover:shadow-md hover:border-border",e),...t}));z.displayName="Card";const re=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:fe("flex flex-col space-y-1.5 p-6",e),...t}));re.displayName="CardHeader";const se=y.forwardRef(({className:e,...t},n)=>i.jsx("h3",{ref:n,className:fe("text-2xl font-semibold leading-none tracking-tight",e),...t}));se.displayName="CardTitle";const _n=y.forwardRef(({className:e,...t},n)=>i.jsx("p",{ref:n,className:fe("text-sm text-muted-foreground",e),...t}));_n.displayName="CardDescription";const V=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:fe("p-6 pt-0",e),...t}));V.displayName="CardContent";const Ife=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{ref:n,className:fe("flex items-center p-6 pt-0",e),...t}));Ife.displayName="CardFooter";const ae=y.forwardRef(({className:e,type:t,...n},r)=>i.jsx("input",{type:t,className:fe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background 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-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));ae.displayName="Input";var $fe="Label",aV=y.forwardRef((e,t)=>i.jsx(ve.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));aV.displayName=$fe;var oV=aV;const Lfe=Xp("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ne=y.forwardRef(({className:e,...t},n)=>i.jsx(oV,{ref:n,className:fe(Lfe(),e),...t}));
779ne.displayName=oV.displayName;function T2({onAuthSuccess:e,defaultUserType:t="farmer",defaultSignUp:n=!1}){const[r,s]=y.useState(t),[a,o]=y.useState(!n),[l,c]=y.useState(""),[u,d]=y.useState(""),[h,f]=y.useState(""),[m,g]=y.useState(!1),{toast:p}=We(),x=()=>{Object.keys(localStorage).forEach(b=>{(b.startsWith("supabase.auth.")||b.includes("sb-"))&&localStorage.removeItem(b)}),Object.keys(sessionStorage||{}).forEach(b=>{(b.startsWith("supabase.auth.")||b.includes("sb-"))&&sessionStorage.removeItem(b)})};y.useEffect(()=>{(async()=>{try{x(),await q.auth.signOut({scope:"global"})}catch{}})();const{data:{subscription:w}}=q.auth.onAuthStateChange((j,S)=>{j==="SIGNED_IN"&&(S!=null&&S.user)&&setTimeout(()=>{var k;const N=((k=S.user.user_metadata)==null?void 0:k.user_type)||"farmer";e(N)},0)});return()=>w.unsubscribe()},[e]);const v=async b=>{b.preventDefault(),g(!0);try{x();try{await q.auth.signOut({scope:"global"})}catch{}if(a){const{error:w}=await q.auth.signInWithPassword({email:l,password:u});if(w)throw w;p({title:"Welcome back!",description:"Successfully signed in."})}else{const{error:w}=await q.auth.signUp({email:l,password:u,options:{data:{display_name:h,user_type:r},emailRedirectTo:`${window.location.origin}/`}});if(w)throw w;p({title:"Account created!",description:"Please check your email to verify your account."})}}catch(w){p({title:"Authentication error",description:w.message,variant:"destructive"})}finally{g(!1)}};return r?i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative overflow-hidden aurora-blobs",children:[i.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-transparent to-secondary/5"}),i.jsx("div",{className:"relative z-10 flex flex-col items-center justify-center min-h-screen space-y-8 p-4",children:i.jsxs("div",{className:"w-full max-w-md",children:[i.jsxs(U,{variant:"ghost",onClick:()=>s(null),className:"mb-6 p-0 h-auto text-muted-foreground hover:text-foreground",children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back to user type selection"]}),i.jsxs(z,{className:"shadow-2xl border-0 bg-background/95 backdrop-blur glass-card",children:[i.jsx(re,{className:"text-center space-y-4",children:i.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[i.jsx("div",{className:`p-3 rounded-xl ${r==="incubator"?"bg-gradient-secondary":"bg-gradient-primary"}`,children:r==="learner"?i.jsx(Oa,{className:"h-6 w-6 text-primary-foreground"}):r==="farmer"?i.jsx(Tm,{className:"h-6 w-6 text-primary-foreground"}):i.jsx(dh,{className:"h-6 w-6 text-primary-foreground"})}),i.jsx("div",{children:i.jsx(se,{className:"text-2xl",children:a?"Sign In":r==="learner"?"Learner Sign Up":r==="incubator"?"Incubator Sign Up":"Farmer Sign Up"})})]})}),i.jsxs(V,{children:[i.jsxs("form",{onSubmit:v,className:"space-y-6",children:[!a&&r!=="incubator"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"I want to"}),i.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{v:"farmer",label:"Run my farm",Icon:Tm},{v:"learner",label:"Just learn",Icon:Oa}].map(({v:b,label:w,Icon:j})=>i.jsxs("button",{type:"button",onClick:()=>s(b),className:`flex items-center justify-center gap-2 rounded-lg border-2 p-3 text-sm font-medium transition-colors ${r===b?"border-primary bg-primary/10 text-foreground":"border-border text-muted-foreground"}`,children:[i.jsx(j,{className:"h-4 w-4"})," ",w]},b))}),r==="learner"&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"No farm needed. You can add your farm later."})]}),!a&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"name",children:"Full Name"}),i.jsx(ae,{id:"name",type:"text",value:h,onChange:b=>f(b.target.value),required:!0,className:"h-12"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"email",children:"Email"}),i.jsx(ae,{id:"email",type:"email",value:l,onChange:b=>c(b.target.value),required:!0,className:"h-12"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"password",children:"Password"}),i.jsx(ae,{id:"password",type:"password",value:u,onChange:b=>d(b.target.value),required:!0,className:"h-12"})]}),i.jsx(U,{type:"submit",className:"w-full h-12",disabled:m,children:m?"Processing...":a?"Sign In":"Create Account"})]}),i.jsx("div",{className:"mt-6 text-center",children:i.jsx(U,{variant:"link",onClick:()=>o(!a),className:"text-sm",children:a?"Don't have an account? Sign up":"Already have an account? Sign in"})})]})]})]})})]}):(s("farmer"),null)}const Dfe="/assets/ctw-win-Dgy_uKMN.png",Ffe="/assets/news-africarena-FQX4qQkD.png",Bfe="/assets/news-mec-gauteng-CjTahDIJ.png",zfe="/assets/news-mybroadband-Cwht96rL.png",Ufe="/assets/news-sabc-agenda-DU8kDnLo.png",Vfe="/assets/news-channel-africa-Din7pMT8.png",Wfe="/assets/news-brics-win-CcJrSQV-.png",my=[{image:Wfe,alt:"Flockify wins BRICS+ Youth Innovation Summit",date:"May 2026",title:"1st Place â BRICS+ Youth Innovation Summit",excerpt:"Awarded 1st Place in Agri-Tech Innovations for Food Security at the BRICS+ Youth Innovation Summit hosted by SABYA.",highlight:"Next stop: Russia â the World Youth Festival."},{image:zfe,alt:"MyBroadband feature on Flockify",date:"April 2026",title:"Featured on MyBroadband",excerpt:"MyBroadband profiled our founder Tshepiso Malema â the gamer and chicken farmer from a township who built an app set to be showcased in China and Russia.",highlight:"From the township to the global stage.",link:"https://mybroadband.co.za/news/software/644334-the-gamer-and-chicken-farmer-from-a-township-known-for-its-crime-who-built-an-app-that-will-be-showcased-in-china-and-russia.html"},{image:Vfe,alt:"Flockify on Channel Africa Radio",date:"April 2026",title:"Live on Channel Africa Radio",excerpt:"Cofounders Tshepiso Malema and Ayanda Chunda joined The Oasis Sunday Edition to share the Flockify journey across the continent.",highlight:"From BRICS+ to SABC⦠now to the continent."},{image:Ufe,alt:"Flockify on SABC News",date:"2026",title:"SABC News â SME on the Agenda",excerpt:"Sharing the Flockify story on SABC News. From losing livestock as a farmer to building a solution now impacting farmers through technology.",highlight:"Transforming agriculture, empowering youth, strengthening food security.",link:"https://youtu.be/auph8LImUy8?si=aRsVUonDVdKisRxX"},{image:Dfe,alt:"Change The World 2025 winners",date:"November 2025",title:"Winners â Change The World 2025",excerpt:"Flockify won Africa's premier social entrepreneurship showcase â a milestone reinfor
779cing what we believe: Africa is ready for bold, youth-led, scalable solutions.",highlight:"This win is just the beginning."},{image:Ffe,alt:"Flockify at AfricArena Grand Summit",date:"2025",title:"AfricArena Grand Summit",excerpt:"Cofounder Ayanda Chunda represented Flockify in Cape Town â connecting with VCs, industry experts, and innovators driving Africa's tech future.",highlight:"Big things are loading."},{image:Bfe,alt:"Flockify with MEC of Agriculture Gauteng",date:"2025",title:"Engaging the MEC of Agriculture",excerpt:"The team spent time with the MEC Mrs. Vuyiswa Ramokgopa at JB Matabane High School â a reminder that agriculture's future starts in classrooms.",highlight:"The future of agriculture is digital and human."}];function Hfe(){const[e,t]=y.useState(0),[n,r]=y.useState(!1),s=my.length,a=y.useCallback(()=>t(u=>(u+1)%s),[s]),o=y.useCallback(()=>t(u=>(u-1+s)%s),[s]);y.useEffect(()=>{if(n)return;const u=setInterval(a,6e3);return()=>clearInterval(u)},[a,n]);const l=my[e],c=String(e+1).padStart(2,"0");return i.jsx("section",{className:"relative py-20 sm:py-32 px-4 sm:px-6",children:i.jsxs("div",{className:"mx-auto max-w-6xl",children:[i.jsxs("div",{className:"mb-10 sm:mb-16 max-w-3xl",children:[i.jsxs(Ln.span,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"inline-flex items-center gap-2 rounded-full border border-black/15 bg-white/60 backdrop-blur px-4 py-1.5 text-xs sm:text-sm text-black/70",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-black"}),"The Flockify journey"]}),i.jsxs(Ln.h2,{initial:{opacity:0,x:-120},whileInView:{opacity:1,x:0},viewport:{once:!0,amount:.4},transition:{duration:.9,delay:.1,ease:[.16,1,.3,1]},className:"mt-5 font-extrabold tracking-tight leading-[0.95] text-[clamp(2.25rem,6vw,4.5rem)] text-black",children:[i.jsx(Ln.span,{initial:{opacity:0,x:-80},whileInView:{opacity:1,x:0},viewport:{once:!0,amount:.4},transition:{duration:.8,delay:.2,ease:[.16,1,.3,1]},className:"inline-block",children:"Stages of our"}),i.jsx("br",{}),i.jsx(Ln.span,{initial:{opacity:0,x:120},whileInView:{opacity:1,x:0},viewport:{once:!0,amount:.4},transition:{duration:.9,delay:.4,ease:[.16,1,.3,1]},className:"italic font-serif inline-block",children:"growth story."})]})]}),i.jsxs("div",{className:"relative",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[i.jsx("div",{className:"relative rounded-3xl overflow-hidden border border-black/10 shadow-[0_30px_80px_-30px_rgba(0,0,0,0.4)]",style:{background:"linear-gradient(135deg, #FFFFFF 0%, #FFF6D6 50%, #F5CE2A 100%)"},children:i.jsx(Mde,{mode:"wait",children:i.jsxs(Ln.div,{initial:{opacity:0,x:40},animate:{opacity:1,x:0},exit:{opacity:0,x:-40},transition:{duration:.6,ease:[.16,1,.3,1]},className:"grid grid-cols-1 md:grid-cols-12",children:[i.jsx("div",{className:"md:col-span-5 bg-black/5",children:i.jsx("div",{className:"relative w-full aspect-[4/3] sm:aspect-[16/10] md:aspect-auto md:h-full md:min-h-[420px] flex items-center justify-center p-4 sm:p-6",children:i.jsx("img",{src:l.image,alt:l.alt,loading:"lazy",className:"max-w-full max-h-full w-auto h-auto object-contain rounded-xl"})})}),i.jsxs("div",{className:"md:col-span-7 p-6 sm:p-10 lg:p-12 flex flex-col justify-center",children:[i.jsxs("div",{className:"flex items-center gap-4 mb-5",children:[i.jsx("span",{className:"font-extrabold leading-none text-black/90",style:{fontSize:"clamp(2.5rem, 5vw, 4.25rem)",letterSpacing:"-0.04em"},children:c}),i.jsx("span",{className:"h-px flex-1 bg-black/15"}),i.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] text-black/55 font-semibold",children:l.date})]}),i.jsx("h3",{className:"text-xl sm:text-2xl lg:text-[2rem] font-extrabold tracking-tight leading-[1.1] text-black",children:l.title}),i.jsx("p",{className:"mt-4 text-sm sm:text-base text-black/75 leading-relaxed",children:l.excerpt}),i.jsx("p",{className:"mt-4 text-sm sm:text-base font-semibold text-black",children:l.highlight}),l.link&&i.jsxs("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",className:"mt-5 inline-flex items-center gap-1.5 text-sm font-semibold text-black border-b border-black/40 hover:border-black transition-colors w-fit",children:["Read the article",i.jsx("span",{"aria-hidden":!0,
779children:"â"})]})]})]},e)})}),i.jsxs("div",{className:"mt-6 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:o,"aria-label":"Previous slide",className:"h-11 w-11 rounded-full bg-black text-white flex items-center justify-center hover:bg-black/85 transition-colors",children:i.jsx(dB,{className:"h-5 w-5"})}),i.jsx("button",{onClick:a,"aria-label":"Next slide",className:"h-11 w-11 rounded-full bg-black text-white flex items-center justify-center hover:bg-black/85 transition-colors",children:i.jsx(Qs,{className:"h-5 w-5"})})]}),i.jsxs("span",{className:"text-xs sm:text-sm font-semibold text-black/60 tabular-nums",children:[c," ",i.jsxs("span",{className:"text-black/30",children:["/ ",String(s).padStart(2,"0")]})]}),i.jsx("div",{className:"hidden sm:flex items-center gap-1.5",children:my.map((u,d)=>i.jsx("button",{onClick:()=>t(d),"aria-label":`Go to slide ${d+1}`,className:`h-1.5 rounded-full transition-all ${d===e?"w-8 bg-black":"w-3 bg-black/25 hover:bg-black/50"}`},d))})]}),i.jsx("div",{className:"sm:hidden mt-4 flex items-center justify-center gap-1.5",children:my.map((u,d)=>i.jsx("button",{onClick:()=>t(d),"aria-label":`Go to slide ${d+1}`,className:`h-1.5 rounded-full transition-all ${d===e?"w-6 bg-black":"w-2 bg-black/25"}`},d))})]})]})})}const qfe="/assets/logo-innovation-hub-CAlsxJTH.png",Kfe="/assets/logo-ctw-COiB2a5E.png",Gfe="/assets/logo-sizoba-CicH75lJ.png",Yfe="/assets/logo-gauteng-CG842a9H.png",Ui="/assets/flockify-logo-new-C2IDg8ge.png",bv="#F5CE2A";function Xfe({onAuthSuccess:e}){const[t,n]=y.useState(!1),r=Ki();if(t)return i.jsx(T2,{onAuthSuccess:e});const s=[{label:"Platform",route:"/smart-analytics"},{label:"Health AI",route:"/ai-health-monitoring"},{label:"Marketplace",route:"/market-access"},{label:"Training",route:"/skills-training"},{label:"Pricing",route:"/pricing"}];return i.jsxs(i.Fragment,{children:[i.jsx(u0,{title:"Flockify â Smart Livestock Farming for South Africa",description:"AI-powered livestock farm management for South African farmers. Track flocks, scan bird health with AI, access the marketplace and grow your farm.",path:"/"}),i.jsxs("div",{className:"min-h-screen text-black selection:bg-black selection:text-[#F5CE2A] overflow-x-hidden",style:{background:"linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 60%, #FFF6D6 80%, #FDEBA0 100%)"},children:[i.jsx(Ln.header,{initial:{y:-40,opacity:0},animate:{y:0,opacity:1},transition:{duration:.7,ease:[.16,1,.3,1]},className:"fixed top-3 sm:top-5 inset-x-0 z-50 px-3",children:i.jsxs("div",{className:"mx-auto max-w-5xl flex items-center justify-between gap-3 rounded-full border border-black/10 bg-white/85 backdrop-blur-xl pl-3 pr-2 py-2 shadow-[0_10px_40px_-10px_rgba(0,0,0,0.18)]",children:[i.jsx("button",{onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),className:"flex items-center gap-2 pl-1","aria-label":"Flockify home",children:i.jsx("img",{src:Ui,alt:"Flockify",className:"h-7 sm:h-8 w-auto"})}),i.jsx("nav",{className:"hidden lg:flex items-center gap-1",children:s.map(a=>i.jsx("button",{onClick:()=>r(a.route),className:"px-3 py-1.5 rounded-full text-sm text-black/70 hover:text-black hover:bg-black/5 transition-colors",children:a.label},a.label))}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(U,{variant:"outline",onClick:()=>r("/learning"),className:"rounded-full font-semibold h-9 px-4",children:"Learn"}),i.jsx(U,{onClick:()=>n(!0),className:"rounded-full font-semibold text-black hover:opacity-90 px-4 sm:px-5 h-9",style:{backgroundColor:bv},children:"Sign in"})]})]})}),i.jsx(Jfe,{onSignIn:()=>n(!0),onPricing:()=>r("/pricing")}),i.jsxs("section",{className:"relative py-12 overflow-hidden",children:[i.jsx("div",{"aria-hidden":!0,className:"absolute inset-x-6 top-0 h-px",style:{background:"linear-gradient(90deg, transparent, rgba(0,0,0,0.15), transparent)"}}),i.jsx("p",{className:"text-center text-[11px] uppercase tracking-[0.25em] text-black/50 mb-6 px-4",children:"Backed by leading partners"}),i.jsx(Qfe,{items:[{src:qfe,alt:"The Innovation Hub",url:"https://www.theinnovationhub.com/"},{src:Kfe,alt:"Change The World",url:"https://ctw-event.co.za/"},{src:Gfe,alt:"Sizoba",url:"https://www.sizoba.com/"},{src:Yfe,alt:"Gauteng Province Agriculture",url:"https://www.gauteng.gov.za/agriculture/Pages/index.aspx"}]})]}),i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsx("div",{className:"mx-auto max-w-6xl grid grid-cols-2 md:grid-cols-4 gap-6 sm:gap-8",children:[{n:800,suffix:"+",l:"Farmers onboarded"},{n:30,suffix:"%",l:"Productivity uplift"},{n:12,suffix:"k+",l:"Health scans"},{n:9,suffix:"",l:"Provinces reached"}].map((a,o)=>i.jsx(Zfe,{value:a.n,suffix:a.suffix,label:a.l,delay:o*.08},a.l))})}),i.jsx(eme,{navigate:r}),i.jsx(Hfe,{}),i.jsx("section",{className:"py-24 sm:py-32 px-4",children:i.jsxs("div",{className:"mx-auto max-w-4xl",children:[i.jsxs(fk,{className:"text-center",children:[i.jsx("span",{className:"text-xs uppercase tracking-[0.25em] text-black/50",children:"Why Flockify exists"}),i.jsxs("h2",{className:"mt-3 text-4xl sm:text-5xl font-extrabold tracking-tight leading-[1.05] text-black",children:["Born from real losses.",i.jsx("br",{}),"Built to ",i.jsx("span",{className:"italic font-serif",children:"prevent yours"}),"."]})]}),i.jsxs(Ln.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-100px"},transition:{duration:.8,ease:[.16,1,.3,1]},className:"mt-12 rounded-3xl bg-white text-black p-8 sm:p-12 border border-black/10 shadow-[0_30px_60px_-2
7790px_rgba(0,0,0,0.18)]",children:[i.jsx("div",{className:"h-1 w-16 mb-6",style:{backgroundColor:bv}}),i.jsx("p",{className:"text-lg sm:text-xl text-black/85 leading-relaxed",children:'"Flockify was founded after I lost over R50,000 in a single season to disease, compliance gaps, and a complete lack of accessible support. Every feature is shaped by real challenges I faced â and the solutions I wished existed."'}),i.jsx("p",{className:"mt-6 text-sm font-semibold text-black/55",children:"â Tshepiso Malema, Founder"})]})]})}),i.jsx("section",{className:"py-24 sm:py-32 px-4",children:i.jsxs("div",{className:"mx-auto max-w-5xl text-center",children:[i.jsx(fk,{children:i.jsxs("h2",{className:"font-extrabold tracking-tight leading-[0.9] text-[clamp(2.5rem,9vw,7rem)] text-black",children:["Ready to grow",i.jsx("br",{}),"your ",i.jsx("span",{className:"italic font-serif",children:"flock"}),"?"]})}),i.jsx(Ln.div,{initial:{opacity:0,scale:.9},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{duration:.6,delay:.2},children:i.jsxs(U,{size:"lg",onClick:()=>n(!0),className:"mt-10 rounded-full font-semibold bg-black text-white hover:bg-black/85 h-14 px-8 text-base shadow-[0_10px_30px_-8px_rgba(0,0,0,0.5)]",children:["Get started free",i.jsx(ya,{className:"ml-1 h-5 w-5"})]})})]})}),i.jsx("footer",{className:"bg-white text-black px-4 py-14 border-t border-black/10",children:i.jsxs("div",{className:"mx-auto max-w-6xl",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-10",children:[i.jsxs("div",{children:[i.jsx("img",{src:Ui,alt:"Flockify",className:"h-8 w-auto mb-4"}),i.jsx("p",{className:"text-sm text-black/60",children:"Empowering African farmers with AI, data, and expertise to build profitable livestock businesses."}),i.jsx("p",{className:"text-xs text-black/40 mt-3",children:"Operated by Tech4Africa Group."})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold mb-4 uppercase tracking-[0.2em] text-black/55",children:"Product"}),i.jsxs("ul",{className:"space-y-2 text-sm text-black/70",children:[i.jsx("li",{children:i.jsx(Ke,{to:"/pricing",className:"hover:text-black",children:"Pricing"})}),i.jsx("li",{children:i.jsx(Ke,{to:"/metrics",className:"hover:text-black",children:"Platform metrics"})}),i.jsx("li",{children:i.jsx(Ke,{to:"/help",className:"hover:text-black",children:"Help center"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold mb-4 uppercase tracking-[0.2em] text-black/55",children:"Legal"}),i.jsxs("ul",{className:"space-y-2 text-sm text-black/70",children:[i.jsx("li",{children:i.jsx(Ke,{to:"/legal/terms",className:"hover:text-black",children:"Terms & Conditions"})}),i.jsx("li",{children:i.jsx(Ke,{to:"/legal/privacy",className:"hover:text-black",children:"Privacy Notice"})}),i.jsx("li",{children:i.jsx(Ke,{to:"/legal/refund",className:"hover:text-black",children:"Refund Policy"})})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold mb-4 uppercase tracking-[0.2em] text-black/55",children:"Contact"}),i.jsxs("div",{className:"space-y-3 text-sm text-black/70",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(ri,{className:"h-4 w-4 text-black"}),i.jsx("span",{children:"068 474 5436"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Ua,{className:"h-4 w-4 text-black"}),i.jsx("span",{children:"[email protected]"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(ts,{className:"h-4 w-4 text-black"}),i.jsx("span",{children:"Sandton, South Africa"})]})]})]})]}),i.jsx("div",{className:"border-t border-black/10 mt-12 pt-6 text-center text-xs text-black/40",children:i.jsx("p",{children:"© 2025 Tech4Africa Group, trading as Flockify. All rights reserved."})})]})})]})]})}function Jfe({onSignIn:e,onPricing:t}){const n=y.useRef(null),{scrollYProgress:r}=cfe({target:n,offset:["start start","end start"]}),s=em(r,[0,1],[0,-120]),a=em(r,[0,1],[1,.92]),o=em(r,[0,.8],[1,0]),l=vv(0),c=vv(0);nI(l,{stiffness:60,damping:18,mass:.6}),nI(c,{stiffness:60,damping:18,mass:.6});const u=f=>{var x;const m=(x=n.current)==null?void 0:x.getBoundingClientRect();if(!m)return;const g=(f.clientX-m.left-m.width/2)/m.width,p=(f.clientY-m.top-m.height/2)/m.height;l.set(g),c.set(p)},d=["Smart","livestock","farming,","made"],h=["brilliantly","simple."];return i.jsxs("section",{ref:n,onMouseMove:u,className:"relative overflow-hidden pt-32 sm:pt-40 pb-20 sm:pb-32 px-4",children:[i.jsx("div",{"aria-hidden":!0,
779className:"pointer-events-none absolute inset-x-0 top-0 h-[700px]",style:{background:"radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255,255,255,0.55), rgba(255,255,255,0) 60%)"}}),i.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 opacity-[0.07]",style:{backgroundImage:"linear-gradient(to right, #000 1px, transparent 1px), linear-gradient(to bottom, #000 1px, transparent 1px)",backgroundSize:"56px 56px",maskImage:"radial-gradient(ellipse 60% 60% at 50% 30%, #000 30%, transparent 75%)"}}),i.jsx("div",{className:"relative mx-auto max-w-6xl",children:i.jsxs(Ln.div,{style:{y:s,scale:a,opacity:o},className:"relative z-10 text-center max-w-4xl mx-auto",children:[i.jsxs("h1",{className:"mt-6 sm:mt-8 font-extrabold tracking-tight leading-[0.92] text-[clamp(2.75rem,9vw,8rem)]",style:{color:bv,textShadow:"0 2px 24px rgba(0,0,0,0.08)"},children:[i.jsx(aI,{words:d,delay:.2}),i.jsx("br",{}),i.jsx(aI,{words:h,delay:.6,italic:!0})]}),i.jsx(Ln.p,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,delay:1},className:"mt-6 sm:mt-8 text-base sm:text-lg text-black/70 max-w-xl mx-auto leading-relaxed",children:"AI health scanning, daily logging, market access, and expert guidance â everything a small-scale farmer needs in one place."}),i.jsxs(Ln.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:1.15},className:"mt-8 sm:mt-10 flex items-center justify-center gap-3 flex-wrap",children:[i.jsxs(U,{size:"lg",onClick:e,className:"rounded-full font-semibold bg-black text-white hover:bg-black/85 h-12 px-7 group shadow-[0_10px_30px_-8px_rgba(0,0,0,0.5)]",children:["Get started free",i.jsx(ya,{className:"ml-1 h-4 w-4 group-hover:translate-x-1 transition-transform"})]}),i.jsx(U,{size:"lg",variant:"ghost",onClick:t,className:"rounded-full h-12 px-6 text-black hover:bg-black/10 hover:text-black border border-black/15",children:"See pricing"})]}),i.jsx(Ln.p,{initial:{opacity:0}
779,animate:{opacity:1},transition:{duration:1,delay:1.4},className:"mt-6 text-xs text-black/50",children:"Trusted by 800+ farmers across South Africa"})]})})]})}function aI({words:e,delay:t=0,italic:n=!1}){return i.jsx("span",{className:"inline-flex flex-wrap justify-center gap-x-[0.25em] overflow-hidden",children:e.map((r,s)=>i.jsx("span",{className:"inline-block overflow-hidden align-bottom",children:i.jsx(Ln.span,{initial:{y:"110%"},animate:{y:"0%"},transition:{duration:.8,delay:t+s*.08,ease:[.16,1,.3,1]},className:`inline-block ${n?"italic font-serif":""}`,children:r})},s))})}function Qfe({items:e}){const t=[...e,...e,...e];return i.jsx("div",{className:"relative",children:i.jsx(Ln.div,{className:"flex gap-14 sm:gap-20 items-center w-max",animate:{x:["0%","-33.333%"]},transition:{duration:30,repeat:1/0,ease:"linear"},children:t.map((n,r)=>i.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"shrink-0",children:i.jsx("img",{src:n.src,alt:n.alt,className:"h-9 sm:h-11 w-auto object-contain opacity-60 hover:opacity-100 transition-opacity grayscale hover:grayscale-0"})},r))})})}function Zfe({value:e,suffix:t,label:n,delay:r}){const s=y.useRef(null),a=Mfe(s,{once:!0,margin:"-50px"}),[o,l]=y.useState(0);return y.useEffect(()=>{if(!a)return;const c=Tfe(0,e,{duration:1.4,delay:r,ease:[.16,1,.3,1],onUpdate:u=>l(Math.round(u))});return()=>c.stop()},[a,e,r]),i.jsxs(Ln.div,{ref:s,initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:r},className:"text-center",children:[i.jsxs("div",{className:"text-5xl sm:text-7xl font-extrabold tracking-tight text-black tabular-nums",children:[o,t]}),i.jsx("div",{className:"mt-2 text-sm text-black/60",children:n})]})}function fk({children:e,className:t=""}){return i.jsx(Ln.div,{initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.8,ease:[.16,1,.3,1]},className:t,children:e})}function eme({navigate:e}){const t=[{icon:Xr,title:"Smart Analytics",desc:"Track flock performance with daily logs and actionable insights.",route:"/smart-analytics"},{icon:Zs,title:"AI Health Monitoring",desc:"Snap a photo, detect disease, get treatment guidance instantly.",route:"/ai-health-monitoring"},{icon:Cd,title:"Market Access",desc:"Connect to buyers across South Africa with fair pricing.",route:"/market-access"},{icon:Oa,title:"Skills Training",desc:"Learn modern farming, business, and digital skills at your pace.",route:"/skills-training"},{icon:ht,title:"Mentorship",desc:"Get matched with experienced farmers and industry experts.",route:"/mentorship-support"},{icon:Wt,title:"Business Growth",desc:"Funding paths, market connections, and scaling resources.",route:"/business-development"}];return i.jsx("section",{className:"py-20 sm:py-28 px-4",children:i.jsxs("div",{className:"mx-auto max-w-6xl",children:[i.jsxs(fk,{className:"max-w-2xl mb-14",children:[i.jsx("span",{className:"text-xs uppercase tracking-[0.25em] text-black/50",children:"What you get"}),i.jsxs("h2",{className:"mt-3 text-4xl sm:text-5xl font-extrabold tracking-tight leading-[1.05] text-black",children:["Everything to run a modern ",i.jsx("span",{className:"italic font-serif",children:"livestock"})," farm."]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:t.map((n,r)=>i.jsxs(Ln.button,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{duration:.7,delay:r%3*.08,ease:[.16,1,.3,1]},whileHover:{y:-6},onClick:()=>e(n.route),className:"group text-left rounded-3xl bg-white text-black p-7 border border-black/10 shadow-[0_10px_30px_-15px_rgba(0,0,0,0.18)] hover:shadow-[0_20px_40px_-15px_rgba(0,0,0,0.25)] transition-shadow",children:[i.jsxs("div",{className:"flex items-start justify-between mb-10",children:[i.jsx("span",{className:"text-xs text-black/40 font-mono",children:String(r+1).padStart(2,"0")}),i.jsx(EZ,{className:"h-5 w-5 text-black/40 group-hover:text-black group-hover:rotate-12 transition-all"})]}),i.jsx("div",{className:"w-11 h-11 rounded-xl flex items-center justify-center mb-5",style:{backgroundColor:bv},children:i.jsx(n.icon,{className:"h-5 w-5 text-black"})}),i.jsx("h3",{className:"text-xl font-bold mb-2",children:n.title}),i.jsx("p",{className:"text-sm text-black/65 leading-relaxed",children:n.desc})]},n.title))})]})})}const b0=[{value:"cape-town",label:"Cape Town, Western Cape"},{value:"stellenbosch",label:"Stellenbosch, Western Cape"},{value:"george",label:"George, Western Cape"},{value:"hermanus",label:"Hermanus, Western Cape"},{value:"worcester",label:"Worcester, Western Cape"},{value:"johannesburg",label:"Johannesburg, Gauteng"},{value:"pretoria",label:"Pretoria, Gauteng"},{value:"sandton",label:"Sandton, Gauteng"},{value:"midrand",label:"Midrand, Gauteng"},{value:"soweto",label:"Soweto, Gauteng"},{value:"alexandra",label:"Alexandra, Gauteng"},{value:"centurion",label:"Centurion, Gauteng"},{value:"benoni",label:"Benoni, Gauteng"},{value:"germiston",label:"Germiston, Gauteng"},{value:"durban",label:"Durban, KwaZulu-Natal"},{value:"pietermaritzburg",label:"Pietermaritzburg, KwaZulu-Natal"},{value:"richards-bay",label:"Richards Bay, KwaZulu-Natal"},{value:"newcastle",label:"Newcastle, KwaZulu-Natal"},{value:"ladysmith",label:"Ladysmith, KwaZulu-Natal"},{value:"port-elizabeth",label:"Port Elizabeth, Eastern Cape"},{value:"east-london",label:"East London, Eastern Cape"},{value:"grahamstown",label:"Grahamstown, Eastern Cape"},{value:"uitenhage",label:"Uitenhage, Eastern Cape"},{value:"polokwane",label:"Polokwane, Limpopo"},{value:"tzaneen",label:"Tzaneen, Limpopo"},{value:"thohoyandou",label:"Thohoyandou, Limpopo"},{value:"musina",label:"Musina, Limpopo"},{value:"nelspruit",label:"Nelspruit, Mpumalanga"},{value:"witbank",label:"Witbank, Mpumalanga"},{value:"middelburg",label:"Middelburg, Mpumalanga"},{value:"barberton",label:"Barberton, Mpumalanga"},{value:"rustenburg",label:"Rustenburg, North West"},{value:"mahikeng",label:"Mahikeng, North West"},{value:"potchefstroom",label:"Potchefstroom, North West"},{value:"klerksdorp",label:"Klerksdorp, North West"},{value:"bloemfontein",label:"Bloemfontein, Free State"},{value:"welkom",label:"Welkom, Free State"},{value:"kroonstad",label:"Kroonstad, Free State"},{value:"bethlehem",label:"Bethlehem, Free State"},{value:"kimberley",label:"Kimberley, Northern Cape"},{value:"upington",label:"Upington, Northern Cape"},{value:"kuruman",label:"Kuruman, Northern Cape"},{value:"springbok",label:"Springbok, Northern Cape"}],tme=e=>{var t;return((t=b0.find(n=>n.value===e))==null?void 0:t.label)||e},oI=[{id:"poultry",title:"Poultry",description:"Broilers, layers, mi
779xed flocks",icon:Ho,color:"bg-gradient-to-br from-orange-500 to-red-500"},{id:"crops",title:"Crops",description:"Vegetables, grains, orchards (Cropify coming soon)",icon:SE,color:"bg-gradient-to-br from-green-500 to-emerald-500"},{id:"mixed",title:"Mixed Farming",description:"Livestock and crops",icon:VZ,color:"bg-gradient-to-br from-amber-500 to-yellow-500"}],nme=[{id:"Disease",icon:see},{id:"Feed Costs",icon:Sc},{id:"Mortality",icon:HZ},{id:"Productivity",icon:Xr},{id:"Market Access",icon:mo},{id:"Weather",icon:FZ}],lI=[{id:"Eggs",icon:yE,breeds:["Lohmann Brown","Hyline Brown","Potchefstroom Koekoek","Boschveld"]},{id:"Meat",icon:zZ,breeds:["Ross 308","Cobb 500","Indigenous (Venda)","Naked Neck"]},{id:"Dual-purpose",icon:GZ,breeds:["Boschveld","Potchefstroom Koekoek","Ovambo"]},{id:"Breeding stock",icon:Ho,breeds:["Boschveld","Koekoek","Indigenous"]}],rme=[{id:"Free-range",icon:uee,hint:"Birds roam outdoors"},{id:"Deep litter",icon:fee,hint:"Barn with bedding"},{id:"Battery cages",icon:PZ,hint:"Tiered cage system"},{id:"Chicken tractor",icon:_B,hint:"Mobile coop"},{id:"Backyard / kraal",icon:xE,hint:"Small home setup"}];function sme({onComplete:e}){var D;const[t,n]=y.useState(0),[r,s]=y.useState(""),[a,o]=y.useState(""),[l,c]=y.useState(""),[u,d]=y.useState(""),[h,f]=y.useState(""),[m,g]=y.useState(""),[p,x]=y.useState(""),[v,b]=y.useState(""),[w,j]=y.useState(""),[S,N]=y.useState(!1),k=4,_=(t+1)/k*100,C=l==="poultry"||l==="mixed",A=r.trim()&&a&&l&&h,E=C?!!(m&&(p||v.trim())&&w):!0,P=lI.find(I=>I.id===m),$=p==="__other"?v.trim():p,R=t===0?"Welcome":t===1?"Tell us about your farm":t===2?"Breed & housing":"Almost ready",L=async()=>{N(!0),await e({farmingType:l,language:"en",farmName:r.trim()||void 0,location:a||void 0,flockSize:u?Number(u):void 0,primaryChallenge:h||void 0,breed:$||void 0,productionGoal:m||void 0,housingSystem:w||void 0})};return i.jsx("div",{className:"min-h-screen bg-gradient-bg aurora-blobs relative overflow-hidden p-4",children:i.jsxs("div",{className:"max-w-md mx-auto pt-8 pb-12 space-y-6 relative z-10",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[i.jsxs("span",{className:"font-medium",children:["Step ",t+1," of ",k]}),i.jsx("span",{children:R})]}),i.jsx("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-primary to-secondary transition-all duration-500",style:{width:`${_}%`}})})]}),t===0&&i.jsxs("div",{className:"space-y-6 animate-fade-in text-center",children:[i.jsx("div",{className:"mx-auto w-24 h-24 rounded-3xl bg-white flex items-center justify-center shadow-glow p-3",children:i.jsx("img",{src:"/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png",alt:"Flockify logo",className:"w-full h-full object-contain"})}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h1",{className:"text-3xl font-bold leading-tight",children:"Welcome to Flockify"}),i.jsx("p",{className:"text-muted-foreground text-base leading-relaxed",children:"Your AI-powered farming assistant for healthier flocks and smarter farming decisions."})]}),i.jsx(z,{className:"text-left",children:i.jsxs(V,{className:"p-4 space-y-2 text-sm",children:[i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx($r,{className:"h-4 w-4 text-success"})," Instant AI health scans for your birds"]}),i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx($r,{className:"h-4 w-4 text-success"})," Daily recommendations tailored to you"]}),i.jsxs("p",{className:"flex items-center gap-2",children:[i.jsx($r,{className:"h-4 w-4 text-success"})," Track feed, mortality, and productivity"]})]})}),i.jsxs(U,{onClick:()=>n(1),size:"lg",className:"w-full",children:["Set Up My Farm ",i.jsx(Qs,{className:"ml-2 h-4 w-4"})]})]}),t===1&&i.jsxs("div",{className:"space-y-5 animate-fade-in",children:[i.jsxs("div",{className:"text-center space-y-1",children:[i.jsx("h2",{className:"text-2xl font-bold",children:"Tell us about your farm"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:"Qu
779ick taps â we'll personalize the rest."})]}),i.jsx(z,{children:i.jsxs(V,{className:"p-4 space-y-2",children:[i.jsx("label",{className:"text-sm font-medium",children:"Farm Name"}),i.jsx(ae,{value:r,onChange:I=>s(I.target.value),placeholder:"e.g., Sunrise Poultry",autoFocus:!0})]})}),i.jsx(z,{children:i.jsxs(V,{className:"p-4 space-y-2",children:[i.jsxs("label",{className:"text-sm font-medium flex items-center gap-2",children:[i.jsx(ts,{className:"h-4 w-4 text-primary"})," Location"]}),i.jsxs("select",{value:a,onChange:I=>o(I.target.value),className:"w-full px-3 py-2.5 rounded-md border bg-background text-sm focus:ring-2 focus:ring-primary focus:outline-none",children:[i.jsx("option",{value:"",children:"Select your area"}),b0.map(I=>i.jsx("option",{value:I.label,children:I.label},I.value))]})]})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-medium px-1",children:"Farming Type"}),i.jsx("div",{className:"grid grid-cols-1 gap-2",children:oI.map(I=>{const M=l===I.id;return i.jsx(z,{onClick:()=>c(I.id),className:`cursor-pointer transition-all ${M?"ring-2 ring-primary":"hover:shadow-md"}`,children:i.jsxs(V,{className:"p-3 flex items-center gap-3",children:[i.jsx("div",{className:`${I.color} p-2.5 rounded-xl`,children:i.jsx(I.icon,{className:"h-5 w-5 text-white"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-semibold text-sm",children:I.title}),i.jsx("p",{className:"text-xs text-muted-foreground",children:I.description})]}),M&&i.jsx($r,{className:"h-4 w-4 text-primary"})]})},I.id)})})]}),i.jsx(z,{children:i.jsxs(V,{className:"p-4 space-y-2",children:[i.jsx("label",{className:"text-sm font-medium",children:"Number of chickens / farm size"}),i.jsx(ae,{type:"number",inputMode:"numeric",value:u,onChange:I=>d(I.target.value),placeholder:"Optional"})]})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-medium px-1",children:"Biggest current challenge"}),i.jsx("div",{className:"grid grid-cols-2 gap-2",children:nme.map(I=>{const M=h===I.id;return i.jsxs("button",{type:"button",onClick:()=>f(I.id),className:`flex items-center gap-2 p-3 rounded-xl border text-sm font-medium transition-all touch-manipulation active:scale-95 ${M?"border-primary bg-primary/10 text-primary":"border-border hover:border-primary/40 bg-card"}`,children:[i.jsx(I.icon,{className:"h-4 w-4"}),i.jsx("span",{className:"truncate",children:I.id})]},I.id)})})]}),i.jsxs("div",{className:"flex gap-3 pt-2",children:[i.jsx(U,{variant:"outline",onClick:()=>n(0),className:"flex-1",children:"Back"}),i.jsxs(U,{onClick:()=>n(C?2:3),disabled:!A,className:"flex-1",children:["Continue ",i.jsx(Qs,{className:"ml-1 h-4 w-4"})]})]})]}),t===2&&C&&i.jsxs("div",{className:"space-y-5 animate-fade-in",children:[i.jsxs("div",{className:"text-center space-y-1",children:[i.jsx("h2",{className:"text-2xl font-bold",children:"Breed & housing"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:"This unlocks feed, vaccination, and stocking advice tailored to your setup."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-medium px-1",children:"What are you producing?"}),i.jsx("div",{className:"grid grid-cols-2 gap-2",children:lI.map(I=>{const M=m===I.id;return i.jsxs("button",{type:"button",onClick:()=>{g(I.id),x(""),b("")},className:`flex items-center gap-2 p-3 rounded-xl border text-sm font-medium transition-all active:scale-95 ${M?"border-primary bg-primary/10 text-primary":"border-border hover:border-primary/40 bg-card"}`,children:[i.jsx(I.icon,{className:"h-4 w-4"}),i.jsx("span",{className:"truncate",children:I.id})]},I.id)})})]}),P&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-medium px-1",children:"Breed"}),i.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[P.breeds.map(I=>{const M=p===I;return i.jsxs("button",{type:"button",onClick:()=>{x(I),b("")},className:`flex items-center justify-between p-3 rounded-xl border text-sm font-medium transition-all active:scale-95 ${M?"border-primary bg-primary/10 text-primary":"border-border hover:border-primary/40 bg-card"}`,children:[i.jsx("span",{children:I}),M&&i.jsx($r,{className:"h-4 w-4"})]},I)}),i.jsxs("button",{type:"button",onClick:()=>x("__other"),className:`flex items-center justify-between p-3 rounded-xl border text-sm font-medium transition-all active:scale-95 ${p==="__other"?"border-primary bg-primary/10 text-primary":"border-border hover:border-primary/40 bg-card"}`,children:[i.jsx("span",{children:"Other breed"}),p==="__other"&&i.jsx($r,{className:"h-4 w-4"})]}
779),p==="__other"&&i.jsx(ae,{value:v,onChange:I=>b(I.target.value),placeholder:"Type your breed"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-medium px-1",children:"Housing system"}),i.jsx("div",{className:"grid grid-cols-1 gap-2",children:rme.map(I=>{const M=w===I.id;return i.jsx(z,{onClick:()=>j(I.id),className:`cursor-pointer transition-all ${M?"ring-2 ring-primary":"hover:shadow-md"}`,children:i.jsxs(V,{className:"p-3 flex items-center gap-3",children:[i.jsx("div",{className:"bg-primary/10 p-2 rounded-xl",children:i.jsx(I.icon,{className:"h-4 w-4 text-primary"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-semibold text-sm",children:I.id}),i.jsx("p",{className:"text-xs text-muted-foreground",children:I.hint})]}),M&&i.jsx($r,{className:"h-4 w-4 text-primary"})]})},I.id)})})]}),i.jsxs("div",{className:"flex gap-3 pt-2",children:[i.jsx(U,{variant:"outline",onClick:()=>n(1),className:"flex-1",children:"Back"}),i.jsxs(U,{onClick:()=>n(3),disabled:!E,className:"flex-1",children:["Continue ",i.jsx(Qs,{className:"ml-1 h-4 w-4"})]})]})]}),t===3&&i.jsxs("div",{className:"space-y-5 animate-fade-in text-center",children:[i.jsx("div",{className:"mx-auto w-16 h-16 rounded-2xl bg-primary/10 flex items-center justify-center",children:i.jsx($r,{className:"h-8 w-8 text-primary"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h2",{className:"text-2xl font-bold",children:"We're ready to brief you"}),i.jsx("p",{className:"text-muted-foreground text-sm",children:"Flockify will generate a personalized starting brief: a farm health score, recommendations, and a risk alert based on your area's conditions."})]}),i.jsx(z,{className:"text-left",children:i.jsxs(V,{className:"p-4 space-y-1 text-sm",children:[i.jsxs("p",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Farm:"})," ",r]}),i.jsxs("p",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Location:"})," ",a]}),i.jsxs("p",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Type:"})," ",(D=oI.find(I=>I.id===l))==null?void 0:D.title]}),u&&i.jsxs("p",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Size:"})," ",u]}),m&&i.jsxs("p",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Producing:"})," ",m]}),$&&i.jsxs("p",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Breed:"})," ",$]}),w&&i.jsxs("p",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Housing:"})," ",w]}),i.jsxs("p",{children:[i.jsx("span",{className:"text-muted-foreground",children:"Focus:"})," ",h]})]})}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(U,{variant:"outline",onClick:()=>n(C?2:1),className:"flex-1",disabled:S,children:"Back"}),i.jsx(U,{onClick:L,className:"flex-1",disabled:S,children:S?"Generatingâ¦":"Generate My Brief"})]})]})]})})}function ime({brief:e,loading:t,farmName:n,onScan:r,onDashboard:s}){return i.jsx("div",{className:"min-h-screen bg-gradient-bg aurora-blobs relative overflow-hidden p-4",children:i.jsxs("div",{className:"max-w-md mx-auto pt-8 pb-12 space-y-5 relative z-10",children:[i.jsxs("div",{className:"text-center space-y-2 animate-fade-in",children:[i.jsx("div",{className:"inline-flex items-center px-3 py-1 rounded-full bg-primary/10 text-primary text-xs font-medium",children:"Your Farm Brief"}),i.jsx("h2",{className:"text-2xl font-bold",children:n?`${n}, here's your starting brief`:"Here's your starting brief"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Personalized insights based on your farm and current conditions."})]}),t||!e?i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-8 flex flex-col items-center gap-3 text-center",children:[i.jsx(Jr,{className:"h-6 w-6 animate-spin text-primary"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Analyzing your farmâ¦"})]})}):i.jsxs(i.Fragment,{children:[i.jsx(z,{className:"glass-card overflow-hidden animate-scale-in",children:i.jsx(V,{className:"p-5",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground font-semibold",children:"Farm Health Score"}),i.jsx("p",{className:"text-4xl font-bold text-primary mt-1",children:e.healthScore}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Starting baseline · improves as you log data"})]}),i.jsx("div",{className:"bg-primary/10 p-4 rounded-2xl",children:i.jsx(Zs,{className:"h-8 w-8 text-primary"})})]})})}),i.jsx(z,{className:"glass-card animate-fade-in",children:i.jsxs(V,{className:"p-4 flex gap-3",children:[i.jsx("div",{className:"bg-secondary/15 p-2 rounded-xl shrink-0 h-fit",children:i.jsx(an,{className:"h-4 w-4 text-secondary"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-semibold text-secondary mb-1",children:"Recommendation"}),i.jsx("p",{className:"text-sm leading-relaxed",children:e.recommendation})]})]})}),i.jsx(z,{className:"glass-card animate-fade-in",children:i.jsxs(V,{className:"p-4 flex gap-3",children:[i.jsx("div",{className:"bg-success/15 p-2 rounded-xl shrink-0 h-fit",children:i.jsx(Wt,{className:"h-4 w-4 text-success"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-semibold text-success mb-1",children:"Productivity Insight"}),i.jsx("p",{className:"text-sm leading-relaxed",children:e.productivity})]})]})}),i.jsx(z,{className:"glass-card border-warning/30 animate-fade-in",children:i.jsxs(V,{className:"p-4 flex gap-3",children:[i.jsx("div",{className:"bg-warning/15 p-2 rounded-xl shrink-0 h-fit",children:i.jsx(Ra,{className:"h-4 w-4 text-warning"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-semibold text-warning mb-1",children:"Risk Alert"}),i.jsx("p",{className:"text-sm leading-relaxed",children:e.risk})]})]})}),i.jsx(z,{onClick:r,className:"glass-card cursor-pointer bg-gradient-to-br from-primary to-secondary text-foreground hover:shadow-glow transition-all active:scale-[0.99] animate-scale-in",children:i.jsxs(V,{className:"p-5 flex items-center gap-4",children:[i.jsx("div",{className:"bg-white/15 p-3 rounded-2xl",children:i.jsx(xa,{
vendor: 7,732 bytes, line 779
779className:"h-7 w-7"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider opacity-90",children:"Suggested Next Action"}),i.jsx("h3",{className:"text-lg font-bold mt-0.5",children:e.nextAction.label}),i.jsx("p",{className:"text-xs opacity-80 mt-0.5",children:"Get an instant clinical-style health report."})]}),i.jsx(Qs,{className:"h-5 w-5"})]})})]}),i.jsx("div",{className:"pt-2",children:i.jsx(U,{variant:"outline",className:"w-full",onClick:s,disabled:t&&!e,children:"Go to Dashboard"})})]})})}const Me=e=>typeof e=="string",rf=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},cI=e=>e==null?"":String(e),ame=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},ome=/###/g,uI=e=>e&&e.includes("###")?e.replace(ome,"."):e,dI=e=>!e||Me(e),tm=(e,t,n)=>{const r=Me(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if(dI(e))return{};const a=uI(r[s]);!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={},++s}return dI(e)?{}:{obj:e,k:uI(r[s])}},hI=(e,t,n)=>{const{obj:r,k:s}=tm(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),l=tm(e,o,Object);for(;l.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),l=tm(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${a}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${a}`]=n},lme=(e,t,n,r)=>{const{obj:s,k:a}=tm(e,t,Object);s[a]=s[a]||[],s[a].push(n)},wv=(e,t)=>{const{obj:n,k:r}=tm(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},cme=(e,t,n)=>{const r=wv(e,n);return r!==void 0?r:wv(t,n)},lV=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Me(e[r])||e[r]instanceof String||Me(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):lV(e[r],t[r],n):e[r]=t[r]);return e},na=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),ume={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},dme=e=>Me(e)?e.replace(/[&<>"'\/]/g,t=>ume[t]):e;class hme{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const fme=[" ",",","?","!",";"],mme=new hme(20),pme=(e,t,n)=>{t=t||"",n=n||"";const r=fme.filter(o=>!t.includes(o)&&!n.includes(o));if(r.length===0)return!0;const s=mme.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!s.test(e);if(!a){const o=e.indexOf(n);o>0&&!s.test(e.substring(0,o))&&(a=!0)}return a},mk=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let s=e;for(let a=0;a<r.length;){if(!s||typeof s!="object")return;let o,l="";for(let c=a;c<r.length;++c)if(c!==a&&(l+=n),l+=r[c],o=s[l],o!==void 0){if(["string","number","boolean"].includes(typeof o)&&c<r.length-1)continue;a+=c-a+1;break}s=o}return s},Jm=e=>e==null?void 0:e.replace(/_/g,"-"),gme={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class jv{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||gme,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(t=t.map(a=>Me(a)?a.replace(/[\r\n\x00-\x1F\x7F]/g," "):a),Me(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new jv(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new jv(this.logger,t)}}var Ei=new jv;let w0=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}once(t,n){const r=(...s)=>{n(...s),this.off(t,r)};return this.on(t,r),this}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([s,a])=>{for(let o=0;o<a;o++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let o=0;o<a;o++)s(t,...n)})}};class fI extends w0{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,s={}){var u,d;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.includes(".")?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):Me(r)&&a?l.push(...r.split(a)):l.push(r)));const c=wv(this.data,l);return!c&&!n&&!r&&t.includes(".")&&(t=l[0],n=l[1],r=l.slice(2).join(".")),c||!o||!Me(r)?c:mk((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],r,a)}addResource(t,n,r,s,a={silent:!1}){const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(o?r.split(o):r)),t.includes(".")&&(l=t.split("."),s=n,n=l[1]),this.addNamespaces(n),hI(this.data,l,s),a.silent||this.emit("added",t,n,r,s)}addResources(t,n,r,s={silent:!1}){for(const a in r)(Me(r[a])||Array.isArray(r[a]))&&this.addResource(t,n,a,r[a],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,a,o={silent:!1,skipCopy:!1}){let l=[t,n];t.includes(".")&&(l=t.split("."),s=r,r=n,n=l[1]),this.addNamespaces(n);let c=wv(this.data,l)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?lV(c,r,a):c={...c,...r},hI(this.data,l,c),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var cV={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(a=>{var o;t=((o=this.processors[a])==null?void 0:o.process(t,n,r,s))??t}),t}};const uV=Symbol("i18next/PATH_KEY");function yme(){const e=[],t=Object.create(null);let n;return t.get=(r,s)=>{var a;return(a=n==null?void 0:n.revoke)==null||a.call(n),s===uV?e:(e.push(s),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Ju(e,t){const{[uV]:n}=e(yme()),r=(t==null?void 0:t.keySeparator)??".",s=(t==null?void 0:t.nsSeparator)??":",a=(t==null?void 0:t.enableSelector)==="strict";if(n.length>1&&s){const o=t==null?void 0:t.ns,l=a?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(l&&(a?l:l.length>1?l.slice(1):[]).includes(n[0]))return`${n[0]}${s}${n.slice(1).join(r)}`}return n.join(r)}const Bj=e=>!Me(e)&&typeof e!="boolean"&&typeof e!="number";class Sv extends w0{constructor(t,n={}){super(),ame(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
779i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ei.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const s=this.resolve(t,r);if((s==null?void 0:s.res)===void 0)return!1;const a=Bj(s.res);return!(r.returnObjects===!1&&a)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const o=r&&t.includes(r),l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!pme(t,r,s);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Me(a)?[a]:a};const u=t.split(r);(r!==s||r===s&&this.options.ns.includes(u[0]))&&(a=u.shift()),t=u.join(s)}return{key:t,namespaces:Me(a)?[a]:a}}translate(t,n,r){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),t==null)return"";typeof t=="function"&&(t=Ju(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]),t=t.map($=>typeof $=="function"?Ju($,{...this.options,...s}):String($));const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],s),u=c[c.length-1];let d=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const h=s.lng||this.language,f=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return f?a?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(s)}:`${u}${d}${l}`:a?{res:l,usedKey:l,exactUsedKey:l,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(s)}:l;const m=this.resolve(t,s);let g=m==null?void 0:m.res;const p=(m==null?void 0:m.usedKey)||l,x=(m==null?void 0:m.exactUsedKey)||l,v=["[object Number]","[object Function]","[object RegExp]"],b=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,j=s.count!==void 0&&!Me(s.count),S=Sv.hasDefaultValue(s),N=j?this.pluralResolver.getSuffix(h,s.count,s):"",k=s.ordinal&&j?this.pluralResolver.getSuffix(h,s.count,{ordinal:!1}):"",_=j&&!s.ordinal&&s.count===0,C=_&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${N}`]||s[`defaultValue${k}`]||s.defaultValue;let A=g;w&&!g&&S&&(A=C);const E=Bj(A),P=Object.prototype.toString.apply(A);if(w&&A&&E&&!v.includes(P)&&!(Me(b)&&Array.isArray(A))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const $=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,A,{...s,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return a?(m.res=$,m.usedParams=this.getUsedParamsDetails(s),m):$}if(o){const $=Array.isArray(A),R=$?[]:{},L=$?x:p;for(const D in A)if(Object.prototype.hasOwnProperty.call(A,D)){const I=`${L}${o}${D}`;S&&!g?R[D]=this.translate(I,{...s,defaultValue:Bj(C)?C[D]:void 0,joinArrays:!1,ns:c}):R[D]=this.translate(I,{...s,joinArrays:!1,ns:c}),R[D]===I&&(R[D]=A[D])}g=R}}else if(w&&Me(b)&&Array.isArray(g))g=g.join(b),g&&(g=this.extendTranslation(g,t,s,r));else{let $=!1,R=!1;!this.isValidLookup(g)&&S&&($=!0,g=C),this.isValidLookup(g)||(R=!0,g=l);const D=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,I=S&&C!==g&&this.options.updateMissing;if(R||$||I){if(this.logger.log(I?"updateKey":"missingKey",h,u,j&&!I?`${l}${this.pluralResolver.getSuffix(h,s.count,s)}`:l,I?C:g),o){const B=this.resolve(l,{...s,keySeparator:!1});B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let M=[];const H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(let B=0;B<H.length;B++)M.push(H[B]);else this.options.saveMissingTo==="all"?M=this.languageUtils.toResolveHierarchy(s.lng||this.language):M.push(s.lng||this.language);const T=(B,Y,O)=>{var X;const W=S&&O!==g?O:D;this.options.missingKeyHandler?this.options.missingKeyHandler(B,u,Y,W,I,s):(X=this.backendConnector)!=null&&X.saveMissing&&this.backendConnector.saveMissing(B,u,Y,W,I,s),this.emit
vendor: 29,034 bytes, line 779
779("missingKey",B,u,Y,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?M.forEach(B=>{const Y=this.pluralResolver.getSuffixes(B,s);_&&s[`defaultValue${this.options.pluralSeparator}zero`]&&!Y.includes(`${this.options.pluralSeparator}zero`)&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(O=>{T([B],l+O,s[`defaultValue${O}`]||C)})}):T(M,l,C))}g=this.extendTranslation(g,t,s,m,r),R&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(R||$)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,$?g:void 0,s))}return a?(m.res=g,m.usedParams=this.getUsedParamsDetails(s),m):g}extendTranslation(t,n,r,s,a){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=Me(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const m=t.match(this.interpolator.nestingRegexp);h=m&&m.length}let f=r.replace&&!Me(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language||s.usedLng,r),d){const m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;h<g&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...m)=>(a==null?void 0:a[0])===m[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,l=Me(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(t=cV.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,s,a,o,l;return Me(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Ju(c,{...this.options,...n}):c)),t.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;s=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=n.count!==void 0&&!Me(n.count),m=f&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Me(n.context)||typeof n.context=="number")&&n.context!=="",p=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(x=>{var v,b;this.isValidLookup(r)||(l=x,!this.checkedLoadedFor[`${p[0]}-${x}`]&&((v=this.utils)!=null&&v.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(l))&&(this.checkedLoadedFor[`${p[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${p.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(w=>{var N;if(this.isValidLookup(r))return;o=w;const j=[d];if((N=this.i18nFormat)!=null&&N.addLookupKeys)this.i18nFormat.addLookupKeys(j,d,w,x,n);else{let k;f&&(k=this.pluralResolver.getSuffix(w,n.count,n));const _=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(n.ordinal&&k.startsWith(C)&&j.push(d+k.replace(C,this.options.pluralSeparator)),j.push(d+k),m&&j.push(d+_)),g){const A=`${d}${this.options.contextSeparator||"_"}${n.context}`;j.push(A),f&&(n.ordinal&&k.startsWith(C)&&j.push(A+k.replace(C,this.options.pluralSeparator)),j.push(A+k),m&&j.push(A+_))}}let S;for(;S=j.pop();)this.isValidLookup(r)||(a=S,r=this.getResource(w,x,S,n))}))})}),{res:r,usedKey:s,exactUsedKey:a,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Me(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const a of n)delete s[a]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith(n)&&t[r]!==void 0)return!0;return!1}}class mI{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ei.create("languageUtils")}getScriptPartFromCode(t){if(t=Jm(t),!t||!t.includes("-"))return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Jm(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Me(t)&&t.includes("-")){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return n=s;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return n=a;n=this.options.supportedLngs.find(o=>o===a?!0:!o.includes("-")&&!a.includes("-")?!1:!!(o.includes("-")&&!a.includes("-")&&o.slice(0,o.indexOf("-"))===a||o.startsWith(a)&&a.length>1))}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Me(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),s=[],a=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Me(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):Me(t)&&a(this.formatLanguageCode(t)),r.forEach(o=>{s.includes(o)||a(this.formatLanguageCode(o))}),s}}const pI={zero:0,one:1,two:2,few:3,many:4,other:5},gI={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class xme{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Ei.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Jm(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),gI;if(!t.match(/-|_/))return gI;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[a]=o,o}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,a)=>pI[s]-pI[a]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,n,r={}){const s=this.getRule(t,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const yI=(e,t,n,r=".",s=!0)=>{let a=cme(e,t,n);return!a&&s&&Me(n)&&(a=mk(e,n,r),a===void 0&&(a=mk(t,n,r))),a},zj=e=>e.replace(/\$/g,"$$$$");class xI{constructor(t={}){var n;this.logger=Ei.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:a,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:m,nestingSuffix:g,nestingSuffixEscaped:p,nestingOptionsSeparator:x,maxReplaces:v,alwaysFormat:b}=t.interpolation;this.escape=n!==void 0?n:dme,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?na(a):o||"{{",this.suffix=l?na(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h?na(h):"-",this.unescapeSuffix=this.unescapePrefix?"":d?na(d):"",this.nestingPrefix=f?na(f):m||na("$t("),this.nestingSuffix=g?na(g):p||na(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=v||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,s){var m;let a,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const b=yI(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...s,...n,interpolationkey:g}):b}const p=g.split(this.formatSeparator),x=p.shift().trim(),v=p.join(this.formatSeparator).trim();return this.format(yI(n,c,x,this.options.keySeparator,this.options.ignoreJSONStructure),v,r,{...s,...n,interpolationkey:x})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false â if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const d=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>zj(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?zj(this.escape(g)):zj(g)}].forEach(g=>{for(l=0;a=g.regex.exec(t);){const p=a[1].trim();if(o=u(p),o===void 0)if(typeof d=="function"){const v=d(t,a,s);o=Me(v)?v:""}else if(s&&Object.prototype.hasOwnProperty.call(s,p))o="";else if(h){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${t}`),o="";else!Me(o)&&!this.useRawValueToEscape&&(o=cI(o));const x=g.safeValue(o);if(t=t.replace(a[0],x),h?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let s,a,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(!c.includes(d))return c;const h=c.split(new RegExp(`${na(d)}[ ]*{`));let f=`{${h[1]}`;c=h[0],f=this.interpolate(f,o);const m=f.match(/'/g),g=f.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!g||((g==null?void 0:g.length)??0)%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),u&&(o={...u,...o})}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,p),`${c}${d}${f}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,c};for(;s=this.nestingRegexp.exec(t);){let c=[];o={...r},o=o.replace&&!Me(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(u!==-1&&(c=s[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),s[1]=s[1].slice(0,u)),a=n(l.call(this,s[1].trim(),o),o),a&&s[0]===t&&!Me(a))return a;Me(a)||(a=cI(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),a=""),c.length&&(a=c.reduce((d,h)=>this.format(d,h,r.lng,{...r,interpolationkey:s[1].trim()}),a.trim())),t=t.replace(s[0],a),this.regexp.lastIndex=0}return t}}const vme=e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].slice(0,-1);t==="currency"&&!s.includes(":")?n.currency||(n.currency=s.trim()):t==="relativetime"&&!s.includes(":")?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},vI=e=>{const t={};return(n,r,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const o=r+JSON.stringify(a);let l=t[o];return l||(l=e(Jm(r),s),t[o]=l),l(n)}},bme=e=>(t,n,r)=>e(Jm(n),r)(t);class wme{constructor(t={}){this.logger=Ei.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?vI:bme;this.formats={number:r((s,a)=>{const o=new Intl.NumberFormat(s,{...a});return l=>o.format(l)}),currency:r((s,a)=>{const o=new Intl.NumberFormat(s,{...a,style:"currency"});return l=>o.format(l)}),datetime:r((s,a)=>{const o=new Intl.DateTimeFormat(s,{...a});return l=>o.format(l)}),relativetime:r((s,a)=>{const o=new Intl.RelativeTimeFormat(s,{...a});return l=>o.format(l,a.range||"day")}),list:r((s,a)=>{const o=new Intl.ListFormat(s,{...a});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=vI(n)}format(t,n,r,s={}){if(!n||t==null)return t;const a=n.split(this.formatSeparator),o=[];for(let c=0;c<a.length;c++){let u=a[c];for(;u.indexOf("(")>-1&&!u.includes(")")&&c+1<a.length;)u=`${u}${this.formatSeparator}${a[++c]}`;o.push(u)}return o.reduce((c,u)=>{var f;const{formatName:d,formatOptions:h}=vme(u);if(this.formats[d]){let m=c;try{const g=((f=s==null?void 0:s.formatParams)==null?void 0:f[s.interpolationkey])||{},p=g.locale||g.lng||s.locale||s.lng||r;m=this.formats[d](c,p,{...h,...s,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const jme=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Sme extends w0{constructor(t,n,r,s={}){var a,o;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Ei.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,r,s.backend,s)}queueLoad(t,n,r,s){const a={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(h=>{const f=`${u}|${h}`;!r.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,d=!1,o[f]===void 0&&(o[f]=!0),a[f]===void 0&&(a[f]=!0),c[h]===void 0&&(c[h]=!0)))}),d||(l[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const s=t.split("|"),a=s[0],o=s[1];n&&this.emit("failedLoading",a,o,n),!n&&r&&this.store.addResourceBundle(a,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(c=>{lme(c.loaded,[a],o),jme(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(h=>{l[u][h]===void 0&&(l[u][h]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r,s=0,a=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:a,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&s<this.maxRetries){setTimeout(()=>{this.read(t,n,r,s+1,a*2,o)},a);return}o(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Me(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Me(n)&&(n=[n]);const a=this.queueLoad(t,n,r,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),s=r[0],a=r[1];this.read(s,a,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${a} for language ${s} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${a} for language ${s}`,l),this.loaded(t,o,l)})}saveMissing(t,n,r,s,a,o={},l=()=>{}){var c,u,d,h,f;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((h=(d=this.services)==null?void 0:d.utils)!=null&&h.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((f=this.backend)!=null&&f.create){const m={...o,isUpdate:a},g=this.backend.create.bind(this.backend);if(g.length<6)try{let p;g.length===5?p=g(t,n,r,s,m):p=g(t,n,r,s),p&&typeof p.then=="function"?p.then(x=>l(null,x)).catch(l):l(null,p)}catch(p){l(p)}else g(t,n,r,s,l,m)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const Uj=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Me(e[1])&&(t.defaultValue=e[1]),Me(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),bI=e=>(Me(e.ns)&&(e.ns=[e.ns]),Me(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Me(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),py=()=>{},Nme=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class nm extends w0{constructor(t={},n){if(super(),this.options=bI(t),this.services={},this.logger=Ei,this.modules={external:[]},Nme(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Me(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const r=Uj();this.options={...r,...this.options,...bI(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const s=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Ei.init(s(this.modules.logger),this.options):Ei.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=wme;const d=new mI(this.options);this.store=new fI(this.options.resources,this.options);const h=this.services;h.logger=Ei,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new xme(d,{prepend:this.options.pluralSeparator}),u&&(h.formatter=s(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new xI(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new Sme(s(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(f,...m)=>{this.emit(f,...m)}),this.modules.languageDetector&&(h.languageDetector=s(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=s(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new Sv(this.services,this.options),this.translator.on("*",(f,...m)=>{this.emit(f,...m)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=py),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=rf(),c=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(h),n(d,h)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=py){var a,o;let r=n;const s=Me(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(h=>{h!=="cimode"&&(l.includes(h)||l.push(h))})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const s=rf();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=py),this.services.backendConnector.reload(t,n,a=>{s.resolve(),r(a)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&cV.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!["cimode","dev"].includes(r)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=rf();this.emit("languageChanging",t);const s=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?this.isLanguageChangingTo===t&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,h;!t&&!l&&this.services.languageDetector&&(l=[]);const c=Me(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Me(l)?[l]:l);u&&(this.language||s(u),this.translator.language||this.translator.changeLanguage(u),(h=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||h.call(d,u)),this.loadResources(u,f=>{a(f,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),r}getFixedT(t,n,r,s){const a=s==null?void 0:s.scopeNs,o=(l,c,...u)=>{let d;typeof c!="object"?d=this.options.overloadTranslationOptionHandler([l,c].concat(u)):d={...c},d.lng=d.lng||o.lng,d.lngs=d.lngs||o.lngs;const h=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||o.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||r||o.keyPrefix);const f={...this.options,...d};Array.isArray(a)&&!h&&(f.ns=a),typeof d.keyPrefix=="function"&&(d.keyPrefix=Ju(d.keyPrefix,f));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(p=>(typeof p=="function"&&(p=Ju(p,f)),`${d.keyPrefix}${m}${p}`)):(typeof l=="function"&&(l=Ju(l,f)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Me(t)?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
779if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!s||o(a,t)))}loadNamespaces(t,n){const r=rf();return this.options.ns?(Me(t)&&(t=[t]),t.forEach(s=>{this.options.ns.includes(s)||this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=rf();Me(t)&&(t=[t]);const s=this.options.preload||[],a=t.filter(o=>!s.includes(o)&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=s.concat(a),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){var s,a;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((a=this.services)==null?void 0:a.languageUtils)||new mI(Uj());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.includes(r.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new nm(t,n);return r.createInstance=nm.createInstance,r}cloneInstance(t={},n=py){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},a=new nm(s);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),["store","services","language"].forEach(l=>{a[l]=this[l]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,h)=>(d[h]={...c[u][h]},d),c[u]),c),{});a.store=new fI(l,s),a.services.resourceStore=a.store}if(t.interpolation){const c={...Uj().interpolation,...this.options.interpolation,...t.interpolation},u={...s,interpolation:c};a.services.interpolator=new xI(u)}return a.translator=new Sv(a.services,s),a.translator.on("*",(l,...c)=>{a.emit(l,...c)}),a.init(s,n),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Un=nm.createInstance();Un.createInstance;Un.dir;Un.init;Un.loadResources;Un.reloadResources;Un.use;Un.changeLanguage;Un.getFixedT;Un.t;Un.exists;Un.setDefaultNamespace;Un.hasLoadedNamespace;Un.loadNamespaces;Un.loadLanguages;const kme=(e,t,n,r)=>{var a,o,l,c;const s=[n,{code:t,...r||{}}];if((o=(a=e==null?void 0:e.services)==null?void 0:a.logger)!=null&&o.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);Cc(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},wI={},pk=(e,t,n,r)=>{Cc(n)&&wI[n]||(Cc(n)&&(wI[n]=new Date),kme(e,t,n,r))},dV=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},gk=(e,t,n)=>{e.loadNamespaces(t,dV(e,n))},jI=(e,t,n,r)=>{if(Cc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return gk(e,n,r);
779n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,dV(e,r))},_me=(e,t,n={})=>!t.languages||!t.languages.length?(pk(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),Cc=e=>typeof e=="string",Cme=e=>typeof e=="object"&&e!==null,Eme=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ame={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"â¦","…":"â¦","/":"/","/":"/"},Pme=e=>Ame[e],Tme=e=>e.replace(Eme,Pme);let yk={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Tme,transDefaultProps:void 0};const Ome=(e={})=>{yk={...yk,...e}},Rme=()=>yk;let hV;const Mme=e=>{hV=e},Ime=()=>hV,$me={type:"3rdParty",init(e){Ome(e.options.react),Mme(e)}},Lme=y.createContext();class Dme{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var fV={exports:{}},mV={};/** 780 * @license React 781 * use-sync-external-store-shim.production.js 782 * 783 * Copyright (c) Meta Platforms, Inc. and affiliates. 784 * 785 * This source code is licensed under the MIT license found in the 786 * LICENSE file in the root directory of this source tree. 787 */var Ld=y;function Fme(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bme=typeof Object.is=="function"?Object.is:Fme,zme=Ld.useState,Ume=Ld.useEffect,Vme=Ld.useLayoutEffect,Wme=Ld.useDebugValue;function Hme(e,t){var n=t(),r=zme({inst:{value:n,getSnapshot:t}}),s=r[0].inst,a=r[1];return Vme(function(){s.value=n,s.getSnapshot=t,Vj(s)&&a({inst:s})},[e,n,t]),Ume(function(){return Vj(s)&&a({inst:s}),e(function(){Vj(s)&&a({inst:s})})},[e]),Wme(n),n}function Vj(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bme(e,n)}catch{return!0}}function qme(e,t){return t()}var Kme=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qme:Hme;mV.useSyncExternalStore=Ld.useSyncExternalStore!==void 0?Ld.useSyncExternalStore:Kme;fV.exports=mV;var Gme=fV.exports;const Yme=(e,t)=>{if(Cc(t))return t;if(Cme(t)&&Cc(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},Xme={t:Yme,ready:!1},Jme=()=>()=>{},Gi=(e,t={})=>{var C,A,E;const{i18n:n}=t,{i18n:r,defaultNS:s}=y.useContext(Lme)||{},a=n||r||Ime();a&&!a.reportNamespaces&&(a.reportNamespaces=new Dme),a||pk(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=y.useMemo(()=>{var P;return{...Rme(),...(P=a==null?void 0:a.options)==null?void 0:P.react,...t}},[a,t]),{useSuspense:l,keyPrefix:c}=o,u=s||((C=a==null?void 0:a.options)==null?void 0:C.defaultNS),d=Cc(u)?[u]:u||["translation"],h=y.useMemo(()=>d,d);(E=(A=a==null?void 0:a.reportNamespaces)==null?void 0:A.addUsedNamespaces)==null||E.call(A,h);const f=y.useRef(0),m=y.useCallback(P=>{if(!a)return Jme;const{bindI18n:$,bindI18nStore:R}=o,L=()=>{f.current+=1,P()};return $&&a.on($,L),R&&a.store.on(R,L),()=>{$&&$.split(" ").forEach(D=>a.off(D,L)),R&&R.split(" ").forEach(D=>a.store.off(D,L))}},[a,o]),g=y.useRef(),p=y.useCallback(()=>{if(!a)return Xme;const P=!!(a.isInitialized||a.initializedStoreOnce)&&h.every(M=>_me(M,a,o)),$=t.lng||a.language,R=f.current,L=g.current;if(L&&L.ready===P&&L.lng===$&&L.keyPrefix===c&&L.revision===R)return L;const I={t:a.getFixedT($,o.nsMode==="fallback"?h:h[0],c,{scopeNs:h}),ready:P,lng:$,keyPrefix:c,revision:R};return g.current=I,I},[a,h,c,o,t.lng]),[x,v]=y.useState(0),{t:b,ready:w}=Gme.useSyncExternalStore(m,p,p);y.useEffect(()=>{if(a&&!w&&!l){const P=()=>v($=>$+1);t.lng?jI(a,t.lng,h,P):gk(a,h,P)}},[a,t.lng,h,w,l,x]);const j=a||{},S=y.useRef(null),N=y.useRef(),k=P=>{const $=Object.getOwnPropertyDescriptors(P);$.__original&&delete $.__original;const R=Object.create(Object.getPrototypeOf(P),$);if(!Object.prototype.hasOwnProperty.call(R,"__original"))try{Object.defineProperty(R,"__original",{value:P,writable:!1,enumerable:!1,
787configurable:!1})}catch{}return R},_=y.useMemo(()=>{const P=j,$=P==null?void 0:P.language;let R=P;P&&(S.current&&S.current.__original===P?N.current!==$?(R=k(P),S.current=R,N.current=$):R=S.current:(R=k(P),S.current=R,N.current=$));const L=!w&&!l?(...I)=>(pk(a,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),b(...I)):b,D=[L,R,w];return D.t=L,D.i18n=R,D.ready=w,D},[b,j,w,j.resolvedLanguage,j.language,j.languages]);if(a&&l&&!w)throw new Promise(P=>{const $=()=>P();t.lng?jI(a,t.lng,h,$):gk(a,h,$)});return _},Qme=[{id:"home",labelKey:"nav.home",icon:xE},{id:"flock",labelKey:"nav.flocks",icon:ht},{id:"daily-log",labelKey:"nav.log",icon:cc,isFab:!0},{id:"finance",labelKey:"nav.finance",icon:Sc},{id:"profile",labelKey:"nav.profile",icon:Xb}];function Zme({activeTab:e,onTabChange:t}){const{t:n}=Gi();return i.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 bg-background/95 border-t border-border shadow-lg backdrop-blur-md safe-area-inset-bottom","data-tour":"bottom-nav",children:i.jsx("div",{className:"flex items-end justify-around py-2 px-1",children:Qme.map(r=>{const s=e===r.id;return r.isFab?i.jsxs("button",{onClick:()=>t(r.id),className:"relative -mt-7 flex flex-col items-center touch-manipulation min-h-11 min-w-11","aria-label":`${n(r.labelKey)} â open daily log`,"aria-current":s?"page":void 0,children:[i.jsxs("div",{className:fe("relative flex items-center justify-center w-14 h-14 rounded-full shadow-elegant transition-all duration-300",s?"bg-gradient-primary shadow-glow scale-110":"bg-gradient-primary hover:scale-105"),children:[!s&&i.jsx("span",{className:"absolute inset-0 rounded-full bg-primary/30 animate-pulse-ring"}),i.jsx(r.icon,{className:"h-6 w-6 text-primary-foreground"})]}),i.jsx("span",{className:fe("text-[10px] mt-1 font-semibold",s?"text-primary":"text-muted-foreground"),children:n(r.labelKey)})]},r.id):i.jsxs("button",{onClick:()=>t(r.id),"aria-label":`Go to ${n(r.labelKey)}`,"aria-current":s?"page":void 0,className:fe("flex flex-col items-center space-y-0.5 p-2 rounded-xl transition-all duration-300 touch-manipulation min-w-[56px] min-h-11",s?"text-primary":"text-muted-foreground hover:text-foreground"),children:[i.jsx("div",{className:fe("p-1.5 rounded-xl transition-all duration-300",s&&"bg-primary/10"),children:i.jsx(r.icon,{className:fe("h-5 w-5 transition-transform duration-300",s&&"scale-110")})}),i.jsx("span",{className:"text-[10px] font-semibold",children:n(r.labelKey)})]},r.id)})})})}const epe=Xp("inline-flex items-center rounded-full 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 hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ye({className:e,variant:t,...n}){return i.jsx("div",{className:fe(epe({variant:t}),e),...n})}const Yt=y.forwardRef(({className:e,...t},n)=>i.jsx("textarea",{className:fe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
787ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Yt.displayName="Textarea";var O2="Progress",R2=100,[tpe,k7e]=kr(O2),[npe,rpe]=tpe(O2),pV=y.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:a=spe,...o}=e;(s||s===0)&&!SI(s)&&console.error(ipe(`${s}`,"Progress"));const l=SI(s)?s:R2;r!==null&&!NI(r,l)&&console.error(ape(`${r}`,"Progress"));const c=NI(r,l)?r:null,u=Nv(c)?a(c,l):void 0;return i.jsx(npe,{scope:n,value:c,max:l,children:i.jsx(ve.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Nv(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":xV(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});pV.displayName=O2;var gV="ProgressIndicator",yV=y.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=rpe(gV,n);return i.jsx(ve.div,{"data-state":xV(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});yV.displayName=gV;function spe(e,t){return`${Math.round(e/t*100)}%`}function xV(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Nv(e){return typeof e=="number"}function SI(e){return Nv(e)&&!isNaN(e)&&e>0}function NI(e,t){return Nv(e)&&!isNaN(e)&&e<=t&&e>=0}function ipe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${R2}\`.`}function ape(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 788 - a positive number 789 - less than the value passed to \`max\` (or ${R2} if no \`max\` prop is set) 790 - \`null\` or \`undefined\` if the progress is indeterminate. 791 792Defaulting to \`null\`.`}var vV=pV,ope=yV;const rr=y.forwardRef(({className:e,value:t,...n},r)=>i.jsx(vV,{ref:r,className:fe("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:i.jsx(ope,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));rr.displayName=vV.displayName;function M2({text:e,label:t,className:n,size:r="sm"}){const{t:s,i18n:a}=Gi(),o=t??s("common.listen"),[l,c]=y.useState("idle"),u=y.useRef(null),d=y.useRef(null);y.useEffect(()=>()=>{var p;(p=u.current)==null||p.pause(),d.current&&URL.revokeObjectURL(d.current)},[]);const h=()=>{var p;(p=u.current)==null||p.pause(),u.current=null,d.current&&(URL.revokeObjectURL(d.current),d.current=null),c("idle")},m=l==="playing"||l==="loading"?h:async()=>{var x;const p=(x=typeof e=="function"?e():e)==null?void 0:x.trim();if(p){c("loading");try{const{data:v,error:b}=await q.functions.invoke("text-to-speech",{body:{text:p,language:a.language}}
792);if(b)throw b;const w=v instanceof Blob?v:new Blob([v],{type:"audio/mpeg"}),j=URL.createObjectURL(w);d.current=j;const S=new Audio(j);u.current=S,S.onended=()=>h(),S.onerror=()=>h(),await S.play(),c("playing")}catch(v){console.error("ReadAloud failed",v),h()}}},g=l==="loading"?Jr:l==="playing"?Xx:EB;return i.jsxs(U,{type:"button",variant:"outline",size:r,onClick:m,className:fe("gap-2 min-h-11",n),"aria-label":l==="playing"?s("common.stopReading"):`${o} â ${s("common.readAloud")}`,"aria-pressed":l==="playing",children:[i.jsx(g,{className:fe("h-4 w-4",l==="loading"&&"animate-spin")}),i.jsx("span",{children:l==="playing"?s("common.stop"):o})]})}const lpe={healthy:{label:"Healthy",description:"No concerning symptoms detected",icon:Dt,accentClass:"text-emerald-600 dark:text-emerald-400",bgClass:"bg-emerald-500/10",borderClass:"border-emerald-500/30",ringClass:"ring-emerald-500/20",progressClass:"[&>div]:bg-emerald-500"},warning:{label:"Warning",description:"Some symptoms require attention",icon:Ra,accentClass:"text-amber-600 dark:text-amber-400",bgClass:"bg-amber-500/10",borderClass:"border-amber-500/30",ringClass:"ring-amber-500/20",progressClass:"[&>div]:bg-amber-500"},sick:{label:"Needs Care",description:"Immediate attention recommended",icon:Jp,accentClass:"text-red-600 dark:text-red-400",bgClass:"bg-red-500/10",borderClass:"border-red-500/30",ringClass:"ring-red-500/20",progressClass:"[&>div]:bg-red-500"}},kI={critical:{label:"Critical",className:"bg-red-500 text-white border-red-500 animate-pulse"},high:{label:"High",className:"bg-red-500/80 text-white border-red-500/80"},medium:{label:"Medium",className:"bg-amber-500 text-white border-amber-500"},low:{label:"Low",className:"bg-emerald-500 text-white border-emerald-500"}};function Za({icon:e,iconClass:t,title:n,children:r,borderAccent:s}){return i.jsxs("div",{className:`rounded-xl border ${s||"border-border/60"} bg-card overflow-hidden`,children:[i.jsxs("div",{className:"flex items-center gap-2.5 px-4 pt-4 pb-2",children:[i.jsx("div",{className:`p-1.5 rounded-lg ${t}`,children:i.jsx(e,{className:"h-4 w-4"})}),i.jsx("h4",{className:"font-semibold text-sm tracking-tight",children:n})]}),i.jsx("div",{className:"px-4 pb-4",children:r})]})}function cpe({result:e,analysisType:t,onReset:n,onDone:r,onShare:s}){var c,u;const{t:a}=Gi(),o=lpe[e.condition],l=o.icon;return i.jsxs("div",{className:"space-y-4 animate-float-in",children:[i.jsxs("div",{className:`relative rounded-2xl border-2 ${o.borderClass} ${o.bgClass} p-5 ring-4 ${o.ringClass} overflow-hidden`,children:[i.jsx("div",{className:"absolute -top-8 -right-8 w-24 h-24 rounded-full bg-gradient-to-br from-primary/10 to-transparent blur-xl"}),i.jsx("div",{className:"absolute -bottom-6 -left-6 w-20 h-20 rounded-full bg-gradient-to-tr from-accent/10 to-transparent blur-lg"}),i.jsxs("div",{className:"relative space-y-4",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:`p-2.5 rounded-xl ${o.bgClass} ${o.accentClass} shadow-sm`,children:i.jsx(l,{className:"h-7 w-7"})}),i.jsxs("div",{children:[i.jsx("h3",{className:`font-bold text-lg ${o.accentClass}`,children:o.label}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:o.description})]})]}),i.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[t&&i.jsx(ye,{variant:"outline",className:"text-[10px] gap-1 font-medium bg-card/80 backdrop-blur-sm",children:t==="both"?i.jsxs(i.Fragment,{children:[i.jsx(xa,{className:"h-2.5 w-2.5"})," Photo + Text"]}):t==="image"?i.jsxs(i.Fragment,{children:[i.jsx(xa,{className:"h-2.5 w-2.5"})," Photo"]}):i.jsxs(i.Fragment,{children:[i.jsx(En,{className:"h-2.5 w-2.5"})," Text"]})}),e.urgencyLevel&&i.jsx(ye,{className:`text-[10px] font-bold ${((c=kI[e.urgencyLevel])==null?void 0:c.className)||""}`,children:((u=kI[e.urgencyLevel])==null?void 0:u.label)||e.urgencyLevel})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("span",{className:"text-xs font-medium text-muted-foreground flex items-center gap-1",children:[i.jsx(pE,{className:"h-3 w-3"})," Confidence"]}),i.jsxs("span",{className:`text-sm font-bold ${o.accentClass}`,children:[e.confidence,"%"]})]}),i.jsx(rr,{value:e.confidence,className:`h-2.5 rounded-full bg-muted/80 ${o.progressClass}`})]}),e.veterinaryNeeded&&i.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-xl bg-red-500/10 border border-red-500/20",children:[i.jsx("div",{className:"p-1.5 rounded-lg bg-red-500/20",children:i.jsx(Zs,{className:"h-4 w-4 text-red-500"})}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-bold text-red-600 dark:text-red-400 uppercase tracking-wide",children:"Vet Recommended"}),i.jsx("p",{className:"text-[11px] text-red-600/70 dark:text-red-400/70",children:"Professional assessment advised"})]})]})]})]}),i.jsx("div",{className:"flex justify-center",children:i.jsx(M2,{text:()=>{var h,f,m;
792const d=[];return d.push(`${o.label}. ${o.description}.`),e.diseaseIdentification&&d.push(`Diagnosis: ${e.diseaseIdentification}.`),e.analysis&&d.push(e.analysis),(h=e.symptoms)!=null&&h.length&&d.push(`Symptoms: ${e.symptoms.join(", ")}.`),(f=e.recommendations)!=null&&f.length&&d.push(`Recommendations: ${e.recommendations.join(". ")}.`),(m=e.treatmentProtocol)!=null&&m.length&&d.push(`Treatment: ${e.treatmentProtocol.join(". ")}.`),e.veterinaryNeeded&&d.push(a("scanResults.vetRecommended")),d.join(" ")},label:a("scanResults.listen")})}),e.timeline&&i.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-3 rounded-xl bg-muted/50 border border-border/50",children:[i.jsx(js,{className:"h-4 w-4 text-primary flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-widest",children:"Recovery Timeline"}),i.jsx("p",{className:"text-sm font-medium leading-snug",children:e.timeline})]})]}),e.diseaseIdentification&&i.jsx(Za,{icon:Pd,iconClass:"bg-primary/10 text-primary",title:"Diagnosis",borderAccent:"border-primary/20",children:i.jsx("p",{className:"text-sm leading-relaxed text-foreground/85",children:e.diseaseIdentification})}),e.analysis&&i.jsx(Za,{icon:oee,iconClass:"bg-amber-500/15 text-amber-600 dark:text-amber-400",title:"Analysis Summary",borderAccent:"border-amber-500/15",children:i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"p-3 rounded-lg bg-muted/40 border border-border/40",children:i.jsx("p",{className:"text-sm leading-relaxed text-foreground/85 whitespace-pre-wrap",children:e.analysis})}),i.jsx("div",{className:"mt-2 flex justify-end",children:i.jsx(ye,{variant:"outline",className:"text-[10px] text-muted-foreground",children:"AI Generated"})})]})}),e.symptoms&&e.symptoms.length>0&&i.jsx(Za,{icon:Ra,iconClass:"bg-amber-500/15 text-amber-600 dark:text-amber-400",title:"Identified Symptoms",children:i.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.symptoms.map((d,h)=>i.jsx(ye,{variant:"secondary",className:"py-1 px-2.5 text-xs font-medium rounded-lg bg-amber-500/10 text-amber-700 dark:text-amber-300 border border-amber-500/20",children:d},h))})}),e.treatmentProtocol&&e.treatmentProtocol.length>0&&i.jsx(Za,{icon:ree,iconClass:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",title:"Treatment Protocol",borderAccent:"border-emerald-500/20",children:i.jsx("div",{className:"space-y-2.5",children:e.treatmentProtocol.map((d,h)=>i.jsxs("div",{className:"flex gap-3 items-start group",children:[i.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-emerald-500/15 flex items-center justify-center ring-2 ring-emerald-500/10 group-hover:ring-emerald-500/30 transition-all",children:i.jsx("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400",children:h+1})}),i.jsx("p",{className:"text-sm leading-relaxed pt-0.5 text-foreground/85",children:d})]},h))})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.preventionMeasures&&e.preventionMeasures.length>0&&i.jsx(Za,{icon:ll,iconClass:"bg-blue-500/15 text-blue-600 dark:text-blue-400",title:"Prevention",children:i.jsx("div",{className:"space-y-2",children:e.preventionMeasures.map((d,h)=>i.jsxs("div",{className:"flex gap-2 items-start",children:[i.jsx(Dt,{className:"h-3.5 w-3.5 text-blue-500 mt-0.5 flex-shrink-0"}),i.jsx("p",{className:"text-xs leading-relaxed",children:d})]},h))})}),e.environmentalFactors&&e.environmentalFactors.length>0&&i.jsx(Za,{icon:xB,iconClass:"bg-green-500/15 text-green-600 dark:text-green-400",title:"Environment",children:i.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.environmentalFactors.map((d,h)=>i.jsx(ye,{variant:"outline",className:"py-1 px-2.5 text-[11px] border-green-500/25 text-green-600 dark:text-green-400 bg-green-500/5",children:d},h))})})]}),e.nutritionalRecommendations&&e.nutritionalRecommendations.length>0&&i.jsx(Za,{icon:CZ,iconClass:"bg-orange-500/15 text-orange-600 dark:text-orange-400",title:"Nutrition",children:i.jsx("div",{className:"space-y-2",children:e.nutritionalRecommendations.map((d,h)=>i.jsxs("div",{className:"flex gap-2 items-start",children:[i.jsx(ya,{className:"h-3.5 w-3.5 text-orange-500 mt-0.5 flex-shrink-0"}),i.jsx("p",{className:"text-xs leading-relaxed",children:d})]},h))})}),e.recommendations&&e.recommendations.length>0&&i.jsx(Za,{icon:Dt,iconClass:"bg-primary/10 text-primary",title:"Additional Recommendations",children:i.jsx("div",{className:"space-y-2",children:e.recommendations.map((d,h)=>i.jsxs("div",{className:"flex gap-2 items-start",children:[i.jsx(ya,{className:"h-3.5 w-3.5 text-primary mt-0.5 flex-shrink-0"}),i.jsx("p",{className:"text-xs leading-relaxed",children:d})]},h))})}),i.jsxs("div",{className:"space-y-2.5 pt-1",children:[i.jsxs(U,{onClick:s,variant:"outline",className:"w-full gap-2 border-green-500/30 text-green-600 hover:bg-green-500/10 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 rounded-xl h-11",children:[i.jsx(Ko,{className:"h-4 w-4"}),"Share via WhatsApp"]}),i.jsxs("div",{className:"flex gap-2.5",children:[i.jsxs(U,{onClick:n,variant:"outline",className:"flex-1 gap-2 rounded-xl h-11",children:[i.jsx(SB,{className:"h-4 w-4"}),"New Scan"]}),i.jsx(U,{onClick:r,className:"flex-1 rounded-xl h-11",children:"Done"})]})]})]})}function Dd({onTranscript:e,className:t,label:n}){const{t:r,i18n:s}=Gi(),a=n??r("common.speak"),[o,l]=y.useState("idle"),c=y.useRef(null),u=y.useRef([]),d=y.useRef(null),h=()=>{var x;
792(x=d.current)==null||x.getTracks().forEach(v=>v.stop()),d.current=null},g=o==="recording"?()=>{var x;(x=c.current)==null||x.stop()}:o==="idle"?async()=>{try{const x=await navigator.mediaDevices.getUserMedia({audio:!0});d.current=x;const v=["audio/webm","audio/mp4"].find(w=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(w))??"",b=v?new MediaRecorder(x,{mimeType:v}):new MediaRecorder(x);c.current=b,u.current=[],b.ondataavailable=w=>w.data.size>0&&u.current.push(w.data),b.onstop=async()=>{h();const w=new Blob(u.current,{type:b.mimeType||"audio/webm"});if(w.size<1024){Ws({title:"Recording too short",description:"Try again and speak a bit longer."}),l("idle");return}l("processing");try{const j=w.type.includes("mp4")?"mp4":w.type.includes("mpeg")?"mp3":w.type.includes("wav")?"wav":"webm",S=new FormData;S.append("file",w,`recording.${j}`),s.language==="en"&&S.append("language","en");const{data:N,error:k}=await q.functions.invoke("speech-to-text",{body:S});if(k)throw k;const _=(N==null?void 0:N.text)??"";_?e(_):Ws({title:"No speech detected",description:"Please try again."})}catch(j){console.error("STT failed",j),Ws({title:"Voice input failed",description:"Please try again.",variant:"destructive"})}finally{l("idle")}},b.start(),l("recording")}catch(x){console.error("Mic access failed",x),Ws({title:"Microphone access needed",description:"Allow microphone permission to use voice input.",variant:"destructive"}),l("idle")}}:void 0,p=o==="processing"?Jr:o==="recording"?Xx:vB;return i.jsxs(U,{type:"button",variant:o==="recording"?"destructive":"outline",size:"sm",onClick:g,disabled:o==="processing",className:fe("gap-2 min-h-11",t),"aria-label":o==="recording"?r("common.stopRecording"):`${a} â ${r("common.voiceInput")}`,"aria-pressed":o==="recording",children:[i.jsx(p,{className:fe("h-4 w-4",o==="processing"&&"animate-spin")}),i.jsx("span",{children:o==="recording"?r("common.stop"):o==="processing"?r("common.transcribing"):a})]})}function upe(e,t){const n=y.createContext(t),r=a=>{const{children:o,...l}=a,c=y.useMemo(()=>l,Object.values(l));return i.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function s(a){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,s]}function dpe(e,t=[]){let n=[];function r(a,o){const l=y.createContext(o),c=n.length;n=[...n,o];const u=h=>{var v;const{scope:f,children:m,...g}=h,p=((v=f==null?void 0:f[e])==null?void 0:v[c])||l,x=y.useMemo(()=>g,Object.values(g));return i.jsx(p.Provider,{value:x,children:m})};u.displayName=a+"Provider";function d(h,f){var p;const m=((p=f==null?void 0:f[e])==null?void 0:p[c])||l,g=y.useContext(m);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[u,d]}const s=()=>{const a=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,hpe(s,...t)]}function hpe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const h=c(a)[`__scope${u}`];return{...l,...h}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Wj="focusScope.autoFocusOnMount",Hj="focusScope.autoFocusOnUnmount",_I={bubbles:!1,cancelable:!0},fpe="FocusScope",lg=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...o}=e,[l,c]=y.useState(null),u=dt(s),d=dt(a),h=y.useRef(null),f=Ce(t,p=>c(p)),m=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let p=function(w){if(m.paused||!l)return;const j=w.target;l.contains(j)?h.current=j:io(h.current,{select:!0})},x=function(w){if(m.paused||!l)return;const j=w.relatedTarget;j!==null&&(l.contains(j)||io(h.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&io(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",x);const b=new MutationObserver(v);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",x),b.disconnect()}}},[r,l,m.paused]),y.useEffect(()=>{if(l){EI.add(m);const p=document.activeElement;if(!l.contains(p)){const v=new CustomEvent(Wj,_I);l.addEventListener(Wj,u),l.dispatchEvent(v),v.defaultPrevented||(mpe(vpe(bV(l)),{select:!0}),document.activeElement===p&&io(l))}return()=>{l.removeEventListener(Wj,u),setTimeout(()=>{const v=new CustomEvent(Hj,_I);l.addEventListener(Hj,d),l.dispatchEvent(v),v.defaultPrevented||io(p??document.body,{select:!0}),l.removeEventListener(Hj,d),EI.remove(m)},0)}}},[l,u,d,m]);const g=y.useCallback(p=>{if(!n&&!r||m.paused)return;const x=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(x&&v){const b=p.currentTarget,[w,j]=ppe(b);w&&j?!p.shiftKey&&v===j?(p.preventDefault(),n&&io(w,{select:!0}
vendor: 4,688 bytes, line 792
792)):p.shiftKey&&v===w&&(p.preventDefault(),n&&io(j,{select:!0})):v===b&&p.preventDefault()}},[n,r,m.paused]);return i.jsx(ve.div,{tabIndex:-1,...o,ref:f,onKeyDown:g})});lg.displayName=fpe;function mpe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(io(r,{select:t}),document.activeElement!==n)return}function ppe(e){const t=bV(e),n=CI(t,e),r=CI(t.reverse(),e);return[n,r]}function bV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function CI(e,t){for(const n of e)if(!gpe(n,{upTo:t}))return n}function gpe(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 ype(e){return e instanceof HTMLInputElement&&"select"in e}function io(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ype(e)&&t&&e.select()}}var EI=xpe();function xpe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=AI(e,t),e.unshift(t)},remove(t){var n;e=AI(e,t),(n=e[0])==null||n.resume()}}}function AI(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function vpe(e){return e.filter(t=>t.tagName!=="A")}function bpe(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var j0=e=>{const{present:t,children:n}=e,r=wpe(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=Ce(r.ref,jpe(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:a}):null};j0.displayName="Presence";function wpe(e){const[t,n]=y.useState(),r=y.useRef({}),s=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=bpe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const u=gy(r.current);a.current=l==="mounted"?u:"none"},[l]),Nt(()=>{const u=r.current,d=s.current;if(d!==e){const f=a.current,m=gy(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Nt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=m=>{const p=gy(r.current).includes(m.animationName);if(m.target===t&&p&&(c("ANIMATION_END"),!s.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=m=>{m.target===t&&(a.current=gy(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function gy(e){return(e==null?void 0:e.animationName)||"none"}function jpe(e){var r,s;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=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qj=0;function Spe(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??PI()),document.body.insertAdjacentElement("beforeend",e[1]??PI()),qj++,()=>{qj===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qj--}},[])}function PI(){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 yo=function(){return yo=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},yo.apply(this,arguments)};function Npe(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function kpe(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;
vendor: 5,514 bytes, lines 792-807
792r++)(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 hc="right-scroll-bar-position",fc="width-before-scroll-bar",_pe="with-scroll-bars-hidden",Cpe="--removed-body-scroll-bar-size";function Kj(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Epe(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var Ape=typeof window<"u"?y.useLayoutEffect:y.useEffect,TI=new WeakMap;function S0(e,t){var n=Epe(null,function(r){return e.forEach(function(s){return Kj(s,r)})});return Ape(function(){var r=TI.get(n);if(r){var s=new Set(r),a=new Set(e),o=n.current;s.forEach(function(l){a.has(l)||Kj(l,null)}),a.forEach(function(l){s.has(l)||Kj(l,o)})}TI.set(n,e)},[e]),n}var kv=function(){return kv=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},kv.apply(this,arguments)};function Ppe(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Tpe(e){return e}function Ope(e,t){t===void 0&&(t=Tpe);var n=[],r=!1,s={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(l){return l!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(a),o=n}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return s}function N0(e){e===void 0&&(e={});var t=Ope(null);return t.options=kv({async:!0,ssr:!1},e),t}var wV=function(e){var t=e.sideCar,n=Ppe(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 y.createElement(r,kv({},n))};wV.isSideCarExport=!0;function k0(e,t){return e.useMedium(t),wV}var jV=N0(),Gj=function(){},_0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Gj,onWheelCapture:Gj,onTouchMoveCapture:Gj}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,m=e.noIsolation,g=e.inert,p=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,b=e.gapMode,w=Npe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,S=S0([n,t]),N=yo(yo({},w),s);return y.createElement(y.Fragment,null,d&&y.createElement(j,{sideCar:jV,removeScrollBar:u,shards:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!p,lockRef:n,gapMode:b}),o?y.cloneElement(y.Children.only(l),yo(yo({},N),{ref:S})):y.createElement(v,yo({},N,{className:c,ref:S}),l))});_0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_0.classNames={fullWidth:fc,zeroRight:hc};var Rpe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mpe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Rpe();return t&&e.setAttribute("nonce",t),e}function Ipe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $pe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lpe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mpe())&&(Ipe(t,n),$pe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Dpe=function(){var e=Lpe();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},cg=function(){var e=Dpe(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Fpe={left:0,top:0,right:0,gap:0},Yj=function(e){return parseInt(e||"",10)||0},Bpe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Yj(n),Yj(r),Yj(s)]},zpe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Fpe;var t=Bpe(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])}},Upe=cg(),Qu="data-scroll-locked",Vpe=function(e,t,n,r){var s=e.left,a=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),` 793 .`.concat(_pe,` { 794 overflow: hidden `).concat(r,`; 795 padding-right: `).concat(l,"px ").concat(r,`; 796 } 797 body[`).concat(Qu,`] { 798 overflow: hidden `).concat(r,`; 799 overscroll-behavior: contain; 800 `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` 801 padding-left: `.concat(s,`px; 802 padding-top: `).concat(a,`px; 803 padding-right: `).concat(o,`px; 804 margin-left:0; 805 margin-top:0; 806 margin-right: `).concat(l,"px ").concat(r,`; 807 `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";
807")].filter(Boolean).join(""),` 808 } 809 810 .`).concat(hc,` { 811 right: `).concat(l,"px ").concat(r,`; 812 } 813 814 .`).concat(fc,` { 815 margin-right: `).concat(l,"px ").concat(r,`; 816 } 817 818 .`).concat(hc," .").concat(hc,` { 819 right: 0 `).concat(r,`; 820 } 821 822 .`).concat(fc," .").concat(fc,` { 823 margin-right: 0 `).concat(r,`; 824 } 825 826 body[`).concat(Qu,`] { 827 `).concat(Cpe,": ").concat(l,`px; 828 } 829`)},OI=function(){var e=parseInt(document.body.getAttribute(Qu)||"0",10);return isFinite(e)?e:0},Wpe=function(){y.useEffect(function(){return document.body.setAttribute(Qu,(OI()+1).toString()),function(){var e=OI()-1;e<=0?document.body.removeAttribute(Qu):document.body.setAttribute(Qu,e.toString())}},[])},C0=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Wpe();var a=y.useMemo(function(){return zpe(s)},[s]);return y.createElement(Upe,{styles:Vpe(a,!t,s,n?"":"!important")})},xk=!1;if(typeof window<"u")try{var yy=Object.defineProperty({},"passive",{get:function(){return xk=!0,!0}});window.addEventListener("test",yy,yy),window.removeEventListener("test",yy,yy)}catch{xk=!1}var Jc=xk?{passive:!1}:!1,Hpe=function(e){return e.tagName==="TEXTAREA"},SV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Hpe(e)&&n[t]==="visible")},qpe=function(e){return SV(e,"overflowY")},Kpe=function(e){return SV(e,"overflowX")},RI=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=NV(e,r);if(s){var a=kV(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gpe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ype=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},NV=function(e,t){return e==="v"?qpe(t):Kpe(t)},kV=function(e,t){return e==="v"?Gpe(t):Ype(t)},Xpe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Jpe=function(e,t,n,r,s){var a=Xpe(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,h=0,f=0;do{var m=kV(e,l),g=m[0],p=m[1],x=m[2],v=p-x-a*g;(g||v)&&NV(e,l)&&(h+=v,f+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(u=!0),u},xy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},MI=function(e){return[e.deltaX,e.deltaY]},II=function(e){return e&&"current"in e?e.current:e},Qpe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Zpe=function(e){return` 830 .block-interactivity-`.concat(e,` {pointer-events: none;} 831 .allow-interactivity-`).concat(e,` {pointer-events: all;} 832`)},ege=0,Qc=[];function tge(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(ege++)[0],a=y.useState(cg)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=kpe([e.lockRef.current],(e.shards||[]).map(II),!0).filter(Boolean);return p.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(p,x){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var v=xy(p),b=n.current,w="deltaX"in p?p.deltaX:b[0]-v[0],j="deltaY"in p?p.deltaY:b[1]-v[1],S,N=p.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in p&&k==="h"&&N.type==="range")return!1;var _=RI(k,N);if(!_)return!0;if(_?S=k:(S=k==="v"?"h":"v",_=RI(k,N)),!_)return!1;if(!r.current&&"changedTouches"in p&&(w||j)&&(r.current=S),!S)return!0;var C=r.current||S;return Jpe(C,x,p,C==="h"?w:j,!0)},[]),c=y.useCallback(function(p){var x=p;if(!(!Qc.length||Qc[Qc.length-1]!==a)){var v="deltaY"in x?MI(x):xy(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&Qpe(S.delta,v)}
vendor: 8,999 bytes, lines 832-836
832)[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(II).filter(Boolean).filter(function(S){return S.contains(x.target)}),j=w.length>0?l(x,w[0]):!o.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),u=y.useCallback(function(p,x,v,b){var w={name:p,delta:x,target:v,should:b,shadowParent:nge(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=y.useCallback(function(p){n.current=xy(p),r.current=void 0},[]),h=y.useCallback(function(p){u(p.type,MI(p),p.target,l(p,e.lockRef.current))},[]),f=y.useCallback(function(p){u(p.type,xy(p),p.target,l(p,e.lockRef.current))},[]);y.useEffect(function(){return Qc.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Jc),document.addEventListener("touchmove",c,Jc),document.addEventListener("touchstart",d,Jc),function(){Qc=Qc.filter(function(p){return p!==a}),document.removeEventListener("wheel",c,Jc),document.removeEventListener("touchmove",c,Jc),document.removeEventListener("touchstart",d,Jc)}},[]);var m=e.removeScrollBar,g=e.inert;return y.createElement(y.Fragment,null,g?y.createElement(a,{styles:Zpe(s)}):null,m?y.createElement(C0,{gapMode:e.gapMode}):null)}function nge(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rge=k0(jV,tge);var _V=y.forwardRef(function(e,t){return y.createElement(_0,yo({},e,{ref:t,sideCar:rge}))});_V.classNames=_0.classNames;var sge=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zc=new WeakMap,vy=new WeakMap,by={},Xj=0,CV=function(e){return e&&(e.host||CV(e.parentNode))},ige=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=CV(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})},age=function(e,t,n,r){var s=ige(t,Array.isArray(e)?e:[e]);by[n]||(by[n]=new WeakMap);var a=by[n],o=[],l=new Set,c=new Set(s),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};s.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(l.has(f))d(f);else try{var m=f.getAttribute(r),g=m!==null&&m!=="false",p=(Zc.get(f)||0)+1,x=(a.get(f)||0)+1;Zc.set(f,p),a.set(f,x),o.push(f),p===1&&g&&vy.set(f,!0),x===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return d(t),l.clear(),Xj++,function(){o.forEach(function(h){var f=Zc.get(h)-1,m=a.get(h)-1;Zc.set(h,f),a.set(h,m),f||(vy.has(h)||h.removeAttribute(r),vy.delete(h)),m||h.removeAttribute(n)}),Xj--,Xj||(Zc=new WeakMap,Zc=new WeakMap,vy=new WeakMap,by={})}},E0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=sge(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),age(r,s,n,"aria-hidden")):function(){return null}},I2="Dialog",[EV,_7e]=dpe(I2),[oge,oi]=EV(I2),AV=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=y.useRef(null),c=y.useRef(null),[u=!1,d]=ni({prop:r,defaultProp:s,onChange:a});return i.jsx(oge,{scope:t,triggerRef:l,contentRef:c,contentId:Kr(),titleId:Kr(),descriptionId:Kr(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(h=>!h),[d]),modal:o,children:n})};AV.displayName=I2;var PV="DialogTrigger",TV=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(PV,n),a=Ce(t,s.triggerRef);return i.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":D2(s.open),...r,ref:a,onClick:ge(e.onClick,s.onOpenToggle)})});TV.displayName=PV;var $2="DialogPortal",[lge,OV]=EV($2,{forceMount:void 0}),RV=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=oi($2,t);return i.jsx(lge,{scope:t,forceMount:n,children:y.Children.map(r,o=>i.jsx(j0,{present:n||a.open,children:i.jsx(iz,{asChild:!0,container:s,children:o})}))})};RV.displayName=$2;var _v="DialogOverlay",MV=y.forwardRef((e,t)=>{const n=OV(_v,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=oi(_v,e.__scopeDialog);return a.modal?i.jsx(j0,{present:r||a.open,children:i.jsx(cge,{...s,ref:t})}):null});MV.displayName=_v;var cge=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(_v,n);return i.jsx(_V,{as:Ta,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(ve.div,{"data-state":D2(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ec="DialogContent",IV=y.forwardRef((e,t)=>{const n=OV(Ec,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=oi(Ec,e.__scopeDialog);return i.jsx(j0,{present:r||a.open,children:a.modal?i.jsx(uge,{...s,ref:t}):i.jsx(dge,{...s,ref:t})})});IV.displayName=Ec;var uge=y.forwardRef((e,t)=>{const n=oi(Ec,e.__scopeDialog),r=y.useRef(null),s=Ce(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return E0(a)},[]),i.jsx($V,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ge(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ge(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:ge(e.onFocusOutside,a=>a.preventDefault())})}),dge=y.forwardRef((e,t)=>{const n=oi(Ec,e.__scopeDialog),r=y.useRef(!1),s=y.useRef(!1);return i.jsx($V,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),$V=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=oi(Ec,n),c=y.useRef(null),u=Ce(t,c);return Spe(),i.jsxs(i.Fragment,{children:[i.jsx(lg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(kE,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":D2(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(hge,{titleId:l.titleId}),i.jsx(mge,{contentRef:c,descriptionId:l.descriptionId})]})]})}),L2="DialogTitle",LV=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(L2,n);return i.jsx(ve.h2,{id:s.titleId,...r,ref:t})});LV.displayName=L2;var DV="DialogDescription",FV=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(DV,n);return i.jsx(ve.p,{id:s.descriptionId,...r,ref:t})});FV.displayName=DV;var BV="DialogClose",zV=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=oi(BV,n);return i.jsx(ve.button,{type:"button",...r,ref:t,onClick:ge(e.onClick,()=>s.onOpenChange(!1))})});zV.displayName=BV;function D2(e){return e?"open":"closed"}var UV="DialogTitleWarning",[C7e,VV]=upe(UV,{contentName:Ec,titleName:L2,docsSlug:"dialog"}),hge=({titleId:e})=>{const t=VV(UV),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 833 834If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 835 836For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},fge="DialogDescriptionWarning",mge=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${VV(fge).contentName}}.`;return y.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},WV=AV,HV=TV,qV=RV,A0=MV,P0=IV,T0=LV,O0=FV,KV=zV;const yt=WV,hn=HV,pge=qV,GV=y.forwardRef(({className:e,...t},n)=>i.jsx(A0,{ref:n,className:fe("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}));GV.displayName=A0.displayName;const mt=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(pge,{children:[i.jsx(GV,{}),i.jsxs(P0,{ref:r,className:fe("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:rou
836nded-lg",e),...n,children:[t,i.jsxs(KV,{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:[i.jsx(hh,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mt.displayName=P0.displayName;const xt=({className:e,...t})=>i.jsx("div",{className:fe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});xt.displayName="DialogHeader";const vk=({className:e,...t})=>i.jsx("div",{className:fe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});vk.displayName="DialogFooter";const vt=y.forwardRef(({className:e,...t},n)=>i.jsx(T0,{ref:n,className:fe("text-lg font-semibold leading-none tracking-tight",e),...t}));vt.displayName=T0.displayName;const $i=y.forwardRef(({className:e,...t},n)=>i.jsx(O0,{ref:n,className:fe("text-sm text-muted-foreground",e),...t}));$i.displayName=O0.displayName;var gge=y.createContext(void 0);function R0(e){const t=y.useContext(gge);return e||t||"ltr"}function bk(e,[t,n]){return Math.min(n,Math.max(t,e))}function yge(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var F2="ScrollArea",[YV,E7e]=kr(F2),[xge,As]=YV(F2),XV=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:a=600,...o}=e,[l,c]=y.useState(null),[u,d]=y.useState(null),[h,f]=y.useState(null),[m,g]=y.useState(null),[p,x]=y.useState(null),[v,b]=y.useState(0),[w,j]=y.useState(0),[S,N]=y.useState(!1),[k,_]=y.useState(!1),C=Ce(t,E=>c(E)),A=R0(s);return i.jsx(xge,{scope:n,type:r,dir:A,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:d,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:N,scrollbarY:p,onScrollbarYChange:x,scrollbarYEnabled:k,onScrollbarYEnabledChange:_,onCornerWidthChange:b,onCornerHeightChange:j,children:i.jsx(ve.div,{dir:A,...o,ref:C,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});XV.displayName=F2;var JV="ScrollAreaViewport",QV=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...a}=e,o=As(JV,n),l=y.useRef(null),c=Ce(t,l,o.onViewportChange);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(ve.div,{"data-radix-scroll-area-viewport":"",...a,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:i.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});QV.displayName=JV;var Yi="ScrollAreaScrollbar",B2=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=As(Yi,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=s,l=e.orientation==="horizontal";return y.useEffect(()=>(l?a(!0):o(!0),()=>{l?a(!1):o(!1)}),[l,a,o]),s.type==="hover"?i.jsx(vge,{...r,ref:t,forceMount:n}):s.type==="scroll"?i.jsx(bge,{...r,ref:t,forceMount:n}):s.type==="auto"?i.jsx(ZV,{...r,ref:t,forceMount:n}):s.type==="always"?i.jsx(z2,{...r,ref:t}):null});B2.displayName=Yi;var vge=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=As(Yi,e.__scopeScrollArea),[a,o]=y.useState(!1);return y.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),i.jsx(es,{present:n||a,children:i.jsx(ZV,{"data-state":a?"visible":"hidden",...r,ref:t})})}),bge=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=As(Yi,e.__scopeScrollArea),a=e.orientation==="horizontal",o=I0(()=>c("SCROLL_END"),100),[l,c]=yge("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return y.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,s.scrollHideDelay,c]),y.useEffect(()=>{const u=s.viewport,d=a?"scrollLeft":"scrollTop";if(u){let h=u[d];const f=()=>{const m=u[d];h!==m&&(c("SCROLL"),o()),h=m};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,a,c,o]),i.jsx(es,{present:n||l!=="hidden",children:i.jsx(z2,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ge(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:ge(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),ZV=y.forwardRef((e,t)=>
vendor: 3,117 bytes, line 836
836{const n=As(Yi,e.__scopeScrollArea),{forceMount:r,...s}=e,[a,o]=y.useState(!1),l=e.orientation==="horizontal",c=I0(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?u:d)}},10);return Fd(n.viewport,c),Fd(n.content,c),i.jsx(es,{present:r||a,children:i.jsx(z2,{"data-state":a?"visible":"hidden",...s,ref:t})})}),z2=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=As(Yi,e.__scopeScrollArea),a=y.useRef(null),o=y.useRef(0),[l,c]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=sW(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>a.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function h(f,m){return _ge(f,o.current,l,m)}return n==="horizontal"?i.jsx(wge,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const f=s.viewport.scrollLeft,m=$I(f,l,s.dir);a.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=h(f,s.dir))}}):n==="vertical"?i.jsx(jge,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const f=s.viewport.scrollTop,m=$I(f,l);a.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=h(f))}}):null}),wge=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=As(Yi,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),u=Ce(t,c,a.onScrollbarXChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(tW,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":M0(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(a.viewport){const f=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),aW(f,h)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Ev(o.paddingLeft),paddingEnd:Ev(o.paddingRight)}})}})}),jge=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,a=As(Yi,e.__scopeScrollArea),[o,l]=y.useState(),c=y.useRef(null),u=Ce(t,c,a.onScrollbarYChange);return y.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),i.jsx(tW,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":M0(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(a.viewport){const f=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),aW(f,h)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:
vendor: 5,509 bytes, line 836
836a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Ev(o.paddingTop),paddingEnd:Ev(o.paddingBottom)}})}})}),[Sge,eW]=YV(Yi),tW=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...f}=e,m=As(Yi,n),[g,p]=y.useState(null),x=Ce(t,C=>p(C)),v=y.useRef(null),b=y.useRef(""),w=m.viewport,j=r.content-r.viewport,S=dt(d),N=dt(c),k=I0(h,10);function _(C){if(v.current){const A=C.clientX-v.current.left,E=C.clientY-v.current.top;u({x:A,y:E})}}return y.useEffect(()=>{const C=A=>{const E=A.target;(g==null?void 0:g.contains(E))&&S(A,j)};return document.addEventListener("wheel",C,{passive:!1}),()=>document.removeEventListener("wheel",C,{passive:!1})},[w,g,j,S]),y.useEffect(N,[r,N]),Fd(g,k),Fd(m.content,k),i.jsx(Sge,{scope:n,scrollbar:g,hasThumb:s,onThumbChange:dt(a),onThumbPointerUp:dt(o),onThumbPositionChange:N,onThumbPointerDown:dt(l),children:i.jsx(ve.div,{...f,ref:x,style:{position:"absolute",...f.style},onPointerDown:ge(e.onPointerDown,C=>{C.button===0&&(C.target.setPointerCapture(C.pointerId),v.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),_(C))}),onPointerMove:ge(e.onPointerMove,_),onPointerUp:ge(e.onPointerUp,C=>{const A=C.target;A.hasPointerCapture(C.pointerId)&&A.releasePointerCapture(C.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=""),v.current=null})})})}),Cv="ScrollAreaThumb",nW=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=eW(Cv,e.__scopeScrollArea);return i.jsx(es,{present:n||s.hasThumb,children:i.jsx(Nge,{ref:t,...r})})}),Nge=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,a=As(Cv,n),o=eW(Cv,n),{onThumbPositionChange:l}=o,c=Ce(t,h=>o.onThumbChange(h)),u=y.useRef(),d=I0(()=>{u.current&&(u.current(),u.current=void 0)},100);return y.useEffect(()=>{const h=a.viewport;if(h){const f=()=>{if(d(),!u.current){const m=Cge(h,l);u.current=m,l()}};return l(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[a.viewport,d,l]),i.jsx(ve.div,{"data-state":o.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ge(e.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),g=h.clientX-m.left,p=h.clientY-m.top;o.onThumbPointerDown({x:g,y:p})}),onPointerUp:ge(e.onPointerUp,o.onThumbPointerUp)})});nW.displayName=Cv;var U2="ScrollAreaCorner",rW=y.forwardRef((e,t)=>{const n=As(U2,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?i.jsx(kge,{...e,ref:t}):null});rW.displayName=U2;var kge=y.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=As(U2,n),[a,o]=y.useState(0),[l,c]=y.useState(0),u=!!(a&&l);return Fd(s.scrollbarX,()=>{var h;const d=((h=s.scrollbarX)==null?void 0:h.offsetHeight)||0;s.onCornerHeightChange(d),c(d)}),Fd(s.scrollbarY,()=>{var h;const d=((h=s.scrollbarY)==null?void 0:h.offsetWidth)||0;s.onCornerWidthChange(d),o(d)}),u?i.jsx(ve.div,{...r,ref:t,style:{width:a,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ev(e){return e?parseInt(e,10):0}function sW(e,t){const n=e/t;return isNaN(n)?0:n}function M0(e){const t=sW(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _ge(e,t,n,r="ltr"){const s=M0(n),a=s/2,o=t||a,l=s-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return iW([c,u],h)(e)}function $I(e,t,n="ltr"){const r=M0(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-s,o=t.content-t.viewport,l=a-r,c=n==="ltr"?[0,o]:[o*-1,0],u=bk(e,c);return iW([0,o],[0,l])(u)}function iW(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function aW(e,t){return e>0&&e<t}var Cge=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,l=n.top!==a.top;(o||l)&&t(),n=a,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function I0(e,t){const n=dt(e),r=y.useRef(0);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),y.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Fd(e,t){const n=dt(t);Nt(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var oW=XV,Ege=QV,Age=rW;const Zu=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(oW,{ref:r,className:fe("relative overflow-hidden",e),...n,children:[i.jsx(Ege,{className:"h-full w-full rounded-[inherit]",children:t}),i.jsx(lW,{}),i.jsx(Age,{})]}));Zu.displayName=oW.displayName;const lW=y.forwardRef(({className:e,orientation:t="vertical",...n},r)=>i.jsx(B2,{ref:r,orientation:t,className:fe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:i.jsx(nW,{className:"relative flex-1 rounded-full bg-border"})}));
vendor: 9,323 bytes, lines 836-839
836lW.displayName=B2.displayName;var Pge="DismissableLayer",wk="dismissableLayer.update",Tge="dismissableLayer.pointerDownOutside",Oge="dismissableLayer.focusOutside",LI,cW=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uW=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=y.useContext(cW),[d,h]=y.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),g=Ce(t,k=>h(k)),p=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(x),b=d?p.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=v,S=Ige(k=>{const _=k.target,C=[...u.branches].some(A=>A.contains(_));!j||C||(s==null||s(k),o==null||o(k),k.defaultPrevented||l==null||l())},f),N=$ge(k=>{const _=k.target;[...u.branches].some(A=>A.contains(_))||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},f);return Gp(k=>{b===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(LI=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),DI(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=LI)}},[d,f,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),DI())},[d,u]),y.useEffect(()=>{const k=()=>m({});return document.addEventListener(wk,k),()=>document.removeEventListener(wk,k)},[]),i.jsx(ve.div,{...c,ref:g,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ge(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ge(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ge(e.onPointerDownCapture,S.onPointerDownCapture)})});uW.displayName=Pge;var Rge="DismissableLayerBranch",Mge=y.forwardRef((e,t)=>{const n=y.useContext(cW),r=y.useRef(null),s=Ce(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(ve.div,{...e,ref:s})});Mge.displayName=Rge;function Ige(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){dW(Tge,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $ge(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&dW(Oge,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function DI(){const e=new CustomEvent(wk);document.dispatchEvent(e)}function dW(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?uh(s,a):s.dispatchEvent(a)}var Jj=0;function Lge(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??FI()),document.body.insertAdjacentElement("beforeend",e[1]??FI()),Jj++,()=>{Jj===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Jj--}},[])}function FI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Dge="Portal",hW=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=y.useState(!1);Nt(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ch.createPortal(i.jsx(ve.div,{...r,ref:t}),o):null});hW.displayName=Dge;function V2(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var xo=function(){return xo=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},xo.apply(this,arguments)};function Fge(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Bge(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;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 fW=N0(),Qj=function(){},$0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Qj,onWheelCapture:Qj,onTouchMoveCapture:Qj}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,m=e.noIsolation,g=e.inert,p=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,b=e.gapMode,w=Fge(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,S=S0([n,t]),N=xo(xo({},w),s);return y.createElement(y.Fragment,null,d&&y.createElement(j,{sideCar:fW,removeScrollBar:u,shards:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!p,lockRef:n,gapMode:b}),o?y.cloneElement(y.Children.only(l),xo(xo({},N),{ref:S})):y.createElement(v,xo({},N,{className:c,ref:S}),l))});$0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$0.classNames={fullWidth:fc,zeroRight:hc};var jk=!1;if(typeof window<"u")try{var wy=Object.defineProperty({},"passive",{get:function(){return jk=!0,!0}});window.addEventListener("test",wy,wy),window.removeEventListener("test",wy,wy)}catch{jk=!1}var eu=jk?{passive:!1}:!1,zge=function(e){return e.tagName==="TEXTAREA"},mW=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!zge(e)&&n[t]==="visible")},Uge=function(e){return mW(e,"overflowY")},Vge=function(e){return mW(e,"overflowX")},BI=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=pW(e,r);if(s){var a=gW(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Wge=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Hge=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},pW=function(e,t){return e==="v"?Uge(t):Vge(t)},gW=function(e,t){return e==="v"?Wge(t):Hge(t)},qge=function(e,t){return e==="h"&&t==="rtl"?-1:1},Kge=function(e,t,n,r,s){var a=qge(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,h=0,f=0;do{var m=gW(e,l),g=m[0],p=m[1],x=m[2],v=p-x-a*g;(g||v)&&pW(e,l)&&(h+=v,f+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(u=!0),u},jy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zI=function(e){return[e.deltaX,e.deltaY]},UI=function(e){return e&&"current"in e?e.current:e},Gge=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Yge=function(e){return` 837 .block-interactivity-`.concat(e,` {pointer-events: none;} 838 .allow-interactivity-`).concat(e,` {pointer-events: all;} 839`)},Xge=0,tu=[];function Jge(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(Xge++)[0],a=y.useState(cg)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=Bge([e.lockRef.current],(e.shards||[]).map(UI),!0).filter(Boolean);return p.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(p,x){if("touches"in p&&p.touches.length===2)return!o.current.allowPinchZoom;var v=jy(p),b=n.current,w="deltaX"in p?p.deltaX:b[0]-v[0],j="deltaY"in p?p.deltaY:b[1]-v[1],S,N=p.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in p&&k==="h"&&N.type==="range")return!1;var _=BI(k,N);if(!_)return!0;if(_?S=k:(S=k==="v"?"h":"v",_=BI(k,N)),!_)return!1;if(!r.current&&"changedTouches"in p&&(w||j)&&(r.current=S),!S)return!0;var C=r.current||S;return Kge(C,x,p,C==="h"?w:j,!0)},[]),c=y.useCallback(function(p){var x=p;if(!(!tu.length||tu[tu.length-1]!==a)){var v="deltaY"in x?zI(x):jy(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&Gge(S.delta,v)}
vendor: 4,136 bytes, line 839
839)[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(UI).filter(Boolean).filter(function(S){return S.contains(x.target)}),j=w.length>0?l(x,w[0]):!o.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),u=y.useCallback(function(p,x,v,b){var w={name:p,delta:x,target:v,should:b,shadowParent:Qge(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=y.useCallback(function(p){n.current=jy(p),r.current=void 0},[]),h=y.useCallback(function(p){u(p.type,zI(p),p.target,l(p,e.lockRef.current))},[]),f=y.useCallback(function(p){u(p.type,jy(p),p.target,l(p,e.lockRef.current))},[]);y.useEffect(function(){return tu.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,eu),document.addEventListener("touchmove",c,eu),document.addEventListener("touchstart",d,eu),function(){tu=tu.filter(function(p){return p!==a}),document.removeEventListener("wheel",c,eu),document.removeEventListener("touchmove",c,eu),document.removeEventListener("touchstart",d,eu)}},[]);var m=e.removeScrollBar,g=e.inert;return y.createElement(y.Fragment,null,g?y.createElement(a,{styles:Yge(s)}):null,m?y.createElement(C0,{gapMode:e.gapMode}):null)}function Qge(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Zge=k0(fW,Jge);var yW=y.forwardRef(function(e,t){return y.createElement($0,xo({},e,{ref:t,sideCar:Zge}))});yW.classNames=$0.classNames;var eye=[" ","Enter","ArrowUp","ArrowDown"],tye=[" ","Enter"],ug="Select",[L0,D0,nye]=dE(ug),[Nh,A7e]=kr(ug,[nye,gh]),F0=gh(),[rye,fl]=Nh(ug),[sye,iye]=Nh(ug),xW=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:f,required:m}=e,g=F0(t),[p,x]=y.useState(null),[v,b]=y.useState(null),[w,j]=y.useState(!1),S=R0(u),[N=!1,k]=ni({prop:r,defaultProp:s,onChange:a}),[_,C]=ni({prop:o,defaultProp:l,onChange:c}),A=y.useRef(null),E=p?!!p.closest("form"):!0,[P,$]=y.useState(new Set),R=Array.from(P).map(L=>L.props.value).join(";");return i.jsx(IE,{...g,children:i.jsxs(rye,{required:m,scope:t,trigger:p,onTriggerChange:x,valueNode:v,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:j,contentId:Kr(),value:_,onValueChange:C,open:N,onOpenChange:k,dir:S,triggerPointerDownPosRef:A,disabled:f,children:[i.jsx(L0.Provider,{scope:t,children:i.jsx(sye,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(L=>{$(D=>new Set(D).add(L))},[]),onNativeOptionRemove:y.useCallback(L=>{$(D=>{const I=new Set(D);return I.delete(L),I})},[]),children:n})}),E?i.jsxs(VW,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:h,value:_,onChange:L=>C(L.target.value),disabled:f,children:[_===void 0?i.jsx("option",{value:""}):null,Array.from(P)]},R):null]})})};xW.displayName=ug;var vW="SelectTrigger",bW=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,a=F0(n),o=fl(vW,n),l=o.disabled||r,c=Ce(t,o.onTriggerChange),u=D0(n),[d,h,f]=WW(g=>{const p=u().filter(b=>!b.disabled),x=p.find(b=>b.value===o.value),v=HW(p,g,x);v!==void 0&&o.onValueChange(v.value)}),m=()=>{l||(o.onOpenChange(!0),f())};return i.jsx(e0,{asChild:!0,...a,children:i.jsx(ve.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:l,"data-disabled":l?"":void 0,"data-placeholder":UW(o.value)?"":void 0,...s,ref:c,onClick:ge(s.onClick,g=>{g.currentTarget.focus()}),onPointerDown:ge(s.onPointerDown,g=>{const p=g.target;p.hasPointerCapture(g.pointerId)&&p.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(m(),o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)},g.preventDefault())}),onKeyDown:ge(s.onKeyDown,g=>{const p=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(p&&g.key===" ")&&eye.includes(g.key)&&(m(),g.preventDefault())})})})});bW.displayName=vW;var wW="SelectValue",jW=y.forwardRef((e,t)=>
vendor: 15,201 bytes, line 839
839{const{__scopeSelect:n,className:r,style:s,children:a,placeholder:o="",...l}=e,c=fl(wW,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,h=Ce(t,c.onValueNodeChange);return Nt(()=>{u(d)},[u,d]),i.jsx(ve.span,{...l,ref:h,style:{pointerEvents:"none"},children:UW(c.value)?i.jsx(i.Fragment,{children:o}):a})});jW.displayName=wW;var aye="SelectIcon",SW=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return i.jsx(ve.span,{"aria-hidden":!0,...s,ref:t,children:r||"â¼"})});SW.displayName=aye;var oye="SelectPortal",NW=e=>i.jsx(hW,{asChild:!0,...e});NW.displayName=oye;var Ac="SelectContent",kW=y.forwardRef((e,t)=>{const n=fl(Ac,e.__scopeSelect),[r,s]=y.useState();if(Nt(()=>{s(new DocumentFragment)},[]),!n.open){const a=r;return a?ol.createPortal(i.jsx(_W,{scope:e.__scopeSelect,children:i.jsx(L0.Slot,{scope:e.__scopeSelect,children:i.jsx("div",{children:e.children})})}),a):null}return i.jsx(CW,{...e,ref:t})});kW.displayName=Ac;var oa=10,[_W,ml]=Nh(Ac),lye="SelectContentImpl",CW=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:g,hideWhenDetached:p,avoidCollisions:x,...v}=e,b=fl(Ac,n),[w,j]=y.useState(null),[S,N]=y.useState(null),k=Ce(t,G=>j(G)),[_,C]=y.useState(null),[A,E]=y.useState(null),P=D0(n),[$,R]=y.useState(!1),L=y.useRef(!1);y.useEffect(()=>{if(w)return E0(w)},[w]),Lge();const D=y.useCallback(G=>{const[ce,...ee]=P().map(Q=>Q.ref.current),[le]=ee.slice(-1),he=document.activeElement;for(const Q of G)if(Q===he||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===ce&&S&&(S.scrollTop=0),Q===le&&S&&(S.scrollTop=S.scrollHeight),Q==null||Q.focus(),document.activeElement!==he))return},[P,S]),I=y.useCallback(()=>D([_,w]),[D,_,w]);y.useEffect(()=>{$&&I()},[$,I]);const{onOpenChange:M,triggerPointerDownPosRef:H}=b;y.useEffect(()=>{if(w){let G={x:0,y:0};const ce=le=>{var he,Q;G={x:Math.abs(Math.round(le.pageX)-(((he=H.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(le.pageY)-(((Q=H.current)==null?void 0:Q.y)??0))}},ee=le=>{G.x<=10&&G.y<=10?le.preventDefault():w.contains(le.target)||M(!1),document.removeEventListener("pointermove",ce),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",ee,{capture:!0})}}},[w,M,H]),y.useEffect(()=>{const G=()=>M(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[M]);const[T,B]=WW(G=>{const ce=P().filter(he=>!he.disabled),ee=ce.find(he=>he.ref.current===document.activeElement),le=HW(ce,G,ee);le&&setTimeout(()=>le.ref.current.focus())}),Y=y.useCallback((G,ce,ee)=>{const le=!L.current&&!ee;(b.value!==void 0&&b.value===ce||le)&&(C(G),le&&(L.current=!0))},[b.value]),O=y.useCallback(()=>w==null?void 0:w.focus(),[w]),W=y.useCallback((G,ce,ee)=>{const le=!L.current&&!ee;(b.value!==void 0&&b.value===ce||le)&&E(G)},[b.value]),X=r==="popper"?Sk:EW,J=X===Sk?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:g,hideWhenDetached:p,avoidCollisions:x}:{};return i.jsx(_W,{scope:n,content:w,viewport:S,onViewportChange:N,itemRefCallback:Y,selectedItem:_,onItemLeave:O,itemTextRefCallback:W,focusSelectedItem:I,selectedItemText:A,position:r,isPositioned:$,searchRef:T,children:i.jsx(yW,{as:Ta,allowPinchZoom:!0,children:i.jsx(lg,{asChild:!0,trapped:b.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:ge(s,G=>{var ce;(ce=b.trigger)==null||ce.focus({preventScroll:!0}),G.preventDefault()}),children:i.jsx(uW,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:i.jsx(X,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:G=>G.preventDefault(),...v,...J,onPlaced:()=>R(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ge(v.onKeyDown,G=>{const ce=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!ce&&G.key.length===1&&B(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let le=P().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(G.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const he=G.target,Q=le.indexOf(he);le=le.slice(Q+1)}setTimeout(()=>D(le)),G.preventDefault()}})})})})})})});CW.displayName=lye;var cye="SelectItemAlignedPosition",EW=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,a=fl(Ac,n),o=ml(Ac,n),[l,c]=y.useState(null),[u,d]=y.useState(null),h=Ce(t,k=>d(k)),f=D0(n),m=y.useRef(!1),g=y.useRef(!0),{viewport:p,selectedItem:x,selectedItemText:v,focusSelectedItem:b}=o,w=y.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&p&&x&&v){const k=a.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),C=a.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(a.dir!=="rtl"){const he=A.left-_.left,Q=C.left-he,Re=k.left-Q,Te=k.width+Re,ot=Math.max(Te,_.width),Qe=window.innerWidth-oa,zt=bk(Q,[oa,Qe-ot]);l.style.minWidth=Te+"px",l.style.left=zt+"px"}else{const he=_.right-A.right,Q=window.innerWidth-C.right-he,Re=window.innerWidth-k.right-Q,Te=k.width+Re,ot=Math.max(Te,_.width),Qe=window.innerWidth-oa,zt=bk(Q,[oa,Qe-ot]);l.style.minWidth=Te+"px",l.style.right=zt+"px"}const E=f(),P=window.innerHeight-oa*2,$=p.scrollHeight,R=window.getComputedStyle(u),L=parseInt(R.borderTopWidth,10),D=parseInt(R.paddingTop,10),I=parseInt(R.borderBottomWidth,10),M=parseInt(R.paddingBottom,10),H=L+D+$+M+I,T=Math.min(x.offsetHeight*5,H),B=window.getComputedStyle(p),Y=parseInt(B.paddingTop,10),O=parseInt(B.paddingBottom,10),W=k.top+k.height/2-oa,X=P-W,J=x.offsetHeight/2,G=x.offsetTop+J,ce=L+D+G,ee=H-ce;if(ce<=W){const he=x===E[E.length-1].ref.current;l.style.bottom="0px";const Q=u.clientHeight-p.offsetTop-p.offsetHeight,Re=Math.max(X,J+(he?O:0)+Q+I),Te=ce+Re;l.style.height=Te+"px"}else{const he=x===E[0].ref.current;l.style.top="0px";const Re=Math.max(W,L+p.offsetTop+(he?Y:0)+J)+ee;l.style.height=Re+"px",p.scrollTop=ce-W+p.offsetTop}l.style.margin=`${oa}px 0`,l.style.minHeight=T+"px",l.style.maxHeight=P+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[f,a.trigger,a.valueNode,l,u,p,x,v,a.dir,r]);Nt(()=>w(),[w]);const[j,S]=y.useState();Nt(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const N=y.useCallback(k=>{k&&g.current===!0&&(w(),b==null||b(),g.current=!1)},[w,b]);return i.jsx(dye,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:i.jsx(ve.div,{...s,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});EW.displayName=cye;var uye="SelectPopperPosition",Sk=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=oa,...a}=e,o=F0(n);return i.jsx($E,{...o,...a,ref:t,align:r,collisionPadding:s,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)"}})});Sk.displayName=uye;var[dye,W2]=Nh(Ac,{}),Nk="SelectViewport",AW=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,a=ml(Nk,n),o=W2(Nk,n),l=Ce(t,a.onViewportChange),c=y.useRef(0);return i.jsxs(i.Fragment,{children:[i.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}),i.jsx(L0.Slot,{scope:n,children:i.jsx(ve.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:ge(s.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const m=Math.abs(c.current-d.scrollTop);if(m>0){const g=window.innerHeight-oa*2,p=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),v=Math.max(p,x);if(v<g){const b=v+m,w=Math.min(g,b),j=b-w;h.style.height=w+"px",h.style.bottom==="0px"&&(d.scrollTop=j>0?j:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});AW.displayName=Nk;var PW="SelectGroup",[hye,fye]=Nh(PW),mye=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Kr();return i.jsx(hye,{scope:n,id:s,children:i.jsx(ve.div,{role:"group","aria-labelledby":s,...r,ref:t})})});mye.displayName=PW;var TW="SelectLabel",OW=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=fye(TW,n);return i.jsx(ve.div,{id:s.id,...r,ref:t})});OW.displayName=TW;var Av="SelectItem",[pye,RW]=Nh(Av),MW=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:a,...o}=e,l=fl(Av,n),c=ml(Av,n),u=l.value===r,[d,h]=y.useState(a??""),[f,m]=y.useState(!1),g=Ce(t,v=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,v,r,s)}),p=Kr(),x=()=>{s||(l.onValueChange(r),l.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 i.jsx(pye,{scope:n,value:r,disabled:s,textId:p,isSelected:u,onItemTextChange:y.useCallback(v=>{h(b=>b||((v==null?void 0:v.textContent)??"").trim())},[]),children:i.jsx(L0.ItemSlot,{scope:n,value:r,disabled:s,textValue:d,children:i.jsx(ve.div,{role:"option","aria-labelledby":p,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...o,ref:g,onFocus:ge(o.onFocus,()=>m(!0)),onBlur:ge(o.onBlur,()=>m(!1)),onPointerUp:ge(o.onPointerUp,x),onPointerMove:ge(o.onPointerMove,v=>{var b;s?(b=c.onItemLeave)==null||b.call(c):v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ge(o.onPointerLeave,v=>{var b;v.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:ge(o.onKeyDown,v=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&v.key===" "||(tye.includes(v.key)&&x(),v.key===" "&&v.preventDefault())})})})})});MW.displayName=Av;var Pf="SelectItemText",IW=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...a}=e,o=fl(Pf,n),l=ml(Pf,n),c=RW(Pf,n),u=iye(Pf,n),[d,h]=y.useState(null),f=Ce(t,v=>h(v),c.onItemTextChange,v=>{var b;return(b=l.itemTextRefCallback)==null?void 0:b.call(l,v,c.value,c.disabled)}),m=d==null?void 0:d.textContent,g=y.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:p,onNativeOptionRemove:x}=u;return Nt(()=>(p(g),()=>x(g)),[p,x,g]),i.jsxs(i.Fragment,{children:[i.jsx(ve.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ol.createPortal(a.children,o.valueNode):null]})});IW.displayName=Pf;var $W="SelectItemIndicator",LW=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return RW($W,n).isSelected?i.jsx(ve.span,{"aria-hidden":!0,...r,ref:t}):null});LW.displayName=$W;var kk="SelectScrollUpButton",DW=y.forwardRef((e,t)=>{const n=ml(kk,e.__scopeSelect),r=W2(kk,e.__scopeSelect),[s,a]=y.useState(!1),o=Ce(t,r.onScrollButtonChange);return Nt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(BW,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});DW.displayName=kk;var _k="SelectScrollDownButton",FW=y.forwardRef((e,t)=>{const n=ml(_k,e.__scopeSelect),r=W2(_k,e.__scopeSelect),[s,a]=y.useState(!1),o=Ce(t,r.onScrollButtonChange);return Nt(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?i.jsx(BW,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});FW.displayName=_k;var BW=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,a=ml("SelectScrollButton",n),o=y.useRef(null),l=D0(n),c=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>c(),[c]),Nt(()=>{var d;const u=l().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(ve.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ge(s.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:ge(s.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:ge(s.onPointerLeave,()=>{c()})})}),gye="SelectSeparator",zW=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i.jsx(ve.div,{"aria-hidden":!0,...r,ref:t})});zW.displayName=gye;var Ck="SelectArrow",yye=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=F0(n),a=fl(Ck,n),o=ml(Ck,n);return a.open&&o.position==="popper"?i.jsx(LE,{...s,...r,ref:t}):null});yye.displayName=Ck;function UW(e){return e===""||e===void 0}var VW=y.forwardRef((e,t)=>{const{value:n,...r}=e,s=y.useRef(null),a=Ce(t,s),o=V2(n);return y.useEffect(()=>{const l=s.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==n&&d){const h=new Event("change",{bubbles:!0});d.call(l,n),l.dispatchEvent(h)}},[o,n]),i.jsx(Yp,{asChild:!0,children:i.jsx("select",{...r,ref:a,defaultValue:n})})});VW.displayName="BubbleSelect";function WW(e){const t=dt(e),n=y.useRef(""),r=y.useRef(0),s=y.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,a]}function HW(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=xye(e,Math.max(a,0));s.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function xye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var vye=xW,qW=bW,bye=jW,wye=SW,jye=NW,KW=kW,Sye=AW,GW=OW,YW=MW,Nye=IW,kye=LW,XW=DW,JW=FW,QW=zW;const Ye=vye,Xe=bye,He=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(qW,{ref:r,className:fe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
839ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,i.jsx(wye,{asChild:!0,children:i.jsx(gE,{className:"h-4 w-4 opacity-50"})})]}));He.displayName=qW.displayName;const ZW=y.forwardRef(({className:e,...t},n)=>i.jsx(XW,{ref:n,className:fe("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx($Z,{className:"h-4 w-4"})}));ZW.displayName=XW.displayName;const eH=y.forwardRef(({className:e,...t},n)=>i.jsx(JW,{ref:n,className:fe("flex cursor-default items-center justify-center py-1",e),...t,children:i.jsx(gE,{className:"h-4 w-4"})}));eH.displayName=JW.displayName;const qe=y.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>i.jsx(jye,{children:i.jsxs(KW,{ref:s,className:fe("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:[i.jsx(ZW,{}),i.jsx(Sye,{className:fe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),i.jsx(eH,{})]})}));qe.displayName=KW.displayName;const _ye=y.forwardRef(({className:e,...t},n)=>i.jsx(GW,{ref:n,className:fe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));_ye.displayName=GW.displayName;const oe=y.forwardRef(({className:e,children:t,...n},r)=>i.jsxs(YW,{ref:r,className:fe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(kye,{children:i.jsx($r,{className:"h-4 w-4"})})}),i.jsx(Nye,{children:t})]}));oe.displayName=YW.displayName;const Cye=y.forwardRef(({className:e,...t},n)=>i.jsx(QW,{ref:n,className:fe("-mx-1 my-1 h-px bg-muted",e),...t}));Cye.displayName=QW.displayName;const{slice:Eye,forEach:Aye}=[];function Pye(e){return Aye.call(Eye.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}
vendor: 6,641 bytes, line 839
839function Tye(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const VI=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Oye=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(t);let a=`${e}=${s}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");a+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!VI.test(r.domain))throw new TypeError("option domain is invalid");a+=`; Domain=${r.domain}`}if(r.path){if(!VI.test(r.path))throw new TypeError("option path is invalid");a+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(a+="; HttpOnly"),r.secure&&(a+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(a+="; Partitioned"),a},WI={create(e,t,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=Oye(e,t,s)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var Rye={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return WI.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:a}=t;n&&typeof document<"u"&&WI.create(n,e,r,s,a)}},Mye={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const o=s.substring(1).split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===t&&(n=o[l].substring(c+1))}}return n}},Iye={name:"hash",lookup(e){var s;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:a}=window.location;if(a&&a.length>2){const o=a.substring(1);if(t){const l=o.split("&");for(let c=0;c<l.length;c++){const u=l[c].indexOf("=");u>0&&l[c].substring(0,u)===t&&(r=l[c].substring(u+1))}}if(r)return r;if(!r&&n>-1){const l=a.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(s=l[typeof n=="number"?n:0])==null?void 0:s.replace("/",""):void 0}}}return r}};let nu=null;const HI=()=>{if(nu!==null)return nu;try{if(nu=typeof window<"u"&&window.localStorage!==null,!nu)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{nu=!1}return nu};var $ye={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&HI())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&HI()&&window.localStorage.setItem(n,e)}};let ru=null;const qI=()=>{if(ru!==null)return ru;try{if(ru=typeof window<"u"&&window.sessionStorage!==null,!ru)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{ru=!1}return ru};var Lye={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&qI())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&qI()&&window.sessionStorage.setItem(n,e)}},Dye={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let a=0;a<n.length;a++)t.push(n[a]);r&&t.push(r),s&&t.push(s)}return t.length>0?t:void 0}},Fye={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},Bye={name:"path",lookup(e){var s;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}},zye={name:"subdomain",lookup(e){var s,a;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((a=(s=window.location)==null?void 0:s.hostname)==null?void 0:a.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let tH=!1;try{document.cookie,tH=!0}catch{}const nH=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];tH||nH.splice(1,1);const Uye=()=>({order:nH,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class rH{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=Pye(n,this.options||{},Uye()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Rye),this.addDetector(Mye),this.addDetector($ye),this.addDetector(Lye),this.addDetector(Dye),this.addDetector(Fye),this.addDetector(Bye),this.addDetector(zye),this.addDetector(Iye)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!Tye(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}
839cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}rH.type="languageDetector";const Vye={home:"Home",flocks:"Flocks",log:"Log",finance:"Finance",profile:"Me",market:"Market",social:"Community",learn:"Learn"},Wye={save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",loading:"Loadingâ¦",back:"Back",next:"Next",yes:"Yes",no:"No",search:"Search",language:"Language",listen:"Listen",stop:"Stop",speak:"Speak",readAloud:"Read aloud",stopReading:"Stop reading",voiceInput:"Voice input",stopRecording:"Stop recording",transcribing:"Transcribingâ¦",needHelp:"Still need help?",chatWhatsapp:"Chat on WhatsApp",emailSupport:"Email [email protected]",openHelp:"Open help and tips for this screen"},Hye={title:"AI Vet Consultation",subtitle:"Speak your question â the AI Vet will answer aloud.",voiceReplyOn:"Voice reply on",voiceReplyOff:"Voice reply off",muteReplies:"Mute voice replies",enableReplies:"Enable voice replies",example:`Try: "My chicken is coughing and won't eat â what do I do?"`,tapStop:"Tap to stop",hearing:"Hearing youâ¦",thinking:"AI Vet is thinkingâ¦",tapStopReply:"Tap to stop reply",tapSpeak:"Tap and speak your question",noReply:"No reply â please try again.",unavailable:"AI Vet unavailable. Please try again.",micNeeded:"Allow microphone permission to talk to the AI Vet.",tooShort:"Hold the mic and speak a bit longer.",cantHear:"Could not hear that. Please try again."},qye={observations:"Observations / Notes",observationsPlaceholder:"Any observations... or tap Speak to talk.",save:"Save Log",update:"Update Log"},Kye={title:"My Profile",language:"Language",languageDescription:"Choose your preferred language. The app will update everywhere.",logout:"Log out"},Gye={en:"English",zu:"isiZulu",tn:"Setswana"},Yye={home:{title:"Home â Your Daily Snapshot",intro:"This is your morning dashboard. You'll see today's weather for your farm, your flock health summary, and the most important thing to do today.",tips:["Tap the big middle button (Log) every day to record feed, water and any deaths.","If the weather card warns about heat or cold, give birds extra water and check ventilation.","The daily tip is written by our AI based on your farm â read it aloud with the Listen button."]},flock:{title:"Flocks â Manage Your Birds",intro:"Each card on this page is one group of birds (a flock). Tap a flock to see daily logs, growth, and tips for that group.",tips:["Add a new flock when you bring in chicks â give it a name like 'House 1 Broilers'.","Keep the bird count up to date â it powers your feed and water suggestions.","If birds get sick, open the Health Scanner from inside the flock card."]},"daily-log":{title:"Daily Log â 1-Minute Update",intro:"Spend one minute a day here. Logging feed, water, eggs and deaths is what gives us the data to help your farm.",tips:["Use the microphone button on the Notes field to talk instead of type.","The feed amount is suggested for you â only change it if you fed differently.","Recording 0 deaths is good news â still tap save so your streak continues."]},market:{title:"Marketplace â Buy & Sell",intro:"Sell birds, eggs and supplies to nearby farmers and buyers. Listings need a clear photo and your location.",tips:["Complete your profile to 75% before listing â buyers trust verified sellers more.","Add a real photo of what you're selling, not stock images.","Reply to messages quickly â buyers often message several sellers at once."]},finance:{title:"Finance â Track Your Money",intro:"Record what you spend (feed, medicine) and what you earn (sales). This helps you see if your farm is profitable.",tips:["Add a feed purchase the same day you buy it â easier to remember the price.","Record sales right after the buyer pays so nothing gets lost.","The summary shows your profit for this month â green is good, red means you spent more than you earned."]},social:{title:"Community â Learn From Others",intro:"Connect with other farmers in South Africa. Ask questions, share what's working, and message people directly.",tips:["Use real names and a profile photo â farmers help neighbours, not anonymous accounts.","Search for farmers in your province if you want local advice.","Tap the message icon on any post to start a private chat."]},profile:{title:"My Profile",intro:"Your profile shows other farmers and buyers who you are. A complete profile unlocks the marketplace and premium tools.",tips:["Fill in your farm name, location and a photo to reach 75% completion.","Set your language here â the app will use it across all screens.","Need help? You can reach our support team from this screen."]},default:{title:"Welcome to Flockify",intro:"Flockify helps you track your flock, scan sick birds, sell in the marketplace and learn â all from your phone.",tips:["Tap the round button at the bottom-middle each day to log feed and water.","Look for the speaker icon to have any tip read aloud to you.","Need help? Tap the question mark anytime to see tips for the screen you're on."]},"feed-calculator":{title:"Feed Calculator â Plan Your Feed",intro:"Enter your flock size, age and bird type. We calculate how much feed your birds need each day and each week, and warn you when your stock
839is running low.",tips:["After you change a number, tap the Listen button on the result card to hear how much feed you need.","Update your stock every time you buy a new bag so the days-remaining counter stays correct.","Tap Record Today's Consumption at the end of the day to subtract what the birds ate."]},learning:{title:"Learn â Free Training",intro:"Browse short video and reading lessons on raising healthy birds, vaccinations, feed mixing, marketing and more.",tips:["Start with the basics course if you're new to chickens.","Tap the speaker icon inside a lesson to listen instead of read.","Your progress is saved automatically â come back any time."]},course:{title:"Course Player",intro:"Watch the videos in order. Each lesson has a short quiz to check what you learned.",tips:["Use the Listen button to have written material read aloud.","You can change playback speed on the video for slower or faster learning.","Finish all lessons to earn your certificate."]},pricing:{title:"Plans & Pricing",intro:"Choose the plan that fits your farm. You can change or cancel any time.",tips:["Free is enough to track one small flock and use the basics.","Premium unlocks the AI Health Scanner, full marketplace and unlimited flocks.","Pay monthly with EFT, card or in-app once you've chosen a plan."]},readThisAloud:"Read this aloud"},Xye={listen:"Listen to your brief",score:"Your farm health score is {{score}} out of 100."},Jye={listen:"Listen to results",vetRecommended:"A veterinary visit is recommended."},Qye={listen:"Listen to feed plan",summary:"For {{size}} birds at {{age}} weeks, you need {{daily}} kilograms of {{feedType}} per day, and {{weekly}} kilograms per week. You currently have {{stock}} kilograms in stock, which lasts about {{days}} days."},Zye={nav:Vye,common:Wye,vet:Hye,dailyLog:qye,profile:Kye,languages:Gye,help:Yye,farmBrief:Xye,scanResults:Jye,feedCalc:Qye},exe={home:"Ikhaya",flocks:"Imihlambi",log:"Bhala",finance:"Imali",profile:"Mina",market:"Imakethe",social:"Umphakathi",learn:"Funda"},txe={save:"Gcina",cancel:"Khansela",delete:"Susa",edit:"Hlela",loading:"Iyalayishaâ¦",back:"Buyela",next:"Okulandelayo",yes:"Yebo",no:"Cha",search:"Sesha",language:"Ulimi",listen:"Lalela",stop:"Misa",speak:"Khuluma",readAloud:"Funda ngokuzwakalayo",stopReading:"Misa ukufunda",voiceInput:"Faka ngezwi",stopRecording:"Misa ukuqopha",transcribing:"Iyabhalaâ¦",needHelp:"Usadinga usizo?",chatWhatsapp:"Xoxa nge-WhatsApp",emailSupport:"I-imeyili [email protected]",openHelp:"Vula usizo nemiyalelo yalesi sikrini"},nxe={title:"Ukubonisana ne-AI Vet",subtitle:"Khuluma umbuzo wakho â i-AI Vet izophendula ngezwi.",voiceReplyOn:"Impendulo yezwi ivuliwe",voiceReplyOff:"Impendulo yezwi ivaliwe",muteReplies:"Thulisa izimpendulo zezwi",enableReplies:"Vula izimpendulo zezwi",example:'Zama: "Inkukhu yami iyakhwehlela futhi ayidli â ngenze njani?"',tapStop:"Cindezela ukuze umise",hearing:"Sikuzwaâ¦",thinking:"I-AI Vet iyacabangaâ¦",tapStopReply:"Cindezela ukuze umise impendulo",tapSpeak:"Cindezela bese ukhuluma umbuzo wakho",noReply:"Ayikho impendulo â sicela uzame futhi.",unavailable:"I-AI Vet ayitholakali. Sicela uzame futhi.",micNeeded:"Vumela imvume yemakrofoni ukuze uxoxe ne-AI Vet.",tooShort:"Bamba imakrofoni ukhulume isikhashana eside.",cantHear:"Asikuzwanga lokho. Sicela uzame futhi."},rxe={observations:"Okuqashelwayo / Amanothi",observationsPlaceholder:"Noma yini oyibonile... noma cindezela Khuluma ukuze ukhulume.",save:"Gcina Ibhuku",update:"Vuselela Ibhuku"},sxe={title:"Iphrofayela Yami",language:"Ulimi",languageDescription:"Khetha ulimi olufunayo. Uhlelo luzoshintsha kuyo yonke indawo.",logout:"Phuma"},ixe={en:"isiNgisi",zu:"isiZulu",tn:"isiTswana"},axe={home:{title:"Ikhaya â Isifinyezo Sakho Sansuku Zonke",intro:"Lesi yisikrini sakho sasekuseni. Uzobona isimo sezulu sepulazi lakho namuhla, isifinyezo sempilo yomhlambi wakho, nento ebaluleke kakhulu okumele uyenze namuhla.",tips:["Cindezela inkinobho enkulu emaphakathi (Bhala) nsuku zonke ukuze ubhale ukudla, amanzi nokufa.","Uma ikhadi lesimo sezulu likuxwayisa ngokushisa noma amakhaza, nikeza izinyoni amanzi engeziwe futhi uhlole umoya.","Iseluleko sansuku zonke sibhalwe yi-AI yethu ngokususelwa kwipulazi lakho â silalele ngenkinobho ethi Lalela."]},flock:{title:"Imihlambi â Lawula Izinyoni Zakho",intro:"Ikhadi ngalinye kuleli khasi liwumhlambi owodwa wezinyoni. Cindezela umhlambi ukuze ubone amabhuku ansuku zonke, ukukhula, namasu aleyo qoqo.",tips:["Engeza umhlambi omusha lapho ulanda amachwane â wuthiye igama elifana no-'Indlu 1 Amabroiler'.","Gcina inombolo yezinyoni iqaphelekile â yiyona enika iziphakamiso zokudla namanzi.","Uma izinyoni zigula, vula i-Health Scanner ngaphakathi kwekhadi lomhlambi."]},"daily-log":{title:"Ibhuku Lansuku Zonke â Isibuyekezo Somzuzu Owodwa",intro:"Sebenzisa umzuzu owodwa nsuku zonke lapha. Ukubhala ukudla, amanzi, amaqanda nokufa yikho okusinikeza idatha yokusiza ipulazi lakho.",tips:["Sebenzisa inkinobho yemakrofoni esicelweni samanothi ukuze ukhulume esikhundleni sokubhala.","Inani lokudla liphakanyiselwe wena â lishintshe kuphela uma wondle ngenye indlela.","Ukubhala ukufa okungu-0 yizindaba ezinhle â sicela ucindezele ugcine ukuze ulandelelane lwakho luqhubeke."]},market:{title:"Imakethe â Thenga & Thengisa",intro:"Thengisa izinyoni, amaqanda nezinto kubalimi nabathengi abaseduze. Izinto ozithengisayo zidinga isithombe esicacile nendawo yakho.",tips:["Qedela iphrofayela yakho ifinyelele ku-75% ngaphambi kokuthengisa â abathengi bayabathemba abathengisi abaqinisekisiwe.","Engeza isithombe sangempela salokho okuthengisayo, hhayi izithombe ezilungiselelwe.","Phendula imilayezo ngokushesha â abathengi bavame ukuthumelela abathengisi abaningi."]},finance:{title:"Imali â Landelela Imali Yakho",intro:"Bhala lokho okuchithayo (ukudla, imithi) nalokho okutholayo (ukuthengisa). Lokhu kukusiza ubone ukuthi ipulazi liyazuza yini.",tips:["Engeza ukuthenga ukudla ngosuku olufanayo olukuthenga ngalo â kulula ukukhumbula intengo.","Bhala ukuthengisa ngemva nje kokuba umthengi ekhokhile ukuze kungalahleki lutho.","Isifinyezo sikhombisa inzuzo yakho yale nyanga â okuluhlaza kuhle, okubomvu kusho ukuthi uchithe ngaphezu kwalokho okutholile."]}
839,social:{title:"Umphakathi â Funda Kwabanye",intro:"Xhumana nabanye abalimi eNingizimu Afrika. Buza imibuzo, yabelana ngokusebenzayo, futhi uthumele imilayezo eqondile.",tips:["Sebenzisa amagama angempela nesithombe sephrofayela â abalimi basiza omakhelwane, hhayi ama-akhawunti angaziwa.","Sesha abalimi esifundazweni sakho uma ufuna iseluleko sasendaweni.","Cindezela isithonjana semilayezo kunoma yikuphi okuthunyelwe ukuze uqale ingxoxo eyimfihlo."]},profile:{title:"Iphrofayela Yami",intro:"Iphrofayela yakho ikhombisa abanye abalimi nabathengi ukuthi ungubani. Iphrofayela ephelele ivula imakethe namathuluzi e-premium.",tips:["Gcwalisa igama lepulazi, indawo nesithombe ukuze ufinyelele ku-75%.","Setha ulimi lwakho lapha â uhlelo luzosebenzisa kuwo wonke amaskrini.","Udinga usizo? Ungaxhumana neqembu lethu lokusekela kulesi sikrini."]},default:{title:"Sawubona ku-Flockify",intro:"I-Flockify ikusiza ulandelele umhlambi wakho, uskene izinyoni ezigulayo, uthengise emakethe futhi ufunde â konke kusuka kufoni yakho.",tips:["Cindezela inkinobho eyindilinga emaphakathi ngezansi nsuku zonke ukuze ubhale ukudla namanzi.","Bheka isithonjana sesipikha ukuze noma yisiphi iseluleko sifundwe kuwe.","Udinga usizo? Cindezela uphawu lombuzo noma nini ukuze ubone amasu esikrini okusona."]},readThisAloud:"Funda lokhu ngokuzwakalayo"},oxe={listen:"Lalela isifinyezo sakho",score:"Amaphuzu empilo yepulazi lakho angu-{{score}} kwayi-100."},lxe={listen:"Lalela imiphumela",vetRecommended:"Kuyanconywa ukuvakashela udokotela wezilwane."},cxe={listen:"Lalela uhlelo lokudla",summary:"Ezinyonini ezingu-{{size}} ezineviki ezingu-{{age}}, udinga ama-kilogramu angu-{{daily}} we-{{feedType}} ngosuku, kanye nama-kilogramu angu-{{weekly}} ngeviki. Njengamanje unama-kilogramu angu-{{stock}} esitokweni, okuthatha cishe izinsuku ezingu-{{days}}."},uxe={nav:exe,common:txe,vet:nxe,dailyLog:rxe,profile:sxe,languages:ixe,help:axe,farmBrief:oxe,scanResults:lxe,feedCalc:cxe},dxe={home:"Legae",flocks:"Mehlape",log:"Kwala",finance:"Madi",profile:"Nna",market:"Mmaraka",social:"SetÅ¡haba",learn:"Ithuta"},hxe={save:"Boloka",cancel:"Khansela",delete:"Phimola",edit:"Fetola",loading:"E a laelaâ¦",back:"Boela morago",next:"Latelago",yes:"Ee",no:"Nnyaa",search:"Batla",language:"Puo",listen:"Reetsa",stop:"Ema",speak:"Bua",readAloud:"Bala godimo",stopReading:"Ema go bala",voiceInput:"Tsenya ka lentswe",stopRecording:"Ema go gatisa",transcribing:"E a ngwalaâ¦",needHelp:"O sa nyaka thuso?",chatWhatsapp:"Bua ka WhatsApp",emailSupport:"Romela imeile [email protected]",openHelp:"Bula thuso le maele a skrine se"},fxe={title:"Therisano ya AI Vet",subtitle:"Bua potso ya gago â AI Vet e tla araba ka lentswe.",voiceReplyOn:"Karabo ya lentswe e butswe",voiceReplyOff:"Karabo ya lentswe e tswetswe",muteReplies:"Didimatsa dikarabo tsa lentswe",enableReplies:"Bula dikarabo tsa lentswe",example:'Leka: "Koko ya me e a gohlola e bile ga e je â ke dire eng?"',tapStop:"Tobetsa go emisa",hearing:"Re a go utlwaâ¦",thinking:"AI Vet e a akanyaâ¦",tapStopReply:"Tobetsa go emisa karabo",tapSpeak:"Tobetsa o bo o bua potso ya gago",noReply:"Ga go karabo â tsweetswee leka gape.",unavailable:"AI Vet ga e gona. Tsweetswee leka gape.",micNeeded:"Letla tetla ya maekrofounu go bua le AI Vet.",tooShort:"Tshwara maekrofounu mme o bue lebakanyana.",cantHear:"Ga re a go utlwa. Tsweetswee leka gape."},mxe={observations:"Dilemogiwa / Dintlha",observationsPlaceholder:"Dilemogiwa dife le dife... goba tobetsa Bua go bua.",save:"Boloka Lebuka",update:"Mpshafatsa Lebuka"},pxe={title:"Porofaele Ya Ka",language:"Puo",languageDescription:"Kgetha puo yeo o e ratago. Sediriswa se tla fetoga gohle.",logout:"Tswa"},gxe={en:"Seesimane",zu:"isiZulu",tn:"Setswana"},yxe={home:{title:"Legae â Kakaretso Ya LetÅ¡atÅ¡i",intro:"Se ke seborotlolo sa gago sa mosong. O tla bona boemo bja leratadima bja polasa ya gago lehono, kakaretso ya maphelo a mohlape wa gago, le selo se bohlokwa kudu seo o swanetÅ¡ego go se dira lehono.",tips:["Tobetsa konope e kgolo ya gare (Kwala) letÅ¡atÅ¡i le letÅ¡atÅ¡i go ngwala dijo, meetse le mahu.","Ge karata ya boemo bja leratadima e lemoÅ¡a ka go fiÅ¡a goba ka go tonya, fa dinonyana meetse a oketÅ¡egilego o lekole moya.","Lekgetlo la letÅ¡atÅ¡i le letÅ¡atÅ¡i le ngwadilwe ke AI ya rena go ya ka polasa ya gago â le reetse ka konope ya Reetsa."]}
839,flock:{title:"Mehlape â Laola Dinonyana TÅ¡a Gago",intro:"Karata e nngwe le e nngwe leloko le ke sehlopha se tee sa dinonyana (mohlape). Tobetsa mohlape go bona dipuku tÅ¡a letÅ¡atÅ¡i, kgolo le maele.",tips:["Tlaleletsa mohlape o mofsa ge o tliÅ¡a bana ba dikgogo â o fe leina go swana le 'Ntlo 1 Diboroilara'.","Boloka palo ya dinonyana e nepagetÅ¡ego â ke yona e tliÅ¡ago dikgakanyo tÅ¡a dijo le meetse.","Ge dinonyana di lwala, bula Health Scanner ka gare ga karata ya mohlape."]},"daily-log":{title:"Lebuka La LetÅ¡atÅ¡i â MpshafatÅ¡o Ya Motsotso",intro:"DiriÅ¡a motsotso o tee letÅ¡atÅ¡i le letÅ¡atÅ¡i mo. Go ngwala dijo, meetse, mae le mahu ke seo se re fago datha ya go thuÅ¡a polasa ya gago.",tips:["DiriÅ¡a konope ya maekrofone karolong ya Dintlha go bua go e na le go ngwala.","BontÅ¡i bja dijo bo Å¡iÅ¡inywe go wena â bo fetole fela ge o fepile ka tsela e fapanego.","Go ngwala mahu a 0 ke ditaba tÅ¡e dibotse â eupÅ¡a tobetsa boloka gore tatelano ya gago e tÅ¡wele pele."]},market:{title:"Mmaraka â Reka Le RekiÅ¡a",intro:"RekiÅ¡a dinonyana, mae le didiriÅ¡wa go balemi le bareki ba kgaufsi. DirekiÅ¡wa di nyaka senepe se se hlakilego le lefelo la gago.",tips:["TlatÅ¡a porofaele ya gago go fihla go 75% pele o rekiÅ¡a â bareki ba tshepa barekiÅ¡i ba netefaditÅ¡wego.","Tlaleletsa senepe sa nnete sa seo o se rekiÅ¡ago, e sego dinepe tÅ¡e di lokiÅ¡itÅ¡wego.","Araba melaetÅ¡a ka pela â bareki gantÅ¡i ba romela barekiÅ¡i ba bantÅ¡i."]},finance:{title:"Madi â Latela Madi A Gago",intro:"Ngwala seo o se diriÅ¡ago (dijo, dihlare) le seo o se hwetÅ¡ago (direkiÅ¡o). Se se go thuÅ¡a go bona ge polasa ya gago e hwetÅ¡a poelo.",tips:["Tlaleletsa theko ya dijo letÅ¡atÅ¡ing leo o di rekilego ka lona â go bonolo go gopola theko.","Ngwala direkiÅ¡o morago ga ge moreki a lefile gore go se lahlegile.","Kakaretso e bontÅ¡ha poelo ya gago ya kgwedi ye â botala bo bobotse, bohwibidu bo ra gore o diriÅ¡itÅ¡e go feta tÅ¡eo o di hweditÅ¡ego."]},social:{title:"SetÅ¡haba â Ithuta Go Ba Bangwe",intro:"Kopana le balemi ba bangwe Afrika Borwa. BotÅ¡iÅ¡a dipotÅ¡iÅ¡o, abelana ka tÅ¡eo di Å¡omago, o romele molaetÅ¡a go batho ka go thwii.",tips:["DiriÅ¡a maina a nnete le senepe sa porofaele â balemi ba thuÅ¡a bo-moagi, e sego di-akhaonto tÅ¡e di sa tsebjego.","Batla balemi ba profenseng ya gago ge o nyaka maele a selegae.","Tobetsa leswao la molaetÅ¡a go go ngwadilwego le ge le le lefe go thoma polediÅ¡ano ya sephiri."]},profile:{title:"Porofaele Ya Ka",intro:"Porofaele ya gago e bontÅ¡ha balemi ba bangwe le bareki gore o mang. Porofaele e tletÅ¡ego e bula mmaraka le didiriÅ¡wa tÅ¡a premium.",tips:["TlatÅ¡a leina la polasa, lefelo le senepe go fihla go 75%.","Beakanya puo ya gago mo â sediriswa se tla e diriÅ¡a go diskrine tÅ¡ohle.","O nyaka thuso? O ka kopana le sehlopha sa rena sa thekgo go skrine se."]},default:{title:"Dumela go Flockify",intro:"Flockify e go thuÅ¡a go latela mohlape wa gago, go skena dinonyana tÅ¡e di lwalago, go rekiÅ¡a mmarakeng le go ithuta â tÅ¡ohle go tÅ¡wa fonong ya gago.",tips:["Tobetsa konope ya kgalase ka gare-tlase letÅ¡atÅ¡i le letÅ¡atÅ¡i go ngwala dijo le meetse.","Å etÅ¡a leswao la sepikara go kwa lekgetlo le lengwe le le lengwe le balwa go wena.","O nyaka thuso? Tobetsa leswao la potÅ¡iÅ¡o neng le neng go bona maele a skrine seo o lego go sona."]},readThisAloud:"Bala se godimo"},xxe={listen:"Reetsa kakaretso ya gago",score:"Maemo a maphelo a polasa ya gago ke {{score}} go 100."},vxe={listen:"Reetsa dipoelo",vetRecommended:"Go Å¡iÅ¡inywa go etela ngaka ya diphoofolo."},bxe={listen:"Reetsa leano la dijo",summary:"Go dinonyana tÅ¡e {{size}} tÅ¡a dibeke tÅ¡e {{age}}, o hloka di-kilogram tÅ¡e {{daily}} tÅ¡a {{feedType}} ka letÅ¡atÅ¡i, le di-kilogram tÅ¡e {{weekly}} ka beke. Mo lebakeng le, o na le di-kilogram tÅ¡e {{stock}} setoko, tÅ¡e di tÅ¡welago matÅ¡atÅ¡i a ka bago {{days}}."},wxe={nav:dxe,common:hxe,vet:fxe,dailyLog:mxe,profile:pxe,languages:gxe,help:yxe,farmBrief:xxe,scanResults:vxe,feedCalc:bxe},jx=[{code:"en",label:"English",nativeLabel:"English"},{code:"zu",label:"isiZulu",nativeLabel:"isiZulu"},{code:"tn",label:"Setswana",nativeLabel:"Setswana"}];Un.use(rH).use($me).init({resources:{en:{translation:Zye},zu:{translation:uxe},tn:{translation:wxe}},fallbackLng:"en",supportedLngs:jx.map(e=>e.code),interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],lookupLocalStorage:"flockify.lang",caches:["localStorage"]}});const sH=e=>{typeof document<"u"&&(document.documentElement.lang=e)};sH(Un.language||"en");Un.on("languageChanged",sH);function H2({className:e,showIcon:t=!0}){const{i18n:n,t:r}=Gi(),s=jx.find(a=>a.code===n.language)??jx[0];return i.jsxs("div",{className:fe("flex items-center gap-2",e),children:[t&&i.jsx(Cd,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),i.jsxs(Ye,{value:s.code,onValueChange:a=>{n.changeLanguage(a)},children:[i.jsx(He,{className:"min-h-11 w-full","aria-label":r("common.language"),children:i.jsx(Xe,{children:s.nativeLabel})}),i.jsx(qe,{children:jx.map(a=>i.jsx(oe,{value:a.code,children:a.nativeLabel},a.code))})]})]})}function jxe({open:e,onOpenChange:t,context:n}){const{i18n:r,t:s}=Gi(),[a,o]=y.useState([]),[l,c]=y.useState("idle"),[u,d]=y.useState(!0),h=y.useRef(null),f=y.useRef(null),m=y.useRef([]),g=y.useRef(null),p=y.useRef(null),x=y.useRef(null);y.useEffect(()=>{var A;(A=x.current)==null||A.scrollTo({top:x.current.scrollHeight,behavior:"smooth"})},[a,l]),y.useEffect(()=>{e||(b(),v(),c("idle"))},[e]),y.useEffect(()=>()=>{b(),v()},[]);const v=()=>{var A,E;try{(A=h.current)==null||A.stop()}catch{}
839(E=f.current)==null||E.getTracks().forEach(P=>P.stop()),f.current=null,h.current=null},b=()=>{var A;(A=g.current)==null||A.pause(),g.current=null,p.current&&(URL.revokeObjectURL(p.current),p.current=null)},w=async A=>{var E;if(A)try{c("speaking");const{data:P}=await q.auth.getSession(),$=(E=P.session)==null?void 0:E.access_token,R="https://mrmmozypopayflmybqvx.supabase.co",L="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1ybW1venlwb3BheWZsbXlicXZ4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI5NzYxNDgsImV4cCI6MjA4ODU1MjE0OH0.GrsUdY1-jwVy4gGt10hILm6qPJgZ6B592MqqLpLPrD0",D=await fetch(`${R}/functions/v1/text-to-speech`,{method:"POST",headers:{"Content-Type":"application/json",apikey:L,Authorization:`Bearer ${$??L}`},body:JSON.stringify({text:A,language:r.language})});if(!D.ok)throw new Error(`TTS ${D.status}: ${await D.text().catch(()=>"")}`);const I=await D.blob();if(I.size===0)throw new Error("Empty audio");const M=URL.createObjectURL(I);p.current=M;const H=new Audio(M);g.current=H,H.onended=()=>{b(),c("idle")},H.onerror=()=>{console.error("Audio playback error"),b(),c("idle")},await H.play()}catch(P){console.error("TTS failed",P),Ws({title:s("vet.unavailable"),variant:"destructive"}),c("idle")}},j=async A=>{var E;c("thinking");try{const{data:P,error:$}=await q.functions.invoke("vet-consultation",{body:{messages:A,context:n,language:r.language}});if($)throw $;const R=((E=P==null?void 0:P.answer)==null?void 0:E.trim())??"";if(!R){c("idle"),Ws({title:s("vet.noReply")});return}o(L=>[...L,{role:"assistant",content:R}]),u?await w(R):c("idle")}catch(P){console.error("Vet chat failed",P),c("idle"),Ws({title:s("vet.unavailable"),variant:"destructive"})}},S=async A=>{const E=A.trim();if(!E){c("idle");return}const P=[...a,{role:"user",content:E}];o(P),await j(P)},N=async()=>{b();try{const A=await navigator.mediaDevices.getUserMedia({audio:!0});f.current=A;const E=["audio/webm","audio/mp4"].find($=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported($))??"",P=E?new MediaRecorder(A,{mimeType:E}):new MediaRecorder(A);h.current=P,m.current=[],P.ondataavailable=$=>$.data.size>0&&m.current.push($.data),P.onstop=async()=>{var R;const $=new Blob(m.current,{type:P.mimeType||"audio/webm"});if((R=f.current)==null||R.getTracks().forEach(L=>L.stop()),f.current=null,$.size<1024){Ws({title:s("vet.tooShort")}),c("idle");return}c("transcribing");try{const L=$.type.includes("mp4")?"mp4":$.type.includes("mpeg")?"mp3":$.type.includes("wav")?"wav":"webm",D=new FormData;D.append("file",$,`recording.${L}`),r.language==="en"&&D.append("language","en");const{data:I,error:M}=await q.functions.invoke("speech-to-text",{body:D});if(M)throw M;const H=(I==null?void 0:I.text)??"";await S(H)}catch(L){console.error("STT failed",L),c("idle"),Ws({title:s("vet.cantHear"),variant:"destructive"})}},P.start(),c("recording")}catch(A){console.error("Mic access failed",A),c("idle"),Ws({title:s("vet.micNeeded"),variant:"destructive"})}},k=()=>{var A;l==="recording"?(A=h.current)==null||A.stop():l==="speaking"?(b(),c("idle")):l==="idle"&&N()},_=s(l==="recording"?"vet.tapStop":l==="transcribing"?"vet.hearing":l==="thinking"?"vet.thinking":l==="speaking"?"vet.tapStopReply":"vet.tapSpeak"),C=l==="transcribing"||l==="thinking"?Jr:l==="recording"||l==="speaking"?Xx:vB;return i.jsx(yt,{open:e,onOpenChange:t,children:i.jsxs(mt,{className:"max-w-md p-0 gap-0 overflow-hidden",children:[i.jsxs(xt,{className:"px-5 pt-4 pb-3 border-b space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"p-2 rounded-xl bg-primary/10 text-primary shrink-0",children:i.jsx(Pd,{className:"h-5 w-5"})}),i.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[i.jsx(vt,{className:"text-base",children:s("vet.title")}),i.jsx($i,{className:"text-xs",children:s("vet.subtitle")})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(H2,{})}),i.jsxs(U,{type:"button",variant:u?"default":"outline",size:"sm",onClick:()=>d(A=>!A),"aria-label":s(u?"vet.muteReplies":"vet.enableReplies"),"aria-pressed":u,className:"gap-2 min-h-11 shrink-0",children:[u?i.jsx(EB,{className:"h-4 w-4"}):i.jsx(hee,{className:"h-4 w-4"}),i.jsx("span",{className:"text-xs",children:s(u?"vet.voiceReplyOn":"vet.voiceReplyOff")})]})]})]}),i.jsx(Zu,{className:"h-[320px]",children:i.jsxs("div",{ref:x,className:"px-4 py-4 space-y-3",children:[a.length===0&&i.jsx("div",{className:"text-center text-xs text-muted-foreground py-8 px-4",children:s("vet.example")}),a.map((A,E)=>i.jsx("div",{className:fe("max-w-[85%] rounded-2xl px-3.5 py-2.5 text-sm leading-relaxed",A.role==="user"?"ml-auto bg-primary text-primary-foreground rounded-br-sm":"bg-muted text-foreground rounded-bl-sm"),children:A.content},E)),(l==="thinking"||l==="transcribing")&&i.jsxs("div",{className:"bg-muted text-muted-foreground rounded-2xl rounded-bl-sm px-3.5 py-2.5 max-w-[60%] flex items-center gap-2 text-sm",children:[i.jsx(Jr,{className:"h-3.5 w-3.5 animate-spin"}),s(l==="transcribing"?"vet.hearing":"vet.thinking")]})]})}),i.jsxs("div",{className:"px-5 py-4 border-t bg-card flex flex-col items-center gap-2",children:[i.jsx(U,{type:"button",onClick:k,disabled:l==="transcribing"||l==="thinking",size:"lg",className:fe("rounded-full h-16 w-16 p-0 shadow-lg transition-all",l==="recording"&&"bg-red-500 hover:bg-red-600 animate-pulse",l==="speaking"&&"bg-amber-500 hover:bg-amber-600"),"aria-label":_,children:i.jsx(C,{className:fe("h-7 w-7",(l==="transcribing"||l==="thinking")&&"animate-spin")})}),i.jsx("p",{className:"text-xs text-muted-foreground text-center",children:_})]})]})})}var Kl;(function(e){e.Prompt="PROMPT",e.Camera="CAMERA",e.Photos="PHOTOS"})(Kl||(Kl={}));var rm;(function(e){e.Rear="REAR",e.Front="FRONT"})(rm||(rm={}));var Ek;(function(e){e.Uri="uri",e.Base64="base64",e.DataUrl="dataUrl"})(Ek||(Ek={}));class Sxe extends KE{async getPhoto(t){return new Promise(async(n,r)=>{if(t.webUseInput||t.source===Kl.Photos)this.fileInputExperience(t,n,r);else if(t.source===Kl.Prompt){let s=document.querySelector("pwa-action-sheet");s||(s=document.createElement("pwa-action-sheet"),document.body.appendChild(s)),s.header=t.promptLabelHeader||"Photo",s.cancelable=!0,s.options=[{title:t.promptLabelPhoto||"From Photos"},{title:t.promptLabelPicture||"Take Picture"}],s.addEventListener("onSelection",async a=>{a.detail===0?this.fileInputExperience(t,n,r):this.cameraExperience(t,n,r)}),s.addEventListener("onCanceled",async()=>{r(new Vl("User cancelled photos app"))})}else this.cameraExperience(t,n,r)})}async pickImages(t){return new Promise(async(n,r)=>{this.multipleFileInputExperience(n,r)})}async cameraExperience(t,n,r){if(customElements.get("pwa-camera-modal")){const s=document.createElement("pwa-camera-modal");s.facingMode=t.direction===rm.Front?"user":"environment",document.body.appendChild(s);try{await s.componentOnReady(),s.addEventListener("onPhoto",async a=>{const o=a.detail;o===null?r(new Vl("User cancelled photos app")):o instanceof Error?r(o):n(await this._getCameraPhoto(o,t)),s.dismiss(),document.body.removeChild(s)}),s.present()}catch{this.fileInputExperience(t,n,r)}}else console.error("Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements."),this.fileInputExperience(t,n,r)}fileInputExperience(t,n,r){let s=document.querySelector("#_capacitor-camera-in
839put");const a=()=>{var o;(o=s.parentNode)===null||o===void 0||o.removeChild(s)};s||(s=document.createElement("input"),s.id="_capacitor-camera-input",s.type="file",s.hidden=!0,document.body.appendChild(s),s.addEventListener("change",o=>{const l=s.files[0];let c="jpeg";if(l.type==="image/png"?c="png":l.type==="image/gif"&&(c="gif"),t.resultType==="dataUrl"||t.resultType==="base64"){const u=new FileReader;u.addEventListener("load",()=>{if(t.resultType==="dataUrl")n({dataUrl:u.result,format:c});else if(t.resultType==="base64"){const d=u.result.split(",")[1];n({base64String:d,format:c})}a()}),u.readAsDataURL(l)}else n({webPath:URL.createObjectURL(l),format:c}),a()}),s.addEventListener("cancel",o=>{r(new Vl("User cancelled photos app")),a()})),s.accept="image/*",s.capture=!0,t.source===Kl.Photos||t.source===Kl.Prompt?s.removeAttribute("capture"):t.direction===rm.Front?s.capture="user":t.direction===rm.Rear&&(s.capture="environment"),s.click()}multipleFileInputExperience(t,n){let r=document.querySelector("#_capacitor-camera-input-multiple");const s=()=>{var a;(a=r.parentNode)===null||a===void 0||a.removeChild(r)};r||(r=document.createElement("input"),r.id="_capacitor-camera-input-multiple",r.type="file",r.hidden=!0,r.multiple=!0,document.body.appendChild(r),r.addEventListener("change",a=>{const o=[];for(let l=0;l<r.files.length;l++){const c=r.files[l];let u="jpeg";c.type==="image/png"?u="png":c.type==="image/gif"&&(u="gif"),o.push({webPath:URL.createObjectURL(c),format:u})}t({photos:o}),s()}),r.addEventListener("cancel",a=>{n(new Vl("User cancelled photos app")),s()})),r.accept="image/*",r.click()}_getCameraPhoto(t,n){return new Promise((r,s)=>{const a=new FileReader,o=t.type.split("/")[1];n.resultType==="uri"?r({webPath:URL.createObjectURL(t),format:o,saved:!1}):(a.readAsDataURL(t),a.onloadend=()=>{const l=a.result;n.resultType==="dataUrl"?r({dataUrl:l,format:o,saved:!1}):r({base64String:l.split(",")[1],format:o,saved:!1})},a.onerror=l=>{s(l)})})}async checkPermissions(){if(typeof navigator>"u"||!navigator.permissions)throw this.unavailable("Permissions API not available in this browser");try{return{camera:(await window.navigator.permissions.query({name:"camera"})).state,photos:"granted"}}catch{throw this.unavailable("Camera permissions are not available in this browser")}}async requestPermissions(){throw this.unimplemented("Not implemented on web.")}async pickLimitedLibraryPhotos(){throw this.unavailable("Not implemented on web.")}async getLimitedLibraryPhotos(){throw this.unavailable("Not implemented on web.")}}const Nxe=tg("Camera",{web:()=>new Sxe});function kxe({onBack:e}){var k,_;const[t,n]=y.useState(null),[r,s]=y.useState(""),[a,o]=y.useState(!1),[l,c]=y.useState(null),[u,d]=y.useState(null),[h,f]=y.useState(!1),m=y.useRef(null),{toast:g}=We(),p=500,x=async()=>{try{const C=await Nxe.getPhoto({quality:90,allowEditing:!1,resultType:Ek.DataUrl,source:Kl.Camera});C.dataUrl&&n(C.dataUrl)}catch{g({title:"Camera Error",description:"Unable to access camera. Please try uploading an image instead.",variant:"destructive"})}},v=C=>{var E;const A=(E=C.target.files)==null?void 0:E[0];if(A){const P=new FileReader;P.onload=$=>{var R;n((R=$.target)==null?void 0:R.result)},P.readAsDataURL(A)}},b=async()=>{if(!t&&!r.trim()){g({title:"Input Required",description:"Please either take a photo or describe the symptoms you've observed.",variant:"destructive"});return}o(!0);const C=!!t,A=r.trim().length>0;d(C&&A?"both":C?"image":"text");try{const{getPaymentEnvironment:P}=await Lm(async()=>{const{getPaymentEnvironment:H}=await Promise.resolve().then(()=>wFe);return{getPaymentEnvironment:H}},void 0),{data:$,error:R}=await q.rpc("consume_ai_scan",{check_env:P()});if(R)throw R;if($&&$.allowed===!1){$.reason==="unauthenticated"?g({title:"Sign in required",description:"Please sign in to use the AI Health Scanner.",variant:"destructive"}):(g({title:"Monthly scan limit reached",description:`Free plan allows ${$.limit??3} scans/month. Upgrade for unlimited scans.`,variant:"destructive"}),window.location.href="/pricing"),o(!1);return}const{data:L,error:D}=await q.functions.invoke("analyze-chicken-health",{body:{imageData:t||void 0,observations:r.trim()||void 0}});if(D)throw new Error("Failed to analyze");const I={condition:L.condition||"warning",confidence:L.confidence||0,symptoms:L.symptoms||[],recommendations:L.recommendations||[],analysis:L.analysis,diseaseIdentification:L.diseaseIdentification,treatmentProtocol:L.treatmentProtocol,preventionMeasures:L.preventionMeasures,urgencyLevel:L.urgencyLevel,veterinaryNeeded:L.veterinaryNeeded,timeline:L.timeline,environmentalFactors:L.environmentalFactors,nutritionalRecommendations:L.nutritionalRecommendations};c(I);const{data:{user:M}}=await q.auth.getUser();M&&await q.from("ai_scan_logs").insert({user_id:M.id,condition:I.condition,confidence:Math.round(I.confidence),disease_identification:I.diseaseIdentification??null,symptoms:I.symptoms??null,treatment_protocol:I.treatmentProtocol??null,urgency_level:I.urgencyLevel??null,veterinary_needed:I.veterinaryNeeded??null,timeline:I.timeline??null,analysis:I.analysis??null,observations:r.trim()||null}),g({title:"Analysis Complete",description:`Health status: ${L.condition}`})}catch{g({title:"Analysis Error",description:"Unable to complete AI analysis. Please try again.",variant:"destructive"})}finally{o(!1)}},w=()=>{n(null),s(""),c(null),o(!1),d(null)},j=C=>{var P,$;let A=`ð *FLOCKIFY HEALTH SCAN RESULTS* 840 841`;const E=C.condition==="healthy"?"â ":C.condition==="warning"?"â ï¸":"ð¨";return A+=`${E} *Status:* ${C.condition.toUpperCase()} 842`,A+=`ð *Confidence:* ${C.confidence}% 843`,C.urgencyLevel&&(A+=`â° *Urgency:* ${C.urgencyLevel.toUpperCase()} 844`),C.veterinaryNeeded&&(A+=` 845ð¥ *VETERINARY ATTENTION RECOMMENDED* 846`),C.diseaseIdentification&&(A+=` 847ð¬ *Diagnosis:* 848${C.diseaseIdentification} 849`),(P=C.symptoms)!=null&&P.length&&(A+=` 850𩺠*Symptoms:*
851`,C.symptoms.forEach(R=>A+=`⢠${R} 852`)),($=C.treatmentProtocol)!=null&&$.length&&(A+=` 853ð *Treatment:* 854`,C.treatmentProtocol.forEach((R,L)=>A+=`${L+1}. ${R} 855`)),C.timeline&&(A+=` 856â±ï¸ *Timeline:* ${C.timeline} 857`),A+=` 858--- 859_Shared from Flockify App_`,A},S=()=>{if(!l)return;const C=j(l);window.open(`https://wa.me/?text=${encodeURIComponent(C)}`,"_blank"),g({title:"Opening WhatsApp",description:"Share your health scan results with a vet or fellow farmer"})},N=l?[`Status: ${l.condition} (confidence ${l.confidence}%).`,l.diseaseIdentification?`Diagnosis: ${l.diseaseIdentification}.`:"",(k=l.symptoms)!=null&&k.length?`Symptoms: ${l.symptoms.join(", ")}.`:"",(_=l.treatmentProtocol)!=null&&_.length?`Treatment so far: ${l.treatmentProtocol.join("; ")}.`:""].filter(Boolean).join(" "):r.trim()||void 0;return i.jsxs("div",{className:"p-4 pb-20 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(U,{variant:"ghost",size:"icon",onClick:e,children:i.jsx(jt,{className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl font-bold",children:"AI Health Scanner"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Describe symptoms or add photo"})]})]}),i.jsxs(U,{size:"sm",variant:"outline",onClick:()=>f(!0),className:"gap-1.5 shrink-0 border-primary/30 text-primary hover:bg-primary/10",children:[i.jsx(Pd,{className:"h-4 w-4"}),"AI Vet"]})]}),i.jsx(jxe,{open:h,onOpenChange:f,context:N}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-6 space-y-6",children:[!l&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(En,{className:"h-5 w-5 text-primary"}),i.jsx(ne,{htmlFor:"observations",className:"text-base font-medium",children:"Describe Symptoms (Optional)"})]}),i.jsx(Dd,{label:"Speak",onTranscript:C=>s(A=>((A?A+" ":"")+C).slice(0,p))})]}),i.jsx(Yt,{id:"observations",value:r,onChange:C=>s(C.target.value.slice(0,p)),placeholder:"e.g., 'Not eating for 2 days, sitting alone, coughing sounds, pale comb...'",className:"min-h-[100px]",maxLength:p}),i.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[i.jsx("span",{children:"Tip: Describe behavior, eating habits, sounds, or symptoms"}),i.jsxs("span",{children:[r.length,"/",p]})]})]}),t?i.jsxs("div",{className:"space-y-3",children:[i.jsx(ne,{children:"Photo Preview"}),i.jsx("img",{src:t,alt:"Captured",className:"w-full rounded-lg"}),i.jsxs(U,{onClick:()=>n(null),variant:"outline",size:"sm",className:"w-full",children:[i.jsx(SB,{className:"h-4 w-4 mr-2"})," Remove Photo"]})]}):i.jsxs("div",{className:"space-y-3",children:[i.jsx(ne,{className:"text-base font-medium",children:"Add Photo (Optional)"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs(U,{onClick:x,className:"h-32 flex-col gap-2",variant:"outline",children:[i.jsx(xa,{className:"h-8 w-8"}),i.jsx("span",{children:"Take Photo"})]}),i.jsxs(U,{onClick:()=>{var C;return(C=m.current)==null?void 0:C.click()},className:"h-32 flex-col gap-2",variant:"outline",children:[i.jsx(Yb,{className:"h-8 w-8"}),i.jsx("span",{children:"Upload"})]})]}),i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:v,className:"hidden"})]}),i.jsx(U,{onClick:b,disabled:a||!t&&!r.trim(),className:"w-full",size:"lg",children:a?"Analyzing...":"Analyze Health"})]}),a&&i.jsxs("div",{className:"space-y-4 py-8 flex flex-col items-center justify-center",children:[i.jsx("div",{className:"h-12 w-12 border-4 border-primary border-t-transparent rounded-full animate-spin"}),i.jsxs("div",{className:"glass-hero p-6 md:p-8 text-center space-y-2 relative z-10",children:[i.jsx("h3",{className:"font-semibold text-lg",children:"Analyzing..."}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Our AI is examining the health indicators"})]})]}),l&&!a&&i.jsx(cpe,{result:l,analysisType:u,onReset:w,onDone:e,onShare:S})]})})]})}var _xe=Array.isArray,_r=_xe,Cxe=typeof Po=="object"&&Po&&Po.Object===Object&&Po,iH=Cxe,Exe=iH,Axe=typeof self=="object"&&self&&self.Object===Object&&self,Pxe=Exe||Axe||Function("return this")(),Xi=Pxe,Txe=Xi,Oxe=Txe.Symbol,dg=Oxe,KI=dg,aH=Object.prototype,Rxe=aH.hasOwnProperty,Mxe=aH.toString,sf=KI?KI.toStringTag:void 0;function Ixe(e){var t=Rxe.call(e,sf),n=e[sf];try{e[sf]=void 0;var r=!0}catch{}var s=Mxe.call(e);return r&&(t?e[sf]=n:delete e[sf]),s}var $xe=Ixe,Lxe=Object.prototype,Dxe=Lxe.toString;function Fxe(e){return Dxe.call(e)}var Bxe=Fxe,GI=dg,zxe=$xe,Uxe=Bxe,Vxe="[object Null]",Wxe="[object Undef
859ined]",YI=GI?GI.toStringTag:void 0;function Hxe(e){return e==null?e===void 0?Wxe:Vxe:YI&&YI in Object(e)?zxe(e):Uxe(e)}var Ha=Hxe;function qxe(e){return e!=null&&typeof e=="object"}var qa=qxe,Kxe=Ha,Gxe=qa,Yxe="[object Symbol]";function Xxe(e){return typeof e=="symbol"||Gxe(e)&&Kxe(e)==Yxe}var kh=Xxe,Jxe=_r,Qxe=kh,Zxe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,eve=/^\w*$/;function tve(e,t){if(Jxe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Qxe(e)?!0:eve.test(e)||!Zxe.test(e)||t!=null&&e in Object(t)}var q2=tve;function nve(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pl=nve;const _h=it(pl);var rve=Ha,sve=pl,ive="[object AsyncFunction]",ave="[object Function]",ove="[object GeneratorFunction]",lve="[object Proxy]";function cve(e){if(!sve(e))return!1;var t=rve(e);return t==ave||t==ove||t==ive||t==lve}var K2=cve;const Ve=it(K2);var uve=Xi,dve=uve["__core-js_shared__"],hve=dve,Zj=hve,XI=function(){var e=/[^.]+$/.exec(Zj&&Zj.keys&&Zj.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function fve(e){return!!XI&&XI in e}var mve=fve,pve=Function.prototype,gve=pve.toString;function yve(e){if(e!=null){try{return gve.call(e)}catch{}try{return e+""}catch{}}return""}var oH=yve,xve=K2,vve=mve,bve=pl,wve=oH,jve=/[\\^$.*+?()[\]{}|]/g,Sve=/^\[object .+?Constructor\]$/,Nve=Function.prototype,kve=Object.prototype,_ve=Nve.toString,Cve=kve.hasOwnProperty,Eve=RegExp("^"+_ve.call(Cve).replace(jve,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ave(e){if(!bve(e)||vve(e))return!1;var t=xve(e)?Eve:Sve;return t.test(wve(e))}var Pve=Ave;function Tve(e,t){return e==null?void 0:e[t]}var Ove=Tve,Rve=Pve,Mve=Ove;function Ive(e,t){var n=Mve(e,t);return Rve(n)?n:void 0}var Lc=Ive,$ve=Lc,Lve=$ve(Object,"create"),B0=Lve,JI=B0;function Dve(){this.__data__=JI?JI(null):{},this.size=0}var Fve=Dve;function Bve(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zve=Bve,Uve=B0,Vve="__lodash_hash_undefined__",Wve=Object.prototype,Hve=Wve.hasOwnProperty;function qve(e){var t=this.__data__;if(Uve){var n=t[e];return n===Vve?void 0:n}return Hve.call(t,e)?t[e]:void 0}var Kve=qve,Gve=B0,Yve=Object.prototype,Xve=Yve.hasOwnProperty;function Jve(e){var t=this.__data__;return Gve?t[e]!==void 0:Xve.call(t,e)}var Qve=Jve,Zve=B0,ebe="__lodash_hash_undefined__";function tbe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Zve&&t===void 0?ebe:t,this}var nbe=tbe,rbe=Fve,sbe=zve,ibe=Kve,abe=Qve,obe=nbe;function Ch(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ch.prototype.clear=rbe;Ch.prototype.delete=sbe;Ch.prototype.get=ibe;Ch.prototype.has=abe;Ch.prototype.set=obe;var lbe=Ch;function cbe(){this.__data__=[],this.size=0}var ube=cbe;function dbe(e,t){return e===t||e!==e&&t!==t}var G2=dbe,hbe=G2;function fbe(e,t){for(var n=e.length;n--;)if(hbe(e[n][0],t))return n;return-1}var z0=fbe,mbe=z0,pbe=Array.prototype,gbe=pbe.splice;function ybe(e){var t=this.__data__,n=mbe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():gbe.call(t,n,1),--this.size,!0}var xbe=ybe,vbe=z0;function bbe(e){var t=this.__data__,n=vbe(t,e);return n<0?void 0:t[n][1]}var wbe=bbe,jbe=z0;function Sbe(e){return jbe(this.__data__,e)>-1}var Nbe=Sbe,kbe=z0;function _be(e,t){var n=this.__data__,r=kbe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Cbe=_be,Ebe=ube,Abe=xbe,Pbe=wbe,Tbe=Nbe,Obe=Cbe;function Eh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Eh.prototype.clear=Ebe;Eh.prototype.delete=Abe;Eh.prototype.get=Pbe;Eh.prototype.has=Tbe;Eh.prototype.set=Obe;var U0=Eh,Rbe=Lc,Mbe=Xi,Ibe=Rbe(Mbe,"Map"),Y2=Ibe,QI=lbe,$be=U0,Lbe=Y2;function Dbe(){this.size=0,this.__data__={hash:new QI,map:new(Lbe||$be),string:new QI}}var Fbe=Dbe;function Bbe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var zbe=Bbe,Ube=zbe;function Vbe(e,t){var n=e.__data__;return Ube(t)?n[typeof t=="string"?"string":"hash"]:n.map}var V0=Vbe,Wbe=V0;function Hbe(e){var t=Wbe(this,e).delete(e);return this.size-=t?1:0,t}var qbe=Hbe,Kbe=V0;function Gbe(e){return Kbe(this,e).get(e)}var Ybe=Gbe,Xbe=V0;function Jbe(e){return Xbe(this,e).has(e)}var Qbe=Jbe,Zbe=V0;function e0e(e,t){var n=Zbe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}
859var t0e=e0e,n0e=Fbe,r0e=qbe,s0e=Ybe,i0e=Qbe,a0e=t0e;function Ah(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ah.prototype.clear=n0e;Ah.prototype.delete=r0e;Ah.prototype.get=s0e;Ah.prototype.has=i0e;Ah.prototype.set=a0e;var X2=Ah,lH=X2,o0e="Expected a function";function J2(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(o0e);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],a=n.cache;if(a.has(s))return a.get(s);var o=e.apply(this,r);return n.cache=a.set(s,o)||a,o};return n.cache=new(J2.Cache||lH),n}J2.Cache=lH;var cH=J2;const l0e=it(cH);var c0e=cH,u0e=500;function d0e(e){var t=c0e(e,function(r){return n.size===u0e&&n.clear(),r}),n=t.cache;return t}var h0e=d0e,f0e=h0e,m0e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p0e=/\\(\\)?/g,g0e=f0e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(m0e,function(n,r,s,a){t.push(s?a.replace(p0e,"$1"):r||n)}),t}),y0e=g0e;function x0e(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var Q2=x0e,ZI=dg,v0e=Q2,b0e=_r,w0e=kh,j0e=1/0,e$=ZI?ZI.prototype:void 0,t$=e$?e$.toString:void 0;function uH(e){if(typeof e=="string")return e;if(b0e(e))return v0e(e,uH)+"";if(w0e(e))return t$?t$.call(e):"";var t=e+"";return t=="0"&&1/e==-j0e?"-0":t}var S0e=uH,N0e=S0e;function k0e(e){return e==null?"":N0e(e)}var dH=k0e,_0e=_r,C0e=q2,E0e=y0e,A0e=dH;function P0e(e,t){return _0e(e)?e:C0e(e,t)?[e]:E0e(A0e(e))}var hH=P0e,T0e=kh,O0e=1/0;function R0e(e){if(typeof e=="string"||T0e(e))return e;var t=e+"";return t=="0"&&1/e==-O0e?"-0":t}var W0=R0e,M0e=hH,I0e=W0;function $0e(e,t){t=M0e(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[I0e(t[n++])];return n&&n==r?e:void 0}var Z2=$0e,L0e=Z2;function D0e(e,t,n){var r=e==null?void 0:L0e(e,t);return r===void 0?n:r}var fH=D0e;const Ss=it(fH);function F0e(e){return e==null}var B0e=F0e;const Ge=it(B0e);var z0e=Ha,U0e=_r,V0e=qa,W0e="[object String]";function H0e(e){return typeof e=="string"||!U0e(e)&&V0e(e)&&z0e(e)==W0e}var q0e=H0e;const hg=it(q0e);var mH={exports:{}},bt={};/** @license React v16.13.1 860 * react-is.production.min.js 861 * 862 * Copyright (c) Facebook, Inc. and its affiliates. 863 * 864 * This source code is licensed under the MIT license found in the 865 * LICENSE file in the root directory of this source tree. 866 */var An=typeof Symbol=="function"&&Symbol.for,eA=An?Symbol.for("react.element"):60103,tA=An?Symbol.for("react.portal"):60106,H0=An?Symbol.for("react.fragment"):60107,q0=An?Symbol.for("react.strict_mode"):60108,K0=An?Symbol.for("react.profiler"):60114,G0=An?Symbol.for("react.provider"):60109,Y0=An?Symbol.for("react.context"):60110,nA=An?Symbol.for("react.async_mode"):60111,X0=An?Symbol.for("react.concurrent_mode"):60111,J0=An?Symbol.for("react.forward_ref"):60112,Q0=An?Symbol.for("react.suspense"):60113,K0e=An?Symbol.for("react.suspense_list"):60120,Z0=An?Symbol.for("react.memo"):60115,ew=An?Symbol.for("react.lazy"):60116,G0e=An?Symbol.for("react.block"):60121,Y0e=An?Symbol.for("react.fundamental"):60117,X0e=An?Symbol.for("react.responder"):60118,J0e=An?Symbol.for("react.scope"):60119;function ns(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case eA:switch(e=e.type,e){case nA:case X0:case H0:case K0:case q0:case Q0:return e;default:switch(e=e&&e.$$typeof,e){case Y0:case J0:case ew:case Z0:case G0:return e;default:return t}}case tA:return t}}}function pH(e){return ns(e)===X0}bt.AsyncMode=nA;bt.ConcurrentMode=X0;bt.ContextConsumer=Y0;bt.ContextProvider=G0;bt.Element=eA;bt.ForwardRef=J0;bt.Fragment=H0;bt.Lazy=ew;bt.Memo=Z0;bt.Portal=tA;bt.Profiler=K0;bt.StrictMode=q0;bt.Suspense=Q0;bt.isAsyncMode=function(e){return pH(e)||ns(e)===nA};bt.isConcurrentMode=pH;bt.isContextConsumer=function(e){return ns(e)===Y0};bt.isContextProvider=function(e){return ns(e)===G0};bt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===eA};bt.isForwardRef=function(e){return ns(e)===J0};bt.isFragment=function(e){return ns(e)===H0};bt.isLazy=function(e){return ns(e)===ew};bt.isMemo=function(e){return ns(e)===Z0};bt.isPortal=function(e){return ns(e)===tA};bt.isProfiler=function(e){return ns(e)===K0};bt.isStrictMode=function(e){return ns(e)===q0};bt.isSuspense=function(e){return ns(e)===Q0};bt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===H0||e===X0||e===K0||e===q0||e===Q0||e===K0e||typeof e=="object"&&e!==null&&(e.$$typeof===ew||e.$$typeof===Z0||e.$$typeof===G0||e.$$typeof===Y0||e.$$typeof===J0||e.$$typeof===Y0e||e.$$typeof===X0e||e.$$typeof===J0e||e.$$typeof===G0e)};bt.typeOf=ns;mH.exports=bt;var Ak=mH.exports,Q0e=Ha,Z0e=qa,ewe="[object Number]";function twe(e){return typeof e=="number"||Z0e(e)&&Q0e(e)==ewe}var gH=twe;const nwe=it(gH);var rwe=gH;function swe(e){return rwe(e)&&e!=+e}var iwe=swe;const Ph=it(iwe);var Ys=function(t){return t===0?0:t>0?1:-1},Gl=function(t){return hg(t)&&t.indexOf("%")===t.length-1},pe=function(t){return nwe(t)&&!Ph(t)},xn=function(t){return pe(t)||hg(t)},awe=0,Th=function(t){var n=++awe;return"".concat(t||"").concat(n)},Pc=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!pe(t)&&!hg(t))return r;var a;if(Gl(t)){var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return Ph(a)&&(a=r),s&&a>n&&(a=n),a},vo=function(t){if(!t)return null;var n=Object.keys(t);
vendor: 5,028 bytes, line 866
866return n&&n.length?t[n[0]]:null},owe=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},s=0;s<n;s++)if(!r[t[s]])r[t[s]]=!0;else return!0;return!1},$n=function(t,n){return pe(t)&&pe(n)?function(r){return t+r*(n-t)}:function(){return n}};function Pv(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Ss(r,t))===n})}function ed(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 Pk(e){"@babel/helpers - typeof";return Pk=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},Pk(e)}var lwe=["viewBox","children"],cwe=["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"],n$=["points","pathLength"],e1={svg:lwe,polygon:n$,polyline:n$},rA=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
866ocus","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"],Tv=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(y.isValidElement(t)&&(r=t.props),!_h(r))return null;var s={};return Object.keys(r).forEach(function(a){rA.includes(a)&&(s[a]=n||function(o){return r[a](r,o)})}),s},uwe=function(t,n,r){return function(s){return t(n,r,s),null}},Ov=function(t,n,r){if(!_h(t)||Pk(t)!=="object")return null;var s=null;return Object.keys(t).forEach(function(a){var o=t[a];rA.includes(a)&&typeof o=="function"&&(s||(s={}),s[a]=uwe(o,n,r))}),s},dwe=["children"],hwe=["children"];function r$(e,t){if(e==null)return{};var n=fwe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fwe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Tk(e){"@babel/helpers - typeof";return Tk=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},Tk(e)}var s$={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},va=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},i$=null,t1=null,sA=function e(t){if(t===i$&&Array.isArray(t1))return t1;var n=[];
vendor: 2,418 bytes, line 866
866return y.Children.forEach(t,function(r){Ge(r)||(Ak.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),t1=n,i$=t,n};function Ns(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(s){return va(s)}):r=[va(t)],sA(e).forEach(function(s){var a=Ss(s,"type.displayName")||Ss(s,"type.name");r.indexOf(a)!==-1&&n.push(s)}),n}function Lr(e,t){var n=Ns(e,t);return n&&n[0]}var a$=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,s=n.height;return!(!pe(r)||r<=0||!pe(s)||s<=0)},mwe=["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"],pwe=function(t){return t&&t.type&&hg(t.type)&&mwe.indexOf(t.type)>=0},yH=function(t){return t&&Tk(t)==="object"&&"cx"in t&&"cy"in t&&"r"in t},gwe=function(t,n,r,s){var a,o=(a=e1==null?void 0:e1[s])!==null&&a!==void 0?a:[];return!Ve(t)&&(s&&o.includes(n)||cwe.includes(n))||r&&rA.includes(n)},ze=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var s=t;if(y.isValidElement(t)&&(s=t.props),!_h(s))return null;var a={};return Object.keys(s).forEach(function(o){var l;gwe((l=s)===null||l===void 0?void 0:l[o],o,n,r)&&(a[o]=s[o])}),a},Ok=function e(t,n){if(t===n)return!0;var r=y.Children.count(t);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return o$(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var s=0;s<r;s++){var a=t[s],o=n[s];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!o$(a,o))return!1}return!0},o$=function(t,n){if(Ge(t)&&Ge(n))return!0;if(!Ge(t)&&!Ge(n)){var r=t.props||{},s=r.children,a=r$(r,dwe),o=n.props||{},l=o.children,c=r$(o,hwe);
866return s&&l?ed(a,c)&&Ok(s,l):!s&&!l?ed(a,c):!1}return!1},l$=function(t,n){var r=[],s={};return sA(t).forEach(function(a,o){if(pwe(a))r.push(a);else if(a){var l=va(a.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!s[l])){var h=u(a,l,o);r.push(h),s[l]=!0}}}),r},ywe=function(t){var n=t&&t.type;return n&&s$[n]?s$[n]:null},xwe=function(t,n){return sA(n).indexOf(t)},vwe=["children","width","height","viewBox","className","style","title","desc"];function Rk(){return Rk=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},Rk.apply(this,arguments)}function bwe(e,t){if(e==null)return{};var n=wwe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wwe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Mk(e){var t=e.children,n=e.width,r=e.height,s=e.viewBox,a=e.className,o=e.style,l=e.title,c=e.desc,u=bwe(e,vwe),d=s||{width:n,height:r,x:0,y:0},h=Ze("recharts-surface",a);return F.createElement("svg",Rk({},ze(u,!0,"svg"),{className:h,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),F.createElement("title",null,l),F.createElement("desc",null,c),t)}var jwe=["children","className"];function Ik(){return Ik=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},Ik.apply(this,arguments)}function Swe(e,t){if(e==null)return{};var n=Nwe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nwe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Tt=F.forwardRef(function(e,t){var n=e.children,r=e.className,s=Swe(e,jwe),a=Ze("recharts-layer",r);return F.createElement("g",Ik({className:a},ze(s,!0),{ref:t}),n)}),ba=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a]};function kwe(e,t,n){var r=-1,s=e.length;t<0&&(t=-t>s?0:s+t),n=n>s?s:n,n<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(s);++r<s;)a[r]=e[r+t];return a}var _we=kwe,Cwe=_we;function Ewe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Cwe(e,t,n)}var Awe=Ewe,Pwe="\\ud800-\\udfff",Twe="\\u0300-\\u036f",Owe="\\ufe20-\\ufe2f",Rwe="\\u20d0-\\u20ff",Mwe=Twe+Owe+Rwe,Iwe="\\ufe0e\\ufe0f",$we="\\u200d",Lwe=RegExp("["+$we+Pwe+Mwe+Iwe+"]");function Dwe(e){return Lwe.test(e)}var xH=Dwe;function Fwe(e){return e.split("")}var Bwe=Fwe,vH="\\ud800-\\udfff",zwe="\\u0300-\\u036f",Uwe="\\ufe20-\\ufe2f",Vwe="\\u20d0-\\u20ff",Wwe=zwe+Uwe+Vwe,Hwe="\\ufe0e\\ufe0f",qwe="["+vH+"]",$k="["+Wwe+"]",Lk="\\ud83c[\\udffb-\\udfff]",Kwe="(?:"+$k+"|"+Lk+")",bH="[^"+vH+"]",wH="(?:\\ud83c[\\udde6-\\uddff]){2}",jH="[\\ud800-\\udbff][\\udc00-\\udfff]",Gwe="\\u200d",SH=Kwe+"?",NH="["+Hwe+"]?",Ywe="(?:"+Gwe+"(?:"+[bH,wH,jH].join("|")+")"+NH+SH+")*",Xwe=NH+SH+Ywe,Jwe="(?:"+[bH+$k+"?",$k,wH,jH,qwe].join("|")+")",Qwe=RegExp(Lk+"(?="+Lk+")|"+Jwe+Xwe,"g");function Zwe(e){return e.match(Qwe)||[]}var eje=Zwe,tje=Bwe,nje=xH,rje=eje;function sje(e){return nje(e)?rje(e):tje(e)}var ije=sje,aje=Awe,oje=xH,lje=ije,cje=dH;function uje(e){return function(t){t=cje(t);var n=oje(t)?lje(t):void 0,r=n?n[0]:t.charAt(0),s=n?aje(n,1).join(""):t.slice(1);return r[e]()+s}}var dje=uje,hje=dje,fje=hje("toUpperCase"),mje=fje;const tw=it(mje);function Et(e){return function(){return e}}const kH=Math.cos,Rv=Math.sin,li=Math.sqrt,Mv=Math.PI,nw=2*Mv,Dk=Math.PI,Fk=2*Dk,$l=1e-6,pje=Fk-$l;function _H(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function gje(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return _H;const n=10**t;return function(r){this._+=r[0];for(let s=1,a=r.length;s<a;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}class yje{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?_H:gje(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,s){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(t,n,r,s,a,o){this._append`C${+t},${+n},${+r},${+s},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,s,a){if(t=+t,n=+n,r=+r,s=+s,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-t,u=s-n,d=o-t,h=l-n,f=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>$l)if(!(Math.abs(h*c-u*d)>$l)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-o,g=s-l,p=c*c+u*u,x=m*m+g*g,v=Math.sqrt(p),b=Math.sqrt(f),w=a*Math.tan((Dk-Math.acos((p+f-x)/(2*v*b)))/2),j=w/b,S=w/v;Math.abs(j-1)>$l&&this._append`L${t+j*d},${n+j*h}`,this._append`A${a},${a},0,0,${+(h*m>d*g)},${this._x1=t+S*c},${this._y1=n+S*u}`}}arc(t,n,r,s,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),u=t+l,d=n+c,h=1^o,f=o?s-a:a-s;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>$l||Math.abs(this._y1-d)>$l)&&this._append`L${u},${d}`,r&&(f<0&&(f=f%Fk+Fk),f>pje?this._append`A${r},${r},0,1,${h}
866,${t-l},${n-c}A${r},${r},0,1,${h},${this._x1=u},${this._y1=d}`:f>$l&&this._append`A${r},${r},0,${+(f>=Dk)},${h},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function iA(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 yje(t)}function aA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function CH(e){this._context=e}CH.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 rw(e){return new CH(e)}function EH(e){return e[0]}function AH(e){return e[1]}function PH(e,t){var n=Et(!0),r=null,s=rw,a=null,o=iA(l);e=typeof e=="function"?e:e===void 0?EH:Et(e),t=typeof t=="function"?t:t===void 0?AH:Et(t);function l(c){var u,d=(c=aA(c)).length,h,f=!1,m;for(r==null&&(a=s(m=o())),u=0;u<=d;++u)!(u<d&&n(h=c[u],u,c))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(h,u,c),+t(h,u,c));if(m)return a=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Et(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Et(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Et(!!c),l):n},l.curve=function(c){return arguments.length?(s=c,r!=null&&(a=s(r)),l):s},l.context=function(c){return arguments.length?(c==null?r=a=null:a=s(r=c),l):r},l}function Sy(e,t,n){var r=null,s=Et(!0),a=null,o=rw,l=null,c=iA(u);e=typeof e=="function"?e:e===void 0?EH:Et(+e),t=typeof t=="function"?t:Et(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?AH:Et(+n);function u(h){var f,m,g,p=(h=aA(h)).length,x,v=!1,b,w=new Array(p),j=new Array(p);for(a==null&&(l=o(b=c())),f=0;f<=p;++f){if(!(f<p&&s(x=h[f],f,h))===v)if(v=!v)m=f,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=f-1;g>=m;--g)l.point(w[g],j[g]);l.lineEnd(),l.areaEnd()}v&&(w[f]=+e(x,f,h),j[f]=+t(x,f,h),l.point(r?+r(x,f,h):w[f],n?+n(x,f,h):j[f]))}if(b)return l=null,b+""||null}function d(){return PH().defined(s).curve(o).context(a)}return u.x=function(h){return arguments.length?(e=typeof h=="function"?h:Et(+h),r=null,u):e},u.x0=function(h){return arguments.length?(e=typeof h=="function"?h:Et(+h),u):e},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Et(+h),u):r},u.y=function(h){return arguments.length?(t=typeof h=="function"?h:Et(+h),n=null,u):t},u.y0=function(h){return arguments.length?(t=typeof h=="function"?h:Et(+h),u):t},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Et(+h),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(h){return arguments.length?(s=typeof h=="function"?h:Et(!!h),u):s},u.curve=function(h){return arguments.length?(o=h,a!=null&&(l=o(a)),u):o},u.context=function(h){return arguments.length?(h==null?a=l=null:l=o(a=h),u):a},u}class TH{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 xje(e){return new TH(e,!0)}function vje(e){return new TH(e,!1)}const oA={draw(e,t){const n=li(t/Mv);e.moveTo(n,0),e.arc(0,0,n,0,nw)}},bje={draw(e,t){const n=li(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()}},OH=li(1/3),wje=OH*2,jje={draw(e,t){const n=li(t/wje),r=n*OH;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Sje={draw(e,t){const n=li(t),r=-n/2;e.rect(r,r,n,n)}},Nje=.8908130915292852,RH=Rv(Mv/10)/Rv(7*Mv/10),kje=Rv(nw/10)*RH,_je=-kH(nw/10)*RH,Cje={draw(e,t){const n=li(t*Nje),r=kje*n,s=_je*n;e.moveTo(0,-n),e.lineTo(r,s);for(let a=1;a<5;++a){const o=nw*a/5,l=kH(o),c=Rv(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*s,c*r+l*s)}e.closePath()}},n1=li(3),Eje={draw(e,t){const n=-li(t/(n1*3));e.moveTo(0,n*2),e.lineTo(-n1*n,-n),e.lineTo(n1*n,-n),e.closePath()}},ss=-.5,is=li(3)/2,Bk=1/li(12),Aje=(Bk/2+1)*3,Pje={draw(e,t){const n=li(t/Aje),r=n/2,s=n*Bk,a=r,o=n*Bk+n,l=-a,c=o;e.moveTo(r,s),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(ss*r-is*s,is*r+ss*s),e.lineTo(ss*a-is*o,is*a+ss*o),e.lineTo(ss*l-is*c,is*l+ss*c),e.lineTo(ss*r+is*s,ss*s-is*r),e.lineTo(ss*a+is*o,ss*o-is*a),e.lineTo(ss*l+is*c,ss*c-is*l),e.closePath()}};function Tje(e,t){let n=null,r=iA(s);e=typeof e=="function"?e:Et(e||oA),t=typeof t=="function"?t:Et(t===void 0?64:+t);function s(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return s.type=function(a){return arguments.length?(e=typeof a=="function"?a:Et(a),s):e},s.size=function(a){return arguments.length?(t=typeof a=="function"?a:Et(+a),s):t},s.context=function(a){return arguments.length?(n=a??null,s):n},s}function Iv(){}function $v(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 MH(e){this._context=e}MH.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:$v(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:$v(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Oje(e){return new MH(e)}function IH(e){this._context=e}IH.prototype={areaStart:Iv,areaEnd:Iv,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:$v(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rje(e){return new IH(e)}function $H(e){this._context=e}$H.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:$v(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Mje(e){return new $H(e)}function LH(e){this._context=e}
866LH.prototype={areaStart:Iv,areaEnd:Iv,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 Ije(e){return new LH(e)}function c$(e){return e<0?-1:1}function u$(e,t,n){var r=e._x1-e._x0,s=t-e._x1,a=(e._y1-e._y0)/(r||s<0&&-0),o=(n-e._y1)/(s||r<0&&-0),l=(a*s+o*r)/(r+s);return(c$(a)+c$(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function d$(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function r1(e,t,n){var r=e._x0,s=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,s+l*t,a-l,o-l*n,a,o)}function Lv(e){this._context=e}Lv.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:r1(this,this._t0,d$(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,r1(this,d$(this,n=u$(this,e,t)),n);break;default:r1(this,this._t0,n=u$(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function DH(e){this._context=new FH(e)}(DH.prototype=Object.create(Lv.prototype)).point=function(e,t){Lv.prototype.point.call(this,t,e)};function FH(e){this._context=e}FH.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,s,a){this._context.bezierCurveTo(t,e,r,n,a,s)}};function $je(e){return new Lv(e)}function Lje(e){return new DH(e)}function BH(e){this._context=e}BH.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=h$(e),s=h$(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],s[0][a],r[1][a],s[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 h$(e){var t,n=e.length-1,r,s=new Array(n),a=new Array(n),o=new Array(n);for(s[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)s[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(s[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=s[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(s[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)s[t]=(o[t]-s[t+1])/a[t];for(a[n-1]=(e[n]+s[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-s[t+1];return[s,a]}function Dje(e){return new BH(e)}function sw(e,t){this._context=e,this._t=t}sw.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 Fje(e){return new sw(e,.5)}function Bje(e){return new sw(e,0)}function zje(e){return new sw(e,1)}function Bd(e,t){if((o=e.length)>1)for(var n=1,r,s,a=e[t[0]],o,l=a.length;n<o;++n)for(s=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function zk(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Uje(e,t){return e[t]}function Vje(e){const t=[];return t.key=e,t}function Wje(){var e=Et([]),t=zk,n=Bd,r=Uje;function s(a){var o=Array.from(e.apply(this,arguments),Vje),l,c=o.length,u=-1,d;for(const h of a)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(h,o[l].key,u,a)]).data=h;for(l=0,d=aA(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return s.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Et(Array.from(a)),s):e},s.value=function(a){return arguments.length?(r=typeof a=="function"?a:Et(+a),s):r},s.order=function(a){return arguments.length?(t=a==null?zk:typeof a=="function"?a:Et(Array.from(a)),s):t},s.offset=function(a){return arguments.length?(n=a??Bd,s):n},s}function Hje(e,t){if((r=e.length)>0){for(var n,r,s=0,a=e[0].length,o;s<a;++s){for(o=n=0;n<r;++n)o+=e[n][s][1]||0;if(o)for(n=0;n<r;++n)e[n][s][1]/=o}Bd(e,t)}}function qje(e,t){if((s=e.length)>0){for(var n=0,r=e[t[0]],s,a=r.length;n<a;++n){for(var o=0,l=0;o<s;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}Bd(e,t)}}function Kje(e,t){if(!(!((o=e.length)>0)||!((a=(s=e[t[0]]).length)>0))){for(var n=0,r=1,s,a,o;r<a;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],h=d[r][1]||0,f=d[r-1][1]||0,m=(h-f)/2,g=0;g<l;++g){var p=e[t[g]],x=p[r][1]||0,v=p[r-1][1]||0;m+=x-v}c+=h,u+=m*h}s[r-1][1]+=s[r-1][0]=n,c&&(n-=u/c)}s[r-1][1]+=s[r-1][0]=n,Bd(e,t)}}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 Gje=["type","size","sizeType"];function Uk(){return Uk=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},Uk.apply(this,arguments)}function f$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function m$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
vendor: 6,472 bytes, lines 866-869
866t%2?f$(Object(n),!0).forEach(function(r){Yje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yje(e,t,n){return t=Xje(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xje(e){var t=Jje(e,"string");return Qm(t)=="symbol"?t:String(t)}function Jje(e,t){if(Qm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qje(e,t){if(e==null)return{};var n=Zje(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zje(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var zH={symbolCircle:oA,symbolCross:bje,symbolDiamond:jje,symbolSquare:Sje,symbolStar:Cje,symbolTriangle:Eje,symbolWye:Pje},e1e=Math.PI/180,t1e=function(t){var n="symbol".concat(tw(t));return zH[n]||oA},n1e=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 s=18*e1e;return 1.25*t*t*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),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}},r1e=function(t,n){zH["symbol".concat(tw(t))]=n},lA=function(t){var n=t.type,r=n===void 0?"circle":n,s=t.size,a=s===void 0?64:s,o=t.sizeType,l=o===void 0?"area":o,c=Qje(t,Gje),u=m$(m$({},c),{},{type:r,size:a,sizeType:l}),d=function(){var x=t1e(r),v=Tje().type(x).size(n1e(a,l,r));return v()},h=u.className,f=u.cx,m=u.cy,g=ze(u,!0);return f===+f&&m===+m&&a===+a?F.createElement("path",Uk({},g,{className:Ze("recharts-symbols",h),transform:"translate(".concat(f,", ").concat(m,")"),d:d()})):null};lA.registerSymbol=r1e;function zd(e){"@babel/helpers - typeof";return zd=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},zd(e)}function Vk(){return Vk=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},Vk.apply(this,arguments)}function p$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function s1e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p$(Object(n),!0).forEach(function(r){Zm(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function i1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a1e(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,VH(r.key),r)}}function o1e(e,t,n){return t&&a1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function l1e(e,t,n){return t=Dv(t),c1e(e,UH()?Reflect.construct(t,n||[],Dv(e).constructor):t.apply(e,n))}function c1e(e,t){if(t&&(zd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return u1e(e)}function u1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UH=function(){return!!e})()}function Dv(e){return Dv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dv(e)}function d1e(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&&Wk(e,t)}function Wk(e,t){return Wk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Wk(e,t)}function Zm(e,t,n){return t=VH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VH(e){var t=h1e(e,"string");return zd(t)=="symbol"?t:String(t)}function h1e(e,t){if(zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var as=32,cA=function(e){d1e(t,e);function t(){return i1e(this,t),l1e(this,t,arguments)}return o1e(t,[{key:"renderIcon",value:function(r){var s=this.props.inactiveColor,a=as/2,o=as/6,l=as/3,c=r.inactive?s:r.color;if(r.type==="plainline")return F.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:as,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return F.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,` 867 A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,` 868 H`).concat(as,"M").concat(2*l,",").concat(a,` 869 A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return F.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(as/8,"h").concat(as,"v").concat(as*3/4,"h").concat(-as,"z"),className:"recharts-legend-icon"});if(F.isValidElement(r.legendIcon)){var u=s1e({},r);return delete u.legendIcon,F.cloneElement(r.legendIcon,u)}return F.createElement(lA,{fill:c,cx:a,cy:a,size:as,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,s=this.props,a=s.payload,o=s.iconSize,l=s.layout,c=s.formatter,u=s.inactiveColor,d={x:0,y:0,width:as,height:as}
vendor: 6,008 bytes, line 869
869,h={display:l==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(m,g){var p=m.formatter||c,x=Ze(Zm(Zm({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",m.inactive));if(m.type==="none")return null;var v=Ve(m.value)?null:m.value;ba(!Ve(m.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 b=m.inactive?u:m.color;return F.createElement("li",Vk({className:x,style:h,key:"legend-item-".concat(g)},Ov(r.props,m,g)),F.createElement(Mk,{width:o,height:o,viewBox:d,style:f},r.renderIcon(m)),F.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},p?p(v,m,g):v))})}},{key:"render",value:function(){var r=this.props,s=r.payload,a=r.layout,o=r.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return F.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}]),t}(y.PureComponent);Zm(cA,"displayName","Legend");Zm(cA,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var f1e=U0;function m1e(){this.__data__=new f1e,this.size=0}var p1e=m1e;function g1e(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var y1e=g1e;function x1e(e){return this.__data__.get(e)}var v1e=x1e;function b1e(e){return this.__data__.has(e)}var w1e=b1e,j1e=U0,S1e=Y2,N1e=X2,k1e=200;function _1e(e,t){var n=this.__data__;if(n instanceof j1e){var r=n.__data__;if(!S1e||r.length<k1e-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new N1e(r)}return n.set(e,t),this.size=n.size,this}var C1e=_1e,E1e=U0,A1e=p1e,P1e=y1e,T1e=v1e,O1e=w1e,R1e=C1e;function Oh(e){var t=this.__data__=new E1e(e);this.size=t.size}Oh.prototype.clear=A1e;Oh.prototype.delete=P1e;Oh.prototype.get=T1e;Oh.prototype.has=O1e;Oh.prototype.set=R1e;var WH=Oh,M1e="__lodash_hash_undefined__";function I1e(e){return this.__data__.set(e,M1e),this}var $1e=I1e;function L1e(e){return this.__data__.has(e)}var D1e=L1e,F1e=X2,B1e=$1e,z1e=D1e;function Fv(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new F1e;++t<n;)this.add(e[t])}Fv.prototype.add=Fv.prototype.push=B1e;Fv.prototype.has=z1e;var HH=Fv;function U1e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var qH=U1e;function V1e(e,t){return e.has(t)}var KH=V1e,W1e=HH,H1e=qH,q1e=KH,K1e=1,G1e=2;function Y1e(e,t,n,r,s,a){var o=n&K1e,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,m=n&G1e?new W1e:void 0;for(a.set(e,t),a.set(t,e);++h<l;){var g=e[h],p=t[h];if(r)var x=o?r(p,g,h,t,e,a):r(g,p,h,e,t,a);if(x!==void 0){if(x)continue;f=!1;break}if(m){if(!H1e(t,function(v,b){if(!q1e(m,b)&&(g===v||s(g,v,n,r,a)))return m.push(b)})){f=!1;break}}else if(!(g===p||s(g,p,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}var GH=Y1e,X1e=Xi,J1e=X1e.Uint8Array,Q1e=J1e;function Z1e(e){var t=-1,n=Array(e.size);return e.forEach(function(r,s){n[++t]=[s,r]}),n}var eSe=Z1e;function tSe(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var uA=tSe,g$=dg,y$=Q1e,nSe=G2,rSe=GH,sSe=eSe,iSe=uA,aSe=1,oSe=2,lSe="[object Boolean]",cSe="[object Date]",uSe="[object Error]",dSe="[object Map]",hSe="[object Number]",fSe="[object RegExp]",mSe="[object Set]",pSe="[object String]",gSe="[object Symbol]",ySe="[object ArrayBuffer]",xSe="[object DataView]",x$=g$?g$.prototype:void 0,s1=x$?x$.valueOf:void 0;function vSe(e,t,n,r,s,a,o){switch(n){case xSe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ySe:return!(e.byteLength!=t.byteLength||!a(new y$(e),new y$(t)));case lSe:case cSe:case hSe:return nSe(+e,+t);case uSe:return e.name==t.name&&e.message==t.message;case fSe:case pSe:return e==t+"";case dSe:var l=sSe;case mSe:var c=r&aSe;if(l||(l=iSe),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=oSe,o.set(e,t);var d=rSe(l(e),l(t),r,s,a,o);return o.delete(e),d;case gSe:if(s1)return s1.call(e)==s1.call(t)}return!1}var bSe=vSe;function wSe(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}var YH=wSe,jSe=YH,SSe=_r;function NSe(e,t,n){var r=t(e);return SSe(e)?r:jSe(r,n(e))}var kSe=NSe;function _Se(e,t){for(var n=-1,r=e==null?0:e.length,s=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[s++]=o)}return a}var CSe=_Se;function ESe(){return[]}var ASe=ESe,PSe=CSe,TSe=ASe,OSe=Object.prototype,RSe=OSe.propertyIsEnumerable,v$=Object.getOwnPropertySymbols,MSe=v$?function(e){return e==null?[]:(e=Object(e),PSe(v$(e),function(t){return RSe.call(e,t)}))}:TSe,ISe=MSe;function $Se(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var LSe=$Se,DSe=Ha,FSe=qa,BSe="[object Arguments]";function zSe(e){return FSe(e)&&DSe(e)==BSe}var USe=zSe,b$=USe,VSe=qa,XH=Object.prototype,WSe=XH.hasOwnProperty,HSe=XH.propertyIsEnumerable,qSe=b$(function(){return arguments}())?b$:function(e){return VSe(e)&&WSe.call(e,"callee")&&!HSe.call(e,"callee")},dA=qSe,Bv={exports:{}};function KSe(){return!1}var GSe=KSe;Bv.exports;(function(e,t){var n=Xi,r=GSe,s=t&&!t.nodeType&&t,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(Bv,Bv.exports);var JH=Bv.exports,YSe=9007199254740991,XSe=/^(?:0|[1-9]\d*)$/;function JSe(e,t){var n=typeof e;return t=t??YSe,!!t&&(n=="number"||n!="symbol"&&XSe.test(e))&&e>-1&&e%1==0&&e<t}var hA=JSe,QSe=9007199254740991;function ZSe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=QSe}var fA=ZSe,eNe=Ha,tNe=fA,nNe=qa,rNe="[object Arguments]",sNe="[object Array]",iNe="[object Boolean]",aNe="[object Date]",oNe="[object Error]",lNe="[object Function]",cNe="[object Map]",uNe="[object Number]",dNe="[object Object]",hNe="[object RegExp]",fNe="[object Set]",mNe="[object String]",pNe="[object WeakMap]",gNe="[object ArrayBuffer]",yNe="[object DataView]",xNe="[object Float32Array]",vNe="[object Float64Array
869]",bNe="[object Int8Array]",wNe="[object Int16Array]",jNe="[object Int32Array]",SNe="[object Uint8Array]",NNe="[object Uint8ClampedArray]",kNe="[object Uint16Array]",_Ne="[object Uint32Array]",Lt={};Lt[xNe]=Lt[vNe]=Lt[bNe]=Lt[wNe]=Lt[jNe]=Lt[SNe]=Lt[NNe]=Lt[kNe]=Lt[_Ne]=!0;Lt[rNe]=Lt[sNe]=Lt[gNe]=Lt[iNe]=Lt[yNe]=Lt[aNe]=Lt[oNe]=Lt[lNe]=Lt[cNe]=Lt[uNe]=Lt[dNe]=Lt[hNe]=Lt[fNe]=Lt[mNe]=Lt[pNe]=!1;function CNe(e){return nNe(e)&&tNe(e.length)&&!!Lt[eNe(e)]}var ENe=CNe;function ANe(e){return function(t){return e(t)}}var QH=ANe,zv={exports:{}};zv.exports;(function(e,t){var n=iH,r=t&&!t.nodeType&&t,s=r&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===r,o=a&&n.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(zv,zv.exports);var PNe=zv.exports,TNe=ENe,ONe=QH,w$=PNe,j$=w$&&w$.isTypedArray,RNe=j$?ONe(j$):TNe,ZH=RNe,MNe=LSe,INe=dA,$Ne=_r,LNe=JH,DNe=hA,FNe=ZH,BNe=Object.prototype,zNe=BNe.hasOwnProperty;function UNe(e,t){var n=$Ne(e),r=!n&&INe(e),s=!n&&!r&&LNe(e),a=!n&&!r&&!s&&FNe(e),o=n||r||s||a,l=o?MNe(e.length,String):[],c=l.length;for(var u in e)(t||zNe.call(e,u))&&!(o&&(u=="length"||s&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||DNe(u,c)))&&l.push(u);return l}var VNe=UNe,WNe=Object.prototype;function HNe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||WNe;return e===n}var qNe=HNe;function KNe(e,t){return function(n){return e(t(n))}}var e9=KNe,GNe=e9,YNe=GNe(Object.keys,Object),XNe=YNe,JNe=qNe,QNe=XNe,ZNe=Object.prototype,eke=ZNe.hasOwnProperty;function tke(e){if(!JNe(e))return QNe(e);var t=[];for(var n in Object(e))eke.call(e,n)&&n!="constructor"&&t.push(n);return t}var nke=tke,rke=K2,ske=fA;function ike(e){return e!=null&&ske(e.length)&&!rke(e)}var fg=ike,ake=VNe,oke=nke,lke=fg;function cke(e){return lke(e)?ake(e):oke(e)}var iw=cke,uke=kSe,dke=ISe,hke=iw;function fke(e){return uke(e,hke,dke)}var mke=fke,S$=mke,pke=1,gke=Object.prototype,yke=gke.hasOwnProperty;function xke(e,t,n,r,s,a){var o=n&pke,l=S$(e),c=l.length,u=S$(t),d=u.length;if(c!=d&&!o)return!1;for(var h=c;h--;){var f=l[h];if(!(o?f in t:yke.call(t,f)))return!1}var m=a.get(e),g=a.get(t);if(m&&g)return m==t&&g==e;var p=!0;a.set(e,t),a.set(t,e);for(var x=o;++h<c;){f=l[h];var v=e[f],b=t[f];if(r)var w=o?r(b,v,f,t,e,a):r(v,b,f,e,t,a);if(!(w===void 0?v===b||s(v,b,n,r,a):w)){p=!1;break}x||(x=f=="constructor")}if(p&&!x){var j=e.constructor,S=t.constructor;j!=S&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof S=="function"&&S instanceof S)&&(p=!1)}return a.delete(e),a.delete(t),p}var vke=xke,bke=Lc,wke=Xi,jke=bke(wke,"DataView"),Ske=jke,Nke=Lc,kke=Xi,_ke=Nke(kke,"Promise"),Cke=_ke,Eke=Lc,Ake=Xi,Pke=Eke(Ake,"Set"),t9=Pke,Tke=Lc,Oke=Xi,Rke=Tke(Oke,"WeakMap"),Mke=Rke,Hk=Ske,qk=Y2,Kk=Cke,Gk=t9,Yk=Mke,n9=Ha,Rh=oH,N$="[object Map]",Ike="[object Object]",k$="[object Promise]",_$="[object Set]",C$="[object WeakMap]",E$="[object DataView]",$ke=Rh(Hk),Lke=Rh(qk),Dke=Rh(Kk),Fke=Rh(Gk),Bke=Rh(Yk),Ll=n9;(Hk&&Ll(new Hk(new ArrayBuffer(1)))!=E$||qk&&Ll(new qk)!=N$||Kk&&Ll(Kk.resolve())!=k$||Gk&&Ll(new Gk)!=_$||Yk&&Ll(new Yk)!=C$)&&(Ll=function(e){var t=n9(e),n=t==Ike?e.constructor:void 0,r=n?Rh(n):"";if(r)switch(r){case $ke:return E$;case Lke:return N$;case Dke:return k$;case Fke:return _$;case Bke:return C$}return t});var zke=Ll,i1=WH,Uke=GH,Vke=bSe,Wke=vke,A$=zke,P$=_r,T$=JH,Hke=ZH,qke=1,O$="[object Arguments]",R$="[object Array]",Ny="[object Object]",Kke=Object.prototype,M$=Kke.hasOwnProperty;function Gke(e,t,n,r,s,a){var o=P$(e),l=P$(t),c=o?R$:A$(e),u=l?R$:A$(t);c=c==O$?Ny:c,u=u==O$?Ny:u;var d=c==Ny,h=u==Ny,f=c==u;if(f&&T$(e)){if(!T$(t))return!1;o=!0,d=!1}if(f&&!d)return a||(a=new i1),o||Hke(e)?Uke(e,t,n,r,s,a):Vke(e,t,c,n,r,s,a);if(!(n&qke)){var m=d&&M$.call(e,"__wrapped__"),g=h&&M$.call(t,"__wrapped__");
vendor: 3,010 bytes, line 869
869if(m||g){var p=m?e.value():e,x=g?t.value():t;return a||(a=new i1),s(p,x,n,r,a)}}return f?(a||(a=new i1),Wke(e,t,n,r,s,a)):!1}var Yke=Gke,Xke=Yke,I$=qa;function r9(e,t,n,r,s){return e===t?!0:e==null||t==null||!I$(e)&&!I$(t)?e!==e&&t!==t:Xke(e,t,n,r,r9,s)}var mA=r9,Jke=WH,Qke=mA,Zke=1,e_e=2;function t_e(e,t,n,r){var s=n.length,a=s,o=!r;if(e==null)return!a;for(e=Object(e);s--;){var l=n[s];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<a;){l=n[s];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var h=new Jke;if(r)var f=r(u,d,c,e,t,h);if(!(f===void 0?Qke(d,u,Zke|e_e,r,h):f))return!1}}return!0}var n_e=t_e,r_e=pl;function s_e(e){return e===e&&!r_e(e)}var s9=s_e,i_e=s9,a_e=iw;function o_e(e){for(var t=a_e(e),n=t.length;n--;){var r=t[n],s=e[r];t[n]=[r,s,i_e(s)]}return t}var l_e=o_e;function c_e(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var i9=c_e,u_e=n_e,d_e=l_e,h_e=i9;function f_e(e){var t=d_e(e);return t.length==1&&t[0][2]?h_e(t[0][0],t[0][1]):function(n){return n===e||u_e(n,e,t)}}var m_e=f_e;function p_e(e,t){return e!=null&&t in Object(e)}var g_e=p_e,y_e=hH,x_e=dA,v_e=_r,b_e=hA,w_e=fA,j_e=W0;function S_e(e,t,n){t=y_e(t,e);for(var r=-1,s=t.length,a=!1;++r<s;){var o=j_e(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=s?a:(s=e==null?0:e.length,!!s&&w_e(s)&&b_e(o,s)&&(v_e(e)||x_e(e)))}var N_e=S_e,k_e=g_e,__e=N_e;function C_e(e,t){return e!=null&&__e(e,t,k_e)}var E_e=C_e,A_e=mA,P_e=fH,T_e=E_e,O_e=q2,R_e=s9,M_e=i9,I_e=W0,$_e=1,L_e=2;function D_e(e,t){return O_e(e)&&R_e(t)?M_e(I_e(e),t):function(n){var r=P_e(n,e);return r===void 0&&r===t?T_e(n,e):A_e(t,r,$_e|L_e)}}var F_e=D_e;function B_e(e){return e}var Mh=B_e;function z_e(e){return function(t){return t==null?void 0:t[e]}}var U_e=z_e,V_e=Z2;function W_e(e){return function(t){return V_e(t,e)}}var H_e=W_e,q_e=U_e,K_e=H_e,G_e=q2,Y_e=W0;function X_e(e){return G_e(e)?q_e(Y_e(e)):K_e(e)}var J_e=X_e,Q_e=m_e,Z_e=F_e,eCe=Mh,tCe=_r,nCe=J_e;function rCe(e){return typeof e=="function"?e:e==null?eCe:typeof e=="object"?tCe(e)?Z_e(e[0],e[1]):Q_e(e):nCe(e)}var gl=rCe;function sCe(e,t,n,r){for(var s=e.length,a=n+(r?1:-1);r?a--:++a<s;)if(t(e[a],a,e))return a;return-1}var a9=sCe;function iCe(e){return e!==e}var aCe=iCe;function oCe(e,t,n){for(var r=n-1,s=e.length;++r<s;)if(e[r]===t)return r;return-1}var lCe=oCe,cCe=a9,uCe=aCe,dCe=lCe;function hCe(e,t,n){return t===t?dCe(e,t,n):cCe(e,uCe,n)}var fCe=hCe,mCe=fCe;function pCe(e,t){var n=e==null?0:e.length;return!!n&&mCe(e,t,0)>-1}var gCe=pCe;function yCe(e,t,n){for(var r=-1,s=e==null?0:e.length;++r<s;)if(n(t,e[r]))return!0;return!1}var xCe=yCe;function vCe(){}var bCe=vCe,a1=t9,wCe=bCe,jCe=uA,SCe=1/0,NCe=a1&&1/jCe(new a1([,-0]))[1]==SCe?function(e){return new a1(e)}:wCe,kCe=NCe,_Ce=HH,CCe=gCe,ECe=xCe,ACe=KH,PCe=kCe,TCe=uA,OCe=200;function RCe(e,t,n){var r=-1,s=CCe,a=e.length,o=!0,l=[],c=l;if(n)o=!1,s=ECe;else if(a>=OCe){var u=t?null:PCe(e);if(u)return TCe(u);o=!1,s=ACe,c=new _Ce}else c=t?[]:l;e:for(;++r<a;
869){var d=e[r],h=t?t(d):d;if(d=n||d!==0?d:0,o&&h===h){for(var f=c.length;f--;)if(c[f]===h)continue e;t&&c.push(h),l.push(d)}else s(c,h,n)||(c!==l&&c.push(h),l.push(d))}return l}var MCe=RCe,ICe=gl,$Ce=MCe;function LCe(e,t){return e&&e.length?$Ce(e,ICe(t)):[]}var DCe=LCe;const $$=it(DCe);function o9(e,t,n){return t===!0?$$(e,n):Ve(t)?$$(e,t):e}function Ud(e){"@babel/helpers - typeof";return Ud=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},Ud(e)}var FCe=["ref"];function L$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L$(Object(n),!0).forEach(function(r){aw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D$(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,u9(r.key),r)}}function zCe(e,t,n){return t&&D$(e.prototype,t),n&&D$(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function UCe(e,t,n){return t=Uv(t),VCe(e,l9()?Reflect.construct(t,n||[],Uv(e).constructor):t.apply(e,n))}function VCe(e,t){if(t&&(Ud(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return c9(e)}function l9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l9=function(){return!!e})()}function Uv(e){return Uv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Uv(e)}function c9(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WCe(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&&Xk(e,t)}function Xk(e,t){return Xk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Xk(e,t)}function aw(e,t,n){return t=u9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u9(e){var t=HCe(e,"string");return Ud(t)=="symbol"?t:String(t)}function HCe(e,t){if(Ud(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ud(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qCe(e,t){if(e==null)return{};var n=KCe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KCe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function GCe(e){return e.value}function YCe(e,t){if(F.isValidElement(e))return F.cloneElement(e,t);if(typeof e=="function")return F.createElement(e,t);t.ref;var n=qCe(t,FCe);return F.createElement(cA,n)}var F$=1,ep=function(e){WCe(t,e);function t(){var n;BCe(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=UCe(this,t,[].concat(s)),aw(c9(n),"lastBoundingBox",{width:-1,height:-1}),n}return zCe(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,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>F$||Math.abs(s.height-this.lastBoundingBox.height)>F$)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,r&&r(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}}
869,{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Tl({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var s=this.props,a=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,u=s.chartWidth,d=s.chartHeight,h,f;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&a==="vertical"){var m=this.getBBoxSnapshot();h={left:((u||0)-m.width)/2}}else h=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(l==="middle"){var g=this.getBBoxSnapshot();f={top:((d||0)-g.height)/2}}else f=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Tl(Tl({},h),f)}},{key:"render",value:function(){var r=this,s=this.props,a=s.content,o=s.width,l=s.height,c=s.wrapperStyle,u=s.payloadUniqBy,d=s.payload,h=Tl(Tl({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return F.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(m){r.wrapperNode=m}},YCe(a,Tl(Tl({},this.props),{},{payload:o9(d,u,GCe)})))}}],[{key:"getWithHeight",value:function(r,s){var a=r.props.layout;return a==="vertical"&&pe(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||s}:null}}]),t}(y.PureComponent);aw(ep,"displayName","Legend");aw(ep,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var B$=dg,XCe=dA,JCe=_r,z$=B$?B$.isConcatSpreadable:void 0;function QCe(e){return JCe(e)||XCe(e)||!!(z$&&e&&e[z$])}var ZCe=QCe,eEe=YH,tEe=ZCe;function d9(e,t,n,r,s){var a=-1,o=e.length;for(n||(n=tEe),s||(s=[]);++a<o;){var l=e[a];t>0&&n(l)?t>1?d9(l,t-1,n,r,s):eEe(s,l):r||(s[s.length]=l)}return s}var h9=d9;function nEe(e){return function(t,n,r){for(var s=-1,a=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++s];if(n(a[c],c,a)===!1)break}return t}}var rEe=nEe,sEe=rEe,iEe=sEe(),aEe=iEe,oEe=aEe,lEe=iw;function cEe(e,t){return e&&oEe(e,t,lEe)}var f9=cEe,uEe=fg;function dEe(e,t){return function(n,r){if(n==null)return n;if(!uEe(n))return e(n,r);for(var s=n.length,a=t?s:-1,o=Object(n);(t?a--:++a<s)&&r(o[a],a,o)!==!1;);return n}}var hEe=dEe,fEe=f9,mEe=hEe,pEe=mEe(fEe),pA=pEe,gEe=pA,yEe=fg;function xEe(e,t){var n=-1,r=yEe(e)?Array(e.length):[];return gEe(e,function(s,a,o){r[++n]=t(s,a,o)}),r}var m9=xEe;function vEe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var bEe=vEe,U$=kh;function wEe(e,t){if(e!==t){var n=e!==void 0,r=e===null,s=e===e,a=U$(e),o=t!==void 0,l=t===null,c=t===t,u=U$(t);if(!l&&!u&&!a&&e>t||a&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!s)return 1;if(!r&&!a&&!u&&e<t||u&&n&&s&&!r&&!a||l&&n&&s||!o&&s||!c)return-1}return 0}var jEe=wEe,SEe=jEe;function NEe(e,t,n){for(var r=-1,s=e.criteria,a=t.criteria,o=s.length,l=n.length;++r<o;){var c=SEe(s[r],a[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var kEe=NEe,o1=Q2,_Ee=Z2,CEe=gl,EEe=m9,AEe=bEe,PEe=QH,TEe=kEe,OEe=Mh,REe=_r;function MEe(e,t,n){t.length?t=o1(t,function(a){return REe(a)?function(o){return _Ee(o,a.length===1?a[0]:a)}:a}):t=[OEe];var r=-1;t=o1(t,PEe(CEe));var s=EEe(e,function(a,o,l){var c=o1(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return AEe(s,function(a,o){return TEe(a,o,n)})}var IEe=MEe;function $Ee(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var LEe=$Ee,DEe=LEe,V$=Math.max;function FEe(e,t,n){return t=V$(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,a=V$(r.length-t,0),o=Array(a);++s<a;)o[s]=r[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=r[s];return l[t]=n(o),DEe(e,this,l)}}var BEe=FEe;function zEe(e){return function(){return e}}var UEe=zEe,VEe=Lc,WEe=function(){try{var e=VEe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),p9=WEe,HEe=UEe,W$=p9,qEe=Mh,KEe=W$?function(e,t){return W$(e,"toString",{configurable:!0,enumerable:!1,value:HEe(t),writable:!0})}:qEe,GEe=KEe,YEe=800,XEe=16,JEe=Date.now;function QEe(e){var t=0,n=0;return function(){var r=JEe(),s=XEe-(r-n);if(n=r,s>0){if(++t>=YEe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var ZEe=QEe,e2e=GEe,t2e=ZEe,n2e=t2e(e2e),r2e=n2e,s2e=Mh,i2e=BEe,a2e=r2e;function o2e(e,t){return a2e(i2e(e,t,s2e),e+"")}var l2e=o2e,c2e=G2,u2e=fg,d2e=hA,h2e=pl;function f2e(e,t,n){if(!h2e(n))return!1;var r=typeof t;return(r=="number"?u2e(n)&&d2e(t,n.length):r=="string"&&t in n)?c2e(n[t],e):!1}var ow=f2e,m2e=h9,p2e=IEe,g2e=l2e,H$=ow,y2e=g2e(function(e,t){if(e==null)return[];var n=t.length;return n>1&&H$(e,t[0],t[1])?t=[]:n>2&&H$(t[0],t[1],t[2])&&(t=[t[0]]),p2e(e,m2e(t,1),[])}),x2e=y2e;const gA=it(x2e);function tp(e){"@babel/helpers - typeof";return tp=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},tp(e)}function Jk(){return Jk=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},Jk.apply(this,arguments)}function v2e(e,t){return S2e(e)||j2e(e,t)||w2e(e,t)||b2e()}
vendor: 30,461 bytes, lines 869-877
869function b2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 870In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function w2e(e,t){if(e){if(typeof e=="string")return q$(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 q$(e,t)}}function q$(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 j2e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function S2e(e){if(Array.isArray(e))return e}function K$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function l1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K$(Object(n),!0).forEach(function(r){N2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N2e(e,t,n){return t=k2e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k2e(e){var t=_2e(e,"string");return tp(t)=="symbol"?t:String(t)}function _2e(e,t){if(tp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C2e(e){return Array.isArray(e)&&xn(e[0])&&xn(e[1])?e.join(" ~ "):e}var E2e=function(t){var n=t.separator,r=n===void 0?" : ":n,s=t.contentStyle,a=s===void 0?{}:s,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,h=t.formatter,f=t.itemSorter,m=t.wrapperClassName,g=t.labelClassName,p=t.label,x=t.labelFormatter,v=t.accessibilityLayer,b=v===void 0?!1:v,w=function(){if(d&&d.length){var P={padding:0,margin:0},$=(f?gA(d,f):d).map(function(R,L){if(R.type==="none")return null;var D=l1({display:"block",paddingTop:4,paddingBottom:4,color:R.color||"#000"},l),I=R.formatter||h||C2e,M=R.value,H=R.name,T=M,B=H;if(I&&T!=null&&B!=null){var Y=I(M,H,R,L,d);if(Array.isArray(Y)){var O=v2e(Y,2);T=O[0],B=O[1]}else T=Y}return F.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(L),style:D},xn(B)?F.createElement("span",{className:"recharts-tooltip-item-name"},B):null,xn(B)?F.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,F.createElement("span",{className:"recharts-tooltip-item-value"},T),F.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return F.createElement("ul",{className:"recharts-tooltip-item-list",style:P},$)}return null},j=l1({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),S=l1({margin:0},u),N=!Ge(p),k=N?p:"",_=Ze("recharts-default-tooltip",m),C=Ze("recharts-tooltip-label",g);N&&x&&d!==void 0&&d!==null&&(k=x(p,d));var A=b?{role:"status","aria-live":"assertive"}:{};return F.createElement("div",Jk({className:_,style:j},A),F.createElement("p",{className:C,style:S},F.isValidElement(k)?k:"".concat(k)),w())};function np(e){"@babel/helpers - typeof";return np=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},np(e)}function ky(e,t,n){return t=A2e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A2e(e){var t=P2e(e,"string");return np(t)=="symbol"?t:String(t)}function P2e(e,t){if(np(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(np(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var af="recharts-tooltip-wrapper",T2e={visibility:"hidden"};function O2e(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ze(af,ky(ky(ky(ky({},"".concat(af,"-right"),pe(n)&&t&&pe(t.x)&&n>=t.x),"".concat(af,"-left"),pe(n)&&t&&pe(t.x)&&n<t.x),"".concat(af,"-bottom"),pe(r)&&t&&pe(t.y)&&r>=t.y),"".concat(af,"-top"),pe(r)&&t&&pe(t.y)&&r<t.y))}function G$(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,s=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&pe(a[r]))return a[r];var d=n[r]-l-s,h=n[r]+s;if(t[r])return o[r]?d:h;if(o[r]){var f=d,m=c[r];return f<m?Math.max(h,c[r]):Math.max(d,c[r])}var g=h+l,p=c[r]+u;return g>p?Math.max(d,c[r]):Math.max(h,c[r])}function R2e(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 M2e(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,h;return o.height>0&&o.width>0&&n?(d=G$({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),h=G$({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:s,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=R2e({translateX:d,translateY:h,useTranslate3d:l})):u=T2e,{cssProperties:u,cssClasses:O2e({translateX:d,translateY:h,coordinate:n})}}function Vd(e){"@babel/helpers - typeof";return Vd=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},Vd(e)}function Y$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function X$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y$(Object(n),!0).forEach(function(r){e_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function I2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $2e(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,y9(r.key),r)}}function L2e(e,t,n){return t&&$2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function D2e(e,t,n){return t=Vv(t),F2e(e,g9()?Reflect.construct(t,n||[],Vv(e).constructor):t.apply(e,n))}function F2e(e,t){if(t&&(Vd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qk(e)}function g9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g9=function(){return!!e})()}function Vv(e){return Vv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vv(e)}function Qk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B2e(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&&Zk(e,t)}function Zk(e,t){return Zk=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Zk(e,t)}function e_(e,t,n){return t=y9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y9(e){var t=z2e(e,"string");return Vd(t)=="symbol"?t:String(t)}function z2e(e,t){if(Vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J$=1,U2e=function(e){B2e(t,e);function t(){var n;I2e(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=D2e(this,t,[].concat(s)),e_(Qk(n),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),e_(Qk(n),"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return L2e(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>J$||Math.abs(r.height-this.state.lastBoundingBox.height)>J$)&&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,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.children,d=s.coordinate,h=s.hasPayload,f=s.isAnimationActive,m=s.offset,g=s.position,p=s.reverseDirection,x=s.useTranslate3d,v=s.viewBox,b=s.wrapperStyle,w=M2e({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:m,position:g,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:v}),j=w.cssClasses,S=w.cssProperties,N=X$(X$({transition:f&&a?"transform ".concat(l,"ms ").concat(c):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&h?"visible":"hidden",position:"absolute",top:0,left:0},b);return F.createElement("div",{tabIndex:-1,className:j,style:N,ref:function(_){r.wrapperNode=_}},u)}}]),t}(y.PureComponent),V2e=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Li={isSsr:V2e(),get:function(t){return Li[t]},set:function(t,n){if(typeof t=="string")Li[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(s){Li[s]=t[s]})}}};function Wd(e){"@babel/helpers - typeof";return Wd=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},Wd(e)}function Q$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Z$(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q$(Object(n),!0).forEach(function(r){yA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q$(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H2e(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,v9(r.key),r)}}function q2e(e,t,n){return t&&H2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function K2e(e,t,n){return t=Wv(t),G2e(e,x9()?Reflect.construct(t,n||[],Wv(e).constructor):t.apply(e,n))}function G2e(e,t){if(t&&(Wd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y2e(e)}function Y2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x9=function(){return!!e})()}function Wv(e){return Wv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wv(e)}function X2e(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&&t_(e,t)}function t_(e,t){return t_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},t_(e,t)}function yA(e,t,n){return t=v9(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v9(e){var t=J2e(e,"string");return Wd(t)=="symbol"?t:String(t)}function J2e(e,t){if(Wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q2e(e){return e.dataKey}function Z2e(e,t){return F.isValidElement(e)?F.cloneElement(e,t):typeof e=="function"?F.createElement(e,t):F.createElement(E2e,t)}var Dr=function(e){X2e(t,e);function t(){return W2e(this,t),K2e(this,t,arguments)}return q2e(t,[{key:"render",value:function(){var r=this,s=this.props,a=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.content,d=s.coordinate,h=s.filterNull,f=s.isAnimationActive,m=s.offset,g=s.payload,p=s.payloadUniqBy,x=s.position,v=s.reverseDirection,b=s.useTranslate3d,w=s.viewBox,j=s.wrapperStyle,S=g??[];h&&S.length&&(S=o9(g.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),p,Q2e));var N=S.length>0;return F.createElement(U2e,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:f,active:a,coordinate:d,hasPayload:N,offset:m,position:x,reverseDirection:v,useTranslate3d:b,viewBox:w,wrapperStyle:j},Z2e(u,Z$(Z$({},this.props),{},{payload:S})))}}]),t}(y.PureComponent);yA(Dr,"displayName","Tooltip");yA(Dr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Li.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 eAe=Xi,tAe=function(){return eAe.Date.now()},nAe=tAe,rAe=/\s/;function sAe(e){for(var t=e.length;t--&&rAe.test(e.charAt(t)););return t}var iAe=sAe,aAe=iAe,oAe=/^\s+/;function lAe(e){return e&&e.slice(0,aAe(e)+1).replace(oAe,"")}var cAe=lAe,uAe=cAe,eL=pl,dAe=kh,tL=NaN,hAe=/^[-+]0x[0-9a-f]+$/i,fAe=/^0b[01]+$/i,mAe=/^0o[0-7]+$/i,pAe=parseInt;function gAe(e){if(typeof e=="number")return e;if(dAe(e))return tL;if(eL(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=eL(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=uAe(e);var n=fAe.test(e);return n||mAe.test(e)?pAe(e.slice(2),n?2:8):hAe.test(e)?tL:+e}var b9=gAe,yAe=pl,c1=nAe,nL=b9,xAe="Expected a function",vAe=Math.max,bAe=Math.min;function wAe(e,t,n){var r,s,a,o,l,c,u=0,d=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(xAe);t=nL(t)||0,yAe(n)&&(d=!!n.leading,h="maxWait"in n,a=h?vAe(nL(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f);function m(N){var k=r,_=s;return r=s=void 0,u=N,o=e.apply(_,k),o}function g(N){return u=N,l=setTimeout(v,t),d?m(N):o}function p(N){var k=N-c,_=N-u,C=t-k;return h?bAe(C,a-_):C}function x(N){var k=N-c,_=N-u;return c===void 0||k>=t||k<0||h&&_>=a}function v(){var N=c1();if(x(N))return b(N);l=setTimeout(v,p(N))}function b(N){return l=void 0,f&&r?m(N):(r=s=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=s=l=void 0}function j(){return l===void 0?o:b(c1())}function S(){var N=c1(),k=x(N);if(r=arguments,s=this,c=N,k){if(l===void 0)return g(c);if(h)return clearTimeout(l),l=setTimeout(v,t),m(c)}return l===void 0&&(l=setTimeout(v,t)),o}return S.cancel=w,S.flush=j,S}var jAe=wAe,SAe=jAe,NAe=pl,kAe="Expected a function";function _Ae(e,t,n){var r=!0,s=!0;if(typeof e!="function")throw new TypeError(kAe);return NAe(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),SAe(e,t,{leading:r,maxWait:t,trailing:s})}var CAe=_Ae;const w9=it(CAe);function rp(e){"@babel/helpers - typeof";return rp=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},rp(e)}function rL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function _y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rL(Object(n),!0).forEach(function(r){EAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EAe(e,t,n){return t=AAe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AAe(e){var t=PAe(e,"string");return rp(t)=="symbol"?t:String(t)}function PAe(e,t){if(rp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(rp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function TAe(e,t){return IAe(e)||MAe(e,t)||RAe(e,t)||OAe()}function OAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 871In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RAe(e,t){if(e){if(typeof e=="string")return sL(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 sL(e,t)}}function sL(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 MAe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function IAe(e){if(Array.isArray(e))return e}var Hv=y.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,s=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,h=e.minHeight,f=e.maxHeight,m=e.children,g=e.debounce,p=g===void 0?0:g,x=e.id,v=e.className,b=e.onResize,w=e.style,j=w===void 0?{}:w,S=y.useRef(null),N=y.useRef();N.current=b,y.useImperativeHandle(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),S.current},configurable:!0})});var k=y.useState({containerWidth:s.width,containerHeight:s.height}),_=TAe(k,2),C=_[0],A=_[1],E=y.useCallback(function($,R){A(function(L){var D=Math.round($),I=Math.round(R);return L.containerWidth===D&&L.containerHeight===I?L:{containerWidth:D,containerHeight:I}})},[]);y.useEffect(function(){var $=function(H){var T,B=H[0].contentRect,Y=B.width,O=B.height;E(Y,O),(T=N.current)===null||T===void 0||T.call(N,Y,O)};p>0&&($=w9($,p,{trailing:!0,leading:!1}));var R=new ResizeObserver($),L=S.current.getBoundingClientRect(),D=L.width,I=L.height;return E(D,I),R.observe(S.current),function(){R.disconnect()}},[E,p]);var P=y.useMemo(function(){var $=C.containerWidth,R=C.containerHeight;if($<0||R<0)return null;ba(Gl(o)||Gl(c),`The width(%s) and height(%s) are both fixed numbers, 872 maybe you don't need to use a ResponsiveContainer.`,o,c),ba(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=Gl(o)?$:o,D=Gl(c)?R:c;n&&n>0&&(L?D=L/n:D&&(L=D*n),f&&D>f&&(D=f)),ba(L>0||D>0,`The width(%s) and height(%s) of chart should be greater than 0, 873 please check the style of container, or the props width(%s) and height(%s), 874 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 875 height and width.`,L,D,o,c,d,h,n);var I=!Array.isArray(m)&&Ak.isElement(m)&&va(m.type).endsWith("Chart");return F.Children.map(m,function(M){return Ak.isElement(M)?y.cloneElement(M,_y({width:L,height:D},I?{style:_y({height:"100%",width:"100%",maxHeight:D,maxWidth:L},M.props.style)}:{})):M})},[n,m,c,f,h,d,C,o]);return F.createElement("div",{id:x?"".concat(x):void 0,className:Ze("recharts-responsive-container",v),style:_y(_y({},j),{},{width:o,height:c,minWidth:d,minHeight:h,maxHeight:f}),ref:S},P)}),j9=function(t){return null};j9.displayName="Cell";function sp(e){"@babel/helpers - typeof";return sp=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},sp(e)}function iL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function n_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iL(Object(n),!0).forEach(function(r){$Ae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Ae(e,t,n){return t=LAe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LAe(e){var t=DAe(e,"string");return sp(t)=="symbol"?t:String(t)}function DAe(e,t){if(sp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var su={widthCache:{},cacheCount:0},FAe=2e3,BAe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},aL="recharts_measurement_span";function zAe(e){var t=n_({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var sm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Li.isSsr)return{width:0,height:0};var r=zAe(n),s=JSON.stringify({text:t,copyStyle:r});if(su.widthCache[s])return su.widthCache[s];try{var a=document.getElementById(aL);a||(a=document.createElement("span"),a.setAttribute("id",aL),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=n_(n_({},BAe),r);Object.assign(a.style,o),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return su.widthCache[s]=c,++su.cacheCount>FAe&&(su.cacheCount=0,su.widthCache={}),c}catch{return{width:0,height:0}}},UAe=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ip(e){"@babel/helpers - typeof";return ip=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},ip(e)}function qv(e,t){return qAe(e)||HAe(e,t)||WAe(e,t)||VAe()}function VAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 876In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WAe(e,t){if(e){if(typeof e=="string")return oL(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 oL(e,t)}}function oL(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 HAe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!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)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function qAe(e){if(Array.isArray(e))return e}function KAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lL(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,YAe(r.key),r)}}function GAe(e,t,n){return t&&lL(e.prototype,t),n&&lL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function YAe(e){var t=XAe(e,"string");return ip(t)=="symbol"?t:String(t)}function XAe(e,t){if(ip(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ip(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cL=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,uL=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,JAe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,QAe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,S9={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},ZAe=Object.keys(S9),$u="NaN";function ePe(e,t){return e*S9[t]}var Cy=function(){function e(t,n){KAe(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!JAe.test(n)&&(this.num=NaN,this.unit=""),ZAe.includes(n)&&(this.num=ePe(t,n),this.unit="px")}return GAe(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,s=(r=QAe.exec(n))!==null&&r!==void 0?r:[],a=qv(s,3),o=a[1],l=a[2];return new e(parseFloat(o),l??"")}}]),e}();function N9(e){if(e.includes($u))return $u;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=cL.exec(t))!==null&&n!==void 0?n:[],s=qv(r,4),a=s[1],o=s[2],l=s[3],c=Cy.parse(a??""),u=Cy.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return $u;t=t.replace(cL,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,f=(h=uL.exec(t))!==null&&h!==void 0?h:[],m=qv(f,4),g=m[1],p=m[2],x=m[3],v=Cy.parse(g??""),b=Cy.parse(x??""),w=p==="+"?v.add(b):v.subtract(b);if(w.isNaN())return $u;t=t.replace(uL,w.toString())}return t}var dL=/\(([^()]*)\)/;function tPe(e){for(var t=e;t.includes("(");){var n=dL.exec(t),r=qv(n,2),s=r[1];t=t.replace(dL,N9(s))}return t}function nPe(e){var t=e.replace(/\s+/g,"");return t=tPe(t),t=N9(t),t}function rPe(e){try{return nPe(e)}catch{return $u}}function u1(e){var t=rPe(e.slice(5,-1));return t===$u?"":t}var sPe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],iPe=["dx","dy","angle","className","breakAll"];function r_(){return r_=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},r_.apply(this,arguments)}function hL(e,t){if(e==null)return{};var n=aPe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(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={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function fL(e,t){return uPe(e)||cPe(e,t)||lPe(e,t)||oPe()}function oPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 877In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lPe(e,t){if(e){if(typeof e=="string")return mL(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 mL(e,t)}}function mL(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 cPe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!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)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}
877finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function uPe(e){if(Array.isArray(e))return e}var k9=/[ \f\n\r\t\v\u2028\u2029]+/,_9=function(t){var n=t.children,r=t.breakAll,s=t.style;try{var a=[];Ge(n)||(r?a=n.toString().split(""):a=n.toString().split(k9));var o=a.map(function(c){return{word:c,width:sm(c,s).width}}),l=r?0:sm(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},dPe=function(t,n,r,s,a){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=pe(o),h=l,f=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(D,I){var M=I.word,H=I.width,T=D[D.length-1];if(T&&(s==null||a||T.width+H+r<Number(s)))T.words.push(M),T.width+=H+r;else{var B={words:[M],width:H};D.push(B)}return D},[])},m=f(n),g=function(L){return L.reduce(function(D,I){return D.width>I.width?D:I})};if(!d)return m;for(var p="â¦",x=function(L){var D=h.slice(0,L),I=_9({breakAll:u,style:c,children:D+p}).wordsWithComputedWidth,M=f(I),H=M.length>o||g(M).width>Number(s);return[H,M]},v=0,b=h.length-1,w=0,j;v<=b&&w<=h.length-1;){var S=Math.floor((v+b)/2),N=S-1,k=x(N),_=fL(k,2),C=_[0],A=_[1],E=x(S),P=fL(E,1),$=P[0];if(!C&&!$&&(v=S+1),C&&$&&(b=S-1),!C&&$){j=A;break}w++}return j||m},pL=function(t){var n=Ge(t)?[]:t.toString().split(k9);return[{words:n}]},hPe=function(t){var n=t.width,r=t.scaleToFit,s=t.children,a=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!Li.isSsr){var c,u,d=_9({breakAll:o,children:s,style:a});if(d){var h=d.wordsWithComputedWidth,f=d.spaceWidth;c=h,u=f}else return pL(s);return dPe({breakAll:o,children:s,maxLines:l,style:a},c,u,n,r)}return pL(s)},gL="#808080",Kv=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,h=d===void 0?!1:d,f=t.textAnchor,m=f===void 0?"start":f,g=t.verticalAnchor,p=g===void 0?"end":g,x=t.fill,v=x===void 0?gL:x,b=hL(t,sPe),w=y.useMemo(function(){return hPe({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:h,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,h,b.style,b.width]),j=b.dx,S=b.dy,N=b.angle,k=b.className,_=b.breakAll,C=hL(b,iPe);if(!xn(r)||!xn(a))return null;var A=r+(pe(j)?j:0),E=a+(pe(S)?S:0),P;switch(p){case"start":P=u1("calc(".concat(u,")"));break;case"middle":P=u1("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:P=u1("calc(".concat(w.length-1," * -").concat(l,")"));break}var $=[];if(h){var R=w[0].width,L=b.width;$.push("scale(".concat((pe(L)?L/R:1)/R,")"))}return N&&$.push("rotate(".concat(N,", ").concat(A,", ").concat(E,")")),$.length&&(C.transform=$.join(" ")),F.createElement("text",r_({},ze(C,!0),{x:A,y:E,className:Ze("recharts-text",k),textAnchor:m,fill:v.includes("url")?gL:v}),w.map(function(D,I){var M=D.words.join(_?"":" ");return F.createElement("tspan",{x:A,dy:I===0?P:l,key:M},M)}))};function Yo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fPe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function xA(e){let t,n,r;e.length!==2?(t=Yo,n=(l,c)=>Yo(e(l),c),r=(l,c)=>e(l)-c):(t=e===Yo||e===fPe?e:mPe,n=e,r=e);function s(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const h=u+d>>>1;n(l[h],c)<0?u=h+1:d=h}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const h=u+d>>>1;n(l[h],c)<=0?u=h+1:d=h}while(u<d)}return u}function o(l,c,u=0,d=l.length){const h=s(l,c,u,d-1);return h>u&&r(l[h-1],c)>-r(l[h],c)?h-1:h}return{left:s,center:o,right:a}}function mPe(){return 0}function C9(e){return e===null?NaN:+e}function*pPe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const gPe=xA(Yo),mg=gPe.right;xA(C9).center;class yL extends Map{constructor(t,n=vPe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,s]of t)this.set(r,s)}get(t){return super.get(xL(this,t))}has(t){return super.has(xL(this,t))}set(t,n){return super.set(yPe(this,t),n)}delete(t){return super.delete(xPe(this,t))}}function xL({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function yPe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function xPe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function vPe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function bPe(e=Yo){if(e===Yo)return E9;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 E9(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}
877const wPe=Math.sqrt(50),jPe=Math.sqrt(10),SPe=Math.sqrt(2);function Gv(e,t,n){const r=(t-e)/Math.max(0,n),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),o=a>=wPe?10:a>=jPe?5:a>=SPe?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,s)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?Gv(e,t,n*2):[l,c,u]}function s_(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[s,a,o]=r?Gv(t,e,n):Gv(e,t,n);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(a-u)/-o;else for(let u=0;u<l;++u)c[u]=(a-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(s+u)/-o;else for(let u=0;u<l;++u)c[u]=(s+u)*o;return c}function i_(e,t,n){return t=+t,e=+e,n=+n,Gv(e,t,n)[2]}function a_(e,t,n){t=+t,e=+e,n=+n;const r=t<e,s=r?i_(t,e,n):i_(e,t,n);return(r?-1:1)*(s<0?1/-s:s)}function vL(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function bL(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function A9(e,t,n=0,r=1/0,s){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(s=s===void 0?E9:bPe(s);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),h=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*h*(c-h)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*h/c+f)),g=Math.min(r,Math.floor(t+(c-u)*h/c+f));A9(e,t,m,g,s)}const a=e[t];let o=n,l=r;for(of(e,n,t),s(e[r],a)>0&&of(e,n,r);o<l;){for(of(e,o,l),++o,--l;s(e[o],a)<0;)++o;for(;s(e[l],a)>0;)--l}s(e[n],a)===0?of(e,n,l):(++l,of(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function of(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function NPe(e,t,n){if(e=Float64Array.from(pPe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return bL(e);if(t>=1)return vL(e);var r,s=(r-1)*t,a=Math.floor(s),o=vL(A9(e,a).subarray(0,a+1)),l=bL(e.subarray(a+1));return o+(l-o)*(s-a)}}function kPe(e,t,n=C9){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,s=(r-1)*t,a=Math.floor(s),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(s-a)}}function _Pe(e,t,n){e=+e,t=+t,n=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+n;for(var r=-1,s=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(s);++r<s;)a[r]=e+r*n;return a}function Ps(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ka(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 vA(){var e=new yL,t=[],n=[],r=o_;function s(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 s.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new yL;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return s},s.range=function(a){return arguments.length?(n=Array.from(a),s):n.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return vA(t,n).unknown(r)},Ps.apply(s,arguments),s}function ap(){var e=vA().unknown(void 0),t=e.domain,n=e.range,r=0,s=1,a,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function h(){var f=t().length,m=s<r,g=m?s:r,p=m?r:s;a=(p-g)/Math.max(1,f-c+u*2),l&&(a=Math.floor(a)),g+=(p-g-a*(f-c))*d,o=a*(1-c),l&&(g=Math.round(g),o=Math.round(o));var x=_Pe(f).map(function(v){return g+a*v});return n(m?x.reverse():x)}return e.domain=function(f){return arguments.length?(t(f),h()):t()},e.range=function(f){return arguments.length?([r,s]=f,r=+r,s=+s,h()):[r,s]},e.rangeRound=function(f){return[r,s]=f,r=+r,s=+s,l=!0,h()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(f){return arguments.length?(l=!!f,h()):l},e.padding=function(f){return arguments.length?(c=Math.min(1,u=+f),h()):c},e.paddingInner=function(f){return arguments.length?(c=Math.min(1,f),h()):c},e.paddingOuter=function(f){return arguments.length?(u=+f,h()):u},e.align=function(f){return arguments.length?(d=Math.max(0,Math.min(1,f)),h()):d},e.copy=function(){return ap(t(),[r,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},Ps.apply(h(),arguments)}function P9(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return P9(t())},e}function im(){return P9(ap.apply(null,arguments).paddingInner(1))}function bA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function T9(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function pg(){}var op=.7,Yv=1/op,td="\\s*([+-]?\\d+)\\s*",lp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Di="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",CPe=/^#([0-9a-f]{3,8})$/,EPe=new RegExp(`^rgb\\(${td},${td},${td}\\)$`),APe=new RegExp(`^rgb\\(${Di},${Di},${Di}\\)$`),PPe=new RegExp(`^rgba\\(${td},${td},${td},${lp}\\)$`),TPe=new RegExp(`^rgba\\(${Di},${Di},${Di},${lp}\\)$`),OPe=new RegExp(`^hsl\\(${lp},${Di},${Di}\\)$`),RPe=new RegExp(`^hsla\\(${lp},${Di},${Di},${lp}\\)$`),wL={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};bA(pg,cp,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jL,formatHex:jL,formatHex8:MPe,formatHsl:IPe,formatRgb:SL,toString:SL});function jL(){return this.rgb().formatHex()}function MPe(){return this.rgb().formatHex8()}function IPe(){return O9(this).formatHsl()}function SL(){return this.rgb().formatRgb()}function cp(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=CPe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?NL(t):n===3?new vr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ey(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ey(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=EPe.exec(e))?new vr(t[1],t[2],t[3],1):(t=APe.exec(e))?new vr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=PPe.exec(e))?Ey(t[1],t[2],t[3],t[4]):(t=TPe.exec(e))?Ey(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=OPe.exec(e))?CL(t[1],t[2]/100,t[3]/100,1):(t=RPe.exec(e))?CL(t[1],t[2]/100,t[3]/100,t[4]):wL.hasOwnProperty(e)?NL(wL[e]):e==="transparent"?new vr(NaN,NaN,NaN,0):null}function NL(e){return new vr(e>>16&255,e>>8&255,e&255,1)}function Ey(e,t,n,r){return r<=0&&(e=t=n=NaN),new vr(e,t,n,r)}function $Pe(e){return e instanceof pg||(e=cp(e)),e?(e=e.rgb(),new vr(e.r,e.g,e.b,e.opacity)):new vr}function l_(e,t,n,r){return arguments.length===1?$Pe(e):new vr(e,t,n,r??1)}function vr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}bA(vr,l_,T9(pg,{brighter(e){return e=e==null?Yv:Math.pow(Yv,e),new vr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?op:Math.pow(op,e),new vr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new vr(mc(this.r),mc(this.g),mc(this.b),Xv(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:kL,formatHex:kL,formatHex8:LPe,formatRgb:_L,toString:_L}));function kL(){return`#${Yl(this.r)}${Yl(this.g)}${Yl(this.b)}`}function LPe(){return`#${Yl(this.r)}${Yl(this.g)}${Yl(this.b)}${Yl((isNaN(this.opacity)?1:this.opacity)*255)}`}function _L(){const e=Xv(this.opacity);return`${e===1?"rgb(":"rgba("}${mc(this.r)}, ${mc(this.g)}, ${mc(this.b)}${e===1?")":`, ${e})`}`}function Xv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yl(e){return e=mc(e),(e<16?"0":"")+e.toString(16)}function CL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ks(e,t,n,r)}function O9(e){if(e instanceof Ks)return new Ks(e.h,e.s,e.l,e.opacity);if(e instanceof pg||(e=cp(e)),!e)return new Ks;if(e instanceof Ks)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-s,c=(a+s)/2;return l?(t===a?o=(n-r)/l+(n<r)*6:n===a?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?a+s:2-a-s,o*=60):l=c>0&&c<1?0:o,new Ks(o,l,c,e.opacity)}function DPe(e,t,n,r){return arguments.length===1?O9(e):new Ks(e,t,n,r??1)}function Ks(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}bA(Ks,DPe,T9(pg,{brighter(e){return e=e==null?Yv:Math.pow(Yv,e),new
vendor: 12,086 bytes, line 877
877Ks(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?op:Math.pow(op,e),new Ks(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,s=2*n-r;return new vr(d1(e>=240?e-240:e+120,s,r),d1(e,s,r),d1(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Ks(EL(this.h),Ay(this.s),Ay(this.l),Xv(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=Xv(this.opacity);return`${e===1?"hsl(":"hsla("}${EL(this.h)}, ${Ay(this.s)*100}%, ${Ay(this.l)*100}%${e===1?")":`, ${e})`}`}}));function EL(e){return e=(e||0)%360,e<0?e+360:e}function Ay(e){return Math.max(0,Math.min(1,e||0))}function d1(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 wA=e=>()=>e;function FPe(e,t){return function(n){return e+n*t}}function BPe(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 zPe(e){return(e=+e)==1?R9:function(t,n){return n-t?BPe(t,n,e):wA(isNaN(t)?n:t)}}function R9(e,t){var n=t-e;return n?FPe(e,n):wA(isNaN(e)?t:e)}const AL=function e(t){var n=zPe(t);function r(s,a){var o=n((s=l_(s)).r,(a=l_(a)).r),l=n(s.g,a.g),c=n(s.b,a.b),u=R9(s.opacity,a.opacity);return function(d){return s.r=o(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return r.gamma=e,r}(1);function UPe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(a){for(s=0;s<n;++s)r[s]=e[s]*(1-a)+t[s]*a;return r}}function VPe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function WPe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)s[o]=Ih(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(l){for(o=0;o<r;++o)a[o]=s[o](l);return a}}function HPe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Jv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function qPe(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Ih(e[s],t[s]):r[s]=t[s];return function(a){for(s in n)r[s]=n[s](a);return r}}var c_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,h1=new RegExp(c_.source,"g");function KPe(e){return function(){return e}}function GPe(e){return function(t){return e(t)+""}}function YPe(e,t){var n=c_.lastIndex=h1.lastIndex=0,r,s,a,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=c_.exec(e))&&(s=h1.exec(t));)(a=s.index)>n&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:Jv(r,s)})),n=h1.lastIndex;return n<t.length&&(a=t.slice(n),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?GPe(c[0].x):KPe(t):(t=c.length,function(u){for(var d=0,h;d<t;++d)l[(h=c[d]).i]=h.x(u);return l.join("")})}function Ih(e,t){var n=typeof t,r;return t==null||n==="boolean"?wA(t):(n==="number"?Jv:n==="string"?(r=cp(t))?(t=r,AL):YPe:t instanceof cp?AL:t instanceof Date?HPe:VPe(t)?UPe:Array.isArray(t)?WPe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?qPe:Jv)(e,t)}function jA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function XPe(e,t){t===void 0&&(t=e,e=Ih);for(var n=0,r=t.length-1,s=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(s,s=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function JPe(e){return function(){return e}}function Qv(e){return+e}var PL=[0,1];function ar(e){return e}function u_(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:JPe(isNaN(t)?NaN:.5)}function QPe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function ZPe(e,t,n){var r=e[0],s=e[1],a=t[0],o=t[1];return s<r?(r=u_(s,r),a=n(o,a)):(r=u_(r,s),a=n(a,o)),function(l){return a(r(l))}}function eTe(e,t,n){var r=Math.min(e.length,t.length)-1,s=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)s[o]=u_(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(l){var c=mg(e,l,1,r)-1;return a[c](s[c](l))}}function gg(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function lw(){var e=PL,t=PL,n=Ih,r,s,a,o=ar,l,c,u;function d(){var f=Math.min(e.length,t.length);return o!==ar&&(o=QPe(e[0],e[f-1])),l=f>2?eTe:ZPe,c=u=null,h}function h(f){return f==null||isNaN(f=+f)?a:(c||(c=l(e.map(r),t,n)))(r(o(f)))}return h.invert=function(f){return o(s((u||(u=l(t,e.map(r),Jv)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,Qv),d()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),d()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),n=jA,d()},h.clamp=function(f){return arguments.length?(o=f?!0:ar,d()):o!==ar},h.interpolate=function(f){return arguments.length?(n=f,d()):n},h.unknown=function(f){return arguments.length?(a=f,h):a},function(f,m){return r=f,s=m,d()}}function SA(){return lw()(ar,ar)}function tTe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Zv(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Hd(e){return e=Zv(Math.abs(e)),e?e[1]:NaN}function nTe(e,t){return function(n,r){for(var s=n.length,a=[],o=0,l=e[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(s-=l,s+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function rTe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var sTe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function up(e){if(!(t=sTe.exec(e)))throw new Error("invalid format: "+e);var t;return new NA({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]})}up.prototype=NA.prototype;function NA(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+""}NA.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 iTe(e){e:for(var t=e.length,n=1,r=-1,s;n<t;++n)switch(e[n]){case".":r=s=n;break;case"0":r===0&&(r=n),s=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(s+1):e}var M9;function aTe(e,t){var n=Zv(e,t);if(!n)return e+"";var r=n[0],s=n[1],a=s-(M9=Math.max(-8,Math.min(8,Math.floor(s/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")+Zv(e,Math.max(0,t+a-1))[0]}function TL(e,t){var n=Zv(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const OL={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:tTe,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)=>TL(e*100,t),r:TL,s:aTe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function RL(e){return e}var ML=Array.prototype.map,IL=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oTe(e){var t=e.grouping===void 0||e.thousands===void 0?RL:nTe(ML.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?RL:rTe(ML.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"â":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(h){h=up(h);var f=h.fill,m=h.align,g=h.sign,p=h.symbol,x=h.zero,v=h.width,b=h.comma,w=h.precision,j=h.trim,S=h.type;S==="n"?(b=!0,S="g"):OL[S]||(w===void 0&&(w=12),j=!0,S="g"),(x||f==="0"&&m==="=")&&(x=!0,f="0",m="=");var N=p==="$"?n:p==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",k=p==="$"?r:/[%p]/.test(S)?o:"",_=OL[S],C=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function A(E){var P=N,$=k,R,L,D;if(S==="c")$=_(E)+$,E="";else{E=+E;var I=E<0||1/E<0;if(E=isNaN(E)?c:_(Math.abs(E),w),j&&(E=iTe(E)),I&&+E==0&&g!=="+"&&(I=!1),P=(I?g==="("?g:l:g==="-"||g==="("?"":g)+P,$=(S==="s"?IL[8+M9/3]:"")+$+(I&&g==="("?")":""),C){for(R=-1,L=E.length;++R<L;)if(D=E.charCodeAt(R),48>D||D>57){$=(D===46?s+E.slice(R+1):E.slice(R))+$,E=E.slice(0,R);break}}}b&&!x&&(E=t(E,1/0));var M=P.length+E.length+$.length,H=M<v?new Array(v-M+1).join(f):"";switch(b&&x&&(E=t(H+E,H.length?v-$.length:1/0),H=""),m){case"<":E=P+E+$+H;break;case"=":E=P+H+E+$;break;case"^":E=H.slice(0,M=H.length>>1)+P+E+$+H.slice(M);break;default:E=H+P+E+$;break}return a(E)}return A.toString=function(){return h+""},A}function d(h,f){var m=u((h=up(h),h.type="f",h)),g=Math.max(-8,Math.min(8,Math.floor(Hd(f)/3)))*3,p=Math.pow(10,-g),x=IL[8+g/3];return function(v){return m(p*v)+x}}return{format:u,formatPrefix:d}}var Py,kA,I9;lTe({thousands:",",grouping:[3],currency:["$",""]});function lTe(e){return Py=oTe(e),kA=Py.format,I9=Py.formatPrefix,Py}function cTe(e){return Math.max(0,-Hd(Math.abs(e)))}function uTe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hd(t)/3)))*3-Hd(Math.abs(e)))}function dTe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hd(t)-Hd(e))+1}function $9(e,t,n,r){var s=a_(e,t,n),a;switch(r=up(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=uTe(s,o))&&(r.precision=a),I9(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=dTe(s,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=cTe(s))&&(r.precision=a-(r.type==="%")*2);break}}return kA(r)}function yl(e){var t=e.domain;return e.ticks=function(n){var r=t();return s_(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var s=t();return $9(s[0],s[s.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),s=0,a=r.length-1,o=r[s],l=r[a],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=s,s=a,a=u);d-- >0;){if(u=i_(o,l,n),u===c)return r[s]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function eb(){var e=SA();return e.copy=function(){return gg(e,eb())},Ps.apply(e,arguments),yl(e)}function L9(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,Qv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return L9(e).unknown(t)},e=arguments.length?Array.from(e,Qv):[0,1],yl(n)}function D9(e,t){e=e.slice();var n=0,r=e.length-1,s=e[n],a=e[r],o;return a<s&&(o=n,n=r,r=o,o=s,s=a,a=o),e[n]=t.floor(s),e[r]=t.ceil(a),e}function $L(e){return Math.log(e)}function LL(e){return Math.exp(e)}function hTe(e){return-Math.log(-e)}function fTe(e){return-Math.exp(-e)}function mTe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function pTe(e){return e===10?mTe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function gTe(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 DL(e){return(t,n)=>-e(-t,n)}function _A(e){const t=e($L,LL),n=t.domain;let r=10,s,a;function o(){return s=gTe(r),a=pTe(r),n()[0]<0?(s=DL(s),a=DL(a),e(hTe,fTe)):e($L,LL),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const h=d<u;h&&([u,d]=[d,u]);let f=s(u),m=s(d),g,p;const x=l==null?10:+l;let v=[];
vendor: 4,526 bytes, line 877
877if(!(r%1)&&m-f<x){if(f=Math.floor(f),m=Math.ceil(m),u>0){for(;f<=m;++f)for(g=1;g<r;++g)if(p=f<0?g/a(-f):g*a(f),!(p<u)){if(p>d)break;v.push(p)}}else for(;f<=m;++f)for(g=r-1;g>=1;--g)if(p=f>0?g/a(-f):g*a(f),!(p<u)){if(p>d)break;v.push(p)}v.length*2<x&&(v=s_(u,d,x))}else v=s_(f,m,Math.min(m-f,x)).map(a);return h?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=up(c)).precision==null&&(c.trim=!0),c=kA(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let h=d/a(Math.round(s(d)));return h*r<r-.5&&(h*=r),h<=u?c(d):""}},t.nice=()=>n(D9(n(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),t}function F9(){const e=_A(lw()).domain([1,10]);return e.copy=()=>gg(e,F9()).base(e.base()),Ps.apply(e,arguments),e}function FL(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function BL(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function CA(e){var t=1,n=e(FL(t),BL(t));return n.constant=function(r){return arguments.length?e(FL(t=+r),BL(t)):t},yl(n)}function B9(){var e=CA(lw());return e.copy=function(){return gg(e,B9()).constant(e.constant())},Ps.apply(e,arguments)}function zL(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function yTe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xTe(e){return e<0?-e*e:e*e}function EA(e){var t=e(ar,ar),n=1;function r(){return n===1?e(ar,ar):n===.5?e(yTe,xTe):e(zL(n),zL(1/n))}return t.exponent=function(s){return arguments.length?(n=+s,r()):n},yl(t)}function AA(){var e=EA(lw());return e.copy=function(){return gg(e,AA()).exponent(e.exponent())},Ps.apply(e,arguments),e}function vTe(){return AA.apply(null,arguments).exponent(.5)}function UL(e){return Math.sign(e)*e*e}function bTe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function z9(){var e=SA(),t=[0,1],n=!1,r;function s(a){var o=bTe(e(a));return isNaN(o)?r:n?Math.round(o):o}return s.invert=function(a){return e.invert(UL(a))},s.domain=function(a){return arguments.length?(e.domain(a),s):e.domain()},s.range=function(a){return arguments.length?(e.range((t=Array.from(a,Qv)).map(UL)),s):t.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(n=!!a,s):n},s.clamp=function(a){return arguments.length?(e.clamp(a),s):e.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return z9(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ps.apply(s,arguments),yl(s)}function U9(){var e=[],t=[],n=[],r;function s(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=kPe(e,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:t[mg(n,o)]}return a.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Yo),s()},a.range=function(o){return arguments.length?(t=Array.from(o),s()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return U9().domain(e).range(t).unknown(r)},Ps.apply(a,arguments)}function V9(){var e=0,t=1,n=1,r=[.5],s=[0,1],a;function o(c){return c!=null&&c<=c?s[mg(r,c,0,n)]:a}function l(){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,l()):[e,t]},o.range=function(c){return arguments.length?(n=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return V9().domain([e,t]).range(s).unknown(a)},Ps.apply(yl(o),arguments)}function W9(){var e=[.5],t=[0,1],n,r=1;function s(a){return a!=null&&a<=a?t[mg(e,a,0,r)]:n}return s.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},s.unknown=function(a){return arguments.length?(n=a,s):n},s.copy=function(){return W9().domain(e).range(t).unknown(n)},Ps.apply(s,arguments)}const f1=new Date,m1=new Date;function vn(e,t,n,r){function s(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>
vendor: 7,045 bytes, line 877
877(e(a=new Date(+a)),a),s.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),s.round=a=>{const o=s(a),l=s.ceil(a);return a-o<l-a?o:l},s.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),s.range=(a,o,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<o);return c},s.filter=a=>vn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(s.count=(a,o)=>(f1.setTime(+a),m1.setTime(+o),e(f1),e(m1),Math.floor(n(f1,m1))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?o=>r(o)%a===0:o=>s.count(0,o)%a===0):s)),s}const tb=vn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);tb.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?vn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):tb);tb.range;const ha=1e3,bs=ha*60,fa=bs*60,$a=fa*24,PA=$a*7,VL=$a*30,p1=$a*365,Xl=vn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ha)},(e,t)=>(t-e)/ha,e=>e.getUTCSeconds());Xl.range;const TA=vn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ha)},(e,t)=>{e.setTime(+e+t*bs)},(e,t)=>(t-e)/bs,e=>e.getMinutes());TA.range;const OA=vn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*bs)},(e,t)=>(t-e)/bs,e=>e.getUTCMinutes());OA.range;const RA=vn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ha-e.getMinutes()*bs)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getHours());RA.range;const MA=vn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*fa)},(e,t)=>(t-e)/fa,e=>e.getUTCHours());MA.range;const yg=vn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*bs)/$a,e=>e.getDate()-1);yg.range;const cw=vn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>e.getUTCDate()-1);cw.range;const H9=vn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>Math.floor(e/$a));H9.range;function Dc(e){return vn(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())*bs)/PA)}const uw=Dc(0),nb=Dc(1),wTe=Dc(2),jTe=Dc(3),qd=Dc(4),STe=Dc(5),NTe=Dc(6);uw.range;nb.range;wTe.range;jTe.range;qd.range;STe.range;NTe.range;function Fc(e){return vn(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)/PA)}const dw=Fc(0),rb=Fc(1),kTe=Fc(2),_Te=Fc(3),Kd=Fc(4),CTe=Fc(5),ETe=Fc(6);dw.range;rb.range;kTe.range;_Te.range;Kd.range;CTe.range;ETe.range;const IA=vn(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());IA.range;const $A=vn(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());$A.range;const La=vn(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());La.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vn(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)});La.range;const Da=vn(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());Da.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vn(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)});Da.range;function q9(e,t,n,r,s,a){const o=[[Xl,1,ha],[Xl,5,5*ha],[Xl,15,15*ha],[Xl,30,30*ha],[a,1,bs],[a,5,5*bs],[a,15,15*bs],[a,30,30*bs],[s,1,fa],[s,3,3*fa],[s,6,6*fa],[s,12,12*fa],[r,1,$a],[r,2,2*$a],[n,1,PA],[t,1,VL],[t,3,3*VL],[e,1,p1]];function l(u,d,h){const f=d<u;f&&([u,d]=[d,u]);const m=h&&typeof h.range=="function"?h:c(u,d,h),g=m?m.range(u,+d+1):[];return f?g.reverse():g}function c(u,d,h){const f=Math.abs(d-u)/h,m=xA(([,,x])=>x).right(o,f);if(m===o.length)return e.every(a_(u/p1,d/p1,h));if(m===0)return tb.every(Math.max(a_(u,d,h),1));const[g,p]=o[f/o[m-1][2]<o[m][2]/f?m-1:m];return g.every(p)}return[l,c]}const[ATe,PTe]=q9(Da,$A,dw,H9,MA,OA),[TTe,OTe]=q9(La,IA,uw,yg,RA,TA);function g1(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 y1(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 lf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function RTe(e){var t=e.dateTime,n=e.date,r=e.time,s=e.periods,a=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=cf(s),d=uf(s),h=cf(a),f=uf(a),m=cf(o),g=uf(o),p=cf(l),x=uf(l),v=cf(c),b=uf(c),w={a:I,A:M,b:H,B:T,c:null,d:YL,e:YL,f:nOe,g:hOe,G:mOe,H:ZTe,I:eOe,j:tOe,L:K9,m:rOe,M:sOe,p:B,q:Y,Q:QL,s:ZL,S:iOe,u:aOe,U:oOe,V:lOe,w:cOe,W:uOe,x:null,X:null,y:dOe,Y:fOe,Z:pOe,"%":JL},j={a:O,A:W,b:X,B:J,c:null,d:XL,e:XL,f:vOe,g:AOe,G:TOe,H:gOe,I:yOe,j:xOe,L:Y9,m:bOe,M:wOe,p:G,q:ce,Q:QL,s:ZL,S:jOe,u:SOe,U:NOe,V:kOe,w:_Oe,W:COe,x:null,X:null,y:EOe,Y:POe,Z:OOe,"%":JL},S={a:A,A:E,b:P,B:$,c:R,d:KL,e:KL,f:YTe,g:qL,G:HL,H:GL,I:GL,j:HTe,L:GTe,m:WTe,M:qTe,p:C,q:VTe,Q:JTe,s:QTe,S:KTe,u:DTe,U:FTe,V:BTe,w:LTe,W:zTe,x:L,X:D,y:qL,Y:HL,Z:UTe,"%":XTe};w.x=N(n,w),w.X=N(r,w),w.c=N(t,w),j.x=N(n,j),j.X=N(r,j),j.c=N(t,j);function N(ee,le){return function(he){var Q=[],Re=-1,Te=0,ot=ee.length,Qe,zt,Qn;for(he instanceof Date||(he=new Date(+he));++Re<ot;)ee.charCodeAt(Re)===37&&(Q.push(ee.slice(Te,Re)),(zt=WL[Qe=ee.charAt(++Re)])!=null?Qe=ee.charAt(++Re):zt=Qe==="e"?" ":"0",(Qn=le[Qe])&&(Qe=Qn(he,zt)),Q.push(Qe),Te=Re+1);return Q.push(ee.slice(Te,Re)),Q.join("")}}function k(ee,le){return function(he){var Q=lf(1900,void 0,1),Re=_(Q,ee,he+="",0),Te,ot;if(Re!=he.length)return null;if("Q"in Q)return new Date(Q.Q);if("s"in Q)return new Date(Q.s*1e3+("L"in Q?Q.L:0));if(le&&!("Z"in Q)&&(Q.Z=0),"p"in Q&&(Q.H=Q.H%12+Q.p*12),Q.m===void 0&&(Q.m="q"in Q?Q.q:0),"V"in Q){if(Q.V<1||Q.V>53)return null;"w"in Q||(Q.w=1),"Z"in Q?(Te=y1(lf(Q.y,0,1)),ot=Te.getUTCDay(),Te=ot>4||ot===0?rb.ceil(Te):rb(Te),Te=cw.offset(Te,(Q.V-1)*7),Q.y=Te.getUTCFullYear(),Q.m=Te.getUTCMonth(),Q.d=Te.getUTCDate()+(Q.w+6)%7):(Te=g1(lf(Q.y,0,1)),ot=Te.getDay(),Te=ot>4||ot===0?nb.ceil(Te):nb(Te),Te=yg.offset(Te,(Q.V-1)*7),Q.y=Te.getFullYear(),Q.m=Te.getMonth(),Q.d=Te.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),ot="Z"in Q?y1(lf(Q.y,0,1)).getUTCDay():g1(lf(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(ot+5)%7:Q.w+Q.U*7-(ot+6)%7);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,y1(Q)):g1(Q)}}function _(ee,le,he,Q){for(var Re=0,Te=le.length,ot=he.length,Qe,zt;Re<Te;){if(Q>=ot)return-1;
vendor: 6,384 bytes, line 877
877if(Qe=le.charCodeAt(Re++),Qe===37){if(Qe=le.charAt(Re++),zt=S[Qe in WL?le.charAt(Re++):Qe],!zt||(Q=zt(ee,he,Q))<0)return-1}else if(Qe!=he.charCodeAt(Q++))return-1}return Q}function C(ee,le,he){var Q=u.exec(le.slice(he));return Q?(ee.p=d.get(Q[0].toLowerCase()),he+Q[0].length):-1}function A(ee,le,he){var Q=m.exec(le.slice(he));return Q?(ee.w=g.get(Q[0].toLowerCase()),he+Q[0].length):-1}function E(ee,le,he){var Q=h.exec(le.slice(he));return Q?(ee.w=f.get(Q[0].toLowerCase()),he+Q[0].length):-1}function P(ee,le,he){var Q=v.exec(le.slice(he));return Q?(ee.m=b.get(Q[0].toLowerCase()),he+Q[0].length):-1}function $(ee,le,he){var Q=p.exec(le.slice(he));return Q?(ee.m=x.get(Q[0].toLowerCase()),he+Q[0].length):-1}function R(ee,le,he){return _(ee,t,le,he)}function L(ee,le,he){return _(ee,n,le,he)}function D(ee,le,he){return _(ee,r,le,he)}function I(ee){return o[ee.getDay()]}function M(ee){return a[ee.getDay()]}function H(ee){return c[ee.getMonth()]}function T(ee){return l[ee.getMonth()]}function B(ee){return s[+(ee.getHours()>=12)]}function Y(ee){return 1+~~(ee.getMonth()/3)}function O(ee){return o[ee.getUTCDay()]}function W(ee){return a[ee.getUTCDay()]}function X(ee){return c[ee.getUTCMonth()]}function J(ee){return l[ee.getUTCMonth()]}function G(ee){return s[+(ee.getUTCHours()>=12)]}function ce(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var le=N(ee+="",w);return le.toString=function(){return ee},le},parse:function(ee){var le=k(ee+="",!1);return le.toString=function(){return ee},le},utcFormat:function(ee){var le=N(ee+="",j);return le.toString=function(){return ee},le},utcParse:function(ee){var le=k(ee+="",!0);return le.toString=function(){return ee},le}}}var WL={"-":"",_:" ",0:"0"},Pn=/^\s*\d+/,MTe=/^%/,ITe=/[\\^$*+?|[\]().{}]/g;function at(e,t,n){var r=e<0?"-":"",s=(r?-e:e)+"",a=s.length;return r+(a<n?new Array(n-a+1).join(t)+s:s)}function $Te(e){return e.replace(ITe,"\\$&")}function cf(e){return new RegExp("^(?:"+e.map($Te).join("|")+")","i")}function uf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function LTe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function DTe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function FTe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function BTe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function zTe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function HL(e,t,n){var r=Pn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function qL(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function UTe(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 VTe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function WTe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function KL(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function HTe(e,t,n){var r=Pn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function GL(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function qTe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function KTe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function GTe(e,t,n){var r=Pn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function YTe(e,t,n){var r=Pn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function XTe(e,t,n){var r=MTe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function JTe(e,t,n){var r=Pn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function QTe(e,t,n){var r=Pn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function YL(e,t){return at(e.getDate(),t,2)}function ZTe(e,t){return at(e.getHours(),t,2)}function eOe(e,t){return at(e.getHours()%12||12,t,2)}function tOe(e,t){return at(1+yg.count(La(e),e),t,3)}function K9(e,t){return at(e.getMilliseconds(),t,3)}function nOe(e,t){return K9(e,t)+"000"}function rOe(e,t){return at(e.getMonth()+1,t,2)}function sOe(e,t){return at(e.getMinutes(),t,2)}function iOe(e,t){return at(e.getSeconds(),t,2)}function aOe(e){var t=e.getDay();return t===0?7:t}function oOe(e,t){return at(uw.count(La(e)-1,e),t,2)}function G9(e){var t=e.getDay();return t>=4||t===0?qd(e):qd.ceil(e)}function lOe(e,t){return e=G9(e),at(qd.count(La(e),e)+(La(e).getDay()===4),t,2)}function cOe(e){return e.getDay()}function uOe(e,t){return at(nb.count(La(e)-1,e),t,2)}function dOe(e,t){return at(e.getFullYear()%100,t,2)}function hOe(e,t){return e=G9(e),at(e.getFullYear()%100,t,2)}function fOe(e,t){return at(e.getFullYear()%1e4,t,4)}function mOe(e,t){var n=e.getDay();return e=n>=4||n===0?qd(e):qd.ceil(e),at(e.getFullYear()%1e4,t,4)}function pOe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+at(t/60|0,"0",2)+at(t%60,"0",2)}function XL(e,t){return at(e.getUTCDate(),t,2)}function gOe(e,t){return at(e.getUTCHours(),t,2)}function yOe(e,t){return at(e.getUTCHours()%12||12,t,2)}function xOe(e,t){return at(1+cw.count(Da(e),e),t,3)}function Y9(e,t){return at(e.getUTCMilliseconds(),t,3)}function vOe(e,t){return Y9(e,t)+"000"}function bOe(e,t){return at(e.getUTCMonth()+1,t,2)}function wOe(e,t){return at(e.getUTCMinutes(),t,2)}function jOe(e,t){return at(e.getUTCSeconds(),t,2)}function SOe(e){var t=e.getUTCDay();return t===0?7:t}function NOe(e,t){return at(dw.count(Da(e)-1,e),t,2)}function X9(e){var t=e.getUTCDay();return t>=4||t===0?Kd(e):Kd.ceil(e)}function kOe(e,t){return e=X9(e),at(Kd.count(Da(e),e)+(Da(e).getUTCDay()===4),t,2)}function _Oe(e){return e.getUTCDay()}function COe(e,t){return at(rb.count(Da(e)-1,e),t,2)}function EOe(e,t){return at(e.getUTCFullYear()%100,t,2)}function AOe(e,t){return e=X9(e),at(e.getUTCFullYear()%100,t,2)}function POe(e,t){return at(e.getUTCFullYear()%1e4,t,4)}function TOe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Kd(e):Kd.ceil(e),at(e.getUTCFullYear()%1e4,t,4)}function OOe(){return"+0000"}function JL(){return"%"}function QL(e){return+e}function ZL(e){return Math.floor(+e/1e3)}var iu,J9,Q9;ROe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
877ay","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 ROe(e){return iu=RTe(e),J9=iu.format,iu.parse,Q9=iu.utcFormat,iu.utcParse,iu}function MOe(e){return new Date(e)}function IOe(e){return e instanceof Date?+e:+new Date(+e)}function LA(e,t,n,r,s,a,o,l,c,u){var d=SA(),h=d.invert,f=d.domain,m=u(".%L"),g=u(":%S"),p=u("%I:%M"),x=u("%I %p"),v=u("%a %d"),b=u("%b %d"),w=u("%B"),j=u("%Y");function S(N){return(c(N)<N?m:l(N)<N?g:o(N)<N?p:a(N)<N?x:r(N)<N?s(N)<N?v:b:n(N)<N?w:j)(N)}return d.invert=function(N){return new Date(h(N))},d.domain=function(N){return arguments.length?f(Array.from(N,IOe)):f().map(MOe)},d.ticks=function(N){var k=f();return e(k[0],k[k.length-1],N??10)},d.tickFormat=function(N,k){return k==null?S:u(k)},d.nice=function(N){var k=f();return(!N||typeof N.range!="function")&&(N=t(k[0],k[k.length-1],N??10)),N?f(D9(k,N)):d},d.copy=function(){return gg(d,LA(e,t,n,r,s,a,o,l,c,u))},d}function $Oe(){return Ps.apply(LA(TTe,OTe,La,IA,uw,yg,RA,TA,Xl,J9).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function LOe(){return Ps.apply(LA(ATe,PTe,Da,$A,dw,cw,MA,OA,Xl,Q9).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function hw(){var e=0,t=1,n,r,s,a,o=ar,l=!1,c;function u(h){return h==null||isNaN(h=+h)?c:o(s===0?.5:(h=(a(h)-n)*s,l?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([e,t]=h,n=a(e=+e),r=a(t=+t),s=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(h){return arguments.length?(l=!!h,u):l},u.interpolator=function(h){return arguments.length?(o=h,u):o};function d(h){return function(f){var m,g;return arguments.length?([m,g]=f,o=h(m,g),u):[o(0),o(1)]}}return u.range=d(Ih),u.rangeRound=d(jA),u.unknown=function(h){return arguments.length?(c=h,u):c},function(h){return a=h,n=h(e),r=h(t),s=n===r?0:1/(r-n),u}}function xl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Z9(){var e=yl(hw()(ar));return e.copy=function(){return xl(e,Z9())},Ka.apply(e,arguments)}function e7(){var e=_A(hw()).domain([1,10]);return e.copy=function(){return xl(e,e7()).base(e.base())},Ka.apply(e,arguments)}function t7(){var e=CA(hw());return e.copy=function(){return xl(e,t7()).constant(e.constant())},Ka.apply(e,arguments)}function DA(){var e=EA(hw());return e.copy=function(){return xl(e,DA()).exponent(e.exponent())},Ka.apply(e,arguments)}function DOe(){return DA.apply(null,arguments).exponent(.5)}function n7(){var e=[],t=ar;function n(r){if(r!=null&&!isNaN(r=+r))return t((mg(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let s of r)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Yo),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,s)=>t(s/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(s,a)=>NPe(e,a/r))},n.copy=function(){return n7(t).domain(e)},Ka.apply(n,arguments)}function fw(){var e=0,t=.5,n=1,r=1,s,a,o,l,c,u=ar,d,h=!1,f;function m(p){return isNaN(p=+p)?f:(p=.5+((p=+d(p))-a)*(r*p<r*a?l:c),u(h?Math.max(0,Math.min(1,p)):p))}m.domain=function(p){return arguments.length?([e,t,n]=p,s=d(e=+e),a=d(t=+t),o=d(n=+n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,m):[e,t,n]},m.clamp=function(p){return arguments.length?(h=!!p,m):h},m.interpolator=function(p){return arguments.length?(u=p,m):u};function g(p){return function(x){var v,b,w;return arguments.length?([v,b,w]=x,u=XPe(p,[v,b,w]),m):[u(0),u(.5),u(1)]}}return m.range=g(Ih),m.rangeRound=g(jA),m.unknown=function(p){return arguments.length?(f=p,m):f},function(p){return d=p,s=p(e),a=p(t),o=p(n),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,m}}function r7(){var e=yl(fw()(ar));return e.copy=function(){return xl(e,r7())},Ka.apply(e,arguments)}function s7(){var e=_A(fw()).domain([.1,1,10]);return e.copy=function(){return xl(e,s7()).base(e.base())},Ka.apply(e,arguments)}function i7(){var e=CA(fw());return e.copy=function(){return xl(e,i7()).constant(e.constant())},Ka.apply(e,arguments)}function FA(){var e=EA(fw());return e.copy=function(){return xl(e,FA()).exponent(e.exponent())},Ka.apply(e,arguments)}function FOe(){return FA.apply(null,arguments).exponent(.5)}const eD=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ap,scaleDiverging:r7,scaleDivergingLog:s7,scaleDivergingPow:FA,scaleDivergingSqrt:FOe,scaleDivergingSymlog:i7,scaleIdentity:L9,scaleImplicit:o_,scaleLinear:eb,scaleLog:F9,scaleOrdinal:vA,scalePoint:im,scalePow:AA,scaleQuantile:U9,scaleQuantize:V9,scaleRadial:z9,scaleSequential:Z9,scaleSequentialLog:e7,scaleSequentialPow:DA,scaleSequentialQuantile:n7,scaleSequentialSqrt:DOe,scaleSequentialSymlog:t7,scaleSqrt:vTe,scaleSymlog:B9,scaleThreshold:W9,scaleTime:$Oe,scaleUtc:LOe,tickFormat:$9},Symbol.toStringTag,{value:"Module"}));var BOe=kh;function zOe(e,t,n){for(var r=-1,s=e.length;++r<s;){var a=e[r],o=t(a);if(o!=null&&(l===void 0?o===o&&!BOe(o):n(o,l)))var l=o,c=a}return c}var a7=zOe;function UOe(e,t){return e>t}var VOe=UOe,WOe=a7,HOe=VOe,qOe=Mh;function KOe(e){return e&&e.length?WOe(e,qOe,HOe):void 0}var GOe=KOe;const Io=it(GOe);function YOe(e,t){return e<t}var XOe=YOe,JOe=a7,QOe=XOe,ZOe=Mh;function eRe(e){return e&&e.length?JOe(e,ZOe,QOe):void 0}var tRe=eRe;const mw=it(tRe);var nRe=Q2,rRe=gl,sRe=m9,iRe=_r;function aRe(e,t){var n=iRe(e)?nRe:sRe;return n(e,rRe(t))}var oRe=aRe,lRe=h9,cRe=oRe;function uRe(e,t){return lRe(cRe(e,t),1)}var dRe=uRe;const hRe=it(dRe);var fRe=mA;function mRe(e,t){return fRe(e,t)}var pRe=mRe;const Gd=it(pRe);
vendor: 56,704 bytes, lines 877-903
877var $h=1e9,gRe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},zA,Vt=!0,Es="[DecimalError] ",pc=Es+"Invalid argument: ",BA=Es+"Exponent out of range: ",Lh=Math.floor,Dl=Math.pow,yRe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ur,Sn=1e7,Ft=7,o7=9007199254740991,sb=Lh(o7/Ft),je={};je.absoluteValue=je.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};je.comparedTo=je.cmp=function(e){var t,n,r,s,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,s=e.d.length,t=0,n=r<s?r:s;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Ft;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};je.dividedBy=je.div=function(e){return wa(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,n=t.constructor;return St(wa(t,new n(e),0,1),n.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return fn(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,n=this,r=n.constructor,s=r.precision,a=s+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Ur))throw Error(Es+"NaN");if(n.s<1)throw Error(Es+(n.s?"NaN":"-Infinity"));return n.eq(Ur)?new r(0):(Vt=!1,t=wa(dp(n,a),dp(e,a),a),Vt=!0,St(t,s))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?u7(t,e):l7(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,n=this,r=n.constructor,s=r.precision;if(e=new r(e),!e.s)throw Error(Es+"NaN");return n.s?(Vt=!1,t=wa(n,e,0,1).times(e),Vt=!0,n.minus(t)):St(new r(n),s)};je.naturalExponential=je.exp=function(){return c7(this)};je.naturalLogarithm=je.ln=function(){return dp(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?l7(t,e):u7(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,n,r,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(pc+e);if(t=fn(s)+1,r=s.d.length-1,n=r*Ft+1,r=s.d[r],r){for(;r%10==0;r/=10)n--;for(r=s.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};je.squareRoot=je.sqrt=function(){var e,t,n,r,s,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Es+"NaN")}for(e=fn(l),Vt=!1,s=Math.sqrt(+l),s==0||s==1/0?(t=Ai(l.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=Lh((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(s.toString()),n=c.precision,s=o=n+3;;)if(a=r,r=a.plus(wa(l,a,o+2)).times(.5),Ai(a.d).slice(0,o)===(t=Ai(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),s==o&&t=="4999"){if(St(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return Vt=!0,St(r,n)};je.times=je.mul=function(e){var t,n,r,s,a,o,l,c,u,d=this,h=d.constructor,f=d.d,m=(e=new h(e)).d;if(!d.s||!e.s)return new h(0);for(e.s*=d.s,n=d.e+e.e,c=f.length,u=m.length,c<u&&(a=f,f=m,m=a,o=c,c=u,u=o),a=[],o=c+u,r=o;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,s=c+r;s>r;)l=a[s]+m[r]*f[s-r-1]+t,a[s--]=l%Sn|0,t=l/Sn|0;a[s]=(a[s]+t)%Sn|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Vt?St(e,h.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Vi(e,0,$h),t===void 0?t=r.rounding:Vi(t,0,8),St(n,e+fn(n)+1,t))};je.toExponential=function(e,t){var n,r=this,s=r.constructor;return e===void 0?n=Tc(r,!0):(Vi(e,0,$h),t===void 0?t=s.rounding:Vi(t,0,8),r=St(new s(r),e+1,t),n=Tc(r,!0,e+1)),n};je.toFixed=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?Tc(s):(Vi(e,0,$h),t===void 0?t=a.rounding:Vi(t,0,8),r=St(new a(s),e+fn(s)+1,t),n=Tc(r.abs(),!1,e+fn(r)+1),s.isneg()&&!s.isZero()?"-"+n:n)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return St(new t(e),fn(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,n,r,s,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Ur);if(l=new c(l),!l.s){if(e.s<1)throw Error(Es+"Infinity");return l}if(l.eq(Ur))return l;if(r=c.precision,e.eq(Ur))return St(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=o7){for(s=new c(Ur),t=Math.ceil(r/Ft+4),Vt=!1;n%2&&(s=s.times(l),nD(s.d,t)),n=Lh(n/2),n!==0;)l=l.times(l),nD(l.d,t);return Vt=!0,e.s<0?new c(Ur).div(s):St(s,r)}}else if(a<0)throw Error(Es+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Vt=!1,s=e.times(dp(l,r+u)),Vt=!0,s=c7(s),s.s=a,s};je.toPrecision=function(e,t){var n,r,s=this,a=s.constructor;return e===void 0?(n=fn(s),r=Tc(s,n<=a.toExpNeg||n>=a.toExpPos)):(Vi(e,1,$h),t===void 0?t=a.rounding:Vi(t,0,8),s=St(new a(s),e,t),n=fn(s),r=Tc(s,e<=n||n<=a.toExpNeg,e)),r};je.toSignificantDigits=je.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Vi(e,1,$h),t===void 0?t=r.rounding:Vi(t,0,8)),St(new r(n),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=fn(e),n=e.constructor;return Tc(e,t<=n.toExpNeg||t>=n.toExpPos)};function l7(e,t){var n,r,s,a,o,l,c,u,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Vt?St(t,h):t;if(c=e.d,u=t.d,o=e.e,s=t.e,c=c.slice(),a=o-s,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,s=o,l=c.length),o=Math.ceil(h/Ft),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/Sn|0,c[a]%=Sn;for(n&&(c.unshift(n),++s),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=s,Vt?St(t,h):t}function Vi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(pc+e)}function Ai(e){var t,n,r,s=e.length-1,a="",o=e[0];if(s>0){for(a+=o,t=1;t<s;t++)r=e[t]+"",n=Ft-r.length,n&&(a+=uo(n)),a+=r;o=e[t],r=o+"",n=Ft-r.length,n&&(a+=uo(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var wa=function(){function e(r,s){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*s+o,r[l]=a%Sn|0,o=a/Sn|0;return o&&r.unshift(o),r}function t(r,s,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=s[l]){c=r[l]>s[l]?1:-1;break}return c}function n(r,s,a){for(var o=0;a--;)r[a]-=o,o=r[a]<s[a]?1:0,r[a]=o*Sn+r[a]-s[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,a,o){var l,c,u,d,h,f,m,g,p,x,v,b,w,j,S,N,k,_,C=r.constructor,A=r.s==s.s?1:-1,E=r.d,P=s.d;if(!r.s)return new C(r);if(!s.s)throw Error(Es+"Division by zero");for(c=r.e-s.e,k=P.length,S=E.length,m=new C(A),g=m.d=[],u=0;P[u]==(E[u]||0);)++u;if(P[u]>(E[u]||0)&&--c,a==null?b=a=C.precision:o?b=a+(fn(r)-fn(s))+1:b=a,b<0)return new C(0);if(b=b/Ft+2|0,u=0,k==1)for(d=0,P=P[0],b++;(u<S||d)&&b--;u++)w=d*Sn+(E[u]||0),g[u]=w/P|0,d=w%P|0;else{for(d=Sn/(P[0]+1)|0,d>1&&(P=e(P,d),E=e(E,d),k=P.length,S=E.length),j=k,p=E.slice(0,k),x=p.length;x<k;)p[x++]=0;_=P.slice(),_.unshift(0),N=P[0],P[1]>=Sn/2&&++N;do d=0,l=t(P,p,k,x),l<0?(v=p[0],k!=x&&(v=v*Sn+(p[1]||0)),d=v/N|0,d>1?(d>=Sn&&(d=Sn-1),h=e(P,d),f=h.length,x=p.length,l=t(h,p,f,x),l==1&&(d--,n(h,k<f?_:P,f))):(d==0&&(l=d=1),h=P.slice()),f=h.length,f<x&&h.unshift(0),n(p,h,x),l==-1&&(x=p.length,l=t(P,p,k,x),l<1&&(d++,n(p,k<x?_:P,x))),x=p.length):l===0&&(d++,p=[0]),g[u++]=d,l&&p[0]?p[x++]=E[j]||0:(p=[E[j]],x=1);while((j++<S||p[0]!==void 0)&&b--)}return g[0]||g.shift(),m.e=c,St(m,o?a+fn(m)+1:a)}}();function c7(e,t){var n,r,s,a,o,l,c=0,u=0,d=e.constructor,h=d.precision;if(fn(e)>16)throw Error(BA+fn(e));if(!e.s)return new d(Ur);for(t==null?(Vt=!1,l=h):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Dl(2,u))/Math.LN10*2+5|0,l+=r,n=s=a=new d(Ur),d.precision=l;;){if(s=St(s.times(e),l),n=n.times(++c),o=a.plus(wa(s,n,l)),Ai(o.d).slice(0,l)===Ai(a.d).slice(0,l)){for(;u--;)a=St(a.times(a),l);return d.precision=h,t==null?(Vt=!0,St(a,h)):a}a=o}}function fn(e){for(var t=e.e*Ft,n=e.d[0];n>=10;n/=10)t++;return t}function x1(e,t,n){if(t>e.LN10.sd())throw Vt=!0,n&&(e.precision=n),Error(Es+"LN10 precision limit exceeded");return St(new e(e.LN10),t)}function uo(e){for(var t="";e--;)t+="0";return t}function dp(e,t){var n,r,s,a,o,l,c,u,d,h=1,f=10,m=e,g=m.d,p=m.constructor,x=p.precision;if(m.s<1)throw Error(Es+(m.s?"NaN":"-Infinity"));if(m.eq(Ur))return new p(0);if(t==null?(Vt=!1,u=x):u=t,m.eq(10))return t==null&&(Vt=!0),x1(p,u);if(u+=f,p.precision=u,n=Ai(g),r=n.charAt(0),a=fn(m),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=Ai(m.d),r=n.charAt(0),h++;a=fn(m),r>1?(m=new p("0."+n),a++):m=new p(r+"."+n.slice(1))}else return c=x1(p,u+2,x).times(a+""),m=dp(new p(r+"."+n.slice(1)),u-f).plus(c),p.precision=x,t==null?(Vt=!0,St(m,x)):m;for(l=o=m=wa(m.minus(Ur),m.plus(Ur),u),d=St(m.times(m),u),s=3;;){if(o=St(o.times(d),u),c=l.plus(wa(o,new p(s),u)),Ai(c.d).slice(0,u)===Ai(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(x1(p,u+2,x).times(a+""))),l=wa(l,new p(h),u),p.precision=x,t==null?(Vt=!0,St(l,x)):l;l=c,s+=2}}function tD(e,t){var n,r,s;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(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(r,s),t){if(s-=r,n=n-r-1,e.e=Lh(n/Ft),e.d=[],r=(n+1)%Ft,n<0&&(r+=Ft),r<s){for(r&&e.d.push(+t.slice(0,r)),s-=Ft;r<s;)e.d.push(+t.slice(r,r+=Ft));t=t.slice(r),r=Ft-t.length}else r-=s;for(;r--;)t+="0";if(e.d.push(+t),Vt&&(e.e>sb||e.e<-sb))throw Error(BA+n)}else e.s=0,e.e=0,e.d=[0];return e}function St(e,t,n){var r,s,a,o,l,c,u,d,h=e.d;for(o=1,a=h[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=Ft,s=t,u=h[d=0];else{if(d=Math.ceil((r+1)/Ft),a=h.length,d>=a)return e;for(u=a=h[d],o=1;a>=10;a/=10)o++;r%=Ft,s=r-Ft+o}if(n!==void 0&&(a=Dl(10,o-s-1),l=u/a%10|0,c=t<0||h[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?s>0?u/Dl(10,o-s):0:h[d-1])%10&1||n==(e.s<0?8:7))),t<1||!h[0])return c?(a=fn(e),h.length=1,t=t-a-1,h[0]=Dl(10,(Ft-t%Ft)%Ft),e.e=Lh(-t/Ft)||0):(h.length=1,h[0]=e.e=e.s=0),e;if(r==0?(h.length=d,a=1,d--):(h.length=d+1,a=Dl(10,Ft-r),h[d]=s>0?(u/Dl(10,o-s)%Dl(10,s)|0)*a:0),c)for(;;)if(d==0){(h[0]+=a)==Sn&&(h[0]=1,++e.e);break}else{if(h[d]+=a,h[d]!=Sn)break;h[d--]=0,a=1}for(r=h.length;h[--r]===0;)h.pop();if(Vt&&(e.e>sb||e.e<-sb))throw Error(BA+fn(e));return e}function u7(e,t){var n,r,s,a,o,l,c,u,d,h,f=e.constructor,m=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),Vt?St(t,m):t;if(c=e.d,h=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=h.length):(n=h,r=u,l=c.length),s=Math.max(Math.ceil(m/Ft),l)+2,o>s&&(o=s,n.length=1),n.reverse(),s=o;s--;)n.push(0);n.reverse()}else{for(s=c.length,l=h.length,d=s<l,d&&(l=s),s=0;s<l;s++)if(c[s]!=h[s]){d=c[s]<h[s];break}o=0}for(d&&(n=c,c=h,h=n,t.s=-t.s),l=c.length,s=h.length-l;s>0;--s)c[l++]=0;for(s=h.length;s>o;){if(c[--s]<h[s]){for(a=s;a&&c[--a]===0;)c[a]=Sn-1;--c[a],c[s]+=Sn}c[s]-=h[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Vt?St(t,m):t):new f(0)}function Tc(e,t,n){var r,s=fn(e),a=Ai(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+uo(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+uo(-s-1)+a,n&&(r=n-o)>0&&(a+=uo(r))):s>=o?(a+=uo(s+1-o),n&&(r=n-s-1)>0&&(a=a+"."+uo(r))):((r=s+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(s+1===o&&(a+="."),a+=uo(r))),e.s<0?"-"+a:a}function nD(e,t){if(e.length>t)return e.length=t,!0}function d7(e){var t,n,r;function s(a){var o=this;if(!(o instanceof s))return new s(a);if(o.constructor=s,a instanceof s){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(pc+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 tD(o,a.toString())}else if(typeof a!="string")throw Error(pc+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,yRe.test(a))tD(o,a);else throw Error(pc+a)}if(s.prototype=je,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=d7,s.config=s.set=xRe,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 s.config(e),s}function xRe(e){if(!e||typeof e!="object")throw Error(Es+"Object expected");var t,n,r,s=["precision",1,$h,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((r=e[n=s[t]])!==void 0)if(Lh(r)===r&&r>=s[t+1]&&r<=s[t+2])this[n]=r;else throw Error(pc+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(pc+n+": "+r);return this}var zA=d7(gRe);Ur=new zA(1);const wt=zA;function vRe(e){return SRe(e)||jRe(e)||wRe(e)||bRe()}function bRe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 878In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wRe(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 jRe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function SRe(e){if(Array.isArray(e))return d_(e)}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}var NRe=function(t){return t},h7={"@@functional/placeholder":!0},f7=function(t){return t===h7},rD=function(t){return function n(){return arguments.length===0||arguments.length===1&&f7(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},kRe=function e(t,n){return t===1?n:rD(function(){for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];var o=s.filter(function(l){return l!==h7}).length;return o>=t?n.apply(void 0,s):e(t-o,rD(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=s.map(function(h){return f7(h)?c.shift():h});return n.apply(void 0,vRe(d).concat(c))}))})},pw=function(t){return kRe(t.length,t)},h_=function(t,n){for(var r=[],s=t;s<n;++s)r[s-t]=s;return r},_Re=pw(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),CRe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return NRe;var s=n.reverse(),a=s[0],o=s.slice(1);return function(){return o.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},f_=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},m7=function(t){var n=null,r=null;return function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function ERe(e){var t;return e===0?t=1:t=Math.floor(new wt(e).abs().log(10).toNumber())+1,t}function ARe(e,t,n){for(var r=new wt(e),s=0,a=[];r.lt(t)&&s<1e5;)a.push(r.toNumber()),r=r.add(n),s++;return a}var PRe=pw(function(e,t,n){var r=+e,s=+t;return r+n*(s-r)}),TRe=pw(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),ORe=pw(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const gw={rangeStep:ARe,getDigitCount:ERe,interpolateNumber:PRe,uninterpolateNumber:TRe,uninterpolateTruncation:ORe};function m_(e){return IRe(e)||MRe(e)||p7(e)||RRe()}function RRe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 879In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MRe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function IRe(e){if(Array.isArray(e))return p_(e)}function hp(e,t){return DRe(e)||LRe(e,t)||p7(e,t)||$Re()}function $Re(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 880In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p7(e,t){if(e){if(typeof e=="string")return p_(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 p_(e,t)}}function p_(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 LRe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,s=!1,a=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){s=!0,a=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(s)throw a}}return n}}function DRe(e){if(Array.isArray(e))return e}function g7(e){var t=hp(e,2),n=t[0],r=t[1],s=n,a=r;return n>r&&(s=r,a=n),[s,a]}function y7(e,t,n){if(e.lte(0))return new wt(0);var r=gw.getDigitCount(e.toNumber()),s=new wt(10).pow(r),a=e.div(s),o=r!==1?.05:.1,l=new wt(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(s);return t?c:new wt(Math.ceil(c))}function FRe(e,t,n){var r=1,s=new wt(e);if(!s.isint()&&n){var a=Math.abs(e);a<1?(r=new wt(10).pow(gw.getDigitCount(e)-1),s=new wt(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new wt(Math.floor(e)))}else e===0?s=new wt(Math.floor((t-1)/2)):n||(s=new wt(Math.floor(e)));var o=Math.floor((t-1)/2),l=CRe(_Re(function(c){return s.add(new wt(c-o).mul(r)).toNumber()}),h_);return l(0,t)}function x7(e,t,n,r){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new wt(0),tickMin:new wt(0),tickMax:new wt(0)};var a=y7(new wt(t).sub(e).div(n-1),r,s),o;e<=0&&t>=0?o=new wt(0):(o=new wt(e).add(t).div(2),o=o.sub(new wt(o).mod(a)));var l=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new wt(t).sub(o).div(a).toNumber()),u=l+c+1;return u>n?x7(e,t,n,r,s+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:o.sub(new wt(l).mul(a)),tickMax:o.add(new wt(c).mul(a))})}function BRe(e){var t=hp(e,2),n=t[0],r=t[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=g7([n,r]),c=hp(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var h=d===1/0?[u].concat(m_(h_(0,s-1).map(function(){return 1/0}))):[].concat(m_(h_(0,s-1).map(function(){return-1/0})),[d]);return n>r?f_(h):h}if(u===d)return FRe(u,s,a);var f=x7(u,d,o,a),m=f.step,g=f.tickMin,p=f.tickMax,x=gw.rangeStep(g,p.add(new wt(.1).mul(m)),m);return n>r?f_(x):x}function zRe(e,t){var n=hp(e,2),r=n[0],s=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=g7([r,s]),l=hp(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,s];if(c===u)return[c];var d=Math.max(t,2),h=y7(new wt(u).sub(c).div(d-1),a,0),f=[].concat(m_(gw.rangeStep(new wt(c),new wt(u).sub(new wt(.99).mul(h)),h)),[u]);return r>s?f_(f):f}var URe=m7(BRe),VRe=m7(zRe),WRe="Invariant failed";function Oc(e,t){throw new Error(WRe)}var HRe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ib(){return ib=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},ib.apply(this,arguments)}function qRe(e,t){return XRe(e)||YRe(e,t)||GRe(e,t)||KRe()}function KRe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 881In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GRe(e,t){if(e){if(typeof e=="string")return sD(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 sD(e,t)}}function sD(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 YRe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function XRe(e){if(Array.isArray(e))return e}function JRe(e,t){if(e==null)return{};var n=QRe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QRe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function xg(e){var t=e.offset,n=e.layout,r=e.width,s=e.dataKey,a=e.data,o=e.dataPointFormatter,l=e.xAxis,c=e.yAxis,u=JRe(e,HRe),d=ze(u,!1);e.direction==="x"&&l.type!=="number"&&Oc();var h=a.map(function(f){var m=o(f,s),g=m.x,p=m.y,x=m.value,v=m.errorVal;if(!v)return null;var b=[],w,j;if(Array.isArray(v)){var S=qRe(v,2);w=S[0],j=S[1]}else w=j=v;if(n==="vertical"){var N=l.scale,k=p+t,_=k+r,C=k-r,A=N(x-w),E=N(x+j);b.push({x1:E,y1:_,x2:E,y2:C}),b.push({x1:A,y1:k,x2:E,y2:k}),b.push({x1:A,y1:_,x2:A,y2:C})}else if(n==="horizontal"){var P=c.scale,$=g+t,R=$-r,L=$+r,D=P(x-w),I=P(x+j);b.push({x1:R,y1:I,x2:L,y2:I}),b.push({x1:$,y1:D,x2:$,y2:I}),b.push({x1:R,y1:D,x2:L,y2:D})}return F.createElement(Tt,ib({className:"recharts-errorBar",key:"bar-".concat(b.map(function(M){return"".concat(M.x1,"-").concat(M.x2,"-").concat(M.y1,"-").concat(M.y2)}))},d),b.map(function(M){return F.createElement("line",ib({},M,{key:"line-".concat(M.x1,"-").concat(M.x2,"-").concat(M.y1,"-").concat(M.y2)}))}))});return F.createElement(Tt,{className:"recharts-errorBars"},h)}xg.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};xg.displayName="ErrorBar";function fp(e){"@babel/helpers - typeof";return fp=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},fp(e)}function iD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function v1(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){ZRe(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 ZRe(e,t,n){return t=eMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eMe(e){var t=tMe(e,"string");return fp(t)=="symbol"?t:String(t)}function tMe(e,t){if(fp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(fp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var v7=function(t){var n=t.children,r=t.formattedGraphicalItems,s=t.legendWidth,a=t.legendContent,o=Lr(n,ep);if(!o)return null;var l;return o.props&&o.props.payload?l=o.props&&o.props.payload:a==="children"?l=(r||[]).reduce(function(c,u){var d=u.item,h=u.props,f=h.sectors||h.data||[];return c.concat(f.map(function(m){return{type:o.props.iconType||d.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):l=(r||[]).map(function(c){var u=c.item,d=u.props,h=d.dataKey,f=d.name,m=d.legendType,g=d.hide;return{inactive:g,dataKey:h,type:o.props.iconType||m||"square",color:UA(u),value:f||h,payload:u.props}}),v1(v1(v1({},o.props),ep.getWithHeight(o,s)),{},{payload:l,item:o})};function mp(e){"@babel/helpers - typeof";return mp=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},mp(e)}function aD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ms(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aD(Object(n),!0).forEach(function(r){nd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nd(e,t,n){return t=nMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nMe(e){var t=rMe(e,"string");return mp(t)=="symbol"?t:String(t)}function rMe(e,t){if(mp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(mp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oD(e){return oMe(e)||aMe(e)||iMe(e)||sMe()}function sMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 882In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iMe(e,t){if(e){if(typeof e=="string")return g_(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 g_(e,t)}}function aMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oMe(e){if(Array.isArray(e))return g_(e)}function g_(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 cr(e,t,n){return Ge(e)||Ge(t)?n:xn(t)?Ss(e,t,n):Ve(t)?t(e):n}function am(e,t,n,r){var s=hRe(e,function(l){return cr(l,t)});if(n==="number"){var a=s.filter(function(l){return pe(l)||parseFloat(l)});return a.length?[mw(a),Io(a)]:[1/0,-1/0]}var o=r?s.filter(function(l){return!Ge(l)}):s;return o.map(function(l){return xn(l)||l instanceof Date?l:""})}var lMe=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=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,u=0;u<l;u++){var d=u>0?s[u-1].coordinate:s[l-1].coordinate,h=s[u].coordinate,f=u>=l-1?s[0].coordinate:s[u+1].coordinate,m=void 0;if(Ys(h-d)!==Ys(f-h)){var g=[];if(Ys(f-h)===Ys(c[1]-c[0])){m=f;var p=h+c[1]-c[0];g[0]=Math.min(p,(p+d)/2),g[1]=Math.max(p,(p+d)/2)}else{m=d;var x=f+c[1]-c[0];g[0]=Math.min(h,(x+h)/2),g[1]=Math.max(h,(x+h)/2)}var v=[Math.min(h,(m+h)/2),Math.max(h,(m+h)/2)];if(t>v[0]&&t<=v[1]||t>=g[0]&&t<=g[1]){o=s[u].index;break}}else{var b=Math.min(d,f),w=Math.max(d,f);if(t>(b+h)/2&&t<=(w+h)/2){o=s[u].index;break}}}else for(var j=0;j<l;j++)if(j===0&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j>0&&j<l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j===l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2){o=r[j].index;break}return o},UA=function(t){var n=t,r=n.type.displayName,s=t.props,a=s.stroke,o=s.fill,l;switch(r){case"Line":l=a;break;case"Area":case"Radar":l=a&&a!=="none"?a:o;break;default:l=o;break}return l},cMe=function(t){var n=t.barSize,r=t.totalSize,s=t.stackGroups,a=s===void 0?{}:s;if(!a)return{};for(var o={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,h=Object.keys(d),f=0,m=h.length;f<m;f++){var g=d[h[f]],p=g.items,x=g.cateAxisId,v=p.filter(function(S){return va(S.type).indexOf("Bar")>=0});if(v&&v.length){var b=v[0].props.barSize,w=v[0].props[x];o[w]||(o[w]=[]);var j=Ge(b)?n:b;o[w].push({item:v[0],stackList:v.slice(1),barSize:Ge(j)?void 0:Pc(j,r,0)})}}return o},uMe=function(t){var n=t.barGap,r=t.barCategoryGap,s=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=Pc(n,s,0,!0),d,h=[];if(o[0].barSize===+o[0].barSize){var f=!1,m=s/c,g=o.reduce(function(j,S){return j+S.barSize||0},0);g+=(c-1)*u,g>=s&&(g-=(c-1)*u,u=0),g>=s&&m>0&&(f=!0,m*=.9,g=c*m);var p=(s-g)/2>>0,x={offset:p-u,size:0};d=o.reduce(function(j,S){var N={item:S.item,position:{offset:x.offset+x.size+u,size:f?m:S.barSize}},k=[].concat(oD(j),[N]);return x=k[k.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(_){k.push({item:_,position:x})}),k},h)}else{var v=Pc(r,s,0,!0);s-2*v-(c-1)*u<=0&&(u=0);var b=(s-2*v-(c-1)*u)/c;b>1&&(b>>=0);var w=l===+l?Math.min(b,l):b;d=o.reduce(function(j,S,N){var k=[].concat(oD(j),[{item:S.item,position:{offset:v+(b+u)*N+(b-w)/2,size:w}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(_){k.push({item:_,position:k[k.length-1].position})}),k},h)}return d},dMe=function(t,n,r,s){var a=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=v7({children:a,legendWidth:c});if(u){var d=s||{},h=d.width,f=d.height,m=u.align,g=u.verticalAlign,p=u.layout;if((p==="vertical"||p==="horizontal"&&g==="middle")&&m!=="center"&&pe(t[m]))return ms(ms({},t),{},nd({},m,t[m]+(h||0)));if((p==="horizontal"||p==="vertical"&&m==="center")&&g!=="middle"&&pe(t[g]))return ms(ms({},t),{},nd({},g,t[g]+(f||0)))}return t},hMe=function(t,n,r){return Ge(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},b7=function(t,n,r,s,a){var o=n.props.children,l=Ns(o,xg).filter(function(u){return hMe(s,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var h=cr(d,r);if(Ge(h))return u;var f=Array.isArray(h)?[mw(h),Io(h)]:[h,h],m=c.reduce(function(g,p){var x=cr(d,p,0),v=f[0]-Math.abs(Array.isArray(x)?x[0]:x),b=f[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(v,g[0]),Math.max(b,g[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},fMe=function(t,n,r,s,a){var o=n.map(function(l){return b7(t,l,r,a,s)}).filter(function(l){return!Ge(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},w7=function(t,n,r,s,a){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&b7(t,c,u,s)||am(t,u,r,a)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,h=u.length;d<h;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},j7=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},S7=function(t,n,r,s){if(s)return t.map(function(c){return c.coordinate});var a,o,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(o=!0),c.coordinate});return a||l.push(n),o||l.push(r),l},ma=function(t,n,r){if(!t)return null;var s=t.scale,a=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?s.bandwidth()/2:2,u=(n||r)&&o==="category"&&s.bandwidth?s.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Ys(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(h){var f=a?a.indexOf(h):h;return{coordinate:s(f)+u,value:h,offset:u}});return d.filter(function(h){return!Ph(h.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(h,f){return{coordinate:s(h)+u,value:h,index:f,offset:u}}):s.ticks&&!r?s.ticks(t.tickCount).map(function(h){return{coordinate:s(h)+u,value:h,offset:u}}):s.domain().map(function(h,f){return{coordinate:s(h)+u,value:a?a[h]:h,index:f,offset:u}})},b1=new WeakMap,Ty=function(t,n){if(typeof n!="function")return t;b1.has(t)||b1.set(t,new WeakMap);var r=b1.get(t);if(r.has(n))return r.get(n);var s=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,s),s},mMe=function(t,n,r){var s=t.scale,a=t.type,o=t.layout,l=t.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:ap(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:eb(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:im(),realScaleType:"point"}:a==="category"?{scale:ap(),realScaleType:"band"}:{scale:eb(),realScaleType:"linear"};if(hg(s)){var c="scale".concat(tw(s));return{scale:(eD[c]||im)(),realScaleType:eD[c]?c:"point"}}return Ve(s)?{scale:s}:{scale:im(),realScaleType:"point"}},lD=1e-4,pMe=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,s=t.range(),a=Math.min(s[0],s[1])-lD,o=Math.max(s[0],s[1])+lD,l=t(n[0]),c=t(n[r-1]);(l<a||l>o||c<a||c>o)&&t.domain([n[0],n[r-1]])}},gMe=function(t,n){if(!t)return null;for(var r=0,s=t.length;r<s;r++)if(t[r].item===n)return t[r].position;return null},yMe=function(t,n){if(!n||n.length!==2||!pe(n[0])||!pe(n[1]))return t;var r=Math.min(n[0],n[1]),s=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!pe(t[0])||t[0]<r)&&(a[0]=r),(!pe(t[1])||t[1]>s)&&(a[1]=s),a[0]>s&&(a[0]=s),a[1]<r&&(a[1]=r),a},xMe=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0,l=0;l<n;++l){var c=Ph(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=a,t[l][r][1]=a+c,a=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},vMe=function(t){var n=t.length;if(!(n<=0))for(var r=0,s=t[0].length;r<s;++r)for(var a=0,o=0;o<n;++o){var l=Ph(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=a,t[o][r][1]=a+l,a=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},bMe={sign:xMe,expand:Hje,none:Bd,silhouette:qje,wiggle:Kje,positive:vMe},wMe=function(t,n,r){var s=n.map(function(l){return l.props.dataKey}),a=bMe[r],o=Wje().keys(s).value(function(l,c){return+cr(l,c,0)}).order(zk).offset(a);return o(t)},jMe=function(t,n,r,s,a,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(h,f){var m=f.props,g=m.stackId,p=m.hide;if(p)return h;var x=f.props[r],v=h[x]||{hasStack:!1,stackGroups:{}};if(xn(g)){var b=v.stackGroups[g]||{numericAxisId:r,cateAxisId:s,items:[]};b.items.push(f),v.hasStack=!0,v.stackGroups[g]=b}else v.stackGroups[Th("_stackId_")]={numericAxisId:r,cateAxisId:s,items:[f]};return ms(ms({},h),{},nd({},x,v))},c),d={};return Object.keys(u).reduce(function(h,f){var m=u[f];if(m.hasStack){var g={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(p,x){var v=m.stackGroups[x];return ms(ms({},p),{},nd({},x,{numericAxisId:r,cateAxisId:s,items:v.items,stackedData:wMe(t,v.items,a)}))},g)}return ms(ms({},h),{},nd({},f,m))},d)},SMe=function(t,n){var r=n.realScaleType,s=n.type,a=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=URe(u,a,l);return t.domain([mw(d),Io(d)]),{niceTicks:d}}if(a&&s==="number"){var h=t.domain(),f=VRe(h,a,l);return{niceTicks:f}}return null};function ab(e){var t=e.axis,n=e.ticks,r=e.bandSize,s=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ge(s[t.dataKey])){var l=Pv(n,"value",s[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=cr(s,Ge(o)?t.dataKey:o);return Ge(c)?null:t.scale(c)}var cD=function(t){var n=t.axis,r=t.ticks,s=t.offset,a=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+s:null;var c=cr(o,n.dataKey,n.domain[l]);return Ge(c)?null:n.scale(c)-a/2+s},NMe=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var s=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return s<=0&&a>=0?0:a<0?a:s}return r[0]},kMe=function(t,n){var r=t.props.stackId;if(xn(r)){var s=n[r];if(s){var a=s.items.indexOf(t);return a>=0?s.stackedData[a]:null}}return null},_Me=function(t){return t.reduce(function(n,r){return[mw(r.concat([n[0]]).filter(pe)),Io(r.concat([n[1]]).filter(pe))]},[1/0,-1/0])},N7=function(t,n,r){return Object.keys(t).reduce(function(s,a){var o=t[a],l=o.stackedData,c=l.reduce(function(u,d){var h=_Me(d.slice(n,r+1));return[Math.min(u[0],h[0]),Math.max(u[1],h[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},uD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,y_=function(t,n,r){if(Ve(t))return t(n,r);if(!Array.isArray(t))return n;var s=[];if(pe(t[0]))s[0]=r?t[0]:Math.min(t[0],n[0]);else if(uD.test(t[0])){var a=+uD.exec(t[0])[1];s[0]=n[0]-a}else Ve(t[0])?s[0]=t[0](n[0]):s[0]=n[0];if(pe(t[1]))s[1]=r?t[1]:Math.max(t[1],n[1]);else if(dD.test(t[1])){var o=+dD.exec(t[1])[1];s[1]=n[1]+o}else Ve(t[1])?s[1]=t[1](n[1]):s[1]=n[1];return s},ob=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var s=t.scale.bandwidth();if(!r||s>0)return s}if(t&&n&&n.length>=2){for(var a=gA(n,function(h){return h.coordinate}),o=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},hD=function(t,n,r){return!t||!t.length||Gd(t,Ss(r,"type.defaultProps.domain"))?n:t},k7=function(t,n){var r=t.props,s=r.dataKey,a=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return ms(ms({},ze(t,!1)),{},{dataKey:s,unit:o,formatter:l,name:a||s,color:UA(t),value:cr(n,s),type:c,payload:n,chartType:u,hide:d})};function pp(e){"@babel/helpers - typeof";return pp=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},pp(e)}function fD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function mD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fD(Object(n),!0).forEach(function(r){CMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CMe(e,t,n){return t=EMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EMe(e){var t=AMe(e,"string");return pp(t)=="symbol"?t:String(t)}function AMe(e,t){if(pp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(pp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lb=Math.PI/180,PMe=function(t){return t*180/Math.PI},Dn=function(t,n,r,s){return{x:t+Math.cos(-lb*s)*r,y:n+Math.sin(-lb*s)*r}},TMe=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(s-o,2))},OMe=function(t,n){var r=t.x,s=t.y,a=n.cx,o=n.cy,l=TMe({x:r,y:s},{x:a,y:o});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return s>o&&(u=2*Math.PI-u),{radius:l,angle:PMe(u),angleInRadian:u}},RMe=function(t){var n=t.startAngle,r=t.endAngle,s=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(s,a);return{startAngle:n-o*360,endAngle:r-o*360}},MMe=function(t,n){var r=n.startAngle,s=n.endAngle,a=Math.floor(r/360),o=Math.floor(s/360),l=Math.min(a,o);return t+l*360},pD=function(t,n){var r=t.x,s=t.y,a=OMe({x:r,y:s},n),o=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=RMe(n),h=d.startAngle,f=d.endAngle,m=l,g;if(h<=f){for(;m>f;)m-=360;for(;m<h;)m+=360;g=m>=h&&m<=f}else{for(;m>h;)m-=360;for(;m<f;)m+=360;g=m>=f&&m<=h}return g?mD(mD({},n),{},{radius:o,angle:MMe(m,n)}):null};function gp(e){"@babel/helpers - typeof";return gp=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},gp(e)}var IMe=["offset"];function $Me(e){return BMe(e)||FMe(e)||DMe(e)||LMe()}function LMe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 883In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DMe(e,t){if(e){if(typeof e=="string")return x_(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 x_(e,t)}}function FMe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BMe(e){if(Array.isArray(e))return x_(e)}function x_(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 zMe(e,t){if(e==null)return{};var n=UMe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UMe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function gD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gD(Object(n),!0).forEach(function(r){VMe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VMe(e,t,n){return t=WMe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WMe(e){var t=HMe(e,"string");return gp(t)=="symbol"?t:String(t)}function HMe(e,t){if(gp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(gp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yp(){return yp=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},yp.apply(this,arguments)}var qMe=function(t){var n=t.value,r=t.formatter,s=Ge(t.children)?n:t.children;return Ve(r)?r(s):s},KMe=function(t,n){var r=Ys(n-t),s=Math.min(Math.abs(n-t),360);return r*s},GMe=function(t,n,r){var s=t.position,a=t.viewBox,o=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,h=c.innerRadius,f=c.outerRadius,m=c.startAngle,g=c.endAngle,p=c.clockWise,x=(h+f)/2,v=KMe(m,g),b=v>=0?1:-1,w,j;s==="insideStart"?(w=m+b*o,j=p):s==="insideEnd"?(w=g-b*o,j=!p):s==="end"&&(w=g+b*o,j=p),j=v<=0?j:!j;var S=Dn(u,d,x,w),N=Dn(u,d,x,w+(j?1:-1)*359),k="M".concat(S.x,",").concat(S.y,` 884 A`).concat(x,",").concat(x,",0,1,").concat(j?0:1,`, 885 `).concat(N.x,",").concat(N.y),_=Ge(t.id)?Th("recharts-radial-line-"):t.id;return F.createElement("text",yp({},r,{dominantBaseline:"central",className:Ze("recharts-radial-bar-label",l)}),F.createElement("defs",null,F.createElement("path",{id:_,d:k})),F.createElement("textPath",{xlinkHref:"#".concat(_)},n))},YMe=function(t){var n=t.viewBox,r=t.offset,s=t.position,a=n,o=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,h=a.endAngle,f=(d+h)/2;if(s==="outside"){var m=Dn(o,l,u+r,f),g=m.x,p=m.y;return{x:g,y:p,textAnchor:g>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var x=(c+u)/2,v=Dn(o,l,x,f),b=v.x,w=v.y;return{x:b,y:w,textAnchor:"middle",verticalAnchor:"middle"}},XMe=function(t){var n=t.viewBox,r=t.parentViewBox,s=t.offset,a=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,h=d>=0?1:-1,f=h*s,m=h>0?"end":"start",g=h>0?"start":"end",p=u>=0?1:-1,x=p*s,v=p>0?"end":"start",b=p>0?"start":"end";if(a==="top"){var w={x:l+u/2,y:c-h*s,textAnchor:"middle",verticalAnchor:m};return mn(mn({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var j={x:l+u/2,y:c+d+f,textAnchor:"middle",verticalAnchor:g};return mn(mn({},j),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var S={x:l-x,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return mn(mn({},S),r?{width:Math.max(S.x-r.x,0),height:d}:{})}if(a==="right"){var N={x:l+u+x,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return mn(mn({},N),r?{width:Math.max(r.x+r.width-N.x,0),height:d}:{})}var k=r?{width:u,height:d}:{};return a==="insideLeft"?mn({x:l+x,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},k):a==="insideRight"?mn({x:l+u-x,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},k):a==="insideTop"?mn({x:l+u/2,y:c+f,textAnchor:"middle",verticalAnchor:g},k):a==="insideBottom"?mn({x:l+u/2,y:c+d-f,textAnchor:"middle",verticalAnchor:m},k):a==="insideTopLeft"?mn({x:l+x,y:c+f,textAnchor:b,verticalAnchor:g},k):a==="insideTopRight"?mn({x:l+u-x,y:c+f,textAnchor:v,verticalAnchor:g},k):a==="insideBottomLeft"?mn({x:l+x,y:c+d-f,textAnchor:b,verticalAnchor:m},k):a==="insideBottomRight"?mn({x:l+u-x,y:c+d-f,textAnchor:v,verticalAnchor:m},k):_h(a)&&(pe(a.x)||Gl(a.x))&&(pe(a.y)||Gl(a.y))?mn({x:l+Pc(a.x,u),y:c+Pc(a.y,d),textAnchor:"end",verticalAnchor:"end"},k):mn({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},k)},JMe=function(t){return"cx"in t&&pe(t.cx)};function Gn(e){var t=e.offset,n=t===void 0?5:t,r=zMe(e,IMe),s=mn({offset:n},r),a=s.viewBox,o=s.position,l=s.value,c=s.children,u=s.content,d=s.className,h=d===void 0?"":d,f=s.textBreakAll;if(!a||Ge(l)&&Ge(c)&&!y.isValidElement(u)&&!Ve(u))return null;if(y.isValidElement(u))return y.cloneElement(u,s);var m;if(Ve(u)){if(m=y.createElement(u,s),y.isValidElement(m))return m}else m=qMe(s);var g=JMe(a),p=ze(s,!0);if(g&&(o==="insideStart"||o==="insideEnd"||o==="end"))return GMe(s,m,p);var x=g?YMe(s):XMe(s);return F.createElement(Kv,yp({className:Ze("recharts-label",h)},p,x,{breakAll:f}),m)}Gn.displayName="Label";var _7=function(t){var n=t.cx,r=t.cy,s=t.angle,a=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,h=t.x,f=t.y,m=t.top,g=t.left,p=t.width,x=t.height,v=t.clockWise,b=t.labelViewBox;if(b)return b;if(pe(p)&&pe(x)){if(pe(h)&&pe(f))return{x:h,y:f,width:p,height:x};if(pe(m)&&pe(g))return{x:m,y:g,width:p,height:x}}return pe(h)&&pe(f)?{x:h,y:f,width:0,height:0}:pe(n)&&pe(r)?{cx:n,cy:r,startAngle:a||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},QMe=function(t,n){return t?t===!0?F.createElement(Gn,{key:"label-implicit",viewBox:n}):xn(t)?F.createElement(Gn,{key:"label-implicit",viewBox:n,value:t}):y.isValidElement(t)?t.type===Gn?y.cloneElement(t,{key:"label-implicit",viewBox:n}):F.createElement(Gn,{key:"label-implicit",content:t,viewBox:n}):Ve(t)?F.createElement(Gn,{key:"label-implicit",content:t,viewBox:n}):_h(t)?F.createElement(Gn,yp({viewBox:n},t,{key:"label-implicit"})):null:null},ZMe=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 s=t.children,a=_7(t),o=Ns(s,Gn).map(function(c,u){return y.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return o;var l=QMe(t.label,n||a);return[l].concat($Me(o))};Gn.parseViewBox=_7;Gn.renderCallByParent=ZMe;function eIe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var tIe=eIe;const nIe=it(tIe);function xp(e){"@babel/helpers - typeof";return xp=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},xp(e)}var rIe=["valueAccessor"],sIe=["data","dataKey","clockWise","id","textBreakAll"];function iIe(e){return cIe(e)||lIe(e)||oIe(e)||aIe()}function aIe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 886In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oIe(e,t){if(e){if(typeof e=="string")return v_(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 v_(e,t)}}function lIe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cIe(e){if(Array.isArray(e))return v_(e)}function v_(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 cb(){return cb=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},cb.apply(this,arguments)}function yD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function xD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yD(Object(n),!0).forEach(function(r){uIe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uIe(e,t,n){return t=dIe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dIe(e){var t=hIe(e,"string");return xp(t)=="symbol"?t:String(t)}function hIe(e,t){if(xp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(xp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vD(e,t){if(e==null)return{};var n=fIe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fIe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var mIe=function(t){return Array.isArray(t.value)?nIe(t.value):t.value};function ja(e){var t=e.valueAccessor,n=t===void 0?mIe:t,r=vD(e,rIe),s=r.data,a=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=vD(r,sIe);return!s||!s.length?null:F.createElement(Tt,{className:"recharts-label-list"},s.map(function(d,h){var f=Ge(a)?n(d,h):cr(d&&d.payload,a),m=Ge(l)?{}:{id:"".concat(l,"-").concat(h)};return F.createElement(Gn,cb({},ze(d,!0),u,m,{parentViewBox:d.parentViewBox,value:f,textBreakAll:c,viewBox:Gn.parseViewBox(Ge(o)?d:xD(xD({},d),{},{clockWise:o})),key:"label-".concat(h),index:h}))}))}ja.displayName="LabelList";function pIe(e,t){return e?e===!0?F.createElement(ja,{key:"labelList-implicit",data:t}):F.isValidElement(e)||Ve(e)?F.createElement(ja,{key:"labelList-implicit",data:t,content:e}):_h(e)?F.createElement(ja,cb({data:t},e,{key:"labelList-implicit"})):null:null}function gIe(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,s=Ns(r,ja).map(function(o,l){return y.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return s;var a=pIe(e.label,t);return[a].concat(iIe(s))}ja.renderCallByParent=gIe;function vp(e){"@babel/helpers - typeof";return vp=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},vp(e)}function b_(){return b_=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},b_.apply(this,arguments)}function bD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function wD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bD(Object(n),!0).forEach(function(r){yIe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yIe(e,t,n){return t=xIe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xIe(e){var t=vIe(e,"string");return vp(t)=="symbol"?t:String(t)}function vIe(e,t){if(vp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(vp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bIe=function(t,n){var r=Ys(n-t),s=Math.min(Math.abs(n-t),359.999);return r*s},Oy=function(t){var n=t.cx,r=t.cy,s=t.radius,a=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+s,h=Math.asin(c/d)/lb,f=u?a:a+o*h,m=Dn(n,r,d,f),g=Dn(n,r,s,f),p=u?a-o*h:a,x=Dn(n,r,d*Math.cos(h*lb),p);return{center:m,circleTangency:g,lineTangency:x,theta:h}},C7=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.startAngle,l=t.endAngle,c=bIe(o,l),u=o+c,d=Dn(n,r,a,o),h=Dn(n,r,a,u),f="M ".concat(d.x,",").concat(d.y,` 887 A `).concat(a,",").concat(a,`,0, 888 `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`, 889 `).concat(h.x,",").concat(h.y,` 890 `);if(s>0){var m=Dn(n,r,s,o),g=Dn(n,r,s,u);f+="L ".concat(g.x,",").concat(g.y,` 891 A `).concat(s,",").concat(s,`,0, 892 `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`, 893 `).concat(m.x,",").concat(m.y," Z")}else f+="L ".concat(n,",").concat(r," Z");return f},wIe=function(t){var n=t.cx,r=t.cy,s=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,h=Ys(d-u),f=Oy({cx:n,cy:r,radius:a,angle:u,sign:h,cornerRadius:o,cornerIsExternal:c}),m=f.circleTangency,g=f.lineTangency,p=f.theta,x=Oy({cx:n,cy:r,radius:a,angle:d,sign:-h,cornerRadius:o,cornerIsExternal:c}),v=x.circleTangency,b=x.lineTangency,w=x.theta,j=c?Math.abs(u-d):Math.abs(u-d)-p-w;if(j<0)return l?"M ".concat(g.x,",").concat(g.y,` 894 a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 895 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 896 `):C7({cx:n,cy:r,innerRadius:s,outerRadius:a,startAngle:u,endAngle:d});var S="M ".concat(g.x,",").concat(g.y,` 897 A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(m.x,",").concat(m.y,` 898 A`).concat(a,",").concat(a,",0,").concat(+(j>180),",").concat(+(h<0),",").concat(v.x,",").concat(v.y,` 899 A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(b.x,",").concat(b.y,` 900 `);if(s>0){var N=Oy({cx:n,cy:r,radius:s,angle:u,sign:h,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),k=N.circleTangency,_=N.lineTangency,C=N.theta,A=Oy({cx:n,cy:r,radius:s,angle:d,sign:-h,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=A.circleTangency,P=A.lineTangency,$=A.theta,R=c?Math.abs(u-d):Math.abs(u-d)-C-$;if(R<0&&o===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(P.x,",").concat(P.y,` 901 A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(E.x,",").concat(E.y,` 902 A`).concat(s,",").concat(s,",0,").concat(+(R>180),",").concat(+(h>0),",").concat(k.x,",").concat(k.y,` 903 A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(_.x,",").concat(_.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},jIe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},E7=function(t){var n=wD(wD({},jIe),t),r=n.cx,s=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,h=n.endAngle,f
903=n.className;if(o<a||d===h)return null;var m=Ze("recharts-sector",f),g=o-a,p=Pc(l,g,0,!0),x;return p>0&&Math.abs(d-h)<360?x=wIe({cx:r,cy:s,innerRadius:a,outerRadius:o,cornerRadius:Math.min(p,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:h}):x=C7({cx:r,cy:s,innerRadius:a,outerRadius:o,startAngle:d,endAngle:h}),F.createElement("path",b_({},ze(n,!0),{className:m,d:x,role:"img"}))};function bp(e){"@babel/helpers - typeof";return bp=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},bp(e)}function w_(){return w_=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},w_.apply(this,arguments)}function jD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function SD(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){SIe(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 SIe(e,t,n){return t=NIe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NIe(e){var t=kIe(e,"string");return bp(t)=="symbol"?t:String(t)}function kIe(e,t){if(bp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(bp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ND={curveBasisClosed:Rje,curveBasisOpen:Mje,curveBasis:Oje,curveBumpX:xje,curveBumpY:vje,curveLinearClosed:Ije,curveLinear:rw,curveMonotoneX:$je,curveMonotoneY:Lje,curveNatural:Dje,curveStep:Fje,curveStepAfter:zje,curveStepBefore:Bje},Ry=function(t){return t.x===+t.x&&t.y===+t.y},df=function(t){return t.x},hf=function(t){return t.y},_Ie=function(t,n){if(Ve(t))return t;var r="curve".concat(tw(t));return(r==="curveMonotone"||r==="curveBump")&&n?ND["".concat(r).concat(n==="vertical"?"Y":"X")]:ND[r]||rw},CIe=function(t){var n=t.type,r=n===void 0?"linear":n,s=t.points,a=s===void 0?[]:s,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=_Ie(r,l),h=u?a.filter(function(p){return Ry(p)}):a,f;if(Array.isArray(o)){var m=u?o.filter(function(p){return Ry(p)}):o,g=h.map(function(p,x){return SD(SD({},p),{},{base:m[x]})});return l==="vertical"?f=Sy().y(hf).x1(df).x0(function(p){return p.base.x}):f=Sy().x(df).y1(hf).y0(function(p){return p.base.y}),f.defined(Ry).curve(d),f(g)}return l==="vertical"&&pe(o)?f=Sy().y(hf).x1(df).x0(o):pe(o)?f=Sy().x(df).y1(hf).y0(o):f=PH().x(df).y(hf),f.defined(Ry).curve(d),f(h)},rd=function(t){var n=t.className,r=t.points,s=t.path,a=t.pathRef;if((!r||!r.length)&&!s)return null;var o=r&&r.length?CIe(t):s;return F.createElement("path",w_({},ze(t,!1),Tv(t),{className:Ze("recharts-curve",n),d:o,ref:a}))},A7={exports:{}},EIe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",AIe=EIe,PIe=AIe;function P7(){}function T7(){}T7.resetWarningCache=P7;var TIe=function(){function e(r,s,a,o,l,c){if(c!==PIe){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:T7,resetWarningCache:P7};return n.PropTypes=n,n};A7.exports=TIe();var OIe=A7.exports;const Be=it(OIe);var RIe=Object.getOwnPropertyNames,MIe=Object.getOwnPropertySymbols,IIe=Object.prototype.hasOwnProperty;function kD(e,t){return function(r,s,a){return e(r,s,a)&&t(r,s,a)}}function My(e){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,s);var a=s.cache,o=a.get(n),l=a.get(r);if(o&&l)return o===r&&l===n;a.set(n,r),a.set(r,n);var c=e(n,r,s);return a.delete(n),a.delete(r),c}}function _D(e){return RIe(e).concat(MIe(e))}var O7=Object.hasOwn||function(e,t){return IIe.call(e,t)};function Dh(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var R7="_owner",CD=Object.getOwnPropertyDescriptor,ED=Object.keys;function $Ie(e,t,n){var 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 LIe(e,t){return Dh(e.getTime(),t.getTime())}function AD(e,t,n){if(e.size!==t.size)return!1;for(var r={},s=e.entries(),a=0,o,l;(o=s.next())&&!o.done;){for(var c=t.entries(),u=!1,d=0;(l=c.next())&&!l.done;){var h=o.value,f=h[0],m=h[1],g=l.value,p=g[0],x=g[1];!u&&!r[d]&&(u=n.equals(f,p,a,d,e,t,n)&&n.equals(m,x,f,p,e,t,n))&&
903(r[d]=!0),d++}if(!u)return!1;a++}return!0}function DIe(e,t,n){var r=ED(e),s=r.length;if(ED(t).length!==s)return!1;for(var a;s-- >0;)if(a=r[s],a===R7&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!O7(t,a)||!n.equals(e[a],t[a],a,a,e,t,n))return!1;return!0}function ff(e,t,n){var r=_D(e),s=r.length;if(_D(t).length!==s)return!1;for(var a,o,l;s-- >0;)if(a=r[s],a===R7&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!O7(t,a)||!n.equals(e[a],t[a],a,a,e,t,n)||(o=CD(e,a),l=CD(t,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function FIe(e,t){return Dh(e.valueOf(),t.valueOf())}function BIe(e,t){return e.source===t.source&&e.flags===t.flags}function PD(e,t,n){if(e.size!==t.size)return!1;for(var r={},s=e.values(),a,o;(a=s.next())&&!a.done;){for(var l=t.values(),c=!1,u=0;(o=l.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(a.value,o.value,a.value,o.value,e,t,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function zIe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var UIe="[object Arguments]",VIe="[object Boolean]",WIe="[object Date]",HIe="[object Map]",qIe="[object Number]",KIe="[object Object]",GIe="[object RegExp]",YIe="[object Set]",XIe="[object String]",JIe=Array.isArray,TD=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,OD=Object.assign,QIe=Object.prototype.toString.call.bind(Object.prototype.toString);function ZIe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,s=e.areObjectsEqual,a=e.arePrimitiveWrappersEqual,o=e.areRegExpsEqual,l=e.areSetsEqual,c=e.areTypedArraysEqual;return function(d,h,f){if(d===h)return!0;if(d==null||h==null||typeof d!="object"||typeof h!="object")return d!==d&&h!==h;var m=d.constructor;if(m!==h.constructor)return!1;if(m===Object)return s(d,h,f);if(JIe(d))return t(d,h,f);if(TD!=null&&TD(d))return c(d,h,f);
903if(m===Date)return n(d,h,f);if(m===RegExp)return o(d,h,f);if(m===Map)return r(d,h,f);if(m===Set)return l(d,h,f);var g=QIe(d);return g===WIe?n(d,h,f):g===GIe?o(d,h,f):g===HIe?r(d,h,f):g===YIe?l(d,h,f):g===KIe?typeof d.then!="function"&&typeof h.then!="function"&&s(d,h,f):g===UIe?s(d,h,f):g===VIe||g===qIe||g===XIe?a(d,h,f):!1}}function e$e(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,s={areArraysEqual:r?ff:$Ie,areDatesEqual:LIe,areMapsEqual:r?kD(AD,ff):AD,areObjectsEqual:r?ff:DIe,arePrimitiveWrappersEqual:FIe,areRegExpsEqual:BIe,areSetsEqual:r?kD(PD,ff):PD,areTypedArraysEqual:r?ff:zIe};if(n&&(s=OD({},s,n(s))),t){var a=My(s.areArraysEqual),o=My(s.areMapsEqual),l=My(s.areObjectsEqual),c=My(s.areSetsEqual);s=OD({},s,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function t$e(e){return function(t,n,r,s,a,o,l){return e(t,n,l)}}function n$e(e){var t=e.circular,n=e.comparator,r=e.createState,s=e.equals,a=e.strict;if(r)return function(c,u){var d=r(),h=d.cache,f=h===void 0?t?new WeakMap:void 0:h,m=d.meta;return n(c,u,{cache:f,equals:s,meta:m,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:s,meta:void 0,strict:a})};var o={cache:void 0,equals:s,meta:void 0,strict:a};return function(c,u){return n(c,u,o)}}var r$e=vl();vl({strict:!0});vl({circular:!0});vl({circular:!0,strict:!0});vl({createInternalComparator:function(){return Dh}});vl({strict:!0,createInternalComparator:function(){return Dh}});vl({circular:!0,createInternalComparator:function(){return Dh}});vl({circular:!0,createInternalComparator:function(){return Dh},strict:!0});function vl(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,s=e.createState,a=e.strict,o=a===void 0?!1:a,l=e$e(e),c=ZIe(l),u=r?r(c):t$e(c);return n$e({circular:n,comparator:c,createState:s,equals:u,strict:o})}function s$e(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function RD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function s(a){n<0&&(n=a),a-n>t?(e(a),n=-1):s$e(s)};requestAnimationFrame(r)}function j_(e){"@babel/helpers - typeof";return j_=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},j_(e)}function i$e(e){return c$e(e)||l$e(e)||o$e(e)||a$e()}function a$e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 904In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o$e(e,t){if(e){if(typeof e=="string")return MD(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 MD(e,t)}}function MD(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 l$e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c$e(e){if(Array.isArray(e))return e}function u$e(){var e={},t=function(){return null},n=!1,r=function s(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var o=a,l=i$e(o),c=l[0],u=l.slice(1);if(typeof c=="number"){RD(s.bind(null,u),c);return}s(c),RD(s.bind(null,u));return}j_(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 wp(e){"@babel/helpers - typeof";return wp=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},wp(e)}function ID(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function $D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
vendor: 47,971 bytes, lines 904-921
904t%2?ID(Object(n),!0).forEach(function(r){M7(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 M7(e,t,n){return t=d$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d$e(e){var t=h$e(e,"string");return wp(t)==="symbol"?t:String(t)}function h$e(e,t){if(wp(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(wp(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var f$e=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,s){return r.filter(function(a){return s.includes(a)})})},m$e=function(t){return t},p$e=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},om=function(t,n){return Object.keys(n).reduce(function(r,s){return $D($D({},r),{},M7({},s,t(s,n[s])))},{})},LD=function(t,n,r){return t.map(function(s){return"".concat(p$e(s)," ").concat(n,"ms ").concat(r)}).join(",")};function g$e(e,t){return v$e(e)||x$e(e,t)||I7(e,t)||y$e()}function y$e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 905In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x$e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function v$e(e){if(Array.isArray(e))return e}function b$e(e){return S$e(e)||j$e(e)||I7(e)||w$e()}function w$e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 906In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I7(e,t){if(e){if(typeof e=="string")return S_(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 S_(e,t)}}function j$e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function S$e(e){if(Array.isArray(e))return S_(e)}function S_(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 ub=1e-4,$7=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},L7=function(t,n){return t.map(function(r,s){return r*Math.pow(n,s)}).reduce(function(r,s){return r+s})},DD=function(t,n){return function(r){var s=$7(t,n);return L7(s,r)}},N$e=function(t,n){return function(r){var s=$7(t,n),a=[].concat(b$e(s.map(function(o,l){return o*l}).slice(1)),[0]);return L7(a,r)}},FD=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0],a=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":s=0,a=0,o=1,l=1;break;case"ease":s=.25,a=.1,o=.25,l=1;break;case"ease-in":s=.42,a=0,o=1,l=1;break;case"ease-out":s=.42,a=0,o=.58,l=1;break;case"ease-in-out":s=0,a=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),d=g$e(u,4);s=d[0],a=d[1],o=d[2],l=d[3]}}}var h=DD(s,o),f=DD(a,l),m=N$e(s,o),g=function(v){return v>1?1:v<0?0:v},p=function(v){for(var b=v>1?1:v,w=b,j=0;j<8;++j){var S=h(w)-b,N=m(w);if(Math.abs(S-b)<ub||N<ub)return f(w);w=g(w-S/N)}return f(w)};return p.isStepper=!1,p},k$e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,s=t.damping,a=s===void 0?8:s,o=t.dt,l=o===void 0?17:o,c=function(d,h,f){var m=-(d-h)*r,g=f*a,p=f+(m-g)*l/1e3,x=f*l/1e3+d;return Math.abs(x-h)<ub&&Math.abs(p)<ub?[h,0]:[x,p]};return c.isStepper=!0,c.dt=l,c},_$e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var s=n[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return FD(s);case"spring":return k$e();default:if(s.split("(")[0]==="cubic-bezier")return FD(s)}return typeof s=="function"?s:null};function jp(e){"@babel/helpers - typeof";return jp=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},jp(e)}function BD(e){return A$e(e)||E$e(e)||D7(e)||C$e()}function C$e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 907In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E$e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function A$e(e){if(Array.isArray(e))return k_(e)}function zD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zD(Object(n),!0).forEach(function(r){N_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N_(e,t,n){return t=P$e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P$e(e){var t=T$e(e,"string");return jp(t)==="symbol"?t:String(t)}function T$e(e,t){if(jp(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(jp(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function O$e(e,t){return I$e(e)||M$e(e,t)||D7(e,t)||R$e()}function R$e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 908In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D7(e,t){if(e){if(typeof e=="string")return k_(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 k_(e,t)}}function k_(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 M$e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function I$e(e){if(Array.isArray(e))return e}var db=function(t,n,r){return t+(n-t)*r},__=function(t){var n=t.from,r=t.to;return n!==r},$$e=function e(t,n,r){var s=om(function(a,o){if(__(o)){var l=t(o.from,o.to,o.velocity),c=O$e(l,2),u=c[0],d=c[1];return Mn(Mn({},o),{},{from:u,velocity:d})}return o},n);return r<1?om(function(a,o){return __(o)?Mn(Mn({},o),{},{velocity:db(o.velocity,s[a].velocity,r),from:db(o.from,s[a].from,r)}):o},n):e(t,s,r-1)};const L$e=function(e,t,n,r,s){var a=f$e(e,t),o=a.reduce(function(x,v){return Mn(Mn({},x),{},N_({},v,[e[v],t[v]]))},{}),l=a.reduce(function(x,v){return Mn(Mn({},x),{},N_({},v,{from:e[v],velocity:0,to:t[v]}))},{}),c=-1,u,d,h=function(){return null},f=function(){return om(function(v,b){return b.from},l)},m=function(){return!Object.values(l).filter(__).length},g=function(v){u||(u=v);var b=v-u,w=b/n.dt;l=$$e(n,l,w),s(Mn(Mn(Mn({},e),t),f())),u=v,m()||(c=requestAnimationFrame(h))},p=function(v){d||(d=v);var b=(v-d)/r,w=om(function(S,N){return db.apply(void 0,BD(N).concat([n(b)]))},o);if(s(Mn(Mn(Mn({},e),t),w)),b<1)c=requestAnimationFrame(h);else{var j=om(function(S,N){return db.apply(void 0,BD(N).concat([n(1)]))},o);s(Mn(Mn(Mn({},e),t),j))}};return h=n.isStepper?g:p,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(c)}}};function Yd(e){"@babel/helpers - typeof";return Yd=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},Yd(e)}var D$e=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function F$e(e,t){if(e==null)return{};var n=B$e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function B$e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function w1(e){return W$e(e)||V$e(e)||U$e(e)||z$e()}function z$e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 909In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U$e(e,t){if(e){if(typeof e=="string")return C_(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 C_(e,t)}}function V$e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function W$e(e){if(Array.isArray(e))return C_(e)}function C_(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 UD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ms(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UD(Object(n),!0).forEach(function(r){Tf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tf(e,t,n){return t=F7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H$e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q$e(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,F7(r.key),r)}}function K$e(e,t,n){return t&&q$e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function F7(e){var t=G$e(e,"string");return Yd(t)==="symbol"?t:String(t)}function G$e(e,t){if(Yd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Yd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y$e(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&&E_(e,t)}function E_(e,t){return E_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},E_(e,t)}function X$e(e){var t=J$e();return function(){var r=hb(e),s;if(t){var a=hb(this).constructor;s=Reflect.construct(r,arguments,a)}else s=r.apply(this,arguments);return A_(this,s)}}function A_(e,t){if(t&&(Yd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P_(e)}function P_(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J$e(){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 hb(e){return hb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hb(e)}var Wi=function(e){Y$e(n,e);var t=X$e(n);function n(r,s){var a;H$e(this,n),a=t.call(this,r,s);var o=a.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,h=o.steps,f=o.children,m=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(P_(a)),a.changeStyle=a.changeStyle.bind(P_(a)),!l||m<=0)return a.state={style:{}},typeof f=="function"&&(a.state={style:d}),A_(a);if(h&&h.length)a.state={style:h[0].style};else if(u){if(typeof f=="function")return a.state={style:u},A_(a);a.state={style:c?Tf({},c,u):u}}else a.state={style:{}};return a}return K$e(n,[{key:"componentDidMount",value:function(){var s=this.props,a=s.isActive,o=s.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var a=this.props,o=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,h=a.from,f=this.state.style;if(l){if(!o){var m={style:c?Tf({},c,d):d};this.state&&f&&(c&&f[c]!==d||!c&&f!==d)&&this.setState(m);return}if(!(r$e(s.to,d)&&s.canBegin&&s.isActive)){var g=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var p=g||u?h:s.to;if(this.state&&f){var x={style:c?Tf({},c,p):p};(c&&f[c]!==p||!c&&f!==p)&&this.setState(x)}this.runAnimation(Ms(Ms({},this.props),{},{from:p,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var a=this,o=s.from,l=s.to,c=s.duration,u=s.easing,d=s.begin,h=s.onAnimationEnd,f=s.onAnimationStart,m=L$e(o,l,_$e(u),c,this.changeStyle),g=function(){a.stopJSAnimation=m()};this.manager.start([f,d,g,c,h])}},{key:"runStepAnimation",value:function(s){var a=this,o=s.steps,l=s.begin,c=s.onAnimationStart,u=o[0],d=u.style,h=u.duration,f=h===void 0?0:h,m=function(p,x,v){if(v===0)return p;var b=x.duration,w=x.easing,j=w===void 0?"ease":w,S=x.style,N=x.properties,k=x.onAnimationEnd,_=v>0?o[v-1]:x,C=N||Object.keys(S);if(typeof j=="function"||j==="spring")return[].concat(w1(p),[a.runJSAnimation.bind(a,{from:_.style,to:S,duration:b,easing:j}),b]);var A=LD(C,b,j),E=Ms(Ms(Ms({},_.style),S),{},{transition:A});return[].concat(w1(p),[E,b,k]).filter(m$e)};return this.manager.start([c].concat(w1(o.reduce(m,[d,Math.max(f,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=u$e());var a=s.begin,o=s.duration,l=s.attributeName,c=s.to,u=s.easing,d=s.onAnimationStart,h=s.onAnimationEnd,f=s.steps,m=s.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(s);return}if(f.length>1){this.runStepAnimation(s);return}var p=l?Tf({},l,c):c,x=LD(Object.keys(p),o,u);g.start([d,a,Ms(Ms({},p),{},{transition:x}),o,h])}},{key:"render",value:function(){var s=this.props,a=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=F$e(s,D$e),u=y.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||o<=0)return a;var h=function(m){var g=m.props,p=g.style,x=p===void 0?{}:p,v=g.className,b=y.cloneElement(m,Ms(Ms({},c),{},{style:Ms(Ms({},x),d),className:v}));return b};return u===1?h(y.Children.only(a)):F.createElement("div",null,y.Children.map(a,function(f){return h(f)}))}}]),n}(y.PureComponent);Wi.displayName="Animate";Wi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Wi.propTypes={from:Be.oneOfType([Be.object,Be.string]),to:Be.oneOfType([Be.object,Be.string]),attributeName:Be.string,duration:Be.number,begin:Be.number,easing:Be.oneOfType([Be.string,Be.func]),steps:Be.arrayOf(Be.shape({duration:Be.number.isRequired,style:Be.object.isRequired,easing:Be.oneOfType([Be.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Be.func]),properties:Be.arrayOf("string"),onAnimationEnd:Be.func})),children:Be.oneOfType([Be.node,Be.func]),isActive:Be.bool,canBegin:Be.bool,onAnimationEnd:Be.func,shouldReAnimate:Be.bool,onAnimationStart:Be.func,onAnimationReStart:Be.func};Be.object,Be.object,Be.object,Be.element;Be.object,Be.object,Be.object,Be.oneOfType([Be.array,Be.element]),Be.any;function Sp(e){"@babel/helpers - typeof";return Sp=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},Sp(e)}function fb(){return fb=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},fb.apply(this,arguments)}function Q$e(e,t){return nLe(e)||tLe(e,t)||eLe(e,t)||Z$e()}function Z$e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 910In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eLe(e,t){if(e){if(typeof e=="string")return VD(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 VD(e,t)}}function VD(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 tLe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function nLe(e){if(Array.isArray(e))return e}function WD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function HD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WD(Object(n),!0).forEach(function(r){rLe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rLe(e,t,n){return t=sLe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sLe(e){var t=iLe(e,"string");return Sp(t)=="symbol"?t:String(t)}function iLe(e,t){if(Sp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Sp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qD=function(t,n,r,s,a){var o=Math.min(Math.abs(r)/2,Math.abs(s)/2),l=s>=0?1:-1,c=r>=0?1:-1,u=s>=0&&r>=0||s<0&&r<0?1:0,d;if(o>0&&a instanceof Array){for(var h=[0,0,0,0],f=0,m=4;f<m;f++)h[f]=a[f]>o?o:a[f];d="M".concat(t,",").concat(n+l*h[0]),h[0]>0&&(d+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(u,",").concat(t+c*h[0],",").concat(n)),d+="L ".concat(t+r-c*h[1],",").concat(n),h[1]>0&&(d+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(u,`, 911 `).concat(t+r,",").concat(n+l*h[1])),d+="L ".concat(t+r,",").concat(n+s-l*h[2]),h[2]>0&&(d+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(u,`, 912 `).concat(t+r-c*h[2],",").concat(n+s)),d+="L ".concat(t+c*h[3],",").concat(n+s),h[3]>0&&(d+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(u,`, 913 `).concat(t,",").concat(n+s-l*h[3])),d+="Z"}else if(o>0&&a===+a&&a>0){var g=Math.min(o,a);d="M ".concat(t,",").concat(n+l*g,` 914 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(n,` 915 L `).concat(t+r-c*g,",").concat(n,` 916 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*g,` 917 L `).concat(t+r,",").concat(n+s-l*g,` 918 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r-c*g,",").concat(n+s,` 919 L `).concat(t+c*g,",").concat(n+s,` 920 A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(n+s-l*g," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(s," h ").concat(-r," Z");return d},aLe=function(t,n){if(!t||!n)return!1;var r=t.x,s=t.y,a=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),h=Math.min(o,o+c),f=Math.max(o,o+c);return r>=u&&r<=d&&s>=h&&s<=f}return!1},oLe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},VA=function(t){var n=HD(HD({},oLe),t),r=y.useRef(),s=y.useState(-1),a=Q$e(s,2),o=a[0],l=a[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var j=r.current.getTotalLength();j&&l(j)}catch{}},[]);var c=n.x,u=n.y,d=n.width,h=n.height,f=n.radius,m=n.className,g=n.animationEasing,p=n.animationDuration,x=n.animationBegin,v=n.isAnimationActive,b=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||d===0||h===0)return null;var w=Ze("recharts-rectangle",m);return b?F.createElement(Wi,{canBegin:o>0,from:{width:d,height:h,x:c,y:u},to:{width:d,height:h,x:c,y:u},duration:p,animationEasing:g,isActive:b},function(j){var S=j.width,N=j.height,k=j.x,_=j.y;return F.createElement(Wi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:p,isActive:v,easing:g},F.createElement("path",fb({},ze(n,!0),{className:w,d:qD(k,_,S,N,f),ref:r})))}):F.createElement("path",fb({},ze(n,!0),{className:w,d:qD(c,u,d,h,f)}))};function T_(){return T_=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},T_.apply(this,arguments)}var yw=function(t){var n=t.cx,r=t.cy,s=t.r,a=t.className,o=Ze("recharts-dot",a);return n===+n&&r===+r&&s===+s?F.createElement("circle",T_({},ze(t,!1),Tv(t),{className:o,cx:n,cy:r,r:s})):null};function Np(e){"@babel/helpers - typeof";return Np=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},Np(e)}var lLe=["x","y","top","left","width","height","className"];function O_(){return O_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O_.apply(this,arguments)}function KD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function cLe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KD(Object(n),!0).forEach(function(r){uLe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uLe(e,t,n){return t=dLe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dLe(e){var t=hLe(e,"string");return Np(t)=="symbol"?t:String(t)}function hLe(e,t){if(Np(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Np(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fLe(e,t){if(e==null)return{};var n=mLe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function mLe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var pLe=function(t,n,r,s,a,o){return"M".concat(t,",").concat(a,"v").concat(s,"M").concat(o,",").concat(n,"h").concat(r)},gLe=function(t){var n=t.x,r=n===void 0?0:n,s=t.y,a=s===void 0?0:s,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,h=d===void 0?0:d,f=t.height,m=f===void 0?0:f,g=t.className,p=fLe(t,lLe),x=cLe({x:r,y:a,top:l,left:u,width:h,height:m},p);return!pe(r)||!pe(a)||!pe(h)||!pe(m)||!pe(l)||!pe(u)?null:F.createElement("path",O_({},ze(x,!0),{className:Ze("recharts-cross",g),d:pLe(r,a,h,m,l,u)}))},yLe=e9,xLe=yLe(Object.getPrototypeOf,Object),vLe=xLe,bLe=Ha,wLe=vLe,jLe=qa,SLe="[object Object]",NLe=Function.prototype,kLe=Object.prototype,B7=NLe.toString,_Le=kLe.hasOwnProperty,CLe=B7.call(Object);function ELe(e){if(!jLe(e)||bLe(e)!=SLe)return!1;var t=wLe(e);if(t===null)return!0;var n=_Le.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&B7.call(n)==CLe}var ALe=ELe;const PLe=it(ALe);var TLe=Ha,OLe=qa,RLe="[object Boolean]";function MLe(e){return e===!0||e===!1||OLe(e)&&TLe(e)==RLe}var ILe=MLe;const $Le=it(ILe);function kp(e){"@babel/helpers - typeof";return kp=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},kp(e)}function mb(){return mb=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},mb.apply(this,arguments)}function LLe(e,t){return zLe(e)||BLe(e,t)||FLe(e,t)||DLe()}function DLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 921In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FLe(e,t){if(e){if(typeof e=="string")return GD(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 GD(e,t)}}function GD(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 BLe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function zLe(e){if(Array.isArray(e))return e}function YD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function XD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YD(Object(n),!0).forEach(function(r){ULe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ULe(e,t,n){return t=VLe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VLe(e){var t=WLe(e,"string");return kp(t)=="symbol"?t:String(t)}function WLe(e,t){if(kp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JD=function(t,n,r,s,a){var o=r-s,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+a),l+="L ".concat(t+r-o/2-s,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},HLe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qLe=function(t){var n=XD(XD({},HLe),t),r=y.useRef(),s=y.useState(-1),a=LLe(s,2),o=a[0],l=a[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&l(w)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,h=n.lowerWidth,f=n.height,m=n.className,g=n.animationEasing,p=n.animationDuration,x=n.animationBegin,v=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||f!==+f||d===0&&h===0||f===0)return null;var b=Ze("recharts-trapezoid",m);return v?F.createElement(Wi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:f,x:c,y:u},to:{upperWidth:d,lowerWidth:h,height:f,x:c,y:u},duration:p,animationEasing:g,isActive:v},function(w){var j=w.upperWidth,S=w.lowerWidth,N=w.height,k=w.x,_=w.y;return F.createElement(Wi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:p,easing:g},F.createElement("path",mb({},ze(n,!0),{className:b,d:JD(k,_,j,S,N),ref:r})))}):F.createElement("g",null,F.createElement("path",mb({},ze(n,!0),{className:b,d:JD(c,u,d,h,f)})))},KLe=["option","shapeType","propTransformer","activeClassName","isActive"];function _p(e){"@babel/helpers - typeof";return _p=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},_p(e)}function GLe(e,t){if(e==null)return{};var n=YLe(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YLe(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function QD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function pb(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){XLe(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 XLe(e,t,n){return t=JLe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JLe(e){var t=QLe(e,"string");return _p(t)=="symbol"?t:String(t)}function QLe(e,t){if(_p(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_p(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ZLe(e,t){return pb(pb({},t),e)}function eDe(e,t){return e==="symbols"}function ZD(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return F.createElement(VA,n);case"trapezoid":return F.createElement(qLe,n);case"sector":return F.createElement(E7,n);case"symbols":if(eDe(t))return F.createElement(lA,n);break;default:return null}}function tDe(e){return y.isValidElement(e)?e.props:e}function nDe(e){var t=e.option,n=e.shapeType,r=e.propTransformer,s=r===void 0?ZLe:r,a=e.activeClassName,o=a===void 0?"recharts-active-shape":a,l=e.isActive,c=GLe(e,KLe),u;if(y.isValidElement(t))u=y.cloneElement(t,pb(pb({},c),tDe(t)));else if(Ve(t))u=t(c);else if(PLe(t)&&!$Le(t)){var d=s(t,c);u=F.createElement(ZD,{shapeType:n,elementProps:d})}else{var h=c;u=F.createElement(ZD,{shapeType:n,elementProps:h})}return l?F.createElement(Tt,{className:o},u):u}function xw(e,t){return t!=null&&"trapezoids"in e.props}function vw(e,t){return t!=null&&"sectors"in e.props}function Cp(e,t){return t!=null&&"points"in e.props}function rDe(e,t){var n,r,s=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 s&&a}function sDe(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function iDe(e,t){var n=e.x===t.x,r=e.y===t.y,s=e.z===t.z;return n&&r&&s}function aDe(e,t){var n;return xw(e,t)?n=rDe:vw(e,t)?n=sDe:Cp(e,t)&&(n=iDe),n}function oDe(e,t){var n;return xw(e,t)?n="trapezoids":vw(e,t)?n="sectors":Cp(e,t)&&(n="points"),n}function lDe(e,t){if(xw(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(vw(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 Cp(e,t)?t.payload:{}}function cDe(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,s=oDe(n,t),a=lDe(n,t),o=r.filter(function(c,u){var d=Gd(a,c),h=n.props[s].filter(function(g){var p=aDe(n,t);return p(g,t)}),f=n.props[s].indexOf(h[h.length-1]),m=u===f;return d&&m}),l=r.indexOf(o[o.length-1]);return l}var uDe=Math.ceil,dDe=Math.max;function hDe(e,t,n,r){for(var s=-1,a=dDe(uDe((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++s]=e,e+=n;return o}var fDe=hDe,mDe=b9,e4=1/0,pDe=17976931348623157e292;function gDe(e){if(!e)return e===0?e:0;if(e=mDe(e),e===e4||e===-e4){var t=e<0?-1:1;return t*pDe}return e===e?e:0}var z7=gDe,yDe=fDe,xDe=ow,j1=z7;function vDe(e){return function(t,n,r){return r&&typeof r!="number"&&xDe(t,n,r)&&(n=r=void 0),t=j1(t),n===void 0?(n=t,t=0):n=j1(n),r=r===void 0?t<n?1:-1:j1(r),yDe(t,n,r,e)}}var bDe=vDe,wDe=bDe,jDe=wDe(),SDe=jDe;const gb=it(SDe);function Ep(e){"@babel/helpers - typeof";return Ep=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},Ep(e)}function t4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function n4(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){U7(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 U7(e,t,n){return t=NDe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NDe(e){var t=kDe(e,"string");return Ep(t)=="symbol"?t:String(t)}function kDe(e,t){if(Ep(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ep(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _De=["Webkit","Moz","O","ms"],CDe=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),s=_De.reduce(function(a,o){return n4(n4({},a),{},U7({},o+r,n))},{});return s[t]=n,s};function Xd(e){"@babel/helpers - typeof";return Xd=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},Xd(e)}function yb(){return yb=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},yb.apply(this,arguments)}function r4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function S1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r4(Object(n),!0).forEach(function(r){Or(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EDe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s4(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,W7(r.key),r)}}function ADe(e,t,n){return t&&s4(e.prototype,t),n&&s4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function PDe(e,t,n){return t=xb(t),TDe(e,V7()?Reflect.construct(t,n||[],xb(e).constructor):t.apply(e,n))}function TDe(e,t){if(t&&(Xd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pi(e)}function V7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V7=function(){return!!e})()}function xb(e){return xb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xb(e)}function pi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ODe(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&&R_(e,t)}function R_(e,t){return R_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},R_(e,t)}function Or(e,t,n){return t=W7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W7(e){var t=RDe(e,"string");return Xd(t)=="symbol"?t:String(t)}function RDe(e,t){if(Xd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MDe=function(t){var n=t.data,r=t.startIndex,s=t.endIndex,a=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=im().domain(gb(0,c)).range([a,a+o-l]),d=u.domain().map(function(h){return u(h)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(s),scale:u,scaleValues:d}},i4=function(t){return t.changedTouches&&!!t.changedTouches.length},Jd=function(e){ODe(t,e);function t(n){var r;return EDe(this,t),r=PDe(this,t,[n]),Or(pi(r),"handleDrag",function(s){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(s):r.state.isSlideMoving&&r.handleSlideDrag(s)}),Or(pi(r),"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&r.handleDrag(s.changedTouches[0])}),Or(pi(r),"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=r.props,a=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Or(pi(r),"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Or(pi(r),"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Or(pi(r),"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Or(pi(r),"handleSlideDragStart",function(s){var a=i4(s)?s.changedTouches[0]:s;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(pi(r),"startX"),endX:r.handleTravellerDragStart.bind(pi(r),"endX")},r.state={},r}return ADe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var s=r.startX,a=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,h=Math.min(s,a),f=Math.max(s,a),m=t.getIndexInRange(o,h),g=t.getIndexInRange(o,f);return{startIndex:m-m%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(r){var s=this.props,a=s.data,o=s.tickFormatter,l=s.dataKey,c=cr(a[r],l,r);return Ve(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 s=this.state,a=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,u=c.x,d=c.width,h=c.travellerWidth,f=c.startIndex,m=c.endIndex,g=c.onChange,p=r.pageX-a;p>0?p=Math.min(p,u+d-h-l,u+d-h-o):p<0&&(p=Math.max(p,u-o,u-l));var x=this.getIndex({startX:o+p,endX:l+p});(x.startIndex!==f||x.endIndex!==m)&&g&&g(x),this.setState({startX:o+p,endX:l+p,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,s){var a=i4(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var s=this.state,a=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,u=this.state[o],d=this.props,h=d.x,f=d.width,m=d.travellerWidth,g=d.onChange,p=d.gap,x=d.data,v={startX:this.state.startX,endX:this.state.endX},b=r.pageX-a;b>0?b=Math.min(b,h+f-m-u):b<0&&(b=Math.max(b,h-u)),v[o]=u+b;var w=this.getIndex(v),j=w.startIndex,S=w.endIndex,N=function(){var _=x.length-1;return o==="startX"&&(l>c?j%p===0:S%p===0)||l<c&&S===_||o==="endX"&&(l>c?S%p===0:j%p===0)||l>c&&S===_};this.setState(Or(Or({},o,u+b),"brushMoveStartX",r.pageX),function(){g&&N()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,s){var a=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[s],h=l.indexOf(d);if(h!==-1){var f=h+r;if(!(f===-1||f>=l.length)){var m=l[f];s==="startX"&&m>=u||s==="endX"&&m<=c||this.setState(Or({},s,m),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return F.createElement("rect",{stroke:u,fill:c,x:s,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,s=r.x,a=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,h=y.Children.only(u);return h?F.cloneElement(h,{x:s,y:a,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,s){var a,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,h=c.height,f=c.traveller,m=c.ariaLabel,g=c.data,p=c.startIndex,x=c.endIndex,v=Math.max(r,this.props.x),b=S1(S1({},ze(this.props,!1)),{},{x:v,y:u,width:d,height:h}),w=m||"Min value: ".concat((a=g[p])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=g[x])===null||o===void 0?void 0:o.name);return F.createElement(Tt,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),l.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(f,b))}},{key:"renderSlide",value:function(r,s){var a=this.props,o=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,s)+u,h=Math.max(Math.abs(s-r)-u,0);return F.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:d,y:o,width:h,height:l})}},{key:"renderText",value:function(){var r=this.props,s=r.startIndex,a=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,h=d.startX,f=d.endX,m=5,g={pointerEvents:"none",fill:u};return F.createElement(Tt,{className:"recharts-brush-texts"},F.createElement(Kv,yb({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,f)-m,y:o+l/2},g),this.getTextOfTick(s)),F.createElement(Kv,yb({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,f)+c+m,y:o+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,s=r.data,a=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,h=r.alwaysShowText,f=this.state,m=f.startX,g=f.endX,p=f.isTextActive,x=f.isSlideMoving,v=f.isTravellerMoving,b=f.isTravellerFocused;if(!s||!s.length||!pe(l)||!pe(c)||!pe(u)||!pe(d)||u<=0||d<=0)return null;var w=Ze("recharts-brush",a),j=F.Children.count(o)===1,S=CDe("userSelect","none");return F.createElement(Tt,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(m,g),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(g,"endX"),(p||x||v||b||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var s=r.x,a=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return F.createElement(F.Fragment,null,F.createElement("rect",{x:s,y:a,width:o,height:l,fill:c,stroke:"none"}),F.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),F.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,s){var a;return F.isValidElement(r)?a=F.cloneElement(r,s):Ve(r)?a=r(s):a=t.renderDefaultTraveller(s),a}},{key:"getDerivedStateFromProps",value:function(r,s){var a=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,h=r.endIndex;if(a!==s.prevData||u!==s.prevUpdateId)return S1({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},a&&a.length?MDe({data:a,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:h}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var f=s.scale.domain().map(function(m){return s.scale(m)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:s.scale(r.startIndex),endX:s.scale(r.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(r,s){for(var a=r.length,o=0,l=a-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>s?l=c:o=c}return s>=r[l]?l:o}}]),t}(y.PureComponent);
921Or(Jd,"displayName","Brush");Or(Jd,"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 IDe=pA;function $De(e,t){var n;return IDe(e,function(r,s,a){return n=t(r,s,a),!n}),!!n}var LDe=$De,DDe=qH,FDe=gl,BDe=LDe,zDe=_r,UDe=ow;function VDe(e,t,n){var r=zDe(e)?DDe:BDe;return n&&UDe(e,t,n)&&(t=void 0),r(e,FDe(t))}var WDe=VDe;const HDe=it(WDe);var Fi=function(t,n){var r=t.alwaysShow,s=t.ifOverflow;return r&&(s="extendDomain"),s===n},a4=p9;function qDe(e,t,n){t=="__proto__"&&a4?a4(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var KDe=qDe,GDe=KDe,YDe=f9,XDe=gl;function JDe(e,t){var n={};return t=XDe(t),YDe(e,function(r,s,a){GDe(n,s,t(r,s,a))}),n}var QDe=JDe;const ZDe=it(QDe);function e4e(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var t4e=e4e,n4e=pA;function r4e(e,t){var n=!0;return n4e(e,function(r,s,a){return n=!!t(r,s,a),n}),n}var s4e=r4e,i4e=t4e,a4e=s4e,o4e=gl,l4e=_r,c4e=ow;function u4e(e,t,n){var r=l4e(e)?i4e:a4e;return n&&c4e(e,t,n)&&(t=void 0),r(e,o4e(t))}var d4e=u4e;const H7=it(d4e);var h4e=["x","y"];function Ap(e){"@babel/helpers - typeof";return Ap=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},Ap(e)}function M_(){return M_=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},M_.apply(this,arguments)}function o4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function mf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o4(Object(n),!0).forEach(function(r){f4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function f4e(e,t,n){return t=m4e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m4e(e){var t=p4e(e,"string");return Ap(t)=="symbol"?t:String(t)}function p4e(e,t){if(Ap(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ap(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function g4e(e,t){if(e==null)return{};var n=y4e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function y4e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function x4e(e,t){var n=e.x,r=e.y,s=g4e(e,h4e),a="".concat(n),o=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||s.height),d=parseInt(u,10),h="".concat(t.width||s.width),f=parseInt(h,10);return mf(mf(mf(mf(mf({},t),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:f,name:t.name,radius:t.radius})}function l4(e){return F.createElement(nDe,M_({shapeType:"rectangle",propTransformer:x4e,activeClassName:"recharts-active-bar"},e))}var v4e=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,s){if(typeof t=="number")return t;var a=typeof r=="number";return a?t(r,s):(a||Oc(),n)}},b4e=["value","background"],q7;function Qd(e){"@babel/helpers - typeof";return Qd=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},Qd(e)}function w4e(e,t){if(e==null)return{};var n=j4e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function j4e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function vb(){return vb=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},vb.apply(this,arguments)}function c4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
921t%2?c4(Object(n),!0).forEach(function(r){$o(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 S4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u4(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,G7(r.key),r)}}function N4e(e,t,n){return t&&u4(e.prototype,t),n&&u4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function k4e(e,t,n){return t=bb(t),_4e(e,K7()?Reflect.construct(t,n||[],bb(e).constructor):t.apply(e,n))}function _4e(e,t){if(t&&(Qd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Of(e)}function K7(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K7=function(){return!!e})()}function bb(e){return bb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},bb(e)}function Of(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C4e(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&&I_(e,t)}function I_(e,t){return I_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},I_(e,t)}function $o(e,t,n){return t=G7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G7(e){var t=E4e(e,"string");return Qd(t)=="symbol"?t:String(t)}function E4e(e,t){if(Qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bl=function(e){C4e(t,e);function t(){var n;S4e(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=k4e(this,t,[].concat(s)),$o(Of(n),"state",{isAnimationFinished:!1}),$o(Of(n),"id",Th("recharts-bar-")),$o(Of(n),"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),$o(Of(n),"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return N4e(t,[{key:"renderRectanglesStatically",value:function(r){var s=this,a=this.props,o=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=ze(this.props,!1);return r&&r.map(function(h,f){var m=f===c,g=m?u:o,p=wn(wn(wn({},d),h),{},{isActive:m,option:g,index:f,dataKey:l,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return F.createElement(Tt,vb({className:"recharts-bar-rectangle"},Ov(s.props,h,f),{key:"rectangle-".concat(h==null?void 0:h.x,"-").concat(h==null?void 0:h.y,"-").concat(h==null?void 0:h.value)}),F.createElement(l4,p))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,s=this.props,a=s.data,o=s.layout,l=s.isAnimationActive,c=s.animationBegin,u=s.animationDuration,d=s.animationEasing,h=s.animationId,f=this.state.prevData;return F.createElement(Wi,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var g=m.t,p=a.map(function(x,v){var b=f&&f[v];if(b){var w=$n(b.x,x.x),j=$n(b.y,x.y),S=$n(b.width,x.width),N=$n(b.height,x.height);return wn(wn({},x),{},{x:w(g),y:j(g),width:S(g),height:N(g)})}if(o==="horizontal"){var k=$n(0,x.height),_=k(g);return wn(wn({},x),{},{y:x.y+x.height-_,height:_})}var C=$n(0,x.width),A=C(g);return wn(wn({},x),{},{width:A})});return F.createElement(Tt,null,r.renderRectanglesStatically(p))})}},{key:"renderRectangles",value:function(){var r=this.props,s=r.data,a=r.isAnimationActive,o=this.state.prevData;return a&&s&&s.length&&(!o||!Gd(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}}
vendor: 15,618 bytes, lines 921-922
921,{key:"renderBackground",value:function(){var r=this,s=this.props,a=s.data,o=s.dataKey,l=s.activeIndex,c=ze(this.props.background,!1);return a.map(function(u,d){u.value;var h=u.background,f=w4e(u,b4e);if(!h)return null;var m=wn(wn(wn(wn(wn({},f),{},{fill:"#eee"},h),c),Ov(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,key:"background-bar-".concat(d),className:"recharts-bar-background-rectangle"});return F.createElement(l4,vb({option:r.props.background,isActive:d===l},m))})}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,h=Ns(d,xg);if(!h)return null;var f=u==="vertical"?o[0].height/2:o[0].width/2,m=function(x,v){var b=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:b,errorVal:cr(x,v)}},g={clipPath:r?"url(#clipPath-".concat(s,")"):null};return F.createElement(Tt,g,h.map(function(p){return F.cloneElement(p,{key:"error-bar-".concat(s,"-").concat(p.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:f,dataPointFormatter:m})}))}},{key:"render",value:function(){var r=this.props,s=r.hide,a=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,h=r.width,f=r.height,m=r.isAnimationActive,g=r.background,p=r.id;if(s||!a||!a.length)return null;var x=this.state.isAnimationFinished,v=Ze("recharts-bar",o),b=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,j=b||w,S=Ge(p)?this.id:p;return F.createElement(Tt,{className:v},b||w?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(S)},F.createElement("rect",{x:b?u:u-h/2,y:w?d:d-f/2,width:b?h:h*2,height:w?f:f*2}))):null,F.createElement(Tt,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(S,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,S),(!m||x)&&ja.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:s.curData}:r.data!==s.curData?{curData:r.data}:null}}]),t}(y.PureComponent);q7=bl;$o(bl,"displayName","Bar");$o(bl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Li.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});$o(bl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,s=e.bandSize,a=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,h=e.displayedData,f=e.offset,m=gMe(r,n);if(!m)return null;var g=t.layout,p=n.props,x=p.dataKey,v=p.children,b=p.minPointSize,w=g==="horizontal"?o:a,j=u?w.scale.domain():null,S=NMe({numericAxis:w}),N=Ns(v,j9),k=h.map(function(_,C){var A,E,P,$,R,L;u?A=yMe(u[d+C],j):(A=cr(_,x),Array.isArray(A)||(A=[S,A]));var D=v4e(b,q7.defaultProps.minPointSize)(A[1],C);if(g==="horizontal"){var I,M=[o.scale(A[0]),o.scale(A[1])],H=M[0],T=M[1];E=cD({axis:a,ticks:l,bandSize:s,offset:m.offset,entry:_,index:C}),P=(I=T??H)!==null&&I!==void 0?I:void 0,$=m.size;var B=H-T;if(R=Number.isNaN(B)?0:B,L={x:E,y:o.y,width:$,height:o.height},Math.abs(D)>0&&Math.abs(R)<Math.abs(D)){var Y=Ys(R||D)*(Math.abs(D)-Math.abs(R));P-=Y,R+=Y}}else{var O=[a.scale(A[0]),a.scale(A[1])],W=O[0],X=O[1];if(E=W,P=cD({axis:o,ticks:c,bandSize:s,offset:m.offset,entry:_,index:C}),$=X-W,R=m.size,L={x:a.x,y:P,width:a.width,height:R},Math.abs(D)>0&&Math.abs($)<Math.abs(D)){var J=Ys($||D)*(Math.abs(D)-Math.abs($));$+=J}}return wn(wn(wn({},_),{},{x:E,y:P,width:$,height:R,value:u?A:A[1],payload:_,background:L},N&&N[C]&&N[C].props),{},{tooltipPayload:[k7(n,_)],tooltipPosition:{x:E+$/2,y:P+R/2}})});return wn({data:k,layout:g},f)});function Pp(e){"@babel/helpers - typeof";return Pp=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},Pp(e)}function A4e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d4(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,Y7(r.key),r)}}function P4e(e,t,n){return t&&d4(e.prototype,t),n&&d4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h4(Object(n),!0).forEach(function(r){bw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bw(e,t,n){return t=Y7(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y7(e){var t=T4e(e,"string");return Pp(t)=="symbol"?t:String(t)}function T4e(e,t){if(Pp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Pp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WA=function(t,n,r,s,a){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),h={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},f=!!Lr(u,bl);return d.reduce(function(m,g){var p=n[g],x=p.orientation,v=p.domain,b=p.padding,w=b===void 0?{}:b,j=p.mirror,S=p.reversed,N="".concat(x).concat(j?"Mirror":""),k,_,C,A,E;if(p.type==="number"&&(p.padding==="gap"||p.padding==="no-gap")){var P=v[1]-v[0],$=1/0,R=p.categoricalDomain.sort();if(R.forEach(function(W,X){X>0&&($=Math.min((W||0)-(R[X-1]||0),$))}),Number.isFinite($)){var L=$/P,D=p.layout==="vertical"?r.height:r.width;if(p.padding==="gap"&&(k=L*D/2),p.padding==="no-gap"){var I=Pc(t.barCategoryGap,L*D),M=L*D/2;k=M-I-(M-I)/D*I}}}s==="xAxis"?_=[r.left+(w.left||0)+(k||0),r.left+r.width-(w.right||0)-(k||0)]:s==="yAxis"?_=c==="horizontal"?[r.top+r.height-(w.bottom||0),r.top+(w.top||0)]:[r.top+(w.top||0)+(k||0),r.top+r.height-(w.bottom||0)-(k||0)]:_=p.range,S&&(_=[_[1],_[0]]);var H=mMe(p,a,f),T=H.scale,B=H.realScaleType;T.domain(v).range(_),pMe(T);var Y=SMe(T,zs(zs({},p),{},{realScaleType:B}));s==="xAxis"?(E=x==="top"&&!j||x==="bottom"&&j,C=r.left,A=h[N]-E*p.height):s==="yAxis"&&(E=x==="left"&&!j||x==="right"&&j,C=h[N]-E*p.width,A=r.top);var O=zs(zs(zs({},p),Y),{},{realScaleType:B,x:C,y:A,scale:T,width:s==="xAxis"?r.width:p.width,height:s==="yAxis"?r.height:p.height});return O.bandSize=ob(O,Y),!p.hide&&s==="xAxis"?h[N]+=(E?-1:1)*O.height:p.hide||(h[N]+=(E?-1:1)*O.width),zs(zs({},m),{},bw({},g,O))},{})},X7=function(t,n){var r=t.x,s=t.y,a=n.x,o=n.y;return{x:Math.min(r,a),y:Math.min(s,o),width:Math.abs(a-r),height:Math.abs(o-s)}},O4e=function(t){var n=t.x1,r=t.y1,s=t.x2,a=t.y2;return X7({x:n,y:r},{x:s,y:a})},J7=function(){function e(t){A4e(this,e),this.scale=t}return P4e(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]:{},s=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 l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(s){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(),s=r[0],a=r[r.length-1];return s<=a?n>=s&&n<=a:n>=a&&n<=s}}],[{key:"create",value:function(n){return new e(n)}}]),e}();bw(J7,"EPS",1e-4);var HA=function(t){var n=Object.keys(t).reduce(function(r,s){return zs(zs({},r),{},bw({},s,J7.create(t[s])))},{});return zs(zs({},n),{},{apply:function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return ZDe(s,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return H7(s,function(a,o){return n[o].isInRange(a)})}})};function R4e(e){return(e%180+180)%180}var M4e=function(t){var n=t.width,r=t.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=R4e(s),o=a*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},I4e=gl,$4e=fg,L4e=iw;function D4e(e){return function(t,n,r){var s=Object(t);if(!$4e(t)){var a=I4e(n);t=L4e(t),n=function(l){return a(s[l],l,s)}}var o=e(t,n,r);return o>-1?s[a?t[o]:o]:void 0}}var F4e=D4e,B4e=z7;function z4e(e){var t=B4e(e),n=t%1;return t===t?n?t-n:t:0}var U4e=z4e,V4e=a9,W4e=gl,H4e=U4e,q4e=Math.max;function K4e(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var s=n==null?0:H4e(n);return s<0&&(s=q4e(r+s,0)),V4e(e,W4e(t),s)}var G4e=K4e,Y4e=F4e,X4e=G4e,J4e=Y4e(X4e),Q4e=J4e;const Z4e=it(Q4e);var e5e=l0e(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("")}),qA=y.createContext(void 0),KA=y.createContext(void 0),Q7=y.createContext(void 0),Z7=y.createContext({}),eq=y.createContext(void 0),tq=y.createContext(0),nq=y.createContext(0),f4=function(t){var n=t.state,r=n.xAxisMap,s=n.yAxisMap,a=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=e5e(a);return F.createElement(qA.Provider,{value:r},F.createElement(KA.Provider,{value:s},F.createElement(Z7.Provider,{value:a},F.createElement(Q7.Provider,{value:d},F.createElement(eq.Provider,{value:o},F.createElement(tq.Provider,{value:u},F.createElement(nq.Provider,{value:c},l)))))))},t5e=function(){return y.useContext(eq)},rq=function(t){var n=y.useContext(qA);n==null&&Oc();var r=n[t];return r==null&&Oc(),r},n5e=function(){var t=y.useContext(qA);return vo(t)},r5e=function(){var t=y.useContext(KA),n=Z4e(t,function(r){return H7(r.domain,Number.isFinite)});return n||vo(t)},sq=function(t){var n=y.useContext(KA);n==null&&Oc();var r=n[t];return r==null&&Oc(),r},s5e=function(){var t=y.useContext(Q7);return t},i5e=function(){return y.useContext(Z7)},GA=function(){return y.useContext(nq)},YA=function(){return y.useContext(tq)};function Tp(e){"@babel/helpers - typeof";return Tp=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},Tp(e)}function m4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function p4(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){a5e(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 a5e(e,t,n){return t=o5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o5e(e){var t=l5e(e,"string");return Tp(t)=="symbol"?t:String(t)}function l5e(e,t){if(Tp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Tp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function c5e(e,t){return f5e(e)||h5e(e,t)||d5e(e,t)||u5e()}function u5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 922In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d5e(e,t){if(e){if(typeof e=="string")return g4(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 g4(e,t)}}function g4(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 h5e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function f5e(e){if(Array.isArray(e))return e}function $_(){return $_=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},$_.apply(this,arguments)}var m5e=function(t,n){var r;return F.isValidElement(t)?r=F.cloneElement(t,n):Ve(t)?r=t(n):r=F.createElement("line",$_({},n,{className:"recharts-reference-line-line"})),r},p5e=function(t,n,r,s,a,o,l,c,u){var d=a.x,h=a.y,f=a.width,m=a.height;if(r){var g=u.y,p=t.y.apply(g,{position:o});if(Fi(u,"discard")&&!t.y.isInRange(p))return null;var x=[{x:d+f,y:p},{x:d,y:p}];return c==="left"?x.reverse():x}if(n){var v=u.x,b=t.x.apply(v,{position:o});if(Fi(u,"discard")&&!t.x.isInRange(b))return null;var w=[{x:b,y:h+m},{x:b,y:h}];return l==="top"?w.reverse():w}if(s){var j=u.segment,S=j.map(function(N){return t.apply(N,{position:o})});return Fi(u,"discard")&&HDe(S,function(N){return!t.isInRange(N)})?null:S}return null};function XA(e){var t=e.x,n=e.y,r=e.segment,s=e.xAxisId,a=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=t5e(),d=rq(s),h=sq(a),f=s5e();if(!u||!f)return null;ba(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=HA({x:d.scale,y:h.scale}),g=xn(t),p=xn(n),x=r&&r.length===2,v=p5e(m,g,p,x,f,e.position,d.orientation,h.orientation,e);if(!v)return null;var b=c5e(v,2),w=b[0],j=w.x,S=w.y,N=b[1],k=N.x,_=N.y,C=Fi(e,"hidden")?"url(#".concat(u,")"):void 0,A=p4(p4({clipPath:C},ze(e,!0)),{},{x1:j,y1:S,x2:k,y2:_});return F.createElement(Tt,{className:Ze("recharts-reference-line",l)},m5e(o,A),Gn.renderCallByParent(e,O4e({x1:j,y1:S,x2:k,y2:_})))}XA.displayName="ReferenceLine";XA.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"};function Op(e){"@babel/helpers - typeof";return Op=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},Op(e)}function L_(){return L_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L_.apply(this,arguments)}function y4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function x4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
922t%2?y4(Object(n),!0).forEach(function(r){g5e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function g5e(e,t,n){return t=y5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y5e(e){var t=x5e(e,"string");return Op(t)=="symbol"?t:String(t)}function x5e(e,t){if(Op(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Op(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var v5e=function(t){var n=t.x,r=t.y,s=t.xAxis,a=t.yAxis,o=HA({x:s.scale,y:a.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return Fi(t,"discard")&&!o.isInRange(l)?null:l};function vg(e){var t=e.x,n=e.y,r=e.r,s=e.alwaysShow,a=e.clipPathId,o=xn(t),l=xn(n);if(ba(s===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!o||!l)return null;var c=v5e(e);if(!c)return null;var u=c.x,d=c.y,h=e.shape,f=e.className,m=Fi(e,"hidden")?"url(#".concat(a,")"):void 0,g=x4(x4({clipPath:m},ze(e,!0)),{},{cx:u,cy:d});return F.createElement(Tt,{className:Ze("recharts-reference-dot",f)},vg.renderDot(h,g),Gn.renderCallByParent(e,{x:u-r,y:d-r,width:2*r,height:2*r}))}vg.displayName="ReferenceDot";vg.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1};vg.renderDot=function(e,t){var n;return F.isValidElement(e)?n=F.cloneElement(e,t):Ve(e)?n=e(t):n=F.createElement(yw,L_({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n};function Rp(e){"@babel/helpers - typeof";return Rp=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},Rp(e)}function D_(){return D_=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},D_.apply(this,arguments)}function v4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function b4(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){b5e(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 b5e(e,t,n){return t=w5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w5e(e){var t=j5e(e,"string");return Rp(t)=="symbol"?t:String(t)}function j5e(e,t){if(Rp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var S5e=function(t,n,r,s,a){var o=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,h=a.yAxis;if(!d||!h)return null;var f=HA({x:d.scale,y:h.scale}),m={x:t?f.x.apply(o,{position:"start"}):f.x.rangeMin,y:r?f.y.apply(c,{position:"start"}):f.y.rangeMin},g={x:n?f.x.apply(l,{position:"end"}):f.x.rangeMax,y:s?f.y.apply(u,{position:"end"}):f.y.rangeMax};return Fi(a,"discard")&&(!f.isInRange(m)||!f.isInRange(g))?null:X7(m,g)};function bg(e){var t=e.x1,n=e.x2,r=e.y1,s=e.y2,a=e.className,o=e.alwaysShow,l=e.clipPathId;ba(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var c=xn(t),u=xn(n),d=xn(r),h=xn(s),f=e.shape;if(!c&&!u&&!d&&!h&&!f)return null;var m=S5e(c,u,d,h,e);if(!m&&!f)return null;var g=Fi(e,"hidden")?"url(#".concat(l,")"):void 0;return F.createElement(Tt,{className:Ze("recharts-reference-area",a)},bg.renderRect(f,b4(b4({clipPath:g},ze(e,!0)),m)),Gn.renderCallByParent(e,m))}
vendor: 64,824 bytes, lines 922-926
922bg.displayName="ReferenceArea";bg.defaultProps={isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1};bg.renderRect=function(e,t){var n;return F.isValidElement(e)?n=F.cloneElement(e,t):Ve(e)?n=e(t):n=F.createElement(VA,D_({},t,{className:"recharts-reference-area-rect"})),n};function iq(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],s=0;s<e.length;s+=t)r.push(e[s]);return r}function N5e(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return M4e(r,n)}function k5e(e,t,n){var r=n==="width",s=e.x,a=e.y,o=e.width,l=e.height;return t===1?{start:r?s:a,end:r?s+o:a+l}:{start:r?s+o:a+l,end:r?s:a}}function wb(e,t,n,r,s){if(e*t<e*r||e*t>e*s)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-s)<=0}function _5e(e,t){return iq(e,t+1)}function C5e(e,t,n,r,s){for(var a=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,h=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:iq(r,u)};var p=c,x,v=function(){return x===void 0&&(x=n(g,p)),x},b=g.coordinate,w=c===0||wb(e,b,v,d,l);w||(c=0,d=o,u+=1),w&&(d=b+e*(v()/2+s),c+=u)},f;u<=a.length;)if(f=h(),f)return f.v;return[]}function Mp(e){"@babel/helpers - typeof";return Mp=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},Mp(e)}function w4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function qn(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){E5e(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 E5e(e,t,n){return t=A5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A5e(e){var t=P5e(e,"string");return Mp(t)=="symbol"?t:String(t)}function P5e(e,t){if(Mp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function T5e(e,t,n,r,s){for(var a=(r||[]).slice(),o=a.length,l=t.start,c=t.end,u=function(f){var m=a[f],g,p=function(){return g===void 0&&(g=n(m,f)),g};if(f===o-1){var x=e*(m.coordinate+e*p()/2-c);a[f]=m=qn(qn({},m),{},{tickCoord:x>0?m.coordinate-x*e:m.coordinate})}else a[f]=m=qn(qn({},m),{},{tickCoord:m.coordinate});var v=wb(e,m.tickCoord,p,l,c);v&&(c=m.tickCoord-e*(p()/2+s),a[f]=qn(qn({},m),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return a}function O5e(e,t,n,r,s,a){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(a){var d=r[l-1],h=n(d,l-1),f=e*(d.coordinate+e*h/2-u);o[l-1]=d=qn(qn({},d),{},{tickCoord:f>0?d.coordinate-f*e:d.coordinate});var m=wb(e,d.tickCoord,function(){return h},c,u);m&&(u=d.tickCoord-e*(h/2+s),o[l-1]=qn(qn({},d),{},{isShow:!0}))}for(var g=a?l-1:l,p=function(b){var w=o[b],j,S=function(){return j===void 0&&(j=n(w,b)),j};if(b===0){var N=e*(w.coordinate-e*S()/2-c);o[b]=w=qn(qn({},w),{},{tickCoord:N<0?w.coordinate-N*e:w.coordinate})}else o[b]=w=qn(qn({},w),{},{tickCoord:w.coordinate});var k=wb(e,w.tickCoord,S,c,u);k&&(c=w.tickCoord+e*(S()/2+s),o[b]=qn(qn({},w),{},{isShow:!0}))},x=0;x<g;x++)p(x);return o}function JA(e,t,n){var r=e.tick,s=e.ticks,a=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,h=e.angle;if(!s||!s.length||!r)return[];if(pe(c)||Li.isSsr)return _5e(s,typeof c=="number"&&pe(c)?c:0);var f=[],m=l==="top"||l==="bottom"?"width":"height",g=d&&m==="width"?sm(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},p=function(w,j){var S=Ve(u)?u(w.value,j):w.value;return m==="width"?N5e(sm(S,{fontSize:t,letterSpacing:n}),g,h):sm(S,{fontSize:t,letterSpacing:n})[m]},x=s.length>=2?Ys(s[1].coordinate-s[0].coordinate):1,v=k5e(a,x,m);return c==="equidistantPreserveStart"?C5e(x,v,p,s,o):(c==="preserveStart"||c==="preserveStartEnd"?f=O5e(x,v,p,s,o,c==="preserveStartEnd"):f=T5e(x,v,p,s,o),f.filter(function(b){return b.isShow}))}var R5e=["viewBox"],M5e=["viewBox"],I5e=["ticks"];function Zd(e){"@babel/helpers - typeof";return Zd=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},Zd(e)}function Lu(){return Lu=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},Lu.apply(this,arguments)}function j4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j4(Object(n),!0).forEach(function(r){QA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N1(e,t){if(e==null)return{};var n=$5e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $5e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function L5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S4(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,oq(r.key),r)}}function D5e(e,t,n){return t&&S4(e.prototype,t),n&&S4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function F5e(e,t,n){return t=jb(t),B5e(e,aq()?Reflect.construct(t,n||[],jb(e).constructor):t.apply(e,n))}function B5e(e,t){if(t&&(Zd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return z5e(e)}function z5e(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 jb(e){return jb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jb(e)}function U5e(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&&F_(e,t)}function F_(e,t){return F_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},F_(e,t)}function QA(e,t,n){return t=oq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oq(e){var t=V5e(e,"string");return Zd(t)=="symbol"?t:String(t)}function V5e(e,t){if(Zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fh=function(e){U5e(t,e);function t(n){var r;return L5e(this,t),r=F5e(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return D5e(t,[{key:"shouldComponentUpdate",value:function(r,s){var a=r.viewBox,o=N1(r,R5e),l=this.props,c=l.viewBox,u=N1(l,M5e);return!ed(a,c)||!ed(o,u)||!ed(s,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var s=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var s=this.props,a=s.x,o=s.y,l=s.width,c=s.height,u=s.orientation,d=s.tickSize,h=s.mirror,f=s.tickMargin,m,g,p,x,v,b,w=h?-1:1,j=r.tickSize||d,S=pe(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":m=g=r.coordinate,x=o+ +!h*c,p=x-w*j,b=p-w*f,v=S;break;case"left":p=x=r.coordinate,g=a+ +!h*l,m=g-w*j,v=m-w*f,b=S;break;case"right":p=x=r.coordinate,g=a+ +h*l,m=g+w*j,v=m+w*f,b=S;break;default:m=g=r.coordinate,x=o+ +h*c,p=x+w*j,b=p+w*f,v=S;break}return{line:{x1:m,y1:p,x2:g,y2:x},tick:{x:v,y:b}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,s=r.orientation,a=r.mirror,o;switch(s){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,s=r.orientation,a=r.mirror,o="end";switch(s){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,s=r.x,a=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,h=Zn(Zn(Zn({},ze(this.props,!1)),ze(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var f=+(c==="top"&&!u||c==="bottom"&&u);h=Zn(Zn({},h),{},{x1:s,y1:a+f*l,x2:s+o,y2:a+f*l})}else{var m=+(c==="left"&&!u||c==="right"&&u);h=Zn(Zn({},h),{},{x1:s+m*o,y1:a,x2:s+m*o,y2:a+l})}return F.createElement("line",Lu({},h,{className:Ze("recharts-cartesian-axis-line",Ss(d,"className"))}))}},{key:"renderTicks",value:function(r,s,a){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,h=l.tickFormatter,f=l.unit,m=JA(Zn(Zn({},this.props),{},{ticks:r}),s,a),g=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),x=ze(this.props,!1),v=ze(d,!1),b=Zn(Zn({},x),{},{fill:"none"},ze(c,!1)),w=m.map(function(j,S){var N=o.getTickLineCoord(j),k=N.line,_=N.tick,C=Zn(Zn(Zn(Zn({textAnchor:g,verticalAnchor:p},x),{},{stroke:"none",fill:u},v),_),{},{index:S,payload:j,visibleTicksCount:m.length,tickFormatter:h});return F.createElement(Tt,Lu({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},Ov(o.props,j,S)),c&&F.createElement("line",Lu({},b,k,{className:Ze("recharts-cartesian-axis-tick-line",Ss(c,"className"))})),d&&t.renderTickItem(d,C,"".concat(Ve(h)?h(j.value,S):j.value).concat(f||"")))});return F.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var r=this,s=this.props,a=s.axisLine,o=s.width,l=s.height,c=s.ticksGenerator,u=s.className,d=s.hide;if(d)return null;var h=this.props,f=h.ticks,m=N1(h,I5e),g=f;return Ve(c)&&(g=f&&f.length>0?c(this.props):c(m)),o<=0||l<=0||!g||!g.length?null:F.createElement(Tt,{className:Ze("recharts-cartesian-axis",u),ref:function(x){r.layerReference=x}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Gn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,s,a){var o;return F.isValidElement(r)?o=F.cloneElement(r,s):Ve(r)?o=r(s):o=F.createElement(Kv,Lu({},s,{className:"recharts-cartesian-axis-tick-value"}),a),o}}]),t}(y.Component);QA(Fh,"displayName","CartesianAxis");QA(Fh,"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 W5e=["x1","y1","x2","y2","key"],H5e=["offset"];function Rc(e){"@babel/helpers - typeof";return Rc=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},Rc(e)}function N4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Yn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N4(Object(n),!0).forEach(function(r){q5e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q5e(e,t,n){return t=K5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K5e(e){var t=G5e(e,"string");return Rc(t)=="symbol"?t:String(t)}function G5e(e,t){if(Rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jl(){return Jl=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},Jl.apply(this,arguments)}function k4(e,t){if(e==null)return{};var n=Y5e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Y5e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var X5e=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,s=t.x,a=t.y,o=t.width,l=t.height;return F.createElement("rect",{x:s,y:a,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function lq(e,t){var n;if(F.isValidElement(e))n=F.cloneElement(e,t);else if(Ve(e))n=e(t);else{var r=t.x1,s=t.y1,a=t.x2,o=t.y2,l=t.key,c=k4(t,W5e),u=ze(c,!1);u.offset;var d=k4(u,H5e);n=F.createElement("line",Jl({},d,{x1:r,y1:s,x2:a,y2:o,fill:"none",key:l}))}return n}function J5e(e){var t=e.x,n=e.width,r=e.horizontal,s=r===void 0?!0:r,a=e.horizontalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Yn(Yn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return lq(s,u)});return F.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Q5e(e){var t=e.y,n=e.height,r=e.vertical,s=r===void 0?!0:r,a=e.verticalPoints;if(!s||!a||!a.length)return null;var o=a.map(function(l,c){var u=Yn(Yn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return lq(s,u)});return F.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Z5e(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,s=e.y,a=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(f){return Math.round(f+s-s)}).sort(function(f,m){return f-m});s!==d[0]&&d.unshift(0);var h=d.map(function(f,m){var g=!d[m+1],p=g?s+o-f:d[m+1]-f;if(p<=0)return null;var x=m%t.length;return F.createElement("rect",{key:"react-".concat(m),y:f,x:r,height:p,width:a,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function e3e(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,s=e.fillOpacity,a=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(f){return Math.round(f+a-a)}).sort(function(f,m){return f-m});a!==d[0]&&d.unshift(0);var h=d.map(function(f,m){var g=!d[m+1],p=g?a+l-f:d[m+1]-f;if(p<=0)return null;var x=m%r.length;return F.createElement("rect",{key:"react-".concat(m),x:f,y:o,width:p,height:c,stroke:"none",fill:r[x],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var t3e=function(t,n){var r=t.xAxis,s=t.width,a=t.height,o=t.offset;return S7(JA(Yn(Yn(Yn({},Fh.defaultProps),r),{},{ticks:ma(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.left,o.left+o.width,n)},n3e=function(t,n){var r=t.yAxis,s=t.width,a=t.height,o=t.offset;return S7(JA(Yn(Yn(Yn({},Fh.defaultProps),r),{},{ticks:ma(r,!0),viewBox:{x:0,y:0,width:s,height:a}})),o.top,o.top+o.height,n)},au={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ip(e){var t,n,r,s,a,o,l=GA(),c=YA(),u=i5e(),d=Yn(Yn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:au.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:au.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:au.horizontal,horizontalFill:(s=e.horizontalFill)!==null&&s!==void 0?s:au.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:au.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:au.verticalFill,x:pe(e.x)?e.x:u.left,y:pe(e.y)?e.y:u.top,width:pe(e.width)?e.width:u.width,height:pe(e.height)?e.height:u.height}),h=d.x,f=d.y,m=d.width,g=d.height,p=d.syncWithTicks,x=d.horizontalValues,v=d.verticalValues,b=n5e(),w=r5e();if(!pe(m)||m<=0||!pe(g)||g<=0||!pe(h)||h!==+h||!pe(f)||f!==+f)return null;var j=d.verticalCoordinatesGenerator||t3e,S=d.horizontalCoordinatesGenerator||n3e,N=d.horizontalPoints,k=d.verticalPoints;if((!N||!N.length)&&Ve(S)){var _=x&&x.length,C=S({yAxis:w?Yn(Yn({},w),{},{ticks:_?x:w.ticks}):void 0,width:l,height:c,offset:u},_?!0:p);ba(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Rc(C),"]")),Array.isArray(C)&&(N=C)}if((!k||!k.length)&&Ve(j)){var A=v&&v.length,E=j({xAxis:b?Yn(Yn({},b),{},{ticks:A?v:b.ticks}):void 0,width:l,height:c,offset:u},A?!0:p);ba(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Rc(E),"]")),Array.isArray(E)&&(k=E)}return F.createElement("g",{className:"recharts-cartesian-grid"},F.createElement(X5e,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height}),F.createElement(J5e,Jl({},d,{offset:u,horizontalPoints:N,xAxis:b,yAxis:w})),F.createElement(Q5e,Jl({},d,{offset:u,verticalPoints:k,xAxis:b,yAxis:w})),F.createElement(Z5e,Jl({},d,{horizontalPoints:N})),F.createElement(e3e,Jl({},d,{verticalPoints:k})))}Ip.displayName="CartesianGrid";var r3e=["type","layout","connectNulls","ref"];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)}function s3e(e,t){if(e==null)return{};var n=i3e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function i3e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function lm(){return lm=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},lm.apply(this,arguments)}function _4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).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?_4(Object(n),!0).forEach(function(r){Us(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ou(e){return c3e(e)||l3e(e)||o3e(e)||a3e()}function a3e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 923In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o3e(e,t){if(e){if(typeof e=="string")return B_(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 B_(e,t)}}function l3e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c3e(e){if(Array.isArray(e))return B_(e)}function B_(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 u3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C4(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,uq(r.key),r)}}function d3e(e,t,n){return t&&C4(e.prototype,t),n&&C4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function h3e(e,t,n){return t=Sb(t),f3e(e,cq()?Reflect.construct(t,n||[],Sb(e).constructor):t.apply(e,n))}function f3e(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 ao(e)}function cq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cq=function(){return!!e})()}function Sb(e){return Sb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sb(e)}function ao(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m3e(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&&z_(e,t)}function z_(e,t){return z_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},z_(e,t)}function Us(e,t,n){return t=uq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uq(e){var t=p3e(e,"string");return eh(t)=="symbol"?t:String(t)}function p3e(e,t){if(eh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(eh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var th=function(e){m3e(t,e);function t(){var n;u3e(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=h3e(this,t,[].concat(s)),Us(ao(n),"state",{isAnimationFinished:!0,totalLength:0}),Us(ao(n),"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Us(ao(n),"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(v,b){return v+b});if(!u)return n.generateSimpleStrokeDasharray(l,o);for(var d=Math.floor(o/u),h=o%u,f=l-o,m=[],g=0,p=0;g<c.length;p+=c[g],++g)if(p+c[g]>h){m=[].concat(ou(c.slice(0,g)),[h-p]);break}var x=m.length%2===0?[0,f]:[f];return[].concat(ou(t.repeat(c,d)),ou(m),x).map(function(v){return"".concat(v,"px")}).join(", ")}),Us(ao(n),"id",Th("recharts-line-")),Us(ao(n),"pathRef",function(o){n.mainCurve=o}),Us(ao(n),"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Us(ao(n),"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return d3e(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,h=Ns(d,xg);if(!h)return null;var f=function(p,x){return{x:p.x,y:p.y,value:p.value,errorVal:cr(p.payload,x)}},m={clipPath:r?"url(#clipPath-".concat(s,")"):null};return F.createElement(Tt,m,h.map(function(g){return F.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:f})}))}},{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,h=ze(this.props,!1),f=ze(c,!0),m=u.map(function(p,x){var v=Pr(Pr(Pr({key:"dot-".concat(x),r:3},h),f),{},{value:p.value,dataKey:d,cx:p.x,cy:p.y,index:x,payload:p.payload});return t.renderDotItem(c,v)}),g={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return F.createElement(Tt,lm({className:"recharts-line-dots",key:"dots"},g),m)}},{key:"renderCurveStatically",value:function(r,s,a,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var h=s3e(l,r3e),f=Pr(Pr(Pr({},ze(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(a,")"):null,points:r},o),{},{type:c,layout:u,connectNulls:d});return F.createElement(rd,lm({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,h=o.animationDuration,f=o.animationEasing,m=o.animationId,g=o.animateNewValues,p=o.width,x=o.height,v=this.state,b=v.prevPoints,w=v.totalLength;return F.createElement(Wi,{begin:d,duration:h,isActive:u,easing:f,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var S=j.t;if(b){var N=b.length/l.length,k=l.map(function(P,$){var R=Math.floor($*N);if(b[R]){var L=b[R],D=$n(L.x,P.x),I=$n(L.y,P.y);return Pr(Pr({},P),{},{x:D(S),y:I(S)})}if(g){var M=$n(p*2,P.x),H=$n(x/2,P.y);return Pr(Pr({},P),{},{x:M(S),y:H(S)})}return Pr(Pr({},P),{},{x:P.x,y:P.y})});return a.renderCurveStatically(k,r,s)}var _=$n(0,w),C=_(S),A;if(c){var E="".concat(c).split(/[,\s]+/gim).map(function(P){return parseFloat(P)});A=a.getStrokeDasharray(C,w,E)}else A=a.generateSimpleStrokeDasharray(w,C);return a.renderCurveStatically(l,r,s,{strokeDasharray:A})})}},{key:"renderCurve",value:function(r,s){var a=this.props,o=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!Gd(u,o))?this.renderCurveWithAnimation(r,s):this.renderCurveStatically(o,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.xAxis,d=s.yAxis,h=s.top,f=s.left,m=s.width,g=s.height,p=s.isAnimationActive,x=s.id;if(a||!l||!l.length)return null;var v=this.state.isAnimationFinished,b=l.length===1,w=Ze("recharts-line",c),j=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,N=j||S,k=Ge(x)?this.id:x,_=(r=ze(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},C=_.r,A=C===void 0?3:C,E=_.strokeWidth,P=E===void 0?2:E,$=yH(o)?o:{},R=$.clipDot,L=R===void 0?!0:R,D=A*2+P;return F.createElement(Tt,{className:w},j||S?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(k)},F.createElement("rect",{x:j?f:f-m/2,y:S?h:h-g/2,width:j?m:m*2,height:S?g:g*2})),!L&&F.createElement("clipPath",{id:"clipPath-dots-".concat(k)},F.createElement("rect",{x:f-D/2,y:h-D/2,width:m+D,height:g+D}))):null,!b&&this.renderCurve(N,k),this.renderErrorBar(N,k),(b||o)&&this.renderDots(N,L,k),(!p||v)&&ja.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:s.curPoints}:r.points!==s.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,s){for(var a=r.length%2!==0?[].concat(ou(r),[0]):r,o=[],l=0;l<s;++l)o=[].concat(ou(o),ou(a));return o}},{key:"renderDotItem",value:function(r,s){var a;if(F.isValidElement(r))a=F.cloneElement(r,s);else if(Ve(r))a=r(s);else{var o=Ze("recharts-line-dot",typeof r!="boolean"?r.className:"");a=F.createElement(yw,lm({},s,{className:o}))}return a}}]),t}(y.PureComponent);Us(th,"displayName","Line");Us(th,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Li.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Us(th,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,s=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,h=c.map(function(f,m){var g=cr(f,o);return d==="horizontal"?{x:ab({axis:n,ticks:s,bandSize:l,entry:f,index:m}),y:Ge(g)?null:r.scale(g),value:g,payload:f}:{x:Ge(g)?null:n.scale(g),y:ab({axis:r,ticks:a,bandSize:l,entry:f,index:m}),value:g,payload:f}});return Pr({points:h,layout:d},u)});var g3e=["layout","type","stroke","connectNulls","isRange","ref"],dq;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 y3e(e,t){if(e==null)return{};var n=x3e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function x3e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Ql(){return Ql=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},Ql.apply(this,arguments)}function E4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E4(Object(n),!0).forEach(function(r){Pi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A4(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,fq(r.key),r)}}function b3e(e,t,n){return t&&A4(e.prototype,t),n&&A4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function w3e(e,t,n){return t=Nb(t),j3e(e,hq()?Reflect.construct(t,n||[],Nb(e).constructor):t.apply(e,n))}function j3e(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 Rf(e)}function hq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hq=function(){return!!e})()}function Nb(e){return Nb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nb(e)}function Rf(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S3e(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&&U_(e,t)}function U_(e,t){return U_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},U_(e,t)}function Pi(e,t,n){return t=fq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fq(e){var t=N3e(e,"string");return nh(t)=="symbol"?t:String(t)}function N3e(e,t){if(nh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(nh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wl=function(e){S3e(t,e);function t(){var n;v3e(this,t);for(var r=arguments.length,s=new Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=w3e(this,t,[].concat(s)),Pi(Rf(n),"state",{isAnimationFinished:!0}),Pi(Rf(n),"id",Th("recharts-area-")),Pi(Rf(n),"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Ve(o)&&o()}),Pi(Rf(n),"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Ve(o)&&o()}),n}return b3e(t,[{key:"renderDots",value:function(r,s,a){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,h=c.dataKey,f=ze(this.props,!1),m=ze(u,!0),g=d.map(function(x,v){var b=oo(oo(oo({key:"dot-".concat(v),r:3},f),m),{},{index:v,cx:x.x,cy:x.y,dataKey:h,value:x.value,payload:x.payload,points:d});return t.renderDotItem(u,b)}),p={clipPath:r?"url(#clipPath-".concat(s?"":"dots-").concat(a,")"):null};return F.createElement(Tt,Ql({className:"recharts-area-dots"},p),g)}},{key:"renderHorizontalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=r*Math.abs(c-u),h=Io(o.map(function(f){return f.y||0}));return pe(a)&&typeof a=="number"?h=Math.max(a,h):a&&Array.isArray(a)&&a.length&&(h=Math.max(Io(a.map(function(f){return f.y||0})),h)),pe(h)?F.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(h+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var s=this.props,a=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=r*Math.abs(c-u),h=Io(o.map(function(f){return f.x||0}));return pe(a)&&typeof a=="number"?h=Math.max(a,h):a&&Array.isArray(a)&&a.length&&(h=Math.max(Io(a.map(function(f){return f.x||0})),h)),pe(h)?F.createElement("rect",{x:0,y:c<u?c:c-d,width:h+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(r){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,s,a,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,h=l.connectNulls,f=l.isRange;l.ref;var m=y3e(l,g3e);return F.createElement(Tt,{clipPath:a?"url(#clipPath-".concat(o,")"):null},F.createElement(rd,Ql({},ze(m,!0),{points:r,connectNulls:h,type:u,baseLine:s,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&F.createElement(rd,Ql({},ze(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:h,fill:"none",points:r})),d!=="none"&&f&&F.createElement(rd,Ql({},ze(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:h,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(r,s){var a=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,h=o.animationDuration,f=o.animationEasing,m=o.animationId,g=this.state,p=g.prevPoints,x=g.prevBaseLine;return F.createElement(Wi,{begin:d,duration:h,isActive:u,easing:f,from:{t:0},to:{t:1},key:"area-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var b=v.t;if(p){var w=p.length/l.length,j=l.map(function(_,C){var A=Math.floor(C*w);if(p[A]){var E=p[A],P=$n(E.x,_.x),$=$n(E.y,_.y);return oo(oo({},_),{},{x:P(b),y:$(b)})}return _}),S;if(pe(c)&&typeof c=="number"){var N=$n(x,c);S=N(b)}else if(Ge(c)||Ph(c)){var k=$n(x,0);S=k(b)}else S=c.map(function(_,C){var A=Math.floor(C*w);if(x[A]){var E=x[A],P=$n(E.x,_.x),$=$n(E.y,_.y);return oo(oo({},_),{},{x:P(b),y:$(b)})}return _});return a.renderAreaStatically(j,S,r,s)}return F.createElement(Tt,null,F.createElement("defs",null,F.createElement("clipPath",{id:"animationClipPath-".concat(s)},a.renderClipRect(b))),F.createElement(Tt,{clipPath:"url(#animationClipPath-".concat(s,")")},a.renderAreaStatically(l,c,r,s)))})}},{key:"renderArea",value:function(r,s){var a=this.props,o=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,d=u.prevPoints,h=u.prevBaseLine,f=u.totalLength;return c&&o&&o.length&&(!d&&f>0||!Gd(d,o)||!Gd(h,l))?this.renderAreaWithAnimation(r,s):this.renderAreaStatically(o,l,r,s)}},{key:"render",value:function(){var r,s=this.props,a=s.hide,o=s.dot,l=s.points,c=s.className,u=s.top,d=s.left,h=s.xAxis,f=s.yAxis,m=s.width,g=s.height,p=s.isAnimationActive,x=s.id;if(a||!l||!l.length)return null;var v=this.state.isAnimationFinished,b=l.length===1,w=Ze("recharts-area",c),j=h&&h.allowDataOverflow,S=f&&f.allowDataOverflow,N=j||S,k=Ge(x)?this.id:x,_=(r=ze(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},C=_.r,A=C===void 0?3:C,E=_.strokeWidth,P=E===void 0?2:E,$=yH(o)?o:{},R=$.clipDot,L=R===void 0?!0:R,D=A*2+P;return F.createElement(Tt,{className:w},j||S?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(k)},F.createElement("rect",{x:j?d:d-m/2,y:S?u:u-g/2,width:j?m:m*2,height:S?g:g*2})),!L&&F.createElement("clipPath",{id:"clipPath-dots-".concat(k)},F.createElement("rect",{x:d-D/2,y:u-D/2,width:m+D,height:g+D}))):null,b?null:this.renderArea(N,k),(o||b)&&this.renderDots(N,L,k),(!p||v)&&ja.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:r.points!==s.curPoints||r.baseLine!==s.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}]),t}(y.PureComponent);dq=wl;Pi(wl,"displayName","Area");Pi(wl,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Li.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Pi(wl,"getBaseValue",function(e,t,n,r){var s=e.layout,a=e.baseValue,o=t.props.baseValue,l=o??a;if(pe(l)&&typeof l=="number")return l;var c=s==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),h=Math.min(u[0],u[1]);return l==="dataMin"?h:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Pi(wl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,s=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,h=e.displayedData,f=e.offset,m=t.layout,g=u&&u.length,p=dq.getBaseValue(t,n,r,s),x=m==="horizontal",v=!1,b=h.map(function(j,S){var N;g?N=u[d+S]:(N=cr(j,c),Array.isArray(N)?v=!0:N=[p,N]);var k=N[1]==null||g&&cr(j,c)==null;return x?{x:ab({axis:r,ticks:a,bandSize:l,entry:j,index:S}),y:k?null:s.scale(N[1]),value:N,payload:j}:{x:k?null:r.scale(N[1]),y:ab({axis:s,ticks:o,bandSize:l,entry:j,index:S}),value:N,payload:j}}),w;return g||v?w=b.map(function(j){var S=Array.isArray(j.value)?j.value[0]:null;return x?{x:j.x,y:S!=null&&j.y!=null?s.scale(S):null}:{x:S!=null?r.scale(S):null,y:j.y}}):w=x?s.scale(p):r.scale(p),oo({points:b,baseLine:w,layout:m,isRange:v},f)});Pi(wl,"renderDotItem",function(e,t){var n;if(F.isValidElement(e))n=F.cloneElement(e,t);else if(Ve(e))n=e(t);else{var r=Ze("recharts-area-dot",typeof e!="boolean"?e.className:"");n=F.createElement(yw,Ql({},t,{className:r}))}return n});function V_(){return V_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V_.apply(this,arguments)}var Fa=function(t){var n=t.xAxisId,r=GA(),s=YA(),a=rq(n);return a==null?null:F.createElement(Fh,V_({},a,{className:Ze("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(l){return ma(l,!0)}}))};Fa.displayName="XAxis";Fa.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 W_(){return W_=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},W_.apply(this,arguments)}var Ba=function(t){var n=t.yAxisId,r=GA(),s=YA(),a=sq(n);return a==null?null:F.createElement(Fh,W_({},a,{className:Ze("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:s},ticksGenerator:function(l){return ma(l,!0)}}))};Ba.displayName="YAxis";Ba.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 P4(e){return E3e(e)||C3e(e)||_3e(e)||k3e()}function k3e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 924In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _3e(e,t){if(e){if(typeof e=="string")return H_(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 H_(e,t)}}function C3e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function E3e(e){if(Array.isArray(e))return H_(e)}function H_(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 q_=function(t,n,r,s,a){var o=Ns(t,XA),l=Ns(t,vg),c=[].concat(P4(o),P4(l)),u=Ns(t,bg),d="".concat(s,"Id"),h=s[0],f=n;if(c.length&&(f=c.reduce(function(p,x){if(x.props[d]===r&&Fi(x.props,"extendDomain")&&pe(x.props[h])){var v=x.props[h];return[Math.min(p[0],v),Math.max(p[1],v)]}return p},f)),u.length){var m="".concat(h,"1"),g="".concat(h,"2");f=u.reduce(function(p,x){if(x.props[d]===r&&Fi(x.props,"extendDomain")&&pe(x.props[m])&&pe(x.props[g])){var v=x.props[m],b=x.props[g];return[Math.min(p[0],v,b),Math.max(p[1],v,b)]}return p},f)}return a&&a.length&&(f=a.reduce(function(p,x){return pe(x)?[Math.min(p[0],x),Math.max(p[1],x)]:p},f)),f},mq={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,h,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new s(d,h||c,f),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],m]:c._events[g].push(m):(c._events[g]=m,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,h;if(this._eventsCount===0)return u;for(h in d=this._events)t.call(d,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var f=0,m=h.length,g=new Array(m);f<m;f++)g[f]=h[f].fn;return g},l.prototype.listenerCount=function(u){var d=n?n+u:u,h=this._events[d];return h?h.fn?1:h.length:0},l.prototype.emit=function(u,d,h,f,m,g){var p=n?n+u:u;if(!this._events[p])return!1;var x=this._events[p],v=arguments.length,b,w;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),v){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,d),!0;case 3:return x.fn.call(x.context,d,h),!0;case 4:return x.fn.call(x.context,d,h,f),!0;case 5:return x.fn.call(x.context,d,h,f,m),!0;case 6:return x.fn.call(x.context,d,h,f,m,g),!0}for(w=1,b=new Array(v-1);w<v;w++)b[w-1]=arguments[w];x.fn.apply(x.context,b)}else{var j=x.length,S;for(w=0;w<j;w++)switch(x[w].once&&this.removeListener(u,x[w].fn,void 0,!0),v){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,d);break;case 3:x[w].fn.call(x[w].context,d,h);break;case 4:x[w].fn.call(x[w].context,d,h,f);break;default:if(!b)for(S=1,b=new Array(v-1);S<v;S++)b[S-1]=arguments[S];x[w].fn.apply(x[w].context,b)}}return!0},l.prototype.on=function(u,d,h){return a(this,u,d,h,!1)},l.prototype.once=function(u,d,h){return a(this,u,d,h,!0)},l.prototype.removeListener=function(u,d,h,f){var m=n?n+u:u;if(!this._events[m])return this;if(!d)return o(this,m),this;var g=this._events[m];if(g.fn)g.fn===d&&(!f||g.once)&&(!h||g.context===h)&&o(this,m);else{for(var p=0,x=[],v=g.length;p<v;p++)(g[p].fn!==d||f&&!g[p].once||h&&g[p].context!==h)&&x.push(g[p]);x.length?this._events[m]=x.length===1?x[0]:x:o(this,m)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(mq);var A3e=mq.exports;const P3e=it(A3e);var k1=new P3e,_1="recharts.syncMouseEvents";function $p(e){"@babel/helpers - typeof";return $p=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},$p(e)}function T3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O3e(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,pq(r.key),r)}}function R3e(e,t,n){return t&&O3e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function C1(e,t,n){return t=pq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pq(e){var t=M3e(e,"string");return $p(t)=="symbol"?t:String(t)}function M3e(e,t){if($p(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($p(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var I3e=function(){function e(){T3e(this,e),C1(this,"activeIndex",0),C1(this,"coordinateList",[]),C1(this,"layout","horizontal")}return R3e(e,[{key:"setDetails",value:function(n){var r,s=n.coordinateList,a=s===void 0?null:s,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,h=d===void 0?null:d,f=n.mouseHandlerCallback,m=f===void 0?null:f;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=h??this.offset,this.mouseHandlerCallback=m??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 s=this.container.getBoundingClientRect(),a=s.x,o=s.y,l=s.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,h=a+c+u,f=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:h,pageY:f})}}}]),e}();function $3e(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],s=e==null?void 0:e[1];if(r&&s&&pe(r)&&pe(s))return!0}return!1}function L3e(e,t,n,r){var s=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-s,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function gq(e){var t=e.cx,n=e.cy,r=e.radius,s=e.startAngle,a=e.endAngle,o=Dn(t,n,r,s),l=Dn(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:s,endAngle:a}}function D3e(e,t,n){var r,s,a,o;if(e==="horizontal")r=t.x,a=r,s=n.top,o=n.top+n.height;else if(e==="vertical")s=t.y,o=s,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,h=t.angle,f=Dn(l,c,u,h),m=Dn(l,c,d,h);r=f.x,s=f.y,a=m.x,o=m.y}else return gq(t);return[{x:r,y:s},{x:a,y:o}]}function Lp(e){"@babel/helpers - typeof";return Lp=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},Lp(e)}function T4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Iy(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){F3e(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 F3e(e,t,n){return t=B3e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B3e(e){var t=z3e(e,"string");return Lp(t)=="symbol"?t:String(t)}function z3e(e,t){if(Lp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Lp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function U3e(e){var t=e.element,n=e.tooltipEventType,r=e.isActive,s=e.activeCoordinate,a=e.activePayload,o=e.offset,l=e.activeTooltipIndex,c=e.tooltipAxisBandSize,u=e.layout,d=e.chartName;if(!t||!t.props.cursor||!r||!s||d!=="ScatterChart"&&n!=="axis")return null;var h,f=rd;if(d==="ScatterChart")h=s,f=gLe;else if(d==="BarChart")h=L3e(u,s,o,c),f=VA;else if(u==="radial"){var m=gq(s),g=m.cx,p=m.cy,x=m.radius,v=m.startAngle,b=m.endAngle;h={cx:g,cy:p,startAngle:v,endAngle:b,innerRadius:x,outerRadius:x},f=E7}else h={points:D3e(u,s,o)},f=rd;var w=Iy(Iy(Iy(Iy({stroke:"#ccc",pointerEvents:"none"},o),h),ze(t.props.cursor,!1)),{},{payload:a,payloadIndex:l,className:Ze("recharts-tooltip-cursor",t.props.cursor.className)});return y.isValidElement(t.props.cursor)?y.cloneElement(t.props.cursor,w):y.createElement(f,w)}var V3e=["item"],W3e=["children","className","width","height","style","compact","title","desc"];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 cm(){return cm=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},cm.apply(this,arguments)}function O4(e,t){return K3e(e)||q3e(e,t)||xq(e,t)||H3e()}function H3e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 925In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q3e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,a,o,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function K3e(e){if(Array.isArray(e))return e}function R4(e,t){if(e==null)return{};var n=G3e(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function G3e(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,a;for(a=0;a<r.length;a++)s=r[a],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Y3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X3e(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,vq(r.key),r)}}function J3e(e,t,n){return t&&X3e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q3e(e,t,n){return t=kb(t),Z3e(e,yq()?Reflect.construct(t,n||[],kb(e).constructor):t.apply(e,n))}function Z3e(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 rt(e)}function yq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yq=function(){return!!e})()}function kb(e){return kb=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kb(e)}function rt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eFe(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&&K_(e,t)}function K_(e,t){return K_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},K_(e,t)}function sh(e){return rFe(e)||nFe(e)||xq(e)||tFe()}function tFe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 926In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xq(e,t){if(e){if(typeof e=="string")return G_(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 G_(e,t)}}function nFe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rFe(e){if(Array.isArray(e))return G_(e)}function G_(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 M4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ie(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){Oe(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 Oe(e,t,n){return t=vq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vq(e){var t=sFe(e,"string");return rh(t)=="symbol"?t:String(t)}function sFe(e,t){if(rh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(rh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iFe={xAxis:["bottom","top"],yAxis:["left","right"]},aFe={width:"100%",height:"100%"},bq={x:0,y:0};function $y(e){return e}var oFe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},lFe=function(t,n,r,s){var a=n.find(function(d){return d&&d.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:s.y};if(t==="vertical")return{x:s.x,y:a.coordinate};if(t==="centric"){var o=a.coordinate,l=s.radius;return ie(ie(ie({},s),Dn(s.cx,s.cy,l,o)),{},{angle:o,radius:l})}var c=a.coordinate,u=s.angle;return ie(ie(ie({},s),Dn(s.cx,s.cy,c,u)),{},{angle:u,radius:c})}return bq},ww=function(t,n){var r=n.graphicalItems,s=n.dataStartIndex,a=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(sh(l),sh(u)):l},[]);return o.length>0?o:t&&t.length&&pe(s)&&pe(a)?t.slice(s,a+1):[]};function wq(e){return e==="number"?[0,"auto"]:void 0}var Y_=function(t,n,r,s){var a=t.graphicalItems,o=t.tooltipAxis,l=ww(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var d,h=(d=u.props.data)!==null&&d!==void 0?d:n;h&&t.dataStartIndex+t.dataEndIndex!==0&&(h=h.slice(t.dataStartIndex,t.dataEndIndex+1));var f;if(o.dataKey&&!o.allowDuplicatedCategory){var m=h===void 0?l:h;f=Pv(m,o.dataKey,s)}else f=h&&h[r]||l[r];return f?[].concat(sh(c),[k7(u,f)]):c},[])},I4=function(t,n,r,s){var a=s||{x:t.chartX,y:t.chartY},o=oFe(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=lMe(o,l,u,c);if(d>=0&&u){var h=u[d]&&u[d].value,f=Y_(t,n,d,h),m=lFe(r,l,d,a);return{activeTooltipIndex:d,activeLabel:h,activePayload:f,activeCoordinate:m}}return null},cFe=function(t,n){var r=n.axes,s=n.graphicalItems,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,f=t.stackOffset,m=j7(d,a);return r.reduce(function(g,p){var x,v=p.props,b=v.type,w=v.dataKey,j=v.allowDataOverflow,S=v.allowDuplicatedCategory,N=v.scale,k=v.ticks,_=v.includeHidden,C=p.props[o];if(g[C])return g;var A=ww(t.data,{graphicalItems:s.filter(function(Y){return Y.props[o]===C}),dataStartIndex:c,dataEndIndex:u}),E=A.length,P,$,R;$3e(p.props.domain,j,b)&&(P=y_(p.props.domain,null,j),m&&(b==="number"||N!=="auto")&&(R=am(A,w,"category")));var L=wq(b);if(!P||P.length===0){var D,I=(D=p.props.domain)!==null&&D!==void 0?D:L;if(w){if(P=am(A,w,b),b==="category"&&m){var M=owe(P);S&&M?($=P,P=gb(0,E)):S||(P=hD(I,P,p).reduce(function(Y,O){return Y.indexOf(O)>=0?Y:[].concat(sh(Y),[O])},[]))}else if(b==="category")S?P=P.filter(function(Y){return Y!==""&&!Ge(Y)}):P=hD(I,P,p).reduce(function(Y,O){return Y.indexOf(O)>=0||O===""||Ge(O)?Y:[].concat(sh(Y),[O])},[]);else if(b==="number"){var H=fMe(A,s.filter(function(Y){return Y.props[o]===C&&(_||!Y.props.hide)}),w,a,d);H&&(P=H)}m&&(b==="number"||N!=="auto")&&(R=am(A,w,"category"))}else m?P=gb(0,E):l&&l[C]&&l[C].hasStack&&b==="number"?P=f==="expand"?[0,1]:N7(l[C].stackGroups,c,u):P=w7(A,s.filter(function(Y){return Y.props[o]===C&&(_||!Y.props.hide)}),b,d,!0);if(b==="number")P=q_(h,P,C,a,k),I&&(P=y_(I,P,j));else if(b==="category"&&I){var T=I,B=P.every(function(Y){return T.indexOf(Y)>=0});B&&(P=T)}}return ie(ie({},g),{},Oe({},C,ie(ie({},p.props),{},{axisType:a,domain:P,categoricalDomain:R,duplicateDomain:$,originalDomain:(x=p.props.domain)!==null&&x!==void 0?x:L,isCategorical:m,layout:d})))},{})},uFe=function(t,n){var r=n.graphicalItems,s=n.Axis,a=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,f=ww(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),m=f.length,g=j7(d,a),p=-1;return r.reduce(function(x,v){var b=v.props[o],w=wq("number");if(!x[b]){p++;var j;return g?j=gb(0,m):l&&l[b]&&l[b].hasStack?(j=N7(l[b].stackGroups,c,u),j=q_(h,j,b,a)):(j=y_(w,w7(f,r.filter(function(S){return S.props[o]===b&&!S.props.hide}),"number",d),s.defaultProps.allowDataOverflow),j=q_(h,j,b,a)),ie(ie({},x),{},Oe({},b,ie(ie({axisType:a},s.defaultProps),{},{hide:!0,orientation:Ss(iFe,"".concat(a,".").concat(p%2),null),domain:j,originalDomain:w,isCategorical:g,layout:d})))}return x},{})},dFe=function(t,n){var r=n.axisType,s=r===void 0?"xAxis":r,a=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,h="".concat(s,"Id"),f=Ns(d,a),m={};return f&&f.length?m=cFe(t,{axes:f,graphicalItems:o,axisType:s,axisIdKey:h,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(m=uFe(t,{Axis:a,graphicalItems:o,axisType:s,axisIdKey:h,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),m},hFe=function(t){var n=vo(t),r=ma(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:gA(r,function(s){return s.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ob(n,r)}},$4=function(t){var n=t.children,r=t.defaultShowTooltip,s=Lr(n,Jd),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(a=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},fFe=function(t){return!t||!t.length?!1:t.some(function(n){var r=va(n&&n.type);return r&&r.indexOf("Bar")>=0})},L4=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"}},mFe=function(t,n){var r=t.props,s=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,h=r.children,f=r.margin||{},m=Lr(h,Jd),g=Lr(h,ep),p=Object.keys(c).reduce(function(S,N){var k=c[N],_=k.orientation;return!k.mirror&&!k.hide?ie(ie({},S),{},Oe({},_,S[_]+k.width)):S},{left:f.left||0,right:f.right||0}),x=Object.keys(o).reduce(function(S,N){var k=o[N],_=k.orientation;return!k.mirror&&!k.hide?ie(ie({},S),{},Oe({},_,Ss(S,"".concat(_))+k.height)):S},{top:f.top||0,bottom:f.bottom||0}),v=ie(ie({},x),p),b=v.bottom;m&&(v.bottom+=m.props.height||Jd.defaultProps.height),g&&n&&(v=dMe(v,s,r,n));var w=u-v.left-v.right,j=d-v.top-v.bottom;return ie(ie({brushBottom:b},v),{},{width:Math.max(w,0),height:Math.max(j,0)})},pFe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},ZA=function(t){var n,r=t.chartName,s=t.GraphicalChild,a=t.defaultTooltipEventType,o=a===void 0?"axis":a,l=t.validateTooltipEventTypes,c=l===void 0?["axis"]:l,u=t.axisComponents,d=t.legendContent,h=t.formatAxisMap,f=t.defaultProps,m=function(x,v){var b=v.graphicalItems,w=v.stackGroups,j=v.offset,S=v.updateId,N=v.dataStartIndex,k=v.dataEndIndex,_=x.barSize,C=x.layout,A=x.barGap,E=x.barCategoryGap,P=x.maxBarSize,$=L4(C),R=$.numericAxisName,L=$.cateAxisName,D=fFe(b),I=[];return b.forEach(function(M,H){var T=ww(x.data,{graphicalItems:[M],dataStartIndex:N,dataEndIndex:k}),B=M.props,Y=B.dataKey,O=B.maxBarSize,W=M.props["".concat(R,"Id")],X=M.props["".concat(L,"Id")],J={},G=u.reduce(function(Tn,Ts){var kl=v["".concat(Ts.axisType,"Map")],Ji=M.props["".concat(Ts.axisType,"Id")];kl&&kl[Ji]||Ts.axisType==="zAxis"||Oc();var Uc=kl[Ji];return ie(ie({},Tn),{},Oe(Oe({},Ts.axisType,Uc),"".concat(Ts.axisType,"Ticks"),ma(Uc)))},J),ce=G[L],ee=G["".concat(L,"Ticks")],le=w&&w[W]&&w[W].hasStack&&kMe(M,w[W].stackGroups),he=va(M.type).indexOf("Bar")>=0,Q=ob(ce,ee),Re=[],Te=D&&cMe({barSize:_,stackGroups:w,totalSize:pFe(G,L)});if(he){var ot,Qe,zt=Ge(O)?P:O,Qn=(ot=(Qe=ob(ce,ee,!0))!==null&&Qe!==void 0?Qe:zt)!==null&&ot!==void 0?ot:0;Re=uMe({barGap:A,barCategoryGap:E,bandSize:Qn!==Q?Qn:Q,sizeList:Te[X],maxBarSize:zt}),Qn!==Q&&(Re=Re.map(function(Tn){return ie(ie({},Tn),{},{position:ie(ie({},Tn.position),{},{offset:Tn.position.offset-Qn/2})})}))}var Rt=M&&M.type&&M.type.getComposedData;Rt&&I.push({props:ie(ie({},Rt(ie(ie({},G),{},{displayedData:T,props:x,dataKey:Y,item:M,bandSize:Q,barPosition:Re,offset:j,stackedData:le,layout:C,dataStartIndex:N,dataEndIndex:k}))),{},Oe(Oe(Oe({key:M.key||"item-".concat(H)},R,G[R]),L,G[L]),"animationId",S)),childIndex:xwe(M,x.children),item:M})}),I},g=function(x,v){var b=x.props,w=x.dataStartIndex,j=x.dataEndIndex,S=x.updateId;if(!a$({props:b}))return null;var N=b.children,k=b.layout,_=b.stackOffset,C=b.data,A=b.reverseStackOrder,E=L4(k),P=E.numericAxisName,$=E.cateAxisName,R=Ns(N,s),L=jMe(C,R,"".concat(P,"Id"),"".concat($,"Id"),_,A),D=u.reduce(function(B,Y){var O="".concat(Y.axisType,"Map");return ie(ie({},B),{},Oe({},O,dFe(b,ie(ie({},Y),{},{graphicalItems:R,stackGroups:Y.axisType===P&&L,dataStartIndex:w,dataEndIndex:j}))))},{}),I=mFe(ie(ie({},D),{},{props:b,graphicalItems:R}),v==null?void 0:v.legendBBox);
926Object.keys(D).forEach(function(B){D[B]=h(b,D[B],I,B.replace("Map",""),r)});var M=D["".concat($,"Map")],H=hFe(M),T=m(b,ie(ie({},D),{},{dataStartIndex:w,dataEndIndex:j,updateId:S,graphicalItems:R,stackGroups:L,offset:I}));return ie(ie({formattedGraphicalItems:T,graphicalItems:R,offset:I,stackGroups:L},H),D)};return n=function(p){eFe(x,p);function x(v){var b,w,j;return Y3e(this,x),j=Q3e(this,x,[v]),Oe(rt(j),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Oe(rt(j),"accessibilityManager",new I3e),Oe(rt(j),"handleLegendBBoxUpdate",function(S){if(S){var N=j.state,k=N.dataStartIndex,_=N.dataEndIndex,C=N.updateId;j.setState(ie({legendBBox:S},g({props:j.props,dataStartIndex:k,dataEndIndex:_,updateId:C},ie(ie({},j.state),{},{legendBBox:S}))))}}),Oe(rt(j),"handleReceiveSyncEvent",function(S,N,k){if(j.props.syncId===S){if(k===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(N)}}),Oe(rt(j),"handleBrushChange",function(S){var N=S.startIndex,k=S.endIndex;if(N!==j.state.dataStartIndex||k!==j.state.dataEndIndex){var _=j.state.updateId;j.setState(function(){return ie({dataStartIndex:N,dataEndIndex:k},g({props:j.props,dataStartIndex:N,dataEndIndex:k,updateId:_},j.state))}),j.triggerSyncEvent({dataStartIndex:N,dataEndIndex:k})}}),Oe(rt(j),"handleMouseEnter",function(S){var N=j.getMouseInfo(S);if(N){var k=ie(ie({},N),{},{isTooltipActive:!0});j.setState(k),j.triggerSyncEvent(k);var _=j.props.onMouseEnter;Ve(_)&&_(k,S)}}),Oe(rt(j),"triggeredAfterMouseMove",function(S){var N=j.getMouseInfo(S),k=N?ie(ie({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(k),j.triggerSyncEvent(k);var _=j.props.onMouseMove;Ve(_)&&_(k,S)}),Oe(rt(j),"handleItemMouseEnter",function(S){j.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),Oe(rt(j),"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),Oe(rt(j),"handleMouseMove",function(S){S.persist(),j.throttleTriggeredAfterMouseMove(S)}),Oe(rt(j),"handleMouseLeave",function(S){j.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var k=j.props.onMouseLeave;Ve(k)&&k(N,S)}),Oe(rt(j),"handleOuterEvent",function(S){var N=ywe(S),k=Ss(j.props,"".concat(N));if(N&&Ve(k)){var _,C;/.*touch.*/i.test(N)?C=j.getMouseInfo(S.changedTouches[0]):C=j.getMouseInfo(S),k((_=C)!==null&&_!==void 0?_:{},S)}}),Oe(rt(j),"handleClick",function(S){var N=j.getMouseInfo(S);if(N){var k=ie(ie({},N),{},{isTooltipActive:!0});j.setState(k),j.triggerSyncEvent(k);var _=j.props.onClick;Ve(_)&&_(k,S)}}),Oe(rt(j),"handleMouseDown",function(S){var N=j.props.onMouseDown;if(Ve(N)){var k=j.getMouseInfo(S);N(k,S)}}),Oe(rt(j),"handleMouseUp",function(S){var N=j.props.onMouseUp;if(Ve(N)){var k=j.getMouseInfo(S);N(k,S)}}),Oe(rt(j),"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),Oe(rt(j),"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.handleMouseDown(S.changedTouches[0])}),Oe(rt(j),"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&j.handleMouseUp(S.changedTouches[0])}),Oe(rt(j),"triggerSyncEvent",function(S){j.props.syncId!==void 0&&k1.emit
vendor: 15,405 bytes, line 926
926(_1,j.props.syncId,S,j.eventEmitterSymbol)}),Oe(rt(j),"applySyncEvent",function(S){var N=j.props,k=N.layout,_=N.syncMethod,C=j.state.updateId,A=S.dataStartIndex,E=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)j.setState(ie({dataStartIndex:A,dataEndIndex:E},g({props:j.props,dataStartIndex:A,dataEndIndex:E,updateId:C},j.state)));else if(S.activeTooltipIndex!==void 0){var P=S.chartX,$=S.chartY,R=S.activeTooltipIndex,L=j.state,D=L.offset,I=L.tooltipTicks;if(!D)return;if(typeof _=="function")R=_(I,S);else if(_==="value"){R=-1;for(var M=0;M<I.length;M++)if(I[M].value===S.activeLabel){R=M;break}}var H=ie(ie({},D),{},{x:D.left,y:D.top}),T=Math.min(P,H.x+H.width),B=Math.min($,H.y+H.height),Y=I[R]&&I[R].value,O=Y_(j.state,j.props.data,R),W=I[R]?{x:k==="horizontal"?I[R].coordinate:T,y:k==="horizontal"?B:I[R].coordinate}:bq;j.setState(ie(ie({},S),{},{activeLabel:Y,activeCoordinate:W,activePayload:O,activeTooltipIndex:R}))}else j.setState(S)}),Oe(rt(j),"renderCursor",function(S){var N,k=j.state,_=k.isTooltipActive,C=k.activeCoordinate,A=k.activePayload,E=k.offset,P=k.activeTooltipIndex,$=k.tooltipAxisBandSize,R=j.getTooltipEventType(),L=(N=S.props.active)!==null&&N!==void 0?N:_,D=j.props.layout,I=S.key||"_recharts-cursor";return F.createElement(U3e,{key:I,activeCoordinate:C,activePayload:A,activeTooltipIndex:P,chartName:r,element:S,isActive:L,layout:D,offset:E,tooltipAxisBandSize:$,tooltipEventType:R})}),Oe(rt(j),"renderPolarAxis",function(S,N,k){var _=Ss(S,"type.axisType"),C=Ss(j.state,"".concat(_,"Map")),A=C&&C[S.props["".concat(_,"Id")]];return y.cloneElement(S,ie(ie({},A),{},{className:Ze(_,A.className),key:S.key||"".concat(N,"-").concat(k),ticks:ma(A,!0)}))}),Oe(rt(j),"renderPolarGrid",function(S){var N=S.props,k=N.radialLines,_=N.polarAngles,C=N.polarRadius,A=j.state,E=A.radiusAxisMap,P=A.angleAxisMap,$=vo(E),R=vo(P),L=R.cx,D=R.cy,I=R.innerRadius,M=R.outerRadius;return y.cloneElement(S,{polarAngles:Array.isArray(_)?_:ma(R,!0).map(function(H){return H.coordinate}),polarRadius:Array.isArray(C)?C:ma($,!0).map(function(H){return H.coordinate}),cx:L,cy:D,innerRadius:I,outerRadius:M,key:S.key||"polar-grid",radialLines:k})}),Oe(rt(j),"renderLegend",function(){var S=j.state.formattedGraphicalItems,N=j.props,k=N.children,_=N.width,C=N.height,A=j.props.margin||{},E=_-(A.left||0)-(A.right||0),P=v7({children:k,formattedGraphicalItems:S,legendWidth:E,legendContent:d});if(!P)return null;var $=P.item,R=R4(P,V3e);return y.cloneElement($,ie(ie({},R),{},{chartWidth:_,chartHeight:C,margin:A,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),Oe(rt(j),"renderTooltip",function(){var S,N=j.props,k=N.children,_=N.accessibilityLayer,C=Lr(k,Dr);if(!C)return null;var A=j.state,E=A.isTooltipActive,P=A.activeCoordinate,$=A.activePayload,R=A.activeLabel,L=A.offset,D=(S=C.props.active)!==null&&S!==void 0?S:E;return y.cloneElement(C,{viewBox:ie(ie({},L),{},{x:L.left,y:L.top}),active:D,label:R,payload:D?$:[],coordinate:P,accessibilityLayer:_})}),Oe(rt(j),"renderBrush",function(S){var N=j.props,k=N.margin,_=N.data,C=j.state,A=C.offset,E=C.dataStartIndex,P=C.dataEndIndex,$=C.updateId;return y.cloneElement(S,{key:S.key||"_recharts-brush",onChange:Ty(j.handleBrushChange,S.props.onChange),data:_,x:pe(S.props.x)?S.props.x:A.left,y:pe(S.props.y)?S.props.y:A.top+A.height+A.brushBottom-(k.bottom||0),width:pe(S.props.width)?S.props.width:A.width,startIndex:E,endIndex:P,updateId:"brush-".concat($)})}),Oe(rt(j),"renderReferenceElement",function(S,N,k){if(!S)return null;var _=rt(j),C=_.clipPathId,A=j.state,E=A.xAxisMap,P=A.yAxisMap,$=A.offset,R=S.props,L=R.xAxisId,D=R.yAxisId;return y.cloneElement(S,{key:S.key||"".concat(N,"-").concat(k),xAxis:E[L],yAxis:P[D],viewBox:{x:$.left,y:$.top,width:$.width,height:$.height},clipPathId:C})}),Oe(rt(j),"renderActivePoints",function(S){var N=S.item,k=S.activePoint,_=S.basePoint,C=S.childIndex,A=S.isRange,E=[],P=N.props.key,$=N.item.props,R=$.activeDot,L=$.dataKey,D=ie(ie({index:C,dataKey:L,cx:k.x,cy:k.y,r:4,fill:UA(N.item),strokeWidth:2,stroke:"#fff",payload:k.payload,value:k.value,key:"".concat(P,"-activePoint-").concat(C)},ze(R,!1)),Tv(R));return E.push(x.renderActiveDot(R,D)),_?E.push(x.renderActiveDot(R,ie(ie({},D),{},{cx:_.x,cy:_.y,key:"".concat(P,"-basePoint-").concat(C)}))):A&&E.push(null),E}),Oe(rt(j),"renderGraphicChild",function(S,N,k){var _=j.filterFormatItem(S,N,k);if(!_)return null;var C=j.getTooltipEventType(),A=j.state,E=A.isTooltipActive,P=A.tooltipAxis,$=A.activeTooltipIndex,R=A.activeLabel,L=j.props.children,D=Lr(L,Dr),I=_.props,M=I.points,H=I.isRange,T=I.baseLine,B=_.item.props,Y=B.activeDot,O=B.hide,W=B.activeBar,X=B.activeShape,J=!!(!O&&E&&D&&(Y||W||X)),G={};C!=="axis"&&D&&D.props.trigger==="click"?G={onClick:Ty(j.handleItemMouseEnter,S.props.onClick)}:C!=="axis"&&(G={onMouseLeave:Ty(j.handleItemMouseLeave,S.props.onMouseLeave),onMouseEnter:Ty(j.handleItemMouseEnter,S.props.onMouseEnter)});var ce=y.cloneElement(S,ie(ie({},_.props),G));function ee(Ts){return typeof P.dataKey=="function"?P.dataKey(Ts.payload):null}if(J)if($>=0){var le,he;if(P.dataKey&&!P.allowDuplicatedCategory){var Q=typeof P.dataKey=="function"?ee:"payload.".concat(P.dataKey.toString());le=Pv(M,Q,R),he=H&&T&&Pv(T,Q,R)}else le=M==null?void 0:M[$],he=H&&T&&T[$];if(X||W){var Re=S.props.activeIndex!==void 0?S.props.activeIndex:$;return[y.cloneElement(S,ie(ie(ie({},_.props),G),{},{activeIndex:Re})),null,null]}if(!Ge(le))return[ce].concat(sh(j.renderActivePoints({item:_,activePoint:le,basePoint:he,childIndex:$,isRange:H})))}else{var Te,ot=(Te=j.getItemByXY(j.state.activeCoordinate))!==null&&Te!==void 0?Te:{graphicalItem:ce},Qe=ot.graphicalItem,zt=Qe.item,Qn=zt===void 0?S:zt,Rt=Qe.childIndex,Tn=ie(ie(ie({},_.props),G),{},{activeIndex:Rt});return[y.cloneElement(Qn,Tn),null,null]}return H?[ce,null,null]:[ce,null]}),Oe(rt(j),"renderCustomized",function(S,N,k){return y.cloneElement(S,ie(ie({key:"recharts-customized-".concat(k)},j.props),j.state))}),Oe(rt(j),"renderMap",{CartesianGrid:{handler:$y,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:$y},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:$y},YAxis:{handler:$y},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((b=v.id)!==null&&b!==void 0?b:Th("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=w9(j.triggeredAfterMouseMove,(w=v.throttleDelay)!==null&&w!==void 0?w:1e3/60),j.state={},j}return J3e(x,[{key:"componentDidMount",value:function(){var b,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,w=b.children,j=b.data,S=b.height,N=b.layout,k=Lr(w,Dr);if(k){var _=k.props.defaultIndex;if(!(typeof _!="number"||_<0||_>this.state.tooltipTicks.length)){var C=this.state.tooltipTicks[_]&&this.state.tooltipTicks[_].value,A=Y_(this.state,j,_,C),E=this.state.tooltipTicks[_].coordinate,P=(this.state.offset.top+S)/2,$=N==="horizontal",R=$?{x:E,y:P}:{y:E,x:P},L=this.state.formattedGraphicalItems.find(function(I){var M=I.item;return M.type.name==="Scatter"});L&&(R=ie(ie({},R),L.props.points[_].tooltipPosition),A=L.props.points[_].tooltipPayload);var D={activeTooltipIndex:_,isTooltipActive:!0,activeLabel:C,activePayload:A,activeCoordinate:R};this.setState(D),this.renderCursor(k),this.accessibilityManager.setIndex(_)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var j,S;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(b){Ok([Lr(b.children,Dr)],[Lr(this.props.children,Dr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Lr(this.props.children,Dr);if(b&&typeof b.props.shared=="boolean"){var w=b.props.shared?"axis":"item";return c.indexOf(w)>=0?w:o}return o}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var w=this.container,j=w.getBoundingClientRect(),S=UAe(j),N={chartX:Math.round(b.pageX-S.left),chartY:Math.round(b.pageY-S.top)},k=j.width/w.offsetWidth||1,_=this.inRange(N.chartX,N.chartY,k);if(!_)return null;var C=this.state,A=C.xAxisMap,E=C.yAxisMap,P=this.getTooltipEventType();if(P!=="axis"&&A&&E){var $=vo(A).scale,R=vo(E).scale,L=$&&$.invert?$.invert(N.chartX):null,D=R&&R.invert?R.invert(N.chartY):null;return ie(ie({},N),{},{xValue:L,yValue:D})}var I=I4(this.state,this.props.data,this.props.layout,_);return I?ie(ie({},N),I):null}},{key:"inRange",value:function(b,w){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,N=b/j,k=w/j;if(S==="horizontal"||S==="vertical"){var _=this.state.offset,C=N>=_.left&&N<=_.left+_.width&&k>=_.top&&k<=_.top+_.height;return C?{x:N,y:k}:null}var A=this.state,E=A.angleAxisMap,P=A.radiusAxisMap;if(E&&P){var $=vo(E);return pD({x:N,y:k},$)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,w=this.getTooltipEventType(),j=Lr(b,Dr),S={};j&&w==="axis"&&(j.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var N=Tv(this.props,this.handleOuterEvent);return ie(ie({},N),S)}},{key:"addListener",value:function(){k1.on(_1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){k1.removeListener(_1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,w,j){for(var S=this.state.formattedGraphicalItems,N=0,k=S.length;N<k;N++){var _=S[N];if(_.item===b||_.props.key===b.key||w===va(_.item.type)&&j===_.childIndex)return _}return null}},{key:"renderClipPath",value:function(){var b=this.clipPathId,w=this.state.offset,j=w.left,S=w.top,N=w.height,k=w.width;return F.createElement("defs",null,F.createElement("clipPath",{id:b},F.createElement("rect",{x:j,y:S,height:N,width:k})))}},{key:"getXScales",value:function(){var b=this.state.xAxisMap;return b?Object.entries(b).reduce(function(w,j){var S=O4(j,2),N=S[0],k=S[1];return ie(ie({},w),{},Oe({},N,k.scale))},{}):null}},{key:"getYScales",value:function(){var b=this.state.yAxisMap;return b?Object.entries(b).reduce(function(w,j){var S=O4(j,2),N=S[0],k=S[1];return ie(ie({},w),{},Oe({},N,k.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(b){var w;return(w=this.state.xAxisMap)===null||w===void 0||(w=w[b])===null||w===void 0?void 0:w.scale}},{key:"getYScaleByAxisId",value:function(b){var w;return(w=this.state.yAxisMap)===null||w===void 0||(w=w[b])===null||w===void 0?void 0:w.scale}},{key:"getItemByXY",value:function(b){var w=this.state,j=w.formattedGraphicalItems,S=w.activeItem;if(j&&j.length)for(var N=0,k=j.length;N<k;N++){var _=j[N],C=_.props,A=_.item,E=va(A.type);if(E==="Bar"){var P=(C.data||[]).find(function(D){return aLe(b,D)});if(P)return{graphicalItem:_,payload:P}}else if(E==="RadialBar"){var $=(C.data||[]).find(function(D){return pD(b,D)});if($)return{graphicalItem:_,payload:$}}else if(xw(_,S)||vw(_,S)||Cp(_,S)){var R=cDe({graphicalItem:_,activeTooltipItem:S,itemData:A.props.data}),L=A.props.activeIndex===void 0?R:A.props.activeIndex;return{graphicalItem:ie(ie({},_),{},{childIndex:L}),payload:Cp(_,S)?A.props.data[R]:_.props.data[R]}}}return null}},{key:"render",value:function(){var b=this;if(!a$(this))return null;var w=this.props,j=w.children,S=w.className,N=w.width,k=w.height,_=w.style,C=w.compact,A=w.title,E=w.desc,P=R4(w,W3e),$=ze(P,!1);if(C)return F.createElement(f4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},F.createElement(Mk,cm({},$,{width:N,height:k,title:A,desc:E}),this.renderClipPath(),l$(j,this.renderMap)));if(this.props.accessibilityLayer){var R,L;$.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,$.role=(L=this.props.role)!==null&&L!==void 0?L:"application",$.onKeyDown=function(I){b.accessibilityManager.keyboardEvent(I)},$.onFocus=function(){b.accessibilityManager.focus()}}var D=this.parseEventsOfWrapper();return F.createElement(f4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},F.createElement("div",cm({className:Ze("recharts-wrapper",S),style:ie({position:"relative",cursor:"default",width:N,height:k},_)},D,{ref:function(M){b.container=M}}),F.createElement(Mk,cm({},$,{width:N,height:k,title:A,desc:E,style:aFe}),this.renderClipPath(),l$(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}]),x}(y.Component),Oe(n,"displayName",r),Oe(n,"defaultProps",ie({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Oe(n,"getDerivedStateFromProps",function(p,x){var v=p.dataKey,b=p.data,w=p.children,j=p.width,S=p.height,N=p.layout,k=p.stackOffset,_=p.margin,C=x.dataStartIndex,A=x.dataEndIndex;if(x.updateId===void 0){var E=$4(p);return ie(ie(ie({},E),{},{updateId:0},g(ie(ie({props:p},E),{},{updateId:0}),x)),{},{prevDataKey:v,prevData:b,prevWidth:j,prevHeight:S,prevLayout:N,prevStackOffset:k,prevMargin:_,prevChildren:w})}if(v!==x.prevDataKey||b!==x.prevData||j!==x.prevWidth||S!==x.prevHeight||N!==x.prevLayout||k!==x.prevStackOffset||!ed(_,x.prevMargin)){var P=$4(p),$={chartX:x.chartX,chartY:x.chartY,isTooltipActive:x.isTooltipActive},R=ie(ie({},I4(x,b,N)),{},{updateId:x.updateId+1}),L=ie(ie(ie({},P),$),R);return ie(ie(ie({},L),g(ie({props:p},L),x)),{},{prevDataKey:v,prevData:b,prevWidth:j,prevHeight:S,prevLayout:N,prevStackOffset:k,prevMargin:_,prevChildren:w})}if(!Ok(w,x.prevChildren)){var D,I,M,H,T=Lr(w,Jd),B=T&&(D=(I=T.props)===null||I===void 0?void 0:I.startIndex)!==null&&D!==void 0?D:C,Y=T&&(M=(H=T.props)===null||H===void 0?void 0:H.endIndex)!==null&&M!==void 0?M:A,O=B!==C||Y!==A,W=!Ge(b),X=W&&!O?x.updateId:x.updateId+1;return ie(ie({updateId:X},g(ie(ie({props:p},x),{},{updateId:X,dataStartIndex:B,dataEndIndex:Y}),x)),{},{prevChildren:w,dataStartIndex:B,dataEndIndex:Y})}return null}),Oe(n,"renderActiveDot",function(p,x){var v;return y.isValidElement(p)?v=y.cloneElement(p,x):Ve(p)?v=p(x):v=F.createElement(yw,x),F.createElement(Tt,{className:"recharts-active-dot",key:x.key},v)}),n}
926,gFe=ZA({chartName:"LineChart",GraphicalChild:th,axisComponents:[{axisType:"xAxis",AxisComp:Fa},{axisType:"yAxis",AxisComp:Ba}],formatAxisMap:WA}),jq=ZA({chartName:"BarChart",GraphicalChild:bl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Fa},{axisType:"yAxis",AxisComp:Ba}],formatAxisMap:WA}),yFe=ZA({chartName:"AreaChart",GraphicalChild:wl,axisComponents:[{axisType:"xAxis",AxisComp:Fa},{axisType:"yAxis",AxisComp:Ba}],formatAxisMap:WA});const xFe={broiler:{name:"Broiler (Meat Production)",primaryMetrics:["Weight Gain","Feed Conversion","Market Weight"],feedTypes:["Starter","Grower","Finisher"],marketReadyWeeks:6,avgDailyFeedPerBird:{1:15,2:25,3:45,4:70,5:95,6:120,7:140,8:160},growthTargets:{1:.15,2:.4,3:.7,4:1.1,5:1.6,6:2.2,7:2.8,8:3.5},keyHealthIndicators:["Growth Rate","Feed Conversion","Leg Health","Respiratory Health"],marketConsiderations:["Live Weight","Meat Quality","Processing Readiness"],optimalTemperature:{min:18,max:24},optimalHumidity:{min:50,max:70}},layer:{name:"Layer (Egg Production)",primaryMetrics:["Egg Production Rate","Egg Quality","Feed per Dozen"],feedTypes:["Starter","Grower","Layer"],marketReadyWeeks:18,avgDailyFeedPerBird:{1:12,2:20,3:35,4:50,5:65,6:80,18:110,19:115,20:120,24:125},growthTargets:{1:.08,2:.18,3:.35,4:.55,5:.8,6:1.1,18:1.5,20:1.6,24:1.7},keyHealthIndicators:["Laying Rate","Egg Shell Quality","Feather Condition","Reproductive Health"],marketConsiderations:["Daily Egg Production","Egg Size","Shell Quality","Laying Cycle"],optimalTemperature:{min:16,max:22},optimalHumidity:{min:60,max:75}},mixed:{name:"Mixed Flock (Dual Purpose)",primaryMetrics:["Overall Health","Feed Efficiency","Production Balance"],feedTypes:["Starter","Grower","All-Purpose"],marketReadyWeeks:12,avgDailyFeedPerBird:{1:13,2:22,3:40,4:60,5:80,6:100,12:115,18:120,20:125},growthTargets:{1:.12,2:.3,3:.55,4:.85,5:1.2,6:1.6,12:1.8,18:1.9,20:2},keyHealthIndicators:["General Health","Growth Consistency","Behavioral Patterns","Adaptability"],marketConsiderations:["Flexible Market Options","Seasonal Production","Value Optimization"],optimalTemperature:{min:17,max:23},optimalHumidity:{min:55,max:72}}},wg=e=>xFe[e],vFe=(e,t,n)=>{const r=wg(e);return(r.avgDailyFeedPerBird[t]||r.avgDailyFeedPerBird[Math.max(...Object.keys(r.avgDailyFeedPerBird).map(Number))])*n/1e3},Ly=(e,t)=>wg(e).growthTargets[t]||0;function Sq(){const{toast:e}=We(),[t,n]=y.useState([]),[r,s]=y.useState({date:new Date().toISOString().split("T")[0],week:0,averageWeight:0,sampleSize:0,notes:"",birdType:"broiler"}),[a,o]=y.useState("broiler"),l=()=>{if(!r.week||!r.averageWeight||!r.sampleSize){e({title:"Missing Information",description:"Please fill in all required fields",variant:"destructive"});return}const v={id:Date.now().toString(),date:r.date,week:r.week,averageWeight:r.averageWeight,sampleSize:r.sampleSize,notes:r.notes||"",birdType:r.birdType};n([...t,v].sort((b,w)=>b.week-w.week)),s({date:new Date().toISOString().split("T")[0],week:0,averageWeight:0,sampleSize:0,notes:"",birdType:"broiler"}),e({title:"Weight Record Added",description:`Week ${v.week} average weight: ${v.averageWeight}kg`})},c=t.filter(v=>v.birdType===a),u=c.map(v=>{const b=Ly(a,v.week);return{week:v.week,actual:v.averageWeight,target:b||0,variance:v.averageWeight-(b||0)}}),d=()=>Math.max(...c.map(b=>b.week),0)+1,h=(v,b)=>{const w=(v-b)/b*100;return w>=10?{status:"excellent",color:"text-green-600",label:"Excellent"}:w>=0?{status:"good",color:"text-green-500",label:"On Target"}:w>=-10?{status:"fair",color:"text-yellow-500",label:"Below Target"}:{status:"poor",color:"text-red-500",label:"Poor"}},f=()=>{if(c.length<2)return 0;const v=[...c].sort((j,S)=>j.week-S.week),b=v[v.length-1].averageWeight-v[0].averageWeight,w=v[v.length-1].week-v[0].week;return w>0?b/w:0},m=()=>{var S;const v=a==="broiler"?7:20,b=d()-1,w=f(),j=((S=c[c.length-1])==null?void 0:S.averageWeight)||0;return b>=v?j:j+w*(v-b)},g=()=>{if(c.length===0)return null;const v=c[c.length-1],b=Ly(a,v.week);return b?h(v.averageWeight,b):null},p=c.map(v=>{const b=Ly(a,v.week),w=b?(v.averageWeight-b)/b*100:0;return{week:v.week,variance:Math.round(w*10)/10}}),x=g();return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx(wE,{className:"h-6 w-6 mx-auto mb-2 text-primary"}),i.jsx("div",{className:"text-2xl font-bold",children:c.length>0?`${c[c.length-1].averageWeight}kg`:"N/A"}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Current Weight"})]})}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx(Wt,{className:"h-6 w-6 mx-auto mb-2 text-primary"}),i.jsxs("div",{className:"text-2xl font-bold",children:[Math.round(f()*1e3),"g"]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Weekly Gain"})]})}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx(Gb,{className:"h-6 w-6 mx-auto mb-2 text-primary"}),i.jsx("div",{className:`text-2xl font-bold ${(x==null?void 0:x.color)||"text-gray-500"}`,children:(x==null?void 0:x.label)||"N/A"}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Performance"})]})}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx(ys,{className:"h-6 w-6 mx-auto mb-2 text-primary"}),i.jsxs("div",{className:"text-2xl font-bold",children:[Math.round(m()*10)/10,"kg"]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Projected Weight"})]})})]}),i.jsx(z,{className:"glass-card",children:i.jsx(re,{children:i.jsxs(se,{className:"flex items-center justify-between",children:["Growth Tracking",i.jsxs(Ye,{value:a,onValueChange:v=>o(v),children:[i.jsx(He,{className:"w-40",children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"broiler",children:"Broilers (Meat)"}),i.jsx(oe,{value:"layer",children:"Layers (Eggs)"}),i.jsx(oe,{value:"mixed",children:"Mixed (Dual Purpose)"})]})]})]})})}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Weight vs Target"})}),i.jsx(V,{children:i.jsx("div",{className:"h-80",children:i.jsx(Hv,{width:"100%",height:"100%",children:i.jsxs(gFe,{data:u,children:[i.jsx(Ip,{strokeDasharray:"3 3"}),i.jsx(Fa,{dataKey:"week",label:{value:"Week",position:"insideBottom",offset:-5}}),i.jsx(Ba,{label:{value:"Weight (kg)",angle:-90,position:"insideLeft"}}),i.jsx(Dr,{formatter:(v,b)=>[`${v}kg`,b==="actual"?"Actual Weight":"Target Weight"]}),i.jsx(th,{type:"monotone",dataKey:"target",stroke:"#94a3b8",strokeDasharray:"5 5",name:"target"}),i.jsx(th,{type:"monotone",dataKey:"actual",stroke:"#f97316",strokeWidth:3,name:"actual"})]})})})})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Performance vs Target (%)"})}),i.jsx(V,{children:i.jsx("div",{className:"h-64",children:i.jsx(Hv,{width:"100%",height:"100%",children:i.jsxs(jq,{data:p,children:[i.jsx(Ip,{strokeDasharray:"3 3"}),i.jsx(Fa,{dataKey:"week",label:{value:"Week",position:"insideBottom",offset:-5}}),i.jsx(Ba,{label:{value:"Variance (%)",angle:-90,position:"insideLeft"}}),i.jsx(Dr,{formatter:v=>[`${v}%`,"Variance from Target"]}),i.jsx(bl,{dataKey:"variance",fill:"#f97316",radius:[4,4,0,0]})]})})})})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Add Weight Record"})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"week",children:"Week Number"}),i.jsx(ae,{id:"week",type:"number",value:r.week||"",onChange:v=>s({...r,week:parseInt(v.target.value)||0}),placeholder:`Week ${d()}`})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"averageWeight",children:"Average Weight (kg)"}),i.jsx(ae,{id:"averageWeight",type:"number",step:"0.01",value:r.averageWeight||"",onChange:v=>s({...r,averageWeight:parseFloat(v.target.value)||0})})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"sampleSize",children:"Sample Size"}),i.jsx(ae,{id:"sampleSize",type:"number",value:r.sampleSize||"",onChange:v=>s({...r,sampleSize:parseInt(v.target.value)||0}),placeholder:"Number of birds weighed"})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"birdTypeRecord",children:"Bird Type"}),i.jsxs(Ye,{value:r.birdType,onValueChange:v=>s({...r,birdType:v}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"broiler",children:"Broiler (Meat)"}),i.jsx(oe,{value:"layer",children:"Layer (Eggs)"}),i.jsx(oe,{value:"mixed",children:"Mixed (Dual Purpose)"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"date",children:"Date"}),i.jsx(ae,{id:"date",type:"date",value:r.date,onChange:v=>s({...r,date:v.target.value})})]})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"notes",children:"Notes (optional)"}),i.jsx(ae,{id:"notes",value:r.notes,onChange:v=>s({...r,notes:v.target.value}),placeholder:"Any observations..."})]}),i.jsxs(U,{onClick:l,className:"w-full",children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Add Weight Record"]})]})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Recent Weight Records"})}),i.jsx(V,{children:i.jsx("div",{className:"space-y-3",children:c.slice(-5).reverse().map(v=>{const b=Ly(a,v.week),w=b?h(v.averageWeight,b):null;return i.jsxs("div",{className:"flex justify-between items-center p-4 bg-muted/50 rounded-lg",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"font-semibold",children:["Week ",v.week]}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:[v.date," ⢠Sample: ",v.sampleSize," birds"]}),v.notes&&i.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:v.notes})]}),i.jsxs("div",{className:"text-right",children:[i.jsxs("div",{className:"font-bold text-lg",children:[v.averageWeight,"kg"]}),b&&i.jsxs("div",{className:"text-sm text-muted-foreground",children:["Target: ",b,"kg"]}),w&&i.jsx(ye,{variant:"secondary",className:w.color,children:w.label})]})]},v.id)})})})]})]})}function bFe(){const{t:e}=Gi(),{toast:t}=We(),[n,r]=y.useState(100),[s,a]=y.useState(4),[o,l]=y.useState("broiler"),[c,u]=y.useState(0),[d,h]=y.useState(45),[f,m]=y.useState(0),g=wg(o),p=g.avgDailyFeedPerBird[s]||g.avgDailyFeedPerBird[Math.max(...Object.keys(g.avgDailyFeedPerBird).map(Number))],x=p*n/1e3,v=x*7,b=c>0?Math.floor(c/x):0,w=b<=3&&b>0,j=()=>{const k=g.feedTypes;return o==="broiler"?s<=3?k[0]:s<=5?k[1]:k[2]:o==="layer"?s<=6?k[0]:s<=18?k[1]:k[2]:s<=4?k[0]:s<=12?k[1]:k[2]},S=()=>
926{if(f<=0){t({title:"Invalid Amount",description:"Please enter a valid stock amount",variant:"destructive"});return}u(c+f),m(0),t({title:"Stock Added",description:`Added ${f}kg to feed stock`})},N=()=>{if(c<x){t({title:"Insufficient Stock",description:"Not enough feed stock for today's consumption",variant:"destructive"});return}u(Math.max(0,c-x)),t({title:"Consumption Recorded",description:`${x.toFixed(1)}kg consumed today`})};return i.jsxs("div",{className:"space-y-6 max-w-4xl mx-auto",children:[i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(cB,{className:"h-5 w-5"}),"Feed Calculator"]})}),i.jsxs(V,{className:"space-y-4",children:[i.jsx("div",{className:"flex justify-end",children:i.jsx(M2,{label:e("feedCalc.listen"),text:()=>e("feedCalc.summary",{size:n,age:s,daily:x.toFixed(1),weekly:v.toFixed(1),feedType:j(),stock:c,days:b})})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"flockSize",children:"Flock Size"}),i.jsx(ae,{id:"flockSize",type:"number",value:n||"",onChange:k=>r(parseInt(k.target.value)||0),min:"1"})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"flockAge",children:"Age (weeks)"}),i.jsx(ae,{id:"flockAge",type:"number",value:s||"",onChange:k=>a(parseInt(k.target.value)||0),min:"1"})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"birdType",children:"Bird Type"}),i.jsxs(Ye,{value:o,onValueChange:k=>l(k),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"broiler",children:"Broiler (Meat)"}),i.jsx(oe,{value:"layer",children:"Layer (Eggs)"}),i.jsx(oe,{value:"mixed",children:"Mixed (Dual Purpose)"})]})]})]})]}),i.jsx("div",{className:"bg-muted/30 p-4 rounded-lg border",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-center",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"Feed per bird/day"}),i.jsxs("div",{className:"text-xl font-bold text-primary",children:[p,"g"]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"Total daily need"}),i.jsxs("div",{className:"text-xl font-bold text-primary",children:[x.toFixed(1),"kg"]})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"Recommended feed"}),i.jsx(ye,{variant:"secondary",className:"mt-1",children:j()})]})]})})]})]}),w&&i.jsx(z,{className:"glass-card border-destructive bg-destructive/5",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Ra,{className:"h-5 w-5 text-destructive"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-semibold text-destructive",children:"Low Stock Alert!"}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:["Only ",b," days of feed remaining"]})]})]})})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(bB,{className:"h-5 w-5"}),"Current Stock"]})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"text-center",children:[i.jsxs("div",{className:"text-3xl font-bold text-primary",children:[c,"kg"]}),i.jsx("div",{className:"text-sm text-muted-foreground",children:c>0?`${b} days remaining`:"No stock available"})]}),i.jsxs("div",{className:"pt-4 border-t space-y-3",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ae,{type:"number",placeholder:"Add stock (kg)",value:f||"",onChange:k=>m(parseFloat(k.target.value)||0),min:"0"}),i.jsx(U,{onClick:S,children:"Add"})]}),i.jsxs(U,{onClick:N,variant:"outline",className:"w-full",disabled:c<x,children:["Record Today's Consumption (",x.toFixed(1),"kg)"]})]})]})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Feed Requirements"})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Daily requirement:"}),i.jsxs("span",{className:"font-semibold",children:[x.toFixed(1),"kg"]})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Weekly requirement:"}),i.jsxs("span",{className:"font-semibold",children:[v.toFixed(1),"kg"]})]})]}),i.jsxs("div",{className:"pt-4 border-t space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ne,{htmlFor:"feedCost",children:"Cost per kg (R):"}),i.jsx(ae,{id:"feedCost",type:"number",value:d,onChange:k=>h(parseFloat(k.target.value)||0),className:"w-24",min:"0",step:"0.1"})]}),i.jsxs("div",{className:"bg-muted/50 p-3 rounded-lg",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:"Weekly feed cost"}),i.jsxs("div",{className:"text-xl font-bold text-primary",children:["R",(v*d).toFixed(2)]})]})]})]})]})]})]})}const Cr=()=>{const[e,t]=y.useState(null),[n,r]=y.useState(!0),{toast:s}=We(),a=async()=>{try{const{data:{user:l}}=await q.auth.getUser();if(!l){t(null),r(!1);return}const{data:c,error:u}=await q.from("profiles").select("*").eq("user_id",l.id).maybeSingle();if(u){console.error("Error fetching profile:",u),s({title:"Error",description:"Failed to load profile data",variant:"destructive"});return}t(c)}catch(l){console.error("Profile fetch error:",l)}finally{r(!1)}},o=async l=>{try{const{data:{user:c}}=await q.auth.getUser();if(!c||!e)return;const{user_type:u,...d}=l;
926u&&console.warn("user_type changes are not allowed via client-side profile updates");const{error:h}=await q.from("profiles").update(d).eq("user_id",c.id);if(h){console.error("Error updating profile:",h),s({title:"Error",description:"Failed to update profile",variant:"destructive"});return}t({...e,...d}),s({title:"Success",description:"Profile updated successfully"})}catch(c){console.error("Profile update error:",c)}};return y.useEffect(()=>{a();const{data:{subscription:l}}=q.auth.onAuthStateChange((c,u)=>{c==="SIGNED_IN"?setTimeout(()=>{a()},0):c==="SIGNED_OUT"&&t(null)});return()=>l.unsubscribe()},[]),{profile:e,loading:n,updateProfile:o,refetch:a}};function jw({title:e="Authentication Required",description:t="Please log in to access this feature and save your data.",feature:n="this feature"}){const[r,s]=y.useState(!1),[a,o]=y.useState(null);return y.useEffect(()=>{(async()=>{const{data:{user:u}}=await q.auth.getUser();o(!!u)})();const{data:{subscription:c}}=q.auth.onAuthStateChange((u,d)=>{o(!!(d!=null&&d.user)),d!=null&&d.user&&s(!1)});return()=>c.unsubscribe()},[]),a===null||a?null:i.jsxs(i.Fragment,{children:[i.jsxs(z,{className:"border-2 border-dashed border-primary/30 bg-gradient-to-br from-primary/5 to-secondary/5",children:[i.jsxs(re,{className:"text-center pb-2",children:[i.jsx("div",{className:"mx-auto w-16 h-16 bg-gradient-to-br from-primary/20 to-secondary/20 rounded-full flex items-center justify-center mb-4",children:i.jsx(XZ,{className:"h-8 w-8 text-primary"})}),i.jsx(se,{className:"text-xl",children:e})]}),i.jsxs(V,{className:"text-center space-y-4",children:[i.jsx("p",{className:"text-muted-foreground",children:t}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Sign in to use ",n," and keep your data synced across devices."]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center pt-2",children:[i.jsxs(U,{onClick:()=>s(!0),className:"bg-gradient-to-r from-primary to-secondary hover:opacity-90",children:[i.jsx(JZ,{className:"h-4 w-4 mr-2"}),"Log In"]}),i.jsxs(U,{variant:"outline",onClick:()=>s(!0),children:[i.jsx(CB,{className:"h-4 w-4 mr-2"}),"Sign Up"]})]})]})]}),i.jsx(yt,{open:r,onOpenChange:s,children:i.jsx(mt,{className:"sm:max-w-md p-0 overflow-hidden",children:i.jsx(T2,{onAuthSuccess:()=>s(!1)})})})]})}function Sw(){const[e,t]=y.useState(null),[n,r]=y.useState(!0);return y.useEffect(()=>{(async()=>{const{data:{user:o}}=await q.auth.getUser();t(!!o),r(!1)})();const{data:{subscription:a}}=q.auth.onAuthStateChange((o,l)=>{t(!!(l!=null&&l.user)),r(!1)});return()=>a.unsubscribe()},[]),{isAuthenticated:e,isLoading:n}}function Nw(){return"live"}async function Nq(e){const{data:t,error:n}=await q.functions.invoke("yoco-create-checkout",{body:{priceId:e,environment:Nw(),origin:window.location.origin}});if(n)throw new Error(n.message??"Could not start card payment");if(!(t!=null&&t.redirectUrl))throw new Error((t==null?void 0:t.error)??"Could not start card payment");return t.redirectUrl}const wFe=Object.freeze(Object.defineProperty({__proto__:null,getPaymentEnvironment:Nw,startYocoCheckout:Nq},Symbol.toStringTag,{value:"Module"})),jFe=new Set(["active","trialing","past_due"]),SFe=7*24*60*60*1e3;function kq(e){return!!(e&&e.status==="pending"&&e.provider!=="yoco"&&e.created_at&&Date.now()-new Date(e.created_at).getTime()<SFe)}function D4(e){if(!e)return!1;const t=e.current_period_end?new Date(e.current_period_end):null,n=e.status==="canceled"&&!!t&&t>new Date,r=!t||t>new Date;return jFe.has(e.status)&&r||n||kq(e)}function Bh(){const[e,t]=y.useState(null),[n,r]=y.useState(null),[s,a]=y.useState(!0),o=y.useCallback(async w=>{const{data:j}=await q.from("subscriptions").select("*").eq("user_id",w).eq("environment",Nw()).order("created_at",{ascending:!1}).limit(5),S=j??[],N=S.find(k=>D4(k))??S[0]??null;t(N),a(!1)},[]);y.useEffect(()=>{let w;return q.auth.getUser().then(({data:{user:j}})=>{if(!j){a(!1);return}r(j.id),o(j.id);const S=q.channel(`subs-${j.id}`).on("postgres_changes",{event:"*",schema:"public",table:"subscriptions",filter:`user_id=eq.${j.id}`},()=>o(j.id)).subscribe();w=()=>{q.removeChannel(S)}}),()=>{w&&w()}},[o]);const l=kq(e),c=D4(e)&&e.product_id||"free",u=c!=="free",d=c==="farmer_pro"||c==="org_pro"||c==="farmer_business"||c==="org_business",h=c==="farmer_business"||c==="org_business",f=c==="org_pro"||c==="org_business",m=(e==null?void 0:e.status)==="past_due"||(e==null?void 0:e.status)==="failed",g=l,p=e!=null&&e.current_period_end?Math.ceil((new Date(e.current_period_end).getTime()-Date.now())/864e5):null,x=u&&p!==null&&p<=7,v=(e==null?void 0:e.status)==="canceled"&&e.current_period_end?new Date(e.current_period_end)>new Date:!1;return{subscription:e,tier:c,isActive:u,isPro:d,isBusiness:h,isOrg:f,
926isPastDue:m,isPending:g,isProvisional:l,inGracePeriod:v,daysUntilRenewal:p,needsRenewal:x,loading:s,refetch:()=>n&&o(n)}}const _q={free:{maxFlocks:1,aiScansPerMonth:3,maxOrgMembers:5,maxCourses:1,marketplaceBoost:!1,advancedAnalytics:!1,prioritySupport:!1,whiteLabel:!1,apiAccess:!1},farmer_pro:{maxFlocks:-1,aiScansPerMonth:-1,maxOrgMembers:5,maxCourses:-1,marketplaceBoost:!0,advancedAnalytics:!0,prioritySupport:!1,whiteLabel:!1,apiAccess:!1},farmer_business:{maxFlocks:-1,aiScansPerMonth:-1,maxOrgMembers:5,maxCourses:-1,marketplaceBoost:!0,advancedAnalytics:!0,prioritySupport:!0,whiteLabel:!1,apiAccess:!1},org_pro:{maxFlocks:-1,aiScansPerMonth:-1,maxOrgMembers:50,maxCourses:-1,marketplaceBoost:!0,advancedAnalytics:!0,prioritySupport:!1,whiteLabel:!1,apiAccess:!1},org_business:{maxFlocks:-1,aiScansPerMonth:-1,maxOrgMembers:-1,maxCourses:-1,marketplaceBoost:!0,advancedAnalytics:!0,prioritySupport:!0,whiteLabel:!0,apiAccess:!0}},Du={free:"Free",farmer_pro:"Farmer Pro",farmer_business:"Farmer Business",org_pro:"Organization Pro",org_business:"Organization Business"};var eP="Switch",[NFe,P7e]=kr(eP),[kFe,_Fe]=NFe(eP),Cq=y.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,...d}=e,[h,f]=y.useState(null),m=Ce(t,b=>f(b)),g=y.useRef(!1),p=h?!!h.closest("form"):!0,[x=!1,v]=ni({prop:s,defaultProp:a,onChange:u});return i.jsxs(kFe,{scope:n,checked:x,disabled:l,children:[i.jsx(ve.button,{type:"button",role:"switch","aria-checked":x,"aria-required":o,"data-state":Pq(x),"data-disabled":l?"":void 0,disabled:l,value:c,...d,ref:m,onClick:ge(e.onClick,b=>{v(w=>!w),p&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),p&&i.jsx(CFe,{control:h,bubbles:!g.current,name:r,value:c,checked:x,required:o,disabled:l,style:{transform:"translateX(-100%)"}})]})});Cq.displayName=eP;var Eq="SwitchThumb",Aq=y.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=_Fe(Eq,n);return i.jsx(ve.span,{"data-state":Pq(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Aq.displayName=Eq;var CFe=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=y.useRef(null),o=V2(n),l=OE(t);return y.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&h){const f=new Event("click",{bubbles:r});h.call(c,n),c.dispatchEvent(f)}},[o,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Pq(e){return e?"checked":"unchecked"}var Tq=Cq,EFe=Aq;const kw=y.forwardRef(({className:e,...t},n)=>i.jsx(Tq,{className:fe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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:i.jsx(EFe,{className:fe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));kw.displayName=Tq.displayName;function AFe(){const{toast:e}=We(),{profile:t}=Cr(),{isAuthenticated:n,isLoading:r}=Sw(),{tier:s}=Bh(),a=_q[s].marketplaceBoost,[o,l]=y.useState(!1),[c,u]=y.useState([]),[d,h]=y.useState(!0),[f,m]=y.useState([]),[g,p]=y.useState(""),[x,v]=y.useState("all"),[b,w]=y.useState("all"),[j,S]=y.useState("all"),[N,k]=y.useState("newest"),[_,C]=y.useState({type:"sell",category:"broilers",title:"",description:"",price:0,unit:"per bird",quantity:0,location:"",contact:"",sellerName:""}),[A,E]=y.useState({category:"broilers",maxPrice:0,location:"",isActive:!0}),[P,$]=y.useState(!1),[R,L]=y.useState(!1);y.useEffect(()=>{D()},[]);const D=async()=>{try{const{data:W,error:X}=await q.from("marketplace_listings").select("*").eq("status","active").order("created_at",{ascending:!1});if(X)throw X;const J=(W||[]).map(G=>
926({id:G.id,type:G.type,category:G.category,title:G.title,description:G.description||"",price:Number(G.price),unit:G.unit,quantity:G.quantity,location:G.location,contact:G.contact,sellerName:G.seller_name||"Anonymous",postedDate:new Date(G.created_at).toISOString().split("T")[0],status:G.status,rating:Number(G.rating||0),image:G.image_url||void 0}));u(J)}catch(W){console.error("Error fetching listings:",W),e({title:"Error",description:"Failed to load listings",variant:"destructive"})}finally{h(!1)}},I=async()=>{if(!_.title||!_.price||!_.quantity||!_.location||!_.contact){e({title:"Missing Information",description:"Please fill in all required fields",variant:"destructive"});return}try{const{data:{user:W}}=await q.auth.getUser();if(!W){e({title:"Authentication Required",description:"Please log in to post a listing",variant:"destructive"});return}const{data:X,error:J}=await q.from("marketplace_listings").insert([{user_id:W.id,type:_.type,category:_.category,title:_.title,description:_.description||"",price:_.price,unit:_.unit,quantity:_.quantity,location:_.location,contact:_.contact,seller_name:_.sellerName||(t==null?void 0:t.display_name)||"Anonymous",status:"active",is_boosted:a&&o}]).select().single();if(J)throw J;await D(),C({type:"sell",category:"broilers",title:"",description:"",price:0,unit:"per bird",quantity:0,location:"",contact:"",sellerName:""}),$(!1),l(!1),e({title:"Listing Posted",description:"Your listing has been posted successfully"})}catch(W){console.error("Error posting listing:",W),e({title:"Error",description:"Failed to post listing. Please try again.",variant:"destructive"})}},M=()=>{if(!A.maxPrice||!A.location){e({title:"Missing Information",description:"Please fill in all required fields",variant:"destructive"});return}const W={id:Date.now().toString(),category:A.category,maxPrice:A.maxPrice,location:A.location,isActive:!0};m([...f,W]),E({category:"broilers",maxPrice:0,location:"",isActive:!0}),L(!1),e({title:"Price Alert Created",description:"You'll be notified when matching listings are posted"})},T=[...c.filter(W=>{const X=W.title.toLowerCase().includes(g.toLowerCase())||W.description.toLowerCase().includes(g.toLowerCase())||W.location.toLowerCase().includes(g.toLowerCase()),J=x==="all"||W.category===x,G=b==="all"||W.type===b,ce=j==="all"||W.location.toLowerCase().includes(j.toLowerCase());return X&&J&&G&&ce&&W.status==="active"})].sort((W,X)=>{const J=W.is_boosted?1:0,G=X.is_boosted?1:0;if(J!==G)return G-J;switch(N){case"price-low":return W.price-X.price;case"price-high":return X.price-W.price;case"rating":return X.rating-W.rating;default:return new Date(X.postedDate).getTime()-new Date(W.postedDate).getTime()}}),B=W=>{switch(W){case"broilers":case"layers":return"ð";case"eggs":return"ð¥";case"feed":return"ð¾";case"equipment":return"ð§";default:return"ð¦"}},Y=(W,X)=>`R${W} ${X}`;[...new Set(c.map(W=>W.location))];const O=[...new Set(b0.map(W=>W.label.split(", ")[1]))].sort();return i.jsxs("div",{className:"space-y-6",children:[!r&&!n&&i.jsx(jw,{title:"Sign in to use the marketplace",description:"Create an account or log in to post listings, contact sellers, and set price alerts.",feature:"marketplace"}),i.jsxs("div",{className:"flex flex-col md:flex-row gap-4 justify-between items-start",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold",children:"Marketplace"}),i.jsx("p",{className:"text-muted-foreground",children:"Buy and sell livestock, eggs, feed, and equipment"})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(yt,{open:P,onOpenChange:$,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Post Listing"]})}),i.jsxs(mt,{className:"max-w-2xl",children:[i.jsx(xt,{children:i.jsx(vt,{children:"Create New Listing"})}),i.jsxs("div",{className:"space-y-4 max-h-96 overflow-y-auto",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Listing Type"}),i.jsxs(Ye,{value:_.type,onValueChange:W=>C({..._,type:W}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"sell",children:"Selling"}),i.jsx(oe,{value:"buy",children:"Buying"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Category"}),i.jsxs(Ye,{value:_.category,onValueChange:W=>C({..._,category:W}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"broilers",children:"Broilers"}),i.jsx(oe,{value:"layers",children:"Layers"}),i.jsx(oe,{value:"eggs",children:"Eggs"}),i.jsx(oe,{value:"feed",children:"Feed"}),i.jsx(oe,{value:"equipment",children:"Equipment"})]})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Title"}),i.jsx(ae,{value:_.title,onChange:W=>C({..._,title:W.target.value}),placeholder:"Enter a descriptive title"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(ne,{children:"Description"}),i.jsx(Dd,{label:"Speak",onTranscript:W=>C(X=>({...X,description:(X.description?X.description+" ":"")+W}))})]}),i.jsx(Yt,{value:_.description,onChange:W=>C({..._,description:W.target.value}),placeholder:"Provide detailed information about your listing"})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Price"}),i.jsx(ae,{type:"number",value:_.price||"",onChange:W=>C({..._,price:parseFloat(W.target.value)||0})})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Unit"}),i.jsxs(Ye,{value:_.unit,onValueChange:W=>C({..._,unit:W}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"per bird",children:"Per Bird"}),i.jsx(oe,{value:"per kg",children:"Per Kg"}),i.jsx(oe,{value:"per dozen",children:"Per Dozen"}),i.jsx(oe,{value:"per bag",children:"Per Bag"}),i.jsx(oe,{value:"total",children:"Total"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Quantity"}),i.jsx(ae,{type:"number",value:_.quantity||"",onChange:W=>C({..._,quantity:parseInt(W.target.value)||0})})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Location"}),i.jsx(ae,{value:_.location,onChange:W=>C({..._,location:W.target.value}),placeholder:"City, Province"})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Contact"}),i.jsx(ae,{value:_.contact,onChange:W=>C({..._,contact:W.target.value}),placeholder:"Phone number"})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Your Name (optional)"}),i.jsx(ae,{value:_.sellerName,onChange:W=>C({..._,sellerName:W.target.value}),placeholder:"Your name or business name"})]}),a?i.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3 bg-primary/5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Wf,{className:"h-4 w-4 text-primary"}),i.jsxs("div",{children:[i.jsx(ne,{className:"text-sm",children:"Boost listing"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Featured at the top of the marketplace"})]})]}),i.jsx(kw,{checked:o,onCheckedChange:l})]}):i.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-dashed p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(Wf,{className:"h-4 w-4"}),"Boost listings to feature them at the top"]}),i.jsx(U,{asChild:!0,size:"sm",variant:"outline",children:i.jsx(Ke,{to:"/pricing",children:"Upgrade"})})]}),i.jsx(U,{onClick:I,className:"w-full",children:"Post Listing"})]})]})]}),i.jsxs(yt,{open:R,onOpenChange:L,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{variant:"outline",children:[i.jsx(jc,{className:"h-4 w-4 mr-2"}),"Price Alert"]})}),i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Create Price Alert"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Category"}),i.jsxs(Ye,{value:A.category,onValueChange:W=>E({...A,category:W}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"broilers",children:"Broilers"}),i.jsx(oe,{value:"layers",children:"Layers"}),i.jsx(oe,{value:"eggs",children:"Eggs"}),i.jsx(oe,{value:"feed",children:"Feed"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Maximum Price"}),i.jsx(ae,{type:"number",value:A.maxPrice,onChange:W=>E({...A,maxPrice:parseFloat(W.target.value)||0}),placeholder:"Alert me when price is below this amount"})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Location"}),i.jsx(ae,{value:A.location,onChange:W=>E({...A,location:W.target.value}),placeholder:"City, Province"})]}),i.jsx(U,{onClick:M,className:"w-full",children:"Create Alert"})]})]})]})]})]}),i.jsx(z,{className:"glass-card",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[i.jsx("div",{className:"flex-1",children:i.jsxs("div",{className:"relative",children:[i.jsx(Qp,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),i.jsx(ae,{placeholder:"Search listings...",value:g,onChange:W=>p(W.target.value),className:"pl-10"})]})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(Ye,{value:b,onValueChange:w,children:[i.jsx(He,{className:"w-32",children:i.jsx(Xe,{placeholder:"Type"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"all",children:"All Types"}),i.jsx(oe,{value:"sell",children:"Selling"}),i.jsx(oe,{value:"buy",children:"Buying"})]})]}),i.jsxs(Ye,{value:x,onValueChange:v,children:[i.jsx(He,{className:"w-32",children:i.jsx(Xe,{placeholder:"Category"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"all",children:"All Categories"}),i.jsx(oe,{value:"broilers",children:"Broilers"}),i.jsx(oe,{value:"layers",children:"Layers"}),i.jsx(oe,{value:"eggs",children:"Eggs"}),i.jsx(oe,{value:"feed",children:"Feed"}),i.jsx(oe,{value:"equipment",children:"Equipment"})]})]}),i.jsxs(Ye,{value:j,onValueChange:S,children:[i.jsx(He,{className:"w-32",children:i.jsx(Xe,{placeholder:"Province"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"all",children:"All Provinces"}),O.map(W=>i.jsx(oe,{value:W.toLowerCase(),children:W},W))]})]}),i.jsxs(Ye,{value:N,onValueChange:k,children:[i.jsx(He,{className:"w-32",children:i.jsx(Xe,{placeholder:"Sort"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"newest",children:"Newest"}),i.jsx(oe,{value:"price-low",children:"Price: Low to High"}),i.jsx(oe,{value:"price-high",children:"Price: High to Low"}
vendor: 4,869 bytes, line 926
926),i.jsx(oe,{value:"rating",children:"Highest Rated"})]})]})]})]})})}),f.length>0&&i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Your Price Alerts"})}),i.jsx(V,{children:i.jsx("div",{className:"space-y-2",children:f.map(W=>i.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/50 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx("div",{className:"text-lg",children:B(W.category)}),i.jsxs("div",{children:[i.jsx("div",{className:"font-medium capitalize",children:W.category}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:["Alert when price ⤠R",W.maxPrice," in ",W.location]})]})]}),i.jsx(ye,{variant:W.isActive?"default":"secondary",children:W.isActive?"Active":"Paused"})]},W.id))})})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:T.map(W=>i.jsxs(z,{className:`transition-all hover:shadow-lg ${W.is_boosted?"ring-2 ring-primary/60":""}`,children:[W.is_boosted&&i.jsxs("div",{className:"bg-primary text-primary-foreground text-xs font-semibold px-3 py-1 flex items-center gap-1 rounded-t-lg",children:[i.jsx(Wf,{className:"h-3 w-3"})," Boosted"]}),i.jsx(V,{className:"p-0",children:i.jsxs("div",{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ye,{variant:W.type==="sell"?"default":"secondary",children:W.type==="sell"?"Selling":"Buying"}),i.jsx("div",{className:"text-lg",children:B(W.category)})]}),i.jsxs("div",{className:"flex items-center space-x-1",children:[i.jsx(Tu,{className:"h-4 w-4 text-yellow-500 fill-current"}),i.jsx("span",{className:"text-sm",children:W.rating.toFixed(1)})]})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-semibold text-lg leading-tight",children:W.title}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:W.description})]}),i.jsx("div",{className:"space-y-2",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-2xl font-bold text-primary",children:Y(W.price,W.unit)}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:["Qty: ",W.quantity]})]})}),i.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsxs("div",{className:"flex items-center space-x-1",children:[i.jsx(ts,{className:"h-3 w-3"}),i.jsx("span",{children:W.location})]}),i.jsxs("div",{className:"flex items-center space-x-1",children:[i.jsx(ys,{className:"h-3 w-3"}),i.jsxs("span",{children:["Posted ",W.postedDate]})]})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[i.jsx("span",{className:"text-sm font-medium",children:W.sellerName}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs(U,{size:"sm",variant:"outline",children:[i.jsx(ri,{className:"h-3 w-3 mr-1"}),"Call"]}),i.jsx(U,{size:"sm",children:"Contact"})]})]})]})})]},W.id))}),T.length===0&&i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-8 text-center",children:[i.jsx(bB,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No listings found"}),i.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search criteria or create a new listing."})]})})]})}var E1="rovingFocusGroup.onEntryFocus",PFe={bubbles:!1,cancelable:!0},_w="RovingFocusGroup",[X_,Oq,TFe]=dE(_w),[OFe,Rq]=kr(_w,[TFe]),[RFe,MFe]=OFe(_w),Mq=y.forwardRef((e,t)=>i.jsx(X_.Provider,{scope:e.__scopeRovingFocusGroup,children:i.jsx(X_.Slot,{scope:e.__scopeRovingFocusGroup,children:i.jsx(IFe,{...e,ref:t})})}));Mq.displayName=_w;var IFe=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,f=y.useRef(null),m=Ce(t,f),g=R0(a),[p=null,x]=ni({prop:o,defaultProp:l,onChange:c}),[v,b]=y.useState(!1),w=dt(u),j=Oq(n),S=y.useRef(!1),[N,k]=y.useState(0);return y.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(E1,w),()=>_.removeEventListener(E1,w)},[w]),i.jsx(RFe,{scope:n,orientation:r,dir:g,loop:s,currentTabStopId:p,onItemFocus:y.useCallback(_=>x(_),[x]),onItemShiftTab:y.useCallback(()=>b(!0),[]),onFocusableItemAdd:y.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:y.useCallback(()=>k(_=>_-1),[]),children:i.jsx(ve.div,{tabIndex:v||N===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:ge(e.onMouseDown,()=>{S.current=!0}),onFocus:ge(e.onFocus,_=>{const C=!S.current;if(_.target===_.currentTarget&&C&&!v){const A=new CustomEvent(E1,PFe);if(_.currentTarget.dispatchEvent(A),!A.defaultPrevented){const E=j().filter(D=>D.focusable),P=E.find(D=>D.active),$=E.find(D=>
vendor: 4,103 bytes, line 926
926D.id===p),L=[P,$,...E].filter(Boolean).map(D=>D.ref.current);Lq(L,d)}}S.current=!1}),onBlur:ge(e.onBlur,()=>b(!1))})})}),Iq="RovingFocusGroupItem",$q=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:a,...o}=e,l=Kr(),c=a||l,u=MFe(Iq,n),d=u.currentTabStopId===c,h=Oq(n),{onFocusableItemAdd:f,onFocusableItemRemove:m}=u;return y.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),i.jsx(X_.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:i.jsx(ve.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:ge(e.onMouseDown,g=>{r?u.onItemFocus(c):g.preventDefault()}),onFocus:ge(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:ge(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const p=DFe(g,u.orientation,u.dir);if(p!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let v=h().filter(b=>b.focusable).map(b=>b.ref.current);if(p==="last")v.reverse();else if(p==="prev"||p==="next"){p==="prev"&&v.reverse();const b=v.indexOf(g.currentTarget);v=u.loop?FFe(v,b+1):v.slice(b+1)}setTimeout(()=>Lq(v))}})})})});$q.displayName=Iq;var $Fe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function LFe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function DFe(e,t,n){const r=LFe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $Fe[r]}function Lq(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function FFe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var BFe=Mq,zFe=$q,tP="Tabs",[UFe,T7e]=kr(tP,[Rq]),Dq=Rq(),[VFe,nP]=UFe(tP),Fq=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=R0(l),[h,f]=ni({prop:r,onChange:s,defaultProp:a});return i.jsx(VFe,{scope:n,baseId:Kr(),value:h,onValueChange:f,orientation:o,dir:d,activationMode:c,children:i.jsx(ve.div,{dir:d,"data-orientation":o,...u,ref:t})})});Fq.displayName=tP;var Bq="TabsList",zq=y.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,a=nP(Bq,n),o=Dq(n);return i.jsx(BFe,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:i.jsx(ve.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});zq.displayName=Bq;var Uq="TabsTrigger",Vq=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...a}=e,o=nP(Uq,n),l=Dq(n),c=qq(o.baseId,r),u=Kq(o.baseId,r),d=r===o.value;return i.jsx(zFe,{asChild:!0,...l,focusable:!s,active:d,children:i.jsx(ve.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...a,ref:t,onMouseDown:ge(e.onMouseDown,h=>{!s&&h.button===0&&h.ctrlKey===!1?o.onValueChange(r):h.preventDefault()}),onKeyDown:ge(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(r)}),onFocus:ge(e.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!s&&h&&o.onValueChange(r)})})})});Vq.displayName=Uq;var Wq="TabsContent",Hq=y.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:a,...o}=e,l=nP(Wq,n),c=qq(l.baseId,r),u=Kq(l.baseId,r),d=r===l.value,h=y.useRef(d);return y.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),i.jsx(es,{present:s||d,children:({present:f})=>i.jsx(ve.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:f&&a})})});Hq.displayName=Wq;function qq(e,t){return`${e}-trigger-${t}`}function Kq(e,t){return`${e}-content-${t}`}var WFe=Fq,Gq=zq,Yq=Vq,Xq=Hq;const Bc=WFe,jl=y.forwardRef(({className:e,...t},n)=>i.jsx(Gq,{ref:n,className:fe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));
926jl.displayName=Gq.displayName;const pt=y.forwardRef(({className:e,...t},n)=>i.jsx(Yq,{ref:n,className:fe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 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-sm",e),...t}));pt.displayName=Yq.displayName;const tt=y.forwardRef(({className:e,...t},n)=>i.jsx(Xq,{ref:n,className:fe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));tt.displayName=Xq.displayName;function jg(){const{toast:e}=We(),t=UE(),{data:n=[],isLoading:r,error:s}=Wre({queryKey:["financial-records"],queryFn:async()=>{const{data:l,error:c}=await q.from("financial_records").select("*").order("date",{ascending:!1});if(c)throw c;return l}}),a=IO({mutationFn:async l=>{const{data:{user:c}}=await q.auth.getUser();if(!c)throw new Error("Please log in to add financial records");const{data:u,error:d}=await q.from("financial_records").insert([{...l,user_id:c.id}]).select().single();if(d)throw d;return u},onSuccess:()=>{t.invalidateQueries({queryKey:["financial-records"]}),e({title:"Saved",description:"Entry added to your books."})},onError:l=>{e({title:"Could not save",description:l.message||"Failed to add record",variant:"destructive"})}}),o=IO({mutationFn:async l=>{const{error:c}=await q.from("financial_records").delete().eq("id",l);if(c)throw c},onSuccess:()=>{t.invalidateQueries({queryKey:["financial-records"]}),e({title:"Removed",description:"Entry deleted."})},onError:()=>{e({title:"Error",description:"Failed to delete record",variant:"destructive"})}});return{records:n,isLoading:r,error:s,addRecord:a.mutate,deleteRecord:o.mutate}}const HFe=["Egg Sales","Meat Sales","Live Bird Sales","Manure Sales","Other Income"],qFe=["Feed","Medication","Equipment","Labor","Utilities","Transportation","Repairs","Other Expenses"];function F4(){const[e,t]=y.useState(!1),[n,r]=y.useState("income"),[s,a]=y.useState(""),[o,l]=y.useState(""),[c,u]=y.useState(""),[d,h]=y.useState(new Date().toISOString().split("T")[0]),{addRecord:f}=jg(),m=p=>{p.preventDefault();const x=parseFloat(s);!x||!o||!c.trim()||(f({type:n,amount:x,category:o,description:c.trim(),date:d}),a(""),l(""),u(""),h(new Date().toISOString().split("T")[0]),t(!1))},g=n==="income"?HFe:qFe;return i.jsxs(yt,{open:e,onOpenChange:t,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{size:"sm",className:"gap-2",children:[i.jsx(rn,{className:"h-4 w-4"}),"Add Transaction"]})}),i.jsxs(mt,{className:"sm:max-w-[425px]",children:[i.jsxs(xt,{children:[i.jsx(vt,{children:"Add Financial Record"}),i.jsx($i,{children:"Record your farm's income or expenses here."})]}),i.jsxs("form",{onSubmit:m,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"type",children:"Type"}),i.jsxs(Ye,{value:n,onValueChange:p=>{r(p),l("")},children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"income",children:"Income"}),i.jsx(oe,{value:"expense",children:"Expense"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"category",children:"Category"}),i.jsxs(Ye,{value:o,onValueChange:l,children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select category"})}),i.jsx(qe,{children:g.map(p=>i.jsx(oe,{value:p,children:p},p))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"amount",children:"Amount (R)"}),i.jsx(ae,{id:"amount",type:"number",step:"0.01",min:"0",value:s,onChange:p=>a(p.target.value),placeholder:"0.00",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"description",children:"Description"}),i.jsx(ae,{id:"description",value:c,onChange:p=>u(p.target.value),placeholder:"Brief description",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"date",children:"Date"}),i.jsx(ae,{id:"date",type:"date",value:d,onChange:p=>h(p.target.value),required:!0})]}),i.jsx(U,{type:"submit",className:"w-full",children:"Add Record"})]})]})]})}const pf=[{key:"Egg Sales",label:"Eggs",unit:"tray",suggested:85},{key:"Live Bird Sales",label:"Live birds",unit:"bird",suggested:90},{key:"Meat Sales",label:"Dressed chicken",unit:"kg",suggested:75},{key:"Manure Sales",label:"Manure",unit:"bag",suggested:40},{key:"Other Income",label:"Other",unit:"unit",suggested:0}];function Dy({trigger:e}){const[t,n]=y.useState(!1),[r,s]=y.useState(pf[0].key),[a,o]=y.useState(""),[l,c]=y.useState(""),[u,d]=y.useState(""),[h,f]=y.useState(new Date().toISOString().split("T")[0]),{addRecord:m}=jg(),g=y.useMemo(()=>pf.find(j=>j.key===r)??pf[0],[r]),p=parseFloat(a)||0,x=parseFloat(l)||0,v=p*x,b=()=>{o(""),c(""),d(""),f(new Date().toISOString().split("T")[0])},w=j=>{j.preventDefault(),!(!p||!x)&&(m({type:"income",amount:v,category:g.key,description:`${p} ${g.unit}${p!==1?"s":""} of ${g.label.toLowerCase()}${u?` â ${u}`:""}`,date:h,quantity:p,unit:g.unit,unit_price:x}),b(),n(!1))};return i.jsxs(yt,{open:t,onOpenChange:n,children:[i.jsx(hn,{asChild:!0,children:e??i.jsxs(U,{size:"sm",className:"gap-2",children:[i.jsx(Wf,{className:"h-4 w-4"}),"Log Daily Sale"]})}),i.jsxs(mt,{className:"sm:max-w-[440px]",children:[i.jsxs(xt,{children:[i.jsx(vt,{children:"Log a sale"}
926),i.jsxs($i,{children:["Quick capture â pick what you sold, quantity and price per ",g.unit,"."]})]}),i.jsxs("form",{onSubmit:w,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Product"}),i.jsxs(Ye,{value:r,onValueChange:j=>{s(j);const S=pf.find(N=>N.key===j);S&&!l&&S.suggested&&c(String(S.suggested))},children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsx(qe,{children:pf.map(j=>i.jsx(oe,{value:j.key,children:j.label},j.key))})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(ne,{children:["Quantity (",g.unit,"s)"]}),i.jsx(ae,{type:"number",inputMode:"decimal",step:"0.01",min:"0",value:a,onChange:j=>o(j.target.value),placeholder:"",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(ne,{children:["Price per ",g.unit," (R)"]}),i.jsx(ae,{type:"number",inputMode:"decimal",step:"0.01",min:"0",value:l,onChange:j=>c(j.target.value),placeholder:g.suggested?String(g.suggested):"",required:!0})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Buyer (optional)"}),i.jsx(ae,{value:u,onChange:j=>d(j.target.value),placeholder:"e.g. Spaza shop, walk-in",maxLength:80})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Date"}),i.jsx(ae,{type:"date",value:h,onChange:j=>f(j.target.value),required:!0})]}),i.jsxs("div",{className:"rounded-lg bg-secondary/50 p-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Total"}),i.jsxs("span",{className:"text-xl font-bold",children:["R",v.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]})]}),i.jsx(U,{type:"submit",className:"w-full",disabled:!p||!x,children:"Save sale"})]})]})]})}const Fy=[{key:"Feed",label:"Feed",unit:"bag"},{key:"Medication",label:"Medication / vaccine",unit:"dose"},{key:"Equipment",label:"Equipment",unit:"item"},{key:"Labor",label:"Labour",unit:"shift"},{key:"Utilities",label:"Utilities (water/power)",unit:"month"},{key:"Transportation",label:"Transport",unit:"trip"},{key:"Repairs",label:"Repairs",unit:"job"},{key:"Other Expenses",label:"Other",unit:"item"}];function A1({trigger:e}){const[t,n]=y.useState(!1),[r,s]=y.useState(Fy[0].key),[a,o]=y.useState(""),[l,c]=y.useState(""),[u,d]=y.useState(""),[h,f]=y.useState(""),[m,g]=y.useState(new Date().toISOString().split("T")[0]),{addRecord:p}=jg(),x=y.useMemo(()=>Fy.find(k=>k.key===r)??Fy[0],[r]),v=parseFloat(a)||0,b=parseFloat(l)||0,w=parseFloat(u)||0,j=w>0?w:v*b,S=()=>{o(""),c(""),d(""),f(""),g(new Date().toISOString().split("T")[0])},N=k=>{if(k.preventDefault(),!j)return;const _=v&&b?`${v} ${x.unit}${v!==1?"s":""} of ${x.label.toLowerCase()}${h?` â ${h}`:""}`:`${x.label}${h?` â ${h}`:""}`;p({type:"expense",amount:j,category:x.key,description:_,date:m,quantity:v||null,unit:v?x.unit:null,unit_price:b||null}),S(),n(!1)};return i.jsxs(yt,{open:t,onOpenChange:n,children:[i.jsx(hn,{asChild:!0,children:e??i.jsxs(U,{size:"sm",variant:"outline",className:"gap-2",children:[i.jsx(jB,{className:"h-4 w-4"}),"Log Expense"]})}),i.jsxs(mt,{className:"sm:max-w-[440px]",children:[i.jsxs(xt,{children:[i.jsx(vt,{children:"Log an expense"}),i.jsx($i,{children:"Capture what you bought. Use quantity à price, or just enter the total."})]}),i.jsxs("form",{onSubmit:N,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Category"}),i.jsxs(Ye,{value:r,onValueChange:s,children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsx(qe,{children:Fy.map(k=>i.jsx(oe,{value:k.key,children:k.label},k.key))})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs(ne,{children:["Quantity (",x.unit,"s)"]}),i.jsx(ae,{type:"number",inputMode:"decimal",step:"0.01",min:"0",value:a,onChange:k=>o(k.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(ne,{children:["Price per ",x.unit," (R)"]}),i.jsx(ae,{type:"number",inputMode:"decimal",step:"0.01",min:"0",value:l,onChange:k=>c(k.target.value)})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Or total amount (R)"}),i.jsx(ae,{type:"number",inputMode:"decimal",step:"0.01",min:"0",value:u,onChange:k=>d(k.target.value),placeholder:"Use this if you only know the total"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Vendor / note (optional)"}),i.jsx(ae,{value:h,onChange:k=>f(k.target.value),placeholder:"e.g. Co-op, Epol, Makro",maxLength:80})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Date"}),i.jsx(ae,{type:"date",value:m,onChange:k=>
926g(k.target.value),required:!0})]}),i.jsxs("div",{className:"rounded-lg bg-secondary/50 p-3 flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Total"}),i.jsxs("span",{className:"text-xl font-bold text-red-600",children:["âR",j.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]})]}),i.jsx(U,{type:"submit",className:"w-full",disabled:!j,children:"Save expense"})]})]})]})}const fr=e=>`R${e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}`;function KFe(e){return new Date(e.getFullYear(),e.getMonth(),1)}function GFe(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function YFe(e){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1).toLocaleDateString(void 0,{month:"short",year:"numeric"})}function XFe(e){const t=new Date,n=t.toISOString().split("T")[0],r=KFe(t),s=new Date(t.getFullYear(),t.getMonth()-1,1),a=(S,N)=>{const k=new Date(S.date);return k.getFullYear()===N.getFullYear()&&k.getMonth()===N.getMonth()},o=(S,N)=>S.filter(k=>k.type===N).reduce((k,_)=>k+Number(_.amount),0),l=e.filter(S=>S.date===n),c=e.filter(S=>a(S,r)),u=e.filter(S=>a(S,s)),d=o(c,"income"),h=o(c,"expense"),f=o(u,"income"),m=o(u,"expense"),g=(S,N)=>N===0?null:Math.round((S-N)/N*100),p=[];for(let S=5;S>=0;S--){const N=new Date(t.getFullYear(),t.getMonth()-S,1),k=e.filter(A=>a(A,N)),_=o(k,"income"),C=o(k,"expense");p.push({key:GFe(N),income:_,expenses:C,profit:_-C})}const x={};c.filter(S=>S.type==="expense").forEach(S=>{x[S.category]=(x[S.category]||0)+Number(S.amount)});const v=Object.entries(x).map(([S,N])=>({category:S,amount:N,percentage:h>0?Math.round(N/h*100):0})).sort((S,N)=>N.amount-S.amount),b={};c.filter(S=>S.type==="income").forEach(S=>{b[S.category]=(b[S.category]||0)+Number(S.amount)});const w=Object.entries(b).sort((S,N)=>N[1]-S[1])[0]??null,j=d>0?Math.round((d-h)/d*100):0;return{today:{income:o(l,"income"),expenses:o(l,"expense"),count:l.length},current:{income:d,expenses:h,profit:d-h,incomeDelta:g(d,f),expenseDelta:g(h,m),profitDelta:g(d-h,f-m),margin:j},months:p,expenseCategories:v,topSeller:w,recent:e.slice(0,15)}}function JFe(e){const t=["Date","Type","Category","Description","Quantity","Unit","Unit Price","Amount (R)"],n=e.map(l=>[l.date,l.type,l.category,l.description.replace(/"/g,'""'),l.quantity??"",l.unit??"",l.unit_price??"",l.amount]),r=[t,...n].map(l
926=>l.map(c=>`"${String(c)}"`).join(",")).join(` 927`),s=new Blob([r],{type:"text/csv;charset=utf-8"}),a=URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=`flockify-finance-${new Date().toISOString().split("T")[0]}.csv`,o.click(),URL.revokeObjectURL(a)}function P1({delta:e,invert:t=!1}){if(e===null)return i.jsx("span",{className:"text-xs text-muted-foreground",children:"No prior month"});const n=t?e<0:e>0,r=e===0;return i.jsxs("span",{className:`text-xs font-medium ${r?"text-muted-foreground":n?"text-green-600":"text-red-600"}`,children:[e>0?"+":"",e,"% vs last month"]})}function Jq(){const{isAuthenticated:e,isLoading:t}=Sw(),{records:n,isLoading:r,deleteRecord:s}=jg(),a=y.useMemo(()=>XFe(n),[n]),o=n.length>0,l=Math.max(1,...a.months.flatMap(c=>[c.income,c.expenses]));return r?i.jsx("div",{className:"min-h-screen p-4 pb-20 flex items-center justify-center",children:i.jsx("p",{className:"text-muted-foreground",children:"Loadingâ¦"})}):i.jsx("div",{className:"min-h-screen p-4 pb-20",children:i.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[i.jsx("div",{className:"glass-hero p-6 md:p-8 relative z-10",children:i.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Finance"}),i.jsx("p",{className:"text-muted-foreground",children:"Track sales, expenses and what you really make."})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(Dy,{}),i.jsx(A1,{}),i.jsx(F4,{})]})]})}),!t&&!e&&i.jsx(jw,{title:"Sign in to track finances",description:"Log sales and expenses to see real profit and trends.",feature:"financial tracking"}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 md:p-5 flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Today"}),i.jsxs("p",{className:"text-2xl font-bold",children:[fr(a.today.income)," ",i.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:["in sales · ",a.today.count," ",a.today.count===1?"entry":"entries"]})]}),a.today.expenses>0&&i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Expenses today: ",fr(a.today.expenses)]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(Dy,{trigger:i.jsxs(U,{size:"lg",className:"gap-2",children:[i.jsx(hO,{className:"h-4 w-4"}),"Log today's sale"]})}),i.jsx(A1,{trigger:i.jsxs(U,{size:"lg",variant:"outline",className:"gap-2",children:[i.jsx(tN,{className:"h-4 w-4"}),"Log expense"]})})]})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsxs(z,{className:"glass-card border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-950/20",children:[i.jsxs(re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(se,{className:"text-sm font-medium",children:"Income this month"}),i.jsx(Wt,{className:"h-4 w-4 text-green-600"})]}),i.jsxs(V,{children:[i.jsx("div",{className:"text-2xl font-bold text-green-700 dark:text-green-400",children:fr(a.current.income)}),i.jsx("p",{className:"mt-1",children:i.jsx(P1,{delta:a.current.incomeDelta})})]})]}),i.jsxs(z,{className:"glass-card border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-950/20",children:[i.jsxs(re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(se,{className:"text-sm font-medium",children:"Expenses this month"}),i.jsx(tN,{className:"h-4 w-4 text-red-600"})]}),i.jsxs(V,{children:[i.jsx("div",{className:"text-2xl font-bold text-red-700 dark:text-red-400",children:fr(a.current.expenses)}),i.jsx("p",{className:"mt-1",children:i.jsx(P1,{delta:a.current.expenseDelta,invert:!0})})]})]}),i.jsxs(z,{className:"glass-card border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/20",children:[i.jsxs(re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[i.jsx(se,{className:"text-sm font-medium",children:"Net profit"}),i.jsx(hO,{className:"h-4 w-4 text-blue-600"})]}),i.jsxs(V,{children:[i.jsx("div",{className:"text-2xl font-bold text-blue-700 dark:text-blue-400",children:fr(a.current.profit)}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Margin: ",a.current.margin,"% · ",i.jsx(P1,{delta:a.current.profitDelta})]})]})]})]}),a.topSeller&&i.jsx(z,{className:"glass-card border-amber-200 bg-amber-50/50 dark:border-amber-800 dark:bg-amber-950/20",children:i.jsxs(V,{className:"p-4 flex items-center gap-3",children:[i.jsx(dee,{className:"h-5 w-5 text-amber-600"}),i.jsxs("div",{className:"text-sm",children:[i.jsx("span",{className:"font-medium",children:a.topSeller[0]})," is your top earner this month â"," ",i.jsx("span",{className:"font-semibold",children:fr(a.topSeller[1])}),"."]})]})}),i.jsxs(Bc,{defaultValue:"overview",className:"space-y-4",children:[i.jsxs(jl,{className:"grid w-full grid-cols-3",children:[i.jsx(pt,{value:"overview",children:"Trend"}),i.jsx(pt,{value:"expenses",children:"Expenses"}),i.jsx(pt,{value:"transactions",children:"Entries"})]}),i.jsx(tt,{value:"overview",className:"space-y-4",children:i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(ys,{className:"h-5 w-5"}),"6-month performance"]}),i.jsx(_n,{children:"Real numbers from your entries."})]}),i.jsx(V,{children:o?i.jsx("div",{className:"space-y-3",children:a.months.map(c=>i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"font-medium",children:YFe(c.key)}),i.jsxs("span",{className:c.profit>=0?"text-green-600":"text-red-600",children:[fr(c.profit)," profit"]})]}),i.jsxs("div",{className:"flex h-3 rounded-full overflow-hidden bg-muted",children:[i.jsx("div",{className:"bg-green-500",style:{width:`${c.income/l*50}%`},title:`Income ${fr(c.income)}`}),i.jsx("div",{className:"bg-red-400",style:{width:`${c.expenses/l*50}%`},title:`Expenses ${fr(c.expenses)}`})]}),i.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[i.jsxs("span",{children:["Income ",fr(c.income)]}),i.jsxs("span",{children:["Expenses ",fr(c.expenses)]})]})]},c.key))}):i.jsxs("div",{className:"text-center py-8",children:[i.jsx("p",{className:"text-muted-foreground",children:"No entries yet"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Log a sale to start seeing trends."}),i.jsx("div",{className:"mt-4",children:i.jsx(Dy,{})})]})})]})}),i.jsx(tt,{value:"expenses",className:"space-y-4",children:i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(uB,{className:"h-5 w-5"}),"Expense breakdown â this month"]}),i.jsx(_n,{children:"Find where money is leaking."})]}),i.jsx(V,{children:a.expenseCategories.length===0?i.jsx("div",{className:"text-center py-8",children:i.jsx("p",{className:"text-muted-foreground",children:"No expenses recorded this month"})}):i.jsx("div",{className:"space-y-4",children:a.expenseCategories.map(c=>i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"font-medium",children:c.category}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[fr(c.amount)," (",c.percentage,"%)"]})]}),i.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:i.jsx("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${c.percentage}%`}})})]},c.category))})})]})}),i.jsx(tt,{value:"transactions",className:"space-y-4",children:i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{className:"flex flex-row items-center justify-between",children:[i.jsxs("div",{children:[i.jsx(se,{children:"Recent entries"}),i.jsx(_n,{children:"Latest 15 sales and expenses."})]}),i.jsxs(U,{size:"sm",variant:"outline",className:"gap-2",onClick:()=>JFe(n),disabled:!o,children:[i.jsx(qo,{className:"h-4 w-4"}),"Export CSV"]})]}),i.jsx(V,{children:a.recent.length===0?i.jsxs("div",{className:"text-center py-8",children:[i.jsx("p",{className:"text-muted-foreground",children:"No entries yet"}),i.jsxs("div",{className:"mt-4 flex justify-center gap-2 flex-wrap",children:[i.jsx(Dy,{}),i.jsx(A1,{}),i.jsx(F4,{})]})]}):i.jsx("div",{className:"space-y-2",children:a.recent.map(c=>i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-muted/30",children:[i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[i.jsx("div",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${c.type==="income"?"bg-green-500":"bg-red-500"}`}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"font-medium truncate",children:c.description}),i.jsxs("p",{className:"text-xs text-muted-foreground truncate",children:[c.category,c.quantity&&c.unit?` · ${c.quantity} ${c.unit}${Number(c.quantity)!==1?"s":""}`:"",c.unit_price?` @ ${fr(Number(c.unit_price))}`:""]})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"text-right",children:[i.jsxs("p",{className:`font-semibold ${c.type==="income"?"text-green-600":"text-red-600"}`,children:[c.type==="income"?"+":"-",fr(Number(c.amount))]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(c.date).toLocaleDateString()})]}),i.jsx(U,{size:"icon",variant:"ghost",className:"h-8 w-8 text-muted-foreground hover:text-red-600",onClick:()=>s(c.id),"aria-label":"Delete entry",children:i.jsx(cl,{className:"h-4 w-4"})})]})]},c.id))})})]})})]})]})})}function Qq({birdType:e,flockSize:t,currentWeek:n,currentWeight:r=0,eggProductionRate:s=0,feedConversionRatio:a=1.8,mortalityRate:o=2}){const l=wg(e),c=l.growthTargets[n]||0,u=n>=l.marketReadyWeeks,h=(()=>{switch(e){case"broiler":return{primary:{title:"Market Weight Progress",value:`${r.toFixed(2)}kg`,target:`Target: ${c.toFixed(2)}kg`,progress:r/c*100,status:r>=c?"good":r>=c*.9?"warning":"poor"},secondary:[{title:"Feed Conversion Ratio",value:a.toFixed(2),status:a<=1.8?"good":a<=2.2?"warning":"poor",description:"Feed:Weight gain ratio"},{title:"Market Readiness",value:u?"Ready":`${l.marketReadyWeeks-n} weeks`,status:u?"good":"pending",description:u?"Ready for processing":"Time to market"}]};case"layer":return{primary:{title:"Egg Production Rate",value:`${s.toFixed(1)}%`,target:"Target: 85-90%",progress:s/90*100,status:s>=85?"good":s>=70?"warning":"poor"},secondary:[{title:"Laying Phase",value:n>=18?"Active":"Growing",status:n>=18?"good":"pending",description:n>=18?"In laying period":"Pre-laying development"},{title:"Daily Egg Estimate",value:`${Math.round(t*s/100)} eggs`,status:"info",description:"Expected daily production"}]};case"mixed":const g=o<=3?85:o<=5?70:50;return{primary:{title:"Flock Performance",value:"Balanced",target:"Dual-purpose optimization",progress:g,status:g>=80?"good":g>=60?"warning":"poor"},secondary:[{title:"Production Flexibility",value:"High",status:"good",description:"Meat & egg options available"},{title:"Resource Efficiency",value:`${a.toFixed(2)} FCR`,status:a<=2.5?"good":"warning",description:"Feed utilization efficie
927ncy"}]};default:return{primary:{title:"",value:"",target:"",progress:0,status:"info"},secondary:[]}}})(),f=g=>{switch(g){case"good":return"text-green-600 bg-green-50";case"warning":return"text-yellow-600 bg-yellow-50";case"poor":return"text-red-600 bg-red-50";case"pending":return"text-blue-600 bg-blue-50";default:return"text-gray-600 bg-gray-50"}},m=g=>{switch(g){case"good":return i.jsx(Dt,{className:"h-4 w-4"});case"warning":case"poor":return i.jsx(Ra,{className:"h-4 w-4"});case"pending":return i.jsx(js,{className:"h-4 w-4"});default:return i.jsx(Gb,{className:"h-4 w-4"})}};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs(se,{className:"flex items-center justify-between",children:[i.jsx("span",{children:l.name}),i.jsxs(ye,{variant:"outline",children:[t," birds"]})]})}),i.jsx(V,{children:i.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[i.jsxs("div",{children:["Focus: ",l.primaryMetrics.join(", ")]}),i.jsxs("div",{children:["Current Age: ",n," weeks"]}),i.jsxs("div",{children:["Key Indicators: ",l.keyHealthIndicators.slice(0,2).join(", ")]})]})})]}),i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs(se,{className:"flex items-center gap-2",children:[e==="broiler"&&i.jsx(wE,{className:"h-5 w-5"}),e==="layer"&&i.jsx(yE,{className:"h-5 w-5"}),e==="mixed"&&i.jsx(Wt,{className:"h-5 w-5"}),h.primary.title]})}),i.jsx(V,{children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"text-3xl font-bold",children:h.primary.value}),i.jsxs("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-sm ${f(h.primary.status)}`,children:[m(h.primary.status),h.primary.status]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-sm text-muted-foreground",children:h.primary.target}),i.jsx(rr,{value:Math.min(h.primary.progress,100),className:"h-2"})]})]})})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:h.secondary.map((g,p)=>i.jsx(z,{children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"font-semibold text-sm",children:g.title}),i.jsx("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs ${f(g.status)}`,children:m(g.status)})]}),i.jsx("div",{className:"text-2xl font-bold",children:g.value}),i.jsx("div",{className:"text-xs text-muted-foreground",children:g.description})]})})},p))}),i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(Sc,{className:"h-5 w-5"}),"Market Considerations"]})}),i.jsx(V,{children:i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:l.marketConsiderations.map((g,p)=>i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx("div",{className:"w-2 h-2 bg-primary rounded-full"}),g]},p))})})]}),o>5&&i.jsx(z,{className:"border-destructive",children:i.jsxs(V,{className:"p-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[i.jsx(Ra,{className:"h-5 w-5"}),i.jsx("span",{className:"font-semibold",children:"High Mortality Alert"})]}),i.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Current mortality rate: ",o,"% - Monitor flock health closely"]})]})})]})}const rP=()=>{const[e,t]=y.useState([]),[n,r]=y.useState(!0),{toast:s}=We(),a=async()=>{try{const{data:{user:u}}=await q.auth.getUser();if(!u){t([]),r(!1);return}const{data:d}=await q.from("profiles").select("*").eq("user_id",u.id).maybeSingle();if(!d){r(!1);return}let h=q.from("flocks").select("*");d.user_type==="farmer"?h=h.eq("farmer_id",d.id):d.user_type==="incubator"&&(h=h.eq("incubator_id",d.id));const{data:f,error:m}=await h.order("created_at",{ascending:!1});if(m){console.error("Error fetching flocks:",m),s({title:"Error",description:"Failed to load flock data",variant:"destructive"});return}t(f||[])}catch(u){console.error("Flock fetch error:",u)}finally{r(!1)}},o=async u=>{try{const{data:{user:d}}=await q.auth.getUser();if(!d){s({title:"Authentication Required",description:"Please log in to add a flock",variant:"destructive"});return}const{data:h}=await q.from("profiles").select("*").eq("user_id",d.id).maybeSingle();if(!h){s({title:"Profile Required",description:"Please complete your profile setup first",variant:"destructive"});return}const{data:f,error:m}=await q.from("flocks").insert({...u,farmer_id:h.id,incubator_id:h.incubator_id}).select().single();if(m){console.error("Error adding flock:",m),s({title:"Error",description:"Failed to add flock",variant:"destructive"});return}return t(g=>[f,...g]),s({title:"Success",description:"Flock added successfully"}),f}catch(d){console.error("Add flock error:",d)}},l=async(u,d)=>{try{const{error:h}=await q.from("flocks").update(d).eq("id",u);if(h){console.error("Error updating flock:",h),s({title:"Error",description:"Failed to update flock",variant:"destructive"});return}t(f=>f.map(m=>m.id===u?{...m,...d}:m)),s({title:"Success",description:"Flock updated successfully"})}catch(h){console.error("Update flock error:",h)}},c=async u=>{try{const{error:d}=await q.from("flocks").delete().eq("id",u);if(d){console.error("Error deleting flock:",d),s({title:"Error",description:"Failed to delete flock",variant:"destructive"});return}t(h=>h.filter(f=>f.id!==u)),s({title:"Success",description:"Flock deleted successfully"})}catch(d){console.error("Delete flock error:",d)}};return y.useEffect(()=>{a();const{data:{subscription:u}}=q.auth.onAuthStateChange(h=>{h==="SIGNED_IN"?setTimeout(()=>{a()},0):h==="SIGNED_OUT"&&t([])}),d=q.channel("flocks-changes").on("postgres_changes",{event:"*",schema:"public",table:"flocks"},h=>{console.log("Flock change detected:",h),h.eventType==="INSERT"?t(f=>f.find(g=>g.id===h.new.id)?f:[h.new,...f]):h.eventType==="UPDATE"?t(f=>f.map(m=>m.id===h.new.id?h.new:m)):h.eventType==="DELETE"&&t(f=>f.filter(m=>m.id!==h.old.id))}).subscribe();return()=>{u.unsubscribe(),q.removeChannel(d)}},[]),{flocks:e,loading:n,addFlock:o,updateFlock:l,deleteFlock:c,refetch:a}},B4=["Clean water daily prevents disease spread and keeps your flock healthy","Monitor temperature regularly - chickens are sensitive to heat and cold","Fresh feed improves egg production and overall bird health significantly","Regular vaccinations keep your flock healthy and prevent costly diseases","Check for signs of illness t
927wice daily - early detection saves lives","Maintain proper ventilation in coops to prevent respiratory problems","Record daily egg production for better tracking and income planning","Biosecurity measures prevent disease outbreaks in your farm","Proper lighting schedules can increase egg production by 15-20%","Clean nesting boxes weekly to maintain egg hygiene standards","Feed at consistent times daily to establish routine and reduce stress","Provide adequate space - overcrowding leads to fighting and disease","Check feed quality regularly - moldy feed can poison your birds","Maintain clean feeders to prevent contamination and food waste","Monitor water consumption - changes indicate health problems","Separate sick birds immediately to prevent disease spread","Use deep litter system for better insulation and manure management","Collect eggs multiple times daily to prevent breakage and soiling","Keep accurate records of feed consumption and production costs","Dust baths help chickens maintain feather condition and remove parasites","Quarantine new birds for at least 2 weeks before mixing flocks","Provide shade during hot weather to prevent heat stress","Install perches at proper height for comfortable roosting","Monitor mortality rates - high rates indicate management issues","Store feed in sealed containers to prevent pest contamination","Regular health checks by veterinarians prevent major problems","Proper drainage prevents wet conditions that breed disease","Gradual feed changes prevent digestive upset in your flock","Clean eggs immediately after collection for better market value","Track growth rates to optimize feeding programs and profits","Emergency planning helps you respond quickly to disease outbreaks"];function QFe(){const[e,t]=y.useState("");return y.useEffect(()=>{const n=new Date,s=Math.floor((n.getTime()-new Date(n.getFullYear(),0,0).getTime())/(1e3*60*60*24))%B4.length;t(B4[s])},[]),{currentTip:e}}const ZFe="flockify:geo:",e6e="flockify:wx:",z4=10*60*1e3,t6e={0:"Clear",1:"Mainly clear",2:"Partly cloudy",3:"Overcast",45:"Fog",48:"Fog",51:"Light drizzle",53:"Drizzle",55:"Heavy drizzle",61:"Light rain",63:"Rain",65:"Heavy rain",71:"Light snow",73:"Snow",75:"Heavy snow",80:"Rain showers",81:"Rain showers",82:"Violent rain showers",95:"Thunderstorm",96:"Thunderstorm with hail",99:"Thunderstorm with hail"};async function n6e(e){var n;const t=ZFe+e.toLowerCase();try{const r=localStorage.getItem(t);if(r)return JSON.parse(r)}catch{}try{const r=e.replace(/-/g," ").split(",")[0].trim(),s=`https://geocoding-api.open-meteo.com/v1/search?name=${encodeURIComponent(r)}&count=1&language=en&format=json&country=ZA`,a=await fetch(s);if(!a.ok)throw new Error(`Geocode failed: ${a.status}`);const l=(n=(await a.json()).results)==null?void 0:n[0];if(!l)return null;const c={latitude:l.latitude,longitude:l.longitude,resolvedName:l.name+(l.admin1?`, ${l.admin1}`:"")};try{localStorage.setItem(t,JSON.stringify(c))}catch{}return c}catch(r){return console.error("Geocoding error:",r),null}}async function r6e(e,t){try{const n=`https://api.open-meteo.com/v1/forecast?latitude=${e.latitude}&longitude=${e.longitude}¤t=temperature_2m,relative_humidity_2m,weather_code,wind_speed_10m&timezone=auto`,r=await fetch(n);if(!r.ok)throw new Error(`Weather fetch failed: ${r.status}`);const a=(await r.json()).current;return a?{temperature:Math.round(a.temperature_2m*10)/10,humidity:Math.round(a.relative_humidity_2m),location:e.resolvedName||t,condition:t6e[a.weather_code]??"Unknown",windSpeed:Math.round(a.wind_speed_10m)}:null}catch(n){return console.error("Weather fetch error:",n),null}}const Zq=e=>{const[t,n]=y.useState({temperature:22,humidity:65,location:"Unknown"}),[r,s]=y.useState(!1),a=async o=>{if(!o)return;const l=e6e+o.toLowerCase();try{const c=localStorage.getItem(l);if(c){const u=JSON.parse(c);if(Date.now()-u.fetchedAt<z4){n(u.data);return}}}catch{}s(!0);try{const c=await n6e(o);if(!c){n(d=>({...d,location:o}));return}const u=await r6e(c,o);if(u){n(u);try{localStorage.setItem(l,JSON.stringify({data:u,fetchedAt:Date.now()}))}catch{}}}finally{s(!1)}};return y.useEffect(()=>{if(!e)return;a(e);const o=setInterval(()=>a(e),z4);return()=>clearInterval(o)},[e]),{weatherData:t,loading:r,refetch:()=>e&&a(e)}};function s6e(){const{isPastDue:e,isPending:t,needsRenewal:n,daysUntilRenewal:r,
927subscription:s}=Bh();if(!e&&!t&&!n)return null;if(t)return i.jsxs("div",{className:"bg-gradient-to-r from-primary/15 via-secondary/15 to-primary/10 border border-primary/30 text-foreground rounded-lg p-3 flex items-center gap-3 mb-4",children:[i.jsx(qr,{className:"h-4 w-4 shrink-0 text-primary"}),i.jsxs("span",{className:"text-sm",children:[i.jsx("strong",{children:"You're in."})," Enjoy full access while we verify your payment (usually within 24 hours)."]})]});if(n&&!e&&!(s!=null&&s.cancel_at_period_end)){const a=Math.max(r??0,0);return i.jsxs("div",{className:"bg-secondary/20 border border-secondary/40 text-foreground rounded-lg p-3 flex items-center justify-between gap-3 mb-4",children:[i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsx(js,{className:"h-4 w-4 mt-0.5 shrink-0 text-primary"}),i.jsxs("span",{children:["Your plan ends in ",a," day",a===1?"":"s",". Renew now to keep your premium features."]})]}),i.jsx(U,{size:"sm",asChild:!0,children:i.jsx(Ke,{to:"/pricing",children:"Renew"})})]})}return i.jsxs("div",{className:"bg-destructive/10 border border-destructive/30 text-destructive rounded-lg p-3 flex items-center justify-between gap-3 mb-4",children:[i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsx(Ra,{className:"h-4 w-4 mt-0.5 shrink-0"}),i.jsx("span",{children:"Your last payment failed. Renew your subscription to keep your premium features."})]}),i.jsx(U,{size:"sm",variant:"destructive",asChild:!0,children:i.jsx(Ke,{to:"/pricing",children:"Renew"})})]})}const eK=e=>`flockify:farmBrief:${e}`;function i6e(e,t){try{localStorage.setItem(eK(e),JSON.stringify({brief:t,savedAt:Date.now()}))}catch{}}function tK(e){try{const t=localStorage.getItem(eK(e));if(!t)return null;const{brief:n}=JSON.parse(t);return n??null}catch{return null}}function a6e(e){const t=[];return e.hasFlocks?t.push({id:"weekly-weights",kind:"weight_check",title:"Weekly weight check",due:"In 2 days",severity:"info"},{id:"vacc-review",kind:"vaccination",title:"Review vaccination schedule",due:"In 5 days",severity:"info"}):t.push({id:"first-flock",kind:"biosecurity",title:"Add your first flock to start tracking",due:"Today",severity:"info"}),e.weatherTemp!==void 0&&e.weatherTemp>30&&t.push({id:"heat-stress",kind:"weather",title:"Heat stress watch â check water and ventilation",due:"Today",severity:"warning"}),t}const o6e=()=>{const e=new Date().getHours();return e<12?"Good Morning":e<18?"Good Afternoon":"Good Evening"};function U4({activeTab:e,onTabChange:t}){const[n,r]=y.useState(null),[s,a]=y.useState(null),[o,l]=y.useState(null),{flocks:c=[],loading:u}=rP(),{currentTip:d}=QFe(),{profile:h}=Cr(),{weatherData:f}=Zq(h==null?void 0:h.location),{records:m=[]}=jg();y.useEffect(()=>{let N=!1;q.auth.getUser().then(({data:k})=>{N||!k.user||l(tK(k.user.id))});try{sessionStorage.getItem("flockify:openScanner")==="1"&&(sessionStorage.removeItem("flockify:openScanner"),r("health-scanner"))}catch{}return()=>{N=!0}},[]);const g=a6e({hasFlocks:c.length>0,weatherTemp:f==null?void 0:f.temperature}),p=c.reduce((N,k)=>N+k.count,0),x=c.filter(N=>N.health_status==="healthy").length,v=c.length>0?Math.round(x/c.length*100):100,b=m.filter(N=>N.type==="income").reduce((N,k)=>N+Number(k.amount),0),w=m.filter(N=>N.type==="expense").reduce((N,k)=>N+Number(k.amount),0),j=c.filter(N=>N.health_status==="sick"),S=(N,k)=>{a(k||null),r(N)};return n==="health-scanner"?i.jsx(kxe,{onBack:()=>r(null)}):n==="growth"?i.jsxs("div",{className:"p-4 pb-20",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>r(null),children:[i.jsx(jt,{className:"h-4 w-4 mr-1"})," Back"]}),i.jsxs("h1",{className:"text-xl font-bold ml-2",children:["Growth Tracker ",s&&`- ${s.name}`]})]}),i.jsx(Sq,{})]}):n==="feed"?i.jsxs("div",{className:"p-4 pb-20",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>r(null),children:[i.jsx(jt,{className:"h-4 w-4 mr-1"})," Back"]}),i.jsx("h1",{className:"text-xl font-bold ml-2",children:"Feed Calculator"})]}),i.jsx(bFe,{})]}):n==="marketplace"?i.jsxs("div",{className:"p-4 pb-20",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>r(null),children:[i.jsx(jt,{className:"h-4 w-4 mr-1"})," Back"]}),i.jsx("h1",{className:"text-xl font-bold ml-2",children:"Marketplace"})]}),i.jsx(AFe,{})]}):n==="finance"?i.jsxs("div",{className:"p-4 pb-20",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>r(null),children:[i.jsx(jt,{className:"h-4 w-4 mr-1"})," Back"]}),i.jsx("h1",{className:"text-xl font-bold ml-2",children:"Finance"})]}),i.jsx(Jq,{})]}):n==="type-dashboard"&&s?i.jsxs("div",{className:"p-4 pb-20",children:[i.jsxs("div",{className:"flex items-center mb-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>r(null),children:[i.jsx(jt,{className:"h-4 w-4 mr-1"})," Back"]}),i.jsxs("h1",{className:"text-xl font-bold ml-2",children:[s.name," Dashboard"]})]}),i.jsx(Qq,{birdType:s.bird_type,flockSize:s.count,currentWeek:s.age_weeks})]}):i.jsx("div",{className:"relative min-h-screen pb-24 overflow-hidden bg-gradient-bg aurora-blobs",children:i.jsxs("div",{className:"relative z-10 p-4 space-y-5",children:[i.jsx(s6e,{}),i.jsxs("div",{className:"relative glass-hero p-5 sm:p-6 animate-float-in overflow-hidden",children:[i.jsx("div",{className:"absolute -top-10 -right-10 h-40 w-40 rounded-full bg-primary/30 blur-2xl pointer-events-none"}),i.jsxs("div",{className:"relative flex flex-col gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-semibold tracking-widest uppercase text-secondary/80",children:o6e()}),i.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground leading-tight mt-1",children:h!=null&&h.display_name?h.display_name.split(" ")[0]:"Welcome"}
927),i.jsx("p",{className:"text-sm text-foreground/70 mt-1",children:u?"Loading your farm...":c.length>0?`${p} birds across ${c.length} flock${c.length>1?"s":""}`:"Let's set up your first flock"})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("div",{className:"glass-pill inline-flex items-center gap-1.5 text-xs px-3 py-1.5",children:[i.jsx(lee,{className:"h-3.5 w-3.5"}),i.jsxs("span",{className:"font-medium",children:[f.temperature,"°C"]})]}),i.jsxs("div",{className:"glass-pill inline-flex items-center gap-1.5 text-xs px-3 py-1.5",children:[i.jsx(mB,{className:"h-3.5 w-3.5"}),i.jsxs("span",{className:"font-medium",children:[f.humidity,"%"]})]}),f.location&&i.jsxs("div",{className:"glass-pill inline-flex items-center gap-1.5 text-xs px-3 py-1.5",children:[i.jsx(ts,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"font-medium truncate max-w-[140px]",children:f.location})]})]})]})]}),i.jsx(z,{onClick:()=>S("health-scanner"),className:"glass-card cursor-pointer bg-gradient-to-br from-primary to-secondary text-foreground hover:shadow-glow transition-all active:scale-[0.99] animate-scale-in overflow-hidden",children:i.jsxs(V,{className:"p-5 flex items-center gap-4",children:[i.jsx("div",{className:"bg-white/15 p-3.5 rounded-2xl shrink-0",children:i.jsx(xa,{
927className:"h-8 w-8"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"text-lg font-bold leading-tight",children:"Scan Chicken with AI"}),i.jsx("p",{className:"text-xs opacity-85 mt-0.5",children:"Get an instant clinical-style health report and recommendations."})]}),i.jsx(Qs,{className:"h-5 w-5 shrink-0"})]})}),o&&i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 animate-fade-in",children:[i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 flex items-center gap-3",children:[i.jsx("div",{className:"bg-primary/10 p-2.5 rounded-xl",children:i.jsx(Zs,{className:"h-5 w-5 text-primary"})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground font-medium",children:"Farm Health Score"}),i.jsx("div",{className:"text-2xl font-bold text-primary",children:o.healthScore})]})]})}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 flex gap-3",children:[i.jsx("div",{className:"bg-secondary/15 p-2 rounded-xl shrink-0 h-fit",children:i.jsx(an,{className:"h-4 w-4 text-secondary"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-xs font-semibold text-secondary mb-0.5",children:"AI Assistant"}),i.jsx("p",{className:"text-xs leading-snug line-clamp-3",children:o.recommendation})]})]})})]}),g.length>0&&i.jsx(z,{className:"glass-card animate-fade-in",children:i.jsxs(V,{className:"p-4 space-y-2",children:[i.jsxs("h3",{className:"text-sm font-bold flex items-center gap-2",children:[i.jsx(cc,{className:"h-4 w-4 text-primary"})," Upcoming Reminders"]}),i.jsx("div",{className:"space-y-1.5",children:g.slice(0,3).map(N=>i.jsxs("div",{className:"flex items-center justify-between text-xs py-1.5 border-b border-border/40 last:border-0",children:[i.jsx("span",{className:"font-medium truncate pr-2",children:N.title}),i.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full shrink-0 ${N.severity==="critical"?"bg-destructive/10 text-destructive":N.severity==="warning"?"bg-warning/10 text-warning":"bg-muted text-muted-foreground"}`,children:N.due})]},N.id))})]})}),j.length>0&&i.jsx(z,{className:"glass-card border-destructive/30 bg-destructive/5 animate-scale-in",children:i.jsxs(V,{className:"p-3 flex items-center gap-3",children:[i.jsx("div",{className:"bg-destructive/10 p-2 rounded-full shrink-0",children:i.jsx(Ra,{className:"h-4 w-4 text-destructive"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-sm font-semibold text-destructive",children:"Health Alert"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[j.map(N=>N.name).join(", ")," ",j.length===1?"needs":"need"," attention"]})]}),i.jsx(U,{size:"sm",variant:"outline",className:"shrink-0 text-xs border-destructive/30 text-destructive",onClick:()=>S("health-scanner",j[0]),children:"Scan"})]})}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 animate-float-in",style:{animationDelay:"0.1s"},children:[i.jsx(z,{className:"glass-card overflow-hidden",children:i.jsxs(V,{className:"p-4 flex items-center gap-3",children:[i.jsx("div",{className:"bg-primary/10 p-2.5 rounded-xl",children:i.jsx(Ho,{className:"h-5 w-5 text-primary"})}),i.jsxs("div",{children:[i.jsx("div",{className:"text-2xl font-bold",children:p}),i.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Birds"})]})]})}),i.jsx(z,{className:"glass-card overflow-hidden",children:i.jsxs(V,{className:"p-4 flex items-center gap-3",children:[i.jsx("div",{className:"bg-success/10 p-2.5 rounded-xl",children:i.jsx(Zs,{className:"h-5 w-5 text-success"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-2xl font-bold",children:[v,"%"]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:"Healthy"})]})]})}),i.jsx(z,{className:"glass-card overflow-hidden",children:i.jsxs(V,{className:"p-4 flex items-center gap-3",children:[i.jsx("div",{className:"bg-primary/10 p-2.5 rounded-xl",children:i.jsx(Wt,{className:"h-5 w-5 text-primary"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-2xl font-bold",children:["R",b>999?`${(b/1e3).toFixed(1)}k`:b]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:"Income"})]})]})}),i.jsx(z,{className:"glass-card overflow-hidden",children:i.jsxs(V,{className:"p-4 flex items-center gap-3",children:[i.jsx("div",{className:"bg-accent/10 p-2.5 rounded-xl",children:i.jsx(Sc,{className:"h-5 w-5 text-accent"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-2xl font-bold",children:["R",w>999?`${(w/1e3).toFixed(1)}k`:w]}),i.jsx("div",{className:"text-xs text-muted-foreground",children:"Expenses"})]})]})})]}),i.jsx(z,{className:"glass-card bg-gradient-primary text-foreground cursor-pointer hover:shadow-glow transition-all active:scale-[0.98] animate-float-in",style:{animationDelay:"0.15s"},onClick:()=>t==null?void 0:t("daily-log"),children:i.jsxs(V,{className:"p-4 flex items-center gap-4",children:[i.jsx("div",{className:"bg-foreground
927/10 p-3 rounded-xl",children:i.jsx(cc,{className:"h-6 w-6 text-foreground"})}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-bold text-base text-foreground",children:"Log Today's Operations"}),i.jsx("p",{className:"text-xs text-foreground/80",children:"Feed, eggs, mortality â keep your records up to date"})]}),i.jsx(Qs,{className:"h-5 w-5 text-foreground/70"})]})}),i.jsxs("div",{className:"space-y-3 animate-float-in",style:{animationDelay:"0.18s"},children:[i.jsx("h2",{className:"text-lg font-bold",children:"Quick Tools"}),i.jsx("div",{className:"grid grid-cols-4 gap-3",children:[{icon:xa,label:"Health AI",action:()=>S("health-scanner")},{icon:cB,label:"Feed Calc",action:()=>S("feed")},{icon:Sc,label:"Finance",action:()=>S("finance")},{icon:mo,label:"Market",action:()=>S("marketplace")},{icon:Oa,label:"Learn",action:()=>window.location.href="/learning"},{icon:Wt,label:"Growth",action:()=>S("growth")},...(h==null?void 0:h.user_type)==="lecturer"?[{icon:ht,label:"Lecturer",action:()=>window.location.href="/lecturer"}]:[],...(h==null?void 0:h.user_type)==="college_admin"?[{icon:ht,label:"College",action:()=>window.location.href="/college-admin"}]:[],...(h==null?void 0:h.user_type)!=="lecturer"&&(h==null?void 0:h.user_type)!=="college_admin"?[{icon:ht,label:"Manage",action:()=>t==null?void 0:t("flock")}]:[],{icon:Qs,label:"More",action:()=>t==null?void 0:t("profile")}].map((N,k)=>i.jsxs("button",{className:"glass-tile flex flex-col items-center gap-1.5 p-3 hover:shadow-elegant hover:border-primary/30 transition-all touch-manipulation active:scale-95",onClick:N.action,children:[i.jsx("div",{className:"bg-primary/15 p-2 rounded-xl",children:i.jsx(N.icon,{className:"h-5 w-5 text-primary"})}),i.jsx("span",{className:"text-[11px] font-medium text-foreground",children:N.label})]},k))})]}),i.jsxs("div",{className:"space-y-3 animate-float-in",style:{animationDelay:"0.2s"},children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h2",{className:"text-lg font-bold",children:"My Flocks"}),i.jsxs(U,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>t==null?void 0:t("flock"),children:[i.jsx(rn,{className:"h-3.5 w-3.5 mr-1"})," Add Flock"]})]}),u?i.jsx(z,{className:"glass-card p-8",children:i.jsx("div",{className:"text-center text-muted-foreground animate-pulse",children:"Loading flocks..."})}):c.length===0?i.jsx(z,{className:"glass-card border-dashed border-2 border-primary/20",children:i.jsxs(V,{className:"p-8 text-center space-y-4",children:[i.jsx("div",{className:"bg-primary/10 p-4 rounded-2xl w-fit mx-auto",children:i.jsx(Ho,{className:"h-10 w-10 text-primary"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-lg",children:"Welcome to Flockify!"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Add your first flock and we'll help you track everything â feed, health, eggs, and more."})]}),i.jsxs(U,{onClick:()=>t==null?void 0:t("flock"),className:"bg-gradient-primary text-foreground",children:[i.jsx(rn,{className:"h-4 w-4 mr-2"})," Add My First Flock"]})]})}):i.jsx("div",{className:"space-y-3",children:c.map((N,k)=>{var A;const _=N.bird_type==="broiler"&&N.age_weeks>=6||N.bird_type==="layer"&&N.age_weeks>=18,C=N.health_status==="sick";return i.jsx(z,{className:`glass-card overflow-hidden transition-all hover:shadow-elegant ${C?"border-destructive/30":""}`,style:{animationDelay:`${.25+k*.05}s`},children:i.jsxs(V,{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"bg-primary/10 p-2 rounded-xl",children:i.jsx(Ho,{className:"h-5 w-5 text-primary"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold",children:N.name}),i.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[i.jsx(ye,{variant:"secondary",className:"text-[10px] capitalize",children:N.bird_type}),_&&i.jsx(ye,{className:"text-[10px] bg-success/15 text-success border-success/30",children:"Ready to Sell"})]})]})]}),i.jsxs("div",{className:`flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium ${C?"bg-destructive/10 text-destructive":N.health_status==="monitoring"?"bg-warning/10 text-warning":"bg-success/10 text-success"}`,children:[i.jsx(Zs,{className:"h-3 w-3"}),i.jsx("span",{className:"capitalize",children:N.health_status})]})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[i.jsxs("div",{className:"bg-muted/50 rounded-xl p-2.5 text-center",children:[i.jsx("div",{className:"font-bold text-lg",children:N.count}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Birds"})]}),i.jsxs("div",{className:"bg-muted/50 rounded-xl p-2.5 text-center",children:[i.jsxs("div",{className:"font-bold text-lg",children:[N.age_weeks,"w"]}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Age"})]}),i.jsxs("div",{className:"bg-muted/50 rounded-xl p-2.5 text-center",children:[i.jsx("div",{className:"font-bold text-lg",children:((A=N.production_stage)==null?void 0:A[0])||"â"}),i.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Stage"})]})]}),i.jsx("div",{className:"grid grid-cols-4 gap-2",children:[{icon:cc,label:"Daily Log",action:()=>t==null?void 0:t("daily-log")},{icon:xa,label:"Health AI",action:()=>S("health-scanner",N)},{icon:Wt,label:"Growth",action:()=>S("growth",N)},{icon:Xr,label:"Dashboard",action:()=>S("type-dashboard",N)}].map((E,P)=>i.jsxs("button",{onClick:E.action,className:"flex flex-col items-center gap-1 p-2.5 rounded-xl bg-muted/40 hover:bg-primary/10 transition-colors touch-manipulation active:scale-95",children:[i.jsx(E.icon,{className:"h-4.5 w-4.5 text-primary"}),i.jsx("span",{className:"text-[10px] font-medium text-muted-foreground",children:E.label})]},P))})]})},N.id)})})]}),i.jsx(z,{className:"glass-card bg-muted/30 border-primary/10 animate-float-in",style:{animationDelay:"0.3s"},children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"bg-primary/10 p-2 rounded-full shrink-0",children:i.jsx(an,{className:"h-4 w-4 text-primary"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-bold text-primary mb-1",children:"Tip of the Day"}),i.jsx("p",{className:"text-sm leading-relaxed text-foreground",children:d})]})]})})})]})})}var l6e="DismissableLayer",J_="dismissableLayer.update",c6e="dismissableLayer.pointerDownOutside",u6e="dismissableLayer.focusOutside",V4,
vendor: 13,573 bytes, lines 927-930
927nK=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rK=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=y.useContext(nK),[d,h]=y.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),g=Ce(t,k=>h(k)),p=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(x),b=d?p.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=v,S=f6e(k=>{const _=k.target,C=[...u.branches].some(A=>A.contains(_));!j||C||(s==null||s(k),o==null||o(k),k.defaultPrevented||l==null||l())},f),N=m6e(k=>{const _=k.target;[...u.branches].some(A=>A.contains(_))||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},f);return Gp(k=>{b===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(V4=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),W4(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=V4)}},[d,f,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),W4())},[d,u]),y.useEffect(()=>{const k=()=>m({});return document.addEventListener(J_,k),()=>document.removeEventListener(J_,k)},[]),i.jsx(ve.div,{...c,ref:g,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ge(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ge(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ge(e.onPointerDownCapture,S.onPointerDownCapture)})});rK.displayName=l6e;var d6e="DismissableLayerBranch",h6e=y.forwardRef((e,t)=>{const n=y.useContext(nK),r=y.useRef(null),s=Ce(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(ve.div,{...e,ref:s})});h6e.displayName=d6e;function f6e(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){sK(c6e,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function m6e(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&sK(u6e,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function W4(){const e=new CustomEvent(J_);document.dispatchEvent(e)}function sK(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?uh(s,a):s.dispatchEvent(a)}var p6e="Portal",iK=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=y.useState(!1);Nt(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ch.createPortal(i.jsx(ve.div,{...r,ref:t}),o):null});iK.displayName=p6e;var T1=0;function g6e(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??H4()),document.body.insertAdjacentElement("beforeend",e[1]??H4()),T1++,()=>{T1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),T1--}},[])}function H4(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var bo=function(){return bo=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},bo.apply(this,arguments)};function y6e(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function x6e(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;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 aK=N0(),O1=function(){},Cw=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:O1,onWheelCapture:O1,onTouchMoveCapture:O1}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,m=e.noIsolation,g=e.inert,p=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,b=e.gapMode,w=y6e(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,S=S0([n,t]),N=bo(bo({},w),s);return y.createElement(y.Fragment,null,d&&y.createElement(j,{sideCar:aK,removeScrollBar:u,shards:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!p,lockRef:n,gapMode:b}),o?y.cloneElement(y.Children.only(l),bo(bo({},N),{ref:S})):y.createElement(v,bo({},N,{className:c,ref:S}),l))});Cw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Cw.classNames={fullWidth:fc,zeroRight:hc};var Q_=!1;if(typeof window<"u")try{var By=Object.defineProperty({},"passive",{get:function(){return Q_=!0,!0}});window.addEventListener("test",By,By),window.removeEventListener("test",By,By)}catch{Q_=!1}var lu=Q_?{passive:!1}:!1,v6e=function(e){return e.tagName==="TEXTAREA"},oK=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!v6e(e)&&n[t]==="visible")},b6e=function(e){return oK(e,"overflowY")},w6e=function(e){return oK(e,"overflowX")},q4=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=lK(e,r);if(s){var a=cK(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},j6e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},S6e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},lK=function(e,t){return e==="v"?b6e(t):w6e(t)},cK=function(e,t){return e==="v"?j6e(t):S6e(t)},N6e=function(e,t){return e==="h"&&t==="rtl"?-1:1},k6e=function(e,t,n,r,s){var a=N6e(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,h=0,f=0;do{var m=cK(e,l),g=m[0],p=m[1],x=m[2],v=p-x-a*g;(g||v)&&lK(e,l)&&(h+=v,f+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(u=!0),u},zy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},K4=function(e){return[e.deltaX,e.deltaY]},G4=function(e){return e&&"current"in e?e.current:e},_6e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},C6e=function(e){return` 928 .block-interactivity-`.concat(e,` {pointer-events: none;} 929 .allow-interactivity-`).concat(e,` {pointer-events: all;} 930`)},E6e=0,cu=[];function A6e(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(E6e++)[0],a=y.useState(cg)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=x6e([e.lockRef.current],(e.shards||[]).map(G4),!0).filter(Boolean);return p.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(p,x){if("touches"in p&&p.touches.length===2)return!o.current.allowPinchZoom;var v=zy(p),b=n.current,w="deltaX"in p?p.deltaX:b[0]-v[0],j="deltaY"in p?p.deltaY:b[1]-v[1],S,N=p.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in p&&k==="h"&&N.type==="range")return!1;var _=q4(k,N);if(!_)return!0;if(_?S=k:(S=k==="v"?"h":"v",_=q4(k,N)),!_)return!1;if(!r.current&&"changedTouches"in p&&(w||j)&&(r.current=S),!S)return!0;var C=r.current||S;return k6e(C,x,p,C==="h"?w:j,!0)},[]),c=y.useCallback(function(p){var x=p;if(!(!cu.length||cu[cu.length-1]!==a)){var v="deltaY"in x?K4(x):zy(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&_6e(S.delta,v)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(G4).filter(Boolean).filter(function(S){return S.contains(x.target)}),j=w.length>0?l(x,w[0]):!o.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),u=y.useCallback(function(p,x,v,b){var w={name:p,delta:x,target:v,should:b,shadowParent:P6e(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=y.useCallback(function(p){n.current=zy(p),r.current=void 0},[]),h=y.useCallback(function(p){u(p.type,K4(p),p.target,l(p,e.lockRef.current))},[]),f=y.useCallback(function(p){u(p.type,zy(p),p.target,l(p,e.lockRef.current))},[]);y.useEffect(function(){return cu.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,lu),document.addEventListener("touchmove",c,lu),document.addEventListener("touchstart",d,lu),function(){cu=cu.filter(function(p){return p!==a}),document.removeEventListener("wheel",c,lu),document.removeEventListener("touchmove",c,lu),document.removeEventListener("touchstart",d,lu)}},[]);var m=e.removeScrollBar,g=e.inert;return y.createElement(y.Fragment,null,g?y.createElement(a,{styles:C6e(s)}):null,m?y.createElement(C0,{gapMode:e.gapMode}):null)}function P6e(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const T6e=k0(aK,A6e);var uK=y.forwardRef(function(e,t){return y.createElement(Cw,bo({},e,{ref:t,sideCar:T6e}))});uK.classNames=Cw.classNames;var sP="Dialog",[dK,hK]=kr(sP),[O6e,ci]=dK(sP),fK=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=y.useRef(null),c=y.useRef(null),[u=!1,d]=ni({prop:r,defaultProp:s,onChange:a});return i.jsx(O6e,{scope:t,triggerRef:l,contentRef:c,contentId:Kr(),titleId:Kr(),descriptionId:Kr(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(h=>!h),[d]),modal:o,children:n})};fK.displayName=sP;var mK="DialogTrigger",pK=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ci(mK,n),a=Ce(t,s.triggerRef);return i.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":oP(s.open),...r,ref:a,onClick:ge(e.onClick,s.onOpenToggle)})});pK.displayName=mK;var iP="DialogPortal",[R6e,gK]=dK(iP,{forceMount:void 0}),yK=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,a=ci(iP,t);return i.jsx(R6e,{scope:t,forceMount:n,children:y.Children.map(r,o=>i.jsx(es,{present:n||a.open,children:i.jsx(iK,{asChild:!0,container:s,children:o})}))})};yK.displayName=iP;var _b="DialogOverlay",xK=y.forwardRef((e,t)=>{const n=gK(_b,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ci(_b,e.__scopeDialog);return a.modal?i.jsx(es,{present:r||a.open,children:i.jsx(M6e,{...s,ref:t})}):null});xK.displayName=_b;var M6e=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ci(_b,n);return i.jsx(uK,{as:Ta,allowPinchZoom:!0,shards:[s.contentRef],children:i.jsx(ve.div,{"data-state":oP(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Mc="DialogContent",vK=y.forwardRef((e,t)=>{const n=gK(Mc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,a=ci(Mc,e.__scopeDialog);return i.jsx(es,{present:r||a.open,children:a.modal?i.jsx(I6e,{...s,ref:t}):i.jsx($6e,{...s,ref:t})})});vK.displayName=Mc;var I6e=y.forwardRef((e,t)=>{const n=ci(Mc,e.__scopeDialog),r=y.useRef(null),s=Ce(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return E0(a)},[]),i.jsx(bK,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ge(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ge(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:ge(e.onFocusOutside,a=>a.preventDefault())})}),$6e=y.forwardRef((e,t)=>{const n=ci(Mc,e.__scopeDialog),r=y.useRef(!1),s=y.useRef(!1);return i.jsx(bK,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),bK=y.forwardRef((e,t)=>
vendor: 4,571 bytes, lines 930-940
930{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...o}=e,l=ci(Mc,n),c=y.useRef(null),u=Ce(t,c);return g6e(),i.jsxs(i.Fragment,{children:[i.jsx(lg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(rK,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":oP(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(D6e,{titleId:l.titleId}),i.jsx(B6e,{contentRef:c,descriptionId:l.descriptionId})]})]})}),aP="DialogTitle",wK=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ci(aP,n);return i.jsx(ve.h2,{id:s.titleId,...r,ref:t})});wK.displayName=aP;var jK="DialogDescription",SK=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ci(jK,n);return i.jsx(ve.p,{id:s.descriptionId,...r,ref:t})});SK.displayName=jK;var NK="DialogClose",kK=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ci(NK,n);return i.jsx(ve.button,{type:"button",...r,ref:t,onClick:ge(e.onClick,()=>s.onOpenChange(!1))})});kK.displayName=NK;function oP(e){return e?"open":"closed"}var _K="DialogTitleWarning",[L6e,CK]=FQ(_K,{contentName:Mc,titleName:aP,docsSlug:"dialog"}),D6e=({titleId:e})=>{const t=CK(_K),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 931 932If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 933 934For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},F6e="DialogDescriptionWarning",B6e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${CK(F6e).contentName}}.`;return y.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},z6e=fK,U6e=pK,V6e=yK,W6e=xK,H6e=vK,q6e=wK,K6e=SK,EK=kK,AK="AlertDialog",[G6e,O7e]=kr(AK,[hK]),Ga=hK(),PK=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ga(t);return i.jsx(z6e,{...r,...n,modal:!0})};PK.displayName=AK;var Y6e="AlertDialogTrigger",TK=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ga(n);return i.jsx(U6e,{...s,...r,ref:t})});TK.displayName=Y6e;var X6e="AlertDialogPortal",OK=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ga(t);return i.jsx(V6e,{...r,...n})};OK.displayName=X6e;var J6e="AlertDialogOverlay",RK=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ga(n);return i.jsx(W6e,{...s,...r,ref:t})});RK.displayName=J6e;var sd="AlertDialogContent",[Q6e,Z6e]=G6e(sd),MK=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,a=Ga(n),o=y.useRef(null),l=Ce(t,o),c=y.useRef(null);return i.jsx(L6e,{contentName:sd,titleName:IK,docsSlug:"alert-dialog",children:i.jsx(Q6e,{scope:n,cancelRef:c,children:i.jsxs(H6e,{role:"alertdialog",...a,...s,ref:l,onOpenAutoFocus:ge(s.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[i.jsx(uE,{children:r}),i.jsx(tBe,{contentRef:o})]})})})});MK.displayName=sd;var IK="AlertDialogTitle",$K=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ga(n);return i.jsx(q6e,{...s,...r,ref:t})});$K.displayName=IK;var LK="AlertDialogDescription",DK=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ga(n);return i.jsx(K6e,{...s,...r,ref:t})});DK.displayName=LK;var eBe="AlertDialogAction",FK=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Ga(n);return i.jsx(EK,{...s,...r,ref:t})});FK.displayName=eBe;var BK="AlertDialogCancel",zK=y.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Z6e(BK,n),a=Ga(n),o=Ce(t,s);return i.jsx(EK,{...a,...r,ref:o})});zK.displayName=BK;var tBe=({contentRef:e})=>{const t=`\`${sd}\` requires a description for the component to be accessible for screen reader users. 935 936You can add a description to the \`${sd}\` by passing a \`${LK}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 937 938Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${sd}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 939 940For more information, see https://radix-ui.com/primitives/docs/components/
940alert-dialog`;return y.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},nBe=PK,rBe=TK,sBe=OK,UK=RK,VK=MK,WK=FK,HK=zK,qK=$K,KK=DK;const GK=nBe,YK=rBe,iBe=sBe,XK=y.forwardRef(({className:e,...t},n)=>i.jsx(UK,{className:fe("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,ref:n}));XK.displayName=UK.displayName;const lP=y.forwardRef(({className:e,...t},n)=>i.jsxs(iBe,{children:[i.jsx(XK,{}),i.jsx(VK,{ref:n,className:fe("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),...t})]}));lP.displayName=VK.displayName;const cP=({className:e,...t})=>i.jsx("div",{className:fe("flex flex-col space-y-2 text-center sm:text-left",e),...t});cP.displayName="AlertDialogHeader";const uP=({className:e,...t})=>i.jsx("div",{className:fe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});uP.displayName="AlertDialogFooter";const dP=y.forwardRef(({className:e,...t},n)=>i.jsx(qK,{ref:n,className:fe("text-lg font-semibold",e),...t}));dP.displayName=qK.displayName;const hP=y.forwardRef(({className:e,...t},n)=>i.jsx(KK,{ref:n,className:fe("text-sm text-muted-foreground",e),...t}));hP.displayName=KK.displayName;const fP=y.forwardRef(({className:e,...t},n)=>i.jsx(WK,{ref:n,className:fe(P2(),e),...t}));fP.displayName=WK.displayName;const mP=y.forwardRef(({className:e,...t},n)=>i.jsx(HK,{ref:n,className:fe(P2({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));mP.displayName=HK.displayName;function aBe(){const{toast:e}=We(),[t,n]=y.useState([]),[r,s]=y.useState(!1),[a,o]=y.useState(null),[l,c]=y.useState(""),[u,d]=y.useState("all"),[h,f]=y.useState({tag:"",type:"broiler",breed:"",hatchDate:"",weight:0,status:"healthy",notes:""}),m=()=>{if(!h.tag||!h.breed||!h.hatchDate){e({title:"Missing Information",description:"Please fill in all required fields",variant:"destructive"});return}const j={id:Date.now().toString(),tag:h.tag,type:h.type,breed:h.breed,hatchDate:h.hatchDate,weight:h.weight||0,status:h.status,notes:h.notes||"",lastWeighed:new Date().toISOString().split("T")[0]};n([...t,j]),f({tag:"",type:"broiler",breed:"",hatchDate:"",weight:0,status:"healthy",notes:""}),s(!1),e({title:"Chicken Added",description:`${j.tag} has been added to your flock`})},g=()=>{a&&(n(t.map(j=>j.id===a.id?a:j)),o(null),e({title:"Chicken Updated",description:"Chicken information has been updated"}))},p=j=>{n(t.filter(S=>S.id!==j)),e({title:"Chicken Removed",description:"Chicken has been removed from your flock"})},x=t.filter(j=>{const S=j.tag.toLowerCase().includes(l.toLowerCase())||j.breed.toLowerCase().includes(l.toLowerCase()),N=u==="all"||j.status===u;return S&&N}),v=j=>{switch(j){case"healthy":return"bg-green-500";case"sick":return"bg-yellow-500";case"deceased":return"bg-red-500";default:return"bg-gray-500"}},b=j=>{const S=new Date,N=new Date(j),k=Math.abs(S.getTime()-N.getTime());return Math.floor(k/(1e3*60*60*24*7))},w={total:t.length,healthy:t.filter(j=>j.status==="healthy").length,sick:t.filter(j=>j.status==="sick").length,deceased:t.filter(j=>j.status==="deceased").length,broilers:t.filter(j=>j.type==="broiler").length,layers:t.filter(j=>j.type==="layer").length};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-primary",children:w.total}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Birds"})]})}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-green-600",children:w.healthy}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Healthy"})]})}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-yellow-600",children:w.sick}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Sick"})]})}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx("div",{className:"text-2xl font-bold text-red-600",children:w.deceased}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Deceased"})]})})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsxs(se,{className:"flex items-center justify-between",children:["Flock Management",i.jsxs(yt,{open:r,onOpenChange:s,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Add Bird"]})}),i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Add New Bird"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"tag",children:"Tag/ID*"}),i.jsx(ae,{id:"tag",value:h.tag,onChange:j=>
940f({...h,tag:j.target.value}),placeholder:"e.g., BR001"})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"type",children:"Type*"}),i.jsxs(Ye,{value:h.type,onValueChange:j=>f({...h,type:j}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"broiler",children:"Broiler (Meat)"}),i.jsx(oe,{value:"layer",children:"Layer (Eggs)"}),i.jsx(oe,{value:"mixed",children:"Mixed (Dual Purpose)"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"breed",children:"Breed*"}),i.jsx(ae,{id:"breed",value:h.breed,onChange:j=>f({...h,breed:j.target.value}),placeholder:"e.g., Ross 308"})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"hatchDate",children:"Hatch Date*"}),i.jsx(ae,{id:"hatchDate",type:"date",value:h.hatchDate,onChange:j=>f({...h,hatchDate:j.target.value})})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"weight",children:"Current Weight (kg)"}),i.jsx(ae,{id:"weight",type:"number",step:"0.1",value:h.weight,onChange:j=>f({...h,weight:parseFloat(j.target.value)||0})})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"notes",children:"Notes"}),i.jsx(Yt,{id:"notes",value:h.notes,onChange:j=>f({...h,notes:j.target.value}),placeholder:"Any additional notes..."})]}),i.jsx(U,{onClick:m,className:"w-full",children:"Add Bird"})]})]})]})]})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"flex gap-4",children:[i.jsx("div",{className:"flex-1",children:i.jsx(ae,{placeholder:"Search by tag or breed...",value:l,onChange:j=>c(j.target.value)})}),i.jsxs(Ye,{value:u,onValueChange:d,children:[i.jsx(He,{className:"w-40",children:i.jsx(Xe,{placeholder:"Filter status"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"all",children:"All Status"}),i.jsx(oe,{value:"healthy",children:"Healthy"}),i.jsx(oe,{value:"sick",children:"Sick"}),i.jsx(oe,{value:"deceased",children:"Deceased"})]})]})]}),i.jsx("div",{className:"space-y-3",children:x.map(j=>i.jsx(z,{className:"glass-card transition-all hover:shadow-md",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("div",{className:`w-3 h-3 rounded-full ${v(j.status)}`}),i.jsxs("div",{children:[i.jsx("div",{className:"font-semibold",children:j.tag}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:[j.breed," ⢠",j.type," ⢠",b(j.hatchDate)," weeks old"]}),i.jsxs("div",{className:"text-sm text-muted-foreground",children:["Weight: ",j.weight,"kg ⢠Last weighed: ",j.lastWeighed]}),j.notes&&i.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:["Notes: ",j.notes]})]})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ye,{variant:j.status==="healthy"?"default":j.status==="sick"?"secondary":"destructive",children:j.status}),i.jsxs(yt,{children:[i.jsx(hn,{asChild:!0,children:i.jsx(U,{variant:"outline",size:"sm",onClick:()=>o(j),children:i.jsx(jE,{className:"h-3 w-3"})})}),i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsxs(vt,{children:["Edit Bird: ",j.tag]})}),a&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Weight (kg)"}),i.jsx(ae,{type:"number",step:"0.1",value:a.weight,onChange:S=>o({...a,weight:parseFloat(S.target.value)||0,lastWeighed:new Date().toISOString().split("T")[0]})})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Status"}),i.jsxs(Ye,{value:a.status,onValueChange:S=>o({...a,status:S}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"healthy",children:"Healthy"}),i.jsx(oe,{value:"sick",children:"Sick"}),i.jsx(oe,{value:"deceased",children:"Deceased"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Notes"}),i.jsx(Yt,{value:a.notes,onChange:S=>o({...a,notes:S.target.value})})]}),i.jsx(U,{onClick:g,className:"w-full",children:"Update Bird"})]})]})]}),i.jsx(U,{variant:"outline",size:"sm",onClick:()=>p(j.id),children:i.jsx(cl,{className:"h-3 w-3"})})]})]})})},j.id))})]})]})]})}function oBe(e,t,n,r){const s=[];return r==="sick"?s.push({icon:Pd,text:"Use AI Health Scanner to diagnose issues quickly.",action:"health",priority:"warning"}):r==="monitoring"&&s.push({icon:Pd,text:"Keep monitoring closely. Consider a health scan if symptoms persist.",action:"health",priority:"warning"}),e==="broiler"?t<=1?(s.push({icon:an,text:"Ensure brooder temperature is 32-35°C for day-old chicks.",priority:"info"}),s.push({icon:an,text:"Provide fresh water with electrolytes for the first 3 days.",priority:"info"})):t<=3?(s.push({icon:an,text:"Switch to grower feed at week 2-3 for optimal weight gain.",priority:"info"}),s.push({icon:Wt,text:"Track weekly weight to ensure birds are on target.",action:"growth",priority:"info"})):t<=5?(s.push({icon:an,text:"Ensure good ventilation â broilers generate more heat as they grow.",priority:"info"}),s.push({icon:Wt,text:"Expected weight: 1.5-2kg. Track growth to compare.",action:"growth",priority:"info"})):t<=8?(s.push({icon:mo,text:"Broilers are nearing market weight (2-3kg). Start listing on marketplace.",action:"market",priority:"success"}),s.push({icon:an,text:"Switch to finisher feed for the last 1-2 weeks before slaughter.",priority:"info"})):s.push({icon:mo,text:"Your broilers are past typical market age. Consider selling soon to reduce feed costs.",action:"market",priority:"warning"}):e==="layer"?t<=6?s.push({icon:an,text:"Provide chick starter feed with 20-22% protein for strong development.",priority:"info"}):t<=18?(s.push({icon:an,text:"Layers need grower feed (16-18% protein) until point of lay at ~18 weeks.",priority:"info"}),s.push({icon:an,text:"Increase light exposure gradually to stimulate egg production.",priority:"info"})):t<=72?(s.push({icon:an,text:"Use layer feed with high calcium (3.5-4%) for strong eggshells.",priority:"info"}),s.push({icon:mo,text:"List your eggs on the marketplace for extra income.",action:"market",priority:"success"})):s.push({icon:an,text:"Egg production typically drops after 72 weeks. Consider flock replacement planning.",priority:"warning"}):e==="breeder"?(s.push({icon:an,text:"Maintain a rooster-to-hen ratio of 1:10 for optimal fertility.",priority:"info"}),t>=20&&s.push({icon:an,text:"Collect and store hatching eggs at 12-15°C, turn daily.",priority:"info"})):e==="duck"?(s.push({icon:an,text:"Ducks need access to water for drinking â deep enough to submerge their bills.",priority:"info"}),t>=8&&s.push({icon:mo,text:"Ducks reach market weight around 8-10 weeks.",action:"market",priority:"success"})):e==="turkey"&&(s.push({icon:an,text:"Turkeys need higher protein feed (28%) in the first 8 weeks.",priority:"info"}),t>=16&&s.push({icon:mo,text:"Turkeys are typically market-ready at 16-20 weeks.",action:"market",priority:"success"})),n>=100&&s.push({icon:tn,text:"With 100+ birds, consider biosecurity training in the Learning Hub.",action:"learn",priority:"info"}),n>
940=500&&s.push({icon:an,text:"Large flock detected. Ensure you have proper compliance documents.",action:"compliance",priority:"warning"}),r==="healthy"&&s.length<2&&s.push({icon:Wt,text:"Track growth weekly to stay ahead of any issues.",action:"growth",priority:"info"}),s.slice(0,3)}const lBe={info:"bg-primary/10 border-primary/20 text-foreground",warning:"bg-destructive/10 border-destructive/20 text-foreground",success:"bg-green-500/10 border-green-500/20 text-foreground"};function cBe({birdType:e,ageWeeks:t,count:n,healthStatus:r}){const s=oBe(e,t,n,r);return s.length===0?null:i.jsxs("div",{className:"space-y-2 pt-2 border-t border-border",children:[i.jsxs("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide flex items-center gap-1",children:[i.jsx(an,{className:"h-3 w-3"}),"Smart Tips"]}),s.map((a,o)=>i.jsxs("div",{className:`flex items-start gap-2 p-2 rounded-lg border text-xs ${lBe[a.priority]}`,children:[i.jsx(a.icon,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),i.jsx("span",{children:a.text})]},o))]})}const Sa=y.forwardRef(({className:e,...t},n)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:n,className:fe("w-full caption-bottom text-sm",e),...t})}));Sa.displayName="Table";const Na=y.forwardRef(({className:e,...t},n)=>i.jsx("thead",{ref:n,className:fe("[&_tr]:border-b",e),...t}));Na.displayName="TableHeader";const ka=y.forwardRef(({className:e,...t},n)=>i.jsx("tbody",{ref:n,className:fe("[&_tr:last-child]:border-0",e),...t}));ka.displayName="TableBody";const uBe=y.forwardRef(({className:e,...t},n)=>i.jsx("tfoot",{ref:n,className:fe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));uBe.displayName="TableFooter";const kn=y.forwardRef(({className:e,...t},n)=>i.jsx("tr",{ref:n,className:fe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));kn.displayName="TableRow";const Pe=y.forwardRef(({className:e,...t},n)=>i.jsx("th",{ref:n,className:fe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Pe.displayName="TableHead";
940const ke=y.forwardRef(({className:e,...t},n)=>i.jsx("td",{ref:n,className:fe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ke.displayName="TableCell";const dBe=y.forwardRef(({className:e,...t},n)=>i.jsx("caption",{ref:n,className:fe("mt-4 text-sm text-muted-foreground",e),...t}));dBe.displayName="TableCaption";const hBe=(e,t)=>{const[n,r]=y.useState([]),[s,a]=y.useState(!1),{toast:o}=We(),l=y.useCallback(async()=>{if(e){a(!0);try{const{data:f,error:m}=await q.from("flock_daily_logs").select("*").eq("flock_id",e).order("log_date",{ascending:!1});if(m)throw m;r(f||[])}catch(f){console.error("Error fetching daily logs:",f)}finally{a(!1)}}},[e]);y.useEffect(()=>{l()},[l]);const c=async f=>{try{const{data:{user:m}}=await q.auth.getUser();if(!m){o({title:"Auth required",description:"Please log in",variant:"destructive"});return}const{data:g,error:p}=await q.from("flock_daily_logs").insert({...f,user_id:m.id}).select().single();if(p){if(p.code==="23505")o({title:"Duplicate",description:"A log for this date already exists. Edit the existing one.",variant:"destructive"});else throw p;return}return r(x=>[g,...x]),o({title:"Success",description:"Daily log recorded"}),g}catch(m){console.error("Error adding daily log:",m),o({title:"Error",description:"Failed to save daily log",variant:"destructive"})}},u=async(f,m)=>{try{const{error:g}=await q.from("flock_daily_logs").update(m).eq("id",f);if(g)throw g;r(p=>p.map(x=>x.id===f?{...x,...m}:x)),o({title:"Updated",description:"Daily log updated"})}catch(g){console.error("Error updating log:",g),o({title:"Error",description:"Failed to update log",variant:"destructive"})}},d=async f=>{try{const{error:m}=await q.from("flock_daily_logs").delete().eq("id",f);if(m)throw m;r(g=>g.filter(p=>p.id!==f)),o({title:"Deleted",description:"Daily log removed"})}catch(m){console.error("Error deleting log:",m),o({title:"Error",description:"Failed to delete log",variant:"destructive"})}},h=(()=>{const f=n.reduce((j,S)=>j+(S.dead_birds||0)+(S.culls||0),0),m=n.reduce((j,S)=>j+(S.egg_production||0),0),g=n.reduce((j,S)=>j+(S.feed_quantity_kg||0),0),p=t-f,x=t>0?p/t*100:100,v=p>0&&n.length>0?g/n.length/p:0,b=p>0&&n.length>0?m/n.length/p:0,w=t>0&&n.length>0?f/t/n.length*100:0;return{totalMortality:f,totalEggs:m,totalFeedKg:g,survivalRate:x,avgFeedPerBird:v,avgEggsPerBird:b,dailyMortalityRate:w,currentBirdCount:p}})();return{logs:n,loading:s,stats:h,addLog:c,updateLog:u,deleteLog:d,refetch:l}},Y4={broiler:["Starter","Grower","Finisher"],layer:["Starter","Grower","Layer Mash","Layer Pellets"],breeder:["Breeder Mash","Grower","Pre-Lay"],duck:["Starter","Grower","Finisher"],turkey:["Starter","Grower","Finisher"],mixed:["Starter","Grower","All-Purpose"]};function fBe(e,t){return e==="broiler"?t<=2?"Starter":t<=4?"Grower":"Finisher":e==="layer"?t<=6?"Starter":t<=16?"Grower":"Layer Mash":e==="mixed"?t<=4?"Starter":t<=10?"Grower":"All-Purpose":t<=3?"Starter":t<=6?"Grower":"Finisher"}function mBe({flockId:e,flockName:t,birdType:n,initialBirdCount:r,ageWeeks:s}){const{t:a}=Gi(),{logs:o,loading:l,stats:c,addLog:u,updateLog:d,deleteLog:h}=hBe(e,r),f=Y4[n]||Y4.broiler,m=n==="layer",g=["broiler","layer","mixed"].includes(n)?n:"broiler",p=y.useMemo(()=>{const E=fBe(n,s),P=parseFloat(vFe(g,s,c.currentBirdCount).toFixed(1)),$=parseFloat((P*2).toFixed(1)),R=wg(g);return{suggestedFeed:E,suggestedFeedKg:P,suggestedWaterLitres:$,config:R}},[n,g,s,c.currentBirdCount]),[x,v]=y.useState(!1),[b,w]=y.useState(null),[j,S]=y.useState({log_date:new Date().toISOString().split("T")[0],feed_type:"",feed_quantity_kg:"",water_consumption_litres:"",egg_production:"",dead_birds:"",culls:"",observations:""}),N=x||!!b,k=E=>{E||(v(!1),w(null))},_=()=>{w(null),S({log_date:new Date().toISOString().split("T")[0],feed_type:p.suggestedFeed,feed_quantity_kg:String(p.suggestedFeedKg),water_consumption_litres:String(p.suggestedWaterLitres),egg_production:"",dead_birds:"",culls:"",observations:""}),v(!0)},C=E=>{v(!1),w(E.id),S({log_date:E.log_date,feed_type:E.feed_type,feed_quantity_kg:String(E.feed_quantity_kg),water_consumption_litres:E.water_consumption_litres!=null?String(E.water_consumption_litres):"",egg_production:String(E.egg_production||""),dead_birds:String(E.dead_birds||""),culls:String(E.culls||""),observations:E.observations||""})},A=async()=>{const E=parseFloat(j.feed_quantity_kg)||0;if(!j.feed_type||E<=0)return;const P={flock_id:e,log_date:j.log_date,feed_type:j.feed_type,feed_quantity_kg:E,water_consumption_litres:j.water_consumption_litres!==""?parseFloat(j.water_consumption_litres):null,egg_production:parseInt(j.egg_production)||0,dead_birds:parseInt(j.dead_birds)||0,culls:parseInt(j.culls)||0,observations:j.observations||null};b?(await d(b,P),w(null)):await u(P)&&v(!1)};return i.jsxs("div",{className:"space-y-4",children:[i.jsx(z,{className:"glass-card p-3 border-primary/20 bg-primary/5",children:i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(an,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"}),i.jsxs("div",{className:"text-xs space-y-0.5",children:[i.jsxs("p",{className:"font-medium text-primary",children:["Today's Recommendation (Week ",s,")"]}),i.jsxs("p",{className:"text-muted-foreground",children:["Feed: ",i.jsx("span",{className:"font-medium text-foreground",children:p.suggestedFeed})," · Qty: ",i.jsxs("span",{className:"font-medium text-foreground",children:[p.suggestedFeedKg," kg"]})," · Water: ",i.jsxs("span",{className:"font-medium text-foreground",children:["~",p.suggestedWaterLitres," L"]})]})]})]})}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[i.jsx(z,{className:"glass-card p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ht,{className:"h-4 w-4 text-primary"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Current Birds"}),i.jsx("p",{className:"text-lg font-bold",children:c.currentBirdCount})]})]})}),i.jsx(z,{className:"glass-card p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(nee,{className:"h-4 w-4 text-green-600"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Survival %"}),i.jsxs("p",{className:"text-lg font-bold",children:[c.survivalRate.toFixed(1),"%"]})]})]})}),i.jsx(z,{className:"glass-card p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(uO,{className:"h-4 w-4 text-destructive"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Mortality"}),i.jsx("p",{className:"text-lg font-bold",children:c.totalMortality})]})]})}),i.jsx(z,{className:"glass-card p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(SE,{className:"h-4 w-4 text-amber-600"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Feed (kg)"}),i.jsx("p",{className:"text-lg font-bold",children:c.totalFeedKg.toFixed(1)})]})]})}),m&&i.jsx(z,{className:"glass-card p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(yE,{className:"h-4 w-4 text-orange-500"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Eggs"}),i.jsx("p",{className:"text-lg font-bold",children:c.totalEggs})]})]})}),i.jsx(z,{className:"glass-card p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(tN,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Feed/Bird/Day"}),i.jsxs("p",{className:"text-lg font-bold",children:[(c.avgFeedPerBird*1e3).toFixed(0),"g"]})]})]})}),m&&i.jsx(z,{className:"glass-card p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Wt,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Eggs/Bird/Day"}),i.jsx("p",{className:"text-lg font-bold",children:c.avgEggsPerBird.toFixed(2)})]})]})}),i.jsx(z,{className:"glass-card p-3",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(uO,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Daily Mortality %"}),i.jsxs("p",{className:"text-lg font-bold",children:[c.dailyMortalityRate.toFixed(3),"%"]})]})]})})]}),i.jsxs(U,{className:"w-full",onClick:_,children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Log Today's Operations"]}),i.jsx(yt,{open:N,onOpenChange:k,children:i.jsxs(mt,{className:"max-h-[90vh] overflow-y-auto",children:[i.jsx(xt,{children:i.jsxs(vt,{children:[b?"Edit Log":"Daily Log"," â ",t]})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Date"}),i.jsx(ae,{type:"date",value:j.log_date,onChange:E=>S({...j,log_date:E.target.value})})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Feed Type"}),i.jsxs(Ye,{value:j.feed_type,onValueChange:E=>S({...j,feed_type:E}
940),children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select feed type"})}),i.jsx(qe,{children:f.map(E=>i.jsxs(oe,{value:E,children:[E," ",E===p.suggestedFeed&&"â Recommended"]},E))})]}),j.feed_type&&j.feed_type!==p.suggestedFeed&&i.jsxs("p",{className:"text-xs text-amber-600 mt-1",children:["ð¡ Standard for week ",s," ",n,"s: ",p.suggestedFeed]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Feed Quantity (kg)"}),i.jsx(ae,{type:"number",step:"0.1",min:"0",value:j.feed_quantity_kg,onChange:E=>S({...j,feed_quantity_kg:E.target.value}),placeholder:`Suggested: ${p.suggestedFeedKg} kg`}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Standard: ",p.suggestedFeedKg," kg for ",c.currentBirdCount," birds"]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Water Consumption (litres)"}),i.jsx(ae,{type:"number",step:"0.1",min:"0",value:j.water_consumption_litres,onChange:E=>S({...j,water_consumption_litres:E.target.value}),placeholder:`Suggested: ${p.suggestedWaterLitres} L`}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Rule of thumb: ~2Ã feed amount"})]}),m&&i.jsxs("div",{children:[i.jsx(ne,{children:"Egg Production (count)"}),i.jsx(ae,{type:"number",min:"0",value:j.egg_production,onChange:E=>S({...j,egg_production:E.target.value}),placeholder:"How many eggs today?"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Dead Birds"}),i.jsx(ae,{type:"number",min:"0",value:j.dead_birds,onChange:E=>S({...j,dead_birds:E.target.value}),placeholder:"0"})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Culls"}),i.jsx(ae,{type:"number",min:"0",value:j.culls,onChange:E=>S({...j,culls:E.target.value}),placeholder:"0"})]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx(ne,{htmlFor:"daily-log-observations",children:a("dailyLog.observations")}),i.jsx(Dd,{onTranscript:E=>S(P=>({...P,observations:P.observations?`${P.observations} ${E}`:E}))})]}),i.jsx(Yt,{id:"daily-log-observations",value:j.observations,onChange:E=>S({...j,observations:E.target.value}),placeholder:a("dailyLog.observationsPlaceholder"),rows:3})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(U,{onClick:A,className:"flex-1",children:a(b?"dailyLog.update":"dailyLog.save")}),i.jsx(U,{variant:"outline",onClick:()=>k(!1),className:"flex-1",children:a("common.cancel")})]})]})]})}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{className:"pb-3",children:i.jsx(se,{className:"text-base",children:"Operation Logs"})}),i.jsx(V,{children:l?i.jsx("p",{className:"text-center text-muted-foreground py-4",children:"Loading logs..."}):o.length===0?i.jsx("p",{className:"text-center text-muted-foreground py-4",children:"No daily logs yet. Start logging today's operations!"}):i.jsx("div",{className:"overflow-x-auto",children:i.jsxs(Sa,{children:[i.jsx(Na,{children:i.jsxs(kn,{children:[i.jsx(Pe,{children:"Date"}),i.jsx(Pe,{children:"Feed"}),i.jsx(Pe,{children:"Qty (kg)"}),m&&i.jsx(Pe,{children:"Eggs"}),i.jsx(Pe,{children:"Dead"}),i.jsx(Pe,{children:"Culls"}),i.jsx(Pe,{})]})}),i.jsx(ka,{children:o.map(E=>i.jsxs(kn,{children:[i.jsx(ke,{className:"text-xs",children:new Date(E.log_date).toLocaleDateString()}),i.jsx(ke,{children:i.jsx(ye,{variant:"outline",className:"text-xs",children:E.feed_type})}),i.jsx(ke,{children:E.feed_quantity_kg}),m&&i.jsx(ke,{children:E.egg_production}),i.jsx(ke,{className:E.dead_birds>0?"text-destructive font-medium":"",children:E.dead_birds}),i.jsx(ke,{children:E.culls}),i.jsxs(ke,{className:"flex gap-1",children:[i.jsx(U,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>C(E),children:i.jsx(tee,{className:"h-3 w-3"})}),i.jsx(U,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>h(E.id),children:i.jsx(cl,{className:"h-3 w-3"})})]})]},E.id))})]})})})]})]})}function Uy(e,t){return e==="layer"?t<=4?"Starter":t<=18?"Grower":"Layer":t<=2?"Starter":t<=4?"Grower":"Finisher"}function X4({initialView:e}={}){const{isAuthenticated:t,isLoading:n}=Sw(),[r,s]=y.useState(e||"overview"),[a,o]=y.useState(null),[l,c]=y.useState(!1),[u,d]=y.useState(!1),[h,f]=y.useState(null),[m,g]=y.useState({name:"",bird_type:"",count:0,age_weeks:0,health_status:"healthy",notes:"",arrival_date:new Date().toISOString().split("T")[0],house_number:"",production_stage:"Starter"}),[p,x]=y.useState({name:"",bird_type:"",count:0,age_weeks:0,health_status:"healthy",notes:"",arrival_date:"",house_number:"",production_stage:""}),{flocks:v=[],loading:b,addFlock:w,updateFlock:j,deleteFlock:S}=rP(),{tier:N}=Bh(),{toast:k}=We(),_=Ki(),C=_q[N].maxFlocks,A=C!==-1&&v.length>=C,E=()=>
940{if(A){k({title:"Flock limit reached",description:`Your ${N==="free"?"Free":"current"} plan allows ${C} flock${C===1?"":"s"}. Upgrade to add more.`,variant:"destructive"}),_("/pricing");return}c(!0)},P=async()=>{if(!m.name||!m.bird_type)return;if(A){k({title:"Flock limit reached",description:"Upgrade to add more flocks.",variant:"destructive"});return}const B=Uy(m.bird_type,m.age_weeks);await w({...m,production_stage:B}),g({name:"",bird_type:"",count:0,age_weeks:0,health_status:"healthy",notes:"",arrival_date:new Date().toISOString().split("T")[0],house_number:"",production_stage:"Starter"}),c(!1)},$=B=>{f(B.id),x({name:B.name,bird_type:B.bird_type,count:B.count,age_weeks:B.age_weeks,health_status:B.health_status||"healthy",notes:B.notes||"",arrival_date:B.arrival_date||"",house_number:B.house_number||"",production_stage:B.production_stage||Uy(B.bird_type,B.age_weeks)}),d(!0)},R=async()=>{!h||!p.name||!p.bird_type||(await j(h,p),d(!1),f(null))},L=v.find(B=>B.id===a)||(v.length>0?v[0]:null),D=(B,Y)=>{Y&&o(Y),s(B)},I=()=>v.length===0?null:i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("span",{className:"text-sm text-muted-foreground",children:"Flock:"}),v.map(B=>i.jsx(U,{variant:(L==null?void 0:L.id)===B.id?"default":"outline",size:"sm",onClick:()=>o(B.id),children:B.name},B.id))]}),M=()=>i.jsx("div",{className:"flex space-x-2 overflow-x-auto pb-2",children:[{id:"overview",label:"Overview",icon:ht},{id:"daily-ops",label:"Daily Log",icon:cc},{id:"tracker",label:"Tracker",icon:ys},{id:"growth",label:"Growth",icon:Wt},{id:"type-specific",label:"Dashboard",icon:Ho}].map(B=>i.jsxs(U,{variant:r===B.id?"default":"outline",size:"sm",onClick:()=>s(B.id),className:"flex items-center space-x-2 whitespace-nowrap",children:[i.jsx(B.icon,{className:"h-4 w-4"}),i.jsx("span",{children:B.label})]},B.id))}),H=(B,Y)=>{if(!B)return Y;const O=new Date(B),X=Math.floor((new Date().getTime()-O.getTime())/(7*24*60*60*1e3));return Y+X};if(r==="daily-ops")return i.jsxs("div",{className:"p-4 pb-20 space-y-4",children:[i.jsx("h1",{className:"text-2xl font-bold",children:"Daily Operations"}),M(),I(),L?i.jsx(mBe,{flockId:L.id,flockName:L.name,birdType:L.bird_type,initialBirdCount:L.count,ageWeeks:L.age_weeks}):i.jsx(z,{className:"glass-card p-8 text-center",children:i.jsx("p",{className:"text-muted-foreground",children:"Select or add a flock to start logging."})})]});if(r==="tracker")return i.jsxs("div",{className:"p-4 pb-20 space-y-6",children:[i.jsx("h1",{className:"text-2xl font-bold",children:"Flock Tracker"}),M(),I(),L&&i.jsx(z,{className:"glass-card p-4 bg-muted/30",children:i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"font-medium",children:L.name}),i.jsxs("div",{className:"flex gap-3 text-muted-foreground",children:[i.jsxs("span",{children:[L.count," birds"]}),i.jsxs("span",{children:[L.age_weeks," weeks"]}),i.jsx(ye,{variant:"secondary",className:"capitalize",children:L.bird_type})]})]})}),i.jsx(aBe,{})]});if(r==="growth")return i.jsxs("div",{className:"p-4 pb-20 space-y-6",children:[i.jsx("h1",{className:"text-2xl font-bold",children:"Growth Tracker"}),M(),I(),L&&i.jsx(z,{className:"glass-card p-4 bg-muted/30",children:i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"font-medium",children:L.name}),i.jsxs("div",{className:"flex gap-3 text-muted-foreground",children:[i.jsxs("span",{children:[L.count," birds"]}),i.jsxs("span",{children:[L.age_weeks," weeks"]}),i.jsx(ye,{variant:"secondary",className:"capitalize",children:L.bird_type})]})]})}),i.jsx(Sq,{})]});if(r==="type-specific")return i.jsxs("div",{className:"p-4 pb-20 space-y-6",children:[i.jsx("h1",{className:"text-2xl font-bold",children:"Type Dashboard"}),M(),I(),i.jsx(Qq,{birdType:(L==null?void 0:L.bird_type)||"broiler",flockSize:(L==null?void 0:L.count)||0,currentWeek:(L==null?void 0:L.age_weeks)||1})]});const T=(B,Y,O=!1)=>i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Flock Name"}),i.jsx(ae,{value:B.name,onChange:W=>Y({...B,name:W.target.value}),placeholder:"e.g. Batch 01"})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Breed / Bird Type"}),i.jsxs(Ye,{value:B.bird_type,onValueChange:W=>Y({...B,bird_type:W}),children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select breed"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"broiler",children:"Broiler"}),i.jsx(oe,{value:"layer",children:"Layer"}),i.jsx(oe,{value:"breeder",children:"Breeder"}),i.jsx(oe,{value:"duck",children:"Duck"}),i.jsx(oe,{value:"turkey",children:"Turkey"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Arrival Date"}),i.jsx(ae,{type:"date",value:B.arrival_date,onChange:W=>Y({...B,arrival_date:W.target.value})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx(ne,{children:"Initial Bird Count"}
940),i.jsx(ae,{type:"number",min:"0",value:B.count||"",onChange:W=>Y({...B,count:parseInt(W.target.value)||0})})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Age at Arrival (weeks)"}),i.jsx(ae,{type:"number",min:"0",value:B.age_weeks||"",onChange:W=>Y({...B,age_weeks:parseInt(W.target.value)||0})})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"House / Pen Number"}),i.jsx(ae,{value:B.house_number,onChange:W=>Y({...B,house_number:W.target.value}),placeholder:"e.g. House A"})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Production Stage (auto-calculated)"}),i.jsx(ae,{value:Uy(B.bird_type||"broiler",B.age_weeks),readOnly:!0,className:"bg-muted"})]}),O&&i.jsxs("div",{children:[i.jsx(ne,{children:"Health Status"}),i.jsxs(Ye,{value:B.health_status,onValueChange:W=>Y({...B,health_status:W}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"healthy",children:"Healthy"}),i.jsx(oe,{value:"sick",children:"Sick"}),i.jsx(oe,{value:"monitoring",children:"Monitoring"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{children:"Notes"}),i.jsx(ae,{value:B.notes,onChange:W=>Y({...B,notes:W.target.value}),placeholder:"Optional notes"})]})]});return i.jsxs("div",{className:"p-4 pb-20 space-y-6",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsx("h1",{className:"text-2xl font-bold",children:"Flock Management"})}),M(),!n&&!t&&i.jsx(jw,{title:"Sign in to manage your flocks",de
940scription:"Create an account or log in to add, edit, and track your livestock flocks.",feature:"flock management"}),r==="overview"&&i.jsxs("div",{className:"space-y-6",children:[A&&i.jsx(z,{className:"glass-card border-primary/40 bg-primary/5",children:i.jsxs(V,{className:"flex items-center justify-between py-3 gap-3",children:[i.jsxs("div",{className:"text-sm",children:[i.jsx("span",{className:"font-semibold",children:"Flock limit reached"}),i.jsxs("span",{className:"text-muted-foreground",children:[" · ",v.length,"/",C," on your ",N==="free"?"Free":"current"," plan"]})]}),i.jsx(U,{asChild:!0,size:"sm",children:i.jsx(Ke,{to:"/pricing",children:"Upgrade"})})]})}),i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsx("h2",{className:"text-2xl font-bold",children:"My Flocks"}),i.jsxs(yt,{open:l,onOpenChange:B=>B?E():c(!1),children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{className:"bg-gradient-primary text-primary-foreground hover:opacity-90",onClick:B=>{A&&(B.preventDefault(),E())},children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Add Flock"]})}),i.jsxs(mt,{className:"max-h-[90vh] overflow-y-auto",children:[i.jsx(xt,{children:i.jsx(vt,{children:"Add New Flock"})}),T(m,g),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(U,{onClick:P,className:"flex-1",children:"Add Flock"}),i.jsx(U,{variant:"outline",onClick:()=>c(!1),className:"flex-1",children:"Cancel"})]})]})]})]}),i.jsx(yt,{open:u,onOpenChange:d,children:i.jsxs(mt,{className:"max-h-[90vh] overflow-y-auto",children:[i.jsx(xt,{children:i.jsx(vt,{children:"Edit Flock"})}),T(p,x,!0),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(U,{onClick:R,className:"flex-1",children:"Update"}),i.jsx(U,{variant:"outline",onClick:()=>d(!1),className:"flex-1",children:"Cancel"})]})]})}),b?i.jsx("div",{className:"text-center py-8",children:"Loading flocks..."}):v.length===0?i.jsx(z,{className:"glass-card text-center p-8",children:i.jsxs(V,{children:[i.jsx(Ho,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No flocks yet"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"Start by adding your first flock to begin tracking"}),i.jsxs(U,{onClick:E,children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Add Your First Flock"]})]})}):v.map(B=>{const Y=H(B.arrival_date||"",B.age_weeks),O=B.production_stage||Uy(B.bird_type,Y);return i.jsxs(z,{className:"glass-card hover:shadow-lg transition-shadow",children:[i.jsx(re,{className:"pb-3",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx(se,{className:"text-lg",children:B.name}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["ID: ",B.id.slice(0,8)]})]}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx(ye,{variant:"secondary",className:"capitalize",children:B.bird_type}),i.jsx(ye,{variant:"outline",children:O})]})]})}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ht,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs("span",{children:[B.count," birds"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ys,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs("span",{children:[Y," weeks old"]})]}),B.arrival_date&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ys,{className:"h-4 w-4 text-muted-foreground"}),i.jsxs("span",{className:"text-xs",children:["Arrived: ",new Date(B.arrival_date).toLocaleDateString()]})]}),B.house_number&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(xE,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{className:"text-xs",children:B.house_number})]})]}),i.jsx("div",{className:"flex items-center justify-between",children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("div",{className:`h-2 w-2 rounded-full ${B.health_status==="healthy"?"bg-green-500":B.health_status==="sick"?"bg-red-500":"bg-yellow-500"}`}),i.jsx("span",{className:"text-sm capitalize",children:B.health_status})]})}),i.jsxs("div",{className:"flex space-x-2 pt-2",children:[i.jsxs(U,{size:"sm",variant:"outline",className:"flex-1",onClick:()=>$(B),children:[i.jsx(jE,{className:"h-3 w-3 mr-1"})," Edit"]}),i.jsxs(GK,{children:[i.jsx(YK,{asChild:!0,children:i.jsxs(U,{size:"sm",variant:"outline",className:"flex-1 text-destructive hover:text-destructive",children:[i.jsx(cl,{className:"h-3 w-3 mr-1"})," Delete"]})}),i.jsxs(lP,{children:[i.jsxs(cP,{children:[i.jsxs(dP,{children:['Delete "',B.name,'"?']}),i.jsx(hP,{children:"This will permanently delete this flock and all its daily operation logs. This action cannot be undone."})]}),i.jsxs(uP,{children:[i.jsx(mP,{children:"Cancel"}),i.jsx(fP,{onClick:()=>S(B.id),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-1 pt-2 border-t border-border",children:[i.jsxs(U,{size:"sm",variant:"ghost",className:"flex flex-col items-center gap-1 h-auto py-2 text-xs",onClick:()=>D("daily-ops",B.id),children:[i.jsx(cc,{className:"h-4 w-4"}),"Daily Log"]}),i.jsxs(U,{size:"sm",variant:"ghost",className:"flex flex-col items-center gap-1 h-auto py-2 text-xs",onClick:()=>D("tracker",B.id),children:[i.jsx(Pd,{className:"h-4 w-4"}),"Track"]}),i.jsxs(U,{size:"sm",variant:"ghost",className:"flex flex-col items-center gap-1 h-auto py-2 text-xs",onClick:()=>D("growth",B.id),children:[i.jsx(Wt,{className:"h-4 w-4"}),"Growth"]}),i.jsxs(U,{size:"sm",variant:"ghost",className:"flex flex-col items-center gap-1 h-auto py-2 text-xs",onClick:()=>D("type-specific",B.id),children:[i.jsx(Xr,{className:"h-4 w-4"}),"Dashboard"]})]}),i.jsx(cBe,{birdType:B.bird_type,ageWeeks:B.age_weeks,count:B.count,healthStatus:B.health_status||"healthy"})]})]},B.id)})]})]})}
940const pBe=[{id:1,type:"selling",item:"Live Broilers",quantity:"30 birds",price:"R 120/bird",seller:"John Mthembu",location:"Soweto, Johannesburg",rating:4.8,phone:"+27 XX XXX XXXX"},{id:2,type:"selling",item:"Fresh Eggs",quantity:"5 trays",price:"R 35/tray",seller:"Mary Ndlovu",location:"Alexandra, Johannesburg",rating:4.9,phone:"+27 XX XXX XXXX"},{id:3,type:"buying",item:"Chicken Feed",quantity:"50kg bags",price:"R 280/bag",seller:"Feed Supply Co",location:"Midrand, Gauteng",rating:4.7,phone:"+27 XX XXX XXXX"}];function gBe(){return i.jsxs("div",{className:"p-4 pb-20 space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h1",{className:"text-2xl font-bold",children:"Marketplace"}),i.jsxs(U,{size:"sm",children:[i.jsx(rn,{className:"h-4 w-4 mr-1"}),"Add Listing"]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Qp,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),i.jsx("input",{type:"text",placeholder:"Search for chickens, eggs, feed...",className:"w-full pl-10 pr-4 py-3 border border-border rounded-xl bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(U,{variant:"default",size:"sm",children:"All"}),i.jsx(U,{variant:"outline",size:"sm",children:"Selling"}),i.jsx(U,{variant:"outline",size:"sm",children:"Buying"}),i.jsx(U,{variant:"outline",size:"sm",children:"Feed"})]}),i.jsx("div",{className:"space-y-4",children:pBe.map(e=>i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{className:"pb-3",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{children:[i.jsx(se,{className:"text-lg",children:e.item}),i.jsx("p",{className:"text-sm text-muted-foreground",children:e.quantity})]}),i.jsxs("div",{className:"text-right",children:[i.jsx("div",{className:"text-lg font-bold text-primary",children:e.price}),i.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${e.type==="selling"?"bg-success/20 text-success":"bg-secondary/20 text-secondary"}`,children:e.type==="selling"?"For Sale":"Wanted"})]})]})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("div",{className:"font-medium",children:e.seller}),i.jsxs("div",{className:"flex items-center space-x-1",children:[i.jsx(Tu,{className:"h-3 w-3 fill-warning text-warning"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:e.rating})]})]}),i.jsxs("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground",children:[i.jsx(ts,{className:"h-3 w-3"}),i.jsx("span",{children:e.location})]})]}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs(U,{variant:"outline",size:"sm",className:"flex-1",children:[i.jsx(ri,{className:"h-3 w-3 mr-1"}),"Contact"]}),i.jsx(U,{size:"sm",className:"flex-1",children:"View Details"})]})]})]},e.id))}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"Quick Actions"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs(U,{variant:"outline",className:"h-auto p-4 flex-col space-y-2",children:[i.jsx("div",{className:"bg-primary/20 p-2 rounded-lg",children:i.jsx(rn,{className:"h-4 w-4 text-primary"})}),i.jsx("span",{className:"text-sm font-medium",children:"Sell Chickens"})]}),i.jsxs(U,{variant:"outline",className:"h-auto p-4 flex-col space-y-2",children:[i.jsx("div",{className:"bg-secondary/20 p-2 rounded-lg",children:i.jsx(rn,{className:"h-4 w-4 text-secondary"})}),i.jsx("span",{className:"text-sm font-medium",children:"Sell Eggs"})]})]})]})]})}const yBe=({onEditClick:e})=>{const{profile:t}=Cr();if(!t)return null;const n=[{key:"display_name",label:"Display Name",icon:Xb,benefit:"Help others recognize you"},{key:"farm_name",label:"Farm Name",icon:En,benefit:"Build your brand in marketplace"},{key:"location",label:"Location",icon:ts,benefit:"Get local weather & suppliers"},{key:"phone",label:"Phone Number",icon:ri,benefit:"Connect with buyers directly"},{key:"bio",label:"Bio",icon:En,benefit:"Build trust with customers"},{key:"avatar_url",label:"Profile Photo",icon:yB,benefit:"Increase credibility by 60%"}],r=n.filter(l=>{const c=t[l.key];return c!=null&&c!==""}),s=Math.round(r.length/n.length*100);if(s===100)return null;const o=n.filter(l=>{const c=t[l.key];return c==null||c===""});return i.jsxs(z,{className:"glass-card border-primary/20 bg-gradient-to-br from-background to-muted/30",children:[i.jsx(re,{children:i.jsxs(se,{className:"flex items-center justify-between",children:[i.jsx("span",{children:"Complete Your Profile"}),i.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:[r.length," of ",n.length," completed"]})]})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsx("span",{className:"text-muted-foreground",children:"Profile Strength"}),i.jsxs("span",{className:"font-semibold text-primary",children:[s,"%"]})]}),i.jsx(rr,{value:s,className:"h-2"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete your profile to unlock marketplace access and get personalized recommendations"}),i.jsxs("div",{className:"space-y-2 pt-2",children:[o.slice(0,3).map(l=>(l.icon,i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsx(DZ,{className:"h-4 w-4 mt-0.5 text-muted-foreground"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("span",{className:"font-medium",children:l.label}),i.jsxs("span",{className:"text-muted-foreground",children:[" - ",l.benefit]})]})]},l.key))),o.length>3&&i.jsxs("p",{className:"text-xs text-muted-foreground pl-6",children:["+",o.length-3," more fields to complete"]})]})]}),i.jsx(U,{onClick:e,className:"w-full",children:"Complete Profile"}),i.jsx("div",{className:"text-xs text-center text-muted-foreground",children:"⨠Farmers with complete profiles get 40% more visibility"})]})]})};function xBe(){const[e,t]=y.useState(!1),{toast:n}=We();return{cancelSubscription:async s=>{t(!0);try{const{error:a}=await q.rpc("cancel_my_subscription",{_subscription_id:s});if(a)throw a;return n({title:"Subscription canceled",description:"You'll keep access until the end of your current billing period."}),!0}catch(a){return n({title:"Cancel failed",description:a.message,variant:"destructive"}),!1}finally{t(!1)}},loading:e}}function vBe(){const{tier:e,subscription:t,isActive:n,inGracePeriod:r,isPastDue:s,isPending:a,isProvisional:o,needsRenewal:l,daysUntilRenewal:c,loading:u}=Bh(),{cancelSubscription:d,loading:h}=xBe(),{toast:f}=We();if(y.useEffect(()=>{if(!t||!n||a)return;const g=`welcomed-${t.id}`;localStorage.getItem(g)||(localStorage.setItem(g,"1"),f({title:`Welcome to ${Du[e]} ð`,description:"All premium features are unlocked. Happy farming!"}))},[t,n,a,e,f]),u)return null;if(a&&t)return i.jsx(z,{className:"border-primary/40 bg-gradient-to-br from-primary/10 via-secondary/10 to-transparent",children:i.jsxs(V,{className:"p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"p-2 rounded-full bg-primary/20",children:i.jsx($r,{className:"h-5 w-5 text-primary"})}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsxs("h3",{className:"font-semibold",children:["Welcome to ",Du[e]||"your plan"]}),i.jsxs(ye,{variant:"secondary",className:"gap-1",children:[i.jsx(Ad,{className:"h-3 w-3"})," Full access"]})]}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"You're in. Every premium feature is unlocked while we confirm your EFT (usually within 24 hours)."}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Reference ",i.jsx("span",{className:"font-mono",children:t.payment_reference})]})]})]}
940),!o&&i.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:["Verification is taking longer than usual. Email"," ",i.jsx("a",{href:"mailto:[email protected]",className:"underline",children:"[email protected]"}),"."]})]})});if(!n&&!r)return i.jsx(z,{className:"glass-card hover:shadow-lg transition-shadow",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(ZS,{className:"h-5 w-5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium",children:"Subscription"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"You're on the Free plan"})]})]}),i.jsx(U,{asChild:!0,size:"sm",children:i.jsx(Ke,{to:"/pricing",children:"View plans"})})]})})});const m=t!=null&&t.current_period_end?new Date(t.current_period_end).toLocaleDateString("en-ZA"):null;return i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 space-y-4",children:[i.jsx("div",{className:"flex items-start justify-between gap-3",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(ZS,{className:"h-5 w-5 text-primary"}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("h3",{className:"font-medium",children:Du[e]}),s&&i.jsx(ye,{variant:"destructive",children:"Past due"}),(t==null?void 0:t.cancel_at_period_end)&&i.jsxs(ye,{variant:"secondary",children:["Cancels ",m]}),r&&!n&&i.jsxs(ye,{variant:"secondary",children:["Ends ",m]}),i.jsx(ye,{variant:"outline",children:(t==null?void 0:t.provider)==="yoco"?"Card":"EFT"}),l&&!(t!=null&&t.cancel_at_period_end)&&i.jsxs(ye,{variant:"secondary",children:["Renews in ",Math.max(c??0,0)," day",c===1?"":"s"]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:s?"Renew your subscription to keep access.":m?`Access until ${m}`:"Active subscription"})]})]})}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(U,{asChild:!0,variant:"outline",size:"sm",children:i.jsxs(Ke,{to:"/pricing",children:[i.jsx(eN,{className:"h-4 w-4 mr-2"}),"Renew or change plan"]})}),!(t!=null&&t.cancel_at_period_end)&&n&&t&&i.jsxs(GK,{children:[i.jsx(YK,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"sm",className:"text-destructive",children:[i.jsx(hh,{className:"h-4 w-4 mr-2"}),"Cancel"]})}),i.jsxs(lP,{children:[i.jsxs(cP,{children:[i.jsx(dP,{children:"Cancel subscription?"}),i.jsxs(hP,{children:["You'll keep access to ",Du[e]," features until ",m,". After that, your account will return to the Free plan."]})]}),i.jsxs(uP,{children:[i.jsx(mP,{children:"Keep subscription"}),i.jsx(fP,{disabled:h,onClick:()=>d(t.id),children:"Cancel subscription"})]})]})]})]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["For invoices or payment issues, email"," ",i.jsx("a",{href:"mailto:[email protected]",className:"underline",children:"[email protected]"}),"."]})]})})}function bBe(){We();const{t:e}=Gi(),{profile:t,loading:n,updateProfile:r}=Cr(),{flocks:s,loading:a}=rP(),[o,l]=y.useState(!1),[c,u]=y.useState({display_name:"",farm_name:"",location:"",phone:"",bio:""}),d=()=>{Object.keys(localStorage).forEach(g=>{(g.startsWith("supabase.auth.")||g.includes("sb-"))&&localStorage.removeItem(g)}),Object.keys(sessionStorage||{}).forEach(g=>{(g.startsWith("supabase.auth.")||g.includes("sb-"))&&sessionStorage.removeItem(g)})},h=()=>{t&&(u({display_name:t.display_name||"",farm_name:t.farm_name||"",location:t.location||"",phone:t.phone||"",bio:t.bio||""}),l(!0))},f=async()=>{try{await r(c),l(!1)}catch(g){console.error("Error updating profile:",g)}},m=async()=>{try{d();try{await q.auth.signOut({scope:"global"})}catch{}window.location.href="/"}catch(g){console.error("Logout error:",g),window.location.href="/"}};return i.jsxs("div",{className:"p-4 pb-20 space-y-6",children:[i.jsx(yBe,{onEditClick:h}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{className:"pb-2",children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(Cd,{className:"h-4 w-4"})," ",e("profile.language")]})}),i.jsxs(V,{className:"space-y-3",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:e("profile.languageDescription")}),i.jsx(H2,{showIcon:!1})]})]}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-6 text-center space-y-4",children:[i.jsx("div",{className:"w-20 h-20 bg-primary rounded-full flex items-center justify-center mx-auto",children:t!=null&&t.avatar_url?i.jsx("img",{src:t.avatar_url,alt:"Profile",className:"w-20 h-20 rounded-full object-cover"}):i.jsx(Xb,{className:"h-10 w-10 text-primary-foreground"})}),i.jsx("div",{children:n?i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"h-6 bg-muted animate-pulse rounded mx-auto w-32"}),i.jsx("div",{className:"h-4 bg-muted animate-pulse rounded mx-auto w-24"})]}):t?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"text-xl font-bold",children:t.display_name||"Farmer"}),i.jsx("p",{className:"text-muted-foreground",children:t.user_type==="farmer"?t.farm_name?`${t.farm_name} Farm`:"Livestock Farmer":"Incubator"}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.location&&`${t.location} ⢠`,"Member since ",new Date(t.created_at).toLocaleDateString("en-US",{month:"short",year:"numeric"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"text-xl font-bold",children:"Welcome!"}),i.jsx("p",{className:"text-muted-foreground",children:"Livestock Farmer"})]})}),i.jsxs(yt,{open:o,onOpenChange:l,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"sm",onClick:h,children:[i.jsx(jE,{className:"h-4 w-4 mr-2"}),"Edit Profile"]})}),i.jsxs(mt,{className:"sm:max-w-[425px]",children:[i.jsx(xt,{children:i.jsx(vt,{children:"Edit Profile"})}),i.jsxs("div",{className:"grid gap-4 py-4",children:[i.jsxs("div",{className:"grid gap-2",children:[i.jsx(ne,{htmlFor:"display_name",children:"Display Name"}),i.jsx(ae,{id:"display_name",value:c.display_name,onChange:g=>u({...c,display_name:g.target.value}),placeholder:"Your display name"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(ne,{htmlFor:"farm_name",children:"Farm Name"}),i.jsx(ae,{id:"farm_name",value:c.farm_name,onChange:g=>u({...c,farm_name:g.target.value}),placeholder:"Your farm name"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(ne,{htmlFor:"location",children:"Location"}),i.jsxs(Ye,{value:c.location,onValueChange:g=>u({...c,location:tme(g)}),children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select your location"})}),i.jsx(qe,{children:b0.map(g=>i.jsx(oe,{value:g.value,children:g.label},g.value))})]})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(ne,{htmlFor:"phone",children:"Phone Number"}),i.jsx(ae,{id:"phone",value:c.phone,onChange:g=>u({...c,phone:g.target.value}),placeholder:"Your phone number"})]}),i.jsxs("div",{className:"grid gap-2",children:[i.jsx(ne,{htmlFor:"bio",children:"Bio"}),i.jsx(Yt,{id:"bio",value:c.bio,onChange:g=>u({...c,bio:g.target.value}),placeholder:"Tell us about yourself and your farm",rows:3})]})]}),i.jsxs("div",{className:"flex justify-end gap-2",children:[i.jsx(U,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),i.jsx(U,{onClick:f,children:"Save Changes"})]})]})]})]})}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(Xr,{className:"h-5 w-5"}),"My Farm Stats"]})}),i.jsxs(V,{className:"space-y-4",children:[a?i.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center",children:[i.jsxs("div",{children:[i.jsx("div",{className:"h-8 bg-muted animate-pulse rounded mx-auto w-16"}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Birds"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"h-8 bg-muted animate-pulse rounded mx-auto w-20"}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Active Flocks"})]})]}):i.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-2xl font-bold text-primary",children:s.reduce((g,p)=>
940g+p.count,0)}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Birds"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-2xl font-bold text-secondary",children:s.length}),i.jsx("div",{className:"text-sm text-muted-foreground",children:"Active Flocks"})]})]}),i.jsx(U,{variant:"outline",className:"w-full",onClick:()=>window.open("/smart-analytics","_blank"),children:"View Detailed Stats"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"Settings"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(z,{className:"glass-card cursor-pointer hover:shadow-lg transition-shadow",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(Cd,{className:"h-5 w-5 text-primary"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-medium",children:"Language & Region"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"English ⢠South Africa"})]}),i.jsx(eN,{className:"h-4 w-4 text-muted-foreground"})]})})}),i.jsx(z,{className:"glass-card cursor-pointer hover:shadow-lg transition-shadow",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(ts,{className:"h-5 w-5 text-secondary"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-medium",children:"Location"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:(t==null?void 0:t.location)||"Location not set"})]}),i.jsx(eN,{className:"h-4 w-4 text-muted-foreground"})]})})}),i.jsx(z,{className:"glass-card cursor-pointer hover:shadow-lg transition-shadow",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(mee,{className:"h-5 w-5 text-warning"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium",children:"Offline Data Sync"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Save data when offline"})]})]}),i.jsx("div",{className:"w-11 h-6 bg-primary rounded-full flex items-center px-1",children:i.jsx("div",{className:"w-4 h-4 bg-white rounded-full ml-auto"})})]})})}),i.jsx(z,{className:"glass-card cursor-pointer hover:shadow-lg transition-shadow",onClick:m,children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(vE,{className:"h-5 w-5 text-destructive"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-medium text-destructive",children:"Sign Out"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Logout from your account"})]})]})})})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"Subscription"}),i.jsx(vBe,{})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"Support"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(Ke,{to:"/help",children:i.jsx(z,{className:"glass-card cursor-pointer hover:shadow-lg transition-shadow",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(hB,{className:"h-5 w-5 text-success"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium",children:"Help Center"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Get answers to common questions"})]})]})})})}),i.jsx(z,{className:"glass-card cursor-pointer hover:shadow-lg transition-shadow",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(ri,{className:"h-5 w-5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium",children:"Contact Support"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"068 474 5436"})]})]})})}),i.jsx(z,{className:"glass-card cursor-pointer hover:shadow-lg transition-shadow",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(Ua,{className:"h-5 w-5 text-secondary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-medium",children:"Email Support"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"[email protected]"})]})]})})})]})]}),i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 text-center space-y-2",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:"Flockify v1.0.0"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Empowering African farmers with smart livestock management"})]})})]})}const pP=()=>{const[e,t]=y.useState([]),[n,r]=y.useState(0),[s,a]=y.useState(!0),{profile:o}=Cr(),l=y.useCallback(async()=>
940{if(!(o!=null&&o.user_id)){t([]),r(0),a(!1);return}try{const{data:h,error:f}=await q.from("notifications").select("*").eq("user_id",o.user_id).order("created_at",{ascending:!1}).limit(50);if(f)throw f;if(h){const m=[...new Set(h.filter(x=>x.actor_id).map(x=>x.actor_id))];let g={};if(m.length>0){const{data:x}=await q.from("profiles").select("user_id, display_name, avatar_url").in("user_id",m);x&&(g=x.reduce((v,b)=>(v[b.user_id]={display_name:b.display_name||"Farmer",avatar_url:b.avatar_url},v),{}))}const p=h.map(x=>({...x,actor_profile:x.actor_id?g[x.actor_id]:void 0}));t(p),r(h.filter(x=>!x.is_read).length)}}catch(h){console.error("Error fetching notifications:",h)}finally{a(!1)}},[o==null?void 0:o.user_id]),c=async h=>{try{const{error:f}=await q.from("notifications").update({is_read:!0}).eq("id",h);if(f)throw f;t(m=>m.map(g=>g.id===h?{...g,is_read:!0}:g)),r(m=>Math.max(0,m-1))}catch(f){console.error("Error marking notification as read:",f)}},u=async()=>{if(o!=null&&o.user_id)try{const{error:h}=await q.from("notifications").update({is_read:!0}).eq("user_id",o.user_id).eq("is_read",!1);if(h)throw h;t(f=>f.map(m=>({...m,is_read:!0}))),r(0)}catch(h){console.error("Error marking all notifications as read:",h)}},d=async(h,f,m,g,p)=>{if(!(!(o!=null&&o.user_id)||h===o.user_id))try{const{error:x}=await q.from("notifications").insert({user_id:h,type:f,title:m,message:g,actor_id:o.user_id,post_id:p||null});if(x)throw x}catch(x){console.error("Error creating notification:",x)}};return y.useEffect(()=>{l()},[l]),y.useEffect(()=>{if(!(o!=null&&o.user_id))return;const h=q.channel("notifications-channel").on("postgres_changes",{event:"INSERT",schema:"public",table:"notifications",filter:`user_id=eq.${o.user_id}`},()=>{l()}).subscribe();return()=>{q.removeChannel(h)}},[o==null?void 0:o.user_id,l]),{notifications:e,unreadCount:n,loading:s,markAsRead:c,markAllAsRead:u,createNotification:d,refetch:l}};var gP="Avatar",[wBe,R7e]=kr(gP),[jBe,JK]=wBe(gP),QK=y.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[s,a]=y.useState("idle");return i.jsx(jBe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:a,children:i.jsx(ve.span,{...r,ref:t})})});QK.displayName=gP;var ZK="AvatarImage",eG=y.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...a}=e,o=JK(ZK,n),l=SBe(r),c=dt(u=>{s(u),o.onImageLoadingStatusChange(u)});return Nt(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?i.jsx(ve.img,{...a,ref:t,src:r}):null});eG.displayName=ZK;var tG="AvatarFallback",nG=y.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...s}=e,a=JK(tG,n),[o,l]=y.useState(r===void 0);return y.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&a.imageLoadingStatus!=="loaded"?i.jsx(ve.span,{...s,ref:t}):null});nG.displayName=tG;function SBe(e){const[t,n]=y.useState("idle");return Nt(()=>{if(!e){n("error");return}let r=!0;const s=new window.Image,a=o=>()=>{r&&n(o)};return n("loading"),s.onload=a("loaded"),s.onerror=a("error"),s.src=e,()=>{r=!1}},[e]),t}var rG=QK,sG=eG,iG=nG;const Ti=y.forwardRef(({className:e,...t},n)=>i.jsx(rG,{ref:n,className:fe("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ti.displayName=rG.displayName;const pa=y.forwardRef(({className:e,...t},n)=>i.jsx(sG,{ref:n,className:fe("aspect-square h-full w-full",e),...t}));pa.displayName=sG.displayName;const Oi=y.forwardRef(({className:e,...t},n)=>i.jsx(iG,{ref:n,className:fe("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Oi.displayName=iG.displayName;var NBe="DismissableLayer",Z_="dismissableLayer.update",kBe="dismissableLayer.pointerDownOutside",_Be="dismissableLayer.focusOutside",J4,aG=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),oG=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=e,u=y.useContext(aG),[d,h]=y.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=y.useState({}),g=Ce(t,k=>
vendor: 15,130 bytes, lines 940-943
940h(k)),p=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(x),b=d?p.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=v,S=ABe(k=>{const _=k.target,C=[...u.branches].some(A=>A.contains(_));!j||C||(s==null||s(k),o==null||o(k),k.defaultPrevented||l==null||l())},f),N=PBe(k=>{const _=k.target;[...u.branches].some(A=>A.contains(_))||(a==null||a(k),o==null||o(k),k.defaultPrevented||l==null||l())},f);return Gp(k=>{b===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},f),y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(J4=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Q4(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=J4)}},[d,f,n,u]),y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Q4())},[d,u]),y.useEffect(()=>{const k=()=>m({});return document.addEventListener(Z_,k),()=>document.removeEventListener(Z_,k)},[]),i.jsx(ve.div,{...c,ref:g,style:{pointerEvents:w?j?"auto":"none":void 0,...e.style},onFocusCapture:ge(e.onFocusCapture,N.onFocusCapture),onBlurCapture:ge(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:ge(e.onPointerDownCapture,S.onPointerDownCapture)})});oG.displayName=NBe;var CBe="DismissableLayerBranch",EBe=y.forwardRef((e,t)=>{const n=y.useContext(aG),r=y.useRef(null),s=Ce(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),i.jsx(ve.div,{...e,ref:s})});EBe.displayName=CBe;function ABe(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){lG(kBe,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function PBe(e,t=globalThis==null?void 0:globalThis.document){const n=dt(e),r=y.useRef(!1);return y.useEffect(()=>{const s=a=>{a.target&&!r.current&&lG(_Be,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Q4(){const e=new CustomEvent(Z_);document.dispatchEvent(e)}function lG(e,t,n,{discrete:r}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?uh(s,a):s.dispatchEvent(a)}var R1=0;function TBe(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Z4()),document.body.insertAdjacentElement("beforeend",e[1]??Z4()),R1++,()=>{R1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),R1--}},[])}function Z4(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var OBe="Portal",cG=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,a]=y.useState(!1);Nt(()=>a(!0),[]);const o=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ch.createPortal(i.jsx(ve.div,{...r,ref:t}),o):null});cG.displayName=OBe;var wo=function(){return wo=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},wo.apply(this,arguments)};function RBe(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 s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function MBe(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,a;r<s;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 uG=N0(),M1=function(){},Ew=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:M1,onWheelCapture:M1,onTouchMoveCapture:M1}),s=r[0],a=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,m=e.noIsolation,g=e.inert,p=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,b=e.gapMode,w=RBe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=f,S=S0([n,t]),N=wo(wo({},w),s);return y.createElement(y.Fragment,null,d&&y.createElement(j,{sideCar:uG,removeScrollBar:u,shards:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!p,lockRef:n,gapMode:b}),o?y.cloneElement(y.Children.only(l),wo(wo({},N),{ref:S})):y.createElement(v,wo({},N,{className:c,ref:S}),l))});Ew.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ew.classNames={fullWidth:fc,zeroRight:hc};var eC=!1;if(typeof window<"u")try{var Vy=Object.defineProperty({},"passive",{get:function(){return eC=!0,!0}});window.addEventListener("test",Vy,Vy),window.removeEventListener("test",Vy,Vy)}catch{eC=!1}var uu=eC?{passive:!1}:!1,IBe=function(e){return e.tagName==="TEXTAREA"},dG=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!IBe(e)&&n[t]==="visible")},$Be=function(e){return dG(e,"overflowY")},LBe=function(e){return dG(e,"overflowX")},e5=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=hG(e,r);if(s){var a=fG(e,r),o=a[1],l=a[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},DBe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},FBe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hG=function(e,t){return e==="v"?$Be(t):LBe(t)},fG=function(e,t){return e==="v"?DBe(t):FBe(t)},BBe=function(e,t){return e==="h"&&t==="rtl"?-1:1},zBe=function(e,t,n,r,s){var a=BBe(e,window.getComputedStyle(t).direction),o=a*r,l=n.target,c=t.contains(l),u=!1,d=o>0,h=0,f=0;do{var m=fG(e,l),g=m[0],p=m[1],x=m[2],v=p-x-a*g;(g||v)&&hG(e,l)&&(h+=v,f+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(h)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(u=!0),u},Wy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},t5=function(e){return[e.deltaX,e.deltaY]},n5=function(e){return e&&"current"in e?e.current:e},UBe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VBe=function(e){return` 941 .block-interactivity-`.concat(e,` {pointer-events: none;} 942 .allow-interactivity-`).concat(e,` {pointer-events: all;} 943`)},WBe=0,du=[];function HBe(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),s=y.useState(WBe++)[0],a=y.useState(cg)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var p=MBe([e.lockRef.current],(e.shards||[]).map(n5),!0).filter(Boolean);return p.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),p.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(p,x){if("touches"in p&&p.touches.length===2)return!o.current.allowPinchZoom;var v=Wy(p),b=n.current,w="deltaX"in p?p.deltaX:b[0]-v[0],j="deltaY"in p?p.deltaY:b[1]-v[1],S,N=p.target,k=Math.abs(w)>Math.abs(j)?"h":"v";if("touches"in p&&k==="h"&&N.type==="range")return!1;var _=e5(k,N);if(!_)return!0;if(_?S=k:(S=k==="v"?"h":"v",_=e5(k,N)),!_)return!1;if(!r.current&&"changedTouches"in p&&(w||j)&&(r.current=S),!S)return!0;var C=r.current||S;return zBe(C,x,p,C==="h"?w:j,!0)},[]),c=y.useCallback(function(p){var x=p;if(!(!du.length||du[du.length-1]!==a)){var v="deltaY"in x?t5(x):Wy(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&UBe(S.delta,v)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(o.current.shards||[]).map(n5).filter(Boolean).filter(function(S){return S.contains(x.target)}),j=w.length>0?l(x,w[0]):!o.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),u=y.useCallback(function(p,x,v,b){var w={name:p,delta:x,target:v,should:b,shadowParent:qBe(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(j){return j!==w})},1)},[]),d=y.useCallback(function(p){n.current=Wy(p),r.current=void 0},[]),h=y.useCallback(function(p){u(p.type,t5(p),p.target,l(p,e.lockRef.current))},[]),f=y.useCallback(function(p){u(p.type,Wy(p),p.target,l(p,e.lockRef.current))},[]);y.useEffect(function(){return du.push(a),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,uu),document.addEventListener("touchmove",c,uu),document.addEventListener("touchstart",d,uu),function(){du=du.filter(function(p){return p!==a}),document.removeEventListener("wheel",c,uu),document.removeEventListener("touchmove",c,uu),document.removeEventListener("touchstart",d,uu)}},[]);var m=e.removeScrollBar,g=e.inert;return y.createElement(y.Fragment,null,g?y.createElement(a,{styles:VBe(s)}):null,m?y.createElement(C0,{gapMode:e.gapMode}):null)}function qBe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const KBe=k0(uG,HBe);var mG=y.forwardRef(function(e,t){return y.createElement(Ew,wo({},e,{ref:t,sideCar:KBe}))});mG.classNames=Ew.classNames;var yP="Popover",[pG,M7e]=kr(yP,[gh]),Sg=gh(),[GBe,Sl]=pG(yP),gG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:a,modal:o=!1}=e,l=Sg(t),c=y.useRef(null),[u,d]=y.useState(!1),[h=!1,f]=ni({prop:r,defaultProp:s,onChange:a});return i.jsx(IE,{...l,children:i.jsx(GBe,{scope:t,contentId:Kr(),triggerRef:c,open:h,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(m=>!m),[f]),hasCustomAnchor:u,onCustomAnchorAdd:y.useCallback(()=>d(!0),[]),onCustomAnchorRemove:y.useCallback(()=>d(!1),[]),modal:o,children:n})})};gG.displayName=yP;var yG="PopoverAnchor",YBe=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Sl(yG,n),a=Sg(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=s;return y.useEffect(()=>(o(),()=>l()),[o,l]),i.jsx(e0,{...a,...r,ref:t})});YBe.displayName=yG;var xG="PopoverTrigger",vG=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Sl(xG,n),a=Sg(n),o=Ce(t,s.triggerRef),l=i.jsx(ve.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":NG(s.open),...r,ref:o,onClick:ge(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?l:i.jsx(e0,{asChild:!0,...a,children:l})});vG.displayName=xG;var xP="PopoverPortal",[XBe,JBe]=pG(xP,{forceMount:void 0}),bG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,a=Sl(xP,t);return i.jsx(XBe,{scope:t,forceMount:n,children:i.jsx(es,{present:n||a.open,children:i.jsx(cG,{asChild:!0,container:s,children:r})})})};bG.displayName=xP;var ih="PopoverContent",wG=y.forwardRef((e,t)=>{const n=JBe(ih,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,a=Sl(ih,e.__scopePopover);return i.jsx(es,{present:r||a.open,children:a.modal?i.jsx(QBe,{...s,ref:t}):i.jsx(ZBe,{...s,ref:t})})});wG.displayName=ih;var QBe=y.forwardRef((e,t)=>{const n=Sl(ih,e.__scopePopover),r=y.useRef(null),s=Ce(t,r),a=y.useRef(!1);return y.useEffect(()=>{const o=r.current;if(o)return E0(o)},[]),i.jsx(mG,{as:Ta,allowPinchZoom:!0,children:i.jsx(jG,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ge(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ge(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ge(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),ZBe=y.forwardRef((e,t)=>{const n=Sl(ih,e.__scopePopover),r=y.useRef(!1),s=y.useRef(!1);return i.jsx(jG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),jG=y.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,f=Sl(ih,n),m=Sg(n);return TBe(),i.jsx(lg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:i.jsx(oG,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:i.jsx($E,{"data-state":NG(f.open),role:"dialog",id:f.contentId,...m,...h,ref:t,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),SG="PopoverClose",eze=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Sl(SG,n);return i.jsx(ve.button,{type:"button",...r,ref:t,onClick:ge(e.onClick,()=>s.onOpenChange(!1))})});eze.displayName=SG;var tze="PopoverArrow",nze=y.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Sg(n);return i.jsx(LE,{...s,...r,ref:t})});nze.displayName=tze;function NG(e){return e?"open":"closed"}var rze=gG,sze=vG,ize=bG,kG=wG;const aze=rze,oze=sze,_G=y.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>i.jsx(ize,{children:i.jsx(kG,{ref:s,align:t,sideOffset:n,className:fe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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]:sli
943de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));_G.displayName=kG.displayName;function Fn(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 lze(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const Hy=43200,r5=1440;let cze={};function uze(){return cze}function s5(e){const t=Fn(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 Sx(e,t){const n=Fn(e),r=Fn(t),s=n.getTime()-r.getTime();return s<0?-1:s>0?1:s}function dze(e){return lze(e,Date.now())}function hze(e,t){const n=Fn(e),r=Fn(t),s=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return s*12+a}function fze(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function mze(e,t){return+Fn(e)-+Fn(t)}function pze(e){const t=Fn(e);return t.setHours(23,59,59,999),t}function gze(e){const t=Fn(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function yze(e){const t=Fn(e);return+pze(t)==+gze(t)}function xze(e,t){const n=Fn(e),r=Fn(t),s=Sx(n,r),a=Math.abs(hze(n,r));let o;if(a<1)o=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-s*a);let l=Sx(n,r)===-s;yze(Fn(e))&&a===1&&Sx(e,r)===1&&(l=!1),o=s*(a-Number(l))}return o===0?0:o}function vze(e,t,n){const r=mze(e,t)/1e3;return fze(n==null?void 0:n.roundingMethod)(r)}const bze={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"}},wze=(e,t,n)=>{let r;const s=bze[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function I1(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const jze={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sze={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Nze={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kze={date:I1({formats:jze,defaultWidth:"full"}),time:I1({formats:Sze,defaultWidth:"full"}),dateTime:I1({formats:Nze,defaultWidth:"full"})},_ze={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Cze=(e,t,n,r)=>_ze[e];function gf(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[o]}const a=e.argumentCallback?e.argumentCallback(t):t;return s[a]}}const Eze={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Aze={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pze={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"]},Tze={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","Frid
943ay","Saturday"]},Oze={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"}},Rze={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"}},Mze=(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"},Ize={ordinalNumber:Mze,era:gf({values:Eze,defaultWidth:"wide"}),quarter:gf({values:Aze,defaultWidth:"wide",argumentCallback:e=>e-1}),month:gf({values:Pze,defaultWidth:"wide"}),day:gf({values:Tze,defaultWidth:"wide"}),dayPeriod:gf({values:Oze,defaultWidth:"wide",formattingValues:Rze,defaultFormattingWidth:"wide"})};function yf(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(s);if(!a)return null;const o=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?Lze(l,h=>h.test(o)):$ze(l,h=>h.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function $ze(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Lze(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Dze(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=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 l=t.slice(s.length);return{value:o,rest:l}}}const Fze=/^(\d+)(th|st|nd|rd)?/i,Bze=/\d+/i,zze={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},Uze={any:[/^b/i,/^(a|c)/i]},Vze={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wze={any:[/1/i,/2/i,/3/i,/4/i]},Hze={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},qze={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]},Kze={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},Gze={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]},Yze={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},Xze={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}},Jze={ordinalNumber:Dze({matchPattern:Fze,parsePattern:Bze,valueCallback:e=>parseInt(e,10)}),era:yf({matchPatterns:zze,defaultMatchWidth:"wide",parsePatterns:Uze,defaultParseWidth:"any"}),quarter:yf({matchPatterns:Vze,defaultMatchWidth:"wide",parsePatterns:Wze,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yf({matchPatterns:Hze,defaultMatchWidth:"wide",parsePatterns:qze,defaultParseWidth:"any"}),day:yf({matchPatterns:Kze,defaultMatchWidth:"wide",parsePatterns:Gze,defaultParseWidth:"any"}),dayPeriod:yf({matchPatterns:Yze,defaultMatchWidth:"any",parsePatterns:Xze,defaultParseWidth:"any"})},Qze={code:"en-US",formatDistance:wze,formatLong:kze,formatRelative:Cze,localize:Ize,match:Jze,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Zze(e,t,n){const r=uze(),s=(n==null?void 0:n.locale)??r.locale??Qze,a=2520,o=Sx(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o});let c,u;o>0?(c=Fn(t),u=Fn(e)):(c=Fn(e),u=Fn(t));
943const d=vze(u,c),h=(s5(u)-s5(c))/1e3,f=Math.round((d-h)/60);let m;if(f<2)return n!=null&&n.includeSeconds?d<5?s.formatDistance("lessThanXSeconds",5,l):d<10?s.formatDistance("lessThanXSeconds",10,l):d<20?s.formatDistance("lessThanXSeconds",20,l):d<40?s.formatDistance("halfAMinute",0,l):d<60?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",1,l):f===0?s.formatDistance("lessThanXMinutes",1,l):s.formatDistance("xMinutes",f,l);if(f<45)return s.formatDistance("xMinutes",f,l);if(f<90)return s.formatDistance("aboutXHours",1,l);if(f<r5){const g=Math.round(f/60);return s.formatDistance("aboutXHours",g,l)}else{if(f<a)return s.formatDistance("xDays",1,l);if(f<Hy){const g=Math.round(f/r5);return s.formatDistance("xDays",g,l)}else if(f<Hy*2)return m=Math.round(f/Hy),s.formatDistance("aboutXMonths",m,l)}if(m=xze(u,c),m<12){const g=Math.round(f/Hy);return s.formatDistance("xMonths",g,l)}else{const g=m%12,p=Math.trunc(m/12);return g<3?s.formatDistance("aboutXYears",p,l):g<9?s.formatDistance("overXYears",p,l):s.formatDistance("almostXYears",p+1,l)}}function tC(e,t){return Zze(e,dze(e),t)}const e8e=e=>{switch(e){case"like":return i.jsx(Zs,{className:"h-4 w-4 text-red-500"});case"comment":return i.jsx(Ko,{className:"h-4 w-4 text-blue-500"});case"message":return i.jsx(Ua,{className:"h-4 w-4 text-primary"});case"payment_pending":return i.jsx(Ad,{className:"h-4 w-4 text-amber-600"});default:return i.jsx(jc,{className:"h-4 w-4 text-muted-foreground"})}};function t8e(){const[e,t]=y.useState(!1),n=Ki(),{notifications:r,unreadCount:s,loading:a,markAsRead:o,markAllAsRead:l}=pP();return i.jsxs(aze,{open:e,onOpenChange:t,children:[i.jsx(oze,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",className:"relative",children:[i.jsx(jc,{className:"h-5 w-5"}),s>0&&i.jsx(ye,{className:"absolute -top-1 -right-1 h-5 w-5 flex items-center justify-center p-0 text-xs bg-destructive text-destructive-foreground",children:s>9?"9+":s})]})}),i.jsxs(_G,{className:"w-80 p-0",align:"end",children:[i.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[i.jsx("h4",{className:"font-semibold",children:"Notifications"}),s>0&&i.jsxs(U,{variant:"ghost",size:"sm",className:"h-8 text-xs gap-1",onClick:l,children:[i.jsx(IZ,{className:"h-3 w-3"}),"Mark all read"]})]}),i.jsx(Zu,{className:"h-[300px]",children:a?i.jsx("div",{className:"flex items-center justify-center py-8",children:i.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}):r.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center px-4",children:[i.jsx(jc,{className:"h-10 w-10 text-muted-foreground mb-2"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"No notifications yet"}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"When someone likes or comments on your posts, you'll see it here"})]}):i.jsx("div",{className:"divide-y divide-border",children:r.map(c=>{var u,d,h;return i.jsxs("button",{className:fe("w-full flex items-start gap-3 p-4 text-left hover:bg-muted/50 transition-colors",!c.is_read&&"bg-primary/5"),onClick:()=>{c.is_read||o(c.id),c.type==="payment_pending"&&(t(!1),n("/admin/payments"))},children:[i.jsxs(Ti,{className:"h-9 w-9 shrink-0",children:[i.jsx(pa,{src:((u=c.actor_profile)==null?void 0:u.avatar_url)||""}),i.jsx(Oi,{className:"bg-secondary text-secondary-foreground text-xs",children:((h=(d=c.actor_profile)==null?void 0:d.display_name)==null?void 0:h.charAt(0))||"F"})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[e8e(c.type),i.jsx("span",{className:"font-medium text-sm truncate",children:c.title})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 line-clamp-2",children:c.message}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:tC(new Date(c.created_at),{addSuffix:!0})})]}),!c.is_read&&i.jsx("div",{className:"h-2 w-2 rounded-full bg-primary shrink-0 mt-2"})]},c.id)})})})]})]})}const CG=WV,EG=HV,n8e=qV,AG=y.forwardRef(({className:e,...t},n)=>i.jsx(A0,{className:fe("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,ref:n}));AG.displayName=A0.displayName;const r8e=Xp("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),vP=y.forwardRef(({side:e="right",className:t,children:n,...r},s)=>i.jsxs(n8e,{children:[i.jsx(AG,{}),i.jsxs(P0,{ref:s,className:fe(r8e({side:e}),t),...r,children:[n,i.jsxs(KV,{className:"absolute right-4 top-4 roun
943ded-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-secondary",children:[i.jsx(hh,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vP.displayName=P0.displayName;const bP=({className:e,...t})=>i.jsx("div",{className:fe("flex flex-col space-y-2 text-center sm:text-left",e),...t});bP.displayName="SheetHeader";const wP=y.forwardRef(({className:e,...t},n)=>i.jsx(T0,{ref:n,className:fe("text-lg font-semibold text-foreground",e),...t}));wP.displayName=T0.displayName;const PG=y.forwardRef(({className:e,...t},n)=>i.jsx(O0,{ref:n,className:fe("text-sm text-muted-foreground",e),...t}));PG.displayName=O0.displayName;const s8e=()=>{const[e,t]=y.useState([]),[n,r]=y.useState(!0),[s,a]=y.useState(0),{profile:o}=Cr(),{createNotification:l}=pP(),c=y.useCallback(async()=>{if(!(o!=null&&o.user_id)){t([]),r(!1);return}try{const{data:m,error:g}=await q.from("conversations").select("*").or(`participant_1.eq.${o.user_id},participant_2.eq.${o.user_id}`).order("last_message_at",{ascending:!1});if(g)throw g;if(!m||m.length===0){t([]),a(0),r(!1);return}const p=m.map(S=>S.participant_1===o.user_id?S.participant_2:S.participant_1),{data:x}=await q.from("profiles").select("user_id, display_name, avatar_url, farm_name").in("user_id",p),v=m.map(S=>S.id),{data:b}=await q.from("messages").select("conversation_id, content, sender_id, is_read, created_at").in("conversation_id",v).order("created_at",{ascending:!1});let w=0;const j=m.map(S=>{var E;const N=S.participant_1===o.user_id?S.participant_2:S.participant_1,k=x==null?void 0:x.find(P=>P.user_id===N),_=(b==null?void 0:b.filter(P=>P.conversation_id===S.id))||[],C=(E=_[0])==null?void 0:E.content,A=_.filter(P=>P.sender_id!==o.user_id&&!P.is_read).length;return w+=A,{...S,other_user:k?{user_id:k.user_id,display_name:k.display_name||"Farmer",avatar_url:k.avatar_url,farm_name:k.farm_name}:void 0,last_message:C,unread_count:A}});t(j),a(w)}catch(m){console.error("Error fetching conversations:",m)}finally{r(!1)}},[o==null?void 0:o.user_id]),u=async m=>{if(!(o!=null&&o.user_id))return null;try{const{data:g}=await q.from("conversations").select("id").or(`and(participant_1.eq.${o.user_id},participant_2.eq.${m}),and(participant_1.eq.${m},participant_2.eq.${o.user_id})`).maybeSingle();if(g)return g.id;const{data:p,error:x}=await q.from("conversations").insert({participant_1:o.user_id,participant_2:m}).select("id").single();if(x)throw x;return c(),p.id}catch(g){return console.error("Error creating conversation:",g),null}},d=async m=>{try{const{data:g,error:p}=await q.from("messages").select("*").eq("conversation_id",m).order("created_at",{ascending:!0});if(p)throw p;return g||[]}catch(g){return console.error("Error fetching messages:",g),[]}},h=async(m,g,p)=>{if(!(o!=null&&o.user_id)||!g.trim())return null;try{const{data:x,error:v}=await q.from("messages").insert({conversation_id:m,sender_id:o.user_id,content:g.trim()}).select().single();if(v)throw v;return await q.from("conversations").update({last_message_at:new Date().toISOString()}).eq("id",m),l(p,"message",`New message from ${o.display_name||"Someone"}`,g.substring(0,100)+(g.length>100?"...":"")),x}catch(x){return console.error("Error sending message:",x),null}},f=async m=>{if(o!=null&&o.user_id)try{await q.from("messages").update({is_read:!0}).eq("conversation_id",m).neq("sender_id",o.user_id).eq("is_read",!1),c()}catch(g){console.error("Error marking messages as read:",g)}};return y.useEffect(()=>{c()},[c]),y.useEffect(()=>{if(!(o!=null&&o.user_id))return;const m=q.channel("messages-channel").on("postgres_changes",{event:"INSERT",schema:"public",table:"messages"},()=>{c()}).subscribe();return()=>{q.removeChannel(m)}},[o==null?void 0:o.user_id,c]),{conversations:e,loading:n,totalUnread:s,getOrCreateConversation:u,getMessages:d,sendMessage:h,markAsRead:f,refetch:c}};function i8e(){const[e,t]=y.useState(!1),[n,r]=y.useState(null),[s,a]=y.useState(null),[o,l]=y.useState([]),[c,u]=y.useState(""),[d,h]=y.useState(!1),[f,m]=y.useState(""),[g,p]=y.useState([]),[x,v]=y.useState(!1),[b,w]=y.useState(!1),j=y.useRef(null),{conversations:S,loading:N,totalUnread:k,getOrCreateConversation:_,getMessages:C,sendMessage:A,markAsRead:E}=s8e(),{profile:P}=Cr(),$=()=>{var T;(T=j.current)==null||T.scrollIntoView({behavior:"smooth"})};y.useEffect(()=>{$()},[o]),y.useEffect(()=>{n&&(R(n),E(n))},[n]),y.useEffect(()=>{if(!n)return;const T=q.channel(`conversation-${n}`).on("postgres_changes",{event:"INSERT",schema:"public",table:"messages",filter:`conversation_id=eq.${n}`},B=>{l(Y=>[...Y,B.new]),E(n)}).subscribe();return()=>{q.removeChannel(T)}},[n]);const R=async T=>{const B=await C(T);l(B)},L=async()=>
943{if(!n||!c.trim()||!s)return;h(!0);const T=await A(n,c,s.user_id);T&&(l(B=>[...B,T]),u("")),h(!1)},D=async T=>{if(m(T),T.length<2){p([]);return}v(!0);try{const{data:B}=await q.from("profiles").select("user_id, display_name, avatar_url, farm_name").neq("user_id",(P==null?void 0:P.user_id)||"").or(`display_name.ilike.%${T}%,farm_name.ilike.%${T}%`).limit(10);p(B||[])}catch(B){console.error("Error searching users:",B)}finally{v(!1)}},I=async T=>{const B=await _(T.user_id);B&&(r(B),a(T),w(!1),m(""),p([]))},M=T=>{r(T.id),a(T.other_user||null)},H=()=>{b?(w(!1),m(""),p([])):(r(null),a(null),l([]))};return i.jsxs(CG,{open:e,onOpenChange:t,children:[i.jsx(EG,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",className:"relative",children:[i.jsx(Ua,{className:"h-5 w-5"}),k>0&&i.jsx(ye,{className:"absolute -top-1 -right-1 h-5 w-5 flex items-center justify-center p-0 text-xs bg-destructive text-destructive-foreground",children:k>9?"9+":k})]})}),i.jsxs(vP,{className:"w-full sm:max-w-md p-0 flex flex-col",children:[i.jsxs(bP,{className:"p-4 border-b border-border",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[(n||b)&&i.jsx(U,{variant:"ghost",size:"icon",onClick:H,children:i.jsx(jt,{className:"h-5 w-5"})}),i.jsx(wP,{className:"flex-1",children:b?"New Message":s?s.display_name:"Messages"}),!n&&!b&&i.jsx(U,{variant:"outline",size:"sm",onClick:()=>w(!0),children:"New Chat"})]}),s&&!b&&i.jsx("p",{className:"text-sm text-muted-foreground ml-11",children:s.farm_name})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:b?i.jsxs("div",{className:"p-4 space-y-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx(Qp,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(ae,{placeholder:"Search farmers by name or farm...",value:f,onChange:T=>D(T.target.value),className:"pl-9"})]}),i.jsx(Zu,{className:"h-[calc(100vh-200px)]",children:x?i.jsx("div",{className:"flex justify-center py-8",children:i.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}):g.length>0?i.jsx("div",{className:"space-y-2",children:g.map(T=>{var B;return i.jsxs("button",{className:"w-full flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 transition-colors text-left",onClick:()=>I(T),children:[i.jsxs(Ti,{children:[i.jsx(pa,{src:T.avatar_url||""}),i.jsx(Oi,{className:"bg-primary text-primary-foreground",children:((B=T.display_name)==null?void 0:B.charAt(0))||"F"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:T.display_name}),T.farm_name&&i.jsx("p",{className:"text-sm text-muted-foreground",children:T.farm_name})]})]},T.user_id)})}):f.length>=2?i.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No farmers found"}):i.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Search for farmers to start a conversation"})})]}):n?i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsx(Zu,{className:"flex-1 p-4",children:i.jsxs("div",{className:"space-y-4",children:[o.map(T=>{const B=T.sender_id===(P==null?void 0:P.user_id);return i.jsx("div",{className:fe("flex",B?"justify-end":"justify-start"),children:i.jsxs("div",{className:fe("max-w-[80%] rounded-2xl px-4 py-2",B?"bg-primary text-primary-foreground rounded-br-sm":"bg-muted rounded-bl-sm"),children:[i.jsx("p",{className:"text-sm whitespace-pre-wrap",children:T.content}),i.jsx("p",{className:fe("text-xs mt-1",B?"text-primary-foreground/70":"text-muted-foreground"),children:tC(new Date(T.created_at),{addSuffix:!0})})]})},T.id)}),i.jsx("div",{ref:j})]})}),i.jsx("div",{className:"p-4 border-t border-border",children:i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ae,{placeholder:"Type or speak a message...",value:c,onChange:T=>u(T.target.value),onKeyPress:T=>T.key==="Enter"&&!T.shiftKey&&L(),disabled:d}),i.jsx(U,{size:"icon",onClick:L,disabled:!c.trim()||d,"aria-label":"Send message",children:i.jsx(Ed,{className:"h-4 w-4"})})]}),i.jsx("div",{className:"flex justify-end",children:i.jsx(Dd,{label:"Speak message",onTranscript:T=>u(B=>(B?B+" ":"")+T)})})]})})]}):i.jsx(Zu,{className:"h-[calc(100vh-120px)]",children:N?i.jsx("div",{className:"flex justify-center py-8",children:i.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}):S.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[i.jsx(ht,{className:"h-12 w-12 text-muted-foreground mb-4"}),i.jsx("h3",{className:"font-medium mb-2",children:"No messages yet"}),i.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Start a conversation with other farmers in the community"}),i.jsx(U,{onClick:()=>w(!0),children:"Start a Chat"})]}):i.jsx("div",{className:"divide-y divide-border",children:S.map(T=>{var B,Y,O,W;return i.jsxs("button",{className:fe("w-full flex items-center gap-3 p-4 text-left hover:bg-muted/50 transition-colors",T.unread_count&&T.unread_count>0&&"bg-primary/5"),onClick:()=>M(T),children:[i.jsxs(Ti,{children:[i.jsx(pa,{src:((B=T.other_user)==null?void 0:B.avatar_url)||""}),i.jsx(Oi,{className:"bg-secondary text-secondary-foreground",children:((O=(Y=T.other_user)==null?void 0:Y.display_name)==null?void 0:O.charAt(0))||"F"})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("p",{className:"font-medium truncate",children:((W=T.other_user)==null?void 0:W.display_name)||"Farmer"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:tC(new Date(T.last_message_at),{addSuffix:!0})})]}),i.jsxs("div",{className:"flex items-center justify-between mt-0.5",children:[i.jsx("p",{className:"text-sm text-muted-foreground truncate",children:T.last_message||"No messages yet"}),T.unread_count&&T.unread_count>0&&i.jsx(ye,{className:"ml-2 h-5 min-w-5 flex items-center justify-center p-0 text-xs",children:T.unread_count})]})]})]},T.id)})})})})]})]})}function a8e(){var D;const[e,t]=y.useState([]),[n,r]=y.useState(""),[s,a]=y.useState(null),[o,l]=y.useState(null),[c,u]=y.useState(!0),[d,h]=y.useState(!1),[f,m]=y.useState(null),[g,p]=y.useState({}),[x,v]=y.useState({}),{profile:b}=Cr(),{toast:w}=We(),{isAuthenticated:j,isLoading:S}=Sw(),{createNotification:N}=pP();y.useEffect(()=>{k()},[]);const k=async()=>{try{const{data:I,error:M}=await q.from("posts").select("*").order("created_at",{ascending:!1});if(M)throw M;if(!I){t([]);return}const H=[...new Set(I.map(J=>J.author_id))],{data:T,error:B}=await q.from("profiles").select("user_id, display_name, avatar_url, farm_name, location").in("user_id",H);if(B)throw B;const{data:Y,error:O}
943=await q.from("post_likes").select("post_id").eq("user_id",(b==null?void 0:b.user_id)||""),W=new Set((Y==null?void 0:Y.map(J=>J.post_id))||[]),X=I.map(J=>({...J,likes_count:J.likes_count||0,comments_count:J.comments_count||0,author_profile:T==null?void 0:T.find(G=>G.user_id===J.author_id),is_liked:W.has(J.id)}));t(X)}catch(I){console.error("Error fetching posts:",I),w({title:"Error",description:"Failed to load posts",variant:"destructive"})}finally{u(!1)}},_=I=>{var H;const M=(H=I.target.files)==null?void 0:H[0];if(M){if(M.size>5*1024*1024){w({title:"File too large",description:"Please select an image smaller than 5MB",variant:"destructive"});return}a(M);const T=new FileReader;T.onload=B=>{var Y;l((Y=B.target)==null?void 0:Y.result)},T.readAsDataURL(M)}},C=()=>{a(null),l(null)},A=async I=>{try{if(!(b!=null&&b.user_id))return null;const M=I.name.split(".").pop(),H=`${b.user_id}/${Date.now()}.${M}`,{error:T}=await q.storage.from("post-images").upload(H,I);if(T)throw console.error("Upload error:",T),T;const{data:B}=q.storage.from("post-images").getPublicUrl(H);return B.publicUrl}catch(M){throw console.error("Error uploading image:",M),M}},E=async()=>{if(!(!n.trim()&&!s)){if(!b){w({title:"Authentication Required",description:"Please log in to create a post",variant:"destructive"});return}h(!0);try{let I=null;s&&(I=await A(s));const{error:M}=await q.from("posts").insert({content:n,author_id:b.user_id,image_url:I});if(M)throw M;r(""),a(null),l(null),w({title:"Success",description:"Post shared successfully!"}),k()}catch(I){console.error("Error creating post:",I),w({title:"Error",description:"Failed to create post",variant:"destructive"})}finally{h(!1)}}},P=async(I,M)=>{if(!b){w({title:"Authentication Required",description:"Please log in to like posts",variant:"destructive"});return}try{const H=e.find(T=>T.id===I);if(M){const{error:T}=await q.from("post_likes").delete().eq("post_id",I).eq("user_id",b.user_id);if(T)throw T}else{const{error:T}=await q.from("post_likes").insert({post_id:I,user_id:b.user_id});if(T)throw T;H&&H.author_id!==b.user_id&&N(H.author_id,"like",`${b.display_name||"Someone"} liked your post`,H.content.substring(0,100)+(H.content.length>100?"...":""),I)}t(e.map(T=>T.id===I?{...T,is_liked:!M,likes_count:M?T.likes_count-1:T.likes_count+1}:T))}catch(H){console.error("Error toggling like:",H)}},$=async I=>{try{const{data:M,error:H}=await q.from("comments").select("*").eq("post_id",I).order("created_at",{ascending:!0});if(H)throw H;if(!M){p(W=>({...W,[I]:[]}));return}const T=[...new Set(M.map(W=>W.author_id))],{data:B,error:Y}=await q.from("profiles").select("user_id, display_name, avatar_url").in("user_id",T);if(Y)throw Y;const O=M.map(W=>({...W,author_profile:B==null?void 0:B.find(X=>X.user_id===W.author_id)}));p(W=>({...W,[I]:O}))}catch(M){console.error("Error fetching comments:",M)}},R=async I=>{var H;const M=(H=x[I])==null?void 0:H.trim();if(M){if(!b){w({title:"Authentication Required",description:"Please log in to comment on posts",variant:"destructive"});return}try{const T=e.find(Y=>Y.id===I),{error:B}=await q.from("comments").insert({post_id:I,content:M,author_id:b.user_id});if(B)throw B;T&&T.author_id!==b.user_id&&N(T.author_id,"comment",`${b.display_name||"Someone"} commented on your post`,M.substring(0,100)+(M.length>100?"...":""),I),v(Y=>({...Y,[I]:""})),$(I),t(e.map(Y=>Y.id===I?{...Y,comments_count:Y.comments_count+1}:Y))}catch(T){console.error("Error adding comment:",T)}}},L=I=>{f===I?m(null):(m(I),g[I]||$(I))};return c?i.jsx("div",{className:"min-h-screen bg-gradient-bg p-4 flex items-center justify-center relative aurora-blobs",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary mx-auto"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading community..."})]})}):i.jsx("div",{className:"min-h-screen bg-gradient-bg p-4 pb-20",children:i.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[i.jsxs("div",{className:"relative py-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"text-3xl font-bold bg-gradient-primary bg-clip-text text-transparent",children:"Community"}),i.jsx("p",{className:"text-muted-foreground mt-2",children:"Connect with fellow farmers"})]}),j&&i.jsxs("div",{className:"absolute right-0 top-6 flex items-center gap-1",children:[i.jsx(i8e,{}),i.jsx(t8e,{})]})]}),!S&&!j&&i.jsx(jw,{title:"Sign in to join the community",description:"Create an account or log in to share posts, like content, and connect with fellow farmers.",feature:"community features"}),i.jsxs(z,{className:"bg-card/80 backdrop-blur-sm border-border/50 glass-card",children:[i.jsx(re,{className:"pb-3",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsxs(Ti,{children:[i.jsx(pa,{src:(b==null?void 0:b.avatar_url)||""}),i.jsx(Oi,{className:"bg-primary text-primary-foreground",children:((D=b==null?void 0:b.display_name)==null?void 0:D.charAt(0))||"F"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:(b==null?void 0:b.display_name)||"Farmer"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:b==null?void 0:b.farm_name})]})]})}),i.jsxs(V,{children:[i.jsx(Yt,{placeholder:"Share your farming experience, tips, or ask questions...",value:n,onChange:I=>r(I.target.value),className:"min-h-[100px] resize-none border-border/50 bg-background/50"}),i.jsx("div",{className:"mt-2 flex justify-end",children:i.jsx(Dd,{label:"Speak post",onTranscript:I=>r(M=>(M?M+" ":"")+I)})}),o&&i.jsxs("div",{className:"relative mt-4",children:[i.jsx("img",{src:o,alt:"Selected image",className:"w-full max-h-64 object-cover rounded-lg"}),i.jsx(U,{variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-8 w-8",onClick:C,children:i.jsx(hh,{className:"h-4 w-4"})})]}),i.jsxs("div",{className:"flex items-center justify-between mt-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"file",accept:"image/*",onChange:_,className:"hidden",id:"image-upload"}),i.jsx("label",{htmlFor:"image-upload",children:i.jsx(U,{variant:"outline",size:"sm",className:"gap-2",asChild:!0,children:i.jsxs("span",{className:"cursor-pointer",children:[i.jsx(xa,{
943className:"w-4 h-4"}),"Photo"]})})})]}),i.jsxs(U,{onClick:E,disabled:!n.trim()&&!s||d,className:"gap-2",children:[i.jsx(Ed,{className:"w-4 h-4"}),d?"Sharing...":"Share"]})]})]})]}),i.jsx("div",{className:"space-y-4",children:e.length===0?i.jsx(z,{className:"bg-card/80 backdrop-blur-sm border-border/50 glass-card",children:i.jsxs(V,{className:"text-center py-12",children:[i.jsx(ht,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),i.jsx("h3",{className:"text-lg font-medium mb-2",children:"No posts yet"}),i.jsx("p",{className:"text-muted-foreground",children:"Be the first to share something with the community!"})]})}):e.map(I=>{var M,H,T,B,Y,O,W,X,J;return i.jsxs(z,{className:"bg-card/80 backdrop-blur-sm border-border/50 glass-card",children:[i.jsx(re,{className:"pb-3",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsxs(Ti,{children:[i.jsx(pa,{src:((M=I.author_profile)==null?void 0:M.avatar_url)||""}),i.jsx(Oi,{className:"bg-secondary text-secondary-foreground",children:((T=(H=I.author_profile)==null?void 0:H.display_name)==null?void 0:T.charAt(0))||"F"})]}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"font-semibold text-foreground",children:((B=I.author_profile)==null?void 0:B.display_name)||"Farmer"}),i.jsx("p",{className:"text-sm text-primary font-medium",children:((Y=I.author_profile)==null?void 0:Y.farm_name)||"Farm not specified"}),i.jsxs("div",{className:"flex items-center text-xs text-muted-foreground mt-0.5",children:[((O=I.author_profile)==null?void 0:O.location)&&i.jsxs("span",{children:[I.author_profile.location," ⢠"]}),i.jsx("span",{children:new Date(I.created_at).toLocaleDateString()})]})]})]})}),i.jsxs(V,{children:[i.jsx("p",{className:"text-foreground whitespace-pre-wrap mb-4",children:I.content}),I.image_url&&i.jsx("img",{src:I.image_url,alt:"Post image",className:"w-full rounded-lg mb-4"}),i.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>P(I.id,I.is_liked||!1),className:fe("gap-2",I.is_liked&&"text-red-500 hover:text-red-600"),children:[i.jsx(Zs,{className:fe("w-4 h-4",I.is_liked&&"fill-current")}),i.jsx("span",{children:I.likes_count??0})]}),i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>L(I.id),className:"gap-2",children:[i.jsx(Ko,{className:"w-4 h-4"}),i.jsx("span",{children:I.comments_count??0})]})]}),i.jsxs(U,{variant:"ghost",size:"sm",className:"gap-2",children:[i.jsx(kB,{className:"w-4 h-4"}),"Share"]})]}),f===I.id&&i.jsxs("div",{className:"mt-4 pt-4 border-t border-border/50 space-y-3",children:[(W=g[I.id])==null?void 0:W.map(G=>{var ce,ee,le,he;return i.jsxs("div",{className:"flex space-x-3",children:[i.jsxs(Ti,{className:"w-8 h-8",children:[i.jsx(pa,{src:((ce=G.author_profile)==null?void 0:ce.avatar_url)||""}),i.jsx(Oi,{className:"bg-muted text-muted-foreground text-xs",children:((le=(ee=G.author_profile)==null?void 0:ee.display_name)==null?void 0:le.charAt(0))||"F"})]}),i.jsxs("div",{className:"flex-1 bg-muted/50 rounded-lg p-3",children:[i.jsx("p",{className:"text-sm font-medium",children:((he=G.author_profile)==null?void 0:he.display_name)||"Anonymous"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:G.content}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:new Date(G.created_at).toLocaleDateString()})]})]},G.id)}),i.jsxs("div",{className:"flex space-x-3",children:[i.jsxs(Ti,{className:"w-8 h-8",children:[i.jsx(pa,{src:(b==null?void 0:b.avatar_url)||""}),i.jsx(Oi,{className:"bg-primary text-primary-foreground text-xs",children:((X=b==null?void 0:b.display_name)==null?void 0:X.charAt(0))||"F"})]}),i.jsxs("div",{className:"flex-1 flex flex-col space-y-2",children:[i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Yt,{placeholder:"Write a comment...",value:x[I.id]||"",onChange:G=>v(ce=>({...ce,[I.id]:G.target.value})),className:"flex-1 min-h-[60px] resize-none text-sm"}),i.jsx(U,{size:"sm",onClick:()=>R(I.id),disabled:!((J=x[I.id])!=null&&J.trim()),children:i.jsx(Ed,{className:"w-4 h-4"})})]}),i.jsx("div",{className:"flex justify-end",children:i.jsx(Dd,{label:"Speak",onTranscript:G=>v(ce=>({...ce,[I.id]:(ce[I.id]||"")+(ce[I.id]?" ":"")+G}))})})]})]})]})]})]},I.id)})})]})})}function o8e(){const{toast:e}=We(),[t,n]=y.useState([]),[r,s]=y.useState([]),[a,o]=y.useState([]),[l,c]=y.useState(""),[u,d]=y.useState(!1),[h,f]=y.useState(!1),[m,g]=y.useState(!1),[p,x]=y.useState({title:"",description:"",category:"",difficulty_level:"beginner",estimated_duration:30}),v=[{id:"1",title:"Introduction to Livestock Management",course:"Livestock Farming Basics",instructor:"Dr. Molefe",date:"2025-01-20",time:"09:00 - 11:00",
943students:24,type:"online"},{id:"2",title:"Disease Prevention Workshop",course:"Livestock Health & Biosecurity",instructor:"Prof. Nkosi",date:"2025-01-22",time:"14:00 - 16:00",students:18,type:"in-person"},{id:"3",title:"Financial Record Keeping",course:"Farm Business Management",instructor:"Ms. Dlamini",date:"2025-01-25",time:"10:00 - 12:00",students:32,type:"online"}],b=[{user_id:"1",display_name:"Thabo Mokoena",farm_name:"Sunrise Livestock Farm",email:"[email protected]",phone:"+27 82 123 4567",created_at:"2024-01-15",courses_enrolled:4,courses_completed:2,average_progress:68},{user_id:"2",display_name:"Lerato Dlamini",farm_name:"Golden Feather Farm",email:"[email protected]",phone:"+27 83 234 5678",created_at:"2024-02-20",courses_enrolled:3,courses_completed:1,average_progress:45},{user_id:"3",display_name:"Sipho Ndlovu",farm_name:"Valley View Livestock",email:"[email protected]",phone:"+27 84 345 6789",created_at:"2024-03-10",courses_enrolled:5,courses_completed:3,average_progress:82},{user_id:"4",display_name:"Nomsa Khumalo",farm_name:"Heritage Farm",email:"[email protected]",phone:"+27 85 456 7890",created_at:"2024-01-08",courses_enrolled:4,courses_completed:4,average_progress:100},{user_id:"5",display_name:"Zanele Mthembu",farm_name:"Ubuntu Livestock Co-op",email:"[email protected]",phone:"+27 86 567 8901",created_at:"2024-04-01",courses_enrolled:2,courses_completed:0,average_progress:25},{user_id:"6",display_name:"Mandla Zulu",farm_name:"Green Valley Layers",email:"[email protected]",phone:"+27 82 678 9012",created_at:"2024-02-05",courses_enrolled:5,courses_completed:4,average_progress:92},{user_id:"7",display_name:"Precious Mahlangu",farm_name:"Sunshine Eggs",email:"[email protected]",phone:"+27 83 789 0123",created_at:"2024-03-15",courses_enrolled:3,courses_completed:2,average_progress:75},{user_id:"8",display_name:"Bongani Sithole",farm_name:"Highveld Livestock",email:"[email protected]",phone:"+27 84 890 1234",created_at:"2024-01-22",courses_enrolled:4,courses_completed:3,average_progress:88},{user_id:"9",display_name:"Thandeka Ngcobo",farm_name:"Fresh Eggs Daily",email:"[email protected]",phone:"+27 85 901 2345",created_at:"2024-04-10",courses_enrolled:2,courses_completed:1,average_progress:55},{user_id:"10",display_name:"Sbusiso Maseko",farm_name:"Maseko Family Farm",email:"[email protected]",phone:"+27 86 012 3456",created_at:"2024-02-28",courses_enrolled:5,courses_completed:5,average_progress:100},{user_id:"11",display_name:"Lindiwe Shabalala",farm_name:"Golden Eggs Farm",email:"[email protected]",phone:"+27 82 111 2222",created_at:"2024-03-05",courses_enrolled:3,courses_completed:1,average_progress:40},{user_id:"12",display_name:"Themba Nkosi",farm_name:"Nkosi Broilers",email:"[email protected]",phone:"+27 83 222 3333",created_at:"2024-01-18",courses_enrolled:4,courses_completed:3,average_progress:78},{user_id:"13",display_name:"Ayanda Cele",farm_name:"Cele Livestock Estate",email:"[email protected]",phone:"+27 84 333 4444",created_at:"2024-04-20",courses_enrolled:2,courses_completed:0,average_progress:15},{user_id:"14",display_name:"Nokuthula Zwane",farm_name:"Zwane Layers",email:"[email protected]",phone:"+27 85 444 5555",created_at:"2024-02-12",courses_enrolled:5,courses_completed:4,average_progress:95},{user_id:"15",display_name:"Lungile Mbeki",farm_name:"Mbeki Free Range",email:"[email protected]",phone:"+27 86 555 6666",created_at:"2024-03-25",courses_enrolled:3,courses_completed:2,average_progress:70},{user_id:"16",display_name:"Siyabonga Radebe",farm_name:"Radebe Farms",email:"[email protected]",phone:"+27 82 666 7777",created_at:"2024-01-30",courses_enrolled:4,courses_completed:2,average_progress:60},{user_id:"17",display_name:"Nompumelelo Mkhize",farm_name:"Mkhize Livestock",email:"[email protected]",phone:"+27 83 777 8888",created_at:"2024-04-05",courses_enrolled:2,courses_completed:1,average_progress:50},{user_id:"18",display_name:"Vusi Moloi",farm_name:"Moloi Agri",email:"[email protected]",phone:"+27 84 888 9999",created_at:"2024-02-08",courses_enrolled:5,courses_completed:3,average_progress:72},{user_id:"19",display_name:"Busisiwe Gumede",farm_name:"Gumede Family Livestock",email:"[email protected]",phone:"+27 85 999 0000",created_at:"2024-03-18",courses_enrolled:3,courses_completed:3,average_progress:100},{user_id:"20",display_name:"Mpho Tau",farm_name:"Tau Egg Suppliers",email:"[email protected]",phone:"+27 86 000 1111",created_at:"2024-01-25",courses_enrolled:4,courses_completed:1,average_progress:35},{user_id:"21",display_name:"Zodwa Buthelezi",farm_name:"Buthelezi Broilers",email:"[email protected]",phone:"+27 82 112 2334",created_at:"2024-04-15",courses_enrolled:2,courses_completed:2,average_progress:100},{user_id:"22",display_name:"Njabulo Mthethwa",farm_name:"Mthethwa Livestock Co",email:"[email protected]",phone:"+27 83 223 3445",created_at:"2024-02-22",courses_enrolled:5,courses_completed:2,average_progress:48},{user_id:"23",display_name:"Hlengiwe Majola",farm_name:"Majola Layers",email:"[email protected]",phone:"+27 84 334 4556",created_at:"2024-03-08",courses_enrolled:3,courses_completed:1,average_progress:38}
943,{user_id:"24",display_name:"Sandile Xaba",farm_name:"Xaba Fresh Eggs",email:"[email protected]",phone:"+27 85 445 5667",created_at:"2024-01-12",courses_enrolled:4,courses_completed:4,average_progress:100},{user_id:"25",display_name:"Zinhle Dube",farm_name:"Dube Livestock Farm",email:"[email protected]",phone:"+27 86 556 6778",created_at:"2024-04-25",courses_enrolled:2,courses_completed:0,average_progress:20},{user_id:"26",display_name:"Thulani Hadebe",farm_name:"Hadebe Agri Solutions",email:"[email protected]",phone:"+27 82 667 7889",created_at:"2024-02-15",courses_enrolled:5,courses_completed:5,average_progress:100},{user_id:"27",display_name:"Ntombi Vilakazi",farm_name:"Vilakazi Free Range",email:"[email protected]",phone:"+27 83 778 8990",created_at:"2024-03-28",courses_enrolled:3,courses_completed:2,average_progress:65},{user_id:"28",display_name:"Lucky Moyo",farm_name:"Moyo Broiler Farm",email:"[email protected]",phone:"+27 84 889 9001",created_at:"2024-01-05",courses_enrolled:4,courses_completed:3,average_progress:85},{user_id:"29",display_name:"Phindile Ntuli",farm_name:"Ntuli Egg Farm",email:"[email protected]",phone:"+27 85 990 0112",created_at:"2024-04-08",courses_enrolled:2,courses_completed:1,average_progress:58},{user_id:"30",display_name:"Buhle Zondi",farm_name:"Zondi Livestock Enterprise",email:"[email protected]",phone:"+27 86 001 1223",created_at:"2024-02-18",courses_enrolled:5,courses_completed:4,average_progress:90}];y.useEffect(()=>{w(),j(),o(b)},[]);const w=async()=>{try{const{data:E,error:P}=await q.from("courses").select("*").eq("is_active",!0).order("created_at",{ascending:!1});if(P)throw P;n(E||[])}catch(E){console.error("Error fetching courses:",E)}},j=async()=>{try{const{data:E,error:P}=await q.from("course_assignments").select(` 944 *, 945 courses(title, category, difficulty_level), 946 profiles(display_name, farm_name) 947 `).order("assigned_at",{ascending:!1});if(P)throw P;s(E||[])}catch(E){console.error("Error fetching assignments:",E)}},S=async()=>{try{const{data:{user:E}}=await q.auth.getUser();if(!E){e({title:"Error",description:"You must be logged in to create courses",variant:"destructive"});return}const{error:P}=await q.from("courses").insert([{...p,created_by:E.id,content:{modules:[]}}]);if(P)throw P;e({title:"Success",description:"Course created successfully"}),d(!1),x({title:"",description:"",category:"",difficulty_level:"beginner",estimated_duration:30}),w()}catch(E){console.error("Error creating course:",E),e({title:"Error",description:"Failed to create course",variant:"destructive"})}},N=E=>{switch(E){case"beginner":return"bg-green-100 text-green-800 border-green-200";case"intermediate":return"bg-amber-100 text-amber-800 border-amber-200";case"advanced":return"bg-red-100 text-red-800 border-red-200";default:return"bg-muted text-muted-foreground"}},k=a.filter(E=>E.display_name.toLowerCase().includes(l.toLowerCase())||E.farm_name.toLowerCase().includes(l.toLowerCase())),_=a.reduce((E,P)=>E+P.courses_enrolled,0),C=a.reduce((E,P)=>E+P.courses_completed,0),A=Math.round(a.reduce((E,P)=>E+P.average_progress,0)/a.length);return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-green-800 via-green-700 to-green-600 p-6 text-white",children:[i.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-white/5 rounded-full -translate-y-1/2 translate-x-1/2"}),i.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-white/5 rounded-full translate-y-1/2 -translate-x-1/2"}),i.jsxs("div",{className:"relative flex flex-col lg:flex-row items-start lg:items-center justify-between gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:"p-2 bg-white rounded-xl shadow-lg",children:i.jsx("img",{src:Ui,alt:"Flockify",className:"h-16 w-auto object-contain"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(ye,{className:"bg-white/20 text-white border-white/30 text-xs",children:"Flockify Learning"}),i.jsx(ye,{className:"bg-yellow-500/90 text-yellow-900 text-xs",children:"Course Management"})]}),i.jsx("h1",{className:"text-2xl lg:text-3xl font-bold",children:"Flockify Learning"}),i.jsx("p",{className:"text-green-100 text-sm lg:text-base",children:"Learning Management System ⢠Student Administration Portal"})]})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsxs(yt,{open:h,onOpenChange:f,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{className:"bg-white text-green-700 hover:bg-green-50",children:[i.jsx(CB,{className:"h-4 w-4 mr-2"}),"Add Student"]})}),i.jsxs(mt,{children:[i.jsxs(xt,{children:[i.jsx(vt,{children:"Enroll New Student"}),i.jsx($i,{children:"Add a new student to the learning program"})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Full Name"}),i.jsx(ae,{placeholder:"Enter student name"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Email Address"}),i.jsx(ae,{type:"email",placeholder:"[email protected]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Phone Number"}),i.jsx(ae,{placeholder:"+27 XX XXX XXXX"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Farm Name"}),i.jsx(ae,{placeholder:"Enter farm name"})]}),i.jsx(U,{className:"w-full bg-green-600 hover:bg-green-700",children:"Enroll Student"})]})]})]}),i.jsxs(yt,{open:m,onOpenChange:g,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{variant:"outline",className:"border-white/30 text-white hover:bg-white/10",children:[i.jsx(ys,{className:"h-4 w-4 mr-2"}),"Schedule Class"]})}),i.jsxs(mt,{children:[i.jsxs(xt,{children:[i.jsx(vt,{children:"Schedule New Class"}),i.jsx($i,{children:"Create a new class session"})]}),i.jsxs("div",{className:"space-y-4 py-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Class Title"}),i.jsx(ae,{placeholder:"Enter class title"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Course"}),i.jsxs(Ye,{children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select course"})}),i.jsx(qe,{children:t.map(E=>i.jsx(oe,{value:E.id,children:E.title},E.id))})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Date"}),i.jsx(ae,{type:"date"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Time"}),i.jsx(ae,{type:"time"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Class Type"}),i.jsxs(Ye,{children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select type"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"online",children:"Online"}),i.jsx(oe,{value:"in-person",children:"In-Person"})]})]})]}),i.jsx(U,{className:"w-full bg-green-600 hover:bg-green-700",children:"Schedule Class"})]})]})]}),i.jsxs(U,{variant:"outline",className:"border-white/30 text-white hover:bg-white/10",children:[i.jsx(qo,{className:"h-4 w-4 mr-2"}),"Export Data"]})]})]})]}
947),i.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-4",children:[i.jsx(z,{className:"border-l-4 border-l-green-600",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Students"}),i.jsx("p",{className:"text-2xl font-bold text-green-600",children:a.length})]}),i.jsx(ht,{className:"h-8 w-8 text-green-600/20"})]})})}),i.jsx(z,{className:"border-l-4 border-l-blue-600",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Active Courses"}),i.jsx("p",{className:"text-2xl font-bold text-blue-600",children:t.length})]}),i.jsx(tn,{className:"h-8 w-8 text-blue-600/20"})]})})}),i.jsx(z,{className:"border-l-4 border-l-purple-600",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Enrollments"}),i.jsx("p",{className:"text-2xl font-bold text-purple-600",children:_})]}),i.jsx(AZ,{className:"h-8 w-8 text-purple-600/20"})]})})}),i.jsx(z,{className:"border-l-4 border-l-amber-600",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Completions"}),i.jsx("p",{className:"text-2xl font-bold text-amber-600",children:C})]}),i.jsx(Fr,{className:"h-8 w-8 text-amber-600/20"})]})})}),i.jsx(z,{className:"border-l-4 border-l-teal-600",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-muted-foreground",children:"Avg Progress"}),i.jsxs("p",{className:"text-2xl font-bold text-teal-600",children:[A,"%"]})]}),i.jsx(Wt,{className:"h-8 w-8 text-teal-600/20"})]})})})]}),i.jsxs(Bc,{defaultValue:"students",className:"space-y-4",children:[i.jsxs(jl,{className:"bg-green-50 p-1",children:[i.jsxs(pt,{value:"students",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:[i.jsx(ht,{className:"h-4 w-4 mr-2"}),"Students"]}),i.jsxs(pt,{value:"courses",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:[i.jsx(tn,{className:"h-4 w-4 mr-2"}),"Courses"]}),i.jsxs(pt,{value:"classes",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:[i.jsx(ys,{className:"h-4 w-4 mr-2"}),"Classes"]}),i.jsxs(pt,{value:"certificates",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:[i.jsx(Fr,{className:"h-4 w-4 mr-2"}),"Certificates"]}),i.jsxs(pt,{value:"analytics",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:[i.jsx(Xr,{className:"h-4 w-4 mr-2"}),"Analytics"]})]}),i.jsx(tt,{value:"students",className:"space-y-4",children:i.jsxs(z,{children:[i.jsx(re,{className:"pb-3",children:i.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-4",children:[i.jsxs("div",{children:[i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(Oa,{className:"h-5 w-5 text-green-600"}),"Student Management"]}),i.jsx(_n,{children:"Manage enrolled students and track their progress"})]}),i.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[i.jsxs("div",{className:"relative flex-1 lg:w-64",children:[i.jsx(Qp,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),i.jsx(ae,{placeholder:"Search students...",className:"pl-9",value:l,onChange:E=>c(E.target.value)})]}),i.jsx(U,{variant:"outline",size:"icon",children:i.jsx(gB,{className:"h-4 w-4"})})]})]})}),i.jsx(V,{className:"p-0",children:i.jsxs(Sa,{children:[i.jsx(Na,{children:i.jsxs(kn,{className:"bg-green-50/50",children:[i.jsx(Pe,{children:"Student"}),i.jsx(Pe,{children:"Contact"}),i.jsx(Pe,{children:"Enrolled"}),i.jsx(Pe,{children:"Completed"}),i.jsx(Pe,{children:"Progress"}),i.jsx(Pe,{children:"Actions"})]})}),i.jsx(ka,{children:k.map(E=>i.jsxs(kn,{children:[i.jsx(ke,{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Ti,{className:"h-10 w-10 border-2 border-green-100",children:i.jsx(Oi,{className:"bg-green-100 text-green-700",children:E.display_name.split(" ").map(P=>P[0]).join("")})}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:E.display_name}),i.jsx("p",{className:"text-xs text-muted-foreground",children:E.farm_name})]})]})}),i.jsx(ke,{children:i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[i.jsx(Ua,{className:"h-3 w-3 text-muted-foreground"}),i.jsx("span",{className:"text-xs",children:E.email})]}),i.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[i.jsx(ri,{className:"h-3 w-3 text-muted-foreground"}),i.jsx("span",{className:"text-xs",children:E.phone})]})]})}),i.jsx(ke,{children:i.jsxs(ye,{variant:"outline",className:"border-blue-200 bg-blue-50 text-blue-700",children:[E.courses_enrolled," courses"]})}),i.jsx(ke,{children:i.jsxs(ye,{variant:"outline",className:"border-green-200 bg-green-50 text-green-700",children:[E.courses_completed," completed"]})}),i.jsx(ke,{children:i.jsxs("div",{className:"w-24 space-y-1",children:[i.jsx("div",{className:"flex justify-between text-xs",children:i.jsxs("span",{children:[E.average_progress,"%"]})}),i.jsx(rr,{value:E.average_progress,className:"h-2"})]})}),i.jsx(ke,{children:i.jsxs("div",{className:"flex gap-1",children:[i.jsx(U,{variant:"ghost",size:"sm",className:"text-green-600 hover:text-green-700 hover:bg-green-50",children:"View"}),i.jsx(U,{variant:"ghost",size:"sm",children:"Assign"})]})})]}
947,E.user_id))})]})})]})}),i.jsxs(tt,{value:"courses",className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"text-lg font-semibold",children:"Course Library"}),i.jsxs(yt,{open:u,onOpenChange:d,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{className:"bg-green-600 hover:bg-green-700",children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Create Course"]})}),i.jsxs(mt,{className:"max-w-md",children:[i.jsxs(xt,{children:[i.jsx(vt,{children:"Create Course"}),i.jsx($i,{children:"Add a new course to the curriculum"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"title",children:"Course Title"}),i.jsx(ae,{id:"title",value:p.title,onChange:E=>x({...p,title:E.target.value}),placeholder:"e.g., Advanced Livestock Nutrition"})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"description",children:"Description"}),i.jsx(Yt,{id:"description",value:p.description,onChange:E=>x({...p,description:E.target.value}),placeholder:"Course description..."})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"category",children:"Category"}),i.jsx(ae,{id:"category",value:p.category,onChange:E=>x({...p,category:E.target.value}),placeholder:"e.g., Health & Biosecurity"})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"difficulty",children:"Difficulty Level"}),i.jsxs(Ye,{value:p.difficulty_level,onValueChange:E=>x({...p,difficulty_level:E}),children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"beginner",children:"Beginner"}),i.jsx(oe,{value:"intermediate",children:"Intermediate"}),i.jsx(oe,{value:"advanced",children:"Advanced"})]})]})]}),i.jsxs("div",{children:[i.jsx(ne,{htmlFor:"duration",children:"Estimated Duration (minutes)"}),i.jsx(ae,{id:"duration",type:"number",value:p.estimated_duration,onChange:E=>x({...p,estimated_duration:parseInt(E.target.value)||30})})]}),i.jsx(U,{onClick:S,className:"w-full bg-green-600 hover:bg-green-700",children:"Create Course"})]})]})]})]}),i.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:[t.map(E=>i.jsxs(z,{className:"border-t-4 border-t-green-600 hover:shadow-lg transition-shadow",children:[i.jsxs(re,{className:"pb-2",children:[i.jsxs("div",{className:"flex justify-between items-start",children:[i.jsx(ye,{className:"bg-green-100 text-green-800 border-green-200 text-xs mb-2",children:"Course"}),i.jsx(ye,{className:N(E.difficulty_level),children:E.difficulty_level})]}),i.jsx(se,{className:"text-lg",children:E.title}),i.jsx(_n,{className:"line-clamp-2",children:E.description})]}),i.jsxs(V,{className:"pt-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground mb-4",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(js,{className:"h-4 w-4"}),E.estimated_duration," min"]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(tn,{className:"h-4 w-4"}),E.category]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(U,{variant:"outline",size:"sm",className:"flex-1",children:"Edit"}),i.jsx(U,{size:"sm",className:"flex-1 bg-green-600 hover:bg-green-700",children:"Assign"})]})]})]},E.id)),t.length===0&&i.jsxs(z,{className:"col-span-full p-12 text-center",children:[i.jsx(tn,{className:"h-12 w-12 mx-auto text-muted-foreground/50 mb-4"}),i.jsx("h3",{className:"font-semibold text-lg mb-2",children:"No Courses Yet"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"Create your first course to get started"}),i.jsxs(U,{className:"bg-green-600 hover:bg-green-700",onClick:()=>d(!0),children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Create First Course"]})]})]})]}),i.jsx(tt,{value:"classes",className:"space-y-4",children:i.jsxs(z,{children:[i.jsxs(re,{children:[i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(ys,{className:"h-5 w-5 text-green-600"}),"Upcoming Classes"]}),i.jsx(_n,{children:"Scheduled class sessions and workshops"})]}),i.jsx(V,{children:i.jsx("div",{className:"space-y-4",children:v.map(E=>i.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[i.jsxs("div",{className:"flex items-start gap-4 mb-3 lg:mb-0",children:[i.jsx("div",{className:"p-3 rounded-lg bg-green-100 text-green-700",children:i.jsx(LZ,{className:"h-6 w-6"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold",children:E.title}),i.jsx("p",{className:"text-sm text-muted-foreground",children:E.course}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Instructor: ",E.instructor]})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsx(ye,{variant:E.type==="online"?"default":"secondary",children:E.type==="online"?"Online":"In-Person"}),i.jsxs("div",{className:"text-sm text-right",children:[i.jsx("p",{className:"font-medium",children:new Date(E.date).toLocaleDateString("en-ZA",{weekday:"short",day:"numeric",month:"short"})}),i.jsx("p",{className:"text-muted-foreground",children:E.time})]}),i.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[i.jsx(ht,{className:"h-4 w-4"}),E.students]}),i.jsx(U,{size:"sm",variant:"outline",children:"View Details"})]})]},E.id))})})]})}),i.jsx(tt,{value:"certificates",className:"space-y-4",children:i.jsxs(z,{children:[i.jsxs(re,{children:[i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(Fr,{className:"h-5 w-5 text-green-600"}),"Issued Certificates"]}),i.jsx(_n,{children:"Certificates issued to students"})]}),i.jsx(V,{children:i.jsxs(Sa,{children:[i.jsx(Na,{children:i.jsxs(kn,{className:"bg-green-50/50",children:[i.jsx(Pe,{children:"Certificate #"}),i.jsx(Pe,{children:"Student"}),i.jsx(Pe,{children:"Course"}),i.jsx(Pe,{children:"Issue Date"}),i.jsx(Pe,{children:"Actions"})]})}),i.jsxs(ka,{children:[i.jsxs(kn,{children:[i.jsx(ke,{className:"font-mono text-sm",children:"FLK-2025-00001"}),i.jsx(ke,{children:"Nomsa Khumalo"}),i.jsx(ke,{children:"Livestock Farming Basics"}),i.jsx(ke,{children:"Jan 10, 2025"}),i.jsx(ke,{children:i.jsxs(U,{variant:"ghost",size:"sm",className:"text-green-600",children:[i.jsx(qo,{className:"h-4 w-4 mr-1"}),"Download"]})})]}),i.jsxs(kn,{children:[i.jsx(ke,{className:"font-mono text-sm",children:"FLK-2025-00002"}),i.jsx(ke,{children:"Sipho Ndlovu"}),i.jsx(ke,{children:"Livestock Health & Biosecurity"}),i.jsx(ke,{children:"Jan 12, 2025"}),i.jsx(ke,{children:i.jsxs(U,{variant:"ghost",size:"sm",className:"text-green-600",children:[i.jsx(qo,{className:"h-4 w-4 mr-1"}),"Download"]})})]})]})]})})]})}),i.jsxs(tt,{value:"analytics",className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[i.jsx(z,{className:"bg-gradient-to-br from-green-50 to-green-100 border-green-200",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx("p",{className:"text-3xl font-bold text-green-700",children:a.length}),i.jsx("p",{className:"text-sm text-green-600",children:"Total Students"})]})}),i.jsx(z,{className:"bg-gradient-to-br from-blue-50 to-blue-100 border-blue-200",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx("p",{className:"text-3xl font-bold text-blue-700",children:_}),i.jsx("p",{className:"text-sm text-blue-600",children:"Total Enrollments"})]})}),i.jsx(z,{className:"bg-gradient-to-br from-purple-50 to-purple-100 border-purple-200",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx("p",{className:"text-3xl font-bold text-purple-700",children:C}),i.jsx("p",{className:"text-sm text-purple-600",children:"Certificates Issued"})]})}),i.jsx(z,{className:"bg-gradient-to-br from-amber-50 to-amber-100 border-amber-200",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsxs("p",{className:"text-3xl font-bold text-amber-700",children:[A,"%"]}),i.jsx("p",{className:"text-sm text-amber-600",children:"Avg Completion Rate"})]})})]}),i.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:[i.jsxs(z,{children:[i.jsx(re,{className:"pb-2",children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(tn,{className:"h-4 w-4 text-green-600"}),"Course Completion Rates"]})}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Livestock Farming Basics"}),i.jsx("span",{className:"text-green-600 font-medium",children:"85%"})]}),i.jsx(rr,{value:85,className:"h-2"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Health & Biosecurity"}),i.jsx("span",{className:"text-green-600 font-medium",children:"72%"})]}),i.jsx(rr,{value:72,className:"h-2"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Farm Business Management"}),i.jsx("span",{className:"text-amber-600 font-medium",children:"58%"})]}),i.jsx(rr,{value:58,className:"h-2"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Advanced Nutrition"}),i.jsx("span",{className:"text-amber-600 font-medium",children:"45%"})]}),i.jsx(rr,{value:45,className:"h-2"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[i.jsx("span",{children:"Breeding & Genetics"}),i.jsx("span",{className:"text-green-600 font-medium",children:"78%"})]}),i.jsx(rr,{value:78,className:"h-2"})]})]})]}),i.jsxs(z,{children:[i.jsx(re,{className:"pb-2",children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(ht,{className:"h-4 w-4 text-blue-600"}),"Student Performance"]})}),i.jsx(V,{children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-green-50",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-green-600"}),i.jsx("span",{className:"text-sm",children:"High Performers (80%+)"})]}),i.jsx("span",{className:"font-bold text-green-600",children:a.filter(E=>E.average_progress>=80).length})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Wt,{className:"h-4 w-4 text-blue-600"}),i.jsx("span",{className:"text-sm",children:"On Track (50-79%)"})]}),i.jsx("span",{className:"font-bold text-blue-600",children:a.filter(E=>E.average_progress>=50&&E.average_progress<80).length})]}),i.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-amber-50",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(QS,{className:"h-4 w-4 text-amber-600"}),i.jsx("span",{className:"text-sm",children:"Needs Attention (<50%)"})]}),i.jsx("span",{className:"font-bold text-amber-600",children:a.filter(E=>E.average_progress<50).length})]})]})})]}),i.jsxs(z,{children:[i.jsx(re,{className:"pb-2",children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(ys,{className:"h-4 w-4 text-purple-600"}),"Monthly Enrollments"]})}),i.jsx(V,{children:i.jsx("div",{className:"space-y-2",children:[{month:"January",count:8,color:"bg-green-500"},{month:"February",count:6,color:"bg-blue-500"},{month:"March",count:7,color:"bg-purple-500"}
947,{month:"April",count:9,color:"bg-amber-500"}].map(E=>i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"text-sm w-20",children:E.month}),i.jsx("div",{className:"flex-1 h-6 bg-muted rounded-full overflow-hidden",children:i.jsx("div",{className:`h-full ${E.color} rounded-full flex items-center justify-end pr-2`,style:{width:`${E.count/10*100}%`},children:i.jsx("span",{className:"text-xs text-white font-medium",children:E.count})})})]},E.month))})})]})]}),i.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[i.jsxs(z,{children:[i.jsx(re,{className:"pb-2",children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(Fr,{className:"h-4 w-4 text-amber-600"}),"Top Performing Students"]})}),i.jsx(V,{children:i.jsx("div",{className:"space-y-3",children:a.sort((E,P)=>P.average_progress-E.average_progress).slice(0,5).map((E,P)=>i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold ${P===0?"bg-amber-100 text-amber-700":P===1?"bg-gray-100 text-gray-700":P===2?"bg-orange-100 text-orange-700":"bg-muted text-muted-foreground"}`,children:P+1}),i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:E.display_name}),i.jsx("p",{className:"text-xs text-muted-foreground",children:E.farm_name})]})]}),i.jsxs(ye,{className:"bg-green-100 text-green-700",children:[E.average_progress,"%"]})]},E.user_id))})})]}),i.jsxs(z,{children:[i.jsx(re,{className:"pb-2",children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(QS,{className:"h-4 w-4 text-red-600"}),"Students Needing Support"]})}),i.jsx(V,{children:i.jsx("div",{className:"space-y-3",children:a.filter(E=>E.average_progress<50).sort((E,P)=>E.average_progress-P.average_progress).slice(0,5).map(E=>i.jsxs("div",{className:"flex items-center justify-between p-2 rounded-lg bg-red-50/50",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium",children:E.display_name}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[E.courses_enrolled," courses enrolled"]})]}),i.jsxs("div",{className:"text-right",children:[i.jsxs(ye,{variant:"destructive",className:"mb-1",children:[E.average_progress,"%"]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[E.courses_completed," completed"]})]})]},E.user_id))})})]})]}),i.jsxs(z,{children:[i.jsx(re,{className:"pb-2",children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(Xr,{className:"h-4 w-4 text-green-600"}),"Program Overview"]})}),i.jsx(V,{children:i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:[i.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[i.jsx("p",{className:"text-2xl font-bold text-primary",children:a.filter(E=>E.average_progress===100).length}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Graduated"})]}),i.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[i.jsx("p",{className:"text-2xl font-bold text-blue-600",children:a.filter(E=>E.average_progress>0&&E.average_progress<100).length}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"In Progress"})]}),i.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[i.jsx("p",{className:"text-2xl font-bold text-amber-600",children:a.filter(E=>E.average_progress===0).length}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Not Started"})]}),i.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[i.jsx("p",{className:"text-2xl font-bold text-green-600",children:"92%"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Retention Rate"})]}),i.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[i.jsx("p",{className:"text-2xl font-bold text-purple-600",children:"4.2"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Avg Courses/Student"})]}),i.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[i.jsx("p",{className:"text-2xl font-bold text-teal-600",children:"45"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Certificates Issued"})]})]})})]})]})]})]})}var jP="Checkbox",[l8e,I7e]=kr(jP),[c8e,u8e]=l8e(jP),TG=y.forwardRef((e,t)=>
947{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:a,required:o,disabled:l,value:c="on",onCheckedChange:u,...d}=e,[h,f]=y.useState(null),m=Ce(t,w=>f(w)),g=y.useRef(!1),p=h?!!h.closest("form"):!0,[x=!1,v]=ni({prop:s,defaultProp:a,onChange:u}),b=y.useRef(x);return y.useEffect(()=>{const w=h==null?void 0:h.form;if(w){const j=()=>v(b.current);return w.addEventListener("reset",j),()=>w.removeEventListener("reset",j)}},[h,v]),i.jsxs(c8e,{scope:n,state:x,disabled:l,children:[i.jsx(ve.button,{type:"button",role:"checkbox","aria-checked":gc(x)?"mixed":x,"aria-required":o,"data-state":MG(x),"data-disabled":l?"":void 0,disabled:l,value:c,...d,ref:m,onKeyDown:ge(e.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:ge(e.onClick,w=>{v(j=>gc(j)?!0:!j),p&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),p&&i.jsx(d8e,{control:h,bubbles:!g.current,name:r,value:c,checked:x,required:o,disabled:l,style:{transform:"translateX(-100%)"}})]})});TG.displayName=jP;var OG="CheckboxIndicator",RG=y.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,a=u8e(OG,n);return i.jsx(es,{present:r||gc(a.state)||a.state===!0,children:i.jsx(ve.span,{"data-state":MG(a.state),"data-disabled":a.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});RG.displayName=OG;var d8e=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=y.useRef(null),o=V2(n),l=OE(t);return y.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==n&&h){const f=new Event("click",{bubbles:r});c.indeterminate=gc(n),h.call(c,gc(n)?!1:n),c.dispatchEvent(f)}},[o,n,r]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:gc(n)?!1:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function gc(e){return e==="indeterminate"}function MG(e){return gc(e)?"indeterminate":e?"checked":"unchecked"}var IG=TG,h8e=RG;const $G=y.forwardRef(({className:e,...t},n)=>i.jsx(IG,{ref:n,className:fe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:i.jsx(h8e,{className:fe("flex items-center justify-center text-current"),children:i.jsx($r,{className:"h-4 w-4"})})}));$G.displayName=IG.displayName;const f8e={Building2:dh,FileText:En,Receipt:jB,Leaf:xB,Shield:ll,Tractor:cee,MapPin:ts,Award:Fr,Droplets:mB,CheckCircle2:qr,Wheat:SE,Truck:_B};function LG(){const{toast:e}=We(),[t,n]=y.useState([]),[r,s]=y.useState(!0);y.useState(!1);const a=t.filter(g=>g.completed).length,o=t.filter(g=>g.required).length,l=t.filter(g=>g.completed&&g.required).length,c=a/t.length*100;y.useEffect(()=>{u()},[]);const u=async()=>{try{const{data:{user:g}}=await q.auth.getUser();if(!g)return;const{data:p,error:x}=await q.from("compliance_requirements").select("*").order("is_required",{ascending:!1}).order("name");if(x)throw x;const{data:v,error:b}=await q.from("compliance_tracking").select("*").eq("user_id",g.id);if(b)throw b;const w=(p==null?void 0:p.map(j=>{const S=v==null?void 0:v.find(N=>N.requirement_id===j.id);return{id:j.id,name:j.name,description:j.description||"",icon:f8e[j.icon_name||"FileText"]||En,completed:(S==null?void 0:S.is_completed)||!1,hasUpload:!0,uploadedFile:S==null?void 0:S.document_name,tooltip:j.tooltip_info||"",required:j.is_required,authority:j.authority||"",category:j.category,trackingId:S==null?void 0:S.id}}))||[];n(w)}catch(g){console.error("Error loading compliance data:",g),e({title:"Error loading compliance data",description:"Please try refreshing the page.",variant:"destructive"})}finally{s(!1)}},d=async g=>{try{const{data:{user:p}}=await q.auth.getUser();if(!p)return;const x=t.find(b=>b.id===g);if(!x)return;const v=!x.completed;if(x.trackingId){const{error:b}=await q.from("compliance_tracking").update({is_completed:v,completion_date:v?new Date().toISOString():null}).eq("id",x.trackingId);if(b)throw b}else{const{error:b}=await q.from("compliance_tracking").insert({user_id:p.id,requirement_id:g,is_completed:v,completion_date:v?new Date().toISOString():null});if(b)throw b}n(b=>b.map(w=>w.id===g?{...w,completed:v}:w)),e({title:v?"Requirement completed":"Requirement unchecked",description:`${x.name} has been ${v?"marked as complete":"unchecked"}.`})}catch(p){console.error("Error updating compliance:",p),e({title:"Error updating compliance",description:"Please try again.",variant:"destructive"})}},h=async(g,p)=>{var v;const x=(v=p.target.files)==null?void 0:v[0];if(x)try{const{data:{user:b}}=await q.auth.getUser();if(!b)return;const w=t.find(j=>j.id===g);if(!w)return;if(w.trackingId){const{error:j}=await q.from("compliance_tracking").update({document_name:x.name}).eq("id",w.trackingId);if(j)throw j}else{const{error:j}=await q.from("compliance_tracking").insert({user_id:b.id,requirement_id:g,document_name:x.name});if(j)throw j}n(j=>j.map(S=>S.id===g?{...S,uploadedFile:x.name}:S)),e({title:"Document uploaded",description:`${x.name} has been uploaded successfully.`})}catch(b){console.error("Error uploading document:",b),e({title:"Error uploading document",description:"Please try again.",variant:"destructive"})}},f=()=>{e({title:"Progress saved",description:"Your compliance checklist progress has been saved automatically."})},m=()=>{e(l===o?{title:"Section completed!",description:"All required registration & legal requirements are complete."}:{title:"Incomplete requirements",description:`Please complete ${o-l} more required items.`,variant:"destructive"})};return r?i.jsx("div",{className:"min-h-screen p-4 pb-20 flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading compliance requirements..."})]})}):i.jsx("div",{className:"min-h-screen p-4 pb-20",children:i.jsx(pz,{children:i.jsxs("div",{className:"max-w-2xl mx-auto
947space-y-6",children:[i.jsxs(z,{className:"glass-card border-primary/20",children:[i.jsxs(re,{children:[i.jsxs(se,{className:"flex items-center gap-2 text-primary",children:[i.jsx(wE,{className:"h-6 w-6"}),"1. Registration & Legal"]}),i.jsx(_n,{children:"Complete all legal and statutory requirements for your livestock farming operation"})]}),i.jsx(V,{children:i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between text-sm",children:[i.jsxs("span",{children:["Progress: ",a,"/",t.length," items"]}),i.jsxs("span",{className:"text-muted-foreground",children:[Math.round(c),"% complete"]})]}),i.jsx(rr,{value:c,className:"h-3"}),i.jsxs("div",{className:"flex gap-2 text-xs",children:[i.jsxs(ye,{variant:l===o?"default":"secondary",children:["Required: ",l,"/",o]}),i.jsxs(ye,{variant:"outline",children:["Optional: ",a-l,"/",t.length-o]})]})]})})]}),i.jsx("div",{className:"space-y-4",children:t.map(g=>{const p=g.icon;return i.jsx(z,{className:`transition-all duration-200 ${g.completed?"bg-success/5 border-success/20":""}`,children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx($G,{id:g.id,checked:g.completed,onCheckedChange:()=>d(g.id),className:"mt-1"}),i.jsxs("div",{className:"flex-1 space-y-2",children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx(p,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("label",{htmlFor:g.id,className:`font-medium cursor-pointer ${g.completed?"line-through text-muted-foreground":""}`,children:g.name}),g.required&&i.jsx(ye,{variant:"destructive",className:"text-xs",children:"Required"}),i.jsxs(ure,{children:[i.jsx(dre,{children:i.jsx(qZ,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx(gz,{className:"max-w-xs",children:i.jsx("p",{children:g.tooltip})})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:g.description})]})]}),g.hasUpload&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"file",id:`upload-${g.id}`,className:"hidden",accept:".pdf,.jpg,.jpeg,.png,.doc,.docx",onChange:x=>h(g.id,x)}),i.jsxs(U,{variant:"outline",size:"sm",onClick:()=>{var x;return(x=document.getElementById(`upload-${g.id}`))==null?void 0:x.click()},className:"text-xs",children:[i.jsx(Yb,{className:"h-3 w-3 mr-1"}),"Upload Document"]}),g.uploadedFile&&i.jsxs("span",{className:"text-xs text-success flex items-center gap-1",children:[i.jsx(qr,{className:"h-3 w-3"}),g.uploadedFile]})]})]})]})})},g.id)})}),i.jsxs("div",{className:"flex gap-3",children:[i.jsxs(U,{onClick:f,variant:"outline",className:"flex-1",children:[i.jsx(NB,{className:"h-4 w-4 mr-2"}),"Save Progress"]}),i.jsxs(U,{onClick:m,className:"flex-1",disabled:l!==o,children:[i.jsx(qr,{className:"h-4 w-4 mr-2"}),"Mark Section Complete"]})]})]})})})}const DG=()=>{y.useState(null);const[e,t]=y.useState(!1),[n,r]=y.useState("all");We();const s=()=>{Object.keys(localStorage).forEach(p=>{(p.startsWith("supabase.auth.")||p.includes("sb-"))&&localStorage.removeItem(p)}),Object.keys(sessionStorage||{}).forEach(p=>{(p.startsWith("supabase.auth.")||p.includes("sb-"))&&sessionStorage.removeItem(p)})},a=async()=>{try{s();try{await q.auth.signOut({scope:"global"})}catch{}window.location.href="/"}catch(p){console.error("Logout error:",p),window.location.href="/"}};y.useEffect(()=>{e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]);const o=[{id:1,name:"Thabo Mokoena",farmName:"Sunrise Livestock Farm",location:"Johannesburg, Gauteng",birdCount:450,birdType:"Layers",eggProduction:380,compliance:92,status:"excellent",funding:45e3,lastUpdate:"2 hours ago",coursesCompleted:3,totalCourses:5,joinDate:"Jan 2024",mortality:"2%"},{id:2,name:"Lerato Dlamini",farmName:"Golden Feather Farm",location:"Pretoria, Gauteng",birdCount:620,birdType:"Broilers",eggProduction:0,compliance:88,status:"healthy",funding:62e3,lastUpdate:"5 hours ago",coursesCompleted:2,totalCourses:4,joinDate:"Mar 2024",mortality:"3%"},{id:3,name:"Sipho Ndlovu",farmName:"Valley View Livestock",location:"Durban, KwaZulu-Natal",birdCount:320,birdType:"Layers",eggProduction:285,compliance:78,status:"warning",funding:38e3,lastUpdate:"1 day ago",coursesCompleted:1,totalCourses:5,joinDate:"Nov 2023",mortality:"5%"},{id:4,name:"Nomsa Khumalo",farmName:"Heritage Farm",location:"Cape Town, Western Cape",birdCount:280,birdType:"Mixed",eggProduction:195,compliance:95,status:"excellent",funding:52e3,lastUpdate:"3 hours ago",coursesCompleted:4,totalCourses:5,joinDate:"Feb 2024",mortality:"1%"},{id:5,name:"Zanele Mthembu",farmName:"Ubuntu Livestock Co-op",location:"Polokwane, Limpopo",birdCount:580,birdType:"Broilers",eggProduction:0,compliance:85,status:"healthy",funding:71e3,lastUpdate:"4 hours ago",coursesCompleted:2,totalCourses:4,joinDate:"Dec 2023",mortality:"4%"},{id:6,name:"Mandla Zulu",farmName:"Green Valley Layers",location:"Nelspruit, Mpumalanga",birdCount:410,birdType:"Layers",eggProduction:350,compliance:82,status:"healthy",funding:48e3,lastUpdate:"6 hours ago",coursesCompleted:3,totalCourses:5,joinDate:"Oct 2023",mortality:"3%"}
947],l=[{id:1,type:"critical",farmName:"Valley View Livestock",message:"Compliance review overdue - vaccination records need update",time:"1 hour ago"},{id:2,type:"warning",farmName:"Golden Feather Farm",message:"Feed stock running low - order reminder sent",time:"3 hours ago"},{id:3,type:"info",farmName:"Heritage Farm",message:"Course completion: Financial Record Keeping certified",time:"1 day ago"},{id:4,type:"warning",farmName:"Ubuntu Livestock Co-op",message:"Weather alert: Heat wave forecasted for next 3 days",time:"2 hours ago"}],c=o.reduce((p,x)=>p+x.birdCount,0),u=Math.round(o.reduce((p,x)=>p+x.compliance,0)/o.length),d=o.reduce((p,x)=>p+x.eggProduction,0),h=o.reduce((p,x)=>p+x.funding,0),f=l.filter(p=>p.type==="critical").length,m=n==="all"?o:o.filter(p=>p.status===n),g=p=>p>=90?"text-success":p>=75?"text-warning":"text-destructive";return i.jsxs("div",{className:"relative min-h-screen bg-gradient-bg aurora-blobs overflow-hidden p-4 space-y-6",children:[i.jsxs("div",{className:"relative glass-hero p-5 sm:p-6 z-10 overflow-hidden","data-tour":"incubator-header",children:[i.jsx("div",{className:"absolute -top-10 -right-10 h-40 w-40 rounded-full bg-primary/30 blur-2xl pointer-events-none"}),i.jsxs("div",{className:"relative flex flex-col lg:flex-row justify-between items-start lg:items-center gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-semibold tracking-widest uppercase text-secondary/80",children:"Incubator Program"}),i.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-foreground leading-tight mt-1",children:"Startup Culture"}),i.jsx("p",{className:"text-sm text-foreground/70 mt-1",children:"Livestock Acceleration Program Dashboard"}),i.jsx("p",{className:"text-xs text-foreground/60 mt-1",children:"Managing 20 farmers across Gauteng, Mpumalanga & Limpopo"})]}),i.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[i.jsxs("div",{className:"glass-pill inline-flex items-center gap-2 px-3 py-1.5",children:[i.jsx(aee,{className:"h-4 w-4"}),i.jsx(kw,{checked:e,onCheckedChange:t,className:"data-[state=checked]:bg-primary"}),i.jsx(eee,{className:"h-4 w-4"})]}),i.jsxs(U,{variant:"outline",size:"sm",className:"glass-tile border-0",children:[i.jsx(qo,{className:"h-4 w-4 mr-2"}),"Export Reports"]}),i.jsxs(U,{variant:"outline",size:"sm",className:"glass-tile border-0",children:[i.jsx(gB,{className:"h-4 w-4 mr-2"}),"Filter"]}),i.jsxs(U,{variant:"default",size:"sm",children:[i.jsx(jc,{className:"h-4 w-4 mr-2"}),"Send Alert"]}),i.jsxs(U,{variant:"outline",size:"sm",onClick:a,className:"glass-tile border-0 text-destructive hover:text-destructive",children:[i.jsx(vE,{className:"h-4 w-4 mr-2"}),"Sign Out"]})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4","data-tour":"farmer-stats",children:[i.jsx(z,{className:"glass-card",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Total Farmers"}),i.jsx("p",{className:"text-2xl font-bold text-primary",children:o.length}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Active incubatees"})]}),i.jsx(ht,{className:"h-8 w-8 text-primary"})]})})}),i.jsx(z,{className:"glass-card",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Avg Compliance"}),i.jsxs("p",{className:"text-2xl font-bold text-success",children:[u,"%"]}),i.jsx("p",{className:"text-xs text-success mt-1",children:"+2% from last month"})]}),i.jsx(Dt,{className:"h-8 w-8 text-success"})]})})}),i.jsx(z,{className:"glass-card",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Total Birds"}),i.jsx("p",{className:"text-2xl font-bold text-primary",children:c.toLocaleStr
947ing()}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Across all farms"})]}),i.jsx(pE,{className:"h-8 w-8 text-primary"})]})})}),i.jsx(z,{className:"glass-card",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Daily Production"}),i.jsx("p",{className:"text-2xl font-bold text-success",children:d.toLocaleString()}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Eggs per day"})]}),i.jsx(Wt,{className:"h-8 w-8 text-success"})]})})}),i.jsx(z,{className:"glass-card",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Critical Alerts"}),i.jsx("p",{className:"text-2xl font-bold text-destructive",children:f}),i.jsx("p",{className:"text-xs text-destructive mt-1",children:"Require attention"})]}),i.jsx(Ra,{className:"h-8 w-8 text-destructive"})]})})})]}),i.jsxs(Bc,{defaultValue:"farmers",className:"space-y-4",children:[i.jsxs(jl,{className:"grid w-full grid-cols-6",children:[i.jsx(pt,{value:"farmers",children:"Farmers"}),i.jsx(pt,{value:"compliance",children:"Compliance"}),i.jsx(pt,{value:"learning",children:"Learning"}),i.jsx(pt,{value:"funding",children:"Funding"}),i.jsx(pt,{value:"alerts",children:"Alerts"}),i.jsx(pt,{value:"analytics",children:"Analytics"})]}),i.jsxs(tt,{value:"farmers",className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center mb-4",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(U,{variant:n==="all"?"default":"outline",size:"sm",onClick:()=>r("all"),children:["All (",o.length,")"]}),i.jsxs(U,{variant:n==="excellent"?"default":"outline",size:"sm",onClick:()=>r("excellent"),children:["Excellent (",o.filter(p=>p.status==="excellent").length,")"]}),i.jsxs(U,{variant:n==="healthy"?"default":"outline",size:"sm",onClick:()=>r("healthy"),children:["Healthy (",o.filter(p=>p.status==="healthy").length,")"]}),i.jsxs(U,{variant:n==="warning"?"default":"outline",size:"sm",onClick:()=>r("warning"),children:["Needs Attention (",o.filter(p=>p.status==="warning").length,")"]})]}),i.jsxs(U,{variant:"outline",size:"sm",children:[i.jsx(rn,{className:"h-4 w-4 mr-2"}),"Add Farmer"]})]}),i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsx(se,{children:"Farmer Overview"}),i.jsx(_n,{children:"Complete list of incubatees and their performance metrics"})]}),i.jsx(V,{className:"p-0",children:i.jsxs(Sa,{children:[i.jsx(Na,{children:i.jsxs(kn,{children:[i.jsx(Pe,{children:"Farm Name"}),i.jsx(Pe,{children:"Location"}),i.jsx(Pe,{children:"Compliance"}),i.jsx(Pe,{children:"Production"}),i.jsx(Pe,{children:"Birds"}),i.jsx(Pe,{children:"Status"}),i.jsx(Pe,{children:"Last Update"}),i.jsx(Pe,{children:"Actions"})]})}),i.jsx(ka,{children:m.map(p=>i.jsxs(kn,{children:[i.jsx(ke,{className:"font-medium",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:p.name}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Joined ",p.joinDate]})]})}),i.jsx(ke,{children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(ts,{className:"h-3 w-3 text-muted-foreground"}),i.jsx("span",{className:"text-sm",children:p.location})]})}),i.jsx(ke,{children:i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"flex justify-between text-sm",children:i.jsxs("span",{className:g(p.compliance),children:[p.compliance,"%"]})}),i.jsx(rr,{value:p.compliance,className:"h-1 w-16"})]})}),i.jsx(ke,{children:i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"font-semibold text-success",children:p.eggProduction}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"eggs/day"})]})}),i.jsx(ke,{children:i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"font-semibold",children:p.birdCount}),i.jsxs("p",{className:"text-xs text-destructive",children:[p.mortality," mortality"]})]})}),i.jsx(ke,{children:i.jsx(ye,{variant:p.status==="excellent"?"default":p.status==="healthy"?"secondary":"destructive",children:p.status})}),i.jsx(ke,{className:"text-sm text-muted-foreground",children:p.lastUpdate}),i.jsx(ke,{children:i.jsxs("div",{className:"flex gap-1",children:[i.jsx(U,{variant:"ghost",size:"sm",children:i.jsx(UZ,{className:"h-3 w-3"})}),i.jsx(U,{variant:"ghost",size:"sm",children:i.jsx(Pm,{className:"h-3 w-3"})})]})})]}
947,p.id))})]})})]})]}),i.jsx(tt,{value:"compliance",className:"space-y-4","data-tour":"partnership",children:i.jsx(LG,{})}),i.jsx(tt,{value:"learning",className:"space-y-4",children:i.jsx(o8e,{})}),i.jsx(tt,{value:"funding",className:"space-y-4","data-tour":"support-tools",children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsx(se,{children:"Disbursement Summary"}),i.jsx(_n,{children:"Total funding distributed across all farmers"})]}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{children:"Equipment & Infrastructure"}),i.jsxs("span",{className:"font-semibold",children:["R",Math.round(h*.35).toLocaleString()]})]}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{children:"Capital Investment"}),i.jsxs("span",{className:"font-semibold",children:["R",Math.round(h*.45).toLocaleString()]})]}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{children:"Feed & Supply Support"}),i.jsxs("span",{className:"font-semibold",children:["R",Math.round(h*.15).toLocaleString()]})]}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{children:"Training & Development"}),i.jsxs("span",{className:"font-semibold",children:["R",Math.round(h*.05).toLocaleString()]})]}),i.jsxs("div",{className:"border-t pt-2",children:[i.jsxs("div",{className:"flex justify-between items-center font-bold",children:[i.jsx("span",{children:"Total Disbursed"}),i.jsxs("span",{children:["R",h.toLocaleString()]})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Since program inception"})]})]})]}),i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsx(se,{children:"Support Tickets"}),i.jsx(_n,{children:"Recent farmer requests"})]}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border",children:[i.jsx("div",{className:"w-2 h-2 rounded-full bg-destructive"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"Equipment malfunction - Incubator failure"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Unity Chicken Farm - 3 hours ago"})]}),i.jsx(U,{variant:"ghost",size:"sm",children:"Resolve"})]}),i.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border",children:[i.jsx("div",{className:"w-2 h-2 rounded-full bg-warning"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"Feed quality concern - Low protein levels"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Marula Layers - 1 day ago"})]}),i.jsx(U,{variant:"ghost",size:"sm",children:"Contact"})]}),i.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border",children:[i.jsx("div",{className:"w-2 h-2 rounded-full bg-primary"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"text-sm font-medium",children:"Training request - Biosecurity protocols"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Crocodile River Farm - 2 days ago"})]}),i.jsx(U,{variant:"ghost",size:"sm",children:"Schedule"})]})]})]})]})}),i.jsx(tt,{value:"alerts",className:"space-y-4",children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsx(se,{children:"Recent Alerts"}),i.jsx(_n,{children:"System-generated notifications"})]}),i.jsx(V,{className:"space-y-3",children:l.map(p=>i.jsxs("div",{className:`p-3 rounded-lg ${p.type==="critical"?"bg-destructive/10":p.type==="warning"?"bg-warning/10":"bg-primary/10"}`,children:[i.jsx("p",{className:"text-sm font-medium",children:p.message}),i.jsx("p",{className:"text-xs text-muted-foreground",children:p.time})]},p.id))})]}),i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsx(se,{children:"Communication Center"}),i.jsx(_n,{children:"Send notifications to farmers"})]}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs(U,{className:"w-full",variant:"outline",children:[i.jsx(Ua,{className:"h-4 w-4 mr-2"}),"Send Email Broadcast"]}),i.jsxs(U,{className:"w-full",variant:"outline",children:[i.jsx(Pm,{className:"h-4 w-4 mr-2"}),"Send SMS Alert"]}),i.jsxs(U,{className:"w-full",variant:"default",children:[i.jsx(jc,{className:"h-4 w-4 mr-2"}),"Create Custom Alert"]})]})]})]})}),i.jsx(tt,{value:"analytics",className:"space-y-4","data-tour":"market-insights",children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Performance Metrics"})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-3xl font-bold text-primary",children:"92%"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Overall Success Rate"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-sm",children:"Productivity"}),i.jsx("span",{className:"text-sm",children:"88%"})]}),i.jsx(rr,{value:88,className:"h-2"})]})]})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Growth Trends"})}),i.jsx(V,{children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Wt,{className:"h-8 w-8 text-success"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-lg font-semibold text-success",children:"+15%"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Production increase"})]})]})})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Risk Assessment"})}),i.jsxs(V,{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-sm",children:"Low Risk"}),i.jsx("span",{className:"text-sm text-success",children:"65%"})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-sm",children:"Medium Risk"}),i.jsx("span",{className:"text-sm text-warning",children:"25%"})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-sm",children:"High Risk"}),i.jsx("span",{className:"text-sm text-destructive",children:"10%"})]})]})]})]})})]})]})},i5=({steps:e,onComplete:t,onSkip:n,isVisible:r})=>{const[s,a]=y.useState(0),[o,l]=y.useState(null),[c,u]=y.useState({top:0,left:0});y.useEffect(()=>{if(!r||!e[s])return;setTimeout(()=>{const p=document.querySelector(e[s].target);if(p){l(p);const x=p.getBoundingClientRect();u({top:x.top+window.scrollY,left:x.left+window.scrollX}),p.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})}},100)},[s,r,e]);const d=()=>{s<e.length-1?a(s+1):t()},h=()=>{s>0&&a(s-1)};if(!r||!e[s])return null;const f=e[s],m=s===e.length-1;return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:n}),o&&i.jsx("div",{className:"fixed z-50 pointer-events-none",style:{to
947p:c.top-4,left:c.left-4,width:o.offsetWidth+8,height:o.offsetHeight+8,border:"3px solid hsl(var(--primary))",borderRadius:"8px",boxShadow:"0 0 0 4px hsl(var(--primary) / 0.2)",animation:"pulse 2s infinite"}}),i.jsx(z,{className:"fixed z-50 w-80 bg-background border shadow-lg",children:i.jsxs(V,{className:"p-6",children:[i.jsxs("div",{className:"flex items-start justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(bE,{className:"h-5 w-5 text-primary"}),i.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["Step ",s+1," of ",e.length]})]}),i.jsx(U,{variant:"ghost",size:"sm",onClick:n,className:"h-6 w-6 p-0",children:i.jsx(hh,{className:"h-4 w-4"})})]}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:f.title}),i.jsx("p",{className:"text-muted-foreground mb-6",children:f.description}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(U,{variant:"outline",size:"sm",onClick:h,disabled:s===0,className:"flex items-center gap-2",children:[i.jsx(jt,{className:"h-4 w-4"}),"Previous"]}),i.jsx("div",{className:"flex gap-1",children:e.map((g,p)=>i.jsx("div",{className:`h-2 w-2 rounded-full transition-colors ${p===s?"bg-primary":p<s?"bg-primary/50":"bg-muted"}`},p))}),i.jsxs(U,{onClick:d,size:"sm",className:"flex items-center gap-2",children:[m?"Finish":"Next",!m&&i.jsx(ya,{className:"h-4 w-4"})]})]}),i.jsx("div",{className:"mt-4 text-center",children:i.jsx(U,{variant:"ghost",size:"sm",onClick:n,className:"text-muted-foreground",children:"Skip tutorial"})})]})}),i.jsx("style",{children:` 948 @keyframes pulse { 949 0%, 100% { opacity: 1; } 950 50% { opacity: 0.7; } 951 } 952 `})]})},m8e=e=>{const[t,n]=y.useState(!1);return y.useEffect(()=>{},[e]),{shouldShowTour:t,completeTour:()=>{e&&localStorage.setItem(`tour_completed_${e}`,"true"),n(!1)},skipTour:()=>{e&&localStorage.setItem(`tour_completed_${e}`,"true"),n(!1)}}},p8e=[{id:"welcome",title:"Welcome to Flockify!",description:"Let's take a quick tour of your farm management dashboard. We'll show you the key features to get you started.",target:'[data-tour="dashboard-header"]',placement:"bottom"},{id:"flock-stats",title:"Your Flock Overview",description:"Monitor your total birds, egg production, and mortality rates at a glance. This gives you a quick health check of your operation.",target:'[data-tour="flock-stats"]',placement:"bottom"},{id:"quick-actions",title:"Quick Actions",description:"Access the most common tasks like adding new birds, recording feeds, or logging health issues directly from here.",target:'[data-tour="quick-actions"]',placement:"top"},{id:"health-monitor",title:"Health Monitoring",description:"AI-powered health analysis helps you detect potential issues early. Upload photos for instant health assessments.",target:'[data-tour="health-monitor"]',placement:"top"},{id:"navigation",title:"Navigation Menu",description:"Use the bottom navigation to access flock management, marketplace, finances, learning resources, and your profile.",target:'[data-tour="bottom-nav"]',placement:"top"}],g8e=[{id:"welcome",title:"Welcome to Flockify Partner Portal!",description:"Your gateway to supporting emerging livestock farmers. Let's explore how you can make an impact.",target:'[data-tour="incubator-header"]',placement:"bottom"},{id:"farmer-stats",title:"Farmer Network Overview",description:"Monitor the farmers in your network, their success rates, and overall impact metrics in real-time.",target:'[data-tour="farmer-stats"]',placement:"bottom"},{id:"support-tools",title:"Support & Mentorship Tools",description:"Access resources to provide guidance, training materials, and direct support to your farmers.",target:'[data-tour="support-tools"]',placement:"top"},{id:"market-insights",title:"Market Intelligence",description:"Stay informed about market trends, pricing, and opportunities to help your farmers succeed.",target:'[data-tour="market-insights"]',placement:"top"},{id:"partnership",title:"Partnership Opportunities",description:"Explore collaboration opportunities with CSIs, government programs, and other stakeholders.",target:'[data-tour="partnership"]',placement:"top"}],y8e=()=>{const[e,t]=y.useState(null),[n,r]=y.useState(null),[s,a]=y.useState(null),[o,l]=y.useState("home"),[c,u]=y.useState(null),{profile:d,loading:h,refetch:f}=Cr(),{weatherData:m}=Zq((d==null?void 0:d.location)??null),{shouldShowTour:g,completeTour:p,skipTour:x}=m8e(s);y.useEffect(()=>
952{((d==null?void 0:d.user_type)==="farmer"||(d==null?void 0:d.user_type)==="incubator")&&a(d.user_type)},[d==null?void 0:d.user_type]),y.useEffect(()=>{const{data:{subscription:k}}=q.auth.onAuthStateChange((_,C)=>{var A;if(r(C),t((C==null?void 0:C.user)??null),C!=null&&C.user){const E=(A=C.user.user_metadata)==null?void 0:A.user_type;E&&a(E)}else a(null)});return q.auth.getSession().then(({data:{session:_}})=>{var C;if(r(_),t((_==null?void 0:_.user)??null),_!=null&&_.user){const A=(C=_.user.user_metadata)==null?void 0:C.user_type;A&&a(A)}}),()=>k.unsubscribe()},[]);const v=k=>{a(k)},b=async k=>{if(!e)return;const{error:_}=await q.from("profiles").update({farming_type:k.farmingType,farm_name:k.farmName||null,location:k.location||null,primary_challenge:k.primaryChallenge||null,breed:k.breed||null,production_goal:k.productionGoal||null,housing_system:k.housingSystem||null,onboarding_completed:!0}).eq("user_id",e.id);_&&console.error("Error updating profile:",_),await f(),u({active:!0,brief:null,loading:!0});try{const{data:C,error:A}=await q.functions.invoke("generate-farm-brief",{body:{farmName:k.farmName,location:k.location,farmingType:k.farmingType,flockSize:k.flockSize,primaryChallenge:k.primaryChallenge,breed:k.breed,productionGoal:k.productionGoal,housingSystem:k.housingSystem,weather:{temperature:m==null?void 0:m.temperature,humidity:m==null?void 0:m.humidity}}});if(A)throw A;i6e(e.id,C),u({active:!0,brief:C,loading:!1})}catch(C){console.error("Brief generation failed",C),u({active:!0,brief:tK(e.id),loading:!1})}},w=()=>{p()},j=()=>{x()};if(!e&&!n)return i.jsx(Xfe,{onAuthSuccess:v});if(e&&((d==null?void 0:d.user_type)==="learner"||!d&&!h&&s==="learner"))return i.jsx(Tse,{to:"/learning",replace:!0});if(e&&s==="incubator")return i.jsxs("div",{className:"min-h-screen",children:[i.jsx(DG,{}),g&&i.jsx(i5,{steps:g8e,onComplete:w,onSkip:j,isVisible:g})]});const S=!!d&&(!d.farm_name||!d.location||!d.farming_type||!d.primary_challenge);if(e&&s==="farmer"&&d&&(!d.onboarding_completed||S)&&!(c!=null&&c.active))return i.jsx(sme,{onComplete:b});if(e&&s==="farmer"&&(c!=null&&c.active))return i.jsx(ime,{brief:c.brief,loading:c.loading,farmName:(d==null?void 0:d.farm_name)??void 0,onScan:()=>{try{sessionStorage.setItem("flockify:openScanner","1")}catch{}u(null),l("home")},onDashboard:()=>{u(null),l("home")}});if(e&&s==="farmer"&&h)return i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading your profile..."})]})});const N=()=>{switch(o){case"home":return i.jsx(U4,{activeTab:o,onTabChange:l});case"flock":return i.jsx(X4,{});case"daily-log":return i.jsx(X4,{initialView:"daily-ops"});case"social":return i.jsx(a8e,{});case"market":return i.jsx(gBe,{});case"finance":return i.jsx(Jq,{});case"learn":return window.location.href="/learning",null;case"profile":return i.jsx(bBe,{});default:return i.jsx(U4,{activeTab:o,onTabChange:l})}};return e&&s==="farmer"?i.jsxs("div",{className:"min-h-screen pb-20 md:pb-0 bg-gradient-bg relative aurora-blobs overflow-hidden",children:[i.jsx("main",{className:"max-w-7xl mx-auto relative z-10",children:N()}),i.jsx(Zme,{activeTab:o,onTabChange:l}),g&&i.jsx(i5,{steps:p8e,onComplete:w,onSkip:j,isVisible:g})]}):e&&!s?i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),i.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})}):null},x8e=()=>{const e=dl();return y.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),i.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),i.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})};function v8e({onAuthSuccess:e,onBack:t}){const[n,r]=y.useState(!0),[s,a]=y.useState(""),[o,l]=y.useState(""),[c,u]=y.useState(""),[d,h]=y.useState(""),[f,m]=y.useState(!1),{toast:g}=We(),p=()=>{Object.keys(localStorage).forEach(v=>{(v.startsWith("supabase.auth.")||v.includes("sb-"))&&localStorage.removeItem(v)}),Object.keys(sessionStorage||{}
952).forEach(v=>{(v.startsWith("supabase.auth.")||v.includes("sb-"))&&sessionStorage.removeItem(v)})};y.useEffect(()=>{(async()=>{try{p(),await q.auth.signOut({scope:"global"})}catch{}})();const{data:{subscription:b}}=q.auth.onAuthStateChange((w,j)=>{w==="SIGNED_IN"&&(j!=null&&j.user)&&setTimeout(()=>{e("incubator")},0)});return()=>b.unsubscribe()},[e]);const x=async v=>{v.preventDefault(),m(!0);try{p();try{await q.auth.signOut({scope:"global"})}catch{}if(n){const{error:b}=await q.auth.signInWithPassword({email:s,password:o});if(b)throw b;g({title:"Welcome back!",description:"Successfully signed in to Partner Portal."})}else{const{error:b}=await q.auth.signUp({email:s,password:o,options:{data:{display_name:d,user_type:"incubator",company_name:c},emailRedirectTo:`${window.location.origin}/incubator-access`}});if(b)throw b;g({title:"Application submitted!",description:"Please check your email to verify your account. We'll review your application shortly."})}}catch(b){g({title:"Authentication error",description:b.message,variant:"destructive"})}finally{m(!1)}};return i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative overflow-hidden aurora-blobs",children:[i.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-transparent to-secondary/5"}),i.jsx("div",{className:"relative z-10 flex flex-col items-center justify-center min-h-screen space-y-8 p-4",children:i.jsxs("div",{className:"w-full max-w-md",children:[i.jsxs(U,{variant:"ghost",onClick:t,className:"mb-6 p-0 h-auto text-muted-foreground hover:text-foreground",children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back to main page"]}),i.jsxs(z,{className:"shadow-2xl border-0 bg-background/95 backdrop-blur glass-card",children:[i.jsxs(re,{className:"text-center space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[i.jsx("div",{className:"bg-gradient-secondary p-3 rounded-xl",children:i.jsx(dh,{className:"h-6 w-6 text-white"})}),i.jsx("div",{children:i.jsxs(se,{className:"text-2xl",children:["Partner Portal ",n?"Login":"Application"]})})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:n?"Welcome back to the incubator portal":"Apply to become a Flockify partner incubator"})]}),i.jsxs(V,{children:[i.jsxs("form",{onSubmit:x,className:"space-y-6",children:[!n&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"companyName",children:"Organization/Company Name *"}),i.jsx(ae,{id:"companyName",type:"text",value:c,onChange:v=>u(v.target.value),required:!0,className:"h-12",placeholder:"Enter your organization name"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"contactName",children:"Contact Person Name *"}),i.jsx(ae,{id:"contactName",type:"text",value:d,onChange:v=>h(v.target.value),required:!0,className:"h-12",placeholder:"Enter contact person name"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"email",children:"Business Email *"}),i.jsx(ae,{id:"email",type:"email",value:s,onChange:v=>a(v.target.value),required:!0,className:"h-12",placeholder:"[email protected]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"password",children:"Password *"}),i.jsx(ae,{id:"password",type:"password",value:o,onChange:v=>l(v.target.value),required:!0,className:"h-12",placeholder:"Enter a secure password"})]}),!n&&i.jsxs("div",{className:"bg-muted/50 p-4 rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(ll,{className:"h-5 w-5 text-primary"}),i.jsx("span",{className:"text-sm font-medium",children:"Partner Benefits"})]}),i.jsxs("ul",{className:"text-sm text-muted-foreground space-y-1 ml-8",children:[i.jsx("li",{children:"⢠Manage and support multiple farmers"}),i.jsx("li",{children:"⢠Access detailed analytics and reports"}),i.jsx("li",{children:"⢠Create and assign learning programs"}),i.jsx("li",{children:"⢠Monitor farmer progress and performance"})]})]}),i.jsx(U,{type:"submit",className:"w-full h-12 bg-gradient-secondary hover:shadow-glow",disabled:f,children:f?"Processing...":n?"Sign In":"Submit Application"})]}),i.jsx("div",{className:"mt-6 text-center",children:i.jsx(U,{variant:"link",onClick:()=>r(!n),className:"text-sm",children:n?"Don't have access? Apply here":"Already have access? Sign in"})})]})]})]})})]})}function b8e({onAuthSuccess:e}){const[t,n]=y.useState(!1);return t?i.jsx(v8e,{onAuthSuccess:e,onBack:()=>n(!1)}):i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative overflow-hidden aurora-blobs",children:[i.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[i.jsx("div",{className:"absolute -top-40 -right-40 w-80 h-80 bg-secondary/5 rounded-full blur-3xl"}),i.jsx("div",{className:"absolute top-1/2 -left-40 w-96 h-96 bg-primary/5 rounded-full blur-3xl"}),i.jsx("div",{className:"absolute bottom-0 right-1/4 w-64 h-64 bg-accent/5 rounded-full blur-3xl"})]}),i.jsx("header",{className:"fixed top-0 left-0 right-0 bg-white/95 backdrop-blur-xl border-b border-border z-50 shadow-elegant",children:i.jsxs("div",{className:"container mx-auto px-6 py-4 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx("img",{src:"/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png",alt:"Flockify Logo",className:"h-12 w-auto drop-shadow-lg"}),i.jsx(ye,{variant:"outline",className:"bg-secondary/10 text-secondary border-secondary/30",children:"Partner Portal"})]}),i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx(U,{variant:"ghost",onClick:()=>window.location.href="/",className:"text-muted-foreground hover:text-primary",children:"Back to Main Site"}),i.jsx(U,{onClick:()=>n(!0),className:"bg-gradient-secondary hover:shadow-glow hover:scale-105 transition-all duration-300 font-semibold px-6",children:"Access Portal"})]})]})}),i.jsx("section",{className:"pt-32 pb-20 px-6 relative z-10",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx(ye,{variant:"outline",className:"bg-secondary/20 text-secondary border-secondary/30 mb-6",children:"PARTNER PROGRAM"}),i.jsxs("h1",{className:"text-5xl md:text-7xl font-bold mb-6 leading-tight",children:[i.jsx("span",{className:"bg-gradient-secondary bg-clip-text text-transparent",children:"Incubator"}),i.jsx("br",{}),"Partner Portal"]}),i.jsx("p",{className:"text-xl text-muted-foreground mb-10 max-w-3xl mx-auto leading-relaxed",children:"Join our network of leading agricultural incubators and organizations. Help farmers across Africa thrive with advanced technology and expert guidance."}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center",children:[i.jsxs(U,{size:"lg",onClick:()=>n(!0),className:"bg-gradient-secondary hover:shadow-glow hover:scale-105 transition-all duration-300 text-lg px-8 py-4 font-semibold",children:["Apply Now",i.jsx(ya,{className:"ml-2 h-5 w-5"})]}),i.jsx(U,{size:"lg",variant:"outline",className:"text-lg px-8 py-4 border-secondary/30 hover:bg-secondary/10 hover:shadow-amber transition-all duration-300",children:"Learn More"})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-muted/30",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsxs("h2",{className:"text-4xl font-bold mb-6",children:["Partner ",i.jsx("span",{className:"text-secondary",children:"Benefits"})]}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Powerful tools and insights to manage your farmer network and maximize impact."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:[i.jsxs(z,{className:"p-8 bg-white border-secondary/20 hover:shadow-elegant transition-all duration-300 glass-card",children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-6",children:i.jsx(ht,{className:"h-6 w-6 text-secondary"})}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Farmer Management"}),i.jsx("p",{className:"text-muted-foreground",children:"Comprehensive dashboard to monitor and support all your farmers in one place."})]}),i.jsxs(z,{className:"p-8 bg-white border-primary/20 hover:shadow-elegant transition-all duration-300 glass-card",children:[i.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-6",children:i.jsx(Xr,{className:"h-6 w-6 text-primary"})}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Analytics & Reports"}),i.jsx("p",{className:"text-muted-foreground",children:"Detailed performance analytics and progress reports across your entire network."})]}),i.jsxs(z,{className:"p-8 bg-white border-accent/20 hover:shadow-elegant transition-all duration-300 glass-card",children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-6",children:i.jsx(tn,{className:"h-6 w-6 text-accent"})}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Learning Management"}),i.jsx("p",{className:"text-muted-foreground",children:"Create and assign customized training programs and track completion rates."})]}),i.jsxs(z,{className:"p-8 bg-white border-warning/20 hover:shadow-elegant transition-all duration-300 glass-card",children:[i.jsx("div",{className:"w-12 h-12 bg-warning/10 rounded-lg flex items-center justify-center mb-6",children:i.jsx(ll,{className:"h-6 w-6 text-warning"})}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Compliance Tracking"}),i.jsx("p",{className:"text-muted-foreground",children:"Monitor regulatory compliance and ensure all farmers meet industry standards."})]})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-gradient-subtle",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsxs("h2",{className:"text-4xl font-bold mb-6",children:["Partner with ",i.jsx("span",{className:"text-primary",children:"CSIs"})]}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Corporate Social Investment opportunities to scale agricultural impact across Africa."})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[i.jsxs(z,{className:"p-8 bg-white border-primary/20 hover:shadow-elegant transition-all duration-300 glass-card",children:[i.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-6",children:i.jsx(ht,{className:"h-6 w-6 text-primary"})}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Corporate Partnerships"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"Partner with corporations to fund farmer development programs and drive sustainable agricultural transformation."}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"Branded program development"})]}),i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"Impact measurement & reporting"})]}),i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"Stakeholder engagement"})]})]})]}),i.jsxs(z,{className:"p-8 bg-white border-secondary/20 hover:shadow-elegant transition-all duration-300 glass-card",children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-6",children:i.jsx(Xr,{className:"h-6 w-6 text-secondary"})}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Impact at Scale"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"Leverage CSI funding to reach thousands of farmers and create measurable social and economic impact."}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"SDG alignment & reporting"})]}),i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"Community development focus"})]}),i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"Long-term sustainability"})]})]})]}),i.jsxs(z,{className:"p-8 bg-white border-accent/20 hover:shadow-elegant transition-all duration-300 glass-card",children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-6",children:i.jsx(tn,{className:"h-6 w-6 text-accent"})}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Comprehensive Support"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"End-to-end program management from proposal development to impact evaluation."}),i.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"Proposal & funding support"})]}),i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"Program implementation"})]}),i.jsxs("li",{className:"flex items-center space-x-2",children:[i.jsx(Dt,{className:"h-4 w-4 text-success"}),i.jsx("span",{children:"Results tracking & evaluation"})]})]})]})]}),i.jsx("div",{className:"text-center mt-12",children:i.jsxs(U,{size:"lg",onClick:()=>n(!0),className:"bg-gradient-primary hover:shadow-glow hover:scale-105 transition-all duration-300 text-lg px-8 py-4 font-semibold",children:["Explore CSI Partnerships",i.jsx(ya,{className:"ml-2 h-5 w-5"})]})})]})}),i.jsx("section",{className:"py-20 px-6",children:i.jsx("div",{className:"container mx-auto",children:i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16 items-center",children:[i.jsxs("div",{children:[i.jsxs("h2",{className:"text-4xl font-bold mb-6",children:["Partnership ",i.jsx("span",{className:"text-secondary",children:"Requirements"})]}),i.jsx("p",{className:"text-lg text-muted-foreground mb-8 leading-relaxed",children:"We work with established agricultural organizations committed to farmer success and sustainable development."}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(Dt,{className:"h-6 w-6 text-success"}),i.jsx("span",{children:"Established agricultural organization or incubator"})]}),i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(Dt,{className:"h-6 w-6 text-success"}),i.jsx("span",{children:"Active farmer network or program"})]}),i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(Dt,{className:"h-6 w-6 text-success"}),i.jsx("span",{children:"Commitment to farmer development and support"})]}),i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(Dt,{className:"h-6 w-6 text-success"}),i.jsx("span",{children:"Alignment with Flockify's mission and values"})]})]})]}),i.jsxs(z,{className:"bg-gradient-secondary p-8 text-white glass-card",children:[i.jsx(dh,{className:"h-16 w-16 mb-6 opacity-80"}),i.jsx("h3",{className:"text-2xl font-semibold mb-4",children:"Ready to Partner?"}),i.jsx("p",{className:"text-lg opacity-90 mb-6",children:"Join our network of leading incubators and help transform African agriculture together."}),i.jsxs(U,{onClick:()=>n(!0),className:"bg-white text-secondary hover:bg-white/90 font-semibold",children:["Start Application",i.jsx(ya,{className:"ml-2 h-5 w-5"})]})]})]})})}),i.jsx("footer",{className:"py-16 px-6 bg-muted/30 border-t border-border",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-3 mb-6",children:[i.jsx("img",{src:"/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png",alt:"Flockify Logo",className:"h-8 w-auto"}),i.jsx(ye,{variant:"outline",className:"bg-secondary/10 text-secondary border-secondary/30 text-xs",children:"Partner Portal"})]}),i.jsx("p",{className:"text-muted-foreground mb-6",ch
952ildren:"Empowering agricultural organizations to scale their impact and support farmer success."})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-lg font-semibold mb-6",children:"Partnership Inquiries"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(ri,{className:"h-5 w-5 text-secondary"}),i.jsx("span",{children:"068 474 5436"})]}),i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(Ua,{className:"h-5 w-5 text-secondary"}),i.jsx("span",{children:"[email protected]"})]}),i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(ts,{className:"h-5 w-5 text-secondary"}),i.jsx("span",{children:"Sandton, South Africa"})]})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-lg font-semibold mb-6",children:"Apply Today"}),i.jsx("p",{className:"text-muted-foreground mb-6",children:"Ready to join our partner network? Apply today and help us transform agriculture across Africa."}),i.jsx(U,{onClick:()=>n(!0),className:"w-full bg-gradient-secondary hover:shadow-glow",children:"Submit Application"})]})]}),i.jsx("div",{className:"border-t border-border mt-12 pt-8 text-center text-muted-foreground",children:i.jsx("p",{children:"© 2024 Flockify Partner Program. Transforming agriculture together."})})]})})]})}const w8e=()=>{const[e,t]=y.useState(!1),{profile:n,updateProfile:r}=Cr(),{toast:s}=We(),a=async()=>{t(!0);try{const l=crypto.randomUUID(),c=crypto.randomUUID(),{error:u}=await q.from("profiles").insert({id:c,user_id:l,user_type:"incubator",display_name:"AgriTech Incubator SA",farm_name:"AgriTech Innovation Hub",location:"Johannesburg, South Africa",bio:"Leading agricultural technology incubator supporting small-scale farmers across South Africa",is_demo:!0});if(u)throw u;const d=[{id:crypto.randomUUID(),user_id:crypto.randomUUID(),user_type:"farmer",display_name:"Thabo Molefe",farm_name:"Molefe Family Farm",location:"Limpopo, South Africa",bio:"Third-generation livestock farmer specializing in free-range chickens",farming_type:"free-range",incubator_id:c,is_demo:!0},{id:crypto.randomUUID(),user_id:crypto.randomUUID(),user_type:"farmer",display_name:"Sarah Ndlovu",farm_name:"Ndlovu Livestock Co-op",location:"KwaZulu-Natal, South Africa",bio:"Community-based livestock cooperative focusing on sustainable farming practices",farming_type:"broiler",incubator_id:c,is_demo:!0},{id:crypto.randomUUID(),user_id:crypto.randomUUID(),user_type:"farmer",display_name:"Johan van der Merwe",farm_name:"Sunrise Livestock Farm",location:"Western Cape, South Africa",bio:"Commercial layer farm with focus on organic feed and animal welfare",farming_type:"layer",incubator_id:c,is_demo:!0}],{error:h}=await q.from("profiles").insert(d);if(h)throw h;const f=[{farmer_id:d[0].id,incubator_id:c,name:"Heritage Breed Flock A",bird_type:"Potchefstroom Koekoek",count:250,age_weeks:12,health_status:"excellent",notes:"Strong genetic line with good egg production",is_demo:!0},{farmer_id:d[1].id,incubator_id:c,name:"Broiler Batch #23",bird_type:"Ross 308",count:500,age_weeks:6,health_status:"good",notes:"Growing well, on schedule for market",is_demo:!0},{farmer_id:d[2].id,incubator_id:c,name:"Layer Flock Main",bird_type:"Lohmann Brown",count:800,age_weeks:24,health_status:"good",notes:"Peak production period, monitoring feed efficiency",is_demo:!0}],{error:m}=await q.from("flocks").insert(f);if(m)throw m;const g=[{id:crypto.randomUUID(),title:"Sustainable Livestock Farming in South Africa",description:"Comprehensive guide to sustainable livestock farming practices adapted for South African conditions",category:"sustainability",difficulty_level:"intermediate",created_by:l,content:{modules:["Introduction to Sustainable Farming","Water Management","Feed Efficiency","Waste Management"]},estimated_duration:480,is_demo:!0},{id:crypto.randomUUID(),title:"Disease Prevention and Biosecurity",description:"Essential biosecurity measures and disease prevention strategies for livestock farms",category:"health",difficulty_level:"beginner",created_by:l,content:{modules:["Biosecurity Basics","Common Diseases","Vaccination Schedules","Emergency Re
952sponse"]},estimated_duration:360,is_demo:!0}],{error:p}=await q.from("courses").insert(g);if(p)throw p;const x=[{author_id:d[0].user_id,content:"Just finished implementing the new water management system recommended by our incubator. Already seeing 15% improvement in water efficiency! ðð§ #SustainableFarming #LivestockLife",likes_count:12,comments_count:3,is_demo:!0},{author_id:d[1].user_id,content:"Our cooperative just completed the biosecurity training program. Amazing to see how small changes can make such a big difference in flock health. Thanks to the AgriTech team for the support! ð",likes_count:18,comments_count:5,is_demo:!0},{author_id:d[2].user_id,content:"Egg production hit a new record this month - 94% lay rate! The nutrition program from our training is really paying off. Happy birds = productive birds ð¥â¨",likes_count:24,comments_count:7,is_demo:!0}],{error:v}=await q.from("posts").insert(x);if(v)throw v;const b=[{course_id:g[0].id,farmer_id:d[0].user_id,assigned_by:l,status:"in_progress",progress:75,notes:"Excellent progress on water management module",is_demo:!0},{course_id:g[1].id,farmer_id:d[1].user_id,assigned_by:l,status:"completed",progress:100,notes:"Successfully implemented all biosecurity measures",is_demo:!0}],{error:w}=await q.from("course_assignments").insert(b);if(w)throw w;s({title:"Success",description:"Demo data created successfully! You can now view partner portal demo content."})}catch(l){console.error("Error seeding demo data:",l),s({title:"Error",description:"Failed to create demo data",variant:"destructive"})}finally{t(!1)}},o=(n==null?void 0:n.user_type)==="admin";return i.jsxs("div",{className:"container mx-auto p-6 max-w-4xl",children:[i.jsxs("div",{className:"mb-8",children:[i.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Admin Panel"}),i.jsx("p",{className:"text-muted-foreground",children:"Manage demo data and platform administration"})]}),i.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[i.jsxs(z,{children:[i.jsxs(re,{children:[i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(ll,{className:"h-5 w-5"}),"Admin Status"]}),i.jsx(_n,{children:"Current admin permissions and access level"})]}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{children:"User Type:"}),i.jsx(ye,{variant:o?"default":"secondary",children:(n==null?void 0:n.user_type)||"Loading..."})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{children:"Demo Access:"}),i.jsx(ye,{variant:o?"default":"destructive",children:o?"Enabled":"Disabled"})]}),!o&&i.jsx("p",{className:"text-sm text-muted-foreground",children:"Admin roles can only be assigned by existing admins via the College Admin dashboard."})]})]}),i.jsxs(z,{children:[i.jsxs(re,{children:[i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(BZ,{className:"h-5 w-5"}),"Demo Data"]}),i.jsx(_n,{children:"Partner portal demo content for presentations"})]}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ht,{className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"Demo Farmers & Incubators"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(tn,{className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"Demo Courses & Assignments"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pm,{className:"h-4 w-4"}),i.jsx("span",{className:"text-sm",children:"Demo Social Posts"})]})]}),i.jsx(U,{onClick:a,disabled:e||!o,className:"w-full",children:e?"Creating...":"Seed Demo Data"}),!o&&i.jsx("p",{className:"text-xs text-muted-foreground",children:"Admin access required to create demo data"})]})]})]}),o&&i.jsxs(z,{className:"mt-6",children:[i.jsxs(re,{children:[i.jsx(se,{children:"Demo Data Access"}),i.jsx(_n,{children:"As an admin, you can now see all demo content that showcases the partner portal functionality. Demo data is hidden from regular users and only visible to you."})]}),i.jsx(V,{children:i.jsxs("div",{className:"bg-muted p-4 rounded-lg",children:[i.jsx("h4",{className:"font-medium mb-2",children:"What you can now see:"}),i.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground",children:[i.jsx("li",{children:"⢠Demo farmer profiles and their flocks"}),i.jsx("li",{children:"⢠Demo incubator managing multiple farmers"}),i.jsx("li",{children:"⢠Demo courses and training assignments"}),i.jsx("li",{children:"⢠Demo social posts and interactions"}),i.jsx("li",{children:"⢠Complete partner portal workflow"})]})]})})]})]})};function j8e(){return i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:[i.jsx("header",{className:"bg-white border-b border-border shadow-sm",children:i.jsx("div",{className:"container mx-auto px-6 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>window.history.back(),children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back"]}),i.jsx("div",{className:"flex items-center space-x-3",children:i.jsx("img",{src:"/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png",alt:"Flockify Logo",className:"h-8 w-auto"})})]}),i.jsx(U,{onClick:()=>window.location.href="/",children:"Get Started"})]})})}),i.jsx("section",{className:"py-20 px-6",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("div",{className:"w-20 h-20 bg-primary/10 rounded-2xl flex items-center justify-center mx-auto mb-8",children:i.jsx(Xr,{className:"h-10 w-10 text-primary"})}),i.jsxs("h1",{className:"text-5xl font-bold mb-6",children:["Smart ",i.jsx("span",{className:"text-primary",children:"Analytics"})]}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"Transform your farm data into actionable insights with our powerful analytics platform. Make data-driven decisions that boost productivity and profitability."})]})}),i.jsx("section",{className:"py-20 px-6",children:i.jsx("div",{className:"container mx-auto",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Wt,{className:"h-6 w-6 text-primary"})}),i.jsx(se,{children:"Performance Tracking"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Monitor key performance indicators like feed conversion ratio, mortality rates, and growth patterns to i
952dentify optimization opportunities."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(uB,{className:"h-6 w-6 text-accent"})}),i.jsx(se,{children:"Cost Analysis"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Break down your operational costs by category - feed, medication, utilities, and labor to identify areas for cost reduction."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(MZ,{className:"h-6 w-6 text-secondary"})}),i.jsx(se,{children:"Predictive Insights"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Use AI-powered forecasting to predict production outcomes, market trends, and optimal harvest timing for maximum profitability."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-warning/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(pE,{className:"h-6 w-6 text-warning"})}),i.jsx(se,{children:"Real-time Monitoring"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Get instant alerts and notifications about critical events in your farm operations, from temperature changes to health issues."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-success/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Gb,{className:"h-6 w-6 text-success"})}),i.jsx(se,{children:"Goal Setting"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Set production targets and track progress with visual dashboards that keep you motivated and on track."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Xr,{className:"h-6 w-6 text-primary"})}),i.jsx(se,{children:"Benchmarking"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Compare your farm's performance against industry standards and similar operations to identify improvement opportunities."})})]})]})})}),i.jsx("section",{className:"py-20 px-6 bg-gradient-primary",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Ready to Optimize Your Farm?"}),i.jsx("p",{className:"text-xl text-white/90 mb-8 max-w-2xl mx-auto",children:"Join thousands of farmers using Flockify's analytics to increase productivity by up to 30%."}),i.jsx(U,{size:"lg",onClick:()=>window.location.href="/",className:"bg-white text-primary hover:bg-white/90",children:"Start Free Trial"})]})})]})}function S8e(){return i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:[i.jsx("header",{className:"bg-white border-b border-border shadow-sm",children:i.jsx("div",{className:"container mx-auto px-6 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>window.history.back(),children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back"]}),i.jsx("div",{className:"flex items-center space-x-3",children:i.jsx("img",{src:"/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png",alt:"Flockify Logo",className:"h-8 w-auto"})})]}),i.jsx(U,{onClick:()=>window.location.href="/",children:"Get Started"})]})})}),i.jsx("section",{className:"py-20 px-6",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("div",{className:"w-20 h-20 bg-accent/10 rounded-2xl flex items-center justify-center mx-auto mb-8",children:i.jsx(Zs,{className:"h-10 w-10 text-accent"})}),i.jsxs("h1",{className:"text-5xl font-bold mb-6",children:["AI Health ",i.jsx("span",{className:"text-accent",children:"Monitoring"})]}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"Revolutionary AI-powered health scanning with instant disease detection and predictive alerts to keep your birds healthy and productive. Prevent outbreaks before they happen."})]})}),i.jsx("section",{className:"py-20 px-6",children:i.jsx("div",{className:"container mx-auto",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(xa,{
952className:"h-6 w-6 text-accent"})}),i.jsx(se,{children:"Visual Health Scanner"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Take photos of your birds and get instant AI-powered health assessments. Detect early signs of disease before they spread to your entire flock."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(TZ,{className:"h-6 w-6 text-primary"})}),i.jsx(se,{children:"Predictive Analytics"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Our AI learns from patterns in your flock's behavior, feed consumption, and environmental data to predict potential health issues."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-warning/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(jc,{className:"h-6 w-6 text-warning"})}),i.jsx(se,{children:"Smart Alerts"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Receive instant notifications when the AI detects anomalies or potential health risks, allowing for immediate intervention."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(ll,{className:"h-6 w-6 text-secondary"})}),i.jsx(se,{children:"Disease Prevention"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Identify biosecurity risks and implement preventive measures based on AI recommendations to keep diseases out of your farm."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-success/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Wf,{className:"h-6 w-6 text-success"})}),i.jsx(se,{children:"Instant Diagnosis"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Get immediate diagnosis suggestions with confidence scores and recommended treatment protocols from veterinary experts."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Zs,{className:"h-6 w-6 text-accent"})}),i.jsx(se,{children:"Welfare Monitoring"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Continuous monitoring of animal welfare indicators ensures your birds are not just healthy, but thriving in optimal conditions."})})]})]})})}),i.jsx("section",{className:"py-20 px-6 bg-white",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-4xl font-bold mb-6",children:"How It Works"}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Simple, fast, and accurate health monitoring in three easy steps"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-primary rounded-full flex items-center justify-center mx-auto mb-6 text-white font-bold text-xl",children:"1"}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Capture"}),i.jsx("p",{className:"text-muted-foreground",children:"Take a photo of your bird using your smartphone camera through the Flockify app"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-accent rounded-full flex items-center justify-center mx-auto mb-6 text-white font-bold text-xl",children:"2"}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Analyze"}),i.jsx("p",{className:"text-muted-foreground",children:"Our AI instantly analyzes the image for signs of disease, stress, or health issues"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-secondary rounded-full flex items-center justify-center mx-auto mb-6 text-white font-bold text-xl",children:"3"}),i.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Act"}),i.jsx("p",{className:"text-muted-foreground",children:"Receive actionable recommendations and connect with veterinary experts if needed"})]})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-gradient-accent",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Protect Your Flock Today"}),i.jsx("p",{className:"text-xl text-white/90 mb-8 max-w-2xl mx-auto",children:"Join farmers who have reduced disease outbreaks by 70% using Flockify's AI health monitoring."}),i.jsx(U,{size:"lg",onClick:()=>window.location.href="/",className:"bg-white text-accent hover:bg-white/90",children:"Start Free Trial"})]})})]})}function N8e(){return i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:[i.jsx("header",{className:"bg-white border-b border-border shadow-sm",children:i.jsx("div",{className:"container mx-auto px-6 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>window.history.back(),children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back"]}),i.jsx("div",{className:"flex items-center space-x-3",children:i.jsx("img",{src:"/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png",alt:"Flockify Logo",className:"h-8 w-auto"})})]}),i.jsx(U,{onClick:()=>window.location.href="/",children:"Get Started"})]})})}),i.jsx("section",{className:"py-20 px-6",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("div",{className:"w-20 h-20 bg-secondary/10 rounded-2xl flex items-center justify-center mx-auto mb-8",children:i.jsx(Cd,{className:"h-10 w-10 text-secondary"})}),i.jsxs("h1",{className:"text-5xl font-bold mb-6",children:["Market ",i.jsx("span",{className:"text-secondary",children:"Access"})]}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"Connect directly with buyers, access fair pricing, and expand your market reach across the region. Break free from middlemen and maximize your profits."})]})}),i.jsx("section",{className:"py-20 px-6",children:i.jsx("div",{className:"container mx-auto",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(ht,{className:"h-6 w-6 text-secondary"})}),i.jsx(se,{children:"Direct Buyer Network"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Connect directly with restaurants, retailers, and consumers in your area. Build lasting relationships and secure repeat business."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Sc,{className:"h-6 w-6 text-primary"})}),i.jsx(se,{children:"Fair Pricing"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Access real-time market prices and receive fair value for your products. Transparent pricing ensures you're never shortchanged."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(ts,{className:"h-6 w-6 text-accent"})}),i.jsx(se,{children:"Local & Regional Markets"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Discover nearby markets and expand to new regions. Our platform helps you identify the best opportunities in your area."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-warning/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(WZ,{className:"h-6 w-6 text-warning"})}),i.jsx(se,{children:"Contract Farming"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Secure guaranteed sales with contract farming opportunities. Plan your production with confidence knowing you have buyers lined up."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-success/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Wt,{className:"h-6 w-6 text-success"})}),i.jsx(se,{children:"Market Intelligence"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Stay ahead with market trends, demand forecasts, and price predictions. Make informed decisions about when and where to sell."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Cd,{className:"h-6 w-6 text-secondary"})}),i.jsx(se,{children:"Export Opportunities"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Access international markets and export opportunities. Scale your business beyond local boundaries with our global network."})})]})]})})}),i.jsx("section",{className:"py-20 px-6 bg-white",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-4xl font-bold mb-6",children:"Market Impact"}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"See how our marketplace is transforming farmer livelihoods"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-primary mb-2",children:"40%"}),i.jsx("div",{className:"text-muted-foreground",children:"Higher Price
952s"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"vs traditional markets"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-secondary mb-2",children:"2,500+"}),i.jsx("div",{className:"text-muted-foreground",children:"Active Buyers"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"across the platform"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-accent mb-2",children:"95%"}),i.jsx("div",{className:"text-muted-foreground",children:"Payment Success"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"on-time payments"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-warning mb-2",children:"48hrs"}),i.jsx("div",{className:"text-muted-foreground",children:"Avg. Sale Time"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"from listing to sale"})]})})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-gradient-secondary",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Expand Your Market Today"}),i.jsx("p",{className:"text-xl text-white/90 mb-8 max-w-2xl mx-auto",children:"Join thousands of farmers earning 40% more by selling directly through our marketplace."}),i.jsx(U,{size:"lg",onClick:()=>window.location.href="/",className:"bg-white text-secondary hover:bg-white/90",children:"Start Selling Now"})]})})]})}const FG=()=>{const[e,t]=y.useState([]),[n,r]=y.useState([]),[s,a]=y.useState([]),[o,l]=y.useState(!0),{toast:c}=We(),u=async()=>{try{const{data:x,error:v}=await q.from("courses").select("*, course_modules(id)").eq("is_active",!0).order("created_at",{ascending:!1});if(v){console.error("Error fetching courses:",v),c({title:"Error",description:"Failed to load courses",variant:"destructive"});return}t(x||[])}catch(x){console.error("Courses fetch error:",x)}},d=async()=>{try{const{data:{user:x}}=await q.auth.getUser();if(!x)return;const{data:v,error:b}=await q.from("course_assignments").select("*").eq("farmer_id",x.id).order("assigned_at",{ascending:!1});if(b){console.error("Error fetching assignments:",b);return}r(v||[])}catch(x){console.error("Assignments fetch error:",x)}},h=async()=>{try{const{data:{user:x}}=await q.auth.getUser();if(!x)return;const{data:v,error:b}=await q.from("certificates").select("*").eq("user_id",x.id);if(b){console.error("Error fetching certificates:",b);return}a(v||[])}catch(x){console.error("Certificates fetch error:",x)}},f=async x=>{try{const v=e.find(S=>S.id===x);if(!v||v.course_type==="campus")return!1;const{data:{user:b}}=await q.auth.getUser();if(!b)return c({title:"Error",description:"Please log in to enroll in courses",variant:"destructive"}),!1;const{data:w}=await q.from("course_assignments").select("id").eq("course_id",x).eq("farmer_id",b.id).maybeSingle();if(w)return await d(),!0;const{error:j}=await q.from("course_assignments").insert({course_id:x,farmer_id:b.id,status:"assigned",progress:0});return j?(console.error("Error enrolling in course:",j),c({title:"Error",description:"Failed to enroll in course",variant:"destructive"}),!1):(c({title:"Success",description:"Successfully enrolled in course"}),await d(),!0)}catch(v){return console.error("Enrollment error:",v),!1}},m=async(x,v)=>{try{const{data:{user:b}}=await q.auth.getUser();if(!b)return c({title:"Error",description:"Please log in",variant:"destructive"}),null;const w=s.find(C=>C.course_id===v);if(w)return w.certificate_number;const{data:j}=await q.rpc("generate_certificate_number"),S=n.find(C=>C.id===x),N=(S==null?void 0:S.completed_at)||new Date().toISOString(),{data:k,error:_}=await q.from("certificates").insert({user_id:b.id,course_id:v,assignment_id:x,certificate_number:j||`CERT-${Date.now()}`,completion_date:N}).select().single();return _?(console.error("Error generating certificate:",_),c({title:"Error",description:"Failed to generate certificate",variant:"destructive"}),null):(await h(),c({title:"Success",description:"Certificate generated successfully!"}),k.certificate_number)}catch(b){return console.error("Certificate generation error:",b),null}},g=async(x,v)=>{try{const b=n.find(j=>j.id===x),{error:w}=await q.from("course_assignments").update({progress:v,started_at:v>0&&!(b!=null&&b.started_at)?new Date().toISOString():b==null?void 0:b.started_at,completed_at:v>
952=100?new Date().toISOString():null,status:v>=100?"completed":v>0?"in_progress":"assigned"}).eq("id",x);return w?(console.error("Error updating progress:",w),!1):(await d(),v>=100&&(b!=null&&b.course_id)&&await m(x,b.course_id),!0)}catch(b){return console.error("Progress update error:",b),!1}};return y.useEffect(()=>{(async()=>{l(!0),await Promise.all([u(),d(),h()]),l(!1)})();const{data:{subscription:v}}=q.auth.onAuthStateChange(b=>{b==="SIGNED_IN"?(d(),h()):b==="SIGNED_OUT"&&(r([]),a([]))});return()=>v.unsubscribe()},[]),{courses:e,assignments:n,certificates:s,loading:o,enrollInCourse:f,updateProgress:g,generateCertificate:m,getCertificateForCourse:x=>s.find(v=>v.course_id===x),refetch:()=>Promise.all([u(),d(),h()])}};function k8e(){const{courses:e,loading:t}=FG(),n=e.filter(r=>{var s;return r.course_type!=="campus"&&(((s=r.course_modules)==null?void 0:s.length)??0)>0});return i.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[i.jsx("header",{className:"border-b bg-card",children:i.jsxs("div",{className:"container mx-auto flex items-center justify-between gap-4 px-4 py-4",children:[i.jsx(U,{asChild:!0,variant:"ghost",size:"sm",children:i.jsxs(Ke,{to:"/",children:[i.jsx(jt,{className:"mr-2 h-4 w-4"}),"Back"]})}),i.jsx("img",{src:Ui,alt:"Flockify",className:"h-10 w-auto object-contain"})]})}),i.jsxs("main",{className:"container mx-auto max-w-6xl px-4 py-12 sm:py-20",children:[i.jsxs("div",{className:"mb-10 max-w-2xl",children:[i.jsx("h1",{className:"text-4xl font-bold tracking-tight sm:text-5xl",children:"Learn to grow your farm"}),i.jsx("p",{className:"mt-4 text-lg text-muted-foreground",children:"Explore practical, self-paced courses. Sign in to start lessons and track your progress."})]}),i.jsxs("div",{className:"mb-6 flex items-center justify-between gap-4",children:[i.jsx("h2",{className:"text-2xl font-semibold",children:"Available courses"}),i.jsx(U,{asChild:!0,children:i.jsx(Ke,{to:"/learning",children:"Open Learning Hub"})})]}),t?i.jsx("p",{className:"text-muted-foreground",children:"Loading coursesâ¦"}):n.length===0?i.jsx("p",{className:"text-muted-foreground",children:"No courses available right now. Check back soon."}):i.jsx("div",{className:"grid gap-5 md:grid-cols-2 lg:grid-cols-3",children:n.map(r=>{var s;return i.jsxs(z,{className:"flex flex-col",children:[i.jsx(re,{children:i.jsx(se,{className:"text-xl",children:r.title})}),i.jsxs(V,{className:"mt-auto space-y-4",children:[i.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),i.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(tn,{className:"h-4 w-4"}),(s=r.course_modules)==null?void 0:s.length," lessons"]}),i.jsx(U,{asChild:!0,className:"w-full",children:i.jsx(Ke,{to:`/learning?course=${r.id}`,children:"View course"})})]})]},r.id)})})]})]})}function _8e(){return i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:[i.jsx("header",{className:"bg-white border-b border-border shadow-sm",children:i.jsx("div",{className:"container mx-auto px-6 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>window.history.back(),children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back"]}),i.jsx("div",{className:"flex items-center space-x-3",children:i.jsx("img",{src:"/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png",alt:"Flockify Logo",className:"h-8 w-auto"})})]}),i.jsx(U,{onClick:()=>window.location.href="/",children:"Get Started"})]})})}),i.jsx("section",{className:"py-20 px-6",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("div",{className:"w-20 h-20 bg-accent/10 rounded-2xl flex items-center justify-center mx-auto mb-8",children:i.jsx(ht,{className:"h-10 w-10 text-accent"})}),i.jsxs("h1",{className:"text-5xl font-bold mb-6",children:["Mentorship ",i.jsx("span",{className:"text-accent",children:"Support"})]}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"Connecting youth with experienced farmers and industry experts for guidance, support, and knowledge sharing throughout their entrepreneurial journey."})]})}),i.jsx("section",{className:"py-20 px-6",children:i.jsx("div",{className:"container mx-auto",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(ht,{className:"h-6 w-6 text-accent"})}),i.jsx(se,{children:"Expert Mentors"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Connect with experienced farmers, veterinarians, and agricultural business experts who have successfully scaled their operations."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Ko,{className:"h-6 w-6 text-primary"})}),i.jsx(se,{children:"24/7 Chat Support"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Get instant answers to your questions through our chat platform. Your mentor is always just a message away when you need guidance."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(ri,{className:"h-6 w-6 text-secondary"})}),i.jsx(se,{children:"Weekly Video Calls"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Schedule regular video sessions with your mentor for in-depth discu
952ssions about your farm progress and challenges."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-warning/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(ys,{className:"h-6 w-6 text-warning"})}),i.jsx(se,{children:"Structured Program"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Follow a 6-month structured mentorship program designed to cover all aspects of successful livestock farming and business management."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-success/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Tu,{className:"h-6 w-6 text-success"})}),i.jsx(se,{children:"Progress Tracking"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Monitor your progress with milestone assessments and celebrate achievements with your mentor as you grow your farming skills."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Zs,{className:"h-6 w-6 text-accent"})}),i.jsx(se,{children:"Peer Community"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Connect with fellow young farmers in your mentorship cohort. Share experiences, challenges, and celebrate successes together."})})]})]})})}),i.jsx("section",{className:"py-20 px-6 bg-white",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-4xl font-bold mb-6",children:"Meet Our Mentors"}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Industry experts with decades of experience ready to guide your journey"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[i.jsxs(z,{className:"text-center p-8 glass-card",children:[i.jsx("div",{className:"w-20 h-20 bg-primary rounded-full mx-auto mb-6 flex items-center justify-center text-white text-2xl font-bold",children:"DR"}),i.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Dr. Sarah Adebayo"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"Veterinary Expert ⢠15 years experience"}),i.jsx("div",{className:"flex justify-center mb-4",children:[...Array(5)].map((e,t)=>i.jsx(Tu,{className:"h-4 w-4 fill-warning text-warning"},t))}),i.jsx("p",{className:"text-sm text-muted-foreground",children:'"Helping young farmers prevent disease outbreaks and optimize bird health."'})]}),i.jsxs(z,{className:"text-center p-8 glass-card",children:[i.jsx("div",{className:"w-20 h-20 bg-secondary rounded-full mx-auto mb-6 flex items-center justify-center text-white text-2xl font-bold",children:"JO"}),i.jsx("h3",{className:"text-xl font-semibold mb-2",children:"John Okonkwo"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"Commercial Farmer ⢠20 years experience"}),i.jsx("div",{className:"flex justify-center mb-4",children:[...Array(5)].map((e,t)=>i.jsx(Tu,{className:"h-4 w-4 fill-warning text-warning"},t))}),i.jsx("p",{className:"text-sm text-muted-foreground",children:'"Scaled from 50 to 10,000 birds. Now teaching others the same strategies."'})]}),i.jsxs(z,{className:"text-center p-8 glass-card",children:[i.jsx("div",{className:"w-20 h-20 bg-accent rounded-full mx-auto mb-6 flex items-center justify-center text-white text-2xl font-bold",children:"MK"}),i.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Mary Kimathi"}),i.jsx("p",{className:"text-muted-foreground mb-4",children:"Business Advisor ⢠12 years experience"}),i.jsx("div",{className:"flex justify-center mb-4",children:[...Array(5)].map((e,t)=>i.jsx(Tu,{className:"h-4 w-4 fill-warning text-warning"},t))}),i.jsx("p",{className:"text-sm text-muted-foreground",children:'"Specializing in agribusiness finance, marketing, and sustainable growth."'})]})]})]})}),i.jsx("section",{className:"py-20 px-6",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-4xl font-bold mb-6",children:"Mentorship Impact"}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Measuring the success of our mentorship programs"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-primary mb-2",children:"250+"}),i.jsx("div",{className:"text-muted-foreground",children:"Active Mentorships"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"ongoing relationships"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-secondary mb-2",children:"85%"}),i.jsx("div",{className:"text-muted-foreground",children:"Success Rate"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"farm profitability achieved"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-accent mb-2",children:"4.8/5"}),i.jsx("div",{className:"text-muted-foreground",children:"Satisfaction Rating"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"mentor program rating"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-warning mb-2",children:"6mo"}),i.jsx("div",{className:"text-muted-foreground",children:"Program Length"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"comprehensive support"})]})})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-gradient-accent",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Find Your Mentor Today"}),i.jsx("p",{className:"text-xl text-white/90 mb-8 max-w-2xl mx-auto",children:"Join 250+ young farmers already benefiting from expert mentorship and guidance."}),i.jsx(U,{size:"lg",onClick:()=>window.location.href="/",className:"bg-white text-accent hover:bg-white/90",children:"Apply for Mentorship"})]})})]})}function C8e(){return i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:[i.jsx("header",{className:"bg-white border-b border-border shadow-sm",children:i.jsx("div",{className:"container mx-auto px-6 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>window.history.back(),children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back"]}),i.jsx("div",{className:"flex items-center space-x-3",children:i.jsx("img",{src:"/lovable-uploads/28372015-7f4e-4fb1-9b7b-8abbe800eba9.png",alt:"Flockify Logo",className:"h-8 w-auto"})})]}),i.jsx(U,{onClick:()=>window.location.href="/",children:"Get Started"})]})})}),i.jsx("section",{className:"py-20 px-6",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("div",{className:"w-20 h-20 bg-secondary/10 rounded-2xl flex items-center justify-center mx-auto mb-8",children:i.jsx(Wt,{className:"h-10 w-10 text-secondary"})}),i.jsxs("h1",{className:"text-5xl font-bold mb-6",children:["Business ",i.jsx("span",{className:"text-secondary",children:"Development"})]}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",children:"Access to funding opportunities, market connections, and business development resources to help young farmers scale their operations sustainably."})]})}),i.jsx("section",{className:"py-20 px-6",children:i.jsx("div",{className:"container mx-auto",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Sc,{className:"h-6 w-6 text-secondary"})}),i.jsx(se,{children:"Funding Access"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Connect with microfinance institutions, angel investors, and government grants specifically designed for young agripreneurs."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Gb,{className:"h-6 w-6 text-primary"})}),i.jsx(se,{children:"Business Planning"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Develop comprehensive business plans with financial projections, market analysis, and growth strategies tailored to your farm."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-accent/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(OZ,{className:"h-6 w-6 text-accent"})}),i.jsx(se,{children:"Legal Support"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Get assistance with business registration, permits, contracts, and compliance with agricultural regulations."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-warning/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(ht,{className:"h-6 w-6 text-warning"})}),i.jsx(se,{children:"Market Connections"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Access our network of buyers, suppliers, and industry partners to establish profitable business relationships."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-success/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Xr,{className:"h-6 w-6 text-success"})}),i.jsx(se,{children:"Financial Management"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Learn essential financial skills including budgeting, cost analysis, profit optimization, and investment planning."})})]}),i.jsxs(z,{className:"bg-white glass-card",children:[i.jsxs(re,{children:[i.jsx("div",{className:"w-12 h-12 bg-secondary/10 rounded-lg flex items-center justify-center mb-4",children:i.jsx(Wt,{className:"h-6 w-6 text-secondary"})}),i.jsx(se,{children:"Scale-up Strategy"})]}),i.jsx(V,{children:i.jsx("p",{className:"text-muted-foreground",children:"Develop strategies for sustainable growth, including expansion planning, technology adoption, and operational optimization."})})]})]})})}),i.jsx("section",{className:"py-20 px-6 bg-white",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-4xl font-bold mb-6",children:"Funding Partners"}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"We've partnered with leading financial institutions to provide funding options"})]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-8 items-center",children:[i.jsxs(z,{className:"p-6 text-center glass-card",children:[i.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-lg mx-auto mb-4 flex items-center justify-center",children:i.jsx("span",{className:"text-sm font-bold text-primary",children:"AgriBank"})}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Microfinance"})]}),i.jsxs(z,{className:"p-6 text-center glass-card",children:[i.jsx("div",{className:"w-16 h-16 bg-secondary/10 rounded-lg mx-auto mb-4 flex items-center justify-center",children:i.jsx("span",{className:"text-sm font-bold text-secondary",children:"YouthFund"})}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Youth Grants"})]}),i.jsxs(z,{className:"p-6 text-center glass-card",children:[i.jsx("div",{className:"w-16 h-16 bg-accent/10 rounded-lg mx-auto mb-4 flex items-center justify-center",children:i.jsx("span",{className:"text-sm font-bold text-accent",children:"FarmInvest"})}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Angel Investors"})]}),i.jsxs(z,{className:"p-6 text-center glass-card",children:[i.jsx("div",{className:"w-16 h-16 bg-warning/10 rounded-lg mx-auto mb-4 flex items-center justify-center",children:i.jsx("span",{className:"text-sm font-bold text-warning",children:"GovGrants"})}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Government"})]})]})]})}),i.jsx("section",{className:"py-20 px-6",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-4xl font-bold mb-6",children:"Success Stories"}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Young entrepreneurs who've scaled their businesses with our support"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[i.jsxs(z,{className:"p-8 glass-card",children:[i.jsxs("div",{className:"text-center mb-6",children:[i.jsx("div",{className:"w-16 h-16 bg-primary rounded-full mx-auto mb-4 flex items-center justify-center text-white text-xl font-bold",children:"RM"}),i.jsx("h3",{className:"text-lg font-semibold",children:"Rebecca Masinga"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Gauteng Province"})]}),i.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:'"Started with 50 birds, now managing 800. The business development program helped me secure R25,000 funding to expand my operations."'}),i.jsx("div",{className:"text-primary font-semibold text-sm",children:"Revenue: R8K â R45K monthly"})]}),i.jsxs(z,{className:"p-8 glass-card",children:[i.jsxs("div",{className:"text-center mb-6",children:[i.jsx("div",{className:"w-16 h-16 bg-secondary rounded-full mx-auto mb-4 flex items-center justify-center text-white text-xl font-bold",children:"AM"}),i.jsx("h3",{className:"text-lg font-semibold",children:"Asanda Mazibuko"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"KwaZulu-Natal"})]}),i.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:'"The market connections program linked me with local restaurants. Now I supply 3 establishments with guaranteed weekly orders."'}),i.jsx("div",{className:"text-secondary font-semibold text-sm",children:"From R3K â R18K monthly sales"})]}),i.jsxs(z,{className:"p-8 glass-card",children:[i.jsxs("div",{className:"text-center mb-6",children:[i.jsx("div",{className:"w-16 h-16 bg-accent rounded-full mx-auto mb-4 flex items-center justify-center text-white text-xl font-bold",children:"MM"}),i.jsx("h3",{className:"text-lg font-semibold",children:"Mologadi Maleka"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Limpopo Province"})]}),i.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:'"The financial management training helped me optimize costs and increase profit margins by 25%. Now planning to double my flock size."'}),i.jsx("div",{className:"text-accent font-semibold text-sm",children:"Profit margin: 12% â 37%"})]})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-white",children:i.jsxs("div",{className:"container mx-auto",children:[i.jsxs("div",{className:"text-center mb-16",children:[i.jsx("h2",{className:"text-4xl font-bold mb-6",children:"Program Impact"}),i.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Measuring the success of our business development initiatives"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-primary mb-2",children:"R850K"}),i.jsx("div",{className:"text-muted-foreground",children:"Funding Secured"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"for beta tester
952s"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-secondary mb-2",children:"25+"}),i.jsx("div",{className:"text-muted-foreground",children:"Businesses Scaled"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"in beta program"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-accent mb-2",children:"35%"}),i.jsx("div",{className:"text-muted-foreground",children:"Revenue Growth"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"beta average"})]})}),i.jsx(z,{className:"text-center p-8 glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("div",{className:"text-4xl font-bold text-warning mb-2",children:"80%"}),i.jsx("div",{className:"text-muted-foreground",children:"Success Rate"}),i.jsx("div",{className:"text-sm text-muted-foreground mt-2",children:"early results"})]})})]})]})}),i.jsx("section",{className:"py-20 px-6 bg-gradient-secondary",children:i.jsxs("div",{className:"container mx-auto text-center",children:[i.jsx("h2",{className:"text-4xl font-bold text-white mb-6",children:"Scale Your Business Today"}),i.jsx("p",{className:"text-xl text-white/90 mb-8 max-w-2xl mx-auto",children:"Join 25+ young farmers in our beta program who are scaling their operations with our support."}),i.jsx(U,{size:"lg",onClick:()=>window.location.href="/",className:"bg-white text-secondary hover:bg-white/90",children:"Apply for Support"})]})})]})}const SP=e=>{const[t,n]=y.useState([]),[r,s]=y.useState(!0),{toast:a}=We(),o=async()=>{try{const{data:u,error:d}=await q.from("course_submissions").select("*").order("submitted_at",{ascending:!1});if(d){console.error("Error fetching submissions:",d);return}n(u||[])}catch(u){console.error("Submissions fetch error:",u)}finally{s(!1)}},l=async(u,d,h)=>{try{const{data:{user:f}}=await q.auth.getUser();if(!f)return a({title:"Error",description:"Please log in",variant:"destructive"}),!1;const{error:m}=await q.from("course_submissions").insert({assignment_id:u,student_id:f.id,content:d,file_url:h||null});return m?(console.error("Error submitting work:",m),a({title:"Error",description:"Failed to submit work",variant:"destructive"}),!1):(a({title:"Success",description:"Work submitted successfully!"}),await o(),!0)}catch(f){return console.error("Submit error:",f),!1}},c=async(u,d,h)=>{try{const{data:{user:f}}=await q.auth.getUser();if(!f)return!1;const{error:m}=await q.from("course_submissions").update({grade:d,feedback:h,graded_by:f.id,graded_at:new Date().toISOString()}).eq("id",u);return m?(console.error("Error grading submission:",m),a({title:"Error",description:"Failed to grade submission",variant:"destructive"}),!1):(a({title:"Success",description:"Submission graded successfully!"}),await o(),!0)}catch(f){return console.error("Grade error:",f),!1}};return y.useEffect(()=>{o()},[]),{submissions:t,loading:r,submitWork:l,gradeSubmission:c,refetch:o}};function BG({certificateNumber:e,courseName:t,userName:n,completionDate:r,showActions:s=!0}){const a=y.useRef(null),[o,l]=y.useState(!1),{toast:c}=We(),u=`${window.location.origin}/certificate/${encodeURIComponent(e)}`,d=new Date(r).toLocaleDateString("en-ZA",{year:"numeric",month:"long",day:"numeric"}),h=async()=>{if(a.current){l(!0);try{const[{default:m},{jsPDF:g}]=await Promise.all([Lm(()=>import("./html2canvas.esm-CBrSDip1.js"),[]),Lm(()=>import("./jspdf.es.min-0ikCHW-1.js"),[])]),p=await m(a.current,{scale:2,backgroundColor:null,useCORS:!0}),x=new g({orientation:"landscape",unit:"mm",format:"a4"}),v=x.internal.pageSize.getWidth(),b=x.internal.pageSize.getHeight(),w=Math.min(v/p.width,b/p.height),j=p.width*w,S=p.height*w;x.addImage(p.toDataURL("image/png"),"PNG",(v-j)/2,(b-S)/2,j,S),x.save(`Flockify-Certificate-${e}.pdf`)}catch(m){console.error(m),c({title:"Download failed",description:"Please try again.",variant:"destructive"})}finally{l(!1)}}},f=async()=>{const m=`I completed "${t}" on Flockify.`;try{navigator.share?await navigator.share({title:"My Flockify certificate",text:m,url:u}):(await navigator.clipboard.writeText(u),c({title:"Link copied",description:"Anyone with this link can verify your certificate."}))}catch{}};return i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{ref:a,className:"bg-foreground p-3 rounded-md",children:i.jsxs("div",{className:"relative bg-background border-2 border-primary px-6 py-10 sm:px-12 sm:py-12 text-center",children:[i.jsx("div",{className:"absolute inset-2 border border-primary/40 pointer-events-none"}),i.jsx("img",{src:Ui,alt:"Flockify",className:"mx-auto h-12 w-auto object-contain"}),i.jsx("p",{className:"mt-6 text-xs font-semibold uppercase tracking-[0.35em] text-muted-foreground",children:"Certificate of Completion"}),i.jsx("p",{className:"mt-6 text-sm text-muted-foreground",children:"This certifies that"}),i.jsx("p",{className:"mt-2 font-serif text-3xl sm:text-4xl font-bold text-foreground break-words",children:n}),i.jsx("div",{className:"mx-auto mt-3 h-1 w-24 bg-primary"}),i.jsx("p",{className:"mt-5 text-sm text-muted-foreground",children:"has successfully completed the course"}),i.jsx("p",{className:"mt-2 text-xl sm:text-2xl font-semibold text-foreground",children:t}),i.jsxs("div",{className:"mt-10 grid grid-cols-2 gap-6 text-left text-xs text-muted-foreground",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold text-foreground",children:d}),i.jsx("p",{className:"border-t border-border pt-1 mt-1",children:"Date completed"})]}),i.jsxs("div",{className:"text-right",children:[i.jsx("p",{className:"font-mono font-semibold text-foreground",children:e}),i.jsx("p",{className:"border-t border-border pt-1 mt-1",children:"Certificate number"})]})]}),i.jsxs("p",{className:"mt-6 flex items-center justify-center gap-1 text-[10px] text-muted-foreground",children:[i.jsx(Ad,{className:"h-3 w-3"})," Verify at ",window.location.host,"/certificate/",e]})]})}),s&&i.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[i.jsxs(U,{onClick:h,disabled:o,className:"gap-2",children:[i.jsx(qo,{className:"h-4 w-4"})," ",o?"Preparingâ¦":"Download PDF"]}),i.jsxs(U,{variant:"outline",onClick:f,className:"gap-2",children:[i.jsx(kB,{className:"h-4 w-4"})," Share"]})]})]})}
952const a5={notes:"Notes",slides:"Slides",handout:"Handout",worksheet:"Worksheet",reference:"Reference"};function zG({courseId:e,canManage:t=!1}){const[n,r]=y.useState([]),[s,a]=y.useState(!0),[o,l]=y.useState(!1),[c,u]=y.useState(null),[d,h]=y.useState(""),[f,m]=y.useState(""),[g,p]=y.useState("notes"),[x,v]=y.useState(null),[b,w]=y.useState(!1),{toast:j}=We(),S=async()=>{try{const{data:A,error:E}=await q.from("course_materials").select("*").eq("course_id",e).order("created_at",{ascending:!1});if(E){console.error("Error fetching materials:",E);return}r(A||[])}catch(A){console.error("Materials fetch error:",A)}finally{a(!1)}},N=()=>{h(""),m(""),v(null),p("notes"),u(null)},k=A=>{u(A.id),h(A.title),m(A.description||""),p(A.material_type),v(null),l(!0)},_=async()=>{if(d.trim()){w(!0);try{const{data:{user:A}}=await q.auth.getUser();if(!A)return;let E=null;if(x){const P=`${A.id}/${e}/${Date.now()}_${x.name}`,{error:$}=await q.storage.from("course-materials").upload(P,x);if($){console.error("Upload error:",$),j({title:"Error",description:"Failed to upload file",variant:"destructive"});return}const{data:R}=await q.storage.from("course-materials").createSignedUrl(P,60*60*24*365);E=(R==null?void 0:R.signedUrl)||null}if(c){const P={title:d.trim(),description:f.trim()||null,material_type:g};E&&(P.file_url=E);const{error:$}=await q.from("course_materials").update(P).eq("id",c);if($){j({title:"Error",description:"Failed to update material",variant:"destructive"});return}j({title:"Updated",description:"Material updated!"})}else{const{error:P}=await q.from("course_materials").insert({course_id:e,title:d.trim(),description:f.trim()||null,file_url:E,material_type:g,uploaded_by:A.id});if(P){j({title:"Error",description:"Failed to add material",variant:"destructive"});return}j({title:"Success",description:"Material added!"})}N(),l(!1),S()}catch(A){console.error("Upload material error:",A)}finally{w(!1)}}},C=async A=>{const{error:E}=await q.from("course_materials").delete().eq("id",A);E||(S(),j({title:"Deleted",description:"Material removed"}))};return y.useEffect(()=>{S()},[e]),s?i.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"Loading materials..."}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[i.jsx(En,{className:"h-5 w-5 text-primary"}),"Course Materials"]}),t&&i.jsxs(yt,{open:o,onOpenChange:A=>{l(A),A||N()},children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{size:"sm",className:"bg-green-600 hover:bg-green-700",children:[i.jsx(rn,{className:"h-4 w-4 mr-1"}),"Add Material"]})}),i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:c?"Edit Material":"Upload Course Material"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(ae,{placeholder:"Material title",value:d,onChange:A=>h(A.target.value),maxLength:200}),i.jsx(Yt,{placeholder:"Description (optional)",value:f,onChange:A=>m(A.target.value),rows:2,maxLength:500}),i.jsxs(Ye,{value:g,onValueChange:p,children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsx(qe,{children:Object.entries(a5).map(([A,E])=>i.jsx(oe,{value:A,children:E},A))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:c?"Replace File (optional)":"Attach File (optional)"}),i.jsx(ae,{type:"file",onChange:A=>{var E;return v(((E=A.target.files)==null?void 0:E[0])||null)},className:"mt-1"})]}),i.jsx(U,{onClick:_,disabled:b,className:"w-full bg-green-600 hover:bg-green-700",children:b?"Saving...":c?"Update Material":"Upload Material"})]})]})]})]}),n.length===0?i.jsx(z,{children:i.jsx(V,{className:"p-8 text-center text-muted-foreground",children:"No materials uploaded yet."})}):n.map(A=>i.jsx(z,{children:i.jsxs(V,{className:"p-4 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[i.jsx(En,{className:"h-8 w-8 text-green-600 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-medium",children:A.title}),A.description&&i.jsx("p",{className:"text-sm text-muted-foreground",children:A.description}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsx(ye,{variant:"outline",className:"text-xs capitalize",children:a5[A.material_type]||A.material_type}),i.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(A.created_at).toLocaleDateString("en-ZA")})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[A.file_url&&i.jsx(U,{variant:"outline",size:"sm",asChild:!0,children:i.jsxs("a",{href:A.file_url,target:"_blank",rel:"noopener noreferrer",children:[i.jsx(qo,{className:"h-4 w-4 mr-1"}),"Download"]})}),t&&i.jsxs(i.Fragment,{children:[i.jsx(U,{variant:"ghost",size:"icon",onClick:()=>k(A),children:i.jsx(wB,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx(U,{variant:"ghost",size:"icon",onClick:()=>C(A.id),children:i.jsx(cl,{className:"h-4 w-4 text-destructive"})})]})]})]})},A.id))]})}function nC({submissions:e,isLecturer:t=!1,onGrade:n}){const[r,s]=y.useState(null),[a,o]=y.useState(""),[l,c]=y.useState(""),u=async()=>
952{if(!r||!a||!n)return;const d=parseFloat(a);if(isNaN(d)||d<0||d>100)return;await n(r,d,l)&&(s(null),o(""),c(""))};return e.length===0?i.jsx(z,{children:i.jsxs(V,{className:"p-8 text-center text-muted-foreground",children:[i.jsx(En,{className:"h-12 w-12 mx-auto mb-3 opacity-50"}),i.jsx("p",{children:"No submissions yet."})]})}):i.jsxs("div",{className:"space-y-3",children:[e.map(d=>i.jsx(z,{className:d.graded_at?"border-l-4 border-l-green-500":"border-l-4 border-l-yellow-500",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("div",{className:"flex items-center gap-2 mb-1",children:d.graded_at?i.jsxs(ye,{className:"bg-green-100 text-green-800",children:[i.jsx(Dt,{className:"h-3 w-3 mr-1"}),"Graded: ",d.grade,"%"]}):i.jsxs(ye,{variant:"secondary",children:[i.jsx(js,{className:"h-3 w-3 mr-1"}),"Pending Review"]})}),d.content&&i.jsx("p",{className:"text-sm mt-2 whitespace-pre-wrap",children:d.content}),d.file_url&&i.jsxs("a",{href:d.file_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:underline flex items-center gap-1 mt-1",children:[i.jsx(En,{className:"h-3 w-3"})," View attached file"]}),d.feedback&&i.jsxs("div",{className:"mt-2 p-2 bg-muted rounded text-sm",children:[i.jsxs("p",{className:"font-medium text-xs text-muted-foreground mb-1 flex items-center gap-1",children:[i.jsx(Pm,{className:"h-3 w-3"})," Lecturer Feedback"]}),i.jsx("p",{children:d.feedback})]}),i.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Submitted: ",new Date(d.submitted_at).toLocaleString("en-ZA")]})]}),t&&!d.graded_at&&i.jsx(U,{size:"sm",variant:"outline",onClick:()=>s(d.id),children:"Grade"})]})})},d.id)),i.jsx(yt,{open:!!r,onOpenChange:()=>s(null),children:i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Grade Submission"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Grade (0-100)"}),i.jsx(ae,{type:"number",min:"0",max:"100",value:a,onChange:d=>o(d.target.value),placeholder:"Enter grade"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Feedback"}),i.jsx(Yt,{value:l,onChange:d=>c(d.target.value),placeholder:"Provide feedback to the student...",rows:3,maxLength:1e3})]}),i.jsx(U,{onClick:u,className:"w-full bg-green-600 hover:bg-green-700",children:"Submit Grade"})]})]})})]})}function E8e(){var W;const{courses:e,assignments:t,certificates:n,loading:r,enrollInCourse:s,getCertificateForCourse:a}=FG(),{profile:o}=Cr(),{submissions:l,submitWork:c}=SP(),[u]=eg(),[d,h]=y.useState(null),[f,m]=y.useState(!1),[g,p]=y.useState(""),[x,v]=y.useState(""),[b,w]=y.useState(null),[j,S]=y.useState(u.get("tab")||"browse"),[N,k]=y.useState(null),[_,C]=y.useState(void 0),[A,E]=y.useState(u.get("signin")==="1"),[P,$]=y.useState(!1),R=Ki(),L=u.get("course");y.useEffect(()=>{q.auth.getSession().then(({data:X})=>{var J;return C(((J=X.session)==null?void 0:J.user.id)??null)})},[]);const D=y.useCallback(()=>{window.location.href=L?`/learning?course=${L}`:"/learning"},[L]),I=e.filter(X=>X.course_type!=="campus"||t.some(J=>J.course_id===X.id)),M=I.filter(X=>{var J;return X.course_type!=="campus"&&(((J=X.course_modules)==null?void 0:J.length)??0)>0&&!t.some(G=>G.course_id===X.id)}),H=(o==null?void 0:o.user_type)==="learner",T=!!o&&!H,B=()=>t.filter(X=>X.status==="completed").length,Y=()=>{if(t.length===0)return 0;const X=t.reduce((J,G)=>J+(G.progress||0),0);return Math.round(X/t.length)},O=async()=>{$(!0);const{error:X}=await q.rpc("become_farmer");$(!1),X||(window.location.href="/")};return A&&_===null?i.jsxs("div",{children:[i.jsx("div",{className:"fixed top-3 left-3 z-20",children:i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>E(!1),children:[i.jsx(jt,{className:"h-4 w-4 mr-2"})," Back to courses"]})}),i.jsx(T2,{defaultUserType:"learner",defaultSignUp:!0,onAuthSuccess:D})]}):r||_===void 0?i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"animate-spin h-8 w-8 border-b-2 border-primary mx-auto"}),i.jsx("p",{className:"mt-2 text-muted-foreground",children:"Loading courses..."})]})}):i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsxs("header",{className:"bg-foreground text-background",children:[i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3 flex items-center justify-between gap-3",children:[i.jsxs(Ke,{to:"/learning",className:"flex items-center gap-2",children:[i.jsx("span",{className:"rounded-md bg-background px-2 py-1",children:i.jsx("img",{src:Ui,alt:"Flockify",className:"h-7 w-auto object-contain"})}),i.jsx("span",{className:"font-bold tracking-tight",children:"Learning Hub"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[T&&i.jsx(U,{asChild:!0,size:"sm",variant:"secondary",children:i.jsxs(Ke,{to:"/",children:[i.jsx(jt,{className:"h-4 w-4 mr-1"})," Back to my farm"]})}),H&&i.jsxs(U,{size:"sm",variant:"secondary",disabled:P,onClick:O,children:[i.jsx(Tm,{className:"h-4 w-4 mr-1"})," ",P?"Setting upâ¦":"Start my farm"]}),_?i.jsx(U,{size:"sm",variant:"ghost",className:"text-background hover:bg-background/10 hover:text-background",onClick:async()=>{await q.auth.signOut(),window.location.href="/learning"},children:i.jsx(vE,{className:"h-4 w-4"})}):i.jsx(U,{size:"sm",onClick:()=>E(!0),children:"Sign in / Join free"})]})]}),i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 pb-10",children:[i.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.3em] text-primary",children:"Flockify Learning Hub"}),i.jsx("h1",{className:"mt-2 text-3xl md:text-4xl font-bold",children:o?`Welcome back, ${((W=o.display_name)==null?void 0:W.split(" ")[0])||"learner"}`:"Learn livestock farming, at your pace"}),i.jsx("p",{className:"mt-2 max-w-2xl text-background/70",children:"Practical courses with a certificate when you finish. No farm needed to start."})]})]}),i.jsx("div",{className:"h-1 bg-primary"}),i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[_&&i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[i.jsx(z,{className:"border-l-4",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center",children:[i.jsx(tn,{className:"h-8 w-8 text-green-600"}),i.jsxs("div",{className:"ml-4",children:[i.jsx("p",{className:"text-2xl font-bold",children:I.length}),i.jsx("p",{className:"text-gray-600",children:"Available Courses"})]})]})})}),i.jsx(z,{className:"border-l-4",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center",children:[i.jsx(ht,{className:"h-8 w-8 text-blue-600"}),i.jsxs("div",{className:"ml-4",children:[i.jsx("p",{className:"text-2xl font-bold",children:t.length}),i.jsx("p",{className:"text-gray-600",children:"Enrolled Courses"})]})]})})}),i.jsx(z,{className:"border-l-4",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center",children:[i.jsx(Fr,{className:"h-8 w-8 text-yellow-600"}),i.jsxs("div",{className:"ml-4",children:[i.jsx("p",{className:"text-2xl font-bold",children:B()}),i.jsx("p",{className:"text-gray-600",children:"Completed"})]})]})})}),i.jsx(z,{className:"border-l-4",children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center",children:[i.jsx(Wt,{className:"h-8 w-8 text-purple-600"}),i.jsxs("div",{className:"ml-4",children:[i.jsxs("p",{className:"text-2xl font-bold",children:[Y(),"%"]}),i.jsx("p",{className:"text-gray-600",children:"Avg Progress"})]})]})})})]}),i.jsxs(Bc,{value:j,onValueChange:S,className:"space-y-6",children:[i.jsx(jl,{className:"flex w-full h-auto overflow-x-auto justify-start bg-muted",children:[["browse","Browse"],["my-courses","My Courses"],["certificates","Certificates"],..._?[["completed","Completed"],["assignments","Assignments"],["materials","Materials"]]:[]].map(([X,J])=>i.jsx(pt,{value:X,className:"data-[state=active]:bg-primary data-[state=active]:text-primary-foreground text-xs sm:text-sm px-2 flex-1",children:J},X))}),i.jsx(tt,{value:"browse",className:"space-y-4",children:M.length===0?i.jsx("div",{className:"py-10 text-center text-muted-foreground",children:"No new courses available right now."}):i.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:M.map(X=>{var J;return i.jsxs(z,{className:`flex flex-col ${X.id===L?"ring-2 ring-primary":""}`,children:[i.jsxs(re,{children:[i.jsx(se,{className:"text-lg",children:X.title}),i.jsx("p",{className:"text-sm text-muted-foreground",children:X.description})]}),i.jsxs(V,{className:"mt-auto flex items-center justify-between gap-3",children:[i.jsxs("span",{className:"text-xs text-muted-foreground capitalize",children:[(J=X.course_modules)==null?void 0:J.length," lessons · ",X.difficulty_level||"Self-paced"]}),i.jsx(U,{disabled:N===X.id,onClick:async()=>
952{if(!_){R(`/learning?signin=1&course=${X.id}`,{replace:!0}),E(!0);return}k(X.id);const G=await s(X.id);k(null),G&&R(`/learning/course/${X.id}`)},children:N===X.id?"Enrollingâ¦":"Start course"})]})]},X.id)})})}),i.jsx(tt,{value:"my-courses",className:"space-y-6",children:t.length===0?i.jsx(z,{children:i.jsxs(V,{className:"p-12 text-center",children:[i.jsx(tn,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),i.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"No enrolled courses"}),i.jsx("p",{className:"text-gray-600 mb-6",children:"Start learning by enrolling in your first course!"}),i.jsx(U,{onClick:()=>S("browse"),children:"Browse Courses"})]})}):i.jsx("div",{className:"space-y-4",children:t.map(X=>{var G;const J=I.find(ce=>ce.id===X.course_id);return J?i.jsx(z,{children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold",children:J.title}),i.jsx("p",{className:"text-gray-600 text-sm",children:J.description}),i.jsxs("div",{className:"mt-3 flex items-center space-x-4",children:[i.jsx(ye,{variant:X.status==="completed"?"default":"secondary",children:(G=X.status)==null?void 0:G.replace("_"," ")}),i.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[i.jsx(js,{className:"h-4 w-4 mr-1"}),i.jsxs("span",{children:["Due:"," ",X.due_date?new Date(X.due_date).toLocaleDateString():"No deadline"]})]})]})]}),i.jsxs("div",{className:"sm:ml-6 sm:text-right shrink-0",children:[i.jsxs("div",{className:"text-2xl font-bold",children:[X.progress||0,"%"]}),i.jsx(rr,{value:X.progress||0,className:"w-24 h-2 mt-2"}),i.jsxs(U,{size:"sm",className:"mt-3",onClick:()=>R(`/learning/course/${J.id}`),children:[i.jsx(bE,{className:"h-4 w-4 mr-2"}),"Continue"]})]})]})})},X.id):null})})}),i.jsx(tt,{value:"certificates",className:"space-y-6",children:_?n.length===0?i.jsx(z,{children:i.jsxs(V,{className:"p-12 text-center",children:[i.jsx(Fr,{className:"h-14 w-14 text-muted-foreground mx-auto mb-4"}),i.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No certificates yet"}),i.jsx("p",{className:"text-muted-foreground",children:"Finish every lesson in a course to earn your certificate."})]})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(X=>{const J=e.find(G=>G.id===X.course_id);return i.jsx(z,{className:"border-t-4 border-t-primary",children:i.jsxs(V,{className:"p-6 space-y-3",children:[i.jsx(Fr,{className:"h-8 w-8 text-primary"}),i.jsx("h3",{className:"font-semibold text-lg",children:(J==null?void 0:J.title)||"Course"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:["Completed ",new Date(X.completion_date).toLocaleDateString("en-ZA")," · ",i.jsx("span",{className:"font-mono",children:X.certificate_number})]}),i.jsx(U,{className:"w-full",onClick:()=>h({course:J,certificate:X,assignment:{completed_at:X.completion_date}}),children:"View & download"})]})},X.id)})}):i.jsx(z,{children:i.jsxs(V,{className:"p-12 text-center space-y-4",children:[i.jsx(Fr,{className:"h-14 w-14 text-primary mx-auto"}),i.jsx("p",{className:"text-muted-foreground",children:"Sign in to see your certificates."}),i.jsx(U,{onClick:()=>E(!0),children:"Sign in / Join free"})]})})}),i.jsx(tt,{value:"completed",className:"space-y-6",children:t.filter(X=>X.status==="completed").length===0?i.jsx(z,{children:i.jsxs(V,{className:"p-12 text-center",children:[i.jsx(Fr,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),i.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"No completed courses yet"}),i.jsx("p",{className:"text-gray-600",children:"Complete your first course to see it here!"})]})}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.filter(X=>X.status==="completed").map(X=>{const J=e.find(ce=>ce.id===X.course_id);if(!J)return null;const G=a(J.id);return i.jsxs(z,{className:"border-green-200",children:[i.jsx(re,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(se,{className:"text-lg",children:J.title}),i.jsx(Dt,{className:"h-6 w-6 text-green-600"})]})}),i.jsxs(V,{children:[i.jsx("p",{className:"text-gray-600 text-sm mb-4",children:J.description}),i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx(ye,{className:"bg-green-100 text-green-800",children:"Completed"}),i.jsx("span",{className:"text-sm text-gray-500",children:X.completed_at&&new Date(X.completed_at).toLocaleDateString()})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(U,{variant:"outline",className:"flex-1",onClick:()=>R(`/learning/course/${J.id}`),children:[i.jsx(tn,{className:"h-4 w-4 mr-2"}),"Review Course"]}),G?i.jsxs(U,{className:"flex-1",onClick:()=>h({course:J,certificate:G,assignment:X}
952),children:[i.jsx(Fr,{className:"h-4 w-4 mr-2"}),"View Certificate"]}):i.jsxs(U,{className:"flex-1",onClick:()=>R(`/learning/course/${J.id}`),children:[i.jsx(tn,{className:"h-4 w-4 mr-2"})," Review lessons"]})]})]})]},X.id)})})}),i.jsxs(tt,{value:"assignments",className:"space-y-6",children:[i.jsx("div",{className:"flex items-center justify-between",children:i.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[i.jsx(En,{className:"h-5 w-5 text-green-600"}),"My Assignments & Submissions"]})}),t.filter(X=>X.due_date||X.assigned_by).length===0?i.jsx(z,{children:i.jsxs(V,{className:"p-12 text-center",children:[i.jsx(En,{className:"h-16 w-16 text-muted-foreground/50 mx-auto mb-4"}),i.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No assignments yet"}),i.jsx("p",{className:"text-muted-foreground",children:"Your lecturer-assigned tasks will appear here."})]})}):i.jsx("div",{className:"space-y-4",children:t.filter(X=>X.due_date||X.assigned_by).map(X=>{var le;const J=e.find(he=>he.id===X.course_id);if(!J)return null;const G=l.filter(he=>he.assignment_id===X.id),ce=G.length>0,ee=G.some(he=>he.graded_at);return i.jsx(z,{className:"border-l-4 border-l-green-600",children:i.jsxs(V,{className:"p-6",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-semibold text-lg",children:J.title}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:X.notes||J.description}),i.jsxs("div",{className:"flex items-center gap-3 mt-3",children:[X.due_date&&i.jsxs(ye,{variant:"outline",className:"text-xs",children:[i.jsx(js,{className:"h-3 w-3 mr-1"}),"Due: ",new Date(X.due_date).toLocaleDateString("en-ZA")]}),ee?i.jsxs(ye,{className:"bg-green-100 text-green-800",children:[i.jsx(Dt,{className:"h-3 w-3 mr-1"}),"Graded: ",(le=G.find(he=>he.graded_at))==null?void 0:le.grade,"%"]}):ce?i.jsxs(ye,{variant:"secondary",children:[i.jsx(js,{className:"h-3 w-3 mr-1"}),"Submitted â Pending Review"]}):i.jsx(ye,{variant:"destructive",className:"text-xs",children:"Not Submitted"})]})]}),!ce&&i.jsxs(U,{size:"sm",className:"bg-green-600 hover:bg-green-700",onClick:()=>{p(X.id),m(!0)},children:[i.jsx(Ed,{className:"h-4 w-4 mr-1"}),"Submit Work"]})]}),G.length>0&&i.jsx("div",{className:"mt-4",children:i.jsx(nC,{submissions:G})})]})},X.id)})})]}),i.jsxs(tt,{value:"materials",className:"space-y-6",children:[i.jsxs("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[i.jsx(tn,{className:"h-5 w-5 text-green-600"}),"Course Materials & Notes"]}),t.length===0?i.jsx(z,{children:i.jsxs(V,{className:"p-12 text-center",children:[i.jsx(tn,{className:"h-16 w-16 text-muted-foreground/50 mx-auto mb-4"}),i.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No materials available"}),i.jsx("p",{className:"text-muted-foreground",children:"Enroll in courses to access materials."})]})}):i.jsx("div",{className:"space-y-6",children:[...new Set(t.map(X=>X.course_id))].map(X=>{const J=e.find(G=>G.id===X);return J?i.jsxs("div",{children:[i.jsxs("h3",{className:"font-semibold mb-3 flex items-center gap-2",children:[i.jsx(Oa,{className:"h-4 w-4 text-green-600"}),J.title]}),i.jsx(zG,{courseId:X,canManage:!1})]},X):null})})]})]}),i.jsx(yt,{open:f,onOpenChange:m,children:i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Submit Your Work"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(Yt,{placeholder:"Write your answer or describe your submission...",value:x,onChange:X=>v(X.target.value),rows:5,maxLength:5e3}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Attach File (optional)"}),i.jsx(ae,{type:"file",onChange:X=>{var J;return w(((J=X.target.files)==null?void 0:J[0])||null)},className:"mt-1"})]}),i.jsxs(U,{className:"w-full bg-green-600 hover:bg-green-700",onClick:async()=>{if(!x.trim())return;let X;if(b){const{data:{user:G}}=await q.auth.getUser();if(G){const ce=`${G.id}/submissions/${Date.now()}_${b.name}`,{error:ee}=await q.storage.from("course-materials").upload(ce,b);if(!ee){const{data:le}=await q.storage.from("course-materials").createSignedUrl(ce,31536e3);X=(le==null?void 0:le.signedUrl)||void 0}}}await c(g,x.trim(),X)&&(m(!1),v(""),w(null))},children:[i.jsx(Ed,{className:"h-4 w-4 mr-2"}),"Submit"]})]})]})})]}),i.jsx(yt,{open:!!d,onOpenChange:()=>h(null),children:i.jsxs(mt,{className:"max-w-3xl",children:[i.jsx(xt,{children:i.jsx(vt,{children:"Course Completion Certificate"})}),d&&i.jsx(BG,{certificateNumber:d.certificate.certificate_number,courseName:d.course.title,userName:(o==null?void 0:o.display_name)||"Student",completionDate:d.assignment.completed_at})]})})]})}var A8e="Separator",o5="horizontal",P8e=["horizontal","vertical"],UG=y.forwardRef((e,t)=>
952{const{decorative:n,orientation:r=o5,...s}=e,a=T8e(r)?r:o5,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return i.jsx(ve.div,{"data-orientation":a,...l,...s,ref:t})});UG.displayName=A8e;function T8e(e){return P8e.includes(e)}var VG=UG;const WG=y.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>i.jsx(VG,{ref:s,decorative:n,orientation:t,className:fe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));WG.displayName=VG.displayName;const $1=[{id:"1",question:"How do I add a new flock to my farm?",answer:"Navigate to the Flock tab and click 'Add New Flock'. Fill in the required information including flock name, bird type, and initial count.",category:"Flock Management"},{id:"2",question:"How can I track my birds' health status?",answer:"Use the Health Scanner feature in the main dashboard. You can upload photos for AI analysis or manually update health records.",category:"Health Monitoring"},{id:"3",question:"Where can I find feed calculation tools?",answer:"The Feed Calculator is available in the Flock management section. It helps calculate optimal feed amounts based on your flock size and bird age.",category:"Feed Management"},{id:"4",question:"How do I access the marketplace?",answer:"Click on the Market tab in the bottom navigation to browse products, services, and connect with suppliers.",category:"Marketplace"},{id:"5",question:"How can I track my farm's financial performance?",answer:"Use the Finance tab to monitor income, expenses, and generate profit reports. You can also set financial goals and track progress.",category:"Financial Management"},{id:"6",question:"What compliance requirements do I need to track?",answer:"Check the Legal/Compliance section for region-specific requirements including licenses, health certificates, and regulatory compliance.",category:"Compliance"}];function O8e(){const[e,t]=y.useState(""),[n,r]=y.useState("All"),[s,a]=y.useState(null),[o,l]=y.useState({subject:"",description:"",priority:"medium"}),[c]=y.useState([{id:"1",subject:"Feed calculator not working properly",status:"open",priority:"high",created_at:"2024-01-15"},{id:"2",subject:"Question about flock health tracking",status:"resolved",priority:"medium",created_at:"2024-01-10"}]),{toast:u}=We(),d=["All",...Array.from(new Set($1.map(x=>x.category)))],h=$1.filter(x=>{const v=x.question.toLowerCase().includes(e.toLowerCase())||x.answer.toLowerCase().includes(e.toLowerCase()),b=n==="All"||x.category===n;return v&&b}),f=async x=>{x.preventDefault();try{const{data:{user:v}}=await q.auth.getUser();if(!v){u({title:"Authentication Required",description:"Please log in to submit a support ticket",variant:"destructive"});return}u({title:"Support Ticket Created",description:"Your support ticket has been submitted. We'll get back to you soon!"}),l({subject:"",description:"",priority:"medium"})}catch(v){console.error("Error submitting ticket:",v),u({title:"Error",description:"Failed to submit support ticket",variant:"destructive"})}},m=x=>{switch(x){case"open":return"bg-red-500/10 text-red-500 border-red-500/20";case"in-progress":return"bg-yellow-500/10 text-yellow-500 border-yellow-500/20";case"resolved":return"bg-green-500/10 text-green-500 border-green-500/20";default:return"bg-muted text-muted-foreground"}},g=x=>{switch(x){case"high":return"bg-red-500/10 text-red-500 border-red-500/20";case"medium":return"bg-yellow-500/10 text-yellow-500 border-yellow-500/20";case"low":return"bg-green-500/10 text-green-500 border-green-500/20";default:return"bg-muted text-muted-foreground"}},p={"@context":"https://schema.org","@type":"FAQPage",mainEntity:$1.map(x=>({"@type":"Question",name:x.question,acceptedAnswer:{"@type":"Answer",text:x.answer}}))};return i.jsxs("div",{className:"min-h-screen bg-gradient-bg pb-20 relative aurora-blobs",children:[i.jsx(u0,{title:"Help Center â Flockify Supp
952ort & FAQs",description:"Find answers about flock management, AI health scanning, marketplace, finance and compliance on Flockify.",path:"/help",jsonLd:p}),i.jsx("div",{className:"bg-card/80 border-b border-border/50 shadow-sm backdrop-blur-lg sticky top-0 z-40",children:i.jsx("div",{className:"flex items-center justify-between p-4",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx(Ke,{to:"/",children:i.jsx(U,{variant:"ghost",size:"icon",className:"hover:bg-accent/20",children:i.jsx(jt,{className:"h-5 w-5"})})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-xl font-bold",children:"Help Center"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Get support and find answers"})]})]})})}),i.jsxs("div",{className:"p-4 space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsx(z,{className:"hover:shadow-md transition-shadow cursor-pointer glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx(cO,{className:"h-8 w-8 mx-auto mb-2 text-primary"}),i.jsx("h3",{className:"font-semibold",children:"Browse FAQs"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Find quick answers"})]})}),i.jsx(z,{className:"hover:shadow-md transition-shadow cursor-pointer glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx(Ko,{className:"h-8 w-8 mx-auto mb-2 text-primary"}),i.jsx("h3",{className:"font-semibold",children:"Contact Support"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Get personalized help"})]})}),i.jsx(z,{className:"hover:shadow-md transition-shadow cursor-pointer glass-card",children:i.jsxs(V,{className:"p-4 text-center",children:[i.jsx(ri,{className:"h-8 w-8 mx-auto mb-2 text-primary"}),i.jsx("h3",{className:"font-semibold",children:"Call Us"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Speak with an expert"})]})})]}),i.jsxs(Bc,{defaultValue:"faq",className:"space-y-6",children:[i.jsxs(jl,{className:"grid w-full grid-cols-3",children:[i.jsx(pt,{value:"faq",children:"Frequently Asked"}),i.jsx(pt,{value:"contact",children:"Contact Support"}),i.jsx(pt,{value:"tickets",children:"My Tickets"})]}),i.jsxs(tt,{value:"faq",className:"space-y-6",children:[i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-4 space-y-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx(Qp,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),i.jsx(ae,{placeholder:"Search for answers...",value:e,onChange:x=>t(x.target.value),className:"pl-10"})]}),i.jsx("div",{className:"flex flex-wrap gap-2",children:d.map(x=>i.jsx(U,{variant:n===x?"default":"outline",size:"sm",onClick:()=>r(x),children:x},x))})]})}),i.jsxs("div",{className:"space-y-4",children:[h.map(x=>i.jsx(z,{className:"overflow-hidden glass-card",children:i.jsxs(V,{className:"p-0",children:[i.jsx("button",{onClick:()=>a(s===x.id?null:x.id),className:"w-full p-4 text-left hover:bg-accent/20 transition-colors",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"font-semibold",children:x.question}),i.jsx(ye,{variant:"outline",className:"mt-1",children:x.category})]}),s===x.id?i.jsx(gE,{className:"h-5 w-5"}):i.jsx(Qs,{className:"h-5 w-5"})]})}),s===x.id&&i.jsxs("div",{className:"px-4 pb-4",children:[i.jsx(WG,{className:"mb-3"}),i.jsx("p",{className:"text-muted-foreground",children:x.answer})]})]})},x.id)),h.length===0&&i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-8 text-center",children:[i.jsx(cO,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No FAQs Found"}),i.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search or contact support for help."})]})})]})]}),i.jsx(tt,{value:"contact",className:"space-y-6",children:i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Submit a Support Ticket"})}),i.jsx(V,{children:i.jsxs("form",{onSubmit:f,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Subject"}),i.jsx(ae,{value:o.subject,onChange:x=>l(v=>({...v,subject:x.target.value})),placeholder:"Brief description of your issue",required:!0})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Priority"}),i.jsxs("select",{value:o.priority,onChange:x=>l(v=>({...v,priority:x.target.value})),className:"w-full p-2 border border-border rounded-md bg-background",children:[i.jsx("option",{value:"low",children:"Low"}),i.jsx("option",{value:"medium",children:"Medium"}),i.jsx("option",{value:"high",children:"High"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Description"}),i.jsx(Yt,{value:o.description,onChange:x=>l(v=>({...v,description:x.target.value})),placeholder:"Provide detailed information about your issue...",rows:4,required:!0})]}),i.jsxs(U,{type:"submit",className:"w-full",children:[i.jsx(Ed,{className:"h-4 w-4 mr-2"}),"Submit Ticket"]})]})})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Other Ways to Reach Us"})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 p-3 border border-border rounded-lg",children:[i.jsx(Ua,{className:"h-5 w-5 text-primary"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Email Support"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"[email protected]"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Response within 24 hours"})]})]}),i.jsxs("div",{className:"flex items-center space-x-3 p-3 border border-border rounded-lg",children:[i.jsx(ri,{className:"h-5 w-5 text-primary"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Phone Support"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"+1 (555) 123-4567"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Mon-Fri, 9AM-6PM EST"})]})]}),i.jsxs("div",{className:"flex items-center space-x-3 p-3 border border-border rounded-lg",children:[i.jsx(Ko,{className:"h-5 w-5 text-primary"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:"Live Chat"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Available 24/7"}),i.jsx(U,{size:"sm",className:"mt-2",children:"Start Chat"})]})]})]})]})]})}),i.jsx(tt,{value:"tickets",className:"space-y-6",children:i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{children:"Your Support Tickets"})}),i.jsx(V,{children:c.length>0?i.jsx("div",{className:"space-y-4",children:c.map(x=>i.jsxs("div",{className:"p-4 border border-border rounded-lg",children:[i.jsxs("div",{className:"flex items-start justify-between mb-2",children:[i.jsx("h3",{className:"font-semibold",children:x.subject}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ye,{className:g(x.priority),children:x.priority}),i.jsx(ye,{className:m(x.status),children:x.status})]})]}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Created: ",new Date(x.created_at).toLocaleDateString()]})]},x.id))}):i.jsxs("div",{className:"text-center py-8",children:[i.jsx(Ko,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No Support Tickets"}),i.jsx("p",{className:"text-muted-foreground",children:"You haven't submitted any supp
952ort tickets yet."})]})})]})})]})]})]})}function R8e(e){return e.is_required!==!1}function M8e(e){const{assignmentId:t,courseId:n}=e,[r,s]=y.useState([]),[a,o]=y.useState([]),[l,c]=y.useState(!0),u=y.useMemo(()=>{const v=new Map;for(const b of a)v.set(b.module_id,b);return v},[a]),d=y.useMemo(()=>r.filter(R8e),[r]),h=y.useMemo(()=>{if(d.length===0)return 0;const v=d.filter(b=>{var w;return(w=u.get(b.id))==null?void 0:w.is_completed}).length;return Math.round(v/d.length*100)},[u,d]),f=y.useCallback(async()=>{if(!n)return;const{data:v,error:b}=await q.from("course_modules").select("*").eq("course_id",n).order("module_order",{ascending:!0});if(b)throw b;s(v||[])},[n]),m=y.useCallback(async()=>{if(!t)return;const{data:v,error:b}=await q.from("module_progress").select("*").eq("assignment_id",t);if(b)throw b;o(v||[])},[t]),g=y.useCallback(async v=>{if(!t)return;const b=typeof v=="number"?v:h,w=new Date().toISOString(),{data:j,error:S}=await q.from("course_assignments").select("id, started_at").eq("id",t).single();if(S)throw S;const N=b>0&&!(j!=null&&j.started_at)?w:(j==null?void 0:j.started_at)??null,k=b>=100?w:null,_=b>=100?"completed":b>0?"in_progress":"assigned",{error:C}=await q.from("course_assignments").update({progress:b,started_at:N,completed_at:k,status:_}).eq("id",t);if(C)throw C},[t,h]),p=y.useCallback(async(v,b)=>{if(!t)return;const{error:w}=await q.from("module_progress").upsert({assignment_id:t,module_id:v,is_completed:b,completed_at:b?new Date().toISOString():null},{onConflict:"assignment_id,module_id"});if(w)throw w;const[{data:j},S]=await Promise.all([q.from("module_progress").select("module_id,is_completed").eq("assignment_id",t),m()]),N=new Map;(j||[]).forEach(C=>N.set(C.module_id,!!C.is_completed));const k=d.filter(C=>N.get(C.id)).length,_=d.length===0?0:Math.round(k/d.length*100);await g(_)},[t,m,d,g]),x=y.useCallback(async()=>{c(!0);try{await Promise.all([f(),m()])}finally{c(!1)}},[f,m]);return y.useEffect(()=>{x()},[x]),{modules:r,progressByModuleId:u,requiredModules:d,percentComplete:h,loading:l,toggleModule:p,syncAssignmentProgress:g,refetch:x}}function I8e(e){const{moduleId:t,assignmentId:n,completed:r,onPassed:s,onNoQuiz:a}=e,[o,l]=y.useState(null),[c,u]=y.useState([]),[d,h]=y.useState(null),[f,m]=y.useState(!1);if(y.useEffect(()=>{h(null),l(null),q.from("module_quizzes").select("questions").eq("module_id",t).maybeSingle().then(({data:p})=>{const x=(p==null?void 0:p.questions)??[];l(x),u(x.map(()=>null)),a(x.length>0)})},[t]),!o||o.length===0)return null;const g=async()=>{if(!n)return;m(!0);const{data:p,error:x}=await q.rpc("submit_quiz",{_assignment_id:n,_module_id:t,_answers:c.map(b=>b??-1)});if(m(!1),x)return;const v=p;h({score:v.score,passed:v.passed,answers:v.answers}),v.passed&&await s()};return i.jsxs(z,{className:"border-primary/40",children:[i.jsxs(re,{className:"pb-3",children:[i.jsx(se,{className:"text-base",children:"Lesson quiz"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:r?"You have passed this lesson. You can retake the quiz to practise.":"Score 70% or more to complete this lesson."})]}),i.jsxs(V,{className:"space-y-5",children:[o.map((p,x)=>i.jsxs("div",{className:"space-y-2",children:[i.jsxs("p",{className:"text-sm font-medium text-foreground",children:[x+1,". ",p.q]}),i.jsx("div",{className:"grid gap-2",children:p.options.map((v,b)=>{var S;const w=c[x]===b,j=((S=d==null?void 0:d.answers)==null?void 0:S[x])===b;return i.jsx("button",{type:"button",onClick:()=>{u(N=>N.map((k,_)=>_===x?b:k)),h(null)},className:`text-left text-sm rounded-md border px-3 py-2 transition-colors ${j?"border-primary bg-primary/15":w?"border-foreground bg-muted":"border-border hover:bg-muted/50"}`,children:v},b)})})]},x)),d&&i.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${d.passed?"text-foreground":"text-destructive"}`,children:[d.passed?i.jsx(qr,{className:"h-4 w-4 text-primary"}):i.jsx(Jp,{className:"h-4 w-4"}),d.passed?`Passed with ${d.score}%. Lesson complete.`:`You scored ${d.score}%. Re-read the lesson and try again.`]}),i.jsx(U,{onClick:g,disabled:f||c.some(p=>p===null)||!n,children:f?"Checkingâ¦":"Submit answers"})]})]})}function $8e(e){return e.replace(/^#{1,6}\s*/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/\[(.*?)\]\((.*?)\)/g,"$1").replace(/^\s*[-*]\s+/gm,"⢠")}async function L8e(e,t,n){const{jsPDF:r}=await Lm(async()=>{const{jsPDF:f}=await import("./jspdf.es.min-0ikCHW-1.js");return{jsPDF:f}},[]),s=new r({unit:"mm",format:"a4"}),a=18,o=s.internal.pageSize.getWidth()-a*2,l=s.internal.pageSize.getHeight();let c=a;const u=(f,m=11,g=!1,p=2)=>{s.setFont("helvetica",g?"bold":"normal"),s.setFontSize(m);const x=s.splitTextToSize(f,o);for(const v of x)c>l-a&&(s.addPage(),c=a),s.text(v,a,c),c+=m*.45;c+=p},d=(f,m,g)=>{!Array.isArray(m)||m.length===0||(c+=2,u(f,13,!0),m.forEach((p,x)=>u(`${g(x)} ${String(p)}`,11,!1,1)))};u("FLOCKIFY LEARNING HUB",9,!0,1),u(e,10,!1,3),u(t,18,!0,4);const h=(n==null?void 0:n.lesson)||(n==null?void 0:n.content)||(n==null?void 0:n.summary);typeof h=="string"&&u($8e(h),11,!1,3),d("Key points",n==null?void 0:n.bullets,()=>"â¢"),d("Action steps",n==null?void 0:n.steps,f=>`${f+1}.`),d("Checklist",n==null?void 0:n.checklist,()=>"[ ]"),s.save(`${t.replace(/[^a-z0-9]+/gi,"-")}-notes.pdf`)}function D8e(e){const{courseId:t,moduleId:n}=e,[r,s]=y.useState([]),[a,o]=y.useState(!1),[l,c]=y.useState(null),u=y.useCallback(async()=>
952{if(!t&&!n){s([]);return}o(!0),c(null);try{let m=q.from("learning_resources").select("*");n&&t?m=m.or(`module_id.eq.${n},and(course_id.eq.${t},module_id.is.null)`):n?m=m.eq("module_id",n):t&&(m=m.eq("course_id",t));const{data:g,error:p}=await m.order("created_at",{ascending:!0});if(p)throw p;s(g??[])}catch(m){console.error(m),c((m==null?void 0:m.message)??"Failed to load resources"),s([])}finally{o(!1)}},[t,n]);y.useEffect(()=>{u()},[u]);const d=y.useMemo(()=>r.find(m=>m.resource_type==="video"&&typeof m.resource_url=="string"&&m.resource_url),[r]),h=y.useMemo(()=>r.filter(m=>m.resource_type==="document"||m.resource_type==="image"),[r]),f=y.useMemo(()=>r.filter(m=>!["video","document","image"].includes(m.resource_type)),[r]);return{resources:r,loading:a,error:l,videoResource:d,documentResources:h,otherResources:f,refetch:u}}function F8e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const B8e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,z8e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,U8e={};function l5(e,t){return(U8e.jsx?z8e:B8e).test(e)}const V8e=/[ \t\n\f\r]/g;function W8e(e){return typeof e=="object"?e.type==="text"?c5(e.value):!1:c5(e)}function c5(e){return e.replace(V8e,"")===""}class Ng{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ng.prototype.normal={};Ng.prototype.property={};Ng.prototype.space=void 0;function HG(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ng(n,r,t)}function rC(e){return e.toLowerCase()}class Er{constructor(t,n){this.attribute=n,this.property=t}}Er.prototype.attribute="";Er.prototype.booleanish=!1;Er.prototype.boolean=!1;Er.prototype.commaOrSpaceSeparated=!1;Er.prototype.commaSeparated=!1;Er.prototype.defined=!1;Er.prototype.mustUseProperty=!1;Er.prototype.number=!1;Er.prototype.overloadedBoolean=!1;Er.prototype.property="";Er.prototype.spaceSeparated=!1;Er.prototype.space=void 0;let H8e=0;const Fe=zc(),ln=zc(),sC=zc(),de=zc(),Ct=zc(),id=zc(),Tr=zc();function zc(){return 2**++H8e}const iC=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:ln,commaOrSpaceSeparated:Tr,commaSeparated:id,number:de,overloadedBoolean:sC,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),L1=Object.keys(iC);class NP extends Er{constructor(t,n,r,s){let a=-1;if(super(t,n),u5(this,"space",s),typeof r=="number")for(;++a<L1.length;){const o=L1[a];u5(this,L1[a],(r&iC[o])===iC[o])}}}NP.prototype.defined=!0;function u5(e,t,n){n&&(e[t]=n)}function zh(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const a=new NP(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[rC(r)]=r,n[rC(a.attribute)]=r}return new Ng(t,n,e.space)}const qG=zh({properties:{ariaActiveDescendant:null,ariaAtomic:ln,ariaAutoComplete:null,ariaBusy:ln,ariaChecked:ln,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:ln,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:ln,ariaFlowTo:Ct,ariaGrabbed:ln,ariaHasPopup:null,ariaHidden:ln,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:de,ariaLive:null,ariaModal:ln,ariaMultiLine:ln,ariaMultiSelectable:ln,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:ln,ariaReadOnly:ln,ariaRelevant:null,ariaRequired:ln,ariaRoleDescription:Ct,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:ln,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function KG(e,t){return t in e?e[t]:t}function GG(e,t){return KG(e,t.toLowerCase())}const q8e=zh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:id,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:Ct,autoFocus:
952Fe,autoPlay:Fe,blocking:Ct,capture:null,charSet:null,checked:Fe,cite:null,className:Ct,cols:de,colSpan:null,content:null,contentEditable:ln,controls:Fe,controlsList:Ct,coords:de|id,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:sC,draggable:ln,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:Ct,height:de,hidden:sC,high:de,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Fe,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Fe,optimum:de,pattern:null,ping:Ct,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:Ct,required:Fe,reversed:Fe,rows:de,rowSpan:de,sandbox:Ct,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:ln,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Fe,useMap:null,value:ln,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:ln,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Fe,disableRemotePlayback:Fe,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:GG}),K8e=zh({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRen
952dering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Tr,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRen
952dering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:id,g2:id,glyphName:id,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Tr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Tr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Tr,rev:Tr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Tr,requiredFeatures:Tr,requiredFonts:Tr,requiredFormats:Tr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Tr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Tr,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Tr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:KG}),YG=zh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}
vendor: 2,214 bytes, lines 952-953
952,space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),XG=zh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:GG}),JG=zh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),G8e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Y8e=/[A-Z]/g,d5=/-[a-z]/g,X8e=/^data[-\w.:]+$/i;function J8e(e,t){const n=rC(t);let r=t,s=Er;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&X8e.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(d5,Z8e);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!d5.test(a)){let o=a.replace(Y8e,Q8e);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=NP}return new s(r,t)}function Q8e(e){return"-"+e.toLowerCase()}function Z8e(e){return e.charAt(1).toUpperCase()}const eUe=HG([qG,q8e,YG,XG,JG],"html"),kP=HG([qG,K8e,YG,XG,JG],"svg");function tUe(e){return e.join(" ").trim()}var _P={},h5=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,nUe=/\n/g,rUe=/^\s*/,sUe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,iUe=/^:\s*/,aUe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,oUe=/^[;\s]*/,lUe=/^\s+|\s+$/g,cUe=` 953`,f5="/",m5="*",Fl="",uUe="comment",dUe="declaration";function hUe(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function s(g){var p=g.match(nUe);p&&(n+=p.length);var x=g.lastIndexOf(cUe);r=~x?g.length-x:r+g.length}function a(){var g={line:n,column:r};return function(p){return p.position=new o(g),u(),p}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(g){var p=new Error(t.source+":"+n+":"+r+": "+g);if(p.reason=g,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}
vendor: 1,656 bytes, line 953
953function c(g){var p=g.exec(e);if(p){var x=p[0];return s(x),e=e.slice(x.length),p}}function u(){c(rUe)}function d(g){var p;for(g=g||[];p=h();)p!==!1&&g.push(p);return g}function h(){var g=a();if(!(f5!=e.charAt(0)||m5!=e.charAt(1))){for(var p=2;Fl!=e.charAt(p)&&(m5!=e.charAt(p)||f5!=e.charAt(p+1));)++p;if(p+=2,Fl===e.charAt(p-1))return l("End of comment missing");var x=e.slice(2,p-2);return r+=2,s(x),e=e.slice(p),r+=2,g({type:uUe,comment:x})}}function f(){var g=a(),p=c(sUe);if(p){if(h(),!c(iUe))return l("property missing ':'");var x=c(aUe),v=g({type:dUe,property:p5(p[0].replace(h5,Fl)),value:x?p5(x[0].replace(h5,Fl)):Fl});return c(oUe),v}}function m(){var g=[];d(g);for(var p;p=f();)p!==!1&&(g.push(p),d(g));return g}return u(),m()}function p5(e){return e?e.replace(lUe,Fl):Fl}var fUe=hUe,mUe=Po&&Po.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_P,"__esModule",{value:!0});_P.default=gUe;const pUe=mUe(fUe);function gUe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,pUe.default)(e),s=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:l}=a;s?t(o,l,a):l&&(n=n||{},n[o]=l)}),n}var Aw={};Object.defineProperty(Aw,"__esModule",{value:!0});Aw.camelCase=void 0;var yUe=/^--[a-zA-Z0-9_-]+$/,xUe=/-([a-z])/g,vUe=/^[^-]+$/,bUe=/^-(webkit|moz|ms|o|khtml)-/,wUe=/^-(ms)-/,jUe=function(e){return!e||vUe.test(e)||yUe.test(e)},SUe=function(e,t){return t.toUpperCase()},g5=function(e,t){return"".concat(t,"-")},NUe=function(e,t){return t===void 0&&(t={}),jUe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(wUe,g5):e=e.replace(bUe,g5),e.replace(xUe,SUe))};
vendor: 2,876 bytes, line 953
953Aw.camelCase=NUe;var kUe=Po&&Po.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_Ue=kUe(_P),CUe=Aw;function aC(e,t){var n={};return!e||typeof e!="string"||(0,_Ue.default)(e,function(r,s){r&&s&&(n[(0,CUe.camelCase)(r,t)]=s)}),n}aC.default=aC;var EUe=aC;const AUe=it(EUe),QG=ZG("end"),CP=ZG("start");function ZG(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function PUe(e){const t=CP(e),n=QG(e);if(t&&n)return{start:t,end:n}}function um(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?y5(e.position):"start"in e||"end"in e?y5(e):"line"in e||"column"in e?oC(e):""}function oC(e){return x5(e&&e.line)+":"+x5(e&&e.column)}function y5(e){return oC(e&&e.start)+"-"+oC(e&&e.end)}function x5(e){return e&&typeof e=="number"?e:1}class Jn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=um(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Jn.prototype.file="";Jn.prototype.name="";Jn.prototype.reason="";Jn.prototype.message="";Jn.prototype.stack="";Jn.prototype.column=void 0;Jn.prototype.line=void 0;Jn.prototype.ancestors=void 0;Jn.prototype.cause=void 0;Jn.prototype.fatal=void 0;Jn.prototype.place=void 0;Jn.prototype.ruleId=void 0;Jn.prototype.source=void 0;const EP={}.hasOwnProperty,TUe=new Map,OUe=/[A-Z]/g,RUe=new Set(["table","tbody","thead","tfoot","tr"]),MUe=new Set(["td","th"]),eY="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function IUe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=VUe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 2,220 bytes, line 953
953if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=UUe(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?kP:eUe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=tY(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function tY(e,t,n){if(t.type==="element")return $Ue(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return LUe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return FUe(e,t,n);if(t.type==="mdxjsEsm")return DUe(e,t);if(t.type==="root")return BUe(e,t,n);if(t.type==="text")return zUe(e,t)}function $Ue(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=kP,e.schema=s),e.ancestors.push(t);const a=rY(e,t.tagName,!1),o=WUe(e,t);let l=PP(e,t);return RUe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!W8e(c):!0})),nY(e,o,a,t),AP(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function LUe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Dp(e,t.position)}function DUe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Dp(e,t.position)}function FUe(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=kP,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:rY(e,t.name,!0),o=HUe(e,t),l=PP(e,t);return nY(e,o,a,t),AP(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function BUe(e,t,n){const r={};return AP(r,PP(e,t)),e.create(t,e.Fragment,r,n)}function zUe(e,t){return t.value}function nY(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function AP(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function UUe(e,t,n){return r;function r(s,a,o,l){const u=Array.isArray(o.children)?n:t;
vendor: 4,127 bytes, line 953
953return l?u(a,o,l):u(a,o)}}function VUe(e,t){return n;function n(r,s,a,o){const l=Array.isArray(a.children),c=CP(r);return t(s,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function WUe(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&EP.call(t.properties,s)){const a=qUe(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&MUe.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function HUe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Dp(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Dp(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function PP(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:TUe;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=s.get(c)||0;o=c+"-"+u,s.set(c,u+1)}}const l=tY(e,a,o);l!==void 0&&n.push(l)}return n}function qUe(e,t,n){const r=J8e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?F8e(n):tUe(n)),r.property==="style"){let s=typeof n=="object"?n:KUe(e,String(n));return e.stylePropertyNameCase==="css"&&(s=GUe(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?G8e[r.property]||r.property:r.attribute,n]}}function KUe(e,t){try{return AUe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new Jn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=eY+"#cannot-parse-style-attribute",s}}function rY(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let a=-1,o;for(;++a<s.length;){const l=l5(s[a])?{type:"Identifier",name:s[a]}:{type:"Literal",value:s[a]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=o}else r=l5(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return EP.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);Dp(e)}function Dp(e,t){const n=new Jn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=eY+"#cannot-handle-mdx-estrees-without-createevaluater",n}function GUe(e){const t={};let n;for(n in e)EP.call(e,n)&&(t[YUe(n)]=e[n]);return t}function YUe(e){let t=e.replace(OUe,XUe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function XUe(e){return"-"+e.toLowerCase()}const D1={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},JUe={};function QUe(e,t){const n=JUe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return sY(e,r,s)}function sY(e,t,n){if(ZUe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return v5(e.children,t,n)}return Array.isArray(e)?v5(e,t,n):""}function v5(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=sY(e[s],t,n);return r.join("")}function ZUe(e){return!!(e&&typeof e=="object")}const b5=document.createElement("i");function TP(e){const t="&"+e+";";b5.innerHTML=t;const n=b5.textContent;
vendor: 10,925 bytes, line 953
953return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Hi(e,t,n,r){const s=e.length;let a=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function ps(e,t){return e.length>0?(Hi(e,e.length,0,t),e):t}const w5={}.hasOwnProperty;function eVe(e){const t={};let n=-1;for(;++n<e.length;)tVe(t,e[n]);return t}function tVe(e,t){let n;for(n in t){const s=(w5.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){w5.call(s,o)||(s[o]=[]);const l=a[o];nVe(s[o],Array.isArray(l)?l:l?[l]:[])}}}function nVe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Hi(e,0,0,r)}function iY(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ad(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ci=Nl(/[A-Za-z]/),Wr=Nl(/[\dA-Za-z]/),rVe=Nl(/[#-'*+\--9=?A-Z^-~]/);function lC(e){return e!==null&&(e<32||e===127)}const cC=Nl(/\d/),sVe=Nl(/[\dA-Fa-f]/),iVe=Nl(/[!-/:-@[-`{-~]/);function Ie(e){return e!==null&&e<-2}function Nr(e){return e!==null&&(e<0||e===32)}function ct(e){return e===-2||e===-1||e===32}const aVe=Nl(new RegExp("\\p{P}|\\p{S}","u")),oVe=Nl(/\s/);function Nl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Uh(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Wr(e.charCodeAt(n+1))&&Wr(e.charCodeAt(n+2)))s=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Ot(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return ct(c)?(e.enter(n),l(c)):t(c)}function l(c){return ct(c)&&a++<s?(e.consume(c),l):(e.exit(n),t(c))}}const lVe={tokenize:cVe};function cVe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ot(e,t,"linePrefix")}function s(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ie(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),o)}}const uVe={tokenize:dVe},j5={tokenize:hVe};function dVe(e){const t=this,n=[];let r=0,s,a,o;return l;function l(w){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&b();const j=t.events.length;let S=j,N;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){N=t.events[S][1].end;break}v(r);let k=j;for(;k<t.events.length;)t.events[k][1].end={...N},k++;return Hi(t.events,S+1,0,t.events.slice(j)),t.events.length=k,u(w)}return l(w)}function u(w){if(r===n.length){if(!s)return f(w);if(s.currentConstruct&&s.currentConstruct.concrete)return g(w);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(j5,d,h)(w)}function d(w){return s&&b(),v(r),f(w)}function h(w){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(w)}function f(w){return t.containerState={},e.attempt(j5,m,g)(w)}function m(w){return r++,n.push([t.currentConstruct,t.containerState]),f(w)}function g(w){if(w===null){s&&b(),v(0),e.consume(w);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:a}),p(w)}function p(w){if(w===null){x(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return Ie(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),p)}function x(w,j){const S=t.sliceStream(w);if(j&&S.push(null),w.previous=a,a&&(a.next=w),a=w,s.defineSkip(w.start),s.write(S),t.parser.lazy[w.start.line]){let N=s.events.length;for(;N--;)if(s.events[N][1].start.offset<o&&(!s.events[N][1].end||s.events[N][1].end.offset>o))return;const k=t.events.length;let _=k,C,A;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if(C){A=t.events[_][1].end;break}C=!0}for(v(r),N=k;N<t.events.length;)t.events[N][1].end={...A},N++;Hi(t.events,_+1,0,t.events.slice(k)),t.events.length=N}}function v(w){let j=n.length;for(;j-- >w;){const S=n[j];t.containerState=S[1],S[0].exit.call(t,e)}n.length=w}function b(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function hVe(e,t,n){return Ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function S5(e){if(e===null||Nr(e)||oVe(e))return 1;if(aVe(e))return 2}function OP(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const a=e[s].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const uC={name:"attention",resolveAll:fVe,tokenize:mVe};function fVe(e,t){let n=-1,r,s,a,o,l,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},f={...e[n][1].start};N5(h,-c),N5(f,c),o={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ps(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ps(u,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=ps(u,OP(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ps(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ps(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Hi(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function mVe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=S5(r);let a;return o;function o(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const u=e.exit("attentionSequence"),d=S5(c),h=!d||d===2&&s||n.includes(c),f=!s||s===2&&d||n.includes(r);return u._open=!!(a===42?h:h&&(s||!f)),u._close=!!(a===42?f:f&&(d||!h)),t(c)}}function N5(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const pVe={name:"autolink",tokenize:gVe};function gVe(e,t,n){let r=0;return s;function s(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return Ci(m)?(e.consume(m),o):m===64?n(m):u(m)}function o(m){return m===43||m===45||m===46||Wr(m)?(r=1,l(m)):u(m)}function l(m){return m===58?(e.consume(m),r=0,c):(m===43||m===45||m===46||Wr(m))&&r++<32?(e.consume(m),l):(r=0,u(m))}function c(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||lC(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),d):rVe(m)?(e.consume(m),u):n(m)}function d(m){return Wr(m)?h(m):n(m)}function h(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||Wr(m))&&r++<63){const g=m===45?f:h;return e.consume(m),g}return n(m)}}const Pw={partial:!0,tokenize:yVe};function yVe(e,t,n){return r;function r(a){return ct(a)?Ot(e,s,"linePrefix")(a):s(a)}function s(a){return a===null||Ie(a)?t(a):n(a)}}const aY={continuation:{tokenize:vVe},exit:bVe,name:"blockQuote",tokenize:xVe};function xVe(e,t,n){const r=this;return s;function s(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return ct(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function vVe(e,t,n){const r=this;return s;function s(o){return ct(o)?Ot(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(aY,t,n)(o)}}function bVe(e){e.exit("blockQuote")}const oY={name:"characterEscape",tokenize:wVe};function wVe(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),s}function s(a){return iVe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const lY={name:"characterReference",tokenize:jVe};function jVe(e,t,n){const r=this;let s=0,a,o;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,o=Wr,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=sVe,d):(e.enter("characterReferenceValue"),a=7,o=cC,d(h))}function d(h){if(h===59&&s){const f=e.exit("characterReferenceValue");return o===Wr&&!TP(r.sliceSerialize(f))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(h)&&s++<a?(e.consume(h),d):n(h)}}const k5={partial:!0,tokenize:NVe},_5={concrete:!0,name:"codeFenced",tokenize:SVe};function SVe(e,t,n){const r=this,s={partial:!0,tokenize:S};let a=0,o=0,l;return c;function c(N){return u(N)}function u(N){const k=r.events[r.events.length-1];return a=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,l=N,e.enter("co
953deFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(N)}function d(N){return N===l?(o++,e.consume(N),d):o<3?n(N):(e.exit("codeFencedFenceSequence"),ct(N)?Ot(e,h,"whitespace")(N):h(N))}function h(N){return N===null||Ie(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(k5,p,j)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(N))}function f(N){return N===null||Ie(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):ct(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ot(e,m,"whitespace")(N)):N===96&&N===l?n(N):(e.consume(N),f)}function m(N){return N===null||Ie(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||Ie(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===l?n(N):(e.consume(N),g)}function p(N){return e.attempt(s,j,x)(N)}function x(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),v}function v(N){return a>0&&ct(N)?Ot(e,b,"linePrefix",a+1)(N):b(N)}function b(N){return N===null||Ie(N)?e.check(k5,p,j)(N):(e.enter("codeFlowValue"),w(N))}function w(N){return N===null||Ie(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),w)}function j(N){return e.exit("codeFenced"),t(N)}function S(N,k,_){let C=0;return A;function A(L){return N.enter("lineEnding"),N.consume(L),N.exit("lineEnding"),E}function E(L){return N.enter("codeFencedFence"),ct(L)?Ot(N,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):P(L)}function P(L){return L===l?(N.enter("codeFencedFenceSequence"),$(L)):_(L)}function $(L){return L===l?(C++,N.consume(L),$):C>=o?(N.exit("codeFencedFenceSequence"),ct(L)?Ot(N,R,"whitespace")(L):R(L)):_(L)}function R(L){return L===null||Ie(L)?(N.exit("codeFencedFence"),k(L)):_(L)}}}function NVe(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const F1={name:"codeIndented",tokenize:_Ve},kVe={partial:!0,tokenize:CVe};function _Ve(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Ot(e,a,"linePrefix",5)(u)}function a(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):Ie(u)?e.attempt(kVe,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ie(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function CVe(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):Ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Ot(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Ie(o)?s(o):n(o)}}const EVe={name:"codeText",previous:PVe,resolve:AVe,tokenize:TVe};function AVe(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function PVe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function TVe(e,t,n){let r=0,s,a;return o;function o(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(a=e.enter("codeTextSequence"),s=0,d(h)):Ie(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Ie(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),s++,d):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",u(h))}}class OVe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&xf(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),xf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),xf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);xf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);xf(this.left,n.reverse())}}}function xf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function cY(e){const t={};let n=-1,r,s,a,o,l,c,u;const d=new OVe(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,RVe(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,s=void 0;a--;)if(o=d.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(r[1].end={...d.get(s)[1].start},l=d.slice(s,n),l.unshift(r),d.splice(s,n-s+1,l))}}return Hi(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function RVe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,h,f=-1,m=n,g=0,p=0;const x=[p];for(;m;){for(;e.get(++s)[1]!==m;);a.push(s),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),h&&o.defineSki
vendor: 18,629 bytes, line 953
953p(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=n;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(p=f+1,x.push(p),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):x.pop(),f=x.length;f--;){const v=l.slice(x[f],x[f+1]),b=a.pop();c.push([b,b+v.length-1]),e.splice(b,2,v)}for(c.reverse(),f=-1;++f<c.length;)u[g+c[f][0]]=g+c[f][1],g+=c[f][1]-c[f][0]-1;return u}const MVe={resolve:$Ve,tokenize:LVe},IVe={partial:!0,tokenize:DVe};function $Ve(e){return cY(e),e}function LVe(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?a(l):Ie(l)?e.check(IVe,o,a)(l):(e.consume(l),s)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function DVe(e,t,n){const r=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ot(e,a,"linePrefix")}function a(o){if(o===null||Ie(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function uY(e,t,n,r,s,a,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return h;function h(v){return v===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(v),e.exit(a),f):v===null||v===32||v===41||lC(v)?n(v):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),p(v))}function f(v){return v===62?(e.enter(a),e.consume(v),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(l),f(v)):v===null||v===60||Ie(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function p(v){return!d&&(v===null||v===41||Nr(v))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(v)):d<u&&v===40?(e.consume(v),d++,p):v===41?(e.consume(v),d--,p):v===null||v===32||v===40||lC(v)?n(v):(e.consume(v),v===92?x:p)}function x(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function dY(e,t,n,r,s,a){const o=this;let l=0,c;return u;function u(m){return e.enter(r),e.enter(s),e.consume(m),e.exit(s),e.enter(a),d}function d(m){return l>999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(a),e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):Ie(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||Ie(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!ct(m)),m===92?f:h)}function f(m){return m===91||m===92||m===93?(e.consume(m),l++,h):h(m)}}function hY(e,t,n,r,s,a){let o;return l;function l(f){return f===34||f===39||f===40?(e.enter(r),e.enter(s),e.consume(f),e.exit(s),o=f===40?41:f,c):n(f)}function c(f){return f===o?(e.enter(s),e.consume(f),e.exit(s),e.exit(r),t):(e.enter(a),u(f))}function u(f){return f===o?(e.exit(a),c(o)):f===null?n(f):Ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ot(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===o||f===null||Ie(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?h:d)}function h(f){return f===o||f===92?(e.consume(f),d):d(f)}}function dm(e,t){let n;return r;function r(s){return Ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):ct(s)?Ot(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const FVe={name:"definition",tokenize:zVe},BVe={partial:!0,tokenize:UVe};function zVe(e,t,n){const r=this;let s;return a;function a(m){return e.enter("definition"),o(m)}function o(m){return dY.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return s=ad(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return Nr(m)?dm(e,u)(m):u(m)}function u(m){return uY(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(BVe,h,h)(m)}function h(m){return ct(m)?Ot(e,f,"whitespace")(m):f(m)}function f(m){return m===null||Ie(m)?(e.exit("definition"),r.parser.defined.push(s),t(m)):n(m)}}function UVe(e,t,n){return r;function r(l){return Nr(l)?dm(e,s)(l):n(l)}function s(l){return hY(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return ct(l)?Ot(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Ie(l)?t(l):n(l)}}const VVe={name:"hardBreakEscape",tokenize:WVe};function WVe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return Ie(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const HVe={name:"headingAtx",resolve:qVe,tokenize:KVe};function qVe(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Hi(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function KVe(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Nr(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ie(d)?(e.exit("atxHeading"),t(d)):ct(d)?Ot(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Nr(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const GVe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],C5=["pre","script","style","textarea"],YVe={concrete:!0,name:"htmlFlow",resolveTo:QVe,tokenize:ZVe},XVe={partial:!0,tokenize:tWe},JVe={partial:!0,tokenize:eWe};function QVe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ZVe(e,t,n){const r=this;let s,a,o,l,c;return u;function u(O){return d(O)}function d(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),f):O===47?(e.consume(O),a=!0,p):O===63?(e.consume(O),s=3,r.interrupt?t:T):Ci(O)?(e.consume(O),o=String.fromCharCode(O),x):n(O)}function f(O){return O===45?(e.consume(O),s=2,m):O===91?(e.consume(O),s=5,l=0,g):Ci(O)?(e.consume(O),s=4,r.interrupt?t:T):n(O)}function m(O){return O===45?(e.consume(O),r.interrupt?t:T):n(O)}function g(O){const W="CDATA[";return O===W.charCodeAt(l++)?(e.consume(O),l===W.length?r.interrupt?t:P:g):n(O)}function p(O){return Ci(O)?(e.consume(O),o=String.fromCharCode(O),x):n(O)}function x(O){if(O===null||O===47||O===62||Nr(O)){const W=O===47,X=o.toLowerCase();return!W&&!a&&C5.includes(X)?(s=1,r.interrupt?t(O):P(O)):GVe.includes(o.toLowerCase())?(s=6,W?(e.consume(O),v):r.interrupt?t(O):P(O)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):a?b(O):w(O))}return O===45||Wr(O)?(e.consume(O),o+=String.fromCharCode(O),x):n(O)}function v(O){return O===62?(e.consume(O),r.interrupt?t:P):n(O)}function b(O){return ct(O)?(e.consume(O),b):A(O)}function w(O){return O===47?(e.consume(O),A):O===58||O===95||Ci(O)?(e.consume(O),j):ct(O)?(e.consume(O),w):A(O)}function j(O){return O===45||O===46||O===58||O===95||Wr(O)?(e.consume(O),j):S(O)}function S(O){return O===61?(e.consume(O),N):ct(O)?(e.consume(O),S):w(O)}function N(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),c=O,k):ct(O)?(e.consume(O),N):_(O)}function k(O){return O===c?(e.consume(O),c=null,C):O===null||Ie(O)?n(O):(e.consume(O),k)}function _(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Nr(O)?S(O):(e.consume(O),_)}function C(O){return O===47||O===62||ct(O)?w(O):n(O)}function A(O){return O===62?(e.consume(O),E):n(O)}function E(O){return O===null||Ie(O)?P(O):ct(O)?(e.consume(O),E):n(O)}function P(O){return O===45&&s===2?(e.consume(O),D):O===60&&s===1?(e.consume(O),I):O===62&&s===4?(e.consume(O),B):O===63&&s===3?(e.consume(O),T):O===93&&s===5?(e.consume(O),H):Ie(O)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(XVe,Y,$)(O)):O===null||Ie(O)?(e.exit("htmlFlowData"),$(O)):(e.consume(O),P)}function $(O){return e.check(JVe,R,Y)(O)}function R(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),L}function L(O){return O===null||Ie(O)?$(O):(e.enter("htmlFlowData"),P(O))}function D(O){return O===45?(e.consume(O),T):P(O)}function I(O){return O===47?(e.consume(O),o="",M):P(O)}function M(O){if(O===62){const W=o.toLowerCase();return C5.includes(W)?(e.consume(O),B):P(O)}return Ci(O)&&o.length<8?(e.consume(O),o+=String.fromCharCode(O),M):P(O)}function H(O){return O===93?(e.consume(O),T):P(O)}function T(O){return O===62?(e.consume(O),B):O===45&&s===2?(e.consume(O),T):P(O)}function B(O){return O===null||Ie(O)?(e.exit("htmlFlowData"),Y(O)):(e.consume(O),B)}function Y(O){return e.exit("htmlFlow"),t(O)}}function eWe(e,t,n){const r=this;return s;function s(o){return Ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function tWe(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Pw,t,n)}}const nWe={name:"htmlText",tokenize:rWe};function rWe(e,t,n){const r=this;let s,a,o;return l;function l(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),c}function c(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),S):T===63?(e.consume(T),w):Ci(T)?(e.consume(T),_):n(T)}function u(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),a=0,g):Ci(T)?(e.consume(T),b):n(T)}function d(T){return T===45?(e.consume(T),m):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),f):Ie(T)?(o=h,I(T)):(e.consume(T),h)}function f(T){return T===45?(e.consume(T),m):h(T)}function m(T){return T===62?D(T):T===45?f(T):h(T)}function g(T){const B="CDATA[";return T===B.charCodeAt(a++)?(e.consume(T),a===B.length?p:g):n(T)}function p(T){return T===null?n(T):T===93?(e.consume(T),x):Ie(T)?(o=p,I(T)):(e.consume(T),p)}function x(T){return T===93?(e.consume(T),v):p(T)}function v(T){return T===62?D(T):T===93?(e.consume(T),v):p(T)}function b(T){return T===null||T===62?D(T):Ie(T)?(o=b,I(T)):(e.consume(T),b)}function w(T){return T===null?n(T):T===63?(e.consume(T),j):Ie(T)?(o=w,I(T)):(e.consume(T),w)}function j(T){return T===62?D(T):w(T)}function S(T){return Ci(T)?(e.consume(T),N):n(T)}function N(T){return T===45||Wr(T)?(e.consume(T),N):k(T)}function k(T){return Ie(T)?(o=k,I(T)):ct(T)?(e.consume(T),k):D(T)}function _(T){return T===45||Wr(T)?(e.consume(T),_):T===47||T===62||Nr(T)?C(T):n(T)}function C(T){return T===47?(e.consume(T),D):T===58||T===95||Ci(T)?(e.consume(T),A):Ie(T)?(o=C,I(T)):ct(T)?(e.consume(T),C):D(T)}function A(T){return T===45||T===46||T===58||T===95||Wr(T)?(e.consume(T),A):E(T)}function E(T){return T===61?(e.consume(T),P):Ie(T)?(o=E,I(T)):ct(T)?(e.consume(T),E):C(T)}function P(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),s=T,$):Ie(T)?(o=P,I(T)):ct(T)?(e.consume(T),P):(e.consume(T),R)}function $(T){return T===s?(e.consume(T),s=void 0,L):T===null?n(T):Ie(T)?(o=$,I(T)):(e.consume(T),$)}function R(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||Nr(T)?C(T):(e.consume(T),R)}function L(T){return T===47||T===62||Nr(T)?C(T):n(T)}function D(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function I(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),M}function M(T){return ct(T)?Ot(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):H(T)}function H(T){return e.enter("htmlTextData"),o(T)}}const RP={name:"labelEnd",resolveAll:oWe,resolveTo:lWe,tokenize:cWe},sWe={tokenize:uWe},iWe={tokenize:dWe},aWe={tokenize:hWe};function oWe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&Hi(e,0,e.length,n),e}function lWe(e,t){let n=e.length,r=0,s,a,o,l;for(;n--;)if(s=e[n][1],a){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(a=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(o=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=ps(l,e.slice(a+1,a+r+3)),l=ps(l,[["enter",d,t]]),l=ps(l,OP(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),l=ps(l,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),l=ps(l,e.slice(o+1)),l=ps(l,[["exit",c,t]]),Hi(e,a,e.length,l),e}function cWe(e,t,n){const r=this;let s=r.events.length,a,o;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){a=r.events[s][1];break}return l;function l(f){return a?a._inactive?h(f):(o=r.parser.defined.includes(ad(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(sWe,d,o?d:h)(f):f===91?e.attempt(iWe,d,o?u:h)(f):o?d(f):h(f)}function u(f){return e.attempt(aWe,d,h)(f)}function d(f){return t(f)}function h(f){return a._balanced=!0,n(f)}}function uWe(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),s}function s(h){return Nr(h)?dm(e,a)(h):a(h)}function a(h){return h===41?d(h):uY(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return Nr(h)?dm(e,c)(h):d(h)}function l(h){return n(h)}function c(h){return h===34||h===39||h===40?hY(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return Nr(h)?dm(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function dWe(e,t,n){const r=this;return s;function s(l){return dY.call(r,e,a,o,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(ad(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function hWe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),s}function s(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const fWe={name:"labelStartImage",resolveAll:RP.resolveAll,tokenize:mWe};function mWe(e,t,n){const r=this;return s;function s(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const pWe={name:"labelStartLink",resolveAll:RP.resolveAll,tokenize:gWe};function gWe(e,t,n){const r=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const B1={name:"lineEnding",tokenize:yWe};function yWe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ot(e,t,"linePrefix")}}const Nx={name:"thematicBreak",tokenize:xWe};function xWe(e,t,n){let r=0,s;return a;function a(u){return e.enter("thematicBreak"),o(u)}function o(u){return s=u,l(u)}function l(u){return u===s?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ie(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),ct(u)?Ot(e,l,"whitespace")(u):l(u))}}const mr={continuation:{tokenize:jWe},exit:NWe,name:"list",tokenize:wWe},vWe={partial:!0,tokenize:kWe},bWe={partial:!0,tokenize:SWe};function wWe(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:cC(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Nx,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return cC(m)&&++o<10?(e.consume(m),c):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Pw,r.interrupt?n:d,e.attempt(vWe,f,h))}
vendor: 5,407 bytes, line 953
953function d(m){return r.containerState.initialBlankLine=!0,a++,f(m)}function h(m){return ct(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function jWe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Pw,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ot(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!ct(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bWe,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ot(e,e.attempt(mr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function SWe(e,t,n){const r=this;return Ot(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function NWe(e){e.exit(this.containerState.type)}function kWe(e,t,n){const r=this;return Ot(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!ct(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const E5={name:"setextUnderline",resolveTo:_We,tokenize:CWe};function _We(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function CWe(e,t,n){const r=this;let s;return a;function a(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),s=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),ct(u)?Ot(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ie(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const EWe={tokenize:AWe};function AWe(e){const t=this,n=e.attempt(Pw,r,e.attempt(this.parser.constructs.flowInitial,s,Ot(e,e.attempt(this.parser.constructs.flow,s,e.attempt(MVe,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const PWe={resolveAll:mY()},TWe=fY("string"),OWe=fY("text");function fY(e){return{resolveAll:mY(e==="text"?RWe:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,o,l);return o;function o(d){return u(d)?a(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),a(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const h=s[d];let f=-1;if(h)for(;++f<h.length;){const m=h[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function mY(e){return t;function t(n,r){let s=-1,a;for(;++s<=n.length;)a===void 0?n[s]&&n[s][1].type==="data"&&(a=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==a+2&&(n[a][1].end=n[s-1][1].end,n.splice(a+2,s-a-2),s=a+2),a=void 0);return e?e(n,r):n}}function RWe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let a=s.length,o=-1,l=0,c;for(;a--;){const u=s[a];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const MWe={42:mr,43:mr,45:mr,48:mr,49:mr,50:mr,51:mr,52:mr,53:mr,54:mr,55:mr,56:mr,57:mr,62:aY},IWe={91:FVe},$We={[-2]:F1,[-1]:F1,32:F1},LWe={35:HVe,42:Nx,45:[E5,Nx],60:YVe,61:E5,95:Nx,96:_5,126:_5},DWe={38:lY,92:oY},FWe={[-5]:B1,[-4]:B1,[-3]:B1,33:fWe,38:lY,42:uC,60:[pVe,nWe],91:pWe,92:[VVe,oY],93:RP,95:uC,96:EVe},BWe={null:[uC,PWe]},zWe={null:[42,95]},UWe={null:[]},VWe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:zWe,contentInitial:IWe,disable:UWe,document:MWe,flow:LWe,flowInitial:$We,insideSpan:BWe,string:DWe,text:FWe},Symbol.toStringTag,{value:"Module"}));function WWe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
vendor: 14,806 bytes, lines 953-955
953olumn:n&&n.column||1,offset:n&&n.offset||0};const s={},a=[];let o=[],l=[];const c={attempt:k(S),check:k(N),consume:b,enter:w,exit:j,interrupt:k(N,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:h};let d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function h(E){return o=ps(o,E),x(),o[o.length-1]!==null?[]:(_(t,0),u.events=OP(a,u.events,u),u.events)}function f(E,P){return qWe(m(E),P)}function m(E){return HWe(o,E)}function g(){const{_bufferIndex:E,_index:P,line:$,column:R,offset:L}=r;return{_bufferIndex:E,_index:P,line:$,column:R,offset:L}}function p(E){s[E.line]=E.column,A()}function x(){let E;for(;r._index<o.length;){const P=o[r._index];if(typeof P=="string")for(E=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===E&&r._bufferIndex<P.length;)v(P.charCodeAt(r._bufferIndex));else v(P)}}function v(E){d=d(E)}function b(E){Ie(E)?(r.line++,r.column=1,r.offset+=E===-3?2:1,A()):E!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=E}function w(E,P){const $=P||{};return $.type=E,$.start=g(),u.events.push(["enter",$,u]),l.push($),$}function j(E){const P=l.pop();return P.end=g(),u.events.push(["exit",P,u]),P}function S(E,P){_(E,P.from)}function N(E,P){P.restore()}function k(E,P){return $;function $(R,L,D){let I,M,H,T;return Array.isArray(R)?Y(R):"tokenize"in R?Y([R]):B(R);function B(J){return G;function G(ce){const ee=ce!==null&&J[ce],le=ce!==null&&J.null,he=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(le)?le:le?[le]:[]];return Y(he)(ce)}}function Y(J){return I=J,M=0,J.length===0?D:O(J[M])}function O(J){return G;function G(ce){return T=C(),H=J,J.partial||(u.currentConstruct=J),J.name&&u.parser.constructs.disable.null.includes(J.name)?X():J.tokenize.call(P?Object.assign(Object.create(u),P):u,c,W,X)(ce)}}function W(J){return E(H,T),L}function X(J){return T.restore(),++M<I.length?O(I[M]):D}}}function _(E,P){E.resolveAll&&!a.includes(E)&&a.push(E),E.resolve&&Hi(u.events,P,u.events.length-P,E.resolve(u.events.slice(P),u)),E.resolveTo&&(u.events=E.resolveTo(u.events,u))}function C(){const E=g(),P=u.previous,$=u.currentConstruct,R=u.events.length,L=Array.from(l);return{from:R,restore:D};function D(){r=E,u.previous=P,u.currentConstruct=$,u.events.length=R,l=L,A()}}function A(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function HWe(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,a=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(r,a)];else{if(o=e.slice(n,s),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function qWe(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=` 954`;break}case-3:{o=`\r 955`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(a)}s=a===-2,r.push(o)}return r.join("")}function KWe(e){const r={constructs:eVe([VWe,...(e||{}).extensions||[]]),content:s(lVe),defined:[],document:s(uVe),flow:s(EWe),lazy:{},string:s(TWe),text:s(OWe)};return r;function s(a){return o;function o(l){return WWe(r,a,l)}}}function GWe(e){for(;!cY(e););return e}const A5=/[\0\t\n\r]/g;function YWe(){let e=1,t="",n=!0,r;return s;function s(a,o,l){const c=[];let u,d,h,f,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(A5.lastIndex=h,u=A5.exec(a),f=u&&u.index!==void 0?u.index:a.length,m=a.charCodeAt(f),!u){t=a.slice(h);break}if(m===10&&h===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<f&&(c.push(a.slice(h,f)),e+=f-h),m){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=f+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const XWe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JWe(e){return e.replace(XWe,QWe)}function QWe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),a=s===120||s===88;return iY(n.slice(a?2:1),a?16:10)}return TP(n)||e}const pY={}.hasOwnProperty;function ZWe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),eHe(n)(GWe(KWe(n).document().write(YWe()(e,t,!0))))}function eHe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Rt),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(ot),blockQuote:a(le),characterEscape:C,characterReference:C,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(Q,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(Re),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Te),hardBreakEscape:a(Qe),hardBreakTrailing:a(Qe),htmlFlow:a(zt,o),htmlFlowData:C,htmlText:a(zt,o),htmlTextData:C,image:a(Qn),label:o,link:a(Rt),listItem:a(Ts),listItemValue:f,listOrdered:a(Tn,h),listUnordered:a(Tn),paragraph:a(kl),reference:O,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ot),strong:a(Ji),thematicBreak:a(_g)},exit:{atxHeading:c(),atxHeadingSequence:S,autolink:c(),autolinkEmail:ee,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:J,characterReference:G,codeFenced:c(x),codeFencedFence:p,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:c(v),codeText:c(L),codeTextData:A,data:A,definition:c(),definitionDestinationString:j,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(P),hardBreakTrailing:c(P),htmlFlow:c($),htmlFlowData:A,htmlText:c(R),htmlTextData:A,image:c(I),label:H,labelText:M,lineEnding:E,link:c(D),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:W,resourceDestinationString:T,resourceTitleString:B,resource:Y,setextHeading:c(_),setextHeadingLineSequence:k,setextHeadingText:N,strong:c(),thematicBreak:c()}};gY(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let me={type:"root",children:[]};const $e={stack:[me],tokenStack:[],config:t,enter:l,exit:u,buffer:o,resume:d,data:n},Le=[];let ut=-1;for(;++ut<te.length;)if(te[ut][1].type==="listOrdered"||te[ut][1].type==="listUnordered")if(te[ut][0]==="enter")Le.push(ut);else{const Ar=Le.pop();ut=s(te,Ar,ut)}for(ut=-1;++ut<te.length;){const Ar=t[te[ut][0]];pY.call(Ar,te[ut][1].type)&&Ar[te[ut][1].type].call(Object.assign({sliceSerialize:te[ut][2].sliceSerialize},$e),te[ut][1])}if($e.tokenStack.length>0){const Ar=$e.tokenStack[$e.tokenStack.length-1];(Ar[1]||P5).call($e,void 0,Ar[0])}for(me.position={start:eo(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:eo(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},ut=-1;++ut<t.transforms.length;)me=t.transforms[ut](me)||me;return me}function s(te,me,$e){let Le=me-1,ut=-1,Ar=!1,ui,rs,_l,Qi;for(;++Le<=$e;){const Xt=te[Le];switch(Xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xt[0]==="enter"?ut++:ut--,Qi=void 0;break}case"lineEndingBlank":{Xt[0]==="enter"&&(ui&&!Qi&&!ut&&!_l&&(_l=Le),Qi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qi=void 0}if(!ut&&Xt[0]==="enter"&&Xt[1].type==="listItemPrefix"||ut===-1&&Xt[0]==="exit"&&(Xt[1].type==="listUnordered"||Xt[1].type==="listOrdered")){if(ui){let Ya=Le;for(rs=void 0;Ya--;){const _e=te[Ya];if(_e[1].type==="lineEnding"||_e[1].type==="lineEndingBlank"){if(_e[0]==="exit")continue;rs&&(te[rs][1].type="lineEndingBlank",Ar=!0),_e[1].type="lineEnding",rs=Ya}else if(!(_e[1].type==="linePrefix"||_e[1].type==="blockQuotePrefix"||_e[1].type==="blockQuotePrefixWhitespace"||_e[1].type==="blockQuoteMarker"||_e[1].type==="listItemIndent"))break}_l&&(!rs||_l<rs)&&(ui._spread=!0),ui.end=Object.assign({},rs?te[rs][1].start:Xt[1].end),te.splice(rs||Le,0,["exit",ui,Xt[2]]),Le++,$e++}if(Xt[1].type==="listItemPrefix"){const Ya={type:"listItem",_spread:!1,start:Object.assign({},Xt[1].start),end:void 0};ui=Ya,te.splice(Le,0,["enter",Ya,Xt[2]]),Le++,$e++,_l=void 0,Qi=!0}}}return te[me][1]._spread=Ar,$e}function a(te,me){return $e;function $e(Le){l.call(this,te(Le),Le),me&&me.call(this,Le)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(te,me,$e){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([me,$e||void 0]),te.position={start:eo(me.start),end:void 0}}function c(te){return me;function me($e){te&&te.call(this,$e),u.call(this,$e)}}function u(te,me){const $e=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==te.type&&(me?me.call(this,te,Le[0]):(Le[1]||P5).call(this,te,Le[0]));else throw new Error("Cannot close `"+te.type+"` ("+um({start:te.start,end:te.end})+"): itâs not open");$e.position.end=eo(te.end)}function d(){return QUe(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(te){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function m(){const te=this.resume(),me=this.stack[this.stack.length-1];me.lang=te}function g(){const te=this.resume(),me=this.stack[this.stack.length-1];me.meta=te}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te.replace(/(\r?\n|\r)$/g,"")}function b(te){const me=this.resume(),$e=this.stack[this.stack.length-1];$e.label=me,$e.identifier=ad(this.sliceSerialize(te)).toLowerCase()}function w(){const te=this.resume(),me=this.stack[this.stack.length-1];me.title=te}function j(){const te=this.resume(),me=this.stack[this.stack.length-1];me.url=te}function S(te){const me=this.stack[this.stack.length-1];if(!me.depth){const $e=this.sliceSerialize(te).length;me.depth=$e}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function k(te){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function C(te){const $e=this.stack[this.stack.length-1].children;let Le=$e[$e.length-1];(!Le||Le.type!=="text")&&(Le=Uc(),Le.position={start:eo(te.start),end:void 0},$e.push(Le)),this.stack.push(Le)}function A(te){const me=this.stack.pop();me.value+=this.sliceSerialize(te),me.position.end=eo(te.end)}function E(te){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=me.children[me.children.length-1];$e.position.end=eo(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(C.call(this,te),A.call(this,te))}function P(){this.data.atHardBreak=!0}function $(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function R(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function L(){const te=this.resume(),me=this.stack[this.stack.length-1];me.value=te}function D(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=me,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function I(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=me,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function M(te){const me=this.sliceSerialize(te),$e=this.stack[this.stack.length-2];$e.label=JWe(me),$e.identifier=ad(me).toLowerCase()}function H(){const te=this.stack[this.stack.length-1],me=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const Le=te.children;$e.children=Le}else $e.alt=me}function T(){const te=this.resume(),me=this.stack[this.stack.length-1];me.url=te}function B(){const te=this.resume(),me=this.stack[this.stack.length-1];me.title=te}function Y(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function W(te){const me=this.resume(),$e=this.stack[this.stack.length-1];$e.label=me,$e.identifier=ad(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function X(te){this.data.characterReferenceType=te.type}function J(te){const me=this.sliceSerialize(te),$e=this.data.characterReferenceType;let Le;$e?(Le=iY(me,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=TP(me);const ut=this.stack[this.stack.length-1];ut.value+=Le}function G(te){const me=this.stack.pop();me.position.end=eo(te.end)}function ce(te){A.call(this,te);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(te)}function ee(te){A.call(this,te);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(te)}function le(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function Q(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function ot(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function zt(){return{type:"html",value:""}}function Qn(){return{type:"image",title:null,url:"",alt:null}}function Rt(){return{type:"link",title:null,url:"",children:[]}}function Tn(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Ts(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function kl(){return{type:"paragraph",children:[]}}function Ji(){return{type:"strong",children:[]}}function Uc(){return{type:"text",value:""}}function _g(){return{type:"thematicBreak"}}}function eo(e){return{line:e.line,column:e.column,offset:e.offset}}function gY(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?gY(e,r):tHe(e,r)}}function tHe(e,t){let n;for(n in t)if(pY.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function P5(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+um({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+um({start:t.start,end:t.end}
vendor: 4,533 bytes, lines 955-959
955)+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+um({start:t.start,end:t.end})+") is still open")}function nHe(e){const t=this;t.parser=n;function n(r){return ZWe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function rHe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function sHe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` 956`}]}function iHe(e,t){const n=t.value?t.value+` 957`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function aHe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oHe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lHe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Uh(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function cHe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uHe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yY(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function dHe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yY(e,t);const s={src:Uh(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function hHe(e,t){const n={src:Uh(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function fHe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function mHe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yY(e,t);const s={href:Uh(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function pHe(e,t){const n={href:Uh(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gHe(e,t,n){const r=e.all(t),s=n?yHe(n):xY(t),a={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(s||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:` 958`}),d.type==="element"&&d.tagName==="p"&&!s?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(s||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:` 959`});const u={type:"element",tagName:"li",properties:a,children:o};
vendor: 3,267 bytes, line 959
959return e.patch(t,u),e.applyData(t,u)}function yHe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=xY(n[r])}return t}function xY(e){const t=e.spread;return t??e.children.length>1}function xHe(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const o=r[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function vHe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bHe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function wHe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jHe(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=CP(t.children[1]),c=QG(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function SHe(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const h=t.children[c],f={},m=o?o[c]:void 0;m&&(f.align=m);let g={type:"element",tagName:a,properties:f,children:[]};h&&(g.children=e.all(h),e.patch(h,g),g=e.applyData(h,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function NHe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const T5=9,O5=32;function kHe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const a=[];for(;r;)a.push(R5(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(R5(t.slice(s),s>0,!1)),a.join("")}function R5(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===T5||a===O5;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===T5||a===O5;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function _He(e,t){const n={type:"text",value:kHe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function CHe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const EHe={blockquote:rHe,break:sHe,code:iHe,delete:aHe,emphasis:oHe,footnoteReference:lHe,heading:cHe,html:uHe,imageReference:dHe,image:hHe,inlineCode:fHe,linkReference:mHe,link:pHe,listItem:gHe,list:xHe,paragraph:vHe,root:bHe,strong:wHe,table:jHe,tableCell:NHe,tableRow:SHe,text:_He,thematicBreak:CHe,toml:qy,yaml:qy,definition:qy,footnoteDefinition:qy};function qy(){}const vY=-1,Tw=0,hm=1,Cb=2,MP=3,IP=4,$P=5,LP=6,bY=7,wY=8,AHe=typeof self=="object"?self:globalThis,M5=(e,t)=>
vendor: 5,739 bytes, lines 959-961
959{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new AHe[e](t)},PHe=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case Tw:case vY:return n(o,s);case hm:{const l=n([],s);for(const c of o)l.push(r(c));return l}case Cb:{const l=n({},s);for(const[c,u]of o)l[r(c)]=r(u);return l}case MP:return n(new Date(o),s);case IP:{const{source:l,flags:c}=o;return n(new RegExp(l,c),s)}case $P:{const l=n(new Map,s);for(const[c,u]of o)l.set(r(c),r(u));return l}case LP:{const l=n(new Set,s);for(const c of o)l.add(r(c));return l}case bY:{const{name:l,message:c}=o;return n(M5(l,c),s)}case wY:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(M5(a,o),s)};return r},I5=e=>PHe(new Map,e)(0),hu="",{toString:THe}={},{keys:OHe}=Object,vf=e=>{const t=typeof e;if(t!=="object"||!e)return[Tw,t];const n=THe.call(e).slice(8,-1);switch(n){case"Array":return[hm,hu];case"Object":return[Cb,hu];case"Date":return[MP,hu];case"RegExp":return[IP,hu];case"Map":return[$P,hu];case"Set":return[LP,hu];case"DataView":return[hm,n]}return n.includes("Array")?[hm,n]:n.includes("Error")?[bY,n]:[Cb,n]},Ky=([e,t])=>e===Tw&&(t==="function"||t==="symbol"),RHe=(e,t,n,r)=>{const s=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=vf(o);switch(l){case Tw:{let d=o;switch(c){case"bigint":l=wY,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([vY],o)}return s([l,d],o)}case hm:{if(c){let f=o;return c==="DataView"?f=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(o)),s([c,[...f]],o)}const d=[],h=s([l,d],o);for(const f of o)d.push(a(f));return h}case Cb:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],h=s([l,d],o);for(const f of OHe(o))(e||!Ky(vf(o[f])))&&d.push([a(f),a(o[f])]);return h}case MP:return s([l,o.toISOString()],o);case IP:{const{source:d,flags:h}=o;return s([l,{source:d,flags:h}],o)}case $P:{const d=[],h=s([l,d],o);for(const[f,m]of o)(e||!(Ky(vf(f))||Ky(vf(m))))&&d.push([a(f),a(m)]);return h}case LP:{const d=[],h=s([l,d],o);for(const f of o)(e||!Ky(vf(f)))&&d.push(a(f));return h}}const{message:u}=o;return s([l,{name:c,message:u}],o)};return a},$5=(e,{json:t,lossy:n}={})=>{const r=[];return RHe(!(t||n),!!t,new Map,r)(e),r},Eb=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?I5($5(e,t)):structuredClone(e):(e,t)=>I5($5(e,t));function MHe(e,t){const n=[{type:"text",value:"â©"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function IHe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $He(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||MHe,r=e.options.footnoteBackLabel||IHe,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),h=String(u.identifier).toUpperCase(),f=Uh(h.toLowerCase());let m=0;const g=[],p=e.footnoteCounts.get(h);for(;p!==void 0&&++m<=p;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,m);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else d.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(d,!0)};e.patch(u,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Eb(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` 960`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` 961`}]}}const jY=function(e){if(e==null)return BHe;if(typeof e=="function")return Ow(e);if(typeof e=="object")return Array.isArray(e)?LHe(e):DHe(e);if(typeof e=="string")return FHe(e);throw new Error("Expected function, string, or object as test")};function LHe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=jY(e[n]);return Ow(r);function r(...s){let a=-1;for(;++a<t.length;)if(t[a].apply(this,s))return!0;return!1}}function DHe(e){const t=e;return Ow(n);function n(r){const s=r;let a;for(a in e)if(s[a]!==t[a])return!1;return!0}}function FHe(e){return Ow(t);function t(n){return n&&n.type===e}}function Ow(e){return t;function t(n,r,s){return!!(zHe(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function BHe(){return!0}function zHe(e){return e!==null&&typeof e=="object"&&"type"in e}const SY=[],UHe=!0,L5=!1,VHe="skip";function WHe(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const a=jY(s),o=r?-1:1;l(e,void 0,[])();function l(c,u,d){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const m=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;
vendor: 16,902 bytes, lines 961-965
961Object.defineProperty(f,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=SY,g,p,x;if((!t||a(c,u,d[d.length-1]||void 0))&&(m=HHe(n(c,d)),m[0]===L5))return m;if("children"in c&&c.children){const v=c;if(v.children&&m[0]!==VHe)for(p=(r?v.children.length:-1)+o,x=d.concat(v);p>-1&&p<v.children.length;){const b=v.children[p];if(g=l(b,p,x)(),g[0]===L5)return g;p=typeof g[1]=="number"?g[1]:p+o}}return m}}}function HHe(e){return Array.isArray(e)?e:typeof e=="number"?[UHe,e]:e==null?SY:[e]}function NY(e,t,n,r){let s,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,s=n):(a=t,o=n,s=r),WHe(e,a,l,s);function l(c,u){const d=u[u.length-1],h=d?d.children.indexOf(c):void 0;return o(c,h,d)}}const dC={}.hasOwnProperty,qHe={};function KHe(e,t){const n=t||qHe,r=new Map,s=new Map,a=new Map,o={...EHe,...n.handlers},l={all:u,applyData:YHe,definitionById:r,footnoteById:s,footnoteCounts:a,footnoteOrder:[],handlers:o,one:c,options:n,patch:GHe,wrap:JHe};return NY(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:s,f=String(d.identifier).toUpperCase();h.has(f)||h.set(f,d)}}),l;function c(d,h){const f=d.type,m=l.handlers[f];if(dC.call(l.handlers,f)&&m)return m(l,d,h);if(l.options.passThrough&&l.options.passThrough.includes(f)){if("children"in d){const{children:p,...x}=d,v=Eb(x);return v.children=l.all(d),v}return Eb(d)}return(l.options.unknownHandler||XHe)(l,d,h)}function u(d){const h=[];if("children"in d){const f=d.children;let m=-1;for(;++m<f.length;){const g=l.one(f[m],d);if(g){if(m&&f[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=D5(g.value)),!Array.isArray(g)&&g.type==="element")){const p=g.children[0];p&&p.type==="text"&&(p.value=D5(p.value))}Array.isArray(g)?h.push(...g):h.push(g)}}}return h}}function GHe(e,t){e.position&&(t.position=PUe(e))}function YHe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,Eb(a)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function XHe(e,t){const n=t.data||{},r="value"in t&&!(dC.call(n,"hProperties")||dC.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function JHe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:` 962`});++r<e.length;)r&&n.push({type:"text",value:` 963`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:` 964`}),n}function D5(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function F5(e,t){const n=KHe(e,t),r=n.one(e,void 0),s=$He(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` 965`},s),a}function QHe(e,t){return e&&"run"in e?async function(n,r){const s=F5(n,{file:r,...t});await e.run(s,r)}:function(n,r){return F5(n,{file:r,...e||t})}}function B5(e){if(e)throw e}var kx=Object.prototype.hasOwnProperty,kY=Object.prototype.toString,z5=Object.defineProperty,U5=Object.getOwnPropertyDescriptor,V5=function(t){return typeof Array.isArray=="function"?Array.isArray(t):kY.call(t)==="[object Array]"},W5=function(t){if(!t||kY.call(t)!=="[object Object]")return!1;var n=kx.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&kx.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var s;for(s in t);return typeof s>"u"||kx.call(t,s)},H5=function(t,n){z5&&n.name==="__proto__"?z5(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},q5=function(t,n){if(n==="__proto__")if(kx.call(t,n)){if(U5)return U5(t,n).value}else return;return t[n]},ZHe=function e(){var t,n,r,s,a,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=q5(l,n),s=q5(t,n),l!==s&&(d&&s&&(W5(s)||(a=V5(s)))?(a?(a=!1,o=r&&V5(r)?r:[]):o=r&&W5(r)?r:{},H5(l,{name:n,newValue:e(d,o,s)})):typeof s<"u"&&H5(l,{name:n,newValue:s}));return l};const z1=it(ZHe);function hC(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function e9e(){const e=[],t={run:n,use:r};return t;function n(...s){let a=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(c,...u){const d=e[++a];let h=-1;if(c){o(c);return}for(;++h<s.length;)(u[h]===null||u[h]===void 0)&&(u[h]=s[h]);s=u,d?t9e(d,l)(...u):o(null,...u)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function t9e(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(s);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,s):c instanceof Error?s(c):a(c))}function s(o,...l){n||(n=!0,t(o,...l))}function a(o){s(null,o)}}const xi={basename:n9e,dirname:r9e,extname:s9e,join:i9e,sep:"/"};function n9e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');kg(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function r9e(e){if(kg(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function s9e(e){kg(e);let t=e.length,n=-1,r=0,s=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function i9e(...e){let t=-1,n;for(;++t<e.length;)kg(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":a9e(n)}function a9e(e){kg(e);const t=e.codePointAt(0)===47;let n=o9e(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function o9e(e,t){let n="",r=0,s=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||a===1))if(s!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",r=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function kg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const l9e={cwd:c9e};function c9e(){return"/"}function fC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function u9e(e){if(typeof e=="string")e=new URL(e);else if(!fC(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return d9e(e)}function d9e(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const U1=["history","path","basename","stem","extname","dirname"];class _Y{constructor(t){let n;t?fC(t)?n={path:t}:typeof t=="string"||h9e(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":l9e.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<U1.length;){const a=U1[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let s;for(s in n)U1.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?xi.basename(this.path):void 0}set basename(t){W1(t,"basename"),V1(t,"basename"),this.path=xi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?xi.dirname(this.path):void 0}set dirname(t){K5(this.basename,"dirname"),this.path=xi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?xi.extname(this.path):void 0}set extname(t){if(V1(t,"extname"),K5(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){fC(t)&&(t=u9e(t)),W1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?xi.basename(this.path,this.extname):void 0}set stem(t){W1(t,"stem"),V1(t,"stem"),this.path=xi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new Jn(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function V1(e,t){if(e&&e.includes(xi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+xi.sep+"`")}function W1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function K5(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function h9e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const f9e=function(e){const r=this.constructor.prototype,s=r[e],a=function(){return s.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},m9e={}.hasOwnProperty;class DP extends f9e{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=e9e()}copy(){const t=new DP;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(z1(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(K1("data",this.frozen),this.namespace[t]=n,this):m9e.call(this.namespace,t)&&this.namespace[t]||void 0:t?(K1("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Gy(t),r=this.parser||this.Parser;return H1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),H1("process",this.parser||this.Parser),q1("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(a,o){const l=Gy(t),c=r.parse(l);r.run(c,l,function(d,h,f){if(d||!h||!f)return u(d);const m=h,g=r.stringify(m,f);y9e(g)?f.value=g:f.result=g,u(d,f)});function u(d,h){d||!h?o(d):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),H1("processSync",this.parser||this.Parser),q1("processSync",this.compiler||this.Compiler),this.process(t,s),Y5("processSync","process",n),r;function s(a,o){n=!0,B5(a),r=o}}run(t,n,r){G5(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,l){const c=Gy(n);s.run(t,c,u);function u(d,h,f){const m=h||t;d?l(d):o?o(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,s;return this.run(t,n,a),Y5("runSync","run",r),s;function a(o,l){B5(o),s=l,r=!0}}stringify(t,n){this.freeze();const r=Gy(n),s=this.compiler||this.Compiler;return q1("stringify",s),G5(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(K1("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;c(d,h)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(s.settings=z1(!0,s.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];a(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let h=-1,f=-1;for(;++h<r.length;)if(r[h][0]===u){f=h;break}if(f===-1)r.push([u,...d]);else if(d.length>0){let[m,...g]=d;const p=r[f][1];hC(p)&&hC(m)&&(m=z1(!0,p,m)),r[f]=[u,m,...g]}}}}const p9e=new DP().freeze();function H1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function q1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function K1(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function G5(e){if(!hC(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Y5(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gy(e){return g9e(e)?e:new _Y(e)}function g9e(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function y9e(e){return typeof e=="string"||x9e(e)}function x9e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const v9e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",X5=[],J5={allowDangerousHtml:!0},b9e=/^(https?|ircs?|mailto|xmpp)$/i,w9e=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function j9e(e){const t=S9e(e),n=N9e(e);return k9e(t.runSync(t.parse(n),n),e)}function S9e(e){const t=e.rehypePlugins||X5,n=e.remarkPlugins||X5,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...J5}:J5;return p9e().use(nHe).use(n).use(QHe,r).use(t)}function N9e(e){const t=e.children||"",n=new _Y;return typeof t=="string"&&(n.value=t),n}function k9e(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||_9e;for(const d of w9e)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+v9e+d.id,void 0);return NY(e,u),IUe(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function u(d,h,f){if(d.type==="raw"&&f&&typeof h=="number")return o?f.children.splice(h,1):f.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let m;
965for(m in D1)if(Object.hasOwn(D1,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],p=D1[m];(p===null||p.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!m&&r&&typeof h=="number"&&(m=!r(d,h,f)),m&&f&&typeof h=="number")return l&&d.children?f.children.splice(h,1,...d.children):f.children.splice(h,1),h}}}function _9e(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||b9e.test(e.slice(0,t))?e:""}var C9e="AspectRatio",CY=y.forwardRef((e,t)=>{const{ratio:n=1/1,style:r,...s}=e;return i.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/n}%`},"data-radix-aspect-ratio-wrapper":"",children:i.jsx(ve.div,{...s,ref:t,style:{...r,position:"absolute",top:0,right:0,bottom:0,left:0}})})});CY.displayName=C9e;var E9e=CY;const A9e=E9e;function ds(e){return typeof e=="string"?e:null}function P9e(e){return ds(e)||ds(e==null?void 0:e.lesson)||ds(e==null?void 0:e.reading)||ds(e==null?void 0:e.body)||ds(e==null?void 0:e.text)||ds(e==null?void 0:e.content)||ds(e==null?void 0:e.summary)}function T9e(e){return ds(e==null?void 0:e.video_url)||ds(e==null?void 0:e.videoUrl)||ds(e==null?void 0:e.video)||ds(e==null?void 0:e.video_link)||ds(e==null?void 0:e.videoLink)}function O9e(e){const{content:t}=e,n=P9e(t),r=Array.isArray(t==null?void 0:t.bullets)?t.bullets:Array.isArray(t==null?void 0:t.points)?t.points:null,s=Array.isArray(t==null?void 0:t.steps)?t.steps:null,a=Array.isArray(t==null?void 0:t.checklist)?t.checklist:null,o=e.videoUrl??T9e(t);return i.jsxs("div",{className:"space-y-6",children:[o?i.jsx("div",{className:"overflow-hidden rounded-xl border border-border/50 bg-card",children:i.jsx(A9e,{ratio:16/9,children:i.jsx("iframe",{title:"Lesson video",src:o,className:"h-full w-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}):null,n?i.jsx("div",{className:"text-sm leading-6 text-foreground",children:i.jsx(j9e,{components:{h1:l=>i.jsx("h2",{className:"text-xl font-semibold tracking-tight text-foreground",...l}),h2:l=>i.jsx("h3",{className:"text-lg font-semibold tracking-tight text-foreground",...l}),h3:l=>i.jsx("h4",{className:"text-base font-semibold text-foreground",...l}),p:l=>i.jsx("p",{className:"my-3 whitespace-pre-wrap",...l}),ul:l=>i.jsx("ul",{className:"my-3 list-disc pl-5 space-y-1",...l}),ol:l=>i.jsx("ol",{className:"my-3 list-decimal pl-5 space-y-1",...l}),a:l=>i.jsx("a",{className:"text-primary underline underline-offset-4",target:"_blank",rel:"noreferrer",...l}),code:l=>i.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",...l})},children:n})}):null,r!=null&&r.length?i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Key points"}),i.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm text-foreground",children:r.map((l,c)=>i.jsx("li",{className:"whitespace-pre-wrap",children:l},c))})]}):null,s!=null&&s.length?i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Steps"}),i.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm text-foreground",children:s.map((l,c)=>i.jsx("li",{className:"whitespace-pre-wrap",children:l},c))})]}):null,a!=null&&a.length?i.jsxs("div",{className:"space-y-2 rounded-lg border border-primary/40 bg-primary/5 p-4",children:[i.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"On-farm checklist"}),i.jsx("ul",{className:"space-y-1 text-sm text-foreground",children:a.map((l,c)=>i.jsxs("li",{className:"flex gap-2",children:[i.jsx("span",{className:"mt-1 h-3 w-3 shrink-0 rounded-sm border border-foreground
965/60"}),l]},c))})]}):null,!o&&!n&&!(r!=null&&r.length)&&!(s!=null&&s.length)?i.jsx("pre",{className:"whitespace-pre-wrap break-words rounded-md bg-muted p-3 text-xs text-foreground",children:JSON.stringify(t??{},null,2)}):null]})}const mC="storage:learning-resources/";function R9e(e){switch(e){case"video":return bE;case"image":return yB;case"link":return YZ;default:return En}}async function M9e(e){if(e.startsWith(mC)){const{data:t}=await q.storage.from("learning-resources").createSignedUrl(e.slice(mC.length),3600);t!=null&&t.signedUrl&&window.open(t.signedUrl,"_blank","noopener");return}window.open(e,"_blank","noopener")}function I9e(e){const{resources:t,loading:n,courseId:r,moduleId:s,onChanged:a}=e,{toast:o}=We(),[l,c]=y.useState(!1),[u,d]=y.useState(!1),[h,f]=y.useState(""),[m,g]=y.useState(""),[p,x]=y.useState(""),[v,b]=y.useState(null),[w,j]=y.useState("lesson"),[S,N]=y.useState(!1);y.useEffect(()=>{q.rpc("can_manage_courses").then(({data:C})=>c(!!C))},[]);const k=async()=>{if(!(!h.trim()||!p.trim()&&!v||!r)){N(!0);try{let C=p.trim(),A="link";if(v){const P=`${r}/${Date.now()}_${v.name.replace(/[^a-z0-9.\-_]/gi,"_")}`,{error:$}=await q.storage.from("learning-resources").upload(P,v);if($)throw $;C=mC+P,A=v.type.startsWith("image/")?"image":v.type.startsWith("video/")?"video":"document"}const{error:E}=await q.from("learning_resources").insert({title:h.trim(),description:m.trim()||null,resource_type:A,resource_url:C,course_id:r,module_id:w==="lesson"?s??null:null});if(E)throw E;d(!1),f(""),g(""),x(""),b(null),o({title:"Resource added"}),a==null||a()}catch(C){o({title:"Could not add resource",description:C==null?void 0:C.message,variant:"destructive"})}finally{N(!1)}}},_=async C=>{const{error:A}=await q.from("learning_resources").delete().eq("id",C);A||a==null||a()};return i.jsxs(z,{className:"h-fit",children:[i.jsxs(re,{className:"flex flex-row items-center justify-between space-y-0",children:[i.jsx(se,{className:"text-base text-foreground",children:"Resources"}),l&&i.jsxs(U,{size:"sm",variant:"outline",onClick:()=>d(!0),children:[i.jsx(rn,{className:"h-4 w-4 mr-1"})," Add"]})]}),i.jsxs(V,{className:"space-y-2",children:[n?i.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading resourcesâ¦"}):null,!n&&t.length===0?i.jsx("div",{className:"text-sm text-muted-foreground",children:"No extra resources for this lesson yet."}):null,t.map(C=>{const A=R9e(C.resource_type);return i.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-border/50 bg-card/50 p-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),i.jsx("div",{className:"text-sm font-medium text-foreground",children:C.title})]}),C.description?i.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:C.description}):null]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C.resource_url?i.jsxs(U,{size:"sm",variant:"secondary",onClick:()=>M9e(C.resource_url),children:["Open ",i.jsx(pB,{className:"ml-2 h-4 w-4"})]}):null,l&&i.jsx(U,{size:"icon",variant:"ghost",onClick:()=>_(C.id),"aria-label":"Remove resource",children:i.jsx(cl,{className:"h-4 w-4"})})]})]},C.id)})]}),i.jsx(yt,{open:u,onOpenChange:d,children:i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Add a resource"})}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(ne,{children:"Title"}),i.jsx(ae,{value:h,onChange:C=>f(C.target.value)})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(ne,{children:"Short description"}),i.jsx(ae,{value:m,onChange:C=>g(C.target.value)})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(ne,{children:"Link (website or video)"}),i.jsx(ae,{placeholder:"https://",value:p,onChange:C=>x(C.target.value),disabled:!!v})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsx(ne,{children:"Or upload a file (PDF, image, video)"}),i.jsx(ae,{type:"file",onChange:C=>{var A;return b(((A=C.target.files)==null?void 0:A[0])??null)}})]}),i.jsx("div",{className:"flex gap-2",children:["lesson","course"].map(C=>i.jsx(U,{type:"button",size:"sm",variant:w===C?"default":"outline",onClick:()=>j(C),children:C==="lesson"?"This lesson only":"Whole course"}
965,C))}),i.jsx(U,{className:"w-full",onClick:k,disabled:S,children:S?"Savingâ¦":"Save resource"})]})]})})]})}function $9e(){var $,R,L;const{courseId:e}=Lz(),t=Ki(),{toast:n}=We(),[r,s]=y.useState(null),[a,o]=y.useState(null),[l,c]=y.useState(!0),[u,d]=y.useState(null);y.useEffect(()=>{(async()=>{try{c(!0);const{data:I}=await q.auth.getUser(),M=I.user;if(!M){n({title:"Please sign in",description:"Sign in or create a free learner account to start."}),t(`/learning?signin=1&course=${e??""}`);return}if(!e)return;const[{data:H,error:T},{data:B,error:Y}]=await Promise.all([q.from("courses").select("id,title,description").eq("id",e).single(),q.from("course_assignments").select("id").eq("course_id",e).eq("farmer_id",M.id).single()]);if(T)throw T;if(Y){n({title:"Not enrolled",description:"Enroll in this course first from the course list.",variant:"destructive"}),t("/learning");return}s(H),o((B==null?void 0:B.id)??null)}catch(I){console.error(I),n({title:"Error",description:"Failed to load course.",variant:"destructive"}),t("/learning")}finally{c(!1)}})()},[e,t,n]);const{modules:h,progressByModuleId:f,percentComplete:m,loading:g,toggleModule:p}=M8e({assignmentId:a,courseId:e??null}),x=y.useMemo(()=>m>=100,[m]),[v,b]=y.useState(null);y.useEffect(()=>{!x||!a||v||h.length===0||q.rpc("complete_course",{_assignment_id:a}).then(({data:D,error:I})=>{if(I){console.error(I);return}b(D),n({title:"Certificate earned",description:"Well done! Your certificate is ready in the Learning Hub."})})},[x,a,v,h.length,n]),y.useEffect(()=>{h.length!==0&&d(D=>D??h[0].id)},[h]);const w=y.useMemo(()=>h.find(D=>D.id===u)??null,[h,u]),j=y.useMemo(()=>h.findIndex(D=>D.id===u),[h,u]),S=j>0?h[j-1]:null,N=j>=0&&j<h.length-1?h[j+1]:null,{resources:k,loading:_,videoResource:C,refetch:A}=D8e({courseId:e??null,moduleId:(w==null?void 0:w.id)??null}),[E,P]=y.useState(!0);return l?i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsx("div",{className:"text-muted-foreground",children:"Loading courseâ¦"})}):r?i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("header",{className:"sticky top-0 z-10 border-b bg-card/80 backdrop-blur-sm",children:i.jsx("div",{className:"mx-auto w-full max-w-6xl px-4 py-3",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(Ke,{to:"/learning",children:i.jsxs(U,{variant:"ghost",size:"sm",children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back"]})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"truncate text-sm font-semibold text-foreground",children:r.title}),i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:w?w.title:"Lessons"})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[x?v?i.jsxs(U,{size:"sm",onClick:()=>t("/learning?tab=certificates"),children:[i.jsx(Fr,{className:"h-4 w-4 mr-2"})," View certificate"]}):i.jsxs("div",{className:"hidden sm:inline-flex items-center text-xs text-muted-foreground",children:[i.jsx(qr,{className:"h-4 w-4 mr-2"})," Completed"]}):null,i.jsx("div",{className:"w-28 sm:w-44",children:i.jsx(rr,{value:m,className:"h-2"})}),i.jsxs("div",{className:"text-sm font-semibold text-foreground tabular-nums",children:[m,"%"]})]})]})})}),i.jsx("main",{className:"mx-auto w-full max-w-6xl px-4 py-5",children:i.jsxs("div",{className:"grid gap-4 lg:grid-cols-[360px_1fr]",children:[i.jsxs("aside",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Course content"}),i.jsxs("div",{className:"text-xs text-muted-foreground",children:[h.length," lessons"]})]}),g?i.jsx(z,{children:i.jsx(V,{className:"py-6 text-muted-foreground",children:"Loading lessonsâ¦"})}):h.length===0?i.jsx(z,{children:i.jsxs(V,{className:"py-10 text-center text-muted-foreground",children:[i.jsx(tn,{className:"h-8 w-8 mx-auto mb-2"}),"This course has no lessons yet.",i.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Please check back when lessons are added."})]})}):i.jsx("div",{className:"space-y-2",children:h.map((D,I)=>{var Y,O;const M=f.get(D.id),H=!!(M!=null&&M.is_completed),T=D.id===u,B=((Y=D==null?void 0:D.content)==null?void 0:Y.summary)??((O=D==null?void 0:D.content)==null?void 0:O.content);return i.jsx(z,{className:T?"ring-1 ring-ring":void 0,role:"button",tabIndex:0,onClick:()=>d(D.id),onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&d(D.id)},"aria-label":`Open lesson ${I+1}: ${D.title}`,children:i.jsx(re,{className:"pb-3",children:i.jsxs("div",{className:"flex items-start gap-3",children:[H?i.jsx(qr,{className:"h-5 w-5 text-primary shrink-0","aria-label":"Completed"}):i.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-border text-[10px] text-muted-foreground",children:I+1}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs(se,{className:"text-base text-foreground",children:[I+1,". ",D.title]}
965),typeof B=="string"&&B.trim().length>0?i.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:B}):null]})]})})},D.id)})})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsxs(z,{children:[i.jsx(re,{className:"pb-3",children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx(se,{className:"text-base text-foreground",children:w?w.title:"Select a lesson"}),r.description?i.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:r.description}):null]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(U,{variant:"secondary",size:"sm",onClick:()=>S&&d(S.id),disabled:!S,children:[i.jsx(dB,{className:"mr-2 h-4 w-4"})," Prev"]}),i.jsxs(U,{variant:"secondary",size:"sm",onClick:()=>N&&d(N.id),disabled:!N,children:["Next ",i.jsx(Qs,{className:"ml-2 h-4 w-4"})]})]})]})}),i.jsx(V,{className:"space-y-4",children:w?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex justify-end",children:i.jsxs(U,{size:"sm",variant:"outline",onClick:()=>L8e(r.title,w.title,w.content),children:[i.jsx(qo,{className:"h-4 w-4 mr-2"})," Download notes (PDF)"]})}),i.jsx(O9e,{content:w.content,videoUrl:C!=null&&C.resource_url&&!C.resource_url.startsWith("storage:")?C.resource_url:null})]}):i.jsx("div",{className:"text-sm text-muted-foreground",children:"Pick a lesson from the left to start learning."})})]}),w?i.jsxs(i.Fragment,{children:[i.jsx(I8e,{moduleId:w.id,assignmentId:a,completed:!!(($=f.get(w.id))!=null&&$.is_completed),onNoQuiz:P,onPassed:async()=>{await p(w.id,!0)}}),!E&&!((R=f.get(w.id))!=null&&R.is_completed)&&i.jsxs(U,{onClick:()=>p(w.id,!0),children:[i.jsx(qr,{className:"h-4 w-4 mr-2"})," Mark lesson complete"]}),((L=f.get(w.id))==null?void 0:L.is_completed)&&N&&i.jsxs(U,{variant:"secondary",onClick:()=>d(N.id),children:["Next lesson ",i.jsx(Qs,{className:"ml-2 h-4 w-4"})]}),i.jsx(I9e,{resources:k,loading:_,courseId:e,moduleId:w.id,onChanged:A})]}):null]})]})})]}):null}const to={communityMembers:135,registeredUsers:206,farmers:135,incubators:2,marketplaceListings:8,flocksManaged:9,communityPosts:14,courseEnrollments:6},L9e=[{month:"Aug '25",users:3},{month:"Sep '25",users:14},{month:"Oct '25",users:38},{month:"Nov '25",users:50},{month:"Dec '25",users:54},{month:"Jan '26",users:60},{month:"Feb '26",users:64}],D9e=[{type:"Mixed",count:27},{type:"Broilers",count:14},{type:"Layers",count:5},{type:"Not specified",count:16}],F9e=[{location:"Gauteng",count:12},{location:"Pretoria",count:4},{location:"Cape Town",count:1},{location:"Durban, KZN",count:1},{location:"Maseru",count:1}],B9e=[{label:"Community Members",value:to.communityMembers,icon:ht,accent:"text-primary"},{label:"Registered Users",value:to.registeredUsers,icon:ht,accent:"text-emerald-500"},{label:"Active Farmers",value:to.farmers,icon:Tm,accent:"text-green-600"},{label:"Incubator Partners",value:to.incubators,icon:dh,accent:"text-blue-500"},{label:"Marketplace Listings",value:to.marketplaceListings,icon:mo,accent:"text-amber-500"},{label:"Flocks Managed",value:to.flocksManaged,icon:Ho,accent:"text-orange-500"},{label:"Community Posts",value:to.communityPosts,icon:Pm,accent:"text-violet-500"},{label:"Course Enrollments",value:to.courseEnrollments,icon:tn,accent:"text-cyan-500"}],z9e=()=>{const e=Ki();return i.jsx("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-8 space-y-8",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(U,{variant:"ghost",size:"icon",onClick:()=>e(-1),children:i.jsx(jt,{className:"h-5 w-5"})}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-3xl font-bold tracking-tight text-foreground",children:"Platform Metrics"}),i.jsx("p",{className:"text-muted-foreground mt-1",children:"Real-time Flockify platform statistics"})]})]}),i.jsx(ye,{variant:"outline",className:"text-xs",children:"Live Data"})]}),i.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:B9e.map(t=>i.jsx(z,{className:"glass-card",children:i.jsxs(V,{className:"p-5 flex flex-col items-center text-center gap-2",children:[i.jsx(t.icon,{className:`h-6 w-6 ${t.accent}`}),i.jsx("span",{className:"text-3xl font-bold text-foreground",children:t.value.toLocaleStr
965ing()}),i.jsx("span",{className:"text-xs text-muted-foreground leading-tight",children:t.label})]})},t.label))}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{className:"text-lg",children:"User Growth"})}),i.jsx(V,{children:i.jsx("div",{className:"h-64",children:i.jsx(Hv,{width:"100%",height:"100%",children:i.jsxs(yFe,{data:L9e,children:[i.jsx("defs",{children:i.jsxs("linearGradient",{id:"colorUsers",x1:"0",y1:"0",x2:"0",y2:"1",children:[i.jsx("stop",{offset:"5%",stopColor:"hsl(var(--primary))",stopOpacity:.3}),i.jsx("stop",{offset:"95%",stopColor:"hsl(var(--primary))",stopOpacity:0})]})}),i.jsx(Ip,{strokeDasharray:"3 3",className:"stroke-border"}),i.jsx(Fa,{dataKey:"month",tick:{fill:"hsl(var(--muted-foreground))",fontSize:12}}),i.jsx(Ba,{tick:{fill:"hsl(var(--muted-foreground))",fontSize:12}}),i.jsx(Dr,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",color:"hsl(var(--foreground))"}}),i.jsx(wl,{type:"monotone",dataKey:"users",stroke:"hsl(var(--primary))",fill:"url(#colorUsers)",strokeWidth:2})]})})})})]}),i.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsxs(se,{className:"text-lg flex items-center gap-2",children:[i.jsx(Tm,{className:"h-5 w-5 text-green-600"})," Farming Types"]})}),i.jsx(V,{children:i.jsx("div",{className:"h-48",children:i.jsx(Hv,{width:"100%",height:"100%",children:i.jsxs(jq,{data:D9e,layout:"vertical",children:[i.jsx(Ip,{strokeDasharray:"3 3",className:"stroke-border"}),i.jsx(Fa,{type:"number",tick:{fill:"hsl(var(--muted-foreground))",fontSize:12}}),i.jsx(Ba,{dataKey:"type",type:"category",width:100,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12}}),i.jsx(Dr,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",color:"hsl(var(--foreground))"}}),i.jsx(bl,{dataKey:"count",fill:"hsl(var(--primary))",radius:[0,4,4,0]})]})})})})]}),i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsxs(se,{className:"text-lg flex items-center gap-2",children:[i.jsx(ts,{className:"h-5 w-5 text-red-500"})," Top Locations"]})}),i.jsx(V,{children:i.jsx("div",{className:"space-y-3",children:F9e.map(t=>i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-foreground",children:t.location}),i.jsx(ye,{variant:"secondary",children:t.count})]},t.location))})})]})]})]})})};function EY({courseId:e,canCreate:t=!1}){const[n,r]=y.useState([]),[s,a]=y.useState(!0),[o,l]=y.useState(""),[c,u]=y.useState(""),[d,h]=y.useState(!1),{toast:f}=We(),m=async()=>{try{let x=q.from("course_announcements").select("*").order("created_at",{ascending:!1});e&&(x=x.or(`course_id.eq.${e},course_id.is.null`));const{data:v,error:b}=await x;if(b){console.error("Error fetching announcements:",b);return}r(v||[])}catch(x){console.error("Announcements fetch error:",x)}finally{a(!1)}},g=async()=>{if(!(!o.trim()||!c.trim()))try{const{data:{user:x}}=await q.auth.getUser();if(!x)return;const{error:v}=await q.from("course_announcements").insert({course_id:e||null,author_id:x.id,title:o.trim(),content:c.trim()});if(v){console.error("Error creating announcement:",v),f({title:"Error",description:"Failed to create announcement",variant:"destructive"});return}f({title:"Success",description:"Announcement posted!"}),l(""),u(""),h(!1),m()}catch(x){console.error("Create announcement error:",x)}},p=async x=>{const{error:v}=await q.from("course_announcements").delete().eq("id",x);v||(m(),f({title:"Deleted",description:"Announcement removed"}))};return y.useEffect(()=>{m()},[e]),s?i.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"Loading announcements..."}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[i.jsx(ZZ,{className:"h-5 w-5 text-primary"}),"Announcements"]}),t&&i.jsxs(yt,{open:d,onOpenChange:h,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{size:"sm",className:"bg-green-600 hover:bg-green-700",children:[i.jsx(rn,{className:"h-4 w-4 mr-1"}),"New Announcement"]})}),i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Post Announcement"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(ae,{placeholder:"Announcement title",value:o,onChange:x=>l(x.target.value),maxLength:200}),i.jsx(Yt,{placeholder:"Announcement content...",value:c,onChange:x=>u(x.target.value),rows:4,maxLength:2e3}),i.jsx(U,{onClick:g,className:"w-full bg-green-600 hover:bg-green-700",children:"Post Announcement"})]})]})]})]}),n.length===0?i.jsx(z,{children:i.jsx(V,{className:"p-8 text-center text-muted-foreground",children:"No announcements yet."})}):n.map(x=>i.jsx(z,{className:"border-l-4 border-l-green-500",children:i.jsx(V,{className:"p-4",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"font-semibold",children:x.title}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1 whitespace-pre-wrap",children:x.content}),i.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground",children:[i.jsx(js,{className:"h-3 w-3"}),new Date(x.created_at).toLocaleDateString("en-ZA",{dateStyle:"medium"}),!x.course_id&&i.jsx(ye,{variant:"outline",className:"text-xs",children:"Global"})]})]}),t&&i.jsx(U,{variant:"ghost",size:"icon",onClick:()=>p(x.id),children:i.jsx(cl,{className:"h-4 w-4 text-destructive"})})]})})},x.id))]})}function U9e({activityId:e,courseId:t,maxGrade:n}){const[r,s]=y.useState([]),[a,o]=y.useState([]),[l,c]=y.useState(!0),[u,d]=y.useState(null),[h,f]=y.useState(""),[m,g]=y.useState(""),{toast:p}=We();y.useEffect(()=>{x()},[e,t]);const x=async()=>{c(!0);try{const{data:S}=await q.from("activity_submissions").select("*").eq("activity_id",e);s(S||[]);const{data:N}=await q.from("course_assignments").select("farmer_id").eq("course_id",t),k=[...new Set((N||[]).map(_=>_.farmer_id))];if(k.length>0){const{data:_}=await q.from("profiles").select("user_id, display_name, student_number, programme").in("user_id",k);o(_||[])}}catch(S){console.error("Error fetching completion data:",S)}finally{c(!1)}},v=async()=>
965{if(!u||!h)return;const S=parseFloat(h);if(isNaN(S)||S<0||S>n)return;const{data:{user:N}}=await q.auth.getUser();if(!N)return;const{error:k}=await q.from("activity_submissions").update({grade:S,feedback:m.trim()||null,graded_by:N.id,graded_at:new Date().toISOString(),status:"graded"}).eq("id",u);if(k){p({title:"Error",description:"Failed to grade",variant:"destructive"});return}p({title:"Graded",description:"Submission graded successfully!"}),d(null),f(""),g(""),x()};if(l)return i.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading student status..."});const b=new Map(r.map(S=>[S.student_id,S])),w=a.filter(S=>b.has(S.user_id)),j=a.filter(S=>!b.has(S.user_id));return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[i.jsxs("span",{className:"flex items-center gap-1 text-green-600 font-medium",children:[i.jsx(Dt,{className:"h-4 w-4"})," ",w.length," submitted"]}),i.jsxs("span",{className:"flex items-center gap-1 text-destructive font-medium",children:[i.jsx(Jp,{className:"h-4 w-4"})," ",j.length," not submitted"]}),i.jsxs("span",{className:"text-muted-foreground",children:[a.length," enrolled"]})]}),w.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsx("p",{className:"text-sm font-medium",children:"Submitted"}),w.map(S=>{const N=b.get(S.user_id);return i.jsxs("div",{className:"flex items-center justify-between p-2 rounded bg-muted/50 text-sm",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("p",{className:"font-medium",children:S.display_name||"Student"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[S.student_number||""," ⢠",new Date(N.submitted_at).toLocaleString("en-ZA")]}),N.content&&i.jsx("p",{className:"text-xs mt-1 truncate max-w-xs",children:N.content}),N.file_url&&i.jsxs("a",{href:N.file_url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 hover:underline flex items-center gap-1 mt-1",children:[i.jsx(En,{className:"h-3 w-3"})," View file"]})]}),i.jsx("div",{className:"flex items-center gap-2",children:N.graded_at?i.jsxs(ye,{className:"bg-green-100 text-green-800",children:[N.grade,"/",n]}):i.jsx(U,{size:"sm",variant:"outline",onClick:()=>{d(N.id),f(""),g("")},children:"Grade"})})]},S.user_id)})]}),j.length>0&&i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"text-sm font-medium text-destructive",children:"Not Submitted"}),j.map(S=>i.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-destructive/5 text-sm",children:[i.jsx(js,{className:"h-3 w-3 text-destructive"}),i.jsx("span",{children:S.display_name||"Student"}),i.jsx("span",{className:"text-xs text-muted-foreground",children:S.student_number||""})]},S.user_id))]}),a.length===0&&i.jsx("p",{className:"text-sm text-muted-foreground",children:"No students enrolled in this course yet."}),i.jsx(yt,{open:!!u,onOpenChange:()=>d(null),children:i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Grade Submission"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"text-sm font-medium",children:["Grade (0â",n,")"]}),i.jsx(ae,{type:"number",min:"0",max:n,value:h,onChange:S=>f(S.target.value),placeholder:"Enter grade"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Feedback"}),i.jsx(Yt,{value:m,onChange:S=>g(S.target.value),placeholder:"Provide feedback...",rows:3,maxLength:1e3})]}),i.jsx(U,{onClick:v,className:"w-full bg-green-600 hover:bg-green-700",children:"Submit Grade"})]})]})})]})}const Q5={assignment:"Assignment",activity:"Activity",quiz:"Quiz",practical:"Practical"},V9e={assignment:"bg-blue-100 text-blue-800",activity:"bg-green-100 text-green-800",quiz:"bg-purple-100 text-purple-800",practical:"bg-orange-100 text-orange-800"},G1={assignment:{placeholder:"Describe the assignment requirements, deliverables, and rubric...",gradeDefault:"100",hint:"Written work students must submit by the due date"},activity:{placeholder:"Describe the activity, learning objectives, and expected outcomes...",gradeDefault:"50",hint:"In-class or group activity â participation-based"},quiz:{placeholder:"Describe the quiz topics, format (MCQ / short answer), and duration...",gradeDefault:"50",hint:"Timed asse
965ssment to test knowledge retention"},practical:{placeholder:"Describe the practical task, safety requirements, tools needed, and assessment criteria...",gradeDefault:"100",hint:"Hands-on task assessed on technique and outcome (70% weight)"}};function W9e({courseId:e,canManage:t=!1}){const[n,r]=y.useState([]),[s,a]=y.useState(!0),[o,l]=y.useState(!1),[c,u]=y.useState(null),[d,h]=y.useState(""),[f,m]=y.useState(""),[g,p]=y.useState("assignment"),[x,v]=y.useState(""),[b,w]=y.useState("100"),[j,S]=y.useState(!1),[N,k]=y.useState(!1),[_,C]=y.useState(null),[A,E]=y.useState(null),[P,$]=y.useState(null),{toast:R}=We(),L=async()=>{try{const{data:O,error:W}=await q.from("course_activities").select("*").eq("course_id",e).order("created_at",{ascending:!1});if(W){console.error("Error fetching activities:",W);return}r(O||[])}catch(O){console.error("Activities fetch error:",O)}finally{a(!1)}},D=()=>{h(""),m(""),p("assignment"),v(""),w("100"),u(null),C(null),E(null)},I=O=>{var W;p(O),c||w(((W=G1[O])==null?void 0:W.gradeDefault)||"100")},M=O=>{u(O.id),h(O.title),m(O.description||""),p(O.activity_type),v(O.due_date?new Date(O.due_date).toISOString().split("T")[0]:""),w(String(O.max_grade||100)),C(O.file_url||null),E(O.file_url?"Existing document":null),l(!0)},H=async O=>{var J;const W=(J=O.target.files)==null?void 0:J[0];if(!W)return;const X=10*1024*1024;if(W.size>X){R({title:"File too large",description:"Maximum file size is 10MB",variant:"destructive"});return}k(!0);try{const G=W.name.split(".").pop(),ce=`activities/${e}/${Date.now()}.${G}`,{error:ee}=await q.storage.from("course-materials").upload(ce,W);if(ee){R({title:"Upload failed",description:ee.message,variant:"destructive"});return}const{data:le}=await q.storage.from("course-materials").createSignedUrl(ce,60*60*24*365);C((le==null?void 0:le.signedUrl)||ce),E(W.name),R({title:"Uploaded",description:W.name})}catch(G){console.error("Upload error:",G)}finally{k(!1)}},T=async()=>{if(d.trim()){S(!0);try{const{data:{user:O}}=await q.auth.getUser();if(!O)return;const W={course_id:e,title:d.trim(),description:f.trim()||null,activity_type:g,due_date:x?new Date(x).toISOString():null,max_grade:parseInt(b)||100,file_url:_,created_by:O.id};if(c){const{error:X}=await q.from("course_activities").update({title:W.title,description:W.description,activity_type:W.activity_type,due_date:W.due_date,max_grade:W.max_grade,file_url:W.file_url}).eq("id",c);if(X){R({title:"Error",description:"Failed to update",variant:"destructive"});return}R({title:"Updated",description:"Activity updated!"})}else{const{error:X}=await q.from("course_activities").insert(W);if(X){R({title:"Error",description:"Failed to create",variant:"destructive"});return}R({title:"Created",description:"Activity created!"})}D(),l(!1),L()}catch(O){console.error("Save activity error:",O)}finally{S(!1)}}},B=async O=>{const{error:W}=await q.from("course_activities").delete().eq("id",O);W||(L(),R({title:"Deleted",description:"Activity removed"}))};if(y.useEffect(()=>{L()},[e]),s)return i.jsx("div",{className:"text-center py-4 text-muted-foreground",children:"Loading activities..."});const Y=G1[g]||G1.assignment;return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[i.jsx(cc,{className:"h-5 w-5 text-primary"}),"Activities & Assignments"]}),t&&i.jsxs(yt,{open:o,onOpenChange:O=>{l(O),O||D()},children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{size:"sm",className:"bg-green-600 hover:bg-green-700",children:[i.jsx(rn,{className:"h-4 w-4 mr-1"}),"Add Activity"]})}),i.jsxs(mt,{className:"max-h-[90vh] overflow-y-auto",children:[i.jsx(xt,{children:i.jsx(vt,{children:c?"Edit Activity":"Create Activity"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Activity Type"}),i.jsxs(Ye,{value:g,onValueChange:I,children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsx(qe,{children:Object.entries(Q5).map(([O,W])=>i.jsx(oe,{value:O,children:W},O))})]}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Y.hint})]}),i.jsx(ae,{placeholder:"Activity title",value:d,onChange:O=>h(O.target.value),maxLength:200}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Instructions / Description"}),i.jsx(Yt,{placeholder:Y.placeholder,value:f,onChange:O=>m(O.target.value),rows:4,maxLength:2e3})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium mb-1 block",children:"Attach Document (optional)"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:N,onClick:()=>{var O;return(O=document.getElementById("activity-file-input"))==null?void 0:O.click()},children:[i.jsx(Yb,{className:"h-4 w-4 mr-1"}),N?"Uploading...":"Upload File"]}),A&&i.jsxs("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[i.jsx(En,{className:"h-3 w-3"})," ",A]})]}),i.jsx("input",{id:"activity-file-input",type:"file",className:"hidden",accept:".pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.txt,.zip",onChange:H}),i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"PDF, Word, PowerPoint, Excel â max 10MB"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Due Date"}),i.jsx(ae,{type:"date",value:x,onChange:O=>v(O.target.value),className:"mt-1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Max Grade"}),i.jsx(ae,{type:"number",min:1,max:100,value:b,onChange:O=>w(O.target.value),className:"mt-1"})]})]}),i.jsx(U,{onClick:T,disabled:j||N,className:"w-full bg-green-600 hover:bg-green-700",children:j?"Saving...":c?"Update Activity":"Create Activity"})]})]})]})]}),n.length===0?i.jsx(z,{children:i.jsx(V,{className:"p-8 text-center text-muted-foreground",children:"No activities or assignments yet."})}):n.map(O=>{const W=O.due_date&&new Date(O.due_date)<new Date;return i.jsx(z,{children:i.jsxs(V,{className:"p-4",children:[i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1 flex-wrap",children:[i.jsx("h4",{className:"font-medium",children:O.title}),i.jsx(ye,{className:V9e[O.activity_type]||"",children:Q5[O.activity_type]||O.activity_type})]}),O.description&&i.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:O.description}),O.file_url&&i.jsxs("a",{href:O.file_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:underline flex items-center gap-1 mb-1",children:[i.jsx(En,{className:"h-3 w-3"})," View attached document"]}),i.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[O.due_date&&i.jsxs("span",{className:`flex items-center gap-1 ${W?"text-destructive font-medium":""}`,children:[i.jsx(ys,{className:"h-3 w-3"}),"Due: ",new Date(O.due_date).toLocaleDateString("en-ZA"),W&&" (overdue)"]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Fr,{className:"h-3 w-3"}),"Max: ",O.max_grade,"%"]})]})]}),t&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(U,{variant:"ghost",size:"icon",onClick:()=>$(P===O.id?null:O.id),title:"View student completions",children:i.jsx(ht,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx(U,{variant:"ghost",size:"icon",onClick:()=>M(O),children:i.jsx(wB,{className:"h-4 w-4 text-muted-foreground"})}),i.jsx(U,{variant:"ghost",size:"icon",onClick:()=>B(O.id),children:i.jsx(cl,{className:"h-4 w-4 text-destructive"})})]})]}),t&&P===O.id&&i.jsx("div",{className:"mt-4 border-t pt-4",children:i.jsx(U9e,{activityId:O.id,courseId:e,maxGrade:O.max_grade||100})})]})},O.id)})]})}function H9e(){var J;const{profile:e}=Cr(),{submissions:t,gradeSubmission:n}=SP(),[r,s]=y.useState([]),[a,o]=y.useState([]),[l,c]=y.useState([]),[u,d]=y.useState(!0),[h,f]=y.useState([]),[m,g]=y.useState(null),[p,x]=y.useState(!1),[v,b]=y.useState(""),[w,j]=y.useState(""),[S,N]=y.useState("plant-production"),[k,_]=y.useState(""),[C,A]=y.useState(""),[E,P]=y.useState(!1),[$,R]=y.useState(""),[L,D]=y.useState(""),[I,M]=y.useState(""),[H,T]=y.useState("");y.useEffect(()=>{B()},[]);const B=async()=>{try{const{data:{user:G}}=await q.auth.getUser();if(!G)return;const{data:ce}=await q.from("courses").select("*").eq("created_by",G.id).order("created_at",{ascending:!1});s(ce||[]);const ee=(ce||[]).map(Re=>Re.id);let le=[];
965if(ee.length>0){const{data:Re}=await q.from("course_assignments").select("*").in("course_id",ee);le=Re||[]}o(le);const he=[...new Set(le.map(Re=>Re.farmer_id))];if(he.length>0){const{data:Re}=await q.from("profiles").select("*").in("user_id",he);c(Re||[])}else c([]);const{data:Q}=await q.from("profiles").select("*").eq("user_type","farmer").eq("campus_enrolled",!0);f(Q||[])}catch(G){console.error("Fetch error:",G)}finally{d(!1)}},Y=async()=>{if(!v.trim())return;const{data:{user:G}}=await q.auth.getUser();if(!G)return;const{error:ce}=await q.from("courses").insert({title:v.trim(),description:w.trim()||null,category:S,course_type:"campus",created_by:G.id,qualification_level:k||null,credits:C?parseInt(C):null});ce||(x(!1),b(""),j(""),B())},O=async()=>{if(!$||!L)return;const{data:{user:G}}=await q.auth.getUser();if(!G)return;const{error:ce}=await q.from("course_assignments").insert({course_id:$,farmer_id:L,assigned_by:G.id,due_date:I||null,notes:H.trim()||null,status:"assigned",progress:0});ce||(P(!1),R(""),D(""),M(""),T(""),B())},W=t.filter(G=>!G.graded_at),X=t.filter(G=>!!G.graded_at);return u?i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsx("div",{className:"animate-spin h-8 w-8 border-b-2 border-primary mx-auto"})}):i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("div",{className:"bg-gradient-to-r from-green-800 via-green-700 to-green-600 text-white",children:i.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Ke,{to:"/",children:i.jsxs(U,{variant:"ghost",size:"sm",className:"text-white hover:bg-white/20",children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back"]})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{src:Ui,alt:"Flockify",className:"h-10 w-auto object-contain"}),i.jsxs("div",{className:"text-right",children:[i.jsx("p",{className:"text-sm text-green-100",children:"Lecturer Portal"}),i.jsx("p",{className:"font-semibold",children:(e==null?void 0:e.display_name)||"Lecturer"})]}),i.jsx(Ke,{to:"/lecturer/profile",children:i.jsx(U,{variant:"ghost",size:"sm",className:"text-white hover:bg-white/20 border border-white/30",children:"My Profile"})})]})]})})}),i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[i.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Lecturer Dashboard"}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[i.jsx(z,{className:"border-l-4 border-l-green-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(tn,{className:"h-6 w-6 text-green-600 mb-1"}),i.jsx("p",{className:"text-2xl font-bold",children:r.length}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"My Courses"})]})}),i.jsx(z,{className:"border-l-4 border-l-blue-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(ht,{className:"h-6 w-6 text-blue-600 mb-1"}),i.jsx("p",{className:"text-2xl font-bold",children:l.length}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Students"})]})}),i.jsx(z,{className:"border-l-4 border-l-yellow-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(QS,{className:"h-6 w-6 text-yellow-600 mb-1"}),i.jsx("p",{className:"text-2xl font-bold",children:W.length}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending Reviews"})]})}),i.jsx(z,{className:"border-l-4 border-l-purple-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(Dt,{className:"h-6 w-6 text-purple-600 mb-1"}),i.jsx("p",{className:"text-2xl font-bold",children:X.length}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Graded"})]})})]}),i.jsxs(Bc,{defaultValue:"courses",className:"space-y-6",children:[i.jsxs(jl,{className:"grid w-full grid-cols-4 bg-green-50",children:[i.jsx(pt,{value:"courses",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:"My Courses"}),i.jsxs(pt,{value:"submissions",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:["Submissions ",W.length>0&&i.jsx(ye,{className:"ml-1 bg-yellow-500 text-xs",children:W.length})]}),i.jsx(pt,{value:"students",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:"Students"}),i.jsx(pt,{value:"announcements",className:"data-[state=active]:bg-green-600 data-[state=active]:text-white",children:"Announcements"})]}),i.jsxs(tt,{value:"courses",className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"My Courses"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(yt,{open:E,onOpenChange:P,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"sm",children:[i.jsx(ht,{className:"h-4 w-4 mr-1"})," Assign Student"]})}),i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Assign Student to Course"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs(Ye,{value:$,onValueChange:R,children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select course"})}),i.jsx(qe,{children:r.map(G=>i.jsx(oe,{value:G.id,children:G.title},G.id))})]}),i.jsxs(Ye,{value:L,onValueChange:D,children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select campus student"})}),i.jsx(qe,{children:h.map(G=>i.jsxs(oe,{value:G.user_id,children:[G.display_name||"Student"," â ",G.location||"No location"]},G.user_id))})]}),i.jsx(ae,{type:"date",value:I,onChange:G=>M(G.target.value)}),i.jsx(Yt,{placeholder:"Notes (optional)",value:H,onChange:G=>T(G.target.value),rows:2}),i.jsx(U,{onClick:O,className:"w-full bg-green-600 hover:bg-green-700",children:"Assign"})]})]})]}),i.jsxs(yt,{open:p,onOpenChange:x,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{size:"sm",className:"bg-green-600 hover:bg-green-700",children:[i.jsx(rn,{className:"h-4 w-4 mr-1"})," New Course"]})}),i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Create Campus Course"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(ae,{placeholder:"Course title",value:v,onCh
965ange:G=>b(G.target.value),maxLength:200}),i.jsx(Yt,{placeholder:"Description",value:w,onChange:G=>j(G.target.value),rows:3,maxLength:1e3}),i.jsxs(Ye,{value:S,onValueChange:N,children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"plant-production",children:"Plant Production"}),i.jsx(oe,{value:"animal-production",children:"Animal Production"}),i.jsx(oe,{value:"mixed-farming",children:"Mixed Farming System"}),i.jsx(oe,{value:"agri-business",children:"Agri-Business"}),i.jsx(oe,{value:"agricultural-practices",children:"Agricultural Practices"}),i.jsx(oe,{value:"fundamental",children:"Fundamental Competencies"}),i.jsx(oe,{value:"short-course",children:"Short Course"})]})]}),i.jsxs(Ye,{value:k,onValueChange:_,children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Qualification Level"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"Level 1",children:"Level 1"}),i.jsx(oe,{value:"Level 2",children:"Level 2"}),i.jsx(oe,{value:"Level 3",children:"Level 3"}),i.jsx(oe,{value:"Level 4",children:"Level 4"}),i.jsx(oe,{value:"Level 5",children:"Level 5"})]})]}),i.jsx(ae,{type:"number",placeholder:"Credits (e.g. 15)",value:C,onChange:G=>A(G.target.value),min:1,max:120}),i.jsx(U,{onClick:Y,className:"w-full bg-green-600 hover:bg-green-700",children:"Create Course"})]})]})]})]})]}),r.length===0?i.jsx(z,{children:i.jsx(V,{className:"p-8 text-center text-muted-foreground",children:"No courses yet. Create your first course!"})}):i.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:r.map(G=>{const ce=a.filter(ee=>ee.course_id===G.id);return i.jsxs(z,{className:"hover:shadow-md transition-shadow cursor-pointer",onClick:()=>g(m===G.id?null:G.id),children:[i.jsx(re,{className:"pb-2",children:i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx(se,{className:"text-base",children:G.title}),i.jsx(ye,{variant:"outline",className:"capitalize",children:G.course_type})]})}),i.jsxs(V,{children:[i.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:G.description}),i.jsxs("div",{className:"flex flex-wrap gap-2 text-sm text-muted-foreground",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(ht,{className:"h-4 w-4"})," ",ce.length," students"]}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Dt,{className:"h-4 w-4"})," ",ce.filter(ee=>ee.status==="completed").length," completed"]}),G.credits&&i.jsxs(ye,{variant:"outline",className:"text-xs",children:[G.credits," credits"]}),G.qualification_level&&i.jsx(ye,{variant:"outline",className:"text-xs",children:G.qualification_level})]})]})]},G.id)})}),m&&i.jsxs("div",{className:"mt-6 space-y-6 border-t pt-6",children:[i.jsxs("h3",{className:"font-semibold text-lg",children:[(J=r.find(G=>G.id===m))==null?void 0:J.title," â Course Content"]}),i.jsx(W9e,{courseId:m,canManage:!0}),i.jsx(zG,{courseId:m,canManage:!0})]})]}),i.jsxs(tt,{value:"submissions",className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"Pending Submissions"}),i.jsx(nC,{submissions:W,isLecturer:!0,onGrade:n}),X.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"text-lg font-semibold mt-6",children:"Recently Graded"}),i.jsx(nC,{submissions:X.slice(0,10),isLecturer:!1})]})]}),i.jsxs(tt,{value:"students",className:"space-y-4",children:[i.jsx("h2",{className:"text-lg font-semibold",children:"Enrolled Students"}),l.length===0?i.jsx(z,{children:i.jsx(V,{className:"p-8 text-center text-muted-foreground",children:"No students enrolled yet."})}):i.jsx("div",{className:"grid gap-3",children:l.map(G=>{const ce=a.filter(ee=>ee.farmer_id===G.user_id);return i.jsx(z,{children:i.jsxs(V,{className:"p-4 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-medium",children:G.display_name||"Student"}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[G.student_number||"No student #"," ⢠",G.programme||"No programme"," ⢠Year ",G.year_of_study||"?"]})]}),i.jsxs("div",{className:"text-right",children:[i.jsxs("p",{className:"text-sm font-medium",children:[ce.length," courses"]}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[ce.filter(ee=>ee.status==="completed").length," completed"]}),ce.some(ee=>ee.requires_remedial)&&i.jsx(ye,{variant:"destructive",className:"text-xs mt-1",children:"Remedial"})]})]})},G.id)})})]}),i.jsx(tt,{value:"announcements",children:i.jsx(EY,{canCreate:!0})})]})]})]})}function q9e(){const{profile:e,loading:t,updateProfile:n}=Cr();We();const[r,s]=y.useState(!1),[a,o]=y.useState({display_name:"",phone:"",location:"",bio:"",department:"",qualifications:"",office_hours:""}),l=()=>{o({display_name:(e==null?void 0:e.display_name)||"",phone:(e==null?void 0:e.phone)||"",location:(e==null?void 0:e.location)||"",bio:(e==null?void 0:e.b
965io)||"",department:(e==null?void 0:e.department)||"",qualifications:(e==null?void 0:e.qualifications)||"",office_hours:(e==null?void 0:e.office_hours)||""}),s(!0)},c=async()=>{await n(a),s(!1)};if(t)return i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsx("div",{className:"animate-spin h-8 w-8 border-b-2 border-primary mx-auto"})});const u=((e==null?void 0:e.display_name)||"L").split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2);return i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("div",{className:"bg-gradient-to-r from-green-800 via-green-700 to-green-600 text-white",children:i.jsx("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Ke,{to:"/lecturer",children:i.jsxs(U,{variant:"ghost",size:"sm",className:"text-white hover:bg-white/20",children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back to Dashboard"]})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{src:Ui,alt:"Flockify",className:"h-10 w-auto object-contain"}),i.jsx("p",{className:"text-sm text-green-100",children:"Lecturer Profile"})]})]})})}),i.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[i.jsx(z,{children:i.jsx(V,{className:"p-6",children:i.jsxs("div",{className:"flex items-center gap-6",children:[i.jsxs(Ti,{className:"h-20 w-20",children:[i.jsx(pa,{src:(e==null?void 0:e.avatar_url)||void 0}),i.jsx(Oi,{className:"bg-green-100 text-green-800 text-xl font-bold",children:u})]}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h1",{className:"text-2xl font-bold",children:(e==null?void 0:e.display_name)||"Lecturer"}),i.jsx("p",{className:"text-muted-foreground",children:(e==null?void 0:e.department)||"No department set"}),i.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:(e==null?void 0:e.qualifications)||"No qualifications listed"})]}),!r&&i.jsx(U,{onClick:l,className:"bg-green-600 hover:bg-green-700",children:"Edit Profile"})]})})}),r?i.jsxs(z,{children:[i.jsx(re,{children:i.jsx(se,{children:"Edit Profile"})}),i.jsxs(V,{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"display_name",children:"Full Name"}),i.jsx(ae,{id:"display_name",value:a.display_name,onChange:d=>o({...a,display_name:d.target.value}),placeholder:"Your full name"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"department",children:"Department"}),i.jsx(ae,{id:"department",value:a.department,onChange:d=>o({...a,department:d.target.value}),placeholder:"e.g. Animal Production"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"phone",children:"Phone"}),i.jsx(ae,{id:"phone",value:a.phone,onChange:d=>o({...a,phone:d.target.value}),placeholder:"+27..."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"location",children:"Location"}),i.jsx(ae,{id:"location",value:a.location,onChange:d=>o({...a,location:d.target.value}),placeholder:"Campus location"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"office_hours",children:"Office Hours"}),i.jsx(ae,{id:"office_hours",value:a.office_hours,onChange:d=>o({...a,office_hours:d.target.value}),placeholder:"e.g. Mon-Fri 08:00-16:00"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"qualifications",children:"Qualifications"}),i.jsx(Yt,{id:"qualifications",value:a.qualifications,onChange:d=>o({...a,qualifications:d.target.value}),placeholder:"e.g. MSc Agriculture, PhD Animal Science",rows:2})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"bio",children:"Bio"}),i.jsx(Yt,{id:"bio",value:a.bio,onChange:d=>o({...a,bio:d.target.value}),placeholder:"Tell students about yourself...",rows:3})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(U,{onClick:c,className:"bg-green-600 hover:bg-green-700",children:[i.jsx(NB,{className:"h-4 w-4 mr-2"})," Save Changes"]}),i.jsx(U,{variant:"outline",onClick:()=>s(!1),children:"Cancel"})]})]})]}):i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(Xb,{className:"h-4 w-4"})," Personal Information"]})}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(ri,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{children:(e==null?void 0:e.phone)||"No phone set"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(ts,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{children:(e==null?void 0:e.location)||"No location set"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(js,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{children:(e==null?void 0:e.office_hours)||"No office hours set"})]})]})]}),i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(Oa,{className:"h-4 w-4"})," Academic Information"]})}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(RZ,{className:"h-4 w-4 text-muted-foreground"}),i.jsx("span",{children:(e==null?void 0:e.department)||"No department set"})]}),i.jsxs("div",{className:"text-sm",children:[i.jsx("p",{className:"text-muted-foreground mb-1",children:"Qualifications:"}),i.jsx("p",{children:(e==null?void 0:e.qualifications)||"Not listed"})]})]})]}
965),(e==null?void 0:e.bio)&&i.jsxs(z,{className:"md:col-span-2",children:[i.jsx(re,{children:i.jsx(se,{className:"text-base",children:"About"})}),i.jsx(V,{children:i.jsx("p",{className:"text-sm",children:e.bio})})]})]})]})]})}const K9e=["Plant Production L4","Plant Production L5","Animal Production L4","Animal Production L5","Mixed Farming L2"];function G9e(){const[e,t]=y.useState([]),[n,r]=y.useState(!0),[s,a]=y.useState(!1),[o,l]=y.useState(""),[c,u]=y.useState(""),[d,h]=y.useState("50"),[f,m]=y.useState("90"),{toast:g}=We(),p=async()=>{const{data:j,error:S}=await q.from("enrollment_codes").select("*").order("created_at",{ascending:!1});S||t(j||[]),r(!1)};y.useEffect(()=>{p()},[]);const x=()=>{const j="EAC",S=new Date().getFullYear(),N=Math.random().toString(36).substring(2,7).toUpperCase();return`${j}-${S}-${N}`},v=async()=>{if(!o)return;const{data:{user:j}}=await q.auth.getUser();if(!j)return;const S=x(),N=f?new Date(Date.now()+parseInt(f)*864e5).toISOString():null,{error:k}=await q.from("enrollment_codes").insert({code:S,programme:o,year_of_study:c?parseInt(c):null,max_uses:parseInt(d)||50,created_by:j.id,expires_at:N});k?g({title:"Error",description:k.message,variant:"destructive"}):(g({title:"Code Created",description:`Enrollment code: ${S}`}),a(!1),l(""),p())},b=j=>{navigator.clipboard.writeText(j),g({title:"Copied!",description:`Code ${j} copied to clipboard`})},w=async(j,S)=>{await q.from("enrollment_codes").update({is_active:!S}).eq("id",j),p()};return n?i.jsx("div",{className:"animate-spin h-6 w-6 border-b-2 border-primary mx-auto"}):i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs(se,{className:"flex items-center gap-2",children:[i.jsx(KZ,{className:"h-5 w-5"})," Enrollment Codes"]}),i.jsxs(yt,{open:s,onOpenChange:a,children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{size:"sm",className:"bg-green-600 hover:bg-green-700",children:[i.jsx(rn,{className:"h-4 w-4 mr-1"})," Generate Code"]})}),i.jsxs(mt,{children:[i.jsx(xt,{children:i.jsx(vt,{children:"Generate Enrollment Code"})}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Programme"}),i.jsxs(Ye,{value:o,onValueChange:l,children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Select programme"})}),i.jsx(qe,{children:K9e.map(j=>i.jsx(oe,{value:j,children:j},j))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Year of Study (optional)"}),i.jsxs(Ye,{value:c,onValueChange:u,children:[i.jsx(He,{children:i.jsx(Xe,{placeholder:"Any year"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"1",children:"Year 1"}),i.jsx(oe,{value:"2",children:"Year 2"}),i.jsx(oe,{value:"3",children:"Year 3"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Max Uses"}),i.jsx(ae,{type:"number",value:d,onChange:j=>h(j.target.value),min:1,max:500})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{children:"Expires In (days)"}),i.jsx(ae,{type:"number",value:f,onChange:j=>m(j.target.value),min:1,max:365})]}),i.jsx(U,{onClick:v,className:"w-full bg-green-600 hover:bg-green-700",children:"Generate Code"})]})]})]})]})}),i.jsxs(V,{children:[i.jsxs(Sa,{children:[i.jsx(Na,{children:i.jsxs(kn,{children:[i.jsx(Pe,{children:"Code"}),i.jsx(Pe,{children:"Programme"}),i.jsx(Pe,{children:"Year"}),i.jsx(Pe,{children:"Usage"}),i.jsx(Pe,{children:"Status"}),i.jsx(Pe,{children:"Actions"})]})}),i.jsx(ka,{children:e.map(j=>i.jsxs(kn,{children:[i.jsx(ke,{className:"font-mono font-bold",children:j.code}),i.jsx(ke,{className:"text-sm",children:j.programme}),i.jsx(ke,{children:j.year_of_study||"Any"}),i.jsxs(ke,{children:[j.used_count,"/",j.max_uses]}),i.jsx(ke,{children:i.jsx(ye,{className:j.is_active?"bg-green-100 text-green-800":"bg-red-100 text-red-800",children:j.is_active?"Active":"Disabled"})}),i.jsxs(ke,{className:"flex gap-1",children:[i.jsx(U,{variant:"ghost",size:"sm",onClick:()=>b(j.code),children:i.jsx(fB,{className:"h-4 w-4"})}),i.jsx(U,{variant:"ghost",size:"sm",onClick:()=>w(j.id,j.is_active),children:j.is_active?"Disable":"Enable"})]})]},j.id))})]}),e.length===0&&i.jsx("p",{className:"text-center py-6 text-muted-foreground",children:"No enrollment codes yet. Generate one to share with students."})]})]})}function Y9e(){const{profile:e}=Cr(),{submissions:t}=SP(),[n,r]=y.useState([]),[s,a]=y.useState([]),[o,l]=y.useState([]),[c,u]=y.useState([]),[d,h]=y.useState(!0),[f,m]=y.useState("all"),[g,p]=y.useState("all");y.useEffect(()=>{x()},[]);const x=async()=>{try{const[_,C,A]=await Promise.all([q.from("courses").select("*").eq("course_type","campus").order("created_at",{ascending:!1}),q.from("profiles").select("*"),q.from("course_assignments").select("*")]),E=_.data||[];r(E);const P=new Set(E.map(R=>R.id));u((A.data||[]).filter(R=>P.has(R.course_id)));const $=C.data||[];a($.filter(R=>R.campus_enrolled===!0)),l($.filter(R=>
965R.user_type==="lecturer"))}catch(_){console.error("Fetch error:",_)}finally{h(!1)}},v=async(_,C)=>{const{error:A}=await q.rpc("update_user_role",{target_profile_id:_,new_user_type:C});A||x()},b=async(_,C)=>{const{error:A}=await q.rpc("toggle_campus_enrollment",{target_profile_id:_,enrolled:C});A||x()},w={"plant-production-l4":"Plant Production L4","plant-production-l5":"Plant Production L5","animal-production-l4":"Animal Production L4","animal-production-l5":"Animal Production L5","mixed-farming-l2":"Mixed Farming L2"},j=n,S=c.filter(_=>_.status==="completed"),N=t.filter(_=>!_.graded_at),k=S.length>0?Math.round(S.length/Math.max(c.length,1)*100):0;return d?i.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:i.jsx("div",{className:"animate-spin h-8 w-8 border-b-2 border-primary mx-auto"})}):i.jsxs("div",{className:"min-h-screen bg-background",children:[i.jsx("div",{className:"bg-gradient-to-r from-green-900 via-green-800 to-green-700 text-white",children:i.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Ke,{to:"/",children:i.jsxs(U,{variant:"ghost",size:"sm",className:"text-white hover:bg-white/20",children:[i.jsx(jt,{className:"h-4 w-4 mr-2"})," Back"]})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{src:Ui,alt:"Flockify",className:"h-10 w-auto object-contain"}),i.jsxs("div",{className:"text-right",children:[i.jsx("p",{className:"text-sm text-green-200",children:"College Management"}),i.jsx("p",{className:"font-semibold",children:(e==null?void 0:e.display_name)||"Administrator"})]})]})]})})}),i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx(ll,{className:"h-7 w-7 text-green-700"}),i.jsx("h1",{className:"text-2xl font-bold",children:"Campus Management"})]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 mb-8",children:[i.jsx(z,{className:"border-l-4 border-l-green-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(ht,{className:"h-5 w-5 text-green-600 mb-1"}),i.jsx("p",{className:"text-2xl font-bold",children:s.length}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Students"})]})}),i.jsx(z,{className:"border-l-4 border-l-blue-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(dO,{className:"h-5 w-5 text-blue-600 mb-1"}),i.jsx("p",{className:"text-2xl font-bold",children:o.length}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Lecturers"})]})}),i.jsx(z,{className:"border-l-4 border-l-purple-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(tn,{className:"h-5 w-5 text-purple-600 mb-1"}),i.jsx("p",{className:"text-2xl font-bold",children:j.length}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Campus Courses"})]})}),i.jsx(z,{className:"border-l-4 border-l-yellow-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(js,{className:"h-5 w-5 text-yellow-600 mb-1"}),i.jsx("p",{className:"text-2xl font-bold",children:N.length}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Pending Reviews"})]})}),i.jsx(z,{className:"border-l-4 border-l-emerald-600",children:i.jsxs(V,{className:"p-4",children:[i.jsx(Wt,{className:"h-5 w-5 text-emerald-600 mb-1"}),i.jsxs("p",{className:"text-2xl font-bold",children:[k,"%"]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Completion Rate"})]})})]}),i.jsxs(Bc,{defaultValue:"students",className:"space-y-6",children:[i.jsxs(jl,{className:"grid w-full grid-cols-6 bg-green-50",children:[i.jsx(pt,{value:"students",className:"data-[state=active]:bg-green-700 data-[state=active]:text-white",children:"Students"}),i.jsx(pt,{value:"lecturers",className:"data-[state=active]:bg-green-700 data-[state=active]:text-white",children:"Lecturers"}),i.jsx(pt,{value:"courses",className:"data-[state=active]:bg-green-700 data-[state=active]:text-white",children:"Courses"}),i.jsx(pt,{value:"enrollment",className:"data-[state=active]:bg-green-700 data-[state=active]:text-white",children:"Enrollment Codes"}),i.jsx(pt,{value:"reports",className:"data-[state=active]:bg-green-700 data-[state=active]:text-white",children:"Reports"}),i.jsx(pt,{value:"announcements",className:"data-[state=active]:bg-green-700 data-[state=active]:text-white",children:"Announcements"})]}),i.jsx(tt,{value:"students",children:i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[i.jsx(se,{children:"Registered Students"}),i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsxs(ye,{className:"bg-green-100 text-green-800",children:[s.filter(_=>_.campus_enrolled).length," Campus Enrolled"]}),i.jsxs(Ye,{value:f,onValueChange:m,children:[i.jsx(He,{className:"w-[180px] h-8 text-xs",children:i.jsx(Xe,{placeholder:"Programme"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"all",children:"All Programmes"}),i.jsx(oe,{value:"Plant Production L4",children:"Plant Production L4"}),i.jsx(oe,{value:"Plant Production L5",children:"Plant Production L5"}),i.jsx(oe,{value:"Animal Production L4",children:"Animal Production L4"}),i.jsx(oe,{value:"Animal Production L5",children:"Animal Production L5"}),i.jsx(oe,{value:"Mixed Farming System L1",children:"Mixed Farming L1"}),i.jsx(oe,{value:"Mixed Farming System L2",children:"Mixed Farming L2"}),i.jsx(oe,{value:"Short Course",children:"Short Course"})]})]}),i.jsxs(Ye,{value:g,onValueChange:p,children:[i.jsx(He,{className:"w-[100px] h-8 text-xs",children:i.jsx(Xe,{placeholder:"Year"})}),i.jsxs(qe,{children:[i.jsx(oe,{value:"all",children:"All Years"}),i.jsx(oe,{value:"1",children:"Year 1"}),i.jsx(oe,{value:"2",children:"Year 2"}),i.jsx(oe,{value:"3",children:"Year 3"})]})]})]})]})}),i.jsxs(V,{children:[i.jsxs(Sa,{children:[i.jsx(Na,{children:i.jsxs(kn,{children:[i.jsx(Pe,{children:"Name"}),i.jsx(Pe,{children:"Student #"}),i.jsx(Pe,{children:"Programme"}),i.jsx(Pe,{children:"Year"}),i.jsx(Pe,{children:"Campus"}),i.jsx(Pe,{children:"Courses"}),i.jsx(Pe,{children:"Actions"})]})}),i.jsx(ka,{children:s.filter(_=>f==="all"||_.programme===f).filter(_=>g==="all"||String(_.year_of_study)===g).map(_=>{const C=c.filter(A=>A.farmer_id===_.user_id);return i.jsxs(kn,{children:[i.jsx(ke,{className:"font-medium",children:_.display_name||"Student"}),i.jsx(ke,{children:_.student_number||"-"}),i.jsx(ke,{className:"text-sm",children:_.programme||"-"}),i.jsx(ke,{children:_.year_of_study||"-"}),i.jsx(ke,{children:i.jsx(U,{variant:_.campus_enrolled?"default":"outline",size:"sm",className:_.campus_enrolled?"bg-green-600 hover:bg-green-700 text-white":"",onClick:()=>b(_.id,!_.campus_enrolled),children:_.campus_enrolled?"â Enrolled":"Enroll"})}),i.jsx(ke,{children:i.jsxs(ye,{variant:C.filter(A=>A.status==="completed").length>0?"default":"secondary",children:[C.filter(A=>A.status==="completed").length,"/",C.length]})}),i.jsx(ke,{children:i.jsxs(U,{variant:"ghost",size:"sm",onClick:()=>v(_.id,"lecturer"),children:[i.jsx(dO,{className:"h-4 w-4 mr-1"})," Make Lecturer"]})})]},_.id)})})]}),s.length===0&&i.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No students registered yet."})]})]})}),i.jsx(tt,{value:"lecturers",children:i.jsxs(z,{children:[i.jsx(re,{children:i.jsx(se,{children:"Lecturers"})}),i.jsxs(V,{children:[i.jsxs(Sa,{children:[i.jsx(Na,{children:i.jsxs(kn,{children:[i.jsx(Pe,{children:"Name"}),i.jsx(Pe,{children:"Location"}),i.jsx(Pe,{children:"Courses Created"}),i.jsx(Pe,{children:"Actions"})]})}),i.jsx(ka,{children:o.map(_=>{const C=n.filter(A=>A.created_by===_.user_id);return i.jsxs(kn,{children:[i.jsx(ke,{className:"font-medium",children:_.display_name||"Lecturer"}),i.jsx(ke,{children:_.location||"-"}),i.jsx(ke,{children:C.length}),i.jsx(ke,{children:i.jsx(U,{variant:"ghost",size:"sm",onClick:()=>v(_.id,"farmer"),children:"Remove Role"})})]},_.id)})})]}),o.length===0&&i.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No lecturers assigned yet. Promote a student from the Students tab."})]})]})}),i.jsx(tt,{value:"courses",children:i.jsxs("div",{className:"space-y-4",children:[i.jsxs(z,{children:[i.jsx(re,{className:"pb-2",children:i.jsx(se,{className:"text-base",children:"Total Campus Courses"})}),i.jsxs(V,{children:[i.jsx("p",{className:"text-3xl font-bold text-green-700",children:j.length}),i.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:Object.entries(w).map(([_,C])=>{const A=j.filter(E=>E.category===_).length;return A>0?i.jsxs(ye,{variant:"outline",className:"text-xs",children:[C,": ",A]},_):null})})]})]}),i.jsx(z,{children:i.jsx(V,{className:"pt-6",children:i.jsxs(Sa,{children:[i.jsx(Na,{children:i.jsxs(kn,{children:[i.jsx(Pe,{children:"Title"}),i.jsx(Pe,{children:"Programme"}),i.jsx(Pe,{children:"Level"}),i.jsx(Pe,{children:"Credits"}),i.jsx(Pe,{children:"Enrolled"}),i.jsx(Pe,{children:"Completion"})]})}),i.jsx(ka,{children:j.map(_=>{const C=c.filter(E=>E.course_id===_.id),A=C.filter(E=>E.status==="completed");return i.jsxs(kn,{children:[i.jsx(ke,{className:"font-medium",children:_.title}),i.jsx(ke,{children:i.jsx(ye,{variant:"outline",className:"text-xs",children:w[_.category]||_.category})}),i.jsx(ke,{className:"text-sm",children:_.qualification_level||"-"}),i.jsx(ke,{children:_.credits||"-"}),i.jsx(ke,{children:C.length}),i.jsx(ke,{children:i.jsxs(ye,{className:A.length>0?"bg-green-100 text-green-800":"bg-muted text-muted-foreground",children:[A.length,"/",C.length]})})]},_.id)})})]})})})]})}),i.jsx(tt,{value:"enrollment",children:i.jsx(G9e,{})}),i.jsx(tt,{value:"reports",children:i.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(Xr,{className:"h-5 w-5"})," Enrollment Summary"]})}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Total Enrollments"}),i.jsx("span",{className:"font-bold",children:c.length})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Active"}),i.jsx("span",{className:"font-bold",children:c.filter(_=>_.status==="in_progress").length})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Completed"}),i.jsx("span",{className:"font-bold text-green-700",children:S.length})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Not Started"}),i.jsx("span",{className:"font-bold",children:c.filter(_=>_.status==="assigned").length})]})]})]}),i.jsxs(z,{children:[i.jsx(re,{children:i.jsxs(se,{className:"text-base flex items-center gap-2",children:[i.jsx(Oa,{className:"h-5 w-5"})," Submissions Overview"]})}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Total Submissions"}),i.jsx("span",{className:"font-bold",children:t.length})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Graded"}),i.jsx("span",{className:"font-bold text-green-700",children:t.filter(_=>_.graded_at).length})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Pending Review"}),i.jsx("span",{className:"font-bold text-yellow-600",children:N.length})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{children:"Avg Grade"}),i.jsx("span",{className:"font-bold",children:t.filter(_=>_.grade!==null).length>0?Math.round(t.filter(_=>_.grade!==null).reduce((_,C)=>_+(C.grade||0),0)/t.filter(_=>_.grade!==null).length)+"%":"N/A"})]})]})]})]})}),i.jsx(tt,{value:"announcements",children:i.jsx(EY,{canCreate:!0})})]})]})]})}const Z5={student:{label:"Student",icon:Oa,userType:"farmer"},lecturer:{label:"Lecturer",icon:tn,userType:"lecturer"}
965,college_admin:{label:"College Admin",icon:ll,userType:"college_admin"}},X9e=()=>{const[e,t]=y.useState(!0),[n,r]=y.useState(""),[s,a]=y.useState(""),[o,l]=y.useState(""),[c,u]=y.useState("student"),[d,h]=y.useState(""),[f,m]=y.useState(""),[g,p]=y.useState(""),[x,v]=y.useState(""),[b,w]=y.useState(!1),[j,S]=y.useState(!1),[N,k]=y.useState(!1),[_,C]=y.useState(!0),{toast:A}=We(),E=async()=>{if(x.trim()){S(!0);try{const{data:R,error:L}=await q.rpc("validate_enrollment_code",{input_code:x.trim()});if(L)throw L;const D=R;D!=null&&D.valid?(w(!0),D.programme&&m(D.programme),D.year_of_study&&p(String(D.year_of_study)),A({title:"Code Valid",description:`Enrollment code accepted for ${D.programme}`})):A({title:"Invalid Code",description:(D==null?void 0:D.error)||"This code is invalid or expired",variant:"destructive"})}catch(R){A({title:"Error",description:R.message,variant:"destructive"})}finally{S(!1)}}};y.useEffect(()=>{q.auth.getSession().then(({data:{session:R}})=>{R!=null&&R.user?P(R.user.id):C(!1)})},[]);const P=async R=>{const{data:L}=await q.from("profiles").select("user_type, campus_enrolled").eq("user_id",R).maybeSingle();(L==null?void 0:L.user_type)==="lecturer"?window.location.href="/lecturer":(L==null?void 0:L.user_type)==="college_admin"?window.location.href="/college-admin":window.location.href="/learning"},$=async R=>{R.preventDefault(),k(!0);try{if(e){const{data:L,error:D}=await q.auth.signInWithPassword({email:n,password:s});if(D)throw D;L.user&&await P(L.user.id)}else{const D={user_type:Z5[c].userType,display_name:o};c==="student"&&(f&&(D.programme=f),g&&(D.year_of_study=parseInt(g)),d.trim()&&(D.student_number=d.trim()));const{data:I,error:M}=await q.auth.signUp({email:n,password:s,options:{data:D,emailRedirectTo:window.location.origin+"/campus"}});if(M)throw M;c==="student"&&x.trim()&&I.user&&await q.rpc("consume_enrollment_code",{input_code:x.trim()}),I.user&&!I.session?A({title:"Check your email",description:"We sent you a confirmation link to verify your account."}):I.user&&await P(I.user.id)}}catch(L){A({title:"Error",description:L.message,variant:"destructive"})}finally{k(!1)}};return _?i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-emerald-900 via-emerald-800 to-yellow-900",children:i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-emerald-900 via-emerald-800 to-yellow-900 p-4",children:i.jsxs(z,{className:"w-full max-w-md border-0 shadow-2xl",children:[i.jsxs(re,{className:"text-center space-y-4 pb-2",children:[i.jsx("div",{className:"flex justify-center",children:i.jsx("img",{src:Ui,alt:"Flockify",className:"h-16 w-auto object-contain"})}),i.jsxs("div",{children:[i.jsx(se,{className:"text-2xl font-bold text-emerald-800",children:"Flockify Campus"}),i.jsx(_n,{className:"text-base mt-1",children:"Campus Learning Management System"})]})]}),i.jsxs(V,{children:[i.jsxs("form",{onSubmit:$,className:"space-y-4",children:[!e&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"role",children:"I am a"}),i.jsxs(Ye,{value:c,onValueChange:R=>{u(R),w(!1),v("")},children:[i.jsx(He,{children:i.jsx(Xe,{})}),i.jsx(qe,{children:Object.entries(Z5).map(([R,L])=>{const D=L.icon;return i.jsx(oe,{value:R,children:i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(D,{className:"h-4 w-4"})," ",L.label]})},R)})})]})]}),c==="student"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"enrollmentCode",children:"Enrollment Code"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(ae,{id:"enrollmentCode",value:x,onChange:R=>{v(R.target.value.toUpperCase()),w(!1)},placeholder:"Enter your enrollment code",maxLength:20,className:b?"border-green-500 bg-green-50":"",disabled:b}),!b&&i.jsx(U,{type:"button",onClick:E,disabled:j||!x.trim(),variant:"outline",className:"shrink-0",children:j?"...":"Verify"})]}),b&&i.jsxs("p",{className:"text-xs text-green-600 font-medium",children:["â Code valid â ",f]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Get this code from your college administrator or lecturer."})]}),(c!=="student"||b)&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"name",children:"Full Name"}),i.jsx(ae,{id:"name",value:o,onChange:R=>l(R.target.value),placeholder:"Enter your full name",required:!0})]}),c==="student"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"studentNumber",children:"Student Number (optional)"}),i.jsx(ae,{id:"studentNumber",value:d,onChange:R=>h(R.target.value),placeholder:"Enter your student number",maxLength:20})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"email",children:"Email"}),i.jsx(ae,{id:"email",type:"email",value:n,onChange:R=>r(R.target.value),placeholder:"[email protected]",required:!0})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"password",children:"Password"}),i.jsx(ae,{id:"password",type:"password",value:s,onChange:R=>
965a(R.target.value),placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:!0,minLength:6})]}),i.jsx(U,{type:"submit",className:"w-full bg-emerald-700 hover:bg-emerald-800 text-white",disabled:N||!e&&c==="student"&&!b,children:N?"Please wait...":e?"Sign In":"Create Account"})]}),i.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-4",children:[e?"Don't have an account?":"Already have an account?"," ",i.jsx("button",{type:"button",onClick:()=>t(!e),className:"text-emerald-700 font-medium hover:underline",children:e?"Sign up":"Sign in"})]})]})]})})},e3=[{id:"free",name:"Free",tagline:"Get started with the essentials",monthlyPrice:0,yearlyPrice:0,features:["1 flock","3 AI health scans/month","Basic dashboard","Marketplace browsing","Community access"]},{id:"farmer_pro",name:"Farmer Pro",tagline:"For serious livestock farmers",monthlyPrice:99,yearlyPrice:990,monthlyPriceId:"farmer_pro_monthly",yearlyPriceId:"farmer_pro_yearly",highlighted:!0,features:["Unlimited flocks","Unlimited AI health scans","Advanced analytics","Marketplace boost","Full learning library","Financial reports"]},{id:"farmer_business",name:"Farmer Business",tagline:"For commercial farms",monthlyPrice:299,yearlyPrice:2990,monthlyPriceId:"farmer_business_monthly",yearlyPriceId:"farmer_business_yearly",features:["Everything in Pro","Multi-farm management","Team seats (up to 5)","Priority support","Bulk financial exports","Custom compliance reports"]}],t3=[{id:"free",name:"Free",tagline:"Try the platform",monthlyPrice:0,yearlyPrice:0,features:["5 members","1 course","Basic enrollment codes","Community support"]},{id:"org_pro",name:"Organization Pro",tagline:"For incubators & colleges",monthlyPrice:499,yearlyPrice:4990,monthlyPriceId:"org_pro_monthly",yearlyPriceId:"org_pro_yearly",highlighted:!0,features:["Up to 50 farmers/students","Course builder","Compliance tracking","Analytics dashboard","Lecturer profiles","Bulk enrollment"]},{id:"org_business",name:"Organization Business",tagline:"For large organizations",monthlyPrice:1499,yearlyPrice:14990,monthlyPriceId:"org_business_monthly",yearlyPriceId:"org_business_yearly",features:["Unlimited members","Advanced LMS features","White-label options","Dedicated support","API access","Custom integrations"]}];function J9e(){const[e,t]=y.useState(!1),[n,r]=y.useState("farmer"),{tier:s,isActive:a}=Bh(),{toast:o}=We(),[l,c]=y.useState(null),u=async f=>{c(f);try{const{data:{session:m}}=await q.auth.getSession();if(!m){o({title:"Sign in required",description:"Please sign in to subscribe.",variant:"destructive"}),c(null);return}const g=await Nq(f);window.location.href=g}catch(m){o({title:"Could not start payment",description:(m==null?void 0:m.message)??"Please try again or pay via EFT.",variant:"destructive"}),c(null)}},d=n==="farmer"?e3:t3,h=[...e3,...t3].filter(f=>f.monthlyPrice>0).map(f=>({"@context":"https://schema.org","@type":"Product",name:`Flockify ${f.name}`,description:f.tagline,offers:{"@type":"Offer",price:f.monthlyPrice,priceCurrency:"ZAR",url:"https://flockify.lovable.app/pricing",availability:"https://schema.org/InStock"}}));return i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:[i.jsx(u0,{title:"Flockify Pricing â Plans for Farmers & Organizations",description:"Compare Flockify plans for farmers and incubators. Monthly and yearly pricing in ZAR with a 30-day money-back guarantee.",path:"/pricing",jsonLd:h}),i.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-12",children:[i.jsxs(Ke,{to:"/",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-8",children:[i.jsx(jt,{className:"h-4 w-4"})," Back home"]}),i.jsxs("div",{className:"text-center mb-10 space-y-4",children:[i.jsx(ye,{variant:"secondary",className:"mb-2",children:"Pricing"}),i.jsx("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight",children:"Choose your plan"}),i.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Start free. Upgrade when you're ready to scale your flock or your organization."}),i.jsxs("div",{className:"flex flex-col items-center gap-4 pt-4",children:[i.jsxs("div",{className:"inline-flex bg-muted rounded-lg p-1",children:[i.jsx("button",{onClick:()=>r("farmer"),className:`px-4 py-2 rounded-md text-sm font-medium transition ${n==="farmer"?"bg-background shadow":""}`,children:"For Farmers"}),i.jsx("button",{onClick:()=>r("org"),className:`px-4 py-2 rounded-md text-sm font-medium transition ${n==="org"?"bg-background shadow":""}`,children:"For Organizations"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:`text-sm ${e?"text-muted-foreground":"font-semibold"}`,children:"Monthly"}),i.jsx(kw,{checked:e,onCheckedChange:t}),i.jsxs("span",{className:`text-sm ${e?"font-semibold":"text-muted-foreground"}`,children:["Yearly ",i.jsx(ye,{variant:"secondary",className:"ml-1",children:"Save 17%"})]})]}),i.jsx("p",{className:"text-xs text-muted-foreground max-w-md",children:"Secure ZAR payments by bank EFT. Upload proof, we verify within 24 hours."})]})]}),i.jsx("div",{className:"grid md:grid-cols-3 gap-6 max-w-6xl mx-auto",children:d.map(f=>{const m=e?f.yearlyPrice:f.monthlyPrice,g=e?f.yearlyPriceId:f.monthlyPriceId,p=s===f.id;return i.jsxs(z,{className:`glass-card relative flex flex-col ${f.highlighted?"border-primary shadow-xl scale-105":""}`,children:[f.highlighted&&i.jsx(ye,{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:"Most popular"}),i.jsxs(re,{children:[i.jsx("h3",{className:"text-2xl font-bold",children:f.name}),i.jsx("p",{className:"text-sm text-muted-foreground",children:f.tagline}),i.jsxs("div",{className:"pt-4",children:[i.jsxs("span",{className:"text-4xl font-bold",children:["R",m]}),m>0&&i.jsxs("span",{className:"text-muted-foreground",children:["/",e?"year":"month"]})]})]}),i.jsxs(V,{className:"flex flex-col flex-1 justify-between gap-6",children:[i.jsx("ul",{className:"space-y-3",children:f.features.map(x=>i.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[i.jsx($r,{className:"h-4 w-4 text-primary mt-0.5 shrink-0"}),i.jsx("span",{children:x})]},x))}),p?i.jsx(U,{disabled:!0,variant:"outline",children:"Current plan"}):f.id==="free"?i.jsx(U,{variant:"outline",asChild:!0,children:i.jsx(Ke,{to:"/",children:"Get started"})}):a&&s!=="free"?i.jsx(U,{variant:"outline",asChild:!0,children:i.jsx("a",{href:"mailto:[email protected]?subject=Plan%20change%20request",children:"Contact us to switch"})}):i.jsxs("div",{className:"space-y-2",children:[i.jsx(U,{className:"w-full",disabled:!g||l===g,onClick:()=>g&&u(g),children:l===g?i.jsxs(i.Fragment,{children:[i.jsx(Jr,{className:"h-4 w-4 mr-2 animate-spin"}),"Opening checkout..."]}):i.jsxs(i.Fragment,{children:[i.jsx(ZS,{className:"h-4 w-4 mr-2"}),"Pay with card"]})}),i.jsx(U,{variant:"outline",className:"w-full",asChild:!0,disabled:!g,children:i.jsx(Ke,{to:`/checkout/manual?plan=${g}`,children:"Pay via EFT"})})]})]})]},f.id)})}),i.jsx("p",{className:"text-center text-sm text-muted-foreground mt-10",children:"All prices in ZAR. VAT included where applicable. Cancel anytime â keep access until your period ends."})]})]})}function FP({title:e,updated:t,path:n,description:r,children:s}){return i.jsxs("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:[n&&i.jsx(u0,{title:`${e} â Flockify`,description:r??`${e} for the Flockify platform. Last updated ${t}.`,path:n}),i.jsx("header",{className:"border-b border-border",children:i.jsxs("div",{className:"container mx-auto px-6 py-4 flex items-center justify-between",children:[i.jsx(U,{variant:"ghost",size:"sm",asChild:!0,children:i.jsxs(Ke,{to:"/",children:[i.jsx(jt,{className:"h-4 w-4 mr-2"}),"Back to Flockify"]})}),i.jsxs("nav",{className:"hidden sm:flex items-center gap-4 text-sm text-muted-foreground",children:[i.jsx(Ke,{to:"/pricing",className:"hover:text-foreground",children:"Pricing"}),i.jsx(Ke,{to:"/legal/terms",className:"hover:text-foreground",children:"Terms"}),i.jsx(Ke,{to:"/legal/privacy",className:"hover:text-foreground",children:"Privacy"}),i.jsx(Ke,{to:"/legal/refund",className:"hover:text-foreground",children:"Refunds"})]})]})}),i.jsxs("main",{className:"container mx-auto max-w-3xl px-6 py-12",children:[i.jsx("h1",{className:"text-3xl font-bold mb-2",children:e}),i.jsxs("p",{className:"text-sm text-muted-foreground mb-8",children:["Last updated: ",t]}),i.jsx("article",{className:"prose prose-sm md:prose-base max-w-none space-y-5 text-foreground [&_h2]:text-xl [&_h2]:font-semibold [&_h2]:mt-8 [&_h2]:mb-3 [&_h3]:font-semibold [&_h3]:mt-6 [&_h3]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:pl-6 [&_ul]:space-y-1 [&_a]:text-primary [&_a]:underline",children:s})]})]})}function Q9e(){return i.jsxs(FP,{title:"Terms & Conditions",updated:"8 May 2026",path:"/legal/terms",description:"Flockify Terms & Conditions covering account use, subscriptions, and acceptable use of the platform.",children:[i.jsxs("p",{children:['These Terms & Conditions ("Terms") govern your access to and use of the Flockify platform, web application, and related services (the "Service"), provided by ',i.jsx("strong",{children:"Tech4Africa Group"}),'("Tech4Africa Group", "we", "us", or "our"), trading as Flockify. By creating an account or otherwise using the Service, you agree to these Terms.']}),i.jsx("h2",{children:"1. Who you are contracting with"}),i.jsx("p",{children:"You are entering into a contract with Tech4Africa Group. If you use the Service on behalf of an organisation, you confirm that you have authority to bind that organisation. If you use the Service as an individual, you confirm that you are of legal age in your jurisdiction."}),i.jsx("h2",{children:"2. The Service"}),i.jsx("p",{children:"Flockify provides livestock farm management tools including flock tracking, daily logging, AI-powered health analysis, marketplace features, learning content, and related functionality. We may add, change, or remove features from time to time."}),i.jsx("h2",{children:"3. Acceptable use"}),i.jsx("p",{children:"You must not, and must not permit anyone else to:"}),i.jsxs("ul",{children:[i.jsx("li",{children:"Use the Service for any unlawful, fraudulent, or harmful purpose;"}),i.jsx("li",{children:"Send spam or unsolicited communications via the Service;"}),i.jsx("li",{children:"Infringe the intellectual property or privacy rights of others;"}),i.jsx("li",{children:"Upload malware or attempt to interfere with the security or integrity of the Service;"}),i.jsx("li",{children:"Probe, scan, scrape, or reverse engineer any part of the Service;"}),i.jsx("li",{children:"Resell, sublicense, or redistribute the Service without our written consent."})]}),i.jsx("h2",{children:"4. Accounts"}),i.jsx("p",{children:"You are responsible for keeping your login credentials confidential and for all activity that occurs under your account. You must provide accurate information and keep it up to date."}),i.jsx("h2",{children:"5. Intellectual property"}),i.jsx("p",{children:"Tech4Africa Group retains all right, title, and interest in and to the Service, including all software, documentation, designs, trademarks, and branding. We grant you a limited, non-exclusive, non-transferable right to use the Service in accordance with your selected plan and these Terms."}),i.jsx("h2",{children:"6. User content"}),i.jsx("p",{children:"You retain ownership of the content you upload (such as flock data, photos, posts, and notes). You grant us a limited licence to host, process, and display that content solely to operate and improve the Service."}),i.jsx("h2",{children:"7. Payments and subscriptions"}),i.jsxs("p",{children:["Tech4Africa Group is the merchant of record for all Flockify subscriptions. Payments are processed on our behalf by ",i.jsx("strong",{children:"Stitch"}),", a South African payment gateway (stitch.money) at checkout. Card details and bank credentials are handled by the gateway and are never stored on Flockify servers."]}),i.jsxs("p",{children:["Subscriptions renew automatically at the end of each billing period (monthly or yearly, as selected) until cancelled. You can cancel at any time from your profile and will retain access to paid features until the end of the current billing period. Fees are stated on the"," ",i.jsx("a",{href:"/pricing",children:"pricing page"})," and may be updated with reasonable notice. All amounts are billed
965in ZAR and include VAT where applicable."]}),i.jsx("h2",{children:"8. Service level"}),i.jsx("p",{children:"We work hard to keep the Service available and reliable, but we do not guarantee that it will be uninterrupted, error-free, or fit for any particular purpose. To the fullest extent permitted by law, all implied warranties are disclaimed."}),i.jsx("h2",{children:"9. Suspension and termination"}),i.jsx("p",{children:"We may suspend or terminate your access to the Service if:"}),i.jsxs("ul",{children:[i.jsx("li",{children:"You materially breach these Terms;"}),i.jsx("li",{children:"Payment for your subscription fails and is not resolved;"}),i.jsx("li",{children:"We reasonably believe your activity poses a security or fraud risk;"}),i.jsx("li",{children:"You repeatedly or seriously violate our policies."})]}),i.jsx("p",{children:"On termination, your right to use the Service ends. We will retain your data for a reasonable export window before deletion, except where law requires otherwise."}),i.jsx("h2",{children:"10. Liability"}),i.jsx("p",{children:"To the fullest extent permitted by law, our aggregate liability arising out of or related to the Service is limited to the fees you have paid us in the twelve (12) months before the event giving rise to the claim. We are not liable for indirect, consequential, or special damages, including loss of profits, data, or goodwill. Nothing in these Terms limits liability for fraud, death, or personal injury caused by negligence, where such limitation is prohibited by law."}),i.jsx("h2",{children:"11. Indemnity"}),i.jsx("p",{children:"You agree to indemnify Tech4Africa Group against claims arising from your content, your use of the Service in violation of these Terms, or your unlawful conduct."}),i.jsx("h2",{children:"12. AI-generated outputs"}),i.jsx("p",{children:"The Service uses AI to provide health analysis, recommendations, and other outputs. These outputs may be inaccurate or incomplete and are provided for general informational purposes. They are not a substitute for veterinary, medical, legal, financial, or other professional advice. You are responsible for verifying outputs and for the prompts and content you submit."}),i.jsx("h2",{children:"13. Changes to these Terms"}),i.jsx("p",{children:"We may update these Terms from time to time. Material changes will be communicated via the Service or by email. Continued use of the Service after changes take effect constitutes acceptance."}),i.jsx("h2",{children:"14. Governing law"}),i.jsx("p",{children:"These Terms are governed by the laws of the Republic of South Africa. The courts of South Africa have exclusive jurisdiction over disputes arising under these Terms."}),i.jsx("h2",{children:"15. Contact"}),i.jsxs("p",{children:["Questions about these Terms can be sent to ",i.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"}),"."]})]})}function Z9e(){return i.jsxs(FP,{title:"Privacy Notice",updated:"8 May 2026",path:"/legal/privacy",description:"How Flockify collects, uses and protects personal data of farmers and organizations on the platform.",children:[i.jsxs("p",{children:["This Privacy Notice explains how ",i.jsx("strong",{children:"Tech4Africa Group"}),' ("Tech4Africa Group", "we", "us"), trading as Flockify, collects and uses personal data when you use the Flockify platform and related services.']}),i.jsx("h2",{children:"1. Who we are"}),i.jsxs("p",{children:["Tech4Africa Group is the data controller responsible for personal data processed through the Flockify Service. You can reach us at ",i.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"}),"."]}),i.jsx("h2",{children:"2. Personal data we collect"}),i.jsxs("ul",{children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Account data:"})," name, email address, phone number, password (hashed), profile photo, location."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Profile and farm data:"})," farm name, farming type, flock records, daily logs, financial records, marketplace listings, course progress."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Content you submit:"})," posts, comments, photos, messages, and observations (including those used by the AI Health Scanner)."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Support and communications:"}
965)," messages you send to support and survey responses."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Payment metadata:"})," a reference to your subscription, the plan you bought, the gateway you used, and the billing dates. Card numbers, bank details and CVV are handled by the payment gateway and never reach Flockify systems."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Usage and device data:"})," log files, IP address, device identifiers, browser type, pages visited, and interaction events."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Cookies:"})," small files used to keep you signed in and to understand product usage."]})]}),i.jsx("h2",{children:"3. Why we use your data and on what legal basis"}),i.jsxs("ul",{children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Provide the Service"})," (creating your account, running flock tools, AI scans, messaging) â performance of a contract."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Process payments and manage subscriptions"})," â performance of a contract."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Customer support"})," â performance of a contract / legitimate interests."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Security and fraud prevention"})," â legitimate interests and legal obligations."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Improving the Service"})," (analytics, feature development) â legitimate interests."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Marketing communications"})," â consent (which you may withdraw at any time)."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Compliance with law"})," â legal obligation."]})]}),i.jsx("h2",{children:"4. Who we share data with"}),i.jsxs("ul",{children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Cloud hosting and infrastructure"})," providers who store your data on our behalf."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Payment gateway"})," â when you subscribe, Flockify sends your selected plan, your email and an internal reference to ",i.jsx("strong",{children:"Stitch"})," (Stitch Money (Pty) Ltd). Privacy notice:"," ",i.jsx("a",{href:"https://stitch.money/legal/privacy-policy",target:"_blank",rel:"noreferrer",children:"stitch.money/legal/privacy-policy"}),". Stitch collects your card or bank credentials directly and notifies us when a payment succeeds, fails or is cancelled. Tech4Africa Group remains the merchant of record."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"AI providers"})," used to power the health scanner and chat features. We send only the content needed to produce a response."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Email and analytics"})," service providers used to send transactional messages and understand product usage."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Educational partners"})," (such as Eagle Africa College) where you have enrolled with an invite code."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Professional advisers"})," (legal, accounting, insurance) where reasonably needed."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Authorities"})," when required by law, court order, or to protect rights and safety."]})]}),i.jsx("h2",{children:"5. International transfers"}),i.jsx("p",{children:"Some of our service providers (in particular AI providers) are located outside South Africa. Where personal data is transferred internationally, we rely on appropriate safeguards such as standard contractual clauses or adequacy decisions. Stitch processes payments within South Africa."}),i.jsx("h2",{children:"6. How long we keep data"}),i.jsx("p",{children:"We keep personal data for as long as your account is active and for a reasonable period afterwards to meet legal, accounting, and dispute-resolution requirements. Content you delete from your account is removed from active systems and purged from backups within a reasonable period. Where data is no longer needed, we delete or anonymise it."}),i.jsx("h2",{children:"7. Your rights"}),i.jsx("p",{children:"Subject to applicable law (including POPIA and GDPR where relevant), you have the right to:"}),i.jsxs("ul",{children:[i.jsx("li",{children:"Access the personal data we hold about you;"}),i.jsx("li",{children:"Request correction of inaccurate data;"}
965),i.jsx("li",{children:"Request deletion of your data;"}),i.jsx("li",{children:"Restrict or object to certain processing;"}),i.jsx("li",{children:"Request portability of data you provided;"}),i.jsx("li",{children:"Withdraw any consent you have given;"}),i.jsx("li",{children:"Lodge a complaint with the Information Regulator (South Africa) or your local supervisory authority."})]}),i.jsxs("p",{children:["To exercise any of these rights, email ",i.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"}),". We will respond within the time required by law (and within one month for GDPR requests)."]}),i.jsx("h2",{children:"8. Security"}),i.jsx("p",{children:"We implement appropriate technical and organisational measures to protect personal data, including encryption in transit, access controls, and regular review of our systems. No service is perfectly secure; please use a strong, unique password and notify us of any suspected unauthorised access."}),i.jsx("h2",{children:"9. Cookies"}),i.jsx("p",{children:"We use essential cookies to keep you signed in and to remember your preferences, and analytics cookies to understand how the Service is used. You can manage cookies in your browser settings. Disabling essential cookies may affect Service functionality."}),i.jsx("h2",{children:"10. Children"}),i.jsx("p",{children:"Flockify is intended for users aged 18 and over. We do not knowingly collect data from children. If you believe a child has provided us with personal data, please contact us so we can delete it."}),i.jsx("h2",{children:"11. Changes to this notice"}),i.jsx("p",{children:'We may update this Privacy Notice from time to time. The "Last updated" date at the top of this page will reflect any changes.'})]})}function e7e(){return i.jsxs(FP,{title:"Refund Policy",updated:"8 May 2026",path:"/legal/refund",description:"Flockify offers a 30-day money-back guarantee on all paid subscriptions. Learn how to request a refund.",children:[i.jsxs("p",{children:["This Refund Policy applies to subscriptions and one-time purchases made on the Flockify platform, operated by ",i.jsx("strong",{children:"Tech4Africa Group"}),"."]}),i.jsx("h2",{children:"30-day money-back guarantee"}),i.jsxs("p",{children:["We offer a ",i.jsx("strong",{children:"30-day money-back guarantee"})," on all paid subscriptions. If you are not satisfied with your purchase, you may request a full refund within 30 days of the original order date."]}),i.jsx("h2",{children:"How to request a refund"}),i.jsx("p",{children:"Tech4Africa Group is the merchant of record for all Flockify orders. To request a refund:"}),i.jsxs("ul",{children:[i.jsxs("li",{children:["Email ",i.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"})," with your order details (the email you used at checkout, plan name, and approximate date) and a brief reason for the request."]}),i.jsx("li",{children:"We aim to respond within two business days. Approved refunds are issued through the same payment gateway you used (Stitch) to your original payment method."})]}),i.jsx("p",{children:"Processing time depends on your bank or card issuer and typically takes 5â10 business days after the refund is approved."}),i.jsx("h2",{children:"Cancelling a subscription"}),i.jsx("p",{children:"You can cancel a subscription at any time from your profile in Flockify. After cancellation, you will continue to have access to paid features until the end of your current billing period. Cancellation alone does not trigger a refund â to request a refund of an unused period, follow the steps above within the 30-day window."}),i.jsx("h2",{children:"Exceptions"}),i.jsx("p",{children:"Refund requests outside the 30-day window are considered on a case-by-case basis and may be granted at our discretion (for example, where you experienced a service outage that materially affected your use). Subscriptions that have been refunded are immediately deactivated."}),i.jsx("h2",{children:"Questions"}),i.jsxs("p",{children:["If you have any questions about this Refund Policy, contact us at ",i.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"}),"."]})]})}function t7e(){const[e]=eg();e.get("plan");const{tier:t,refetch:n}=Bh(),{toast:r}=We(),[s,a]=y.useState(0);return y.useEffect(()=>{if(t!=="free"||s>=10)return;const o=setTimeout(()=>{n(),a(l=>l+1)},1500);return()=>clearTimeout(o)},[t,s,n]),y.useEffect(()=>{t!=="free"&&(r({title:`Welcome to ${Du[t]}!`,description:"Your new features are unlocked. Let's take a quick tour."}),localStorage.removeItem("flockify-tour-completed"))},[t,r]),i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-bg p-4 relative aurora-blobs",children:i.jsx(z,{className:"max-w-lg w-full glass-card",children:i.jsxs(V,{className:"text-center py-12 px-6 space-y-6",children:[i.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:i.jsx(qr,{className:"h-10 w-10 text-primary"})}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h1",{className:"text-3xl font-bold",children:"Payment successful"}),i.jsx("p",{className:"text-muted-foreground",children:t!=="free"?`You're now on the ${Du[t]} plan.`:"Activating your subscription..."})]}),i.jsxs("div",{className:"bg-muted/50 rounded-lg p-4 text-left text-sm space-y-2",children:[i.jsx("div",{className:"flex items-center gap-2 font-medium",children:"What's next"}),i.jsxs("ul",{className:"text-muted-foreground space-y-1 ml-6 list-disc",children:[i.jsx("li",{children:"All premium features are now unlocked"}),i.jsx("li",{children:"You'll get a guided tour highlighting what's new"}),i.jsx("li",{children:"Manage your subscription anytime from your profile"})]})]}),t==="free"&&s>=10&&i.jsxs("div",{className:"text-sm text-muted-foreground bg-muted/30 rounded-lg p-3",children:["Still activating? It can take a moment for our system to re
965ceive the payment confirmation. Refresh in a few seconds or contact"," ",i.jsx("a",{className:"underline",href:"mailto:[email protected]",children:"[email protected]"})," if it persists."]}),i.jsx(U,{asChild:!0,size:"lg",className:"w-full",children:i.jsxs(Ke,{to:"/",children:["Go to dashboard ",i.jsx(ya,{className:"ml-2 h-4 w-4"})]})})]})})})}const bf={bankName:"First National Bank (FNB)",accountHolder:"TECH4AFRICA GROUP (Pty) Ltd",accountNumber:"63202833794",branchCode:"250655",branchName:"FNB Remote Banking",accountType:"Gold Business Account",swiftCode:"FIRNZAJJ"};function n7e(e){const t=e.replace(/-/g,"").slice(0,6).toUpperCase(),n=Date.now().toString(36).slice(-4).toUpperCase();return`FLK${t}${n}`.slice(0,12)}const fu=({label:e,value:t})=>{const[n,r]=y.useState(!1),s=()=>{navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)};return i.jsxs("div",{className:"flex items-center justify-between gap-3 py-2 border-b border-border/40 last:border-0",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-xs text-muted-foreground",children:e}),i.jsx("div",{className:"font-mono text-sm truncate",children:t})]}),i.jsx(U,{size:"sm",variant:"ghost",onClick:s,className:"shrink-0 h-8 px-2",children:n?i.jsx($r,{className:"h-4 w-4 text-primary"}):i.jsx(fB,{className:"h-4 w-4"})})]})};function r7e({reference:e,amount:t}){return i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsxs(se,{className:"flex items-center gap-2 text-lg",children:[i.jsx(dh,{className:"h-5 w-5 text-primary"})," Bank deposit details"]}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Make an EFT to the account below. Use the reference EXACTLY as shown so we can match your payment."})]}),i.jsxs(V,{children:[i.jsxs("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 mb-4",children:[i.jsx("div",{className:"text-xs text-muted-foreground",children:"Amount to pay"}),i.jsxs("div",{className:"text-2xl font-bold",children:["R ",t.toLocaleString("en-ZA")]})]}),i.jsx(fu,{label:"Bank",value:bf.bankName}),i.jsx(fu,{label:"Account holder",value:bf.accountHolder}),i.jsx(fu,{label:"Account number",value:bf.accountNumber}),i.jsx(fu,{label:"Branch code",value:bf.branchCode}),i.jsx(fu,{label:"Account type",value:bf.accountType}),i.jsx(fu,{label:"Payment reference",value:e})]})]})}const s7e={farmer_pro_monthly:{name:"Farmer Pro",product:"farmer_pro",amount:99,frequency:"monthly"},farmer_pro_yearly:{name:"Farmer Pro",product:"farmer_pro",amount:990,frequency:"yearly"},farmer_business_monthly:{name:"Farmer Business",product:"farmer_business",amount:299,frequency:"monthly"},farmer_business_yearly:{name:"Farmer Business",product:"farmer_business",amount:2990,frequency:"yearly"},org_pro_monthly:{name:"Organization Pro",product:"org_pro",amount:499,frequency:"monthly"},org_pro_yearly:{name:"Organization Pro",product:"org_pro",amount:4990,frequency:"yearly"},org_business_monthly:{name:"Organization Business",product:"org_business",amount:1499,frequency:"monthly"},org_business_yearly:{name:"Organization Business",product:"org_business",amount:14990,frequency:"yearly"}};function i7e(){const[e]=eg(),t=Ki(),{toast:n}=We(),r=e.get("plan")??"",s=s7e[r],[a,o]=y.useState(null),[l,c]=y.useState(""),[u,d]=y.useState(null),[h,f]=y.useState(!1);y.useEffect(()=>{q.auth.getUser().then(({data:{user:p}})=>{if(!p){n({title:"Sign in required",description:"Please sign in to subscribe.",variant:"destructive"}),t("/pricing");return}o(p.id),c(n7e(p.id))})},[t,n]);const m=y.useMemo(()=>(s==null?void 0:s.frequency)==="yearly"?365:30,[s]);if(!s)return i.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:i.jsx(z,{className:"max-w-md w-full",children:i.jsxs(V,{className:"py-8 text-center space-y-3",children:[i.jsx("p",{children:"Unknown plan."}),i.jsx(U,{asChild:!0,children:i.jsx(Ke,{to:"/pricing",children:"Back to pricing"})})]})})});const g=async()=>{if(!u){n({title:"Proof required",description:"Please upload your proof of payment.",variant:"destructive"});return}if(u.size<1024){n({title:"File looks empty",description:"Please pick a clear screenshot or PDF of your payment.",variant:"destructive"});return}if(u.size>10*1024*1024){n({title:"File too large",description:"Maximum file size is 10MB.",variant:"destructive"});return}const p=["image/jpeg","image/png","image/webp","image/heic","image/heif","application/pdf"];if(u.type&&!p.includes(u.type)){n({title:"Unsupported file",description:"Use a JPG, PNG, WEBP, HEIC or PDF file.",variant:"destructive"});return}f(!0);try{const{data:{user:x},error:v}=await q.auth.getUser();if(v||!x){n({title:"Sign in again",description:"Your session expired. Please sign in and retry.",variant:"destructive"}),t("/");return}const b=x.id,w=(u.name.split(".").pop()||"bin").toLowerCase().replace(/[^a-z0-9]/g,"").slice(0,5)||"bin",j=l.replace(/[^A-Za-z0-9_-]/g,""),S=`${b}/${j}-${Date.now()}.${w}`,{error:N}=await q.storage.from("payment-proofs").upload(S,u,{contentType:u.type||"application/octet-stream",cacheControl:"3600",upsert:!1});if(N)throw console.error("[ManualCheckout] upload error",N),new Error(N.message||"Upload failed. Please try a different file.");const{data:k,error:_}=await q.rpc("submit_manual_payment",{_price_id:r,_product_id:s.product,_payment_reference:j,_proof_of_payment_url:S,_environment:Nw()});if(_)throw _;q.functions.invoke("notify-admin-payment",{body:{subscription_id:k,plan:`${s.name} (${s.frequency}
965)`,amount:s.amount.toLocaleString("en-ZA"),reference:j}}).catch(C=>console.warn("[ManualCheckout] notify-admin-payment failed",C)),n({title:`Welcome to ${s.name} ð`,description:"You have full access right away. We'll confirm your EFT within 24 hours."}),t("/?payment=pending")}catch(x){n({title:"Submission failed",description:(x==null?void 0:x.message)??"Please try again.",variant:"destructive"})}finally{f(!1)}};return i.jsx("div",{className:"min-h-screen bg-gradient-bg relative aurora-blobs",children:i.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-8",children:[i.jsxs(Ke,{to:"/pricing",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-6",children:[i.jsx(jt,{className:"h-4 w-4"})," Back to pricing"]}),i.jsxs("div",{className:"mb-6",children:[i.jsx(ye,{variant:"secondary",className:"mb-2",children:"Manual EFT"}),i.jsx("h1",{className:"text-3xl font-bold",children:"Complete your payment"}),i.jsxs("p",{className:"text-muted-foreground mt-1",children:["Subscribing to ",i.jsx("strong",{children:s.name})," (",s.frequency,") â R ",s.amount.toLocaleString("en-ZA")]})]}),i.jsxs("ol",{className:"space-y-6",children:[i.jsx("li",{children:i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{className:"text-base",children:"Step 1 â Make the EFT in your banking app"})}),i.jsx(V,{children:i.jsx(r7e,{reference:l,amount:s.amount})})]})}),i.jsx("li",{children:i.jsxs(z,{className:"glass-card",children:[i.jsxs(re,{children:[i.jsx(se,{className:"text-base",children:"Step 2 â Upload your proof of payment"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"Screenshot or PDF from your banking app. Max 10MB."})]}),i.jsx(V,{children:i.jsxs("label",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-border rounded-lg cursor-pointer hover:bg-muted/30 transition",children:[i.jsx("input",{type:"file",accept:"image/jpeg,image/png,image/webp,image/heic,image/heif,application/pdf",className:"hidden",onChange:p=>{var x;return d(((x=p.target.files)==null?void 0:x[0])??null)}}),u?i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[i.jsx(En,{className:"h-5 w-5 text-primary"}),i.jsx("span",{className:"truncate max-w-[220px]",children:u.name}),i.jsx(qr,{className:"h-4 w-4 text-primary"})]}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[i.jsx(Yb,{className:"h-6 w-6"}),i.jsx("span",{children:"Tap to choose proof of payment"})]})]})})]})}),i.jsx("li",{children:i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{children:i.jsx(se,{className:"text-base",children:"Step 3 â Submit for verification"})}),i.jsxs(V,{className:"space-y-3",children:[i.jsxs("p",{className:"text-sm text-muted-foreground",children:["Once submitted, our team will verify your payment (usually within 24 hours) and activate your"," ",i.jsx("strong",{children:s.name})," subscription for ",m," days."]}),i.jsx(U,{onClick:g,disabled:h||!u,className:"w-full",size:"lg",children:h?i.jsxs(i.Fragment,{children:[i.jsx(Jr,{className:"h-4 w-4 mr-2 animate-spin"}),"Submitting..."]}):"Submit for verification"}),i.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Questions? Email"," ",i.jsx("a",{className:"underline",href:"mailto:[email protected]",children:"[email protected]"})]})]})]})})]})]})})}const a7e=["pending","active","canceled"];function o7e(){const{toast:e}=We(),[t,n]=y.useState(null),[r,s]=y.useState("pending"),[a,o]=y.useState([]),[l,c]=y.useState(!0),[u,d]=y.useState(0);y.useEffect(()=>{(async()=>{const{data:{user:g}}=await q.auth.getUser();if(!g){n(!1);return}const{data:p}=await q.from("user_roles").select("role").eq("user_id",g.id).eq("role","admin").maybeSingle();n(!!p)})()},[]);const h=async()=>{c(!0);let g=q.from("subscriptions").select("*").eq("status",r);r==="pending"&&(g=g.neq("provider","yoco"));const{data:p}=await g.order("created_at",{ascending:!1}).limit(100),x=[...new Set((p??[]).map(w=>w.user_id))],v=x.length?(await q.from("profiles").select("user_id, display_name, phone").in("user_id",x)).data??[]:[],b=new Map(v.map(w=>[w.user_id,w]));o((p??[]).map(w=>
965({...w,profile:b.get(w.user_id)??null}))),c(!1)};y.useEffect(()=>{t&&h()},[t,r]);const f=async()=>{const{count:g}=await q.from("subscriptions").select("id",{count:"exact",head:!0}).eq("status","pending").neq("provider","yoco");d(g??0)};y.useEffect(()=>{if(!t)return;f();const g=q.channel("admin-pending-subs").on("postgres_changes",{event:"*",schema:"public",table:"subscriptions"},()=>{f(),r==="pending"&&h()}).subscribe();return()=>{q.removeChannel(g)}},[t]);const m=async g=>{const{data:p,error:x}=await q.storage.from("payment-proofs").createSignedUrl(g,300);if(x||!(p!=null&&p.signedUrl)){e({title:"Could not open proof",description:x==null?void 0:x.message,variant:"destructive"});return}window.open(p.signedUrl,"_blank")};return t===null?i.jsx("div",{className:"min-h-screen flex items-center justify-center",children:i.jsx(Jr,{className:"h-6 w-6 animate-spin"})}):t?i.jsx("div",{className:"min-h-screen bg-gradient-bg",children:i.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[i.jsxs(Ke,{to:"/",className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-4",children:[i.jsx(jt,{className:"h-4 w-4"})," Back home"]}),i.jsxs("div",{className:"flex items-center justify-between mb-6 flex-wrap gap-3",children:[i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[i.jsx(Ad,{className:"h-6 w-6 text-primary"})," Payment verification"]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"Review and approve manual EFT payments."})]}),i.jsx("div",{className:"inline-flex bg-muted rounded-lg p-1",children:a7e.map(g=>i.jsxs("button",{onClick:()=>s(g),className:`px-3 py-1.5 rounded-md text-sm capitalize inline-flex items-center gap-2 ${r===g?"bg-background shadow":""}`,children:[g,g==="pending"&&u>0&&i.jsx("span",{className:"inline-flex items-center justify-center min-w-5 h-5 px-1.5 rounded-full text-[10px] font-semibold bg-destructive text-destructive-foreground",children:u})]},g))})]}),l?i.jsx("div",{className:"flex justify-center py-12",children:i.jsx(Jr,{className:"h-6 w-6 animate-spin"})}):a.length===0?i.jsx(z,{children:i.jsxs(V,{className:"py-12 text-center text-muted-foreground",children:["No ",r," payments."]})}):i.jsx("div",{className:"space-y-3",children:a.map(g=>i.jsx(l7e,{row:g,onAction:h,onViewProof:m},g.id))})]})}):i.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:i.jsx(z,{className:"max-w-md w-full",children:i.jsxs(V,{className:"py-8 text-center space-y-3",children:[i.jsx(Ad,{className:"h-10 w-10 mx-auto text-muted-foreground"}),i.jsx("h2",{className:"font-semibold",children:"Admin access required"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"You don't have permission to view this page."}),i.jsx(U,{asChild:!0,variant:"outline",children:i.jsx(Ke,{to:"/",children:"Back home"})})]})})})}function l7e({row:e,onAction:t,onViewProof:n}){var x,v,b;const{toast:r}=We(),[s,a]=y.useState((x=e.price_id)!=null&&x.includes("yearly")?365:30),[o,l]=y.useState(""),[c,u]=y.useState(""),[d,h]=y.useState(!1),f=async()=>{h(!0);const{error:w}=await q.rpc("approve_manual_payment",{_subscription_id:e.id,_period_days:s,_notes:o||null});if(h(!1),w)return r({title:"Approve failed",description:w.message,variant:"destructive"});r({title:"Subscription activated"}),t()},m=async()=>{if(!c.trim())return r({title:"Reason required",variant:"destructive"});h(!0);const{error:w}=await q.rpc("reject_manual_payment",{_subscription_id:e.id,_reason:c});if(h(!1),w)return r({title:"Reject failed",description:w.message,variant:"destructive"});r({title:"Payment rejected"}),t()},g=e.provider==="yoco",p=e.status==="pending"&&!g;return i.jsxs(z,{className:"glass-card",children:[i.jsx(re,{className:"pb-3",children:i.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[i.jsxs("div",{children:[i.jsx(se,{className:"text-base",children:((v=e.profile)==null?void 0:v.display_name)??"Unknown user"}),i.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.product_id," ⢠",e.price_id," ⢠",e.environment]}),((b=e.profile)==null?void 0:b.phone)&&i.jsx("p",{className:"text-xs text-muted-foreground",children:e.profile.phone})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ye,{variant:"outline",children:g?"Card (Yoco)":"Manual EFT"}),i.jsx(ye,{variant:e.status==="active"?"default":e.status==="pending"?"secondary":"outline",children:e.status})]})]})}),i.jsxs(V,{className:"space-y-3 text-sm",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground",children:"Reference"}),i.jsx("div",{className:"font-mono",children:e.payment_reference??"â"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs text-muted-foreground",children:"Submitted"}
965),i.jsx("div",{children:new Date(e.created_at).toLocaleString("en-ZA")})]}),e.current_period_end&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("div",{className:"text-xs text-muted-foreground",children:"Access until"}),i.jsx("div",{children:new Date(e.current_period_end).toLocaleDateString("en-ZA")})]}),e.admin_notes&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("div",{className:"text-xs text-muted-foreground",children:"Admin notes"}),i.jsx("div",{children:e.admin_notes})]})]}),e.proof_of_payment_url&&i.jsxs(U,{variant:"outline",size:"sm",onClick:()=>n(e.proof_of_payment_url),children:[i.jsx(En,{className:"h-4 w-4 mr-2"})," View proof ",i.jsx(pB,{className:"h-3 w-3 ml-1"})]}),p&&i.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/40",children:[i.jsxs(yt,{children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{size:"sm",className:"flex-1",children:[i.jsx(qr,{className:"h-4 w-4 mr-2"}),"Approve"]})}),i.jsxs(mt,{children:[i.jsxs(xt,{children:[i.jsx(vt,{children:"Approve payment"}),i.jsx($i,{children:"Activates the subscription and grants access for the chosen period."})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Access period (days)"}),i.jsx(ae,{type:"number",value:s,onChange:w=>a(parseInt(w.target.value)||30)})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm font-medium",children:"Notes (optional)"}),i.jsx(Yt,{value:o,onChange:w=>l(w.target.value),placeholder:"Internal notes..."})]})]}),i.jsx(vk,{children:i.jsx(U,{onClick:f,disabled:d,children:d?"Approving...":"Approve & activate"})})]})]}),i.jsxs(yt,{children:[i.jsx(hn,{asChild:!0,children:i.jsxs(U,{size:"sm",variant:"outline",className:"flex-1 text-destructive",children:[i.jsx(Jp,{className:"h-4 w-4 mr-2"}),"Reject"]})}),i.jsxs(mt,{children:[i.jsxs(xt,{children:[i.jsx(vt,{children:"Reject payment"}),i.jsx($i,{children:"The user will be notified that the payment was rejected."})]}),i.jsx(Yt,{value:c,onChange:w=>u(w.target.value),placeholder:"Reason (e.g. payment not received, wrong reference)"}),i.jsx(vk,{children:i.jsx(U,{variant:"destructive",onClick:m,disabled:d,children:d?"Rejecting...":"Reject payment"})})]})]})]})]})]})}const n3="https://mrmmozypopayflmybqvx.supabase.co",r3="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1ybW1venlwb3BheWZsbXlicXZ4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzI5NzYxNDgsImV4cCI6MjA4ODU1MjE0OH0.GrsUdY1-jwVy4gGt10hILm6qPJgZ6B592MqqLpLPrD0";function c7e(){const[e]=eg(),t=e.get("token")??"",[n,r]=y.useState({status:"loading"});y.useEffect(()=>{if(!t){r({status:"invalid",message:"Missing unsubscribe token."});return}(async()=>{try{const a=await fetch(`${n3}/functions/v1/handle-email-unsubscribe?token=${encodeURIComponent(t)}`,{headers:{apikey:r3}}),o=await a.json().catch(()=>({}));a.ok&&(o!=null&&o.valid)?r({status:"valid",email:o.email??""}):o!=null&&o.alreadyUsed?r({status:"already"}):r({status:"invalid",message:(o==null?void 0:o.error)??"This unsubscribe link is invalid or expired."})}catch{r({status:"invalid",message:"Couldn't validate this link. Try again later."})}})()},[t]);const s=async()=>{if(n.status==="valid"){r({status:"submitting",email:n.email});try{const a=await fetch(`${n3}/functions/v1/handle-email-unsubscribe`,{method:"POST",headers:{"Content-Type":"application/json",apikey:r3},body:JSON.stringify({token:t})}),o=await a.json().catch(()=>({}));a.ok&&(o!=null&&o.success)?r({status:"done",email:n.email}):r({status:"error",message:(o==null?void 0:o.error)??"Couldn't unsubscribe. Please try again."})}catch{r({status:"error",message:"Network error. Please try again."})}}};return i.jsx("main",{className:"min-h-screen flex items-center justify-center bg-background px-4 py-12",children:i.jsxs(z,{className:"w-full max-w-md border-border",children:[i.jsxs(re,{className:"text-center space-y-2",children:[i.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:i.jsx(QZ,{className:"w-6 h-6 text-primary"})}),i.jsx(se,{className:"text-2xl",children:"Email preferences"})]}),i.jsxs(V,{className:"space-y-4 text-center",children:[n.status==="loading"&&i.jsxs("div",{className:"flex items-center justify-center gap-2 text-muted-foreground",children:[i.jsx(Jr,{className:"w-4 h-4 animate-spin"})," Checking your linkâ¦"]}),n.status==="valid"&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-muted-foreground",children:["Unsubscribe ",i.jsx("span",{className:"font-medium text-foreground",children:n.email})," from Flockify app emails?"]}
965),i.jsx(U,{onClick:s,className:"w-full",size:"lg",children:"Confirm unsubscribe"}),i.jsx("p",{className:"text-xs text-muted-foreground",children:"You'll still receive essential account emails (sign-in, password reset)."})]}),n.status==="submitting"&&i.jsxs("div",{className:"flex items-center justify-center gap-2 text-muted-foreground",children:[i.jsx(Jr,{className:"w-4 h-4 animate-spin"})," Updating your preferencesâ¦"]}),n.status==="done"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(qr,{className:"w-10 h-10 text-primary mx-auto"}),i.jsx("p",{className:"font-medium",children:"You've been unsubscribed."}),i.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.email," will no longer receive Flockify app emails."]})]}),n.status==="already"&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(qr,{className:"w-10 h-10 text-primary mx-auto"}),i.jsx("p",{className:"font-medium",children:"You're already unsubscribed."}),i.jsx("p",{className:"text-sm text-muted-foreground",children:"No further action needed."})]}),(n.status==="invalid"||n.status==="error")&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(Jp,{className:"w-10 h-10 text-destructive mx-auto"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:n.message})]})]})]})})}function s3(){return q.auth.oauth}function u7e(){var N,k;const[e]=eg(),t=e.get("authorization_id")??"",{toast:n}=We(),[r,s]=y.useState(!1),[a,o]=y.useState(!1),[l,c]=y.useState(null),[u,d]=y.useState(null),[h,f]=y.useState(!1),[m,g]=y.useState(""),[p,x]=y.useState("");y.useEffect(()=>{let _=!0;return(async()=>{if(!t){d("Missing authorization_id in the URL."),s(!0);return}const{data:C}=await q.auth.getSession();if(!_||(o(!!C.session),s(!0),!C.session))return;const{data:A,error:E}=await s3().getAuthorizationDetails(t);if(!_)return;if(E){d(E.message??"Could not load this authorization request.");return}const P=(A==null?void 0:A.redirect_url)??(A==null?void 0:A.redirect_to);if(P&&!(A!=null&&A.client)){window.location.href=P;return}c(A)})(),()=>{_=!1}},[t]);async function v(_){f(!0);const C=s3(),{data:A,error:E}=_?await C.approveAuthorization(t):await C.denyAuthorization(t);if(E){f(!1),d(E.message??"The authorization server rejected the request.");return}const P=(A==null?void 0:A.redirect_url)??(A==null?void 0:A.redirect_to);if(!P){f(!1),d("No redirect returned by the authorization server.");return}window.location.href=P}async function b(_){_.preventDefault(),f(!0);const{error:C}=await q.auth.signInWithPassword({email:m,password:p});if(f(!1),C){n({title:"Sign-in failed",description:C.message,variant:"destructive"});return}window.location.reload()}if(!r)return i.jsx("main",{className:"min-h-screen grid place-items-center p-6",children:i.jsx(Jr,{className:"h-6 w-6 animate-spin text-muted-foreground"})});if(u)return i.jsx("main",{className:"min-h-screen grid place-items-center p-6",children:i.jsxs(z,{className:"w-full max-w-md",children:[i.jsx(re,{children:i.jsx(se,{children:"Authorization error"})}),i.jsxs(V,{className:"space-y-2 text-sm",children:[i.jsx("p",{children:"Could not complete this authorization request."}),i.jsx("p",{className:"text-muted-foreground",children:u})]})]})});if(!a)return i.jsx("main",{className:"min-h-screen grid place-items-center p-6 bg-background",children:i.jsxs(z,{className:"w-full max-w-md",children:[i.jsxs(re,{className:"text-center",children:[i.jsx(se,{children:"Sign in to continue"}),i.jsx("p",{className:"text-sm text-muted-foreground pt-2",children:"An external app is asking to connect to your Flockify account."})]}),i.jsx(V,{children:i.jsxs("form",{onSubmit:b,className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"email",children:"Email"}),i.jsx(ae,{id:"email",type:"email",required:!0,value:m,onChange:_=>g(_.target.value)})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(ne,{htmlFor:"password",children:"Password"}),i.jsx(ae,{id:"password",type:"password",required:!0,value:p,onChange:_=>x(_.target.value)})]}),i.jsx(U,{type:"submit",className:"w-full",disabled:h,children:h?"Signing inâ¦":"Sign in"})]})})]})});if(!l)return i.jsx("main",{className:"min-h-screen grid place-items-center p-6",children:i.jsx(Jr,{className:"h-6 w-6 animate-spin text-muted-foreground"})});const w=((N=l==null?void 0:l.client)==null?void 0:N.name)??"an external app",j=((k=l==null?void 0:l.client)==null?void 0:k.redirect_uri)??(l==null?void 0:l.redirect_uri)??null,S=(l==null?void 0:l.scopes)??(l==null?void 0:l.requested_scopes)??[];return i.jsx("main",{className:"min-h-screen grid place-items-center p-6 bg-background",children:i.jsxs(z,{className:"w-full max-w-md",children:[i.jsx(re,{children:i.jsxs(se,{children:["Connect ",w," to Flockify"]})}),i.jsxs(V,{className:"space-y-4 text-sm",children:[i.jsxs("p",{children:[w," will be able to call Flockify tools while you are signed in. It can list and update your flocks, daily logs, and finance records, and search the marketplace â always acting as you."]}),j&&i.jsxs("p",{className:"text-muted-foreground break-all",children:["Redirects to: ",i.jsx("span",{className:"font-mono",children:j})]}),S.length>0&&i.jsx("ul",{className:"list-disc pl-5 text-muted-foreground",children:S.map(_=>i.jsx("li",{children:_},_))}),i.jsx("p",{className:"text-muted-foreground",children:"This does not bypass Flockify's permissions or backend policies."}),i.jsxs("div",{className:"flex gap-3 pt-2",children:[i.jsx(U,{className:"flex-1",disabled:h,onClick:()=>v(!0),children:h?"Workingâ¦":"Approve"}),i.jsx(U,{className:"flex-1",variant:"outline",disabled:h,onClick:()=>v(!1),children:"Deny"})]})]})]})})}function d7e(){const{number:e}=Lz(),[t,n]=y.useState(null),[r,s]=y.useState(!0);return y.useEffect(()=>{e&&q.rpc("verify_certificate",{_number:e}).then(({data:a})=>{n(a??null),s(!1)})},[e]),i.jsx("div",{className:"min-h-screen bg-background px-4 py-10",children:i.jsxs("div",{className:"mx-auto max-w-3xl space-y-6",children:[r?i.jsx("p",{className:"text-center text-muted-foreground",children:"Checking certificateâ¦"}):t!=null&&t.valid?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-center gap-2 text-foreground",children:[i.jsx(Ad,{className:"h-6 w-6 text-primary"}),i.jsx("h1",{className:"text-xl font-bold",children:"This certificate is genuine"})]}),i.jsx(BG,{certificateNumber:t.certificate_number,courseName:t.course,userName:t.name,completionDate:t.completion_date,
965showActions:!1})]}):i.jsxs("div",{className:"text-center space-y-3",children:[i.jsx(iee,{className:"h-10 w-10 mx-auto text-destructive"}),i.jsx("h1",{className:"text-xl font-bold",children:"Certificate not found"}),i.jsx("p",{className:"text-muted-foreground",children:"Check the certificate number and try again."})]}),i.jsx("div",{className:"text-center",children:i.jsx(U,{asChild:!0,variant:"outline",children:i.jsx(Ke,{to:"/learning",children:"Visit the Flockify Learning Hub"})})})]})})}const h7e=new Set(["home","flock","daily-log","market","finance","social","profile","learning","course","pricing","help-center","compliance","smart-analytics","ai-health","skills-training","mentorship","business-development","marketplace-access","lecturer","campus","metrics","feed-calculator"]);function f7e(e){return e==="/"||e===""?"home":e.startsWith("/learning/course")?"course":e.startsWith("/learning")?"learning":e.startsWith("/pricing")?"pricing":e.startsWith("/help")?"help-center":e.startsWith("/compliance")?"compliance":e.startsWith("/smart-analytics")?"smart-analytics":e.startsWith("/ai-health")?"ai-health":e.startsWith("/skills-training")?"skills-training":e.startsWith("/mentorship")?"mentorship":e.startsWith("/business-development")?"business-development":e.startsWith("/market-access")?"marketplace-access":e.startsWith("/lecturer")?"lecturer":e.startsWith("/campus")?"campus":e.startsWith("/metrics")?"metrics":"default"}function m7e({activeTab:e}){const[t,n]=y.useState(!1),{t:r,i18n:s}=Gi(),a=dl(),o=e??f7e(a.pathname),l=h7e.has(o)?o:"default",c=r(`help.${l}.title`,{defaultValue:r("help.default.title")}),u=r(`help.${l}.intro`,{defaultValue:r("help.default.intro")}),d=r(`help.${l}.tips`,{returnObjects:!0,defaultValue:r("help.default.tips",{returnObjects:!0})}),h=Array.isArray(d)?d:[],f=y.useMemo(()=>`${c}. ${u} ${h.join(" ")}`,[c,u,h,s.language]);return i.jsxs(CG,{open:t,onOpenChange:n,children:[i.jsx(EG,{asChild:!0,children:i.jsx(U,{type:"button",size:"icon",className:"fixed right-4 bottom-24 md:bottom-6 z-40 h-12 w-12 rounded-full shadow-elegant bg-secondary text-secondary-foreground hover:bg-secondary/90 min-h-11 min-w-11","aria-label":r("common.openHelp"),children:i.jsx(hB,{className:"h-6 w-6"})})}),i.jsxs(vP,{side:"bottom",className:"max-h-[85dvh] overflow-y-auto rounded-t-2xl",children:[i.jsxs(bP,{className:"text-left",children:[i.jsx(wP,{className:"text-xl",children:c}),i.jsx(PG,{className:"text-base text-foreground/80",children:u})]}),i.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 items-center",children:[i.jsx(M2,{text:f,label:r("help.readThisAloud")}),i.jsx(H2,{className:"ml-auto w-40"})]}),i.jsx("ul",{className:"mt-5 space-y-3","aria-label":r("help.readThisAloud"),children:h.map((m,g)=>i.jsxs("li",{className:"flex gap-3 items-start text-base leading-relaxed",children:[i.jsx("span",{"aria-hidden":"true",className:"mt-1 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary font-semibold text-sm",children:g+1}),i.jsx("span",{children:m})]},g))}),i.jsxs("div",{className:"mt-6 border-t border-border pt-4 space-y-2",children:[i.jsx("p",{className:"text-sm font-semibold",children:r("common.needHelp")}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx(U,{asChild:!0,variant:"outline",className:"justify-start min-h-11",children:i.jsxs("a",{href:"https://wa.me/27000000000",target:"_blank",rel:"noopener noreferrer",children:[i.jsx(Ko,{className:"h-4 w-4 mr-2"}),r("common.chatWhatsapp")]})}),i.jsx(U,{asChild:!0,variant:"outline",className:"justify-start min-h-11",children:i.jsxs("a",{href:"mailto:[email protected]",children:[i.jsx(Ua,{className:"h-4 w-4 mr-2"}),r("common.emailSupport")]})})]})]})]})]})}const p7e=new _re,g7e=()=>{y.useEffect(()=>{(async()=>{if(iv.isNativePlatform())try{await nie.hide(),await GO.setStyle({style:CN.Dark}),await GO.setBackgroundColor({color:"#10b981"})}catch(n){console.log("Capacitor initialization error:",n)}})()},[]);const e=t=>{t==="incubator"?window.location.href="/incubator":window.location.href="/"};return i.jsx(Tre,{client:p7e,children:i.jsxs(pz,{children:[i.jsx(Xee,{}),i.jsx(kte,{}),i.jsxs(zse,{children:[i.jsxs(Rse,{children:[i.jsx(lt,{path:"/",element:i.jsx(y8e,{})}),i.jsx(lt,{path:"/incubator",element:i.jsx(DG,{})}),i.jsx(lt,{path:"/incubator-access",element:i.jsx(b8e,{onAuthSuccess:e})}),i.jsx(lt,{path:"/compliance",element:i.jsx(LG,{})}),i.jsx(lt,{path:"/smart-analytics",element:i.jsx(j8e,{})}),i.jsx(lt,{path:"/ai-health-monitoring",element:i.jsx(S8e,{})}),i.jsx(lt,{path:"/market-access",element:i.jsx(N8e,{})}),i.jsx(lt,{path:"/skills-training",element:i.jsx(k8e,{})}),i.jsx(lt,{path:"/mentorship-support",element:i.jsx(_8e,{})}),i.jsx(lt,{path:"/business-development",element:i.jsx(C8e,{})}),i.jsx(lt,{path:"/learning",element:i.jsx(E8e,{})}),i.jsx(lt,{path:"/learning/course/:courseId",element:i.jsx($9e,{})}),i.jsx(lt,{path:"/certificate/:number",element:i.jsx(d7e,{})}),i.jsx(lt,{path:"/help",element:i.jsx(O8e,{})}),i.jsx(lt,{path:"/admin",element:i.jsx(w8e,{})}),i.jsx(lt,{path:"/metrics",element:i.jsx(z9e,{})}),i.jsx(lt,{path:"/lecturer",element:i.jsx(H9e,{})}),i.jsx(lt,{path:"/lecturer/profile",element:i.jsx(q9e,{})}),i.jsx(lt,{path:"/college-admin",element:i.jsx(Y9e,{})}),i.jsx(lt,{path:"/campus",element:i.jsx(X9e,{})}),i.jsx(lt,{path:"/pricing",element:i.jsx(J9e,{})}),i.jsx(lt,{path:"/checkout/manual",element:i.jsx(i7e,{})}),i.jsx(lt,{path:"/checkout/success",element:i.jsx(t7e,{})}),i.jsx(lt,{path:"/admin/payments",element:i.jsx(o7e,{})}),i.jsx(lt,{path:"/legal/terms",element:i.jsx(Q9e,{})}),i.jsx(lt,{path:"/legal/privacy",element:i.jsx(Z9e,{})}),i.jsx(lt,{path:"/legal/refund",element:i.jsx(e7e,{})}),i.jsx(lt,{path:"/unsubscribe",element:i.jsx(c7e,{})}),i.jsx(lt,{path:"/.lovable/oauth/consent",element:i.jsx(u7e,{})}),i.jsx(lt,{path:"*",element:i.jsx(x8e,{})})]}),i.jsx(m7e,{})]})]})})};E6(document.getElementById("root")).render(i.jsx(I6,{children:i.jsx(g7e,{})}));export{KE as W,Lm as _,Po as c,it as g};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.