PageSourceSearch

https://my.reviewkit.com/assets/index-CWCzEn8J.js

js reviewkit.com collected 2026-10-09 22:25:36 UTC 1,598,364 bytes, 777 lines download raw bytes

vendor: 6,236 bytes, lines 1-9
1var FE=e=>{throw TypeError(e)};var f0=(e,t,n)=>t.has(e)||FE("Cannot "+n);var z=(e,t,n)=>(f0(e,t,"read from private field"),n?n.call(e):t.get(e)),Re=(e,t,n)=>t.has(e)?FE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ve=(e,t,n,r)=>(f0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Je=(e,t,n)=>(f0(e,t,"access private method"),n);var Fm=(e,t,n,r)=>({set _(i){ve(e,t,i,n)},get _(){return z(e,t,r)}});function $7(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r$={exports:{}},cx={},i$={exports:{}},et={};/**
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 Kp=Symbol.for("react.element"),D7=Symbol.for("react.portal"),L7=Symbol.for("react.fragment"),F7=Symbol.for("react.strict_mode"),B7=Symbol.for("react.profiler"),U7=Symbol.for("react.provider"),z7=Symbol.for("react.context"),W7=Symbol.for("react.forward_ref"),H7=Symbol.for("react.suspense"),q7=Symbol.for("react.memo"),V7=Symbol.for("react.lazy"),BE=Symbol.iterator;function G7(e){return e===null||typeof e!="object"?null:(e=BE&&e[BE]||e["@@iterator"],typeof e=="function"?e:null)}var a$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},s$=Object.assign,o$={};function kd(e,t,n){this.props=e,this.context=t,this.refs=o$,this.updater=n||a$}kd.prototype.isReactComponent={};kd.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")};kd.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function l$(){}l$.prototype=kd.prototype;function qS(e,t,n){this.props=e,this.context=t,this.refs=o$,this.updater=n||a$}var VS=qS.prototype=new l$;VS.constructor=qS;s$(VS,kd.prototype);VS.isPureReactComponent=!0;var UE=Array.isArray,c$=Object.prototype.hasOwnProperty,GS={current:null},u$={key:!0,ref:!0,__self:!0,__source:!0};function d$(e,t,n){var r,i={},a=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(a=""+t.key),t)c$.call(t,r)&&!u$.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Kp,type:e,key:a,ref:s,props:i,_owner:GS.current}}function K7(e,t){return{$$typeof:Kp,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function KS(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kp}function Y7(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zE=/\/+/g;function h0(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Y7(""+e.key):t.toString(36)}function Lg(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Kp:case D7:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+h0(s,0):r,UE(i)?(n="",e!=null&&(n=e.replace(zE,"$&/")+"/"),Lg(i,t,n,"",function(u){return u})):i!=null&&(KS(i)&&(i=K7(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(zE,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",UE(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+h0(a,l);s+=Lg(a,t,n,c,i)}else if(c=G7(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+h0(a,l++),s+=Lg(a,t,n,c,i);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 s}function Bm(e,t,n){if(e==null)return e;var r=[],i=0;return Lg(e,r,"","",function(a){return t.call(n,a,i++)}),r}function X7(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 fr={current:null},Fg={transition:null},Q7={ReactCurrentDispatcher:fr,ReactCurrentBatchConfig:Fg,ReactCurrentOwner:GS};function f$(){throw Error("act(...) is not supported in production builds of React.")}et.Children={map:Bm,forEach:function(e,t,n){Bm(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Bm(e,function(){t++}),t},toArray:function(e){return Bm(e,function(t){return t})||[]},only:function(e){if(!KS(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};et.Component=kd;et.Fragment=L7;et.Profiler=B7;et.PureComponent=qS;et.StrictMode=F7;et.Suspense=H7;
vendor: 7,383 bytes, lines 9-25
9et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q7;et.act=f$;et.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=s$({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=GS.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)c$.call(t,c)&&!u$.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:Kp,type:e.type,key:i,ref:a,props:r,_owner:s}};et.createContext=function(e){return e={$$typeof:z7,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:U7,_context:e},e.Consumer=e};et.createElement=d$;et.createFactory=function(e){var t=d$.bind(null,e);return t.type=e,t};et.createRef=function(){return{current:null}};et.forwardRef=function(e){return{$$typeof:W7,render:e}};et.isValidElement=KS;et.lazy=function(e){return{$$typeof:V7,_payload:{_status:-1,_result:e},_init:X7}};et.memo=function(e,t){return{$$typeof:q7,type:e,compare:t===void 0?null:t}};et.startTransition=function(e){var t=Fg.transition;Fg.transition={};try{e()}finally{Fg.transition=t}};et.unstable_act=f$;et.useCallback=function(e,t){return fr.current.useCallback(e,t)};et.useContext=function(e){return fr.current.useContext(e)};et.useDebugValue=function(){};et.useDeferredValue=function(e){return fr.current.useDeferredValue(e)};et.useEffect=function(e,t){return fr.current.useEffect(e,t)};et.useId=function(){return fr.current.useId()};et.useImperativeHandle=function(e,t,n){return fr.current.useImperativeHandle(e,t,n)};et.useInsertionEffect=function(e,t){return fr.current.useInsertionEffect(e,t)};et.useLayoutEffect=function(e,t){return fr.current.useLayoutEffect(e,t)};et.useMemo=function(e,t){return fr.current.useMemo(e,t)};et.useReducer=function(e,t,n){return fr.current.useReducer(e,t,n)};et.useRef=function(e){return fr.current.useRef(e)};et.useState=function(e){return fr.current.useState(e)};et.useSyncExternalStore=function(e,t,n){return fr.current.useSyncExternalStore(e,t,n)};et.useTransition=function(){return fr.current.useTransition()};et.version="18.3.1";i$.exports=et;var b=i$.exports;const I=ct(b),YS=$7({__proto__:null,default:I},[b]);/**
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 J7=b,Z7=Symbol.for("react.element"),eW=Symbol.for("react.fragment"),tW=Object.prototype.hasOwnProperty,nW=J7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,rW={key:!0,ref:!0,__self:!0,__source:!0};function h$(e,t,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)tW.call(t,r)&&!rW.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Z7,type:e,key:a,ref:s,props:i,_owner:nW.current}}cx.Fragment=eW;cx.jsx=h$;cx.jsxs=h$;r$.exports=cx;var o=r$.exports,p$={exports:{}},Zr={},m$={exports:{}},g$={};/**
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($,O){var N=$.length;$.push(O);e:for(;0<N;){var H=N-1>>>1,V=$[H];if(0<i(V,O))$[H]=O,$[N]=V,N=H;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var O=$[0],N=$.pop();if(N!==O){$[0]=N;e:for(var H=0,V=$.length,D=V>>>1;H<D;){var K=2*(H+1)-1,ae=$[K],se=K+1,Q=$[se];if(0>i(ae,N))se<V&&0>i(Q,ae)?($[H]=Q,$[se]=N,H=se):($[H]=ae,$[K]=N,H=K);else if(se<V&&0>i(Q,N))$[H]=Q,$[se]=N,H=se;else break e}}return O}function i($,O){var N=$.sortIndex-O.sortIndex;return N!==0?N:$.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,g=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=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($){for(var O=n(u);O!==null;){if(O.callback===null)r(u);else if(O.startTime<=$)r(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(u)}}function S($){if(m=!1,w($),!g)if(n(c)!==null)g=!0,L(_);else{var O=n(u);O!==null&&R(S,O.startTime-$)}}function _($,O){g=!1,m&&(m=!1,x(C),C=-1),p=!0;var N=h;try{for(w(O),f=n(c);f!==null&&(!(f.expirationTime>O)||$&&!P());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var V=H(f.expirationTime<=O);O=e.unstable_now(),typeof V=="function"?f.callback=V:f===n(c)&&r(c),w(O)}else r(c);f=n(c)}if(f!==null)var D=!0;else{var K=n(u);K!==null&&R(S,K.startTime-O),D=!1}return D}finally{f=null,h=N,p=!1}}var j=!1,k=null,C=-1,E=5,A=-1;function P(){return!(e.unstable_now()-A<E)}function T(){if(k!==null){var $=e.unstable_now();A=$;var O=!0;try{O=k(!0,$)}finally{O?B():(j=!1,k=null)}}else j=!1}var B;if(typeof y=="function")B=function(){y(T)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,M=F.port2;F.port1.onmessage=T,B=function(){M.postMessage(null)}}else B=function(){v(T,0)};function L($){k=$,j||(j=!0,B())}function R($,O){C=v(function(){$(e.unstable_now())},O)}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($){$.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,L(_))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function($){switch(h){case 1:case 2:case 3:var O=3;break;default:O=h}var N=h;h=O;try{return $()}finally{h=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,O){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var N=h;h=$;try{return O()}finally{h=N}},e.unstable_scheduleCallback=function($,O,N){var H=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?H+N:H):N=H,$){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=N+V,$={id:d++,callback:O,priorityLevel:$,startTime:N,expirationTime:V,sortIndex:-1},N>H?($.sortIndex=N,t(u,$),n(c)===null&&$===n(u)&&(m?(x(C),C=-1):m=!0,R(S,N-H))):($.sortIndex=V,t(c,$),g||p||(g=!0,L(_))),$},e.unstable_shouldYield=P,e.unstable_wrapCallback=function($){var O=h;return function(){var N=h;h=O;try{return $.apply(this,arguments)}finally{h=N}}}})(g$);
vendor: 4,243 bytes, lines 25-33
25m$.exports=g$;var iW=m$.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 aW=b,Qr=iW;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 v$=new Set,Nh={};function ec(e,t){Tu(e,t),Tu(e+"Capture",t)}function Tu(e,t){for(Nh[e]=t,e=0;e<t.length;e++)v$.add(t[e])}var ts=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),a1=Object.prototype.hasOwnProperty,sW=/^[: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]*$/,WE={},HE={};function oW(e){return a1.call(HE,e)?!0:a1.call(WE,e)?!1:sW.test(e)?HE[e]=!0:(WE[e]=!0,!1)}function lW(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 cW(e,t,n,r){if(t===null||typeof t>"u"||lW(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 hr(e,t,n,r,i,a,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var Ln={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ln[e]=new hr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ln[t]=new hr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ln[e]=new hr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ln[e]=new hr(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){Ln[e]=new hr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ln[e]=new hr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ln[e]=new hr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ln[e]=new hr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ln[e]=new hr(e,5,!1,e.toLowerCase(),null,!1,!1)});var XS=/[\-:]([a-z])/g;function QS(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
33-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(XS,QS);Ln[t]=new hr(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(XS,QS);Ln[t]=new hr(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(XS,QS);Ln[t]=new hr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ln[e]=new hr(e,1,!1,e.toLowerCase(),null,!1,!1)});Ln.xlinkHref=new hr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ln[e]=new hr(e,1,!1,e.toLowerCase(),null,!0,!0)});function JS(e,t,n,r){var i=Ln.hasOwnProperty(t)?Ln[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(cW(t,n,i,r)&&(n=null),r||i===null?oW(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var fs=aW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Um=Symbol.for("react.element"),Fc=Symbol.for("react.portal"),Bc=Symbol.for("react.fragment"),ZS=Symbol.for("react.strict_mode"),s1=Symbol.for("react.profiler"),y$=Symbol.for("react.provider"),x$=Symbol.for("react.context"),ek=Symbol.for("react.forward_ref"),o1=Symbol.for("react.suspense"),l1=Symbol.for("react.suspense_list"),tk=Symbol.for("react.memo"),As=Symbol.for("react.lazy"),b$=Symbol.for("react.offscreen"),qE=Symbol.iterator;function sf(e){return e===null||typeof e!="object"?null:(e=qE&&e[qE]||e["@@iterator"],typeof e=="function"?e:null)}var Qt=Object.assign,p0;function Ff(e){if(p0===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);p0=t&&t[1]||""}return`
34`+p0+e}var m0=!1;function g0(e,t){if(!e||m0)return"";m0=!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()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35`),a=r.stack.split(`
36`),s=i.length-1,l=a.length-1;1<=s&&0<=l&&i[s]!==a[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==a[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==a[l]){var c=`
37`+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{m0=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ff(e):""}function uW(e){switch(e.tag){case 5:return Ff(e.type);case 16:return Ff("Lazy");case 13:return Ff("Suspense");case 19:return Ff("SuspenseList");case 0:case 2:case 15:return e=g0(e.type,!1),e;case 11:return e=g0(e.type.render,!1),e;case 1:return e=g0(e.type,!0),e;default:return""}}function c1(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 Bc:return"Fragment";case Fc:return"Portal";case s1:return"Profiler";case ZS:return"StrictMode";case o1:return"Suspense";case l1:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x$:return(e.displayName||"Context")+".Consumer";case y$:return(e._context.displayName||"Context")+".Provider";case ek:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tk:return t=e.displayName||null,t!==null?t:c1(e.type)||"Memo";case As:t=e._payload,e=e._init;try{return c1(e(t))}catch{}}return null}function dW(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 c1(t);case 8:return t===ZS?"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 w$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fW(e){var t=w$(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 i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zm(e){e._valueTracker||(e._valueTracker=fW(e))}function _$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=w$(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function uv(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 u1(e,t){var n=t.checked;return Qt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function VE(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 j$(e,t){t=t.checked,t!=null&&JS(e,"checked",t,!1)}function d1(e,t){j$(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")?f1(e,t.type,n):t.hasOwnProperty("defaultValue")&&f1(e,t.type,xo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function GE(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)}
vendor: 13,550 bytes, line 37
37function f1(e,t,n){(t!=="number"||uv(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bf=Array.isArray;function ru(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+xo(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function h1(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ue(91));return Qt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function KE(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));if(Bf(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 S$(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 YE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function k$(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 p1(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?k$(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wm,N$=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Wm=Wm||document.createElement("div"),Wm.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wm.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ch(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zf={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},hW=["Webkit","ms","Moz","O"];Object.keys(Zf).forEach(function(e){hW.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zf[t]=Zf[e]})});function C$(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zf.hasOwnProperty(e)&&Zf[e]?(""+t).trim():t+"px"}function E$(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=C$(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var pW=Qt({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 m1(e,t){if(t){if(pW[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 g1(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 v1=null;function nk(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var y1=null,iu=null,au=null;function XE(e){if(e=Qp(e)){if(typeof y1!="function")throw Error(ue(280));var t=e.stateNode;t&&(t=px(t),y1(e.stateNode,e.type,t))}}function P$(e){iu?au?au.push(e):au=[e]:iu=e}function O$(){if(iu){var e=iu,t=au;if(au=iu=null,XE(e),t)for(e=0;e<t.length;e++)XE(t[e])}}function A$(e,t){return e(t)}function T$(){}var v0=!1;function R$(e,t,n){if(v0)return e(t,n);v0=!0;try{return A$(e,t,n)}finally{v0=!1,(iu!==null||au!==null)&&(T$(),O$())}}function Eh(e,t){var n=e.stateNode;if(n===null)return null;var r=px(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 x1=!1;if(ts)try{var of={};Object.defineProperty(of,"passive",{get:function(){x1=!0}}),window.addEventListener("test",of,of),window.removeEventListener("test",of,of)}catch{x1=!1}function mW(e,t,n,r,i,a,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var eh=!1,dv=null,fv=!1,b1=null,gW={onError:function(e){eh=!0,dv=e}};function vW(e,t,n,r,i,a,s,l,c){eh=!1,dv=null,mW.apply(gW,arguments)}function yW(e,t,n,r,i,a,s,l,c){if(vW.apply(this,arguments),eh){if(eh){var u=dv;eh=!1,dv=null}else throw Error(ue(198));fv||(fv=!0,b1=u)}}function tc(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 I$(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 QE(e){if(tc(e)!==e)throw Error(ue(188))}function xW(e){var t=e.alternate;if(!t){if(t=tc(e),t===null)throw Error(ue(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return QE(i),e;if(a===r)return QE(i),t;a=a.sibling}throw Error(ue(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)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 M$(e){return e=xW(e),e!==null?$$(e):null}function $$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=$$(e);if(t!==null)return t;e=e.sibling}return null}var D$=Qr.unstable_scheduleCallback,JE=Qr.unstable_cancelCallback,bW=Qr.unstable_shouldYield,wW=Qr.unstable_requestPaint,sn=Qr.unstable_now,_W=Qr.unstable_getCurrentPriorityLevel,rk=Qr.unstable_ImmediatePriority,L$=Qr.unstable_UserBlockingPriority,hv=Qr.unstable_NormalPriority,jW=Qr.unstable_LowPriority,F$=Qr.unstable_IdlePriority,ux=null,wa=null;function SW(e){if(wa&&typeof wa.onCommitFiberRoot=="function")try{wa.onCommitFiberRoot(ux,e,void 0,(e.current.flags&128)===128)}catch{}}var Hi=Math.clz32?Math.clz32:CW,kW=Math.log,NW=Math.LN2;function CW(e){return e>>>=0,e===0?32:31-(kW(e)/NW|0)|0}var Hm=64,qm=4194304;function Uf(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 pv(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Uf(l):(a&=s,a!==0&&(r=Uf(a)))}else s=n&~i,s!==0?r=Uf(s):a!==0&&(r=Uf(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===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-Hi(t),i=1<<n,r|=e[n],t&=~i;return r}function EW(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 PW(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-Hi(a),l=1<<s,c=i[s];c===-1?(!(l&n)||l&r)&&(i[s]=EW(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function w1(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function B$(){var e=Hm;return Hm<<=1,!(Hm&4194240)&&(Hm=64),e}function y0(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yp(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Hi(t),e[t]=n}function OW(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 i=31-Hi(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function ik(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Hi(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var vt=0;function U$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var z$,ak,W$,H$,q$,_1=!1,Vm=[],no=null,ro=null,io=null,Ph=new Map,Oh=new Map,Is=[],AW="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 ZE(e,t){switch(e){case"focusin":case"focusout":no=null;break;case"dragenter":case"dragleave":ro=null;break;case"mouseover":case"mouseout":io=null;break;case"pointerover":case"pointerout":Ph.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oh.delete(t.pointerId)}}function lf(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Qp(t),t!==null&&ak(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function TW(e,t,n,r,i){switch(t){case"focusin":return no=lf(no,e,t,n,r,i),!0;case"dragenter":return ro=lf(ro,e,t,n,r,i),!0;case"mouseover":return io=lf(io,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Ph.set(a,lf(Ph.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Oh.set(a,lf(Oh.get(a)||null,e,t,n,r,i)),!0}return!1}function V$(e){var t=dl(e.target);if(t!==null){var n=tc(t);if(n!==null){if(t=n.tag,t===13){if(t=I$(n),t!==null){e.blockedOn=t,q$(e.priority,function(){W$(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 Bg(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=j1(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);v1=r,n.target.dispatchEvent(r),v1=null}else return t=Qp(n),t!==null&&ak(t),e.blockedOn=n,!1;t.shift()}return!0}function eP(e,t,n){Bg(e)&&n.delete(t)}function RW(){_1=!1,no!==null&&Bg(no)&&(no=null),ro!==null&&Bg(ro)&&(ro=null),io!==null&&Bg(io)&&(io=null),Ph.forEach(eP),Oh.forEach(eP)}function cf(e,t){e.blockedOn===t&&(e.blockedOn=null,_1||(_1=!0,Qr.unstable_scheduleCallback(Qr.unstable_NormalPriority,RW)))}function Ah(e){function t(i){return cf(i,e)}if(0<Vm.length){cf(Vm[0],e);for(var n=1;n<Vm.length;n++){var r=Vm[n];r.blockedOn===e&&(r.blockedOn=null)}}for(no!==null&&cf(no,e),ro!==null&&cf(ro,e),io!==null&&cf(io,e),Ph.forEach(t),Oh.forEach(t),n=0;n<Is.length;n++)r=Is[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Is.length&&(n=Is[0],n.blockedOn===null);)V$(n),n.blockedOn===null&&Is.shift()}var su=fs.ReactCurrentBatchConfig,mv=!0;function IW(e,t,n,r){var i=vt,a=su.transition;su.transition=null;try{vt=1,sk(e,t,n,r)}finally{vt=i,su.transition=a}}function MW(e,t,n,r){var i=vt,a=su.transition;su.transition=null;try{vt=4,sk(e,t,n,r)}finally{vt=i,su.transition=a}}function sk(e,t,n,r){if(mv){var i=j1(e,t,n,r);if(i===null)E0(e,t,r,gv,n),ZE(e,r);else if(TW(i,e,t,n,r))r.stopPropagation();else if(ZE(e,r),t&4&&-1<AW.indexOf(e)){for(;i!==null;){var a=Qp(i);if(a!==null&&z$(a),a=j1(e,t,n,r),a===null&&E0(e,t,r,gv,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else E0(e,t,r,null,n)}}var gv=null;function j1(e,t,n,r){if(gv=null,e=nk(r),e=dl(e),e!==null)if(t=tc(e),t===null)e=null;else if(n=t.tag,n===13){if(e=I$(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 gv=e,null}
vendor: 10,401 bytes, line 37
37function G$(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(_W()){case rk:return 1;case L$:return 4;case hv:case jW:return 16;case F$:return 536870912;default:return 16}default:return 16}}var Xs=null,ok=null,Ug=null;function K$(){if(Ug)return Ug;var e,t=ok,n=t.length,r,i="value"in Xs?Xs.value:Xs.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[a-r];r++);return Ug=i.slice(e,1<r?1-r:void 0)}function zg(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 Gm(){return!0}function tP(){return!1}function ei(e){function t(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,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)?Gm:tP,this.isPropagationStopped=tP,this}return Qt(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=Gm)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Gm)},persist:function(){},isPersistent:Gm}),t}var Nd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lk=ei(Nd),Xp=Qt({},Nd,{view:0,detail:0}),$W=ei(Xp),x0,b0,uf,dx=Qt({},Xp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ck,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!==uf&&(uf&&e.type==="mousemove"?(x0=e.screenX-uf.screenX,b0=e.screenY-uf.screenY):b0=x0=0,uf=e),x0)},movementY:function(e){return"movementY"in e?e.movementY:b0}}),nP=ei(dx),DW=Qt({},dx,{dataTransfer:0}),LW=ei(DW),FW=Qt({},Xp,{relatedTarget:0}),w0=ei(FW),BW=Qt({},Nd,{animationName:0,elapsedTime:0,pseudoElement:0}),UW=ei(BW),zW=Qt({},Nd,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),WW=ei(zW),HW=Qt({},Nd,{data:0}),rP=ei(HW),qW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VW={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"},GW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KW(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=GW[e])?!!t[e]:!1}function ck(){return KW}var YW=Qt({},Xp,{key:function(e){if(e.key){var t=qW[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=zg(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?VW[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ck,charCode:function(e){return e.type==="keypress"?zg(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?zg(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),XW=ei(YW),QW=Qt({},dx,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iP=ei(QW),JW=Qt({},Xp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ck}),ZW=ei(JW),eH=Qt({},Nd,{propertyName:0,elapsedTime:0,pseudoElement:0}),tH=ei(eH),nH=Qt({},dx,{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}),rH=ei(nH),iH=[9,13,27,32],uk=ts&&"CompositionEvent"in window,th=null;ts&&"documentMode"in document&&(th=document.documentMode);var aH=ts&&"TextEvent"in window&&!th,Y$=ts&&(!uk||th&&8<th&&11>=th),aP=" ",sP=!1;function X$(e,t){switch(e){case"keyup":return iH.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Q$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Uc=!1;function sH(e,t){switch(e){case"compositionend":return Q$(t);case"keypress":return t.which!==32?null:(sP=!0,aP);case"textInput":return e=t.data,e===aP&&sP?null:e;default:return null}}function oH(e,t){if(Uc)return e==="compositionend"||!uk&&X$(e,t)?(e=K$(),Ug=ok=Xs=null,Uc=!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 Y$&&t.locale!=="ko"?null:t.data;default:return null}}var lH={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 oP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lH[e.type]:t==="textarea"}function J$(e,t,n,r){P$(r),t=vv(t,"onChange"),0<t.length&&(n=new lk("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var nh=null,Th=null;function cH(e){cD(e,0)}function fx(e){var t=Hc(e);if(_$(t))return e}function uH(e,t){if(e==="change")return t}var Z$=!1;if(ts){var _0;if(ts){var j0="oninput"in document;if(!j0){var lP=document.createElement("div");lP.setAttribute("oninput","return;"),j0=typeof lP.oninput=="function"}_0=j0}else _0=!1;Z$=_0&&(!document.documentMode||9<document.documentMode)}function cP(){nh&&(nh.detachEvent("onpropertychange",eD),Th=nh=null)}function eD(e){if(e.propertyName==="value"&&fx(Th)){var t=[];J$(t,Th,e,nk(e)),R$(cH,t)}}function dH(e,t,n){e==="focusin"?(cP(),nh=t,Th=n,nh.attachEvent("onpropertychange",eD)):e==="focusout"&&cP()}function fH(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fx(Th)}function hH(e,t){if(e==="click")return fx(t)}function pH(e,t){if(e==="input"||e==="change")return fx(t)}function mH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ki=typeof Object.is=="function"?Object.is:mH;function Rh(e,t){if(Ki(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 i=n[r];if(!a1.call(t,i)||!Ki(e[i],t[i]))return!1}return!0}function uP(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function dP(e,t){var n=uP(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=uP(n)}}function tD(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tD(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nD(){for(var e=window,t=uv();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=uv(e.document)}return t}function dk(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 gH(e){var t=nD(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&tD(n.ownerDocument.documentElement,n)){if(r!==null&&dk(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 i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=dP(n,a);var s=dP(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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 vH=ts&&"documentMode"in document&&11>=document.documentMode,zc=null,S1=null,rh=null,k1=!1;function fP(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;k1||zc==null||zc!==uv(r)||(r=zc,"selectionStart"in r&&dk(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,501 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),rh&&Rh(rh,r)||(rh=r,r=vv(S1,"onSelect"),0<r.length&&(t=new lk("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=zc)))}function Km(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Wc={animationend:Km("Animation","AnimationEnd"),animationiteration:Km("Animation","AnimationIteration"),animationstart:Km("Animation","AnimationStart"),transitionend:Km("Transition","TransitionEnd")},S0={},rD={};ts&&(rD=document.createElement("div").style,"AnimationEvent"in window||(delete Wc.animationend.animation,delete Wc.animationiteration.animation,delete Wc.animationstart.animation),"TransitionEvent"in window||delete Wc.transitionend.transition);function hx(e){if(S0[e])return S0[e];if(!Wc[e])return e;var t=Wc[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in rD)return S0[e]=t[n];return e}var iD=hx("animationend"),aD=hx("animationiteration"),sD=hx("animationstart"),oD=hx("transitionend"),lD=new Map,hP="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 Co(e,t){lD.set(e,t),ec(t,[e])}for(var k0=0;k0<hP.length;k0++){var N0=hP[k0],yH=N0.toLowerCase(),xH=N0[0].toUpperCase()+N0.slice(1);Co(yH,"on"+xH)}Co(iD,"onAnimationEnd");Co(aD,"onAnimationIteration");Co(sD,"onAnimationStart");Co("dblclick","onDoubleClick");Co("focusin","onFocus");Co("focusout","onBlur");Co(oD,"onTransitionEnd");Tu("onMouseEnter",["mouseout","mouseover"]);Tu("onMouseLeave",["mouseout","mouseover"]);Tu("onPointerEnter",["pointerout","pointerover"]);Tu("onPointerLeave",["pointerout","pointerover"]);ec("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ec("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ec("onBeforeInput",["compositionend","keypress","textInput","paste"]);ec("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ec("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ec("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zf="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(" "),bH=new Set("cancel close invalid load scroll toggle".split(" ").concat(zf));function pP(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,yW(r,t,void 0,e),e.currentTarget=null}function cD(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;pP(i,l,u),a=c}else for(s=0;s<r.length;s++){if(l=r[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;pP(i,l,u),a=c}}}if(fv)throw e=b1,fv=!1,b1=null,e}function Lt(e,t){var n=t[O1];n===void 0&&(n=t[O1]=new Set);var r=e+"__bubble";n.has(r)||(uD(t,e,2,!1),n.add(r))}function C0(e,t,n){var r=0;t&&(r|=4),uD(n,e,r,t)}var Ym="_reactListening"+Math.random().toString(36).slice(2);function Ih(e){if(!e[Ym]){e[Ym]=!0,v$.forEach(function(n){n!=="selectionchange"&&(bH.has(n)||C0(n,!1,e),C0(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ym]||(t[Ym]=!0,C0("selectionchange",!1,t))}}function uD(e,t,n,r){switch(G$(t)){case 1:var i=IW;break;case 4:i=MW;break;default:i=sk}n=i.bind(null,t,n,e),i=void 0,!x1||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function E0(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;
vendor: 35,764 bytes, lines 37-40
37if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;l!==null;){if(s=dl(l),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}l=l.parentNode}}r=r.return}R$(function(){var u=a,d=nk(n),f=[];e:{var h=lD.get(e);if(h!==void 0){var p=lk,g=e;switch(e){case"keypress":if(zg(n)===0)break e;case"keydown":case"keyup":p=XW;break;case"focusin":g="focus",p=w0;break;case"focusout":g="blur",p=w0;break;case"beforeblur":case"afterblur":p=w0;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":p=nP;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=LW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=ZW;break;case iD:case aD:case sD:p=UW;break;case oD:p=tH;break;case"scroll":p=$W;break;case"wheel":p=rH;break;case"copy":case"cut":case"paste":p=WW;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=iP}var m=(t&4)!==0,v=!m&&e==="scroll",x=m?h!==null?h+"Capture":null:h;m=[];for(var y=u,w;y!==null;){w=y;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,x!==null&&(S=Eh(y,x),S!=null&&m.push(Mh(y,S,w)))),v)break;y=y.return}0<m.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==v1&&(g=n.relatedTarget||n.fromElement)&&(dl(g)||g[ns]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?dl(g):null,g!==null&&(v=tc(g),g!==v||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(m=nP,S="onMouseLeave",x="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=iP,S="onPointerLeave",x="onPointerEnter",y="pointer"),v=p==null?h:Hc(p),w=g==null?h:Hc(g),h=new m(S,y+"leave",p,n,d),h.target=v,h.relatedTarget=w,S=null,dl(d)===u&&(m=new m(x,y+"enter",g,n,d),m.target=w,m.relatedTarget=v,S=m),v=S,p&&g)t:{for(m=p,x=g,y=0,w=m;w;w=gc(w))y++;for(w=0,S=x;S;S=gc(S))w++;for(;0<y-w;)m=gc(m),y--;for(;0<w-y;)x=gc(x),w--;for(;y--;){if(m===x||x!==null&&m===x.alternate)break t;m=gc(m),x=gc(x)}m=null}else m=null;p!==null&&mP(f,h,p,m,!1),g!==null&&v!==null&&mP(f,v,g,m,!0)}}e:{if(h=u?Hc(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var _=uH;else if(oP(h))if(Z$)_=pH;else{_=fH;var j=dH}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(_=hH);if(_&&(_=_(e,u))){J$(f,_,n,d);break e}j&&j(e,h,u),e==="focusout"&&(j=h._wrapperState)&&j.controlled&&h.type==="number"&&f1(h,"number",h.value)}switch(j=u?Hc(u):window,e){case"focusin":(oP(j)||j.contentEditable==="true")&&(zc=j,S1=u,rh=null);break;case"focusout":rh=S1=zc=null;break;case"mousedown":k1=!0;break;case"contextmenu":case"mouseup":case"dragend":k1=!1,fP(f,n,d);break;case"selectionchange":if(vH)break;case"keydown":case"keyup":fP(f,n,d)}var k;if(uk)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Uc?X$(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Y$&&n.locale!=="ko"&&(Uc||C!=="onCompositionStart"?C==="onCompositionEnd"&&Uc&&(k=K$()):(Xs=d,ok="value"in Xs?Xs.value:Xs.textContent,Uc=!0)),j=vv(u,C),0<j.length&&(C=new rP(C,e,null,n,d),f.push({event:C,listeners:j}),k?C.data=k:(k=Q$(n),k!==null&&(C.data=k)))),(k=aH?sH(e,n):oH(e,n))&&(u=vv(u,"onBeforeInput"),0<u.length&&(d=new rP("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=k))}cD(f,t)})}function Mh(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vv(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Eh(e,n),a!=null&&r.unshift(Mh(e,a,i)),a=Eh(e,t),a!=null&&r.push(Mh(e,a,i))),e=e.return}return r}function gc(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function mP(e,t,n,r,i){for(var a=t._reactName,s=[];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,i?(c=Eh(n,a),c!=null&&s.unshift(Mh(n,c,l))):i||(c=Eh(n,a),c!=null&&s.push(Mh(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var wH=/\r\n?/g,_H=/\u0000|\uFFFD/g;function gP(e){return(typeof e=="string"?e:""+e).replace(wH,`
38`).replace(_H,"")}function Xm(e,t,n){if(t=gP(t),gP(e)!==t&&n)throw Error(ue(425))}function yv(){}var N1=null,C1=null;function E1(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 P1=typeof setTimeout=="function"?setTimeout:void 0,jH=typeof clearTimeout=="function"?clearTimeout:void 0,vP=typeof Promise=="function"?Promise:void 0,SH=typeof queueMicrotask=="function"?queueMicrotask:typeof vP<"u"?function(e){return vP.resolve(null).then(e).catch(kH)}:P1;function kH(e){setTimeout(function(){throw e})}function P0(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Ah(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ah(t)}function ao(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 yP(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 Cd=Math.random().toString(36).slice(2),ha="__reactFiber$"+Cd,$h="__reactProps$"+Cd,ns="__reactContainer$"+Cd,O1="__reactEvents$"+Cd,NH="__reactListeners$"+Cd,CH="__reactHandles$"+Cd;function dl(e){var t=e[ha];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ns]||n[ha]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yP(e);e!==null;){if(n=e[ha])return n;e=yP(e)}return t}e=n,n=e.parentNode}return null}function Qp(e){return e=e[ha]||e[ns],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Hc(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ue(33))}function px(e){return e[$h]||null}var A1=[],qc=-1;function Eo(e){return{current:e}}function zt(e){0>qc||(e.current=A1[qc],A1[qc]=null,qc--)}function Tt(e,t){qc++,A1[qc]=e.current,e.current=t}var bo={},Xn=Eo(bo),Nr=Eo(!1),$l=bo;function Ru(e,t){var n=e.type.contextTypes;if(!n)return bo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Cr(e){return e=e.childContextTypes,e!=null}function xv(){zt(Nr),zt(Xn)}function xP(e,t,n){if(Xn.current!==bo)throw Error(ue(168));Tt(Xn,t),Tt(Nr,n)}function dD(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ue(108,dW(e)||"Unknown",i));return Qt({},n,r)}function bv(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bo,$l=Xn.current,Tt(Xn,e),Tt(Nr,Nr.current),!0}function bP(e,t,n){var r=e.stateNode;if(!r)throw Error(ue(169));n?(e=dD(e,t,$l),r.__reactInternalMemoizedMergedChildContext=e,zt(Nr),zt(Xn),Tt(Xn,e)):zt(Nr),Tt(Nr,n)}var za=null,mx=!1,O0=!1;function fD(e){za===null?za=[e]:za.push(e)}function EH(e){mx=!0,fD(e)}function Po(){if(!O0&&za!==null){O0=!0;var e=0,t=vt;try{var n=za;for(vt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}za=null,mx=!1}catch(i){throw za!==null&&(za=za.slice(e+1)),D$(rk,Po),i}finally{vt=t,O0=!1}}return null}var Vc=[],Gc=0,wv=null,_v=0,oi=[],li=0,Dl=null,qa=1,Va="";function tl(e,t){Vc[Gc++]=_v,Vc[Gc++]=wv,wv=e,_v=t}function hD(e,t,n){oi[li++]=qa,oi[li++]=Va,oi[li++]=Dl,Dl=e;var r=qa;e=Va;var i=32-Hi(r)-1;r&=~(1<<i),n+=1;var a=32-Hi(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,qa=1<<32-Hi(t)+i|n<<i|r,Va=a+e}else qa=1<<a|n<<i|r,Va=e}function fk(e){e.return!==null&&(tl(e,1),hD(e,1,0))}function hk(e){for(;e===wv;)wv=Vc[--Gc],Vc[Gc]=null,_v=Vc[--Gc],Vc[Gc]=null;for(;e===Dl;)Dl=oi[--li],oi[li]=null,Va=oi[--li],oi[li]=null,qa=oi[--li],oi[li]=null}var Kr=null,Vr=null,qt=!1,Ui=null;function pD(e,t){var n=di(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 wP(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Kr=e,Vr=ao(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Kr=e,Vr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Dl!==null?{id:qa,overflow:Va}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=di(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Kr=e,Vr=null,!0):!1;default:return!1}}function T1(e){return(e.mode&1)!==0&&(e.flags&128)===0}function R1(e){if(qt){var t=Vr;if(t){var n=t;if(!wP(e,t)){if(T1(e))throw Error(ue(418));t=ao(n.nextSibling);var r=Kr;t&&wP(e,t)?pD(r,n):(e.flags=e.flags&-4097|2,qt=!1,Kr=e)}}else{if(T1(e))throw Error(ue(418));e.flags=e.flags&-4097|2,qt=!1,Kr=e}}}function _P(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Kr=e}function Qm(e){if(e!==Kr)return!1;if(!qt)return _P(e),qt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!E1(e.type,e.memoizedProps)),t&&(t=Vr)){if(T1(e))throw mD(),Error(ue(418));for(;t;)pD(e,t),t=ao(t.nextSibling)}if(_P(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=ao(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Vr=null}}else Vr=Kr?ao(e.stateNode.nextSibling):null;return!0}function mD(){for(var e=Vr;e;)e=ao(e.nextSibling)}function Iu(){Vr=Kr=null,qt=!1}function pk(e){Ui===null?Ui=[e]:Ui.push(e)}var PH=fs.ReactCurrentBatchConfig;function df(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 i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(s){var l=i.refs;s===null?delete l[a]:l[a]=s},t._stringRef=a,t)}if(typeof e!="string")throw Error(ue(284));if(!n._owner)throw Error(ue(290,e))}return e}function Jm(e,t){throw e=Object.prototype.toString.call(t),Error(ue(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function jP(e){var t=e._init;return t(e._payload)}function gD(e){function t(x,y){if(e){var w=x.deletions;w===null?(x.deletions=[y],x.flags|=16):w.push(y)}}function n(x,y){if(!e)return null;for(;y!==null;)t(x,y),y=y.sibling;return null}function r(x,y){for(x=new Map;y!==null;)y.key!==null?x.set(y.key,y):x.set(y.index,y),y=y.sibling;return x}function i(x,y){return x=co(x,y),x.index=0,x.sibling=null,x}function a(x,y,w){return x.index=w,e?(w=x.alternate,w!==null?(w=w.index,w<y?(x.flags|=2,y):w):(x.flags|=2,y)):(x.flags|=1048576,y)}function s(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,y,w,S){return y===null||y.tag!==6?(y=D0(w,x.mode,S),y.return=x,y):(y=i(y,w),y.return=x,y)}function c(x,y,w,S){var _=w.type;return _===Bc?d(x,y,w.props.children,S,w.key):y!==null&&(y.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===As&&jP(_)===y.type)?(S=i(y,w.props),S.ref=df(x,y,w),S.return=x,S):(S=Yg(w.type,w.key,w.props,null,x.mode,S),S.ref=df(x,y,w),S.return=x,S)}function u(x,y,w,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==w.containerInfo||y.stateNode.implementation!==w.implementation?(y=L0(w,x.mode,S),y.return=x,y):(y=i(y,w.children||[]),y.return=x,y)}function d(x,y,w,S,_){return y===null||y.tag!==7?(y=Ol(w,x.mode,S,_),y.return=x,y):(y=i(y,w),y.return=x,y)}function f(x,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return y=D0(""+y,x.mode,w),y.return=x,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Um:return w=Yg(y.type,y.key,y.props,null,x.mode,w),w.ref=df(x,null,y),w.return=x,w;case Fc:return y=L0(y,x.mode,w),y.return=x,y;case As:var S=y._init;return f(x,S(y._payload),w)}if(Bf(y)||sf(y))return y=Ol(y,x.mode,w,null),y.return=x,y;Jm(x,y)}return null}function h(x,y,w,S){var _=y!==null?y.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return _!==null?null:l(x,y,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Um:return w.key===_?c(x,y,w,S):null;case Fc:return w.key===_?u(x,y,w,S):null;case As:return _=w._init,h(x,y,_(w._payload),S)}if(Bf(w)||sf(w))return _!==null?null:d(x,y,w,S,null);Jm(x,w)}return null}function p(x,y,w,S,_){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(w)||null,l(y,x,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Um:return x=x.get(S.key===null?w:S.key)||null,c(y,x,S,_);case Fc:return x=x.get(S.key===null?w:S.key)||null,u(y,x,S,_);case As:var j=S._init;return p(x,y,w,j(S._payload),_)}if(Bf(S)||sf(S))return x=x.get(w)||null,d(y,x,S,_,null);Jm(y,S)}return null}function g(x,y,w,S){for(var _=null,j=null,k=y,C=y=0,E=null;k!==null&&C<w.length;C++){k.index>C?(E=k,k=null):E=k.sibling;var A=h(x,k,w[C],S);if(A===null){k===null&&(k=E);break}e&&k&&A.alternate===null&&t(x,k),y=a(A,y,C),j===null?_=A:j.sibling=A,j=A,k=E}if(C===w.length)return n(x,k),qt&&tl(x,C),_;if(k===null){for(;C<w.length;C++)k=f(x,w[C],S),k!==null&&(y=a(k,y,C),j===null?_=k:j.sibling=k,j=k);return qt&&tl(x,C),_}for(k=r(x,k);C<w.length;C++)E=p(k,x,C,w[C],S),E!==null&&(e&&E.alternate!==null&&k.delete(E.key===null?C:E.key),y=a(E,y,C),j===null?_=E:j.sibling=E,j=E);return e&&k.forEach(function(P){return t(x,P)}),qt&&tl(x,C),_}function m(x,y,w,S){var _=sf(w);if(typeof _!="function")throw Error(ue(150));if(w=_.call(w),w==null)throw Error(ue(151));for(var j=_=null,k=y,C=y=0,E=null,A=w.next();k!==null&&!A.done;C++,A=w.next()){k.index>C?(E=k,k=null):E=k.sibling;var P=h(x,k,A.value,S);if(P===null){k===null&&(k=E);break}e&&k&&P.alternate===null&&t(x,k),y=a(P,y,C),j===null?_=P:j.sibling=P,j=P,k=E}if(A.done)return n(x,k),qt&&tl(x,C),_;if(k===null){for(;!A.done;C++,A=w.next())A=f(x,A.value,S),A!==null&&(y=a(A,y,C),j===null?_=A:j.sibling=A,j=A);return qt&&tl(x,C),_}for(k=r(x,k);!A.done;C++,A=w.next())A=p(k,x,C,A.value,S),A!==null&&(e&&A.alternate!==null&&k.delete(A.key===null?C:A.key),y=a(A,y,C),j===null?_=A:j.sibling=A,j=A);return e&&k.forEach(function(T){return t(x,T)}),qt&&tl(x,C),_}function v(x,y,w,S){if(typeof w=="object"&&w!==null&&w.type===Bc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Um:e:{for(var _=w.key,j=y;j!==null;){if(j.key===_){if(_=w.type,_===Bc){if(j.tag===7){n(x,j.sibling),y=i(j,w.props.children),y.return=x,x=y;break e}}else if(j.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===As&&jP(_)===j.type){n(x,j.sibling),y=i(j,w.props),y.ref=df(x,j,w),y.return=x,x=y;break e}n(x,j);break}else t(x,j);j=j.sibling}w.type===Bc?(y=Ol(w.props.children,x.mode,S,w.key),y.return=x,x=y):(S=Yg(w.type,w.key,w.props,null,x.mode,S),S.ref=df(x,y,w),S.return=x,x=S)}return s(x);case Fc:e:{for(j=w.key;y!==null;){if(y.key===j)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){n(x,y.sibling),y=i(y,w.children||[]),y.return=x,x=y;break e}else{n(x,y);break}else t(x,y);y=y.sibling}y=L0(w,x.mode,S),y.return=x,x=y}return s(x);case As:return j=w._init,v(x,y,j(w._payload),S)}if(Bf(w))return g(x,y,w,S);if(sf(w))return m(x,y,w,S);Jm(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(n(x,y.sibling),y=i(y,w),y.return=x,x=y):(n(x,y),y=D0(w,x.mode,S),y.return=x,x=y),s(x)):n(x,y)}return v}var Mu=gD(!0),vD=gD(!1),jv=Eo(null),Sv=null,Kc=null,mk=null;function gk(){mk=Kc=Sv=null}function vk(e){var t=jv.current;zt(jv),e._currentValue=t}function I1(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 ou(e,t){Sv=e,mk=Kc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_r=!0),e.firstContext=null)}function vi(e){var t=e._currentValue;if(mk!==e)if(e={context:e,memoizedValue:t,next:null},Kc===null){if(Sv===null)throw Error(ue(308));Kc=e,Sv.dependencies={lanes:0,firstContext:e}}else Kc=Kc.next=e;return t}var fl=null;function yk(e){fl===null?fl=[e]:fl.push(e)}function yD(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,yk(t)):(n.next=i.next,i.next=n),t.interleaved=n,rs(e,r)}function rs(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 Ts=!1;function xk(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xD(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 Qa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function so(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,st&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,rs(e,n)}return i=r.interleaved,i===null?(t.next=t,yk(r)):(t.next=i.next,i.next=t),r.interleaved=t,rs(e,n)}function Wg(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,ik(e,n)}}function SP(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,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 kv(e,t,n,r){var i=e.updateQueue;Ts=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?a=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=i.baseState;s=0,d=u=c=null,l=a;do{var h=l.lane,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,m=l;switch(h=t,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=Qt({},f,h);break e;case 2:Ts=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,s|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Fl|=s,e.lanes=s,e.memoizedState=f}}function kP(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ue(191,i));i.call(r)}}}var Jp={},_a=Eo(Jp),Dh=Eo(Jp),Lh=Eo(Jp);function hl(e){if(e===Jp)throw Error(ue(174));return e}function bk(e,t){switch(Tt(Lh,t),Tt(Dh,e),Tt(_a,Jp),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:p1(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=p1(t,e)}zt(_a),Tt(_a,t)}function $u(){zt(_a),zt(Dh),zt(Lh)}function bD(e){hl(Lh.current);var t=hl(_a.current),n=p1(t,e.type);t!==n&&(Tt(Dh,e),Tt(_a,n))}function wk(e){Dh.current===e&&(zt(_a),zt(Dh))}var Kt=Eo(0);function Nv(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 A0=[];function _k(){for(var e=0;e<A0.length;e++)A0[e]._workInProgressVersionPrimary=null;A0.length=0}var Hg=fs.ReactCurrentDispatcher,T0=fs.ReactCurrentBatchConfig,Ll=0,Xt=null,yn=null,Nn=null,Cv=!1,ih=!1,Fh=0,OH=0;function zn(){throw Error(ue(321))}function jk(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ki(e[n],t[n]))return!1;return!0}function Sk(e,t,n,r,i,a){if(Ll=a,Xt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Hg.current=e===null||e.memoizedState===null?IH:MH,e=n(r,i),ih){a=0;do{if(ih=!1,Fh=0,25<=a)throw Error(ue(301));a+=1,Nn=yn=null,t.updateQueue=null,Hg.current=$H,e=n(r,i)}while(ih)}if(Hg.current=Ev,t=yn!==null&&yn.next!==null,Ll=0,Nn=yn=Xt=null,Cv=!1,t)throw Error(ue(300));return e}function kk(){var e=Fh!==0;return Fh=0,e}function aa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nn===null?Xt.memoizedState=Nn=e:Nn=Nn.next=e,Nn}function yi(){if(yn===null){var e=Xt.alternate;e=e!==null?e.memoizedState:null}else e=yn.next;var t=Nn===null?Xt.memoizedState:Nn.next;if(t!==null)Nn=t,yn=e;else{if(e===null)throw Error(ue(310));yn=e,e={memoizedState:yn.memoizedState,baseState:yn.baseState,baseQueue:yn.baseQueue,queue:yn.queue,next:null},Nn===null?Xt.memoizedState=Nn=e:Nn=Nn.next=e}return Nn}function Bh(e,t){return typeof t=="function"?t(e):t}function R0(e){var t=yi(),n=t.queue;if(n===null)throw Error(ue(311));n.lastRenderedReducer=e;var r=yn,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var l=s=null,c=null,u=a;do{var d=u.lane;if((Ll&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 f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,s=r):c=c.next=f,Xt.lanes|=d,Fl|=d}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=l,Ki(r,t.memoizedState)||(_r=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Xt.lanes|=a,Fl|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function I0(e){var t=yi(),n=t.queue;if(n===null)throw Error(ue(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Ki(a,t.memoizedState)||(_r=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function wD(){}function _D(e,t){var n=Xt,r=yi(),i=t(),a=!Ki(r.memoizedState,i);if(a&&(r.memoizedState=i,_r=!0),r=r.queue,Nk(kD.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Nn!==null&&Nn.memoizedState.tag&1){if(n.flags|=2048,Uh(9,SD.bind(null,n,r,i,t),void 0,null),En===null)throw Error(ue(349));Ll&30||jD(n,t,i)}return i}function jD(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Xt.updateQueue,t===null?(t={lastEffect:null,stores:null},Xt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function SD(e,t,n,r){t.value=n,t.getSnapshot=r,ND(t)&&CD(e)}function kD(e,t,n){return n(function(){ND(t)&&CD(e)})}function ND(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ki(e,n)}catch{return!0}}function CD(e){var t=rs(e,1);t!==null&&qi(t,e,1,-1)}function NP(e){var t=aa();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bh,lastRenderedState:e},t.queue=e,e=e.dispatch=RH.bind(null,Xt,e),[t.memoizedState,e]}function Uh(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Xt.updateQueue,t===null?(t={lastEffect:null,stores:null},Xt.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 ED(){return yi().memoizedState}function qg(e,t,n,r){var i=aa();Xt.flags|=e,i.memoizedState=Uh(1|t,n,void 0,r===void 0?null:r)}function gx(e,t,n,r){var i=yi();r=r===void 0?null:r;var a=void 0;if(yn!==null){var s=yn.memoizedState;if(a=s.destroy,r!==null&&jk(r,s.deps)){i.memoizedState=Uh(t,n,a,r);return}}Xt.flags|=e,i.memoizedState=Uh(1|t,n,a,r)}function CP(e,t){return qg(8390656,8,e,t)}function Nk(e,t){return gx(2048,8,e,t)}function PD(e,t){return gx(4,2,e,t)}function OD(e,t){return gx(4,4,e,t)}function AD(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 TD(e,t,n){return n=n!=null?n.concat([e]):null,gx(4,4,AD.bind(null,t,e),n)}function Ck(){}function RD(e,t){var n=yi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jk(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ID(e,t){var n=yi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jk(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function MD(e,t,n){return Ll&21?(Ki(n,t)||(n=B$(),Xt.lanes|=n,Fl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_r=!0),e.memoizedState=n)}function AH(e,t){var n=vt;vt=n!==0&&4>n?n:4,e(!0);var r=T0.transition;T0.transition={};try{e(!1),t()}finally{vt=n,T0.transition=r}}function $D(){return yi().memoizedState}function TH(e,t,n){var r=lo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},DD(e))LD(t,n);else if(n=yD(e,t,n,r),n!==null){var i=ur();qi(n,e,r,i),FD(n,t,r)}}function RH(e,t,n){var r=lo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(DD(e))LD(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,l=a(s,n);if(i.hasEagerState=!0,i.eagerState=l,Ki(l,s)){var c=t.interleaved;c===null?(i.next=i,yk(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=yD(e,t,i,r),n!==null&&(i=ur(),qi(n,e,r,i),FD(n,t,r))}}function DD(e){var t=e.alternate;return e===Xt||t!==null&&t===Xt}function LD(e,t){ih=Cv=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function FD(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ik(e,n)}}var Ev={readContext:vi,useCallback:zn,useContext:zn,useEffect:zn,useImperativeHandle:zn,useInsertionEffect:zn,useLayoutEffect:zn,useMemo:zn,useReducer:zn,useRef:zn,useState:zn,useDebugValue:zn,useDeferredValue:zn,useTransition:zn,useMutableSource:zn,useSyncExternalStore:zn,useId:zn,unstable_isNewReconciler:!1},IH={readContext:vi,useCallback:function(e,t){return aa().memoizedState=[e,t===void 0?null:t],e},useContext:vi,useEffect:CP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,qg(4194308,4,AD.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qg(4194308,4,e,t)},useInsertionEffect:function(e,t){return qg(4,2,e,t)},useMemo:function(e,t){var n=aa();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=aa();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=TH.bind(null,Xt,e),[r.memoizedState,e]},useRef:function(e){var t=aa();return e={current:e},t.memoizedState=e},useState:NP,useDebugValue:Ck,useDeferredValue:function(e){return aa().memoizedState=e},useTransition:function(){var e=NP(!1),t=e[0];return e=AH.bind(null,e[1]),aa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Xt,i=aa();if(qt){if(n===void 0)throw Error(ue(407));n=n()}else{if(n=t(),En===null)throw Error(ue(349));Ll&30||jD(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,CP(kD.bind(null,r,a,e),[e]),r.flags|=2048,Uh(9,SD.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=aa(),t=En.identifierPrefix;if(qt){var n=Va,r=qa;n=(r&~(1<<32-Hi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Fh++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=OH++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},MH={readContext:vi,useCallback:RD,useContext:vi,useEffect:Nk,useImperativeHandle:TD,useInsertionEffect:PD,useLayoutEffect:OD,useMemo:ID,useReducer:R0,useRef:ED,useState:function(){return R0(Bh)},useDebugValue:Ck,useDeferredValue:function(e){var t=yi();return MD(t,yn.memoizedState,e)},useTransition:function(){var e=R0(Bh)[0],t=yi().memoizedState;return[e,t]},useMutableSource:wD,useSyncExternalStore:_D,useId:$D,unstable_isNewReconciler:!1},$H={readContext:vi,useCallback:RD,useContext:vi,useEffect:Nk,useImperativeHandle:TD,useInsertionEffect:PD,useLayoutEffect:OD,useMemo:ID,useReducer:I0,useRef:ED,useState:function(){return I0(Bh)},useDebugValue:Ck,useDeferredValue:function(e){var t=yi();return yn===null?t.memoizedState=e:MD(t,yn.memoizedState,e)},useTransition:function(){var e=I0(Bh)[0],t=yi().memoizedState;return[e,t]},useMutableSource:wD,useSyncExternalStore:_D,useId:$D,unstable_isNewReconciler:!1};function Ri(e,t){if(e&&e.defaultProps){t=Qt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function M1(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vx={isMounted:function(e){return(e=e._reactInternals)?tc(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ur(),i=lo(e),a=Qa(r,i);a.payload=t,n!=null&&(a.callback=n),t=so(e,a,i),t!==null&&(qi(t,e,i,r),Wg(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ur(),i=lo(e),a=Qa(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=so(e,a,i),t!==null&&(qi(t,e,i,r),Wg(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ur(),r=lo(e),i=Qa(n,r);i.tag=2,t!=null&&(i.callback=t),t=so(e,i,r),t!==null&&(qi(t,e,r,n),Wg(t,e,r))}};function EP(e,t,n,r,i,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,s):t.prototype&&t.prototype.isPureReactComponent?!Rh(n,r)||!Rh(i,a):!0}function BD(e,t,n){var r=!1,i=bo,a=t.contextType;return typeof a=="object"&&a!==null?a=vi(a):(i=Cr(t)?$l:Xn.current,r=t.contextTypes,a=(r=r!=null)?Ru(e,i):bo),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=vx,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function PP(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&&vx.enqueueReplaceState(t,t.state,null)}function $1(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},xk(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=vi(a):(a=Cr(t)?$l:Xn.current,i.context=Ru(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(M1(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&vx.enqueueReplaceState(i,i.state,null),kv(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Du(e,t){try{var n="",r=t;do n+=uW(r),r=r.return;while(r);var i=n}catch(a){i=`
39Error generating stack: `+a.message+`
40`+a.stack}return{value:e,source:t,stack:i,digest:null}}function M0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function D1(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var DH=typeof WeakMap=="function"?WeakMap:Map;function UD(e,t,n){n=Qa(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ov||(Ov=!0,G1=r),D1(e,t)},n}function zD(e,t,n){n=Qa(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){D1(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){D1(e,t),typeof r!="function"&&(oo===null?oo=new Set([this]):oo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function OP(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new DH;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=QH.bind(null,e,t,n),t.then(e,e))}function AP(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 TP(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=Qa(-1,1),t.tag=2,so(n,t,1))),n.lanes|=1),e)}var LH=fs.ReactCurrentOwner,_r=!1;function tr(e,t,n,r){t.child=e===null?vD(t,null,n,r):Mu(t,e.child,n,r)}function RP(e,t,n,r,i){n=n.render;var a=t.ref;return ou(t,i),r=Sk(e,t,n,r,a,i),n=kk(),e!==null&&!_r?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,is(e,t,i)):(qt&&n&&fk(t),t.flags|=1,tr(e,t,r,i),t.child)}function IP(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!Mk(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,WD(e,t,a,r,i)):(e=Yg(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:Rh,n(s,r)&&e.ref===t.ref)return is(e,t,i)}return t.flags|=1,e=co(a,r),e.ref=t.ref,e.return=t,t.child=e}function WD(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rh(a,r)&&e.ref===t.ref)if(_r=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(_r=!0);else return t.lanes=e.lanes,is(e,t,i)}return L1(e,t,n,r,i)}function HD(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(Xc,Ur),Ur|=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,Tt(Xc,Ur),Ur|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Tt(Xc,Ur),Ur|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Tt(Xc,Ur),Ur|=r;return tr(e,t,i,n),t.child}function qD(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 9,036 bytes, line 40
40function L1(e,t,n,r,i){var a=Cr(n)?$l:Xn.current;return a=Ru(t,a),ou(t,i),n=Sk(e,t,n,r,a,i),r=kk(),e!==null&&!_r?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,is(e,t,i)):(qt&&r&&fk(t),t.flags|=1,tr(e,t,n,i),t.child)}function MP(e,t,n,r,i){if(Cr(n)){var a=!0;bv(t)}else a=!1;if(ou(t,i),t.stateNode===null)Vg(e,t),BD(t,n,r),$1(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=vi(u):(u=Cr(n)?$l:Xn.current,u=Ru(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||c!==u)&&PP(t,s,r,u),Ts=!1;var h=t.memoizedState;s.state=h,kv(t,r,s,i),c=t.memoizedState,l!==r||h!==c||Nr.current||Ts?(typeof d=="function"&&(M1(t,n,d,r),c=t.memoizedState),(l=Ts||EP(t,n,l,r,h,c,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,xD(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Ri(t.type,l),s.props=u,f=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=vi(c):(c=Cr(n)?$l:Xn.current,c=Ru(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||h!==c)&&PP(t,s,r,c),Ts=!1,h=t.memoizedState,s.state=h,kv(t,r,s,i);var g=t.memoizedState;l!==f||h!==g||Nr.current||Ts?(typeof p=="function"&&(M1(t,n,p,r),g=t.memoizedState),(u=Ts||EP(t,n,u,r,h,g,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return F1(e,t,n,r,a,i)}function F1(e,t,n,r,i,a){qD(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&bP(t,n,!1),is(e,t,a);r=t.stateNode,LH.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Mu(t,e.child,null,a),t.child=Mu(t,null,l,a)):tr(e,t,l,a),t.memoizedState=r.state,i&&bP(t,n,!0),t.child}function VD(e){var t=e.stateNode;t.pendingContext?xP(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xP(e,t.context,!1),bk(e,t.containerInfo)}function $P(e,t,n,r,i){return Iu(),pk(i),t.flags|=256,tr(e,t,n,r),t.child}var B1={dehydrated:null,treeContext:null,retryLane:0};function U1(e){return{baseLanes:e,cachePool:null,transitions:null}}function GD(e,t,n){var r=t.pendingProps,i=Kt.current,a=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Tt(Kt,i&1),e===null)return R1(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):(s=r.children,e=r.fallback,a?(r=t.mode,a=t.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=bx(s,r,0,null),e=Ol(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=U1(n),t.memoizedState=B1,e):Ek(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return FH(e,t,s,r,l,i,n);if(a){a=r.fallback,s=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=co(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=co(l,a):(a=Ol(a,s,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,s=e.child.memoizedState,s=s===null?U1(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=B1,r}return a=e.child,e=a.sibling,r=co(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 Ek(e,t){return t=bx({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Zm(e,t,n,r){return r!==null&&pk(r),Mu(t,e.child,null,n),e=Ek(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function FH(e,t,n,r,i,a,s){if(n)return t.flags&256?(t.flags&=-257,r=M0(Error(ue(422))),Zm(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=bx({mode:"visible",children:r.children},i,0,null),a=Ol(a,i,s,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Mu(t,e.child,null,s),t.child.memoizedState=U1(s),t.memoizedState=B1,a);if(!(t.mode&1))return Zm(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(ue(419)),r=M0(a,r,void 0),Zm(e,t,s,r)}if(l=(s&e.childLanes)!==0,_r||l){if(r=En,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,rs(e,i),qi(r,e,i,-1))}return Ik(),r=M0(Error(ue(421))),Zm(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=JH.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Vr=ao(i.nextSibling),Kr=t,qt=!0,Ui=null,e!==null&&(oi[li++]=qa,oi[li++]=Va,oi[li++]=Dl,qa=e.id,Va=e.overflow,Dl=t),t=Ek(t,r.children),t.flags|=4096,t)}function DP(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),I1(e.return,t,n)}function $0(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function KD(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(tr(e,t,r.children,n),r=Kt.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&&DP(e,n,t);else if(e.tag===19)DP(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(Tt(Kt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Nv(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$0(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Nv(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$0(t,!0,n,null,a);break;case"together":$0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vg(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function is(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Fl|=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=co(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=co(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function BH(e,t,n){switch(t.tag){case 3:VD(t),Iu();break;case 5:bD(t);break;case 1:Cr(t.type)&&bv(t);break;case 4:bk(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Tt(jv,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Tt(Kt,Kt.current&1),t.flags|=128,null):n&t.child.childLanes?GD(e,t,n):(Tt(Kt,Kt.current&1),e=is(e,t,n),e!==null?e.sibling:null);Tt(Kt,Kt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return KD(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Tt(Kt,Kt.current),r)break;return null;
vendor: 4,598 bytes, line 40
40case 22:case 23:return t.lanes=0,HD(e,t,n)}return is(e,t,n)}var YD,z1,XD,QD;YD=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}};z1=function(){};XD=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,hl(_a.current);var a=null;switch(n){case"input":i=u1(e,i),r=u1(e,r),a=[];break;case"select":i=Qt({},i,{value:void 0}),r=Qt({},r,{value:void 0}),a=[];break;case"textarea":i=h1(e,i),r=h1(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=yv)}m1(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Nh.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(n||(n={}),n[s]=c[s])}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"&&(Nh.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Lt("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)}};QD=function(e,t,n,r){n!==r&&(t.flags|=4)};function ff(e,t){if(!qt)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 i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function UH(e,t,n){var r=t.pendingProps;switch(hk(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 Cr(t.type)&&xv(),Wn(t),null;case 3:return r=t.stateNode,$u(),zt(Nr),zt(Xn),_k(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qm(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui!==null&&(X1(Ui),Ui=null))),z1(e,t),Wn(t),null;case 5:wk(t);var i=hl(Lh.current);if(n=t.type,e!==null&&t.stateNode!=null)XD(e,t,n,r,i),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=hl(_a.current),Qm(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[ha]=t,r[$h]=a,e=(t.mode&1)!==0,n){case"dialog":Lt("cancel",r),Lt("close",r);break;case"iframe":case"object":case"embed":Lt("load",r);break;case"video":case"audio":for(i=0;i<zf.length;i++)Lt(zf[i],r);break;case"source":Lt("error",r);break;case"img":case"image":case"link":Lt("error",r),Lt("load",r);break;case"details":Lt("toggle",r);break;case"input":VE(r,a),Lt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Lt("invalid",r);break;case"textarea":KE(r,a),Lt("invalid",r)}m1(n,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="children"?typeof l=="string"?r.textContent!==l&&(a.suppressHydrationWarning!==!0&&Xm(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Xm(r.textContent,l,e),i=["children",""+l]):Nh.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&Lt("scroll",r)}switch(n){case"input":zm(r),GE(r,a,!0);break;case"textarea":zm(r),YE(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=yv)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=k$(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[ha]=t,e[$h]=r,YD(e,t,!1,!1),t.stateNode=e;e:{switch(s=g1(n,r),n){case"dialog":Lt("cancel",e),Lt("close",e),i=r;break;case"iframe":case"object":case"embed":Lt("load",e),i=r;break;case"video":case"audio":for(i=0;i<zf.length;i++)Lt(zf[i],e);i=r;break;case"source":Lt("error",e),i=r;break;case"img":case"image":case"link":Lt("error",e),Lt("load",e),i=r;break;case"details":Lt("toggle",e),i=r;break;case"input":VE(e,r),i=u1(e,r),Lt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Qt({},r,{value:void 0}),Lt("invalid",e);break;case"textarea":KE(e,r),i=h1(e,r),Lt("invalid",e);break;default:i=r}m1(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?E$(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&N$(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ch(e,c):typeof c=="number"&&Ch(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Nh.hasOwnProperty(a)?c!=null&&a==="onScroll"&&Lt("scroll",e):c!=null&&JS(e,a,c,s))}switch(n){case"input":zm(e),GE(e,r,!1);break;case"textarea":zm(e),YE(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?ru(e,!!r.multiple,a,!1):r.defaultValue!=null&&ru(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=yv)}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)QD(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ue(166));if(n=hl(Lh.current),hl(_a.current),Qm(t)){if(r=t.stateNode,n=t.memoizedProps,r[ha]=t,(a=r.nodeValue!==n)&&(e=Kr,e!==null))switch(e.tag){case 3:Xm(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Xm(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ha]=t,t.stateNode=r}return Wn(t),null;case 13:if(zt(Kt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qt&&Vr!==null&&t.mode&1&&!(t.flags&128))mD(),Iu(),t.flags|=98560,a=!1;else if(a=Qm(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[ha]=t}else Iu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wn(t),a=!1}else Ui!==null&&(X1(Ui),Ui=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||Kt.current&1?wn===0&&(wn=3):Ik())),t.updateQueue!==null&&(t.flags|=4),Wn(t),null);case 4:return $u(),z1(e,t),e===null&&Ih(t.stateNode.containerInfo),Wn(t),null;case 10:return vk(t.type._context),Wn(t),null;case 17:return Cr(t.type)&&xv(),Wn(t),null;case 19:if(zt(Kt),a=t.memoizedState,a===null)return Wn(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)ff(a,!1);else{if(wn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Nv(e),s!==null){for(t.flags|=128,ff(a,!1),r=s.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,s=a.alternate,s===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=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Tt(Kt,Kt.current&1|2),t.child}e=e.sibling}a.tail!==null&&sn()>Lu&&(t.flags|=128,r=!0,ff(a,!1),t.lanes=4194304)}else{if(!r)if(e=Nv(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ff(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!qt)return Wn(t),null}else 2*sn()-a.renderingStartTime>Lu&&n!==1073741824&&(t.flags|=128,r=!0,ff(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(n=a.last,n!==null?n.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=sn(),t.sibling=null,n=Kt.current,Tt(Kt,r?n&1|2:n&1),t):(Wn(t),null);case 22:case 23:return Rk(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ur&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 zH(e,t){switch(hk(t),t.tag){case 1:return Cr(t.type)&&xv(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 25,438 bytes, line 40
40case 3:return $u(),zt(Nr),zt(Xn),_k(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wk(t),null;case 13:if(zt(Kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ue(340));Iu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zt(Kt),null;case 4:return $u(),null;case 10:return vk(t.type._context),null;case 22:case 23:return Rk(),null;case 24:return null;default:return null}}var eg=!1,Vn=!1,WH=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Yc(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){en(e,t,r)}else n.current=null}function W1(e,t,n){try{n()}catch(r){en(e,t,r)}}var LP=!1;function HH(e,t){if(N1=mv,e=nD(),dk(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 i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(l=s+i),f!==a||r!==0&&f.nodeType!==3||(c=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===i&&(l=s),h===a&&++d===r&&(c=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(C1={focusedElem:e,selectionRange:n},mv=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;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 m=g.memoizedProps,v=g.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ri(t.type,m),v);x.__reactInternalSnapshotBeforeUpdate=y}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(S){en(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return g=LP,LP=!1,g}function ah(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&W1(t,n,a)}i=i.next}while(i!==r)}}function yx(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 H1(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 JD(e){var t=e.alternate;t!==null&&(e.alternate=null,JD(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ha],delete t[$h],delete t[O1],delete t[NH],delete t[CH])),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 ZD(e){return e.tag===5||e.tag===3||e.tag===4}function FP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ZD(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 q1(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=yv));else if(r!==4&&(e=e.child,e!==null))for(q1(e,t,n),e=e.sibling;e!==null;)q1(e,t,n),e=e.sibling}function V1(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(V1(e,t,n),e=e.sibling;e!==null;)V1(e,t,n),e=e.sibling}var Mn=null,Di=!1;function js(e,t,n){for(n=n.child;n!==null;)e3(e,t,n),n=n.sibling}function e3(e,t,n){if(wa&&typeof wa.onCommitFiberUnmount=="function")try{wa.onCommitFiberUnmount(ux,n)}catch{}switch(n.tag){case 5:Vn||Yc(n,t);case 6:var r=Mn,i=Di;Mn=null,js(e,t,n),Mn=r,Di=i,Mn!==null&&(Di?(e=Mn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Mn.removeChild(n.stateNode));break;case 18:Mn!==null&&(Di?(e=Mn,n=n.stateNode,e.nodeType===8?P0(e.parentNode,n):e.nodeType===1&&P0(e,n),Ah(e)):P0(Mn,n.stateNode));break;case 4:r=Mn,i=Di,Mn=n.stateNode.containerInfo,Di=!0,js(e,t,n),Mn=r,Di=i;break;case 0:case 11:case 14:case 15:if(!Vn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&W1(n,t,s),i=i.next}while(i!==r)}js(e,t,n);break;case 1:if(!Vn&&(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){en(n,t,l)}js(e,t,n);break;case 21:js(e,t,n);break;case 22:n.mode&1?(Vn=(r=Vn)||n.memoizedState!==null,js(e,t,n),Vn=r):js(e,t,n);break;default:js(e,t,n)}}function BP(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new WH),t.forEach(function(r){var i=ZH.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ei(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Mn=l.stateNode,Di=!1;break e;case 3:Mn=l.stateNode.containerInfo,Di=!0;break e;case 4:Mn=l.stateNode.containerInfo,Di=!0;break e}l=l.return}if(Mn===null)throw Error(ue(160));e3(a,s,i),Mn=null,Di=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){en(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)t3(t,e),t=t.sibling}function t3(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ei(t,e),ra(e),r&4){try{ah(3,e,e.return),yx(3,e)}catch(m){en(e,e.return,m)}try{ah(5,e,e.return)}catch(m){en(e,e.return,m)}}break;case 1:Ei(t,e),ra(e),r&512&&n!==null&&Yc(n,n.return);break;case 5:if(Ei(t,e),ra(e),r&512&&n!==null&&Yc(n,n.return),e.flags&32){var i=e.stateNode;try{Ch(i,"")}catch(m){en(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,s=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&&j$(i,a),g1(l,s);var u=g1(l,a);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?E$(i,f):d==="dangerouslySetInnerHTML"?N$(i,f):d==="children"?Ch(i,f):JS(i,d,f,u)}switch(l){case"input":d1(i,a);break;case"textarea":S$(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?ru(i,!!a.multiple,p,!1):h!==!!a.multiple&&(a.defaultValue!=null?ru(i,!!a.multiple,a.defaultValue,!0):ru(i,!!a.multiple,a.multiple?[]:"",!1))}i[$h]=a}catch(m){en(e,e.return,m)}}break;case 6:if(Ei(t,e),ra(e),r&4){if(e.stateNode===null)throw Error(ue(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(m){en(e,e.return,m)}}break;case 3:if(Ei(t,e),ra(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ah(t.containerInfo)}catch(m){en(e,e.return,m)}break;case 4:Ei(t,e),ra(e);break;case 13:Ei(t,e),ra(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Ak=sn())),r&4&&BP(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Vn=(u=Vn)||d,Ei(t,e),Vn=u):Ei(t,e),ra(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(xe=e,d=e.child;d!==null;){for(f=xe=d;xe!==null;){switch(h=xe,p=h.child,h.tag){case 0:case 11:case 14:case 15:ah(4,h,h.return);break;case 1:Yc(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(m){en(r,n,m)}}break;case 5:Yc(h,h.return);break;case 22:if(h.memoizedState!==null){zP(f);continue}}p!==null?(p.return=h,xe=p):zP(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=f.stateNode,c=f.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=C$("display",s))}catch(m){en(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){en(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ei(t,e),ra(e),r&4&&BP(e);break;case 21:break;default:Ei(t,e),ra(e)}}function ra(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ZD(n)){var r=n;break e}n=n.return}throw Error(ue(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ch(i,""),r.flags&=-33);var a=FP(e);V1(e,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=FP(e);q1(e,l,s);break;default:throw Error(ue(161))}}catch(c){en(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qH(e,t,n){xe=e,n3(e)}function n3(e,t,n){for(var r=(e.mode&1)!==0;xe!==null;){var i=xe,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||eg;if(!s){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Vn;l=eg;var u=Vn;if(eg=s,(Vn=c)&&!u)for(xe=i;xe!==null;)s=xe,c=s.child,s.tag===22&&s.memoizedState!==null?WP(i):c!==null?(c.return=s,xe=c):WP(i);for(;a!==null;)xe=a,n3(a),a=a.sibling;xe=i,eg=l,Vn=u}UP(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,xe=a):UP(e)}}function UP(e){for(;xe!==null;){var t=xe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Vn||yx(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Vn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ri(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&kP(t,a,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}kP(t,s,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 f=d.dehydrated;f!==null&&Ah(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ue(163))}Vn||t.flags&512&&H1(t)}catch(h){en(t,t.return,h)}}if(t===e){xe=null;break}if(n=t.sibling,n!==null){n.return=t.return,xe=n;break}xe=t.return}}function zP(e){for(;xe!==null;){var t=xe;if(t===e){xe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,xe=n;break}xe=t.return}}function WP(e){for(;xe!==null;){var t=xe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{yx(4,t)}catch(c){en(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){en(t,i,c)}}var a=t.return;try{H1(t)}catch(c){en(t,a,c)}break;case 5:var s=t.return;try{H1(t)}catch(c){en(t,s,c)}}}catch(c){en(t,t.return,c)}if(t===e){xe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,xe=l;break}xe=t.return}}var VH=Math.ceil,Pv=fs.ReactCurrentDispatcher,Pk=fs.ReactCurrentOwner,hi=fs.ReactCurrentBatchConfig,st=0,En=null,hn=null,Dn=0,Ur=0,Xc=Eo(0),wn=0,zh=null,Fl=0,xx=0,Ok=0,sh=null,wr=null,Ak=0,Lu=1/0,La=null,Ov=!1,G1=null,oo=null,tg=!1,Qs=null,Av=0,oh=0,K1=null,Gg=-1,Kg=0;function ur(){return st&6?sn():Gg!==-1?Gg:Gg=sn()}function lo(e){return e.mode&1?st&2&&Dn!==0?Dn&-Dn:PH.transition!==null?(Kg===0&&(Kg=B$()),Kg):(e=vt,e!==0||(e=window.event,e=e===void 0?16:G$(e.type)),e):1}function qi(e,t,n,r){if(50<oh)throw oh=0,K1=null,Error(ue(185));Yp(e,n,r),(!(st&2)||e!==En)&&(e===En&&(!(st&2)&&(xx|=n),wn===4&&Ms(e,Dn)),Er(e,r),n===1&&st===0&&!(t.mode&1)&&(Lu=sn()+500,mx&&Po()))}function Er(e,t){var n=e.callbackNode;PW(e,t);var r=pv(e,e===En?Dn:0);if(r===0)n!==null&&JE(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&JE(n),t===1)e.tag===0?EH(HP.bind(null,e)):fD(HP.bind(null,e)),SH(function(){!(st&6)&&Po()}),n=null;else{switch(U$(r)){case 1:n=rk;break;case 4:n=L$;break;case 16:n=hv;break;case 536870912:n=F$;break;default:n=hv}n=u3(n,r3.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function r3(e,t){if(Gg=-1,Kg=0,st&6)throw Error(ue(327));var n=e.callbackNode;if(lu()&&e.callbackNode!==n)return null;var r=pv(e,e===En?Dn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Tv(e,r);else{t=r;var i=st;st|=2;var a=a3();(En!==e||Dn!==t)&&(La=null,Lu=sn()+500,Pl(e,t));do try{YH();break}catch(l){i3(e,l)}while(!0);gk(),Pv.current=a,st=i,hn!==null?t=0:(En=null,Dn=0,t=wn)}if(t!==0){if(t===2&&(i=w1(e),i!==0&&(r=i,t=Y1(e,i))),t===1)throw n=zh,Pl(e,0),Ms(e,r),Er(e,sn()),n;if(t===6)Ms(e,r);else{if(i=e.current.alternate,!(r&30)&&!GH(i)&&(t=Tv(e,r),t===2&&(a=w1(e),a!==0&&(r=a,t=Y1(e,a))),t===1))throw n=zh,Pl(e,0),Ms(e,r),Er(e,sn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ue(345));case 2:nl(e,wr,La);break;case 3:if(Ms(e,r),(r&130023424)===r&&(t=Ak+500-sn(),10<t)){if(pv(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){ur(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=P1(nl.bind(null,e,wr,La),t);break}nl(e,wr,La);break;case 4:if(Ms(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-Hi(r);a=1<<s,s=t[s],s>i&&(i=s),r&=~a}if(r=i,r=sn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*VH(r/1960))-r,10<r){e.timeoutHandle=P1(nl.bind(null,e,wr,La),r);break}nl(e,wr,La);break;case 5:nl(e,wr,La);break;default:throw Error(ue(329))}}}return Er(e,sn()),e.callbackNode===n?r3.bind(null,e):null}function Y1(e,t){var n=sh;return e.current.memoizedState.isDehydrated&&(Pl(e,t).flags|=256),e=Tv(e,t),e!==2&&(t=wr,wr=n,t!==null&&X1(t)),e}function X1(e){wr===null?wr=e:wr.push.apply(wr,e)}function GH(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 i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ki(a(),i))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 Ms(e,t){for(t&=~Ok,t&=~xx,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Hi(t),r=1<<n;e[n]=-1,t&=~r}}function HP(e){if(st&6)throw Error(ue(327));lu();var t=pv(e,0);if(!(t&1))return Er(e,sn()),null;var n=Tv(e,t);if(e.tag!==0&&n===2){var r=w1(e);r!==0&&(t=r,n=Y1(e,r))}if(n===1)throw n=zh,Pl(e,0),Ms(e,t),Er(e,sn()),n;if(n===6)throw Error(ue(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,nl(e,wr,La),Er(e,sn()),null}function Tk(e,t){var n=st;st|=1;try{return e(t)}finally{st=n,st===0&&(Lu=sn()+500,mx&&Po())}}function Bl(e){Qs!==null&&Qs.tag===0&&!(st&6)&&lu();var t=st;st|=1;var n=hi.transition,r=vt;try{if(hi.transition=null,vt=1,e)return e()}finally{vt=r,hi.transition=n,st=t,!(st&6)&&Po()}}function Rk(){Ur=Xc.current,zt(Xc)}function Pl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jH(n)),hn!==null)for(n=hn.return;n!==null;){var r=n;switch(hk(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&xv();break;case 3:$u(),zt(Nr),zt(Xn),_k();break;case 5:wk(r);break;case 4:$u();break;case 13:zt(Kt);break;case 19:zt(Kt);break;case 10:vk(r.type._context);break;case 22:case 23:Rk()}n=n.return}if(En=e,hn=e=co(e.current,null),Dn=Ur=t,wn=0,zh=null,Ok=xx=Fl=0,wr=sh=null,fl!==null){for(t=0;t<fl.length;t++)if(n=fl[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var s=a.next;a.next=i,r.next=s}n.pending=r}fl=null}return e}function i3(e,t){do{var n=hn;try{if(gk(),Hg.current=Ev,Cv){for(var r=Xt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Cv=!1}if(Ll=0,Nn=yn=Xt=null,ih=!1,Fh=0,Pk.current=null,n===null||n.return===null){wn=1,zh=t,hn=null;break}e:{var a=e,s=n.return,l=n,c=t;if(t=Dn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=AP(s);if(p!==null){p.flags&=-257,TP(p,s,l,a,t),p.mode&1&&OP(a,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var m=new Set;m.add(c),t.updateQueue=m}else g.add(c);break e}else{if(!(t&1)){OP(a,u,t),Ik();break e}c=Error(ue(426))}}else if(qt&&l.mode&1){var v=AP(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),TP(v,s,l,a,t),pk(Du(c,l));break e}}a=c=Du(c,l),wn!==4&&(wn=2),sh===null?sh=[a]:sh.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var x=UD(a,c,t);SP(a,x);break e;case 1:l=c;var y=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(oo===null||!oo.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var S=zD(a,l,t);SP(a,S);break e}}a=a.return}while(a!==null)}o3(n)}catch(_){t=_,hn===n&&n!==null&&(hn=n=n.return);continue}break}while(!0)}function a3(){var e=Pv.current;return Pv.current=Ev,e===null?Ev:e}function Ik(){(wn===0||wn===3||wn===2)&&(wn=4),En===null||!(Fl&268435455)&&!(xx&268435455)||Ms(En,Dn)}function Tv(e,t){var n=st;st|=2;var r=a3();(En!==e||Dn!==t)&&(La=null,Pl(e,t));do try{KH();break}catch(i){i3(e,i)}while(!0);if(gk(),st=n,Pv.current=r,hn!==null)throw Error(ue(261));return En=null,Dn=0,wn}function KH(){for(;hn!==null;)s3(hn)}function YH(){for(;hn!==null&&!bW();)s3(hn)}function s3(e){var t=c3(e.alternate,e,Ur);e.memoizedProps=e.pendingProps,t===null?o3(e):hn=t,Pk.current=null}function o3(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=zH(n,t),n!==null){n.flags&=32767,hn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{wn=6,hn=null;return}}else if(n=UH(n,t,Ur),n!==null){hn=n;return}if(t=t.sibling,t!==null){hn=t;return}hn=t=e}while(t!==null);wn===0&&(wn=5)}function nl(e,t,n){var r=vt,i=hi.transition;try{hi.transition=null,vt=1,XH(e,t,n,r)}finally{hi.transition=i,vt=r}return null}function XH(e,t,n,r){do lu();while(Qs!==null);if(st&6)throw Error(ue(327));n=e.finishedWork;var i=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(OW(e,a),e===En&&(hn=En=null,Dn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||tg||(tg=!0,u3(hv,function(){return lu(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=hi.transition,hi.transition=null;var s=vt;vt=1;var l=st;st|=4,Pk.current=null,HH(e,n),t3(n,e),gH(C1),mv=!!N1,C1=N1=null,e.current=n,qH(n),wW(),st=l,vt=s,hi.transition=a}else e.current=n;if(tg&&(tg=!1,Qs=e,Av=i),a=e.pendingLanes,a===0&&(oo=null),SW(n.stateNode),Er(e,sn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ov)throw Ov=!1,e=G1,G1=null,e;return Av&1&&e.tag!==0&&lu(),a=e.pendingLanes,a&1?e===K1?oh++:(oh=0,K1=e):oh=0,Po(),null}function lu(){if(Qs!==null){var e=U$(Av),t=hi.transition,n=vt;try{if(hi.transition=null,vt=16>e?16:e,Qs===null)var r=!1;else{if(e=Qs,Qs=null,Av=0,st&6)throw Error(ue(331));var i=st;for(st|=4,xe=e.current;xe!==null;){var a=xe,s=a.child;if(xe.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(xe=u;xe!==null;){var d=xe;switch(d.tag){case 0:case 11:case 15:ah(8,d,a)}var f=d.child;if(f!==null)f.return=d,xe=f;else for(;xe!==null;){d=xe;var h=d.sibling,p=d.return;if(JD(d),d===u){xe=null;break}if(h!==null){h.return=p,xe=h;break}xe=p}}}var g=a.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(m!==null)}}xe=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,xe=s;else e:for(;xe!==null;){if(a=xe,a.flags&2048)switch(a.tag){case 0:case 11:case 15:ah(9,a,a.return)}var x=a.sibling;if(x!==null){x.return=a.return,xe=x;break e}xe=a.return}}var y=e.current;for(xe=y;xe!==null;){s=xe;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,xe=w;else e:for(s=y;xe!==null;){if(l=xe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:yx(9,l)}}catch(_){en(l,l.return,_)}if(l===s){xe=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,xe=S;break e}xe=l.return}}if(st=i,Po(),wa&&typeof wa.onPostCommitFiberRoot=="function")try{wa.onPostCommitFiberRoot(ux,e)}catch{}r=!0}return r}finally{vt=n,hi.transition=t}}return!1}function qP(e,t,n){t=Du(n,t),t=UD(e,t,1),e=so(e,t,1),t=ur(),e!==null&&(Yp(e,1,t),Er(e,t))}function en(e,t,n){if(e.tag===3)qP(e,e,n);else for(;t!==null;){if(t.tag===3){qP(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(oo===null||!oo.has(r))){e=Du(n,e),e=zD(t,e,1),t=so(t,e,1),e=ur(),t!==null&&(Yp(t,1,e),Er(t,e));break}}t=t.return}}function QH(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ur(),e.pingedLanes|=e.suspendedLanes&n,En===e&&(Dn&n)===n&&(wn===4||wn===3&&(Dn&130023424)===Dn&&500>sn()-Ak?Pl(e,0):Ok|=n),Er(e,t)}function l3(e,t){t===0&&(e.mode&1?(t=qm,qm<<=1,!(qm&130023424)&&(qm=4194304)):t=1);var n=ur();e=rs(e,t),e!==null&&(Yp(e,t,n),Er(e,n))}function JH(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),l3(e,n)}function ZH(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ue(314))}r!==null&&r.delete(t),l3(e,n)}var c3;c3=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nr.current)_r=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _r=!1,BH(e,t,n);_r=!!(e.flags&131072)}else _r=!1,qt&&t.flags&1048576&&hD(t,_v,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vg(e,t),e=t.pendingProps;var i=Ru(t,Xn.current);ou(t,n),i=Sk(null,t,r,e,i,n);var a=kk();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Cr(r)?(a=!0,bv(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xk(t),i.updater=vx,t.stateNode=i,i._reactInternals=t,$1(t,r,e,n),t=F1(null,t,r,!0,a,n)):(t.tag=0,qt&&a&&fk(t),tr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vg(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=tq(r),e=Ri(r,e),i){case 0:t=L1(null,t,r,e,n);break e;case 1:t=MP(null,t,r,e,n);break e;case 11:t=RP(null,t,r,e,n);break e;case 14:t=IP(null,t,r,Ri(r.type,e),n);break e}throw Error(ue(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ri(r,i),L1(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ri(r,i),MP(e,t,r,i,n);case 3:e:{if(VD(t),e===null)throw Error(ue(387));r=t.pendingProps,a=t.memoizedState,i=a.element,xD(e,t),kv(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Du(Error(ue(423)),t),t=$P(e,t,r,n,i);break e}else if(r!==i){i=Du(Error(ue(424)),t),t=$P(e,t,r,n,i);break e}else for(Vr=ao(t.stateNode.containerInfo.firstChild),Kr=t,qt=!0,Ui=null,n=vD(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Iu(),r===i){t=is(e,t,n);break e}tr(e,t,r,n)}t=t.child}return t;case 5:return bD(t),e===null&&R1(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,E1(r,i)?s=null:a!==null&&E1(r,a)&&(t.flags|=32),qD(e,t),tr(e,t,s,n),t.child;case 6:return e===null&&R1(t),null;case 13:return GD(e,t,n);case 4:return bk(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mu(t,null,r,n):tr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ri(r,i),RP(e,t,r,i,n);case 7:return tr(e,t,t.pendingProps,n),t.child;case 8:return tr(e,t,t.pendingProps.children,n),t.child;case 12:return tr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Tt(jv,r._currentValue),r._currentValue=s,a!==null)if(Ki(a.value,s)){if(a.children===i.children&&!Nr.current){t=is(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=Qa(-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),I1(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)s=a.type===t.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(ue(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),I1(s,n,t),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}tr(e,t,i.children,n),t=t.child}return t;
vendor: 11,706 bytes, line 40
40case 9:return i=t.type,r=t.pendingProps.children,ou(t,n),i=vi(i),r=r(i),t.flags|=1,tr(e,t,r,n),t.child;case 14:return r=t.type,i=Ri(r,t.pendingProps),i=Ri(r.type,i),IP(e,t,r,i,n);case 15:return WD(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ri(r,i),Vg(e,t),t.tag=1,Cr(r)?(e=!0,bv(t)):e=!1,ou(t,n),BD(t,r,i),$1(t,r,i,n),F1(null,t,r,!0,e,n);case 19:return KD(e,t,n);case 22:return HD(e,t,n)}throw Error(ue(156,t.tag))};function u3(e,t){return D$(e,t)}function eq(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 di(e,t,n,r){return new eq(e,t,n,r)}function Mk(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tq(e){if(typeof e=="function")return Mk(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ek)return 11;if(e===tk)return 14}return 2}function co(e,t){var n=e.alternate;return n===null?(n=di(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 Yg(e,t,n,r,i,a){var s=2;if(r=e,typeof e=="function")Mk(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Bc:return Ol(n.children,i,a,t);case ZS:s=8,i|=8;break;case s1:return e=di(12,n,t,i|2),e.elementType=s1,e.lanes=a,e;case o1:return e=di(13,n,t,i),e.elementType=o1,e.lanes=a,e;case l1:return e=di(19,n,t,i),e.elementType=l1,e.lanes=a,e;case b$:return bx(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y$:s=10;break e;case x$:s=9;break e;case ek:s=11;break e;case tk:s=14;break e;case As:s=16,r=null;break e}throw Error(ue(130,e==null?e:typeof e,""))}return t=di(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ol(e,t,n,r){return e=di(7,e,r,t),e.lanes=n,e}function bx(e,t,n,r){return e=di(22,e,r,t),e.elementType=b$,e.lanes=n,e.stateNode={isHidden:!1},e}function D0(e,t,n){return e=di(6,e,null,t),e.lanes=n,e}function L0(e,t,n){return t=di(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nq(e,t,n,r,i){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=y0(0),this.expirationTimes=y0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=y0(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $k(e,t,n,r,i,a,s,l,c){return e=new nq(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=di(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xk(a),e}function rq(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fc,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function d3(e){if(!e)return bo;e=e._reactInternals;e:{if(tc(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(Cr(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(Cr(n))return dD(e,n,t)}return t}function f3(e,t,n,r,i,a,s,l,c){return e=$k(n,r,!0,e,i,a,s,l,c),e.context=d3(null),n=e.current,r=ur(),i=lo(n),a=Qa(r,i),a.callback=t??null,so(n,a,i),e.current.lanes=i,Yp(e,i,r),Er(e,r),e}function wx(e,t,n,r){var i=t.current,a=ur(),s=lo(i);return n=d3(n),t.context===null?t.context=n:t.pendingContext=n,t=Qa(a,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=so(i,t,s),e!==null&&(qi(e,i,s,a),Wg(e,i,s)),s}function Rv(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 VP(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Dk(e,t){VP(e,t),(e=e.alternate)&&VP(e,t)}function iq(){return null}var h3=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lk(e){this._internalRoot=e}_x.prototype.render=Lk.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ue(409));wx(e,t,null,null)};_x.prototype.unmount=Lk.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bl(function(){wx(null,e,null,null)}),t[ns]=null}};function _x(e){this._internalRoot=e}_x.prototype.unstable_scheduleHydration=function(e){if(e){var t=H$();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Is.length&&t!==0&&t<Is[n].priority;n++);Is.splice(n,0,e),n===0&&V$(e)}};function Fk(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function jx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function GP(){}function aq(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=Rv(s);a.call(u)}}var s=f3(t,r,e,0,null,!1,!1,"",GP);return e._reactRootContainer=s,e[ns]=s.current,Ih(e.nodeType===8?e.parentNode:e),Bl(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=Rv(c);l.call(u)}}var c=$k(e,0,!1,null,null,!1,!1,"",GP);return e._reactRootContainer=c,e[ns]=c.current,Ih(e.nodeType===8?e.parentNode:e),Bl(function(){wx(t,c,n,r)}),c}function Sx(e,t,n,r,i){var a=n._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var l=i;i=function(){var c=Rv(s);l.call(c)}}wx(t,s,e,i)}else s=aq(n,t,e,i,r);return Rv(s)}z$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Uf(t.pendingLanes);n!==0&&(ik(t,n|1),Er(t,sn()),!(st&6)&&(Lu=sn()+500,Po()))}break;case 13:Bl(function(){var r=rs(e,1);if(r!==null){var i=ur();qi(r,e,1,i)}}),Dk(e,1)}};ak=function(e){if(e.tag===13){var t=rs(e,134217728);if(t!==null){var n=ur();qi(t,e,134217728,n)}Dk(e,134217728)}};W$=function(e){if(e.tag===13){var t=lo(e),n=rs(e,t);if(n!==null){var r=ur();qi(n,e,t,r)}Dk(e,t)}};H$=function(){return vt};q$=function(e,t){var n=vt;try{return vt=e,t()}finally{vt=n}};y1=function(e,t,n){switch(t){case"input":if(d1(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 i=px(r);if(!i)throw Error(ue(90));_$(r),d1(r,i)}}}break;case"textarea":S$(e,n);break;case"select":t=n.value,t!=null&&ru(e,!!n.multiple,t,!1)}};A$=Tk;T$=Bl;var sq={usingClientEntryPoint:!1,Events:[Qp,Hc,px,P$,O$,Tk]},hf={findFiberByHostInstance:dl,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},oq={bundleType:hf.bundleType,version:hf.version,rendererPackageName:hf.rendererPackageName,rendererConfig:hf.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fs.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=M$(e),e===null?null:e.stateNode},findFiberByHostInstance:hf.findFiberByHostInstance||iq,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ng=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ng.isDisabled&&ng.supportsFiber)try{ux=ng.inject(oq),wa=ng}catch{}}Zr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sq;Zr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Fk(t))throw Error(ue(200));return rq(e,t,null,n)};Zr.createRoot=function(e,t){if(!Fk(e))throw Error(ue(299));var n=!1,r="",i=h3;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=$k(e,1,!1,null,null,n,!1,r,i),e[ns]=t.current,Ih(e.nodeType===8?e.parentNode:e),new Lk(t)};Zr.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=M$(t),e=e===null?null:e.stateNode,e};Zr.flushSync=function(e){return Bl(e)};Zr.hydrate=function(e,t,n){if(!jx(t))throw Error(ue(200));return Sx(null,e,t,!0,n)};Zr.hydrateRoot=function(e,t,n){if(!Fk(e))throw Error(ue(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=h3;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=f3(t,null,e,1,n??null,i,!1,a,s),e[ns]=t.current,Ih(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new _x(t)};Zr.render=function(e,t,n){if(!jx(t))throw Error(ue(200));return Sx(null,e,t,!1,n)};Zr.unmountComponentAtNode=function(e){if(!jx(e))throw Error(ue(40));return e._reactRootContainer?(Bl(function(){Sx(null,null,e,!1,function(){e._reactRootContainer=null,e[ns]=null})}),!0):!1};Zr.unstable_batchedUpdates=Tk;Zr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!jx(n))throw Error(ue(200));if(e==null||e._reactInternals===void 0)throw Error(ue(38));return Sx(e,t,n,!1,r)};Zr.version="18.3.1-next-f1338f8080-20240426";function p3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(p3)}catch(e){console.error(e)}}p3(),p$.exports=Zr;var nc=p$.exports;const m3=ct(nc);var g3,KP=nc;g3=KP.createRoot,KP.hydrateRoot;var Ed=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(){}},Ul=typeof window>"u"||"Deno"in globalThis;function nr(){}function lq(e,t){return typeof e=="function"?e(t):e}function Q1(e){return typeof e=="number"&&e>=0&&e!==1/0}function v3(e,t){return Math.max(e+(t||0)-Date.now(),0)}function uo(e,t){return typeof e=="function"?e(t):e}function si(e,t){return typeof e=="function"?e(t):e}function YP(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:s,stale:l}=e;if(s){if(r){if(t.queryHash!==Bk(s,t.options))return!1}else if(!Wh(t.queryKey,s))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||i&&i!==t.state.fetchStatus||a&&!a(t))}function XP(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(zl(t.options.mutationKey)!==zl(a))return!1}
vendor: 17,379 bytes, line 40
40else if(!Wh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Bk(e,t){return((t==null?void 0:t.queryKeyHashFn)||zl)(e)}function zl(e){return JSON.stringify(e,(t,n)=>J1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Wh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Wh(e[n],t[n])):!1}function y3(e,t){if(e===t)return e;const n=QP(e)&&QP(t);if(n||J1(e)&&J1(t)){const r=n?e:Object.keys(e),i=r.length,a=n?t:Object.keys(t),s=a.length,l=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<s;d++){const f=n?d:a[d];(!n&&c.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=y3(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return i===s&&u===i?e:l}return t}function Iv(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 QP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function J1(e){if(!JP(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!JP(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function JP(e){return Object.prototype.toString.call(e)==="[object Object]"}function cq(e){return new Promise(t=>{setTimeout(t,e)})}function Z1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?y3(e,t):t}function uq(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dq(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uk=Symbol();function x3(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Uk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function b3(e,t){return typeof e=="function"?e(...t):!!e}var bl,Fs,bu,GM,fq=(GM=class extends Ed{constructor(){super();Re(this,bl);Re(this,Fs);Re(this,bu);ve(this,bu,t=>{if(!Ul&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){z(this,Fs)||this.setEventListener(z(this,bu))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,Fs))==null||t.call(this),ve(this,Fs,void 0))}setEventListener(t){var n;ve(this,bu,t),(n=z(this,Fs))==null||n.call(this),ve(this,Fs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){z(this,bl)!==t&&(ve(this,bl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof z(this,bl)=="boolean"?z(this,bl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},bl=new WeakMap,Fs=new WeakMap,bu=new WeakMap,GM),zk=new fq,wu,Bs,_u,KM,hq=(KM=class extends Ed{constructor(){super();Re(this,wu,!0);Re(this,Bs);Re(this,_u);ve(this,_u,t=>{if(!Ul&&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(){z(this,Bs)||this.setEventListener(z(this,_u))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,Bs))==null||t.call(this),ve(this,Bs,void 0))}setEventListener(t){var n;ve(this,_u,t),(n=z(this,Bs))==null||n.call(this),ve(this,Bs,t(this.setOnline.bind(this)))}setOnline(t){z(this,wu)!==t&&(ve(this,wu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return z(this,wu)}},wu=new WeakMap,Bs=new WeakMap,_u=new WeakMap,KM),Mv=new hq;function e_(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function pq(e){return Math.min(1e3*2**e,3e4)}function w3(e){return(e??"online")==="online"?Mv.isOnline():!0}var _3=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function F0(e){return e instanceof _3}function j3(e){let t=!1,n=0,r=!1,i;const a=e_(),s=m=>{var v;r||(h(new _3(m)),(v=e.abort)==null||v.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>zk.isFocused()&&(e.networkMode==="always"||Mv.isOnline())&&e.canRun(),d=()=>w3(e.networkMode)&&e.canRun(),f=m=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,m),i==null||i(),a.resolve(m))},h=m=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,m),i==null||i(),a.reject(m))},p=()=>new Promise(m=>{var v;i=x=>{(r||u())&&m(x)},(v=e.onPause)==null||v.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),g=()=>{if(r)return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(x){m=Promise.reject(x)}Promise.resolve(m).then(f).catch(x=>{var j;if(r)return;const y=e.retry??(Ul?0:3),w=e.retryDelay??pq,S=typeof w=="function"?w(n,x):w,_=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,x);if(t||!_){h(x);return}n++,(j=e.onFail)==null||j.call(e,n,x),cq(S).then(()=>u()?void 0:p()).then(()=>{t?h(x):g()})})};return{promise:a,cancel:s,continue:()=>(i==null||i(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?g():p().then(g),a)}}var mq=e=>setTimeout(e,0);function gq(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=mq;const a=l=>{t?e.push(l):i(()=>{n(l)})},s=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||s()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var xn=gq(),wl,YM,S3=(YM=class{constructor(){Re(this,wl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Q1(this.gcTime)&&ve(this,wl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ul?1/0:5*60*1e3))}clearGcTimeout(){z(this,wl)&&(clearTimeout(z(this,wl)),ve(this,wl,void 0))}},wl=new WeakMap,YM),ju,_l,ai,jl,Hn,Hp,Sl,Mi,Da,XM,vq=(XM=class extends S3{constructor(t){super();Re(this,Mi);Re(this,ju);Re(this,_l);Re(this,ai);Re(this,jl);Re(this,Hn);Re(this,Hp);Re(this,Sl);ve(this,Sl,!1),ve(this,Hp,t.defaultOptions),this.setOptions(t.options),this.observers=[],ve(this,jl,t.client),ve(this,ai,z(this,jl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ve(this,ju,yq(this.options)),this.state=t.state??z(this,ju),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=z(this,Hn))==null?void 0:t.promise}setOptions(t){this.options={...z(this,Hp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,ai).remove(this)}setData(t,n){const r=Z1(this.state.data,t,this.options);return Je(this,Mi,Da).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Je(this,Mi,Da).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=z(this,Hn))==null?void 0:r.promise;return(i=z(this,Hn))==null||i.cancel(t),n?n.then(nr).catch(nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(z(this,ju))}isActive(){return this.observers.some(t=>si(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uk||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>uo(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!v3(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,Hn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,Hn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),z(this,ai).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(z(this,Hn)&&(z(this,Sl)?z(this,Hn).cancel({revert:!0}):z(this,Hn).cancelRetry()),this.scheduleGc()),z(this,ai).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Je(this,Mi,Da).call(this,{type:"invalidate"})}fetch(t,n){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(z(this,Hn))return z(this,Hn).continueRetry(),z(this,Hn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,i=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ve(this,Sl,!0),r.signal)})},a=()=>{const h=x3(this.options,n),g=(()=>{const m={client:z(this,jl),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return ve(this,Sl,!1),this.options.persister?this.options.persister(h,g,this):h(g)},l=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:z(this,jl),state:this.state,fetchFn:a};return i(h),h})();(u=this.options.behavior)==null||u.onFetch(l,this),ve(this,_l,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Je(this,Mi,Da).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=h=>{var p,g,m,v;F0(h)&&h.silent||Je(this,Mi,Da).call(this,{type:"error",error:h}),F0(h)||((g=(p=z(this,ai).config).onError)==null||g.call(p,h,this),(v=(m=z(this,ai).config).onSettled)==null||v.call(m,this.state.data,h,this)),this.scheduleGc()};return ve(this,Hn,j3({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var p,g,m,v;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(x){c(x);return}(g=(p=z(this,ai).config).onSuccess)==null||g.call(p,h,this),(v=(m=z(this,ai).config).onSettled)==null||v.call(m,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,p)=>{Je(this,Mi,Da).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{Je(this,Mi,Da).call(this,{type:"pause"})},onContinue:()=>{Je(this,Mi,Da).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),z(this,Hn).start()}},ju=new WeakMap,_l=new WeakMap,ai=new WeakMap,jl=new WeakMap,Hn=new WeakMap,Hp=new WeakMap,Sl=new WeakMap,Mi=new WeakSet,Da=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,...k3(r.data,this.options),fetchMeta:t.meta??null};case"success":return ve(this,_l,void 0),{...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 i=t.error;return F0(i)&&i.revert&&z(this,_l)?{...z(this,_l),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),xn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),z(this,ai).notify({query:this,type:"updated",action:t})})},XM);function k3(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:w3(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yq(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 ca,QM,xq=(QM=class extends Ed{constructor(t={}){super();Re(this,ca);this.config=t,ve(this,ca,new Map)}build(t,n,r){const i=n.queryKey,a=n.queryHash??Bk(i,n);let s=this.get(a);return s||(s=new vq({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){z(this,ca).has(t.queryHash)||(z(this,ca).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=z(this,ca).get(t.queryHash);n&&(t.destroy(),n===t&&z(this,ca).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){xn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return z(this,ca).get(t)}getAll(){return[...z(this,ca).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>YP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>YP(t,r)):n}notify(t){xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){xn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){xn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ca=new WeakMap,QM),ua,Zn,kl,da,Es,JM,bq=(JM=class extends S3{constructor(t){super();Re(this,da);Re(this,ua);Re(this,Zn);Re(this,kl);this.mutationId=t.mutationId,ve(this,Zn,t.mutationCache),ve(this,ua,[]),this.state=t.state||N3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){z(this,ua).includes(t)||(z(this,ua).push(t),this.clearGcTimeout(),z(this,Zn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ve(this,ua,z(this,ua).filter(n=>n!==t)),this.scheduleGc(),z(this,Zn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){z(this,ua).length||(this.state.status==="pending"?this.scheduleGc():z(this,Zn).remove(this))}continue(){var t;return((t=z(this,kl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,s,l,c,u,d,f,h,p,g,m,v,x,y,w,S,_,j,k,C;const n=()=>{Je(this,da,Es).call(this,{type:"continue"})};ve(this,kl,j3({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,A)=>{Je(this,da,Es).call(this,{type:"failed",failureCount:E,error:A})},onPause:()=>{Je(this,da,Es).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,Zn).canRun(this)}));const r=this.state.status==="pending",i=!z(this,kl).canStart();try{if(r)n();else{Je(this,da,Es).call(this,{type:"pending",variables:t,isPaused:i}),await((s=(a=z(this,Zn).config).onMutate)==null?void 0:s.call(a,t,this));const A=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));A!==this.state.context&&Je(this,da,Es).call(this,{type:"pending",context:A,variables:t,isPaused:i})}const E=await z(this,kl).start();return await((d=(u=z(this,Zn).config).onSuccess)==null?void 0:d.call(u,E,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,E,t,this.state.context)),await((g=(p=z(this,Zn).config).onSettled)==null?void 0:g.call(p,E,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,E,null,t,this.state.context)),Je(this,da,Es).call(this,{type:"success",data:E}),E}catch(E){try{throw await((y=(x=z(this,Zn).config).onError)==null?void 0:y.call(x,E,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,E,t,this.state.context)),await((j=(_=z(this,Zn).config).onSettled)==null?void 0:j.call(_,void 0,E,this.state.variables,this.state.context,this)),await((C=(k=this.options).onSettled)==null?void 0:C.call(k,void 0,E,t,this.state.context)),E}finally{Je(this,da,Es).call(this,{type:"error",error:E})}}finally{z(this,Zn).runNext(this)}}},ua=new WeakMap,Zn=new WeakMap,kl=new WeakMap,da=new WeakSet,Es=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),xn.batch(()=>{z(this,ua).forEach(r=>{r.onMutationUpdate(t)}),z(this,Zn).notify({mutation:this,type:"updated",action:t})})},JM);function N3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}
40var Wa,$i,qp,ZM,wq=(ZM=class extends Ed{constructor(t={}){super();Re(this,Wa);Re(this,$i);Re(this,qp);this.config=t,ve(this,Wa,new Set),ve(this,$i,new Map),ve(this,qp,0)}build(t,n,r){const i=new bq({mutationCache:this,mutationId:++Fm(this,qp)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){z(this,Wa).add(t);const n=rg(t);if(typeof n=="string"){const r=z(this,$i).get(n);r?r.push(t):z(this,$i).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(z(this,Wa).delete(t)){const n=rg(t);if(typeof n=="string"){const r=z(this,$i).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&z(this,$i).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=rg(t);if(typeof n=="string"){const r=z(this,$i).get(n),i=r==null?void 0:r.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=rg(t);if(typeof n=="string"){const i=(r=z(this,$i).get(n))==null?void 0:r.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){xn.batch(()=>
vendor: 17,989 bytes, line 40
40{z(this,Wa).forEach(t=>{this.notify({type:"removed",mutation:t})}),z(this,Wa).clear(),z(this,$i).clear()})}getAll(){return Array.from(z(this,Wa))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XP(n,r))}findAll(t={}){return this.getAll().filter(n=>XP(t,n))}notify(t){xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return xn.batch(()=>Promise.all(t.map(n=>n.continue().catch(nr))))}},Wa=new WeakMap,$i=new WeakMap,qp=new WeakMap,ZM);function rg(e){var t;return(t=e.options.scope)==null?void 0:t.id}function ZP(e){return{onFetch:(t,n)=>{var d,f,h,p,g;const r=t.options,i=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],s=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},x=x3(t.options,t.fetchOptions),y=async(w,S,_)=>{if(m)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:S,direction:_?"backward":"forward",meta:t.options.meta};return v(P),P})(),C=await x(k),{maxPages:E}=t.options,A=_?dq:uq;return{pages:A(w.pages,C,E),pageParams:A(w.pageParams,S,E)}};if(i&&a.length){const w=i==="backward",S=w?_q:e2,_={pages:a,pageParams:s},j=S(r,_);l=await y(_,j,w)}else{const w=e??a.length;do{const S=c===0?s[0]??r.initialPageParam:e2(r,l);if(c>0&&S==null)break;l=await y(l,S),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var m,v;return(v=(m=t.options).persister)==null?void 0:v.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function e2(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 _q(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,Us,zs,Su,ku,Ws,Nu,Cu,e$,jq=(e$=class{constructor(e={}){Re(this,Jt);Re(this,Us);Re(this,zs);Re(this,Su);Re(this,ku);Re(this,Ws);Re(this,Nu);Re(this,Cu);ve(this,Jt,e.queryCache||new xq),ve(this,Us,e.mutationCache||new wq),ve(this,zs,e.defaultOptions||{}),ve(this,Su,new Map),ve(this,ku,new Map),ve(this,Ws,0)}mount(){Fm(this,Ws)._++,z(this,Ws)===1&&(ve(this,Nu,zk.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,Jt).onFocus())})),ve(this,Cu,Mv.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,Jt).onOnline())})))}unmount(){var e,t;Fm(this,Ws)._--,z(this,Ws)===0&&((e=z(this,Nu))==null||e.call(this),ve(this,Nu,void 0),(t=z(this,Cu))==null||t.call(this),ve(this,Cu,void 0))}isFetching(e){return z(this,Jt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,Us).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,Jt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=z(this,Jt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(uo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return z(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}),i=z(this,Jt).get(r.queryHash),a=i==null?void 0:i.state.data,s=lq(t,a);if(s!==void 0)return z(this,Jt).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return xn.batch(()=>z(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=z(this,Jt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=z(this,Jt);xn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=z(this,Jt);return xn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=xn.batch(()=>z(this,Jt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(nr).catch(nr)}invalidateQueries(e,t={}){return xn.batch(()=>(z(this,Jt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=xn.batch(()=>z(this,Jt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(nr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=z(this,Jt).build(this,t);return n.isStaleByTime(uo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nr).catch(nr)}fetchInfiniteQuery(e){return e.behavior=ZP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nr).catch(nr)}ensureInfiniteQueryData(e){return e.behavior=ZP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Mv.isOnline()?z(this,Us).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,Jt)}getMutationCache(){return z(this,Us)}getDefaultOptions(){return z(this,zs)}setDefaultOptions(e){ve(this,zs,e)}setQueryDefaults(e,t){z(this,Su).set(zl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...z(this,Su).values()],n={};return t.forEach(r=>{Wh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){z(this,ku).set(zl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...z(this,ku).values()],n={};return t.forEach(r=>{Wh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...z(this,zs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bk(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Uk&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,zs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,Jt).clear(),z(this,Us).clear()}},Jt=new WeakMap,Us=new WeakMap,zs=new WeakMap,Su=new WeakMap,ku=new WeakMap,Ws=new WeakMap,Nu=new WeakMap,Cu=new WeakMap,e$),yr,nt,Vp,er,Nl,Eu,Hs,qs,Gp,Pu,Ou,Cl,El,Vs,Au,ht,Wf,t_,n_,r_,i_,a_,s_,o_,C3,t$,Sq=(t$=class extends Ed{constructor(t,n){super();Re(this,ht);Re(this,yr);Re(this,nt);Re(this,Vp);Re(this,er);Re(this,Nl);Re(this,Eu);Re(this,Hs);Re(this,qs);Re(this,Gp);Re(this,Pu);Re(this,Ou);Re(this,Cl);Re(this,El);Re(this,Vs);Re(this,Au,new Set);this.options=n,ve(this,yr,t),ve(this,qs,null),ve(this,Hs,e_()),this.options.experimental_prefetchInRender||z(this,Hs).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,nt).addObserver(this),t2(z(this,nt),this.options)?Je(this,ht,Wf).call(this):this.updateResult(),Je(this,ht,i_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return l_(z(this,nt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return l_(z(this,nt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Je(this,ht,a_).call(this),Je(this,ht,s_).call(this),z(this,nt).removeObserver(this)}setOptions(t){const n=this.options,r=z(this,nt);if(this.options=z(this,yr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof si(this.options.enabled,z(this,nt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Je(this,ht,o_).call(this),z(this,nt).setOptions(this.options),n._defaulted&&!Iv(this.options,n)&&z(this,yr).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,nt),observer:this});const i=this.hasListeners();i&&n2(z(this,nt),r,this.options,n)&&Je(this,ht,Wf).call(this),this.updateResult(),i&&(z(this,nt)!==r||si(this.options.enabled,z(this,nt))!==si(n.enabled,z(this,nt))||uo(this.options.staleTime,z(this,nt))!==uo(n.staleTime,z(this,nt)))&&Je(this,ht,t_).call(this);const a=Je(this,ht,n_).call(this);i&&(z(this,nt)!==r||si(this.options.enabled,z(this,nt))!==si(n.enabled,z(this,nt))||a!==z(this,Vs))&&Je(this,ht,r_).call(this,a)}getOptimisticResult(t){const n=z(this,yr).getQueryCache().build(z(this,yr),t),r=this.createResult(n,t);return Nq(this,r)&&(ve(this,er,r),ve(this,Eu,this.options),ve(this,Nl,z(this,nt).state)),r}getCurrentResult(){return z(this,er)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){z(this,Au).add(t)}getCurrentQuery(){return z(this,nt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=z(this,yr).defaultQueryOptions(t),r=z(this,yr).getQueryCache().build(z(this,yr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Je(this,ht,Wf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,er)))}createResult(t,n){var E;const r=z(this,nt),i=this.options,a=z(this,er),s=z(this,Nl),l=z(this,Eu),u=t!==r?t.state:z(this,Vp),{state:d}=t;let f={...d},h=!1,p;if(n._optimisticResults){const A=this.hasListeners(),P=!A&&t2(t,n),T=A&&n2(t,r,n,i);(P||T)&&(f={...f,...k3(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:m,status:v}=f;p=f.data;let x=!1;if(n.placeholderData!==void 0&&p===void 0&&v==="pending"){let A;a!=null&&a.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(A=a.data,x=!0):A=typeof n.placeholderData=="function"?n.placeholderData((E=z(this,Ou))==null?void 0:E.state.data,z(this,Ou)):n.placeholderData,A!==void 0&&(v="success",p=Z1(a==null?void 0:a.data,A,n),h=!0)}if(n.select&&p!==void 0&&!x)if(a&&p===(s==null?void 0:s.data)&&n.select===z(this,Gp))p=z(this,Pu);else try{ve(this,Gp,n.select),p=n.select(p),p=Z1(a==null?void 0:a.data,p,n),ve(this,Pu,p),ve(this,qs,null)}catch(A){ve(this,qs,A)}z(this,qs)&&(g=z(this,qs),p=z(this,Pu),m=Date.now(),v="error");const y=f.fetchStatus==="fetching",w=v==="pending",S=v==="error",_=w&&y,j=p!==void 0,C={status:v,fetchStatus:f.fetchStatus,isPending:w,isSuccess:v==="success",isError:S,isInitialLoading:_,isLoading:_,data:p,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:m,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:S&&!j,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&j,isStale:Wk(t,n),refetch:this.refetch,promise:z(this,Hs),isEnabled:si(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const A=B=>{C.status==="error"?B.reject(C.error):C.data!==void 0&&B.resolve(C.data)},P=()=>{const B=ve(this,Hs,C.promise=e_());A(B)},T=z(this,Hs);switch(T.status){case"pending":t.queryHash===r.queryHash&&A(T);break;case"fulfilled":(C.status==="error"||C.data!==T.value)&&P();break;case"rejected":(C.status!=="error"||C.error!==T.reason)&&P();break}}return C}updateResult(){const t=z(this,er),n=this.createResult(z(this,nt),this.options);if(ve(this,Nl,z(this,nt).state),ve(this,Eu,this.options),z(this,Nl).data!==void 0&&ve(this,Ou,z(this,nt)),Iv(n,t))return;ve(this,er,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!z(this,Au).size)return!0;const s=new Set(a??z(this,Au));return this.options.throwOnError&&s.add("error"),Object.keys(z(this,er)).some(l=>{const c=l;return z(this,er)[c]!==t[c]&&s.has(c)})};Je(this,ht,C3).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Je(this,ht,i_).call(this)}},yr=new WeakMap,nt=new WeakMap,Vp=new WeakMap,er=new WeakMap,Nl=new WeakMap,Eu=new WeakMap,Hs=new WeakMap,qs=new WeakMap,Gp=new WeakMap,Pu=new WeakMap,Ou=new WeakMap,Cl=new WeakMap,El=new WeakMap,Vs=new WeakMap,Au=new WeakMap,ht=new WeakSet,Wf=function(t){Je(this,ht,o_).call(this);let n=z(this,nt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(nr)),n},t_=function(){Je(this,ht,a_).call(this);const t=uo(this.options.staleTime,z(this,nt));if(Ul||z(this,er).isStale||!Q1(t))return;const r=v3(z(this,er).dataUpdatedAt,t)+1;ve(this,Cl,setTimeout(()=>{z(this,er).isStale||this.updateResult()},r))},n_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,nt)):this.options.refetchInterval)??!1},r_=function(t){Je(this,ht,s_).call(this),ve(this,Vs,t),!(Ul||si(this.options.enabled,z(this,nt))===!1||!Q1(z(this,Vs))||z(this,Vs)===0)&&ve(this,El,setInterval(()=>{(this.options.refetchIntervalInBackground||zk.isFocused())&&Je(this,ht,Wf).call(this)},z(this,Vs)))},i_=function(){Je(this,ht,t_).call(this),Je(this,ht,r_).call(this,Je(this,ht,n_).call(this))},a_=function(){z(this,Cl)&&(clearTimeout(z(this,Cl)),ve(this,Cl,void 0))},s_=function(){z(this,El)&&(clearInterval(z(this,El)),ve(this,El,void 0))},o_=function(){const t=z(this,yr).getQueryCache().build(z(this,yr),this.options);if(t===z(this,nt))return;const n=z(this,nt);ve(this,nt,t),ve(this,Vp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},C3=function(t){xn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(z(this,er))}),z(this,yr).getQueryCache().notify({query:z(this,nt),type:"observerResultsUpdated"})})},t$);function kq(e,t){return si(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function t2(e,t){return kq(e,t)||e.state.data!==void 0&&l_(e,t,t.refetchOnMount)}function l_(e,t,n){if(si(t.enabled,e)!==!1&&uo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Wk(e,t)}return!1}function n2(e,t,n,r){return(e!==t||si(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Wk(e,n)}function Wk(e,t){return si(t.enabled,e)!==!1&&e.isStaleByTime(uo(t.staleTime,e))}function Nq(e,t){return!Iv(e.getCurrentResult(),t)}var Gs,Ks,xr,Ha,es,Xg,c_,n$,Cq=(n$=class extends Ed{constructor(n,r){super();Re(this,es);Re(this,Gs);Re(this,Ks);Re(this,xr);Re(this,Ha);ve(this,Gs,n),this.setOptions(r),this.bindMethods(),Je(this,es,Xg).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=z(this,Gs).defaultMutationOptions(n),Iv(this.options,r)||z(this,Gs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:z(this,xr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&zl(r.mutationKey)!==zl(this.options.mutationKey)?this.reset():((i=z(this,xr))==null?void 0:i.state.status)==="pending"&&z(this,xr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=z(this,xr))==null||n.removeObserver(this)}onMutationUpdate(n){Je(this,es,Xg).call(this),Je(this,es,c_).call(this,n)}getCurrentResult(){return z(this,Ks)}reset(){var n;(n=z(this,xr))==null||n.removeObserver(this),ve(this,xr,void 0),Je(this,es,Xg).call(this),Je(this,es,c_).call(this)}mutate(n,r){var i;return ve(this,Ha,r),(i=z(this,xr))==null||i.removeObserver(this),ve(this,xr,z(this,Gs).getMutationCache().build(z(this,Gs),this.options)),z(this,xr).addObserver(this),z(this,xr).execute(n)}},Gs=new WeakMap,Ks=new WeakMap,xr=new WeakMap,Ha=new WeakMap,es=new WeakSet,Xg=function(){var r;const n=((r=z(this,xr))==null?void 0:r.state)??N3();ve(this,Ks,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},c_=function(n){xn.batch(()=>{var r,i,a,s,l,c,u,d;if(z(this,Ha)&&this.hasListeners()){const f=z(this,Ks).variables,h=z(this,Ks).context;(n==null?void 0:n.type)==="success"?((i=(r=z(this,Ha)).onSuccess)==null||i.call(r,n.data,f,h),(s=(a=z(this,Ha)).onSettled)==null||s.call(a,n.data,null,f,h)):(n==null?void 0:n.type)==="error"&&((c=(l=z(this,Ha)).onError)==null||c.call(l,n.error,f,h),(d=(u=z(this,Ha)).onSettled)==null||d.call(u,void 0,n.error,f,h))}this.listeners.forEach(f=>{f(z(this,Ks))})})},n$),E3=b.createContext(void 0),_i=e=>{const t=b.useContext(E3);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Eq=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(E3.Provider,{value:e,children:t})),P3=b.createContext(!1),Pq=()=>b.useContext(P3);P3.Provider;function Oq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Aq=b.createContext(Oq()),Tq=()=>b.useContext(Aq),Rq=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Iq=e=>{b.useEffect(()=>{e.clearReset()},[e])},Mq=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||b3(n,[e.error,r])),$q=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Dq=(e,t)=>e.isLoading&&e.isFetching&&!t,Lq=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,r2=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Fq(e,t,n){var f,h,p,g,m;
40const r=Pq(),i=Tq(),a=_i(),s=a.defaultQueryOptions(e);(h=(f=a.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,s),s._optimisticResults=r?"isRestoring":"optimistic",$q(s),Rq(s,i),Iq(i);const l=!a.getQueryCache().get(s.queryHash),[c]=b.useState(()=>new t(a,s)),u=c.getOptimisticResult(s),d=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(v=>{const x=d?c.subscribe(xn.batchCalls(v)):nr;return c.updateResult(),x},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),b.useEffect(()=>{c.setOptions(s)},[s,c]),Lq(s,u))throw r2(s,c,i);if(Mq({result:u,errorResetBoundary:i,throwOnError:s.throwOnError,query:a.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw u.error;if((g=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,s,u),s.experimental_prefetchInRender&&!Ul&&Dq(u,r)){const v=l?r2(s,c,i):(m=a.getQueryCache().get(s.queryHash))==null?void 0:m.promise;v==null||v.catch(nr).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?u:c.trackResult(u)}function Na(e,t){return Fq(e,Sq)}function u_(e,t){const n=_i(),[r]=b.useState(()=>new Cq(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(s=>r.subscribe(xn.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=b.useCallback((s,l)=>{r.mutate(s,l).catch(nr)},[r]);if(i.error&&b3(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}/**
41 * @remix-run/router v1.23.0
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */function Hh(){return Hh=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},Hh.apply(this,arguments)}var Js;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Js||(Js={}));const i2="popstate";function Bq(e){e===void 0&&(e={});function t(r,i){let{pathname:a,search:s,hash:l}=r.location;return d_("",{pathname:a,search:s,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:$v(i)}return zq(t,n,null,e)}function ln(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O3(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Uq(){return Math.random().toString(36).substr(2,8)}function a2(e,t){return{usr:e.state,key:e.key,idx:t}}function d_(e,t,n,r){return n===void 0&&(n=null),Hh({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pd(t):t,{state:n,key:t&&t.key||r||Uq()})}function $v(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 Pd(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 zq(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,l=Js.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(Hh({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=Js.Pop;let v=d(),x=v==null?null:v-u;u=v,c&&c({action:l,location:m.location,delta:x})}function h(v,x){l=Js.Push;let y=d_(m.location,v,x);u=d()+1;let w=a2(y,u),S=m.createHref(y);try{s.pushState(w,"",S)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(S)}a&&c&&c({action:l,location:m.location,delta:1})}function p(v,x){l=Js.Replace;let y=d_(m.location,v,x);u=d();let w=a2(y,u),S=m.createHref(y);s.replaceState(w,"",S),a&&c&&c({action:l,location:m.location,delta:0})}function g(v){let x=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof v=="string"?v:$v(v);return y=y.replace(/ $/,"%20"),ln(x,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,x)}let m={get action(){return l},get location(){return e(i,s)},listen(v){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(i2,f),c=v,()=>{i.removeEventListener(i2,f),c=null}},createHref(v){return t(i,v)},createURL:g,encodeLocation(v){let x=g(v);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:p,go(v){return s.go(v)}};return m}var s2;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(s2||(s2={}));function Wq(e,t,n){return n===void 0&&(n="/"),Hq(e,t,n,!1)}function Hq(e,t,n,r){let i=typeof t=="string"?Pd(t):t,a=Hk(i.pathname||"/",n);if(a==null)return null;let s=A3(e);qq(s);let l=null;for(let c=0;l==null&&c<s.length;++c){let u=nV(a);l=eV(s[c],u,r)}return l}function A3(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,s,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(ln(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not val
49id. 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=fo([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(ln(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),A3(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Jq(u,a.index),routesMeta:d})};return e.forEach((a,s)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,s);else for(let c of T3(a.path))i(a,s,c)}),t}function T3(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=T3(r.join("/")),l=[];return l.push(...s.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function qq(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Zq(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Vq=/^:[\w-]+$/,Gq=3,Kq=2,Yq=1,Xq=10,Qq=-2,o2=e=>e==="*";function Jq(e,t){let n=e.split("/"),r=n.length;return n.some(o2)&&(r+=Qq),t&&(r+=Kq),n.filter(i=>!o2(i)).reduce((i,a)=>i+(Vq.test(a)?Gq:a===""?Yq:Xq),r)}function Zq(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function eV(e,t,n){let{routesMeta:r}=e,i={},a="/",s=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=l2({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=l2({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
vendor: 5,690 bytes, lines 49-58
49Object.assign(i,f.params),s.push({params:i,pathname:fo([a,f.pathname]),pathnameBase:sV(fo([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=fo([a,f.pathnameBase]))}return s}function l2(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=tV(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";s=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function tV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),O3(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function nV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return O3(!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 Hk(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 rV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Pd(e):e;return{pathname:n?n.startsWith("/")?n:iV(n,t):t,search:oV(r),hash:lV(i)}}function iV(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function B0(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 aV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qk(e,t){let n=aV(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Vk(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Pd(e):(i=Hh({},e),ln(!i.pathname||!i.pathname.includes("?"),B0("?","pathname","search",i)),ln(!i.pathname||!i.pathname.includes("#"),B0("#","pathname","hash",i)),ln(!i.search||!i.search.includes("#"),B0("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,l;if(s==null)l=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=rV(i,l),u=s&&s!=="/"&&s.endsWith("/"),d=(a||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const fo=e=>e.join("/").replace(/\/\/+/g,"/"),sV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),oV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,lV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function cV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const R3=["post","put","patch","delete"];new Set(R3);const uV=["get",...R3];new Set(uV);/**
50 * React Router v6.30.1
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function qh(){return qh=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},qh.apply(this,arguments)}const Gk=b.createContext(null),dV=b.createContext(null),Oo=b.createContext(null),kx=b.createContext(null),hs=b.createContext({outlet:null,matches:[],isDataRoute:!1}),I3=b.createContext(null);function fV(e,t){let{relative:n}=t===void 0?{}:t;Od()||ln(!1);let{basename:r,navigator:i}=b.useContext(Oo),{hash:a,pathname:s,search:l}=$3(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:fo([r,s])),i.createHref({pathname:c,search:l,hash:a})}function Od(){return b.useContext(kx)!=null}function Ao(){return Od()||ln(!1),b.useContext(kx).location}function M3(e){b.useContext(Oo).static||b.useLayoutEffect(e)}function ps(){let{isDataRoute:e}=b.useContext(hs);return e?kV():hV()}function hV(){Od()||ln(!1);let e=b.useContext(Gk),{basename:t,future:n,navigator:r}=b.useContext(Oo),{matches:i}=b.useContext(hs),{pathname:a}=Ao(),s=JSON.stringify(qk(i,n.v7_relativeSplatPath)),l=b.useRef(!1);return M3(()=>{l.current=!0}),b.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=Vk(u,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:fo([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,a,e])}function Kk(){let{matches:e}=b.useContext(hs),t=e[e.length-1];return t?t.params:{}}function $3(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(Oo),{matches:i}=b.useContext(hs),{pathname:a}=Ao(),s=JSON.stringify(qk(i,r.v7_relativeSplatPath));return b.useMemo(()=>Vk(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}
vendor: 3,805 bytes, line 58
58function pV(e,t){return mV(e,t)}function mV(e,t,n,r){Od()||ln(!1);let{navigator:i}=b.useContext(Oo),{matches:a}=b.useContext(hs),s=a[a.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=Ao(),d;if(t){var f;let v=typeof t=="string"?Pd(t):t;c==="/"||(f=v.pathname)!=null&&f.startsWith(c)||ln(!1),d=v}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let v=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=Wq(e,{pathname:p}),m=bV(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:fo([c,i.encodeLocation?i.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:fo([c,i.encodeLocation?i.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),a,n,r);return t&&m?b.createElement(kx.Provider,{value:{location:qh({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Js.Pop}},m):m}function gV(){let e=SV(),t=cV(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:i},n):null,null)}const vV=b.createElement(gV,null);class yV extends b.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?b.createElement(hs.Provider,{value:this.props.routeContext},b.createElement(I3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function xV(e){let{routeContext:t,match:n,children:r}=e,i=b.useContext(Gk);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(hs.Provider,{value:t},r)}function bV(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||ln(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let p,g=!1,m=null,v=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||vV,c&&(u<0&&h===0?(g=!0,v=null):u===h&&(g=!0,v=f.route.hydrateFallbackElement||null)));let x=t.concat(s.slice(0,h+1)),y=()=>{let w;return p?w=m:g?w=v:f.route.Component?w=b.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,b.createElement(xV,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?b.createElement(yV,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:y(),routeC
58ontext:{outlet:null,matches:x,isDataRoute:!0}}):y()},null)}var D3=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(D3||{}),Dv=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}(Dv||{});function wV(e){let t=b.useContext(Gk);return t||ln(!1),t}function _V(e){let t=b.useContext(dV);return t||ln(!1),t}function jV(e){let t=b.useContext(hs);return t||ln(!1),t}function L3(e){let t=jV(),n=t.matches[t.matches.length-1];return n.route.id||ln(!1),n.route.id}function SV(){var e;let t=b.useContext(I3),n=_V(Dv.UseRouteError),r=L3(Dv.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function kV(){let{router:e}=wV(D3.UseNavigateStable),t=L3(Dv.UseNavigateStable),n=b.useRef(!1);return M3(()=>{n.current=!0}),b.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,qh({fromRouteId:t},a)))},[e,t])}function NV(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Yi(e){let{to:t,replace:n,state:r,relative:i}=e;Od()||ln(!1);let{future:a,static:s}=b.useContext(Oo),{matches:l}=b.useContext(hs),{pathname:c}=Ao(),u=ps(),d=Vk(t,qk(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return b.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function an(e){ln(!1)}function CV(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Js.Pop,navigator:a,static:s=!1,future:l}=e;Od()&&ln(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:a,static:s,future:qh({v7_relativeSplatPath:!1},l)}),[c,l,a,s]);typeof r=="string"&&(r=Pd(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,m=b.useMemo(()=>{let v=Hk(d,c);return v==null?null:{location:{pathname:v,search:f,hash:h,state:p,key:g},navigationType:i}},[c,d,f,h,p,g,i]);return m==null?null:b.createElement(Oo.Provider,{value:u},b.createElement(kx.Provider,{children:n,value:m}))}function EV(e){let{children:t,location:n}=e;return pV(f_(t),n)}new Promise(()=>{});function f_(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,i)=>{if(!b.isValidElement(r))return;let a=[...t,i];if(r.type===b.Fragment){n.push.apply(n,f_(r.props.children,a));return}r.type!==an&&ln(!1),!r.props.index||!r.props.children||ln(!1);let s={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&&(s.children=f_(r.props.children,a)),n.push(s)}),n}/**
59 * React Router DOM v6.30.1
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */function h_(){return h_=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},h_.apply(this,arguments)}function PV(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function OV(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function AV(e,t){return e.button===0&&(!t||t==="_self")&&!OV(e)}function p_(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(i=>[n,i]):[[n,r]])},[]))}function TV(e,t){let n=p_(e);return t&&t.forEach((r,i)=>
67{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const RV=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],IV="6";try{window.__reactRouterVersion=IV}catch{}const MV="startTransition",c2=YS[MV];function $V(e){let{basename:t,children:n,future:r,window:i}=e,a=b.useRef();a.current==null&&(a.current=Bq({window:i,v5Compat:!0}));let s=a.current,[l,c]=b.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},d=b.useCallback(f=>{u&&c2?c2(()=>c(f)):c(f)},[c,u]);return b.useLayoutEffect(()=>s.listen(d),[s,d]),b.useEffect(()=>NV(r),[r]),b.createElement(CV,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const DV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,on=b.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=PV(t,RV),{basename:p}=b.useContext(Oo),g,m=!1;if(typeof u=="string"&&LV.test(u)&&(g=u,DV))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),_=Hk(S.pathname,p);S.origin===w.origin&&_!=null?u=_+S.search+S.hash:m=!0}catch{}let v=fV(u,{relative:i}),x=FV(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function y(w){r&&r(w),w.defaultPrevented||x(w)}return b.createElement("a",h_({},h,{href:g||v,onClick:m||a?r:y,ref:n,target:c}))});var u2;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(u2||(u2={}));var d2;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(d2||(d2={}));function FV(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:l}=t===void 0?{}:t,c=ps(),u=Ao(),d=$3(e,{relative:s});return b.useCallback(f=>{if(AV(f,n)){f.preventDefault();let h=r!==void 0?r:$v(u)===$v(d);c(e,{replace:h,state:i,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,d,r,i,n,e,a,s,l])}function rc(e){let t=b.useRef(p_(e)),n=b.useRef(!1),r=Ao(),i=b.useMemo(()=>TV(r.search,n.current?null:t.current),[r.search]),a=ps(),s=b.useCallback((l,c)=>{const u=p_(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,s]}var f2=["light","dark"],BV="(prefers-color-scheme: dark)",UV=b.createContext(void 0),zV={setTheme:e=>{},themes:[]},WV=()=>{var e;return(e=b.useContext(UV))!=null?e:zV};b.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:s,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';`,f=i?f2.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(g,m=!1,v=!0)=>{let x=s?s[g]:g,y=m?g+"|| ''":`'${x}'`,w="";return i&&v&&!m&&f2.includes(g)&&(w+=`d.style.colorScheme = '${g}';`),n==="class"?m||x?w+=`c.add(${y})`:w+="null":x&&(w+=`d[s](n,${y})`),w},p=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${BV}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${h(s?"x[e]":"e",!0)}}${u?"":"else{"+h(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${h(s?"x[e]":"e",!0)}}else{${h(a,!1,!1)};}${f}}catch(t){}}();`;return b.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var HV=e=>{switch(e){case"success":return GV;case"info":return YV;case"warning":return KV;case"error":return XV;default:return null}},qV=Array(12).fill(0),VV=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(
67Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},qV.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),GV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),KV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.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"})),YV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),XV=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),QV=I.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"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),JV=()=>
67{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},m_=1,ZV=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,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:m_++,a=this.toasts.find(l=>l.id===i),s=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:n}),{...l,...e,id:i,dismissible:s,title:n}):l):this.addToast({title:n,...r,dismissible:s,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(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)=>
67this.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(),i=n!==void 0,a,s=r.then(async c=>{if(a=["resolve",c],I.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(tG(c)&&!c.ok){i=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){i=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(a=["reject",c],t.error!==void 0){i=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;i&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>s.then(()=>a[0]==="reject"?u(a[1]):c(a[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||m_++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},br=new ZV,eG=(e,t)=>{let n=(t==null?void 0:t.id)||m_++;return br.addToast({title:e,...t,id:n}),n},tG=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",nG=eG,rG=()=>br.toasts,iG=()=>br.getActiveToasts(),G=Object.assign(nG,{success:br.success,info:br.info,warning:br.warning,error:br.error,custom:br.custom,message:br.message,promise:br.promise,dismiss:br.dismiss,loading:br.loading},{getHistory:rG,getToasts:iG});function aG(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))}aG(`: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;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-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;
67left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}: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:-50%;right:-50%;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}
67: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-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-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-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 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%);
67--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[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%)}
68`);function ig(e){return e.label!==void 0}var sG=3,oG="32px",lG="16px",h2=4e3,cG=356,uG=14,dG=20,fG=200;function Pi(...e){return e.filter(Boolean).join(" ")}function hG(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var pG=e=>{var t,n,r,i,a,s,l,c,u,d,f;let{invert:h,toast:p,unstyled:g,interacting:m,setHeights:v,visibleToasts:x,heights:y,index:w,toasts:S,expanded:_,removeToast:j,defaultRichColors:k,closeButton:C,style:E,cancelButtonStyle:A,actionButtonStyle:P,className:T="",descriptionClassName:B="",duration:F,position:M,gap:L,loadingIcon:R,expandByDefault:$,classNames:O,icons:N,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:V}
68=e,[D,K]=I.useState(null),[ae,se]=I.useState(null),[Q,ne]=I.useState(!1),[Z,W]=I.useState(!1),[ee,q]=I.useState(!1),[re,ge]=I.useState(!1),[Ie,ye]=I.useState(!1),[qe,jt]=I.useState(0),[pt,rn]=I.useState(0),Wt=I.useRef(p.duration||F||h2),Sn=I.useRef(null),mt=I.useRef(null),Ee=w===0,Gt=w+1<=x,J=p.type,le=p.dismissible!==!1,Ae=p.className||"",Ve=p.descriptionClassName||"",Ze=I.useMemo(()=>y.findIndex(Ge=>Ge.toastId===p.id)||0,[y,p.id]),cn=I.useMemo(()=>{var Ge;return(Ge=p.closeButton)!=null?Ge:C},[p.closeButton,C]),Bn=I.useMemo(()=>p.duration||F||h2,[p.duration,F]),mn=I.useRef(0),An=I.useRef(0),Ct=I.useRef(0),it=I.useRef(null),[U,ie]=M.split("-"),je=I.useMemo(()=>y.reduce((Ge,xt,Ht)=>Ht>=Ze?Ge:Ge+xt.height,0),[y,Ze]),at=JV(),$r=p.invert||h,na=J==="loading";An.current=I.useMemo(()=>Ze*L+je,[Ze,je]),I.useEffect(()=>{Wt.current=Bn},[Bn]),I.useEffect(()=>{ne(!0)},[]),I.useEffect(()=>{let Ge=mt.current;if(Ge){let xt=Ge.getBoundingClientRect().height;return rn(xt),v(Ht=>[{toastId:p.id,height:xt,position:p.position},...Ht]),()=>v(Ht=>Ht.filter(ki=>ki.toastId!==p.id))}},[v,p.id]),I.useLayoutEffect(()=>{if(!Q)return;let Ge=mt.current,xt=Ge.style.height;Ge.style.height="auto";let Ht=Ge.getBoundingClientRect().height;Ge.style.height=xt,rn(Ht),v(ki=>ki.find(Ni=>Ni.toastId===p.id)?ki.map(Ni=>Ni.toastId===p.id?{...Ni,height:Ht}:Ni):[{toastId:p.id,height:Ht,position:p.position},...ki])},[Q,p.title,p.description,v,p.id]);let Un=I.useCallback(()=>{W(!0),jt(An.current),v(Ge=>Ge.filter(xt=>xt.toastId!==p.id)),setTimeout(()=>{j(p)},fG)},[p,j,v,An]);I.useEffect(()=>{if(p.promise&&J==="loading"||p.duration===1/0||p.type==="loading")return;let Ge;return _||m||V&&at?(()=>{if(Ct.current<mn.current){let xt=new Date().getTime()-mn.current;Wt.current=Wt.current-xt}Ct.current=new Date().getTime()})():Wt.current!==1/0&&(mn.current=new Date().getTime(),Ge=setTimeout(()=>{var xt;(xt=p.onAutoClose)==null||xt.call(p,p),Un()},Wt.current)),()=>clearTimeout(Ge)},[_,m,p,J,V,at,Un]),I.useEffect(()=>{p.delete&&Un()},[Un,p.delete]);function M7(){var Ge,xt,Ht;return N!=null&&N.loading?I.createElement("div",{className:Pi(O==null?void 0:O.loader,(Ge=p==null?void 0:p.classNames)==null?void 0:Ge.loader,"sonner-loader"),"data-visible":J==="loading"},N.loading):R?I.createElement("div",{className:Pi(O==null?void 0:O.loader,(xt=p==null?void 0:p.classNames)==null?void 0:xt.loader,"sonner-loader"),"data-visible":J==="loading"},R):I.createElement(VV,{className:Pi(O==null?void 0:O.loader,(Ht=p==null?void 0:p.classNames)==null?void 0:Ht.loader),visible:J==="loading"})}return I.createElement("li",{tabIndex:0,ref:mt,className:Pi(T,Ae,O==null?void 0:O.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[J],(n=p==null?void 0:p.classNames)==null?void 0:n[J]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:k,"data-styled":!(p.jsx||p.unstyled||g),"data-mounted":Q,"data-promise":!!p.promise,"data-swiped":Ie,"data-removed":Z,"data-visible":Gt,"data-y-position":U,"data-x-position":ie,"data-index":w,"data-front":Ee,"data-swiping":ee,"data-dismissible":le,"data-type":J,"data-invert":$r,"data-swipe-out":re,"data-swipe-direction":ae,"data-expanded":!!(_||$&&Q),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${Z?qe:An.current}px`,"--initial-height":$?"auto":`${pt}px`,...E,...p.style},onDragEnd:()=>{q(!1),K(null),it.current=null},onPointerDown:Ge=>{na||!le||(Sn.current=new Date,jt(An.current),Ge.target.setPointerCapture(Ge.pointerId),Ge.target.tagName!=="BUTTON"&&(q(!0),it.current={x:Ge.clientX,y:Ge.clientY}))},onPointerUp:()=>{var Ge,xt,Ht,ki;if(re||!le)return;it.current=null;let Ni=Number(((Ge=mt.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ws=Number(((xt=mt.current)==null?void 0:xt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ko=new Date().getTime()-((Ht=Sn.current)==null?void 0:Ht.getTime()),Ci=D==="x"?Ni:ws,_s=Math.abs(Ci)/Ko;if(Math.abs(Ci)>=dG||_s>.11){jt(An.current),(ki=p.onDismiss)==null||ki.call(p,p),se(D==="x"?Ni>0?"right":"left":ws>0?"down":"up"),Un(),ge(!0),ye(!1);return}q(!1),K(null)},onPointerMove:Ge=>{var xt,Ht,ki,Ni;if(!it.current||!le||((xt=window.getSelection())==null?void 0:xt.toString().length)>0)return;let ws=Ge.clientY-it.current.y,Ko=Ge.clientX-it.current.x,Ci=(Ht=e.swipeDirections)!=null?Ht:hG(M);!D&&(Math.abs(Ko)>1||Math.abs(ws)>1)&&K(Math.abs(Ko)>Math.abs(ws)?"x":"y");let _s={x:0,y:0};D==="y"?(Ci.includes("top")||Ci.includes("bottom"))&&(Ci.includes("top")&&ws<0||Ci.includes("bottom")&&ws>0)&&(_s.y=ws):D==="x"&&(Ci.includes("left")||Ci.includes("right"))&&(Ci.includes("left")&&Ko<0||Ci.includes("right")&&Ko>0)&&(_s.x=Ko),(Math.abs(_s.x)>0||Math.abs(_s.y)>0)&&ye(!0),(ki=mt.current)==null||ki.style.setProperty("--swipe-amount-x",`${_s.x}px`),(Ni=mt.current)==null||Ni.style.setProperty("--swipe-amount-y",`${_s.y}px`)}},cn&&!p.jsx?I.createElement("button",{"aria-label":H,"data-disabled":na,"data-close-button":!0,onClick:na||!le?()=>{}:()=>{var Ge;Un(),(Ge=p.onDismiss)==null||Ge.call(p,p)},className:Pi(O==null?void 0:O.closeButton,(i=p==null?void 0:p.classNames)==null?void 0:i.closeButton)},(a=N==null?void 0:N.close)!=null?a:QV):null,p.jsx||b.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:I.createElement(I.Fragment,null,J||p.icon||p.promise?I.createElement("div",{"data-icon":"",className:Pi(O==null?void 0:O.icon,(s=p==null?void 0:p.classNames)==null?void 0:s.icon)}
vendor: 5,600 bytes, line 68
68,p.promise||p.type==="loading"&&!p.icon?p.icon||M7():null,p.type!=="loading"?p.icon||(N==null?void 0:N[J])||HV(J):null):null,I.createElement("div",{"data-content":"",className:Pi(O==null?void 0:O.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},I.createElement("div",{"data-title":"",className:Pi(O==null?void 0:O.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?I.createElement("div",{"data-description":"",className:Pi(B,Ve,O==null?void 0:O.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),b.isValidElement(p.cancel)?p.cancel:p.cancel&&ig(p.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:Ge=>{var xt,Ht;ig(p.cancel)&&le&&((Ht=(xt=p.cancel).onClick)==null||Ht.call(xt,Ge),Un())},className:Pi(O==null?void 0:O.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,b.isValidElement(p.action)?p.action:p.action&&ig(p.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||P,onClick:Ge=>{var xt,Ht;ig(p.action)&&((Ht=(xt=p.action).onClick)==null||Ht.call(xt,Ge),!Ge.defaultPrevented&&Un())},className:Pi(O==null?void 0:O.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function p2(){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}function mG(e,t){let n={};return[e,t].forEach((r,i)=>{let a=i===1,s=a?"--mobile-offset":"--offset",l=a?lG:oG;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${s}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${s}-${u}`]=l:n[`${s}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}var gG=b.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:s,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:p,visibleToasts:g=sG,toastOptions:m,dir:v=p2(),gap:x=uG,loadingIcon:y,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:_}=e,[j,k]=I.useState([]),C=I.useMemo(()=>Array.from(new Set([r].concat(j.filter(V=>V.position).map(V=>V.position)))),[j,r]),[E,A]=I.useState([]),[P,T]=I.useState(!1),[B,F]=I.useState(!1),[M,L]=I.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),R=I.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=I.useRef(null),N=I.useRef(!1),H=I.useCallback(V=>{k(D=>{var K;return(K=D.find(ae=>ae.id===V.id))!=null&&K.delete||br.dismiss(V.id),D.filter(({id:ae})=>ae!==V.id)})},[]);return I.useEffect(()=>br.subscribe(V=>{if(V.dismiss){k(D=>D.map(K=>K.id===V.id?{...K,delete:!0}:K));return}setTimeout(()=>{m3.flushSync(()=>{k(D=>{let K=D.findIndex(ae=>ae.id===V.id);return K!==-1?[...D.slice(0,K),{...D[K],...V},...D.slice(K+1)]:[V,...D]})})})}),[]),I.useEffect(()=>{if(d!=="system"){L(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;let V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:D})=>{L(D?"dark":"light")})}catch{V.addListener(({matches:K})=>{try{L(K?"dark":"light")}catch(ae){console.error(ae)}})}},[d]),I.useEffect(()=>{j.length<=1&&T(!1)},[j]),I.useEffect(()=>{let V=D=>{var K,ae;i.every(se=>D[se]||D.code===se)&&(T(!0),(K=R.current)==null||K.focus()),D.code==="Escape"&&(document.activeElement===R.current||(ae=R.current)!=null&&ae.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[i]),I.useEffect(()=>{if(R.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,N.current=!1)}},[R.current]),I.createElement("section",{ref:t,"aria-label":`${S} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((V,D)=>{var K;let[ae,se]=V.split("-");return j.length?I.createElement("ol",{key:V,dir:v==="auto"?p2():v,tabIndex:-1,ref:R,className:l,"data-sonner-toaster":!0,"data-theme":M,"data-y-position":ae,"data-lifted":P&&j.length>1&&!a,"data-x-position":se,style:{"--front-toast-height":`${((K=E[0])==null?void 0:K.height)||0}px`,"--width":`${cG}px`,"--gap":`${x}px`,...p,...mG(c,u)},onBlur:Q=>{N.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(N.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||N.current||(N.current=!0,O.current=Q.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{B||T(!1)},onDragEnd:()=>T(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},j.filter(Q=>!Q.position&&D===0||Q.position===V).map((Q,ne)=>{var Z,W;return I.createElement(pG,{key:Q.id,icons:w,index:ne,toast:Q,defaultRichColors:f,duration:(Z=m==null?void 0:m.duration)!=null?Z:h,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:g,closeButton:(W=m==null?void 0:m.closeButton)!=null?W:s,interacting:
68B,position:V,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:H,toasts:j.filter(ee=>ee.position==Q.position),heights:E.filter(ee=>ee.position==Q.position),setHeights:A,expandByDefault:a,gap:x,loadingIcon:y,expanded:P,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const vG=({...e})=>{const{theme:t="system"}=WV();return o.jsx(gG,{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})},yG=1,xG=1e6;let U0=0;function bG(){return U0=(U0+1)%Number.MAX_SAFE_INTEGER,U0.toString()}const z0=new Map,m2=e=>{if(z0.has(e))return;const t=setTimeout(()=>{z0.delete(e),lh({type:"REMOVE_TOAST",toastId:e})},xG);z0.set(e,t)},wG=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,yG)};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?m2(n):e.toasts.forEach(r=>{m2(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)}}},Qg=[];let Jg={toasts:[]};function lh(e){Jg=wG(Jg,e),Qg.forEach(t=>{t(Jg)})}function _G({...e}){const t=bG(),n=i=>lh({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>lh({type:"DISMISS_TOAST",toastId:t});return lh({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function Yk(){const[e,t]=b.useState(Jg);return b.useEffect(()=>(Qg.push(t),()=>{const n=Qg.indexOf(t);n>-1&&Qg.splice(n,1)}),[e]),{...e,toast:_G,dismiss:n=>lh({type:"DISMISS_TOAST",toastId:n})}}function me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function g2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nx(...e){return t=>{let n=!1;const r=e.map(i=>{const a=g2(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():g2(e[i],null)}}}}function Qe(...e){return b.useCallback(Nx(...e),e)}function jG(e,t){const n=b.createContext(t),r=a=>{const{children:s,...l}=a,c=b.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:s})};r.displayName=e+"Provider";function i(a){const s=b.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Fn(e,t=[]){let n=[];function r(a,s){const l=b.createContext(s),c=n.length;n=[...n,s];const u=f=>{var x;const{scope:h,children:p,...g}=f,m=((x=h==null?void 0:h[e])==null?void 0:x[c])||l,v=b.useMemo(()=>g,Object.values(g));return o.jsx(m.Provider,{value:v,children:p})};u.displayName=a+"Provider";function d(f,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[c])||l,g=b.useContext(p);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const i=()=>{const a=n.map(s=>b.createContext(s));return function(l){const c=(l==null?void 0:l[e])||a;return b.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,SG(i,...t)]}function SG(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function wo(e){const t=NG(e),n=b.forwardRef((r,i)=>{const{children:a,...s}=r,l=b.Children.toArray(a),c=l.find(CG);
vendor: 10,160 bytes, line 68
68if(c){const u=c.props.children,d=l.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return o.jsx(t,{...s,ref:i,children:b.isValidElement(u)?b.cloneElement(u,void 0,d):null})}return o.jsx(t,{...s,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var kG=wo("Slot");function NG(e){const t=b.forwardRef((n,r)=>{const{children:i,...a}=n;if(b.isValidElement(i)){const s=PG(i),l=EG(a,i.props);return i.type!==b.Fragment&&(l.ref=r?Nx(r,s):s),b.cloneElement(i,l)}return b.Children.count(i)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var F3=Symbol("radix.slottable");function B3(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=F3,t}function CG(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===F3}function EG(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...l)=>{const c=a(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function PG(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zp(e){const t=e+"CollectionProvider",[n,r]=Fn(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:x}=m,y=I.useRef(null),w=I.useRef(new Map).current;return o.jsx(i,{scope:v,itemMap:w,collectionRef:y,children:x})};s.displayName=t;const l=e+"CollectionSlot",c=wo(l),u=I.forwardRef((m,v)=>{const{scope:x,children:y}=m,w=a(l,x),S=Qe(v,w.collectionRef);return o.jsx(c,{ref:S,children:y})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=wo(d),p=I.forwardRef((m,v)=>{const{scope:x,children:y,...w}=m,S=I.useRef(null),_=Qe(v,S),j=a(d,x);return I.useEffect(()=>(j.itemMap.set(S,{ref:S,...w}),()=>void j.itemMap.delete(S))),o.jsx(h,{[f]:"",ref:_,children:y})});p.displayName=d;function g(m){const v=a(e+"CollectionConsumer",m);return I.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((j,k)=>w.indexOf(j.ref.current)-w.indexOf(k.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:u,ItemSlot:p},g,r]}var OG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=OG.reduce((e,t)=>{const n=wo(`Primitive.${t}`),r=b.forwardRef((i,a)=>{const{asChild:s,...l}=i,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Xk(e,t){e&&nc.flushSync(()=>e.dispatchEvent(t))}function Ar(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function AG(e,t=globalThis==null?void 0:globalThis.document){const n=Ar(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var TG="DismissableLayer",g_="dismissableLayer.update",RG="dismissableLayer.pointerDownOutside",IG="dismissableLayer.focusOutside",v2,U3=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ic=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=b.useContext(U3),[d,f]=b.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=b.useState({}),g=Qe(t,k=>f(k)),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(v),y=d?m.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=y>=x,_=$G(k=>{const C=k.target,E=[...u.branches].some(A=>A.contains(C));!S||E||(i==null||i(k),s==null||s(k),k.defaultPrevented||l==null||l())},h),j=DG(k=>{const C=k.target;[...u.branches].some(A=>A.contains(C))||(a==null||a(k),s==null||s(k),k.defaultPrevented||l==null||l())},h);return AG(k=>{y===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},h),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(v2=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),y2(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=v2)}},[d,h,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),y2())},[d,u]),b.useEffect(()=>{const k=()=>p({});return document.addEventListener(g_,k),()=>document.removeEventListener(g_,k)},[]),o.jsx(Ce.div,{...c,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,j.onFocusCapture),onBlurCapture:me(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,_.onPointerDownCapture)})});ic.displayName=TG;var MG="DismissableLayerBranch",z3=b.forwardRef((e,t)=>{const n=b.useContext(U3),r=b.useRef(null),i=Qe(t,r);return b.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),o.jsx(Ce.div,{...e,ref:i})});z3.displayName=MG;function $G(e,t=globalThis==null?void 0:globalThis.document){const n=Ar(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let c=function(){W3(RG,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function DG(e,t=globalThis==null?void 0:globalThis.document){const n=Ar(e),r=b.useRef(!1);return b.useEffect(()=>{const i=a=>{a.target&&!r.current&&W3(IG,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function y2(){const e=new CustomEvent(g_);document.dispatchEvent(e)}function W3(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Xk(i,a):i.dispatchEvent(a)}var LG=ic,FG=z3,Pn=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},BG="Portal",Ad=b.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,a]=b.useState(!1);Pn(()=>a(!0),[]);const s=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?m3.createPortal(o.jsx(Ce.div,{...r,ref:t}),s):null});Ad.displayName=BG;function UG(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var pr=e=>{const{present:t,children:n}=e,r=zG(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),a=Qe(r.ref,WG(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:a}):null};pr.displayName="Presence";function zG(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef("none"),s=e?"mounted":"unmounted",[l,c]=UG(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=ag(r.current);a.current=l==="mounted"?u:"none"},[l]),Pn(()=>{const u=r.current,d=i.current;if(d!==e){const h=a.current,p=ag(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Pn(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const m=ag(r.current).includes(p.animationName);if(p.target===t&&m&&(c("ANIMATION_END"),!i.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=p=>{p.target===t&&(a.current=ag(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function ag(e){return(e==null?void 0:e.animationName)||"none"}function WG(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var HG=YS[" useInsertionEffect ".trim().toString()]||Pn;function Tr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,s]=qG({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const d=b.useRef(e!==void 0);b.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const u=b.useCallback(d=>{var f;if(l){const h=VG(d)?d(e):d;h!==e&&((f=s.current)==null||f.call(s,h))}else a(d)},[l,e,a,s]);return[c,u]}function qG({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return HG(()=>{a.current=t},[t]),b.useEffect(()=>{var s;i.current!==n&&((s=a.current)==null||s.call(a,n),i.current=n)},[n,i]),[n,r,a]}function VG(e){return typeof e=="function"}
68var H3=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),GG="VisuallyHidden",Cx=b.forwardRef((e,t)=>o.jsx(Ce.span,{...e,ref:t,style:{...H3,...e.style}}));Cx.displayName=GG;var KG=Cx,Qk="ToastProvider",[Jk,YG,XG]=Zp("Toast"),[q3,PLe]=Fn("Toast",[XG]),[QG,Ex]=q3(Qk),V3=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:a=50,children:s}=e,[l,c]=b.useState(null),[u,d]=b.useState(0),f=b.useRef(!1),h=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Qk}\`. Expected non-empty \`string\`.`),o.jsx(Jk.Provider,{scope:t,children:o.jsx(QG,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:b.useCallback(()=>d(p=>p+1),[]),onToastRemove:b.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:s})})};V3.displayName=Qk;var G3="ToastViewport",JG=["F8"],v_="toast.viewportPause",y_="toast.viewportResume",K3=b.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=JG,label:i="Notifications ({hotkey})",...a}=e,s=Ex(G3,n),l=YG(n),c=b.useRef(null),u=b.useRef(null),d=b.useRef(null),f=b.useRef(null),h=Qe(t,f,s.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=s.toastCount>0;b.useEffect(()=>{const v=x=>{var w;r.length!==0&&r.every(S=>x[S]||x.code===S)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),b.useEffect(()=>{const v=c.current,x=f.current;if(g&&v&&x){const y=()=>{if(!s.isClosePausedRef.current){const j=new CustomEvent(v_);x.dispatchEvent(j),s.isClosePausedRef.current=!0}},w=()=>{if(s.isClosePausedRef.current){const j=new CustomEvent(y_);x.dispatchEvent(j),s.isClosePausedRef.current=!1}},S=j=>{!v.contains(j.relatedTarget)&&w()},_=()=>{v.contains(document.activeElement)||w()};return v.addEventListener("focusin",y),v.addEventListener("focusout",S),v.addEventListener("pointermove",y),v.addEventListener("pointerleave",_),window.addEventListener("blur",y),window.addEventListener("focus",w),()=>{v.removeEventListener("focusin",y),v.removeEventListener("focusout",S),v.removeEventListener("pointermove",y),v.removeEventListener("pointerleave",_),window.removeEventListener("blur",y),window.removeEventListener("focus",w)}}},[g,s.isClosePausedRef]);const m=b.useCallback(({tabbingDirection:v})=>{const y=l().map(w=>{const S=w.ref.current,_=[S,...dK(S)];return v==="forwards"?_:_.reverse()});return(v==="forwards"?y.reverse():y).flat()},[l]);return b.useEffect(()=>{const v=f.current;if(v){const x=y=>{var _,j,k;const w=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!w){const C=document.activeElement,E=y.shiftKey;if(y.target===v&&E){(_=u.current)==null||_.focus();return}const T=m({tabbingDirection:E?"backwards":"forwards"}),B=T.findIndex(F=>F===C);W0(T.slice(B+1))?y.preventDefault():E?(j=u.current)==null||j.focus():(k=d.current)==null||k.focus()}};return v.addEventListener("keydown",x),()=>v.removeEventListener("keydown",x)}},[l,m]),o.jsxs(FG,{ref:c,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&o.jsx(x_,{ref:u,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"forwards"});W0(v)}}),o.jsx(Jk.Slot,{scope:n,children:o.jsx(Ce.ol,{tabIndex:-1,...a,ref:h})}),g&&o.jsx(x_,{ref:d,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"backwards"});W0(v)}})]})});K3.displayName=G3;var Y3="ToastFocusProxy",x_=b.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Ex(Y3,n);return o.jsx(Cx,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const l=s.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});x_.displayName=Y3;var em="Toast",ZG="toast.swipeStart",eK="toast.swipeMove",tK="toast.swipeCancel",nK="toast.swipeEnd",X3=b.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...s}=e,[l,c]=Tr({prop:r,defaultProp:i??!0,onChange:a,caller:em});return o.jsx(pr,{present:n||l,children:o.jsx(aK,{open:l,...s,ref:t,onClose:()=>c(!1),onPause:Ar(e.onPause),onResume:Ar(e.onResume),onSwipeStart:me(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(e.onSwipeMove,u=>{const{x:d,y:f}=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",`${f}px`)}),onSwipeCancel:me(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:me(e.onSwipeEnd,u=>{const{x:d,y:f}=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",`${f}px`),c(!1)})})})});X3.displayName=em;var[rK,iK]=q3(em,{onClose(){}}),aK=b.forwardRef((e,t)=>
68{const{__scopeToast:n,type:r="foreground",duration:i,open:a,onClose:s,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:p,...g}=e,m=Ex(em,n),[v,x]=b.useState(null),y=Qe(t,F=>x(F)),w=b.useRef(null),S=b.useRef(null),_=i||m.duration,j=b.useRef(0),k=b.useRef(_),C=b.useRef(0),{onToastAdd:E,onToastRemove:A}=m,P=Ar(()=>{var M;(v==null?void 0:v.contains(document.activeElement))&&((M=m.viewport)==null||M.focus()),s()}),T=b.useCallback(F=>{!F||F===1/0||(window.clearTimeout(C.current),j.current=new Date().getTime(),C.current=window.setTimeout(P,F))},[P]);b.useEffect(()=>{const F=m.viewport;if(F){const M=()=>{T(k.current),u==null||u()},L=()=>{const R=new Date().getTime()-j.current;k.current=k.current-R,window.clearTimeout(C.current),c==null||c()};return F.addEventListener(v_,L),F.addEventListener(y_,M),()=>{F.removeEventListener(v_,L),F.removeEventListener(y_,M)}}},[m.viewport,_,c,u,T]),b.useEffect(()=>{a&&!m.isClosePausedRef.current&&T(_)},[a,_,m.isClosePausedRef,T]),b.useEffect(()=>(E(),()=>A()),[E,A]);const B=b.useMemo(()=>v?r5(v):null,[v]);return m.viewport?o.jsxs(o.Fragment,{children:[B&&o.jsx(sK,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:B}),o.jsx(rK,{scope:n,onClose:P,children:nc.createPortal(o.jsx(Jk.ItemSlot,{scope:n,children:o.jsx(LG,{asChild:!0,onEscapeKeyDown:me(l,()=>{m.isFocusedToastEscapeKeyDownRef.current||P(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Ce.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":m.swipeDirection,...g,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:me(e.onKeyDown,F=>{F.key==="Escape"&&(l==null||l(F.nativeEvent),F.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:me(e.onPointerDown,F=>{F.button===0&&(w.current={x:F.clientX,y:F.clientY})}),onPointerMove:me(e.onPointerMove,F=>{if(!w.current)return;const M=F.clientX-w.current.x,L=F.clientY-w.current.y,R=!!S.current,$=["left","right"].includes(m.swipeDirection),O=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,N=$?O(0,M):0,H=$?0:O(0,L),V=F.pointerType==="touch"?10:2,D={x:N,y:H},K={originalEvent:F,delta:D};R?(S.current=D,sg(eK,f,K,{discrete:!1})):x2(D,m.swipeDirection,V)?(S.current=D,sg(ZG,d,K,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(M)>V||Math.abs(L)>V)&&(w.current=null)}),onPointerUp:me(e.onPointerUp,F=>{const M=S.current,L=F.target;if(L.hasPointerCapture(F.pointerId)&&L.releasePointerCapture(F.pointerId),S.current=null,w.current=null,M){const R=F.currentTarget,$={originalEvent:F,delta:M};x2(M,m.swipeDirection,m.swipeThreshold)?sg(nK,p,$,{discrete:!0}):sg(tK,h,$,{discrete:!0}),R.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),sK=e=>{const{__scopeToast:t,children:n,...r}=e,i=Ex(em,t),[a,s]=b.useState(!1),[l,c]=b.useState(!1);return cK(()=>s(!0)),b.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:o.jsx(Ad,{asChild:!0,children:o.jsx(Cx,{...r,children:a&&o.jsxs(o.Fragment,{children:[i.label," ",n]})})})},oK="ToastTitle",Q3=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Ce.div,{...r,ref:t})});Q3.displayName=oK;var lK="ToastDescription",J3=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Ce.div,{...r,ref:t})});J3.displayName=lK;var Z3="ToastAction",e5=b.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?o.jsx(n5,{altText:n,asChild:!0,children:o.jsx(Zk,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Z3}\`. Expected non-empty \`string\`.`),null)});e5.displayName=Z3;var t5="ToastClose",Zk=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=iK(t5,n);return o.jsx(n5,{asChild:!0,children:o.jsx(Ce.button,{type:"button",...r,ref:t,onClick:me(e.onClick,i.onClose)})})});Zk.displayName=t5;var n5=b.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return o.jsx(Ce.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function r5(e){const t=[];
vendor: 7,929 bytes, lines 68-138
68return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),uK(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!i)if(a){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...r5(r))}}),t}function sg(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Xk(i,a):i.dispatchEvent(a)}var x2=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t==="left"||t==="right"?a&&r>n:!a&&i>n};function cK(e=()=>{}){const t=Ar(e);Pn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function uK(e){return e.nodeType===e.ELEMENT_NODE}function dK(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function W0(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var fK=V3,i5=K3,a5=X3,s5=Q3,o5=J3,l5=e5,c5=Zk;function u5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=u5(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function He(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=u5(e))&&(r&&(r+=" "),r+=t);return r}const b2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,w2=He,Td=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return w2(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],f=a==null?void 0:a[u];if(d===null)return null;const h=b2(d)||b2(f);return i[u][h]}),l=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(g=>{let[m,v]=g;return Array.isArray(v)?v.includes({...a,...l}[m]):{...a,...l}[m]===v})?[...u,f,h]:u},[]);return w2(e,s,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
69 * @license lucide-react v0.462.0 - ISC
70 *
71 * This source code is licensed under the ISC license.
72 * See the LICENSE file in the root directory of this source tree.
73 */const hK=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
74 * @license lucide-react v0.462.0 - ISC
75 *
76 * This source code is licensed under the ISC license.
77 * See the LICENSE file in the root directory of this source tree.
78 */var pK={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"};/**
79 * @license lucide-react v0.462.0 - ISC
80 *
81 * This source code is licensed under the ISC license.
82 * See the LICENSE file in the root directory of this source tree.
83 */const mK=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...l},c)=>b.createElement("svg",{ref:c,...pK,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:d5("lucide",i),...l},[...s.map(([u,d])=>b.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
84 * @license lucide-react v0.462.0 - ISC
85 *
86 * This source code is licensed under the ISC license.
87 * See the LICENSE file in the root directory of this source tree.
88 */const oe=(e,t)=>{const n=b.forwardRef(({className:r,...i},a)=>b.createElement(mK,{ref:a,iconNode:t,className:d5(`lucide-${hK(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
89 * @license lucide-react v0.462.0 - ISC
90 *
91 * This source code is licensed under the ISC license.
92 * See the LICENSE file in the root directory of this source tree.
93 */const gK=oe("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
94 * @license lucide-react v0.462.0 - ISC
95 *
96 * This source code is licensed under the ISC license.
97 * See the LICENSE file in the root directory of this source tree.
98 */const f5=oe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
99 * @license lucide-react v0.462.0 - ISC
100 *
101 * This source code is licensed under the ISC license.
102 * See the LICENSE file in the root directory of this source tree.
103 */const vK=oe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
104 * @license lucide-react v0.462.0 - ISC
105 *
106 * This source code is licensed under the ISC license.
107 * See the LICENSE file in the root directory of this source tree.
108 */const yK=oe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
109 * @license lucide-react v0.462.0 - ISC
110 *
111 * This source code is licensed under the ISC license.
112 * See the LICENSE file in the root directory of this source tree.
113 */const xK=oe("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
114 * @license lucide-react v0.462.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const h5=oe("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"}]]);/**
119 * @license lucide-react v0.462.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */const bK=oe("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"}]]);/**
124 * @license lucide-react v0.462.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const _2=oe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
129 * @license lucide-react v0.462.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const wK=oe("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"}]]);/**
134 * @license lucide-react v0.462.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const Jr=oe("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"}
138],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
139 * @license lucide-react v0.462.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const _K=oe("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
144 * @license lucide-react v0.462.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const b_=oe("CalendarDays",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
149 * @license lucide-react v0.462.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const ch=oe("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"}]]);/**
154 * @license lucide-react v0.462.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const Px=oe("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"}]]);/**
159 * @license lucide-react v0.462.0 - ISC
160 *
161 * This source code is licensed under the ISC license.
162 * See the LICENSE file in the root directory of this source tree.
163 */const To=oe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
164 * @license lucide-react v0.462.0 - ISC
165 *
166 * This source code is licensed under the ISC license.
167 * See the LICENSE file in the root directory of this source tree.
168 */const Rd=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
169 * @license lucide-react v0.462.0 - ISC
170 *
171 * This source code is licensed under the ISC license.
172 * See the LICENSE file in the root directory of this source tree.
173 */const p5=oe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
174 * @license lucide-react v0.462.0 - ISC
175 *
176 * This source code is licensed under the ISC license.
177 * See the LICENSE file in the root directory of this source tree.
178 */const Ox=oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
179 * @license lucide-react v0.462.0 - ISC
180 *
181 * This source code is licensed under the ISC license.
182 * See the LICENSE file in the root directory of this source tree.
183 */const eN=oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
184 * @license lucide-react v0.462.0 - ISC
185 *
186 * This source code is licensed under the ISC license.
187 * See the LICENSE file in the root directory of this source tree.
188 */const Lv=oe("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"}]]);/**
189 * @license lucide-react v0.462.0 - ISC
190 *
191 * This source code is licensed under the ISC license.
192 * See the LICENSE file in the root directory of this source tree.
193 */const j2=oe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
194 * @license lucide-react v0.462.0 - ISC
195 *
196 * This source code is licensed under the ISC license.
197 * See the LICENSE file in the root directory of this source tree.
198 */const ar=oe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
199 * @license lucide-react v0.462.0 - ISC
200 *
201 * This source code is licensed under the ISC license.
202 * See the LICENSE file in the root directory of this source tree.
203 */const S2=oe("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"}]]);/**
204 * @license lucide-react v0.462.0 - ISC
205 *
206 * This source code is licensed under the ISC license.
207 * See the LICENSE file in the root directory of this source tree.
208 */const jK=oe("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"}]]);/**
209 * @license lucide-react v0.462.0 - ISC
210 *
211 * This source code is licensed under the ISC license.
212 * See the LICENSE file in the root directory of this source tree.
213 */const m5=oe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
214 * @license lucide-react v0.462.0 - ISC
215 *
216 * This source code is licensed under the ISC license.
217 * See the LICENSE file in the root directory of this source tree.
218 */const pf=oe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
219 * @license lucide-react v0.462.0 - ISC
220 *
221 * This source code is licensed under the ISC license.
222 * See the LICENSE file in the root directory of this source tree.
223 */const k2=oe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
224 * @license lucide-react v0.462.0 - ISC
225 *
226 * This source code is licensed under the ISC license.
227 * See the LICENSE file in the root directory of this source tree.
228 */const SK=oe("Contact",[["path",{d:"M16 2v2",key:"scm5qe"}],["path",{d:"M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2",key:"1waht3"}],["path",{d:"M8 2v2",key:"pbkmx"}
228],["circle",{cx:"12",cy:"11",r:"3",key:"itu57m"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]]);/**
229 * @license lucide-react v0.462.0 - ISC
230 *
231 * This source code is licensed under the ISC license.
232 * See the LICENSE file in the root directory of this source tree.
233 */const Vh=oe("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"}]]);/**
234 * @license lucide-react v0.462.0 - ISC
235 *
236 * This source code is licensed under the ISC license.
237 * See the LICENSE file in the root directory of this source tree.
238 */const kK=oe("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/**
239 * @license lucide-react v0.462.0 - ISC
240 *
241 * This source code is licensed under the ISC license.
242 * See the LICENSE file in the root directory of this source tree.
243 */const Fv=oe("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"}]]);/**
244 * @license lucide-react v0.462.0 - ISC
245 *
246 * This source code is licensed under the ISC license.
247 * See the LICENSE file in the root directory of this source tree.
248 */const NK=oe("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
249 * @license lucide-react v0.462.0 - ISC
250 *
251 * This source code is licensed under the ISC license.
252 * See the LICENSE file in the root directory of this source tree.
253 */const CK=oe("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
254 * @license lucide-react v0.462.0 - ISC
255 *
256 * This source code is licensed under the ISC license.
257 * See the LICENSE file in the root directory of this source tree.
258 */const sr=oe("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"}]]);/**
259 * @license lucide-react v0.462.0 - ISC
260 *
261 * This source code is licensed under the ISC license.
262 * See the LICENSE file in the root directory of this source tree.
263 */const EK=oe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
264 * @license lucide-react v0.462.0 - ISC
265 *
266 * This source code is licensed under the ISC license.
267 * See the LICENSE file in the root directory of this source tree.
268 */const uh=oe("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"}]]);/**
269 * @license lucide-react v0.462.0 - ISC
270 *
271 * This source code is licensed under the ISC license.
272 * See the LICENSE file in the root directory of this source tree.
273 */const g5=oe("Frown",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 16s-1.5-2-4-2-4 2-4 2",key:"epbg0q"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
274 * @license lucide-react v0.462.0 - ISC
275 *
276 * This source code is licensed under the ISC license.
277 * See the LICENSE file in the root directory of this source tree.
278 */const PK=oe("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/**
279 * @license lucide-react v0.462.0 - ISC
280 *
281 * This source code is licensed under the ISC license.
282 * See the LICENSE file in the root directory of this source tree.
283 */const Gh=oe("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"}]]);/**
284 * @license lucide-react v0.462.0 - ISC
285 *
286 * This source code is licensed under the ISC license.
287 * See the LICENSE file in the root directory of this source tree.
288 */const OK=oe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
289 * @license lucide-react v0.462.0 - ISC
290 *
291 * This source code is licensed under the ISC license.
292 * See the LICENSE file in the root directory of this source tree.
293 */const v5=oe("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"}]]);/**
294 * @license lucide-react v0.462.0 - ISC
295 *
296 * This source code is licensed under the ISC license.
297 * See the LICENSE file in the root directory of this source tree.
298 */const AK=oe("History",[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
299 * @license lucide-react v0.462.0 - ISC
300 *
301 * This source code is licensed under the ISC license.
302 * See the LICENSE file in the root directory of this source tree.
303 */const N2=oe("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"}]]);/**
304 * @license lucide-react v0.462.0 - ISC
305 *
306 * This source code is licensed under the ISC license.
307 * See the LICENSE file in the root directory of this source tree.
308 */const TK=oe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
309 * @license lucide-react v0.462.0 - ISC
310 *
311 * This source code is licensed under the ISC license.
312 * See the LICENSE file in the root directory of this source tree.
313 */const y5=oe("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
314 * @license lucide-react v0.462.0 - ISC
315 *
316 * This source code is licensed under the ISC license.
317 * See the LICENSE file in the root directory of this source tree.
318 */const tN=oe("LayoutList",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]]);/**
319 * @license lucide-react v0.462.0 - ISC
320 *
321 * This source code is licensed under the ISC license.
322 * See the LICENSE file in the root directory of this source tree.
323 */const C2=oe("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"}]]);/**
324 * @license lucide-react v0.462.0 - ISC
325 *
326 * This source code is licensed under the ISC license.
327 * See the LICENSE file in the root directory of this source tree.
328 */const w_=oe("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
329 * @license lucide-react v0.462.0 - ISC
330 *
331 * This source code is licensed under the ISC license.
332 * See the LICENSE file in the root directory of this source tree.
333 */const x5=oe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
334 * @license lucide-react v0.462.0 - ISC
335 *
336 * This source code is licensed under the ISC license.
337 * See the LICENSE file in the root directory of this source tree.
338 */const ke=oe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
339 * @license lucide-react v0.462.0 - ISC
340 *
341 * This source code is licensed under the ISC license.
342 * See the LICENSE file in the root directory of this source tree.
343 */const Fu=oe("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"}]]);/**
344 * @license lucide-react v0.462.0 - ISC
345 *
346 * This source code is licensed under the ISC license.
347 * See the LICENSE file in the root directory of this source tree.
348 */const RK=oe("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"}]]);/**
349 * @license lucide-react v0.462.0 - ISC
350 *
351 * This source code is licensed under the ISC license.
352 * See the LICENSE file in the root directory of this source tree.
353 */const H0=oe("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"}]]);/**
354 * @license lucide-react v0.462.0 - ISC
355 *
356 * This source code is licensed under the ISC license.
357 * See the LICENSE file in the root directory of this source tree.
358 */const E2=oe("MailOpen",[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]]);/**
359 * @license lucide-react v0.462.0 - ISC
360 *
361 * This source code is licensed under the ISC license.
362 * See the LICENSE file in the root directory of this source tree.
363 */const as=oe("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"}]]);/**
364 * @license lucide-react v0.462.0 - ISC
365 *
366 * This source code is licensed under the ISC license.
367 * See the LICENSE file in the root directory of this source tree.
368 */const Id=oe("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"}]]);/**
369 * @license lucide-react v0.462.0 - ISC
370 *
371 * This source code is licensed under the ISC license.
372 * See the LICENSE file in the root directory of this source tree.
373 */const IK=oe("Meh",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"8",x2:"16",y1:"15",y2:"15",key:"1xb1d9"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/**
374 * @license lucide-react v0.462.0 - ISC
375 *
376 * This source code is licensed under the ISC license.
377 * See the LICENSE file in the root directory of this source tree.
378 */const MK=oe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
379 * @license lucide-react v0.462.0 - ISC
380 *
381 * This source code is licensed under the ISC license.
382 * See the LICENSE file in the root directory of this source tree.
383 */const P2=oe("MessageSquareQuote",[["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"}],["path",{d:"M8 12a2 2 0 0 0 2-2V8H8",key:"1jfesj"}],["path",{d:"M14 12a2 2 0 0 0 2-2V8h-2",key:"1dq9mh"}]]);/**
384 * @license lucide-react v0.462.0 - ISC
385 *
386 * This source code is licensed under the ISC license.
387 * See the LICENSE file in the root directory of this source tree.
388 */const $K=oe("MessageSquareReply",[["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"}],["path",{d:"m10 7-3 3 3 3",key:"1eugdv"}],["path",{d:"M17 13v-1a2 2 0 0 0-2-2H7",key:"ernfh3"}]]);/**
389 * @license lucide-react v0.462.0 - ISC
390 *
391 * This source code is licensed under the ISC license.
392 * See the LICENSE file in the root directory of this source tree.
393 */const b5=oe("MessageSquareText",[["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"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
394 * @license lucide-react v0.462.0 - ISC
395 *
396 * This source code is licensed under the ISC license.
397 * See the LICENSE file in the root directory of this source tree.
398 */const Bu=oe("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"}]]);/**
399 * @license lucide-react v0.462.0 - ISC
400 *
401 * This source code is licensed under the ISC license.
402 * See the LICENSE file in the root directory of this source tree.
403 */const nN=oe("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
404 * @license lucide-react v0.462.0 - ISC
405 *
406 * This source code is licensed under the ISC license.
407 * See the LICENSE file in the root directory of this source tree.
408 */const DK=oe("MousePointerClick",[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.
408074z",key:"s0h3yz"}]]);/**
409 * @license lucide-react v0.462.0 - ISC
410 *
411 * This source code is licensed under the ISC license.
412 * See the LICENSE file in the root directory of this source tree.
413 */const LK=oe("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
414 * @license lucide-react v0.462.0 - ISC
415 *
416 * This source code is licensed under the ISC license.
417 * See the LICENSE file in the root directory of this source tree.
418 */const w5=oe("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
419 * @license lucide-react v0.462.0 - ISC
420 *
421 * This source code is licensed under the ISC license.
422 * See the LICENSE file in the root directory of this source tree.
423 */const O2=oe("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);/**
424 * @license lucide-react v0.462.0 - ISC
425 *
426 * This source code is licensed under the ISC license.
427 * See the LICENSE file in the root directory of this source tree.
428 */const rN=oe("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"}]]);/**
429 * @license lucide-react v0.462.0 - ISC
430 *
431 * This source code is licensed under the ISC license.
432 * See the LICENSE file in the root directory of this source tree.
433 */const _5=oe("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"}]]);/**
434 * @license lucide-react v0.462.0 - ISC
435 *
436 * This source code is licensed under the ISC license.
437 * See the LICENSE file in the root directory of this source tree.
438 */const _o=oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
439 * @license lucide-react v0.462.0 - ISC
440 *
441 * This source code is licensed under the ISC license.
442 * See the LICENSE file in the root directory of this source tree.
443 */const FK=oe("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
444 * @license lucide-react v0.462.0 - ISC
445 *
446 * This source code is licensed under the ISC license.
447 * See the LICENSE file in the root directory of this source tree.
448 */const BK=oe("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
449 * @license lucide-react v0.462.0 - ISC
450 *
451 * This source code is licensed under the ISC license.
452 * See the LICENSE file in the root directory of this source tree.
453 */const UK=oe("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"}]]);/**
454 * @license lucide-react v0.462.0 - ISC
455 *
456 * This source code is licensed under the ISC license.
457 * See the LICENSE file in the root directory of this source tree.
458 */const zi=oe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
459 * @license lucide-react v0.462.0 - ISC
460 *
461 * This source code is licensed under the ISC license.
462 * See the LICENSE file in the root directory of this source tree.
463 */const A2=oe("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}
463],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
464 * @license lucide-react v0.462.0 - ISC
465 *
466 * This source code is licensed under the ISC license.
467 * See the LICENSE file in the root directory of this source tree.
468 */const zK=oe("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"}]]);/**
469 * @license lucide-react v0.462.0 - ISC
470 *
471 * This source code is licensed under the ISC license.
472 * See the LICENSE file in the root directory of this source tree.
473 */const Uu=oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
474 * @license lucide-react v0.462.0 - ISC
475 *
476 * This source code is licensed under the ISC license.
477 * See the LICENSE file in the root directory of this source tree.
478 */const ac=oe("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"}]]);/**
479 * @license lucide-react v0.462.0 - ISC
480 *
481 * This source code is licensed under the ISC license.
482 * See the LICENSE file in the root directory of this source tree.
483 */const WK=oe("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"}]]);/**
484 * @license lucide-react v0.462.0 - ISC
485 *
486 * This source code is licensed under the ISC license.
487 * See the LICENSE file in the root directory of this source tree.
488 */const HK=oe("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"}]]);/**
489 * @license lucide-react v0.462.0 - ISC
490 *
491 * This source code is licensed under the ISC license.
492 * See the LICENSE file in the root directory of this source tree.
493 */const qK=oe("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"}]]);/**
494 * @license lucide-react v0.462.0 - ISC
495 *
496 * This source code is licensed under the ISC license.
497 * See the LICENSE file in the root directory of this source tree.
498 */const j5=oe("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"}]]);/**
499 * @license lucide-react v0.462.0 - ISC
500 *
501 * This source code is licensed under the ISC license.
502 * See the LICENSE file in the root directory of this source tree.
503 */const VK=oe("SmilePlus",[["path",{d:"M22 11v1a10 10 0 1 1-9-10",key:"ew0xw9"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}]]);/**
504 * @license lucide-react v0.462.0 - ISC
505 *
506 * This source code is licensed under the ISC license.
507 * See the LICENSE file in the root directory of this source tree.
508 */const bn=oe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
509 * @license lucide-react v0.462.0 - ISC
510 *
511 * This source code is licensed under the ISC license.
512 * See the LICENSE file in the root directory of this source tree.
513 */const pi=oe("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"}]]);/**
514 * @license lucide-react v0.462.0 - ISC
515 *
516 * This source code is licensed under the ISC license.
517 * See the LICENSE file in the root directory of this source tree.
518 */const iN=oe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
519 * @license lucide-react v0.462.0 - ISC
520 *
521 * This source code is licensed under the ISC license.
522 * See the LICENSE file in the root directory of this source tree.
523 */const S5=oe("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
524 * @license lucide-react v0.462.0 - ISC
525 *
526 * This source code is licensed under the ISC license.
527 * See the LICENSE file in the root directory of this source tree.
528 */const aN=oe("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
529 * @license lucide-react v0.462.0 - ISC
530 *
531 * This source code is licensed under the ISC license.
532 * See the LICENSE file in the root directory of this source tree.
533 */const Md=oe("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"}]]);/**
534 * @license lucide-react v0.462.0 - ISC
535 *
536 * This source code is licensed under the ISC license.
537 * See the LICENSE file in the root directory of this source tree.
538 */const k5=oe("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"}]]);/**
539 * @license lucide-react v0.462.0 - ISC
540 *
541 * This source code is licensed under the ISC license.
542 * See the LICENSE file in the root directory of this source tree.
543 */const N5=oe("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"}]]);/**
544 * @license lucide-react v0.462.0 - ISC
545 *
546 * This source code is licensed under the ISC license.
547 * See the LICENSE file in the root directory of this source tree.
548 */const C5=oe("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"}]]);/**
549 * @license lucide-react v0.462.0 - ISC
550 *
551 * This source code is licensed under the ISC license.
552 * See the LICENSE file in the root directory of this source tree.
553 */const GK=oe("Unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
554 * @license lucide-react v0.462.0 - ISC
555 *
556 * This source code is licensed under the ISC license.
557 * See the LICENSE file in the root directory of this source tree.
558 */const E5=oe("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"}]]);/**
559 * @license lucide-react v0.462.0 - ISC
560 *
561 * This source code is licensed under the ISC license.
562 * See the LICENSE file in the root directory of this source tree.
563 */const KK=oe("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"}]]);/**
564 * @license lucide-react v0.462.0 - ISC
565 *
566 * This source code is licensed under the ISC license.
567 * See the LICENSE file in the root directory of this source tree.
568 */const YK=oe("UserX",[["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:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
569 * @license lucide-react v0.462.0 - ISC
570 *
571 * This source code is licensed under the ISC license.
572 * See the LICENSE file in the root directory of this source tree.
573 */const Wl=oe("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"}]]);/**
574 * @license lucide-react v0.462.0 - ISC
575 *
576 * This source code is licensed under the ISC license.
577 * See the LICENSE file in the root directory of this source tree.
578 */const Ax=oe("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"}]]);/**
579 * @license lucide-react v0.462.0 - ISC
580 *
581 * This source code is licensed under the ISC license.
582 * See the LICENSE file in the root directory of this source tree.
583 */const Ro=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 12,256 bytes, line 583
583],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),sN="-",XK=e=>{const t=JK(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const l=s.split(sN);return l[0]===""&&l.length!==1&&l.shift(),P5(l,t)||QK(s)},getConflictingClassGroupIds:(s,l)=>{const c=n[s]||[];return l&&r[s]?[...c,...r[s]]:c}}},P5=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?P5(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(sN);return(s=t.validators.find(({validator:l})=>l(a)))==null?void 0:s.classGroupId},T2=/^\[(.+)\]$/,QK=e=>{if(T2.test(e)){const t=T2.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},JK=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return eY(Object.entries(e.classGroups),n).forEach(([a,s])=>{__(s,r,a,t)}),r},__=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:R2(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(ZK(i)){__(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,s])=>{__(s,R2(t,a),n,r)})})},R2=(e,t)=>{let n=e;return t.split(sN).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},ZK=e=>e.isThemeGetter,eY=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,l])=>[t+s,l])):a);return[n,i]}):e,tY=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,s)=>{n.set(a,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let s=n.get(a);if(s!==void 0)return s;if((s=r.get(a))!==void 0)return i(a,s),s},set(a,s){n.has(a)?n.set(a,s):i(a,s)}}},O5="!",nY=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,s=l=>{const c=[];let u=0,d=0,f;for(let v=0;v<l.length;v++){let x=l[v];if(u===0){if(x===i&&(r||l.slice(v,v+a)===t)){c.push(l.slice(d,v)),d=v+a;continue}if(x==="/"){f=v;continue}}x==="["?u++:x==="]"&&u--}const h=c.length===0?l:l.substring(d),p=h.startsWith(O5),g=p?h.substring(1):h,m=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return n?l=>n({className:l,parseClassName:s}):s},rY=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},iY=e=>({cache:tY(e.cacheSize),parseClassName:nY(e),...XK(e)}),aY=/\s+/,sY=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],s=e.trim().split(aY);let l="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(u);let g=!!p,m=r(g?h.substring(0,p):h);if(!m){if(!g){l=u+(l.length>0?" "+l:l);continue}if(m=r(h),!m){l=u+(l.length>0?" "+l:l);continue}g=!1}const v=rY(d).join(":"),x=f?v+O5:v,y=x+m;if(a.includes(y))continue;a.push(y);const w=i(m,g);for(let S=0;S<w.length;++S){const _=w[S];a.push(x+_)}l=u+(l.length>0?" "+l:l)}return l};function oY(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=A5(t))&&(r&&(r+=" "),r+=n);return r}const A5=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=A5(e[r]))&&(n&&(n+=" "),n+=t);return n};function lY(e,...t){let n,r,i,a=s;function s(c){const u=t.reduce((d,f)=>f(d),e());return n=iY(u),r=n.cache.get,i=n.cache.set,a=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=sY(c,n);return i(c,d),d}return function(){return a(oY.apply(null,arguments))}}const Dt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},T5=/^\[(?:([a-z-]+):)?(.+)\]$/i,cY=/^\d+\/\d+$/,uY=new Set(["px","full","screen"]),dY=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fY=/\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$/,hY=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pY=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mY=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ia=e=>cu(e)||uY.has(e)||cY.test(e),Ss=e=>$d(e,"length",jY),cu=e=>!!e&&!Number.isNaN(Number(e)),q0=e=>$d(e,"number",cu),mf=e=>!!e&&Number.isInteger(Number(e)),gY=e=>e.endsWith("%")&&cu(e.slice(0,-1)),Ye=e=>T5.test(e),ks=e=>dY.test(e),vY=new Set(["length","size","percentage"]),yY=e=>$d(e,vY,R5),xY=e=>$d(e,"position",R5),bY=new Set(["image","url"]),wY=e=>$d(e,bY,kY),_Y=e=>$d(e,"",SY),gf=()=>!0,$d=(e,t,n)=>{const r=T5.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},jY=e=>fY.test(e)&&!hY.test(e),R5=()=>!1,SY=e=>pY.test(e),kY=e=>mY.test(e),NY=()=>{const e=Dt("colors"),t=Dt("spacing"),n=Dt("blur"),r=Dt("brightness"),i=Dt("borderColor"),a=Dt("borderRadius"),s=Dt("borderSpacing"),l=Dt("borderWidth"),c=Dt("contrast"),u=Dt("grayscale"),d=Dt("hueRotate"),f=Dt("invert"),h=Dt("gap"),p=Dt("gradientColorStops"),g=Dt("gradientColorStopPositions"),m=Dt("inset"),v=Dt("margin"),x=Dt("opacity"),y=Dt("padding"),w=Dt("saturate"),S=Dt("scale"),_=Dt("sepia"),j=Dt("skew"),k=Dt("space"),C=Dt("translate"),E=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",Ye,t],T=()=>[Ye,t],B=()=>["",Ia,Ss],F=()=>["auto",cu,Ye],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",Ye],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[cu,Ye];return{cacheSize:500,separator:":",theme:{colors:[gf],spacing:[Ia,Ss],blur:["none","",ks,Ye],brightness:H(),borderColor:[e],borderRadius:["none","","full",ks,Ye],borderSpacing:T(),borderWidth:B(),contrast:H(),grayscale:O(),hueRotate:H(),invert:O(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[gY,Ss],inset:P(),margin:P(),opacity:H(),padding:T(),saturate:H(),scale:H(),sepia:O(),skew:H(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",Ye]}],container:["container"],columns:[{columns:[ks]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:[...M(),Ye]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mf,Ye]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ye]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",mf,Ye]}],"grid-cols":[{"grid-cols":[gf]}],"col-start-end":[{col:["auto",{span:["full",mf,Ye]},Ye]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[gf]}],"row-start-end":[{row:["auto",{span:[mf,Ye]},Ye]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ye]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ye]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"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",Ye,t]}],"min-w":[{"min-w":[Ye,t,"min","max","fit"]}],"max-w":[{"max-w":[Ye,t,"none","full","min","max","fit","prose",{screen:[ks]},ks]}],h:[{h:[Ye,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ye,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ye,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ks,Ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",q0]}],"font-family":[{font:[gf]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ye]}],"line-clamp":[{"line-clamp":["none",cu,q0]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ia,Ye]}],"list-image":[{"list-image":["none",Ye]}],"list-style-type":[{list:["none","disc","decimal",Ye]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ia,Ss]}],"underline-offset":[{"underline-offset":["auto",Ia,Ye]}],"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:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye]}],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",Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),xY]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",yY]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wY]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}
vendor: 5,180 bytes, line 583
583],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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":[x]}],"border-style":[{border:[...L(),"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":[x]}],"divide-style":[{divide:L()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[Ia,Ye]}],"outline-w":[{outline:[Ia,Ss]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Ia,Ss]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ks,_Y]}],"shadow-color":[{shadow:[gf]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...R(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":R()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ks,Ye]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[_]}],"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":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ye]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Ye]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ye]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[mf,Ye]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[j]}],"skew-y":[{"skew-y":[j]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ye]}],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",Ye]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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,647 bytes, line 583
583],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",Ye]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ia,Ss,q0]}],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-s","border-color-e","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"]}}},CY=lY(NY);function he(...e){return CY(He(e))}const EY=fK,I5=b.forwardRef(({className:e,...t},n)=>o.jsx(i5,{ref:n,className:he("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}));I5.displayName=i5.displayName;const PY=Td("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"}}),M5=b.forwardRef(({className:e,variant:t,...n},r)=>o.jsx(a5,{ref:r,className:he(PY({variant:t}),e),...n}));M5.displayName=a5.displayName;const OY=b.forwardRef(({className:e,...t},n)=>o.jsx(l5,{ref:n,className:he("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 group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));OY.displayName=l5.displayName;const $5=b.forwardRef(({className:e,...t},n)=>o.jsx(c5,{ref:n,className:he("absolute right-2 top-2 rounded-md p-1 text-foreground
583/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Ro,{className:"h-4 w-4"})}));$5.displayName=c5.displayName;const D5=b.forwardRef(({className:e,...t},n)=>o.jsx(s5,{ref:n,className:he("text-sm font-semibold",e),...t}));D5.displayName=s5.displayName;const L5=b.forwardRef(({className:e,...t},n)=>o.jsx(o5,{ref:n,className:he("text-sm opacity-90",e),...t}));L5.displayName=o5.displayName;function AY(){const{toasts:e}=Yk();return o.jsxs(EY,{children:[e.map(function({id:t,title:n,description:r,action:i,...a}){return o.jsxs(M5,{...a,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(D5,{children:n}),r&&o.jsx(L5,{children:r})]}),i,o.jsx($5,{})]},t)}),o.jsx(I5,{})]})}var TY=YS[" useId ".trim().toString()]||(()=>{}),RY=0;function Pr(e){const[t,n]=b.useState(TY());return Pn(()=>{n(r=>r??String(RY++))},[e]),t?`radix-${t}`:""}const IY=["top","right","bottom","left"],jo=Math.min,Wr=Math.max,Bv=Math.round,og=Math.floor,ja=e=>({x:e,y:e}
vendor: 11,913 bytes, line 583
583),MY={left:"right",right:"left",bottom:"top",top:"bottom"},$Y={start:"end",end:"start"};function j_(e,t,n){return Wr(e,jo(t,n))}function ss(e,t){return typeof e=="function"?e(t):e}function os(e){return e.split("-")[0]}function Dd(e){return e.split("-")[1]}function oN(e){return e==="x"?"y":"x"}function lN(e){return e==="y"?"height":"width"}const DY=new Set(["top","bottom"]);function ga(e){return DY.has(os(e))?"y":"x"}function cN(e){return oN(ga(e))}function LY(e,t,n){n===void 0&&(n=!1);const r=Dd(e),i=cN(e),a=lN(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Uv(s)),[s,Uv(s)]}function FY(e){const t=Uv(e);return[S_(e),t,S_(t)]}function S_(e){return e.replace(/start|end/g,t=>$Y[t])}const I2=["left","right"],M2=["right","left"],BY=["top","bottom"],UY=["bottom","top"];function zY(e,t,n){switch(e){case"top":case"bottom":return n?t?M2:I2:t?I2:M2;case"left":case"right":return t?BY:UY;default:return[]}}function WY(e,t,n,r){const i=Dd(e);let a=zY(os(e),n==="start",r);return i&&(a=a.map(s=>s+"-"+i),t&&(a=a.concat(a.map(S_)))),a}function Uv(e){return e.replace(/left|right|bottom|top/g,t=>MY[t])}function HY(e){return{top:0,right:0,bottom:0,left:0,...e}}function F5(e){return typeof e!="number"?HY(e):{top:e,right:e,bottom:e,left:e}}function zv(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function $2(e,t,n){let{reference:r,floating:i}=e;const a=ga(t),s=cN(t),l=lN(s),c=os(t),u=a==="y",d=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(c){case"top":p={x:d,y:r.y-i.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Dd(t)){case"start":p[s]-=h*(n&&u?-1:1);break;case"end":p[s]+=h*(n&&u?-1:1);break}return p}const qY=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:s}=n,l=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=$2(u,r,c),h=r,p={},g=0;for(let m=0;m<l.length;m++){const{name:v,fn:x}=l[m],{x:y,y:w,data:S,reset:_}=await x({x:d,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:u,platform:s,elements:{reference:e,floating:t}});d=y??d,f=w??f,p={...p,[v]:{...p[v],...S}},_&&g<=50&&(g++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(u=_.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x:d,y:f}=$2(u,h,c)),m=-1)}return{x:d,y:f,placement:h,strategy:i,middlewareData:p}};async function Kh(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:s,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=ss(t,e),g=F5(p),v=l[h?f==="floating"?"reference":"floating":f],x=zv(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),y=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),S=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},_=zv(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:c}):y);return{top:(x.top-_.top+g.top)/S.y,bottom:(_.bottom-x.bottom+g.bottom)/S.y,left:(x.left-_.left+g.left)/S.x,right:(_.right-x.right+g.right)/S.x}}const VY=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:s,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=ss(e,t)||{};if(u==null)return{};const f=F5(d),h={x:n,y:r},p=cN(i),g=lN(p),m=await s.getDimensions(u),v=p==="y",x=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",S=a.reference[g]+a.reference[p]-h[p]-a.floating[g],_=h[p]-a.reference[p],j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let k=j?j[w]:0;(!k||!await(s.isElement==null?void 0:s.isElement(j)))&&(k=l.floating[w]||a.floating[g]);const C=S/2-_/2,E=k/2-m[g]/2-1,A=jo(f[x],E),P=jo(f[y],E),T=A,B=k-m[g]-P,F=k/2-m[g]/2+C,M=j_(T,F,B),L=!c.arrow&&Dd(i)!=null&&F!==M&&a.reference[g]/2-(F<T?A:P)-m[g]/2<0,R=L?F<T?F-T:F-B:0;return{[p]:h[p]+R,data:{[p]:M,centerOffset:F-M-R,...L&&{alignmentOffset:R}},reset:L}}}),GY=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:s,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...v}=ss(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const x=os(i),y=ga(l),w=os(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),_=h||(w||!m?[Uv(l)]:FY(l)),j=g!=="none";!h&&j&&_.push(...WY(l,m,g,S));const k=[l,..._],C=await Kh(t,v),E=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(d&&E.push(C[x]),f){const F=LY(i,s,S);E.push(C[F[0]],C[F[1]])}if(A=[...A,{placement:i,overflows:E}],!E.every(F=>F<=0)){var P,T;const F=(((P=a.flip)==null?void 0:P.index)||0)+1,M=k[F];if(M&&(!(f==="alignment"?y!==ga(M):!1)||A.every($=>$.overflows[0]>0&&ga($.placement)===y)))return{data:{index:F,overflows:A},reset:{placement:M}};let L=(T=A.filter(R=>R.overflows[0]<=0).sort((R,$)=>R.overflows[1]-$.overflows[1])[0])==null?void 0:T.placement;if(!L)switch(p){case"bestFit":{var B;const R=(B=A.filter($=>{if(j){const O=ga($.placement);return O===y||O==="y"}return!0}).map($=>[$.placement,$.overflows.filter(O=>O>0).reduce((O,N)=>O+N,0)]).sort(($,O)=>$[1]-O[1])[0])==null?void 0:B[0];R&&(L=R);break}case"initialPlacement":L=l;break}if(i!==L)return{reset:{placement:L}}}return{}}}};function D2(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function L2(e){return IY.some(t=>e[t]>=0)}const KY=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ss(e,t);switch(r){case"referenceHidden":{const a=await Kh(t,{...i,elementContext:"reference"}),s=D2(a,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:L2(s)}}}case"escaped":{const a=await Kh(t,{...i,altBoundary:!0}),s=D2(a,n.floating);return{data:{escapedOffsets:s,escaped:L2(s)}}}default:return{}}}}},B5=new Set(["left","top"]);async function YY(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=os(n),l=Dd(n),c=ga(n)==="y",u=B5.has(s)?-1:1,d=a&&c?-1:1,f=ss(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const XY=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:s,middlewareData:l}=t,c=await YY(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:s}}}}},QY=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:v=>{let{x,y}=v;return{x,y}}},...c}=ss(e,t),u={x:n,y:r},d=await Kh(t,c),f=ga(os(i)),h=oN(f);let p=u[h],g=u[f];if(a){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",y=p+d[v],w=p-d[x];p=j_(y,p,w)}if(s){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=g+d[v],w=g-d[x];g=j_(y,g,w)}const m=l.fn({...t,[h]:p,[f]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:a,[f]:s}}}}}},JY=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=ss(e,t),d={x:n,y:r},f=ga(i),h=oN(f);let p=d[h],g=d[f];const m=ss(l,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const w=h==="y"?"height":"width",S=a.reference[h]-a.floating[w]+v.mainAxis,_=a.reference[h]+a.reference[w]-v.mainAxis;p<S?p=S:p>_&&(p=_)}if(u){var x,y;const w=h==="y"?"width":"height",S=B5.has(os(i)),_=a.reference[f]-a.floating[w]+(S&&((x=s.offset)==null?void 0:x[f])||0)+(S?0:v.crossAxis),j=a.reference[f]+a.reference[w]+(S?0:((y=s.offset)==null?void 0:y[f])||0)-(S?v.crossAxis:0);g<_?g=_:g>j&&(g=j)}return{[h]:p,[f]:g}}}},ZY=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:s,elements:l}=t,{apply:c=()=>{},...u}=ss(e,t),d=await Kh(t,u),f=os(i),h=Dd(i),p=ga(i)==="y",{width:g,height:m}=a.floating;let v,x;f==="top"||f==="bottom"?(v=f,x=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,v=h==="end"?"top":"bottom");const y=m-d.top-d.bottom,w=g-d.left-d.right,S=jo(m-d[v],y),_=jo(g-d[x],w),j=!t.middlewareData.shift;let k=S,C=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=y),j&&!h){const A=Wr(d.left,0),P=Wr(d.right,0),T=Wr(d.top,0),B=Wr(d.bottom,0);p?C=g-2*(A!==0||P!==0?A+P:Wr(d.left,d.right)):k=m-2*(T!==0||B!==0?T+B:Wr(d.top,d.bottom))}await c({...t,availableWidth:C,availableHeight:k});const E=await s.getDimensions(l.floating);return g!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function Tx(){return typeof window<"u"}function Ld(e){return U5(e)?(e.nodeName||"").toLowerCase():"#document"}function Yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Aa(e){var t;return(t=(U5(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function U5(e){return Tx()?e instanceof Node||e instanceof Yr(e).Node:!1}function Xi(e){return Tx()?e instanceof Element||e instanceof Yr(e).Element:!1}function Ca(e){return Tx()?e instanceof HTMLElement||e instanceof Yr(e).HTMLElement:!1}function F2(e){return!Tx()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Yr(e).ShadowRoot}const eX=new Set(["inline","contents"]);function tm(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Qi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!eX.has(i)}const tX=new Set(["table","td","th"]);function nX(e){return tX.has(Ld(e))}const rX=[":popover-open",":modal"];function Rx(e){return rX.some(t=>{try{return e.matches(t)}catch{return!1}})}const iX=["transform","translate","scale","rotate","perspective"],aX=["transform","translate","scale","rotate","perspective","filter"],sX=["paint","layout","strict","content"];function uN(e){const t=dN(),n=Xi(e)?Qi(e):e;return iX.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||aX.some(r=>(n.willChange||"").includes(r))||sX.some(r=>(n.contain||"").includes(r))}function oX(e){let t=So(e);for(;Ca(t)&&!zu(t);){if(uN(t))return t;if(Rx(t))return null;t=So(t)}return null}function dN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lX=new Set(["html","body","#document"]);function zu(e){return lX.has(Ld(e))}function Qi(e){return Yr(e).getComputedStyle(e)}function Ix(e){return Xi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function So(e){if(Ld(e)==="html")return e;const t=e.assignedSlot||e.parentNode||F2(e)&&e.host||Aa(e);return F2(t)?t.host:t}function z5(e){const t=So(e);return zu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ca(t)&&tm(t)?t:z5(t)}function Yh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=z5(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),s=Yr(i);if(a){const l=k_(s);
vendor: 4,127 bytes, line 583
583return t.concat(s,s.visualViewport||[],tm(i)?i:[],l&&n?Yh(l):[])}return t.concat(i,Yh(i,[],n))}function k_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function W5(e){const t=Qi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ca(e),a=i?e.offsetWidth:n,s=i?e.offsetHeight:r,l=Bv(n)!==a||Bv(r)!==s;return l&&(n=a,r=s),{width:n,height:r,$:l}}function fN(e){return Xi(e)?e:e.contextElement}function uu(e){const t=fN(e);if(!Ca(t))return ja(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=W5(t);let s=(a?Bv(n.width):n.width)/r,l=(a?Bv(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const cX=ja(0);function H5(e){const t=Yr(e);return!dN()||!t.visualViewport?cX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uX(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Yr(e)?!1:t}function Hl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=fN(e);let s=ja(1);t&&(r?Xi(r)&&(s=uu(r)):s=uu(e));const l=uX(a,n,r)?H5(a):ja(0);let c=(i.left+l.x)/s.x,u=(i.top+l.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(a){const h=Yr(a),p=r&&Xi(r)?Yr(r):r;let g=h,m=k_(g);for(;m&&r&&p!==g;){const v=uu(m),x=m.getBoundingClientRect(),y=Qi(m),w=x.left+(m.clientLeft+parseFloat(y.paddingLeft))*v.x,S=x.top+(m.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=w,u+=S,g=Yr(m),m=k_(g)}}return zv({width:d,height:f,x:c,y:u})}function hN(e,t){const n=Ix(e).scrollLeft;return t?t.left+n:Hl(Aa(e)).left+n}function q5(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:hN(e,r)),a=r.top+t.scrollTop;return{x:i,y:a}}function dX(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",s=Aa(r),l=t?Rx(t.floating):!1;if(r===s||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=ja(1);const d=ja(0),f=Ca(r);if((f||!f&&!a)&&((Ld(r)!=="body"||tm(s))&&(c=Ix(r)),Ca(r))){const p=Hl(r);u=uu(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=s&&!f&&!a?q5(s,c,!0):ja(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function fX(e){return Array.from(e.getClientRects())}function hX(e){const t=Aa(e),n=Ix(e),r=e.ownerDocument.body,i=Wr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Wr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+hN(e);const l=-n.scrollTop;return Qi(r).direction==="rtl"&&(s+=Wr(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:s,y:l}}function pX(e,t){const n=Yr(e),r=Aa(e),i=n.visualViewport;let a=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){a=i.width,s=i.height;const u=dN();(!u||u&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:a,height:s,x:l,y:c}}const mX=new Set(["absolute","fixed"]);function gX(e,t){const n=Hl(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ca(e)?uu(e):ja(1),s=e.clientWidth*a.x,l=e.clientHeight*a.y,c=i*a.x,u=r*a.y;return{width:s,height:l,x:c,y:u}}function B2(e,t,n){let r;if(t==="viewport")r=pX(e,n);else if(t==="document")r=hX(Aa(e));else if(Xi(t))r=gX(t,n);else{const i=H5(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return zv(r)}function V5(e,t){const n=So(e);return n===t||!Xi(n)||zu(n)?!1:Qi(n).position==="fixed"||V5(n,t)}function vX(e,t){const n=t.get(e);if(n)return n;let r=Yh(e,[],!1).filter(l=>Xi(l)&&Ld(l)!=="body"),i=null;const a=Qi(e).position==="fixed";let s=a?So(e):e;for(;Xi(s)&&!zu(s);){const l=Qi(s),c=uN(s);!c&&l.position==="fixed"&&(i=null),(a?!c&&!i:!c&&l.position==="static"&&!!i&&mX.has(i.position)||tm(s)&&!c&&V5(e,s))?r=r.filter(d=>d!==s):i=l,s=So(s)}return t.set(e,r),r}function yX(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?Rx(t)?[]:vX(t,this._c):[].concat(n),r],l=s[0],c=s.reduce((u,d)=>{const f=B2(t,d,i);return u.top=Wr(f.top,u.top),u.right=jo(f.right,u.right),u.bottom=jo(f.bottom,u.bottom),u.left=Wr(f.left,u.left),u},B2(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function xX(e){const{width:t,height:n}=W5(e);return{width:t,height:n}}
vendor: 9,774 bytes, line 583
583function bX(e,t,n){const r=Ca(t),i=Aa(t),a=n==="fixed",s=Hl(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=ja(0);function u(){c.x=hN(i)}if(r||!r&&!a)if((Ld(t)!=="body"||tm(i))&&(l=Ix(t)),r){const p=Hl(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else i&&u();a&&!r&&i&&u();const d=i&&!r&&!a?q5(i,l):ja(0),f=s.left+l.scrollLeft-c.x-d.x,h=s.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:s.width,height:s.height}}function V0(e){return Qi(e).position==="static"}function U2(e,t){if(!Ca(e)||Qi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Aa(e)===n&&(n=n.ownerDocument.body),n}function G5(e,t){const n=Yr(e);if(Rx(e))return n;if(!Ca(e)){let i=So(e);for(;i&&!zu(i);){if(Xi(i)&&!V0(i))return i;i=So(i)}return n}let r=U2(e,t);for(;r&&nX(r)&&V0(r);)r=U2(r,t);return r&&zu(r)&&V0(r)&&!uN(r)?n:r||oX(e)||n}const wX=async function(e){const t=this.getOffsetParent||G5,n=this.getDimensions,r=await n(e.floating);return{reference:bX(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _X(e){return Qi(e).direction==="rtl"}const jX={convertOffsetParentRelativeRectToViewportRelativeRect:dX,getDocumentElement:Aa,getClippingRect:yX,getOffsetParent:G5,getElementRects:wX,getClientRects:fX,getDimensions:xX,getScale:uu,isElement:Xi,isRTL:_X};function K5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SX(e,t){let n=null,r;const i=Aa(e);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=u;if(l||t(),!h||!p)return;const g=og(f),m=og(i.clientWidth-(d+h)),v=og(i.clientHeight-(f+p)),x=og(d),w={rootMargin:-g+"px "+-m+"px "+-v+"px "+-x+"px",threshold:Wr(0,jo(1,c))||1};let S=!0;function _(j){const k=j[0].intersectionRatio;if(k!==c){if(!S)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!K5(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(_,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,w)}n.observe(e)}return s(!0),a}function kX(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=fN(e),d=i||a?[...u?Yh(u):[],...Yh(t)]:[];d.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),a&&x.addEventListener("resize",n)});const f=u&&l?SX(u,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let g,m=c?Hl(e):null;c&&v();function v(){const x=Hl(e);m&&!K5(m,x)&&n(),m=x,g=requestAnimationFrame(v)}return n(),()=>{var x;d.forEach(y=>{i&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),f==null||f(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const NX=XY,CX=QY,EX=GY,PX=ZY,OX=KY,z2=VY,AX=JY,TX=(e,t,n)=>{const r=new Map,i={platform:jX,...n},a={...i.platform,_c:r};return qY(e,t,{...i,platform:a})};var RX=typeof document<"u",IX=function(){},Zg=RX?b.useLayoutEffect:IX;function Wv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Wv(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!Wv(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Y5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function W2(e,t){const n=Y5(e);return Math.round(t*n)/n}function G0(e){const t=b.useRef(e);return Zg(()=>{t.current=e}),t}function MX(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=b.useState(r);Wv(h,r)||p(r);const[g,m]=b.useState(null),[v,x]=b.useState(null),y=b.useCallback($=>{$!==j.current&&(j.current=$,m($))},[]),w=b.useCallback($=>{$!==k.current&&(k.current=$,x($))},[]),S=a||g,_=s||v,j=b.useRef(null),k=b.useRef(null),C=b.useRef(d),E=c!=null,A=G0(c),P=G0(i),T=G0(u),B=b.useCallback(()=>{if(!j.current||!k.current)return;const $={placement:t,strategy:n,middleware:h};P.current&&($.platform=P.current),TX(j.current,k.current,$).then(O=>{const N={...O,isPositioned:T.current!==!1};F.current&&!Wv(C.current,N)&&(C.current=N,nc.flushSync(()=>{f(N)}))})},[h,t,n,P,T]);Zg(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[u]);const F=b.useRef(!1);Zg(()=>(F.current=!0,()=>{F.current=!1}),[]),Zg(()=>{if(S&&(j.current=S),_&&(k.current=_),S&&_){if(A.current)return A.current(S,_,B);B()}},[S,_,B,A,E]);const M=b.useMemo(()=>({reference:j,floating:k,setReference:y,setFloating:w}),[y,w]),L=b.useMemo(()=>({reference:S,floating:_}),[S,_]),R=b.useMemo(()=>{const $={position:n,left:0,top:0};if(!L.floating)return $;const O=W2(L.floating,d.x),N=W2(L.floating,d.y);return l?{...$,transform:"translate("+O+"px, "+N+"px)",...Y5(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:N}},[n,l,L.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:B,refs:M,elements:L,floatingStyles:R}),[d,B,M,L,R])}const $X=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?z2({element:r.current,padding:i}).fn(n):{}:r?z2({element:r,padding:i}).fn(n):{}}}},DX=(e,t)=>({...NX(e),options:[e,t]}),LX=(e,t)=>({...CX(e),options:[e,t]}),FX=(e,t)=>({...AX(e),options:[e,t]}),BX=(e,t)=>({...EX(e),options:[e,t]}),UX=(e,t)=>({...PX(e),options:[e,t]}),zX=(e,t)=>({...OX(e),options:[e,t]}),WX=(e,t)=>({...$X(e),options:[e,t]});var HX="Arrow",X5=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return o.jsx(Ce.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});X5.displayName=HX;var qX=X5;function pN(e){const[t,n]=b.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let s,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,l=u.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var mN="Popper",[Q5,Io]=Fn(mN),[VX,J5]=Q5(mN),Z5=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return o.jsx(VX,{scope:t,anchor:r,onAnchorChange:i,children:n})};Z5.displayName=mN;var e4="PopperAnchor",t4=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=J5(e4,n),s=b.useRef(null),l=Qe(t,s);return b.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:o.jsx(Ce.div,{...i,ref:l})});t4.displayName=e4;var gN="PopperContent",[GX,KX]=Q5(gN),n4=b.forwardRef((e,t)=>{var Q,ne,Z,W,ee,q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=e,v=J5(gN,n),[x,y]=b.useState(null),w=Qe(t,re=>y(re)),[S,_]=b.useState(null),j=pN(S),k=(j==null?void 0:j.width)??0,C=(j==null?void 0:j.height)??0,E=r+(a!=="center"?"-"+a:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],T=P.length>0,B={padding:A,boundary:P.filter(XX),altBoundary:T},{refs:F,floatingStyles:M,placement:L,isPositioned:R,middlewareData:$}=MX({strategy:"fixed",placement:E,whileElementsMounted:(...re)=>kX(...re,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[DX({mainAxis:i+C,alignmentAxis:s}),c&&LX({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?FX():void 0,...B}),c&&BX({...B}),UX({...B,apply:({elements:re,rects:ge,availableWidth:Ie,availableHeight:ye})=>{const{width:qe,height:jt}=ge.reference,pt=re.floating.style;pt.setProperty("--radix-popper-available-width",`${Ie}px`),pt.setProperty("--radix-popper-available-height",`${ye}px`),pt.setProperty("--radix-popper-anchor-width",`${qe}px`),pt.setProperty("--radix-popper-anchor-height",`${jt}px`)}}),S&&WX({element:S,padding:l}),QX({arrowWidth:k,arrowHeight:C}),h&&zX({strategy:"referenceHidden",...B})]}),[O,N]=a4(L),H=Ar(g);Pn(()=>{R&&(H==null||H())},[R,H]);const V=(Q=$.arrow)==null?void 0:Q.x,D=(ne=$.arrow)==null?void 0:ne.y,K=((Z=$.arrow)==null?void 0:Z.centerOffset)!==0,[ae,se]=b.useState();return Pn(()=>{x&&se(window.getComputedStyle(x).zIndex)},[x]),o.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:R?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(W=$.transformOrigin)==null?void 0:W.x,(ee=$.transformOrigin)==null?void 0:ee.y].join(" "),...((q=$.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(GX,{scope:n,placedSide:O,onArrowChange:_,arrowX:V,arrowY:D,shouldHideArrow:K,children:o.jsx(Ce.div,{"data-side":O,"data-align":N,...m,ref:w,style:{...m.style,animation:R?void 0:"none"}})})})});n4.displayName=gN;var r4="PopperArrow",YX={top:"bottom",right:"left",bottom:"top",left:"r
583ight"},i4=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=KX(r4,r),s=YX[a.placedSide];return o.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]: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:o.jsx(qX,{...i,ref:n,style:{...i.style,display:"block"}})})});i4.displayName=r4;function XX(e){return e!==null}var QX=e=>({name:"transformOrigin",options:e,fn(t){var v,x,y;const{placement:n,rects:r,middlewareData:i}=t,s=((v=i.arrow)==null?void 0:v.centerOffset)!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[u,d]=a4(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((x=i.arrow)==null?void 0:x.x)??0)+l/2,p=(((y=i.arrow)==null?void 0:y.y)??0)+c/2;let g="",m="";return u==="bottom"?(g=s?f:`${h}px`,m=`${-c}px`):u==="top"?(g=s?f:`${h}px`,m=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,m=s?f:`${p}px`):u==="left"&&(g=`${r.floating.width+c}px`,m=s?f:`${p}px`),{data:{x:g,y:m}}}});function a4(e){const[t,n="center"]=e.split("-");return[t,n]}var Mx=Z5,nm=t4,$x=n4,Dx=i4,[Lx,OLe]=Fn("Tooltip",[Io]),Fx=Io(),s4="TooltipProvider",JX=700,N_="tooltip.open",[ZX,vN]=Lx(s4),o4=e=>{const{__scopeTooltip:t,delayDuration:n=JX,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=b.useRef(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(ZX,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),s.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:a})};o4.displayName=s4;var Xh="Tooltip",[eQ,Bx]=Lx(Xh),l4=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=e,c=vN(Xh,e.__scopeTooltip),u=Fx(t),[d,f]=b.useState(null),h=Pr(),p=b.useRef(0),g=s??c.disableHoverableContent,m=l??c.delayDuration,v=b.useRef(!1),[x,y]=Tr({prop:r,defaultProp:i??!1,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(N_))):c.onClose(),a==null||a(k)},caller:Xh}),w=b.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),S=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,y(!0)},[y]),_=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),j=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,y(!0),p.current=0},m)},[m,y]);return b.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),o.jsx(Mx,{...u,children:o.jsx(eQ,{scope:t,contentId:h,open:x,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?j():S()},[c.isOpenDelayedRef,j,S]),onTriggerLeave:b.useCallback(()=>{g?_():(window.clearTimeout(p.current),p.current=0)},[_,g]),onOpen:S,onClose:_,disableHoverableContent:g,children:n})})};l4.displayName=Xh;var C_="TooltipTrigger",c4=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Bx(C_,n),a=vN(C_,n),s=Fx(n),l=b.useRef(null),c=Qe(t,l,i.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),o.jsx(nm,{asChild:!0,...s,children:o.jsx(Ce.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:me(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:me(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:me(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:me(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:me(e.onBlur,i.onClose),onClick:me(e.onClick,i.onClose)})})});c4.displayName=C_;var tQ="TooltipPortal",[ALe,nQ]=Lx(tQ,{forceMount:void 0}),Wu="TooltipContent",u4=b.forwardRef((e,t)=>
vendor: 4,283 bytes, line 583
583{const n=nQ(Wu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...a}=e,s=Bx(Wu,e.__scopeTooltip);return o.jsx(pr,{present:r||s.open,children:s.disableHoverableContent?o.jsx(d4,{side:i,...a,ref:t}):o.jsx(rQ,{side:i,...a,ref:t})})}),rQ=b.forwardRef((e,t)=>{const n=Bx(Wu,e.__scopeTooltip),r=vN(Wu,e.__scopeTooltip),i=b.useRef(null),a=Qe(t,i),[s,l]=b.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,h=b.useCallback(()=>{l(null),f(!1)},[f]),p=b.useCallback((g,m)=>{const v=g.currentTarget,x={x:g.clientX,y:g.clientY},y=lQ(x,v.getBoundingClientRect()),w=cQ(x,y),S=uQ(m.getBoundingClientRect()),_=fQ([...w,...S]);l(_),f(!0)},[f]);return b.useEffect(()=>()=>h(),[h]),b.useEffect(()=>{if(c&&d){const g=v=>p(v,d),m=v=>p(v,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",m)}}},[c,d,p,h]),b.useEffect(()=>{if(s){const g=m=>{const v=m.target,x={x:m.clientX,y:m.clientY},y=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),w=!dQ(x,s);y?h():w&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,s,u,h]),o.jsx(d4,{...e,ref:a})}),[iQ,aQ]=Lx(Xh,{isInside:!1}),sQ=B3("TooltipContent"),d4=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,c=Bx(Wu,n),u=Fx(n),{onClose:d}=c;return b.useEffect(()=>(document.addEventListener(N_,d),()=>document.removeEventListener(N_,d)),[d]),b.useEffect(()=>{if(c.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),o.jsx(ic,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:o.jsxs($x,{"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:[o.jsx(sQ,{children:r}),o.jsx(iQ,{scope:n,isInside:!0,children:o.jsx(KG,{id:c.contentId,role:"tooltip",children:i||r})})]})})});u4.displayName=Wu;var f4="TooltipArrow",oQ=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Fx(n);return aQ(f4,n).isInside?null:o.jsx(Dx,{...i,...r,ref:t})});oQ.displayName=f4;function lQ(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function cQ(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 uQ(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function dQ(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const l=t[a],c=t[s],u=l.x,d=l.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(i=!i)}return i}function fQ(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),hQ(t)}function hQ(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const a=t[t.length-1],s=t[t.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const a=n[n.length-1],s=n[n.length-2];if((a.x-s.x)*(i.y-s.y)>=(a.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}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 pQ=o4,mQ=l4,gQ=c4,h4=u4;const Tc=pQ,vf=mQ,yf=gQ,Rc=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>
583o.jsx(h4,{ref:r,sideOffset:t,className:he("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}));Rc.displayName=h4.displayName;function vQ(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function l(d){try{u(r.next(d))}catch(f){s(f)}}function c(d){try{u(r.throw(d))}catch(f){s(f)}}function u(d){d.done?a(d.value):i(d.value).then(l,c)}u((r=r.apply(e,t||[])).next())})}const yQ=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class yN extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class xQ extends yN{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class H2 extends yN{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class q2 extends yN{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var E_;(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"})(E_||(E_={}));class bQ{constructor(t,{headers:n={},customFetch:r,region:i=E_.Any}={}){this.url=t,this.headers=n,this.region=i,this.fetch=yQ(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return vQ(this,arguments,void 0,function*(n,r={}){var i;let a,s;try{const{headers:l,method:c,body:u,signal:d,timeout:f}=r;let h={},{region:p}=r;p||(p=this.region);const g=new URL(`${this.url}/${n}`);p&&p!=="any"&&(h["x-region"]=p,g.searchParams.set("forceFunctionRegion",p));let m;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",m=u):typeof u=="string"?(h["Content-Type"]="text/plain",m=u):typeof FormData<"u"&&u instanceof FormData?m=u:(h["Content-Type"]="application/json",m=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?m=JSON.stringify(u):m=u;let v=d;f&&(s=new AbortController,a=setTimeout(()=>s.abort(),f),d?(v=s.signal,d.addEventListener("abort",()=>s.abort())):v=s.signal);const x=yield this.fetch(g.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),l),body:m,signal:v}).catch(_=>{throw new xQ(_)}),y=x.headers.get("x-relay-error");if(y&&y==="true")throw new H2(x);if(!x.ok)throw new q2(x);let w=((i=x.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),S;return w==="application/json"?S=yield x.json():w==="application/octet-stream"||w==="application/pdf"?S=yield x.blob():w==="text/event-stream"?S=x:w==="multipart/form-data"?S=yield x.formData():S=yield x.text(),{data:S,error:null,response:x}}catch(l){return{data:null,error:l,response:l instanceof q2||l instanceof H2?l.context:void 0}}finally{a&&clearTimeout(a)}})}}var wQ=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
583de=e.code}},_Q=class{constructor(e){var t,n,r;this.shouldThrowOnError=!1,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.urlLengthLimit=(r=e.urlLengthLimit)!==null&&r!==void 0?r:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;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");const r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{let s=null,l=null,c=null,u=a.status,d=a.statusText;if(a.ok){var f,h;if(n.method!=="HEAD"){var p;const v=await a.text();v===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((p=n.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?l=v:l=JSON.parse(v))}const g=(f=n.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),m=(h=a.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");g&&m&&m.length>1&&(c=parseInt(m[1])),n.isMaybeSingle&&Array.isArray(l)&&(l.length>1?(s={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,u=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{const g=await a.text();try{s=JSON.parse(g),Array.isArray(s)&&a.status===404&&(l=[],s=null,u=200,d="OK")}catch{a.status===404&&g===""?(u=204,d="No Content"):s={message:g}}if(s&&n.shouldThrowOnError)throw new wQ(s)}return{error:s,data:l,count:c,status:u,statusText:d}});return this.shouldThrowOnError||(i=i.catch(a=>{var s;let l="",c="",u="";const d=a==null?void 0:a.cause;if(d){var f,h,p,g;const x=(f=d==null?void 0:d.message)!==null&&f!==void 0?f:"",y=(h=d==null?void 0:d.code)!==null&&h!==void 0?h:"";l=`${(p=a==null?void 0:a.name)!==null&&p!==void 0?p:"FetchError"}: ${a==null?void 0:a.message}`,l+=`
584
585Caused by: ${(g=d==null?void 0:d.name)!==null&&g!==void 0?g:"Error"}: ${x}`,y&&(l+=` (${y})`),d!=null&&d.stack&&(l+=`
586${d.stack}`)}else{var m;l=(m=a==null?void 0:a.stack)!==null&&m!==void 0?m:""}const v=this.url.toString().length;return(a==null?void 0:a.name)==="AbortError"||(a==null?void 0:a.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(c+=`. 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.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(c+=`. 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.`)),{error:{message:`${(s=a==null?void 0:a.name)!==null&&s!==void 0?s:"FetchError"}: ${a==null?void 0:a.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}})),i.then(e,t)}returns(){return this}overrideTypes(){return this}},jQ=class extends _Q{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:i=r}={}){const a=i?`${i}.order`:"order",s=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${s?`${s},`:""}${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 i=typeof r>"u"?"offset":`${r}.offset`,a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${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}
586explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:a="text"}={}){var s;const l=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"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 V2=new RegExp("[,()]");var Ic=class extends jQ{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"&&V2.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"&&V2.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 i="";r==="plain"?i="pl":r==="phrase"?i="ph":r==="websearch"&&(i="w");const a=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([t,n])=>n!==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}},SQ=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},i=n?"HEAD":"GET";let a=!1;const s=(e??"*").split("").map(u=>/\s/.test(u)&&!a?"":(u==='"'&&(a=!a),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",s),r&&c.append("Prefer",`count=${r}`),new Ic({method:i,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const i="POST",{url:a,headers:s}=this.cloneRequestState();if(t&&s.append("Prefer",`count=${t}`),n||s.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 Ic({method:i,url:a,headers:s,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var a;const s="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}`),i||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);l.searchParams.set("columns",d.join(","))}}return new Ic({method:s,url:l,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var n;const r="PATCH",{url:i,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new Ic({method:r,url:i,headers:a,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Ic({method:n,url:r,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function Qh(e){"@babel/helpers - typeof";return Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qh(e)}function kQ(e,t){if(Qh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NQ(e){var t=kQ(e,"string");return Qh(t)=="symbol"?t:t+""}
586function CQ(e,t,n){return(t=NQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G2(Object(n),!0).forEach(function(r){CQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var EQ=class p4{constructor(t,{headers:n={},schema:r,fetch:i,timeout:a,urlLengthLimit:s=8e3}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=s;const l=i??globalThis.fetch;a!==void 0&&a>0?this.fetch=(c,u)=>{const d=new AbortController,f=setTimeout(()=>d.abort(),a),h=u==null?void 0:u.signal;if(h){if(h.aborted)return clearTimeout(f),l(c,u);const p=()=>{clearTimeout(f),d.abort()};return h.addEventListener("abort",p,{once:!0}),l(c,lg(lg({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(f),h.removeEventListener("abort",p)})}return l(c,lg(lg({},u),{},{signal:d.signal})).finally(()=>clearTimeout(f))}:this.fetch=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 SQ(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new p4(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(t,n={},{head:r=!1,get:i=!1,count:a}={}){var s;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),f=r&&Object.values(n).some(d);f?(l="POST",u=n):r||i?(l=r?"HEAD":"GET",Object.entries(n).filter(([p,g])=>g!==void 0).map(([p,g])=>[p,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([p,g])=>{c.searchParams.append(p,g)})):(l="POST",u=n);const h=new Headers(this.headers);return f?h.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&h.set("Prefer",`count=${a}`),new Ic({method:l,url:c,headers:h,schema:this.schemaName,body:u,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit})}};class PQ{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.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"&&globalThis.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 n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const i=r.node,a=parseInt(i.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
587import ws from "ws"
588new 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.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
589
590Suggested solution: ${t.workaround}`),new Error(n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const OQ="2.101.1",AQ=`realtime-js/${OQ}`,TQ="1.0.0",m4="2.0.0",RQ=m4,IQ=1e4,MQ=100,$s={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},g4={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},P_={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class $Q{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 i=(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,i)}_encodeJsonUserBroadcastPush(t){var n,r;const i=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},s=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(t,n,r){var i,a;const s=t.topic,l=(i=t.ref)!==null&&i!==void 0?i:"",c=(a=t.join_ref)!==null&&a!==void 0?a:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=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(s.length>255)throw new Error(`topic length ${s.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+s.length+u.length+f.length,p=new ArrayBuffer(this.HEADER_LENGTH+h);let g=new DataView(p),m=0;g.setUint8(m++,this.KINDS.userBroadcastPush),g.setUint8(m++,c.length),g.setUint8(m++,l.length),g.setUint8(m++,s.length),g.setUint8(m++,u.length),g.setUint8(m++,f.length),g.setUint8(m++,n),Array.from(c,x=>g.setUint8(m++,x.charCodeAt(0))),Array.from(l,x=>g.setUint8(m++,x.charCodeAt(0))),Array.from(s,x=>g.setUint8(m++,x.charCodeAt(0))),Array.from(u,x=>g.setUint8(m++,x.charCodeAt(0))),Array.from(f,x=>g.setUint8(m++,x.charCodeAt(0)));var v=new Uint8Array(p.byteLength+r.byteLength);return v.set(new Uint8Array(p),0),v.set(new Uint8Array(r),p.byteLength),v.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),[i,a,s,l,c]=r;
590return n({join_ref:i,ref:a,topic:s,event:l,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,i)}}_decodeUserBroadcast(t,n,r){const i=n.getUint8(1),a=n.getUint8(2),s=n.getUint8(3),l=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+i));c=c+i;const d=r.decode(t.slice(c,c+a));c=c+a;const f=r.decode(t.slice(c,c+s));c=c+s;const h=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,g={type:this.BROADCAST_EVENT,event:d,payload:p};return s>0&&(g.meta=JSON.parse(f)),{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 Et;(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"})(Et||(Et={}));const K2=(e,t,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((a,s)=>(a[s]=DQ(s,e,t,i),a),{}):{}},DQ=(e,t,n,r)=>{const i=t.find(l=>
vendor: 5,523 bytes, line 590
590l.name===e),a=i==null?void 0:i.type,s=n[e];return a&&!r.includes(a)?v4(a,s):O_(s)},v4=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return UQ(t,n)}switch(e){case Et.bool:return LQ(t);case Et.float4:case Et.float8:case Et.int2:case Et.int4:case Et.int8:case Et.numeric:case Et.oid:return FQ(t);case Et.json:case Et.jsonb:return BQ(t);case Et.timestamp:return zQ(t);case Et.abstime:case Et.date:case Et.daterange:case Et.int4range:case Et.int8range:case Et.money:case Et.reltime:case Et.text:case Et.time:case Et.timestamptz:case Et.timetz:case Et.tsrange:case Et.tstzrange:return O_(t);default:return O_(t)}},O_=e=>e,LQ=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},FQ=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},BQ=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},UQ=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let a;const s=e.slice(1,n);try{a=JSON.parse("["+s+"]")}catch{a=s?s.split(","):[]}return a.map(l=>v4(t,l))}return e},zQ=e=>typeof e=="string"?e.replace(" ","T"):e,y4=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 dh=e=>typeof e=="function"?e:function(){return e},WQ=typeof self<"u"?self:null,Mc=typeof window<"u"?window:null,la=WQ||Mc||globalThis,HQ="2.0.0",qQ=1e4,VQ=1e3,fa={connecting:0,open:1,closing:2,closed:3},gr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Fa={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},A_={longpoll:"longpoll",websocket:"websocket"},GQ={complete:4},T_="base64url.bearer.phx.",cg=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})}},x4=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))}},KQ=class{constructor(e,t,n){this.state=gr.closed,this.topic=e,this.params=dh(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new cg(this,Fa.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new x4(()=>{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=gr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=gr.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=gr.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=gr.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 cg(this,Fa.leave,dh({}),this.timeout).send(),this.state=gr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Fa.reply,(r,i)=>{this.trigger(this.replyEventName(i),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,263 bytes, line 590
590teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=gr.closed,this.bindings=[]}onClose(e){this.on(Fa.close,e)}onError(e){return this.on(Fa.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 cg(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=gr.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Fa.close,"leave")},n=new cg(this,Fa.leave,dh({}),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=gr.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let a=this.bindings.filter(s=>s.event===e&&this.filterBindings(s,t,n));for(let s=0;s<a.length;s++)a[s].callback(i,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===gr.closed}isErrored(){return this.state===gr.errored}isJoined(){return this.state===gr.joined}isJoining(){return this.state===gr.joining}isLeaving(){return this.state===gr.leaving}},Hv=class{static request(e,t,n,r,i,a,s){if(la.XDomainRequest){let l=new la.XDomainRequest;return this.xdomainRequest(l,e,t,r,i,a,s)}else if(la.XMLHttpRequest){let l=new la.XMLHttpRequest;return this.xhrRequest(l,e,t,n,r,i,a,s)}else{if(la.fetch&&la.AbortController)return this.fetchRequest(e,t,n,r,i,a,s);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,n,r,i,a,s){let l={method:e,headers:n,body:r},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),l.signal=c.signal),la.fetch(t,l).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>s&&s(u)).catch(u=>{u.name==="AbortError"&&a?a():s&&s(null)}),c}static xdomainRequest(e,t,n,r,i,a,s){return e.timeout=i,e.open(t,n),e.onload=()=>{let l=this.parseJSON(e.responseText);s&&s(l)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,s,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===GQ.complete&&l){let c=this.parseJSON(e.responseText);l(c)}},s&&(e.ontimeout=s),e.send(i),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 i=t?`${t}[${r}]`:r,a=e[r];typeof a=="object"?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+"="+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)}`}},YQ=e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let i=0;i<r;i++)t+=String.fromCharCode(n[i]);return btoa(t)},vc=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(T_)&&(this.authToken=atob(t[1].slice(T_.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=fa.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+A_.websocket),"$1/"+A_.longpoll)}endpointURL(){return Hv.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=fa.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===fa.open||this.readyState===fa.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:i}=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:i.forEach(a=>{setTimeout(()=>this.onmessage({data:a}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=fa.open,this.onopen({}),this.poll();break;
590case 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=YQ(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(`
591`),()=>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 i of this.reqs)i.abort();this.readyState=fa.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,i){let a,s=()=>{this.reqs.delete(a),r()};a=Hv.request(e,this.endpointURL(),t,n,this.timeout,s,l=>{this.reqs.delete(a),this.isActive()&&i(l)}),this.reqs.add(a)}},XQ=class Hf{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,i=>{let{onJoin:a,onLeave:s,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Hf.syncState(this.state,i,a,s),this.pendingDiffs.forEach(c=>{this.state=Hf.syncDiff(this.state,c,a,s)}),this.pendingDiffs=[],l()}),this.channel.on(r.diff,i=>{let{onJoin:a,onLeave:s,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Hf.syncDiff(this.state,i,a,s),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Hf.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,n,r,i){let a=this.clone(t),s={},l={};return this.map(a,(c,u)=>{n[c]||(l[c]=u)}),this.map(n,(c,u)=>{let d=a[c];if(d){let f=u.metas.map(m=>m.phx_ref),h=d.metas.map(m=>m.phx_ref),p=u.metas.filter(m=>h.indexOf(m.phx_ref)<0),g=d.metas.filter(m=>f.indexOf(m.phx_ref)<0);p.length>0&&(s[c]=u,s[c].metas=p),g.length>0&&(l[c]=this.clone(d),l[c].metas=g)}else s[c]=u}),this.syncDiff(a,{joins:s,leaves:l},r,i)}static syncDiff(t,n,r,i){let{joins:a,leaves:s}=this.clone(n);return r||(r=function(){}),i||(i=function(){}),this.map(a,(l,c)=>{let u=t[l];if(t[l]=this.clone(c),u){let d=t[l].metas.map(h=>h.phx_ref),f=u.metas.filter(h=>d.indexOf(h.phx_ref)<0);t[l].metas.unshift(...f)}r(l,u,c)}),this.map(s,(l,c)=>{let u=t[l];if(!u)return;let d=c.metas.map(f=>f.phx_ref);u.metas=u.metas.filter(f=>d.indexOf(f.phx_ref)<0),i(l,u,c),u.metas.length===0&&delete t[l]}),t}static list(t,n){return n||(n=function(r,i){return i}),this.map(t,(r,i)=>n(r,i))}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static clone(t){return JSON.parse(JSON.stringify(t))}},ug={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,i,a,s]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:s})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,s=this.META_LENGTH+t.length+n.length+i.length+r.length,l=new ArrayBuffer(this.HEADER_LENGTH+s),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++,i.length),c.setUint8(u++,r.length),Array.from(t,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(n,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(i,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(r,f=>c.setUint8(u++,f.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,419 bytes, line 591
591,decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),s=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(e.slice(s,s+r));s=s+r;let c=n.decode(e.slice(s,s+i));s=s+i;let u=n.decode(e.slice(s,s+a));s=s+a;let d=e.slice(s,e.byteLength);return{join_ref:l,ref:null,topic:c,event:u,payload:d}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),s=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+i));l=l+i;let d=n.decode(e.slice(l,l+a));l=l+a;let f=n.decode(e.slice(l,l+s));l=l+s;let h=e.slice(l,e.byteLength),p={status:f,response:h};return{join_ref:c,ref:u,topic:d,event:Fa.reply,payload:p}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,s=n.decode(e.slice(a,a+r));a=a+r;let l=n.decode(e.slice(a,a+i));a=a+i;let c=e.slice(a,e.byteLength);return{join_ref:null,ref:null,topic:s,event:l,payload:c}}},QQ=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||qQ,this.transport=t.transport||la.WebSocket||vc,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||la&&la.sessionStorage,this.establishedConnections=0,this.defaultEncoder=ug.encode.bind(ug),this.defaultDecoder=ug.decode.bind(ug),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!==vc?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Mc&&Mc.addEventListener&&(Mc.addEventListener("pagehide",r=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Mc.addEventListener("pageshow",r=>{n===this.connectClock&&(n=null,this.connect())}),Mc.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,i,a)=>{console.log(`${r}: ${i}`,a)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=dh(t.params||{}),this.endPoint=`${e}/${A_.websocket}`,this.vsn=t.vsn||HQ,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new x4(()=>{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 vc}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=Hv.appendParams(Hv.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=dh(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==vc?this.connectWithFallback(vc,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(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case vc:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${T_}${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,i,a,s=this.transportName(e),l=c=>{this.log("transport",`falling back to ${s}...`,c),this.off([i,a]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${s}`))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(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),VQ,"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===fa.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(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",e,t,n),(t===this.transport||n>0)&&this.triggerChanError()}
591triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Fa.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case fa.connecting:return"connecting";case fa.open:return"open";case fa.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 KQ(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log("push",`${t} ${n} (${a}, ${i})`,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:i,ref:a,join_ref:s}=t;if(a&&a===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.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",`${i.status||""} ${n} ${r} ${a&&"("+a+")"||""}`.trim(),i);for(let l=0;l<this.channels.length;l++){const c=this.channels[l];c.isMember(n,r,i,s)&&c.trigger(r,i,a,s)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([n,r])=>{try{r(...t)}catch(i){this.log("error",`error in ${e} callback`,i)}})}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 fh{constructor(t,n){const r=ZQ(n);this.presence=new XQ(t.getChannel(),r),this.presence.onJoin((i,a,s)=>{const l=fh.onJoinPayload(i,a,s);t.getChannel().trigger("presence",l)}),this.presence.onLeave((i,a,s)=>{const l=fh.onLeavePayload(i,a,s);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return fh.transformState(this.presence.state)}static transformState(t){return t=JQ(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const i=t[r];return n[r]=ev(i),n},{})}static onJoinPayload(t,n,r){const i=Y2(n),a=ev(r);return{event:"join",key:t,currentPresences:i,newPresences:a}}static onLeavePayload(t,n,r){const i=Y2(n),a=ev(r);return{event:"leave",key:t,currentPresences:i,leftPresences:a}}}function ev(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function JQ(e){return JSON.parse(JSON.stringify(e))}function ZQ(e){return(e==null?void 0:e.events)&&{events:e.events}}function Y2(e){return e!=null&&e.metas?ev(e):[]}var X2;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(X2||(X2={}));class eJ{get state(){return this.presenceAdapter.state}constructor(t,n){this.channel=t,this.presenceAdapter=new fh(this.channel.channelAdapter,n)}}class tJ{constructor(t,n,r){const i=nJ(r);this.channel=t.getSocket().channel(n,i),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 i;try{i=this.channel.push(t,n,r)}catch{throw`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>MQ){const a=this.channel.pushBuffer.shift();a.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload())}return i}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===$s.joined}isJoined(){return this.state===$s.joined}isJoining(){return this.state===$s.joining}isClosed(){return this.state===$s.closed}isLeaving(){return this.state===$s.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function nJ(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var Q2;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Q2||(Q2={}));var Qc;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Qc||(Qc={}));var Ba;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Ba||(Ba={}));class hh{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 i,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 tJ(this.socket.socketAdapter,t,this.params),this.presence=new eJ(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=y4(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((a=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||a===void 0)&&a.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,i,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:s,presence:l,private:c}}=this.params,u=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[Qc.PRESENCE]&&this.bindings[Qc.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,f={},h={broadcast:s,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(p=>{t==null||t(Ba.CHANNEL_ERROR,p)}),this._onClose(()=>t==null?void 0:t(Ba.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(Ba.SUBSCRIBED);return}this._updatePostgresBindings(p,t)}
591).receive("error",p=>{this.state=$s.errored,t==null||t(Ba.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Ba.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){var r;const i=this.bindings.postgres_changes,a=(r=i==null?void 0:i.length)!==null&&r!==void 0?r:0,s=[];for(let l=0;l<a;l++){const c=i[l],{filter:{event:u,schema:d,table:f,filter:h}}=c,p=t&&t[l];if(p&&p.event===u&&hh.isFilterValueEqual(p.schema,d)&&hh.isFilterValueEqual(p.table,f)&&hh.isFilterValueEqual(p.filter,h))s.push(Object.assign(Object.assign({},c),{id:p.id}));else{this.unsubscribe(),this.state=$s.errored,n==null||n(Ba.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=s,this.state!=$s.errored&&n&&n(Ba.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 i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),a=t===Qc.PRESENCE||t===Qc.POSTGRES_CHANGES;if(i&&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 i;if(n==null)return Promise.reject("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 s={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,s,(i=r.timeout)!==null&&i!==void 0?i: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,i;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
591in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:s}=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:s,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var s,l,c;const u=this.channelAdapter.push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(s=this.params)===null||s===void 0?void 0:s.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 i=new AbortController,a=setTimeout(()=>i.abort(),r),s=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(a),s}_on(t,n,r){const i=t.toLocaleLowerCase(),a=this.channelAdapter.on(t,r),s={type:i,filter:n,callback:r,ref:a};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,n,r)=>{var i,a,s,l,c,u,d;const f=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,r))return!1;const h=(i=this.bindings[f])===null||i===void 0?void 0:i.find(p=>p.ref===t.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in h){const p=h.id,g=(a=h.filter)===null||a===void 0?void 0:a.event;return p&&((s=n.ids)===null||s===void 0?void 0:s.includes(p))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((l=n.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const p=(u=(c=h==null?void 0:h.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p==="*"||p===((d=n==null?void 0:n.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===f})}_notThisChannelEvent(t,n){const{close:r,error:i,leave:a,join:s}=g4;return n&&[r,i,a,s].includes(t)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,n,r)=>{if(typeof n=="object"&&"ids"in n){const i=n.data,{schema:a,table:s,commit_timestamp:l,type:c,errors:u}=i;return Object.assign(Object.assign({},{schema:a,table:s,commit_timestamp:l,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(i))}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=K2(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=K2(t.columns,t.old_record)),n}}class rJ{constructor(t,n){this.socket=new QQ(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,i=1e4){return new Promise(a=>{setTimeout(()=>a("timeout"),i),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()==P_.connecting}isDisconnecting(){return this.socket.connectionState()==P_.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const iJ={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},aJ=[1e3,2e3,5e3,1e4],sJ=1e4,oJ=`
592  addEventListener("message", (e) => {
593    if (e.data.event === "start") {
594      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
595    }
596  });`;class lJ{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={}
596,this.ref=0,this.serializer=new $Q,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=a=>a?(...s)=>a(...s):(...s)=>fetch(...s),!(!((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 i=this._initializeOptions(n);this.socketAdapter=new rJ(t,i),this.httpEndpoint=y4(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}
597
598To use Realtime in Node.js, you need to provide a WebSocket implementation:
599
600Option 1: Use Node.js 22+ which has native WebSocket support
601Option 2: Install and provide the "ws" package:
602
603  npm install ws
604
605  import ws from "ws"
606  const client = new RealtimeClient(url, {
607    ...options,
608    transport: ws
609  })`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,n){return 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(),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=this.channels.map(async r=>{const i=await r.unsubscribe();return r.teardown(),i}),n=await Promise.all(t);return this.disconnect(),n}log(t,n,r){this.socketAdapter.log(t,n,r)}connectionState(){return this.socketAdapter.connectionState()||P_.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,n={config:{}}){const r=`realtime:${t}`,i=this.getChannels().find(a=>a.topic===r);if(i)return i;{const a=new hh(`realtime:${t}`,n,this);return 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)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),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(i=>{const a={access_token:n,version:AQ};n&&i.updateJoinPayload(a),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(g4.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([oJ],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(t){var n,r,i,a,s,l,c,u,d;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 f={};
609f.timeout=(i=t==null?void 0:t.timeout)!==null&&i!==void 0?i:IQ,f.heartbeatIntervalMs=(a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:iJ.HEARTBEAT_INTERVAL,f.transport=(s=t==null?void 0:t.transport)!==null&&s!==void 0?s:PQ.getWebSocketConstructor(),f.params=t==null?void 0:t.params,f.logger=t==null?void 0:t.logger,f.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),f.reconnectAfterMs=(l=t==null?void 0:t.reconnectAfterMs)!==null&&l!==void 0?l:m=>aJ[m-1]||sJ;let h,p;const g=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:RQ;switch(g){case TQ:h=(m,v)=>v(JSON.stringify(m)),p=(m,v)=>v(JSON.parse(m));break;case m4:h=this.serializer.encode.bind(this.serializer),p=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${f.vsn}`)}if(f.vsn=g,f.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:h,f.decode=(d=t==null?void 0:t.decode)!==null&&d!==void 0?d:p,f.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,f.params=Object.assign(Object.assign({},f.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,f.autoSendHeartbeat=!this.worker}return f}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Jh=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 cJ(e,t,n){const r=new URL(t,e);if(n)for(const[i,a]of Object.entries(n))a!==void 0&&r.searchParams.set(i,a);return r.toString()}async function uJ(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 dJ(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:s}){const l=cJ(e.baseUrl,r,i),c=await uJ(e.auth),u=await t(l,{method:n,headers:{...a?{"Content-Type":"application/json"}:{},...c,...s},body:a?JSON.stringify(a):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),h=f&&d?JSON.parse(d):d;if(!u.ok){const p=f?h:void 0,g=p==null?void 0:p.error;throw new Jh((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:p})}return{status:u.status,headers:u.headers,data:h}}}}function dg(e){return e.join("�")}var fJ=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:dg(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/${dg(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${dg(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${dg(e.namespace)}`}),!0}catch(t){if(t instanceof Jh&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Jh&&n.status===409)return;throw n}}};function yc(e){return e.join("�")}var hJ=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/${yc(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/${yc(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/${yc(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/${yc(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/${yc(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/${yc(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Jh&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Jh&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},pJ=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=dJ({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new fJ(this.client,t),this.tableOps=new hJ(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)}
609async 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)}},Ux=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}};function zx(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var R_=class extends Ux{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{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},b4=class extends Ux{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const mJ=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),gJ=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)},I_=e=>{if(Array.isArray(e))return e.map(n=>I_(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[i]=I_(r)}),t},vJ=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Zh(e){"@babel/helpers - typeof";return Zh=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},Zh(e)}function yJ(e,t){if(Zh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Zh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xJ(e){var t=yJ(e,"string");return Zh(t)=="symbol"?t:t+""}function bJ(e,t,n){return(t=xJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Me(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J2(Object(n),!0).forEach(function(r){bJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const Z2=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},wJ=async(e,t,n,r)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const i=e;let a=parseInt(i.status,10);Number.isFinite(a)||(a=500),i.json().then(s=>{const l=(s==null?void 0:s.statusCode)||(s==null?void 0:s.code)||a+"";t(new R_(Z2(s),a,l,r))}).catch(()=>{const s=a+"";t(new R_(i.statusText||`HTTP ${a} error`,a,s,r))})}else t(new b4(Z2(e),e,r))},_J=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!r?Me(Me({},i),n):(gJ(r)?(i.headers=Me({"Content-Type":"application/json"},t==null?void 0:t.headers),i.body=JSON.stringify(r)):i.body=r,t!=null&&t.duplex&&(i.duplex=t.duplex),Me(Me({},i),n))};async function xf(e,t,n,r,i,a,s){return new Promise((l,c)=>{e(n,_J(t,r,i,a)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(s==="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=>wJ(u,c,r,s))})}function w4(e="storage"){return{get:async(t,n,r,i)=>xf(t,"GET",n,r,i,void 0,e),post:async(t,n,r,i,a)=>xf(t,"POST",n,i,a,r,e),put:async(t,n,r,i,a)=>xf(t,"PUT",n,i,a,r,e),head:async(t,n,r,i)=>xf(t,"HEAD",n,Me(Me({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>xf(t,"DELETE",n,i,a,r,e)}}const jJ=w4("storage"),{get:ep,post:Ii,put:M_,head:SJ,remove:xN}=jJ,Hr=w4("vectors");var Fd=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=mJ(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Me(Me({},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(zx(n))return{data:null,error:n};throw n}}},kJ=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(zx(t))return{data:null,error:t};throw t}}};let _4;_4=Symbol.toStringTag;var NJ=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[_4]="BlobDownloadBuilder",this.promise=null}asStream(){return new kJ(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(zx(t))return{data:null,error:t};throw t}}};const CJ={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},eO={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var EJ=class extends Fd{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a;const s=Me(Me({},eO),r);let l=Me(Me({},i.headers),e==="POST"&&{"x-upsert":String(s.upsert)});const c=s.metadata;typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",s.cacheControl),c&&a.append("metadata",i.encodeMetadata(c)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.has("cacheControl")||a.append("cacheControl",s.cacheControl),c&&!a.has("metadata")&&a.append("metadata",i.encodeMetadata(c))):(a=n,l["cache-control"]=`max-age=${s.cacheControl}`,l["content-type"]=s.contentType,c&&(l["x-metadata"]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<"u"&&a 
609instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!s.duplex&&(s.duplex="half")),r!=null&&r.headers&&(l=Me(Me({},l),r.headers));const u=i._removeEmptyFolders(t),d=i._getFinalPath(u),f=await(e=="PUT"?M_:Ii)(i.fetch,`${i.url}/object/${d}`,a,Me({headers:l},s!=null&&s.duplex?{duplex:s.duplex}:{}));return{path:u,id:f.Id,fullPath:f.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;const a=i._removeEmptyFolders(e),s=i._getFinalPath(a),l=new URL(i.url+`/object/upload/sign/${s}`);return l.searchParams.set("token",t),i.handleOperation(async()=>{let c;const u=Me(Me({},eO),r),d=Me(Me({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",u.cacheControl)):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:a,fullPath:(await M_(i.fetch,l.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const i=Me({},n.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const a=await Ii(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),s=new URL(n.url+a.url),l=s.searchParams.get("token");if(!l)throw new Ux("No token returned by API");return{signedUrl:s.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 Ii(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
609stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Ii(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 i=r._getFinalPath(e);const a=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let s=await Ii(r.fetch,`${r.url}/object/sign/${i}`,Me({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers});const l=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"",c=a&&s.signedURL.includes("/object/sign/")?s.signedURL.replace("/object/sign/","/render/image/sign/"):s.signedURL;return{signedUrl:encodeURI(`${r.url}${c}${l}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const i=await Ii(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i.map(s=>Me(Me({},s),{},{signedUrl:s.signedURL?encodeURI(`${r.url}${s.signedURL}${a}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),a=i?`?${i}`:"",s=this._getFinalPath(e),l=()=>ep(this.fetch,`${this.url}/${r}/${s}${a}`,{headers:this.headers,noResolveJson:!0},n);return new NJ(l,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>I_(await ep(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await SJ(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(i){if(t.shouldThrowOnError)throw i;if(zx(i)){var r;const a=i instanceof R_?i.status:i instanceof b4?(r=i.originalError)===null||r===void 0?void 0:r.status:void 0;if(a!==void 0&&[400,404].includes(a))return{data:!1,error:i}}throw i}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],i=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&r.push(i);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",s=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});s!==""&&r.push(s);let l=r.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${l}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await xN(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 i=Me(Me(Me({},CJ),t),{},{prefix:e||""});return await Ii(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=Me({},e);return await Ii(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,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const PJ="2.101.1",rm={"X-Client-Info":`storage-js/${PJ}`};var OJ=class extends Fd{constructor(e,t={},n,r){const i=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const a=i.href.replace(/\/$/,""),s=Me(Me({},rm),t);super(a,s,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await ep(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ep(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Ii(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 M_(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 Ii(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await xN(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():""}},AJ=class extends Fd{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Me(Me({},rm),t);super(r,i,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ii(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(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await ep(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await xN(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!vJ(e))throw new Ux("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 pJ({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}
609),r=this.shouldThrowOnError;return new Proxy(n,{get(i,a){const s=i[a];return typeof s!="function"?s:async(...l)=>{try{return{data:await s.apply(i,l),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},TJ=class extends Fd{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Me(Me({},rm),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Hr.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Hr.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},RJ=class extends Fd{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Me(Me({},rm),{},{"Content-Type":"application/json"},t);super(r,i,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 Hr.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Hr.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 Hr.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Hr.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 Hr.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},IJ=class extends Fd{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Me(Me({},rm),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Hr.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},MJ=class extends IJ{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new $J(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)}},$J=class extends TJ{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,Me(Me({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,Me(Me({},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 DJ(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},DJ=class extends RJ{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,Me(Me({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,Me(Me({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,Me(Me({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,Me(Me({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,Me(Me({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},LJ=class extends OJ{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new EJ(this.url,this.headers,e,this.fetch)}get vectors(){return new MJ(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new AJ(this.url+"/iceberg",this.headers,this.fetch)}};function Wx(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}const j4="2.101.1",$c=30*1e3,$_=3,K0=$_*$c,FJ="http://localhost:9999",BJ="supabase.auth.token",UJ={"X-Client-Info":`gotrue-js/${j4}`},D_="X-Supabase-Api-Version",S4={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},zJ=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,WJ=10*60*1e3;
609class tp extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function _e(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class HJ extends tp{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function qJ(e){return _e(e)&&e.name==="AuthApiError"}class ll extends tp{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class ms extends tp{constructor(t,n,r,i){super(t,r,i),this.name=n,this.status=r}}class Dr extends ms{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Y0(e){return _e(e)&&e.name==="AuthSessionMissingError"}class xc extends ms{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class fg extends ms{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class hg extends ms{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function VJ(e){return _e(e)&&e.name==="AuthImplicitGrantRedirectError"}class tO extends ms{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class GJ extends ms{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 L_ extends ms{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function X0(e){return _e(e)&&e.name==="AuthRetryableFetchError"}class nO extends ms{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class F_ extends ms{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const qv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),rO=` 	
610\r=`.split(""),KJ=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<rO.length;t+=1)e[rO[t].charCodeAt(0)]=-2;for(let t=0;t<qv.length;t+=1)e[qv[t].charCodeAt(0)]=t;return e})();function iO(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(qv[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(qv[r]),t.queuedBits-=6}}function k4(e,t,n){const r=KJ[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 aO(e){const t=[],n=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=s=>{QJ(s,r,n)};for(let s=0;s<e.length;s+=1)k4(e.charCodeAt(s),i,a);return t.join("")}function YJ(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 XJ(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}YJ(r,t)}}function QJ(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 du(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)k4(e.charCodeAt(i),n,r);return new Uint8Array(t)}function JJ(e){const t=[];return XJ(e,n=>t.push(n)),new Uint8Array(t)}function pl(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};return e.forEach(i=>
610iO(i,n,r)),iO(null,n,r),t.join("")}function ZJ(e){return Math.round(Date.now()/1e3)+e}function eZ(){return Symbol("auth-callback")}const Rn=()=>typeof window<"u"&&typeof document<"u",Yo={tested:!1,writable:!1},N4=()=>{if(!Rn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Yo.tested)return Yo.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Yo.tested=!0,Yo.writable=!0}catch{Yo.tested=!0,Yo.writable=!1}return Yo.writable};function tZ(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,a)=>{t[a]=i})}catch{}return n.searchParams.forEach((r,i)=>{t[i]=r}),t}const C4=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),nZ=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Dc=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Xo=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Tn=async(e,t)=>{await e.removeItem(t)};class Hx{constructor(){this.promise=new Hx.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Hx.promiseConstructor=Promise;function pg(e){const t=e.split(".");if(t.length!==3)throw new F_("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!zJ.test(t[r]))throw new F_("JWT not in base64url format");return{header:JSON.parse(aO(t[0])),payload:JSON.parse(aO(t[1])),signature:du(t[2]),raw:{header:t[0],payload:t[1]}}}async function rZ(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function iZ(e,t){return new Promise((r,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const s=await e(a);if(!t(a,null,s)){r(s);return}}catch(s){if(!t(a,s)){i(s);return}}})()})}function aZ(e){return("0"+e.toString(16)).substr(-2)}function sZ(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let a=0;a<56;a++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(t),Array.from(t,aZ).join("")}async function oZ(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}async function lZ(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 oZ(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function bc(e,t,n=!1){const r=sZ();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await Dc(e,`${t}-code-verifier`,i);const a=await lZ(r);return[a,r===a?"plain":"s256"]}const cZ=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function uZ(e){const t=e.headers.get(D_);if(!t||!t.match(cZ))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function dZ(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 fZ(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 hZ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function wc(e){if(!hZ.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Q0(){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 pZ(e,t){return new Proxy(e,{get:(n,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;
610if(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,i)}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,i)}})}function sO(e){return JSON.parse(JSON.stringify(e))}const rl=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),mZ=[502,503,504];async function oO(e){var t;if(!nZ(e))throw new L_(rl(e),0);if(mZ.includes(e.status))throw new L_(rl(e),e.status);let n;try{n=await e.json()}catch(a){throw new ll(rl(a),a)}let r;const i=uZ(e);if(i&&i.getTime()>=S4["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 nO(rl(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Dr}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,s)=>a&&typeof s=="string",!0))throw new nO(rl(n),e.status,n.weak_password.reasons);throw new HJ(rl(n),e.status||500,r)}const gZ=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Oe(e,t,n,r){var i;const a=Object.assign({},r==null?void 0:r.headers);a[D_]||(a[D_]=S4["2024-01-01"].name),r!=null&&r.jwt&&(a.Authorization=`Bearer ${r.jwt}`);const s=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(s.redirect_to=r.redirectTo);const l=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",c=await vZ(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 vZ(e,t,n,r,i,a){const s=gZ(t,r,i,a);let l;try{l=await e(n,Object.assign({},s))}catch(c){throw console.error(c),new L_(rl(c),0)}if(l.ok||await oO(l),r!=null&&r.noResolveJson)return l;try{return await l.json()}catch(c){await oO(c)}}function Ai(e){var t;let n=null;bZ(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=ZJ(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function lO(e){const t=Ai(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 Ds(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function yZ(e){return{data:e,error:null}}function xZ(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,s=Wx(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},c=Object.assign({},s);return{data:{properties:l,user:c},error:null}}function cO(e){return e}function bZ(e){return e.access_token&&e.refresh_token&&e.expires_in}const J0=["global","local","others"];class wZ{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=C4(r),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)}}
vendor: 4,780 bytes, line 610
610async signOut(t,n=J0[0]){if(J0.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${J0.join(", ")}`);try{return await Oe(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(_e(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Oe(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Ds})}catch(r){if(_e(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=Wx(t,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await Oe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:xZ,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(_e(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Oe(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ds})}catch(n){if(_e(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,i,a,s,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Oe(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=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:cO});if(d.error)throw d.error;const f=await d.json(),h=(s=d.headers.get("x-total-count"))!==null&&s!==void 0?s:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);u[`${v}Page`]=m}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(_e(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){wc(t);try{return await Oe(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ds})}catch(n){if(_e(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){wc(t);try{return await Oe(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Ds})}catch(r){if(_e(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){wc(t);try{return await Oe(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Ds})}catch(r){if(_e(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){wc(t.userId);try{const{data:n,error:r}=await Oe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _deleteFactor(t){wc(t.userId),wc(t.id);try{return{data:await Oe(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,i,a,s,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Oe(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=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:cO});if(d.error)throw d.error;const f=await d.json(),h=(s=d.headers.get("x-total-count"))!==null&&s!==void 0?s:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(g=>{const m=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(g.split(";")[1].split("=")[1]);u[`${v}Page`]=m}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(_e(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await Oe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await Oe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await Oe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(_e(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Oe(this.fetch,"DELET
610E",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await Oe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _listCustomProviders(t){try{const n={};return t!=null&&t.type&&(n.type=t.type),await Oe(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var i;return{data:{providers:(i=r==null?void 0:r.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(n){if(_e(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(t){try{return await Oe(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _getCustomProvider(t){try{return await Oe(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(_e(n))return{data:null,error:n};throw n}}async _updateCustomProvider(t,n){try{return await Oe(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(_e(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(t){try{return await Oe(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(_e(n))return{data:null,error:n};throw n}}}function uO(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const ia={debug:!!(globalThis&&N4()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class E4 extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class dO extends E4{}async function _Z(e,t,n){ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;let i;t>0&&(i=setTimeout(()=>{r.abort(),ia.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(i),ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await n()}finally{ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new dO(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(ia.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null,"  "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}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(i),await n()}})}catch(a){if(t>0&&clearTimeout(i),(a==null?void 0:a.name)==="AbortError"&&t>0){if(r.signal.aborted)return ia.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 s=>{if(s){ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,s.name);try{return await n()}finally{ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,s.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await n()}));throw ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new dO(`Lock "${e}" was released because another request stole it`)}throw a}}function jZ(){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 P4(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}
610" is invalid.`);return e.toLowerCase()}function SZ(e){return parseInt(e,16)}function kZ(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function NZ(e){var t;const{chainId:n,domain:r,expirationTime:i,issuedAt:a=new Date,nonce:s,notBefore:l,requestId:c,resources:u,scheme:d,uri:f,version:h}=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(s&&s.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${s}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
611`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=P4(e.address),g=d?`${d}://${r}`:r,m=e.statement?`${e.statement}
612`:"",v=`${g} wants you to sign in with your Ethereum account:
613${p}
614
615${m}`;let x=`URI: ${f}
616Version: ${h}
617Chain ID: ${n}${s?`
618Nonce: ${s}`:""}
619Issued At: ${a.toISOString()}`;if(i&&(x+=`
620Expiration Time: ${i.toISOString()}`),l&&(x+=`
621Not Before: ${l.toISOString()}`),c&&(x+=`
622Request ID: ${c}`),u){let y=`
623Resources:`;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}`);y+=`
624- ${w}`}x+=y}return`${v}
625${x}`}class fn extends Error{constructor({message:t,code:n,cause:r,name:i}){var a;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(a=i??(r instanceof Error?r.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=n}}class Vv extends fn{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function CZ({error:e,options:t}){var n,r,i;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 fn({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 fn({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 fn({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new fn({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 fn({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new fn({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 fn({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new fn({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 s=window.location.hostname;if(O4(s)){if(a.rp.id!==s)return new fn({message:`The RP ID "${a.rp.id}
625" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new fn({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 fn({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 fn({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 fn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function EZ({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 fn({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new fn({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(O4(r)){if(n.rpId!==r)return new fn({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new fn({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new fn({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 fn({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class PZ{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 OZ=new PZ;function AZ(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,i=Wx(e,["challenge","user","excludeCredentials"]),a=du(t).buffer,s=Object.assign(Object.assign({},n),{id:du(n.id).buffer}),l=Object.assign(Object.assign({},i),{challenge:a,user:s});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:du(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function TZ(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=Wx(e,["challenge","allowCredentials"]),i=du(t).buffer,a=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){a.allowCredentials=new Array(n.length);for(let s=0;s<n.length;s++){const l=n[s];a.allowCredentials[s]=Object.assign(Object.assign({},l),{id:du(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function RZ(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:pl(new Uint8Array(e.response.attestationObject)),clientDataJSON:pl(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function IZ(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),i=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:pl(new Uint8Array(i.authenticatorData)),clientDataJSON:pl(new Uint8Array(i.clientDataJSON)),signature:pl(new Uint8Array(i.signature)),userHandle:i.userHandle?pl(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function O4(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function fO(){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 MZ(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Vv("Browser returned unexpected credential type",t)}:{data:null,error:new Vv("Empty credential response",t)}}
625catch(t){return{data:null,error:CZ({error:t,options:e})}}}async function $Z(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Vv("Browser returned unexpected credential type",t)}:{data:null,error:new Vv("Empty credential response",t)}}catch(t){return{data:null,error:EZ({error:t,options:e})}}}const DZ={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},LZ={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Gv(...e){const t=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of e)if(i)for(const a in i){const s=i[a];if(s!==void 0)if(Array.isArray(s))r[a]=s;else if(n(s))r[a]=s;else if(t(s)){const l=r[a];t(l)?r[a]=Gv(l,s):r[a]=Gv(s)}else r[a]=s}return r}function FZ(e,t){return Gv(DZ,e,t||{})}function BZ(e,t){return Gv(LZ,e,t||{})}class UZ{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:i},a){var s;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!l)return{data:null,error:c};const u=i??OZ.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:d}=l.webauthn.credential_options.publicKey;if(!d.name){const f=r;if(f)d.name=`${d.id}:${f}`;else{const p=(await this.client.getUser()).data.user,g=((s=p==null?void 0:p.user_metadata)===null||s===void 0?void 0:s.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${g}`}}d.displayName||(d.displayName=d.name)}switch(l.webauthn.type){case"create":{const d=FZ(l.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:f,error:h}=await MZ({publicKey:d,signal:u});return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}case"request":{const d=BZ(l.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:f,error:h}=await $Z(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:d,signal:u}));return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}}}catch(l){return _e(l)?{data:null,error:l}:{data:null,error:new ll("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:i}={}},a){if(!n)return{data:null,error:new tp("rpId is required for WebAuthn authentication")};try{if(!fO())return{data:null,error:new ll("Browser does not support WebAuthn",null)};const{data:s,error:l}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:i},{request:a});if(!s)return{data:null,error:l};const{webauthn:c}=s;return this._verify({factorId:t,challengeId:s.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(s){return _e(s)?{data:null,error:s}:{data:null,error:new ll("Unexpected error in authenticate",s)}}}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:i}={}},a){if(!n)return{data:null,error:new tp("rpId is required for WebAuthn registration")};try{if(!fO())return{data:null,error:new ll("Browser does not support WebAuthn",null)};const{data:s,error:l}=await this._enroll({friendlyName:t});if(!s)return await this.client.mfa.listFactors().then(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.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:s.id,friendlyName:s.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:a});return c?this._verify({factorId:s.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(s){return _e(s)?{data:null,error:s}:{data:null,error:new ll("Unexpected error in register",s)}}}}jZ();const zZ={url:FJ,storageKey:BJ,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:UJ,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function hO(e,t,n){return await n()}const _c={};class np{get jwks(){var t,n;return(n=(t=_c[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){_c[this.storageKey]=Object.assign(Object.assign({},_c[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=_c[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){_c[this.storageKey]=Object.assign(Object.assign({},_c[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,i;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 a=Object.assign(Object.assign({},zZ),t);
625if(this.storageKey=a.storageKey,this.instanceID=(n=np.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,np.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&Rn()){const s=`${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(s),this.logDebugMessages&&console.trace(s)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new wZ({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=C4(a.fetch),this.lock=a.lock||hO,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&Rn()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=_Z:this.lock=hO,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 UZ(this)},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.persistSession?(a.storage?this.storage=a.storage:N4()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=uO(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=uO(this.memoryStorage)),Rn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s);try{await this._notifyAllSubscribers(s.data.event,s.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}a.skipAutoInitialize||this.initialize().catch(s=>{this._debug("#initialize()","error",s)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${j4}) ${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=tZ(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),Rn()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:a}=await this._getSessionFromURL(n,r);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),VJ(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:s,redirectType:l}=i;return this._debug("#_initialize()","detected session in URL",s,"redirect type",l),await this._saveSession(s),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return _e(n)?this._returnResult({error:n}):this._returnResult({error:new ll("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,i;try{const a=await Oe(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:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:Ai}),{data:s,error:l}=a;if(l||!s)return this._returnResult({data:{user:null,session:null},error:l});const c=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(_e(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var n,r,i;try{let a;if("email"in t){const{email:d,password:f,options:h}=t;let p=null,g=null;this.flowType==="pkce"&&([p,g]=await bc(this.storage,this.storageKey)),a=await Oe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:d,password:f,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:g},xform:Ai})}else if("phone"in t){const{phone:d,password:f,options:h}=t;a=await Oe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},channel:(i=h==null?void 0:h.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:Ai})}else throw new fg("You must provide either an email or phone number and a password");const{data:s,error:l}=a;if(l||!s)return await Tn(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(await Tn(this.storage,`${this.storageKey}-code-verifier`),_e(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:s,options:l}=t;n=await Oe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:s,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:lO})}else if("phone"in t){const{phone:a,password:s,options:l}=t;n=await Oe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:s,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:lO})}else throw new fg("You must provide either an email or phone number and a password");const{data:r,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const a=new xc;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:i})}catch(n){if(_e(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,i,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:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(a=t.o
625ptions)===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,i,a,s,l,c,u,d,f,h;let p,g;if("message"in t)p=t.message,g=t.signature;else{const{chain:m,wallet:v,statement:x,options:y}=t;let w;if(Rn())if(typeof v=="object")w=v;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")w=E.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 v!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=v}const S=new URL((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href),_=await w.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!_||_.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const j=P4(_[0]);let k=(r=y==null?void 0:y.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!k){const E=await w.request({method:"eth_chainId"});k=SZ(E)}const C={domain:S.host,address:j,statement:x,uri:S.href,version:"1",chainId:k,nonce:(i=y==null?void 0:y.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(s=(a=y==null?void 0:y.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=y==null?void 0:y.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=y==null?void 0:y.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=NZ(C),g=await w.request({method:"personal_sign",params:[kZ(p),j]})}try{const{data:m,error:v}=await Oe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:g},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Ai});if(v)throw v;if(!m||!m.session||!m.user){const x=new xc;return this._returnResult({data:{user:null,session:null},error:x})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:v})}catch(m){if(_e(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var n,r,i,a,s,l,c,u,d,f,h,p;let g,m;if("message"in t)g=t.message,m=t.signature;else{const{chain:v,wallet:x,statement:y,options:w}=t;let S;if(Rn())if(typeof x=="object")S=x;else{const j=window;if("solana"in j&&typeof j.solana=="object"&&("signIn"in j.solana&&typeof j.solana.signIn=="function"||"signMessage"in j.solana&&typeof j.solana.signMessage=="function"))S=j.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 x!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=x}const _=new URL((n=w==null?void 0:w.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in S&&S.signIn){const j=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:_.host,uri:_.href}),y?{statement:y}:null));let k;if(Array.isArray(j)&&j[0]&&typeof j[0]=="object")k=j[0];else if(j&&typeof j=="object"&&"signedMessage"in j&&"signature"in j)k=j;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),m=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");g=[`${_.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${_.href}`,`Issued At: ${(i=(r=w==null?void 0:w.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((s=w==null?void 0:w.signInWithSolana)===null||s===void 0)&&s.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}`]:[],...!((f=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...w.sign
625InWithSolana.resources.map(k=>`- ${k}`)]:[]].join(`
626`);const j=await S.signMessage(new TextEncoder().encode(g),"utf8");if(!j||!(j instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=j}}try{const{data:v,error:x}=await Oe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:g,signature:pl(m)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Ai});if(x)throw x;if(!v||!v.session||!v.user){const y=new xc;return this._returnResult({data:{user:null,session:null},error:y})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:x})}catch(v){if(_e(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(t){const n=await Xo(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new GJ;const{data:a,error:s}=await Oe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Ai});if(await Tn(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!a||!a.session||!a.user){const l=new xc;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:s})}catch(a){if(await Tn(this.storage,`${this.storageKey}-code-verifier`),_e(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:i,access_token:a,nonce:s}=t,l=await Oe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:a,nonce:s,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Ai}),{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 xc;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(_e(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,i,a,s;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await bc(this.storage,this.storageKey));const{error:f}=await Oe(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:f})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await Oe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},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:(s=c==null?void 0:c.channel)!==null&&s!==void 0?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new fg("You must provide either an email or phone number.")}catch(l){if(await Tn(this.storage,`${this.storageKey}-code-verifier`),_e(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var n,r;try{let i,a;"options"in t&&(i=(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:s,error:l}=await Oe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:Ai});if(l)throw l;if(!s)throw new Error("An error occurred on token verification.");const c=s.session,u=s.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(i){if(_e(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(t){var n,r,i,a,s;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await bc(this.storage,this.storageKey));const u=await Oe(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}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.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:yZ});return!((a=u.data)===null||a===void 0)&&a.url&&Rn()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await Tn(this.storage,`${this.storageKey}-code-verifier`),_e(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 Dr;const{error:i}=await Oe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(t){if(_e(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:i,options:a}=t,{error:s}=await Oe(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,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:s})}else if("phone"in t){const{phone:r,type:i,options:a}=t,{data:s,error:l}=await Oe(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:s==null?void 0:s.message_id},error:l})}throw new fg("You must provide either an email or phone number and a type")}catch(n){if(_e(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(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}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 i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.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 Xo(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
626id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<K0:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const s=await Xo(this.userStorage,this.storageKey+"-user");s!=null&&s.user?t.user=s.user:t.user=Q0()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const s={value:this.suppressGetSessionWarning};t.user=pZ(t.user,s),s.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:i,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:i},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 Oe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ds}):await this._useSession(async n=>{var r,i,a;const{data:s,error:l}=n;if(l)throw l;return!(!((r=s.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Dr}:await Oe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&a!==void 0?a:void 0,xform:Ds})})}catch(n){if(_e(n))return Y0(n)&&(await this._removeSession(),await Tn(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:i,error:a}=r;if(a)throw a;if(!i.session)throw new Dr;const s=i.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await bc(this.storage,this.storageKey));const{data:u,error:d}=await Oe(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:s.access_token,xform:Ds});if(d)throw d;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})})}catch(r){if(await Tn(this.storage,`${this.storageKey}-code-verifier`),_e(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 Dr;const n=Date.now()/1e3;let r=n,i=!0,a=null;const{payload:s}=pg(t.access_token);if(s.exp&&(r=s.exp,i=r<=n),i){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(_e(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:s,error:l}=n;if(l)throw l;t=(r=s.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Dr;const{data:i,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(_e(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!Rn())throw new hg("No browser detected.");
626if(t.error||t.error_description||t.error_code)throw new hg(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 tO("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new hg("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 tO("No code detected.");const{data:y,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:a,refresh_token:s,expires_in:l,expires_at:c,token_type:u}=t;if(!a||!l||!s||!u)throw new hg("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(l);let h=d+f;c&&(h=parseInt(c));const p=h-d;p*1e3<=$c&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${f}s`);const g=h-f;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,h,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,h,d);const{data:m,error:v}=await this._getUser(a);if(v)throw v;const x={provider_token:r,provider_refresh_token:i,access_token:a,expires_in:f,expires_at:h,refresh_token:s,token_type:u,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:x,redirectType:t.type},error:null})}catch(r){if(_e(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_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 Xo(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:i,error:a}=n;if(a&&!Y0(a))return this._returnResult({error:a});const s=(r=i.session)===null||r===void 0?void 0:r.access_token;if(s){const{error:l}=await this.admin.signOut(s,t);if(l&&!(qJ(l)&&(l.status===404||l.status===401||l.status===403)||Y0(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await Tn(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=eZ(),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,i;try{const{data:{session:a},error:s}=n;if(s)throw s;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((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),console.error(a)}})}async resetPasswordForEmail(t,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await bc(this.storage,this.storageKey,!0));try{return await Oe(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(a){if(await Tn(this.storage,`${this.storageKey}-code-verifier`),_e(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(_e(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:i}=await this._useSession(async a=>{var s,l,c,u,d;const{data:f,error:h}=a;if(h)throw h;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.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 Oe(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;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(_e(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:i,data:{session:a}}=n;if(i)throw i;const{options:s,provider:l,token:c,access_token:u,nonce:d}=t,f=await Oe(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:s==null?void 0:s.captchaToken}},xform:Ai}),{data:h,error:p}=f;return p?this._returnResult({data:{user:null,session:null},error:p}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new xc}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:p}))}catch(i){if(await Tn(this.storage,`${this.storageKey}-code-verifier`),_e(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,i;const{data:a,error:s}=n;if(s)throw s;
626return await Oe(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(_e(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 iZ(async i=>(i>0&&await rZ(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await Oe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ai})),(i,a)=>{const s=200*Math.pow(2,i);return a&&X0(a)&&Date.now()+s-r<$c})}catch(r){if(this._debug(n,"error",r),_e(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 i=await Xo(this.storage,this.storageKey);if(i&&this.userStorage){let s=await Xo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:i.user},await Dc(this.userStorage,this.storageKey+"-user",s)),i.user=(t=s==null?void 0:s.user)!==null&&t!==void 0?t:Q0()}else if(i&&!i.user&&!i.user){const s=await Xo(this.storage,this.storageKey+"-user");s&&(s!=null&&s.user)?(i.user=s.user,await Tn(this.storage,this.storageKey+"-user"),await Dc(this.storage,this.storageKey,i)):i.user=Q0()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const a=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<K0;if(this._debug(r,`session has${a?"":" not"} expired with margin of ${K0}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:s}=await this._callRefreshToken(i.refresh_token);s&&(console.error(s),X0(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:s,error:l}=await this._getUser(i.access_token);!l&&(s!=null&&s.user)?(i.user=s.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(r,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new Dr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new Hx;const{data:a,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!a.session)throw new Dr;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(i,"error",a),_e(a)){const s={data:null,error:a};return X0(a)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(s),s}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(a),a}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(t,n,r=!0){const i=`#_notifyAllSubscribers(${t})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const a=[],s=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,n)}catch(c){a.push(c)}});if(await Promise.all(s),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Tn(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 Dc(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const a=sO(i);await Dc(this.storage,this.storageKey,a)}else{const i=sO(n);await Dc(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Tn(this.storage,this.storageKey),await Tn(this.storage,this.storageKey+"-code-verifier"),await Tn(this.storage,this.storageKey+"-user"),this.userStorage&&await Tn(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)}
626catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),$c);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 i=Math.floor((r.expires_at*1e3-t)/$c);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${$c}ms, refresh threshold is ${$_} ticks`),i<=$_&&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.isAcquireTimeout||t instanceof E4)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 i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[a,s]=await bc(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(l.toString())}if(r!=null&&r.queryParams){const a=new URLSearchParams(r.queryParams);i.push(a.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:i,error:a}=n;return a?this._returnResult({data:null,error:a}):await Oe(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,i;const{data:a,error:s}=n;if(s)return this._returnResult({data:null,error:s});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 Oe(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"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.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(_e(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:i,error:a}=n;
626if(a)return this._returnResult({data:null,error:a});const s=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?RZ(t.webauthn.credential_response):IZ(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await Oe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:s,headers:this.headers,jwt:(r=i==null?void 0:i.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(_e(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:i,error:a}=n;if(a)return this._returnResult({data:null,error:a});const s=await Oe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});if(s.error)return s;const{data:l}=s;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:AZ(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:TZ(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(_e(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 i={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])i.all.push(a),a.status==="verified"&&i[a.factor_type].push(a);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,i,a;if(t)try{const{payload:p}=pg(t);let g=null;p.aal&&(g=p.aal);let m=g;const{data:{user:v},error:x}=await this.getUser(t);if(x)return this._returnResult({data:null,error:x});((r=(n=v==null?void 0:v.factors)===null||n===void 0?void 0:n.filter(S=>S.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(m="aal2");const w=p.amr||[];return{data:{currentLevel:g,nextLevel:m,currentAuthenticationMethods:w},error:null}}catch(p){if(_e(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:s},error:l}
626=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=pg(s.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((a=(i=s.user.factors)===null||i===void 0?void 0:i.filter(p=>p.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(d="aal2");const h=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await Oe(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 Dr})})}catch(n){if(_e(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:i},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new Dr});const s=await Oe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return s.data&&s.data.redirect_url&&Rn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(r){if(_e(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:i},error:a}=r;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new Dr});const s=await Oe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return s.data&&s.data.redirect_url&&Rn()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(s.data.redirect_url),s})}catch(r){if(_e(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 Oe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Dr})})}catch(t){if(_e(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:i}=n;return i?this._returnResult({data:null,error:i}):r?(await Oe(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 Dr})})}catch(n){if(_e(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 i=Date.now();if(r=this.jwks.keys.find(l=>l.kid===t),r&&this.jwks_cached_at+WJ>i)return r;const{data:a,error:s}=await Oe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=i,r=a.keys.find(l=>l.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:p,error:g}
626=await this.getSession();if(g||!p.session)return this._returnResult({data:null,error:g});r=p.session.access_token}const{header:i,payload:a,signature:s,raw:{header:l,payload:c}}=pg(r);n!=null&&n.allowExpired||dZ(a.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:a,header:i,signature:s},error:null}}const d=fZ(i.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,s,JJ(`${l}.${c}`)))throw new F_("Invalid JWT signature");return{data:{claims:a,header:i,signature:s},error:null}}catch(r){if(_e(r))return this._returnResult({data:null,error:r});throw r}}}np.nextInstanceID={};const WZ=np,HZ="2.101.1";let qf="";typeof Deno<"u"?qf="deno":typeof document<"u"?qf="web":typeof navigator<"u"&&navigator.product==="ReactNative"?qf="react-native":qf="node";const qZ={"X-Client-Info":`supabase-js-${qf}/${HZ}`},VZ={headers:qZ},GZ={schema:"public"},KZ={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},YZ={};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 XZ(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 QZ(e){var t=XZ(e,"string");return rp(t)=="symbol"?t:t+""}function JZ(e,t,n){return(t=QZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pO(Object(n),!0).forEach(function(r){JZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const ZZ=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),eee=()=>Headers,tee=(e,t,n)=>{const r=ZZ(n),i=eee();return async(a,s)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new i(s==null?void 0:s.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(a,Zt(Zt({},s),{},{headers:u}))}};function nee(e){return e.endsWith("/")?e:e+"/"}function ree(e,t){var n,r;const{db:i,auth:a,realtime:s,global:l}=e,{db:c,auth:u,realtime:d,global:f}=t,h={db:Zt(Zt({},c),i),auth:Zt(Zt({},u),a),realtime:Zt(Zt({},d),s),storage:{},global:Zt(Zt(Zt({},f),l),{},{headers:Zt(Zt({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=l==null?void 0:l.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function iee(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(nee(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var aee=class extends WZ{constructor(e){super(e)}},see=class{constructor(e,t,n){var r,i;this.supabaseUrl=e,this.supabaseKey=t;const a=iee(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 s=`sb-${a.hostname.split(".")[0]}-auth-token`,l={db:GZ,realtime:YZ,auth:Zt(Zt({},KZ),{},{storageKey:s}),global:VZ},c=ree(n??{},l);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} 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=tee(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Zt({headers:this.headers,accessToken:this._getAccessToken.bind(this)},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 EQ(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 LJ(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new bQ(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)}
626channel(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:i,storageKey:a,flowType:s,lock:l,debug:c,throwOnError:u},d,f){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new aee({url:this.authUrl.href,headers:Zt(Zt({},h),d),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:s,lock:l,debug:c,throwOnError:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new lJ(this.realtimeUrl.href,Zt(Zt({},e),{},{params:Zt(Zt({},{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 oee=(e,t,n)=>new see(e,t,n);function lee(){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}lee()&&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");function cee(){var v,x;if(typeof window>"u")return;const e=location.hostname,n=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(y=>e===y||e.endsWith("."+y)),r="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",i=n?((v=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+r+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:v[1])??((x=e.match(new RegExp("^("+r+")(?=[.-])","i")))==null?void 0:x[1]):void 0,a=window.parent&&window.parent!==window;if(!i||!a)return localStorage;const s=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),l=s?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,c=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),u=c&&l.test(c)?[c]:s?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],d="lovable-preview-auth:result",f=2e3,h=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),p=(y,w,S)=>new Promise(_=>{const j=h();let k=!1,C;const E=T=>{k||(k=!0,clearTimeout(C),window.removeEventListener("message",A),_(T))},A=T=>{if(u.indexOf(T.origin)<0)return;const B=T.data;B&&B.type===d&&B.requestId===j&&E(B)};window.addEventListener("message",A);const P={type:y,requestId:j,projectId:i,key:w};S!==void 0&&(P.value=S);for(const T of u)window.parent.postMessage(P,T);C=setTimeout(()=>E(null),f)}
626);let g=!0;const m=250;return{getItem:async y=>{let w=await p("lovable-preview-auth:get",y);return!w&&g&&(await new Promise(S=>setTimeout(S,m)),w=await p("lovable-preview-auth:get",y)),g=!1,w&&w.ok&&typeof w.value=="string"?w.value===""?(localStorage.removeItem(y),null):w.value:localStorage.getItem(y)},setItem:(y,w)=>(localStorage.setItem(y,w),p("lovable-preview-auth:set",y,w).then(()=>{})),removeItem:y=>(localStorage.removeItem(y),p("lovable-preview-auth:remove",y).then(()=>{}))}}const uee="https://hfnnsrngmmfuhssfwhlj.supabase.co",dee="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imhmbm5zcm5nbW1mdWhzc2Z3aGxqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzMzMDIyNTksImV4cCI6MjA4ODg3ODI1OX0.cOG14AuXKizGxOndB0gA-YWKB7xn4hJdwxYandovxC8",Y=oee(uee,dee,{auth:{storage:cee(),persistSession:!0,autoRefreshToken:!0}}),fee=Object.freeze(Object.defineProperty({__proto__:null,supabase:Y},Symbol.toStringTag,{value:"Module"})),tv={subscribed:!1,trialing:!1,hadTrial:!1,subscriptionEnd:null,trialEnd:null,loading:!0},A4=b.createContext({session:null,user:null,loading:!0,isAdmin:!1,isTeamMember:!1,subscription:tv,startingTrial:!1,refreshSubscription:async()=>{},signOut:async()=>{}}),Mt=()=>b.useContext(A4),hee=({children:e})=>{const[t,n]=b.useState(null),[r,i]=b.useState(null),[a,s]=b.useState(!0),[l,c]=b.useState(!1),[u,d]=b.useState(!1),[f,h]=b.useState(tv),p=b.useRef(!1),g=b.useCallback(async()=>{let S=null;for(let _=0;_<3;_++)try{const j=await Y.functions.invoke("check-subscription");if(j.error)throw j.error;S=j.data;break}catch{_<2&&await new Promise(j=>setTimeout(j,800*2**_))}if(S){h({subscribed:S.subscribed,trialing:S.trialing||!1,hadTrial:S.had_trial||!1,subscriptionEnd:S.subscription_end,trialEnd:S.trial_end||null,loading:!1});return}try{const{data:{user:_}}=await Y.auth.getUser();if(_){const{data:j}=await Y.from("user_subscriptions").select("*").eq("user_id",_.id).maybeSingle();
626if(j){const k=j.trial_end?new Date(j.trial_end).getTime()>Date.now():!1,C=j.status==="active"||j.status==="trialing"&&k;h({subscribed:C,trialing:j.status==="trialing"&&k,hadTrial:!0,subscriptionEnd:j.current_period_end,trialEnd:j.trial_end,loading:!1});return}}}catch{}h(_=>({..._,loading:!1}))},[]),m=b.useCallback(async S=>{const[_,j,k]=await Promise.all([Y.from("user_roles").select("role").eq("user_id",S).eq("role","admin").maybeSingle(),Y.from("team_members").select("id").eq("member_id",S).eq("status","accepted").limit(1),Y.from("user_subscriptions").select("*").eq("user_id",S).maybeSingle()]);c(!!_.data),d(!!(j.data&&j.data.length>0));let C=null;if(k.data){const E=k.data,A=E.trial_end?new Date(E.trial_end).getTime()>Date.now():!1,P=E.status==="trialing"&&A,T=E.status==="active"||P;if(C={subscribed:T,trialing:P,hadTrial:!0,subscriptionEnd:E.current_period_end,trialEnd:E.trial_end,loading:!1},T){h(C);return}}if(j.data&&j.data.length>0){const{data:E}=await Y.from("team_members").select("owner_id").eq("member_id",S).eq("status","accepted");if(E&&E.length>0)for(const A of E){const{data:P}=await Y.from("user_subscriptions").select("*").eq("user_id",A.owner_id).maybeSingle();if(P){const T=P.trial_end?new Date(P.trial_end).getTime()>Date.now():!1;if(P.status==="active"||P.status==="trialing"&&T){h({subscribed:!0,trialing:P.status==="trialing",hadTrial:!0,subscriptionEnd:P.current_period_end,trialEnd:P.trial_end,loading:!1});return}}}}if(C){h(C),g();return}g()},[g]);b.useEffect(()=>{Y.auth.getSession().then(({data:{session:_}})=>{n(_),i((_==null?void 0:_.user)??null),s(!1),p.current=!0,_!=null&&_.user?m(_.user.id):(c(!1),h({...tv,loading:!1}))});const{data:{subscription:S}}=Y.auth.onAuthStateChange((_,j)=>{p.current&&(n(j),i((j==null?void 0:j.user)??null),s(!1),j!=null&&j.user?m(j.user.id):(c(!1),d(!1),h({...tv,loading:!1})))});return()=>S.unsubscribe()},[m]),b.useEffect(()=>{if(!r)return;const S=Y.channel("user-subscription-changes").on("postgres_changes",{event:"*",schema:"public",table:"user_subscriptions",filter:`user_id=eq.${r.id}`},_=>{const j=_.new;if(j){const k=j.status==="active"||j.status==="trialing";h({subscribed:k,trialing:j.status==="trialing",hadTrial:!0,subscriptionEnd:j.current_period_end,trialEnd:j.trial_end,loading:!1})}}).subscribe();return()=>{Y.removeChannel(S)}},[r]),b.useEffect(()=>{if(!r)return;const S=setInterval(g,6e4);return()=>clearInterval(S)},[r,g]);const v=b.useRef(!1),[x,y]=b.useState(!1);b.useEffect(()=>{r&&(f.loading||f.subscribed||f.trialing||l||u||v.current||(v.current=!0,y(!0),(async()=>{const S=async()=>{const{data:_,error:j}=await Y.functions.invoke("start-trial");if(j)throw j;return _};try{let _=null,j=null;for(let k=0;k<3;k++)try{_=await S(),j=null;break}catch(C){j=C,k<2&&await new Promise(E=>setTimeout(E,1e3*2**k))}if(j)throw j;_!=null&&_.started&&G.success("Your 7-day free trial has started — up to 200 reviews included."),await g()}catch(_){console.error("start-trial failed after retries",_),v.current=!1}finally{y(!1)}})()))},[r==null?void 0:r.id,f.loading,f.subscribed,f.trialing,l,u,g]);const w=async()=>{await Y.auth.signOut()};return o.jsx(A4.Provider,{value:{session:t,user:r,loading:a,isAdmin:l,isTeamMember:u,subscription:f,startingTrial:x,refreshSubscription:g,signOut:w},children:e})};var Z0="focusScope.autoFocusOnMount",ew="focusScope.autoFocusOnUnmount",mO={bubbles:!1,cancelable:!0},pee="FocusScope",im=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[l,c]=b.useState(null),u=Ar(i),d=Ar(a),f=b.useRef(null),h=Qe(t,m=>c(m)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let m=function(w){if(p.paused||!l)return;const S=w.target;l.contains(S)?f.current=S:Ps(f.current,{select:!0})},v=function(w){if(p.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||Ps(f.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const _ of w)_.removedNodes.length>0&&Ps(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const y=new MutationObserver(x);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),y.disconnect()}}},[r,l,p.paused]),b.useEffect(()=>{if(l){vO.add(p);
vendor: 6,230 bytes, line 626
626const m=document.activeElement;if(!l.contains(m)){const x=new CustomEvent(Z0,mO);l.addEventListener(Z0,u),l.dispatchEvent(x),x.defaultPrevented||(mee(bee(T4(l)),{select:!0}),document.activeElement===m&&Ps(l))}return()=>{l.removeEventListener(Z0,u),setTimeout(()=>{const x=new CustomEvent(ew,mO);l.addEventListener(ew,d),l.dispatchEvent(x),x.defaultPrevented||Ps(m??document.body,{select:!0}),l.removeEventListener(ew,d),vO.remove(p)},0)}}},[l,u,d,p]);const g=b.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,x=document.activeElement;if(v&&x){const y=m.currentTarget,[w,S]=gee(y);w&&S?!m.shiftKey&&x===S?(m.preventDefault(),n&&Ps(w,{select:!0})):m.shiftKey&&x===w&&(m.preventDefault(),n&&Ps(S,{select:!0})):x===y&&m.preventDefault()}},[n,r,p.paused]);return o.jsx(Ce.div,{tabIndex:-1,...s,ref:h,onKeyDown:g})});im.displayName=pee;function mee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ps(r,{select:t}),document.activeElement!==n)return}function gee(e){const t=T4(e),n=gO(t,e),r=gO(t.reverse(),e);return[n,r]}function T4(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gO(e,t){for(const n of e)if(!vee(n,{upTo:t}))return n}function vee(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 yee(e){return e instanceof HTMLInputElement&&"select"in e}function Ps(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yee(e)&&t&&e.select()}}var vO=xee();function xee(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yO(e,t),e.unshift(t)},remove(t){var n;e=yO(e,t),(n=e[0])==null||n.resume()}}}function yO(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bee(e){return e.filter(t=>t.tagName!=="A")}var tw=0;function qx(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xO()),document.body.insertAdjacentElement("beforeend",e[1]??xO()),tw++,()=>{tw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),tw--}},[])}function xO(){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 pa=function(){return pa=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},pa.apply(this,arguments)};function R4(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function wee(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var nv="right-scroll-bar-position",rv="width-before-scroll-bar",_ee="with-scroll-bars-hidden",jee="--removed-body-scroll-bar-size";function nw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function See(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var kee=typeof window<"u"?b.useLayoutEffect:b.useEffect,bO=new WeakMap;function Nee(e,t){var n=See(null,function(r){return e.forEach(function(i){return nw(i,r)})});return kee(function(){var r=bO.get(n);if(r){var i=new Set(r),a=new Set(e),s=n.current;i.forEach(function(l){a.has(l)||nw(l,null)}),a.forEach(function(l){i.has(l)||nw(l,s)})}bO.set(n,e)},[e]),n}function Cee(e){return e}function Eee(e,t){t===void 0&&(t=Cee);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(a),s=n}var c=function(){var d=s;s=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return i}function Pee(e){e===void 0&&(e={});var t=Eee(null);return t.options=pa({async:!0,ssr:!1},e),t}var I4=function(e){var t=e.sideCar,n=R4(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 b.createElement(r,pa({},n))};I4.isSideCarExport=!0;function Oee(e,t){return e.useMedium(t),I4}var M4=Pee(),rw=function(){},Vx=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:rw,onWheelCapture:rw,onTouchMoveCapture:rw}),i=r[0],a=r[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,x=e.as,y=x===void 0?"div":x,w=e.gapMode,S=R4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,j=Nee([n,t]),k=pa(pa({},S),i);return b.createElement(b.Fragment,null,d&&b.createElement(_,{sideCar:M4,removeScrollBar:u,shards:f,noRelative:p,noIsolation:g,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:w}),s?b.cloneElement(b.Children.only(l),pa(pa({},k),{ref:j})):b.createElement(y,pa({}
vendor: 4,204 bytes, lines 626-663
626,k,{className:c,ref:j}),l))});Vx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vx.classNames={fullWidth:rv,zeroRight:nv};var Aee=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Tee(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Aee();return t&&e.setAttribute("nonce",t),e}function Ree(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Iee(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Mee=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Tee())&&(Ree(t,n),Iee(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$ee=function(){var e=Mee();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$4=function(){var e=$ee(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Dee={left:0,top:0,right:0,gap:0},iw=function(e){return parseInt(e||"",10)||0},Lee=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[iw(n),iw(r),iw(i)]},Fee=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Dee;var t=Lee(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])}},Bee=$4(),fu="data-scroll-locked",Uee=function(e,t,n,r){var i=e.left,a=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
627  .`.concat(_ee,` {
628   overflow: hidden `).concat(r,`;
629   padding-right: `).concat(l,"px ").concat(r,`;
630  }
631  body[`).concat(fu,`] {
632    overflow: hidden `).concat(r,`;
633    overscroll-behavior: contain;
634    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
635    padding-left: `.concat(i,`px;
636    padding-top: `).concat(a,`px;
637    padding-right: `).concat(s,`px;
638    margin-left:0;
639    margin-top:0;
640    margin-right: `).concat(l,"px ").concat(r,`;
641    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
642  }
643  
644  .`).concat(nv,` {
645    right: `).concat(l,"px ").concat(r,`;
646  }
647  
648  .`).concat(rv,` {
649    margin-right: `).concat(l,"px ").concat(r,`;
650  }
651  
652  .`).concat(nv," .").concat(nv,` {
653    right: 0 `).concat(r,`;
654  }
655  
656  .`).concat(rv," .").concat(rv,` {
657    margin-right: 0 `).concat(r,`;
658  }
659  
660  body[`).concat(fu,`] {
661    `).concat(jee,": ").concat(l,`px;
662  }
663`)},wO=function(){var e=parseInt(document.body.getAttribute(fu)||"0",10);return isFinite(e)?e:0},zee=function(){b.useEffect(function(){return document.body.setAttribute(fu,(wO()+1).toString()),function(){var e=wO()-1;e<=0?document.body.removeAttribute(fu):document.body.setAttribute(fu,e.toString())}},[])},Wee=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;zee();var a=b.useMemo(function(){return Fee(i)},[i]);return b.createElement(Bee,{styles:Uee(a,!t,i,n?"":"!important")})},B_=!1;if(typeof window<"u")try{var mg=Object.defineProperty({},"passive",{get:function(){return B_=!0,!0}});window.addEventListener("test",mg,mg),window.removeEventListener("test",mg,mg)}catch{B_=!1}var jc=B_?{passive:!1}:!1,Hee=function(e){return e.tagName==="TEXTAREA"},D4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Hee(e)&&n[t]==="visible")},qee=function(e){return D4(e,"overflowY")},Vee=function(e){return D4(e,"overflowX")},_O=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=L4(e,r);if(i){var a=F4(e,r),s=a[1],l=a[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Kee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},L4=function(e,t){return e==="v"?qee(t):Vee(t)},F4=function(e,t){return e==="v"?Gee(t):Kee(t)},Yee=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xee=function(e,t,n,r,i){var a=Yee(e,window.getComputedStyle(t).direction),s=a*r,l=n.target,c=t.contains(l),u=!1,d=s>0,f=0,h=0;
vendor: 4,259 bytes, lines 663-666
663do{if(!l)break;var p=F4(e,l),g=p[0],m=p[1],v=p[2],x=m-v-a*g;(g||x)&&L4(e,l)&&(f+=x,h+=g);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!i)||!d&&(Math.abs(h)<1||!i))&&(u=!0),u},gg=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jO=function(e){return[e.deltaX,e.deltaY]},SO=function(e){return e&&"current"in e?e.current:e},Qee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Jee=function(e){return`
664  .block-interactivity-`.concat(e,` {pointer-events: none;}
665  .allow-interactivity-`).concat(e,` {pointer-events: all;}
666`)},Zee=0,Sc=[];function ete(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(Zee++)[0],a=b.useState($4)[0],s=b.useRef(e);b.useEffect(function(){s.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=wee([e.lockRef.current],(e.shards||[]).map(SO),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=b.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var x=gg(m),y=n.current,w="deltaX"in m?m.deltaX:y[0]-x[0],S="deltaY"in m?m.deltaY:y[1]-x[1],_,j=m.target,k=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&k==="h"&&j.type==="range")return!1;var C=_O(k,j);if(!C)return!0;if(C?_=k:(_=k==="v"?"h":"v",C=_O(k,j)),!C)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=_),!_)return!0;var E=r.current||_;return Xee(E,v,m,E==="h"?w:S,!0)},[]),c=b.useCallback(function(m){var v=m;if(!(!Sc.length||Sc[Sc.length-1]!==a)){var x="deltaY"in v?jO(v):gg(v),y=t.current.filter(function(_){return _.name===v.type&&(_.target===v.target||v.target===_.shadowParent)&&Qee(_.delta,x)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(SO).filter(Boolean).filter(function(_){return _.contains(v.target)}),S=w.length>0?l(v,w[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),u=b.useCallback(function(m,v,x,y){var w={name:m,delta:v,target:x,should:y,shadowParent:tte(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=b.useCallback(function(m){n.current=gg(m),r.current=void 0},[]),f=b.useCallback(function(m){u(m.type,jO(m),m.target,l(m,e.lockRef.current))},[]),h=b.useCallback(function(m){u(m.type,gg(m),m.target,l(m,e.lockRef.current))},[]);b.useEffect(function(){return Sc.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,jc),document.addEventListener("touchmove",c,jc),document.addEventListener("touchstart",d,jc),function(){Sc=Sc.filter(function(m){return m!==a}),document.removeEventListener("wheel",c,jc),document.removeEventListener("touchmove",c,jc),document.removeEventListener("touchstart",d,jc)}},[]);var p=e.removeScrollBar,g=e.inert;return b.createElement(b.Fragment,null,g?b.createElement(a,{styles:Jee(i)}):null,p?b.createElement(Wee,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tte(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nte=Oee(M4,ete);var am=b.forwardRef(function(e,t){return b.createElement(Vx,pa({},e,{ref:t,sideCar:nte}))});am.classNames=Vx.classNames;var rte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},kc=new WeakMap,vg=new WeakMap,yg={},aw=0,B4=function(e){return e&&(e.host||B4(e.parentNode))},ite=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=B4(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})},ate=function(e,t,n,r){var i=ite(t,Array.isArray(e)?e:[e]);yg[n]||(yg[n]=new WeakMap);var a=yg[n],s=[],l=new Set,c=new Set(i),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};
vendor: 4,557 bytes, line 666
666i.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",m=(kc.get(h)||0)+1,v=(a.get(h)||0)+1;kc.set(h,m),a.set(h,v),s.push(h),m===1&&g&&vg.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return d(t),l.clear(),aw++,function(){s.forEach(function(f){var h=kc.get(f)-1,p=a.get(f)-1;kc.set(f,h),a.set(f,p),h||(vg.has(f)||f.removeAttribute(r),vg.delete(f)),p||f.removeAttribute(n)}),aw--,aw||(kc=new WeakMap,kc=new WeakMap,vg=new WeakMap,yg={})}},Gx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=rte(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),ate(r,i,n,"aria-hidden")):function(){return null}},Kx="Dialog",[U4,z4]=Fn(Kx),[ste,Zi]=U4(Kx),W4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,l=b.useRef(null),c=b.useRef(null),[u,d]=Tr({prop:r,defaultProp:i??!1,onChange:a,caller:Kx});return o.jsx(ste,{scope:t,triggerRef:l,contentRef:c,contentId:Pr(),titleId:Pr(),descriptionId:Pr(),open:u,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(f=>!f),[d]),modal:s,children:n})};W4.displayName=Kx;var H4="DialogTrigger",q4=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Zi(H4,n),a=Qe(t,i.triggerRef);return o.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":_N(i.open),...r,ref:a,onClick:me(e.onClick,i.onOpenToggle)})});q4.displayName=H4;var bN="DialogPortal",[ote,V4]=U4(bN,{forceMount:void 0}),G4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Zi(bN,t);return o.jsx(ote,{scope:t,forceMount:n,children:b.Children.map(r,s=>o.jsx(pr,{present:n||a.open,children:o.jsx(Ad,{asChild:!0,container:i,children:s})}))})};G4.displayName=bN;var Kv="DialogOverlay",K4=b.forwardRef((e,t)=>{const n=V4(Kv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Zi(Kv,e.__scopeDialog);return a.modal?o.jsx(pr,{present:r||a.open,children:o.jsx(cte,{...i,ref:t})}):null});K4.displayName=Kv;var lte=wo("DialogOverlay.RemoveScroll"),cte=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Zi(Kv,n);return o.jsx(am,{as:lte,allowPinchZoom:!0,shards:[i.contentRef],children:o.jsx(Ce.div,{"data-state":_N(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ql="DialogContent",Y4=b.forwardRef((e,t)=>{const n=V4(ql,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Zi(ql,e.__scopeDialog);return o.jsx(pr,{present:r||a.open,children:a.modal?o.jsx(ute,{...i,ref:t}):o.jsx(dte,{...i,ref:t})})});Y4.displayName=ql;var ute=b.forwardRef((e,t)=>{const n=Zi(ql,e.__scopeDialog),r=b.useRef(null),i=Qe(t,n.contentRef,r);return b.useEffect(()=>{const a=r.current;if(a)return Gx(a)},[]),o.jsx(X4,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&a.preventDefault()}),onFocusOutside:me(e.onFocusOutside,a=>a.preventDefault())})}),dte=b.forwardRef((e,t)=>{const n=Zi(ql,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return o.jsx(X4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.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"&&(i.current=!0));const s=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),X4=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=e,l=Zi(ql,n),c=b.useRef(null),u=Qe(t,c);return qx(),o.jsxs(o.Fragment,{children:[o.jsx(im,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:o.jsx(ic,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":_N(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(hte,{titleId:l.titleId}),o.jsx(mte,{contentRef:c,descriptionId:l.descriptionId})]})]})}),wN="DialogTitle",Q4=b.forwardRef((e,t)=>
666{const{__scopeDialog:n,...r}=e,i=Zi(wN,n);return o.jsx(Ce.h2,{id:i.titleId,...r,ref:t})});Q4.displayName=wN;var J4="DialogDescription",Z4=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Zi(J4,n);return o.jsx(Ce.p,{id:i.descriptionId,...r,ref:t})});Z4.displayName=J4;var eL="DialogClose",tL=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Zi(eL,n);return o.jsx(Ce.button,{type:"button",...r,ref:t,onClick:me(e.onClick,()=>i.onOpenChange(!1))})});tL.displayName=eL;function _N(e){return e?"open":"closed"}var nL="DialogTitleWarning",[fte,rL]=jG(nL,{contentName:ql,titleName:wN,docsSlug:"dialog"}),hte=({titleId:e})=>{const t=rL(nL),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
667
668If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
669
670For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pte="DialogDescriptionWarning",mte=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rL(pte).contentName}}.`;return b.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},jN=W4,iL=q4,SN=G4,sm=K4,om=Y4,lm=Q4,cm=Z4,Yx=tL;const gte=jN,vte=iL,yte=SN,aL=b.forwardRef(({className:e,...t},n)=>o.jsx(sm,{className:he("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}));aL.displayName=sm.displayName;const xte=Td("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"}}),sL=b.forwardRef(({side:e="right",className:t,children:n,...r},i)=>o.jsxs(yte,{children:[o.jsx(aL,{}),o.jsxs(om,{ref:i,className:he(xte({side:e}),t),...r,children:[n,o.jsxs(Yx,{className:"absolute right-4 top-4 roun
670ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[o.jsx(Ro,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sL.displayName=om.displayName;const bte=b.forwardRef(({className:e,...t},n)=>o.jsx(lm,{ref:n,className:he("text-lg font-semibold text-foreground",e),...t}));bte.displayName=lm.displayName;const wte=b.forwardRef(({className:e,...t},n)=>o.jsx(cm,{ref:n,className:he("text-sm text-muted-foreground",e),...t}));wte.displayName=cm.displayName;const sc=jN,_te=SN,oL=b.forwardRef(({className:e,...t},n)=>o.jsx(sm,{ref:n,className:he("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}));oL.displayName=sm.displayName;const Mo=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(_te,{children:[o.jsx(oL,{}),o.jsxs(om,{ref:r,className:he("fixed left-[50%] top-[50%] z-50 grid max-h-[90vh] w-[calc(100%-1.5rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-lg border bg-background p-4 shadow-lg sm:w-full sm:p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,o.jsxs(Yx,{className:"absolute right-4 top-4 roun
670ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[o.jsx(Ro,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Mo.displayName=om.displayName;const $o=({className:e,...t})=>o.jsx("div",{className:he("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$o.displayName="DialogHeader";const sa=({className:e,...t})=>o.jsx("div",{className:he("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sa.displayName="DialogFooter";const Do=b.forwardRef(({className:e,...t},n)=>o.jsx(lm,{ref:n,className:he("text-lg font-semibold leading-none tracking-tight",e),...t}));Do.displayName=lm.displayName;const kN=b.forwardRef(({className:e,...t},n)=>o.jsx(cm,{ref:n,className:he("text-sm text-muted-foreground",e),...t}));kN.displayName=cm.displayName;const Hu=Td("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors 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",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},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"}}),X=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const s=r?kG:"button";return o.jsx(s,{className:he(Hu({variant:t,size:n,className:e})),ref:a,...i})});X.displayName="Button";const $n=(e,t={})=>{(async()=>{var n,r;try{const{data:i}=await Y.auth.getSession(),a=(r=(n=i.session)==null?void 0:n.user)==null?void 0:r.id;if(!a)return;await Y.from("onboarding_events").insert({user_id:a,event:e,metadata:t})}catch(i){console.warn("onboarding event failed",i)}})()},jte=()=>{const{user:e}=Mt(),t=ps(),[n,r]=b.useState(!1);b.useEffect(()=>{if(!e)return;(async()=>{const{data:l}=await Y.from("profiles").select("welcome_seen").eq("user_id",e.id).maybeSingle();l&&!l.welcome_seen&&(r(!0),$n("welcome_shown"))})()},[e]);const i=async(s="dismissed")=>{r(!1),s==="dismissed"&&$n("welcome_dismissed"),e&&await Y.from("profiles").update({welcome_seen:!0}).eq("user_id",e.id)},a=async()=>{$n("welcome_get_started"),await i("get_started"),t("/businesses?add=true")};return o.jsx(sc,{open:n,onOpenChange:s=>!s&&i(),children:o.jsxs(Mo,{className:"sm:max-w-md",children:[o.jsxs($o,{className:"text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10",children:o.jsx(bn,{className:"h-8 w-8 text-primary"})}),o.jsx(Do,{className:"font-display text-2xl",children:"Welcome to Review Kit! 🎉"}),o.jsx(kN,{className:"text-base",children:"Your 7-day free trial is active. Here's what you can do:"})]}),o.jsxs("div",{className:"space-y-3 py-4",children:[o.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[o.jsx(Jr,{className:"mt-0.5 h-5 w-5 shrink-0 text-primary"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Add your business"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect Google or TripAdvisor to sync reviews"})]})]}),o.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[o.jsx(Bu,{className:"mt-0.5 h-5 w-5 shrink-0 text-primary"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"AI-powered replies"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate professional responses in seconds"})]})]}),o.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-border p-3",children:[o.jsx(Px,{className:"mt-0.5 h-5 w-5 shrink-0 text-primary"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Analytics & insights"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Track sentiment trends and review performance"})]})]})]}),o.jsx(X,{onClick:a,className:"w-full",size:"lg",children:"Get Started — Add Your Business"})]})})},Ste=()=>{const{subscription:e,isAdmin:t}=Mt();if(t||e.loading||!e.trialing)return null;let n=null;if(e.trialEnd){const r=new Date(e.trialEnd).getTime()-Date.now();n=Math.max(0,Math.ceil(r/(1e3*60*60*24)))}return o.jsx("div",{className:"w-full bg-primary text-primary-foreground",children:o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-1 px-4 py-2 text-sm",children:[o.jsx(bn,{className:"h-4 w-4 shrink-0"}),o.jsxs("span",{className:"font-medium",children:["You're on a free trial",n!==null&&o.jsxs(o.Fragment,{children:[" — ",n," day",n===1?"":"s"," left"]}),". Limited to 200 reviews."]}),o.jsx(on,{to:"/settings?tab=billing",className:"rounded-md bg-primary-foreground
670/15 px-3 py-1 text-xs font-semibold underline-offset-2 hover:bg-primary-foreground/25 hover:underline",children:"Upgrade to keep your account active"})]})})},Qo={count:"exact",head:!0},NN=()=>{const{user:e}=Mt(),t=_i(),{data:n,isLoading:r}=Na({queryKey:["onboarding-checklist",e==null?void 0:e.id],enabled:!!e,staleTime:3e4,queryFn:async()=>{var S;const d=e.id,[f,h,p,g,m,v,x,y]=await Promise.all([Y.from("businesses").select("id",Qo).eq("user_id",d),Y.from("businesses").select("id",Qo).eq("user_id",d).or("tripadvisor_url.not.is.null,trustpilot_url.not.is.null,getyourguide_url.not.is.null,yelp_url.not.is.null,google_place_id.not.is.null"),Y.from("reviews").select("id",Qo).eq("user_id",d),Y.from("reviews").select("id",Qo).eq("user_id",d).not("reply","is",null),Y.from("review_invitations").select("id",Qo).eq("user_id",d).not("sent_at","is",null),Y.from("profiles").select("checklist_collapsed").eq("user_id",d).maybeSingle(),Y.from("businesses").select("id",Qo).eq("user_id",d).not("review_page_logo_url","is",null).not("review_page_description","is",null),Y.from("review_links").select("id",Qo)]);return{steps:{connect_business:(f.count??0)>0,connect_platform:(h.count??0)>0,import_reviews:(p.count??0)>0,brand_profile:(x.count??0)>0,review_links:(y.count??0)>0,reply_review:(g.count??0)>0,send_invite:(m.count??0)>0},collapsed:((S=v.data)==null?void 0:S.checklist_collapsed)??!1}}}),i=(n==null?void 0:n.steps)??{connect_business:!1,connect_platform:!1,import_reviews:!1,brand_profile:!1,review_links:!1,reply_review:!1,send_invite:!1},a=Object.values(i).filter(Boolean).length,s=7,l=a===s,c=async d=>{e&&(await Y.from("profiles").update({checklist_collapsed:d}).eq("user_id",e.id),await t.invalidateQueries({queryKey:["onboarding-checklist",e.id]}))},u=()=>{e&&t.invalidateQueries({queryKey:["onboarding-checklist",e.id]})};return{steps:i,completedCount:a,totalCount:s,allComplete:l,collapsed:(n==null?void 0:n.collapsed)??!1,loading:r,setCollapsed:c,refresh:u}},kte=1,Nte="cf7d8836-f051-4de0-ae89-002db9e22f12",Cte="5450cc4f-4646-4831-99a5-ba4247c15425",Ete="/__l5e/assets-v1/cf7d8836-f051-4de0-ae89-002db9e22f12/logo-icon.png",Pte="a/v1/5450cc4f-4646-4831-99a5-ba4247c15425/cf7d8836-f051-4de0-ae89-002db9e22f12/logo-icon.png",Ote="logo-icon.png",Ate=20305,Tte="image/png",Rte="2026-09-02T09:16:28Z",um={version:kte,asset_id:Nte,project_id:Cte,url:Ete,r2_key:Pte,original_filename:Ote,size:Ate,content_type:Tte,created_at:Rte},sw=um.url,Ite=[{label:"Dashboard",icon:Px,path:"/",requiresPlan:!0},{label:"Getting Started",icon:x5,path:"/getting-started",requiresPlan:!1},{label:"Businesses",icon:Jr,path:"/businesses",requiresPlan:!1},{label:"Reviews",icon:Bu,path:"/reviews",requiresPlan:!0},{label:"Chat",icon:b5,path:"/chat",requiresPlan:!0},{label:"Invite",icon:ac,path:"/invitations",requiresPlan:!0},{label:"Settings",icon:WK,path:"/settings",requiresPlan:!1}],Qn=({children:e})=>{const{user:t,signOut:n,subscription:r,isAdmin:i,startingTrial:a}=Mt(),s=Ao(),l=NN(),c=!l.loading&&!l.allComplete,u=r.subscribed||i||a||!r.hadTrial,[d,f]=b.useState(!1),h=b.useRef(!1),p=()=>{h.current||(h.current=!0,G.info("Your trial has ended — pick a plan to unlock this page."))},g=[...Ite,...i?[{label:"Admin",icon:j5,path:"/admin",requiresPlan:!1}]:[]];return o.jsxs("div",{className:"flex min-h-screen bg-background",children:[o.jsx("aside",{className:"hidden w-64 border-r border-border bg-card lg:block sticky top-0 h-screen",children:o.jsxs("div",{className:"flex h-full flex-col",children:[o.jsxs("a",{href:"https://reviewkit.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 border-b border-border px-6 py-5 hover:opacity-80 transition-opacity",children:[o.jsx("img",{src:sw,alt:"Review Kit",className:"h-6 w-6"}),o.jsx("span",{className:"font-display text-xl font-bold text-foreground",children:"Review Kit"})]}),o.jsx("nav",{className:"flex-1 space-y-1 overflow-auto p-4",children:g.map(m=>{const v=s.pathname===m.path;return m.requiresPlan&&!u&&!r.loading?o.jsxs(on,{to:"/settings?tab=billing",onClick:p,className:"flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium text-muted-foreground
670/50 cursor-not-allowed hover:bg-accent/50 transition-colors",children:[o.jsx(m.icon,{className:"h-4 w-4"}),m.label,o.jsx(Fu,{className:"h-3 w-3 ml-auto"})]},m.path):o.jsxs(on,{to:m.path,className:`flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors ${v?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"}`,children:[o.jsx(m.icon,{className:"h-4 w-4"}),m.label,m.path==="/getting-started"&&c&&o.jsxs("span",{className:`ml-auto rounded-full px-2 py-0.5 text-xs font-semibold ${v?"bg-primary-foreground/20 text-primary-foreground":"bg-primary/10 text-primary"}`,children:[l.completedCount,"/",l.totalCount]})]},m.path)})}),o.jsxs("div",{className:"shrink-0 border-t border-border p-4",children:[o.jsxs("a",{href:"https://reviewkit.com/book-a-demo",target:"_blank",rel:"noopener noreferrer",className:"mb-3 flex items-center gap-3 rounded-lg border border-primary/30 bg-primary/5 px-3 py-2.5 text-sm font-semibold text-primary transition-colors hover:bg-primary/10",children:[o.jsx(b_,{className:"h-4 w-4"}),"Book a demo"]}),o.jsxs("a",{href:"https://reviewkit.com/support",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[o.jsx(S2,{className:"h-4 w-4"}),"Help & Support"]}),o.jsxs(on,{to:"/settings",className:"mt-3 mb-3 flex items-center gap-3 truncate rounded-lg px-3 py-2.5 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[o.jsx(Wl,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"truncate",children:t==null?void 0:t.email})]}),o.jsxs(X,{variant:"ghost",className:"w-full justify-start gap-3 text-muted-foreground",onClick:n,children:[o.jsx(H0,{className:"h-4 w-4"}),"Sign out"]})]})]})}),o.jsxs("div",{className:"flex min-w-0 max-w-full flex-1 flex-col",children:[o.jsx(Ste,{}),o.jsx("header",{className:"sticky top-0 z-30 border-b border-border bg-card lg:hidden",children:o.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[o.jsxs(gte,{open:d,onOpenChange:f,children:[o.jsx(vte,{asChild:!0,children:o.jsx(X,{variant:"ghost",size:"icon","aria-label":"Open menu",children:o.jsx(MK,{className:"h-5 w-5"})})}),o.jsx(sL,{side:"left",className:"w-[17rem] p-0",children:o.jsxs("div",{className:"flex h-full flex-col",children:[o.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-5 py-4",children:[o.jsx("img",{src:sw,alt:"Review Kit",className:"h-6 w-6"}),o.jsx("span",{className:"font-display text-lg font-bold",children:"Review Kit"})]}),o.jsx("nav",{className:"flex-1 space-y-1 overflow-auto p-3",children:g.map(m=>{const v=s.pathname===m.path,x=m.requiresPlan&&!u&&!r.loading;return o.jsxs(on,{to:x?"/settings?tab=billing":m.path,onClick:()=>{x&&p(),f(!1)},className:`flex items-center gap-3 rounded-lg px-3 py-3 text-sm font-medium transition-colors ${x?"text-muted-foreground/50":v?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"}`,children:[x?o.jsx(Fu,{className:"h-4 w-4"}):o.jsx(m.icon,{className:"h-4 w-4"}),m.label,m.path==="/getting-started"&&c&&o.jsxs("span",{className:`ml-auto rounded-full px-2 py-0.5 text-xs font-semibold ${v?"bg-primary-foreground/20 text-primary-foreground":"bg-primary/10 text-primary"}`,children:[l.completedCount,"/",l.totalCount]})]},m.path)})}),o.jsxs("div",{className:"shrink-0 border-t border-border p-3",children:[o.jsxs("a",{href:"https://reviewkit.com/book-a-demo",target:"_blank",rel:"noopener noreferrer",className:"mb-1 flex items-center gap-3 rounded-lg border border-primary/30 bg-primary/5 px-3 py-3 text-sm font-semibold text-primary transition-colors hover:bg-primary/10",children:[o.jsx(b_,{className:"h-4 w-4"}),"Book a demo"]}),o.jsxs("a",{href:"https://reviewkit.com/support",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 rounded-lg px-3 py-3 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-colors",children:[o.jsx(S2,{className:"h-4 w-4"}),"Help & Support"]}),o.jsxs("div",{className:"flex items-center gap-2 truncate px-3 py-2 text-xs text-muted-foreground",children:[o.jsx(Wl,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{className:"truncate",children:t==null?void 0:t.email})]}),o.jsxs(X,{variant:"ghost",className:"w-full justify-start gap-3 text-muted-foreground",onClick:()=>{f(!1),n()},children:[o.jsx(H0,{className:"h-4 w-4"}),"Sign out"]})]})]})})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("img",{src:sw,alt:"Review 
670Kit",className:"h-5 w-5"}),o.jsx("span",{className:"font-display text-lg font-bold",children:"Review Kit"})]}),o.jsx(X,{variant:"ghost",size:"icon",onClick:n,"aria-label":"Sign out",children:o.jsx(H0,{className:"h-4 w-4"})})]})}),o.jsx("main",{className:"flex-1 overflow-auto p-4 lg:p-8",children:e}),o.jsx(jte,{})]})]})},pe=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:he("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));pe.displayName="Card";const ze=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:he("flex flex-col space-y-1.5 p-6",e),...t}));ze.displayName="CardHeader";const We=b.forwardRef(({className:e,...t},n)=>o.jsx("h3",{ref:n,className:he("text-2xl font-semibold leading-none tracking-tight",e),...t}));We.displayName="CardTitle";const ft=b.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:he("text-sm text-muted-foreground",e),...t}));ft.displayName="CardDescription";const de=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:he("p-6 pt-0",e),...t}));de.displayName="CardContent";const qu=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:he("flex items-center p-6 pt-0",e),...t}));qu.displayName="CardFooter";const Vf=({children:e})=>{const{subscription:t,isAdmin:n,startingTrial:r}=Mt(),i=ps();return n?o.jsx(o.Fragment,{children:e}):t.loading?o.jsx(Qn,{children:o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsx(ke,{className:"h-8 w-8 animate-spin text-primary"})})}):t.subscribed||r||!t.hadTrial?o.jsx(o.Fragment,{children:e}):o.jsx(Qn,{children:o.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:o.jsx(pe,{className:"max-w-md w-full animate-fade-in",children:o.jsxs(de,{className:"flex flex-col items-center text-center py-12 px-6",children:[o.jsx("div",{className:"mb-4 rounded-full bg-destructive/10 p-4",children:o.jsx(qK,{className:"h-8 w-8 text-destructive"})}),o.jsx("h2",{className:"font-display text-xl font-semibold text-foreground mb-2",children:"Subscription Required"}),o.jsx("p",{className:"text-muted-foreground mb-6",children:"Your trial has ended or you don't have an active subscription. Please subscribe to continue using ReviewKit."}),o.jsxs(X,{onClick:()=>i("/settings?tab=billing"),className:"gap-2",children:[o.jsx(Fv,{className:"h-4 w-4"}),"View Plans"]})]})})})})},Mte=async()=>{const e="id, name, address, email, phone, website, google_place_id, google_account_name, google_location_name, tripadvisor_url, trustpilot_url, getyourguide_url, yelp_url, sync_status, sync_message, last_synced_at, review_page_logo_url, review_page_description, reply_tone, reply_instructions, apify_run_id, apify_dataset_id, apify_items_imported, created_at, updated_at, user_id, inbound_token, inbound_enabled, invite_mode, invite_days_after_booking, invite_fallback_days",{data:t,error:n}=await Y.from("businesses").select(e).order("created_at",{ascending:!1});if(n)throw n;return t||[]},Lo=()=>{const{user:e}=Mt(),t=_i(),{data:n=[],isLoading:r}=Na({queryKey:["businesses",e==null?void 0:e.id],queryFn:Mte,enabled:!!e,staleTime:5*60*1e3,refetchInterval:h=>{const p=h.state.data;return(p==null?void 0:p.some(m=>m.sync_status==="syncing"||m.sync_status==="processing"||m.sync_status==="importing"))?5e3:!1}}),i=n.some(h=>h.sync_status==="syncing"||h.sync_status==="processing"||h.sync_status==="importing");!i&&window.__rk_was_syncing?(window.__rk_was_syncing=!1,t.invalidateQueries({queryKey:["reviews"]})):i&&(window.__rk_was_syncing=!0);const a=n.filter(h=>(h.sync_status==="syncing"||h.sync_status==="processing")&&h.apify_run_id).map(h=>h.id).join(",");b.useEffect(()=>{if(!a)return;const h=a.split(",");let p=!1;const g=async()=>{for(const v of h){if(p)return;try{const{data:x}=await Y.functions.invoke("poll-tripadvisor-import",{body:{business_id:v}});((x==null?void 0:x.status)==="complete"||(x==null?void 0:x.status)==="error"||(x==null?void 0:x.newItems)>0)&&(t.invalidateQueries({queryKey:["businesses",e==null?void 0:e.id]}),t.invalidateQueries({queryKey:["reviews"]}))}catch(x){console.error("Global poll error:",x)}}};g();const m=setInterval(g,5e3);return()=>{p=!0,clearInterval(m)}},[a,t,e==null?void 0:e.id]);const s=()=>{t.invalidateQueries({queryKey:["businesses",e==null?void 0:e.id]}),t.invalidateQueries({queryKey:["onboarding-checklist",e==null?void 0:e.id]})},l=async()=>{try{await Y.functions.invoke("sync-subscription-quantity")}catch(h){console.error("Failed to sync subscription quantity:",h)}};return{businesses:n,isLoading:r,addBusiness:async h=>{if(!e)return!1;const{error:p}=await Y.from("businesses").insert({...h,user_id:e.id});return p?(console.error("addBusiness failed",p),G.error(`Couldn't add business: ${p.message}`),$n("add_business_failed",{error:p.message,code:p.code}),!1):(G.success("Business added!"),$n("business_added",{name:h==null?void 0:h.name}),await s(),l(),!0)},createBusinessShell:async h=>{if(!e)return null;const{data:p,error:g}=await Y.from("businesses").insert({name:h,user_id:e.id}).select("id").single();return g||!p?(console.error("createBusinessShell failed",g),G.error(`Couldn't add business: ${(g==null?void 0:g.message)??"unknown error"}`),$n("add_business_failed",{error:g==null?void 0:g.message,code:g==null?void 0:g.code}),null):($n("business_created_pending_connection",{name:h}),await s(),l(),p.id)},updateBusiness:async(h,p)=>{const{error:g}=await Y.from("businesses").update(p).eq("id",h);return g?(G.error("Failed to update business"),!1):(G.success("Business updated!"),await s(),!0)},deleteBusiness:async h=>{const{error:p}=await Y.from("businesses").delete().eq("id",h);return p?(G.error("Failed to delete business"),!1):(G.success("Business deleted"),await s(),l(),!0)},refetch:s}},lL=()=>{const{businesses:e}=Lo(),t=e.filter(r=>r.sync_status==="syncing"||r.sync_status==="processing"||r.sync_status==="importing");if(t.length===0)return null;const n=t.map(r=>r.name).join(", ");return o.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3 animate-fade-in",children:[o.jsx(ke,{className:"h-4 w-4 animate-spin text-primary shrink-0"}),o.jsxs("p",{className:"text-sm text-foreground",children:[o.jsx("span",{className:"font-medium",children:"Syncing reviews"}),o.jsxs("span",{className:"text-muted-foreground",children:[" — ",n,". This may take a few minutes."]})]})]})},$te=({reviews:e})=>{const t=e.length,n=t>0?(e.reduce((l,c)=>l+c.rating,0)/t).toFixed(1):"0.0",r=e.filter(l=>l.sentiment==="positive").length,i=t>0?Math.round(r/t*100):0,a=e.filter(l=>l.reply).length,s=[{label:"Total Reviews",value:t.toString(),icon:Bu,description:"All time"},{label:"Average Rating",value:n,icon:pi,description:"Out of 5.0"},{label:"Positive Sentiment",value:`${i}%`,icon:aN,description:`${r} reviews`},{label:"Response Rate",value:t>0?`${Math.round(a/t*100)}%`:"0%",icon:N5,description:`${a} responded`}];return o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:s.map(l=>o.jsx(pe,{className:"animate-fade-in",children:o.jsxs(de,{className:"flex items-start gap-4 p-6",children:[o.jsx("div",{className:"rounded-lg bg-primary/10 p-2.5",children:o.jsx(l.icon,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:l.label}),o.jsx("p",{className:"font-display text-2xl font-bold text-foreground",children:l.value}),o.jsx("p",{className:"text-xs text-muted-foreground",children:l.description})]})]})},l.label))})};var Dte=Array.isArray,Ir=Dte,Lte=typeof Ys=="object"&&Ys&&Ys.Object===Object&&Ys,cL=Lte,Fte=cL,Bte=typeof self=="object"&&self&&self.Object===Object&&self,Ute=Fte||Bte||Function("return this")(),Ta=Ute,zte=Ta,Wte=zte.Symbol,dm=Wte,kO=dm,uL=Object.prototype,Hte=uL.hasOwnProperty,qte=uL.toString,bf=kO?kO.toStringTag:void 0;function Vte(e){var t=Hte.call(e,bf),n=e[bf];try{e[bf]=void 0;var r=!0}catch{}var i=qte.call(e);return r&&(t?e[bf]=n:delete e[bf]),i}var Gte=Vte,Kte=Object.prototype,Yte=Kte.toString;function Xte(e){return Yte.call(e)}var Qte=Xte,NO=dm,Jte=Gte,Zte=Qte,ene="[object Null]",tne="[object Undef
670ined]",CO=NO?NO.toStringTag:void 0;function nne(e){return e==null?e===void 0?tne:ene:CO&&CO in Object(e)?Jte(e):Zte(e)}var gs=nne;function rne(e){return e!=null&&typeof e=="object"}var vs=rne,ine=gs,ane=vs,sne="[object Symbol]";function one(e){return typeof e=="symbol"||ane(e)&&ine(e)==sne}var Bd=one,lne=Ir,cne=Bd,une=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dne=/^\w*$/;function fne(e,t){if(lne(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||cne(e)?!0:dne.test(e)||!une.test(e)||t!=null&&e in Object(t)}var CN=fne;function hne(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Fo=hne;const Ud=ct(Fo);var pne=gs,mne=Fo,gne="[object AsyncFunction]",vne="[object Function]",yne="[object GeneratorFunction]",xne="[object Proxy]";function bne(e){if(!mne(e))return!1;var t=pne(e);return t==vne||t==yne||t==gne||t==xne}var EN=bne;const De=ct(EN);var wne=Ta,_ne=wne["__core-js_shared__"],jne=_ne,ow=jne,EO=function(){var e=/[^.]+$/.exec(ow&&ow.keys&&ow.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Sne(e){return!!EO&&EO in e}var kne=Sne,Nne=Function.prototype,Cne=Nne.toString;function Ene(e){if(e!=null){try{return Cne.call(e)}catch{}try{return e+""}catch{}}return""}var dL=Ene,Pne=EN,One=kne,Ane=Fo,Tne=dL,Rne=/[\\^$.*+?()[\]{}|]/g,Ine=/^\[object .+?Constructor\]$/,Mne=Function.prototype,$ne=Object.prototype,Dne=Mne.toString,Lne=$ne.hasOwnProperty,Fne=RegExp("^"+Dne.call(Lne).replace(Rne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bne(e){if(!Ane(e)||One(e))return!1;var t=Pne(e)?Fne:Ine;return t.test(Tne(e))}var Une=Bne;function zne(e,t){return e==null?void 0:e[t]}var Wne=zne,Hne=Une,qne=Wne;function Vne(e,t){var n=qne(e,t);return Hne(n)?n:void 0}var oc=Vne,Gne=oc,Kne=Gne(Object,"create"),Xx=Kne,PO=Xx;function Yne(){this.__data__=PO?PO(null):{},this.size=0}var Xne=Yne;function Qne(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Jne=Qne,Zne=Xx,ere="__lodash_hash_undefined__",tre=Object.prototype,nre=tre.hasOwnProperty;function rre(e){var t=this.__data__;if(Zne){var n=t[e];return n===ere?void 0:n}return nre.call(t,e)?t[e]:void 0}var ire=rre,are=Xx,sre=Object.prototype,ore=sre.hasOwnProperty;function lre(e){var t=this.__data__;return are?t[e]!==void 0:ore.call(t,e)}var cre=lre,ure=Xx,dre="__lodash_hash_undefined__";function fre(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ure&&t===void 0?dre:t,this}var hre=fre,pre=Xne,mre=Jne,gre=ire,vre=cre,yre=hre;function zd(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])}}zd.prototype.clear=pre;zd.prototype.delete=mre;zd.prototype.get=gre;zd.prototype.has=vre;zd.prototype.set=yre;var xre=zd;function bre(){this.__data__=[],this.size=0}var wre=bre;function _re(e,t){return e===t||e!==e&&t!==t}var PN=_re,jre=PN;function Sre(e,t){for(var n=e.length;n--;)if(jre(e[n][0],t))return n;return-1}var Qx=Sre,kre=Qx,Nre=Array.prototype,Cre=Nre.splice;function Ere(e){var t=this.__data__,n=kre(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Cre.call(t,n,1),--this.size,!0}var Pre=Ere,Ore=Qx;function Are(e){var t=this.__data__,n=Ore(t,e);return n<0?void 0:t[n][1]}var Tre=Are,Rre=Qx;function Ire(e){return Rre(this.__data__,e)>-1}var Mre=Ire,$re=Qx;function Dre(e,t){var n=this.__data__,r=$re(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Lre=Dre,Fre=wre,Bre=Pre,Ure=Tre,zre=Mre,Wre=Lre;function Wd(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])}}Wd.prototype.clear=Fre;Wd.prototype.delete=Bre;Wd.prototype.get=Ure;Wd.prototype.has=zre;Wd.prototype.set=Wre;var Jx=Wd,Hre=oc,qre=Ta,Vre=Hre(qre,"Map"),ON=Vre,OO=xre,Gre=Jx,Kre=ON;function Yre(){this.size=0,this.__data__={hash:new OO,map:new(Kre||Gre),string:new OO}}var Xre=Yre;function Qre(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Jre=Qre,Zre=Jre;function eie(e,t){var n=e.__data__;return Zre(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Zx=eie,tie=Zx;function nie(e){var t=tie(this,e).delete(e);return this.size-=t?1:0,t}var rie=nie,iie=Zx;function aie(e){return iie(this,e).get(e)}var sie=aie,oie=Zx;function lie(e){return oie(this,e).has(e)}var cie=lie,uie=Zx;function die(e,t){var n=uie(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var fie=die,hie=Xre,pie=rie,mie=sie,gie=cie,vie=fie;function Hd(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])}}Hd.prototype.clear=hie;Hd.prototype.delete=pie;Hd.prototype.get=mie;Hd.prototype.has=gie;Hd.prototype.set=vie;var AN=Hd,fL=AN,yie="Expected a function";function TN(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(yie);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=e.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(TN.Cache||fL),n}TN.Cache=fL;var hL=TN;const xie=ct(hL);var bie=hL,wie=500;function _ie(e){var t=bie(e,function(r){return n.size===wie&&n.clear(),r}),n=t.cache;return t}
670var jie=_ie,Sie=jie,kie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nie=/\\(\\)?/g,Cie=Sie(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(kie,function(n,r,i,a){t.push(i?a.replace(Nie,"$1"):r||n)}),t}),Eie=Cie;function Pie(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var RN=Pie,AO=dm,Oie=RN,Aie=Ir,Tie=Bd,Rie=1/0,TO=AO?AO.prototype:void 0,RO=TO?TO.toString:void 0;function pL(e){if(typeof e=="string")return e;if(Aie(e))return Oie(e,pL)+"";if(Tie(e))return RO?RO.call(e):"";var t=e+"";return t=="0"&&1/e==-Rie?"-0":t}var Iie=pL,Mie=Iie;function $ie(e){return e==null?"":Mie(e)}var mL=$ie,Die=Ir,Lie=CN,Fie=Eie,Bie=mL;function Uie(e,t){return Die(e)?e:Lie(e,t)?[e]:Fie(Bie(e))}var gL=Uie,zie=Bd,Wie=1/0;function Hie(e){if(typeof e=="string"||zie(e))return e;var t=e+"";return t=="0"&&1/e==-Wie?"-0":t}var eb=Hie,qie=gL,Vie=eb;function Gie(e,t){t=qie(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Vie(t[n++])];return n&&n==r?e:void 0}var IN=Gie,Kie=IN;function Yie(e,t,n){var r=e==null?void 0:Kie(e,t);return r===void 0?n:r}var vL=Yie;const Xr=ct(vL);function Xie(e){return e==null}var Qie=Xie;const $e=ct(Qie);var Jie=gs,Zie=Ir,eae=vs,tae="[object String]";function nae(e){return typeof e=="string"||!Zie(e)&&eae(e)&&Jie(e)==tae}var rae=nae;const Vl=ct(rae);var yL={exports:{}},yt={};/**
671 * @license React
672 * react-is.production.min.js
673 *
674 * Copyright (c) Facebook, Inc. and its affiliates.
675 *
676 * This source code is licensed under the MIT license found in the
677 * LICENSE file in the root directory of this source tree.
678 */var MN=Symbol.for("react.element"),$N=Symbol.for("react.portal"),tb=Symbol.for("react.fragment"),nb=Symbol.for("react.strict_mode"),rb=Symbol.for("react.profiler"),ib=Symbol.for("react.provider"),ab=Symbol.for("react.context"),iae=Symbol.for("react.server_context"),sb=Symbol.for("react.forward_ref"),ob=Symbol.for("react.suspense"),lb=Symbol.for("react.suspense_list"),cb=Symbol.for("react.memo"),ub=Symbol.for("react.lazy"),aae=Symbol.for("react.offscreen"),xL;xL=Symbol.for("react.module.reference");function ji(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case MN:switch(e=e.type,e){case tb:case rb:case nb:case ob:case lb:return e;default:switch(e=e&&e.$$typeof,e){case iae:case ab:case sb:case ub:case cb:case ib:return e;default:return t}}case $N:return t}}}yt.ContextConsumer=ab;yt.ContextProvider=ib;yt.Element=MN;yt.ForwardRef=sb;yt.Fragment=tb;yt.Lazy=ub;yt.Memo=cb;yt.Portal=$N;yt.Profiler=rb;yt.StrictMode=nb;yt.Suspense=ob;yt.SuspenseList=lb;yt.isAsyncMode=function(){return!1};yt.isConcurrentMode=function(){return!1};yt.isContextConsumer=function(e){return ji(e)===ab};yt.isContextProvider=function(e){return ji(e)===ib};yt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===MN};yt.isForwardRef=function(e){return ji(e)===sb};yt.isFragment=function(e){return ji(e)===tb};yt.isLazy=function(e){return ji(e)===ub};yt.isMemo=function(e){return ji(e)===cb};yt.isPortal=function(e){return ji(e)===$N};yt.isProfiler=function(e){return ji(e)===rb};yt.isStrictMode=function(e){return ji(e)===nb};yt.isSuspense=function(e){return ji(e)===ob};yt.isSuspenseList=function(e){return ji(e)===lb};yt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===tb||e===rb||e===nb||e===ob||e===lb||e===aae||typeof e=="object"&&e!==null&&(e.$$typeof===ub||e.$$typeof===cb||e.$$typeof===ib||e.$$typeof===ab||e.$$typeof===sb||e.$$typeof===xL||e.getModuleId!==void 0)};yt.typeOf=ji;yL.exports=yt;var sae=yL.exports,oae=gs,lae=vs,cae="[object Number]";function uae(e){return typeof e=="number"||lae(e)&&oae(e)==cae}var bL=uae;const dae=ct(bL);var fae=bL;function hae(e){return fae(e)&&e!=+e}var pae=hae;const qd=ct(pae);var or=function(t){return t===0?0:t>0?1:-1},ml=function(t){return Vl(t)&&t.indexOf("%")===t.length-1},ce=function(t){return dae(t)&&!qd(t)},mae=function(t){return $e(t)},_n=function(t){return ce(t)||Vl(t)},gae=0,Bo=function(t){var n=++gae;return"".concat(t||"").concat(n)},lr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ce(t)&&!Vl(t))return r;var a;if(ml(t)){var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}
vendor: 5,576 bytes, line 678
678else a=+t;return qd(a)&&(a=r),i&&a>n&&(a=n),a},Ls=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},vae=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},Yt=function(t,n){return ce(t)&&ce(n)?function(r){return t+r*(n-t)}:function(){return n}};function Yv(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Xr(r,t))===n})}var yae=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,i=0,a=0,s=0,l=1/0,c=-1/0,u=0,d=0,f=0;f<n;f++)u=t[f].cx||0,d=t[f].cy||0,r+=u,i+=d,a+=u*d,s+=u*u,l=Math.min(l,u),c=Math.max(c,u);var h=n*s!==r*r?(n*a-r*i)/(n*s-r*r):0;return{xmin:l,xmax:c,a:h,b:(i-h*r)/n}},xae=function(t,n){return ce(t)&&ce(n)?t-n:Vl(t)&&Vl(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function hu(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 U_(e){"@babel/helpers - typeof";return U_=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},U_(e)}var bae=["viewBox","children"],wae=["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"],IO=["points","pathLength"],lw={svg:bae,polygon:IO,polyline:IO},DN=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
678ocus","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"],Xv=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(b.isValidElement(t)&&(r=t.props),!Ud(r))return null;var i={};return Object.keys(r).forEach(function(a){DN.includes(a)&&(i[a]=n||function(s){return r[a](r,s)})}),i},_ae=function(t,n,r){return function(i){return t(n,r,i),null}},ko=function(t,n,r){if(!Ud(t)||U_(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(a){var s=t[a];DN.includes(a)&&typeof s=="function"&&(i||(i={}),i[a]=_ae(s,n,r))}),i},jae=["children"],Sae=["children"];function MO(e,t){if(e==null)return{};var n=kae(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function z_(e){"@babel/helpers - typeof";return z_=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},z_(e)}var $O={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"}
vendor: 2,019 bytes, line 678
678,Ja=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},DO=null,cw=null,LN=function e(t){if(t===DO&&Array.isArray(cw))return cw;var n=[];return b.Children.forEach(t,function(r){$e(r)||(sae.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),cw=n,DO=t,n};function dr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return Ja(i)}):r=[Ja(t)],LN(e).forEach(function(i){var a=Xr(i,"type.displayName")||Xr(i,"type.name");r.indexOf(a)!==-1&&n.push(i)}),n}function zr(e,t){var n=dr(e,t);return n&&n[0]}var LO=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!ce(r)||r<=0||!ce(i)||i<=0)},Nae=["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"],Cae=function(t){return t&&t.type&&Vl(t.type)&&Nae.indexOf(t.type)>=0},wL=function(t){return t&&z_(t)==="object"&&"clipDot"in t},Eae=function(t,n,r,i){var a,s=(a=lw==null?void 0:lw[i])!==null&&a!==void 0?a:[];return n.startsWith("data-")||!De(t)&&(i&&s.includes(n)||wae.includes(n))||r&&DN.includes(n)},Ne=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(b.isValidElement(t)&&(i=t.props),!Ud(i))return null;var a={};
678return Object.keys(i).forEach(function(s){var l;Eae((l=i)===null||l===void 0?void 0:l[s],s,n,r)&&(a[s]=i[s])}),a},W_=function e(t,n){if(t===n)return!0;var r=b.Children.count(t);if(r!==b.Children.count(n))return!1;if(r===0)return!0;if(r===1)return FO(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],s=n[i];if(Array.isArray(a)||Array.isArray(s)){if(!e(a,s))return!1}else if(!FO(a,s))return!1}return!0},FO=function(t,n){if($e(t)&&$e(n))return!0;if(!$e(t)&&!$e(n)){var r=t.props||{},i=r.children,a=MO(r,jae),s=n.props||{},l=s.children,c=MO(s,Sae);return i&&l?hu(a,c)&&W_(i,l):!i&&!l?hu(a,c):!1}return!1},BO=function(t,n){var r=[],i={};return LN(t).forEach(function(a,s){if(Cae(a))r.push(a);else if(a){var l=Ja(a.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!i[l])){var f=u(a,l,s);r.push(f),i[l]=!0}}}),r},Pae=function(t){var n=t&&t.type;return n&&$O[n]?$O[n]:null},Oae=function(t,n){return LN(n).indexOf(t)},Aae=["children","width","height","viewBox","className","style","title","desc"];function H_(){return H_=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},H_.apply(this,arguments)}function Tae(e,t){if(e==null)return{};var n=Rae(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function q_(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,s=e.style,l=e.title,c=e.desc,u=Tae(e,Aae),d=i||{width:n,height:r,x:0,y:0},f=He("recharts-surface",a);return I.createElement("svg",H_({},Ne(u,!0,"svg"),{className:f,width:n,height:r,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),I.createElement("title",null,l),I.createElement("desc",null,c),t)}var Iae=["children","className"];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)}function Mae(e,t){if(e==null)return{};var n=$ae(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $ae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Ke=I.forwardRef(function(e,t){var n=e.children,r=e.className,i=Mae(e,Iae),a=He("recharts-layer",r);return I.createElement("g",V_({className:a},Ne(i,!0),{ref:t}),n)}),Vi=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a]};function Dae(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var Lae=Dae,Fae=Lae;function Bae(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Fae(e,t,n)}var Uae=Bae,zae="\\ud800-\\udfff",Wae="\\u0300-\\u036f",Hae="\\ufe20-\\ufe2f",qae="\\u20d0-\\u20ff",Vae=Wae+Hae+qae,Gae="\\ufe0e\\ufe0f",Kae="\\u200d",Yae=RegExp("["+Kae+zae+Vae+Gae+"]");function Xae(e){return Yae.test(e)}var _L=Xae;function Qae(e){return e.split("")}var Jae=Qae,jL="\\ud800-\\udfff",Zae="\\u0300-\\u036f",ese="\\ufe20-\\ufe2f",tse="\\u20d0-\\u20ff",nse=Zae+ese+tse,rse="\\ufe0e\\ufe0f",ise="["+jL+"]",G_="["+nse+"]",K_="\\ud83c[\\udffb-\\udfff]",ase="(?:"+G_+"|"+K_+")",SL="[^"+jL+"]",kL="(?:\\ud83c[\\udde6-\\uddff]){2}",NL="[\\ud800-\\udbff][\\udc00-\\udfff]",sse="\\u200d",CL=ase+"?",EL="["+rse+"]?",ose="(?:"+sse+"(?:"+[SL,kL,NL].join("|")+")"+EL+CL+")*",lse=EL+CL+ose,cse="(?:"+[SL+G_+"?",G_,kL,NL,ise].join("|")+")",use=RegExp(K_+"(?="+K_+")|"+cse+lse,"g");function dse(e){return e.match(use)||[]}var fse=dse,hse=Jae,pse=_L,mse=fse;function gse(e){return pse(e)?mse(e):hse(e)}var vse=gse,yse=Uae,xse=_L,bse=vse,wse=mL;function _se(e){return function(t){t=wse(t);var n=xse(t)?bse(t):void 0,r=n?n[0]:t.charAt(0),i=n?yse(n,1).join(""):t.slice(1);return r[e]()+i}}var jse=_se,Sse=jse,kse=Sse("toUpperCase"),Nse=kse;const db=ct(Nse);function At(e){return function(){return e}}const PL=Math.cos,Qv=Math.sin,ea=Math.sqrt,Jv=Math.PI,fb=2*Jv,Y_=Math.PI,X_=2*Y_,il=1e-6,Cse=X_-il;function OL(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Ese(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return OL;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Pse{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?OL:Ese(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,c=r-t,u=i-n,d=s-t,f=l-n,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>il)if(!(Math.abs(f*c-u*d)>il)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-s,g=i-l,m=c*c+u*u,v=p*p+g*g,x=Math.sqrt(m),y=Math.sqrt(h),w=a*M
vendor: 4,198 bytes, line 678
678ath.tan((Y_-Math.acos((m+h-v)/(2*x*y)))/2),S=w/y,_=w/x;Math.abs(S-1)>il&&this._append`L${t+S*d},${n+S*f}`,this._append`A${a},${a},0,0,${+(f*p>d*g)},${this._x1=t+_*c},${this._y1=n+_*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,d=n+c,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>il||Math.abs(this._y1-d)>il)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%X_+X_),h>Cse?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>il&&this._append`A${r},${r},0,${+(h>=Y_)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function FN(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 Pse(t)}function BN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function AL(e){this._context=e}AL.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 hb(e){return new AL(e)}function TL(e){return e[0]}function RL(e){return e[1]}function IL(e,t){var n=At(!0),r=null,i=hb,a=null,s=FN(l);e=typeof e=="function"?e:e===void 0?TL:At(e),t=typeof t=="function"?t:t===void 0?RL:At(t);function l(c){var u,d=(c=BN(c)).length,f,h=!1,p;for(r==null&&(a=i(p=s())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,c),+t(f,u,c));if(p)return a=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:At(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:At(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:At(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function xg(e,t,n){var r=null,i=At(!0),a=null,s=hb,l=null,c=FN(u);e=typeof e=="function"?e:e===void 0?TL:At(+e),t=typeof t=="function"?t:At(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?RL:At(+n);function u(f){var h,p,g,m=(f=BN(f)).length,v,x=!1,y,w=new Array(m),S=new Array(m);for(a==null&&(l=s(y=c())),h=0;h<=m;++h){if(!(h<m&&i(v=f[h],h,f))===x)if(x=!x)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=p;--g)l.point(w[g],S[g]);l.lineEnd(),l.areaEnd()}x&&(w[h]=+e(v,h,f),S[h]=+t(v,h,f),l.point(r?+r(v,h,f):w[h],n?+n(v,h,f):S[h]))}if(y)return l=null,y+""||null}function d(){return IL().defined(i).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:At(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:At(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:At(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:At(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:At(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:At(+f),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(f){return arguments.length?(i=typeof f=="function"?f:At(!!f),u):i},u.curve=function(f){return arguments.length?(s=f,a!=null&&(l=s(a)),u):s},u.context=function(f){return arguments.length?(f==null?a=l=null:l=s(a=f),u):a},u}class ML{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}
vendor: 8,443 bytes, line 678
678point(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 Ose(e){return new ML(e,!0)}function Ase(e){return new ML(e,!1)}const UN={draw(e,t){const n=ea(t/Jv);e.moveTo(n,0),e.arc(0,0,n,0,fb)}},Tse={draw(e,t){const n=ea(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()}},$L=ea(1/3),Rse=$L*2,Ise={draw(e,t){const n=ea(t/Rse),r=n*$L;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Mse={draw(e,t){const n=ea(t),r=-n/2;e.rect(r,r,n,n)}},$se=.8908130915292852,DL=Qv(Jv/10)/Qv(7*Jv/10),Dse=Qv(fb/10)*DL,Lse=-PL(fb/10)*DL,Fse={draw(e,t){const n=ea(t*$se),r=Dse*n,i=Lse*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=fb*a/5,l=PL(s),c=Qv(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},uw=ea(3),Bse={draw(e,t){const n=-ea(t/(uw*3));e.moveTo(0,n*2),e.lineTo(-uw*n,-n),e.lineTo(uw*n,-n),e.closePath()}},ti=-.5,ni=ea(3)/2,Q_=1/ea(12),Use=(Q_/2+1)*3,zse={draw(e,t){const n=ea(t/Use),r=n/2,i=n*Q_,a=r,s=n*Q_+n,l=-a,c=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(ti*r-ni*i,ni*r+ti*i),e.lineTo(ti*a-ni*s,ni*a+ti*s),e.lineTo(ti*l-ni*c,ni*l+ti*c),e.lineTo(ti*r+ni*i,ti*i-ni*r),e.lineTo(ti*a+ni*s,ti*s-ni*a),e.lineTo(ti*l+ni*c,ti*c-ni*l),e.closePath()}};function Wse(e,t){let n=null,r=FN(i);e=typeof e=="function"?e:At(e||UN),t=typeof t=="function"?t:At(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:At(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:At(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Zv(){}function ey(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 LL(e){this._context=e}LL.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:ey(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:ey(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Hse(e){return new LL(e)}function FL(e){this._context=e}FL.prototype={areaStart:Zv,areaEnd:Zv,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:ey(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function qse(e){return new FL(e)}function BL(e){this._context=e}BL.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:ey(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Vse(e){return new BL(e)}function UL(e){this._context=e}UL.prototype={areaStart:Zv,areaEnd:Zv,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 Gse(e){return new UL(e)}function UO(e){return e<0?-1:1}function zO(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),l=(a*i+s*r)/(r+i);return(UO(a)+UO(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function WO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function dw(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,s-l*n,a,s)}function ty(e){this._context=e}ty.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:dw(this,this._t0,WO(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,dw(this,WO(this,n=zO(this,e,t)),n);break;default:dw(this,this._t0,n=zO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function zL(e){this._context=new WL(e)}(zL.prototype=Object.create(ty.prototype)).point=function(e,t){ty.prototype.point.call(this,t,e)};function WL(e){this._context=e}WL.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Kse(e){return new ty(e)}function Yse(e){return new zL(e)}function HL(e){this._context=e}HL.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=HO(e),i=HO(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(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 HO(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Xse(e){return new HL(e)}function pb(e,t){this._context=e,this._t=t}pb.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;
vendor: 9,187 bytes, lines 678-681
678default:{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 Qse(e){return new pb(e,.5)}function Jse(e){return new pb(e,0)}function Zse(e){return new pb(e,1)}function Vu(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,l=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function J_(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function eoe(e,t){return e[t]}function toe(e){const t=[];return t.key=e,t}function noe(){var e=At([]),t=J_,n=Vu,r=eoe;function i(a){var s=Array.from(e.apply(this,arguments),toe),l,c=s.length,u=-1,d;for(const f of a)for(l=0,++u;l<c;++l)(s[l][u]=[0,+r(f,s[l].key,u,a)]).data=f;for(l=0,d=BN(t(s));l<c;++l)s[d[l]].index=l;return n(s,d),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:At(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:At(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?J_:typeof a=="function"?a:At(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Vu,i):n},i}function roe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Vu(e,t)}}function ioe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var s=0,l=0;s<i;++s)l+=e[s][n][1]||0;r[n][1]+=r[n][0]=-l/2}Vu(e,t)}}function aoe(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var l=0,c=0,u=0;l<s;++l){for(var d=e[t[l]],f=d[r][1]||0,h=d[r-1][1]||0,p=(f-h)/2,g=0;g<l;++g){var m=e[t[g]],v=m[r][1]||0,x=m[r-1][1]||0;p+=v-x}c+=f,u+=p*f}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,Vu(e,t)}}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)}var soe=["type","size","sizeType"];function Z_(){return Z_=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},Z_.apply(this,arguments)}function qO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function VO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qO(Object(n),!0).forEach(function(r){ooe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ooe(e,t,n){return t=loe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function loe(e){var t=coe(e,"string");return ip(t)=="symbol"?t:t+""}function coe(e,t){if(ip(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ip(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uoe(e,t){if(e==null)return{};var n=doe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function doe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var qL={symbolCircle:UN,symbolCross:Tse,symbolDiamond:Ise,symbolSquare:Mse,symbolStar:Fse,symbolTriangle:Bse,symbolWye:zse},foe=Math.PI/180,hoe=function(t){var n="symbol".concat(db(t));return qL[n]||UN},poe=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*foe;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},moe=function(t,n){qL["symbol".concat(db(t))]=n},mb=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,a=i===void 0?64:i,s=t.sizeType,l=s===void 0?"area":s,c=uoe(t,soe),u=VO(VO({},c),{},{type:r,size:a,sizeType:l}),d=function(){var v=hoe(r),x=Wse().type(v).size(poe(a,l,r));return x()},f=u.className,h=u.cx,p=u.cy,g=Ne(u,!0);return h===+h&&p===+p&&a===+a?I.createElement("path",Z_({},g,{className:He("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};mb.registerSymbol=moe;function Gu(e){"@babel/helpers - typeof";return Gu=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},Gu(e)}function ej(){return ej=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},ej.apply(this,arguments)}function GO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function goe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GO(Object(n),!0).forEach(function(r){ap(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function voe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yoe(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,GL(r.key),r)}}function xoe(e,t,n){return t&&yoe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function boe(e,t,n){return t=ny(t),woe(e,VL()?Reflect.construct(t,n||[],ny(e).constructor):t.apply(e,n))}function woe(e,t){if(t&&(Gu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _oe(e)}function _oe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VL=function(){return!!e})()}function ny(e){return ny=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ny(e)}function joe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tj(e,t)}function tj(e,t){return tj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},tj(e,t)}function ap(e,t,n){return t=GL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GL(e){var t=Soe(e,"string");return Gu(t)=="symbol"?t:t+""}function Soe(e,t){if(Gu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ri=32,zN=function(e){function t(){return voe(this,t),boe(this,t,arguments)}return joe(t,e),xoe(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,a=ri/2,s=ri/6,l=ri/3,c=r.inactive?i:r.color;if(r.type==="plainline")return I.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:a,x2:ri,y2:a,className:"recharts-legend-icon"});if(r.type==="line")return I.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
679            A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(a,`
680            H`).concat(ri,"M").concat(2*l,",").concat(a,`
681            A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(r.type==="rect")return I.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ri/8,"h").concat(ri,"v").concat(ri*3/4,"h").concat(-ri,"z"),className:"recharts-legend-icon"});if(I.isValidElement(r.legendIcon)){var u=goe({},r);return delete u.legendIcon,I.cloneElement(r.legendIcon,u)}return I.createElement(mb,{fill:c,cx:a,cy:a,size:ri,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,a=i.payload,s=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:ri,height:ri}
681,f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,g){var m=p.formatter||c,v=He(ap(ap({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var x=De(p.value)?null:p.value;Vi(!De(p.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 y=p.inactive?u:p.color;return I.createElement("li",ej({className:v,style:f,key:"legend-item-".concat(g)},ko(r.props,p,g)),I.createElement(q_,{width:s,height:s,viewBox:d,style:h},r.renderIcon(p)),I.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},m?m(x,p,g):x))})}},{key:"render",value:function(){var r=this.props,i=r.payload,a=r.layout,s=r.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return I.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(b.PureComponent);ap(zN,"displayName","Legend");ap(zN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var koe=Jx;function Noe(){this.__data__=new koe,this.size=0}var Coe=Noe;function Eoe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Poe=Eoe;function Ooe(e){return this.__data__.get(e)}var Aoe=Ooe;function Toe(e){return this.__data__.has(e)}var Roe=Toe,Ioe=Jx,Moe=ON,$oe=AN,Doe=200;function Loe(e,t){var n=this.__data__;if(n instanceof Ioe){var r=n.__data__;if(!Moe||r.length<Doe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $oe(r)}return n.set(e,t),this.size=n.size,this}var Foe=Loe,Boe=Jx,Uoe=Coe,zoe=Poe,Woe=Aoe,Hoe=Roe,qoe=Foe;function Vd(e){var t=this.__data__=new Boe(e);this.size=t.size}Vd.prototype.clear=Uoe;Vd.prototype.delete=zoe;Vd.prototype.get=Woe;Vd.prototype.has=Hoe;Vd.prototype.set=qoe;var KL=Vd,Voe="__lodash_hash_undefined__";function Goe(e){return this.__data__.set(e,Voe),this}var Koe=Goe;function Yoe(e){return this.__data__.has(e)}var Xoe=Yoe,Qoe=AN,Joe=Koe,Zoe=Xoe;function ry(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Qoe;++t<n;)this.add(e[t])}ry.prototype.add=ry.prototype.push=Joe;ry.prototype.has=Zoe;var YL=ry;function ele(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 XL=ele;function tle(e,t){return e.has(t)}var QL=tle,nle=YL,rle=XL,ile=QL,ale=1,sle=2;function ole(e,t,n,r,i,a){var s=n&ale,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=n&sle?new nle:void 0;for(a.set(e,t),a.set(t,e);++f<l;){var g=e[f],m=t[f];if(r)var v=s?r(m,g,f,t,e,a):r(g,m,f,e,t,a);if(v!==void 0){if(v)continue;h=!1;break}if(p){if(!rle(t,function(x,y){if(!ile(p,y)&&(g===x||i(g,x,n,r,a)))return p.push(y)})){h=!1;break}}else if(!(g===m||i(g,m,n,r,a))){h=!1;break}}return a.delete(e),a.delete(t),h}var JL=ole,lle=Ta,cle=lle.Uint8Array,ule=cle;function dle(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var fle=dle;function hle(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var WN=hle,KO=dm,YO=ule,ple=PN,mle=JL,gle=fle,vle=WN,yle=1,xle=2,ble="[object Boolean]",wle="[object Date]",_le="[object Error]",jle="[object Map]",Sle="[object Number]",kle="[object RegExp]",Nle="[object Set]",Cle="[object String]",Ele="[object Symbol]",Ple="[object ArrayBuffer]",Ole="[object DataView]",XO=KO?KO.prototype:void 0,fw=XO?XO.valueOf:void 0;function Ale(e,t,n,r,i,a,s){switch(n){case Ole:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ple:return!(e.byteLength!=t.byteLength||!a(new YO(e),new YO(t)));case ble:case wle:case Sle:return ple(+e,+t);case _le:return e.name==t.name&&e.message==t.message;case kle:case Cle:return e==t+"";case jle:var l=gle;case Nle:var c=r&yle;if(l||(l=vle),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=xle,s.set(e,t);var d=mle(l(e),l(t),r,i,a,s);return s.delete(e),d;case Ele:if(fw)return fw.call(e)==fw.call(t)}return!1}var Tle=Ale;function Rle(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var ZL=Rle,Ile=ZL,Mle=Ir;function $le(e,t,n){var r=t(e);return Mle(e)?r:Ile(r,n(e))}var Dle=$le;function Lle(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var s=e[n];t(s,n,e)&&(a[i++]=s)}return a}var Fle=Lle;function Ble(){return[]}var Ule=Ble,zle=Fle,Wle=Ule,Hle=Object.prototype,qle=Hle.propertyIsEnumerable,QO=Object.getOwnPropertySymbols,Vle=QO?function(e){return e==null?[]:(e=Object(e),zle(QO(e),function(t){return qle.call(e,t)}))}:Wle,Gle=Vle;function Kle(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Yle=Kle,Xle=gs,Qle=vs,Jle="[object Arguments]";function Zle(e){return Qle(e)&&Xle(e)==Jle}var ece=Zle,JO=ece,tce=vs,eF=Object.prototype,nce=eF.hasOwnProperty,rce=eF.propertyIsEnumerable,ice=JO(function(){return arguments}())?JO:function(e){return tce(e)&&nce.call(e,"callee")&&!rce.call(e,"callee")},HN=ice,iy={exports:{}};function ace(){return!1}var sce=ace;iy.exports;(function(e,t){var n=Ta,r=sce,i=t&&!t.nodeType&&t,a=i&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u}
vendor: 4,576 bytes, line 681
681)(iy,iy.exports);var tF=iy.exports,oce=9007199254740991,lce=/^(?:0|[1-9]\d*)$/;function cce(e,t){var n=typeof e;return t=t??oce,!!t&&(n=="number"||n!="symbol"&&lce.test(e))&&e>-1&&e%1==0&&e<t}var qN=cce,uce=9007199254740991;function dce(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=uce}var VN=dce,fce=gs,hce=VN,pce=vs,mce="[object Arguments]",gce="[object Array]",vce="[object Boolean]",yce="[object Date]",xce="[object Error]",bce="[object Function]",wce="[object Map]",_ce="[object Number]",jce="[object Object]",Sce="[object RegExp]",kce="[object Set]",Nce="[object String]",Cce="[object WeakMap]",Ece="[object ArrayBuffer]",Pce="[object DataView]",Oce="[object Float32Array]",Ace="[object Float64Array]",Tce="[object Int8Array]",Rce="[object Int16Array]",Ice="[object Int32Array]",Mce="[object Uint8Array]",$ce="[object Uint8ClampedArray]",Dce="[object Uint16Array]",Lce="[object Uint32Array]",Ft={};Ft[Oce]=Ft[Ace]=Ft[Tce]=Ft[Rce]=Ft[Ice]=Ft[Mce]=Ft[$ce]=Ft[Dce]=Ft[Lce]=!0;Ft[mce]=Ft[gce]=Ft[Ece]=Ft[vce]=Ft[Pce]=Ft[yce]=Ft[xce]=Ft[bce]=Ft[wce]=Ft[_ce]=Ft[jce]=Ft[Sce]=Ft[kce]=Ft[Nce]=Ft[Cce]=!1;function Fce(e){return pce(e)&&hce(e.length)&&!!Ft[fce(e)]}var Bce=Fce;function Uce(e){return function(t){return e(t)}}var nF=Uce,ay={exports:{}};ay.exports;(function(e,t){var n=cL,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===r,s=a&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=l})(ay,ay.exports);var zce=ay.exports,Wce=Bce,Hce=nF,ZO=zce,eA=ZO&&ZO.isTypedArray,qce=eA?Hce(eA):Wce,rF=qce,Vce=Yle,Gce=HN,Kce=Ir,Yce=tF,Xce=qN,Qce=rF,Jce=Object.prototype,Zce=Jce.hasOwnProperty;function eue(e,t){var n=Kce(e),r=!n&&Gce(e),i=!n&&!r&&Yce(e),a=!n&&!r&&!i&&Qce(e),s=n||r||i||a,l=s?Vce(e.length,String):[],c=l.length;for(var u in e)(t||Zce.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Xce(u,c)))&&l.push(u);return l}var tue=eue,nue=Object.prototype;function rue(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||nue;return e===n}var iue=rue;function aue(e,t){return function(n){return e(t(n))}}var iF=aue,sue=iF,oue=sue(Object.keys,Object),lue=oue,cue=iue,uue=lue,due=Object.prototype,fue=due.hasOwnProperty;function hue(e){if(!cue(e))return uue(e);var t=[];for(var n in Object(e))fue.call(e,n)&&n!="constructor"&&t.push(n);return t}var pue=hue,mue=EN,gue=VN;function vue(e){return e!=null&&gue(e.length)&&!mue(e)}var fm=vue,yue=tue,xue=pue,bue=fm;function wue(e){return bue(e)?yue(e):xue(e)}var gb=wue,_ue=Dle,jue=Gle,Sue=gb;function kue(e){return _ue(e,Sue,jue)}var Nue=kue,tA=Nue,Cue=1,Eue=Object.prototype,Pue=Eue.hasOwnProperty;function Oue(e,t,n,r,i,a){var s=n&Cue,l=tA(e),c=l.length,u=tA(t),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in t:Pue.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=s;++f<c;){h=l[f];var x=e[h],y=t[h];if(r)var w=s?r(y,x,h,t,e,a):r(x,y,h,e,t,a);if(!(w===void 0?x===y||i(x,y,n,r,a):w)){m=!1;break}v||(v=h=="constructor")}if(m&&!v){var S=e.constructor,_=t.constructor;S!=_&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return a.delete(e),a.delete(t),m}var Aue=Oue,Tue=oc,Rue=Ta,Iue=Tue(Rue,"DataView"),Mue=Iue,$ue=oc,Due=Ta,Lue=$ue(Due,"Promise"),Fue=Lue,Bue=oc,Uue=Ta,zue=Bue(Uue,"Set"),aF=zue,Wue=oc,Hue=Ta,que=Wue(Hue,"WeakMap"),Vue=que,nj=Mue,rj=ON,ij=Fue,aj=aF,sj=Vue,sF=gs,Gd=dL,nA="[object Map]",Gue="[object Object]",rA="[object Promise]",iA="[object Set]",aA="[object WeakMap]",sA="[object DataView]",Kue=Gd(nj),Yue=Gd(rj),Xue=Gd(ij),Que=Gd(aj),Jue=Gd(sj),al=sF;(nj&&al(new nj(new ArrayBuffer(1)))!=sA||rj&&al(new rj)!=nA||ij&&al(ij.resolve())!=rA||aj&&al(new aj)!=iA||sj&&al(new sj)!=aA)&&(al=function(e){var t=sF(e),n=t==Gue?e.constructor:void 0,r=n?Gd(n):"";if(r)switch(r){case Kue:return sA;case Yue:return nA;case Xue:return rA;case Que:return iA;case Jue:return aA}return t});var Zue=al,hw=KL,ede=JL,tde=Tle,nde=Aue,oA=Zue,lA=Ir,cA=tF,rde=rF,ide=1,uA="[object Arguments]",dA="[object Array]",bg="[object Object]",ade=Object.prototype,fA=ade.hasOwnProperty;function sde(e,t,n,r,i,a){var s=lA(e),l=lA(t),c=s?dA:oA(e),u=l?dA:oA(t);c=c==uA?bg:c,u=u==uA?bg:u;var d=c==bg,f=u==bg,h=c==u;if(h&&cA(e)){if(!cA(t))return!1;s=!0,d=!1}if(h&&!d)return a||(a=new hw),s||rde(e)?ede(e,t,n,r,i,a):tde(e,t,c,n,r,i,a);if(!(n&ide)){var p=d&&fA.call(e,"__wrapped__"),g=f&&fA.call(t,"__wrapped__");
vendor: 4,112 bytes, line 681
681if(p||g){var m=p?e.value():e,v=g?t.value():t;return a||(a=new hw),i(m,v,n,r,a)}}return h?(a||(a=new hw),nde(e,t,n,r,i,a)):!1}var ode=sde,lde=ode,hA=vs;function oF(e,t,n,r,i){return e===t?!0:e==null||t==null||!hA(e)&&!hA(t)?e!==e&&t!==t:lde(e,t,n,r,oF,i)}var GN=oF,cde=KL,ude=GN,dde=1,fde=2;function hde(e,t,n,r){var i=n.length,a=i,s=!r;if(e==null)return!a;for(e=Object(e);i--;){var l=n[i];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<a;){l=n[i];var c=l[0],u=e[c],d=l[1];if(s&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new cde;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?ude(d,u,dde|fde,r,f):h))return!1}}return!0}var pde=hde,mde=Fo;function gde(e){return e===e&&!mde(e)}var lF=gde,vde=lF,yde=gb;function xde(e){for(var t=yde(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,vde(i)]}return t}var bde=xde;function wde(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var cF=wde,_de=pde,jde=bde,Sde=cF;function kde(e){var t=jde(e);return t.length==1&&t[0][2]?Sde(t[0][0],t[0][1]):function(n){return n===e||_de(n,e,t)}}var Nde=kde;function Cde(e,t){return e!=null&&t in Object(e)}var Ede=Cde,Pde=gL,Ode=HN,Ade=Ir,Tde=qN,Rde=VN,Ide=eb;function Mde(e,t,n){t=Pde(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var s=Ide(t[r]);if(!(a=e!=null&&n(e,s)))break;e=e[s]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Rde(i)&&Tde(s,i)&&(Ade(e)||Ode(e)))}var $de=Mde,Dde=Ede,Lde=$de;function Fde(e,t){return e!=null&&Lde(e,t,Dde)}var Bde=Fde,Ude=GN,zde=vL,Wde=Bde,Hde=CN,qde=lF,Vde=cF,Gde=eb,Kde=1,Yde=2;function Xde(e,t){return Hde(e)&&qde(t)?Vde(Gde(e),t):function(n){var r=zde(n,e);return r===void 0&&r===t?Wde(n,e):Ude(t,r,Kde|Yde)}}var Qde=Xde;function Jde(e){return e}var Kd=Jde;function Zde(e){return function(t){return t==null?void 0:t[e]}}var efe=Zde,tfe=IN;function nfe(e){return function(t){return tfe(t,e)}}var rfe=nfe,ife=efe,afe=rfe,sfe=CN,ofe=eb;function lfe(e){return sfe(e)?ife(ofe(e)):afe(e)}var cfe=lfe,ufe=Nde,dfe=Qde,ffe=Kd,hfe=Ir,pfe=cfe;function mfe(e){return typeof e=="function"?e:e==null?ffe:typeof e=="object"?hfe(e)?dfe(e[0],e[1]):ufe(e):pfe(e)}var Ra=mfe;function gfe(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var uF=gfe;function vfe(e){return e!==e}var yfe=vfe;function xfe(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var bfe=xfe,wfe=uF,_fe=yfe,jfe=bfe;function Sfe(e,t,n){return t===t?jfe(e,t,n):wfe(e,_fe,n)}var kfe=Sfe,Nfe=kfe;function Cfe(e,t){var n=e==null?0:e.length;return!!n&&Nfe(e,t,0)>-1}var Efe=Cfe;function Pfe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Ofe=Pfe;function Afe(){}var Tfe=Afe,pw=aF,Rfe=Tfe,Ife=WN,Mfe=1/0,$fe=pw&&1/Ife(new pw([,-0]))[1]==Mfe?function(e){return new pw(e)}:Rfe,Dfe=$fe,Lfe=YL,Ffe=Efe,Bfe=Ofe,Ufe=QL,zfe=Dfe,Wfe=WN,Hfe=200;function qfe(e,t,n){var r=-1,i=Ffe,a=e.length,s=!0,l=[],c=l;if(n)s=!1,i=Bfe;else if(a>=Hfe){var u=t?null:zfe(e);if(u)return Wfe(u);s=!1,i=Ufe,c=new Lfe}else c=t?[]:l;e:for(;++r<a;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,s&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else i(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var Vfe=qfe,Gfe=Ra,Kfe=Vfe;function Yfe(e,t){return e&&e.length?Kfe(e,Gfe(t)):[]}var Xfe=Yfe;const pA=ct(Xfe);function dF(e,t,n){return t===!0?pA(e,n):De(t)?pA(e,t):e}function Ku(e){"@babel/helpers - typeof";return Ku=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},Ku(e)}var Qfe=["ref"];function mA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ma(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mA(Object(n),!0).forEach(function(r){vb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mA(Object(n)).forEac
vendor: 4,282 bytes, line 681
681h(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gA(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,hF(r.key),r)}}function Zfe(e,t,n){return t&&gA(e.prototype,t),n&&gA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ehe(e,t,n){return t=sy(t),the(e,fF()?Reflect.construct(t,n||[],sy(e).constructor):t.apply(e,n))}function the(e,t){if(t&&(Ku(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nhe(e)}function nhe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fF=function(){return!!e})()}function sy(e){return sy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sy(e)}function rhe(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&&oj(e,t)}function oj(e,t){return oj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},oj(e,t)}function vb(e,t,n){return t=hF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hF(e){var t=ihe(e,"string");return Ku(t)=="symbol"?t:t+""}function ihe(e,t){if(Ku(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ku(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ahe(e,t){if(e==null)return{};var n=she(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function she(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ohe(e){return e.value}function lhe(e,t){if(I.isValidElement(e))return I.cloneElement(e,t);if(typeof e=="function")return I.createElement(e,t);t.ref;var n=ahe(t,Qfe);return I.createElement(zN,n)}var vA=1,ho=function(e){function t(){var n;Jfe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=ehe(this,t,[].concat(i)),vb(n,"lastBoundingBox",{width:-1,height:-1}),n}return rhe(t,e),Zfe(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>vA||Math.abs(i.height-this.lastBoundingBox.height)>vA)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ma({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,a=i.layout,s=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(s==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=s==="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.getBBoxSnapsh
681ot();h={top:((d||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ma(Ma({},f),h)}},{key:"render",value:function(){var r=this,i=this.props,a=i.content,s=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,f=Ma(Ma({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return I.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){r.wrapperNode=p}},lhe(a,Ma(Ma({},this.props),{},{payload:dF(d,u,ohe)})))}}],[{key:"getWithHeight",value:function(r,i){var a=Ma(Ma({},this.defaultProps),r.props),s=a.layout;return s==="vertical"&&ce(r.props.height)?{height:r.props.height}:s==="horizontal"?{width:r.props.width||i}:null}}])}(b.PureComponent);vb(ho,"displayName","Legend");vb(ho,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var yA=dm,che=HN,uhe=Ir,xA=yA?yA.isConcatSpreadable:void 0;function dhe(e){return uhe(e)||che(e)||!!(xA&&e&&e[xA])}var fhe=dhe,hhe=ZL,phe=fhe;function pF(e,t,n,r,i){var a=-1,s=e.length;for(n||(n=phe),i||(i=[]);++a<s;){var l=e[a];t>0&&n(l)?t>1?pF(l,t-1,n,r,i):hhe(i,l):r||(i[i.length]=l)}return i}var mF=pF;function mhe(e){return function(t,n,r){for(var i=-1,a=Object(t),s=r(t),l=s.length;l--;){var c=s[e?l:++i];if(n(a[c],c,a)===!1)break}return t}}var ghe=mhe,vhe=ghe,yhe=vhe(),xhe=yhe,bhe=xhe,whe=gb;function _he(e,t){return e&&bhe(e,t,whe)}var gF=_he,jhe=fm;function She(e,t){return function(n,r){if(n==null)return n;if(!jhe(n))return e(n,r);for(var i=n.length,a=t?i:-1,s=Object(n);(t?a--:++a<i)&&r(s[a],a,s)!==!1;);return n}}var khe=She,Nhe=gF,Che=khe,Ehe=Che(Nhe),KN=Ehe,Phe=KN,Ohe=fm;function Ahe(e,t){var n=-1,r=Ohe(e)?Array(e.length):[];return Phe(e,function(i,a,s){r[++n]=t(i,a,s)}),r}var vF=Ahe;function The(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var Rhe=The,bA=Bd;function Ihe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=bA(e),s=t!==void 0,l=t===null,c=t===t,u=bA(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||r&&s&&c||!n&&c||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||l&&n&&i||!s&&i||!c)return-1}return 0}var Mhe=Ihe,$he=Mhe;function Dhe(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,s=i.length,l=n.length;++r<s;){var c=$he(i[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 Lhe=Dhe,mw=RN,Fhe=IN,Bhe=Ra,Uhe=vF,zhe=Rhe,Whe=nF,Hhe=Lhe,qhe=Kd,Vhe=Ir;function Ghe(e,t,n){t.length?t=mw(t,function(a){return Vhe(a)?function(s){return Fhe(s,a.length===1?a[0]:a)}:a}):t=[qhe];var r=-1;t=mw(t,Whe(Bhe));var i=Uhe(e,function(a,s,l){var c=mw(t,function(u){return u(a)});return{criteria:c,index:++r,value:a}});return zhe(i,function(a,s){return Hhe(a,s,n)})}var Khe=Ghe;function Yhe(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 Xhe=Yhe,Qhe=Xhe,wA=Math.max;function Jhe(e,t,n){return t=wA(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=wA(r.length-t,0),s=Array(a);++i<a;)s[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(s),Qhe(e,this,l)}}var Zhe=Jhe;function epe(e){return function(){return e}}var tpe=epe,npe=oc,rpe=function(){try{var e=npe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),yF=rpe,ipe=tpe,_A=yF,ape=Kd,spe=_A?function(e,t){return _A(e,"toString",{configurable:!0,enumerable:!1,value:ipe(t),writable:!0})}:ape,ope=spe,lpe=800,cpe=16,upe=Date.now;function dpe(e){var t=0,n=0;return function(){var r=upe(),i=cpe-(r-n);if(n=r,i>0){if(++t>=lpe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var fpe=dpe,hpe=ope,ppe=fpe,mpe=ppe(hpe),gpe=mpe,vpe=Kd,ype=Zhe,xpe=gpe;function bpe(e,t){return xpe(ype(e,t,vpe),e+"")}var wpe=bpe,_pe=PN,jpe=fm,Spe=qN,kpe=Fo;function Npe(e,t,n){if(!kpe(n))return!1;var r=typeof t;return(r=="number"?jpe(n)&&Spe(t,n.length):r=="string"&&t in n)?_pe(n[t],e):!1}var yb=Npe,Cpe=mF,Epe=Khe,Ppe=wpe,jA=yb,Ope=Ppe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&jA(e,t[0],t[1])?t=[]:n>2&&jA(t[0],t[1],t[2])&&(t=[t[0]]),Epe(e,Cpe(t,1),[])}),Ape=Ope;const YN=ct(Ape);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 lj(){return lj=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},lj.apply(this,arguments)}function Tpe(e,t){return $pe(e)||Mpe(e,t)||Ipe(e,t)||Rpe()}
vendor: 29,552 bytes, lines 681-688
681function Rpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
682In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ipe(e,t){if(e){if(typeof e=="string")return SA(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 SA(e,t)}}function SA(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 Mpe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function $pe(e){if(Array.isArray(e))return e}function kA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kA(Object(n),!0).forEach(function(r){Dpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dpe(e,t,n){return t=Lpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lpe(e){var t=Fpe(e,"string");return sp(t)=="symbol"?t:t+""}function Fpe(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)}function Bpe(e){return Array.isArray(e)&&_n(e[0])&&_n(e[1])?e.join(" ~ "):e}var Upe=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,a=i===void 0?{}:i,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,g=t.labelClassName,m=t.label,v=t.labelFormatter,x=t.accessibilityLayer,y=x===void 0?!1:x,w=function(){if(d&&d.length){var T={padding:0,margin:0},B=(h?YN(d,h):d).map(function(F,M){if(F.type==="none")return null;var L=gw({display:"block",paddingTop:4,paddingBottom:4,color:F.color||"#000"},l),R=F.formatter||f||Bpe,$=F.value,O=F.name,N=$,H=O;if(R&&N!=null&&H!=null){var V=R($,O,F,M,d);if(Array.isArray(V)){var D=Tpe(V,2);N=D[0],H=D[1]}else N=V}return I.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:L},_n(H)?I.createElement("span",{className:"recharts-tooltip-item-name"},H):null,_n(H)?I.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,I.createElement("span",{className:"recharts-tooltip-item-value"},N),I.createElement("span",{className:"recharts-tooltip-item-unit"},F.unit||""))});return I.createElement("ul",{className:"recharts-tooltip-item-list",style:T},B)}return null},S=gw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),_=gw({margin:0},u),j=!$e(m),k=j?m:"",C=He("recharts-default-tooltip",p),E=He("recharts-tooltip-label",g);j&&v&&d!==void 0&&d!==null&&(k=v(m,d));var A=y?{role:"status","aria-live":"assertive"}:{};return I.createElement("div",lj({className:C,style:S},A),I.createElement("p",{className:E,style:_},I.isValidElement(k)?k:"".concat(k)),w())};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 wg(e,t,n){return t=zpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zpe(e){var t=Wpe(e,"string");return op(t)=="symbol"?t:t+""}function Wpe(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 wf="recharts-tooltip-wrapper",Hpe={visibility:"hidden"};function qpe(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return He(wf,wg(wg(wg(wg({},"".concat(wf,"-right"),ce(n)&&t&&ce(t.x)&&n>=t.x),"".concat(wf,"-left"),ce(n)&&t&&ce(t.x)&&n<t.x),"".concat(wf,"-bottom"),ce(r)&&t&&ce(t.y)&&r>=t.y),"".concat(wf,"-top"),ce(r)&&t&&ce(t.y)&&r<t.y))}function NA(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&ce(a[r]))return a[r];var d=n[r]-l-i,f=n[r]+i;if(t[r])return s[r]?d:f;if(s[r]){var h=d,p=c[r];return h<p?Math.max(f,c[r]):Math.max(d,c[r])}var g=f+l,m=c[r]+u;return g>m?Math.max(d,c[r]):Math.max(f,c[r])}function Vpe(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 Gpe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return s.height>0&&s.width>0&&n?(d=NA({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),f=NA({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=Vpe({translateX:d,translateY:f,useTranslate3d:l})):u=Hpe,{cssProperties:u,cssClasses:qpe({translateX:d,translateY:f,coordinate:n})}}function Yu(e){"@babel/helpers - typeof";return Yu=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},Yu(e)}function CA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CA(Object(n),!0).forEach(function(r){uj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ype(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,bF(r.key),r)}}function Xpe(e,t,n){return t&&Ype(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qpe(e,t,n){return t=oy(t),Jpe(e,xF()?Reflect.construct(t,n||[],oy(e).constructor):t.apply(e,n))}function Jpe(e,t){if(t&&(Yu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zpe(e)}function Zpe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xF=function(){return!!e})()}function oy(e){return oy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},oy(e)}function eme(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&&cj(e,t)}function cj(e,t){return cj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},cj(e,t)}function uj(e,t,n){return t=bF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bF(e){var t=tme(e,"string");return Yu(t)=="symbol"?t:t+""}function tme(e,t){if(Yu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Yu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var PA=1,nme=function(e){function t(){var n;Kpe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Qpe(this,t,[].concat(i)),uj(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),uj(n,"handleKeyDown",function(s){if(s.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 eme(t,e),Xpe(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>PA||Math.abs(r.height-this.state.lastBoundingBox.height)>PA)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,f=i.hasPayload,h=i.isAnimationActive,p=i.offset,g=i.position,m=i.reverseDirection,v=i.useTranslate3d,x=i.viewBox,y=i.wrapperStyle,w=Gpe({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:p,position:g,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:v,viewBox:x}),S=w.cssClasses,_=w.cssProperties,j=EA(EA({transition:h&&a?"transform ".concat(l,"ms ").concat(c):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},y);return I.createElement("div",{tabIndex:-1,className:S,style:j,ref:function(C){r.wrapperNode=C}},u)}}])}(b.PureComponent),rme=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},mi={isSsr:rme(),get:function(t){return mi[t]},set:function(t,n){if(typeof t=="string")mi[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(i){mi[i]=t[i]})}}};function Xu(e){"@babel/helpers - typeof";return Xu=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},Xu(e)}function OA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function AA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OA(Object(n),!0).forEach(function(r){XN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ime(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ame(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,_F(r.key),r)}}function sme(e,t,n){return t&&ame(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ome(e,t,n){return t=ly(t),lme(e,wF()?Reflect.construct(t,n||[],ly(e).constructor):t.apply(e,n))}function lme(e,t){if(t&&(Xu(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cme(e)}function cme(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wF=function(){return!!e})()}function ly(e){return ly=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ly(e)}function ume(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&&dj(e,t)}function dj(e,t){return dj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dj(e,t)}function XN(e,t,n){return t=_F(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _F(e){var t=dme(e,"string");return Xu(t)=="symbol"?t:t+""}function dme(e,t){if(Xu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fme(e){return e.dataKey}function hme(e,t){return I.isValidElement(e)?I.cloneElement(e,t):typeof e=="function"?I.createElement(e,t):I.createElement(Upe,t)}var Li=function(e){function t(){return ime(this,t),ome(this,t,arguments)}return ume(t,e),sme(t,[{key:"render",value:function(){var r=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,f=i.filterNull,h=i.isAnimationActive,p=i.offset,g=i.payload,m=i.payloadUniqBy,v=i.position,x=i.reverseDirection,y=i.useTranslate3d,w=i.viewBox,S=i.wrapperStyle,_=g??[];f&&_.length&&(_=dF(g.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),m,fme));var j=_.length>0;return I.createElement(nme,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:j,offset:p,position:v,reverseDirection:x,useTranslate3d:y,viewBox:w,wrapperStyle:S},hme(u,AA(AA({},this.props),{},{payload:_})))}}])}(b.PureComponent);XN(Li,"displayName","Tooltip");XN(Li,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!mi.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 pme=Ta,mme=function(){return pme.Date.now()},gme=mme,vme=/\s/;function yme(e){for(var t=e.length;t--&&vme.test(e.charAt(t)););return t}var xme=yme,bme=xme,wme=/^\s+/;function _me(e){return e&&e.slice(0,bme(e)+1).replace(wme,"")}var jme=_me,Sme=jme,TA=Fo,kme=Bd,RA=NaN,Nme=/^[-+]0x[0-9a-f]+$/i,Cme=/^0b[01]+$/i,Eme=/^0o[0-7]+$/i,Pme=parseInt;function Ome(e){if(typeof e=="number")return e;if(kme(e))return RA;if(TA(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=TA(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Sme(e);var n=Cme.test(e);return n||Eme.test(e)?Pme(e.slice(2),n?2:8):Nme.test(e)?RA:+e}var jF=Ome,Ame=Fo,vw=gme,IA=jF,Tme="Expected a function",Rme=Math.max,Ime=Math.min;function Mme(e,t,n){var r,i,a,s,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Tme);t=IA(t)||0,Ame(n)&&(d=!!n.leading,f="maxWait"in n,a=f?Rme(IA(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h);function p(j){var k=r,C=i;return r=i=void 0,u=j,s=e.apply(C,k),s}function g(j){return u=j,l=setTimeout(x,t),d?p(j):s}function m(j){var k=j-c,C=j-u,E=t-k;return f?Ime(E,a-C):E}function v(j){var k=j-c,C=j-u;return c===void 0||k>=t||k<0||f&&C>=a}function x(){var j=vw();if(v(j))return y(j);l=setTimeout(x,m(j))}function y(j){return l=void 0,h&&r?p(j):(r=i=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function S(){return l===void 0?s:y(vw())}function _(){var j=vw(),k=v(j);if(r=arguments,i=this,c=j,k){if(l===void 0)return g(c);if(f)return clearTimeout(l),l=setTimeout(x,t),p(c)}return l===void 0&&(l=setTimeout(x,t)),s}return _.cancel=w,_.flush=S,_}var $me=Mme,Dme=$me,Lme=Fo,Fme="Expected a function";function Bme(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(Fme);return Lme(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Dme(e,t,{leading:r,maxWait:t,trailing:i})}var Ume=Bme;const SF=ct(Ume);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 MA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _g(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MA(Object(n),!0).forEach(function(r){zme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zme(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 lp(t)=="symbol"?t:t+""}function Hme(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 qme(e,t){return Yme(e)||Kme(e,t)||Gme(e,t)||Vme()}function Vme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
683In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gme(e,t){if(e){if(typeof e=="string")return $A(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 $A(e,t)}}function $A(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 Kme(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Yme(e){if(Array.isArray(e))return e}var kF=b.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,s=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,p=e.children,g=e.debounce,m=g===void 0?0:g,v=e.id,x=e.className,y=e.onResize,w=e.style,S=w===void 0?{}:w,_=b.useRef(null),j=b.useRef();j.current=y,b.useImperativeHandle(t,function(){return Object.defineProperty(_.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),_.current},configurable:!0})});var k=b.useState({containerWidth:i.width,containerHeight:i.height}),C=qme(k,2),E=C[0],A=C[1],P=b.useCallback(function(B,F){A(function(M){var L=Math.round(B),R=Math.round(F);return M.containerWidth===L&&M.containerHeight===R?M:{containerWidth:L,containerHeight:R}})},[]);b.useEffect(function(){var B=function(O){var N,H=O[0].contentRect,V=H.width,D=H.height;P(V,D),(N=j.current)===null||N===void 0||N.call(j,V,D)};m>0&&(B=SF(B,m,{trailing:!0,leading:!1}));var F=new ResizeObserver(B),M=_.current.getBoundingClientRect(),L=M.width,R=M.height;return P(L,R),F.observe(_.current),function(){F.disconnect()}},[P,m]);var T=b.useMemo(function(){var B=E.containerWidth,F=E.containerHeight;if(B<0||F<0)return null;Vi(ml(s)||ml(c),`The width(%s) and height(%s) are both fixed numbers,
684       maybe you don't need to use a ResponsiveContainer.`,s,c),Vi(!n||n>0,"The aspect(%s) must be greater than zero.",n);var M=ml(s)?B:s,L=ml(c)?F:c;n&&n>0&&(M?L=M/n:L&&(M=L*n),h&&L>h&&(L=h)),Vi(M>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0,
685       please check the style of container, or the props width(%s) and height(%s),
686       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
687       height and width.`,M,L,s,c,d,f,n);var R=!Array.isArray(p)&&Ja(p.type).endsWith("Chart");return I.Children.map(p,function($){return I.isValidElement($)?b.cloneElement($,_g({width:M,height:L},R?{style:_g({height:"100%",width:"100%",maxHeight:L,maxWidth:M},$.props.style)}:{})):$})},[n,p,c,h,f,d,E,s]);return I.createElement("div",{id:v?"".concat(v):void 0,className:He("recharts-responsive-container",x),style:_g(_g({},S),{},{width:s,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:_},T)}),hm=function(t){return null};hm.displayName="Cell";function cp(e){"@babel/helpers - typeof";return cp=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},cp(e)}function DA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DA(Object(n),!0).forEach(function(r){Xme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xme(e,t,n){return t=Qme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qme(e){var t=Jme(e,"string");return cp(t)=="symbol"?t:t+""}function Jme(e,t){if(cp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(cp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nc={widthCache:{},cacheCount:0},Zme=2e3,ege={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},LA="recharts_measurement_span";function tge(e){var t=fj({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var ph=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||mi.isSsr)return{width:0,height:0};var r=tge(n),i=JSON.stringify({text:t,copyStyle:r});if(Nc.widthCache[i])return Nc.widthCache[i];try{var a=document.getElementById(LA);a||(a=document.createElement("span"),a.setAttribute("id",LA),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var s=fj(fj({},ege),r);Object.assign(a.style,s),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return Nc.widthCache[i]=c,++Nc.cacheCount>Zme&&(Nc.cacheCount=0,Nc.widthCache={}),c}catch{return{width:0,height:0}}},nge=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function up(e){"@babel/helpers - typeof";return up=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},up(e)}function cy(e,t){return sge(e)||age(e,t)||ige(e,t)||rge()}function rge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
688In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ige(e,t){if(e){if(typeof e=="string")return FA(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 FA(e,t)}}function FA(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 age(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function sge(e){if(Array.isArray(e))return e}function oge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BA(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,cge(r.key),r)}}function lge(e,t,n){return t&&BA(e.prototype,t),n&&BA(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cge(e){var t=uge(e,"string");return up(t)=="symbol"?t:t+""}function uge(e,t){if(up(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(up(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var UA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,zA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,dge=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,fge=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,NF={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},hge=Object.keys(NF),Jc="NaN";function pge(e,t){return e*NF[t]}var jg=function(){function e(t,n){oge(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!dge.test(n)&&(this.num=NaN,this.unit=""),hge.includes(n)&&(this.num=pge(t,n),this.unit="px")}return lge(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,i=(r=fge.exec(n))!==null&&r!==void 0?r:[],a=cy(i,3),s=a[1],l=a[2];return new e(parseFloat(s),l??"")}}])}();function CF(e){if(e.includes(Jc))return Jc;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=UA.exec(t))!==null&&n!==void 0?n:[],i=cy(r,4),a=i[1],s=i[2],l=i[3],c=jg.parse(a??""),u=jg.parse(l??""),d=s==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Jc;t=t.replace(UA,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=zA.exec(t))!==null&&f!==void 0?f:[],p=cy(h,4),g=p[1],m=p[2],v=p[3],x=jg.parse(g??""),y=jg.parse(v??""),w=m==="+"?x.add(y):x.subtract(y);if(w.isNaN())return Jc;t=t.replace(zA,w.toString())}return t}var WA=/\(([^()]*)\)/;function mge(e){for(var t=e;t.includes("(");){var n=WA.exec(t),r=cy(n,2),i=r[1];t=t.replace(WA,CF(i))}return t}function gge(e){var t=e.replace(/\s+/g,"");return t=mge(t),t=CF(t),t}function vge(e){try{return gge(e)}catch{return Jc}}function yw(e){var t=vge(e.slice(5,-1));return t===Jc?"":t}var yge=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],xge=["dx","dy","angle","className","breakAll"];function hj(){return hj=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},hj.apply(this,arguments)}function HA(e,t){if(e==null)return{};var n=bge(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bge(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function qA(e,t){return Sge(e)||jge(e,t)||_ge(e,t)||wge()}
688function wge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
689In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ge(e,t){if(e){if(typeof e=="string")return VA(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 VA(e,t)}}function VA(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 jge(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Sge(e){if(Array.isArray(e))return e}var EF=/[ \f\n\r\t\v\u2028\u2029]+/,PF=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var a=[];$e(n)||(r?a=n.toString().split(""):a=n.toString().split(EF));var s=a.map(function(c){return{word:c,width:ph(c,i).width}}),l=r?0:ph(" ",i).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},kge=function(t,n,r,i,a){var s=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=ce(s),f=l,h=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return M.reduce(function(L,R){var $=R.word,O=R.width,N=L[L.length-1];if(N&&(i==null||a||N.width+O+r<Number(i)))N.words.push($),N.width+=O+r;else{var H={words:[$],width:O};L.push(H)}return L},[])},p=h(n),g=function(M){return M.reduce(function(L,R){return L.width>R.width?L:R})};if(!d)return p;for(var m="…",v=function(M){var L=f.slice(0,M),R=PF({breakAll:u,style:c,children:L+m}).wordsWithComputedWidth,$=h(R),O=$.length>s||g($).width>Number(i);return[O,$]},x=0,y=f.length-1,w=0,S;x<=y&&w<=f.length-1;){var _=Math.floor((x+y)/2),j=_-1,k=v(j),C=qA(k,2),E=C[0],A=C[1],P=v(_),T=qA(P,1),B=T[0];if(!E&&!B&&(x=_+1),E&&B&&(y=_-1),!E&&B){S=A;break}w++}return S||p},GA=function(t){var n=$e(t)?[]:t.toString().split(EF);return[{words:n}]},Nge=function(t){var n=t.width,r=t.scaleToFit,i=t.children,a=t.style,s=t.breakAll,l=t.maxLines;if((n||r)&&!mi.isSsr){var c,u,d=PF({breakAll:s,children:i,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return GA(i);return kge({breakAll:s,children:i,maxLines:l,style:a},c,u,n,r)}return GA(i)},KA="#808080",Gl=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,m=g===void 0?"end":g,v=t.fill,x=v===void 0?KA:v,y=HA(t,yge),w=b.useMemo(function(){return Nge({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:f,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,f,y.style,y.width]),S=y.dx,_=y.dy,j=y.angle,k=y.className,C=y.breakAll,E=HA(y,xge);if(!_n(r)||!_n(a))return null;var A=r+(ce(S)?S:0),P=a+(ce(_)?_:0),T;switch(m){case"start":T=yw("calc(".concat(u,")"));break;case"middle":T=yw("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:T=yw("calc(".concat(w.length-1," * -").concat(l,")"));break}var B=[];if(f){var F=w[0].width,M=y.width;B.push("scale(".concat((ce(M)?M/F:1)/F,")"))}return j&&B.push("rotate(".concat(j,", ").concat(A,", ").concat(P,")")),B.length&&(E.transform=B.join(" ")),I.createElement("text",hj({},Ne(E,!0),{x:A,y:P,className:He("recharts-text",k),textAnchor:p,fill:x.includes("url")?KA:x}),w.map(function(L,R){var $=L.words.join(C?"":" ");return I.createElement("tspan",{x:A,dy:R===0?T:l,key:"".concat($,"-").concat(R)},$)}))};function po(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Cge(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function QN(e){let t,n,r;e.length!==2?(t=po,n=(l,c)=>po(e(l),c),r=(l,c)=>e(l)-c):(t=e===po||e===Cge?e:Ege,n=e,r=e);function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}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 f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){const f=i(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:s,right:a}}function Ege(){return 0}function OF(e){return e===null?NaN:+e}function*Pge(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Oge=QN(po),pm=Oge.right;QN(OF).center;class YA extends Map{constructor(t,n=Rge){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(XA(this,t))}has(t){return super.has(XA(this,t))}set(t,n){return super.set(Age(this,t),n)}delete(t){return super.delete(Tge(this,t))}}function XA({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Age({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Tge({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Rge(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ige(e=po){if(e===po)return AF;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 AF(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Mge=Math.sqrt(50),$ge=Math.sqrt(10),Dge=Math.sqrt(2);
689function uy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=Mge?10:a>=$ge?5:a>=Dge?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/s,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?uy(e,t,n*2):[l,c,u]}function pj(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?uy(t,e,n):uy(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(s<0)for(let u=0;u<l;++u)c[u]=(a-u)/-s;else for(let u=0;u<l;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(i+u)/-s;else for(let u=0;u<l;++u)c[u]=(i+u)*s;return c}function mj(e,t,n){return t=+t,e=+e,n=+n,uy(e,t,n)[2]}function gj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?mj(t,e,n):mj(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function QA(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function JA(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function TF(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?AF:Ige(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(n,Math.floor(t-u*f/c+h)),g=Math.min(r,Math.floor(t+(c-u)*f/c+h));TF(e,t,p,g,i)}const a=e[t];let s=n,l=r;for(_f(e,n,t),i(e[r],a)>0&&_f(e,n,r);s<l;){for(_f(e,s,l),++s,--l;i(e[s],a)<0;)++s;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?_f(e,n,l):(++l,_f(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function _f(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Lge(e,t,n){if(e=Float64Array.from(Pge(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return JA(e);if(t>=1)return QA(e);var r,i=(r-1)*t,a=Math.floor(i),s=QA(TF(e,a).subarray(0,a+1)),l=JA(e.subarray(a+1));return s+(l-s)*(i-a)}}function Fge(e,t,n=OF){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),s=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return s+(l-s)*(i-a)}}function Bge(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Si(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ys(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 vj=Symbol("implicit");function JN(){var e=new YA,t=[],n=[],r=vj;function i(a){let s=e.get(a);if(s===void 0){if(r!==vj)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new YA;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return JN(t,n).unknown(r)},Si.apply(i,arguments),i}function dp(){var e=JN().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=i<r,g=p?i:r,m=p?r:i;a=(m-g)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),g+=(m-g-a*(h-c))*d,s=a*(1-c),l&&(g=Math.round(g),s=Math.round(s));var v=Bge(h).map(function(x){return g+a*x});return n(p?v.reverse():v)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return dp(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(d)},Si.apply(f(),arguments)}function RF(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return RF(t())},e}function mh(){return RF(dp.apply(null,arguments).paddingInner(1))}function ZN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function IF(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function mm(){}var fp=.7,dy=1/fp,pu="\\s*([+-]?\\d+)\\s*",hp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Sa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Uge=/^#([0-9a-f]{3,8})$/,zge=new RegExp(`^rgb\\(${pu},${pu},${pu}\\)$`),Wge=new RegExp(`^rgb\\(${Sa},${Sa},${Sa}\\)$`),Hge=new RegExp(`^rgba\\(${pu},${pu},${pu},${hp}\\)$`),qge=new RegExp(`^rgba\\(${Sa},${Sa},${Sa},${hp}\\)$`),Vge=new RegExp(`^hsl\\(${hp},${Sa},${Sa}
689\\)$`),Gge=new RegExp(`^hsla\\(${hp},${Sa},${Sa},${hp}\\)$`),ZA={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};ZN(mm,pp,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:eT,formatHex:eT,formatHex8:Kge,formatHsl:Yge,formatRgb:tT,toString:tT});function eT(){return this.rgb().formatHex()}function Kge(){return this.rgb().formatHex8()}function Yge(){return MF(this).formatHsl()}function tT(){return this.rgb().formatRgb()}function pp(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Uge.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nT(t):n===3?new jr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Sg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Sg(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=zge.exec(e))?new jr(t[1],t[2],t[3],1):(t=Wge.exec(e))?new jr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Hge.exec(e))?
vendor: 7,272 bytes, line 689
689Sg(t[1],t[2],t[3],t[4]):(t=qge.exec(e))?Sg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vge.exec(e))?aT(t[1],t[2]/100,t[3]/100,1):(t=Gge.exec(e))?aT(t[1],t[2]/100,t[3]/100,t[4]):ZA.hasOwnProperty(e)?nT(ZA[e]):e==="transparent"?new jr(NaN,NaN,NaN,0):null}function nT(e){return new jr(e>>16&255,e>>8&255,e&255,1)}function Sg(e,t,n,r){return r<=0&&(e=t=n=NaN),new jr(e,t,n,r)}function Xge(e){return e instanceof mm||(e=pp(e)),e?(e=e.rgb(),new jr(e.r,e.g,e.b,e.opacity)):new jr}function yj(e,t,n,r){return arguments.length===1?Xge(e):new jr(e,t,n,r??1)}function jr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ZN(jr,yj,IF(mm,{brighter(e){return e=e==null?dy:Math.pow(dy,e),new jr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fp:Math.pow(fp,e),new jr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new jr(Al(this.r),Al(this.g),Al(this.b),fy(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:rT,formatHex:rT,formatHex8:Qge,formatRgb:iT,toString:iT}));function rT(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}`}function Qge(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}${gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function iT(){const e=fy(this.opacity);return`${e===1?"rgb(":"rgba("}${Al(this.r)}, ${Al(this.g)}, ${Al(this.b)}${e===1?")":`, ${e})`}`}function fy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Al(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gl(e){return e=Al(e),(e<16?"0":"")+e.toString(16)}function aT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wi(e,t,n,r)}function MF(e){if(e instanceof Wi)return new Wi(e.h,e.s,e.l,e.opacity);if(e instanceof mm||(e=pp(e)),!e)return new Wi;if(e instanceof Wi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,l=a-i,c=(a+i)/2;return l?(t===a?s=(n-r)/l+(n<r)*6:n===a?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?a+i:2-a-i,s*=60):l=c>0&&c<1?0:s,new Wi(s,l,c,e.opacity)}function Jge(e,t,n,r){return arguments.length===1?MF(e):new Wi(e,t,n,r??1)}function Wi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ZN(Wi,Jge,IF(mm,{brighter(e){return e=e==null?dy:Math.pow(dy,e),new Wi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fp:Math.pow(fp,e),new Wi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new jr(xw(e>=240?e-240:e+120,i,r),xw(e,i,r),xw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Wi(sT(this.h),kg(this.s),kg(this.l),fy(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=fy(this.opacity);return`${e===1?"hsl(":"hsla("}${sT(this.h)}, ${kg(this.s)*100}%, ${kg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sT(e){return e=(e||0)%360,e<0?e+360:e}function kg(e){return Math.max(0,Math.min(1,e||0))}function xw(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 eC=e=>()=>e;function Zge(e,t){return function(n){return e+n*t}}function eve(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 tve(e){return(e=+e)==1?$F:function(t,n){return n-t?eve(t,n,e):eC(isNaN(t)?n:t)}}function $F(e,t){var n=t-e;return n?Zge(e,n):eC(isNaN(e)?t:e)}const oT=function e(t){var n=tve(t);function r(i,a){var s=n((i=yj(i)).r,(a=yj(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=$F(i.opacity,a.opacity);return function(d){return i.r=s(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function nve(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function rve(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ive(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=Yd(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(l){for(s=0;s<r;++s)a[s]=i[s](l);return a}}function ave(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function hy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function sve(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Yd(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var xj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bw=new RegExp(xj.source,"g");function ove(e){return function(){return e}}function lve(e){return function(t){return e(t)+""}}function cve(e,t){var n=xj.lastIndex=bw.lastIndex=0,r,i,a,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=xj.exec(e))&&(i=bw.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[s]?l[s]+=a:l[++s]=a),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:hy(r,i)})),n=bw.lastIndex;return n<t.length&&(a=t.slice(n),l[s]?l[s]+=a:l[++s]=a),l.length<2?c[0]?lve(c[0].x):ove(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function Yd(e,t){var n=typeof t,r;return t==null||n==="boolean"?eC(t):(n==="number"?hy:n==="string"?(r=pp(t))?(t=r,oT):cve:t instanceof pp?oT:t instanceof Date?ave:rve(t)?nve:Array.isArray(t)?ive:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?sve:hy)(e,t)}function tC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function uve(e,t){t===void 0&&(t=e,e=Yd);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(s){var l=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return a[l](s-l)}}function dve(e){return function(){return e}}function py(e){return+e}var lT=[0,1];function cr(e){return e}function bj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:dve(isNaN(t)?NaN:.5)}function fve(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function hve(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=bj(i,r),a=n(s,a)):(r=bj(r,i),a=n(a,s)),function(l){return a(r(l))}}function pve(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=bj(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(l){var c=pm(e,l,1,r)-1;return a[c](i[c](l))}}function gm(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function xb(){var e=lT,t=lT,n=Yd,r,i,a,s=cr,l,c,u;function d(){var h=Math.min(e.length,t.length);return s!==cr&&(s=fve(e[0],e[h-1])),l=h>2?pve:hve,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(r),t,n)))(r(s(h)))}return f.invert=function(h){return s(i((u||(u=l(t,e.map(r),hy)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,py),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=tC,d()},f.clamp=function(h){return arguments.length?(s=h?!0:cr,d()):s!==cr},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return r=h,i=p,d()}}function nC(){return xb()(cr,cr)}
vendor: 4,809 bytes, line 689
689function mve(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function my(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 Qu(e){return e=my(Math.abs(e)),e?e[1]:NaN}function gve(e,t){return function(n,r){for(var i=n.length,a=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return a.reverse().join(t)}}function vve(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var yve=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mp(e){if(!(t=yve.exec(e)))throw new Error("invalid format: "+e);var t;return new rC({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]})}mp.prototype=rC.prototype;function rC(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+""}rC.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 xve(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var DF;function bve(e,t){var n=my(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(DF=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+my(e,Math.max(0,t+a-1))[0]}function cT(e,t){var n=my(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const uT={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:mve,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)=>cT(e*100,t),r:cT,s:bve,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function dT(e){return e}var fT=Array.prototype.map,hT=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function wve(e){var t=e.grouping===void 0||e.thousands===void 0?dT:gve(fT.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?dT:vve(fT.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=mp(f);var h=f.fill,p=f.align,g=f.sign,m=f.symbol,v=f.zero,x=f.width,y=f.comma,w=f.precision,S=f.trim,_=f.type;_==="n"?(y=!0,_="g"):uT[_]||(w===void 0&&(w=12),S=!0,_="g"),(v||h==="0"&&p==="=")&&(v=!0,h="0",p="=");var j=m==="$"?n:m==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",k=m==="$"?r:/[%p]/.test(_)?s:"",C=uT[_],E=/[defgprs%]/.test(_);w=w===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function A(P){var T=j,B=k,F,M,L;if(_==="c")B=C(P)+B,P="";else{P=+P;var R=P<0||1/P<0;if(P=isNaN(P)?c:C(Math.abs(P),w),S&&(P=xve(P)),R&&+P==0&&g!=="+"&&(R=!1),T=(R?g==="("?g:l:g==="-"||g==="("?"":g)+T,B=(_==="s"?hT[8+DF/3]:"")+B+(R&&g==="("?")":""),E){for(F=-1,M=P.length;++F<M;)if(L=P.charCodeAt(F),48>L||L>57){B=(L===46?i+P.slice(F+1):P.slice(F))+B,P=P.slice(0,F);break}}}y&&!v&&(P=t(P,1/0));var $=T.length+P.length+B.length,O=$<x?new Array(x-$+1).join(h):"";switch(y&&v&&(P=t(O+P,O.length?x-B.length:1/0),O=""),p){case"<":P=T+P+B+O;break;case"=":P=T+O+P+B;break;case"^":P=O.slice(0,$=O.length>>1)+T+P+B+O.slice($);break;default:P=O+T+P+B;break}return a(P)}return A.toString=function(){return f+""},A}function d(f,h){var p=u((f=mp(f),f.type="f",f)),g=Math.max(-8,Math.min(8,Math.floor(Qu(h)/3)))*3,m=Math.pow(10,-g),v=hT[8+g/3];return function(x){return p(m*x)+v}}return{format:u,formatPrefix:d}}var Ng,iC,LF;_ve({thousands:",",grouping:[3],currency:["$",""]});function _ve(e){return Ng=wve(e),iC=Ng.format,LF=Ng.formatPrefix,Ng}function jve(e){return Math.max(0,-Qu(Math.abs(e)))}function Sve(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Qu(t)/3)))*3-Qu(Math.abs(e)))}function kve(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Qu(t)-Qu(e))+1}
vendor: 5,844 bytes, line 689
689function FF(e,t,n,r){var i=gj(e,t,n),a;switch(r=mp(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Sve(i,s))&&(r.precision=a),LF(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=kve(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=jve(i))&&(r.precision=a-(r.type==="%")*2);break}}return iC(r)}function Uo(e){var t=e.domain;return e.ticks=function(n){var r=t();return pj(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return FF(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],l=r[a],c,u,d=10;for(l<s&&(u=s,s=l,l=u,u=i,i=a,a=u);d-- >0;){if(u=mj(s,l,n),u===c)return r[i]=s,r[a]=l,t(r);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function gy(){var e=nC();return e.copy=function(){return gm(e,gy())},Si.apply(e,arguments),Uo(e)}function BF(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,py),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return BF(e).unknown(t)},e=arguments.length?Array.from(e,py):[0,1],Uo(n)}function UF(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}function pT(e){return Math.log(e)}function mT(e){return Math.exp(e)}function Nve(e){return-Math.log(-e)}function Cve(e){return-Math.exp(-e)}function Eve(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Pve(e){return e===10?Eve:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Ove(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 gT(e){return(t,n)=>-e(-t,n)}function aC(e){const t=e(pT,mT),n=t.domain;let r=10,i,a;function s(){return i=Ove(r),a=Pve(r),n()[0]<0?(i=gT(i),a=gT(a),e(Nve,Cve)):e(pT,mT),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=i(u),p=i(d),g,m;const v=l==null?10:+l;let x=[];if(!(r%1)&&p-h<v){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<r;++g)if(m=h<0?g/a(-h):g*a(h),!(m<u)){if(m>d)break;x.push(m)}}else for(;h<=p;++h)for(g=r-1;g>=1;--g)if(m=h>0?g/a(-h):g*a(h),!(m<u)){if(m>d)break;x.push(m)}x.length*2<v&&(x=pj(u,d,v))}else x=pj(h,p,Math.min(p-h,v)).map(a);return f?x.reverse():x},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=mp(c)).precision==null&&(c.trim=!0),c=iC(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(i(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(UF(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function zF(){const e=aC(xb()).domain([1,10]);return e.copy=()=>gm(e,zF()).base(e.base()),Si.apply(e,arguments),e}function vT(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function yT(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function sC(e){var t=1,n=e(vT(t),yT(t));return n.constant=function(r){return arguments.length?e(vT(t=+r),yT(t)):t},Uo(n)}function WF(){var e=sC(xb());return e.copy=function(){return gm(e,WF()).constant(e.constant())},Si.apply(e,arguments)}function xT(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ave(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Tve(e){return e<0?-e*e:e*e}function oC(e){var t=e(cr,cr),n=1;function r(){return n===1?e(cr,cr):n===.5?e(Ave,Tve):e(xT(n),xT(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Uo(t)}function lC(){var e=oC(xb());return e.copy=function(){return gm(e,lC()).exponent(e.exponent())},Si.apply(e,arguments),e}function Rve(){return lC.apply(null,arguments).exponent(.5)}function bT(e){return Math.sign(e)*e*e}function Ive(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function HF(){var e=nC(),t=[0,1],n=!1,r;function i(a){var s=Ive(e(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return e.invert(bT(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,py)).map(bT)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return HF(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Si.apply(i,arguments),Uo(i)}function qF(){var e=[],t=[],n=[],r;function i(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s<l;)n[s-1]=Fge(e,s/l);return a}function a(s){return s==null||isNaN(s=+s)?r:t[pm(n,s)]}return a.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(po),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return qF().domain(e).range(t).unknown(r)},Si.apply(a,arguments)}function VF(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[pm(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 s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l(
689)):i.slice()},s.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return VF().domain([e,t]).range(i).unknown(a)},Si.apply(Uo(s),arguments)}function GF(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[pm(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return GF().domain(e).range(t).unknown(n)},Si.apply(i,arguments)}const ww=new Date,_w=new Date;function jn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),l=i.ceil(a);return a-s<l-a?s:l},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<s)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<s);return c},i.filter=a=>jn(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!a(s););else for(;--l>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(ww.setTime(+a),_w.setTime(+s),e(ww),e(_w),Math.floor(n(ww,_w))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const vy=jn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?jn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vy);vy.range;const Ga=1e3,fi=Ga*60,Ka=fi*60,ls=Ka*24,cC=ls*7,wT=ls*30,jw=ls*365,vl=jn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ga)},(e,t)=>(t-e)/Ga,e=>e.getUTCSeconds());vl.range;const uC=jn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ga)},(e,t)=>{e.setTime(+e+t*fi)},(e,t)=>(t-e)/fi,e=>e.getMinutes());uC.range;const dC=jn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*fi)},(e,t)=>(t-e)/fi,e=>e.getUTCMinutes());dC.range;const fC=jn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ga-e.getMinutes()*fi)},(e,t)=>{e.setTime(+e+t*Ka)},(e,t)=>(t-e)/Ka,e=>e.getHours());fC.range;const hC=jn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ka)},(e,t)=>(t-e)/Ka,e=>e.getUTCHours());hC.range;const vm=jn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*fi)/ls,e=>e.getDate()-1);vm.range;const bb=jn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ls,e=>e.getUTCDate()-1);bb.range;const KF=jn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ls,e=>Math.floor(e/ls));KF.range;function lc(e){return jn(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())*fi)/cC)}const wb=lc(0),yy=lc(1),Mve=lc(2),$ve=lc(3),Ju=lc(4),Dve=lc(5),Lve=lc(6);wb.range;yy.range;Mve.range;$ve.range;Ju.range;Dve.range;Lve.range;function cc(e){return jn(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)/cC)}const _b=cc(0),xy=cc(1),Fve=cc(2),Bve=cc(3),Zu=cc(4),Uve=cc(5),zve=cc(6);_b.range;xy.range;Fve.range;Bve.range;Zu.range;Uve.range;zve.range;const pC=jn(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());pC.range;const mC=jn(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());mC.range;const cs=jn(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());cs.every=e=>
vendor: 4,121 bytes, line 689
689!isFinite(e=Math.floor(e))||!(e>0)?null:jn(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)});cs.range;const us=jn(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());us.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:jn(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)});us.range;function YF(e,t,n,r,i,a){const s=[[vl,1,Ga],[vl,5,5*Ga],[vl,15,15*Ga],[vl,30,30*Ga],[a,1,fi],[a,5,5*fi],[a,15,15*fi],[a,30,30*fi],[i,1,Ka],[i,3,3*Ka],[i,6,6*Ka],[i,12,12*Ka],[r,1,ls],[r,2,2*ls],[n,1,cC],[t,1,wT],[t,3,3*wT],[e,1,jw]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),g=p?p.range(u,+d+1):[];return h?g.reverse():g}function c(u,d,f){const h=Math.abs(d-u)/f,p=QN(([,,v])=>v).right(s,h);if(p===s.length)return e.every(gj(u/jw,d/jw,f));if(p===0)return vy.every(Math.max(gj(u,d,f),1));const[g,m]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(m)}return[l,c]}const[Wve,Hve]=YF(us,mC,_b,KF,hC,dC),[qve,Vve]=YF(cs,pC,wb,vm,fC,uC);function Sw(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 kw(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 jf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Gve(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=Sf(i),d=kf(i),f=Sf(a),h=kf(a),p=Sf(s),g=kf(s),m=Sf(l),v=kf(l),x=Sf(c),y=kf(c),w={a:R,A:$,b:O,B:N,c:null,d:CT,e:CT,f:gye,g:Nye,G:Eye,H:hye,I:pye,j:mye,L:XF,m:vye,M:yye,p:H,q:V,Q:OT,s:AT,S:xye,u:bye,U:wye,V:_ye,w:jye,W:Sye,x:null,X:null,y:kye,Y:Cye,Z:Pye,"%":PT},S={a:D,A:K,b:ae,B:se,c:null,d:ET,e:ET,f:Rye,g:Wye,G:qye,H:Oye,I:Aye,j:Tye,L:JF,m:Iye,M:Mye,p:Q,q:ne,Q:OT,s:AT,S:$ye,u:Dye,U:Lye,V:Fye,w:Bye,W:Uye,x:null,X:null,y:zye,Y:Hye,Z:Vye,"%":PT},_={a:A,A:P,b:T,B,c:F,d:kT,e:kT,f:cye,g:ST,G:jT,H:NT,I:NT,j:aye,L:lye,m:iye,M:sye,p:E,q:rye,Q:dye,s:fye,S:oye,u:Jve,U:Zve,V:eye,w:Qve,W:tye,x:M,X:L,y:ST,Y:jT,Z:nye,"%":uye};w.x=j(n,w),w.X=j(r,w),w.c=j(t,w),S.x=j(n,S),S.X=j(r,S),S.c=j(t,S);function j(Z,W){return function(ee){var q=[],re=-1,ge=0,Ie=Z.length,ye,qe,jt;for(ee instanceof Date||(ee=new Date(+ee));++re<Ie;)Z.charCodeAt(re)===37&&(q.push(Z.slice(ge,re)),(qe=_T[ye=Z.charAt(++re)])!=null?ye=Z.charAt(++re):qe=ye==="e"?" ":"0",(jt=W[ye])&&(ye=jt(ee,qe)),q.push(ye),ge=re+1);return q.push(Z.slice(ge,re)),q.join("")}}function k(Z,W){return function(ee){var q=jf(1900,void 0,1),re=C(q,Z,ee+="",0),ge,Ie;if(re!=ee.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(W&&!("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?(ge=kw(jf(q.y,0,1)),Ie=ge.getUTCDay(),ge=Ie>4||Ie===0?xy.ceil(ge):xy(ge),ge=bb.offset(ge,(q.V-1)*7),q.y=ge.getUTCFullYear(),q.m=ge.getUTCMonth(),q.d=ge.getUTCDate()+(q.w+6)%7):(ge=Sw(jf(q.y,0,1)),Ie=ge.getDay(),ge=Ie>4||Ie===0?yy.ceil(ge):yy(ge),ge=vm.offset(ge,(q.V-1)*7),q.y=ge.getFullYear(),q.m=ge.getMonth(),q.d=ge.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),Ie="Z"in q?kw(jf(q.y,0,1)).getUTCDay():Sw(jf(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(Ie+5)%7:q.w+q.U*7-(Ie+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,kw(q)):Sw(q)}}function C(Z,W,ee,q){for(var re=0,ge=W.length,Ie=ee.length,ye,qe;re<ge;){if(q>=Ie)return-1;if(ye=W.charCodeAt(re++),ye===37){if(ye=W.charAt(re++),qe=_[ye in _T?W.charAt(re++):ye],!qe||(q=qe(Z,ee,q))<0)return-1}else if(ye!=ee.charCodeAt(q++))return-1}return q}function E(Z,W,ee){var q=u.exec(W.slice(ee));return q?(Z.p=d.get(q[0].toLowerCase()),ee+q[0].length):-1}function A(Z,W,ee){var q=p.exec(W.slice(ee));
vendor: 5,985 bytes, line 689
689return q?(Z.w=g.get(q[0].toLowerCase()),ee+q[0].length):-1}function P(Z,W,ee){var q=f.exec(W.slice(ee));return q?(Z.w=h.get(q[0].toLowerCase()),ee+q[0].length):-1}function T(Z,W,ee){var q=x.exec(W.slice(ee));return q?(Z.m=y.get(q[0].toLowerCase()),ee+q[0].length):-1}function B(Z,W,ee){var q=m.exec(W.slice(ee));return q?(Z.m=v.get(q[0].toLowerCase()),ee+q[0].length):-1}function F(Z,W,ee){return C(Z,t,W,ee)}function M(Z,W,ee){return C(Z,n,W,ee)}function L(Z,W,ee){return C(Z,r,W,ee)}function R(Z){return s[Z.getDay()]}function $(Z){return a[Z.getDay()]}function O(Z){return c[Z.getMonth()]}function N(Z){return l[Z.getMonth()]}function H(Z){return i[+(Z.getHours()>=12)]}function V(Z){return 1+~~(Z.getMonth()/3)}function D(Z){return s[Z.getUTCDay()]}function K(Z){return a[Z.getUTCDay()]}function ae(Z){return c[Z.getUTCMonth()]}function se(Z){return l[Z.getUTCMonth()]}function Q(Z){return i[+(Z.getUTCHours()>=12)]}function ne(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var W=j(Z+="",w);return W.toString=function(){return Z},W},parse:function(Z){var W=k(Z+="",!1);return W.toString=function(){return Z},W},utcFormat:function(Z){var W=j(Z+="",S);return W.toString=function(){return Z},W},utcParse:function(Z){var W=k(Z+="",!0);return W.toString=function(){return Z},W}}}var _T={"-":"",_:" ",0:"0"},On=/^\s*\d+/,Kve=/^%/,Yve=/[\\^$*+?|[\]().{}]/g;function lt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function Xve(e){return e.replace(Yve,"\\$&")}function Sf(e){return new RegExp("^(?:"+e.map(Xve).join("|")+")","i")}function kf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Qve(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Jve(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Zve(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function eye(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function tye(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function jT(e,t,n){var r=On.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ST(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function nye(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 rye(e,t,n){var r=On.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function iye(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function kT(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function aye(e,t,n){var r=On.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function NT(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function sye(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function oye(e,t,n){var r=On.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function lye(e,t,n){var r=On.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function cye(e,t,n){var r=On.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function uye(e,t,n){var r=Kve.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function dye(e,t,n){var r=On.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function fye(e,t,n){var r=On.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function CT(e,t){return lt(e.getDate(),t,2)}function hye(e,t){return lt(e.getHours(),t,2)}function pye(e,t){return lt(e.getHours()%12||12,t,2)}function mye(e,t){return lt(1+vm.count(cs(e),e),t,3)}function XF(e,t){return lt(e.getMilliseconds(),t,3)}function gye(e,t){return XF(e,t)+"000"}function vye(e,t){return lt(e.getMonth()+1,t,2)}function yye(e,t){return lt(e.getMinutes(),t,2)}function xye(e,t){return lt(e.getSeconds(),t,2)}function bye(e){var t=e.getDay();return t===0?7:t}function wye(e,t){return lt(wb.count(cs(e)-1,e),t,2)}function QF(e){var t=e.getDay();return t>=4||t===0?Ju(e):Ju.ceil(e)}function _ye(e,t){return e=QF(e),lt(Ju.count(cs(e),e)+(cs(e).getDay()===4),t,2)}function jye(e){return e.getDay()}function Sye(e,t){return lt(yy.count(cs(e)-1,e),t,2)}function kye(e,t){return lt(e.getFullYear()%100,t,2)}function Nye(e,t){return e=QF(e),lt(e.getFullYear()%100,t,2)}function Cye(e,t){return lt(e.getFullYear()%1e4,t,4)}function Eye(e,t){var n=e.getDay();return e=n>=4||n===0?Ju(e):Ju.ceil(e),lt(e.getFullYear()%1e4,t,4)}function Pye(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+lt(t/60|0,"0",2)+lt(t%60,"0",2)}function ET(e,t){return lt(e.getUTCDate(),t,2)}function Oye(e,t){return lt(e.getUTCHours(),t,2)}function Aye(e,t){return lt(e.getUTCHours()%12||12,t,2)}function Tye(e,t){return lt(1+bb.count(us(e),e),t,3)}function JF(e,t){return lt(e.getUTCMilliseconds(),t,3)}function Rye(e,t){return JF(e,t)+"000"}function Iye(e,t){return lt(e.getUTCMonth()+1,t,2)}function Mye(e,t){return lt(e.getUTCMinutes(),t,2)}function $ye(e,t){return lt(e.getUTCSeconds(),t,2)}function Dye(e){var t=e.getUTCDay();return t===0?7:t}function Lye(e,t){return lt(_b.count(us(e)-1,e),t,2)}function ZF(e){var t=e.getUTCDay();return t>=4||t===0?Zu(e):Zu.ceil(e)}function Fye(e,t){return e=ZF(e),lt(Zu.count(us(e),e)+(us(e).getUTCDay()===4),t,2)}function Bye(e){return e.getUTCDay()}function Uye(e,t){return lt(xy.count(us(e)-1,e),t,2)}function zye(e,t){return lt(e.getUTCFullYear()%100,t,2)}function Wye(e,t){return e=ZF(e),lt(e.getUTCFullYear()%100,t,2)}function Hye(e,t){return lt(e.getUTCFullYear()%1e4,t,4)}function qye(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Zu(e):Zu.ceil(e),lt(e.getUTCFullYear()%1e4,t,4)}function Vye(){return"+0000"}function PT(){return"%"}function OT(e){return+e}function AT(e){return Math.floor(+e/1e3)}var Cc,e6,t6;Gye({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
689ay","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 Gye(e){return Cc=Gve(e),e6=Cc.format,Cc.parse,t6=Cc.utcFormat,Cc.utcParse,Cc}function Kye(e){return new Date(e)}function Yye(e){return e instanceof Date?+e:+new Date(+e)}function gC(e,t,n,r,i,a,s,l,c,u){var d=nC(),f=d.invert,h=d.domain,p=u(".%L"),g=u(":%S"),m=u("%I:%M"),v=u("%I %p"),x=u("%a %d"),y=u("%b %d"),w=u("%B"),S=u("%Y");function _(j){return(c(j)<j?p:l(j)<j?g:s(j)<j?m:a(j)<j?v:r(j)<j?i(j)<j?x:y:n(j)<j?w:S)(j)}return d.invert=function(j){return new Date(f(j))},d.domain=function(j){return arguments.length?h(Array.from(j,Yye)):h().map(Kye)},d.ticks=function(j){var k=h();return e(k[0],k[k.length-1],j??10)},d.tickFormat=function(j,k){return k==null?_:u(k)},d.nice=function(j){var k=h();return(!j||typeof j.range!="function")&&(j=t(k[0],k[k.length-1],j??10)),j?h(UF(k,j)):d},d.copy=function(){return gm(d,gC(e,t,n,r,i,a,s,l,c,u))},d}function Xye(){return Si.apply(gC(qve,Vve,cs,pC,wb,vm,fC,uC,vl,e6).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Qye(){return Si.apply(gC(Wve,Hve,us,mC,_b,bb,hC,dC,vl,t6).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jb(){var e=0,t=1,n,r,i,a,s=cr,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(a(f)-n)*i,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(s=f,u):s};function d(f){return function(h){var p,g;return arguments.length?([p,g]=h,s=f(p,g),u):[s(0),s(1)]}}
vendor: 69,197 bytes, lines 689-716
689return u.range=d(Yd),u.rangeRound=d(tC),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),u}}function zo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function n6(){var e=Uo(jb()(cr));return e.copy=function(){return zo(e,n6())},ys.apply(e,arguments)}function r6(){var e=aC(jb()).domain([1,10]);return e.copy=function(){return zo(e,r6()).base(e.base())},ys.apply(e,arguments)}function i6(){var e=sC(jb());return e.copy=function(){return zo(e,i6()).constant(e.constant())},ys.apply(e,arguments)}function vC(){var e=oC(jb());return e.copy=function(){return zo(e,vC()).exponent(e.exponent())},ys.apply(e,arguments)}function Jye(){return vC.apply(null,arguments).exponent(.5)}function a6(){var e=[],t=cr;function n(r){if(r!=null&&!isNaN(r=+r))return t((pm(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(po),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>Lge(e,a/r))},n.copy=function(){return a6(t).domain(e)},ys.apply(n,arguments)}function Sb(){var e=0,t=.5,n=1,r=1,i,a,s,l,c,u=cr,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-a)*(r*m<r*a?l:c),u(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,n]=m,i=d(e=+e),a=d(t=+t),s=d(n=+n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(m){return arguments.length?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(u=m,p):u};function g(m){return function(v){var x,y,w;return arguments.length?([x,y,w]=v,u=uve(m,[x,y,w]),p):[u(0),u(.5),u(1)]}}return p.range=g(Yd),p.rangeRound=g(tC),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return d=m,i=m(e),a=m(t),s=m(n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,p}}function s6(){var e=Uo(Sb()(cr));return e.copy=function(){return zo(e,s6())},ys.apply(e,arguments)}function o6(){var e=aC(Sb()).domain([.1,1,10]);return e.copy=function(){return zo(e,o6()).base(e.base())},ys.apply(e,arguments)}function l6(){var e=sC(Sb());return e.copy=function(){return zo(e,l6()).constant(e.constant())},ys.apply(e,arguments)}function yC(){var e=oC(Sb());return e.copy=function(){return zo(e,yC()).exponent(e.exponent())},ys.apply(e,arguments)}function Zye(){return yC.apply(null,arguments).exponent(.5)}const TT=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:dp,scaleDiverging:s6,scaleDivergingLog:o6,scaleDivergingPow:yC,scaleDivergingSqrt:Zye,scaleDivergingSymlog:l6,scaleIdentity:BF,scaleImplicit:vj,scaleLinear:gy,scaleLog:zF,scaleOrdinal:JN,scalePoint:mh,scalePow:lC,scaleQuantile:qF,scaleQuantize:VF,scaleRadial:HF,scaleSequential:n6,scaleSequentialLog:r6,scaleSequentialPow:vC,scaleSequentialQuantile:a6,scaleSequentialSqrt:Jye,scaleSequentialSymlog:i6,scaleSqrt:Rve,scaleSymlog:WF,scaleThreshold:GF,scaleTime:Xye,scaleUtc:Qye,tickFormat:FF},Symbol.toStringTag,{value:"Module"}));var exe=Bd;function txe(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],s=t(a);if(s!=null&&(l===void 0?s===s&&!exe(s):n(s,l)))var l=s,c=a}return c}var kb=txe;function nxe(e,t){return e>t}var c6=nxe,rxe=kb,ixe=c6,axe=Kd;function sxe(e){return e&&e.length?rxe(e,axe,ixe):void 0}var oxe=sxe;const Zs=ct(oxe);function lxe(e,t){return e<t}var u6=lxe,cxe=kb,uxe=u6,dxe=Kd;function fxe(e){return e&&e.length?cxe(e,dxe,uxe):void 0}var hxe=fxe;const Nb=ct(hxe);var pxe=RN,mxe=Ra,gxe=vF,vxe=Ir;function yxe(e,t){var n=vxe(e)?pxe:gxe;return n(e,mxe(t))}var xxe=yxe,bxe=mF,wxe=xxe;function _xe(e,t){return bxe(wxe(e,t),1)}var jxe=_xe;const Sxe=ct(jxe);var kxe=GN;function Nxe(e,t){return kxe(e,t)}var Cxe=Nxe;const No=ct(Cxe);var Xd=1e9,Exe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},bC,Vt=!0,xi="[DecimalError] ",Tl=xi+"Invalid argument: ",xC=xi+"Exponent out of range: ",Qd=Math.floor,sl=Math.pow,Pxe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,qr,kn=1e7,Bt=7,d6=9007199254740991,by=Qd(d6/Bt),be={};be.absoluteValue=be.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};be.comparedTo=be.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};be.decimalPlaces=be.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Bt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};be.dividedBy=be.div=function(e){return Za(this,new this.constructor(e))};be.dividedToIntegerBy=be.idiv=function(e){var t=this,n=t.constructor;return Nt(Za(t,new n(e),0,1),n.precision)};be.equals=be.eq=function(e){return!this.cmp(e)};be.exponent=function(){return pn(this)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){return this.cmp(e)>=0};be.isInteger=be.isint=function(){return this.e>this.d.length-2};be.isNegative=be.isneg=function(){return this.s<0};be.isPositive=be.ispos=function(){return this.s>0};be.isZero=function(){return this.s===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(qr))throw Error(xi+"NaN");if(n.s<1)throw Error(xi+(n.s?"NaN":"-Infinity"));return n.eq(qr)?new r(0):(Vt=!1,t=Za(gp(n,a),gp(e,a),a),Vt=!0,Nt(t,i))};be.minus=be.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?p6(t,e):f6(t,(e.s=-e.s,e))};be.modulo=be.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(xi+"NaN");return n.s?(Vt=!1,t=Za(n,e,0,1).times(e),Vt=!0,n.minus(t)):Nt(new r(n),i)};be.naturalExponential=be.exp=function(){return h6(this)};be.naturalLogarithm=be.ln=function(){return gp(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};be.plus=be.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?f6(t,e):p6(t,(e.s=-e.s,e))};be.precision=be.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Tl+e);if(t=pn(i)+1,r=i.d.length-1,n=r*Bt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};be.squareRoot=be.sqrt=function(){var e,t,n,r,i,a,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(xi+"NaN")}for(e=pn(l),Vt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=va(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Qd((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(a=r,r=a.plus(Za(l,a,s+2)).times(.5),va(a.d).slice(0,s)===(t=va(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Nt(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;s+=4}return Vt=!0,Nt(r,n)};be.times=be.mul=function(e){var t,n,r,i,a,s,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=p.length,c<u&&(a=h,h=p,p=a,s=c,c=u,u=s),a=[],s=c+u,r=s;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+p[r]*h[i-r-1]+t,a[i--]=l%kn|0,t=l/kn|0;a[i]=(a[i]+t)%kn|0}for(;!a[--s];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Vt?Nt(e,f.precision):e};be.toDecimalPlaces=be.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ea(e,0,Xd),t===void 0?t=r.rounding:Ea(t,0,8),Nt(n,e+pn(n)+1,t))};be.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Kl(r,!0):(Ea(e,0,Xd),t===void 0?t=i.rounding:Ea(t,0,8),r=Nt(new i(r),e+1,t),n=Kl(r,!0,e+1)),n};be.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Kl(i):(Ea(e,0,Xd),t===void 0?t=a.rounding:Ea(t,0,8),r=Nt(new a(i),e+pn(i)+1,t),n=Kl(r.abs(),!1,e+pn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};be.toInteger=be.toint=function(){var e=this,t=e.constructor;return Nt(new t(e),pn(e)+1,t.rounding)};be.toNumber=function(){return+this};be.toPower=be.pow=function(e){var t,n,r,i,a,s,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(qr);if(l=new c(l),!l.s){if(e.s<1)throw Error(xi+"Infinity");return l}if(l.eq(qr))return l;if(r=c.precision,e.eq(qr))return Nt(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,a=l.s,s){if((n=d<0?-d:d)<=d6){for(i=new c(qr),t=Math.ceil(r/Bt+4),Vt=!1;n%2&&(i=i.times(l),IT(i.d,t)),n=Qd(n/2),n!==0;)l=l.times(l),IT(l.d,t);return Vt=!0,e.s<0?new c(qr).div(i):Nt(i,r)}}else if(a<0)throw Error(xi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Vt=!1,i=e.times(gp(l,r+u)),Vt=!0,i=h6(i),i.s=a,i};be.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=pn(i),r=Kl(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ea(e,1,Xd),t===void 0?t=a.rounding:Ea(t,0,8),i=Nt(new a(i),e,t),n=pn(i),r=Kl(i,e<=n||n<=a.toExpNeg,e)),r};be.toSignificantDigits=be.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ea(e,1,Xd),t===void 0?t=r.rounding:Ea(t,0,8)),Nt(new r(n),e,t)};be.toString=be.valueOf=be.val=be.toJSON=be[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=pn(e),n=e.constructor;return Kl(e,t<=n.toExpNeg||t>=n.toExpPos)};function f6(e,t){var n,r,i,a,s,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Vt?Nt(t,f):t;if(c=e.d,u=t.d,s=e.e,i=t.e,c=c.slice(),a=s-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=s,l=c.length),s=Math.ceil(f/Bt),l=s>l?s+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)/kn|0,c[a]%=kn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Vt?Nt(t,f):t}function Ea(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Tl+e)}function va(e){var t,n,r,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)r=e[t]+"",n=Bt-r.length,n&&(a+=Rs(n)),a+=r;s=e[t],r=s+"",n=Bt-r.length,n&&(a+=Rs(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var Za=function(){function e(r,i){var a,s=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+s,r[l]=a%kn|0,s=a/kn|0;return s&&r.unshift(s),r}function t(r,i,a,s){var l,c;if(a!=s)c=a>s?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var s=0;a--;)r[a]-=s,s=r[a]<i[a]?1:0,r[a]=s*kn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var l,c,u,d,f,h,p,g,m,v,x,y,w,S,_,j,k,C,E=r.constructor,A=r.s==i.s?1:-1,P=r.d,T=i.d;if(!r.s)return new E(r);if(!i.s)throw Error(xi+"Division by zero");for(c=r.e-i.e,k=T.length,_=P.length,p=new E(A),g=p.d=[],u=0;T[u]==(P[u]||0);)++u;if(T[u]>(P[u]||0)&&--c,a==null?y=a=E.precision:s?y=a+(pn(r)-pn(i))+1:y=a,y<0)return new E(0);if(y=y/Bt+2|0,u=0,k==1)for(d=0,T=T[0],y++;(u<_||d)&&y--;u++)w=d*kn+(P[u]||0),g[u]=w/T|0,d=w%T|0;else{for(d=kn/(T[0]+1)|0,d>1&&(T=e(T,d),P=e(P,d),k=T.length,_=P.length),S=k,m=P.slice(0,k),v=m.length;v<k;)m[v++]=0;C=T.slice(),C.unshift(0),j=T[0],T[1]>=kn/2&&++j;do d=0,l=t(T,m,k,v),l<0?(x=m[0],k!=v&&(x=x*kn+(m[1]||0)),d=x/j|0,d>1?(d>=kn&&(d=kn-1),f=e(T,d),h=f.length,v=m.length,l=t(f,m,h,v),l==1&&(d--,n(f,k<h?C:T,h))):(d==0&&(l=d=1),f=T.slice()),h=f.length,h<v&&f.unshift(0),n(m,f,v),l==-1&&(v=m.length,l=t(T,m,k,v),l<1&&(d++,n(m,k<v?C:T,v))),v=m.length):l===0&&(d++,m=[0]),g[u++]=d,l&&m[0]?m[v++]=P[S]||0:(m=[P[S]],v=1);while((S++<_||m[0]!==void 0)&&y--)}return g[0]||g.shift(),p.e=c,Nt(p,s?a+pn(p)+1:a)}}();function h6(e,t){var n,r,i,a,s,l,c=0,u=0,d=e.constructor,f=d.precision;if(pn(e)>16)throw Error(xC+pn(e));if(!e.s)return new d(qr);for(t==null?(Vt=!1,l=f):l=t,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(sl(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(qr),d.precision=l;;){if(i=Nt(i.times(e),l),n=n.times(++c),s=a.plus(Za(i,n,l)),va(s.d).slice(0,l)===va(a.d).slice(0,l)){for(;u--;)a=Nt(a.times(a),l);return d.precision=f,t==null?(Vt=!0,Nt(a,f)):a}a=s}}function pn(e){for(var t=e.e*Bt,n=e.d[0];n>=10;n/=10)t++;return t}function Nw(e,t,n){if(t>e.LN10.sd())throw Vt=!0,n&&(e.precision=n),Error(xi+"LN10 precision limit exceeded");return Nt(new e(e.LN10),t)}function Rs(e){for(var t="";e--;)t+="0";return t}function gp(e,t){var n,r,i,a,s,l,c,u,d,f=1,h=10,p=e,g=p.d,m=p.constructor,v=m.precision;if(p.s<1)throw Error(xi+(p.s?"NaN":"-Infinity"));if(p.eq(qr))return new m(0);if(t==null?(Vt=!1,u=v):u=t,p.eq(10))return t==null&&(Vt=!0),Nw(m,u);if(u+=h,m.precision=u,n=va(g),r=n.charAt(0),a=pn(p),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=va(p.d),r=n.charAt(0),f++;a=pn(p),r>1?(p=new m("0."+n),a++):p=new m(r+"."+n.slice(1))}else return c=Nw(m,u+2,v).times(a+""),p=gp(new m(r+"."+n.slice(1)),u-h).plus(c),m.precision=v,t==null?(Vt=!0,Nt(p,v)):p;for(l=s=p=Za(p.minus(qr),p.plus(qr),u),d=Nt(p.times(p),u),i=3;;){if(s=Nt(s.times(d),u),c=l.plus(Za(s,new m(i),u)),va(c.d).slice(0,u)===va(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(Nw(m,u+2,v).times(a+""))),l=Za(l,new m(f),u),m.precision=v,t==null?(Vt=!0,Nt(l,v)):l;l=c,i+=2}}function RT(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Qd(n/Bt),e.d=[],r=(n+1)%Bt,n<0&&(r+=Bt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Bt;r<i;)e.d.push(+t.slice(r,r+=Bt));t=t.slice(r),r=Bt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Vt&&(e.e>by||e.e<-by))throw Error(xC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Nt(e,t,n){var r,i,a,s,l,c,u,d,f=e.d;for(s=1,a=f[0];a>=10;a/=10)s++;if(r=t-s,r<0)r+=Bt,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/Bt),a=f.length,d>=a)return e;for(u=a=f[d],s=1;a>=10;a/=10)s++;r%=Bt,i=r-Bt+s}if(n!==void 0&&(a=sl(10,s-i-1),l=u/a%10|0,c=t<0||f[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?i>0?u/sl(10,s-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=pn(e),f.length=1,t=t-a-1,f[0]=sl(10,(Bt-t%Bt)%Bt),e.e=Qd(-t/Bt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=sl(10,Bt-r),f[d]=i>0?(u/sl(10,s-i)%sl(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==kn&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=kn)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(Vt&&(e.e>by||e.e<-by))throw Error(xC+pn(e));return e}function p6(e,t){var n,r,i,a,s,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Vt?Nt(t,p):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),s=u-r,s){for(d=s<0,d?(n=c,s=-s,l=f.length):(n=f,r=u,l=c.length),i=Math.max(Math.ceil(p/Bt),l)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,d=i<l,d&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){d=c[i]<f[i];break}s=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=kn-1;--c[a],c[i]+=kn}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Vt?Nt(t,p):t):new h(0)}function Kl(e,t,n){var r,i=pn(e),a=va(e.d),s=a.length;return t?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+Rs(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Rs(-i-1)+a,n&&(r=n-s)>0&&(a+=Rs(r))):i>=s?(a+=Rs(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+Rs(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=Rs(r))),e.s<0?"-"+a:a}function IT(e,t){if(e.length>t)return e.length=t,!0}function m6(e){var t,n,r;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Tl+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return RT(s,a.toString())}else if(typeof a!="string")throw Error(Tl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,Pxe.test(a))RT(s,a);else throw Error(Tl+a)}if(i.prototype=be,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=m6,i.config=i.set=Oxe,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Oxe(e){if(!e||typeof e!="object")throw Error(xi+"Object expected");var t,n,r,i=["precision",1,Xd,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Qd(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Tl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Tl+n+": "+r);return this}var bC=m6(Exe);qr=new bC(1);const bt=bC;function Axe(e){return Mxe(e)||Ixe(e)||Rxe(e)||Txe()}function Txe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
690In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rxe(e,t){if(e){if(typeof e=="string")return wj(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 wj(e,t)}}function Ixe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Mxe(e){if(Array.isArray(e))return wj(e)}function wj(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 $xe=function(t){return t},g6={"@@functional/placeholder":!0},v6=function(t){return t===g6},MT=function(t){return function n(){return arguments.length===0||arguments.length===1&&v6(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Dxe=function e(t,n){return t===1?n:MT(function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var s=i.filter(function(l){return l!==g6}).length;return s>=t?n.apply(void 0,i):e(t-s,MT(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=i.map(function(f){return v6(f)?c.shift():f});return n.apply(void 0,Axe(d).concat(c))}))})},Cb=function(t){return Dxe(t.length,t)},_j=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},Lxe=Cb(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Fxe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return $xe;var i=n.reverse(),a=i[0],s=i.slice(1);return function(){return s.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},jj=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},y6=function(t){var n=null,r=null;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return n&&a.every(function(l,c){return l===n[c]})||(n=a,r=t.apply(void 0,a)),r}};function Bxe(e){var t;return e===0?t=1:t=Math.floor(new bt(e).abs().log(10).toNumber())+1,t}function Uxe(e,t,n){for(var r=new bt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var zxe=Cb(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),Wxe=Cb(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Hxe=Cb(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Eb={rangeStep:Uxe,getDigitCount:Bxe,interpolateNumber:zxe,uninterpolateNumber:Wxe,uninterpolateTruncation:Hxe};function Sj(e){return Gxe(e)||Vxe(e)||x6(e)||qxe()}function qxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
691In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vxe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Gxe(e){if(Array.isArray(e))return kj(e)}function vp(e,t){return Xxe(e)||Yxe(e,t)||x6(e,t)||Kxe()}function Kxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
692In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x6(e,t){if(e){if(typeof e=="string")return kj(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 kj(e,t)}}function kj(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 Yxe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(r=(l=s.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){i=!0,a=c}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw a}}return n}}function Xxe(e){if(Array.isArray(e))return e}function b6(e){var t=vp(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function w6(e,t,n){if(e.lte(0))return new bt(0);var r=Eb.getDigitCount(e.toNumber()),i=new bt(10).pow(r),a=e.div(i),s=r!==1?.05:.1,l=new bt(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=l.mul(i);return t?c:new bt(Math.ceil(c))}function Qxe(e,t,n){var r=1,i=new bt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new bt(10).pow(Eb.getDigitCount(e)-1),i=new bt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new bt(Math.floor(e)))}else e===0?i=new bt(Math.floor((t-1)/2)):n||(i=new bt(Math.floor(e)));var s=Math.floor((t-1)/2),l=Fxe(Lxe(function(c){return i.add(new bt(c-s).mul(r)).toNumber()}),_j);return l(0,t)}function _6(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new bt(0),tickMin:new bt(0),tickMax:new bt(0)};var a=w6(new bt(t).sub(e).div(n-1),r,i),s;e<=0&&t>=0?s=new bt(0):(s=new bt(e).add(t).div(2),s=s.sub(new bt(s).mod(a)));var l=Math.ceil(s.sub(e).div(a).toNumber()),c=Math.ceil(new bt(t).sub(s).div(a).toNumber()),u=l+c+1;return u>n?_6(e,t,n,r,i+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:a,tickMin:s.sub(new bt(l).mul(a)),tickMax:s.add(new bt(c).mul(a))})}function Jxe(e){var t=vp(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),l=b6([n,r]),c=vp(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(Sj(_j(0,i-1).map(function(){return 1/0}))):[].concat(Sj(_j(0,i-1).map(function(){return-1/0})),[d]);return n>r?jj(f):f}if(u===d)return Qxe(u,i,a);var h=_6(u,d,s,a),p=h.step,g=h.tickMin,m=h.tickMax,v=Eb.rangeStep(g,m.add(new bt(.1).mul(p)),p);return n>r?jj(v):v}function Zxe(e,t){var n=vp(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=b6([r,i]),l=vp(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var d=Math.max(t,2),f=w6(new bt(u).sub(c).div(d-1),a,0),h=[].concat(Sj(Eb.rangeStep(new bt(c),new bt(u).sub(new bt(.99).mul(f)),f)),[u]);return r>i?jj(h):h}var ebe=y6(Jxe),tbe=y6(Zxe),nbe="Invariant failed";function Yl(e,t){throw new Error(nbe)}var rbe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ed(e){"@babel/helpers - typeof";return ed=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},ed(e)}function wy(){return wy=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},wy.apply(this,arguments)}function ibe(e,t){return lbe(e)||obe(e,t)||sbe(e,t)||abe()}function abe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
693In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sbe(e,t){if(e){if(typeof e=="string")return $T(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 $T(e,t)}}function $T(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 obe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function lbe(e){if(Array.isArray(e))return e}function cbe(e,t){if(e==null)return{};var n=ube(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ube(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function dbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fbe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,k6(r.key),r)}}function hbe(e,t,n){return t&&fbe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pbe(e,t,n){return t=_y(t),mbe(e,j6()?Reflect.construct(t,n||[],_y(e).constructor):t.apply(e,n))}function mbe(e,t){if(t&&(ed(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gbe(e)}function gbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(j6=function(){return!!e})()}function _y(e){return _y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_y(e)}function vbe(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&&Nj(e,t)}function Nj(e,t){return Nj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Nj(e,t)}function S6(e,t,n){return t=k6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k6(e){var t=ybe(e,"string");return ed(t)=="symbol"?t:t+""}function ybe(e,t){if(ed(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ed(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jd=function(e){function t(){return dbe(this,t),pbe(this,t,arguments)}return vbe(t,e),hbe(t,[{key:"render",value:function(){var r=this.props,i=r.offset,a=r.layout,s=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,h=cbe(r,rbe),p=Ne(h,!1);this.props.direction==="x"&&d.type!=="number"&&Yl();var g=c.map(function(m){var v=u(m,l),x=v.x,y=v.y,w=v.value,S=v.errorVal;if(!S)return null;var _=[],j,k;if(Array.isArray(S)){var C=ibe(S,2);j=C[0],k=C[1]}else j=k=S;if(a==="vertical"){var E=d.scale,A=y+i,P=A+s,T=A-s,B=E(w-j),F=E(w+k);_.push({x1:F,y1:P,x2:F,y2:T}),_.push({x1:B,y1:A,x2:F,y2:A}),_.push({x1:B,y1:P,x2:B,y2:T})}else if(a==="horizontal"){var M=f.scale,L=x+i,R=L-s,$=L+s,O=M(w-j),N=M(w+k);_.push({x1:R,y1:N,x2:$,y2:N}),_.push({x1:L,y1:O,x2:L,y2:N}),_.push({x1:R,y1:O,x2:$,y2:O})}return I.createElement(Ke,wy({className:"recharts-errorBar",key:"bar-".concat(_.map(function(H){return"".concat(H.x1,"-").concat(H.x2,"-").concat(H.y1,"-").concat(H.y2)}))},p),_.map(function(H){return I.createElement("line",wy({},H,{key:"line-".concat(H.x1,"-").concat(H.x2,"-").concat(H.y1,"-").concat(H.y2)}))}))});return I.createElement(Ke,{className:"recharts-errorBars"},g)}}])}(I.Component);S6(Jd,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});S6(Jd,"displayName","ErrorBar");function yp(e){"@babel/helpers - typeof";return yp=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},yp(e)}function DT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DT(Object(n),!0).forEach(function(r){xbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xbe(e,t,n){return t=bbe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bbe(e){var t=wbe(e,"string");return yp(t)=="symbol"?t:t+""}function wbe(e,t){if(yp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(yp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N6=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,a=t.legendContent,s=zr(n,ho);if(!s)return null;var l=ho.defaultProps,c=l!==void 0?Jo(Jo({},l),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:a==="children"?u=(r||[]).reduce(function(d,f){var h=f.item,p=f.props,g=p.sectors||p.data||[];return d.concat(g.map(function(m){return{type:s.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?Jo(Jo({},h),f.props):{},g=p.dataKey,m=p.name,v=p.legendType,x=p.hide;return{inactive:x,dataKey:g,type:c.iconType||v||"square",color:wC(f),value:m||g,payload:p}}),Jo(Jo(Jo({},c),ho.getWithHeight(s,i)),{},{payload:u,item:s})};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)}function LT(e){return kbe(e)||Sbe(e)||jbe(e)||_be()}function _be(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
694In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jbe(e,t){if(e){if(typeof e=="string")return Cj(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 Cj(e,t)}}function Sbe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kbe(e){if(Array.isArray(e))return Cj(e)}function Cj(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 FT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FT(Object(n),!0).forEach(function(r){mu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mu(e,t,n){return t=Nbe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nbe(e){var t=Cbe(e,"string");return xp(t)=="symbol"?t:t+""}function Cbe(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 Ut(e,t,n){return $e(e)||$e(t)?n:_n(t)?Xr(e,t,n):De(t)?t(e):n}function gh(e,t,n,r){var i=Sxe(e,function(l){return Ut(l,t)});if(n==="number"){var a=i.filter(function(l){return ce(l)||parseFloat(l)});return a.length?[Nb(a),Zs(a)]:[1/0,-1/0]}var s=r?i.filter(function(l){return!$e(l)}):i;return s.map(function(l){return _n(l)||l instanceof Date?l:""})}var Ebe=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,s=-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?i[u-1].coordinate:i[l-1].coordinate,f=i[u].coordinate,h=u>=l-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(or(f-d)!==or(h-f)){var g=[];if(or(h-f)===or(c[1]-c[0])){p=h;var m=f+c[1]-c[0];g[0]=Math.min(m,(m+d)/2),g[1]=Math.max(m,(m+d)/2)}else{p=d;var v=h+c[1]-c[0];g[0]=Math.min(f,(v+f)/2),g[1]=Math.max(f,(v+f)/2)}var x=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>x[0]&&t<=x[1]||t>=g[0]&&t<=g[1]){s=i[u].index;break}}else{var y=Math.min(d,h),w=Math.max(d,h);if(t>(y+f)/2&&t<=(w+f)/2){s=i[u].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(r[S].coordinate+r[S+1].coordinate)/2||S>0&&S<l-1&&t>(r[S].coordinate+r[S-1].coordinate)/2&&t<=(r[S].coordinate+r[S+1].coordinate)/2||S===l-1&&t>(r[S].coordinate+r[S-1].coordinate)/2){s=r[S].index;break}return s},wC=function(t){var n,r=t,i=r.type.displayName,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?tn(tn({},t.type.defaultProps),t.props):t.props,s=a.stroke,l=a.fill,c;switch(i){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:l;break;default:c=l;break}return c},Pbe=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var s={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var g=d[f[h]],m=g.items,v=g.cateAxisId,x=m.filter(function(k){return Ja(k.type).indexOf("Bar")>=0});if(x&&x.length){var y=x[0].type.defaultProps,w=y!==void 0?tn(tn({},y),x[0].props):x[0].props,S=w.barSize,_=w[v];s[_]||(s[_]=[]);var j=$e(S)?n:S;s[_].push({item:x[0],stackList:x.slice(1),barSize:$e(j)?void 0:lr(j,r,0)})}}return s},Obe=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,a=t.sizeList,s=a===void 0?[]:a,l=t.maxBarSize,c=s.length;if(c<1)return null;var u=lr(n,i,0,!0),d,f=[];if(s[0].barSize===+s[0].barSize){var h=!1,p=i/c,g=s.reduce(function(S,_){return S+_.barSize||0},0);g+=(c-1)*u,g>=i&&(g-=(c-1)*u,u=0),g>=i&&p>0&&(h=!0,p*=.9,g=c*p);var m=(i-g)/2>>0,v={offset:m-u,size:0};d=s.reduce(function(S,_){var j={item:_.item,position:{offset:v.offset+v.size+u,size:h?p:_.barSize}},k=[].concat(LT(S),[j]);return v=k[k.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(C){k.push({item:C,position:v})}),k},f)}else{var x=lr(r,i,0,!0);i-2*x-(c-1)*u<=0&&(u=0);var y=(i-2*x-(c-1)*u)/c;y>1&&(y>>=0);var w=l===+l?Math.min(y,l):y;d=s.reduce(function(S,_,j){var k=[].concat(LT(S),[{item:_.item,position:{offset:x+(y+u)*j+(y-w)/2,size:w}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(C){k.push({item:C,position:k[k.length-1].position})}),k},f)}return d},Abe=function(t,n,r,i){var a=r.children,s=r.width,l=r.margin,c=s-(l.left||0)-(l.right||0),u=N6({children:a,legendWidth:c});if(u){var d=i||{},f=d.width,h=d.height,p=u.align,g=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&g==="middle")&&p!=="center"&&ce(t[p]))return tn(tn({},t),{},mu({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&g!=="middle"&&ce(t[g]))return tn(tn({},t),{},mu({},g,t[g]+(h||0)))}return t},Tbe=function(t,n,r){return $e(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},C6=function(t,n,r,i,a){var s=n.props.children,l=dr(s,Jd).filter(function(u){return Tbe(i,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 f=Ut(d,r);if($e(f))return u;var h=Array.isArray(f)?[Nb(f),Zs(f)]:[f,f],p=c.reduce(function(g,m){var v=Ut(d,m,0),x=h[0]-Math.abs(Array.isArray(v)?v[0]:v),y=h[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,g[0]),Math.max(y,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},Rbe=function(t,n,r,i,a){var s=n.map(function(l){return C6(t,l,r,a,i)}).filter(function(l){return!$e(l)});return s&&s.length?s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},E6=function(t,n,r,i,a){var s=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&C6(t,c,u,i)||gh(t,u,r,a)});if(r==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return s.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},P6=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},O6=function(t,n,r,i){if(i)return t.map(function(c){return c.coordinate});var a,s,l=t.map(function(c){return c.coordinate===n&&(a=!0),c.coordinate===r&&(s=!0),c.coordinate});return a||l.push(n),s||l.push(r),l},Ya=function(t,n,r){if(!t)return null;var i=t.scale,a=t.duplicateDomain,s=t.type,l=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&s==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?or(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:i(h)+u,value:f,offset:u}});return d.filter(function(f){return!qd(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:i(f)+u,value:f,index:h,offset:u}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,h){return{coordinate:i(f)+u,value:a?a[f]:f,index:h,offset:u}})},Cw=new WeakMap,Cg=function(t,n){if(typeof n!="function")return t;Cw.has(t)||Cw.set(t,new WeakMap);var r=Cw.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},A6=function(t,n,r){var i=t.scale,a=t.type,s=t.layout,l=t.axisType;if(i==="auto")return s==="radial"&&l==="radiusAxis"?{scale:dp(),realScaleType:"band"}:s==="radial"&&l==="angleAxis"?{scale:gy(),realScaleType:"linear"}:a==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:mh(),realScaleType:"point"}:a==="category"?{scale:dp(),realScaleType:"band"}:{scale:gy(),realScaleType:"linear"};if(Vl(i)){var c="scale".concat(db(i));return{scale:(TT[c]||mh)(),realScaleType:TT[c]?c:"point"}}return De(i)?{scale:i}:{scale:mh(),realScaleType:"point"}},BT=1e-4,T6=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),a=Math.min(i[0],i[1])-BT,s=Math.max(i[0],i[1])+BT,l=t(n[0]),c=t(n[r-1]);(l<a||l>s||c<a||c>s)&&t.domain([n[0],n[r-1]])}},Ibe=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},Mbe=function(t,n){if(!n||n.length!==2||!ce(n[0])||!ce(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),a=[t[0],t[1]];return(!ce(t[0])||t[0]<r)&&(a[0]=r),(!ce(t[1])||t[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<r&&(a[1]=r),a},$be=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,s=0,l=0;l<n;++l){var c=qd(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]=s,t[l][r][1]=s+c,s=t[l][r][1])}},Dbe=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var a=0,s=0;s<n;++s){var l=qd(t[s][r][1])?t[s][r][0]:t[s][r][1];l>=0?(t[s][r][0]=a,t[s][r][1]=a+l,a=t[s][r][1]):(t[s][r][0]=0,t[s][r][1]=0)}},Lbe={sign:$be,expand:roe,none:Vu,silhouette:ioe,wiggle:aoe,positive:Dbe},Fbe=function(t,n,r){var i=n.map(function(l){return l.props.dataKey}),a=Lbe[r],s=noe().keys(i).value(function(l,c){return+Ut(l,c,0)}).order(J_).offset(a);return s(t)},Bbe=function(t,n,r,i,a,s){if(!t)return null;var l=s?n.reverse():n,c={},u=l.reduce(function(f,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?tn(tn({},h.type.defaultProps),h.props):h.props,m=g.stackId,v=g.hide;if(v)return f;var x=g[r],y=f[x]||{hasStack:!1,stackGroups:{}};if(_n(m)){var w=y.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};w.items.push(h),y.hasStack=!0,y.stackGroups[m]=w}else y.stackGroups[Bo("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[h]};return tn(tn({},f),{},mu({},x,y))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,v){var x=p.stackGroups[v];return tn(tn({},m),{},mu({},v,{numericAxisId:r,cateAxisId:i,items:x.items,stackedData:Fbe(t,x.items,a)}))},g)}return tn(tn({},f),{},mu({},h,p))},d)},R6=function(t,n){var r=n.realScaleType,i=n.type,a=n.tickCount,s=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=ebe(u,a,l);return t.domain([Nb(d),Zs(d)]),{niceTicks:d}}if(a&&i==="number"){var f=t.domain(),h=tbe(f,a,l);return{niceTicks:h}}return null};function td(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!$e(i[t.dataKey])){var l=Yv(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=Ut(i,$e(s)?t.dataKey:s);return $e(c)?null:t.scale(c)}var UT=function(t){var n=t.axis,r=t.ticks,i=t.offset,a=t.bandSize,s=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+i:null;var c=Ut(s,n.dataKey,n.domain[l]);return $e(c)?null:n.scale(c)-a/2+i},Ube=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return i<=0&&a>=0?0:a<0?a:i}return r[0]},zbe=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?tn(tn({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(_n(a)){var s=n[a];if(s){var l=s.items.indexOf(t);return l>=0?s.stackedData[l]:null}}return null},Wbe=function(t){return t.reduce(function(n,r){return[Nb(r.concat([n[0]]).filter(ce)),Zs(r.concat([n[1]]).filter(ce))]},[1/0,-1/0])},I6=function(t,n,r){return Object.keys(t).reduce(function(i,a){var s=t[a],l=s.stackedData,c=l.reduce(function(u,d){var f=Wbe(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},zT=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,WT=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ej=function(t,n,r){if(De(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(ce(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(zT.test(t[0])){var a=+zT.exec(t[0])[1];i[0]=n[0]-a}else De(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(ce(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(WT.test(t[1])){var s=+WT.exec(t[1])[1];i[1]=n[1]+s}else De(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},jy=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var a=YN(n,function(f){return f.coordinate}),s=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];s=Math.min((u.coordinate||0)-(d.coordinate||0),s)}return s===1/0?0:s}return r?void 0:0},HT=function(t,n,r){return!t||!t.length||No(t,Xr(r,"type.defaultProps.domain"))?n:t},M6=function(t,n){var r=t.type.defaultProps?tn(tn({},t.type.defaultProps),t.props):t.props,i=r.dataKey,a=r.name,s=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return tn(tn({},Ne(t,!1)),{},{dataKey:i,unit:s,formatter:l,name:a||i,color:wC(t),value:Ut(n,i),type:c,payload:n,chartType:u,hide:d})};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 qT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qT(Object(n),!0).forEach(function(r){$6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $6(e,t,n){return t=Hbe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hbe(e){var t=qbe(e,"string");return bp(t)=="symbol"?t:t+""}function qbe(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)}function Vbe(e,t){return Xbe(e)||Ybe(e,t)||Kbe(e,t)||Gbe()}function Gbe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
695In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kbe(e,t){if(e){if(typeof e=="string")return VT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VT(e,t)}}function VT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ybe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Xbe(e){if(Array.isArray(e))return e}var Sy=Math.PI/180,Qbe=function(t){return t*180/Math.PI},It=function(t,n,r,i){return{x:t+Math.cos(-Sy*i)*r,y:n+Math.sin(-Sy*i)*r}},D6=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},Jbe=function(t,n,r,i,a){var s=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=lr(t.cx,s,s/2),f=lr(t.cy,l,l/2),h=D6(s,l,r),p=lr(t.innerRadius,h,0),g=lr(t.outerRadius,h,h*.8),m=Object.keys(n);return m.reduce(function(v,x){var y=n[x],w=y.domain,S=y.reversed,_;if($e(y.range))i==="angleAxis"?_=[c,u]:i==="radiusAxis"&&(_=[p,g]),S&&(_=[_[1],_[0]]);else{_=y.range;var j=_,k=Vbe(j,2);c=k[0],u=k[1]}var C=A6(y,a),E=C.realScaleType,A=C.scale;A.domain(w).range(_),T6(A);var P=R6(A,Ua(Ua({},y),{},{realScaleType:E})),T=Ua(Ua(Ua({},y),P),{},{range:_,radius:g,realScaleType:E,scale:A,cx:d,cy:f,innerRadius:p,outerRadius:g,startAngle:c,endAngle:u});return Ua(Ua({},v),{},$6({},x,T))},{})},Zbe=function(t,n){var r=t.x,i=t.y,a=n.x,s=n.y;return Math.sqrt(Math.pow(r-a,2)+Math.pow(i-s,2))},e0e=function(t,n){var r=t.x,i=t.y,a=n.cx,s=n.cy,l=Zbe({x:r,y:i},{x:a,y:s});if(l<=0)return{radius:l};var c=(r-a)/l,u=Math.acos(c);return i>s&&(u=2*Math.PI-u),{radius:l,angle:Qbe(u),angleInRadian:u}},t0e=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return{startAngle:n-s*360,endAngle:r-s*360}},n0e=function(t,n){var r=n.startAngle,i=n.endAngle,a=Math.floor(r/360),s=Math.floor(i/360),l=Math.min(a,s);return t+l*360},GT=function(t,n){var r=t.x,i=t.y,a=e0e({x:r,y:i},n),s=a.radius,l=a.angle,c=n.innerRadius,u=n.outerRadius;if(s<c||s>u)return!1;if(s===0)return!0;var d=t0e(n),f=d.startAngle,h=d.endAngle,p=l,g;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;g=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=f}return g?Ua(Ua({},n),{},{radius:s,angle:n0e(p,n)}):null},L6=function(t){return!b.isValidElement(t)&&!De(t)&&typeof t!="boolean"?t.className:""};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)}var r0e=["offset"];function i0e(e){return l0e(e)||o0e(e)||s0e(e)||a0e()}function a0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
696In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s0e(e,t){if(e){if(typeof e=="string")return Pj(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 Pj(e,t)}}function o0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l0e(e){if(Array.isArray(e))return Pj(e)}function Pj(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 c0e(e,t){if(e==null)return{};var n=u0e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function u0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function KT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KT(Object(n),!0).forEach(function(r){d0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function d0e(e,t,n){return t=f0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f0e(e){var t=h0e(e,"string");return wp(t)=="symbol"?t:t+""}function h0e(e,t){if(wp(e)!="object"||!e)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)}function _p(){return _p=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},_p.apply(this,arguments)}var p0e=function(t){var n=t.value,r=t.formatter,i=$e(t.children)?n:t.children;return De(r)?r(i):i},m0e=function(t,n){var r=or(n-t),i=Math.min(Math.abs(n-t),360);return r*i},g0e=function(t,n,r){var i=t.position,a=t.viewBox,s=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,g=c.endAngle,m=c.clockWise,v=(f+h)/2,x=m0e(p,g),y=x>=0?1:-1,w,S;i==="insideStart"?(w=p+y*s,S=m):i==="insideEnd"?(w=g-y*s,S=!m):i==="end"&&(w=g+y*s,S=m),S=x<=0?S:!S;var _=It(u,d,v,w),j=It(u,d,v,w+(S?1:-1)*359),k="M".concat(_.x,",").concat(_.y,`
697    A`).concat(v,",").concat(v,",0,1,").concat(S?0:1,`,
698    `).concat(j.x,",").concat(j.y),C=$e(t.id)?Bo("recharts-radial-line-"):t.id;return I.createElement("text",_p({},r,{dominantBaseline:"central",className:He("recharts-radial-bar-label",l)}),I.createElement("defs",null,I.createElement("path",{id:C,d:k})),I.createElement("textPath",{xlinkHref:"#".concat(C)},n))},v0e=function(t){var n=t.viewBox,r=t.offset,i=t.position,a=n,s=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,h=(d+f)/2;if(i==="outside"){var p=It(s,l,u+r,h),g=p.x,m=p.y;return{x:g,y:m,textAnchor:g>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"end"};var v=(c+u)/2,x=It(s,l,v,h),y=x.x,w=x.y;return{x:y,y:w,textAnchor:"middle",verticalAnchor:"middle"}},y0e=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,a=t.position,s=n,l=s.x,c=s.y,u=s.width,d=s.height,f=d>=0?1:-1,h=f*i,p=f>0?"end":"start",g=f>0?"start":"end",m=u>=0?1:-1,v=m*i,x=m>0?"end":"start",y=m>0?"start":"end";if(a==="top"){var w={x:l+u/2,y:c-f*i,textAnchor:"middle",verticalAnchor:p};return vn(vn({},w),r?{height:Math.max(c-r.y,0),width:u}:{})}if(a==="bottom"){var S={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:g};return vn(vn({},S),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(a==="left"){var _={x:l-v,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return vn(vn({},_),r?{width:Math.max(_.x-r.x,0),height:d}:{})}if(a==="right"){var j={x:l+u+v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return vn(vn({},j),r?{width:Math.max(r.x+r.width-j.x,0),height:d}:{})}var k=r?{width:u,height:d}:{};return a==="insideLeft"?vn({x:l+v,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},k):a==="insideRight"?vn({x:l+u-v,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},k):a==="insideTop"?vn({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},k):a==="insideBottom"?vn({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},k):a==="insideTopLeft"?vn({x:l+v,y:c+h,textAnchor:y,verticalAnchor:g},k):a==="insideTopRight"?vn({x:l+u-v,y:c+h,textAnchor:x,verticalAnchor:g},k):a==="insideBottomLeft"?vn({x:l+v,y:c+d-h,textAnchor:y,verticalAnchor:p},k):a==="insideBottomRight"?vn({x:l+u-v,y:c+d-h,textAnchor:x,verticalAnchor:p},k):Ud(a)&&(ce(a.x)||ml(a.x))&&(ce(a.y)||ml(a.y))?vn({x:l+lr(a.x,u),y:c+lr(a.y,d),textAnchor:"end",verticalAnchor:"end"},k):vn({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},k)},x0e=function(t){return"cx"in t&&ce(t.cx)};function Cn(e){var t=e.offset,n=t===void 0?5:t,r=c0e(e,r0e),i=vn({offset:n},r),a=i.viewBox,s=i.position,l=i.value,c=i.children,u=i.content,d=i.className,f=d===void 0?"":d,h=i.textBreakAll;if(!a||$e(l)&&$e(c)&&!b.isValidElement(u)&&!De(u))return null;if(b.isValidElement(u))return b.cloneElement(u,i);var p;if(De(u)){if(p=b.createElement(u,i),b.isValidElement(p))return p}else p=p0e(i);var g=x0e(a),m=Ne(i,!0);if(g&&(s==="insideStart"||s==="insideEnd"||s==="end"))return g0e(i,p,m);var v=g?v0e(i):y0e(i);return I.createElement(Gl,_p({className:He("recharts-label",f)},m,v,{breakAll:h}),p)}Cn.displayName="Label";var F6=function(t){var n=t.cx,r=t.cy,i=t.angle,a=t.startAngle,s=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,g=t.left,m=t.width,v=t.height,x=t.clockWise,y=t.labelViewBox;if(y)return y;if(ce(m)&&ce(v)){if(ce(f)&&ce(h))return{x:f,y:h,width:m,height:v};if(ce(p)&&ce(g))return{x:p,y:g,width:m,height:v}}return ce(f)&&ce(h)?{x:f,y:h,width:0,height:0}:ce(n)&&ce(r)?{cx:n,cy:r,startAngle:a||i||0,endAngle:s||i||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:x}:t.viewBox?t.viewBox:{}},b0e=function(t,n){return t?t===!0?I.createElement(Cn,{key:"label-implicit",viewBox:n}):_n(t)?I.createElement(Cn,{key:"label-implicit",viewBox:n,value:t}):b.isValidElement(t)?t.type===Cn?b.cloneElement(t,{key:"label-implicit",viewBox:n}):I.createElement(Cn,{key:"label-implicit",content:t,viewBox:n}):De(t)?I.createElement(Cn,{key:"label-implicit",content:t,viewBox:n}):Ud(t)?I.createElement(Cn,_p({viewBox:n},t,{key:"label-implicit"})):null:null},w0e=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,a=F6(t),s=dr(i,Cn).map(function(c,u){return b.cloneElement(c,{viewBox:n||a,key:"label-".concat(u)})});if(!r)return s;var l=b0e(t.label,n||a);return[l].concat(i0e(s))};Cn.parseViewBox=F6;Cn.renderCallByParent=w0e;function _0e(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var j0e=_0e;const S0e=ct(j0e);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)}var k0e=["valueAccessor"],N0e=["data","dataKey","clockWise","id","textBreakAll"];function C0e(e){return A0e(e)||O0e(e)||P0e(e)||E0e()}function E0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
699In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P0e(e,t){if(e){if(typeof e=="string")return Oj(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 Oj(e,t)}}function O0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function A0e(e){if(Array.isArray(e))return Oj(e)}function Oj(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 ky(){return ky=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},ky.apply(this,arguments)}function YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(n),!0).forEach(function(r){T0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T0e(e,t,n){return t=R0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R0e(e){var t=I0e(e,"string");return jp(t)=="symbol"?t:t+""}function I0e(e,t){if(jp(e)!="object"||!e)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 QT(e,t){if(e==null)return{};var n=M0e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function M0e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var $0e=function(t){return Array.isArray(t.value)?S0e(t.value):t.value};function Gi(e){var t=e.valueAccessor,n=t===void 0?$0e:t,r=QT(e,k0e),i=r.data,a=r.dataKey,s=r.clockWise,l=r.id,c=r.textBreakAll,u=QT(r,N0e);return!i||!i.length?null:I.createElement(Ke,{className:"recharts-label-list"},i.map(function(d,f){var h=$e(a)?n(d,f):Ut(d&&d.payload,a),p=$e(l)?{}:{id:"".concat(l,"-").concat(f)};return I.createElement(Cn,ky({},Ne(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Cn.parseViewBox($e(s)?d:XT(XT({},d),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}Gi.displayName="LabelList";function D0e(e,t){return e?e===!0?I.createElement(Gi,{key:"labelList-implicit",data:t}):I.isValidElement(e)||De(e)?I.createElement(Gi,{key:"labelList-implicit",data:t,content:e}):Ud(e)?I.createElement(Gi,ky({data:t},e,{key:"labelList-implicit"})):null:null}function L0e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=dr(r,Gi).map(function(s,l){return b.cloneElement(s,{data:t,key:"labelList-".concat(l)})});if(!n)return i;var a=D0e(e.label,t);return[a].concat(C0e(i))}Gi.renderCallByParent=L0e;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 Aj(){return Aj=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},Aj.apply(this,arguments)}function JT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ZT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JT(Object(n),!0).forEach(function(r){F0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function F0e(e,t,n){return t=B0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B0e(e){var t=U0e(e,"string");return Sp(t)=="symbol"?t:t+""}function U0e(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 z0e=function(t,n){var r=or(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},Eg=function(t){var n=t.cx,r=t.cy,i=t.radius,a=t.angle,s=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+i,f=Math.asin(c/d)/Sy,h=u?a:a+s*f,p=It(n,r,d,h),g=It(n,r,i,h),m=u?a-s*f:a,v=It(n,r,d*Math.cos(f*Sy),m);return{center:p,circleTangency:g,lineTangency:v,theta:f}},B6=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,s=t.startAngle,l=t.endAngle,c=z0e(s,l),u=s+c,d=It(n,r,a,s),f=It(n,r,a,u),h="M ".concat(d.x,",").concat(d.y,`
700    A `).concat(a,",").concat(a,`,0,
701    `).concat(+(Math.abs(c)>180),",").concat(+(s>u),`,
702    `).concat(f.x,",").concat(f.y,`
703  `);if(i>0){var p=It(n,r,i,s),g=It(n,r,i,u);h+="L ".concat(g.x,",").concat(g.y,`
704            A `).concat(i,",").concat(i,`,0,
705            `).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`,
706            `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},W0e=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=or(d-u),h=Eg({cx:n,cy:r,radius:a,angle:u,sign:f,cornerRadius:s,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,m=h.theta,v=Eg({cx:n,cy:r,radius:a,angle:d,sign:-f,cornerRadius:s,cornerIsExternal:c}),x=v.circleTangency,y=v.lineTangency,w=v.theta,S=c?Math.abs(u-d):Math.abs(u-d)-m-w;if(S<0)return l?"M ".concat(g.x,",").concat(g.y,`
707        a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
708        a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
709      `):B6({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d});var _="M ".concat(g.x,",").concat(g.y,`
710    A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
711    A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(x.x,",").concat(x.y,`
712    A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
713  `);if(i>0){var j=Eg({cx:n,cy:r,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),k=j.circleTangency,C=j.lineTangency,E=j.theta,A=Eg({cx:n,cy:r,radius:i,angle:d,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),P=A.circleTangency,T=A.lineTangency,B=A.theta,F=c?Math.abs(u-d):Math.abs(u-d)-E-B;if(F<0&&s===0)return"".concat(_,"L").concat(n,",").concat(r,"Z");_+="L".concat(T.x,",").concat(T.y,`
714      A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,`
715      A`).concat(i,",").concat(i,",0,").concat(+(F>180),",").concat(+(f>0),",").concat(k.x,",").concat(k.y,`
716      A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(C.x,",").concat(C.y,"Z")}else _+="L".concat(n,",").concat(r,"Z");return _},H0e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},U6=function(t){var n=ZT(ZT({},H0e),t),r=n.cx,i=n.cy,a=n.innerRadius,s=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(s<a||d===f)return null;var p=He("recharts-sector",h),g=s-a,m=lr(l,g,0,!0),v;return m>0&&Math.abs(d-f)<360?v=W0e({cx:r,cy:i,innerRadius:a,outerRadius:s,cornerRadius:Math.min(m,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):v=B6({cx:r,cy:i,innerRadius:a,outerRadius:s,startAngle:d,endAngle:f}),I.createElement("path",Aj({},Ne(n,!0),{className:p,d:v,role:"img"}))};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 Tj(){return Tj=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},Tj.apply(this,arguments)}function eR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tR(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){q0e(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}function q0e(e,t,n){return t=V0e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V0e(e){var t=G0e(e,"string");return kp(t)=="symbol"?t:t+""}function G0e(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 nR={curveBasisClosed:qse,curveBasisOpen:Vse,curveBasis:Hse,curveBumpX:Ose,curveBumpY:Ase,curveLinearClosed:Gse,curveLinear:hb,curveMonotoneX:Kse,curveMonotoneY:Yse,curveNatural:Xse,curveStep:Qse,curveStepAfter:Zse,curveStepBefore:Jse},Pg=function(t){return t.x===+t.x&&t.y===+t.y},Nf=function(t){return t.x},Cf=function(t){return t.y},K0e=function(t,n){if(De(t))return t;var r="curve".concat(db(t));return(r==="curveMonotone"||r==="curveBump")&&n?nR["".concat(r).concat(n==="vertical"?"Y":"X")]:nR[r]||hb},Y0e=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,a=i===void 0?[]:i,s=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=K0e(r,l),f=u?a.filter(function(m){return Pg(m)}):a,h;if(Array.isArray(s)){var p=u?s.filter(function(m){return Pg(m)}):s,g=f.map(function(m,v){return tR(tR({},m),{},{base:p[v]})});return l==="vertical"?h=xg().y(Cf).x1(Nf).x0(function(m){return m.base.x}):h=xg().x(Nf).y1(Cf).y0(function(m){return m.base.y}),h.defined(Pg).curve(d),h(g)}return l==="vertical"&&ce(s)?h=xg().y(Cf).x1(Nf).x0(s):ce(s)?h=xg().x(Nf).y1(Cf).y0(s):h=IL().x(Nf).y(Cf),h.defined(Pg).curve(d),h(f)},mo=function(t){var n=t.className,r=t.points,i=t.path,a=t.pathRef;if((!r||!r.length)&&!i)return null;var s=r&&r.length?Y0e(t):i;return b.createElement("path",Tj({},Ne(t,!1),Xv(t),{className:He("recharts-curve",n),d:s,ref:a}))},z6={exports:{}},X0e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Q0e=X0e,J0e=Q0e;function W6(){}function H6(){}H6.resetWarningCache=W6;var Z0e=function(){function e(r,i,a,s,l,c){if(c!==J0e){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
716:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:H6,resetWarningCache:W6};return n.PropTypes=n,n};z6.exports=Z0e();var ewe=z6.exports;const dt=ct(ewe);var twe=Object.getOwnPropertyNames,nwe=Object.getOwnPropertySymbols,rwe=Object.prototype.hasOwnProperty;function rR(e,t){return function(r,i,a){return e(r,i,a)&&t(r,i,a)}}function Og(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var a=i.cache,s=a.get(n),l=a.get(r);if(s&&l)return s===r&&l===n;a.set(n,r),a.set(r,n);var c=e(n,r,i);return a.delete(n),a.delete(r),c}}function iR(e){return twe(e).concat(nwe(e))}var iwe=Object.hasOwn||function(e,t){return rwe.call(e,t)};function uc(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var awe="__v",swe="__o",owe="_owner",aR=Object.getOwnPropertyDescriptor,sR=Object.keys;function lwe(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 cwe(e,t){return uc(e.getTime(),t.getTime())}function uwe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function dwe(e,t){return e===t}function oR(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var i=new Array(r),a=e.entries(),s,l,c=0;(s=a.next())&&!s.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(i[f]){f++;continue}var h=s.value,p=l.value;if(n.equals(h[0],p[0],c,f,e,t,n)&&n.equals(h[1],p[1],h[0],p[0],e,t,n)){d=i[f]=!0;break}f++}if(!d)return!1;c++}return!0}var fwe=uc;function hwe(e,t,n){var r=sR(e),i=r.length;if(sR(t).length!==i)return!1;for(;i-- >0;)if(!q6(e,t,n,r[i]))return!1;return!0}function Ef(e,t,n){var r=iR(e),i=r.length;if(iR(t).length!==i)return!1;for(var a,s,l;i-- >0;)if(a=r[i],!q6(e,t,n,a)||(s=aR(e,a),l=aR(t,a),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function pwe(e,t){return uc(e.valueOf(),t.valueOf())}function mwe(e,t){return e.source===t.source&&e.flags===t.flags}function lR(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var i=new Array(r),a=e.values(),s,l;(s=a.next())&&!s.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!i[d]&&n.equals(s.value,l.value,s.value,l.value,e,t,n)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function gwe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function vwe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function q6(e,t,n,r){return(r===owe||r===swe||r===awe)&&(e.$$typeof||t.$$typeof)?!0:iwe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var ywe="[object Arguments]",xwe="[object Boolean]",bwe="[object Date]",wwe="[object Error]",_we="[object Map]",jwe="[object Number]",Swe="[object Object]",kwe="[object RegExp]",Nwe="[object Set]",Cwe="[object String]",Ewe="[object URL]",Pwe=Array.isArray,cR=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,uR=Object.assign,Owe=Object.prototype.toString.call.bind(Object.prototype.toString);function Awe(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,s=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(g,m,v){if(g===m)return!0;if(g==null||m==null)return!1;var x=typeof g;if(x!==typeof m)return!1;if(x!=="object")return x==="number"?s(g,m,v):x==="function"?i(g,m,v):!1;var y=g.constructor;if(y!==m.constructor)return!1;if(y===Object)return l(g,m,v);if(Pwe(g))return t(g,m,v);if(cR!=null&&cR(g))return f(g,m,v);if(y===Date)return n(g,m,v);if(y===RegExp)return u(g,m,v);if(y===Map)return a(g,m,v);if(y===Set)return d(g,m,v);var w=Owe(g);return w===bwe?n(g,m,v):w===kwe?u(g,m,v):w===_we?a(g,m,v):w===Nwe?d(g,m,v):w===Swe?typeof g.then!="function"&&typeof m.then!="function"&&l(g,m,v):w===Ewe?h(g,m,v):w===wwe?r(g,m,v):w===ywe?l(g,m,v):w===xwe||w===jwe||w===Cwe?c(g,m,v):!1}}
vendor: 62,586 bytes, lines 716-735
716function Twe(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?Ef:lwe,areDatesEqual:cwe,areErrorsEqual:uwe,areFunctionsEqual:dwe,areMapsEqual:r?rR(oR,Ef):oR,areNumbersEqual:fwe,areObjectsEqual:r?Ef:hwe,arePrimitiveWrappersEqual:pwe,areRegExpsEqual:mwe,areSetsEqual:r?rR(lR,Ef):lR,areTypedArraysEqual:r?Ef:gwe,areUrlsEqual:vwe};if(n&&(i=uR({},i,n(i))),t){var a=Og(i.areArraysEqual),s=Og(i.areMapsEqual),l=Og(i.areObjectsEqual),c=Og(i.areSetsEqual);i=uR({},i,{areArraysEqual:a,areMapsEqual:s,areObjectsEqual:l,areSetsEqual:c})}return i}function Rwe(e){return function(t,n,r,i,a,s,l){return e(t,n,l)}}function Iwe(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,a=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,p=d.meta;return n(c,u,{cache:h,equals:i,meta:p,strict:a})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var s={cache:void 0,equals:i,meta:void 0,strict:a};return function(c,u){return n(c,u,s)}}var Mwe=Wo();Wo({strict:!0});Wo({circular:!0});Wo({circular:!0,strict:!0});Wo({createInternalComparator:function(){return uc}});Wo({strict:!0,createInternalComparator:function(){return uc}});Wo({circular:!0,createInternalComparator:function(){return uc}});Wo({circular:!0,createInternalComparator:function(){return uc},strict:!0});function Wo(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,a=e.strict,s=a===void 0?!1:a,l=Twe(e),c=Awe(l),u=r?r(c):Rwe(c);return Iwe({circular:n,comparator:c,createState:i,equals:u,strict:s})}function $we(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function dR(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(a){n<0&&(n=a),a-n>t?(e(a),n=-1):$we(i)};requestAnimationFrame(r)}function Rj(e){"@babel/helpers - typeof";return Rj=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},Rj(e)}function Dwe(e){return Uwe(e)||Bwe(e)||Fwe(e)||Lwe()}function Lwe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
717In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fwe(e,t){if(e){if(typeof e=="string")return fR(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 fR(e,t)}}function fR(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 Bwe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Uwe(e){if(Array.isArray(e))return e}function zwe(){var e={},t=function(){return null},n=!1,r=function i(a){if(!n){if(Array.isArray(a)){if(!a.length)return;var s=a,l=Dwe(s),c=l[0],u=l.slice(1);if(typeof c=="number"){dR(i.bind(null,u),c);return}i(c),dR(i.bind(null,u));return}Rj(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 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 hR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hR(Object(n),!0).forEach(function(r){V6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function V6(e,t,n){return t=Wwe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wwe(e){var t=Hwe(e,"string");return Np(t)==="symbol"?t:String(t)}function Hwe(e,t){if(Np(e)!=="object"||e===null)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 qwe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(a){return i.includes(a)})})},Vwe=function(t){return t},Gwe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},vh=function(t,n){return Object.keys(n).reduce(function(r,i){return pR(pR({},r),{},V6({},i,t(i,n[i])))},{})},mR=function(t,n,r){return t.map(function(i){return"".concat(Gwe(i)," ").concat(n,"ms ").concat(r)}).join(",")};function Kwe(e,t){return Qwe(e)||Xwe(e,t)||G6(e,t)||Ywe()}function Ywe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
718In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xwe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Qwe(e){if(Array.isArray(e))return e}function Jwe(e){return t1e(e)||e1e(e)||G6(e)||Zwe()}function Zwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
719In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G6(e,t){if(e){if(typeof e=="string")return Ij(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 Ij(e,t)}}function e1e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function t1e(e){if(Array.isArray(e))return Ij(e)}function Ij(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 Ny=1e-4,K6=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},Y6=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},gR=function(t,n){return function(r){var i=K6(t,n);return Y6(i,r)}},n1e=function(t,n){return function(r){var i=K6(t,n),a=[].concat(Jwe(i.map(function(s,l){return s*l}).slice(1)),[0]);return Y6(a,r)}},vR=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],a=n[1],s=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,a=0,s=1,l=1;break;case"ease":i=.25,a=.1,s=.25,l=1;break;case"ease-in":i=.42,a=0,s=1,l=1;break;case"ease-out":i=.42,a=0,s=.58,l=1;break;case"ease-in-out":i=0,a=0,s=.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(v){return parseFloat(v)}),d=Kwe(u,4);i=d[0],a=d[1],s=d[2],l=d[3]}}}var f=gR(i,s),h=gR(a,l),p=n1e(i,s),g=function(x){return x>1?1:x<0?0:x},m=function(x){for(var y=x>1?1:x,w=y,S=0;S<8;++S){var _=f(w)-y,j=p(w);if(Math.abs(_-y)<Ny||j<Ny)return h(w);w=g(w-_/j)}return h(w)};return m.isStepper=!1,m},r1e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,s=t.dt,l=s===void 0?17:s,c=function(d,f,h){var p=-(d-f)*r,g=h*a,m=h+(p-g)*l/1e3,v=h*l/1e3+d;return Math.abs(v-f)<Ny&&Math.abs(m)<Ny?[f,0]:[v,m]};return c.isStepper=!0,c.dt=l,c},i1e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return vR(i);case"spring":return r1e();default:if(i.split("(")[0]==="cubic-bezier")return vR(i)}return typeof i=="function"?i:null};function Cp(e){"@babel/helpers - typeof";return Cp=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},Cp(e)}function yR(e){return o1e(e)||s1e(e)||X6(e)||a1e()}function a1e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
720In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s1e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o1e(e){if(Array.isArray(e))return $j(e)}function xR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function In(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(r){Mj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mj(e,t,n){return t=l1e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l1e(e){var t=c1e(e,"string");return Cp(t)==="symbol"?t:String(t)}function c1e(e,t){if(Cp(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Cp(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function u1e(e,t){return h1e(e)||f1e(e,t)||X6(e,t)||d1e()}function d1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
721In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X6(e,t){if(e){if(typeof e=="string")return $j(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 $j(e,t)}}function $j(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 f1e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function h1e(e){if(Array.isArray(e))return e}var Cy=function(t,n,r){return t+(n-t)*r},Dj=function(t){var n=t.from,r=t.to;return n!==r},p1e=function e(t,n,r){var i=vh(function(a,s){if(Dj(s)){var l=t(s.from,s.to,s.velocity),c=u1e(l,2),u=c[0],d=c[1];return In(In({},s),{},{from:u,velocity:d})}return s},n);return r<1?vh(function(a,s){return Dj(s)?In(In({},s),{},{velocity:Cy(s.velocity,i[a].velocity,r),from:Cy(s.from,i[a].from,r)}):s},n):e(t,i,r-1)};const m1e=function(e,t,n,r,i){var a=qwe(e,t),s=a.reduce(function(v,x){return In(In({},v),{},Mj({},x,[e[x],t[x]]))},{}),l=a.reduce(function(v,x){return In(In({},v),{},Mj({},x,{from:e[x],velocity:0,to:t[x]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return vh(function(x,y){return y.from},l)},p=function(){return!Object.values(l).filter(Dj).length},g=function(x){u||(u=x);var y=x-u,w=y/n.dt;l=p1e(n,l,w),i(In(In(In({},e),t),h())),u=x,p()||(c=requestAnimationFrame(f))},m=function(x){d||(d=x);var y=(x-d)/r,w=vh(function(_,j){return Cy.apply(void 0,yR(j).concat([n(y)]))},s);if(i(In(In(In({},e),t),w)),y<1)c=requestAnimationFrame(f);else{var S=vh(function(_,j){return Cy.apply(void 0,yR(j).concat([n(1)]))},s);i(In(In(In({},e),t),S))}};return f=n.isStepper?g:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function nd(e){"@babel/helpers - typeof";return nd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nd(e)}var g1e=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function v1e(e,t){if(e==null)return{};var n=y1e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function y1e(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Ew(e){return _1e(e)||w1e(e)||b1e(e)||x1e()}function x1e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
722In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b1e(e,t){if(e){if(typeof e=="string")return Lj(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 Lj(e,t)}}function w1e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _1e(e){if(Array.isArray(e))return Lj(e)}function Lj(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 bR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Oi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bR(Object(n),!0).forEach(function(r){Gf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gf(e,t,n){return t=Q6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S1e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q6(r.key),r)}}function k1e(e,t,n){return t&&S1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q6(e){var t=N1e(e,"string");return nd(t)==="symbol"?t:String(t)}function N1e(e,t){if(nd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(nd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function C1e(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&&Fj(e,t)}function Fj(e,t){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Fj(e,t)}function E1e(e){var t=P1e();return function(){var r=Ey(e),i;if(t){var a=Ey(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return Bj(this,i)}}function Bj(e,t){if(t&&(nd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uj(e)}function Uj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P1e(){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 Ey(e){return Ey=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ey(e)}var bi=function(e){C1e(n,e);var t=E1e(n);function n(r,i){var a;j1e(this,n),a=t.call(this,r,i);var s=a.props,l=s.isActive,c=s.attributeName,u=s.from,d=s.to,f=s.steps,h=s.children,p=s.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Uj(a)),a.changeStyle=a.changeStyle.bind(Uj(a)),!l||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),Bj(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},Bj(a);a.state={style:c?Gf({},c,u):u}}else a.state={style:{}};return a}return k1e(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,s=i.canBegin;this.mounted=!0,!(!a||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,s=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,h=this.state.style;if(l){if(!s){var p={style:c?Gf({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(Mwe(i.to,d)&&i.canBegin&&i.isActive)){var g=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=g||u?f:i.to;if(this.state&&h){var v={style:c?Gf({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(v)}this.runAnimation(Oi(Oi({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,s=i.from,l=i.to,c=i.duration,u=i.easing,d=i.begin,f=i.onAnimationEnd,h=i.onAnimationStart,p=m1e(s,l,i1e(u),c,this.changeStyle),g=function(){a.stopJSAnimation=p()};this.manager.start([h,d,g,c,f])}},{key:"runStepAnimation",value:function(i){var a=this,s=i.steps,l=i.begin,c=i.onAnimationStart,u=s[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,v,x){if(x===0)return m;var y=v.duration,w=v.easing,S=w===void 0?"ease":w,_=v.style,j=v.properties,k=v.onAnimationEnd,C=x>0?s[x-1]:v,E=j||Object.keys(_);if(typeof S=="function"||S==="spring")return[].concat(Ew(m),[a.runJSAnimation.bind(a,{from:C.style,to:_,duration:y,easing:S}),y]);var A=mR(E,y,S),P=Oi(Oi(Oi({},C.style),_),{},{transition:A});return[].concat(Ew(m),[P,y,k]).filter(Vwe)};return this.manager.start([c].concat(Ew(s.reduce(p,[d,Math.max(h,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=zwe());var a=i.begin,s=i.duration,l=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,f=i.onAnimationEnd,h=i.steps,p=i.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=l?Gf({},l,c):c,v=mR(Object.keys(m),s,u);g.start([d,a,Oi(Oi({},m),{},{transition:v}),s,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=v1e(i,g1e),u=b.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||s<=0)return a;var f=function(p){var g=p.props,m=g.style,v=m===void 0?{}:m,x=g.className,y=b.cloneElement(p,Oi(Oi({},c),{},{style:Oi(Oi({},v),d),className:x}));return y};return u===1?f(b.Children.only(a)):I.createElement("div",null,b.Children.map(a,function(h){return f(h)}))}}]),n}(b.PureComponent);bi.displayName="Animate";bi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};bi.propTypes={from:dt.oneOfType([dt.object,dt.string]),to:dt.oneOfType([dt.object,dt.string]),attributeName:dt.string,duration:dt.number,begin:dt.number,easing:dt.oneOfType([dt.string,dt.func]),steps:dt.arrayOf(dt.shape({duration:dt.number.isRequired,style:dt.object.isRequired,easing:dt.oneOfType([dt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),dt.func]),properties:dt.arrayOf("string"),onAnimationEnd:dt.func})),children:dt.oneOfType([dt.node,dt.func]),isActive:dt.bool,canBegin:dt.bool,onAnimationEnd:dt.func,shouldReAnimate:dt.bool,onAnimationStart:dt.func,onAnimationReStart:dt.func};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 Py(){return Py=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},Py.apply(this,arguments)}function O1e(e,t){return I1e(e)||R1e(e,t)||T1e(e,t)||A1e()}function A1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
723In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T1e(e,t){if(e){if(typeof e=="string")return wR(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 wR(e,t)}}function wR(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 R1e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function I1e(e){if(Array.isArray(e))return e}function _R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_R(Object(n),!0).forEach(function(r){M1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_R(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M1e(e,t,n){return t=$1e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $1e(e){var t=D1e(e,"string");return Ep(t)=="symbol"?t:t+""}function D1e(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 SR=function(t,n,r,i,a){var s=Math.min(Math.abs(r)/2,Math.abs(i)/2),l=i>=0?1:-1,c=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(s>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=a[h]>s?s:a[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
724        `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+i-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
725        `).concat(t+r-c*f[2],",").concat(n+i)),d+="L ".concat(t+c*f[3],",").concat(n+i),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
726        `).concat(t,",").concat(n+i-l*f[3])),d+="Z"}else if(s>0&&a===+a&&a>0){var g=Math.min(s,a);d="M ".concat(t,",").concat(n+l*g,`
727            A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(n,`
728            L `).concat(t+r-c*g,",").concat(n,`
729            A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*g,`
730            L `).concat(t+r,",").concat(n+i-l*g,`
731            A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+r-c*g,",").concat(n+i,`
732            L `).concat(t+c*g,",").concat(n+i,`
733            A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(n+i-l*g," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},L1e=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,a=n.x,s=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),f=Math.min(s,s+c),h=Math.max(s,s+c);return r>=u&&r<=d&&i>=f&&i<=h}return!1},F1e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},_C=function(t){var n=jR(jR({},F1e),t),r=b.useRef(),i=b.useState(-1),a=O1e(i,2),s=a[0],l=a[1];b.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var S=r.current.getTotalLength();S&&l(S)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,x=n.isAnimationActive,y=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=He("recharts-rectangle",p);return y?I.createElement(bi,{canBegin:s>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:m,animationEasing:g,isActive:y},function(S){var _=S.width,j=S.height,k=S.x,C=S.y;return I.createElement(bi,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,isActive:x,easing:g},I.createElement("path",Py({},Ne(n,!0),{className:w,d:SR(k,C,_,j,h),ref:r})))}):I.createElement("path",Py({},Ne(n,!0),{className:w,d:SR(c,u,d,f,h)}))},B1e=["points","className","baseLinePoints","connectNulls"];function Zc(){return Zc=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},Zc.apply(this,arguments)}function U1e(e,t){if(e==null)return{};var n=z1e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function z1e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kR(e){return V1e(e)||q1e(e)||H1e(e)||W1e()}function W1e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
734In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H1e(e,t){if(e){if(typeof e=="string")return zj(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 zj(e,t)}}function q1e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function V1e(e){if(Array.isArray(e))return zj(e)}function zj(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 NR=function(t){return t&&t.x===+t.x&&t.y===+t.y},G1e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){NR(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),NR(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},yh=function(t,n){var r=G1e(t);n&&(r=[r.reduce(function(a,s){return[].concat(kR(a),kR(s))},[])]);var i=r.map(function(a){return a.reduce(function(s,l,c){return"".concat(s).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},K1e=function(t,n,r){var i=yh(t,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(yh(n.reverse(),r).slice(1))},Y1e=function(t){var n=t.points,r=t.className,i=t.baseLinePoints,a=t.connectNulls,s=U1e(t,B1e);if(!n||!n.length)return null;var l=He("recharts-polygon",r);if(i&&i.length){var c=s.stroke&&s.stroke!=="none",u=K1e(n,i,a);return I.createElement("g",{className:l},I.createElement("path",Zc({},Ne(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),c?I.createElement("path",Zc({},Ne(s,!0),{fill:"none",d:yh(n,a)})):null,c?I.createElement("path",Zc({},Ne(s,!0),{fill:"none",d:yh(i,a)})):null)}var d=yh(n,a);return I.createElement("path",Zc({},Ne(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:l,d}))};function Wj(){return Wj=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},Wj.apply(this,arguments)}var ym=function(t){var n=t.cx,r=t.cy,i=t.r,a=t.className,s=He("recharts-dot",a);return n===+n&&r===+r&&i===+i?b.createElement("circle",Wj({},Ne(t,!1),Xv(t),{className:s,cx:n,cy:r,r:i})):null};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)}var X1e=["x","y","top","left","width","height","className"];function Hj(){return Hj=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},Hj.apply(this,arguments)}function CR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Q1e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CR(Object(n),!0).forEach(function(r){J1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J1e(e,t,n){return t=Z1e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z1e(e){var t=e_e(e,"string");return Pp(t)=="symbol"?t:t+""}function e_e(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)}function t_e(e,t){if(e==null)return{};var n=n_e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function n_e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var r_e=function(t,n,r,i,a,s){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(s,",").concat(n,"h").concat(r)},i_e=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,a=i===void 0?0:i,s=t.top,l=s===void 0?0:s,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,g=t.className,m=t_e(t,X1e),v=Q1e({x:r,y:a,top:l,left:u,width:f,height:p},m);return!ce(r)||!ce(a)||!ce(f)||!ce(p)||!ce(l)||!ce(u)?null:I.createElement("path",Hj({},Ne(v,!0),{className:He("recharts-cross",g),d:r_e(r,a,f,p,l,u)}))},a_e=kb,s_e=c6,o_e=Ra;function l_e(e,t){return e&&e.length?a_e(e,o_e(t),s_e):void 0}var c_e=l_e;const u_e=ct(c_e);var d_e=kb,f_e=Ra,h_e=u6;function p_e(e,t){return e&&e.length?d_e(e,f_e(t),h_e):void 0}var m_e=p_e;const g_e=ct(m_e);var v_e=["cx","cy","angle","ticks","axisLine"],y_e=["ticks","tick","angle","tickFormatter","stroke"];function rd(e){"@babel/helpers - typeof";return rd=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},rd(e)}function xh(){return xh=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},xh.apply(this,arguments)}function ER(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zo(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){Pb(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}function PR(e,t){if(e==null)return{};var n=x_e(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function x_e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function b_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z6(r.key),r)}}function w_e(e,t,n){return t&&OR(e.prototype,t),n&&OR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function __e(e,t,n){return t=Oy(t),j_e(e,J6()?Reflect.construct(t,n||[],Oy(e).constructor):t.apply(e,n))}function j_e(e,t){if(t&&(rd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S_e(e)}function S_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(J6=function(){return!!e})()}function Oy(e){return Oy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Oy(e)}function k_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&&qj(e,t)}function qj(e,t){return qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},qj(e,t)}function Pb(e,t,n){return t=Z6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z6(e){var t=N_e(e,"string");return rd(t)=="symbol"?t:t+""}function N_e(e,t){if(rd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ob=function(e){function t(){return b_e(this,t),__e(this,t,arguments)}return k_e(t,e),w_e(t,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,a=this.props,s=a.angle,l=a.cx,c=a.cy;return It(l,c,i,s)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,a=r.cy,s=r.angle,l=r.ticks,c=u_e(l,function(d){return d.coordinate||0}),u=g_e(l,function(d){return d.coordinate||0});return{cx:i,cy:a,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,s=r.angle,l=r.ticks,c=r.axisLine,u=PR(r,v_e),d=l.reduce(function(g,m){return[Math.min(g[0],m.coordinate),Math.max(g[1],m.coordinate)]},[1/0,-1/0]),f=It(i,a,d[0],s),h=It(i,a,d[1],s),p=Zo(Zo(Zo({},Ne(u,!1)),{},{fill:"none"},Ne(c,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return I.createElement("line",xh({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,s=i.tick,l=i.angle,c=i.tickFormatter,u=i.stroke,d=PR(i,y_e),f=this.getTickTextAnchor(),h=Ne(d,!1),p=Ne(s,!1),g=a.map(function(m,v){var x=r.getTickValueCoord(m),y=Zo(Zo(Zo(Zo({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(x.x,", ").concat(x.y,")")},h),{},{stroke:"none",fill:u},p),{},{index:v},x),{},{payload:m});return I.createElement(Ke,xh({className:He("recharts-polar-radius-axis-tick",L6(s)),key:"tick-".concat(m.coordinate)},ko(r.props,m,v)),t.renderTickItem(s,y,c?c(m.value,v):m.value))});return I.createElement(Ke,{className:"recharts-polar-radius-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.axisLine,s=r.tick;return!i||!i.length?null:I.createElement(Ke,{className:He("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),s&&this.renderTicks(),Cn.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,a){var s;return I.isValidElement(r)?s=I.cloneElement(r,i):De(r)?s=r(i):s=I.createElement(Gl,xh({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),s}}])}(b.PureComponent);Pb(Ob,"displayName","PolarRadiusAxis");Pb(Ob,"axisType","radiusAxis");Pb(Ob,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function id(e){"@babel/helpers - typeof";return id=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},id(e)}function cl(){return cl=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},cl.apply(this,arguments)}function AR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function el(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){Ab(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}function C_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TR(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,tB(r.key),r)}}function E_e(e,t,n){return t&&TR(e.prototype,t),n&&TR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function P_e(e,t,n){return t=Ay(t),O_e(e,eB()?Reflect.construct(t,n||[],Ay(e).constructor):t.apply(e,n))}function O_e(e,t){if(t&&(id(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A_e(e)}function A_e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eB=function(){return!!e})()}function Ay(e){return Ay=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ay(e)}function T_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&&Vj(e,t)}function Vj(e,t){return Vj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Vj(e,t)}function Ab(e,t,n){return t=tB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tB(e){var t=R_e(e,"string");return id(t)=="symbol"?t:t+""}function R_e(e,t){if(id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var I_e=Math.PI/180,RR=1e-5,Tb=function(e){function t(){return C_e(this,t),P_e(this,t,arguments)}return T_e(t,e),E_e(t,[{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.cx,s=i.cy,l=i.radius,c=i.orientation,u=i.tickSize,d=u||8,f=It(a,s,l,r.coordinate),h=It(a,s,l+(c==="inner"?-1:1)*d,r.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,a=Math.cos(-r.coordinate*I_e),s;return a>RR?s=i==="outer"?"start":"end":a<-RR?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,s=r.radius,l=r.axisLine,c=r.axisLineType,u=el(el({},Ne(this.props,!1)),{},{fill:"none"},Ne(l,!1));if(c==="circle")return I.createElement(ym,cl({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:s}));var d=this.props.ticks,f=d.map(function(h){return It(i,a,s,h.coordinate)});return I.createElement(Y1e,cl({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,s=i.tick,l=i.tickLine,c=i.tickFormatter,u=i.stroke,d=Ne(this.props,!1),f=Ne(s,!1),h=el(el({},d),{},{fill:"none"},Ne(l,!1)),p=a.map(function(g,m){var v=r.getTickLineCoord(g),x=r.getTickTextAnchor(g),y=el(el(el({textAnchor:x},d),{},{stroke:"none",fill:u},f),{},{index:m,payload:g,x:v.x2,y:v.y2});return I.createElement(Ke,cl({className:He("recharts-polar-angle-axis-tick",L6(s)),key:"tick-".concat(g.coordinate)},ko(r.props,g,m)),l&&I.createElement("line",cl({className:"recharts-polar-angle-axis-tick-line"},h,v)),s&&t.renderTickItem(s,y,c?c(g.value,m):g.value))});return I.createElement(Ke,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,s=r.axisLine;return a<=0||!i||!i.length?null:I.createElement(Ke,{className:He("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var s;return I.isValidElement(r)?s=I.cloneElement(r,i):De(r)?s=r(i):s=I.createElement(Gl,cl({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),s}}])}(b.PureComponent);Ab(Tb,"displayName","PolarAngleAxis");Ab(Tb,"axisType","angleAxis");Ab(Tb,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var M_e=iF,$_e=M_e(Object.getPrototypeOf,Object),D_e=$_e,L_e=gs,F_e=D_e,B_e=vs,U_e="[object Object]",z_e=Function.prototype,W_e=Object.prototype,nB=z_e.toString,H_e=W_e.hasOwnProperty,q_e=nB.call(Object);function V_e(e){if(!B_e(e)||L_e(e)!=U_e)return!1;var t=F_e(e);if(t===null)return!0;var n=H_e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&nB.call(n)==q_e}var G_e=V_e;const K_e=ct(G_e);var Y_e=gs,X_e=vs,Q_e="[object Boolean]";function J_e(e){return e===!0||e===!1||X_e(e)&&Y_e(e)==Q_e}var Z_e=J_e;const eje=ct(Z_e);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 Ty(){return Ty=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},Ty.apply(this,arguments)}function tje(e,t){return aje(e)||ije(e,t)||rje(e,t)||nje()}function nje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
735In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rje(e,t){if(e){if(typeof e=="string")return IR(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 IR(e,t)}}function IR(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 ije(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function aje(e){if(Array.isArray(e))return e}function MR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $R(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MR(Object(n),!0).forEach(function(r){sje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sje(e,t,n){return t=oje(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oje(e){var t=lje(e,"string");return Op(t)=="symbol"?t:t+""}function lje(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 DR=function(t,n,r,i,a){var s=r-i,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-s/2,",").concat(n+a),l+="L ".concat(t+r-s/2-i,",").concat(n+a),l+="L ".concat(t,",").concat(n," Z"),l},cje={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},uje=function(t){var n=$R($R({},cje),t),r=b.useRef(),i=b.useState(-1),a=tje(i,2),s=a[0],l=a[1];b.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,f=n.lowerWidth,h=n.height,p=n.className,g=n.animationEasing,m=n.animationDuration,v=n.animationBegin,x=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var y=He("recharts-trapezoid",p);return x?I.createElement(bi,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:m,animationEasing:g,isActive:x},function(w){var S=w.upperWidth,_=w.lowerWidth,j=w.height,k=w.x,C=w.y;return I.createElement(bi,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:m,easing:g},I.createElement("path",Ty({},Ne(n,!0),{className:y,d:DR(k,C,S,_,j),ref:r})))}):I.createElement("g",null,I.createElement("path",Ty({},Ne(n,!0),{className:y,d:DR(c,u,d,f,h)})))},dje=["option","shapeType","propTransformer","activeClassName","isActive"];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 fje(e,t){if(e==null)return{};var n=hje(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hje(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ry(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(r){pje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pje(e,t,n){return t=mje(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mje(e){var t=gje(e,"string");return Ap(t)=="symbol"?t:t+""}function gje(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 vje(e,t){return Ry(Ry({},t),e)}function yje(e,t){return e==="symbols"}function FR(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return I.createElement(_C,n);case"trapezoid":return I.createElement(uje,n);case"sector":return I.createElement(U6,n);case"symbols":if(yje(t))return I.createElement(mb,n);break;default:return null}}function xje(e){return b.isValidElement(e)?e.props:e}function Iy(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?vje:r,a=e.activeClassName,s=a===void 0?"recharts-active-shape":a,l=e.isActive,c=fje(e,dje),u;if(b.isValidElement(t))u=b.cloneElement(t,Ry(Ry({},c),xje(t)));else if(De(t))u=t(c);else if(K_e(t)&&!eje(t)){var d=i(t,c);u=I.createElement(FR,{shapeType:n,elementProps:d})}else{var f=c;u=I.createElement(FR,{shapeType:n,elementProps:f})}return l?I.createElement(Ke,{className:s},u):u}function Rb(e,t){return t!=null&&"trapezoids"in e.props}function Ib(e,t){return t!=null&&"sectors"in e.props}function Tp(e,t){return t!=null&&"points"in e.props}function bje(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&a}function wje(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function _je(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function jje(e,t){var n;return Rb(e,t)?n=bje:Ib(e,t)?n=wje:Tp(e,t)&&(n=_je),n}function Sje(e,t){var n;return Rb(e,t)?n="trapezoids":Ib(e,t)?n="sectors":Tp(e,t)&&(n="points"),n}function kje(e,t){if(Rb(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(Ib(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 Tp(e,t)?t.payload:{}}function Nje(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=Sje(n,t),a=kje(n,t),s=r.filter(function(c,u){var d=No(a,c),f=n.props[i].filter(function(g){var m=jje(n,t);return m(g,t)}),h=n.props[i].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=r.indexOf(s[s.length-1]);return l}var iv;function ad(e){"@babel/helpers - typeof";return ad=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},ad(e)}function eu(){return eu=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},eu.apply(this,arguments)}function BR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BR(Object(n),!0).forEach(function(r){ui(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UR(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,iB(r.key),r)}}function Eje(e,t,n){return t&&UR(e.prototype,t),n&&UR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pje(e,t,n){return t=My(t),Oje(e,rB()?Reflect.construct(t,n||[],My(e).constructor):t.apply(e,n))}function Oje(e,t){if(t&&(ad(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Aje(e)}function Aje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rB=function(){return!!e})()}function My(e){return My=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},My(e)}function Tje(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&&Gj(e,t)}function Gj(e,t){return Gj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Gj(e,t)}function ui(e,t,n){return t=iB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iB(e){var t=Rje(e,"string");return ad(t)=="symbol"?t:t+""}function Rje(e,t){if(ad(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ad(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xs=function(e){function t(n){var r;return Cje(this,t),r=Pje(this,t,[n]),ui(r,"pieRef",null),ui(r,"sectorRefs",[]),ui(r,"id",Bo("recharts-pie-")),ui(r,"handleAnimationEnd",function(){var i=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),De(i)&&i()}),ui(r,"handleAnimationStart",function(){var i=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),De(i)&&i()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Tje(t,e),Eje(t,[{key:"isActiveIndex",value:function(r){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(r)!==-1:r===i}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.label,l=a.labelLine,c=a.dataKey,u=a.valueKey,d=Ne(this.props,!1),f=Ne(s,!1),h=Ne(l,!1),p=s&&s.offsetRadius||20,g=r.map(function(m,v){var x=(m.startAngle+m.endAngle)/2,y=It(m.cx,m.cy,m.outerRadius+p,x),w=Ot(Ot(Ot(Ot({},d),m),{},{stroke:"none"},f),{},{index:v,textAnchor:t.getTextAnchor(y.x,m.cx)},y),S=Ot(Ot(Ot(Ot({},d),m),{},{fill:"none",stroke:m.fill},h),{},{index:v,points:[It(m.cx,m.cy,m.outerRadius,x),y]}),_=c;return $e(c)&&$e(u)?_="value":$e(c)&&(_=u),I.createElement(Ke,{key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(v)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(s,w,Ut(m,_)))});return I.createElement(Ke,{className:"recharts-pie-labels"},g)}},{key:"renderSectorsStatically",value:function(r){var i=this,a=this.props,s=a.activeShape,l=a.blendStroke,c=a.inactiveShape;return r.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&r.length!==1)return null;var f=i.isActiveIndex(d),h=c&&i.hasActiveIndex()?c:null,p=f?s:h,g=Ot(Ot({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return I.createElement(Ke,eu({ref:function(v){v&&!i.sectorRefs.includes(v)&&i.sectorRefs.push(v)},tabIndex:-1,className:"recharts-pie-sector"},ko(i.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),I.createElement(Iy,eu({option:p,isActive:f,shapeType:"sector"},g)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,i=this.props,a=i.sectors,s=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,u=i.animationEasing,d=i.animationId,f=this.state,h=f.prevSectors,p=f.prevIsAnimationActive;return I.createElement(bi,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(g){var m=g.t,v=[],x=a&&a[0],y=x.startAngle;return a.forEach(function(w,S){var _=h&&h[S],j=S>0?Xr(w,"paddingAngle",0):0;if(_){var k=Yt(_.endAngle-_.startAngle,w.endAngle-w.startAngle),C=Ot(Ot({},w),{},{startAngle:y+j,endAngle:y+k(m)+j});v.push(C),y=C.endAngle}else{var E=w.endAngle,A=w.startAngle,P=Yt(0,E-A),T=P(m),B=Ot(Ot({},w),{},{startAngle:y+j,endAngle:y+T+j});v.push(B),y=B.endAngle}}),I.createElement(Ke,null,r.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(r){var i=this;r.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var l=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[l].focus(),i.setState({sectorToFocus:l});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,i=r.sectors,a=r.isAnimationActive,s=this.state.prevSectors;return a&&i&&i.length&&(!s||!No(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,i=this.props,a=i.hide,s=i.sectors,l=i.className,c=i.label,u=i.cx,d=i.cy,f=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,g=this.state.isAnimationFinished;if(a||!s||!s.length||!ce(u)||!ce(d)||!ce(f)||!ce(h))return null;var m=He("recharts-pie",l);return I.createElement(Ke,{tabIndex:this.props.rootTabIndex,className:m,ref:function(x){r.pieRef=x}},this.renderSectors(),c&&this.renderLabels(s),Cn.renderCallByParent(this.props,null,!1),(!p||g)&&Gi.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return i.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:r.sectors!==i.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,i){return r>i?"start":r<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,i,a){if(I.isValidElement(r))return I.cloneElement(r,i);if(De(r))return r(i);var s=He("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return I.createElement(mo,eu({},i,{key:a,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(r,i,a){if(I.isValidElement(r))return I.cloneElement(r,i);var s=a;if(De(r)&&(s=r(i),I.isValidElement(s)))return s;var l=He("recharts-pie-label-text",typeof r!="boolean"&&!De(r)?r.className:"");return I.createElement(Gl,eu({},i,{alignmentBaseline:"middle",className:l}),s)}}])}(b.PureComponent);iv=xs;ui(xs,"displayName","Pie");ui(xs,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!mi.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ui(xs,"parseDeltaAngle",function(e,t){var n=or(t-e),r=Math.min(Math.abs(t-e),360);return n*r});ui(xs,"getRealPieData",function(e){var t=e.data,n=e.children,r=Ne(e,!1),i=dr(n,hm);return t&&t.length?t.map(function(a,s){return Ot(Ot(Ot({payload:a},r),a),i&&i[s]&&i[s].props)}):i&&i.length?i.map(function(a){return Ot(Ot({},r),a.props)}):[]});ui(xs,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,s=D6(i,a),l=r+lr(e.cx,i,i/2),c=n+lr(e.cy,a,a/2),u=lr(e.innerRadius,s,0),d=lr(e.outerRadius,s,s*.8),f=e.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});ui(xs,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?Ot(Ot({},t.type.defaultProps),t.props):t.props,i=iv.getRealPieData(r);if(!i||!i.length)return null;var a=r.cornerRadius,s=r.startAngle,l=r.endAngle,c=r.paddingAngle,u=r.dataKey,d=r.nameKey,f=r.valueKey,h=r.tooltipType,p=Math.abs(r.minAngle),g=iv.parseCoordinateOfPie(r,n),m=iv.parseDeltaAngle(s,l),v=Math.abs(m),x=u;$e(u)&&$e(f)?(Vi(!1,`Use "dataKey" to specify the value of pie,
736      the props "valueKey" will be deprecated in 1.1.0`),x="value"):$e(u)&&(Vi(!1,`Use "dataKey" to specify the value of pie,
737      the props "valueKey" will be deprecated in 1.1.0`),x=f);var y=i.filter(function(C){return Ut(C,x,0)!==0}).length,w=(v>=360?y:y-1)*c,S=v-y*p-w,_=i.reduce(function(C,E){var A=Ut(E,x,0);return C+(ce(A)?A:0)},0),j;if(_>0){var k;j=i.map(function(C,E){var A=Ut(C,x,0),P=Ut(C,d,E),T=(ce(A)?A:0)/_,B;E?B=k.endAngle+or(m)*c*(A!==0?1:0):B=s;var F=B+or(m)*((A!==0?p:0)+T*S),M=(B+F)/2,L=(g.innerRadius+g.outerRadius)/2,R=[{name:P,value:A,payload:C,dataKey:x,type:h}],$=It(g.cx,g.cy,L,M);return k=Ot(Ot(Ot({percent:T,cornerRadius:a,name:P,tooltipPayload:R,midAngle:M,middleRadius:L,tooltipPosition:$},C),g),{},{value:Ut(C,x),startAngle:B,endAngle:F,payload:C,paddingAngle:or(m)*c}),k})}return Ot(Ot({},g),{},{sectors:j,data:i})});var Ije=Math.ceil,Mje=Math.max;function $je(e,t,n,r){for(var i=-1,a=Mje(Ije((t-e)/(n||1)),0),s=Array(a);a--;)s[r?a:++i]=e,e+=n;return s}var Dje=$je,Lje=jF,zR=1/0,Fje=17976931348623157e292;function Bje(e){if(!e)return e===0?e:0;if(e=Lje(e),e===zR||e===-zR){var t=e<0?-1:1;return t*Fje}return e===e?e:0}var aB=Bje,Uje=Dje,zje=yb,Pw=aB;function Wje(e){return function(t,n,r){return r&&typeof r!="number"&&zje(t,n,r)&&(n=r=void 0),t=Pw(t),n===void 0?(n=t,t=0):n=Pw(n),r=r===void 0?t<n?1:-1:Pw(r),Uje(t,n,r,e)}}var Hje=Wje,qje=Hje,Vje=qje(),Gje=Vje;const $y=ct(Gje);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 WR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function HR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WR(Object(n),!0).forEach(function(r){sB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sB(e,t,n){return t=Kje(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kje(e){var t=Yje(e,"string");return Rp(t)=="symbol"?t:t+""}function Yje(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 Xje=["Webkit","Moz","O","ms"],Qje=function(t,n){var r=t.replace(/(\w)/,function(a){return a.toUpperCase()}),i=Xje.reduce(function(a,s){return HR(HR({},a),{},sB({},s+r,n))},{});return i[t]=n,i};function sd(e){"@babel/helpers - typeof";return sd=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},sd(e)}function Dy(){return Dy=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},Dy.apply(this,arguments)}function qR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ow(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qR(Object(n),!0).forEach(function(r){Br(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VR(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,lB(r.key),r)}}function Zje(e,t,n){return t&&VR(e.prototype,t),n&&VR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function eSe(e,t,n){return t=Ly(t),tSe(e,oB()?Reflect.construct(t,n||[],Ly(e).constructor):t.apply(e,n))}function tSe(e,t){if(t&&(sd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nSe(e)}function nSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oB=function(){return!!e})()}
vendor: 9,387 bytes, line 737
737function Ly(e){return Ly=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ly(e)}function rSe(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&&Kj(e,t)}function Kj(e,t){return Kj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Kj(e,t)}function Br(e,t,n){return t=lB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lB(e){var t=iSe(e,"string");return sd(t)=="symbol"?t:t+""}function iSe(e,t){if(sd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aSe=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,a=t.x,s=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=mh().domain($y(0,c)).range([a,a+s-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(i),scale:u,scaleValues:d}},GR=function(t){return t.changedTouches&&!!t.changedTouches.length},od=function(e){function t(n){var r;return Jje(this,t),r=eSe(this,t,[n]),Br(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),Br(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),Br(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,a=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:a,startIndex:l})}),r.detachDragEndListener()}),Br(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Br(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Br(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Br(r,"handleSlideDragStart",function(i){var a=GR(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return rSe(t,e),Zje(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,a=r.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(i,a),h=Math.max(i,a),p=t.getIndexInRange(s,f),g=t.getIndexInRange(s,h);return{startIndex:p-p%c,endIndex:g===d?d:g-g%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,a=i.data,s=i.tickFormatter,l=i.dataKey,c=Ut(a[r],l,r);return De(s)?s(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var i=this.state,a=i.slideMoveStartX,s=i.startX,l=i.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,m=r.pageX-a;m>0?m=Math.min(m,u+d-f-l,u+d-f-s):m<0&&(m=Math.max(m,u-s,u-l));var v=this.getIndex({startX:s+m,endX:l+m});(v.startIndex!==h||v.endIndex!==p)&&g&&g(v),this.setState({startX:s+m,endX:l+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var a=GR(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,a=i.brushMoveStartX,s=i.movingTravellerId,l=i.endX,c=i.startX,u=this.state[s],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.onChange,m=d.gap,v=d.data,x={startX:this.state.startX,endX:this.state.endX},y=r.pageX-a;y>0?y=Math.min(y,f+h-p-u):y<0&&(y=Math.max(y,f-u)),x[s]=u+y;var w=this.getIndex(x),S=w.startIndex,_=w.endIndex,j=function(){var C=v.length-1;return s==="startX"&&(l>c?S%m===0:_%m===0)||l<c&&_===C||s==="endX"&&(l>c?_%m===0:S%m===0)||l>c&&_===C};this.setState(Br(Br({},s,u+y),"brushMoveStartX",r.pageX),function(){g&&j()&&g(w)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var a=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,d=this.state[i],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var p=l[h];i==="startX"&&p>=u||i==="endX"&&p<=c||this.setState(Br({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,l=r.height,c=r.fill,u=r.stroke;return I.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:s,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=b.Children.only(u);return f?I.cloneElement(f,{x:i,y:a,width:s,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var a,s,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,m=c.startIndex,v=c.endIndex,x=Math.max(r,this.props.x),y=Ow(Ow({},Ne(this.props,!1)),{},{x,y:u,width:d,height:f}),w=p||"Min value: ".concat((a=g[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((s=g[v])===null||s===void 0?void 0:s.name);return I.createElement(Ke,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),l.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,y))}},{key:"renderSlide",value:function(r,i){var a=this.props,s=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(r,i)+u,f=Math.max(Math.abs(i-r)-u,0);return I.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:s,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,a=r.endIndex,s=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,g={pointerEvents:"none",fill:u};return I.createElement(Ke,{className:"recharts-brush-texts"},I.createElement(Gl,Dy({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:s+l/2},g),this.getTextOfTick(i)),I.createElement(Gl,Dy({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:s+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var r=this.props,i=r.data,a=r.className,s=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,g=h.endX,m=h.isTextActive,v=h.isSlideMoving,x=h.isTravellerMoving,y=h.isTravellerFocused;if(!i||!i.length||!ce(l)||!ce(c)||!ce(u)||!ce(d)||u<=0||d<=0)return null;var w=He("recharts-brush",a),S=I.Children.count(s)===1,_=Qje("userSelect","none");return I.createElement(Ke,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(m||v||x||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,a=r.y,s=r.width,l=r.height,c=r.stroke,u=Math.floor(a+l/2)-1;return I.createElement(I.Fragment,null,I.createElement("rect",{x:i,y:a,width:s,height:l,fill:c,stroke:"none"}),I.createElement("line",{x1:i+1,y1:u,x2:i+s-1,y2:u,fill:"none",stroke:"#fff"}),I.createElement("line",{x1:i+1,y1:u+2,x2:i+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var a;return I.isValidElement(r)?a=I.cloneElement(r,i):De(r)?a=r(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(r,i){var a=r.data,s=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Ow({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},a&&a.length?aSe({data:a,width:s,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+s-c]
737);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,i){for(var a=r.length,s=0,l=a-1;l-s>1;){var c=Math.floor((s+l)/2);r[c]>i?l=c:s=c}return i>=r[l]?l:s}}])}(b.PureComponent);Br(od,"displayName","Brush");Br(od,"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 sSe=KN;function oSe(e,t){var n;return sSe(e,function(r,i,a){return n=t(r,i,a),!n}),!!n}var lSe=oSe,cSe=XL,uSe=Ra,dSe=lSe,fSe=Ir,hSe=yb;function pSe(e,t,n){var r=fSe(e)?cSe:dSe;return n&&hSe(e,t,n)&&(t=void 0),r(e,uSe(t))}var mSe=pSe;const gSe=ct(mSe);var ka=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},KR=yF;function vSe(e,t,n){t=="__proto__"&&KR?KR(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var ySe=vSe,xSe=ySe,bSe=gF,wSe=Ra;function _Se(e,t){var n={};return t=wSe(t),bSe(e,function(r,i,a){xSe(n,i,t(r,i,a))}),n}var jSe=_Se;const SSe=ct(jSe);function kSe(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 NSe=kSe,CSe=KN;function ESe(e,t){var n=!0;return CSe(e,function(r,i,a){return n=!!t(r,i,a),n}),n}var PSe=ESe,OSe=NSe,ASe=PSe,TSe=Ra,RSe=Ir,ISe=yb;function MSe(e,t,n){var r=RSe(e)?OSe:ASe;return n&&ISe(e,t,n)&&(t=void 0),r(e,TSe(t))}var $Se=MSe;const cB=ct($Se);var DSe=["x","y"];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 Yj(){return Yj=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},Yj.apply(this,arguments)}function YR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YR(Object(n),!0).forEach(function(r){LSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LSe(e,t,n){return t=FSe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FSe(e){var t=BSe(e,"string");return Ip(t)=="symbol"?t:t+""}function BSe(e,t){if(Ip(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ip(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function USe(e,t){if(e==null)return{};var n=zSe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zSe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function WSe(e,t){var n=e.x,r=e.y,i=USe(e,DSe),a="".concat(n),s=parseInt(a,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||i.height),d=parseInt(u,10),f="".concat(t.width||i.width),h=parseInt(f,10);return Pf(Pf(Pf(Pf(Pf({},t),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function XR(e){return I.createElement(Iy,Yj({shapeType:"rectangle",propTransformer:WSe,activeClassName:"recharts-active-bar"},e))}var HSe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var a=ce(r)||mae(r);return a?t(r,i):(a||Yl(),n)}},qSe=["value","background"],uB;function ld(e){"@babel/helpers - typeof";return ld=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},ld(e)}function VSe(e,t){if(e==null)return{};var n=GSe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GSe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Fy(){return Fy=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},Fy.apply(this,arguments)}function QR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
vendor: 131,079 bytes, lines 737-742
737t%2?QR(Object(n),!0).forEach(function(r){eo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JR(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,fB(r.key),r)}}function YSe(e,t,n){return t&&JR(e.prototype,t),n&&JR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function XSe(e,t,n){return t=By(t),QSe(e,dB()?Reflect.construct(t,n||[],By(e).constructor):t.apply(e,n))}function QSe(e,t){if(t&&(ld(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JSe(e)}function JSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dB=function(){return!!e})()}function By(e){return By=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},By(e)}function ZSe(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&&Xj(e,t)}function Xj(e,t){return Xj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Xj(e,t)}function eo(e,t,n){return t=fB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fB(e){var t=eke(e,"string");return ld(t)=="symbol"?t:t+""}function eke(e,t){if(ld(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dc=function(e){function t(){var n;KSe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=XSe(this,t,[].concat(i)),eo(n,"state",{isAnimationFinished:!1}),eo(n,"id",Bo("recharts-bar-")),eo(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),s&&s()}),eo(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),s&&s()}),n}return ZSe(t,e),YSe(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,a=this.props,s=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=Ne(this.props,!1);return r&&r.map(function(f,h){var p=h===c,g=p?u:s,m=un(un(un({},d),f),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return I.createElement(Ke,Fy({className:"recharts-bar-rectangle"},ko(i.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),I.createElement(XR,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,a=i.data,s=i.layout,l=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,f=i.animationId,h=this.state.prevData;return I.createElement(bi,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var g=p.t,m=a.map(function(v,x){var y=h&&h[x];if(y){var w=Yt(y.x,v.x),S=Yt(y.y,v.y),_=Yt(y.width,v.width),j=Yt(y.height,v.height);return un(un({},v),{},{x:w(g),y:S(g),width:_(g),height:j(g)})}if(s==="horizontal"){var k=Yt(0,v.height),C=k(g);return un(un({},v),{},{y:v.y+v.height-C,height:C})}var E=Yt(0,v.width),A=E(g);return un(un({},v),{},{width:A})});return I.createElement(Ke,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,a=r.isAnimationActive,s=this.state.prevData;return a&&i&&i.length&&(!s||!No(s,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,a=i.data,s=i.dataKey,l=i.activeIndex,c=Ne(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,h=VSe(u,qSe);if(!f)return null;var p=un(un(un(un(un({},h),{},{fill:"#eee"},f),c),ko(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:s,index:d,className:"recharts-bar-background-rectangle"});return I.createElement(XR,Fy({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=dr(d,Jd);if(!f)return null;var h=u==="vertical"?s[0].height/2:s[0].width/2,p=function(v,x){var y=Array.isArray(v.value)?v.value[1]:v.value;return{x:v.x,y:v.y,value:y,errorVal:Ut(v,x)}},g={clipPath:r?"url(#clipPath-".concat(i,")"):null};return I.createElement(Ke,g,f.map(function(m){return I.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,a=r.data,s=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,h=r.height,p=r.isAnimationActive,g=r.background,m=r.id;if(i||!a||!a.length)return null;var v=this.state.isAnimationFinished,x=He("recharts-bar",s),y=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,S=y||w,_=$e(m)?this.id:m;return I.createElement(Ke,{className:x},y||w?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(_)},I.createElement("rect",{x:y?u:u-f/2,y:w?d:d-h/2,width:y?f:f*2,height:w?h:h*2}))):null,I.createElement(Ke,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(_,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,_),(!p||v)&&Gi.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(b.PureComponent);uB=dc;eo(dc,"displayName","Bar");eo(dc,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!mi.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});eo(dc,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=Ibe(r,n);if(!p)return null;var g=t.layout,m=n.type.defaultProps,v=m!==void 0?un(un({},m),n.props):n.props,x=v.dataKey,y=v.children,w=v.minPointSize,S=g==="horizontal"?s:a,_=u?S.scale.domain():null,j=Ube({numericAxis:S}),k=dr(y,hm),C=f.map(function(E,A){var P,T,B,F,M,L;u?P=Mbe(u[d+A],_):(P=Ut(E,x),Array.isArray(P)||(P=[j,P]));var R=HSe(w,uB.defaultProps.minPointSize)(P[1],A);if(g==="horizontal"){var $,O=[s.scale(P[0]),s.scale(P[1])],N=O[0],H=O[1];T=UT({axis:a,ticks:l,bandSize:i,offset:p.offset,entry:E,index:A}),B=($=H??N)!==null&&$!==void 0?$:void 0,F=p.size;var V=N-H;if(M=Number.isNaN(V)?0:V,L={x:T,y:s.y,width:F,height:s.height},Math.abs(R)>0&&Math.abs(M)<Math.abs(R)){var D=or(M||R)*(Math.abs(R)-Math.abs(M));B-=D,M+=D}}else{var K=[a.scale(P[0]),a.scale(P[1])],ae=K[0],se=K[1];if(T=ae,B=UT({axis:s,ticks:c,bandSize:i,offset:p.offset,entry:E,index:A}),F=se-ae,M=p.size,L={x:a.x,y:B,width:a.width,height:M},Math.abs(R)>0&&Math.abs(F)<Math.abs(R)){var Q=or(F||R)*(Math.abs(R)-Math.abs(F));F+=Q}}return un(un(un({},E),{},{x:T,y:B,width:F,height:M,value:u?P:P[1],payload:E,background:L},k&&k[A]&&k[A].props),{},{tooltipPayload:[M6(n,E)],tooltipPosition:{x:T+F/2,y:B+M/2}})});return un({data:C,layout:g},h)});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 tke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZR(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,hB(r.key),r)}}function nke(e,t,n){return t&&ZR(e.prototype,t),n&&ZR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eI(Object(n),!0).forEach(function(r){Mb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mb(e,t,n){return t=hB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hB(e){var t=rke(e,"string");return Mp(t)=="symbol"?t:t+""}function rke(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)}var ike=function(t,n,r,i,a){var s=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:s-r.right,rightMirror:s-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},h=!!zr(u,dc);return d.reduce(function(p,g){var m=n[g],v=m.orientation,x=m.domain,y=m.padding,w=y===void 0?{}:y,S=m.mirror,_=m.reversed,j="".concat(v).concat(S?"Mirror":""),k,C,E,A,P;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var T=x[1]-x[0],B=1/0,F=m.categoricalDomain.sort(xae);if(F.forEach(function(K,ae){ae>0&&(B=Math.min((K||0)-(F[ae-1]||0),B))}),Number.isFinite(B)){var M=B/T,L=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(k=M*L/2),m.padding==="no-gap"){var R=lr(t.barCategoryGap,M*L),$=M*L/2;k=$-R-($-R)/L*R}}}i==="xAxis"?C=[r.left+(w.left||0)+(k||0),r.left+r.width-(w.right||0)-(k||0)]:i==="yAxis"?C=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)]:C=m.range,_&&(C=[C[1],C[0]]);var O=A6(m,a,h),N=O.scale,H=O.realScaleType;N.domain(x).range(C),T6(N);var V=R6(N,Fi(Fi({},m),{},{realScaleType:H}));i==="xAxis"?(P=v==="top"&&!S||v==="bottom"&&S,E=r.left,A=f[j]-P*m.height):i==="yAxis"&&(P=v==="left"&&!S||v==="right"&&S,E=f[j]-P*m.width,A=r.top);var D=Fi(Fi(Fi({},m),V),{},{realScaleType:H,x:E,y:A,scale:N,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return D.bandSize=jy(D,V),!m.hide&&i==="xAxis"?f[j]+=(P?-1:1)*D.height:m.hide||(f[j]+=(P?-1:1)*D.width),Fi(Fi({},p),{},Mb({},g,D))},{})},pB=function(t,n){var r=t.x,i=t.y,a=n.x,s=n.y;return{x:Math.min(r,a),y:Math.min(i,s),width:Math.abs(a-r),height:Math.abs(s-i)}},ake=function(t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2;return pB({x:n,y:r},{x:i,y:a})},mB=function(){function e(t){tke(this,e),this.scale=t}return nke(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,a=r.position;if(n!==void 0){if(a)switch(a){case"start":return this.scale(n);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],a=r[r.length-1];return i<=a?n>=i&&n<=a:n>=a&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();Mb(mB,"EPS",1e-4);var jC=function(t){var n=Object.keys(t).reduce(function(r,i){return Fi(Fi({},r),{},Mb({},i,mB.create(t[i])))},{});return Fi(Fi({},n),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.bandAware,l=a.position;return SSe(i,function(c,u){return n[u].apply(c,{bandAware:s,position:l})})},isInRange:function(i){return cB(i,function(a,s){return n[s].isInRange(a)})}})};function ske(e){return(e%180+180)%180}var oke=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=ske(i),s=a*Math.PI/180,l=Math.atan(r/n),c=s>l&&s<Math.PI-l?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},lke=Ra,cke=fm,uke=gb;function dke(e){return function(t,n,r){var i=Object(t);if(!cke(t)){var a=lke(n);t=uke(t),n=function(l){return a(i[l],l,i)}}var s=e(t,n,r);return s>-1?i[a?t[s]:s]:void 0}}var fke=dke,hke=aB;function pke(e){var t=hke(e),n=t%1;return t===t?n?t-n:t:0}var mke=pke,gke=uF,vke=Ra,yke=mke,xke=Math.max;function bke(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:yke(n);return i<0&&(i=xke(r+i,0)),gke(e,vke(t),i)}var wke=bke,_ke=fke,jke=wke,Ske=_ke(jke),kke=Ske;const Nke=ct(kke);var Cke=xie(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("")}),SC=b.createContext(void 0),kC=b.createContext(void 0),gB=b.createContext(void 0),vB=b.createContext({}),yB=b.createContext(void 0),xB=b.createContext(0),bB=b.createContext(0),tI=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,a=n.offset,s=t.clipPathId,l=t.children,c=t.width,u=t.height,d=Cke(a);return I.createElement(SC.Provider,{value:r},I.createElement(kC.Provider,{value:i},I.createElement(vB.Provider,{value:a},I.createElement(gB.Provider,{value:d},I.createElement(yB.Provider,{value:s},I.createElement(xB.Provider,{value:u},I.createElement(bB.Provider,{value:c},l)))))))},Eke=function(){return b.useContext(yB)},wB=function(t){var n=b.useContext(SC);n==null&&Yl();var r=n[t];return r==null&&Yl(),r},Pke=function(){var t=b.useContext(SC);return Ls(t)},Oke=function(){var t=b.useContext(kC),n=Nke(t,function(r){return cB(r.domain,Number.isFinite)});return n||Ls(t)},_B=function(t){var n=b.useContext(kC);n==null&&Yl();var r=n[t];return r==null&&Yl(),r},Ake=function(){var t=b.useContext(gB);return t},Tke=function(){return b.useContext(vB)},NC=function(){return b.useContext(bB)},CC=function(){return b.useContext(xB)};function cd(e){"@babel/helpers - typeof";return cd=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},cd(e)}function Rke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ike(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,SB(r.key),r)}}function Mke(e,t,n){return t&&Ike(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ke(e,t,n){return t=Uy(t),Dke(e,jB()?Reflect.construct(t,n||[],Uy(e).constructor):t.apply(e,n))}function Dke(e,t){if(t&&(cd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lke(e)}function Lke(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jB=function(){return!!e})()}function Uy(e){return Uy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Uy(e)}function Fke(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&&Qj(e,t)}function Qj(e,t){return Qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Qj(e,t)}function nI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nI(Object(n),!0).forEach(function(r){EC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EC(e,t,n){return t=SB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SB(e){var t=Bke(e,"string");return cd(t)=="symbol"?t:t+""}function Bke(e,t){if(cd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(cd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uke(e,t){return qke(e)||Hke(e,t)||Wke(e,t)||zke()}function zke(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
738In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wke(e,t){if(e){if(typeof e=="string")return iI(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 iI(e,t)}}function iI(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 Hke(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function qke(e){if(Array.isArray(e))return e}function Jj(){return Jj=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},Jj.apply(this,arguments)}var Vke=function(t,n){var r;return I.isValidElement(t)?r=I.cloneElement(t,n):De(t)?r=t(n):r=I.createElement("line",Jj({},n,{className:"recharts-reference-line-line"})),r},Gke=function(t,n,r,i,a,s,l,c,u){var d=a.x,f=a.y,h=a.width,p=a.height;if(r){var g=u.y,m=t.y.apply(g,{position:s});if(ka(u,"discard")&&!t.y.isInRange(m))return null;var v=[{x:d+h,y:m},{x:d,y:m}];return c==="left"?v.reverse():v}if(n){var x=u.x,y=t.x.apply(x,{position:s});if(ka(u,"discard")&&!t.x.isInRange(y))return null;var w=[{x:y,y:f+p},{x:y,y:f}];return l==="top"?w.reverse():w}if(i){var S=u.segment,_=S.map(function(j){return t.apply(j,{position:s})});return ka(u,"discard")&&gSe(_,function(j){return!t.isInRange(j)})?null:_}return null};function Kke(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,u=Eke(),d=wB(i),f=_B(a),h=Ake();if(!u||!h)return null;Vi(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=jC({x:d.scale,y:f.scale}),g=_n(t),m=_n(n),v=r&&r.length===2,x=Gke(p,g,m,v,h,e.position,d.orientation,f.orientation,e);if(!x)return null;var y=Uke(x,2),w=y[0],S=w.x,_=w.y,j=y[1],k=j.x,C=j.y,E=ka(e,"hidden")?"url(#".concat(u,")"):void 0,A=rI(rI({clipPath:E},Ne(e,!0)),{},{x1:S,y1:_,x2:k,y2:C});return I.createElement(Ke,{className:He("recharts-reference-line",l)},Vke(s,A),Cn.renderCallByParent(e,ake({x1:S,y1:_,x2:k,y2:C})))}var PC=function(e){function t(){return Rke(this,t),$ke(this,t,arguments)}return Fke(t,e),Mke(t,[{key:"render",value:function(){return I.createElement(Kke,this.props)}}])}(I.Component);EC(PC,"displayName","ReferenceLine");EC(PC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Zj(){return Zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zj.apply(this,arguments)}function 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)}function aI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aI(Object(n),!0).forEach(function(r){$b(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xke(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,NB(r.key),r)}}function Qke(e,t,n){return t&&Xke(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jke(e,t,n){return t=zy(t),Zke(e,kB()?Reflect.construct(t,n||[],zy(e).constructor):t.apply(e,n))}function Zke(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 eNe(e)}function eNe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kB=function(){return!!e})()}function zy(e){return zy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zy(e)}function tNe(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&&eS(e,t)}function eS(e,t){return eS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},eS(e,t)}function $b(e,t,n){return t=NB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NB(e){var t=nNe(e,"string");return ud(t)=="symbol"?t:t+""}function nNe(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)}var rNe=function(t){var n=t.x,r=t.y,i=t.xAxis,a=t.yAxis,s=jC({x:i.scale,y:a.scale}),l=s.apply({x:n,y:r},{bandAware:!0});return ka(t,"discard")&&!s.isInRange(l)?null:l},Db=function(e){function t(){return Yke(this,t),Jke(this,t,arguments)}return tNe(t,e),Qke(t,[{key:"render",value:function(){var r=this.props,i=r.x,a=r.y,s=r.r,l=r.alwaysShow,c=r.clipPathId,u=_n(i),d=_n(a);if(Vi(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=rNe(this.props);if(!f)return null;var h=f.x,p=f.y,g=this.props,m=g.shape,v=g.className,x=ka(this.props,"hidden")?"url(#".concat(c,")"):void 0,y=sI(sI({clipPath:x},Ne(this.props,!0)),{},{cx:h,cy:p});return I.createElement(Ke,{className:He("recharts-reference-dot",v)},t.renderDot(m,y),Cn.renderCallByParent(this.props,{x:h-s,y:p-s,width:2*s,height:2*s}))}}])}(I.Component);$b(Db,"displayName","ReferenceDot");$b(Db,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});$b(Db,"renderDot",function(e,t){var n;return I.isValidElement(e)?n=I.cloneElement(e,t):De(e)?n=e(t):n=I.createElement(ym,Zj({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function tS(){return tS=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},tS.apply(this,arguments)}function dd(e){"@babel/helpers - typeof";return dd=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},dd(e)}function oI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(n),!0).forEach(function(r){Lb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aNe(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,EB(r.key),r)}}function sNe(e,t,n){return t&&aNe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oNe(e,t,n){return t=Wy(t),lNe(e,CB()?Reflect.construct(t,n||[],Wy(e).constructor):t.apply(e,n))}function lNe(e,t){if(t&&(dd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cNe(e)}function cNe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CB=function(){return!!e})()}function Wy(e){return Wy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wy(e)}function uNe(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&&nS(e,t)}function nS(e,t){return nS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},nS(e,t)}function Lb(e,t,n){return t=EB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EB(e){var t=dNe(e,"string");return dd(t)=="symbol"?t:t+""}function dNe(e,t){if(dd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(dd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fNe=function(t,n,r,i,a){var s=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var h=jC({x:d.scale,y:f.scale}),p={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:r?h.y.apply(c,{position:"start"}):h.y.rangeMin},g={x:n?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:i?h.y.apply(u,{position:"end"}):h.y.rangeMax};return ka(a,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:pB(p,g)},Fb=function(e){function t(){return iNe(this,t),oNe(this,t,arguments)}return uNe(t,e),sNe(t,[{key:"render",value:function(){var r=this.props,i=r.x1,a=r.x2,s=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;Vi(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=_n(i),h=_n(a),p=_n(s),g=_n(l),m=this.props.shape;if(!f&&!h&&!p&&!g&&!m)return null;var v=fNe(f,h,p,g,this.props);if(!v&&!m)return null;var x=ka(this.props,"hidden")?"url(#".concat(d,")"):void 0;return I.createElement(Ke,{className:He("recharts-reference-area",c)},t.renderRect(m,lI(lI({clipPath:x},Ne(this.props,!0)),v)),Cn.renderCallByParent(this.props,v))}}])}(I.Component);Lb(Fb,"displayName","ReferenceArea");Lb(Fb,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Lb(Fb,"renderRect",function(e,t){var n;return I.isValidElement(e)?n=I.cloneElement(e,t):De(e)?n=e(t):n=I.createElement(_C,tS({},t,{className:"recharts-reference-area-rect"})),n});function PB(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function hNe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return oke(r,n)}function pNe(e,t,n){var r=n==="width",i=e.x,a=e.y,s=e.width,l=e.height;return t===1?{start:r?i:a,end:r?i+s:a+l}:{start:r?i+s:a+l,end:r?i:a}}function Hy(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function mNe(e,t){return PB(e,t+1)}function gNe(e,t,n,r,i){for(var a=(r||[]).slice(),s=t.start,l=t.end,c=0,u=1,d=s,f=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:PB(r,u)};var m=c,v,x=function(){return v===void 0&&(v=n(g,m)),v},y=g.coordinate,w=c===0||Hy(e,y,x,d,l);w||(c=0,d=s,u+=1),w&&(d=y+e*(x()/2+i),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}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 cI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(r){vNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vNe(e,t,n){return t=yNe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yNe(e){var t=xNe(e,"string");return $p(t)=="symbol"?t:t+""}function xNe(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 bNe(e,t,n,r,i){for(var a=(r||[]).slice(),s=a.length,l=t.start,c=t.end,u=function(h){var p=a[h],g,m=function(){return g===void 0&&(g=n(p,h)),g};if(h===s-1){var v=e*(p.coordinate+e*m()/2-c);a[h]=p=qn(qn({},p),{},{tickCoord:v>0?p.coordinate-v*e:p.coordinate})}else a[h]=p=qn(qn({},p),{},{tickCoord:p.coordinate});var x=Hy(e,p.tickCoord,m,l,c);x&&(c=p.tickCoord-e*(m()/2+i),a[h]=qn(qn({},p),{},{isShow:!0}))},d=s-1;d>=0;d--)u(d);return a}function wNe(e,t,n,r,i,a){var s=(r||[]).slice(),l=s.length,c=t.start,u=t.end;if(a){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);s[l-1]=d=qn(qn({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=Hy(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+i),s[l-1]=qn(qn({},d),{},{isShow:!0}))}for(var g=a?l-1:l,m=function(y){var w=s[y],S,_=function(){return S===void 0&&(S=n(w,y)),S};if(y===0){var j=e*(w.coordinate-e*_()/2-c);s[y]=w=qn(qn({},w),{},{tickCoord:j<0?w.coordinate-j*e:w.coordinate})}else s[y]=w=qn(qn({},w),{},{tickCoord:w.coordinate});var k=Hy(e,w.tickCoord,_,c,u);k&&(c=w.tickCoord+e*(_()/2+i),s[y]=qn(qn({},w),{},{isShow:!0}))},v=0;v<g;v++)m(v);return s}function OC(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(ce(c)||mi.isSsr)return mNe(i,typeof c=="number"&&ce(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=d&&p==="width"?ph(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(w,S){var _=De(u)?u(w.value,S):w.value;return p==="width"?hNe(ph(_,{fontSize:t,letterSpacing:n}),g,f):ph(_,{fontSize:t,letterSpacing:n})[p]},v=i.length>=2?or(i[1].coordinate-i[0].coordinate):1,x=pNe(a,v,p);return c==="equidistantPreserveStart"?gNe(v,x,m,i,s):(c==="preserveStart"||c==="preserveStartEnd"?h=wNe(v,x,m,i,s,c==="preserveStartEnd"):h=bNe(v,x,m,i,s),h.filter(function(y){return y.isShow}))}var _Ne=["viewBox"],jNe=["viewBox"],SNe=["ticks"];function fd(e){"@babel/helpers - typeof";return fd=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},fd(e)}function tu(){return tu=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},tu.apply(this,arguments)}function uI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uI(Object(n),!0).forEach(function(r){AC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aw(e,t){if(e==null)return{};var n=kNe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kNe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function NNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dI(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,AB(r.key),r)}}function CNe(e,t,n){return t&&dI(e.prototype,t),n&&dI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ENe(e,t,n){return t=qy(t),PNe(e,OB()?Reflect.construct(t,n||[],qy(e).constructor):t.apply(e,n))}function PNe(e,t){if(t&&(fd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ONe(e)}function ONe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OB=function(){return!!e})()}function qy(e){return qy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qy(e)}function ANe(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&&rS(e,t)}function rS(e,t){return rS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},rS(e,t)}function AC(e,t,n){return t=AB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AB(e){var t=TNe(e,"string");return fd(t)=="symbol"?t:t+""}function TNe(e,t){if(fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zd=function(e){function t(n){var r;return NNe(this,t),r=ENe(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return ANe(t,e),CNe(t,[{key:"shouldComponentUpdate",value:function(r,i){var a=r.viewBox,s=Aw(r,_Ne),l=this.props,c=l.viewBox,u=Aw(l,jNe);return!hu(a,c)||!hu(s,u)||!hu(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.x,s=i.y,l=i.width,c=i.height,u=i.orientation,d=i.tickSize,f=i.mirror,h=i.tickMargin,p,g,m,v,x,y,w=f?-1:1,S=r.tickSize||d,_=ce(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":p=g=r.coordinate,v=s+ +!f*c,m=v-w*S,y=m-w*h,x=_;break;case"left":m=v=r.coordinate,g=a+ +!f*l,p=g-w*S,x=p-w*h,y=_;break;case"right":m=v=r.coordinate,g=a+ +f*l,p=g+w*S,x=p+w*h,y=_;break;default:p=g=r.coordinate,v=s+ +f*c,m=v+w*S,y=m+w*h,x=_;break}return{line:{x1:p,y1:m,x2:g,y2:v},tick:{x,y}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,s;switch(i){case"left":s=a?"start":"end";break;case"right":s=a?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,a=r.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=a?"start":"end";break;default:s=a?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,a=r.y,s=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=gn(gn(gn({},Ne(this.props,!1)),Ne(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=gn(gn({},f),{},{x1:i,y1:a+h*l,x2:i+s,y2:a+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=gn(gn({},f),{},{x1:i+p*s,y1:a,x2:i+p*s,y2:a+l})}return I.createElement("line",tu({},f,{className:He("recharts-cartesian-axis-line",Xr(d,"className"))}))}},{key:"renderTicks",value:function(r,i,a){var s=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=OC(gn(gn({},this.props),{},{ticks:r}),i,a),g=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),v=Ne(this.props,!1),x=Ne(d,!1),y=gn(gn({},v),{},{fill:"none"},Ne(c,!1)),w=p.map(function(S,_){var j=s.getTickLineCoord(S),k=j.line,C=j.tick,E=gn(gn(gn(gn({textAnchor:g,verticalAnchor:m},v),{},{stroke:"none",fill:u},x),C),{},{index:_,payload:S,visibleTicksCount:p.length,tickFormatter:f});return I.createElement(Ke,tu({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},ko(s.props,S,_)),c&&I.createElement("line",tu({},y,k,{className:He("recharts-cartesian-axis-tick-line",Xr(c,"className"))})),d&&t.renderTickItem(d,E,"".concat(De(f)?f(S.value,_):S.value).concat(h||"")))});return I.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var r=this,i=this.props,a=i.axisLine,s=i.width,l=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var f=this.props,h=f.ticks,p=Aw(f,SNe),g=h;return De(c)&&(g=h&&h.length>0?c(this.props):c(p)),s<=0||l<=0||!g||!g.length?null:I.createElement(Ke,{className:He("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Cn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,a){var s,l=He(i.className,"recharts-cartesian-axis-tick-value");return I.isValidElement(r)?s=I.cloneElement(r,gn(gn({},i),{},{className:l})):De(r)?s=r(gn(gn({},i),{},{className:l})):s=I.createElement(Gl,tu({},i,{className:"recharts-cartesian-axis-tick-value"}),a),s}}])}(b.Component);AC(Zd,"displayName","CartesianAxis");AC(Zd,"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 RNe=["x1","y1","x2","y2","key"],INe=["offset"];function Xl(e){"@babel/helpers - typeof";return Xl=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},Xl(e)}function fI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fI(Object(n),!0).forEach(function(r){MNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MNe(e,t,n){return t=$Ne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ne(e){var t=DNe(e,"string");return Xl(t)=="symbol"?t:t+""}function DNe(e,t){if(Xl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yl(){return yl=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},yl.apply(this,arguments)}function hI(e,t){if(e==null)return{};var n=LNe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LNe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var FNe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,a=t.y,s=t.width,l=t.height,c=t.ry;return I.createElement("rect",{x:i,y:a,ry:c,width:s,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function TB(e,t){var n;if(I.isValidElement(e))n=I.cloneElement(e,t);else if(De(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,s=t.y2,l=t.key,c=hI(t,RNe),u=Ne(c,!1);u.offset;var d=hI(u,INe);n=I.createElement("line",yl({},d,{x1:r,y1:i,x2:a,y2:s,fill:"none",key:l}))}return n}function BNe(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(l,c){var u=Gn(Gn({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return TB(i,u)});return I.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function UNe(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;var s=a.map(function(l,c){var u=Gn(Gn({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return TB(i,u)});return I.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function zNe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,s=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(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?i+s-h:d[p+1]-h;if(m<=0)return null;var v=p%t.length;return I.createElement("rect",{key:"react-".concat(p),y:h,x:r,height:m,width:a,stroke:"none",fill:t[v],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return I.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function WNe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var g=!d[p+1],m=g?a+l-h:d[p+1]-h;if(m<=0)return null;var v=p%r.length;return I.createElement("rect",{key:"react-".concat(p),x:h,y:s,width:m,height:c,stroke:"none",fill:r[v],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return I.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var HNe=function(t,n){var r=t.xAxis,i=t.width,a=t.height,s=t.offset;return O6(OC(Gn(Gn(Gn({},Zd.defaultProps),r),{},{ticks:Ya(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.left,s.left+s.width,n)},qNe=function(t,n){var r=t.yAxis,i=t.width,a=t.height,s=t.offset;return O6(OC(Gn(Gn(Gn({},Zd.defaultProps),r),{},{ticks:Ya(r,!0),viewBox:{x:0,y:0,width:i,height:a}})),s.top,s.top+s.height,n)},Ec={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function RB(e){var t,n,r,i,a,s,l=NC(),c=CC(),u=Tke(),d=Gn(Gn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ec.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:Ec.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:Ec.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Ec.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Ec.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Ec.verticalFill,x:ce(e.x)?e.x:u.left,y:ce(e.y)?e.y:u.top,width:ce(e.width)?e.width:u.width,height:ce(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,g=d.height,m=d.syncWithTicks,v=d.horizontalValues,x=d.verticalValues,y=Pke(),w=Oke();if(!ce(p)||p<=0||!ce(g)||g<=0||!ce(f)||f!==+f||!ce(h)||h!==+h)return null;var S=d.verticalCoordinatesGenerator||HNe,_=d.horizontalCoordinatesGenerator||qNe,j=d.horizontalPoints,k=d.verticalPoints;if((!j||!j.length)&&De(_)){var C=v&&v.length,E=_({yAxis:w?Gn(Gn({},w),{},{ticks:C?v:w.ticks}):void 0,width:l,height:c,offset:u},C?!0:m);Vi(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Xl(E),"]")),Array.isArray(E)&&(j=E)}if((!k||!k.length)&&De(S)){var A=x&&x.length,P=S({xAxis:y?Gn(Gn({},y),{},{ticks:A?x:y.ticks}):void 0,width:l,height:c,offset:u},A?!0:m);Vi(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Xl(P),"]")),Array.isArray(P)&&(k=P)}return I.createElement("g",{className:"recharts-cartesian-grid"},I.createElement(FNe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),I.createElement(BNe,yl({},d,{offset:u,horizontalPoints:j,xAxis:y,yAxis:w})),I.createElement(UNe,yl({},d,{offset:u,verticalPoints:k,xAxis:y,yAxis:w})),I.createElement(zNe,yl({},d,{horizontalPoints:j})),I.createElement(WNe,yl({},d,{verticalPoints:k})))}RB.displayName="CartesianGrid";var VNe=["type","layout","connectNulls","ref"],GNe=["key"];function hd(e){"@babel/helpers - typeof";return hd=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},hd(e)}function pI(e,t){if(e==null)return{};var n=KNe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KNe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bh(){return bh=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},bh.apply(this,arguments)}function mI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){Bi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pc(e){return JNe(e)||QNe(e)||XNe(e)||YNe()}function YNe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
739In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XNe(e,t){if(e){if(typeof e=="string")return iS(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 iS(e,t)}}function QNe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JNe(e){if(Array.isArray(e))return iS(e)}function iS(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 ZNe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gI(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,MB(r.key),r)}}function eCe(e,t,n){return t&&gI(e.prototype,t),n&&gI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tCe(e,t,n){return t=Vy(t),nCe(e,IB()?Reflect.construct(t,n||[],Vy(e).constructor):t.apply(e,n))}function nCe(e,t){if(t&&(hd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rCe(e)}function rCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IB=function(){return!!e})()}function Vy(e){return Vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vy(e)}function iCe(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&&aS(e,t)}function aS(e,t){return aS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},aS(e,t)}function Bi(e,t,n){return t=MB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MB(e){var t=aCe(e,"string");return hd(t)=="symbol"?t:t+""}function aCe(e,t){if(hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xm=function(e){function t(){var n;ZNe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=tCe(this,t,[].concat(i)),Bi(n,"state",{isAnimationFinished:!0,totalLength:0}),Bi(n,"generateSimpleStrokeDasharray",function(s,l){return"".concat(l,"px ").concat(s-l,"px")}),Bi(n,"getStrokeDasharray",function(s,l,c){var u=c.reduce(function(x,y){return x+y});if(!u)return n.generateSimpleStrokeDasharray(l,s);for(var d=Math.floor(s/u),f=s%u,h=l-s,p=[],g=0,m=0;g<c.length;m+=c[g],++g)if(m+c[g]>f){p=[].concat(Pc(c.slice(0,g)),[f-m]);break}var v=p.length%2===0?[0,h]:[h];return[].concat(Pc(t.repeat(c,d)),Pc(p),v).map(function(x){return"".concat(x,"px")}).join(", ")}),Bi(n,"id",Bo("recharts-line-")),Bi(n,"pathRef",function(s){n.mainCurve=s}),Bi(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Bi(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return iCe(t,e),eCe(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,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=dr(d,Jd);if(!f)return null;var h=function(m,v){return{x:m.x,y:m.y,value:m.value,errorVal:Ut(m.payload,v)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return I.createElement(Ke,p,f.map(function(g){return I.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(r,i,a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=Ne(this.props,!1),h=Ne(c,!0),p=u.map(function(m,v){var x=Lr(Lr(Lr({key:"dot-".concat(v),r:3},f),h),{},{index:v,cx:m.x,cy:m.y,value:m.value,dataKey:d,payload:m.payload,points:u});return t.renderDotItem(c,x)}),g={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return I.createElement(Ke,bh({className:"recharts-line-dots",key:"dots"},g),p)}},{key:"renderCurveStatically",value:function(r,i,a,s){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=pI(l,VNe),h=Lr(Lr(Lr({},Ne(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:r},s),{},{type:c,layout:u,connectNulls:d});return I.createElement(mo,bh({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var a=this,s=this.props,l=s.points,c=s.strokeDasharray,u=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,g=s.animateNewValues,m=s.width,v=s.height,x=this.state,y=x.prevPoints,w=x.totalLength;return I.createElement(bi,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var _=S.t;if(y){var j=y.length/l.length,k=l.map(function(T,B){var F=Math.floor(B*j);if(y[F]){var M=y[F],L=Yt(M.x,T.x),R=Yt(M.y,T.y);return Lr(Lr({},T),{},{x:L(_),y:R(_)})}if(g){var $=Yt(m*2,T.x),O=Yt(v/2,T.y);return Lr(Lr({},T),{},{x:$(_),y:O(_)})}return Lr(Lr({},T),{},{x:T.x,y:T.y})});return a.renderCurveStatically(k,r,i)}var C=Yt(0,w),E=C(_),A;if(c){var P="".concat(c).split(/[,\s]+/gim).map(function(T){return parseFloat(T)});A=a.getStrokeDasharray(E,w,P)}else A=a.generateSimpleStrokeDasharray(w,E);return a.renderCurveStatically(l,r,i,{strokeDasharray:A})})}},{key:"renderCurve",value:function(r,i){var a=this.props,s=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&s&&s.length&&(!u&&d>0||!No(u,s))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(s,r,i)}},{key:"render",value:function(){var r,i=this.props,a=i.hide,s=i.dot,l=i.points,c=i.className,u=i.xAxis,d=i.yAxis,f=i.top,h=i.left,p=i.width,g=i.height,m=i.isAnimationActive,v=i.id;if(a||!l||!l.length)return null;var x=this.state.isAnimationFinished,y=l.length===1,w=He("recharts-line",c),S=u&&u.allowDataOverflow,_=d&&d.allowDataOverflow,j=S||_,k=$e(v)?this.id:v,C=(r=Ne(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=C.r,A=E===void 0?3:E,P=C.strokeWidth,T=P===void 0?2:P,B=wL(s)?s:{},F=B.clipDot,M=F===void 0?!0:F,L=A*2+T;return I.createElement(Ke,{className:w},S||_?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(k)},I.createElement("rect",{x:S?h:h-p/2,y:_?f:f-g/2,width:S?p:p*2,height:_?g:g*2})),!M&&I.createElement("clipPath",{id:"clipPath-dots-".concat(k)},I.createElement("rect",{x:h-L/2,y:f-L/2,width:p+L,height:g+L}))):null,!y&&this.renderCurve(j,k),this.renderErrorBar(j,k),(y||s)&&this.renderDots(j,M,k),(!m||x)&&Gi.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var a=r.length%2!==0?[].concat(Pc(r),[0]):r,s=[],l=0;l<i;++l)s=[].concat(Pc(s),Pc(a));return s}},{key:"renderDotItem",value:function(r,i){var a;if(I.isValidElement(r))a=I.cloneElement(r,i);else if(De(r))a=r(i);else{var s=i.key,l=pI(i,GNe),c=He("recharts-line-dot",typeof r!="boolean"?r.className:"");a=I.createElement(ym,bh({key:s},l,{className:c}))}return a}}])}(b.PureComponent);Bi(xm,"displayName","Line");Bi(xm,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!mi.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Bi(xm,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,s=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(h,p){var g=Ut(h,s);return d==="horizontal"?{x:td({axis:n,ticks:i,bandSize:l,entry:h,index:p}),y:$e(g)?null:r.scale(g),value:g,payload:h}:{x:$e(g)?null:n.scale(g),y:td({axis:r,ticks:a,bandSize:l,entry:h,index:p}),value:g,payload:h}});return Lr({points:f,layout:d},u)});var sCe=["layout","type","stroke","connectNulls","isRange","ref"],oCe=["key"],$B;function pd(e){"@babel/helpers - typeof";return pd=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},pd(e)}function DB(e,t){if(e==null)return{};var n=lCe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lCe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function xl(){return xl=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},xl.apply(this,arguments)}function vI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Os(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vI(Object(n),!0).forEach(function(r){ya(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,FB(r.key),r)}}function uCe(e,t,n){return t&&yI(e.prototype,t),n&&yI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dCe(e,t,n){return t=Gy(t),fCe(e,LB()?Reflect.construct(t,n||[],Gy(e).constructor):t.apply(e,n))}function fCe(e,t){if(t&&(pd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hCe(e)}function hCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LB=function(){return!!e})()}function Gy(e){return Gy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gy(e)}function pCe(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&&sS(e,t)}function sS(e,t){return sS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},sS(e,t)}function ya(e,t,n){return t=FB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FB(e){var t=mCe(e,"string");return pd(t)=="symbol"?t:t+""}function mCe(e,t){if(pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fc=function(e){function t(){var n;cCe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=dCe(this,t,[].concat(i)),ya(n,"state",{isAnimationFinished:!0}),ya(n,"id",Bo("recharts-area-")),ya(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),De(s)&&s()}),ya(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),De(s)&&s()}),n}return pCe(t,e),uCe(t,[{key:"renderDots",value:function(r,i,a){var s=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(s&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,h=Ne(this.props,!1),p=Ne(u,!0),g=d.map(function(v,x){var y=Os(Os(Os({key:"dot-".concat(x),r:3},h),p),{},{index:x,cx:v.x,cy:v.y,dataKey:f,value:v.value,payload:v.payload,points:d});return t.renderDotItem(u,y)}),m={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return I.createElement(Ke,xl({className:"recharts-area-dots"},m),g)}},{key:"renderHorizontalRect",value:function(r){var i=this.props,a=i.baseLine,s=i.points,l=i.strokeWidth,c=s[0].x,u=s[s.length-1].x,d=r*Math.abs(c-u),f=Zs(s.map(function(h){return h.y||0}));return ce(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(Zs(a.map(function(h){return h.y||0})),f)),ce(f)?I.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var i=this.props,a=i.baseLine,s=i.points,l=i.strokeWidth,c=s[0].y,u=s[s.length-1].y,d=r*Math.abs(c-u),f=Zs(s.map(function(h){return h.x||0}));return ce(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(Zs(a.map(function(h){return h.x||0})),f)),ce(f)?I.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(r){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,i,a,s){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,h=l.isRange;l.ref;var p=DB(l,sCe);return I.createElement(Ke,{clipPath:a?"url(#clipPath-".concat(s,")"):null},I.createElement(mo,xl({},Ne(p,!0),{points:r,connectNulls:f,type:u,baseLine:i,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&I.createElement(mo,xl({},Ne(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:r})),d!=="none"&&h&&I.createElement(mo,xl({},Ne(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(r,i){var a=this,s=this.props,l=s.points,c=s.baseLine,u=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,g=this.state,m=g.prevPoints,v=g.prevBaseLine;return I.createElement(bi,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(x){var y=x.t;if(m){var w=m.length/l.length,S=l.map(function(C,E){var A=Math.floor(E*w);if(m[A]){var P=m[A],T=Yt(P.x,C.x),B=Yt(P.y,C.y);return Os(Os({},C),{},{x:T(y),y:B(y)})}return C}),_;if(ce(c)&&typeof c=="number"){var j=Yt(v,c);_=j(y)}else if($e(c)||qd(c)){var k=Yt(v,0);_=k(y)}else _=c.map(function(C,E){var A=Math.floor(E*w);if(v[A]){var P=v[A],T=Yt(P.x,C.x),B=Yt(P.y,C.y);return Os(Os({},C),{},{x:T(y),y:B(y)})}return C});return a.renderAreaStatically(S,_,r,i)}return I.createElement(Ke,null,I.createElement("defs",null,I.createElement("clipPath",{id:"animationClipPath-".concat(i)},a.renderClipRect(y))),I.createElement(Ke,{clipPath:"url(#animationClipPath-".concat(i,")")},a.renderAreaStatically(l,c,r,i)))})}},{key:"renderArea",value:function(r,i){var a=this.props,s=a.points,l=a.baseLine,c=a.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,h=u.totalLength;return c&&s&&s.length&&(!d&&h>0||!No(d,s)||!No(f,l))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,l,r,i)}},{key:"render",value:function(){var r,i=this.props,a=i.hide,s=i.dot,l=i.points,c=i.className,u=i.top,d=i.left,f=i.xAxis,h=i.yAxis,p=i.width,g=i.height,m=i.isAnimationActive,v=i.id;if(a||!l||!l.length)return null;var x=this.state.isAnimationFinished,y=l.length===1,w=He("recharts-area",c),S=f&&f.allowDataOverflow,_=h&&h.allowDataOverflow,j=S||_,k=$e(v)?this.id:v,C=(r=Ne(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=C.r,A=E===void 0?3:E,P=C.strokeWidth,T=P===void 0?2:P,B=wL(s)?s:{},F=B.clipDot,M=F===void 0?!0:F,L=A*2+T;return I.createElement(Ke,{className:w},S||_?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(k)},I.createElement("rect",{x:S?d:d-p/2,y:_?u:u-g/2,width:S?p:p*2,height:_?g:g*2})),!M&&I.createElement("clipPath",{id:"clipPath-dots-".concat(k)},I.createElement("rect",{x:d-L/2,y:u-L/2,width:p+L,height:g+L}))):null,y?null:this.renderArea(j,k),(s||y)&&this.renderDots(j,M,k),(!m||x)&&Gi.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(b.PureComponent);$B=fc;ya(fc,"displayName","Area");ya(fc,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!mi.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});ya(fc,"getBaseValue",function(e,t,n,r){var i=e.layout,a=e.baseValue,s=t.props.baseValue,l=s??a;if(ce(l)&&typeof l=="number")return l;var c=i==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f: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]});ya(fc,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,a=e.xAxisTicks,s=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=t.layout,g=u&&u.length,m=$B.getBaseValue(t,n,r,i),v=p==="horizontal",x=!1,y=f.map(function(S,_){var j;g?j=u[d+_]:(j=Ut(S,c),Array.isArray(j)?x=!0:j=[m,j]);var k=j[1]==null||g&&Ut(S,c)==null;return v?{x:td({axis:r,ticks:a,bandSize:l,entry:S,index:_}),y:k?null:i.scale(j[1]),value:j,payload:S}:{x:k?null:r.scale(j[1]),y:td({axis:i,ticks:s,bandSize:l,entry:S,index:_}),value:j,payload:S}}),w;return g||x?w=y.map(function(S){var _=Array.isArray(S.value)?S.value[0]:null;return v?{x:S.x,y:_!=null&&S.y!=null?i.scale(_):null}:{x:_!=null?r.scale(_):null,y:S.y}}):w=v?i.scale(m):r.scale(m),Os({points:y,baseLine:w,layout:p,isRange:x},h)});ya(fc,"renderDotItem",function(e,t){var n;if(I.isValidElement(e))n=I.cloneElement(e,t);else if(De(e))n=e(t);else{var r=He("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=DB(t,oCe);n=I.createElement(ym,xl({},a,{key:i,className:r}))}return n});function md(e){"@babel/helpers - typeof";return md=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},md(e)}function gCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vCe(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,zB(r.key),r)}}function yCe(e,t,n){return t&&vCe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xCe(e,t,n){return t=Ky(t),bCe(e,BB()?Reflect.construct(t,n||[],Ky(e).constructor):t.apply(e,n))}function bCe(e,t){if(t&&(md(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wCe(e)}function wCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BB=function(){return!!e})()}function Ky(e){return Ky=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ky(e)}function _Ce(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&&oS(e,t)}function oS(e,t){return oS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},oS(e,t)}function UB(e,t,n){return t=zB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zB(e){var t=jCe(e,"string");return md(t)=="symbol"?t:t+""}function jCe(e,t){if(md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bb=function(e){function t(){return gCe(this,t),xCe(this,t,arguments)}return _Ce(t,e),yCe(t,[{key:"render",value:function(){return null}}])}(b.Component);UB(Bb,"displayName","ZAxis");UB(Bb,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var SCe=["option","isActive"];function wh(){return wh=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},wh.apply(this,arguments)}function kCe(e,t){if(e==null)return{};var n=NCe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function NCe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function CCe(e){var t=e.option,n=e.isActive,r=kCe(e,SCe);return typeof t=="string"?b.createElement(Iy,wh({option:b.createElement(mb,wh({type:t},r)),isActive:n,shapeType:"symbols"},r)):b.createElement(Iy,wh({option:t,isActive:n,shapeType:"symbols"},r))}function gd(e){"@babel/helpers - typeof";return gd=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},gd(e)}function _h(){return _h=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},_h.apply(this,arguments)}function xI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(n),!0).forEach(function(r){to(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ECe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bI(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,HB(r.key),r)}}function PCe(e,t,n){return t&&bI(e.prototype,t),n&&bI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OCe(e,t,n){return t=Yy(t),ACe(e,WB()?Reflect.construct(t,n||[],Yy(e).constructor):t.apply(e,n))}function ACe(e,t){if(t&&(gd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TCe(e)}function TCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WB=function(){return!!e})()}function Yy(e){return Yy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yy(e)}function RCe(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&&lS(e,t)}function lS(e,t){return lS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},lS(e,t)}function to(e,t,n){return t=HB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HB(e){var t=ICe(e,"string");return gd(t)=="symbol"?t:t+""}function ICe(e,t){if(gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ub=function(e){function t(){var n;ECe(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=OCe(this,t,[].concat(i)),to(n,"state",{isAnimationFinished:!1}),to(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),to(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),to(n,"id",Bo("recharts-scatter-")),n}return RCe(t,e),PCe(t,[{key:"renderSymbolsStatically",value:function(r){var i=this,a=this.props,s=a.shape,l=a.activeShape,c=a.activeIndex,u=Ne(this.props,!1);return r.map(function(d,f){var h=c===f,p=h?l:s,g=ii(ii({},u),d);return I.createElement(Ke,_h({className:"recharts-scatter-symbol",key:"symbol-".concat(d==null?void 0:d.cx,"-").concat(d==null?void 0:d.cy,"-").concat(d==null?void 0:d.size,"-").concat(f)},ko(i.props,d,f),{role:"img"}),I.createElement(CCe,_h({option:p,isActive:h,key:"symbol-".concat(f)},g)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,i=this.props,a=i.points,s=i.isAnimationActive,l=i.animationBegin,c=i.animationDuration,u=i.animationEasing,d=i.animationId,f=this.state.prevPoints;return I.createElement(bi,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var p=h.t,g=a.map(function(m,v){var x=f&&f[v];if(x){var y=Yt(x.cx,m.cx),w=Yt(x.cy,m.cy),S=Yt(x.size,m.size);return ii(ii({},m),{},{cx:y(p),cy:w(p),size:S(p)})}var _=Yt(0,m.size);return ii(ii({},m),{},{size:_(p)})});return I.createElement(Ke,null,r.renderSymbolsStatically(g))})}},{key:"renderSymbols",value:function(){var r=this.props,i=r.points,a=r.isAnimationActive,s=this.state.prevPoints;return a&&i&&i.length&&(!s||!No(s,i))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(i)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var i=this.props,a=i.points,s=i.xAxis,l=i.yAxis,c=i.children,u=dr(c,Jd);return u?u.map(function(d,f){var h=d.props,p=h.direction,g=h.dataKey;return I.cloneElement(d,{key:"".concat(p,"-").concat(g,"-").concat(a[f]),data:a,xAxis:s,yAxis:l,layout:p==="x"?"vertical":"horizontal",dataPointFormatter:function(v,x){return{x:v.cx,y:v.cy,value:p==="x"?+v.node.x:+v.node.y,errorVal:Ut(v,x)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,i=r.points,a=r.line,s=r.lineType,l=r.lineJointType,c=Ne(this.props,!1),u=Ne(a,!1),d,f;if(s==="joint")d=i.map(function(w){return{x:w.cx,y:w.cy}});else if(s==="fitting"){var h=yae(i),p=h.xmin,g=h.xmax,m=h.a,v=h.b,x=function(S){return m*S+v};d=[{x:p,y:x(p)},{x:g,y:x(g)}]}var y=ii(ii(ii({},c),{},{fill:"none",stroke:c&&c.fill},u),{},{points:d});return I.isValidElement(a)?f=I.cloneElement(a,y):De(a)?f=a(y):f=I.createElement(mo,_h({},y,{type:l})),I.createElement(Ke,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var r=this.props,i=r.hide,a=r.points,s=r.line,l=r.className,c=r.xAxis,u=r.yAxis,d=r.left,f=r.top,h=r.width,p=r.height,g=r.id,m=r.isAnimationActive;if(i||!a||!a.length)return null;var v=this.state.isAnimationFinished,x=He("recharts-scatter",l),y=c&&c.allowDataOverflow,w=u&&u.allowDataOverflow,S=y||w,_=$e(g)?this.id:g;return I.createElement(Ke,{className:x,clipPath:S?"url(#clipPath-".concat(_,")"):null},y||w?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(_)},I.createElement("rect",{x:y?d:d-h/2,y:w?f:f-p/2,width:y?h:h*2,height:w?p:p*2}))):null,s&&this.renderLine(),this.renderErrorBar(),I.createElement(Ke,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!m||v)&&Gi.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}}])}(b.PureComponent);to(Ub,"displayName","Scatter");to(Ub,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!mi.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});to(Ub,"getComposedData",function(e){var t=e.xAxis,n=e.yAxis,r=e.zAxis,i=e.item,a=e.displayedData,s=e.xAxisTicks,l=e.yAxisTicks,c=e.offset,u=i.props.tooltipType,d=dr(i.props.children,hm),f=$e(t.dataKey)?i.props.dataKey:t.dataKey,h=$e(n.dataKey)?i.props.dataKey:n.dataKey,p=r&&r.dataKey,g=r?r.range:Bb.defaultProps.range,m=g&&g[0],v=t.scale.bandwidth?t.scale.bandwidth():0,x=n.scale.bandwidth?n.scale.bandwidth():0,y=a.map(function(w,S){var _=Ut(w,f),j=Ut(w,h),k=!$e(p)&&Ut(w,p)||"-",C=[{name:$e(t.dataKey)?i.props.name:t.name||t.dataKey,unit:t.unit||"",value:_,payload:w,dataKey:f,type:u},{name:$e(n.dataKey)?i.props.name:n.name||n.dataKey,unit:n.unit||"",value:j,payload:w,dataKey:h,type:u}];k!=="-"&&C.push({name:r.name||r.dataKey,unit:r.unit||"",value:k,payload:w,dataKey:p,type:u});var E=td({axis:t,ticks:s,bandSize:v,entry:w,index:S,dataKey:f}),A=td({axis:n,ticks:l,bandSize:x,entry:w,index:S,dataKey:h}),P=k!=="-"?r.scale(k):m,T=Math.sqrt(Math.max(P,0)/Math.PI);return ii(ii({},w),{},{cx:E,cy:A,x:E-T,y:A-T,xAxis:t,yAxis:n,zAxis:r,width:2*T,height:2*T,size:P,node:{x:_,y:j,z:k},tooltipPayload:C,tooltipPosition:{x:E,y:A},payload:w},d&&d[S]&&d[S].props)});return ii({points:y},c)});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 MCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $Ce(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,GB(r.key),r)}}function DCe(e,t,n){return t&&$Ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LCe(e,t,n){return t=Xy(t),FCe(e,qB()?Reflect.construct(t,n||[],Xy(e).constructor):t.apply(e,n))}function FCe(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 BCe(e)}function BCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qB=function(){return!!e})()}function Xy(e){return Xy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xy(e)}function UCe(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&&cS(e,t)}function cS(e,t){return cS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},cS(e,t)}function VB(e,t,n){return t=GB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GB(e){var t=zCe(e,"string");return vd(t)=="symbol"?t:t+""}function zCe(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)}function uS(){return uS=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},uS.apply(this,arguments)}function WCe(e){var t=e.xAxisId,n=NC(),r=CC(),i=wB(t);return i==null?null:b.createElement(Zd,uS({},i,{className:He("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(s){return Ya(s,!0)}}))}var zb=function(e){function t(){return MCe(this,t),LCe(this,t,arguments)}return UCe(t,e),DCe(t,[{key:"render",value:function(){return b.createElement(WCe,this.props)}}])}(b.Component);VB(zb,"displayName","XAxis");VB(zb,"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 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)}function HCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qCe(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,XB(r.key),r)}}function VCe(e,t,n){return t&&qCe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function GCe(e,t,n){return t=Qy(t),KCe(e,KB()?Reflect.construct(t,n||[],Qy(e).constructor):t.apply(e,n))}function KCe(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 YCe(e)}function YCe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KB=function(){return!!e})()}function Qy(e){return Qy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qy(e)}function XCe(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&&dS(e,t)}function dS(e,t){return dS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dS(e,t)}function YB(e,t,n){return t=XB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XB(e){var t=QCe(e,"string");return yd(t)=="symbol"?t:t+""}function QCe(e,t){if(yd(e)!="object"||!e)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 fS(){return fS=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},fS.apply(this,arguments)}var JCe=function(t){var n=t.yAxisId,r=NC(),i=CC(),a=_B(n);return a==null?null:b.createElement(Zd,fS({},a,{className:He("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(l){return Ya(l,!0)}}))},Dp=function(e){function t(){return HCe(this,t),GCe(this,t,arguments)}return XCe(t,e),VCe(t,[{key:"render",value:function(){return b.createElement(JCe,this.props)}}])}(b.Component);YB(Dp,"displayName","YAxis");YB(Dp,"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 wI(e){return nEe(e)||tEe(e)||eEe(e)||ZCe()}function ZCe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
740In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eEe(e,t){if(e){if(typeof e=="string")return hS(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 hS(e,t)}}function tEe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nEe(e){if(Array.isArray(e))return hS(e)}function hS(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 pS=function(t,n,r,i,a){var s=dr(t,PC),l=dr(t,Db),c=[].concat(wI(s),wI(l)),u=dr(t,Fb),d="".concat(i,"Id"),f=i[0],h=n;if(c.length&&(h=c.reduce(function(m,v){if(v.props[d]===r&&ka(v.props,"extendDomain")&&ce(v.props[f])){var x=v.props[f];return[Math.min(m[0],x),Math.max(m[1],x)]}return m},h)),u.length){var p="".concat(f,"1"),g="".concat(f,"2");h=u.reduce(function(m,v){if(v.props[d]===r&&ka(v.props,"extendDomain")&&ce(v.props[p])&&ce(v.props[g])){var x=v.props[p],y=v.props[g];return[Math.min(m[0],x,y),Math.max(m[1],x,y)]}return m},h)}return a&&a.length&&(h=a.reduce(function(m,v){return ce(v)?[Math.min(m[0],v),Math.max(m[1],v)]:m},h)),h},QB={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new i(d,f||c,h),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function s(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,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,g=new Array(p);h<p;h++)g[h]=f[h].fn;return g},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,g){var m=n?n+u:u;if(!this._events[m])return!1;var v=this._events[m],x=arguments.length,y,w;if(v.fn){switch(v.once&&this.removeListener(u,v.fn,void 0,!0),x){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,h),!0;case 5:return v.fn.call(v.context,d,f,h,p),!0;case 6:return v.fn.call(v.context,d,f,h,p,g),!0}for(w=1,y=new Array(x-1);w<x;w++)y[w-1]=arguments[w];v.fn.apply(v.context,y)}else{var S=v.length,_;for(w=0;w<S;w++)switch(v[w].once&&this.removeListener(u,v[w].fn,void 0,!0),x){case 1:v[w].fn.call(v[w].context);break;case 2:v[w].fn.call(v[w].context,d);break;case 3:v[w].fn.call(v[w].context,d,f);break;case 4:v[w].fn.call(v[w].context,d,f,h);break;default:if(!y)for(_=1,y=new Array(x-1);_<x;_++)y[_-1]=arguments[_];v[w].fn.apply(v[w].context,y)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=n?n+u:u;if(!this._events[p])return this;if(!d)return s(this,p),this;var g=this._events[p];if(g.fn)g.fn===d&&(!h||g.once)&&(!f||g.context===f)&&s(this,p);else{for(var m=0,v=[],x=g.length;m<x;m++)(g[m].fn!==d||h&&!g[m].once||f&&g[m].context!==f)&&v.push(g[m]);v.length?this._events[p]=v.length===1?v[0]:v:s(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&s(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})(QB);var rEe=QB.exports;const iEe=ct(rEe);var Tw=new iEe,Rw="recharts.syncMouseEvents";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 aEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sEe(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,JB(r.key),r)}}function oEe(e,t,n){return t&&sEe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Iw(e,t,n){return t=JB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JB(e){var t=lEe(e,"string");return Lp(t)=="symbol"?t:t+""}function lEe(e,t){if(Lp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Lp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cEe=function(){function e(){aEe(this,e),Iw(this,"activeIndex",0),Iw(this,"coordinateList",[]),Iw(this,"layout","horizontal")}return oEe(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,a=i===void 0?null:i,s=n.container,l=s===void 0?null:s,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,h=n.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(r=a??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,s=i.y,l=i.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,f=a+c+u,h=s+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function uEe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&ce(r)&&ce(i))return!0}return!1}function dEe(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function ZB(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,s=It(t,n,r,i),l=It(t,n,r,a);return{points:[s,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function fEe(e,t,n){var r,i,a,s;if(e==="horizontal")r=t.x,a=r,i=n.top,s=n.top+n.height;else if(e==="vertical")i=t.y,s=i,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,f=t.angle,h=It(l,c,u,f),p=It(l,c,d,f);r=h.x,i=h.y,a=p.x,s=p.y}else return ZB(t);return[{x:r,y:i},{x:a,y:s}]}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 _I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ag(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_I(Object(n),!0).forEach(function(r){hEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hEe(e,t,n){return t=pEe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pEe(e){var t=mEe(e,"string");return Fp(t)=="symbol"?t:t+""}function mEe(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)}function gEe(e){var t,n,r=e.element,i=e.tooltipEventType,a=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!p||!a||!s||h!=="ScatterChart"&&i!=="axis")return null;var g,m=mo;if(h==="ScatterChart")g=s,m=i_e;else if(h==="BarChart")g=dEe(f,s,c,d),m=_C;else if(f==="radial"){var v=ZB(s),x=v.cx,y=v.cy,w=v.radius,S=v.startAngle,_=v.endAngle;g={cx:x,cy:y,startAngle:S,endAngle:_,innerRadius:w,outerRadius:w},m=U6}else g={points:fEe(f,s,c)},m=mo;var j=Ag(Ag(Ag(Ag({stroke:"#ccc",pointerEvents:"none"},c),g),Ne(p,!1)),{},{payload:l,payloadIndex:u,className:He("recharts-tooltip-cursor",p.className)});return b.isValidElement(p)?b.cloneElement(p,j):b.createElement(m,j)}var vEe=["item"],yEe=["children","className","width","height","style","compact","title","desc"];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 nu(){return nu=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},nu.apply(this,arguments)}function jI(e,t){return wEe(e)||bEe(e,t)||t8(e,t)||xEe()}function xEe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
741In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bEe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,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,i=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function wEe(e){if(Array.isArray(e))return e}function SI(e,t){if(e==null)return{};var n=_Ee(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Ee(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jEe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SEe(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,n8(r.key),r)}}function kEe(e,t,n){return t&&SEe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function NEe(e,t,n){return t=Jy(t),CEe(e,e8()?Reflect.construct(t,n||[],Jy(e).constructor):t.apply(e,n))}function CEe(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 EEe(e)}function EEe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e8(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(e8=function(){return!!e})()}function Jy(e){return Jy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jy(e)}function PEe(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&&mS(e,t)}function mS(e,t){return mS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},mS(e,t)}function bd(e){return TEe(e)||AEe(e)||t8(e)||OEe()}function OEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
742In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t8(e,t){if(e){if(typeof e=="string")return gS(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 gS(e,t)}}function AEe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TEe(e){if(Array.isArray(e))return gS(e)}function gS(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 kI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(n),!0).forEach(function(r){Le(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Le(e,t,n){return t=n8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n8(e){var t=REe(e,"string");return xd(t)=="symbol"?t:t+""}function REe(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 IEe={xAxis:["bottom","top"],yAxis:["left","right"]},MEe={width:"100%",height:"100%"},r8={x:0,y:0};function Tg(e){return e}var $Ee=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},DEe=function(t,n,r,i){var a=n.find(function(d){return d&&d.index===r});if(a){if(t==="horizontal")return{x:a.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:a.coordinate};if(t==="centric"){var s=a.coordinate,l=i.radius;return te(te(te({},i),It(i.cx,i.cy,l,s)),{},{angle:s,radius:l})}var c=a.coordinate,u=i.angle;return te(te(te({},i),It(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return r8},Wb=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,a=n.dataEndIndex,s=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(bd(l),bd(u)):l},[]);return s.length>0?s:t&&t.length&&ce(i)&&ce(a)?t.slice(i,a+1):[]};function i8(e){return e==="number"?[0,"auto"]:void 0}var vS=function(t,n,r,i){var a=t.graphicalItems,s=t.tooltipAxis,l=Wb(n,t);return r<0||!a||!a.length||r>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var p=f===void 0?l:f;h=Yv(p,s.dataKey,i)}else h=f&&f[r]||l[r];return h?[].concat(bd(c),[M6(u,h)]):c},[])},NI=function(t,n,r,i){var a=i||{x:t.chartX,y:t.chartY},s=$Ee(a,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=Ebe(s,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=vS(t,n,d,f),p=DEe(r,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},LEe=function(t,n){var r=n.axes,i=n.graphicalItems,a=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=P6(d,a);return r.reduce(function(g,m){var v,x=m.type.defaultProps!==void 0?te(te({},m.type.defaultProps),m.props):m.props,y=x.type,w=x.dataKey,S=x.allowDataOverflow,_=x.allowDuplicatedCategory,j=x.scale,k=x.ticks,C=x.includeHidden,E=x[s];if(g[E])return g;var A=Wb(t.data,{graphicalItems:i.filter(function(V){var D,K=s in V.props?V.props[s]:(D=V.type.defaultProps)===null||D===void 0?void 0:D[s];return K===E}),dataStartIndex:c,dataEndIndex:u}),P=A.length,T,B,F;uEe(x.domain,S,y)&&(T=Ej(x.domain,null,S),p&&(y==="number"||j!=="auto")&&(F=gh(A,w,"category")));var M=i8(y);if(!T||T.length===0){var L,R=(L=x.domain)!==null&&L!==void 0?L:M;if(w){if(T=gh(A,w,y),y==="category"&&p){var $=vae(T);_&&$?(B=T,T=$y(0,P)):_||(T=HT(R,T,m).reduce(function(V,D){return V.indexOf(D)>=0?V:[].concat(bd(V),[D])},[]))}else if(y==="category")_?T=T.filter(function(V){return V!==""&&!$e(V)}):T=HT(R,T,m).reduce(function(V,D){return V.indexOf(D)>=0||D===""||$e(D)?V:[].concat(bd(V),[D])},[]);else if(y==="number"){var O=Rbe(A,i.filter(function(V){var D,K,ae=s in V.props?V.props[s]:(D=V.type.defaultProps)===null||D===void 0?void 0:D[s],se="hide"in V.props?V.props.hide:(K=V.type.defaultProps)===null||K===void 0?void 0:K.hide;return ae===E&&(C||!se)}),w,a,d);O&&(T=O)}p&&(y==="number"||j!=="auto")&&(F=gh(A,w,"category"))}else p?T=$y(0,P):l&&l[E]&&l[E].hasStack&&y==="number"?T=h==="expand"?[0,1]:I6(l[E].stackGroups,c,u):T=E6(A,i.filter(function(V){var D=s in V.props?V.props[s]:V.type.defaultProps[s],K="hide"in V.props?V.props.hide:V.type.defaultProps.hide;return D===E&&(C||!K)}),y,d,!0);if(y==="number")T=pS(f,T,E,a,k),R&&(T=Ej(R,T,S));else if(y==="category"&&R){var N=R,H=T.every(function(V){return N.indexOf(V)>=0});H&&(T=N)}}return te(te({},g),{},Le({},E,te(te({},x),{},{axisType:a,domain:T,categoricalDomain:F,duplicateDomain:B,originalDomain:(v=x.domain)!==null&&v!==void 0?v:M,isCategorical:p,layout:d})))},{})},FEe=function(t,n){var r=n.graphicalItems,i=n.Axis,a=n.axisType,s=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=Wb(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=P6(d,a),m=-1;return r.reduce(function(v,x){var y=x.type.defaultProps!==void 0?te(te({},x.type.defaultProps),x.props):x.props,w=y[s],S=i8("number");if(!v[w]){m++;var _;return g?_=$y(0,p):l&&l[w]&&l[w].hasStack?(_=I6(l[w].stackGroups,c,u),_=pS(f,_,w,a)):(_=Ej(S,E6(h,r.filter(function(j){var k,C,E=s in j.props?j.props[s]:(k=j.type.defaultProps)===null||k===void 0?void 0:k[s],A="hide"in j.props?j.props.hide:(C=j.type.defaultProps)===null||C===void 0?void 0:C.hide;return E===w&&!A}),"number",d),i.defaultProps.allowDataOverflow),_=pS(f,_,w,a)),te(te({},v),{},Le({},w,te(te({axisType:a},i.defaultProps),{},{hide:!0,orientation:Xr(IEe,"".concat(a,".").concat(m%2),null),domain:_,originalDomain:S,isCategorical:g,layout:d})))}return v},{})},BEe=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,a=n.AxisComp,s=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(i,"Id"),h=dr(d,a),p={};return h&&h.length?p=LEe(t,{axes:h,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(p=FEe(t,{Axis:a,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},UEe=function(t){var n=Ls(t),r=Ya(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:YN(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:jy(n,r)}},CI=function(t){var n=t.children,r=t.defaultShowTooltip,i=zr(n,od),a=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},zEe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ja(n&&n.type);return r&&r.indexOf("Bar")>=0})},EI=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"}},WEe=function(t,n){var r=t.props,i=t.graphicalItems,a=t.xAxisMap,s=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},p=zr(f,od),g=zr(f,ho),m=Object.keys(c).reduce(function(_,j){var k=c[j],C=k.orientation;return!k.mirror&&!k.hide?te(te({},_),{},Le({},C,_[C]+k.width)):_},{left:h.left||0,right:h.right||0}),v=Object.keys(s).reduce(function(_,j){var k=s[j],C=k.orientation;return!k.mirror&&!k.hide?te(te({},_),{},Le({},C,Xr(_,"".concat(C))+k.height)):_},{top:h.top||0,bottom:h.bottom||0}),x=te(te({},v),m),y=x.bottom;p&&(x.bottom+=p.props.height||od.defaultProps.height),g&&n&&(x=Abe(x,i,r,n));var w=u-x.left-x.right,S=d-x.top-x.bottom;return te(te({brushBottom:y},x),{},{width:Math.max(w,0),height:Math.max(S,0)})},HEe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},a8=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(x,y){var w=y.graphicalItems,S=y.stackGroups,_=y.offset,j=y.updateId,k=y.dataStartIndex,C=y.dataEndIndex,E=x.barSize,A=x.layout,P=x.barGap,T=x.barCategoryGap,B=x.maxBarSize,F=EI(A),M=F.numericAxisName,L=F.cateAxisName,R=zEe(w),$=[];return w.forEach(function(O,N){var H=Wb(x.data,{graphicalItems:[O],dataStartIndex:k,dataEndIndex:C}),V=O.type.defaultProps!==void 0?te(te({},O.type.defaultProps),O.props):O.props,D=V.dataKey,K=V.maxBarSize,ae=V["".concat(M,"Id")],se=V["".concat(L,"Id")],Q={},ne=c.reduce(function(Wt,Sn){var mt=y["".concat(Sn.axisType,"Map")],Ee=V["".concat(Sn.axisType,"Id")];mt&&mt[Ee]||Sn.axisType==="zAxis"||Yl();var Gt=mt[Ee];return te(te({},Wt),{},Le(Le({},Sn.axisType,Gt),"".concat(Sn.axisType,"Ticks"),Ya(Gt)))},Q),Z=ne[L],W=ne["".concat(L,"Ticks")],ee=S&&S[ae]&&S[ae].hasStack&&zbe(O,S[ae].stackGroups),q=Ja(O.type).indexOf("Bar")>=0,re=jy(Z,W),ge=[],Ie=R&&Pbe({barSize:E,stackGroups:S,totalSize:HEe(ne,L)});if(q){var ye,qe,jt=$e(K)?B:K,pt=(ye=(qe=jy(Z,W,!0))!==null&&qe!==void 0?qe:jt)!==null&&ye!==void 0?ye:0;ge=Obe({barGap:P,barCategoryGap:T,bandSize:pt!==re?pt:re,sizeList:Ie[se],maxBarSize:jt}),pt!==re&&(ge=ge.map(function(Wt){return te(te({},Wt),{},{position:te(te({},Wt.position),{},{offset:Wt.position.offset-pt/2})})}))}var rn=O&&O.type&&O.type.getComposedData;rn&&$.push({props:te(te({},rn(te(te({},ne),{},{displayedData:H,props:x,dataKey:D,item:O,bandSize:re,barPosition:ge,offset:_,stackedData:ee,layout:A,dataStartIndex:k,dataEndIndex:C}))),{},Le(Le(Le({key:O.key||"item-".concat(N)},M,ne[M]),L,ne[L]),"animationId",j)),childIndex:Oae(O,x.children),item:O})}),$},p=function(x,y){var w=x.props,S=x.dataStartIndex,_=x.dataEndIndex,j=x.updateId;if(!LO({props:w}))return null;var k=w.children,C=w.layout,E=w.stackOffset,A=w.data,P=w.reverseStackOrder,T=EI(C),B=T.numericAxisName,F=T.cateAxisName,M=dr(k,r),L=Bbe(A,M,"".concat(B,"Id"),"".concat(F,"Id"),E,P),R=c.reduce(function(V,D){var K="".concat(D.axisType,"Map");return te(te({},V),{},Le({},K,BEe(w,te(te({},D),{},{graphicalItems:M,stackGroups:D.axisType===B&&L,dataStartIndex:S,dataEndIndex:_}))))},{}),$=WEe(te(te({},R),{},{props:w,graphicalItems:M}),y==null?void 0:y.legendBBox);Object.keys(R).forEach(function(V){R[V]=d(w,R[V],$,V.replace("Map",""),n)});var O=R["".concat(F,"Map")],N=UEe(O),H=h(w,te(te({},R),{},{dataStartIndex:S,dataEndIndex:_,updateId:j,graphicalItems:M,stackGroups:L,offset:$}));return te(te({formattedGraphicalItems:H,graphicalItems:M,offset:$,stackGroups:L},N),R)},g=function(v){function x(y){var w,S,_;return jEe(this,x),_=NEe(this,x,[y]),Le(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Le(_,"accessibilityManager",new cEe),Le(_,"handleLegendBBoxUpdate",function(j){if(j){var k=_.state,C=k.dataStartIndex,E=k.dataEndIndex,A=k.updateId;_.setState(te({legendBBox:j},p({props:_.props,dataStartIndex:C,dataEndIndex:E,updateId:A},te(te({},_.state),{},{legendBBox:j}))))}}),Le(_,"handleReceiveSyncEvent",function(j,k,C){if(_.props.syncId===j){if(C===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(k)}}),Le(_,"handleBrushChange",function(j){var k=j.startIndex,C=j.endIndex;if(k!==_.state.dataStartIndex||C!==_.state.dataEndIndex){var E=_.state.updateId;_.setState(function(){return te({dataStartIndex:k,dataEndIndex:C},p({props:_.props,dataStartIndex:k,dataEndIndex:C,updateId:E},_.state))}),_.triggerSyncEvent({dataStartIndex:k,dataEndIndex:C})}}),Le(_,"handleMouseEnter",function(j){var k=_.getMouseInfo(j);if(k){var C=te(te({},k),{},{isTooltipActive:!0});_.setState(C),_.triggerSyncEvent(C);var E=_.props.onMouseEnter;De(E)&&E(C,j)}}),Le(_,"triggeredAfterMouseMove",function(j){var k=_.getMouseInfo(j),C=k?te(te({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(C),_.triggerSyncEvent(C);var E=_.props.onMouseMove;De(E)&&E(C,j)}),Le(_,"handleItemMouseEnter",function(j){_.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),Le(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),Le(_,"handleMouseMove",function(j){j.persist(),_.throttleTriggeredAfterMouseMove(j)}),Le(_,"handleMouseLeave",function(j){_.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};_.setState(k),_.triggerSyncEvent(k);var C=_.props.onMouseLeave;De(C)&&C(k,j)}),Le(_,"handleOuterEvent",function(j){var k=Pae(j),C=Xr(_.props,"".concat(k));if(k&&De(C)){var E,A;/.*touch.*/i.test(k)?A=_.getMouseInfo(j.changedTouches[0]):A=_.getMouseInfo(j),C((E=A)!==null&&E!==void 0?E:{},j)}}),Le(_,"handleClick",function(j){var k=_.getMouseInfo(j);if(k){var C=te(te({},k),{},{isTooltipActive:!0});_.setState(C),_.triggerSyncEvent(C);var E=_.props.onClick;De(E)&&E(C,j)}}),Le(_,"handleMouseDown",function(j){var k=_.props.onMouseDown;if(De(k)){var C=_.getMouseInfo(j);k(C,j)}}),Le(_,"handleMouseUp",function(j){var k=_.props.onMouseUp;if(De(k)){var C=_.getMouseInfo(j);k(C,j)}}),Le(_,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),Le(_,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&_.handleMouseDown(j.changedTouches[0])}),Le(_,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&_.handleMouseUp(j.changedTouches[0])}),Le(_,"handleDoubleClick",function(j){var k=_.props.onDoubleClick;if(De(k)){var C=_.getMouseInfo(j);k(C,j)}}),Le(_,"handleContextMenu",function(j){var k=_.props.onContextMenu;if(De(k)){var C=_.getMouseInfo(j);k(C,j)}}),Le(_,"triggerSyncEvent",function(j){_.props.syncId!==void 0&&Tw.emit(Rw,_.props.syncId,j,_.eventEmitterSymbol)}),Le(_,"applySyncEvent",function(j){var k=_.props,C=k.layout,E=k.syncMethod,A=_.state.updateId,P=j.dataStartIndex,T=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)_.setState(te({dataStartIndex:P,dataEndIndex:T},p({props:_.props,dataStartIndex:P,dataEndIndex:T,updateId:A},_.state)));else if(j.activeTooltipIndex!==void 0){var B=j.chartX,F=j.chartY,M=j.activeTooltipIndex,L=_.state,R=L.offset,$=L.tooltipTicks;if(!R)return;if(typeof E=="function")M=E($,j);else if(E==="value"){M=-1;for(var O=0;O<$.length;O++)if($[O].value===j.activeLabel){M=O;break}}var N=te(te({},R),{},{x:R.left,y:R.top}),H=Math.min(B,N.x+N.width),V=Math.min(F,N.y+N.height),D=$[M]&&$[M].value,K=vS(_.state,_.props.data,M),ae=$[M]?{x:C==="horizontal"?$[M].coordinate:H,y:C==="horizontal"?V:$[M].coordinate}:r8;_.setState(te(te({},j),{},{activeLabel:D,activeCoordinate:ae,activePayload:K,activeTooltipIndex:M}))}else _.setState(j)}),Le(_,"renderCursor",function(j){var k,C=_.state,E=C.isTooltipActive,A=C.activeCoordinate,P=C.activePayload,T=C.offset,B=C.activeTooltipIndex,F=C.tooltipAxisBandSize,M=_.getTooltipEventType(),L=(k=j.props.active)!==null&&k!==void 0?k:E,R=_.props.layout,$=j.key||"_recharts-cursor";return I.createElement(gEe,{key:$,activeCoordinate:A,activePayload:P,activeTooltipIndex:B,chartName:n,element:j,isActive:L,layout:R,offset:T,tooltipAxisBandSize:F,tooltipEventType:M})}),Le(_,"renderPolarAxis",function(j,k,C){var E=Xr(j,"type.axisType"),A=Xr(_.state,"".concat(E,"Map")),P=j.type.defaultProps,T=P!==void 0?te(te({},P),j.props):j.props,B=A&&A[T["".concat(E,"Id")]];return b.cloneElement(j,te(te({},B),{},{className:He(E,B.className),key:j.key||"".concat(k,"-").concat(C),ticks:Ya(B,!0)}))}),Le(_,"renderPolarGrid",function(j){var k=j.props,C=k.radialLines,E=k.polarAngles,A=k.polarRadius,P=_.state,T=P.radiusAxisMap,B=P.angleAxisMap,F=Ls(T),M=Ls(B),L=M.cx,R=M.cy,$=M.innerRadius,O=M.outerRadius;return b.cloneElement(j,{polarAngles:Array.isArray(E)?E:Ya(M,!0).map(function(N){return N.coordinate}),polarRadius:Array.isArray(A)?A:Ya(F,!0).map(function(N){return N.coordinate}),cx:L,cy:R,innerRadius:$,outerRadius:O,key:j.key||"polar-grid",radialLines:C})}),Le(_,"renderLegend",function(){var j=_.state.formattedGraphicalItems,k=_.props,C=k.children,E=k.width,A=k.height,P=_.props.margin||{},T=E-(P.left||0)-(P.right||0),B=N6({children:C,formattedGraphicalItems:j,legendWidth:T,legendContent:u});if(!B)return null;var F=B.item,M=SI(B,vEe);return b.cloneElement(F,te(te({},M),{},{chartWidth:E,chartHeight:A,margin:P,onBBoxUpdate:_.handleLegendBBoxUpdate}))}),Le(_,"renderTooltip",function(){var j,k=_.props,C=k.children,E=k.accessibilityLayer,A=zr(C,Li);if(!A)return null;var P=_.state,T=P.isTooltipActive,B=P.activeCoordinate,F=P.activePayload,M=P.activeLabel,L=P.offset,R=(j=A.props.active)!==null&&j!==void 0?j:T;return b.cloneElement(A,{viewBox:te(te({},L),{},{x:L.left,y:L.top}),active:R,label:M,payload:R?F:[],coordinate:B,accessibilityLayer:E})}),Le(_,"renderBrush",function(j){var k=_.props,C=k.margin,E=k.data,A=_.state,P=A.offset,T=A.dataStartIndex,B=A.dataEndIndex,F=A.updateId;return b.cloneElement(j,{key:j.key||"_recharts-brush",onChange:Cg(_.handleBrushChange,j.props.onChange),data:E,x:ce(j.props.x)?j.props.x:P.left,y:ce(j.props.y)?j.props.y:P.top+P.height+P.brushBottom-(C.bottom||0),width:ce(j.props.width)?j.props.width:P.width,startIndex:T,endIndex:B,updateId:"brush-".concat(F)})}),Le(_,"renderReferenceElement",function(j,k,C){if(!j)return null;var E=_,A=E.clipPathId,P=_.state,T=P.xAxisMap,B=P.yAxisMap,F=P.offset,M=j.type.defaultProps||{},L=j.props,R=L.xAxisId,$=R===void 0?M.xAxisId:R,O=L.yAxisId,N=O===void 0?M.yAxisId:O;return b.cloneElement(j,{key:j.key||"".concat(k,"-").concat(C),xAxis:T[$],yAxis:B[N],viewBox:{x:F.left,y:F.top,width:F.width,height:F.height},clipPathId:A})}),Le(_,"renderActivePoints",function(j){var k=j.item,C=j.activePoint,E=j.basePoint,A=j.childIndex,P=j.isRange,T=[],B=k.props.key,F=k.item.type.defaultProps!==void 0?te(te({},k.item.type.defaultProps),k.item.props):k.item.props,M=F.activeDot,L=F.dataKey,R=te(te({index:A,dataKey:L,cx:C.x,cy:C.y,r:4,fill:wC(k.item),strokeWidth:2,stroke:"#fff",payload:C.payload,value:C.value},Ne(M,!1)),Xv(M));return T.push(x.renderActiveDot(M,R,"".concat(B,"-activePoint-").concat(A))),E?T.push(x.renderActiveDot(M,te(te({},R),{},{cx:E.x,cy:E.y}),"".concat(B,"-basePoint-").concat(A))):P&&T.push(null),T}),Le(_,"renderGraphicChild",function(j,k,C){var E=_.filterFormatItem(j,k,C);if(!E)return null;var A=_.getTooltipEventType(),P=_.state,T=P.isTooltipActive,B=P.tooltipAxis,F=P.activeTooltipIndex,M=P.activeLabel,L=_.props.children,R=zr(L,Li),$=E.props,O=$.points,N=$.isRange,H=$.baseLine,V=E.item.type.defaultProps!==void 0?te(te({},E.item.type.defaultProps),E.item.props):E.item.props,D=V.activeDot,K=V.hide,ae=V.activeBar,se=V.activeShape,Q=!!(!K&&T&&R&&(D||ae||se)),ne={};A!=="axis"&&R&&R.props.trigger==="click"?ne={onClick:Cg(_.handleItemMouseEnter,j.props.onClick)}:A!=="axis"&&(ne={onMouseLeave:Cg(_.handleItemMouseLeave,j.props.onMouseLeave),onMouseEnter:Cg(_.handleItemMouseEnter,j.props.onMouseEnter)});var Z=b.cloneElement(j,te(te({},E.props),ne));function W(Sn){return typeof B.dataKey=="function"?B.dataKey(Sn.payload):null}if(Q)if(F>=0){var ee,q;if(B.dataKey&&!B.allowDuplicatedCategory){var re=typeof B.dataKey=="function"?W:"payload.".concat(B.dataKey.toString());ee=Yv(O,re,M),q=N&&H&&Yv(H,re,M)}else ee=O==null?void 0:O[F],q=N&&H&&H[F];if(se||ae){var ge=j.props.activeIndex!==void 0?j.props.activeIndex:F;return[b.cloneElement(j,te(te(te({},E.props),ne),{},{activeIndex:ge})),null,null]}if(!$e(ee))return[Z].concat(bd(_.renderActivePoints({item:E,activePoint:ee,basePoint:q,childIndex:F,isRange:N})))}else{var Ie,ye=(Ie=_.getItemByXY(_.state.activeCoordinate))!==null&&Ie!==void 0?Ie:{graphicalItem:Z},qe=ye.graphicalItem,jt=qe.item,pt=jt===void 0?j:jt,rn=qe.childIndex,Wt=te(te(te({},E.props),ne),{},{activeIndex:rn});return[b.cloneElement(pt,Wt),null,null]}return N?[Z,null,null]:[Z,null]}),Le(_,"renderCustomized",function(j,k,C){return b.cloneElement(j,te(te({key:"recharts-customized-".concat(C)},_.props),_.state))}),Le(_,"renderMap",{CartesianGrid:{handler:Tg,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:Tg},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:Tg},YAxis:{handler:Tg},Brush:{handler:_.renderBrush,once:!0},Bar:{handler:_.renderGraphicChild},Line:{handler:_.renderGraphicChild},Area:{handler:_.renderGraphicChild},Radar:{handler:_.renderGraphicChild},RadialBar:{handler:_.renderGraphicChild},Scatter:{handler:_.renderGraphicChild},Pie:{handler:_.renderGraphicChild},Funnel:{handler:_.renderGraphicChild},Tooltip:{handler:_.renderCursor,once:!0},PolarGrid:{handler:_.renderPolarGrid,once:!0},PolarAngleAxis:{handler:_.renderPolarAxis},PolarRadiusAxis:{handler:_.renderPolarAxis},Customized:{handler:_.renderCustomized}}),_.clipPathId="".concat((w=y.id)!==null&&w!==void 0?w:Bo("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=SF(_.triggeredAfterMouseMove,(S=y.throttleDelay)!==null&&S!==void 0?S:1e3/60),_.state={},_}return PEe(x,v),kEe(x,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,_=w.data,j=w.height,k=w.layout,C=zr(S,Li);if(C){var E=C.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var A=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,P=vS(this.state,_,E,A),T=this.state.tooltipTicks[E].coordinate,B=(this.state.offset.top+j)/2,F=k==="horizontal",M=F?{x:T,y:B}:{y:T,x:B},L=this.state.formattedGraphicalItems.find(function($){var O=$.item;return O.type.name==="Scatter"});L&&(M=te(te({},M),L.props.points[E].tooltipPosition),P=L.props.points[E].tooltipPayload);var R={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:A,activePayload:P,activeCoordinate:M};this.setState(R),this.renderCursor(C),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var _,j;this.accessibilityManager.setDetails({offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(w){W_([zr(w.children,Li)],[zr(this.props.children,Li)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=zr(this.props.children,Li);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return l.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,_=S.getBoundingClientRect(),j=nge(_),k={chartX:Math.round(w.pageX-j.left),chartY:Math.round(w.pageY-j.top)},C=_.width/S.offsetWidth||1,E=this.inRange(k.chartX,k.chartY,C);if(!E)return null;var A=this.state,P=A.xAxisMap,T=A.yAxisMap,B=this.getTooltipEventType(),F=NI(this.state,this.props.data,this.props.layout,E);if(B!=="axis"&&P&&T){var M=Ls(P).scale,L=Ls(T).scale,R=M&&M.invert?M.invert(k.chartX):null,$=L&&L.invert?L.invert(k.chartY):null;return te(te({},k),{},{xValue:R,yValue:$},F)}return F?te(te({},k),F):null}},{key:"inRange",value:function(w,S){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,k=w/_,C=S/_;if(j==="horizontal"||j==="vertical"){var E=this.state.offset,A=k>=E.left&&k<=E.left+E.width&&C>=E.top&&C<=E.top+E.height;return A?{x:k,y:C}:null}var P=this.state,T=P.angleAxisMap,B=P.radiusAxisMap;if(T&&B){var F=Ls(T);return GT({x:k,y:C},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),_=zr(w,Li),j={};_&&S==="axis"&&(_.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=Xv(this.props,this.handleOuterEvent);return te(te({},k),j)}},{key:"addListener",value:function(){Tw.on(Rw,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Tw.removeListener(Rw,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,_){for(var j=this.state.formattedGraphicalItems,k=0,C=j.length;k<C;k++){var E=j[k];if(E.item===w||E.props.key===w.key||S===Ja(E.item.type)&&_===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,S=this.state.offset,_=S.left,j=S.top,k=S.height,C=S.width;return I.createElement("defs",null,I.createElement("clipPath",{id:w},I.createElement("rect",{x:_,y:j,height:k,width:C})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(S,_){var j=jI(_,2),k=j[0],C=j[1];return te(te({},S),{},Le({},k,C.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(S,_){var j=jI(_,2),k=j[0],C=j[1];return te(te({},S),{},Le({},k,C.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[w])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(w){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[w])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(w){var S=this.state,_=S.formattedGraphicalItems,j=S.activeItem;if(_&&_.length)for(var k=0,C=_.length;k<C;k++){var E=_[k],A=E.props,P=E.item,T=P.type.defaultProps!==void 0?te(te({},P.type.defaultProps),P.props):P.props,B=Ja(P.type);if(B==="Bar"){var F=(A.data||[]).find(function($){return L1e(w,$)});if(F)return{graphicalItem:E,payload:F}}else if(B==="RadialBar"){var M=(A.data||[]).find(function($){return GT(w,$)});if(M)return{graphicalItem:E,payload:M}}else if(Rb(E,j)||Ib(E,j)||Tp(E,j)){var L=Nje({graphicalItem:E,activeTooltipItem:j,itemData:T.data}),R=T.activeIndex===void 0?L:T.activeIndex;return{graphicalItem:te(te({},E),{},{childIndex:R}),payload:Tp(E,j)?T.data[L]:E.props.data[L]}}}return null}},{key:"render",value:function(){var w=this;if(!LO(this))return null;var S=this.props,_=S.children,j=S.className,k=S.width,C=S.height,E=S.style,A=S.compact,P=S.title,T=S.desc,B=SI(S,yEe),F=Ne(B,!1);if(A)return I.createElement(tI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement(q_,nu({},F,{width:k,height:C,title:P,desc:T}),this.renderClipPath(),BO(_,this.renderMap)));if(this.props.accessibilityLayer){var M,L;F.tabIndex=(M=this.props.tabIndex)!==null&&M!==void 0?M:0,F.role=(L=this.props.role)!==null&&L!==void 0?L:"application",F.onKeyDown=function($){w.accessibilityManager.keyboardEvent($)},F.onFocus=function(){w.accessibilityManager.focus()}}var R=this.parseEventsOfWrapper();return I.createElement(tI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement("div",nu({className:He("recharts-wrapper",j),style:te({position:"relative",cursor:"default",width:k,height:C},E)},R,{ref:function(O){w.container=O}}),I.createElement(q_,nu({},F,{width:k,height:C,title:P,desc:T,style:MEe}),this.renderClipPath(),BO(_,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(b.Component);Le(g,"displayName",n),Le(g,"defaultProps",te({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Le(g,"getDerivedStateFromProps",function(v,x){var y=v.dataKey,w=v.data,S=v.children,_=v.width,j=v.height,k=v.layout,C=v.stackOffset,E=v.margin,A=x.dataStartIndex,P=x.dataEndIndex;if(x.updateId===void 0){var T=CI(v);return te(te(te({},T),{},{updateId:0},p(te(te({props:v},T),{},{updateId:0}),x)),{},{prevDataKey:y,prevData:w,prevWidth:_,prevHeight:j,prevLayout:k,prevStackOffset:C,prevMargin:E,prevChildren:S})}if(y!==x.prevDataKey||w!==x.prevData||_!==x.prevWidth||j!==x.prevHeight||k!==x.prevLayout||C!==x.prevStackOffset||!hu(E,x.prevMargin)){var B=CI(v),F={chartX:x.chartX,chartY:x.chartY,isTooltipActive:x.isTooltipActive},M=te(te({},NI(x,w,k)),{},{updateId:x.updateId+1}),L=te(te(te({},B),F),M);return te(te(te({},L),p(te({props:v},L),x)),{},{prevDataKey:y,prevData:w,prevWidth:_,prevHeight:j,prevLayout:k,prevStackOffset:C,prevMargin:E,prevChildren:S})}if(!W_(S,x.prevChildren)){var R,$,O,N,H=zr(S,od),V=H&&(R=($=H.props)===null||$===void 0?void 0:$.startIndex)!==null&&R!==void 0?R:A,D=H&&(O=(N=H.props)===null||N===void 0?void 0:N.endIndex)!==null&&O!==void 0?O:P,K=V!==A||D!==P,ae=!$e(w),se=ae&&!K?x.updateId:x.updateId+1;return te(te({updateId:se},p(te(te({props:v},x),{},{updateId:se,dataStartIndex:V,dataEndIndex:D}),x)),{},{prevChildren:S,dataStartIndex:V,dataEndIndex:D})}return null}),Le(g,"renderActiveDot",function(v,x,y){var w;return b.isValidElement(v)?w=b.cloneElement(v,x):De(v)?w=v(x):w=I.createElement(ym,x),I.createElement(Ke,{className:"recharts-active-dot",key:y},w)});var m=b.forwardRef(function(x,y){return I.createElement(g,nu({},x,{ref:y}))});return m.displayName=g.displayName,m},qEe=a8({chartName:"PieChart",GraphicalChild:xs,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Tb},{axisType:"radiusAxis",AxisComp:Ob}],formatAxisMap:Jbe,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}
742),VEe=a8({chartName:"ComposedChart",GraphicalChild:[xm,fc,dc,Ub],axisComponents:[{axisType:"xAxis",AxisComp:zb},{axisType:"yAxis",AxisComp:Dp},{axisType:"zAxis",AxisComp:Bb}],formatAxisMap:ike});function Fe(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 Rr(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function rr(e,t){const n=Fe(e);return isNaN(t)?Rr(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function wi(e,t){const n=Fe(e);if(isNaN(t))return Rr(e,NaN);if(!t)return n;const r=n.getDate(),i=Rr(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const a=i.getDate();return r>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}const TC=6048e5,GEe=864e5,s8=6e4,o8=36e5,Rg=43200,PI=1440;let KEe={};function ef(){return KEe}function Pa(e,t){var l,c,u,d;const n=ef(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=Fe(e),a=i.getDay(),s=(a<r?7:0)+a-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function Ql(e){return Pa(e,{weekStartsOn:1})}function l8(e){const t=Fe(e),n=t.getFullYear(),r=Rr(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Ql(r),a=Rr(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=Ql(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function wd(e){const t=Fe(e);return t.setHours(0,0,0,0),t}function _d(e){const t=Fe(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 xa(e,t){const n=wd(e),r=wd(t),i=+n-_d(n),a=+r-_d(r);return Math.round((i-a)/GEe)}function YEe(e){const t=l8(e),n=Rr(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Ql(n)}function yS(e,t){const n=t*7;return rr(e,n)}function XEe(e,t){return wi(e,t*12)}function QEe(e){let t;return e.forEach(function(n){const r=Fe(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function JEe(e){let t;return e.forEach(n=>{const r=Fe(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function av(e,t){const n=Fe(e),r=Fe(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function ZEe(e){return Rr(e,Date.now())}function Sr(e,t){const n=wd(e),r=wd(t);return+n==+r}function RC(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ePe(e){if(!RC(e)&&typeof e!="number")return!1;const t=Fe(e);return!isNaN(Number(t))}function jd(e,t){const n=Fe(e),r=Fe(t),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function tPe(e,t,n){const r=Pa(e,n),i=Pa(t,n),a=+r-_d(r),s=+i-_d(i);return Math.round((a-s)/TC)}function nPe(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function rPe(e,t){return+Fe(e)-+Fe(t)}function iPe(e){const t=Fe(e);return t.setHours(23,59,59,999),t}function Hb(e){const t=Fe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function aPe(e){const t=Fe(e);return+iPe(t)==+Hb(t)}function sPe(e,t){const n=Fe(e),r=Fe(t),i=av(n,r),a=Math.abs(jd(n,r));let s;if(a<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*a);let l=av(n,r)===-i;aPe(Fe(e))&&a===1&&av(e,r)===1&&(l=!1),s=i*(a-Number(l))}return s===0?0:s}function oPe(e,t,n){const r=rPe(e,t)/1e3;return nPe(n==null?void 0:n.roundingMethod)(r)}function lPe(e,t){const n=Fe(e.start),r=Fe(e.end);let i=+n>+r;const a=i?+n:+r,s=i?r:n;s.setHours(0,0,0,0),s.setDate(1);let l=1;const c=[];for(;+s<=a;)c.push(Fe(s)),s.setMonth(s.getMonth()+l);return i?c.reverse():c}function Yn(e){const t=Fe(e);return t.setDate(1),t.setHours(0,0,0,0),t}function c8(e){const t=Fe(e),n=Rr(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function IC(e,t){var l,c,u,d;const n=ef(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=Fe(e),a=i.getDay(),s=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+s),i.setHours(23,59,59,999),i}function u8(e){return IC(e,{weekStartsOn:1}
vendor: 13,791 bytes, line 742
742)}const cPe={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"}},uPe=(e,t,n)=>{let r;const i=cPe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Mw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const dPe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fPe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hPe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pPe={date:Mw({formats:dPe,defaultWidth:"full"}),time:Mw({formats:fPe,defaultWidth:"full"}),dateTime:Mw({formats:hPe,defaultWidth:"full"})},mPe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gPe=(e,t,n,r)=>mPe[e];function Of(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):s;i=e.formattingValues[l]||e.formattingValues[s]}else{const s=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[l]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const vPe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yPe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},xPe={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"]},bPe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},wPe={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"}},_Pe={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"}},jPe=(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"},SPe={ordinalNumber:jPe,era:Of({values:vPe,defaultWidth:"wide"}),quarter:Of({values:yPe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Of({values:xPe,defaultWidth:"wide"}),day:Of({values:bPe,defaultWidth:"wide"}),dayPeriod:Of({values:wPe,defaultWidth:"wide",formattingValues:_Pe,defaultFormattingWidth:"wide"})};function Af(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const s=a[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?NPe(l,f=>f.test(s)):kPe(l,f=>f.test(s));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(s.length);return{value:u,rest:d}}}function kPe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function NPe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function CPe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=n.valueCallback?n.valueCallback(s):s;const l=t.slice(i.length);return{value:s,rest:l}}}const EPe=/^(\d+)(th|st|nd|rd)?/i,PPe=/\d+/i,OPe={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},APe={any:[/^b/i,/^(a|c)/i]},TPe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},RPe={any:[/1/i,/2/i,/3/i,/4/i]},IPe={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},MPe={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]},$Pe={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},DPe={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]},LPe={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},FPe={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}},BPe={ordinalNumber:CPe({matchPattern:EPe,parsePattern:PPe,valueCallback:e=>parseInt(e,10)}),era:Af({matchPatterns:OPe,defaultMatchWidth:"wide",parsePatterns:APe,defaultParseWidth:"any"}),quarter:Af({matchPatterns:TPe,defaultMatchWidth:"wide",parsePatterns:RPe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Af({matchPatterns:IPe,defaultMatchWidth:"wide",parsePatterns:MPe,defaultParseWidth:"any"}),day:Af({matchPatterns:$Pe,defaultMatchWidth:"wide",parsePatterns:DPe,defaultParseWidth:"any"}),dayPeriod:Af({matchPatterns:LPe,defaultMatchWidth:"any",parsePatterns:FPe,defaultParseWidth:"any"})},MC={code:"en-US",formatDistance:uPe,formatLong:pPe,formatRelative:gPe,localize:SPe,match:BPe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function UPe(e){const t=Fe(e);return xa(t,c8(t))+1}function d8(e){const t=Fe(e),n=+Ql(t)-+YEe(t);return Math.round(n/TC)+1}function f8(e,t){var d,f,h,p;const n=Fe(e),r=n.getFullYear(),i=ef(),a=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(h=i.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=Rr(e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);const l=Pa(s,t),c=Rr(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);const u=Pa(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function zPe(e,t){var l,c,u,d;const n=ef(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=f8(e,t),a=Rr(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),Pa(a,t)}function h8(e,t){const n=Fe(e),r=+Pa(n,t)-+zPe(n,t);return Math.round(r/TC)+1}function gt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ns={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return gt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):gt(n+1,2)},d(e,t){return gt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return gt(e.getHours()%12||12,t.length)},H(e,t){return gt(e.getHours(),t.length)},m(e,t){return gt(e.getMinutes(),t.length)},s(e,t){return gt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return gt(i,t.length)}},Oc={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},OI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Ns.y(e,t)},Y:function(e,t,n,r){const i=f8(e,r),a=i>0?i:1-i;if(t==="YY"){const s=a%100;return gt(s,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):gt(a,t.length)},R:function(e,t){const n=l8(e);return gt(n,t.length)},u:function(e,t){const n=e.getFullYear();return gt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return gt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return gt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ns.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return gt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=h8(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):gt(i,t.length)},I:function(e,t,n){const r=d8(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):gt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ns.d(e,t)},D:function(e,t,n){const r=UPe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):gt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return gt(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return gt(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return gt(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Oc.noon:r===0?i=Oc.midnight:i=r/12>
vendor: 4,717 bytes, line 742
742=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Oc.evening:r>=12?i=Oc.afternoon:r>=4?i=Oc.morning:i=Oc.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ns.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ns.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):gt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):gt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ns.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ns.s(e,t)},S:function(e,t){return Ns.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return TI(r);case"XXXX":case"XX":return ol(r);case"XXXXX":case"XXX":default:return ol(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return TI(r);case"xxxx":case"xx":return ol(r);case"xxxxx":case"xxx":default:return ol(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+AI(r,":");case"OOOO":default:return"GMT"+ol(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+AI(r,":");case"zzzz":default:return"GMT"+ol(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return gt(r,t.length)},T:function(e,t,n){const r=e.getTime();return gt(r,t.length)}};function AI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+gt(a,2)}function TI(e,t){return e%60===0?(e>0?"-":"+")+gt(Math.abs(e)/60,2):ol(e,t)}function ol(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=gt(Math.trunc(r/60),2),a=gt(r%60,2);return n+i+t+a}const RI=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},p8=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},WPe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return RI(e,t);let a;switch(r){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",RI(r,t)).replace("{{time}}",p8(i,t))},HPe={p:p8,P:WPe},qPe=/^D+$/,VPe=/^Y+$/,GPe=["D","DD","YY","YYYY"];function KPe(e){return qPe.test(e)}function YPe(e){return VPe.test(e)}function XPe(e,t,n){const r=QPe(e,t,n);if(console.warn(r),GPe.includes(e))throw new RangeError(r)}function QPe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const JPe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ZPe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,e2e=/^'([^]*?)'?$/,t2e=/''/g,n2e=/[a-zA-Z]/;function nn(e,t,n){var d,f,h,p,g,m,v,x;const r=ef(),i=(n==null?void 0:n.locale)??r.locale??MC,a=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((m=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((x=(v=r.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0,l=Fe(e);if(!ePe(l))throw new RangeError("Invalid time value");let c=t.match(ZPe).map(y=>{const w=y[0];if(w==="p"||w==="P"){const S=HPe[w];return S(y,i.formatLong)}return y}).join("").match(JPe).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:r2e(y)};if(OI[w])return{isToken:!0,value:y};
742if(w.match(n2e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});i.localize.preprocessor&&(c=i.localize.preprocessor(l,c));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:i};return c.map(y=>{if(!y.isToken)return y.value;const w=y.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&YPe(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&KPe(w))&&XPe(w,t,String(e));const S=OI[w[0]];return S(l,w,i.localize,u)}).join("")}function r2e(e){const t=e.match(e2e);return t?t[1].replace(t2e,"'"):e}function i2e(e,t,n){const r=ef(),i=(n==null?void 0:n.locale)??r.locale??MC,a=2520,s=av(e,t);if(isNaN(s))throw new RangeError("Invalid time value");const l=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:s});let c,u;s>0?(c=Fe(t),u=Fe(e)):(c=Fe(e),u=Fe(t));const d=oPe(u,c),f=(_d(u)-_d(c))/1e3,h=Math.round((d-f)/60);let p;if(h<2)return n!=null&&n.includeSeconds?d<5?i.formatDistance("lessThanXSeconds",5,l):d<10?i.formatDistance("lessThanXSeconds",10,l):d<20?i.formatDistance("lessThanXSeconds",20,l):d<40?i.formatDistance("halfAMinute",0,l):d<60?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",1,l):h===0?i.formatDistance("lessThanXMinutes",1,l):i.formatDistance("xMinutes",h,l);if(h<45)return i.formatDistance("xMinutes",h,l);if(h<90)return i.formatDistance("aboutXHours",1,l);if(h<PI){const g=Math.round(h/60);return i.formatDistance("aboutXHours",g,l)}else{if(h<a)return i.formatDistance("xDays",1,l);if(h<Rg){const g=Math.round(h/PI);return i.formatDistance("xDays",g,l)}else if(h<Rg*2)return p=Math.round(h/Rg),i.formatDistance("aboutXMonths",p,l)}if(p=sPe(u,c),p<12){const g=Math.round(h/Rg);return i.formatDistance("xMonths",g,l)}else{const g=p%12,m=Math.trunc(p/12);return g<3?i.formatDistance("aboutXYears",m,l):g<9?i.formatDistance("overXYears",m,l):i.formatDistance("almostXYears",m+1,l)}}function Tf(e,t){return i2e(e,ZEe(e),t)}function a2e(e){const t=Fe(e),n=t.getFullYear(),r=t.getMonth(),i=Rr(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function s2e(e){return Math.trunc(+Fe(e)/1e3)}function o2e(e){const t=Fe(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function l2e(e,t){return tPe(o2e(e),Yn(e),t)+1}function xS(e,t){const n=Fe(e),r=Fe(t);return n.getTime()>r.getTime()}function m8(e,t){const n=Fe(e),r=Fe(t);return+n<+r}function $C(e,t){const n=Fe(e),r=Fe(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function c2e(e,t){const n=Fe(e),r=Fe(t);return n.getFullYear()===r.getFullYear()}function gu(e,t){return rr(e,-t)}function go(e,t){const r=h2e(e);let i;if(r.date){const c=p2e(r.date,2);i=m2e(c.restDateString,c.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);const a=i.getTime();let s=0,l;if(r.time&&(s=g2e(r.time),isNaN(s)))return new Date(NaN);if(r.timezone){if(l=v2e(r.timezone),isNaN(l))return new Date(NaN)}else{const c=new Date(a+s),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(a+s+l)}const Ig={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},u2e=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,d2e=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,f2e=/^([+-])(\d{2})(?::?(\d{2}))?$/;function h2e(e){const t={},n=e.split(Ig.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Ig.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Ig.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const i=Ig.timezone.exec(r);i?(t.time=r.replace(i[1],""),t.timezone=i[1]):t.time=r}return t}function p2e(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function m2e(e,t){if(t===null)return new Date(NaN);const n=e.match(u2e);if(!n)return new Date(NaN);const r=!!n[4],i=Rf(n[1]),a=Rf(n[2])-1,s=Rf(n[3]),l=Rf(n[4]),c=Rf(n[5])-1;if(r)return _2e(t,l,c)?y2e(t,l,c):new Date(NaN);{const u=new Date(0);return!b2e(t,a,s)||!w2e(t,i)?new Date(NaN):(u.setUTCFullYear(t,a,Math.max(i,s)),u)}}function Rf(e){return e?parseInt(e):1}function g2e(e){const t=e.match(d2e);if(!t)return NaN;const n=$w(t[1]),r=$w(t[2]),i=$w(t[3]);return j2e(n,r,i)?n*o8+r*s8+i*1e3:NaN}function $w(e){return e&&parseFloat(e.replace(",","."))||0}function v2e(e){if(e==="Z")return 0;const t=e.match(f2e);if(!t)return 0;
742const n=t[1]==="+"?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return S2e(r,i)?n*(r*o8+i*s8):NaN}function y2e(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}const x2e=[31,null,31,30,31,30,31,31,30,31,30,31];function g8(e){return e%400===0||e%4===0&&e%100!==0}function b2e(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(x2e[t]||(g8(e)?29:28))}function w2e(e,t){return t>=1&&t<=(g8(e)?366:365)}function _2e(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function j2e(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function S2e(e,t){return t>=0&&t<=59}function Dw(e,t){const n=Fe(e),r=n.getFullYear(),i=n.getDate(),a=Rr(e,0);a.setFullYear(r,t,15),a.setHours(0,0,0,0);const s=a2e(a);return n.setMonth(t,Math.min(i,s)),n}function II(e,t){const n=Fe(e);return isNaN(+n)?Rr(e,NaN):(n.setFullYear(t),n)}function v8(e,t){return wi(e,-t)}const k2e=({reviews:e})=>{const t=new Date,r=lPe({start:v8(t,11),end:t}).map(s=>{const l=Yn(s),c=e.filter(d=>{const f=go(d.review_date);return Yn(f).getTime()===l.getTime()}),u=c.length>0?c.reduce((d,f)=>d+f.rating,0)/c.length:null;return{month:nn(s,"MMM"),rating:u?Number(u.toFixed(1)):null,count:c.length}}),i=r.some(s=>s.rating!==null),a=Math.max(...r.map(s=>s.count),1);return o.jsxs(pe,{className:"animate-fade-in",children:[o.jsx(ze,{children:o.jsx(We,{className:"font-display text-lg",children:"Rating Trends"})}),o.jsx(de,{children:i?o.jsx(kF,{width:"100%",height:280,children:o.jsxs(VEe,{data:r,children:[o.jsx(RB,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),o.jsx(zb,{dataKey:"month",stroke:"hsl(var(--muted-foreground))",fontSize:12}),o.jsx(Dp,{yAxisId:"rating",domain:[1,5],stroke:"hsl(var(--primary))",fontSize:12,orientation:"left",label:{value:"Rating",angle:-90,position:"insideLeft",style:{fill:"hsl(var(--muted-foreground))",fontSize:11}}}),o.jsx(Dp,{yAxisId:"count",domain:[0,Math.ceil(a*1.2)],stroke:"hsl(var(--muted-foreground))",fontSize:12,orientation:"right",allowDecimals:!1,label:{value:"Reviews",angle:90,position:"insideRight",style:{fill:"hsl(var(--muted-foreground))",fontSize:11}}}),o.jsx(Li,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)",fontSize:13}}),o.jsx(ho,{wrapperStyle:{fontSize:12}}),o.jsx(dc,{yAxisId:"count",dataKey:"count",name:"Reviews",fill:"hsl(var(--muted-foreground) / 0.2)",radius:[4,4,0,0]}),o.jsx(xm,{yAxisId:"rating",type:"monotone",dataKey:"rating",name:"Avg Rating",stroke:"hsl(var(--primary))",strokeWidth:2.5,dot:{fill:"hsl(var(--primary))",r:4},connectNulls:!0})]})}):o.jsx("div",{className:"flex h-[280px] items-center justify-center text-muted-foreground",children:"No review data yet. Import reviews to see trends."})})]})},MI=["hsl(var(--chart-positive))","hsl(var(--chart-neutral))","hsl(var(--chart-negative))"],N2e=({reviews:e})=>{const t=e.filter(s=>s.sentiment==="positive").length,n=e.filter(s=>s.sentiment==="neutral").length,r=e.filter(s=>s.sentiment==="negative").length,i=[{name:"Positive",value:t},{name:"Neutral",value:n},{name:"Negative",value:r}].filter(s=>s.value>0),a=i.length>0;return o.jsxs(pe,{className:"animate-fade-in",children:[o.jsx(ze,{children:o.jsx(We,{className:"font-display text-lg",children:"Sentiment Breakdown"})}),o.jsx(de,{children:a?o.jsx(kF,{width:"100%",height:280,children:o.jsxs(qEe,{children:[o.jsx(xs,{data:i,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:4,dataKey:"value",children:i.map((s,l)=>o.jsx(hm,{fill:MI[l%MI.length]},`cell-${l}`))}),o.jsx(Li,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)",fontSize:13}}),o.jsx(ho,{})]})}):o.jsx("div",{className:"flex h-[280px] items-center justify-center text-muted-foreground",children:"No sentiment data yet. Import reviews to see analysis."})})]})},DC=({className:e,...t})=>o.jsx("nav",{role:"navigation","aria-label":"pagination",className:he("mx-auto flex w-full justify-center",e),...t});DC.displayName="Pagination";const LC=b.forwardRef(({className:e,...t},n)=>o.jsx("ul",{ref:n,className:he("flex flex-row items-center gap-1",e),...t}));LC.displayName="PaginationContent";const Xa=b.forwardRef(({className:e,...t},n)=>o.jsx("li",{ref:n,className:he("",e),...t}));Xa.displayName="PaginationItem";const bm=({className:e,isActive:t,size:n="icon",...r})=>o.jsx("a",{"aria-current":t?"page":void 0,className:he(Hu({variant:t?"outline":"ghost",size:n}),e),...r});bm.displayName="PaginationLink";const FC=({className:e,...t})=>o.jsxs(bm,{"aria-label":"Go to previous page",size:"default",className:he("gap-1 pl-2.5",e),...t,children:[o.jsx(p5,{className:"h-4 w-4"}),o.jsx("span",{children:"Previous"})]});FC.displayName="PaginationPrevious";const BC=({className:e,...t})=>o.jsxs(bm,{"aria-label":"Go to next page",size:"default",className:he("gap-1 pr-2.5",e),...t,children:[o.jsx("span",{children:"Next"}),o.jsx(Ox,{className:"h-4 w-4"})]});BC.displayName="PaginationNext";const UC=({className:e,...t})=>
vendor: 4,358 bytes, line 742
742o.jsxs("span",{"aria-hidden":!0,className:he("flex h-9 w-9 items-center justify-center",e),...t,children:[o.jsx(CK,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"More pages"})]});UC.displayName="PaginationEllipsis";const Te=b.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:he("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}));Te.displayName="Input";const C2e=Td("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 Se({className:e,variant:t,...n}){return o.jsx("div",{className:he(C2e({variant:t}),e),...n})}function $I(e,[t,n]){return Math.min(n,Math.max(t,e))}var E2e=b.createContext(void 0);function wm(e){const t=b.useContext(E2e);return e||t||"ltr"}function zC(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var P2e=[" ","Enter","ArrowUp","ArrowDown"],O2e=[" ","Enter"],Jl="Select",[qb,Vb,A2e]=Zp(Jl),[tf,TLe]=Fn(Jl,[A2e,Io]),Gb=Io(),[T2e,Ho]=tf(Jl),[R2e,I2e]=tf(Jl),y8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:g}=e,m=Gb(t),[v,x]=b.useState(null),[y,w]=b.useState(null),[S,_]=b.useState(!1),j=wm(u),[k,C]=Tr({prop:r,defaultProp:i??!1,onChange:a,caller:Jl}),[E,A]=Tr({prop:s,defaultProp:l,onChange:c,caller:Jl}),P=b.useRef(null),T=v?g||!!v.closest("form"):!0,[B,F]=b.useState(new Set),M=Array.from(B).map(L=>L.props.value).join(";");return o.jsx(Mx,{...m,children:o.jsxs(T2e,{required:p,scope:t,trigger:v,onTriggerChange:x,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:_,contentId:Pr(),value:E,onValueChange:A,open:k,onOpenChange:C,dir:j,triggerPointerDownPosRef:P,disabled:h,children:[o.jsx(qb.Provider,{scope:t,children:o.jsx(R2e,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(L=>{F(R=>new Set(R).add(L))},[]),onNativeOptionRemove:b.useCallback(L=>{F(R=>{const $=new Set(R);return $.delete(L),$})},[]),children:n})}),T?o.jsxs(z8,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:E,onChange:L=>A(L.target.value),disabled:h,form:g,children:[E===void 0?o.jsx("option",{value:""}):null,Array.from(B)]},M):null]})})};y8.displayName=Jl;var x8="SelectTrigger",b8=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=Gb(n),s=Ho(x8,n),l=s.disabled||r,c=Qe(t,s.onTriggerChange),u=Vb(n),d=b.useRef("touch"),[f,h,p]=H8(m=>{const v=u().filter(w=>!w.disabled),x=v.find(w=>w.value===s.value),y=q8(v,m,x);y!==void 0&&s.onValueChange(y.value)}),g=m=>{l||(s.onOpenChange(!0),p()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return o.jsx(nm,{asChild:!0,...a,children:o.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":W8(s.value)?"":void 0,...i,ref:c,onClick:me(i.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&g(m)}),onPointerDown:me(i.onPointerDown,m=>{d.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(g(m),m.preventDefault())}),onKeyDown:me(i.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(v&&m.key===" ")&&P2e.includes(m.key)&&
vendor: 15,614 bytes, line 742
742(g(),m.preventDefault())})})})});b8.displayName=x8;var w8="SelectValue",_8=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:s="",...l}=e,c=Ho(w8,n),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,f=Qe(t,c.onValueNodeChange);return Pn(()=>{u(d)},[u,d]),o.jsx(Ce.span,{...l,ref:f,style:{pointerEvents:"none"},children:W8(c.value)?o.jsx(o.Fragment,{children:s}):a})});_8.displayName=w8;var M2e="SelectIcon",j8=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return o.jsx(Ce.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});j8.displayName=M2e;var $2e="SelectPortal",S8=e=>o.jsx(Ad,{asChild:!0,...e});S8.displayName=$2e;var Zl="SelectContent",k8=b.forwardRef((e,t)=>{const n=Ho(Zl,e.__scopeSelect),[r,i]=b.useState();if(Pn(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?nc.createPortal(o.jsx(N8,{scope:e.__scopeSelect,children:o.jsx(qb.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),a):null}return o.jsx(C8,{...e,ref:t})});k8.displayName=Zl;var Ti=10,[N8,qo]=tf(Zl),D2e="SelectContentImpl",L2e=wo("SelectContent.RemoveScroll"),C8=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:v,...x}=e,y=Ho(Zl,n),[w,S]=b.useState(null),[_,j]=b.useState(null),k=Qe(t,Q=>S(Q)),[C,E]=b.useState(null),[A,P]=b.useState(null),T=Vb(n),[B,F]=b.useState(!1),M=b.useRef(!1);b.useEffect(()=>{if(w)return Gx(w)},[w]),qx();const L=b.useCallback(Q=>{const[ne,...Z]=T().map(q=>q.ref.current),[W]=Z.slice(-1),ee=document.activeElement;for(const q of Q)if(q===ee||(q==null||q.scrollIntoView({block:"nearest"}),q===ne&&_&&(_.scrollTop=0),q===W&&_&&(_.scrollTop=_.scrollHeight),q==null||q.focus(),document.activeElement!==ee))return},[T,_]),R=b.useCallback(()=>L([C,w]),[L,C,w]);b.useEffect(()=>{B&&R()},[B,R]);const{onOpenChange:$,triggerPointerDownPosRef:O}=y;b.useEffect(()=>{if(w){let Q={x:0,y:0};const ne=W=>{var ee,q;Q={x:Math.abs(Math.round(W.pageX)-(((ee=O.current)==null?void 0:ee.x)??0)),y:Math.abs(Math.round(W.pageY)-(((q=O.current)==null?void 0:q.y)??0))}},Z=W=>{Q.x<=10&&Q.y<=10?W.preventDefault():w.contains(W.target)||$(!1),document.removeEventListener("pointermove",ne),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",Z,{capture:!0})}}},[w,$,O]),b.useEffect(()=>{const Q=()=>$(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[$]);const[N,H]=H8(Q=>{const ne=T().filter(ee=>!ee.disabled),Z=ne.find(ee=>ee.ref.current===document.activeElement),W=q8(ne,Q,Z);W&&setTimeout(()=>W.ref.current.focus())}),V=b.useCallback((Q,ne,Z)=>{const W=!M.current&&!Z;(y.value!==void 0&&y.value===ne||W)&&(E(Q),W&&(M.current=!0))},[y.value]),D=b.useCallback(()=>w==null?void 0:w.focus(),[w]),K=b.useCallback((Q,ne,Z)=>{const W=!M.current&&!Z;(y.value!==void 0&&y.value===ne||W)&&P(Q)},[y.value]),ae=r==="popper"?bS:E8,se=ae===bS?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:g,hideWhenDetached:m,avoidCollisions:v}:{};return o.jsx(N8,{scope:n,content:w,viewport:_,onViewportChange:j,itemRefCallback:V,selectedItem:C,onItemLeave:D,itemTextRefCallback:K,focusSelectedItem:R,selectedItemText:A,position:r,isPositioned:B,searchRef:N,children:o.jsx(am,{as:L2e,allowPinchZoom:!0,children:o.jsx(im,{asChild:!0,trapped:y.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:me(i,Q=>{var ne;(ne=y.trigger)==null||ne.focus({preventScroll:!0}),Q.preventDefault()}),children:o.jsx(ic,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:o.jsx(ae,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Q=>Q.preventDefault(),...x,...se,onPlaced:()=>F(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:me(x.onKeyDown,Q=>{const ne=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ne&&Q.key.length===1&&H(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let W=T().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const ee=Q.target,q=W.indexOf(ee);W=W.slice(q+1)}setTimeout(()=>L(W)),Q.preventDefault()}})})})})})})});C8.displayName=D2e;var F2e="SelectItemAlignedPosition",E8=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=Ho(Zl,n),s=qo(Zl,n),[l,c]=b.useState(null),[u,d]=b.useState(null),f=Qe(t,k=>d(k)),h=Vb(n),p=b.useRef(!1),g=b.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:x,focusSelectedItem:y}=s,w=b.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&m&&v&&x){const k=a.trigger.getBoundingClientRect(),C=u.getBoundingClientRect(),E=a.valueNode.getBoundingClientRect(),A=x.getBoundingClientRect();if(a.dir!=="rtl"){const ee=A.left-C.left,q=E.left-ee,re=k.left-q,ge=k.width+re,Ie=Math.max(ge,C.width),ye=window.innerWidth-Ti,qe=$I(q,[Ti,Math.max(Ti,ye-Ie)]);l.style.minWidth=ge+"px",l.style.left=qe+"px"}else{const ee=C.right-A.right,q=window.innerWidth-E.right-ee,re=window.innerWidth-k.right-q,ge=k.width+re,Ie=Math.max(ge,C.width),ye=window.innerWidth-Ti,qe=$I(q,[Ti,Math.max(Ti,ye-Ie)]);l.style.minWidth=ge+"px",l.style.right=qe+"px"}const P=h(),T=window.innerHeight-Ti*2,B=m.scrollHeight,F=window.getComputedStyle(u),M=parseInt(F.borderTopWidth,10),L=parseInt(F.paddingTop,10),R=parseInt(F.borderBottomWidth,10),$=parseInt(F.paddingBottom,10),O=M+L+B+$+R,N=Math.min(v.offsetHeight*5,O),H=window.getComputedStyle(m),V=parseInt(H.paddingTop,10),D=parseInt(H.paddingBottom,10),K=k.top+k.height/2-Ti,ae=T-K,se=v.offsetHeight/2,Q=v.offsetTop+se,ne=M+L+Q,Z=O-ne;if(ne<=K){const ee=P.length>0&&v===P[P.length-1].ref.current;l.style.bottom="0px";const q=u.clientHeight-m.offsetTop-m.offsetHeight,re=Math.max(ae,se+(ee?D:0)+q+R),ge=ne+re;l.style.height=ge+"px"}else{const ee=P.length>0&&v===P[0].ref.current;l.style.top="0px";const re=Math.max(K,M+m.offsetTop+(ee?V:0)+se)+Z;l.style.height=re+"px",m.scrollTop=ne-K+m.offsetTop}l.style.margin=`${Ti}px 0`,l.style.minHeight=N+"px",l.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[h,a.trigger,a.valueNode,l,u,m,v,x,a.dir,r]);Pn(()=>w(),[w]);const[S,_]=b.useState();Pn(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const j=b.useCallback(k=>{k&&g.current===!0&&(w(),y==null||y(),g.current=!1)},[w,y]);return o.jsx(U2e,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:j,children:o.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:o.jsx(Ce.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});E8.displayName=F2e;var B2e="SelectPopperPosition",bS=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ti,...a}=e,s=Gb(n);return o.jsx($x,{...s,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});bS.displayName=B2e;var[U2e,WC]=tf(Zl,{}),wS="SelectViewport",P8=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=qo(wS,n),s=WC(wS,n),l=Qe(t,a.onViewportChange),c=b.useRef(0);return o.jsxs(o.Fragment,{children:[o.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}),o.jsx(qb.Slot,{scope:n,children:o.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:me(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const g=window.innerHeight-Ti*2,m=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),x=Math.max(m,v);if(x<g){const y=x+p,w=Math.min(g,y),S=y-w;f.style.height=w+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});P8.displayName=wS;var O8="SelectGroup",[z2e,W2e]=tf(O8),H2e=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Pr();return o.jsx(z2e,{scope:n,id:i,children:o.jsx(Ce.div,{role:"group","aria-labelledby":i,...r,ref:t})})});H2e.displayName=O8;var A8="SelectLabel",T8=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=W2e(A8,n);return o.jsx(Ce.div,{id:i.id,...r,ref:t})});T8.displayName=A8;var Zy="SelectItem",[q2e,R8]=tf(Zy),I8=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...s}=e,l=Ho(Zy,n),c=qo(Zy,n),u=l.value===r,[d,f]=b.useState(a??""),[h,p]=b.useState(!1),g=Qe(t,y=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,y,r,i)}),m=Pr(),v=b.useRef("touch"),x=()=>{i||(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 o.jsx(q2e,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:b.useCallback(y=>{f(w=>w||((y==null?void 0:y.textContent)??"").trim())},[]),children:o.jsx(qb.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:o.jsx(Ce.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:g,onFocus:me(s.onFocus,()=>p(!0)),onBlur:me(s.onBlur,()=>p(!1)),onClick:me(s.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:me(s.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:me(s.onPointerDown,y=>{v.current=y.pointerType}),onPointerMove:me(s.onPointerMove,y=>{var w;v.current=y.pointerType,i?(w=c.onItemLeave)==null||w.call(c):v.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(s.onPointerLeave,y=>{var w;y.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:me(s.onKeyDown,y=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&y.key===" "||(O2e.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});I8.displayName=Zy;var Kf="SelectItemText",M8=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,s=Ho(Kf,n),l=qo(Kf,n),c=R8(Kf,n),u=I2e(Kf,n),[d,f]=b.useState(null),h=Qe(t,x=>f(x),c.onItemTextChange,x=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,x,c.value,c.disabled)}),p=d==null?void 0:d.textContent,g=b.useMemo(()=>o.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=u;return Pn(()=>(m(g),()=>v(g)),[m,v,g]),o.jsxs(o.Fragment,{children:[o.jsx(Ce.span,{id:c.textId,...a,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?nc.createPortal(a.children,s.valueNode):null]})});M8.displayName=Kf;var $8="SelectItemIndicator",D8=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return R8($8,n).isSelected?o.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});D8.displayName=$8;var _S="SelectScrollUpButton",L8=b.forwardRef((e,t)=>{const n=qo(_S,e.__scopeSelect),r=WC(_S,e.__scopeSelect),[i,a]=b.useState(!1),s=Qe(t,r.onScrollButtonChange);return Pn(()=>{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]),i?o.jsx(B8,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});L8.displayName=_S;var jS="SelectScrollDownButton",F8=b.forwardRef((e,t)=>{const n=qo(jS,e.__scopeSelect),r=WC(jS,e.__scopeSelect),[i,a]=b.useState(!1),s=Qe(t,r.onScrollButtonChange);return Pn(()=>{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]),i?o.jsx(B8,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});F8.displayName=jS;var B8=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=qo("SelectScrollButton",n),s=b.useRef(null),l=Vb(n),c=b.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),Pn(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),o.jsx(Ce.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:me(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:me(i.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:me(i.onPointerLeave,()=>{c()})})}),V2e="SelectSeparator",U8=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});U8.displayName=V2e;var SS="SelectArrow",G2e=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Gb(n),a=Ho(SS,n),s=qo(SS,n);return a.open&&s.position==="popper"?o.jsx(Dx,{...i,...r,ref:t}):null});G2e.displayName=SS;var K2e="SelectBubbleInput",z8=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=b.useRef(null),a=Qe(r,i),s=zC(t);return b.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[s,t]),o.jsx(Ce.select,{...n,style:{...H3,...n.style},ref:a,defaultValue:t})});z8.displayName=K2e;function W8(e){return e===""||e===void 0}function H8(e){const t=Ar(e),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(s=>{const l=n.current+s;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),a=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function q8(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=Y2e(e,Math.max(a,0));i.length===1&&(s=s.filter(u=>u!==n));const c=s.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function Y2e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var X2e=y8,V8=b8,Q2e=_8,J2e=j8,Z2e=S8,G8=k8,eOe=P8,K8=T8,Y8=I8,tOe=M8,nOe=D8,X8=L8,Q8=F8,J8=U8;const St=X2e,kt=Q2e,wt=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(V8,{ref:r,className:he("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
742ing-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,o.jsx(J2e,{asChild:!0,children:o.jsx(Rd,{className:"h-4 w-4 opacity-50"})})]}));wt.displayName=V8.displayName;const Z8=b.forwardRef(({className:e,...t},n)=>o.jsx(X8,{ref:n,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(eN,{className:"h-4 w-4"})}));Z8.displayName=X8.displayName;const eU=b.forwardRef(({className:e,...t},n)=>o.jsx(Q8,{ref:n,className:he("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Rd,{className:"h-4 w-4"})}));eU.displayName=Q8.displayName;const _t=b.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>o.jsx(Z2e,{children:o.jsxs(G8,{ref:i,className:he("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:[o.jsx(Z8,{}),o.jsx(eOe,{className:he("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(eU,{})]})}));_t.displayName=G8.displayName;const rOe=b.forwardRef(({className:e,...t},n)=>o.jsx(K8,{ref:n,className:he("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));rOe.displayName=K8.displayName;const we=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Y8,{ref:r,className:he("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(nOe,{children:o.jsx(To,{className:"h-4 w-4"})})}),o.jsx(tOe,{children:t})]}));we.displayName=Y8.displayName;const iOe=b.forwardRef(({className:e,...t},n)=>o.jsx(J8,{ref:n,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));iOe.displayName=J8.displayName;const Rl=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:he("w-full caption-bottom text-sm",e),...t})}));Rl.displayName="Table";const Il=b.forwardRef(({className:e,...t},n)=>o.jsx("thead",{ref:n,className:he("[&_tr]:border-b",e),...t}));Il.displayName="TableHeader";const Ml=b.forwardRef(({className:e,...t},n)=>o.jsx("tbody",{ref:n,className:he("[&_tr:last-child]:border-0",e),...t}));Ml.displayName="TableBody";const aOe=b.forwardRef(({className:e,...t},n)=>o.jsx("tfoot",{ref:n,className:he("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));aOe.displayName="TableFooter";const ir=b.forwardRef(({className:e,...t},n)=>o.jsx("tr",{ref:n,className:he("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));ir.displayName="TableRow";const rt=b.forwardRef(({className:e,...t},n)=>o.jsx("th",{ref:n,className:he("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));rt.displayName="TableHead";const tt=b.forwardRef(({className:e,...t},n)=>o.jsx("td",{ref:n,className:he("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));tt.displayName="TableCell";const sOe=b.forwardRef(({className:e,...t},n)=>o.jsx("caption",{ref:n,className:he("mt-4 text-sm text-muted-foreground",e),...t}));sOe.displayName="TableCaption";const DI=e=>{switch(e){case"positive":return"bg-chart-positive text-success-foreground";case"negative":return"bg-chart-negative text-destructive-foreground";default:return"bg-muted text-muted-foreground"}},LI=e=>{switch(e){case"tripadvisor":return{label:"TripAdvisor",className:"bg-emerald-500/10 text-emerald-700 border-emerald-500/20"};case"google":return{label:"Google",className:"bg-blue-500/10 text-blue-700 border-blue-500/20"};case"getyourguide":return{label:"GetYourGuide",className:"bg-orange-500/10 text-orange-700 border-orange-500/20"};case"trustpilot":return{label:"Trustpilot",className:"bg-green-500/10 text-green-700 border-green-500/20"};case"yelp":return{label:"Yelp",className:"bg-red-500/10 text-red-700 border-red-500/20"};default:return{label:e||"Unknown",className:"bg-muted text-muted-foreground"}}},FI=({rating:e})=>o.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(t=>o.jsx(pi,{className:`h-4 w-4 ${t<=e?"fill-warning text-warning":"text-border"}`},t))}),oOe=({reviews:e,businesses:t,isLoading:n})=>{const[r,i]=b.useState(""),[a,s]=b.useState("all"),[l,c]=b.useState("all"),[u,d]=b.useState(1),f=20,h=new Map(t.map(y=>[y.id,y.name])),p=e.filter(y=>{var j;const w=!r||y.reviewer_name.toLowerCase().includes(r.toLowerCase())||((j=y.comment)==null?void 0:j.toLowerCase().includes(r.toLowerCase())),S=a==="all"||y.rating===Number(a),_=l==="all"||y.sentiment===l;return w&&S&&_}),g=Math.ceil(p.length/f),m=p.slice((u-1)*f,u*f),v=y=>w=>{y(w),d(1)},x=()=>{const y=[];if(g<=7)for(let w=1;w<=g;w++)y.push(w);else{y.push(1),u>3&&y.push("ellipsis");for(let w=Math.max(2,u-1);w<=Math.min(g-1,u+1);w++)y.push(w);u<g-2&&y.push("ellipsis"),y.push(g)}return y};return o.jsxs(pe,{className:"animate-fade-in",children:[o.jsx(ze,{children:o.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx(We,{className:"font-display text-lg",children:"Reviews"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap",children:[o.jsxs("div",{className:"relative col-span-2 sm:col-auto",children:[o.jsx(Uu,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx(Te,{placeholder:"Search reviews...",value:r,onChange:y=>{i(y.target.value),d(1)},className:"w-full pl-9 sm:w-48"})]}),o.jsxs(St,{value:a,onValueChange:v(s),children:[o.jsx(wt,{className:"w-full sm:w-32",children:o.jsx(kt,{placeholder:"Rating"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All ratings"}),[5,4,3,2,1].map(y=>o.jsxs(we,{value:y.toString(),children:[y," stars"]},y))]})]}),o.jsxs(St,{value:l,onValueChange:v(c),children:[o.jsx(wt,{className:"w-full sm:w-36",children:o.jsx(kt,{placeholder:"Sentiment"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All sentiment"}),o.jsx(we,{value:"positive",children:"Positive"}),o.jsx(we,{value:"neutral",children:"Neutral"}),o.jsx(we,{value:"negative",children:"Negative"})]})]})]})]})}),o.jsx(de,{children:n?o.jsx("div",{className:"flex h-32 items-center justify-center text-muted-foreground",children:"Loading..."}):p.length===0?o.jsx("div",{className:"flex h-32 items-center justify-center text-muted-foreground text-center px-4",children:e.length===0?"N
742o reviews yet. Import your reviews to get started.":"No reviews match your filters."}):o.jsxs("div",{children:[o.jsx("div",{className:"space-y-3 md:hidden",children:m.map(y=>{const w=LI(y.source);return o.jsxs("div",{className:"rounded-lg border border-border p-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"truncate font-medium",children:y.reviewer_name}),o.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:[h.get(y.business_id)||"—"," · ",nn(go(y.review_date),"MMM d, yyyy")]})]}),o.jsx(FI,{rating:y.rating})]}),o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[o.jsx(Se,{variant:"outline",className:`text-xs ${w.className}`,children:w.label}),y.sentiment&&o.jsx(Se,{variant:"secondary",className:DI(y.sentiment),children:y.sentiment})]}),y.comment&&o.jsx("p",{className:"mt-2 line-clamp-3 text-sm text-muted-foreground",children:y.comment})]},y.id)})}),o.jsx("div",{className:"hidden overflow-x-auto md:block",children:o.jsxs(Rl,{children:[o.jsx(Il,{children:o.jsxs(ir,{children:[o.jsx(rt,{children:"Reviewer"}),o.jsx(rt,{children:"Source"}),o.jsx(rt,{children:"Business"}),o.jsx(rt,{children:"Rating"}),o.jsx(rt,{children:"Sentiment"}),o.jsx(rt,{className:"max-w-xs",children:"Comment"}),o.jsx(rt,{children:"Date"})]})}),o.jsx(Ml,{children:m.map(y=>o.jsxs(ir,{children:[o.jsx(tt,{className:"font-medium",children:y.reviewer_name}),o.jsx(tt,{children:(()=>{const w=LI(y.source);return o.jsx(Se,{variant:"outline",className:`text-xs ${w.className}`,children:w.label})})()}),o.jsx(tt,{className:"text-muted-foreground",children:h.get(y.business_id)||"—"}),o.jsx(tt,{children:o.jsx(FI,{rating:y.rating})}),o.jsx(tt,{children:y.sentiment&&o.jsx(Se,{variant:"secondary",className:DI(y.sentiment),children:y.sentiment})}),o.jsx(tt,{className:"max-w-xs truncate",children:y.comment||"—"}),o.jsx(tt,{className:"text-muted-foreground",children:nn(go(y.review_date),"MMM d, yyyy")})]},y.id))})]})}),g>1&&o.jsxs("div",{className:"mt-4 flex flex-col items-center gap-3 sm:flex-row sm:justify-between",children:[o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing ",(u-1)*f+1,"–",Math.min(u*f,p.length)," of ",p.length," reviews"]}),o.jsx(DC,{children:o.jsxs(LC,{children:[o.jsx(Xa,{children:o.jsx(FC,{onClick:()=>d(y=>Math.max(1,y-1)),className:u===1?"pointer-events-none opacity-50":"cursor-pointer"})}),x().map((y,w)=>y==="ellipsis"?o.jsx(Xa,{children:o.jsx(UC,{})},`e-${w}`):o.jsx(Xa,{children:o.jsx(bm,{isActive:u===y,onClick:()=>d(y),className:"cursor-pointer",children:y})},y)),o.jsx(Xa,{children:o.jsx(BC,{onClick:()=>d(y=>Math.min(g,y+1)),className:u===g?"pointer-events-none opacity-50":"cursor-pointer"})})]})})]})]})})]})},lOe=async()=>{let t=[],n=0,r=!0;for(;r;){const{data:i,error:a}=await Y.from("reviews").select("*").order("review_date",{ascending:!1}).range(n,n+1e3-1);if(a)throw a;i&&i.length>0?(t=t.concat(i),n+=1e3,r=i.length===1e3):r=!1}return t},cOe="id, name, address, email, phone, website, google_place_id, google_account_name, google_location_name, tripadvisor_url, trustpilot_url, getyourguide_url, yelp_url, sync_status, sync_message, last_synced_at, review_page_logo_url, review_page_description, reply_tone, reply_instructions, apify_run_id, apify_dataset_id, apify_items_imported, created_at, updated_at, user_id",uOe=async()=>{const{data:e,error:t}=await Y.from("businesses").select(cOe);if(t)throw t;return e||[]},HC=()=>{const{user:e}=Mt(),{data:t=[],isLoading:n}=Na({queryKey:["reviews",e==null?void 0:e.id],queryFn:lOe,enabled:!!e,staleTime:5*60*1e3}),{data:r=[],isLoading:i}=Na({queryKey:["businesses",e==null?void 0:e.id],queryFn:uOe,enabled:!!e,staleTime:5*60*1e3});return{reviews:t,businesses:r,reviewsLoading:n,businessesLoading:i,isLoading:n||i}};function ba({className:e,...t}){return o.jsx("div",{className:he("animate-pulse rounded-md bg-muted",e),...t})}const dOe=()=>{var f;const{user:e,loading:t}=Mt(),{reviews:n,businesses:r,reviewsLoading:i,businessesLoading:a}=HC(),s=NN(),[l,c]=b.useState("all"),u=b.useMemo(()=>l==="all"?n:n.filter(h=>h.business_id===l),[n,l]);if(t||a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});if(!e)return o.jsx(Yi,{to:"/login",replace:!0});if(!a&&r.length===0)return o.jsx(Yi,{to:"/businesses",replace:!0});const d=l==="all"?"all businesses":((f=r.find(h=>h.id===l))==null?void 0:f.name)||"";return o.jsx(Qn,{children:o.jsxs("div",{className:"space-y-6",children:[o.jsx(lL,{}
742),!s.loading&&!s.allComplete&&o.jsxs(on,{to:"/getting-started",className:"flex items-center gap-3 rounded-lg border border-primary/30 bg-primary/5 px-4 py-3 transition-colors hover:bg-primary/10",children:[o.jsx(x5,{className:"h-5 w-5 shrink-0 text-primary"}),o.jsxs("span",{className:"flex-1 text-sm font-medium text-foreground",children:["Continue setup — ",s.completedCount," of ",s.totalCount," complete"]}),o.jsx(vK,{className:"h-4 w-4 text-primary"})]}),o.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-3xl font-bold text-foreground",children:"Dashboard"}),o.jsxs("p",{className:"text-muted-foreground",children:["Showing data for ",d]})]}),r.length>1&&o.jsxs(St,{value:l,onValueChange:c,children:[o.jsxs(wt,{className:"w-52",children:[o.jsx(Jr,{className:"mr-2 h-4 w-4 text-muted-foreground"}),o.jsx(kt,{placeholder:"Filter by business"})]}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All Businesses"}),r.map(h=>o.jsx(we,{value:h.id,children:h.name},h.id))]})]})]}),i?o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((h,p)=>o.jsx(ba,{className:"h-28 w-full"},p))}),o.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[o.jsx(ba,{className:"h-[360px] w-full"}),o.jsx(ba,{className:"h-[360px] w-full"})]}),o.jsx(ba,{className:"h-[420px] w-full"})]}):o.jsxs(o.Fragment,{children:[o.jsx($te,{reviews:u}),o.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[o.jsx(k2e,{reviews:u}),o.jsx(N2e,{reviews:u})]}),o.jsx(oOe,{reviews:u,businesses:r,isLoading:i})]})]})})},fOe="authorization_response",hOe="/~oauth/initiate",pOe=["https://oauth.lovable.app","https://lovable.dev"],mOe="lovable://oauth-callback",gOe="http://127.0.0.1/iframe-oauth/callback",vOe=500,yOe=12e4,xOe=/LovableAppScheme\/([a-z0-9.+-]+)/i;function bOe(e){var n;const t=(n=xOe.exec(e))==null?void 0:n[1];return t?`${t}://oauth-callback`:mOe}function wOe(e){let t;const n=new Promise(a=>{t=a}),r=a=>{if(!e.some(l=>a.origin===l))return;const s=a.data;!s||typeof s!="object"||s.type===fOe&&t(s.response)},i=()=>{window.removeEventListener("message",r)};return window.addEventListener("message",r),{cleanup:i,messagePromise:n}}function _Oe(e){const t=window.screenX!==0||window.screenY!==0||!e,n=t?window.outerWidth*.5:window.screen.width*.5,r=t?window.outerHeight*.5:window.screen.height*.5;return{width:n,height:r,left:t?window.screenX+(window.outerWidth-n)/2:(window.screen.width-n)/2,top:t?window.screenY+(window.outerHeight-r)/2:(window.screen.height-r)/2}}function BI(e,t){return e.state!==t?{error:new Error("State is invalid")}:e.error?e.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(e.error_description??"Sign in failed")}:!e.access_token||!e.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:e.access_token,refresh_token:e.refresh_token},error:null}}function jOe(){const e=navigator.userAgent;return!!(/iPhone|iPad|iPod|Android/i.test(e)||/Macintosh/i.test(e)&&navigator.maxTouchPoints>1)}function SOe(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function kOe(e={}){const t=e.oauthBrokerUrl??hOe,n=e.supportedOAuthOrigins??pOe;async function r(i,a={}){let s=!1;try{s=window.self!==window.top}catch{s=!0}const l=navigator.userAgent,c=/LovableApp\//.test(l),u=!c&&/lovable/i.test(l),d=SOe();let f=a.redirect_uri??window.location.origin;c&&s?f=bOe(l):u&&s&&(f=gOe);const h=new URLSearchParams({...a.extraParams,provider:i,redirect_uri:f,state:d});if(!s)return window.location.href=`${t}?${h.toString()}`,{error:null,redirected:!0};!c&&!u&&h.set("response_mode","web_message");const p=`${t}?${h.toString()}`,{messagePromise:g,cleanup:m}=wOe(u?[...n,window.location.origin]:n);let v;if(jOe())v=window.open(p,"_blank");else{const{width:w,height:S,left:_,top:j}=_Oe(s);v=window.open(p,"oauth",`width=${w},height=${S},left=${_},top=${j}`)}if(!v&&(c||u)){let w;const S=new Promise((_,j)=>{w=setTimeout(()=>{j(new Error("OAuth timed out waiting for response"))},yOe)});try{return BI(await Promise.race([g,S]),d)}catch(_){return{error:_ instanceof Error?_:new Error(String(_))}}finally{w&&clearTimeout(w),m()}}if(!v)return m(),{error:new Error("Popup was blocked")};let x;const y=new Promise((w,S)=>{x=setInterval(()=>{v.closed&&(clearInterval(x),S(new Error("Sign in was cancelled")))},vOe)});
742try{return BI(await Promise.race([g,y]),d)}catch(w){return{error:w instanceof Error?w:new Error(String(w))}}finally{clearInterval(x),m(),v==null||v.close()}}return{signInWithOAuth:r}}function NOe(e={}){return kOe(e)}const COe=NOe(),EOe={auth:{signInWithOAuth:async(e,t)=>{const n=await COe.signInWithOAuth(e,{...t,extraParams:{...t==null?void 0:t.extraParams}});if(n.redirected||n.error)return n;try{await Y.auth.setSession(n.tokens)}catch(r){return{error:r instanceof Error?r:new Error(String(r))}}return n}}};var POe="Label",tU=b.forwardRef((e,t)=>o.jsx(Ce.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));tU.displayName=POe;var nU=tU;const OOe=Td("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pe=b.forwardRef(({className:e,...t},n)=>o.jsx(nU,{ref:n,className:he(OOe(),e),...t}));Pe.displayName=nU.displayName;const AOe=um.url,rU=({label:e})=>{const[t,n]=b.useState(!1),r=async()=>{n(!0),(await EOe.auth.signInWithOAuth("google",{redirect_uri:window.location.origin})).error&&(G.error("Google sign-in failed. Please try again."),n(!1))};return o.jsxs(X,{type:"button",variant:"outline",className:"w-full gap-2",onClick:r,disabled:t,children:[o.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",children:[o.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),o.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),o.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),o.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),t?"Redirecting...":e]})},TOe=()=>{const{user:e,loading:t}=Mt(),n=ps(),[r]=rc(),i=r.get("redirect"),[a,s]=b.useState(""),[l,c]=b.useState(""),[u,d]=b.useState(!1);if(!t&&e)return o.jsx(Yi,{to:i||"/",replace:!0});const f=async h=>{h.preventDefault(),d(!0);const{error:p}=await Y.auth.signInWithPassword({email:a,password:l});p?G.error(p.message):n(i||"/"),d(!1)};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs("div",{className:"w-full max-w-md animate-fade-in",children:[o.jsxs("div",{className:"mb-8 text-center",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-center gap-2",children:[o.jsx("img",{src:AOe,alt:"Review Kit",className:"h-8 w-8"}),o.jsx("h1",{className:"font-display text-3xl font-bold text-foreground",children:"Review Kit"})]}),o.jsx("p",{className:"text-muted-foreground",children:"Take Control Of Your Review Management"})]}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{className:"font-display",children:"Sign in"}),o.jsx(ft,{children:"Enter your credentials to access your dashboard"})]}),o.jsxs("form",{onSubmit:f,children:[o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"email",children:"Email"}),o.jsx(Te,{id:"email",type:"email",placeholder:"[email protected]",value:a,onChange:h=>s(h.target.value),required:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"password",children:"Password"}),o.jsx(Te,{id:"password",type:"password",placeholder:"••••••••",value:l,onChange:h=>c(h.target.value),required:!0})]})]}),o.jsxs(qu,{className:"flex flex-col gap-4",children:[o.jsx(X,{type:"submit",className:"w-full",disabled:u,children:u?"Signing in...":"Sign in"}),o.jsxs("div",{className:"relative w-full",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("span",{className:"w-full border-t border-border"})}),o.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:o.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or continue with"})})]}),o.jsx(rU,{label:"Google"}),o.jsx(X,{variant:"outline",className:"w-full",asChild:!0,children:o.jsx(on,{to:i?`/signup?redirect=${encodeURIComponent(i)}`:"/signup",children:"Create an account"})}),o.jsx(on,{to:"/forgot-password",className:"text-sm text-muted-foreground hover:underline",children:"Forgot password?"})]})]})]})]})})},ROe=um.url,IOe=()=>{const{user:e,loading:t}=Mt(),[n]=rc(),r=n.get("redirect"),[i,a]=b.useState(""),[s,l]=b.useState(""),[c,u]=b.useState(""),[d,f]=b.useState(!1),[h,p]=b.useState(!1);if(!t&&e)return o.jsx(Yi,{to:r||"/",replace:!0});const g=async m=>{var S;m.preventDefault(),f(!0);const v=r!=null&&r.startsWith("/")?r:"/",x=`${window.location.origin}${v}`,{data:y,error:w}=await Y.auth.signUp({email:i,password:s,options:{data:{full_name:c},emailRedirectTo:x}});if(w)G.error(w.message);else{y.session?($n("signed_up"),G.success("You're in — your 7-day free trial has started.")):p(!0);try{(S=window.gtag)==null||S.call(window,"event","conversion",{send_to:"AW-16472346323/3EHDCMDe4tQcENOd0K49",transaction_id:""})}catch(_){console.warn("gtag conversion failed",_)}}f(!1)};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs("div",{className:"w-full max-w-md animate-fade-in",children:[o.jsxs("div",{className:"mb-8 text-center",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-center gap-2",children:[o.jsx("img",{src:ROe,alt:"Review 
742Kit",className:"h-8 w-8"}),o.jsx("h1",{className:"font-display text-3xl font-bold text-foreground",children:"Review Kit"})]}),o.jsx("p",{className:"text-muted-foreground",children:"Take Control Of Your Review Management"})]}),h?o.jsx(pe,{children:o.jsxs(de,{className:"py-10 text-center",children:[o.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-primary/10",children:o.jsx(as,{className:"h-8 w-8 text-primary"})}),o.jsx("h2",{className:"mb-2 font-display text-xl font-bold text-foreground",children:"Check your email"}),o.jsx("p",{className:"mb-1 text-muted-foreground",children:"We've sent a verification link to"}),o.jsx("p",{className:"mb-6 font-medium text-foreground",children:i}),o.jsx("p",{className:"mb-6 text-sm text-muted-foreground",children:"Click the link in the email to activate your account and start your 7-day free trial."}),o.jsx(X,{variant:"outline",className:"gap-2",asChild:!0,children:o.jsxs(on,{to:r?`/login?redirect=${encodeURIComponent(r)}`:"/login",children:[o.jsx(f5,{className:"h-4 w-4"}),"Back to sign in"]})})]})}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mb-4 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3 text-center",children:[o.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm font-medium text-primary",children:[o.jsx(bn,{className:"h-4 w-4"}),"Start your 7-day free trial"]}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Full access to all Pro features including AI replies, analytics & more"})]}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{className:"font-display",children:"Create account"}),o.jsx(ft,{children:"Get started with Review Kit"})]}),o.jsxs(de,{className:"pb-0",children:[o.jsx(rU,{label:"Sign up with Google"}),o.jsxs("div",{className:"relative my-4 w-full",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("span",{className:"w-full border-t border-border"})}),o.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:o.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or with email"})})]})]}),o.jsxs("form",{onSubmit:g,children:[o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"fullName",children:"Full Name"}),o.jsx(Te,{id:"fullName",placeholder:"John Doe",value:c,onChange:m=>u(m.target.value),required:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"email",children:"Email"}),o.jsx(Te,{id:"email",type:"email",placeholder:"[email protected]",value:i,onChange:m=>a(m.target.value),required:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"password",children:"Password"}),o.jsx(Te,{id:"password",type:"password",placeholder:"••••••••",value:s,onChange:m=>l(m.target.value),required:!0,minLength:6})]})]}),o.jsxs(qu,{className:"flex flex-col gap-4",children:[o.jsx(X,{type:"submit",className:"w-full",disabled:d,children:d?"Creating account...":"Create account"}),o.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Already have an account?"," ",o.jsx(on,{to:r?`/login?redirect=${encodeURIComponent(r)}`:"/login",className:"text-primary hover:underline",children:"Sign in"})]})]})]})]})]})]})})},MOe=um.url,$Oe=()=>{const[e,t]=b.useState(""),[n,r]=b.useState(!1),[i,a]=b.useState(!1),s=async l=>{l.preventDefault(),r(!0);const{error:c}=await Y.auth.resetPasswordForEmail(e,{redirectTo:`${window.location.origin}/reset-password`});c?G.error(c.message):(a(!0),G.success("Check your email for a reset link!")),r(!1)};return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs("div",{className:"w-full max-w-md animate-fade-in",children:[o.jsx("div",{className:"mb-8 text-center",children:o.jsxs("div",{className:"mb-4 flex items-center justify-center gap-2",children:[o.jsx("img",{src:MOe,alt:"Review Kit",className:"h-8 w-8"}),o.jsx("h1",{className:"font-display text-3xl font-bold text-foreground",children:"Review Kit"})]})}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{className:"font-display",children:"Reset password"}),o.jsx(ft,{children:"We'll send you a link to reset your password"})]}),i?o.jsx(de,{children:o.jsx("p",{className:"text-center text-muted-foreground",children:"Check your email for a password reset link."})}):o.jsxs("form",{onSubmit:s,children:[o.jsx(de,{className:"space-y-4",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"email",children:"Email"}),o.jsx(Te,{id:"email",type:"email",placeholder:"[email protected]",value:e,onCh
742ange:l=>t(l.target.value),required:!0})]})}),o.jsx(qu,{className:"flex flex-col gap-4",children:o.jsx(X,{type:"submit",className:"w-full",disabled:n,children:n?"Sending...":"Send reset link"})})]}),o.jsx(qu,{children:o.jsx(on,{to:"/login",className:"w-full text-center text-sm text-primary hover:underline",children:"Back to sign in"})})]})]})})},DOe=um.url,LOe=()=>{const e=ps(),[t,n]=b.useState(""),[r,i]=b.useState(!1),[a,s]=b.useState(!1);b.useEffect(()=>{const c=window.location.hash;c&&c.includes("type=recovery")&&s(!0)},[]);const l=async c=>{c.preventDefault(),i(!0);const{error:u}=await Y.auth.updateUser({password:t});u?G.error(u.message):(G.success("Password updated successfully!"),e("/")),i(!1)};return a?o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsxs("div",{className:"w-full max-w-md animate-fade-in",children:[o.jsx("div",{className:"mb-8 text-center",children:o.jsxs("div",{className:"mb-4 flex items-center justify-center gap-2",children:[o.jsx("img",{src:DOe,alt:"Review Kit",className:"h-8 w-8"}),o.jsx("h1",{className:"font-display text-3xl font-bold text-foreground",children:"Review Kit"})]})}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{className:"font-display",children:"Set new password"}),o.jsx(ft,{children:"Enter your new password below"})]}),o.jsxs("form",{onSubmit:l,children:[o.jsx(de,{className:"space-y-4",children:o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"password",children:"New Password"}),o.jsx(Te,{id:"password",type:"password",placeholder:"••••••••",value:t,onChange:c=>n(c.target.value),required:!0,minLength:6})]})}),o.jsx(qu,{children:o.jsx(X,{type:"submit",className:"w-full",disabled:r,children:r?"Updating...":"Update password"})})]})]})]})}):o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:o.jsx(pe,{className:"w-full max-w-md",children:o.jsx(de,{className:"pt-6 text-center text-muted-foreground",children:"Invalid or expired reset link."})})})},If={name:"ReviewKit Pro",price:45,price_id:"price_1TAvzgHXJhlq0Pk7wrLtzBVd",product_id:"prod_U9ES7ZoqDye2pT",features:["Unlimited review syncing","Unlimited AI replies","Review chat with AI","Sentiment analysis","Email notifications","Custom reply tones","Advanced analytics","Priority support"]},FOe={maxBusinesses:1,maxReviews:200,aiReplies:!1,aiRepliesPerMonth:0,chat:!1},iU={maxBusinesses:1/0,maxReviews:1/0,aiReplies:!0,aiRepliesPerMonth:1/0,chat:!0};function BOe(e){return e?iU:FOe}const qC=()=>{const{subscription:e,isAdmin:t}=Mt();return{...t?iU:BOe(e.subscribed),subscribed:e.subscribed||t,loading:e.loading}},ds=b.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:he("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
742ing-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}));ds.displayName="Textarea";function UOe(e){if(!e.trim())return!0;try{const t=new URL(e.trim());return/^(www\.)?tripadvisor\.(com|co\.uk|ca|com\.au|co\.nz|ie|co\.za|in|com\.sg|com\.my|com\.ph|com\.hk|co\.id|co\.il|com\.tr|com\.br|com\.mx|com\.ar|cl|com\.co|com\.pe|com\.ve|es|fr|de|it|nl|pt|se|dk|no|fi|at|ch|be|ru|pl|cz|hu|ro|gr|bg|hr|rs|sk|si|ee|lv|lt|jp|kr|cn|tw|vn|th)$/i.test(t.hostname)}catch{return!1}}function zOe(e){if(!e.trim())return!0;try{const t=new URL(e.trim());return/^(www\.)?getyourguide\.(com|co\.uk|de|fr|es|it|nl|pt|at|ch|pl|com\.au|com\.br|ca|ie|se|dk|no|fi|com\.ar|com\.mx|co\.za|co\.nz|com\.sg|jp|kr|com\.tw|co\.il|com\.tr|ru|com\.hk)$/i.test(t.hostname)}catch{return!1}}function WOe(e){if(!e.trim())return!0;try{const t=new URL(e.trim());return/^(www|[a-z]{2})\.trustpilot\.com$/i.test(t.hostname)}catch{return!1}}function HOe(e){if(!e.trim())return!0;try{const t=new URL(e.trim());return/^([a-z-]+\.)?yelp\.(com|co\.uk|ca|ie|fr|de|it|es|nl|be|at|ch|se|dk|no|fi|pt|pl|cz|com\.au|com\.br|com\.mx|com\.sg|com\.ph|com\.tr|jp|hk|tw|com\.ar)$/i.test(t.hostname)}catch{return!1}}function ot(e,t){return t.trim()?e==="tripadvisor"&&!UOe(t)?"Please enter a valid TripAdvisor URL (e.g. https://www.tripadvisor.com/...)":e==="getyourguide"&&!zOe(t)?"Please enter a valid GetYourGuide URL (e.g. https://www.getyourguide.com/...)":e==="trustpilot"&&!WOe(t)?"Please enter a valid Trustpilot URL (e.g. https://www.trustpilot.com/review/yourbusiness.com)":e==="yelp"&&!HOe(t)?"Please enter a valid Yelp URL (e.g. https://www.yelp.com/biz/your-business)":null:null}const qOe=1,VOe="e5b11457-99a9-4102-a948-7fac8bb88b31",GOe="5450cc4f-4646-4831-99a5-ba4247c15425",KOe="/__l5e/assets-v1/e5b11457-99a9-4102-a948-7fac8bb88b31/tripadvisor-logo.png",YOe="a/v1/5450cc4f-4646-4831-99a5-ba4247c15425/e5b11457-99a9-4102-a948-7fac8bb88b31/tripadvisor-logo.png",XOe="tripadvisor-logo.png",QOe=7168,JOe="image/png",ZOe="2026-09-02T09:29:34Z",Kb={version:qOe,asset_id:VOe,project_id:GOe,url:KOe,r2_key:YOe,original_filename:XOe,size:QOe,content_type:JOe,created_at:ZOe},eAe=({open:e,onOpenChange:t,business:n,onSubmit:r,onCreate:i,onConnect:a,connectBusinessId:s,connectBusinessName:l,initialGmbData:c})=>{const u=_i(),d=()=>u.invalidateQueries({queryKey:["businesses"]}),[f,h]=b.useState("name"),[p,g]=b.useState((n==null?void 0:n.name)||""),[m,v]=b.useState((n==null?void 0:n.address)||""),[x,y]=b.useState(!1),[w,S]=b.useState([]),[_,j]=b.useState(null),[k,C]=b.useState(null),[E,A]=b.useState(null),[P,T]=b.useState(!1),[B,F]=b.useState(""),[M,L]=b.useState(""),[R,$]=b.useState(!1),[O,N]=b.useState(!1),[H,V]=b.useState(""),[D,K]=b.useState(""),[ae,se]=b.useState(""),[Q,ne]=b.useState(""),[Z,W]=b.useState(null),ee=!!n;b.useEffect(()=>{e&&s&&!n&&(W(s),l&&g(l),h(Ee=>Ee==="select"?Ee:"source"))},[e,s,l,n]),b.useEffect(()=>{c&&e&&(g(c.businessName),S(c.locations),C(c.tokens),h("select"))},[c,e]),b.useEffect(()=>{n&&(g(n.name),v(n.address||""),h("name"))},[n]);const q=async()=>{if(p.trim()){if(ee){ge();return}if($n("add_business_name_entered"),!Z&&i){y(!0);const Ee=await i(p.trim());if(y(!1),!Ee)return;W(Ee)}else if(Z){y(!0);const{error:Ee}=await Y.from("businesses").update({name:p.trim()}).eq("id",Z);if(y(!1),Ee){G.error("Couldn't update the business name. Please try again.");return}u.invalidateQueries({queryKey:["businesses"]})}h("source")}},re=()=>{E&&($n("add_business_platform_selected",{platform:E}),E==="google"?h("connect"):E==="tripadvisor"?h("tripadvisor"):E==="getyourguide"?h("getyourguide"):E==="trustpilot"?h("trustpilot"):E==="yelp"&&h("yelp"))},ge=async()=>{y(!0),await r({name:p,address:m||(n==null?void 0:n.address)||"",google_place_id:(n==null?void 0:n.google_place_id)||""})&&mt(),y(!1)},Ie=async()=>{$n("add_business_google_started"),y(!0);try{const{data:{session:Ee}}=await Y.auth.getSession();if(!Ee){G.error("Please sign in first");return}const Gt=`${window.location.origin}/google-business-callback`,{data:J,error:le}=await Y.functions.invoke("google-business-auth-url",{body:{redirect_uri:Gt,business_name:p}});if(le)throw le;J!=null&&J.url&&(localStorage.setItem("gmb_business_name",p),localStorage.setItem("gmb_redirect_uri",Gt),Z&&localStorage.setItem("gmb_business_id",Z),window.location.href=J.url)}catch(Ee){console.error("Error starting Google OAuth:",Ee),G.error("Failed to connect to Google. Please try again.")}finally{y(!1)}},ye=async(Ee,Gt)=>
742{if(!Z||!a){G.error("Something went wrong saving your business. Please close and try again."),h(Gt);return}h("saving"),y(!0),await a(Z,Ee)?(d(),mt()):h(Gt),y(!1)},qe=async()=>{H.trim()&&await ye({tripadvisor_url:H.trim()},"tripadvisor")},jt=async()=>{D.trim()&&await ye({getyourguide_url:D.trim()},"getyourguide")},pt=async()=>{ae.trim()&&await ye({trustpilot_url:ae.trim()},"trustpilot")},rn=async()=>{Q.trim()&&await ye({yelp_url:Q.trim()},"yelp")},Wt=async()=>{if(_){if(!(k!=null&&k.access_token)){G.error("Google connection expired before it could be saved. Please reconnect Google."),h("connect");return}await ye({name:_.title||p,address:_.address||"",google_place_id:_.placeId||"",google_access_token:k==null?void 0:k.access_token,google_refresh_token:k==null?void 0:k.refresh_token,google_account_name:_.accountName,google_location_name:_.locationName},"select")}},Sn=async()=>{if(!B.trim())return;$(!0);const{error:Ee}=await Y.functions.invoke("request-platform",{body:{platform:B.trim(),details:M.trim(),business_name:p.trim()}});if($(!1),Ee){G.error("Couldn't send your request. Please try again.");return}N(!0),F(""),L(""),G.success("Thanks! We've received your platform request.")},mt=()=>{h("name"),g(""),v(""),S([]),j(null),C(null),A(null),V(""),K(""),se(""),ne(""),W(null),T(!1),N(!1),F(""),L(""),t(!1)};return o.jsx(sc,{open:e,onOpenChange:Ee=>{Ee||mt()},children:o.jsxs(Mo,{className:"sm:max-w-lg",children:[o.jsx($o,{children:o.jsx(Do,{className:"font-display",children:ee?"Edit Business":"Add Business"})}),f==="name"&&o.jsxs("div",{className:"space-y-4",children:[!ee&&o.jsx("p",{className:"text-sm text-muted-foreground",children:"Start with your business name and connect your review platforms in the next step."}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"biz-name",children:"Business Name"}),o.jsx(Te,{id:"biz-name",placeholder:"My Restaurant",value:p,onChange:Ee=>g(Ee.target.value),onKeyDown:Ee=>Ee.key==="Enter"&&q(),autoFocus:!0})]}),ee&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"biz-address",children:"Address"}),o.jsx(Te,{id:"biz-address",placeholder:"123 Main St, City",value:m,onChange:Ee=>v(Ee.target.value)})]}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:mt,children:"Cancel"}),o.jsxs(X,{onClick:q,disabled:!p.trim()||x,children:[x&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),ee?"Save Changes":"Next"]})]})]}),f==="source"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Choose which review platform to connect first for ",o.jsx("strong",{className:"text-foreground",children:p}),":"]}),o.jsxs("div",{className:"grid gap-3",children:[o.jsx(pe,{className:`cursor-pointer transition-colors ${E==="google"?"border-primary bg-primary/5":"hover:border-primary/50"}`,onClick:()=>A("google"),children:o.jsxs(de,{className:"p-4 flex items-center gap-4",children:[o.jsx("div",{className:"shrink-0 w-10 h-10 rounded-lg bg-background flex items-center justify-center border",children:o.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[o.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),o.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),o.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),o.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-sm text-foreground",children:"Google Business Profile"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Connect via Google OAuth to import & reply to reviews"})]}),E==="google"&&o.jsx(ar,{className:"h-5 w-5 text-primary shrink-0"})]})}
742),o.jsx(pe,{className:`cursor-pointer transition-colors ${E==="tripadvisor"?"border-primary bg-primary/5":"hover:border-primary/50"}`,onClick:()=>A("tripadvisor"),children:o.jsxs(de,{className:"p-4 flex items-center gap-4",children:[o.jsx("div",{className:"shrink-0 w-12 h-12 rounded-lg flex items-center justify-center border bg-white",children:o.jsx("img",{src:Kb.url,alt:"TripAdvisor",className:"w-10 h-10 object-contain"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-sm text-foreground",children:"TripAdvisor"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Paste your TripAdvisor listing URL to import reviews"})]}),E==="tripadvisor"&&o.jsx(ar,{className:"h-5 w-5 text-primary shrink-0"})]})}),o.jsx(pe,{className:`cursor-pointer transition-colors ${E==="getyourguide"?"border-primary bg-primary/5":"hover:border-primary/50"}`,onClick:()=>A("getyourguide"),children:o.jsxs(de,{className:"p-4 flex items-center gap-4",children:[o.jsx("div",{className:"shrink-0 w-10 h-10 rounded-lg flex items-center justify-center border",style:{backgroundColor:"#FF55331A"},children:o.jsx("span",{className:"text-lg font-bold leading-none",style:{color:"#FF5533"},children:"G"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-sm text-foreground",children:"GetYourGuide"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Paste your GetYourGuide activity URL to import reviews"})]}),E==="getyourguide"&&o.jsx(ar,{className:"h-5 w-5 text-primary shrink-0"})]})}),o.jsx(pe,{className:`cursor-pointer transition-colors ${E==="trustpilot"?"border-primary bg-primary/5":"hover:border-primary/50"}`,onClick:()=>A("trustpilot"),children:o.jsxs(de,{className:"p-4 flex items-center gap-4",children:[o.jsx("div",{className:"shrink-0 w-10 h-10 rounded-lg bg-background flex items-center justify-center border",children:o.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",children:[o.jsx("rect",{width:"24",height:"24",rx:"4",fill:"#00B67A"}),o.jsx("path",{d:"M12 3l2.47 5.01L20 8.87l-4 3.9.94 5.5L12 15.49l-4.94 2.78.94-5.5-4-3.9 5.53-.86L12 3z",fill:"white"})]})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-sm text-foreground",children:"Trustpilot"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Paste your Trustpilot business URL to import reviews"})]}),E==="trustpilot"&&o.jsx(ar,{className:"h-5 w-5 text-primary shrink-0"})]})}),o.jsx(pe,{className:`cursor-pointer transition-colors ${E==="yelp"?"border-primary bg-primary/5":"hover:border-primary/50"}`,onClick:()=>A("yelp"),children:o.jsxs(de,{className:"p-4 flex items-center gap-4",children:[o.jsx("div",{className:"shrink-0 w-10 h-10 rounded-lg bg-background flex items-center justify-center border",children:o.jsx("span",{className:"text-lg font-bold leading-none",style:{color:"#D32323"},children:"Y"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-sm text-foreground",children:"Yelp"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Paste your Yelp business page URL to import reviews"})]}),E==="yelp"&&o.jsx(ar,{className:"h-5 w-5 text-primary shrink-0"})]})})]}),o.jsx("div",{className:"rounded-lg border border-dashed p-4",children:O?o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(ar,{className:"h-5 w-5 text-primary shrink-0 mt-0.5"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Request received"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"We'll be in touch by email once we can support that platform."})]})]}):P?o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"request-platform",children:"Which platform do you use?"}),o.jsx(Te,{id:"request-platform",placeholder:"e.g. Booking.com, Yelp, Viator",value:B,onChange:Ee=>F(Ee.target.value)})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"request-details",children:"Listing URL or notes (optional)"}),o.jsx(ds,{id:"request-details",rows:3,placeholder:"Paste your listing URL so we can prioritise it",value:M,onChange:Ee=>L(Ee.target.value)})]}),o.jsxs("div",{className:"flex justify-end gap-2",children:[o.jsx(X,{variant:"ghost",size:"sm",onClick:()=>T(!1),children:"Cancel"}),o.jsxs(X,{size:"sm",onClick:Sn,disabled:!B.trim()||R,children:[R&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Send request"]})]})]}):o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Don't see your review platform?"}),o.jsx(X,{variant:"outline",size:"sm",onClick:()=>T(!0),children:"Request a platform"})]})}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:()=>h("name"),children:"Back"}),o.jsx(X,{onClick:re,disabled:!E,children:"Continue"})]})]}),f==="connect"&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center space-y-3 py-4",children:[o.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/10 flex items-center justify-center",children:o.jsxs("svg",{className:"w-8 h-8",viewBox:"0 0 24 24",children:[o.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),o.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),o.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),o.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-display text-lg font-semibold text-foreground",children:"Connect to Google Business Profile"}),o.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Sign in with your Google account to link ",o.jsx("strong",{className:"text-foreground",children:p})," to your Google Business Profile and import reviews."]})]})]}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:()=>h("source"),children:"Back"}),o.jsxs(X,{onClick:Ie,disabled:x,children:[x&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Connect with Google"]})]})]}),f==="tripadvisor"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"tripadvisor-url",children:"TripAdvisor Listing URL"}),o.jsx(Te,{id:"tripadvisor-url",placeholder:"https://www.tripadvisor.com/Restaurant_Review-...",value:H,onChange:Ee=>V(Ee.target.value),autoFocus:!0}),ot("tripadvisor",H)?o.jsx("p",{className:"text-xs text-destructive",children:ot("tripadvisor",H)}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste the full URL of your business listing on TripAdvisor."})]}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:()=>h("source"),children:"Back"}),o.jsxs(X,{onClick:qe,disabled:!H.trim()||!!ot("tripadvisor",H)||x,children:[x&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Add Business"]})]})]}),f==="trustpilot"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"trustpilot-url",children:"Trustpilot Business URL"}),o.jsx(Te,{id:"trustpilot-url",placeholder:"https://www.trustpilot.com/review/yourbusiness.com",value:ae,onChange:Ee=>{const Gt=Ee.target.value.replace(/^(https?:\/\/)[a-z]{2}\.trustpilot\.com/,"$1www.trustpilot.com");se(Gt)},autoFocus:!0}),ot("trustpilot",ae)?o.jsx("p",{className:"text-xs text-destructive",children:ot("trustpilot",ae)}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste the full URL of your business page on Trustpilot."})]}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:()=>h("source"),children:"Back"}),o.jsxs(X,{onClick:pt,disabled:!ae.trim()||!!ot("trustpilot",ae)||x,children:[x&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Add Business"]})]})]}),f==="getyourguide"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"gyg-url",children:"GetYourGuide Activity URL"}),o.jsx(Te,{id:"gyg-url",placeholder:"https://www.getyourguide.com/...",value:D,onChange:Ee=>K(Ee.target.value),autoFocus:!0}),ot("getyourguide",D)?o.jsx("p",{className:"text-xs text-destructive",children:ot("getyourguide",D)}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste the full URL of your activity listing on GetYourGuide."})]}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:()=>h("source"),children:"Back"}),o.jsxs(X,{onClick:jt,disabled:!D.trim()||!!ot("getyourguide",D)||x,children:[x&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Add Business"]})]})]}),f==="yelp"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"yelp-url",children:"Yelp Business URL"}),o.jsx(Te,{id:"yelp-url",placeholder:"https://www.yelp.com/biz/your-business",value:Q,onChange:Ee=>ne(Ee.target.value),autoFocus:!0}),ot("yelp",Q)?o.jsx("p",{className:"text-xs text-destructive",children:ot("yelp",Q)}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste the full URL of your business page on Yelp."})]}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:()=>h("source"),children:"Back"}),o.jsxs(X,{onClick:rn,disabled:!Q.trim()||!!ot("yelp",Q)||x,children:[x&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Add Business"]})]})]}),f==="select"&&o.jsxs("div",{className:"space-y-4",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Select the Google Business location to link:"}),w.length===0?o.jsxs("div",{className:"py-8 text-center text-muted-foreground",children:[o.jsx("p",{children:"No business locations foun
742d in your Google account."}),o.jsx("p",{className:"text-xs mt-2",children:"Make sure your business is listed on Google Business Profile."})]}):o.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:w.map((Ee,Gt)=>o.jsx(pe,{className:`cursor-pointer transition-colors ${_===Ee?"border-primary bg-primary/5":"hover:border-primary/50"}`,onClick:()=>j(Ee),children:o.jsxs(de,{className:"p-3 flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-sm text-foreground truncate",children:Ee.title}),Ee.address&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-0.5",children:[o.jsx(Id,{className:"h-3 w-3 shrink-0"}),o.jsx("span",{className:"truncate",children:Ee.address})]})]}),_===Ee&&o.jsx(ar,{className:"h-5 w-5 text-primary shrink-0"})]})},Gt))}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:mt,children:"Cancel"}),o.jsx(X,{onClick:Wt,disabled:!_,children:"Link Business"})]})]}),f==="saving"&&o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-3",children:[o.jsx(ke,{className:"h-8 w-8 animate-spin text-primary"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Linking your business..."})]})]})})},tAe=[{value:"professional",label:"Professional",description:"Formal and business-like"},{value:"friendly",label:"Friendly",description:"Warm and approachable"},{value:"casual",label:"Casual",description:"Relaxed and conversational"},{value:"empathetic",label:"Empathetic",description:"Compassionate and understanding"},{value:"enthusiastic",label:"Enthusiastic",description:"Energetic and upbeat"}],nAe=({open:e,onOpenChange:t,businessName:n,currentTone:r,currentInstructions:i,onSave:a})=>{const[s,l]=b.useState(r),[c,u]=b.useState(i),[d,f]=b.useState(!1),h=async()=>{f(!0);const g=await a(s,c);f(!1),g&&t(!1)},p=g=>{g&&(l(r),u(i)),t(g)};return o.jsx(sc,{open:e,onOpenChange:p,children:o.jsxs(Mo,{className:"sm:max-w-lg",children:[o.jsx($o,{children:o.jsxs(Do,{className:"font-display flex items-center gap-2",children:[o.jsx(bn,{className:"h-5 w-5 text-primary"}),"AI Reply Settings"]})}),o.jsxs("div",{className:"space-y-5",children:[o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure how AI generates reply suggestions for ",o.jsx("strong",{className:"text-foreground",children:n}),"."]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{children:"Reply Tone"}),o.jsxs(St,{value:s,onValueChange:l,children:[o.jsx(wt,{children:o.jsx(kt,{})}),o.jsx(_t,{children:tAe.map(g=>o.jsxs(we,{value:g.value,children:[o.jsx("span",{className:"font-medium",children:g.label}),o.jsxs("span",{className:"ml-2 text-muted-foreground",children:["— ",g.description]})]},g.value))})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{children:"Custom Instructions"}),o.jsx(ds,{placeholder:"E.g., Always mention our loyalty program. Sign off with the manager's name (Sarah). Invite unhappy customers to email [email protected]...",value:c,onChange:g=>u(g.target.value),rows:4,maxLength:1e3,className:"text-sm"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.length,"/1000 — These instructions guide the AI when generating reply suggestions."]})]})]}),o.jsxs(sa,{children:[o.jsx(X,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),o.jsxs(X,{onClick:h,disabled:d,children:[d&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Settings"]})]})]})})};var Lw="rovingFocusGroup.onEntryFocus",rAe={bubbles:!1,cancelable:!0},_m="RovingFocusGroup",[kS,aU,iAe]=Zp(_m),[aAe,Yb]=Fn(_m,[iAe]),[sAe,oAe]=aAe(_m),sU=b.forwardRef((e,t)=>o.jsx(kS.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(kS.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(lAe,{...e,ref:t})})}));sU.displayName=_m;var lAe=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=b.useRef(null),p=Qe(t,h),g=wm(a),[m,v]=Tr({prop:s,defaultProp:l??null,onChange:c,caller:_m}),[x,y]=b.useState(!1),w=Ar(u),S=aU(n),_=b.useRef(!1),[j,k]=b.useState(0);return b.useEffect(()=>{const C=h.current;if(C)return C.addEventListener(Lw,w),()=>C.removeEventListener(Lw,w)},[w]),o.jsx(sAe,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:m,onItemFocus:b.useCallback(C=>v(C),[v]),onItemShiftTab:b.useCallback(()=>y(!0),[]),onFocusableItemAdd:b.useCallback(()=>k(C=>C+1),[]),onFocusableItemRemove:b.useCallback(()=>k(C=>C-1),[]),children:o.jsx(Ce.div,{tabIndex:x||j===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:me(e.onMouseDown,()=>{_.current=!0}
vendor: 17,193 bytes, line 742
742),onFocus:me(e.onFocus,C=>{const E=!_.current;if(C.target===C.currentTarget&&E&&!x){const A=new CustomEvent(Lw,rAe);if(C.currentTarget.dispatchEvent(A),!A.defaultPrevented){const P=S().filter(L=>L.focusable),T=P.find(L=>L.active),B=P.find(L=>L.id===m),M=[T,B,...P].filter(Boolean).map(L=>L.ref.current);cU(M,d)}}_.current=!1}),onBlur:me(e.onBlur,()=>y(!1))})})}),oU="RovingFocusGroupItem",lU=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...l}=e,c=Pr(),u=a||c,d=oAe(oU,n),f=d.currentTabStopId===u,h=aU(n),{onFocusableItemAdd:p,onFocusableItemRemove:g,currentTabStopId:m}=d;return b.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),o.jsx(kS.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:o.jsx(Ce.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:me(e.onMouseDown,v=>{r?d.onItemFocus(u):v.preventDefault()}),onFocus:me(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){d.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const x=dAe(v,d.orientation,d.dir);if(x!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(v.currentTarget);w=d.loop?fAe(w,S+1):w.slice(S+1)}setTimeout(()=>cU(w))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:m!=null}):s})})});lU.displayName=oU;var cAe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uAe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dAe(e,t,n){const r=uAe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cAe[r]}function cU(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function fAe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uU=sU,dU=lU,NS=["Enter"," "],hAe=["ArrowDown","PageUp","Home"],fU=["ArrowUp","PageDown","End"],pAe=[...hAe,...fU],mAe={ltr:[...NS,"ArrowRight"],rtl:[...NS,"ArrowLeft"]},gAe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},jm="Menu",[Bp,vAe,yAe]=Zp(jm),[hc,hU]=Fn(jm,[yAe,Io,Yb]),Xb=Io(),pU=Yb(),[xAe,pc]=hc(jm),[bAe,Sm]=hc(jm),mU=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:s=!0}=e,l=Xb(t),[c,u]=b.useState(null),d=b.useRef(!1),f=Ar(a),h=wm(i);return b.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),o.jsx(Mx,{...l,children:o.jsx(xAe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(bAe,{scope:t,onClose:b.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:s,children:r})})})};mU.displayName=jm;var wAe="MenuAnchor",VC=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Xb(n);return o.jsx(nm,{...i,...r,ref:t})});VC.displayName=wAe;var GC="MenuPortal",[_Ae,gU]=hc(GC,{forceMount:void 0}),vU=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=pc(GC,t);return o.jsx(_Ae,{scope:t,forceMount:n,children:o.jsx(pr,{present:n||a.open,children:o.jsx(Ad,{asChild:!0,container:i,children:r})})})};vU.displayName=GC;var gi="MenuContent",[jAe,KC]=hc(gi),yU=b.forwardRef((e,t)=>{const n=gU(gi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=pc(gi,e.__scopeMenu),s=Sm(gi,e.__scopeMenu);return o.jsx(Bp.Provider,{scope:e.__scopeMenu,children:o.jsx(pr,{present:r||a.open,children:o.jsx(Bp.Slot,{scope:e.__scopeMenu,children:s.modal?o.jsx(SAe,{...i,ref:t}):o.jsx(kAe,{...i,ref:t})})})})}),SAe=b.forwardRef((e,t)=>{const n=pc(gi,e.__scopeMenu),r=b.useRef(null),i=Qe(t,r);return b.useEffect(()=>{const a=r.current;if(a)return Gx(a)},[]),o.jsx(YC,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kAe=b.forwardRef((e,t)=>{const n=pc(gi,e.__scopeMenu);return o.jsx(YC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),NAe=wo("MenuContent.ScrollLock"),YC=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:g,...m}=e,v=pc(gi,n),x=Sm(gi,n),y=Xb(n),w=pU(n),S=vAe(n),[_,j]=b.useState(null),k=b.useRef(null),C=Qe(t,k,v.onContentChange),E=b.useRef(0),A=b.useRef(""),P=b.useRef(0),T=b.useRef(null),B=b.useRef("right"),F=b.useRef(0),M=g?am:b.Fragment,L=g?{as:NAe,allowPinchZoom:!0}:void 0,R=O=>{var Q,ne;const N=A.current+O,H=S().filter(Z=>!Z.disabled),V=document.activeElement,D=(Q=H.find(Z=>Z.ref.current===V))==null?void 0:Q.textValue,K=H.map(Z=>Z.textValue),ae=LAe(K,N,D),se=(ne=H.find(Z=>Z.textValue===ae))==null?void 0:ne.ref.current;(function Z(W){A.current=W,window.clearTimeout(E.current),W!==""&&(E.current=window.setTimeout(()=>Z(""),1e3))})(N),se&&setTimeout(()=>se.focus())};b.useEffect(()=>()=>window.clearTimeout(E.current),[]),qx();const $=b.useCallback(O=>{var H,V;return B.current===((H=T.current)==null?void 0:H.side)&&BAe(O,(V=T.current)==null?void 0:V.area)},[]);return o.jsx(jAe,{scope:n,searchRef:A,onItemEnter:b.useCallback(O=>{$(O)&&O.preventDefault()},[$]),onItemLeave:b.useCallback(O=>{var N;$(O)||((N=k.current)==null||N.focus(),j(null))},[$]),onTriggerLeave:b.useCallback(O=>{$(O)&&O.preventDefault()},[$]),pointerGraceTimerRef:P,onPointerGraceIntentChange:b.useCallback(O=>{T.current=O},[]),children:o.jsx(M,{...L,children:o.jsx(im,{asChild:!0,trapped:i,onMountAutoFocus:me(a,O=>{var N;O.preventDefault(),(N=k.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:o.jsx(ic,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:o.jsx(uU,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:j,onEntryFocus:me(c,O=>{x.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx($x,{role:"menu","aria-orientation":"vertical","data-state":IU(v.open),"data-radix-menu-content":"",dir:x.dir,...y,...m,ref:C,style:{outline:"none",...m.style},onKeyDown:me(m.onKeyDown,O=>{const H=O.target.closest("[data-radix-menu-content]")===O.currentTarget,V=O.ctrlKey||O.altKey||O.metaKey,D=O.key.length===1;H&&(O.key==="Tab"&&O.preventDefault(),!V&&D&&R(O.key));const K=k.current;if(O.target!==K||!pAe.includes(O.key))return;O.preventDefault();const se=S().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);fU.includes(O.key)&&se.reverse(),$Ae(se)}),onBlur:me(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(E.current),A.current="")}),onPointerMove:me(e.onPointerMove,Up(O=>{const N=O.target,H=F.current!==O.clientX;if(O.currentTarget.contains(N)&&H){const V=O.clientX>F.current?"right":"left";B.current=V,F.current=O.clientX}}))})})})})})})});yU.displayName=gi;var CAe="MenuGroup",XC=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ce.div,{role:"group",...r,ref:t})});XC.displayName=CAe;var EAe="MenuLabel",xU=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ce.div,{...r,ref:t})});xU.displayName=EAe;var ex="MenuItem",UI="menu.itemSelect",Qb=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=b.useRef(null),s=Sm(ex,e.__scopeMenu),l=KC(ex,e.__scopeMenu),c=Qe(t,a),u=b.useRef(!1),d=()=>{const f=a.current;if(!n&&f){const h=new CustomEvent(UI,{bubbles:!0,cancelable:!0});f.addEventListener(UI,p=>r==null?void 0:r(p),{once:!0}),Xk(f,h),h.defaultPrevented?u.current=!1:s.onClose()}};return o.jsx(bU,{...i,ref:c,disabled:n,onClick:me(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:me(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:me(e.onKeyDown,f=>{const h=l.searchRef.current!=="";n||h&&f.key===" "||NS.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Qb.displayName=ex;var bU=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,s=KC(ex,n),l=pU(n),c=b.useRef(null),u=Qe(t,c),[d,f]=b.useState(!1),[h,p]=b.useState("");return b.useEffect(()=>{const g=c.current;g&&p((g.textContent??"").trim())},[a.children]),o.jsx(Bp.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:o.jsx(dU,{asChild:!0,...l,focusable:!r,children:o.jsx(Ce.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:me(e.onPointerMove,Up(g=>{r?s.onItemLeave(g):(s.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(e.onPointerLeave,Up(g=>s.onItemLeave(g))),onFocus:me(e.onFocus,()=>f(!0)),onBlur:me(e.onBlur,()=>f(!1))})})})}),PAe="MenuCheckboxItem",wU=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return o.jsx(NU,{scope:e.__scopeMenu,checked:n,children:o.jsx(Qb,{role:"menuitemcheckbox","aria-checked":tx(n)?"mixed":n,...i,ref:t,"data-state":JC(n),onSelect:me(i.onSelect,()=>r==null?void 0:r(tx(n)?!0:!n),{checkForDefaultPrevented:!1})})})});wU.displayName=PAe;var _U="MenuRadioGroup",[OAe,AAe]=hc(_U,{value:void 0,onValueChange:()=>{}}),jU=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=Ar(r);return o.jsx(OAe,{scope:e.__scopeMenu,value:n,onValueChange:a,children:o.jsx(XC,{...i,ref:t})})});jU.displayName=_U;var SU="MenuRadioItem",kU=b.forwardRef((e,t)=>{const{value:n,...r}=e,i=AAe(SU,e.__scopeMenu),a=n===i.value;return o.jsx(NU,{scope:e.__scopeMenu,checked:a,children:o.jsx(Qb,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":JC(a),onSelect:me(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});kU.displayName=SU;var QC="MenuItemIndicator",[NU,TAe]=hc(QC,{checked:!1}),CU=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=TAe(QC,n);return o.jsx(pr,{present:r||tx(a.checked)||a.checked===!0,children:o.jsx(Ce.span,{...i,ref:t,"data-state":JC(a.checked)})})});CU.displayName=QC;var RAe="MenuSeparator",EU=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ce.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});EU.displayName=RAe;var IAe="MenuArrow",PU=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Xb(n);return o.jsx(Dx,{...i,...r,ref:t})});PU.displayName=IAe;var MAe="MenuSub",[RLe,OU]=hc(MAe),Yf="MenuSubTrigger",AU=b.forwardRef((e,t)=>{const n=pc(Yf,e.__scopeMenu),r=Sm(Yf,e.__scopeMenu),i=OU(Yf,e.__scopeMenu),a=KC(Yf,e.__scopeMenu),s=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=b.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return b.useEffect(()=>d,[d]),b.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),o.jsx(VC,{asChild:!0,...u,children:o.jsx(bU,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":IU(n.open),...e,ref:Nx(t,i.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:me(e.onPointerMove,Up(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:me(e.onPointerLeave,Up(f=>{var p,g;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const m=(g=n.content)==null?void 0:g.dataset.side,v=m==="right",x=v?-5:5,y=h[v?"left":"right"],w=h[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+x,y:f.clientY},{x:y,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:y,y:h.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:me(e.onKeyDown,f=>{var p;const h=a.searchRef.current!=="";e.disabled||h&&f.key===" "||mAe[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});AU.displayName=Yf;var TU="MenuSubContent",RU=b.forwardRef((e,t)=>{const n=gU(gi,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=pc(gi,e.__scopeMenu),s=Sm(gi,e.__scopeMenu),l=OU(TU,e.__scopeMenu),c=b.useRef(null),u=Qe(t,c);return o.jsx(Bp.Provider,{scope:e.__scopeMenu,children:o.jsx(pr,{present:r||a.open,children:o.jsx(Bp.Slot,{scope:e.__scopeMenu,children:o.jsx(YC,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;s.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:me(e.onFocusOutside,d=>{d.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:me(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:me(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=gAe[s.dir].includes(d.key);f&&h&&(a.onOpenChange(!1),(p=l.trigger)==null||p.focus(),d.preventDefault())})})})})})});RU.displayName=TU;function IU(e){return e?"open":"closed"}function tx(e){return e==="indeterminate"}function JC(e){return tx(e)?"indeterminate":e?"checked":"unchecked"}function $Ae(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function DAe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function LAe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let s=DAe(e,Math.max(a,0));i.length===1&&(s=s.filter(u=>u!==n));const c=s.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function FAe(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,s=t.length-1;a<t.length;s=a++){const l=t[a],c=t[s],u=l.x,d=l.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(i=!i)}return i}function BAe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return FAe(n,t)}function Up(e){return t=>t.pointerType==="mouse"?e(t):void 0}var UAe=mU,zAe=VC,WAe=vU,HAe=yU,qAe=XC,VAe=xU,GAe=Qb,KAe=wU,YAe=jU,XAe=kU,QAe=CU,JAe=EU,ZAe=PU,eTe=AU,tTe=RU,Jb="DropdownMenu",[nTe,ILe]=Fn(Jb,[hU]),mr=hU(),[rTe,MU]=nTe(Jb),$U=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:l=!0}=e,c=mr(t),u=b.useRef(null),[d,f]=Tr({prop:i,defaultProp:a??!1,onChange:s,caller:Jb});return o.jsx(rTe,{scope:t,triggerId:Pr(),triggerRef:u,contentId:Pr(),open:d,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(h=>!h),[f]),modal:l,children:o.jsx(UAe,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};$U.displayName=Jb;var DU="DropdownMenuTrigger",LU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=MU(DU,n),s=mr(n);return o.jsx(zAe,{asChild:!0,...s,children:o.jsx(Ce.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Nx(t,a.triggerRef),onPointerDown:me(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:me(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});LU.displayName=DU;var iTe="DropdownMenuPortal",FU=e=>{const{__scopeDropdownMenu:t,...n}=e,r=mr(t);return o.jsx(WAe,{...r,...n})};FU.displayName=iTe;var BU="DropdownMenuContent",UU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=MU(BU,n),a=mr(n),s=b.useRef(!1);return o.jsx(HAe,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:me(e.onCloseAutoFocus,l=>{var c;s.current||(c=i.triggerRef.current)==null||c.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:me(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!i.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});UU.displayName=BU;var aTe="DropdownMenuGroup",sTe=b.forwardRef((e,t)=>
742{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(qAe,{...i,...r,ref:t})});sTe.displayName=aTe;var oTe="DropdownMenuLabel",zU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(VAe,{...i,...r,ref:t})});zU.displayName=oTe;var lTe="DropdownMenuItem",WU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(GAe,{...i,...r,ref:t})});WU.displayName=lTe;var cTe="DropdownMenuCheckboxItem",HU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(KAe,{...i,...r,ref:t})});HU.displayName=cTe;var uTe="DropdownMenuRadioGroup",dTe=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(YAe,{...i,...r,ref:t})});dTe.displayName=uTe;var fTe="DropdownMenuRadioItem",qU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(XAe,{...i,...r,ref:t})});qU.displayName=fTe;var hTe="DropdownMenuItemIndicator",VU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(QAe,{...i,...r,ref:t})});VU.displayName=hTe;var pTe="DropdownMenuSeparator",GU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(JAe,{...i,...r,ref:t})});GU.displayName=pTe;var mTe="DropdownMenuArrow",gTe=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(ZAe,{...i,...r,ref:t})});gTe.displayName=mTe;var vTe="DropdownMenuSubTrigger",KU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(eTe,{...i,...r,ref:t})});KU.displayName=vTe;var yTe="DropdownMenuSubContent",YU=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mr(n);return o.jsx(tTe,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});YU.displayName=yTe;var xTe=$U,bTe=LU,wTe=FU,XU=UU,QU=zU,JU=WU,ZU=HU,ez=qU,tz=VU,nz=GU,rz=KU,iz=YU;const _Te=xTe,jTe=bTe,STe=b.forwardRef(({className:e,inset:t,children:n,...r},i)=>o.jsxs(rz,{ref:i,className:he("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,o.jsx(Ox,{className:"ml-auto h-4 w-4"})]}));STe.displayName=rz.displayName;const kTe=b.forwardRef(({className:e,...t},n)=>o.jsx(iz,{ref:n,className:he("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));kTe.displayName=iz.displayName;const az=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(wTe,{children:o.jsx(XU,{ref:r,sideOffset:t,className:he("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",e),...n})}));az.displayName=XU.displayName;const sv=b.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(JU,{ref:r,className:he("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));sv.displayName=JU.displayName;const NTe=b.forwardRef(({className:e,children:t,checked:n,...r},i)=>o.jsxs(ZU,{ref:i,className:he("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(tz,{children:o.jsx(To,{className:"h-4 w-4"})})}),t]}));NTe.displayName=ZU.displayName;const CTe=b.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(ez,{ref:r,className:he("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(tz,{children:o.jsx(m5,{className:"h-2 w-2 fill-current"})})}),t]}));CTe.displayName=ez.displayName;const ETe=b.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(QU,{ref:r,className:he("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));ETe.displayName=QU.displayName;const PTe=b.forwardRef(({className:e,...t},n)=>o.jsx(nz,{ref:n,className:he("-mx-1 my-1 h-px bg-muted",e),...t}));PTe.displayName=nz.displayName;var sz="AlertDialog",[OTe,MLe]=Fn(sz,[z4]),bs=z4(),oz=e=>{const{__scopeAlertDialog:t,...n}=e,r=bs(t);return o.jsx(jN,{...r,...n,modal:!0})};oz.displayName=sz;var ATe="AlertDialogTrigger",lz=b.forwardRef((e,t)=>
742{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return o.jsx(iL,{...i,...r,ref:t})});lz.displayName=ATe;var TTe="AlertDialogPortal",cz=e=>{const{__scopeAlertDialog:t,...n}=e,r=bs(t);return o.jsx(SN,{...r,...n})};cz.displayName=TTe;var RTe="AlertDialogOverlay",uz=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return o.jsx(sm,{...i,...r,ref:t})});uz.displayName=RTe;var vu="AlertDialogContent",[ITe,MTe]=OTe(vu),$Te=B3("AlertDialogContent"),dz=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,a=bs(n),s=b.useRef(null),l=Qe(t,s),c=b.useRef(null);return o.jsx(fte,{contentName:vu,titleName:fz,docsSlug:"alert-dialog",children:o.jsx(ITe,{scope:n,cancelRef:c,children:o.jsxs(om,{role:"alertdialog",...a,...i,ref:l,onOpenAutoFocus:me(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[o.jsx($Te,{children:r}),o.jsx(LTe,{contentRef:s})]})})})});dz.displayName=vu;var fz="AlertDialogTitle",hz=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return o.jsx(lm,{...i,...r,ref:t})});hz.displayName=fz;var pz="AlertDialogDescription",mz=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return o.jsx(cm,{...i,...r,ref:t})});mz.displayName=pz;var DTe="AlertDialogAction",gz=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bs(n);return o.jsx(Yx,{...i,...r,ref:t})});gz.displayName=DTe;var vz="AlertDialogCancel",yz=b.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=MTe(vz,n),a=bs(n),s=Qe(t,i);return o.jsx(Yx,{...a,...r,ref:s})});yz.displayName=vz;var LTe=({contentRef:e})=>{const t=`\`${vu}\` requires a description for the component to be accessible for screen reader users.
743
744You can add a description to the \`${vu}\` by passing a \`${pz}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
745
746Alternatively, 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 \`${vu}\`. 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.
747
748For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return b.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},FTe=oz,BTe=lz,UTe=cz,xz=uz,bz=dz,wz=gz,_z=yz,jz=hz,Sz=mz;const Zb=FTe,kz=BTe,zTe=UTe,Nz=b.forwardRef(({className:e,...t},n)=>o.jsx(xz,{className:he("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}));Nz.displayName=xz.displayName;const km=b.forwardRef(({className:e,...t},n)=>o.jsxs(zTe,{children:[o.jsx(Nz,{}),o.jsx(bz,{ref:n,className:he("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})]}));km.displayName=bz.displayName;const Nm=({className:e,...t})=>o.jsx("div",{className:he("flex flex-col space-y-2 text-center sm:text-left",e),...t});Nm.displayName="AlertDialogHeader";const Cm=({className:e,...t})=>o.jsx("div",{className:he("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Cm.displayName="AlertDialogFooter";const Em=b.forwardRef(({className:e,...t},n)=>o.jsx(jz,{ref:n,className:he("text-lg font-semibold",e),...t}));Em.displayName=jz.displayName;const Pm=b.forwardRef(({className:e,...t},n)=>o.jsx(Sz,{ref:n,className:he("text-sm text-muted-foreground",e),...t}));Pm.displayName=Sz.displayName;const Om=b.forwardRef(({className:e,...t},n)=>o.jsx(wz,{ref:n,className:he(Hu(),e),...t}));Om.displayName=wz.displayName;const Am=b.forwardRef(({className:e,...t},n)=>o.jsx(_z,{ref:n,className:he(Hu({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Am.displayName=_z.displayName;var e0="Tabs",[WTe,$Le]=Fn(e0,[Yb]),Cz=Yb(),[HTe,ZC]=WTe(e0),Ez=b.forwardRef((e,t)=>
vendor: 3,031 bytes, line 748
748{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:s="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=wm(l),[f,h]=Tr({prop:r,onChange:i,defaultProp:a??"",caller:e0});return o.jsx(HTe,{scope:n,baseId:Pr(),value:f,onValueChange:h,orientation:s,dir:d,activationMode:c,children:o.jsx(Ce.div,{dir:d,"data-orientation":s,...u,ref:t})})});Ez.displayName=e0;var Pz="TabsList",Oz=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,a=ZC(Pz,n),s=Cz(n);return o.jsx(uU,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:r,children:o.jsx(Ce.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});Oz.displayName=Pz;var Az="TabsTrigger",Tz=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,s=ZC(Az,n),l=Cz(n),c=Mz(s.baseId,r),u=$z(s.baseId,r),d=r===s.value;return o.jsx(dU,{asChild:!0,...l,focusable:!i,active:d,children:o.jsx(Ce.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...a,ref:t,onMouseDown:me(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:me(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!i&&f&&s.onValueChange(r)})})})});Tz.displayName=Az;var Rz="TabsContent",Iz=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,l=ZC(Rz,n),c=Mz(l.baseId,r),u=$z(l.baseId,r),d=r===l.value,f=b.useRef(d);return b.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),o.jsx(pr,{present:i||d,children:({present:h})=>o.jsx(Ce.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&a})})});Iz.displayName=Rz;function Mz(e,t){return`${e}-trigger-${t}`}function $z(e,t){return`${e}-content-${t}`}var qTe=Ez,Dz=Oz,Lz=Tz,Fz=Iz;const Tm=qTe,nf=b.forwardRef(({className:e,...t},n)=>o.jsx(Dz,{ref:n,className:he("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));nf.displayName=Dz.displayName;const Kn=b.forwardRef(({className:e,...t},n)=>o.jsx(Lz,{ref:n,className:he("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Kn.displayName=Lz.displayName;const kr=b.forwardRef(({className:e,...t},n)=>o.jsx(Fz,{ref:n,className:he("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));kr.displayName=Fz.displayName;
vendor: 4,258 bytes, line 748
748var t0="Collapsible",[VTe,Bz]=Fn(t0),[GTe,eE]=VTe(t0),Uz=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...l}=e,[c,u]=Tr({prop:r,defaultProp:i??!1,onChange:s,caller:t0});return o.jsx(GTe,{scope:n,disabled:a,contentId:Pr(),open:c,onOpenToggle:b.useCallback(()=>u(d=>!d),[u]),children:o.jsx(Ce.div,{"data-state":iE(c),"data-disabled":a?"":void 0,...l,ref:t})})});Uz.displayName=t0;var zz="CollapsibleTrigger",tE=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=eE(zz,n);return o.jsx(Ce.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":iE(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:me(e.onClick,i.onOpenToggle)})});tE.displayName=zz;var nE="CollapsibleContent",rE=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=eE(nE,e.__scopeCollapsible);return o.jsx(pr,{present:n||i.open,children:({present:a})=>o.jsx(KTe,{...r,ref:t,present:a})})});rE.displayName=nE;var KTe=b.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...a}=e,s=eE(nE,n),[l,c]=b.useState(r),u=b.useRef(null),d=Qe(t,u),f=b.useRef(0),h=f.current,p=b.useRef(0),g=p.current,m=s.open||l,v=b.useRef(m),x=b.useRef(void 0);return b.useEffect(()=>{const y=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(y)},[]),Pn(()=>{const y=u.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();f.current=w.height,p.current=w.width,v.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),c(r)}},[s.open,r]),o.jsx(Ce.div,{"data-state":iE(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...a,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&i})});function iE(e){return e?"open":"closed"}var Wz=Uz,YTe=tE,XTe=rE,ta="Accordion",QTe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[aE,JTe,ZTe]=Zp(ta),[n0,DLe]=Fn(ta,[ZTe,Bz]),sE=Bz(),Hz=I.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,a=r;return o.jsx(aE.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?o.jsx(rRe,{...a,ref:t}):o.jsx(nRe,{...i,ref:t})})});Hz.displayName=ta;var[qz,eRe]=n0(ta),[Vz,tRe]=n0(ta,{collapsible:!1}),nRe=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...s}=e,[l,c]=Tr({prop:n,defaultProp:r??"",onChange:i,caller:ta});return o.jsx(qz,{scope:e.__scopeAccordion,value:I.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:I.useCallback(()=>a&&c(""),[a,c]),children:o.jsx(Vz,{scope:e.__scopeAccordion,collapsible:a,children:o.jsx(Gz,{...s,ref:t})})})}),rRe=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[s,l]=Tr({prop:n,defaultProp:r??[],onChange:i,caller:ta}),c=I.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=I.useCallback(d=>l((f=[])=>f.filter(h=>h!==d)),[l]);return o.jsx(qz,{scope:e.__scopeAccordion,value:s,onItemOpen:c,onItemClose:u,children:o.jsx(Vz,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(Gz,{...a,ref:t})})})}),[iRe,r0]=n0(ta),Gz=I.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:a="vertical",...s}=e,l=I.useRef(null),c=Qe(l,t),u=JTe(n),f=wm(i)==="ltr",h=me(e.onKeyDown,p=>{var C;if(!QTe.includes(p.key))return;const g=p.target,m=u().filter(E=>{var A;return!((A=E.ref.current)!=null&&A.disabled)}),v=m.findIndex(E=>E.ref.current===g),x=m.length;if(v===-1)return;p.preventDefault();let y=v;const w=0,S=x-1,_=()=>{y=v+1,y>S&&(y=w)},j=()=>{y=v-1,y<w&&(y=S)};switch(p.key){case"Home":y=w;break;case"End":y=S;break;case"ArrowRight":a==="horizontal"&&(f?_():j());break;case"ArrowDown":a==="vertical"&&_();break;case"ArrowLeft":a==="horizontal"&&(f?j():_());break;case"ArrowUp":a==="vertical"&&j();break}const k=y%x;(C=m[k].ref.current)==null||C.focus()});return o.jsx(iRe,{scope:n,disabled:r,direction:i,orientation:a,children:o.jsx(aE.Slot,{scope:n,children:o.jsx(Ce.div,{...s,"data-orientation":a,ref:c,onKeyDown:r?void 0:h})})})}),nx="AccordionItem",[aRe,oE]=n0(nx),Kz=I.forwardRef((e,t)=>
748{const{__scopeAccordion:n,value:r,...i}=e,a=r0(nx,n),s=eRe(nx,n),l=sE(n),c=Pr(),u=r&&s.value.includes(r)||!1,d=a.disabled||e.disabled;return o.jsx(aRe,{scope:n,open:u,disabled:d,triggerId:c,children:o.jsx(Wz,{"data-orientation":a.orientation,"data-state":e9(u),...l,...i,ref:t,disabled:d,open:u,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})})});Kz.displayName=nx;var Yz="AccordionHeader",Xz=I.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=r0(ta,n),a=oE(Yz,n);return o.jsx(Ce.h3,{"data-orientation":i.orientation,"data-state":e9(a.open),"data-disabled":a.disabled?"":void 0,...r,ref:t})});Xz.displayName=Yz;var CS="AccordionTrigger",Qz=I.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=r0(ta,n),a=oE(CS,n),s=tRe(CS,n),l=sE(n);return o.jsx(aE.ItemSlot,{scope:n,children:o.jsx(YTe,{"aria-disabled":a.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...l,...r,ref:t})})});Qz.displayName=CS;var Jz="AccordionContent",Zz=I.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=r0(ta,n),a=oE(Jz,n),s=sE(n);return o.jsx(XTe,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...s,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});Zz.displayName=Jz;function e9(e){return e?"open":"closed"}var sRe=Hz,oRe=Kz,lRe=Xz,t9=Qz,n9=Zz;const cRe=sRe,Xf=b.forwardRef(({className:e,...t},n)=>o.jsx(oRe,{ref:n,className:he("border-b",e),...t}));Xf.displayName="AccordionItem";const Qf=b.forwardRef(({className:e,children:t,...n},r)=>o.jsx(lRe,{className:"flex",children:o.jsxs(t9,{ref:r,className:he("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,o.jsx(Rd,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Qf.displayName=t9.displayName;const Jf=b.forwardRef(({className:e,children:t,...n},r)=>o.jsx(n9,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:o.jsx("div",{className:he("pb-4 pt-0",e),children:t})}));Jf.displayName=n9.displayName;const r9=e=>{const[t,n]=b.useState([]),[r,i]=b.useState(!1),a=b.useCallback(async()=>{if(!e)return;i(!0);const{data:d,error:f}=await Y.from("review_links").select("*").eq("business_id",e).order("display_order",{ascending:!0});f?G.error("Failed to load review links"):n(d||[]),i(!1)},[e]);return b.useEffect(()=>{a()},[a]),{links:t,isLoading:r,addLink:async(d,f)=>{if(!e)return!1;const h=t.length>0?Math.max(...t.map(g=>g.display_order))+1:0,{error:p}=await Y.from("review_links").insert({business_id:e,platform:d,url:f,display_order:h});return p?(G.error("Failed to add link"),!1):(await a(),!0)},updateLink:async(d,f)=>{const{error:h}=await Y.from("review_links").update(f).eq("id",d);return h?(G.error("Failed to update link"),!1):(await a(),!0)},deleteLink:async d=>{const{error:f}=await Y.from("review_links").delete().eq("id",d);return f?(G.error("Failed to delete link"),!1):(await a(),!0)},reorderLinks:async d=>(n(h=>{const p=new Map(h.map(g=>[g.id,g]));return d.map((g,m)=>{const v=p.get(g);return v?{...v,display_order:m}:null}).filter(Boolean)}),(await Promise.all(d.map((h,p)=>Y.from("review_links").update({display_order:p}).eq("id",h)))).some(h=>h.error)?(G.error("Failed to save new order"),await a(),!1):!0),refetch:a}},i9=[{value:"google",label:"Google"},{value:"tripadvisor",label:"TripAdvisor"},{value:"yelp",label:"Yelp"},{value:"facebook",label:"Facebook"},{value:"trustpilot",label:"Trustpilot"},{value:"custom",label:"Custom link"}],zp="custom:",zI="We'd love to hear your feedback! Leave us a review on your preferred platform.",WI=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Fw=e=>{var t;return e.startsWith(zp)?e.slice(zp.length):((t=i9.find(n=>n.value===e))==null?void 0:t.label)||e},uRe=e=>{switch(e.startsWith(zp)?"custom":e){case"google":return o.jsxs("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",children:[o.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),o.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),o.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),o.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]});case"tripadvisor":return o.jsx("img",{src:Kb.url,alt:"TripAdvisor",className:"w-6 h-6 object-contain"});case"yelp":return o.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",children:o.jsx("path",{fill:"#D32323",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"})});case"facebook":return o.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",children:o.jsx("path",{fill:"#1877F2",d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})});case"trustpilot":return o.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",children:o.jsx("path",{fill:"#00B67A",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})});default:return o.jsx(sr,{className:"h-6 w-6 text-gray-500"})}},a9=({open:e,onOpenChange:t,businessId:n,businessName:r,address:i,googlePlaceId:a,tripadvisorUrl:s,reviewPageLogoUrl:l,reviewPageDescription:c,phone:u,email:d,website:f})=>{const{links:h,isLoading:p,addLink:g,deleteLink:m,reorderLinks:v}=r9(e?n:null),x=_i(),[y,w]=b.useState(""),[S,_]=b.useState(""),[j,k]=b.useState(""),[C,E]=b.useState(""),[A,P]=b.useState(""),[T,B]=b.useState(!1),[F,M]=b.useState("idle"),[L,R]=b.useState(!1),[$,O]=b.useState(!1),[N,H]=b.useState("edit"),[V,D]=b.useState(!1),[K,ae]=b.useState(""),[se,Q]=b.useState(""),[ne,Z]=b.useState(""),[W,ee]=b.useState(!1),[q,re]=b.useState(null),[ge,Ie]=b.useState(null),ye=b.useRef(null),qe=b.useRef(null),jt=b.useRef({logoUrl:"",description:"",phone:"",email:"",website:""}),pt=b.useRef(!1);b.useEffect(()=>{if(!e||!n)return;const U={logoUrl:l||"",description:c||"",phone:u||"",email:d||"",website:f||""};w(U.logoUrl),_(U.description),k(U.phone),E(U.email),P(U.website),jt.current=U,pt.current=!1,M("idle"),B(!1),H("edit")},[e,n]);const rn=b.useCallback(async(U=jt.current)=>{if(!n)return;M("saving");const{error:ie}=await Y.from("businesses").update({review_page_logo_url:U.logoUrl||null,review_page_description:U.description||null,phone:U.phone||null,email:U.email||null,website:U.website||null}).eq("id",n);ie?(M("error"),G.error("Couldn't save — your changes are still here. Try again.")):(jt.current=U,M("saved"),x.invalidateQueries({queryKey:["businesses"]}))},[n,x]),Wt=b.useCallback(U=>{pt.current=!0,M("saving"),qe.current&&clearTimeout(qe.current),qe.current=setTimeout(()=>{pt.current=!1,rn(U)},800)},[rn]),Sn=U=>{if(!U&&qe.current&&(clearTimeout(qe.current),qe.current=null,pt.current)){pt.current=!1;const ie=mt();rn(ie)}t(U)},mt=()=>({logoUrl:y,description:S,phone:j,email:C,website:Ee(A)}),Ee=U=>{const ie=U.trim();return ie?ie.startsWith("http://")||ie.startsWith("https://")?ie:`https://${ie}`:""}
748,Gt=(U,ie)=>{if(U==="description"&&_(ie),U==="phone"&&k(ie),U==="email"&&(E(ie),B(!!ie&&!WI.test(ie.trim()))),U==="website"&&P(ie),U==="email"&&ie&&!WI.test(ie.trim()))return;const je={logoUrl:y,description:U==="description"?ie:S,phone:U==="phone"?ie:j,email:U==="email"?ie:C,website:Ee(U==="website"?ie:A)};Wt(je)},J=async U=>{if(!U.type.startsWith("image/")){G.error("Please upload an image file (PNG or JPG)");return}if(U.size>2*1024*1024){G.error("Image must be under 2MB");return}R(!0);try{const ie=U.name.split(".").pop(),je=`${n}/logo.${ie}`,{error:at}=await Y.storage.from("review-page-assets").upload(je,U,{upsert:!0});if(at)throw at;const{data:{publicUrl:$r}}=Y.storage.from("review-page-assets").getPublicUrl(je),na=`${$r}?t=${Date.now()}`;w(na);const Un={...mt(),logoUrl:na};qe.current&&clearTimeout(qe.current),await rn(Un),G.success("Logo saved!")}catch(ie){console.error("Upload error:",ie),G.error("Failed to upload logo")}finally{R(!1),ye.current&&(ye.current.value="")}},le=async()=>{w("");const U={...mt(),logoUrl:""};qe.current&&clearTimeout(qe.current),await rn(U)},Ae=`https://my.reviewkit.com/r/${n}`,Ve=()=>{navigator.clipboard.writeText(Ae),G.success("Link copied to clipboard!")},Ze=new Set(h.map(U=>U.platform)),cn=async()=>{const U=K==="custom";if(!K||!se.trim()||U&&!ne.trim())return;ee(!0);const ie=U?`${zp}${ne.trim()}`:K;await g(ie,se.trim())&&(ae(""),Q(""),Z("")),ee(!1)},Bn=U=>{if(!q||q===U)return;const ie=h.map($r=>$r.id),je=ie.indexOf(q),at=ie.indexOf(U);je===-1||at===-1||(ie.splice(at,0,ie.splice(je,1)[0]),v(ie))},mn=Ee(A),An=j||C&&!T||mn,Ct=o.jsx("div",{className:"rounded-xl border border-border bg-gradient-to-b from-gray-50 to-white p-6 min-h-[420px]",children:o.jsxs("div",{className:"w-full max-w-md mx-auto",children:[o.jsxs("div",{className:"text-center mb-6",children:[y?o.jsx("img",{src:y,alt:r,className:"w-16 h-16 rounded-2xl object-cover mx-auto mb-4"}):o.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-gray-900 text-white mb-4",children:o.jsx(pi,{className:"h-8 w-8"})}),o.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-1",children:r}),i&&o.jsxs("p",{className:"text-sm text-gray-500 flex items-center justify-center gap-1",children:[o.jsx(Id,{className:"h-3.5 w-3.5"}),i]}),o.jsx("p",{className:"text-gray-600 mt-3 text-sm",children:S||zI})]}),An&&o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 mb-6",children:[j&&o.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm text-gray-600 bg-white border border-gray-200 rounded-full px-3 py-1.5",children:[o.jsx(_5,{className:"h-3.5 w-3.5"}),j]}),C&&!T&&o.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm text-gray-600 bg-white border border-gray-200 rounded-full px-3 py-1.5",children:[o.jsx(as,{className:"h-3.5 w-3.5"}),C]}),mn&&o.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm text-gray-600 bg-white border border-gray-200 rounded-full px-3 py-1.5",children:[o.jsx(Gh,{className:"h-3.5 w-3.5"}),"Website"]})]}),h.length===0?o.jsx("p",{className:"text-center text-gray-400 text-sm",children:"No review links available yet."}):o.jsx("div",{className:"space-y-3",children:h.map(U=>o.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-xl bg-white border border-gray-200",children:[o.jsx("div",{className:"shrink-0",children:uRe(U.platform)}),o.jsx("span",{className:"font-medium text-gray-900 flex-1",children:U.platform.startsWith(zp)?Fw(U.platform):`Review us on ${Fw(U.platform)}`}),o.jsx(sr,{className:"h-4 w-4 text-gray-400"})]},U.id))}),o.jsx("p",{className:"text-center text-xs text-gray-300 mt-8",children:"Powered by Review Kit"})]})}),it=o.jsxs(cRe,{type:"multiple",defaultValue:["share"],className:"min-w-0 space-y-2 overflow-hidden",children:[o.jsxs(Xf,{value:"share",className:"rounded-lg border border-border bg-background px-4",children:[o.jsx(Qf,{className:"gap-3 py-4 text-left hover:no-underline",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[o.jsx(HK,{className:"h-4 w-4 shrink-0 text-primary"}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-sm font-medium",children:"Share profile"}),o.jsx("span",{className:"block truncate text-xs font-normal text-muted-foreground",children:"Copy your link, open the live page or download its QR code"})]})]})}),o.jsxs(Jf,{className:"min-w-0 space-y-2 pb-4",children:[o.jsx(Pe,{className:"text-xs text-muted-foreground",children:"Share this link with customers"}),o.jsxs("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto_auto] gap-2",children:[o.jsx(Te,{value:Ae,readOnly:!0,className:"min-w-0 text-xs font-mono bg-background"}),o.jsxs(X,{variant:"outline",size:"sm",onClick:Ve,className:"shrink-0 gap-1.5",children:[o.jsx(Vh,{
748className:"h-3.5 w-3.5"}),"Copy"]}),o.jsx(X,{variant:"outline",size:"sm",onClick:()=>D(!V),className:"shrink-0 gap-1.5",children:o.jsx(FK,{className:"h-3.5 w-3.5"})}),o.jsx(X,{variant:"outline",size:"sm",asChild:!0,className:"shrink-0 gap-1.5",children:o.jsx("a",{href:Ae,target:"_blank",rel:"noopener noreferrer",children:o.jsx(sr,{className:"h-3.5 w-3.5"})})})]}),V&&o.jsxs("div",{className:"flex flex-col items-center gap-2 pt-2",children:[o.jsx("div",{className:"rounded-lg border border-border bg-white p-3",children:o.jsx("img",{src:`https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=${encodeURIComponent(Ae)}`,alt:"QR Code",width:200,height:200,className:"block"})}),o.jsx(X,{variant:"outline",size:"sm",onClick:()=>{const U=document.createElement("a");U.href=`https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=${encodeURIComponent(Ae)}`,U.download=`${r}-qr-code.png`,U.click()},children:"Download QR Code"})]})]})]}),o.jsxs(Xf,{value:"branding",className:"rounded-lg border border-border bg-background px-4",children:[o.jsx(Qf,{className:"gap-3 py-4 text-left hover:no-underline",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[o.jsx(N2,{className:"h-4 w-4 shrink-0 text-primary"}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-sm font-medium",children:"Logo and description"}),o.jsxs("span",{className:"block truncate text-xs font-normal text-muted-foreground",children:[y?"Logo added":"No logo yet"," · ",S?"Description added":"Using the default description"]})]})]})}),o.jsxs(Jf,{className:"space-y-5 pb-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{children:"Logo / Icon"}),o.jsx("input",{ref:ye,type:"file",accept:"image/*",className:"hidden",onChange:U=>{var je;const ie=(je=U.target.files)==null?void 0:je[0];ie&&J(ie)}}),o.jsxs("div",{onClick:()=>{var U;return(U=ye.current)==null?void 0:U.click()},onDragOver:U=>{U.preventDefault(),O(!0)},onDragLeave:()=>O(!1),onDrop:U=>{var je;U.preventDefault(),O(!1);const ie=(je=U.dataTransfer.files)==null?void 0:je[0];ie&&J(ie)},className:`cursor-pointer rounded-xl border-2 border-dashed p-4 flex items-center gap-4 transition-colors ${$?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,children:[o.jsx("div",{className:"shrink-0 w-20 h-20 rounded-xl border border-border bg-muted/50 flex items-center justify-center overflow-hidden",children:y?o.jsx("img",{src:y,alt:"Logo",className:"w-full h-full object-cover"}):o.jsx(N2,{className:"h-8 w-8 text-muted-foreground/40"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground flex items-center gap-1.5",children:L?o.jsxs(o.Fragment,{children:[o.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"})," Uploading…"]}):o.jsxs(o.Fragment,{children:[o.jsx(E5,{className:"h-3.5 w-3.5"})," ",y?"Drop a new image or click to replace":"Drop an image here or click to upload"]})}),o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"PNG or JPG, max 2MB. Shown at the top of your public page."}),y&&o.jsxs(X,{variant:"ghost",size:"sm",onClick:U=>{U.stopPropagation(),le()},className:"gap-1.5 mt-2 text-muted-foreground hover:text-destructive -ml-3",children:[o.jsx(Ro,{className:"h-3.5 w-3.5"}),"Remove logo"]})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"profile-desc",children:"Description"}),o.jsx(ds,{id:"profile-desc",placeholder:zI,value:S,onChange:U=>Gt("description",U.target.value),rows:3,className:"resize-none",maxLength:300}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Shown below your business name on the public page."})]})]})]}),o.jsxs(Xf,{value:"contact",className:"rounded-lg border border-border bg-background px-4",children:[o.jsx(Qf,{className:"gap-3 py-4 text-left hover:no-underline",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[o.jsx(SK,{className:"h-4 w-4 shrink-0 text-primary"}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-sm font-medium",children:"Contact information"}),o.jsxs("span",{className:"block truncate text-xs font-normal text-muted-foreground",children:[[j,C,A].filter(
748Boolean).length," of 3 details added"]})]})]})}),o.jsxs(Jf,{className:"space-y-3 pb-4",children:[o.jsx("p",{className:"text-xs text-muted-foreground -mt-1",children:"Shown on your public page so customers can reach you."}),o.jsx(Te,{placeholder:"Phone number",value:j,onChange:U=>Gt("phone",U.target.value)}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(Te,{type:"email",placeholder:"Email address",value:C,onChange:U=>Gt("email",U.target.value),className:T?"border-destructive":""}),T&&o.jsx("p",{className:"text-xs text-destructive",children:"That doesn't look like a valid email address — it won't be saved."})]}),o.jsx(Te,{placeholder:"Website URL",value:A,onChange:U=>Gt("website",U.target.value)})]})]}),o.jsxs(Xf,{value:"links",className:"rounded-lg border border-border bg-background px-4",children:[o.jsx(Qf,{className:"gap-3 py-4 text-left hover:no-underline",children:o.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[o.jsx(w_,{className:"h-4 w-4 shrink-0 text-primary"}),o.jsxs("span",{className:"min-w-0",children:[o.jsx("span",{className:"block text-sm font-medium",children:"Review links"}),o.jsx("span",{className:"block truncate text-xs font-normal text-muted-foreground",children:p?"Loading links…":`${h.length} ${h.length===1?"link":"links"} added`})]})]})}),o.jsxs(Jf,{className:"space-y-3 pb-4",children:[p?o.jsx("div",{className:"flex items-center justify-center py-6",children:o.jsx(ke,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):h.length===0?o.jsxs("div",{className:"text-center py-6 text-sm text-muted-foreground",children:[o.jsx(w_,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground/50"}),"No review links added yet. Add your first platform below."]}):o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Drag to reorder — this is the order shown on your public page."}),h.map(U=>o.jsxs("div",{draggable:!0,onDragStart:ie=>{re(U.id),ie.dataTransfer.effectAllowed="move"},onDragOver:ie=>{ie.preventDefault(),ie.dataTransfer.dropEffect="move",ge!==U.id&&Ie(U.id)},onDragLeave:()=>Ie(ie=>ie===U.id?null:ie),onDrop:ie=>{ie.preventDefault(),Bn(U.id),re(null),Ie(null)},onDragEnd:()=>{re(null),Ie(null)},className:`flex items-center gap-2 rounded-lg border p-2.5 transition-colors ${ge===U.id&&q!==U.id?"border-primary bg-primary/5":"border-border"} ${q===U.id?"opacity-50":""}`,children:[o.jsx(OK,{className:"h-4 w-4 text-muted-foreground/60 cursor-grab active:cursor-grabbing shrink-0"}),o.jsx("span",{className:"text-sm font-medium text-foreground capitalize min-w-[90px]",children:Fw(U.platform)}),o.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1 font-mono",children:U.url}),o.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:()=>m(U.id),children:o.jsx(Md,{className:"h-3.5 w-3.5"})})]},U.id))]}),o.jsxs("div",{className:"space-y-2 pt-1",children:[K==="custom"&&o.jsx(Te,{placeholder:"Link label (e.g. Our website)",value:ne,onChange:U=>Z(U.target.value),maxLength:40}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(St,{value:K,onValueChange:U=>{ae(U),U==="google"&&a&&!se?Q(`https://search.google.com/local/writereview?placeid=${a}`):U==="tripadvisor"&&s&&!se&&Q(s)},children:[o.jsx(wt,{className:"w-[130px]",children:o.jsx(kt,{placeholder:"Platform"})}),o.jsx(_t,{children:i9.map(U=>o.jsx(we,{value:U.value,disabled:U.value!=="custom"&&Ze.has(U.value),children:U.label},U.value))})]}),o.jsx(Te,{placeholder:"https://...",value:se,onChange:U=>Q(U.target.value),onKeyDown:U=>U.key==="Enter"&&cn(),className:"flex-1"}),o.jsxs(X,{onClick:cn,disabled:!K||!se.trim()||K==="custom"&&!ne.trim()||W,size:"sm",className:"shrink-0 gap-1.5",children:[W?o.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(_o,{className:"h-3.5 w-3.5"}),"Add"]})]})]})]})]})]});return o.jsx(sc,{open:e,onOpenChange:Sn,children:o.jsxs(Mo,{className:"sm:max-w-5xl max-h-[92vh] flex flex-col",children:[o.jsx($o,{children:o.jsxs("div",{className:"flex items-center justify-between gap-4 pr-8",children:[o.jsxs(Do,{className:"font-display",children:["Review Profile — ",r]}),o.jsxs("div",{className:"flex items-center gap-1.5 text-xs shrink-0",children:[F==="saving"&&o.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[o.jsx(ke,{className:"h-3 w-3 animate-spin"})," Saving…"]}),F==="saved"&&o.jsxs("span",{className:"flex items-center gap-1.5 text-primary",children:[o.jsx(To,{className:"h-3 w-3"})," All changes saved"]}),F==="error"&&o.jsxs("button",{onClick:()=>rn(mt()),className:"flex items-center gap-1.5 text-destructive hover:underline",children:[o.jsx(Lv,{className:"h-3 w-3"})," Save failed — retry"]})]})]})}),o.jsx("div",{className:"lg:hidden",children:o.jsx(Tm,{value:N,onValueChange:H,children:o.jsxs(nf,{className:"w-full",children:[o.jsx(Kn,{value:"edit",className:"flex-1",children:"Edit"}),o.jsx(Kn,{value:"preview",className:"flex-1",children:"Preview"})]})})}),o.jsxs("div",{className:"grid min-w-0 lg:grid-cols-2 gap-6 overflow-x-hidden overflow-y-auto flex-1 min-h-0 pr-1",children:[o.jsx("div",{className:`${N==="edit"?"":"hidden lg:block"} min-w-0`,children:it}),o.jsxs("div",{className:`${N==="preview"?"":"hidden lg:block"} min-w-0 lg:sticky lg:top-0`,children:[Ct,o.jsx(X,{variant:"outline",size:"sm",asChild:!0,className:"w-full mt-3 gap-1.5",children:o.jsxs("a",{href:Ae,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(sr,{className:"h-3.5 w-3.5"}),"Open live page"]})})]})]})]})})},dRe={google:e=>e.google_place_id?`https://search.google.com/local/writereview?placeid=${e.google_place_id}`:null,tripadvisor:e=>{const t=e.tripadvisor_url;return t?t.replace(/AttractionProductReview-/i,"UserReviewEdit-").replace(/Attraction_Review-/i,"UserReviewEdit-").replace(/Restaurant_Review-/i,"UserReviewEdit-").replace(/Hotel_Review-/i,"UserReviewEdit-"):null},trustpilot:e=>e.trustpilot_url||null,yelp:e=>e.yelp_url||null};async function Lc(e,t,n){try{const{data:r}=await Y.from("review_links").select("id").eq("business_id",e).eq("platform",t).maybeSingle();if(r)return;const{data:i}=await Y.from("review_links").select("display_order").eq("business_id",e).order("display_order",{ascending:!1}).limit(1),a=i!=null&&i.length?i[0].display_order+1:0;await Y.from("review_links").insert({business_id:e,platform:t,url:n,display_order:a})}catch(r){console.error(`Failed to auto-add ${t} review link:`,r)}}async function fRe(e){for(const[t,n]of Object.entries(dRe)){const r=n(e);r&&await Lc(e.id,t,r)}}const HI="missing_oauth_tokens",hRe="Google connection is missing credentials",s9=async e=>{var r,i;let t;try{const a=await((i=(r=e==null?void 0:e.context)==null?void 0:r.json)==null?void 0:i.call(r));t=a==null?void 0:a.code}catch{t=void 0}const n=e instanceof Error?e.message:typeof e=="string"?e:"";return t===HI||n.includes(HI)||n.includes(hRe)},ES=async e=>{const t=await Y.from("businesses").update({google_account_name:null,google_location_name:null,google_place_id:null}).eq("id",e);return await Y.from("business_oauth_tokens").delete().eq("business_id",e),t},pRe=()=>{const{user:e,loading:t,subscription:n,refreshSubscription:r,isAdmin:i,startingTrial:a}=Mt(),{businesses:s,isLoading:l,createBusinessShell:c,updateBusiness:u,deleteBusiness:d,refetch:f}=Lo(),h=_i(),{maxBusinesses:p}=qC(),g=!n.loading&&!n.subscribed&&n.hadTrial&&!a&&!i,m=g||s.length>=p,[v,x]=b.useState(!1),[y,w]=b.useState(null),[S,_]=b.useState(null),[j,k]=b.useState(null),[C,E]=b.useState(null),[A,P]=rc(),[T,B]=b.useState(()=>localStorage.getItem("pending_sync_business_id")),[F,M]=b.useState(null),L=s.find(W=>W.id===F)||null,[R,$]=b.useState(null),[,O]=b.useState(!1),N=s.find(W=>W.id===R)||null,[H,V]=b.useState({});b.useEffect(()=>{if(!s.length)return;(async()=>{const ee={};for(const q of s){const{count:re}=await Y.from("reviews").select("*",{count:"exact",head:!0}).eq("business_id",q.id);ee[q.id]=re||0}V(ee)})()},[s]),b.useEffect(()=>{const W=s.filter(q=>(q.sync_status==="syncing"||q.sync_status==="processing")&&q.apify_run_id);if(W.length===0)return;const ee=setInterval(async()=>{for(const q of W)try{const{data:re,error:ge}=await Y.functions.invoke("poll-tripadvisor-import",{body:{business_id:q.id}});if(ge){console.error("Poll error:",ge);continue}(re==null?void 0:re.status)==="complete"?(G.success(`Import complete for ${q.name}! ${re.totalImported} reviews imported.`),h.invalidateQueries({queryKey:["reviews"]}),f()):(re==null?void 0:re.status)==="error"?(G.error(`Import failed for ${q.name}: ${re.runStatus}`),f()):(re==null?void 0:re.newItems)>0&&(h.invalidateQueries({queryKey:["reviews"]}),f())}catch(re){console.error("Poll error:",re)}},5e3);return()=>clearInterval(ee)}
748,[s]);const D=async(W,ee=!1)=>{if(!ee&&!n.subscribed&&!i){G.error("Your free trial has ended — choose a plan to sync reviews.",{action:{label:"Choose a plan",onClick:()=>{window.location.href="/settings?tab=billing"}}});return}const q=s.find(re=>re.id===W);if(q){if((e==null?void 0:e.email)==="[email protected]"){G.success("Reviews synced successfully");return}if(!(q.sync_status==="syncing"||q.sync_status==="importing"||j===q.id)){k(W);try{const re=[],ge=[];q.google_location_name&&ge.push(Y.functions.invoke("fetch-google-reviews",{body:{business_id:W}}).then(async({data:Ie,error:ye})=>{if((Ie==null?void 0:Ie.code)==="missing_oauth_tokens"||ye&&await s9(ye)){await ES(W),G.error("Google connection lost. Please reconnect it in Review Sources.",{duration:7e3});return}if(ye)throw ye;re.push(`Google: ${Ie.inserted} new, ${Ie.updated} updated`)})),q.tripadvisor_url&&ge.push(Y.functions.invoke("fetch-tripadvisor-reviews",{body:{business_id:W}}).then(({data:Ie,error:ye})=>{if(ye)throw ye;re.push("TripAdvisor import started")})),q.trustpilot_url&&ge.push(Y.functions.invoke("fetch-trustpilot-reviews",{body:{business_id:W}}).then(({data:Ie,error:ye})=>{if(ye)throw ye;re.push("Trustpilot import started")})),q.getyourguide_url&&ge.push(Y.functions.invoke("fetch-getyourguide-reviews",{body:{business_id:W}}).then(({data:Ie,error:ye})=>{if(ye)throw ye;re.push("GetYourGuide import started")})),q.yelp_url&&ge.push(Y.functions.invoke("fetch-yelp-reviews",{body:{business_id:W}}).then(({data:Ie,error:ye})=>{if(ye)throw ye;re.push("Yelp import started")})),await Promise.all(ge),re.length>0&&G.success(re.join(" · ")),!q.tripadvisor_url&&!q.trustpilot_url&&!q.getyourguide_url&&!q.yelp_url&&k(null),f()}catch(re){console.error("Failed to fetch reviews:",re),G.error("Failed to sync reviews"),k(null)}}}};b.useEffect(()=>{if(A.get("gmb_connected")==="true"){const W=localStorage.getItem("gmb_locations"),ee=localStorage.getItem("gmb_tokens"),q=localStorage.getItem("gmb_business_name")||"",re=localStorage.getItem("gmb_business_id");if(re&&M(re),W&&ee){const ge=JSON.parse(W),Ie=JSON.parse(ee);localStorage.removeItem("gmb_locations"),localStorage.removeItem("gmb_tokens"),localStorage.removeItem("gmb_business_name"),ae({locations:ge,tokens:Ie,businessName:q}),x(!0)}A.delete("gmb_connected"),P(A,{replace:!0})}else localStorage.removeItem("gmb_business_id")},[A,P]),b.useEffect(()=>{A.get("checkout")==="success"&&(G.success("Subscription activated! Your trial has started."),r(),A.delete("checkout"),P(A,{replace:!0}),(T||localStorage.getItem("pending_sync_business_id"))&&(localStorage.removeItem("pending_sync_business_id"),B(null),G.info("Press Sync on your business to import reviews.",{duration:6e3})))},[A,P,r,T]),b.useEffect(()=>{A.get("add")==="true"&&(w(null),ae(null),x(!0),$n("add_business_opened",{via:"welcome"}),A.delete("add"),P(A,{replace:!0}))},[A,P]),b.useEffect(()=>{const W=A.get("profile");!W||s.length===0||($(s[0].id),O(W==="branding"),A.delete("profile"),P(A,{replace:!0}))},[A,P,s]);const[K,ae]=b.useState(null);if(t)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});if(!e)return o.jsx(Yi,{to:"/login",replace:!0});const se=async W=>{const ee=await c(W);return ee&&M(ee),ee},Q=async(W,ee)=>{const{google_access_token:q,google_refresh_token:re,...ge}=ee;if(!await u(W,ge))return!1;if(q||re){const{error:qe}=await Y.from("business_oauth_tokens").delete().eq("business_id",W);if(qe)return console.error("Failed to clear previous Google OAuth tokens:",qe),await Y.from("businesses").update({google_place_id:null,google_account_name:null,google_location_name:null}).eq("id",W),G.error("Google connected, but credentials could not be saved. Please reconnect."),!1;const{error:jt}=await Y.from("business_oauth_tokens").insert({business_id:W,google_access_token:q||null,google_refresh_token:re||null});if(jt)return console.error("Failed to save Google OAuth tokens:",jt),await Y.from("businesses").update({google_place_id:null,google_account_name:null,google_location_name:null}).eq("id",W),G.error("Google connected, but credentials could not be saved. Please reconnect."),!1}const ye=s.find(qe=>qe.id===W);return fRe({id:W,name:ee.name||(ye==null?void 0:ye.name)||"",...ee}),localStorage.removeItem("gmb_business_id"),M(null),G.info("Press Sync on the business card to import your reviews.",{duration:6e3}),!0},ne=async W=>y?u(y.id,W):!1,Z=async()=>{S&&(await d(S),_(null))};return o.jsxs(Qn,{children:[o.jsxs("div",{className:"space-y-6",children:[(()=>{const W=s.filter(q=>q.sync_status==="syncing"||q.sync_status==="processing"||q.sync_status==="importing"||j===q.id);if(W.length===0)return null;const ee=W.map(q=>q.name).join(", ");return o.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-primary/20 bg-primary/5 px-4 py-3 animate-fade-in",children:[o.jsx(ke,{className:"h-4 w-4 animate-spin text-primary shrink-0"}),o.jsxs("p",{className:"text-sm text-foreground",children:[o.jsx("span",{className:"font-medium",children:"Syncing reviews"}),o.jsxs("span",{className:"text-muted-foreground",children:[" — ",ee,". This may take a few minutes."]})]})]})})(),g&&o.jsx(pe,{className:"border-destructive/40 bg-destructive/5 animate-fade-in",children:o.jsxs(de,{className:"flex flex-col gap-3 py-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(Fu,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-foreground",children:"Your free trial has ended"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"You can still view what's here, but adding businesses and syncing new reviews need a paid plan."})]})]}),o.jsx(X,{asChild:!0,className:"shrink-0",children:o.jsx("a",{href:"/settings?tab=billing",children:"Choose a plan"})})]})}),o.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-3xl font-bold text-foreground",children:"Businesses"}),o.jsx("p",{className:"text-muted-foreground",children:"Manage your business locations and link to review sources"})]}),m?o.jsx(X,{variant:"outline",asChild:!0,children:o.jsxs("a",{href:"/settings?tab=billing",children:[o.jsx(Fu,{className:"mr-2 h-4 w-4"}),g?"Choose a plan":"Upgrade to add more"]})}):o.jsxs(X,{onClick:()=>{w(null),ae(null),M(null),localStorage.removeItem("gmb_business_id"),x(!0),$n("add_business_opened",{via:"header"})},children:[o.jsx(_o,{className:"mr-2 h-4 w-4"}),"Add Business"]})]}),l?o.jsx("div",{className:"flex h-40 items-center justify-center text-muted-foreground",children:"Loading..."}):s.length===0?o.jsx(pe,{className:"animate-fade-in",children:o.jsxs(de,{className:"flex flex-col items-center justify-center py-16 text-center",children:[o.jsx("div",{className:"mb-4 rounded-full bg-primary/10 p-4",children:o.jsx(Jr,{className:"h-8 w-8 text-primary"})}),o.jsx("h2",{className:"mb-2 font-display text-xl font-semibold text-foreground",children:"Add your business to get started"}),o.jsx("p",{className:"mb-6 max-w-sm text-muted-foreground",children:"Takes less than a minute to connect. "}),o.jsxs(X,{onClick:()=>{w(null),ae(null),M(null),localStorage.removeItem("gmb_business_id"),x(!0),$n("add_business_opened",{via:"empty_state"})},disabled:m,children:[o.jsx(_o,{className:"mr-2 h-4 w-4"}),"Add Your First Business"]})]})}):o.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:s.map(W=>{const ee=W.last_synced_at?new Date(W.last_synced_at):null,q=!ee||Date.now()-ee.getTime()>6*60*60*1e3,re=W.sync_status==="syncing"||W.sync_status==="importing"||W.sync_status==="processing"||j===W.id;return o.jsxs(pe,{className:"group animate-fade-in overflow-hidden transition-all hover:shadow-lg hover:border-primary/20",children:[o.jsx("div",{className:`h-1 ${re?"bg-primary/40 relative overflow-hidden":"bg-gradient-to-r from-primary/60 to-primary"}`,children:re&&o.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-primary to-transparent animate-[shimmer_1.5s_infinite]",style:{animation:"shimmer 1.5s infinite linear"}})}),o.jsxs(de,{className:"p-5",children:[o.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[o.jsx("div",{className:"shrink-0 rounded-xl bg-primary/10 p-2.5",children:o.jsx(Jr,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("h3",{className:"font-display text-base font-semibold text-foreground break-words",children:W.name}),o.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[W.google_location_name&&o.jsxs(Se,{variant:"secondary",className:"text-xs gap-1 bg-blue-500/10 text-blue-700 border-blue-500/20",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 inline-block"}),"Google"]}),W.tripadvisor_url&&o.jsxs(Se,{variant:"secondary",className:"text-xs gap-1 bg-success/10 text-success border-success/20",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success inline-block"}),"TripAdvisor"]}),W.trustpilot_url&&o.jsxs(Se,{variant:"secondary",className:"text-xs gap-1 bg-success/10 text-success border-success/20",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success inline-block"}),"Trustpilot"]}),W.getyourguide_url&&o.jsxs(Se,{variant:"secondary",className:"text-xs gap-1 bg-orange-500/10 text-orange-700 border-orange-500/20",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-orange-500 inline-block"}),"GetYourGuide"]}),W.yelp_url&&o.jsxs(Se,{variant:"secondary",className:"text-xs gap-1 bg-red-500/10 text-red-700 border-red-500/20",children:[o.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-red-500 
748inline-block"}),"Yelp"]}),!W.google_location_name&&!W.tripadvisor_url&&!W.trustpilot_url&&!W.getyourguide_url&&!W.yelp_url&&o.jsx(Se,{variant:"secondary",className:"text-xs text-muted-foreground",children:"Not connected"})]})]}),o.jsxs(_Te,{children:[o.jsx(jTe,{asChild:!0,children:o.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7 shrink-0 text-muted-foreground hover:text-foreground",children:o.jsx(NK,{className:"h-4 w-4"})})}),o.jsxs(az,{align:"end",children:[o.jsxs(sv,{onClick:()=>{w(W),ae(null),x(!0)},children:[o.jsx(rN,{className:"mr-2 h-3.5 w-3.5"}),"Edit Business"]}),o.jsxs(sv,{className:"text-destructive focus:text-destructive",onClick:()=>_(W.id),children:[o.jsx(Md,{className:"mr-2 h-3.5 w-3.5"}),"Delete Business"]}),o.jsxs(sv,{onClick:()=>E(W),children:[o.jsx(bn,{className:"mr-2 h-3.5 w-3.5"}),"AI Reply Settings"]})]})]})]}),o.jsxs("div",{className:"space-y-2 mb-4",children:[W.address&&o.jsxs("div",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[o.jsx(Id,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),o.jsx("span",{className:"leading-snug",children:W.address})]}),!W.address&&(W.tripadvisor_url||W.trustpilot_url||W.getyourguide_url||W.yelp_url)&&o.jsxs("div",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[o.jsx(Gh,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),o.jsx("span",{className:"leading-snug text-xs italic",children:"Address will appear after first sync"})]}),W.google_place_id&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o.jsx(sr,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{className:"truncate font-mono text-xs",children:W.google_place_id})]})]}),H[W.id]!==void 0&&H[W.id]>0&&o.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-4",children:[o.jsx(Bu,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{className:"font-medium text-foreground",children:H[W.id]}),o.jsxs("span",{children:["review",H[W.id]!==1?"s":""]})]}),!W.google_location_name&&!W.tripadvisor_url&&!W.trustpilot_url&&!W.getyourguide_url&&!W.yelp_url&&o.jsxs("div",{className:"rounded-md border border-primary/20 bg-primary/5 px-3 py-2 mb-4 text-xs text-foreground",children:[o.jsx("p",{className:"mb-2",children:"No reviews connected yet — finish setup to import your reviews."}),o.jsx(X,{size:"sm",className:"h-7 text-xs",onClick:()=>{w(null),ae(null),M(W.id),x(!0),$n("add_business_opened",{via:"finish_setup"})},children:"Finish setup"})]}),!W.last_synced_at&&!re&&(W.google_location_name||W.tripadvisor_url||W.trustpilot_url||W.getyourguide_url||W.yelp_url)&&o.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-primary/20 bg-primary/5 px-3 py-2 mb-4 text-xs text-foreground",children:[o.jsx(zi,{className:"h-3.5 w-3.5 mt-0.5 shrink-0 text-primary"}),g?o.jsxs("span",{children:["Your free trial has ended — ",o.jsx(on,{to:"/settings?tab=billing",className:"font-medium underline",children:"choose a plan"})," to import your reviews."]}):o.jsxs("span",{children:["Press ",o.jsx("span",{className:"font-medium",children:"Sync"})," below to import your reviews for the first time."]})]}),o.jsx("div",{className:"flex items-center border-t border-border pt-3 -mb-1",children:o.jsxs("div",{className:"flex gap-1",children:[(W.google_location_name||W.tripadvisor_url||W.trustpilot_url||W.getyourguide_url||W.yelp_url)&&o.jsxs(X,{variant:"ghost",size:"sm",className:"h-8 px-2.5 text-xs text-muted-foreground hover:text-foreground gap-1.5",onClick:()=>D(W.id),disabled:re||!n.subscribed&&!i||!q,title:q?void 0:"Already synced today",children:[re?o.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(zi,{className:"h-3.5 w-3.5"}),re?"Syncing":q?"Sync":"Synced"]}),o.jsx(on,{to:`/businesses/${W.id}/sources`,children:o.jsxs(X,{variant:"ghost",size:"sm",className:"h-8 px-2.5 text-xs text-muted-foreground hover:text-primary gap-1.5",title:"Manage Review Sources",children:[o.jsx(Gh,{className:"h-3.5 w-3.5"}),"Sources"]})}),o.jsxs(X,{variant:"ghost",size:"sm",className:"h-8 px-2.5 text-xs text-muted-foreground hover:text-primary gap-1.5",title:"Review Links Page",onClick:()=>$(W.id),children:[o.jsx(w_,{className:"h-3.5 w-3.5"}),"Profile"]})]})})]})]},W.id)})})]}),o.jsx(eAe,{open:v,onOpenChange:W=>{x(W),W||(w(null),ae(null),M(null),localStorage.removeItem("gmb_business_id"))},business:y,onSubmit:ne,onCreate:se,onConnect:Q,connectBusinessId:y?null:F,connectBusinessName:(L==null?void 0:L.name)||localStorage.getItem("gmb_business_name")||"",initialGmbData:K}),o.jsx(nAe,{open:!!C,onOpenChange:W=>!W&&E(null),businessName:(C==null?void 0:C.name)||"",currentTone:(C==null?void 0:C.reply_tone)||"professional",currentInstructions:(C==null?void 0:C.reply_instructions)||"",onSave:async(W,ee)=>
748C?u(C.id,{reply_tone:W,reply_instructions:ee}):!1}),o.jsx(a9,{open:!!N,onOpenChange:W=>{W||($(null),O(!1))},businessId:(N==null?void 0:N.id)||"",businessName:(N==null?void 0:N.name)||"",address:N==null?void 0:N.address,googlePlaceId:N==null?void 0:N.google_place_id,tripadvisorUrl:N==null?void 0:N.tripadvisor_url,reviewPageLogoUrl:N==null?void 0:N.review_page_logo_url,reviewPageDescription:N==null?void 0:N.review_page_description,phone:N==null?void 0:N.phone,email:N==null?void 0:N.email,website:N==null?void 0:N.website}),o.jsx(Zb,{open:!!S,onOpenChange:W=>!W&&_(null),children:o.jsxs(km,{children:[o.jsxs(Nm,{children:[o.jsx(Em,{className:"font-display",children:"Delete Business"}),o.jsx(Pm,{children:"This will permanently delete this business and all associated reviews. This action cannot be undone."})]}),o.jsxs(Cm,{children:[o.jsx(Am,{children:"Cancel"}),o.jsx(Om,{onClick:Z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})};var i0="Switch",[mRe,LLe]=Fn(i0),[gRe,vRe]=mRe(i0),o9=b.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:s,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=b.useState(null),g=Qe(t,w=>p(w)),m=b.useRef(!1),v=h?d||!!h.closest("form"):!0,[x,y]=Tr({prop:i,defaultProp:a??!1,onChange:u,caller:i0});return o.jsxs(gRe,{scope:n,checked:x,disabled:l,children:[o.jsx(Ce.button,{type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":d9(x),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:g,onClick:me(e.onClick,w=>{y(S=>!S),v&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),v&&o.jsx(u9,{control:h,bubbles:!m.current,name:r,value:c,checked:x,required:s,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});o9.displayName=i0;var l9="SwitchThumb",c9=b.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=vRe(l9,n);return o.jsx(Ce.span,{"data-state":d9(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});c9.displayName=l9;var yRe="SwitchBubbleInput",u9=b.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{const s=b.useRef(null),l=Qe(s,a),c=zC(n),u=pN(t);return b.useEffect(()=>{const d=s.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&p){const g=new Event("click",{bubbles:r});p.call(d,n),d.dispatchEvent(g)}},[c,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});u9.displayName=yRe;function d9(e){return e?"checked":"unchecked"}var f9=o9,xRe=c9;const vo=b.forwardRef(({className:e,...t},n)=>o.jsx(f9,{className:he("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input 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",e),...t,ref:n,children:o.jsx(xRe,{className:he("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")})}));vo.displayName=f9.displayName;const Bw=["#6366f1","#ec4899","#f59e0b","#10b981","#3b82f6","#8b5cf6","#ef4444","#14b8a6","#f97316","#06b6d4"],h9=()=>{const{user:e}=Mt(),[t,n]=b.useState([]),[r,i]=b.useState([]),[a,s]=b.useState(!0),l=b.useCallback(async()=>{if(!e)return;s(!0);const m=1e3;let v=[],x=0;for(;;){const{data:w}=await Y.from("tags").select("*").order("name").range(x,x+m-1);if(!w||(v=v.concat(w),w.length<m))break;x+=m}let y=[];for(x=0;;){const{data:w}=await Y.from("review_tags").select("*").range(x,x+m-1);if(!w||(y=y.concat(w),w.length<m))break;x+=m}n(v),i(y),s(!1)},[e]);return b.useEffect(()=>{l()},[l]),{tags:t,reviewTags:r,isLoading:a,createTag:async m=>{if(!e)return null;const v=m.trim();if(!v)return null;const x=t.find(j=>j.name.toLowerCase()===v.toLowerCase());if(x)return x;const y=Bw[t.length%Bw.length],{data:w,error:S}=await Y.from("tags").insert({user_id:e.id,name:v,color:y}).select().single();if(S)return G.error("Failed to create tag"),null;const _=w;return n(j=>[...j,_].sort((k,C)=>k.name.localeCompare(C.name))),_},deleteTag:async m=>{const{error:v}=await Y.from("tags").delete().eq("id",m);return v?(G.error("Failed to delete tag"),!1):(n(x=>x.filter(y=>y.id!==m)),i(x=>x.filter(y=>y.tag_id!==m)),!0)},addTagToReview:async(m,v)=>{if(r.some(S=>S.review_id===m&&S.tag_id===v))return!0;const{data:y,error:w}=await Y.from("review_tags").insert({review_id:m,tag_id:v}).select().single();return w?(G.error("Failed to add tag"),!1):(i(S=>[...S,y]),!0)},removeTagFromReview:async(m,v)=>{const{error:x}=await Y.from("review_tags").delete().eq("review_id",m).eq("tag_id",v);return x?(G.error("Failed to remove tag"),!1):(i(y=>y.filter(w=>!(w.review_id===m&&w.tag_id===v))),!0)},getTagsForReview:m=>{const v=r.filter(x=>x.review_id===m).map(x=>x.tag_id);return t.filter(x=>v.includes(x.id))},getReviewIdsForTag:m=>r.filter(v=>v.tag_id===m).map(v=>v.review_id),autoTagMatchingReviews:async(m,v)=>{if(!e)return 0;const x=v.toLowerCase(),y=new RegExp(`\\b${x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"i"),w=1e3;let S=[],_=0;for(;;){const{data:P,error:T}=await Y.from("reviews").select("id, comment").eq("user_id",e.id).not("comment","is",null).range(_,_+w-1);if(T||!P||(S=S.concat(P),P.length<w))break;_+=w}if(S.length===0)return 0;const j=S.filter(P=>P.comment&&y.test(P.comment));if(j.length===0)return 0;const k=new Set(r.filter(P=>P.tag_id===m).map(P=>P.review_id)),C=j.filter(P=>!k.has(P.id)).map(P=>({review_id:P.id,tag_id:m}));if(C.length===0)return 0;const{data:E,error:A}=await Y.from("review_tags").insert(C).select();return A?(G.error("Failed to auto-tag some reviews"),0):(E&&i(P=>[...P,...E]),(E==null?void 0:E.length)??0)},refetch:l,TAG_COLORS:Bw}},Mf=["#6366f1","#ec4899","#f59e0b","#10b981","#3b82f6","#8b5cf6","#ef4444","#14b8a6","#f97316","#06b6d4"],bRe=()=>{const{tags:e,isLoading:t,createTag:n,deleteTag:r,autoTagMatchingReviews:i,refetch:a}=h9(),[s,l]=b.useState(()=>localStorage.getItem("autoTagEnabled")==="true"),c=M=>{l(M),localStorage.setItem("autoTagEnabled",String(M))},[u,d]=b.useState(""),[f,h]=b.useState(Mf[0]),[p,g]=b.useState(!1),[m,v]=b.useState(null),[x,y]=b.useState(""),[w,S]=b.useState(""),[_,j]=b.useState(!1),[k,C]=b.useState(null),[E,A]=b.useState(null),P=async()=>{const M=u.trim();if(!M)return;if(M.length>50){G.error("Tag name must be less than 50 characters");return}g(!0);const L=await n(M);if(L){if(f!=="#6366f1"&&(await Y.from("tags").update({color:f}).eq("id",L.id),await a()),s){const R=await i(L.id,M);R>0?G.success(`Tag "${M}" created and auto-applied to ${R} review${R>1?"s":""}`):G.success(`Tag "${M}" created (no matching reviews found)`)}else G.success(`Tag "${M}" created`);d(""),h(Mf[(e.length+1)%Mf.length])}g(!1)}
748,T=M=>{v(M.id),y(M.name),S(M.color)},B=async()=>{if(!m)return;const M=x.trim();if(!M){G.error("Tag name cannot be empty");return}if(M.length>50){G.error("Tag name must be less than 50 characters");return}j(!0);const{error:L}=await Y.from("tags").update({name:M,color:w}).eq("id",m);j(!1),L?G.error("Failed to update tag"):(G.success("Tag updated"),v(null),await a())},F=async(M,L)=>{C(M),await r(M)&&G.success(`Tag "${L}" deleted`),C(null)};return t?o.jsx(pe,{children:o.jsx(de,{className:"flex items-center justify-center py-12",children:o.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{children:"Create Tag"}),o.jsx(ft,{children:"Add a new tag to organize your reviews"})]}),o.jsxs(de,{children:[o.jsxs("div",{className:"flex items-end gap-3",children:[o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx(Pe,{htmlFor:"newTagName",children:"Tag Name"}),o.jsx(Te,{id:"newTagName",value:u,onChange:M=>d(M.target.value),placeholder:"e.g. Staff Members Name",maxLength:50,onKeyDown:M=>M.key==="Enter"&&P()})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{children:"Color"}),o.jsx("div",{className:"flex gap-1.5",children:Mf.map(M=>o.jsx("button",{className:"h-8 w-8 rounded-full border-2 transition-transform hover:scale-110",style:{backgroundColor:M,borderColor:f===M?"hsl(var(--foreground))":"transparent"},onClick:()=>h(M),type:"button","aria-label":`Select color ${M}`},M))})]}),o.jsxs(X,{onClick:P,disabled:p||!u.trim(),children:[p?o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}):o.jsx(_o,{className:"mr-2 h-4 w-4"}),"Add Tag"]})]}),o.jsxs("div",{className:"flex items-center gap-3 mt-4 p-3 rounded-lg border border-border bg-muted/30",children:[o.jsx(bn,{className:"h-4 w-4 text-primary shrink-0"}),o.jsxs("div",{className:"flex-1",children:[o.jsx(Pe,{htmlFor:"autoTag",className:"text-sm font-medium cursor-pointer",children:"Auto-tag matching reviews"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Automatically tag all reviews that mention the tag name in their comment"})]}),o.jsx(vo,{id:"autoTag",checked:s,onCheckedChange:c})]}),u.trim()&&o.jsxs("div",{className:"mt-3",children:[o.jsx("span",{className:"text-sm text-muted-foreground mr-2",children:"Preview:"}),o.jsx(Se,{variant:"outline",className:"border-transparent text-white",style:{backgroundColor:f},children:u.trim()})]})]})]}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsxs(We,{children:["Your Tags (",e.length,")"]}),o.jsx(ft,{children:"Manage existing tags — edit names, colors, or delete unused tags"})]}),o.jsx(de,{children:e.length===0?o.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No tags yet. Create one above to get started."}):o.jsx("div",{className:"space-y-2",children:e.map(M=>o.jsx("div",{className:"flex items-center justify-between rounded-lg border border-border bg-card p-3 transition-colors hover:bg-muted/50",children:m===M.id?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[o.jsx("div",{className:"flex gap-1",children:Mf.map(L=>o.jsx("button",{className:"h-6 w-6 rounded-full border-2 transition-transform hover:scale-110",style:{backgroundColor:L,borderColor:w===L?"hsl(var(--foreground))":"transparent"},onClick:()=>S(L),type:"button"},L))}),o.jsx(Te,{value:x,onChange:L=>y(L.target.value),className:"max-w-[200px] h-8",maxLength:50,onKeyDown:L=>L.key==="Enter"&&B()})]}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(X,{size:"sm",variant:"ghost",onClick:B,disabled:_,children:_?o.jsx(ke,{className:"h-4 w-4 animate-spin"}):o.jsx(To,{className:"h-4 w-4"})}),o.jsx(X,{size:"sm",variant:"ghost",onClick:()=>v(null),children:o.jsx(Ro,{className:"h-4 w-4"})})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex items-center gap-3",children:o.jsx(Se,{variant:"outline",className:"border-transparent text-white",style:{backgroundColor:M.color},children:M.name})}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(X,{size:"sm",variant:"ghost",title:"Scan & auto-tag matching reviews",onClick:async()=>{A(M.id);const L=await i(M.id,M.name);L>0?G.success(`Auto-tagged ${L} review${L>1?"s":""} with "${M.name}"`):G.info(`No new matching reviews found for "${M.name}"`),A(null)},disabled:E===M.id,children:E===M.id?o.jsx(ke,{className:"h-4 w-4 animate-spin"}):o.jsx(bn,{className:"h-4 w-4"})}),o.jsx(X,{size:"sm",variant:"ghost",onClick:()=>T(M),children:o.jsx(rN,{className:"h-4 w-4"})}),o.jsx(X,{size:"sm",variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>F(M.id,M.name),disabled:k===M.id,children:k===M.id?o.jsx(ke,{className:"h-4 w-4 animate-spin"}):o.jsx(Md,{className:"h-4 w-4"})})]})]})},M.id))})})]})]})};var a0="Popover",[p9,FLe]=Fn(a0,[Io]),Rm=Io(),[wRe,Vo]=p9(a0),m9=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!1}=e,l=Rm(t),c=b.useRef(null),[u,d]=b.useState(!1),[f,h]=Tr({prop:r,defaultProp:i??!1,onChange:a,caller:a0});return o.jsx(Mx,{...l,children:o.jsx(wRe,{scope:t,contentId:Pr(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:b.useCallback(()=>d(!0),[]),onCustomAnchorRemove:b.useCallback(()=>d(!1),[]),modal:s,children:n})})};m9.displayName=a0;var g9="PopoverAnchor",_Re=b.forwardRef((e,t)=>
vendor: 4,472 bytes, line 748
748{const{__scopePopover:n,...r}=e,i=Vo(g9,n),a=Rm(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=i;return b.useEffect(()=>(s(),()=>l()),[s,l]),o.jsx(nm,{...a,...r,ref:t})});_Re.displayName=g9;var v9="PopoverTrigger",y9=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Vo(v9,n),a=Rm(n),s=Qe(t,i.triggerRef),l=o.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":j9(i.open),...r,ref:s,onClick:me(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:o.jsx(nm,{asChild:!0,...a,children:l})});y9.displayName=v9;var lE="PopoverPortal",[jRe,SRe]=p9(lE,{forceMount:void 0}),x9=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Vo(lE,t);return o.jsx(jRe,{scope:t,forceMount:n,children:o.jsx(pr,{present:n||a.open,children:o.jsx(Ad,{asChild:!0,container:i,children:r})})})};x9.displayName=lE;var Sd="PopoverContent",b9=b.forwardRef((e,t)=>{const n=SRe(Sd,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Vo(Sd,e.__scopePopover);return o.jsx(pr,{present:r||a.open,children:a.modal?o.jsx(NRe,{...i,ref:t}):o.jsx(CRe,{...i,ref:t})})});b9.displayName=Sd;var kRe=wo("PopoverContent.RemoveScroll"),NRe=b.forwardRef((e,t)=>{const n=Vo(Sd,e.__scopePopover),r=b.useRef(null),i=Qe(t,r),a=b.useRef(!1);return b.useEffect(()=>{const s=r.current;if(s)return Gx(s)},[]),o.jsx(am,{as:kRe,allowPinchZoom:!0,children:o.jsx(w9,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:me(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),CRe=b.forwardRef((e,t)=>{const n=Vo(Sd,e.__scopePopover),r=b.useRef(!1),i=b.useRef(!1);return o.jsx(w9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,i.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"&&(i.current=!0));const s=a.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),w9=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Vo(Sd,n),p=Rm(n);return qx(),o.jsx(im,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:o.jsx(ic,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:o.jsx($x,{"data-state":j9(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.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)"}})})})}),_9="PopoverClose",ERe=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Vo(_9,n);return o.jsx(Ce.button,{type:"button",...r,ref:t,onClick:me(e.onClick,()=>i.onOpenChange(!1))})});ERe.displayName=_9;var PRe="PopoverArrow",ORe=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Rm(n);return o.jsx(Dx,{...i,...r,ref:t})});ORe.displayName=PRe;function j9(e){return e?"open":"closed"}var ARe=m9,TRe=y9,RRe=x9,S9=b9;const PS=ARe,OS=TRe,rx=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>o.jsx(RRe,{children:o.jsx(S9,{ref:i,align:t,sideOffset:n,className:he("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
748de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));rx.displayName=S9.displayName;var cE="Progress",uE=100,[IRe,BLe]=Fn(cE),[MRe,$Re]=IRe(cE),k9=b.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=DRe,...s}=e;(i||i===0)&&!qI(i)&&console.error(LRe(`${i}`,"Progress"));const l=qI(i)?i:uE;r!==null&&!VI(r,l)&&console.error(FRe(`${r}`,"Progress"));const c=VI(r,l)?r:null,u=ix(c)?a(c,l):void 0;return o.jsx(MRe,{scope:n,value:c,max:l,children:o.jsx(Ce.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":ix(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":E9(c,l),"data-value":c??void 0,"data-max":l,...s,ref:t})})});k9.displayName=cE;var N9="ProgressIndicator",C9=b.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=$Re(N9,n);return o.jsx(Ce.div,{"data-state":E9(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});C9.displayName=N9;function DRe(e,t){return`${Math.round(e/t*100)}%`}function E9(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function ix(e){return typeof e=="number"}function qI(e){return ix(e)&&!isNaN(e)&&e>0}function VI(e,t){return ix(e)&&!isNaN(e)&&e<=t&&e>=0}function LRe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${uE}\`.`}function FRe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
749  - a positive number
750  - less than the value passed to \`max\` (or ${uE} if no \`max\` prop is set)
751  - \`null\` or \`undefined\` if the progress is indeterminate.
752
753Defaulting to \`null\`.`}var P9=k9,BRe=C9;const AS=b.forwardRef(({className:e,value:t,...n},r)=>o.jsx(P9,{ref:r,className:he("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:o.jsx(BRe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));AS.displayName=P9.displayName;const URe=({businessFilter:e,timeRange:t})=>{const[n,r]=b.useState(null),[i,a]=b.useState(!1),[s,l]=b.useState(null),c=async()=>{a(!0),l(null);try{const{data:u,error:d}=await Y.functions.invoke("extract-themes",{body:{business_id:e,time_range:t}});if(d)throw new Error(d.message);if(u!=null&&u.error)throw new Error(u.error);r(u)}catch(u){const d=(u==null?void 0:u.message)||"Failed to extract themes";l(d),G.error(d)}finally{a(!1)}};return!n&&!i?o.jsx(pe,{children:o.jsxs(de,{className:"p-8 flex flex-col items-center gap-4 text-center",children:[o.jsx(bn,{className:"h-10 w-10 text-primary/60"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-base font-display font-semibold text-foreground",children:"AI Keyword Extraction"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Identify the most common themes in your positive and negative reviews using AI."})]}),o.jsxs(X,{onClick:c,disabled:i,className:"gap-2",children:[o.jsx(bn,{className:"h-4 w-4"}),"Extract Themes"]}),s&&o.jsxs("p",{className:"text-sm text-destructive flex items-center gap-1.5",children:[o.jsx(Lv,{className:"h-3.5 w-3.5"})," ",s]})]})}):i?o.jsx(pe,{children:o.jsxs(de,{className:"p-8 flex flex-col items-center gap-3",children:[o.jsx(ke,{className:"h-8 w-8 animate-spin text-primary"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Analyzing your reviews…"})]})}):n!=null&&n.message?o.jsx(pe,{children:o.jsxs(de,{className:"p-8 text-center",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:n.message}),o.jsxs(X,{variant:"outline",size:"sm",onClick:c,className:"mt-3 gap-2",children:[o.jsx(bn,{className:"h-3.5 w-3.5"})," Retry"]})]})}):o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs(We,{className:"text-base font-display flex items-center gap-2",children:[o.jsx(bn,{className:"h-4 w-4 text-primary"}),"AI Keyword Themes"]}),o.jsxs(X,{variant:"ghost",size:"sm",onClick:c,disabled:i,className:"gap-1.5 text-xs",children:[o.jsx(bn,{className:"h-3 w-3"})," Refresh"]})]})}),o.jsx(de,{children:o.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h4",{className:"text-sm font-medium text-foreground flex items-center gap-1.5",children:[o.jsx(aN,{className:"h-4 w-4 text-emerald-600"}),"Positive Themes"]}),n!=null&&n.positive_themes&&n.positive_themes.length>0?o.jsx("div",{className:"space-y-2.5",children:n.positive_themes.map((u,d)=>o.jsxs("div",{className:"rounded-lg border border-border p-3 space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Se,{variant:"secondary",className:"text-xs bg-emerald-50 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300 border-0",children:u.theme}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.count," mentions"]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground italic flex gap-1",children:[o.jsx(P2,{className:"h-3 w-3 shrink-0 mt-0.5"}),'"',u.example_quote,'"']})]},d))}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"No positive themes found"})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("h4",{className:"text-sm font-medium text-foreground flex items-center gap-1.5",children:[o.jsx(S5,{className:"h-4 w-4 text-red-500"}),"Negative Themes"]}),n!=null&&n.negative_themes&&n.negative_themes.length>0?o.jsx("div",{className:"space-y-2.5",children:n.negative_themes.map((u,d)=>o.jsxs("div",{className:"rounded-lg border border-border p-3 space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Se,{variant:"secondary",className:"text-xs bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-300 border-0",children:u.theme}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.count," mentions"]})]}),o.jsxs("p",{className:"text-xs text-muted-foreground italic flex gap-1",children:[o.jsx(P2,{className:"h-3 w-3 shrink-0 mt-0.5"}),'"',u.example_quote,'"']})]},d))}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"No negative themes found"})]})]})})]})},zRe={positive:VK,neutral:IK,negative:g5}
753,WRe={positive:"text-emerald-600",neutral:"text-amber-500",negative:"text-red-500"},HRe=({reviews:e,businesses:t,tags:n,reviewTags:r})=>{const[i,a]=b.useState("all"),[s,l]=b.useState("all"),[c,u]=b.useState("all"),d=b.useMemo(()=>{let h=e;if(i!=="all"&&(h=h.filter(m=>m.business_id===i)),c!=="all"){const m=new Set(r.filter(v=>v.tag_id===c).map(v=>v.review_id));h=h.filter(v=>m.has(v.id))}const p=new Date;let g;switch(s){case"7d":g=gu(p,7);break;case"30d":g=gu(p,30);break;case"90d":g=gu(p,90);break;case"12m":g=v8(p,12);break;default:g=new Date(0)}return s!=="all"&&(h=h.filter(m=>new Date(m.review_date)>=g)),h},[e,i,s,c,r]),f=b.useMemo(()=>{const h=d.length,p=d.filter(M=>M.sentiment==="positive").length,g=d.filter(M=>M.sentiment==="neutral").length,m=d.filter(M=>M.sentiment==="negative").length,v=h>0?d.reduce((M,L)=>M+L.rating,0)/h:0,x=d.filter(M=>M.comment&&M.comment.trim().length>0).length,y=d.filter(M=>M.reply).length,w=[...d].sort((M,L)=>new Date(M.review_date).getTime()-new Date(L.review_date).getTime()),S=Math.floor(w.length/2),_=w.slice(0,S),j=w.slice(S),k=_.length>0?_.reduce((M,L)=>M+L.rating,0)/_.length:0,E=(j.length>0?j.reduce((M,L)=>M+L.rating,0)/j.length:0)-k,A=[5,4,3,2,1].map(M=>({star:M,count:d.filter(L=>L.rating===M).length,pct:h>0?d.filter(L=>L.rating===M).length/h*100:0})),P=new Map;d.forEach(M=>{const L=M.source||"unknown";P.has(L)||P.set(L,{total:0,positive:0,negative:0,avgRating:0});const R=P.get(L);R.total++,M.sentiment==="positive"&&R.positive++,M.sentiment==="negative"&&R.negative++}),P.forEach(M=>{const L=d.filter(R=>{var $;return(R.source||"unknown")===(($=[...P.entries()].find(([,O])=>O===M))==null?void 0:$[0])});M.avgRating=L.length>0?L.reduce((R,$)=>R+$.rating,0)/L.length:0});const T=d.filter(M=>M.sentiment==="negative"&&!M.reply).sort((M,L)=>new Date(L.review_date).getTime()-new Date(M.review_date).getTime()).slice(0,5),B=new Map;d.forEach(M=>{const L=nn(go(M.review_date),"yyyy-MM");B.has(L)||B.set(L,{positive:0,negative:0,neutral:0,total:0});const R=B.get(L);R.total++,M.sentiment==="positive"?R.positive++:M.sentiment==="negative"?R.negative++:R.neutral++});const F=[...B.entries()].sort(([M],[L])=>M.localeCompare(L)).map(([M,L])=>({month:nn(new Date(M+"-01"),"MMM yyyy"),...L}));return{total:h,positive:p,neutral:g,negative:m,avgRating:v,withComment:x,replied:y,trend:E,ratingDist:A,sources:P,needsAttention:T,monthlyTrend:F}},[d]);return o.jsxs("div",{className:"space-y-5",children:[o.jsx(pe,{children:o.jsx(de,{className:"p-4",children:o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs(St,{value:s,onValueChange:l,children:[o.jsxs(wt,{className:"w-full sm:w-40",children:[o.jsx(ch,{className:"mr-1.5 h-3.5 w-3.5 text-muted-foreground"}),o.jsx(kt,{})]}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All time"}),o.jsx(we,{value:"7d",children:"Last 7 days"}),o.jsx(we,{value:"30d",children:"Last 30 days"}),o.jsx(we,{value:"90d",children:"Last 90 days"}),o.jsx(we,{value:"12m",children:"Last 12 months"})]})]}),t.length>1&&o.jsxs(St,{value:i,onValueChange:a,children:[o.jsxs(wt,{className:"w-full sm:w-44",children:[o.jsx(Jr,{className:"mr-1.5 h-3.5 w-3.5 text-muted-foreground"}),o.jsx(kt,{})]}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All businesses"}),t.map(h=>o.jsx(we,{value:h.id,children:h.name},h.id))]})]}),n.length>0&&o.jsxs(St,{value:c,onValueChange:u,children:[o.jsxs(wt,{className:"w-full sm:w-44",children:[o.jsx(iN,{className:"mr-1.5 h-3.5 w-3.5 text-muted-foreground"}),o.jsx(kt,{})]}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All tags"}),n.map(h=>o.jsx(we,{value:h.id,children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:h.color}}),h.name]})},h.id))]})]})]})})}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[o.jsx(pe,{children:o.jsxs(de,{className:"p-5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Sentiment Score"}),f.trend>
753.1?o.jsx(N5,{className:"h-4 w-4 text-emerald-500"}):f.trend<-.1?o.jsx(k5,{className:"h-4 w-4 text-red-500"}):o.jsx(nN,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[o.jsxs("span",{className:"text-3xl font-bold font-display text-foreground",children:[f.total>0?Math.round(f.positive/f.total*100):0,"%"]}),o.jsx("span",{className:"text-sm text-muted-foreground",children:"positive"})]}),o.jsxs("div",{className:"mt-2 flex h-2 rounded-full overflow-hidden bg-muted",children:[f.positive>0&&o.jsx("div",{className:"bg-emerald-500",style:{width:`${f.positive/f.total*100}%`}}),f.neutral>0&&o.jsx("div",{className:"bg-amber-400",style:{width:`${f.neutral/f.total*100}%`}}),f.negative>0&&o.jsx("div",{className:"bg-red-500",style:{width:`${f.negative/f.total*100}%`}})]})]})}),o.jsx(pe,{children:o.jsxs(de,{className:"p-5",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Average Rating"}),o.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[o.jsx("span",{className:"text-3xl font-bold font-display text-foreground",children:f.avgRating.toFixed(1)}),o.jsx(pi,{className:"h-5 w-5 fill-warning text-warning"})]}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[f.trend>.1?"↑ Improving":f.trend<-.1?"↓ Declining":"→ Stable"," vs previous period"]})]})}),o.jsx(pe,{children:o.jsxs(de,{className:"p-5",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Response Rate"}),o.jsx("div",{className:"mt-2 flex items-baseline gap-2",children:o.jsxs("span",{className:"text-3xl font-bold font-display text-foreground",children:[f.total>0?Math.round(f.replied/f.total*100):0,"%"]})}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[f.replied," of ",f.total," reviews replied"]})]})}),o.jsx(pe,{children:o.jsxs(de,{className:"p-5",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Reviews"}),o.jsx("div",{className:"mt-2 flex items-baseline gap-2",children:o.jsx("span",{className:"text-3xl font-bold font-display text-foreground",children:f.total})}),o.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[f.withComment," with comments"]})]})})]}),o.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsx(We,{className:"text-base font-display",children:"Sentiment Breakdown"})}),o.jsx(de,{className:"space-y-4",children:["positive","neutral","negative"].map(h=>{const p=f[h],g=f.total>0?p/f.total*100:0,m=zRe[h];return o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(m,{className:`h-4 w-4 ${WRe[h]}`}),o.jsx("span",{className:"capitalize text-foreground font-medium",children:h})]}),o.jsxs("span",{className:"text-muted-foreground",children:[p," (",g.toFixed(0),"%)"]})]}),o.jsx(AS,{value:g,className:"h-2"})]},h)})})]}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsx(We,{className:"text-base font-display",children:"Rating Distribution"})}),o.jsx(de,{className:"space-y-3",children:f.ratingDist.map(({star:h,count:p,pct:g})=>o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-1 w-16 shrink-0",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:h}),o.jsx(pi,{className:"h-3.5 w-3.5 fill-warning text-warning"})]}),o.jsx("div",{className:"flex-1",children:o.jsx(AS,{value:g,className:"h-2"})}),o.jsx("span",{className:"text-xs text-muted-foreground w-10 text-right",children:p})]},h))})]})]}),f.monthlyTrend.length>1&&o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsx(We,{className:"text-base font-display",children:"Monthly Sentiment Trend"})}),o.jsx(de,{children:o.jsxs("div",{className:"space-y-2",children:[f.monthlyTrend.map(h=>{const p=h.total>0?h.positive/h.total*100:0,g=h.total>0?h.neutral/h.total*100:0,m=h.total>0?h.negative/h.total*100:0;return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-xs text-muted-foreground w-20 shrink-0",children:h.month}),o.jsxs("div",{className:"flex-1 flex h-5 rounded-md overflow-hidden bg-muted",children:[h.positive>0&&o.jsx("div",{className:"bg-emerald-500 flex items-center justify-center",style:{width:`${p}%`},children:p>15&&o.jsx("span",{className:"text-[9px] text-white font-medium",children:h.positive})}),h.neutral>0&&o.jsx("div",{className:"bg-amber-400 flex items-center justify-center",style:{width:`${g}%`},children:g>15&&o.jsx("span",{className:"text-[9px] text-white font-medium",children:h.neutral})}),h.negative>0&&o.jsx("div",{className:"bg-red-500 flex items-center justify-center",style:{width:`${m}%`},children:m>15&&o.jsx("span",{className:"text-[9px] text-white font-medium",children:h.negative})})]}),o.jsx("span",{className:"text-xs text-muted-foreground w-8 text-right",children:h.total})]},h.month)}),o.jsxs("div",{className:"flex items-center gap-4 pt-2 text-xs text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"h-2.5 w-2.5 rounded-sm bg-emerald-500"})," Positive"]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"h-2.5 w-2.5 rounded-sm bg-amber-400"})," Neutral"]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"h-2.5 w-2.5 rounded-sm bg-red-500"})," Negative"]})]})]})})]}),o.jsx(URe,{businessFilter:i,timeRange:s}),f.sources.size>1&&o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsx(We,{className:"text-base font-display",children:"Sentiment by Source"})}),o.jsx(de,{children:o.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:[...f.sources.entries()].map(([h,p])=>o.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Se,{variant:"outline",className:"capitalize text-xs",children:h}),o.jsxs("span",{className:"text-sm font-medium text-foreground",children:[p.total," reviews"]})]}),o.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[o.jsxs("span",{className:"flex items-center gap-1 text-emerald-600",children:[o.jsx(aN,{className:"h-3.5 w-3.5"})," ",p.positive]}),o.jsxs("span",{className:"flex items-center gap-1 text-red-500",children:[o.jsx(S5,{className:"h-3.5 w-3.5"})," ",p.negative]}),o.jsxs("span",{className:"text-muted-foreground ml-auto",children:[p.total>0?Math.round(p.positive/p.total*100):0,"% positive"]})]})]},h))})})]}),f.needsAttention.length>0&&o.jsxs(pe,{children:[o.jsxs(ze,{className:"pb-3",children:[o.jsxs(We,{className:"text-base font-display flex items-center gap-2",children:[o.jsx(g5,{className:"h-4 w-4 text-red-500"}),"Needs Attention"]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Negative reviews without a reply"})]}),o.jsx(de,{className:"space-y-3",children:f.needsAttention.map(h=>o.jsxs("div",{className:"rounded-lg border border-border p-3 space-y-1.5",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:h.reviewer_name}),o.jsx(Se,{variant:"outline",className:"text-[10px] capitalize",children:h.source})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(p=>o.jsx(pi,{className:`h-3 w-3 ${p<=h.rating?"fill-warning text-warning":"text-border"}`},p))}),o.jsx("span",{className:"text-xs text-muted-foreground",children:nn(go(h.review_date),"MMM d, yyyy")})]})]}),h.comment&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.comment})]}
753,h.id))})]})]})};var Be=function(){return Be=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Be.apply(this,arguments)};function qRe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function O9(e,t,n){for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Im(e){return e.mode==="multiple"}function Mm(e){return e.mode==="range"}function s0(e){return e.mode==="single"}var VRe={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function GRe(e,t){return nn(e,"LLLL y",t)}function KRe(e,t){return nn(e,"d",t)}function YRe(e,t){return nn(e,"LLLL",t)}function XRe(e){return"".concat(e)}function QRe(e,t){return nn(e,"cccccc",t)}function JRe(e,t){return nn(e,"yyyy",t)}var ZRe=Object.freeze({__proto__:null,formatCaption:GRe,formatDay:KRe,formatMonthCaption:YRe,formatWeekNumber:XRe,formatWeekdayName:QRe,formatYearCaption:JRe}),eIe=function(e,t,n){return nn(e,"do MMMM (EEEE)",n)},tIe=function(){return"Month: "},nIe=function(){return"Go to next month"},rIe=function(){return"Go to previous month"},iIe=function(e,t){return nn(e,"cccc",t)},aIe=function(e){return"Week n. ".concat(e)},sIe=function(){return"Year: "},oIe=Object.freeze({__proto__:null,labelDay:eIe,labelMonthDropdown:tIe,labelNext:nIe,labelPrevious:rIe,labelWeekNumber:aIe,labelWeekday:iIe,labelYearDropdown:sIe});function lIe(){var e="buttons",t=VRe,n=MC,r={},i={},a=1,s={},l=new Date;return{captionLayout:e,classNames:t,formatters:ZRe,labels:oIe,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:a,styles:s,today:l,mode:"default"}}function cIe(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,a=e.fromDate,s=e.toDate;return r?a=Yn(r):t&&(a=new Date(t,0,1)),i?s=Hb(i):n&&(s=new Date(n,11,31)),{fromDate:a?wd(a):void 0,toDate:s?wd(s):void 0}}var A9=b.createContext(void 0);function uIe(e){var t,n=e.initialProps,r=lIe(),i=cIe(n),a=i.fromDate,s=i.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;l!=="buttons"&&(!a||!s)&&(l="buttons");var c;(s0(n)||Im(n)||Mm(n))&&(c=n.onSelect);var u=Be(Be(Be({},r),n),{captionLayout:l,classNames:Be(Be({},r.classNames),n.classNames),components:Be({},n.components),formatters:Be(Be({},r.formatters),n.formatters),fromDate:a,labels:Be(Be({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Be(Be({},r.modifiers),n.modifiers),modifiersClassNames:Be(Be({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:Be(Be({},r.styles),n.styles),toDate:s});return o.jsx(A9.Provider,{value:u,children:e.children})}function $t(){var e=b.useContext(A9);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function T9(e){var t=$t(),n=t.locale,r=t.classNames,i=t.styles,a=t.formatters.formatCaption;return o.jsx("div",{className:r.caption_label,style:i.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:n})})}function dIe(e){return o.jsx("svg",Be({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:o.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.7
75378175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function R9(e){var t,n,r=e.onChange,i=e.value,a=e.children,s=e.caption,l=e.className,c=e.style,u=$t(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:dIe;return o.jsxs("div",{className:l,style:c,children:[o.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),o.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:r,children:a}),o.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,o.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function fIe(e){var t,n=$t(),r=n.fromDate,i=n.toDate,a=n.styles,s=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return o.jsx(o.Fragment,{});if(!i)return o.jsx(o.Fragment,{});var f=[];if(c2e(r,i))for(var h=Yn(r),p=r.getMonth();p<=i.getMonth();p++)f.push(Dw(h,p));else for(var h=Yn(new Date),p=0;p<=11;p++)f.push(Dw(h,p));var g=function(v){var x=Number(v.target.value),y=Dw(Yn(e.displayMonth),x);e.onChange(y)},m=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:R9;return o.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:a.dropdown_month,onChange:g,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:s}),children:f.map(function(v){return o.jsx("option",{value:v.getMonth(),children:l(v,{locale:s})},v.getMonth())})})}function hIe(e){var t,n=e.displayMonth,r=$t(),i=r.fromDate,a=r.toDate,s=r.locale,l=r.styles,c=r.classNames,u=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,h=[];if(!i)return o.jsx(o.Fragment,{});if(!a)return o.jsx(o.Fragment,{});for(var p=i.getFullYear(),g=a.getFullYear(),m=p;m<=g;m++)h.push(II(c8(new Date),m));var v=function(y){var w=II(Yn(n),Number(y.target.value));e.onChange(w)},x=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:R9;return o.jsx(x,{name:"years","aria-label":f(),className:c.dropdown_year,style:l.dropdown_year,onChange:v,value:n.getFullYear(),caption:d(n,{locale:s}),children:h.map(function(y){return o.jsx("option",{value:y.getFullYear(),children:d(y,{locale:s})},y.getFullYear())})})}function pIe(e,t){var n=b.useState(e),r=n[0],i=n[1],a=t===void 0?r:t;return[a,i]}function mIe(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,a=e.toDate,s=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(a&&jd(a,i)<0){var u=-1*(c-1);i=wi(a,u)}return s&&jd(i,s)<0&&(i=s),Yn(i)}function gIe(){var e=$t(),t=mIe(e),n=pIe(t,e.month),r=n[0],i=n[1],a=function(s){var l;if(!e.disableNavigation){var c=Yn(s);i(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[r,a]}function vIe(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=Yn(e),a=Yn(wi(i,r)),s=jd(a,i),l=[],c=0;c<s;c++){var u=wi(i,c);l.push(u)}return n&&(l=l.reverse()),l}function yIe(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,a=i===void 0?1:i,s=r?a:1,l=Yn(e);if(!n)return wi(l,s);var c=jd(n,e);if(!(c<a))return wi(l,s)}}function xIe(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,a=i===void 0?1:i,s=r?a:1,l=Yn(e);if(!n)return wi(l,-s);var c=jd(l,n);if(!(c<=0))return wi(l,-s)}}var I9=b.createContext(void 0);function bIe(e){var t=$t(),n=gIe(),r=n[0],i=n[1],a=vIe(r,t),s=yIe(r,t),l=xIe(r,t),c=function(f){return a.some(function(h){return $C(f,h)})},u=function(f,h){c(f)||(h&&m8(f,h)?i(wi(f,1+t.numberOfMonths*-1)):i(f))},d={currentMonth:r,displayMonths:a,goToMonth:i,goToDate:u,previousMonth:l,nextMonth:s,isDateDisplayed:c};return o.jsx(I9.Provider,{value:d,children:e.children})}function $m(){var e=b.useContext(I9);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function GI(e){var t,n=$t(),r=n.classNames,i=n.styles,a=n.components,s=$m().goToMonth,l=function(d){s(wi(d,e.displayIndex?-e.dis
753playIndex:0))},c=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:T9,u=o.jsx(c,{id:e.id,displayMonth:e.displayMonth});return o.jsxs("div",{className:r.caption_dropdowns,style:i.caption_dropdowns,children:[o.jsx("div",{className:r.vhidden,children:u}),o.jsx(fIe,{onChange:l,displayMonth:e.displayMonth}),o.jsx(hIe,{onChange:l,displayMonth:e.displayMonth})]})}function wIe(e){return o.jsx("svg",Be({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:o.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function _Ie(e){return o.jsx("svg",Be({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:o.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var ax=b.forwardRef(function(e,t){var n=$t(),r=n.classNames,i=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var s=a.join(" "),l=Be(Be({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),o.jsx("button",Be({},e,{ref:t,type:"button",className:s,style:l}))});function jIe(e){var t,n,r=$t(),i=r.dir,a=r.locale,s=r.classNames,l=r.styles,c=r.labels,u=c.labelPrevious,d=c.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return o.jsx(o.Fragment,{});var h=u(e.previousMonth,{locale:a}),p=[s.nav_button,s.nav_button_previous].join(" "),g=d(e.nextMonth,{locale:a}),m=[s.nav_button,s.nav_button_next].join(" "),v=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:_Ie,x=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:wIe;return o.jsxs("div",{className:s.nav,style:l.nav,children:[!e.hidePrevious&&o.jsx(ax,{name:"previous-month","aria-label":h,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:i==="rtl"?o.jsx(v,{className:s.nav_icon,style:l.nav_icon}):o.jsx(x,{className:s.nav_icon,style:l.nav_icon})}),!e.hideNext&&o.jsx(ax,{name:"next-month","aria-label":g,className:m,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:i==="rtl"?o.jsx(x,{className:s.nav_icon,style:l.nav_icon}):o.jsx(v,{className:s.nav_icon,style:l.nav_icon})})]})}function KI(e){var t=$t().numberOfMonths,n=$m(),r=n.previousMonth,i=n.nextMonth,a=n.goToMonth,s=n.displayMonths,l=s.findIndex(function(g){return $C(e.displayMonth,g)}),c=l===0,u=l===s.length-1,d=t>1&&(c||!u),f=t>1&&(u||!c),h=function(){r&&a(r)},p=function(){i&&a(i)};return o.jsx(jIe,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:i,previousMonth:r,onPreviousClick:h,onNextClick:p})}function SIe(e){var t,n=$t(),r=n.classNames,i=n.disableNavigation,a=n.styles,s=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:T9,u;return i?u=o.jsx(c,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?u=o.jsx(GI,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?u=o.jsxs(o.Fragment,{children:[o.jsx(GI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),o.jsx(KI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=o.jsxs(o.Fragment,{children:[o.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),o.jsx(KI,{displayMonth:e.displayMonth,id:e.id})]}),o.jsx("div",{className:r.caption,style:a.caption,children:u})}function kIe(e){var t=$t(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?o.jsx("tfoot",{className:i,style:r.tfoot,children:o.jsx("tr",{children:o.jsx("td",{colSpan:8,children:n})})}):o.jsx(o.Fragment,{})}function NIe(e,t,n){for(var r=n?Ql(new Date):Pa(new Date,{locale:e,weekStartsOn:t}),i=[],a=0;a<7;a++){var s=rr(r,a);i.push(s)}return i}function CIe(){var e=$t(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,a=e.weekStartsOn,s=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=NIe(i,a,s);return o.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&o.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(d,f){return o.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(d,{locale:i}),children:l(d,{locale:i})},f)})]})}function EIe(){var e,t=$t(),n=t.classNames,r=t.styles,i=t.components,a=(e=i==null?void 0:i.HeadRow)!==null&&e!==void 0?e:CIe;return o.jsx("thead",{style:r.head,className:n.head,children:o.jsx(a,{})})}function PIe(e){var t=$t(),n=t.locale,r=t.formatters.formatDay;return o.jsx(o.Fragment,{children:r(e.date,{locale:n})})}var dE=b.createContext(void 0);function OIe(e){if(!Im(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return o.jsx(dE.Provider,{value:t,children:e.children})}return o.jsx(AIe,{initialProps:e.initialProps,children:e.children})}function AIe(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,a=t.max,s=function(u,d,f){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,u,d,f);var g=!!(d.selected&&i&&(r==null?void 0:r.length)===i);if(!g){var m=!!(!d.selected&&a&&(r==null?void 0:r.length)===a);if(!m){var v=r?O9([],r):[];if(d.selected){var x=v.findIndex(function(y){return Sr(u,y)});v.splice(x,1)}else v.push(u);(p=t.onSelect)===null||p===void 0||p.call(t,v,u,d,f)}}},l={disabled:[]};r&&l.disabled.push(function(u){var d=a&&r.length>a-1,f=r.some(function(h){return Sr(h,u)});return!!(d&&!f)});var c={selected:r,onDayClick:s,modifiers:l};return o.jsx(dE.Provider,{value:c,children:n})}function fE(){var e=b.useContext(dE);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function TIe(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?Sr(i,e)&&Sr(r,e)?void 0:Sr(i,e)?{from:i,to:void 0}:Sr(r,e)?void 0:xS(r,e)?{from:e,to:i}:{from:r,to:e}:i?xS(e,i)?{from:i,to:e}:{from:e,to:i}:r?m8(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var hE=b.createContext(void 0);function RIe(e){if(!Mm(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return o.jsx(hE.Provider,{value:t,children:e.children})}return o.jsx(IIe,{initialProps:e.initialProps,children:e.children})}function IIe(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},a=i.from,s=i.to,l=t.min,c=t.max,u=function(p,g,m){var v,x;(v=t.onDayClick)===null||v===void 0||v.call(t,p,g,m);var y=TIe(p,r);(x=t.onSelect)===null||x===void 0||x.call(t,y,p,g,m)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(d.range_start=[a],s?(d.range_end=[s],Sr(a,s)||(d.range_middle=[{after:a,before:s}])):d.range_end=[a]):s&&(d.range_start=[s],d.range_end=[s]),l&&(a&&!s&&d.disabled.push({after:gu(a,l-1),before:rr(a,l-1)}),a&&s&&d.disabled.push({after:a,before:rr(a,l-1)}),!a&&s&&d.disabled.push({after:gu(s,l-1),before:rr(s,l-1)})),c){if(a&&!s&&(d.disabled.push({before:rr(a,-c+1)}),d.disabled.push({after:rr(a,c-1)})),a&&s){var f=xa(s,a)+1,h=c-f;d.disabled.push({before:gu(a,h)}),d.disabled.push({after:rr(s,h)})}!a&&s&&(d.disabled.push({before:rr(s,-c+1)}),d.disabled.push({after:rr(s,c-1)}))}return o.jsx(hE.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function pE(){var e=b.useContext(hE);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ov(e){return Array.isArray(e)?O9([],e):e!==void 0?[e]:[]}function MIe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],i=n[1];t[r]=ov(i)}),t}var Ji;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Ji||(Ji={}));
753var $Ie=Ji.Selected,$a=Ji.Disabled,DIe=Ji.Hidden,LIe=Ji.Today,Uw=Ji.RangeEnd,zw=Ji.RangeMiddle,Ww=Ji.RangeStart,FIe=Ji.Outside;function BIe(e,t,n){var r,i=(r={},r[$Ie]=ov(e.selected),r[$a]=ov(e.disabled),r[DIe]=ov(e.hidden),r[LIe]=[e.today],r[Uw]=[],r[zw]=[],r[Ww]=[],r[FIe]=[],r);return e.fromDate&&i[$a].push({before:e.fromDate}),e.toDate&&i[$a].push({after:e.toDate}),Im(e)?i[$a]=i[$a].concat(t.modifiers[$a]):Mm(e)&&(i[$a]=i[$a].concat(n.modifiers[$a]),i[Ww]=n.modifiers[Ww],i[zw]=n.modifiers[zw],i[Uw]=n.modifiers[Uw]),i}var M9=b.createContext(void 0);function UIe(e){var t=$t(),n=fE(),r=pE(),i=BIe(t,n,r),a=MIe(t.modifiers),s=Be(Be({},i),a);return o.jsx(M9.Provider,{value:s,children:e.children})}function $9(){var e=b.useContext(M9);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function zIe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function WIe(e){return!!(e&&typeof e=="object"&&"from"in e)}function HIe(e){return!!(e&&typeof e=="object"&&"after"in e)}function qIe(e){return!!(e&&typeof e=="object"&&"before"in e)}function VIe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function GIe(e,t){var n,r=t.from,i=t.to;if(r&&i){var a=xa(i,r)<0;a&&(n=[i,r],r=n[0],i=n[1]);var s=xa(e,r)>=0&&xa(i,e)>=0;return s}return i?Sr(i,e):r?Sr(r,e):!1}function KIe(e){return RC(e)}function YIe(e){return Array.isArray(e)&&e.every(RC)}function XIe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(KIe(n))return Sr(e,n);if(YIe(n))return n.includes(e);if(WIe(n))return GIe(e,n);if(VIe(n))return n.dayOfWeek.includes(e.getDay());if(zIe(n)){var r=xa(n.before,e),i=xa(n.after,e),a=r>0,s=i<0,l=xS(n.before,n.after);return l?s&&a:a||s}return HIe(n)?xa(e,n.after)>0:qIe(n)?xa(n.before,e)>0:typeof n=="function"?n(e):!1})}function mE(e,t,n){var r=Object.keys(t).reduce(function(a,s){var l=t[s];return XIe(e,l)&&a.push(s),a},[]),i={};return r.forEach(function(a){return i[a]=!0}),n&&!$C(e,n)&&(i.outside=!0),i}function QIe(e,t){for(var n=Yn(e[0]),r=Hb(e[e.length-1]),i,a,s=n;s<=r;){var l=mE(s,t),c=!l.disabled&&!l.hidden;if(!c){s=rr(s,1);continue}if(l.selected)return s;l.today&&!a&&(a=s),i||(i=s),s=rr(s,1)}return a||i}var JIe=365;function D9(e,t){var n=t.moveBy,r=t.direction,i=t.context,a=t.modifiers,s=t.retry,l=s===void 0?{count:0,lastFocused:e}:s,c=i.weekStartsOn,u=i.fromDate,d=i.toDate,f=i.locale,h={day:rr,week:yS,month:wi,year:XEe,startOfWeek:function(v){return i.ISOWeek?Ql(v):Pa(v,{locale:f,weekStartsOn:c})},endOfWeek:function(v){return i.ISOWeek?u8(v):IC(v,{locale:f,weekStartsOn:c})}},p=h[n](e,r==="after"?1:-1);r==="before"&&u?p=QEe([u,p]):r==="after"&&d&&(p=JEe([d,p]));var g=!0;if(a){var m=mE(p,a);g=!m.disabled&&!m.hidden}return g?p:l.count>JIe?l.lastFocused:D9(p,{moveBy:n,direction:r,context:i,modifiers:a,retry:Be(Be({},l),{count:l.count+1})})}var L9=b.createContext(void 0);function ZIe(e){var t=$m(),n=$9(),r=b.useState(),i=r[0],a=r[1],s=b.useState(),l=s[0],c=s[1],u=QIe(t.displayMonths,n),d=i??(l&&t.isDateDisplayed(l))?l:u,f=function(){c(i),a(void 0)},h=function(v){a(v)},p=$t(),g=function(v,x){if(i){var y=D9(i,{moveBy:v,direction:x,context:p,modifiers:n});Sr(i,y)||(t.goToDate(y,i),h(y))}},m={focusedDay:i,focusTarget:d,blur:f,focus:h,focusDayAfter:function(){return g("day","after")},focusDayBefore:function(){return g("day","before")},focusWeekAfter:function(){return g("week","after")},focusWeekBefore:function(){return g("week","before")},focusMonthBefore:function(){return g("month","before")},focusMonthAfter:function(){return g("month","after")},focusYearBefore:function(){return g("year","before")},focusYearAfter:function(){return g("year","after")},focusStartOfWeek:function(){return g("startOfWeek","before")},focusEndOfWeek:function(){return g("endOfWeek","after")}};return o.jsx(L9.Provider,{value:m,children:e.children})}function gE(){var e=b.useContext(L9);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function eMe(e,t){var n=$9(),r=mE(e,n,t);return r}var vE=b.createContext(void 0);function tMe(e){if(!s0(e.initialProps)){var t={selected:void 0};return o.jsx(vE.Provider,{value:t,children:e.children})}return o.jsx(nMe,{initialProps:e.initialProps,children:e.children})}function nMe(e){var t=e.initialProps,n=e.children,r=function(a,s,l){var c,u,d;
753if((c=t.onDayClick)===null||c===void 0||c.call(t,a,s,l),s.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,a,s,l);return}(d=t.onSelect)===null||d===void 0||d.call(t,a,a,s,l)},i={selected:t.selected,onDayClick:r};return o.jsx(vE.Provider,{value:i,children:n})}function F9(){var e=b.useContext(vE);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function rMe(e,t){var n=$t(),r=F9(),i=fE(),a=pE(),s=gE(),l=s.focusDayAfter,c=s.focusDayBefore,u=s.focusWeekAfter,d=s.focusWeekBefore,f=s.blur,h=s.focus,p=s.focusMonthBefore,g=s.focusMonthAfter,m=s.focusYearBefore,v=s.focusYearAfter,x=s.focusStartOfWeek,y=s.focusEndOfWeek,w=function(R){var $,O,N,H;s0(n)?($=r.onDayClick)===null||$===void 0||$.call(r,e,t,R):Im(n)?(O=i.onDayClick)===null||O===void 0||O.call(i,e,t,R):Mm(n)?(N=a.onDayClick)===null||N===void 0||N.call(a,e,t,R):(H=n.onDayClick)===null||H===void 0||H.call(n,e,t,R)},S=function(R){var $;h(e),($=n.onDayFocus)===null||$===void 0||$.call(n,e,t,R)},_=function(R){var $;f(),($=n.onDayBlur)===null||$===void 0||$.call(n,e,t,R)},j=function(R){var $;($=n.onDayMouseEnter)===null||$===void 0||$.call(n,e,t,R)},k=function(R){var $;($=n.onDayMouseLeave)===null||$===void 0||$.call(n,e,t,R)},C=function(R){var $;($=n.onDayPointerEnter)===null||$===void 0||$.call(n,e,t,R)},E=function(R){var $;($=n.onDayPointerLeave)===null||$===void 0||$.call(n,e,t,R)},A=function(R){var $;($=n.onDayTouchCancel)===null||$===void 0||$.call(n,e,t,R)},P=function(R){var $;($=n.onDayTouchEnd)===null||$===void 0||$.call(n,e,t,R)},T=function(R){var $;($=n.onDayTouchMove)===null||$===void 0||$.call(n,e,t,R)},B=function(R){var $;($=n.onDayTouchStart)===null||$===void 0||$.call(n,e,t,R)},F=function(R){var $;($=n.onDayKeyUp)===null||$===void 0||$.call(n,e,t,R)},M=function(R){var $;switch(R.key){case"ArrowLeft":R.preventDefault(),R.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":R.preventDefault(),R.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":R.preventDefault(),R.stopPropagation(),u();break;case"ArrowUp":R.preventDefault(),R.stopPropagation(),d();break;case"PageUp":R.preventDefault(),R.stopPropagation(),R.shiftKey?m():p();break;case"PageDown":R.preventDefault(),R.stopPropagation(),R.shiftKey?v():g();break;case"Home":R.preventDefault(),R.stopPropagation(),x();break;case"End":R.preventDefault(),R.stopPropagation(),y();break}($=n.onDayKeyDown)===null||$===void 0||$.call(n,e,t,R)},L={onClick:w,onFocus:S,onBlur:_,onKeyDown:M,onKeyUp:F,onMouseEnter:j,onMouseLeave:k,onPointerEnter:C,onPointerLeave:E,onTouchCancel:A,onTouchEnd:P,onTouchMove:T,onTouchStart:B};return L}function iMe(){var e=$t(),t=F9(),n=fE(),r=pE(),i=s0(e)?t.selected:Im(e)?n.selected:Mm(e)?r.selected:void 0;return i}function aMe(e){return Object.values(Ji).includes(e)}function sMe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var i=e.modifiersClassNames[r];if(i)n.push(i);else if(aMe(r)){var a=e.classNames["day_".concat(r)];a&&n.push(a)}}),n}function oMe(e,t){var n=Be({},e.styles.day);return Object.keys(t).forEach(function(r){var i;n=Be(Be({},n),(i=e.modifiersStyles)===null||i===void 0?void 0:i[r])}),n}function lMe(e,t,n){var r,i,a,s=$t(),l=gE(),c=eMe(e,t),u=rMe(e,c),d=iMe(),f=!!(s.onDayClick||s.mode!=="default");b.useEffect(function(){var j;c.outside||l.focusedDay&&f&&Sr(l.focusedDay,e)&&((j=n.current)===null||j===void 0||j.focus())},[l.focusedDay,e,n,f,c.outside]);var h=sMe(s,c).join(" "),p=oMe(s,c),g=!!(c.outside&&!s.showOutsideDays||c.hidden),m=(a=(i=s.components)===null||i===void 0?void 0:i.DayContent)!==null&&a!==void 0?a:PIe,v=o.jsx(m,{date:e,displayMonth:t,activeModifiers:c}),x={style:p,className:h,children:v,role:"gridcell"},y=l.focusTarget&&Sr(l.focusTarget,e)&&!c.outside,w=l.focusedDay&&Sr(l.focusedDay,e),S=Be(Be(Be({},x),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||y?0:-1,r)),u),_={isButton:f,isHidden:g,activeModifiers:c,selectedDays:d,buttonProps:S,divProps:x};return _}function cMe(e){var t=b.useRef(null),n=lMe(e.date,e.displayMonth,t);return n.isHidden?o.jsx("div",{role:"gridcell"}):n.isButton?o.jsx(ax,Be({name:"day",ref:t},n.buttonProps)):o.jsx("div",Be({},n.divProps))}function uMe(e){var t=e.number,n=e.dates,r=$t(),i=r.onWeekNumberClick,a=r.styles,s=r.classNames,l=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(t),{locale:l});if(!i)return o.jsx("span",{className:s.weeknumber,style:a.weeknumber,children:d});var f=c(Number(t),{locale:l}),h=function(p){i(t,n,p)};return o.jsx(ax,{name:"week-number","aria-label":f,className:s.weeknumber,style:a.weeknumber,onClick:h,children:d})}function dMe(e){var t,n,r=$t(),i=r.styles,a=r.classNames,s=r.showWeekNumber,l=r.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:cMe,u=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:uMe,d;return s&&(d=o.jsx("td",{className:a.cell,style:i.cell,children:o.jsx(u,{number:e.weekNumber,dates:e.dates})})),o.jsxs("tr",{className:a.row,style:i.row,children:[d,e.dates.map(function(f){return o.jsx("td",{className:a.cell,style:i.cell,role:"presentation",children:o.jsx(c,{displayMonth:e.displayMonth,date:f})},s2e(f))})]})}function YI(e,t,n){for(var r=n!=null&&n.ISOWeek?u8(t):IC(t,n),i=n!=null&&n.ISOWeek?Ql(e):Pa(e,n),a=xa(r,i),s=[],l=0;l<=a;l++)s.push(rr(i,l));var c=s.reduce(function(u,d){var f=n!=null&&n.ISOWeek?d8(d):h8(d,n),h=u.find(function(p){return p.weekNumber===f});return h?(h.dates.push(d),u):(u.push({weekNumber:f,dates:[d]}),u)},[]);return c}function fMe(e,t){var n=YI(Yn(e),Hb(e),t);if(t!=null&&t.useFixedWeeks){var r=l2e(e,t);if(r<6){var i=n[n.length-1],a=i.dates[i.dates.length-1],s=yS(a,6-r),l=YI(yS(a,1),s,t);n.push.apply(n,l)}}return n}function hMe(e){var t,n,r,i=$t(),a=i.locale,s=i.classNames,l=i.styles,c=i.hideHead,u=i.fixedWeeks,d=i.components,f=i.weekStartsOn,h=i.firstWeekContainsDate,p=i.ISOWeek,g=fMe(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:p,locale:a,weekStartsOn:f,firstWeekContainsDate:h}),m=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:EIe,v=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:dMe,x=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:kIe;return o.jsxs("table",{id:e.id,className:s.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&o.jsx(m,{}),o.jsx("tbody",{className:s.tbody,style:l.tbody,children:g.map(function(y){return o.jsx(v,{displayMonth:e.displayMonth,dates:y.dates,weekNumber:y.weekNumber},y.weekNumber)})}),o.jsx(x,{displayMonth:e.displayMonth})]})}function pMe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var mMe=pMe()?b.useLayoutEffect:b.useEffect,Hw=!1,gMe=0;function XI(){return"react-day-picker-".concat(++gMe)}function vMe(e){var t,n=e??(Hw?XI():null),r=b.useState(n),i=r[0],a=r[1];return mMe(function(){i===null&&a(XI())},[]),b.useEffect(function(){Hw===!1&&(Hw=!0)},[]),(t=e??i)!==null&&t!==void 0?t:void 0}function yMe(e){var t,n,r=$t(),i=r.dir,a=r.classNames,s=r.styles,l=r.components,c=$m().displayMonths,u=vMe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],h=s.month,p=e.displayIndex===0,g=e.dis
753playIndex===c.length-1,m=!p&&!g;i==="rtl"&&(t=[p,g],g=t[0],p=t[1]),p&&(f.push(a.caption_start),h=Be(Be({},h),s.caption_start)),g&&(f.push(a.caption_end),h=Be(Be({},h),s.caption_end)),m&&(f.push(a.caption_between),h=Be(Be({},h),s.caption_between));var v=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:SIe;return o.jsxs("div",{className:f.join(" "),style:h,children:[o.jsx(v,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),o.jsx(hMe,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function xMe(e){var t=$t(),n=t.classNames,r=t.styles;return o.jsx("div",{className:n.months,style:r.months,children:e.children})}function bMe(e){var t,n,r=e.initialProps,i=$t(),a=gE(),s=$m(),l=b.useState(!1),c=l[0],u=l[1];b.useEffect(function(){i.initialFocus&&a.focusTarget&&(c||(a.focus(a.focusTarget),u(!0)))},[i.initialFocus,c,a.focus,a.focusTarget,a]);var d=[i.classNames.root,i.className];i.numberOfMonths>1&&d.push(i.classNames.multiple_months),i.showWeekNumber&&d.push(i.classNames.with_weeknumber);var f=Be(Be({},i.styles.root),i.style),h=Object.keys(r).filter(function(g){return g.startsWith("data-")}).reduce(function(g,m){var v;return Be(Be({},g),(v={},v[m]=r[m],v))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:xMe;return o.jsx("div",Be({className:d.join(" "),style:f,dir:i.dir,id:i.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:o.jsx(p,{children:s.displayMonths.map(function(g,m){return o.jsx(yMe,{displayIndex:m,displayMonth:g},m)})})}))}function wMe(e){var t=e.children,n=qRe(e,["children"]);return o.jsx(uIe,{initialProps:n,children:o.jsx(bIe,{children:o.jsx(tMe,{initialProps:n,children:o.jsx(OIe,{initialProps:n,children:o.jsx(RIe,{initialProps:n,children:o.jsx(UIe,{children:o.jsx(ZIe,{children:t})})})})})})})}function _Me(e){return o.jsx(wMe,Be({},e,{children:o.jsx(bMe,{initialProps:e})}))}function TS({className:e,classNames:t,showOutsideDays:n=!0,...r}){return o.jsx(_Me,{showOutsideDays:n,className:he("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:he(Hu({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:he(Hu({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...i})=>o.jsx(p5,{className:"h-4 w-4"}),IconRight:({...i})=>o.jsx(Ox,{className:"h-4 w-4"})},...r})}TS.displayName="Calendar";var jMe="Separator",QI="horizontal",SMe=["horizontal","vertical"],B9=b.forwardRef((e,t)=>{const{decorative:n,orientation:r=QI,...i}=e,a=kMe(r)?r:QI,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return o.jsx(Ce.div,{"data-orientation":a,...l,...i,ref:t})});B9.displayName=jMe;function kMe(e){return SMe.includes(e)}var U9=B9;const sx=b.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>o.jsx(U9,{ref:i,decorative:n,orientation:t,className:he("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));sx.displayName=U9.displayName;const JI={positive:{class:"bg-chart-positive text-success-foreground",label:"Positive"},negative:{class:"bg-chart-negative text-destructive-foreground",label:"Negative"},neutral:{class:"bg-muted text-muted-foreground",label:"Neutral"}},ZI=({rating:e})=>o.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(t=>o.jsx(pi,{className:`h-4 w-4 ${t<=e?"fill-warning text-warning":"text-border"}`},t))}),NMe=({reviewId:e,reviewTags:t,allTags:n,onAdd:r,onRemove:i,onCreate:a})=>{const[s,l]=b.useState(!1),[c,u]=b.useState(""),d=n.filter(h=>!t.some(p=>p.id===h.id)),f=async()=>
753{if(!c.trim())return;const h=await a(c.trim());h&&(await r(e,h.id),u(""))};return o.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[t.map(h=>o.jsxs(Se,{variant:"secondary",className:"gap-1 text-xs pr-1",style:{backgroundColor:h.color+"22",color:h.color,borderColor:h.color+"44"},children:[h.name,o.jsx("button",{onClick:()=>i(e,h.id),className:"ml-0.5 rounded-full hover:bg-black/10 p-0.5",children:o.jsx(Ro,{className:"h-2.5 w-2.5"})})]},h.id)),o.jsxs(PS,{open:s,onOpenChange:l,children:[o.jsx(OS,{asChild:!0,children:o.jsxs(X,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs text-muted-foreground hover:text-foreground",children:[o.jsx(_o,{className:"h-3 w-3 mr-0.5"}),"Tag"]})}),o.jsx(rx,{className:"w-56 p-2",align:"start",children:o.jsxs("div",{className:"space-y-2",children:[d.length>0&&o.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:d.map(h=>o.jsxs("button",{onClick:async()=>{await r(e,h.id)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-accent text-left",children:[o.jsx("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:h.color}}),h.name]},h.id))}),o.jsxs("div",{className:"flex gap-1.5",children:[o.jsx(Te,{placeholder:"New tag...",value:c,onChange:h=>u(h.target.value),onKeyDown:h=>h.key==="Enter"&&f(),className:"h-7 text-xs"}),o.jsx(X,{size:"sm",className:"h-7 px-2 text-xs",onClick:f,disabled:!c.trim(),children:"Add"})]})]})})]})]})},CMe=({review:e,businessName:t,reviewTags:n,allTags:r,onAddTag:i,onRemoveTag:a,onCreateTag:s,canReply:l})=>{var E;const[c,u]=b.useState(!1),[d,f]=b.useState(!1),[h,p]=b.useState(e.reply||""),[g,m]=b.useState(!1),[v,x]=b.useState(!1),y=JI[e.sentiment||"neutral"]||JI.neutral,w=(((E=e.comment)==null?void 0:E.length)||0)>200,S=e.source==="google",_=!!e.reply,j=async()=>{if(h.trim())try{await navigator.clipboard.writeText(h.trim()),G.success("Reply copied to clipboard!"),f(!1)}catch{G.error("Failed to copy to clipboard")}},k=async()=>{m(!0);try{const{data:A,error:P}=await Y.functions.invoke("suggest-reply",{body:{review_id:e.id}});if(P)throw P;A!=null&&A.suggestion&&p(A.suggestion)}catch(A){G.error(A.message||"Failed to generate suggestion")}finally{m(!1)}},C=async()=>{if(h.trim()){x(!0);try{const{data:A,error:P}=await Y.functions.invoke("reply-to-review",{body:{review_id:e.id,reply_text:h.trim()}});if(P)throw P;if(A!=null&&A.error)throw new Error(A.error);G.success("Reply posted to Google!"),f(!1)}catch(A){G.error(A.message||"Failed to post reply")}finally{x(!1)}}};return o.jsx(pe,{className:"animate-fade-in transition-shadow hover:shadow-md",children:o.jsxs(de,{className:"p-5",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[e.reviewer_photo_url?o.jsx("img",{src:e.reviewer_photo_url,alt:e.reviewer_name,className:"h-10 w-10 rounded-full object-cover"}):o.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-primary/10",children:o.jsx(Wl,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium text-foreground",children:e.reviewer_name}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(ch,{className:"h-3 w-3"}),nn(go(e.review_date),"MMM d, yyyy")]})]})]}),o.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[o.jsx(ZI,{rating:e.rating}),o.jsx(Se,{variant:"secondary",className:y.class,children:y.label})]})]}),o.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(Jr,{className:"h-3 w-3"}),t,(()=>{const A=e.source;return A==="tripadvisor"?o.jsx(Se,{variant:"outline",className:"ml-1 text-[10px] py-0 px-1.5 bg-emerald-500/10 text-emerald-700 border-emerald-500/20",children:"TripAdvisor"}):A==="google"?o.jsx(Se,{variant:"outline",className:"ml-1 text-[10px] py-0 px-1.5 bg-blue-500/10 text-blue-700 border-blue-500/20",children:"Google"}):A==="getyourguide"?o.jsx(Se,{variant:"outline",className:"ml-1 text-[10px] py-0 px-1.5 bg-orange-500/10 text-orange-700 border-orange-500/20",children:"GetYourGuide"}):A==="trustpilot"?o.jsx(Se,{variant:"outline",className:"ml-1 text-[10px] py-0 px-1.5 bg-green-500/10 text-green-700 border-green-500/20",children:"Trustpilot"}
753):A==="yelp"?o.jsx(Se,{variant:"outline",className:"ml-1 text-[10px] py-0 px-1.5 bg-red-500/10 text-red-700 border-red-500/20",children:"Yelp"}):null})()]}),e.comment&&o.jsxs("div",{className:"mt-3",children:[o.jsx("p",{className:`text-sm text-foreground leading-relaxed ${!c&&w?"line-clamp-3":""}`,children:e.comment}),w&&o.jsx(X,{variant:"ghost",size:"sm",className:"mt-1 h-auto p-0 text-xs text-primary",onClick:()=>u(!c),children:c?o.jsxs(o.Fragment,{children:["Show less ",o.jsx(eN,{className:"ml-1 h-3 w-3"})]}):o.jsxs(o.Fragment,{children:["Read more ",o.jsx(Rd,{className:"ml-1 h-3 w-3"})]})})]}),_&&o.jsxs("div",{className:"mt-3 rounded-md bg-muted/50 border border-border p-3",children:[o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mb-1",children:[o.jsx(kK,{className:"h-3 w-3"}),"Owner reply",e.reply_date&&o.jsxs("span",{children:["· ",nn(go(e.reply_date),"MMM d, yyyy")]})]}),o.jsx("p",{className:"text-sm text-foreground",children:e.reply})]}),l&&o.jsx("div",{className:"mt-3",children:o.jsxs(X,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1.5",onClick:()=>{f(!0),p(e.reply||"")},children:[o.jsx(A2,{className:"h-3.5 w-3.5"}),_?"Edit reply":"Reply"]})}),o.jsx(sc,{open:d,onOpenChange:f,children:o.jsxs(Mo,{className:"sm:max-w-lg",children:[o.jsx($o,{children:o.jsxs(Do,{className:"font-display flex items-center gap-2",children:[o.jsx(A2,{className:"h-5 w-5 text-primary"}),_?"Edit Reply":"Reply to Review"]})}),o.jsxs("div",{className:"rounded-md bg-muted/50 border border-border p-3 space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[e.reviewer_photo_url?o.jsx("img",{src:e.reviewer_photo_url,alt:e.reviewer_name,className:"h-8 w-8 rounded-full object-cover"}):o.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-primary/10",children:o.jsx(Wl,{className:"h-4 w-4 text-primary"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:e.reviewer_name}),o.jsx("p",{className:"text-xs text-muted-foreground",children:nn(go(e.review_date),"MMM d, yyyy")})]})]}),o.jsx(ZI,{rating:e.rating})]}),e.comment&&o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-4",children:e.comment})]}),!S&&o.jsxs("p",{className:"text-xs text-muted-foreground bg-accent/50 rounded-md px-3 py-2",children:["💡 Use AI Suggest to draft a reply, then copy it and paste it directly on ",e.source==="tripadvisor"?"TripAdvisor":e.source==="getyourguide"?"GetYourGuide":e.source==="trustpilot"?"Trustpilot":e.source==="yelp"?"Yelp":"the review platform","."]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(ds,{placeholder:"Write your reply...",value:h,onChange:A=>p(A.target.value),rows:4,maxLength:4096,className:"text-sm resize-none",disabled:v}),o.jsxs("p",{className:"text-xs text-muted-foreground text-right",children:[h.length,"/4096"]})]}),o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsxs(X,{variant:"outline",size:"sm",className:"gap-1.5",onClick:k,disabled:g||v,children:[g?o.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(bn,{className:"h-3.5 w-3.5"}),"AI Suggest"]}),S?o.jsxs(X,{size:"sm",className:"gap-1.5",onClick:C,disabled:v||!h.trim(),children:[v?o.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(ac,{className:"h-3.5 w-3.5"}),"Post to Google"]}):o.jsxs(X,{size:"sm",className:"gap-1.5",onClick:j,disabled:!h.trim(),children:[o.jsx(Vh,{className:"h-3.5 w-3.5"}),"Copy Reply"]})]})]})}),o.jsx(NMe,{reviewId:e.id,reviewTags:n,allTags:r,onAdd:i,onRemove:a,onCreate:s})]})})},EMe=({tags:e,reviews:t,businesses:n,getReviewIdsForTag:r})=>{const[i,a]=b.useState("all"),[s,l]=b.useState("all"),[c,u]=b.useState(void 0),[d,f]=b.useState(void 0),h=b.useMemo(()=>{let g=t;if(s!=="all"&&(g=g.filter(m=>m.business_id===s)),i==="custom"){if(c&&(g=g.filter(m=>new Date(m.review_date)>=c)),d){const m=new Date(d);m.setHours(23,59,59,999),g=g.filter(v=>new Date(v.review_date)<=m)}}else if(i!=="all"){const m=new Date;let v;switch(i){case"7d":v=new Date(m.getTime()-7*864e5);break;case"30d":v=new Date(m.getTime()-30*864e5);break;case"90d":v=new Date(m.getTime()-90*864e5);break;case"12m":v=new Date(m.getTime()-365*864e5);break;default:v=new Date(0)}g=g.filter(x=>new Date(x.review_date)>=v)}return g},[t,i,s,c,d]);if(e.length===0)return o.jsx(pe,{children:o.jsxs(de,{className:"flex flex-col items-center justify-center py-12 text-center",children:[o.jsx(iN,{className:"mb-3 h-8 w-8 text-muted-foreground"}),o.jsx("p",{className:"font-medium text-foreground",children:"No tags yet"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Tag reviews on the Reviews tab to see reports here."})]})});const p=e.map(g=>{const m=r(g.id),v=h.filter(k=>m.includes(k.id)),x=v.length,y=x>0?v.reduce((k,C)=>k+C.rating,0)/x:0,w=v.filter(k=>k.sentiment==="positive").length,S=v.filter(k=>k.sentiment==="negative").length,_=v.filter(k=>k.sentiment==="neutral").length,j=v.filter(k=>k.reply).length;return{tag:g,count:x,avgRating:y,positive:w,negative:S,neutral:_,replied:j}}).sort((g,m)=>m.count-g.count);return o.jsxs("div",{className:"space-y-4",children:[o.jsx(pe,{children:o.jsx(de,{className:"p-4",children:o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs(St,{value:i,onValueChange:g=>{a(g),g!=="custom"&&(u(void 0),f(void 0))},children:[o.jsxs(wt,{className:"w-full sm:w-40",children:[o.jsx(ch,{className:"mr-1.5 h-3.5 w-3.5 text-muted-foreground"}),o.jsx(kt,{placeholder:"Date range"})]}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All time"}),o.jsx(we,{value:"7d",children:"Last 7 days"}),o.jsx(we,{value:"30d",children:"Last 30 days"}),o.jsx(we,{value:"90d",children:"Last 90 days"}),o.jsx(we,{value:"12m",children:"Last 12 months"}),o.jsx(we,{value:"custom",children:"Custom range"})]})]}),i==="custom"&&o.jsxs(o.Fragment,{children:[o.jsxs(PS,{children:[o.jsx(OS,{asChild:!0,children:o.jsxs(X,{variant:"outline",className:he("w-full sm:w-40 justify-start text-left font-normal",!c&&"text-muted-foreground"),children:[o.jsx(ch,{className:"mr-1.5 h-3.5 w-3.5"}),c?nn(c,"MMM d, yyyy"):"From date"]})}),o.jsx(rx,{className:"w-auto p-0",align:"start",children:o.jsx(TS,{mode:"single",selected:c,onSelect:u,disabled:g=>g>new Date||(d?g>d:!1),initialFocus:!0,className:he("p-3 pointer-events-auto")})})]}),o.jsxs(PS,{children:[o.jsx(OS,{asChild:!0,children:o.jsxs(X,{variant:"outline",className:he("w-full sm:w-40 justify-start text-left font-normal",!d&&"text-muted-foreground"),children:[o.jsx(ch,{className:"mr-1.5 h-3.5 w-3.5"}),d?nn(d,"MMM d, yyyy"):"To date"]})}),o.jsx(rx,{className:"w-auto p-0",align:"start",children:o.jsx(TS,{mode:"single",selected:d,onSelect:f,disabled:g=>g>new Date||(c?g<c:!1),initialFocus:!0,className:he("p-3 pointer-events-auto")})})]})]}),n.length>1&&o.jsxs(St,{value:s,onValueChange:l,children:[o.jsxs(wt,{className:"w-full sm:w-44",children:[o.jsx(Jr,{className:"mr-1.5 h-3.5 w-3.5 text-muted-foreground"}),o.jsx(kt,{placeholder:"Business"})]}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All businesses"}),n.map(g=>o.jsx(we,{value:g.id,children:g.name},g.id))]})]})]})})}),o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",children:p.map(({tag:g,count:m,avgRating:v,positive:x,negative:y,neutral:w,replied:S})=>o.jsx(pe,{className:"animate-fade-in",children:o.jsxs(de,{className:"p-5",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsx(Se,{variant:"secondary",className:"text-sm font-medium",style:{backgroundColor:g.color+"22",color:g.color,borderColor:g.color+"44"},children:g.name}),o.jsx("span",{className:"text-2xl font-bold font-display text-foreground",children:m})]}),o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-muted-foreground",children:"Avg Rating"}),o.jsxs("span",{className:"font-medium text-foreground flex items-center gap-1",children:[v>0?v.toFixed(1):"—",o.jsx(pi,{className:"h-3.5 w-3.5 fill-warning text-warning"})]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-muted-foreground",children:"Sentiment"}),o.jsxs("div",{className:"flex gap-2 text-xs",children:[o.jsxs("span",{className:"text-chart-positive",children:["+",x]}),o.jsxs("span",{className:"text-muted-foreground",children:["~",w]}),o.jsxs("span",{className:"text-chart-negative",children:["-",y]})]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-muted-foreground",children:"Response Rate"}),o.jsx("span",{className:"font-medium text-foreground",children:m>0?`${Math.round(S/m*100)}%`:"—"})]}),m>0&&o.jsx("div",{className:"pt-1",children:o.jsxs("div",{className:"flex h-2 rounded-full overflow-hidden bg-muted",children:[x>0&&o.jsx("div",{className:"bg-chart-positive",style:{width:`${x/m*100}%`}}),w>
7530&&o.jsx("div",{className:"bg-muted-foreground/30",style:{width:`${w/m*100}%`}}),y>0&&o.jsx("div",{className:"bg-chart-negative",style:{width:`${y/m*100}%`}})]})})]})]})},g.id))})]})},PMe=()=>{const{user:e,loading:t}=Mt(),{reviews:n,businesses:r,isLoading:i}=HC(),a=h9(),{aiReplies:s}=qC(),[l,c]=b.useState(""),[u,d]=b.useState("all"),[f,h]=b.useState("all"),[p,g]=b.useState("all"),[m,v]=b.useState("all"),[x,y]=b.useState("all"),[w,S]=b.useState("all"),[_,j]=b.useState("newest"),[k,C]=b.useState("reviews"),[E,A]=b.useState(1),P=18;if(t)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});if(!e)return o.jsx(Yi,{to:"/login",replace:!0});if(i||a.isLoading)return o.jsx(Qn,{children:o.jsx("div",{className:"flex h-[60vh] items-center justify-center",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})})});const T=new Map(r.map(N=>[N.id,N.name])),B=n.filter(N=>{var ne;const H=!l||N.reviewer_name.toLowerCase().includes(l.toLowerCase())||((ne=N.comment)==null?void 0:ne.toLowerCase().includes(l.toLowerCase())),V=u==="all"||N.rating===Number(u),D=f==="all"||N.sentiment===f,K=p==="all"||N.business_id===p,ae=m==="all"||a.getReviewIdsForTag(m).includes(N.id),se=x==="all"||N.source===x,Q=w==="all"||(w==="replied"?!!N.reply:!N.reply);return H&&V&&D&&K&&ae&&se&&Q}).sort((N,H)=>{switch(_){case"oldest":return new Date(N.review_date).getTime()-new Date(H.review_date).getTime();case"highest":return H.rating-N.rating;case"lowest":return N.rating-H.rating;default:return new Date(H.review_date).getTime()-new Date(N.review_date).getTime()}}),F=n.length,M=B.length,L=Math.ceil(M/P),R=B.slice((E-1)*P,E*P),$=()=>{const N=[];if(L<=7)for(let H=1;H<=L;H++)N.push(H);else{N.push(1),E>3&&N.push("ellipsis");for(let H=Math.max(2,E-1);H<=Math.min(L-1,E+1);H++)N.push(H);E<L-2&&N.push("ellipsis"),N.push(L)}return N},O=()=>A(1);return o.jsx(Qn,{children:o.jsxs("div",{className:"space-y-6",children:[o.jsx(lL,{}),o.jsx("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-2xl sm:text-3xl font-bold text-foreground",children:"Reviews"}),o.jsxs("p",{className:"text-muted-foreground",children:[F," total review",F!==1?"s":""," across ",r.length," business",r.length!==1?"es":""]})]})}),o.jsxs(Tm,{value:k,onValueChange:C,children:[o.jsxs(nf,{children:[o.jsxs(Kn,{value:"reviews",className:"gap-1.5",children:[o.jsx(Bu,{className:"h-4 w-4"}),"Reviews"]}),o.jsxs(Kn,{value:"sentiment",className:"gap-1.5",children:[o.jsx(wK,{className:"h-4 w-4"}),"AI Sentiment"]}),o.jsxs(Kn,{value:"reports",className:"gap-1.5",children:[o.jsx(Px,{className:"h-4 w-4"}),"Tag Reports"]})]}),o.jsxs(kr,{value:"reviews",className:"space-y-4 mt-4",children:[o.jsx(pe,{children:o.jsxs(de,{className:"p-4",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"relative",children:[o.jsx(Uu,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx(Te,{placeholder:"Search by name or comment...",value:l,onChange:N=>{c(N.target.value),O()},className:"pl-9"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:items-center [&>*]:min-w-0 sm:[&>*]:flex-none",children:[r.length>1&&o.jsxs(St,{value:p,onValueChange:N=>{g(N),O()},children:[o.jsx(wt,{className:"w-full sm:w-40",children:o.jsx(kt,{placeholder:"Business"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All businesses"}),r.map(N=>o.jsx(we,{value:N.id,children:N.name},N.id))]})]}),o.jsxs(St,{value:u,onValueChange:N=>{d(N),O()},children:[o.jsx(wt,{className:"w-full sm:w-32",children:o.jsx(kt,{placeholder:"Rating"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All ratings"}),[5,4,3,2,1].map(N=>o.jsxs(we,{value:N.toString(),children:[N," star",N!==1?"s":""]},N))]})]}),o.jsxs(St,{value:f,onValueChange:N=>{h(N),O()},children:[o.jsx(wt,{className:"w-full sm:w-36",children:o.jsx(kt,{placeholder:"Sentiment"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All sentiment"}),o.jsx(we,{value:"positive",children:"Positive"}),o.jsx(we,{value:"neutral",children:"Neutral"}),o.jsx(we,{value:"negative",children:"Negative"})]})]}),o.jsxs(St,{value:x,onValueChange:N=>{y(N),O()},children:[o.jsx(wt,{className:"w-full sm:w-36",children:o.jsx(kt,{placeholder:"Source"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All sources"}),o.jsx(we,{value:"google",children:"Google"}),o.jsx(we,{value:"tripadvisor",children:"TripAdvisor"}),o.jsx(we,{value:"trustpilot",children:"Trustpilot"}),o.jsx(we,{value:"getyourguide",children:"GetYourGuide"}),o.jsx(we,{value:"yelp",children:"Yelp"})]})]}),o.jsxs(St,{value:w,onValueChange:N=>{S(N),O()},children:[o.jsx(wt,{className:"w-full sm:w-36",children:o.jsx(kt,{placeholder:"Reply status"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All replies"}),o.jsx(we,{value:"unreplied",children:"Not replied"}),o.jsx(we,{value:"replied",children:"Replied"})]})]}),a.tags.length>0&&o.jsxs(St,{value:m,onValueChange:N=>{v(N),O()},children:[o.jsxs(wt,{className:"w-full sm:w-36",children:[o.jsx(iN,{className:"mr-1.5 h-3.5 w-3.5 text-muted-foreground"}),o.jsx(kt,{placeholder:"Tag"})]}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All tags"}),a.tags.map(N=>o.jsx(we,{value:N.id,children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"h-2 w-2 rounded-full shrink-0",style:{backgroundColor:N.color}}),N.name]})},N.id))]})]}),o.jsxs(St,{value:_,onValueChange:N=>{j(N),O()},children:[o.jsx(wt,{className:"w-full sm:w-36",children:o.jsx(kt,{placeholder:"Sort by"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"newest",children:"Newest first"}),o.jsx(we,{value:"oldest",children:"Oldest first"}
753),o.jsx(we,{value:"highest",children:"Highest rated"}),o.jsx(we,{value:"lowest",children:"Lowest rated"})]})]})]})]}),M!==F&&o.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Showing ",M," of ",F," reviews"]})]})}),B.length===0?o.jsx(pe,{className:"animate-fade-in",children:o.jsxs(de,{className:"flex flex-col items-center justify-center py-16 text-center",children:[o.jsx("div",{className:"mb-4 rounded-full bg-primary/10 p-4",children:o.jsx(Bu,{className:"h-8 w-8 text-primary"})}),o.jsx("h2",{className:"mb-2 font-display text-xl font-semibold text-foreground",children:F===0?"No reviews yet":"No matching reviews"}),o.jsx("p",{className:"text-muted-foreground whitespace-nowrap",children:F===0?"Connect a business and sync reviews to see them here.":"Try adjusting your filters to find what you're looking for."})]})}):o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",children:R.map(N=>o.jsx(CMe,{review:N,businessName:T.get(N.business_id)||"Unknown",reviewTags:a.getTagsForReview(N.id),allTags:a.tags,onAddTag:a.addTagToReview,onRemoveTag:a.removeTagFromReview,onCreateTag:a.createTag,canReply:s},N.id))}),L>1&&o.jsxs("div",{className:"flex items-center justify-between pt-2",children:[o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing ",(E-1)*P+1,"–",Math.min(E*P,M)," of ",M," reviews"]}),o.jsx(DC,{children:o.jsxs(LC,{children:[o.jsx(Xa,{children:o.jsx(FC,{onClick:()=>{A(N=>Math.max(1,N-1)),window.scrollTo({top:0,behavior:"smooth"})},className:E===1?"pointer-events-none opacity-50":"cursor-pointer"})}),$().map((N,H)=>N==="ellipsis"?o.jsx(Xa,{children:o.jsx(UC,{})},`e-${H}`):o.jsx(Xa,{children:o.jsx(bm,{isActive:E===N,onClick:()=>{A(N),window.scrollTo({top:0,behavior:"smooth"})},className:"cursor-pointer",children:N})},N)),o.jsx(Xa,{children:o.jsx(BC,{onClick:()=>{A(N=>Math.min(L,N+1)),window.scrollTo({top:0,behavior:"smooth"})},className:E===L?"pointer-events-none opacity-50":"cursor-pointer"})})]})})]})]})]}),o.jsx(kr,{value:"sentiment",className:"mt-4",children:o.jsx(HRe,{reviews:n,businesses:r,tags:a.tags,reviewTags:a.reviewTags})}),o.jsxs(kr,{value:"reports",className:"mt-4 space-y-6",children:[o.jsx(EMe,{tags:a.tags,reviews:n,businesses:r,getReviewIdsForTag:a.getReviewIdsForTag}),o.jsx(sx,{}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-display text-lg font-semibold text-foreground mb-4",children:"Manage Tags"}),o.jsx(bRe,{})]})]})]})]})})},OMe=()=>{const e=ps(),[t,n]=b.useState("loading"),[r,i]=b.useState("");return b.useEffect(()=>{(async()=>{const s=new URLSearchParams(window.location.search),l=s.get("code"),c=s.get("error");if(c){n("error"),i(`Google authorization was denied: ${c}`);return}if(!l){n("error"),i("No authorization code received from Google.");return}const u=localStorage.getItem("gmb_redirect_uri")||`${window.location.origin}/google-business-callback`,d=localStorage.getItem("gmb_business_name")||"",f=localStorage.getItem("gmb_source_business_id");try{const{data:h,error:p}=await Y.functions.invoke("google-business-callback",{body:{code:l,redirect_uri:u}});if(p)throw p;if(!(h!=null&&h.access_token))throw new Error("Google callback completed without an access token");const g={access_token:h.access_token,refresh_token:h.refresh_token??""};localStorage.removeItem("gmb_redirect_uri"),f?(localStorage.setItem("gmb_source_locations",JSON.stringify(h.locations||[])),localStorage.setItem("gmb_source_tokens",JSON.stringify(g)),localStorage.removeItem("gmb_source_business_id"),localStorage.removeItem("gmb_business_name"),e(`/businesses/${f}/sources?gmb_source_connected=true`,{replace:!0})):(localStorage.setItem("gmb_locations",JSON.stringify(h.locations||[])),localStorage.setItem("gmb_tokens",JSON.stringify(g)),localStorage.setItem("gmb_business_name",d),e("/businesses?gmb_connected=true",{replace:!0}))}catch(h){console.error("Google Business callback error:",h),n("error"),i("Failed to connect to Google Business Profile. Please try again.")}})()},[e]),o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsxs("div",{className:"text-center space-y-4 max-w-md px-4",children:[t==="loading"&&o.jsxs(o.Fragment,{children:[o.jsx(ke,{className:"h-10 w-10 animate-spin text-primary mx-auto"}),o.jsx("p",{className:"text-lg font-display font-semibold text-foreground",children:"Connecting to Google Business Profile..."}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Please wait while we retrieve your business locations."})]}),t==="error"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-destructive/10 flex items-center justify-center",children:o.jsx("span",{className:"text-destructive text-xl",children:"✕"})}),o.jsx("p",{className:"text-lg font-display font-semibold text-foreground",children:"Connection Failed"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:r}),o.jsx("button",{onClick:()=>e("/businesses",{replace:!0}),className:"text-sm text-primary hover:underline",children:"Go back to Businesses"})]})]})})},AMe="modulepreload",TMe=function(e){return"/"+e},eM={},RMe=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=TMe(c),c in eM)return;eM[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":AMe,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return i.then(s=>{for(const l of s||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},IMe=({feature:e,description:t})=>o.jsx(pe,{className:"border-primary/20 bg-primary/5",children:o.jsxs(de,{className:"flex flex-col items-center justify-center py-10 text-center",children:[o.jsx("div",{className:"mb-4 rounded-full bg-primary/10 p-4",children:o.jsx(Fu,{className:"h-6 w-6 text-primary"})}),o.jsxs("h3",{className:"mb-1 font-display text-lg font-semibold text-foreground",children:[e," requires a subscription"]}),o.jsx("p",{className:"mb-5 max-w-sm text-sm text-muted-foreground",children:t||"Subscribe to ReviewKit Pro to unlock this feature."}),o.jsx(X,{asChild:!0,children:o.jsx(on,{to:"/settings?tab=billing",children:"Subscribe"})})]})});function MMe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}
vendor: 4,251 bytes, line 753
753const $Me=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DMe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LMe={};function tM(e,t){return(LMe.jsx?DMe:$Me).test(e)}const FMe=/[ \t\n\f\r]/g;function BMe(e){return typeof e=="object"?e.type==="text"?nM(e.value):!1:nM(e)}function nM(e){return e.replace(FMe,"")===""}class Dm{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Dm.prototype.normal={};Dm.prototype.property={};Dm.prototype.space=void 0;function z9(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Dm(n,r,t)}function RS(e){return e.toLowerCase()}class Mr{constructor(t,n){this.attribute=n,this.property=t}}Mr.prototype.attribute="";Mr.prototype.booleanish=!1;Mr.prototype.boolean=!1;Mr.prototype.commaOrSpaceSeparated=!1;Mr.prototype.commaSeparated=!1;Mr.prototype.defined=!1;Mr.prototype.mustUseProperty=!1;Mr.prototype.number=!1;Mr.prototype.overloadedBoolean=!1;Mr.prototype.property="";Mr.prototype.spaceSeparated=!1;Mr.prototype.space=void 0;let UMe=0;const Xe=mc(),dn=mc(),IS=mc(),fe=mc(),Pt=mc(),yu=mc(),Fr=mc();function mc(){return 2**++UMe}const MS=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:dn,commaOrSpaceSeparated:Fr,commaSeparated:yu,number:fe,overloadedBoolean:IS,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),qw=Object.keys(MS);class yE extends Mr{constructor(t,n,r,i){let a=-1;if(super(t,n),rM(this,"space",i),typeof r=="number")for(;++a<qw.length;){const s=qw[a];rM(this,qw[a],(r&MS[s])===MS[s])}}}yE.prototype.defined=!0;function rM(e,t,n){n&&(e[t]=n)}function rf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new yE(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[RS(r)]=r,n[RS(a.attribute)]=r}return new Dm(t,n,e.space)}const W9=rf({properties:{ariaActiveDescendant:null,ariaAtomic:dn,ariaAutoComplete:null,ariaBusy:dn,ariaChecked:dn,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:Pt,ariaCurrent:null,ariaDescribedBy:Pt,ariaDetails:null,ariaDisabled:dn,ariaDropEffect:Pt,ariaErrorMessage:null,ariaExpanded:dn,ariaFlowTo:Pt,ariaGrabbed:dn,ariaHasPopup:null,ariaHidden:dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pt,ariaLevel:fe,ariaLive:null,ariaModal:dn,ariaMultiLine:dn,ariaMultiSelectable:dn,ariaOrientation:null,ariaOwns:Pt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:dn,ariaReadOnly:dn,ariaRelevant:null,ariaRequired:dn,ariaRoleDescription:Pt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:dn,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function H9(e,t){return t in e?e[t]:t}function q9(e,t){return H9(e,t.toLowerCase())}const zMe=rf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:yu,acceptCharset:Pt,accessKey:Pt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:Pt,autoFocus:Xe,autoPlay:Xe,blocking:Pt,capture:null,charSet:null,checked:Xe,cite:null,className:Pt,cols:fe,colSpan:null,content:null,contentEditable:dn,controls:Xe,controlsList:Pt,coords:fe|yu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:IS,draggable:dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:Pt,height:fe,hidden:IS,high:fe,href:null,hrefLang:null,htmlFor:Pt,httpEquiv:Pt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:Pt,itemRef:Pt,itemScope:Xe,itemType:Pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,onAbort:null,onAfterPrint:null,onAuxCl
753ick: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:Xe,optimum:fe,pattern:null,ping:Pt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:Pt,required:Xe,reversed:Xe,rows:fe,rowSpan:fe,sandbox:Pt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:dn,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:dn,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:q9}),WMe=rf({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",colorRendering:"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
753-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:Fr,accentHeight:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:Pt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:yu,g2:yu,glyphName:yu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:Fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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,on
vendor: 5,340 bytes, lines 753-754
753Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fr,rev:Fr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fr,requiredFeatures:Fr,requiredFonts:Fr,requiredFormats:Fr,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:Fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fr,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:H9}),V9=rf({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),G9=rf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:q9}),K9=rf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),HMe={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"},qMe=/[A-Z]/g,iM=/-[a-z]/g,VMe=/^data[-\w.:]+$/i;function GMe(e,t){const n=RS(t);let r=t,i=Mr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&VMe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(iM,YMe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!iM.test(a)){let s=a.replace(qMe,KMe);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=yE}return new i(r,t)}function KMe(e){return"-"+e.toLowerCase()}function YMe(e){return e.charAt(1).toUpperCase()}const XMe=z9([W9,zMe,V9,G9,K9],"html"),xE=z9([W9,WMe,V9,G9,K9],"svg");function QMe(e){return e.join(" ").trim()}var bE={},aM=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,JMe=/\n/g,ZMe=/^\s*/,e$e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,t$e=/^:\s*/,n$e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,r$e=/^[;\s]*/,i$e=/^\s+|\s+$/g,a$e=`
754`,sM="/",oM="*",ul="",s$e="comment",o$e="declaration";function l$e(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 i(g){var m=g.match(JMe);m&&(n+=m.length);var v=g.lastIndexOf(a$e);r=~v?g.length-v:r+g.length}function a(){var g={line:n,column:r};return function(m){return m.position=new s(g),u(),m}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(g){var m=new Error(t.source+":"+n+":"+r+": "+g);if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function c(g){var m=g.exec(e);if(m){var v=m[0];return i(v),e=e.slice(v.length),m}}function u(){c(ZMe)}function d(g){var m;for(g=g||[];m=f();)m!==!1&&g.push(m);return g}function f(){var g=a();if(!(sM!=e.charAt(0)||oM!=e.charAt(1))){for(var m=2;ul!=e.charAt(m)&&(oM!=e.charAt(m)||sM!=e.charAt(m+1));)++m;if(m+=2,ul===e.charAt(m-1))return l("End of comment missing");var v=e.slice(2,m-2);return r+=2,i(v),e=e.slice(m),r+=2,g({type:s$e,comment:v})}}function h(){var g=a(),m=c(e$e);if(m){if(f(),!c(t$e))return l("property missing ':'");var v=c(n$e),x=g({type:o$e,property:lM(m[0].replace(aM,ul)),value:v?lM(v[0].replace(aM,ul)):ul});return c(r$e),x}}function p(){var g=[];d(g);for(var m;m=h();)m!==!1&&(g.push(m),d(g));return g}return u(),p()}function lM(e){return e?e.replace(i$e,ul):ul}var c$e=l$e,u$e=Ys&&Ys.__importDefault||function(e){return e&&e.__esMo
vendor: 3,679 bytes, line 754
754dule?e:{default:e}};Object.defineProperty(bE,"__esModule",{value:!0});bE.default=f$e;const d$e=u$e(c$e);function f$e(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,d$e.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:l}=a;i?t(s,l,a):l&&(n=n||{},n[s]=l)}),n}var o0={};Object.defineProperty(o0,"__esModule",{value:!0});o0.camelCase=void 0;var h$e=/^--[a-zA-Z0-9_-]+$/,p$e=/-([a-z])/g,m$e=/^[^-]+$/,g$e=/^-(webkit|moz|ms|o|khtml)-/,v$e=/^-(ms)-/,y$e=function(e){return!e||m$e.test(e)||h$e.test(e)},x$e=function(e,t){return t.toUpperCase()},cM=function(e,t){return"".concat(t,"-")},b$e=function(e,t){return t===void 0&&(t={}),y$e(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(v$e,cM):e=e.replace(g$e,cM),e.replace(p$e,x$e))};o0.camelCase=b$e;var w$e=Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_$e=w$e(bE),j$e=o0;function $S(e,t){var n={};return!e||typeof e!="string"||(0,_$e.default)(e,function(r,i){r&&i&&(n[(0,j$e.camelCase)(r,t)]=i)}),n}$S.default=$S;var S$e=$S;const k$e=ct(S$e),Y9=X9("end"),wE=X9("start");function X9(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 N$e(e){const t=wE(e),n=Y9(e);if(t&&n)return{start:t,end:n}}function jh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?uM(e.position):"start"in e||"end"in e?uM(e):"line"in e||"column"in e?DS(e):""}function DS(e){return dM(e&&e.line)+":"+dM(e&&e.column)}function uM(e){return DS(e&&e.start)+"-"+DS(e&&e.end)}function dM(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 i="",a={},s=!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"?i=t:!a.cause&&t&&(s=!0,i=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=i,this.line=l?l.line:void 0,this.name=jh(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=s&&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 _E={}.hasOwnProperty,C$e=new Map,E$e=/[A-Z]/g,P$e=new Set(["table","tbody","thead","tfoot","tr"]),O$e=new Set(["td","th"]),Q9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function A$e(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=F$e(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 2,220 bytes, line 754
754if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=L$e(n,t.jsx,t.jsxs)}const i={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"?xE:XMe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=J9(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function J9(e,t,n){if(t.type==="element")return T$e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return R$e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return M$e(e,t,n);if(t.type==="mdxjsEsm")return I$e(e,t);if(t.type==="root")return $$e(e,t,n);if(t.type==="text")return D$e(e,t)}function T$e(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=xE,e.schema=i),e.ancestors.push(t);const a=e7(e,t.tagName,!1),s=B$e(e,t);let l=SE(e,t);return P$e.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!BMe(c):!0})),Z9(e,s,a,t),jE(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function R$e(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)}Wp(e,t.position)}function I$e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wp(e,t.position)}function M$e(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=xE,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:e7(e,t.name,!0),s=U$e(e,t),l=SE(e,t);return Z9(e,s,a,t),jE(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function $$e(e,t,n){const r={};return jE(r,SE(e,t)),e.create(t,e.Fragment,r,n)}function D$e(e,t){return t.value}function Z9(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jE(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function L$e(e,t,n){return r;function r(i,a,s,l){const u=Array.isArray(s.children)?n:t;
vendor: 4,127 bytes, line 754
754return l?u(a,s,l):u(a,s)}}function F$e(e,t){return n;function n(r,i,a,s){const l=Array.isArray(a.children),c=wE(r);return t(i,a,s,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function B$e(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&_E.call(t.properties,i)){const a=z$e(e,i,t.properties[i]);if(a){const[s,l]=a;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&O$e.has(t.tagName)?r=l:n[s]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function U$e(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 s=a.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Wp(e,t.position);else{const i=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 Wp(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function SE(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:C$e;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;s=c+"-"+u,i.set(c,u+1)}}const l=J9(e,a,s);l!==void 0&&n.push(l)}return n}function z$e(e,t,n){const r=GMe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?MMe(n):QMe(n)),r.property==="style"){let i=typeof n=="object"?n:W$e(e,String(n));return e.stylePropertyNameCase==="css"&&(i=H$e(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?HMe[r.property]||r.property:r.attribute,n]}}function W$e(e,t){try{return k$e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Jn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Q9+"#cannot-parse-style-attribute",i}}function e7(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const l=tM(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=s}else r=tM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return _E.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Wp(e)}function Wp(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=Q9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function H$e(e){const t={};let n;for(n in e)_E.call(e,n)&&(t[q$e(n)]=e[n]);return t}function q$e(e){let t=e.replace(E$e,V$e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function V$e(e){return"-"+e.toLowerCase()}const Vw={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"]},G$e={};function K$e(e,t){const n=G$e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return t7(e,r,i)}function t7(e,t,n){if(Y$e(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 fM(e.children,t,n)}return Array.isArray(e)?fM(e,t,n):""}function fM(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=t7(e[i],t,n);return r.join("")}function Y$e(e){return!!(e&&typeof e=="object")}const hM=document.createElement("i");function kE(e){const t="&"+e+";";hM.innerHTML=t;const n=hM.textContent;
vendor: 13,052 bytes, line 754
754return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Oa(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function ci(e,t){return e.length>0?(Oa(e,e.length,0,t),e):t}const pM={}.hasOwnProperty;function X$e(e){const t={};let n=-1;for(;++n<e.length;)Q$e(t,e[n]);return t}function Q$e(e,t){let n;for(n in t){const i=(pM.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){pM.call(i,s)||(i[s]=[]);const l=a[s];J$e(i[s],Array.isArray(l)?l:l?[l]:[])}}}function J$e(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Oa(e,0,0,r)}function n7(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 xu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ma=Go(/[A-Za-z]/),Gr=Go(/[\dA-Za-z]/),Z$e=Go(/[#-'*+\--9=?A-Z^-~]/);function LS(e){return e!==null&&(e<32||e===127)}const FS=Go(/\d/),eDe=Go(/[\dA-Fa-f]/),tDe=Go(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function Or(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const nDe=Go(new RegExp("\\p{P}|\\p{S}","u")),rDe=Go(/\s/);function Go(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function af(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&Gr(e.charCodeAt(n+1))&&Gr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(s=String.fromCharCode(a,l),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Rt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return ut(c)?(e.enter(n),l(c)):t(c)}function l(c){return ut(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const iDe={tokenize:aDe};function aDe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Rt(e,t,"linePrefix")}function i(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,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ue(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),s)}}const sDe={tokenize:oDe},mM={tokenize:lDe};function oDe(e){const t=this,n=[];let r=0,i,a,s;return l;function l(w){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const S=t.events.length;let _=S,j;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){j=t.events[_][1].end;break}x(r);let k=S;for(;k<t.events.length;)t.events[k][1].end={...j},k++;return Oa(t.events,_+1,0,t.events.slice(S)),t.events.length=k,u(w)}return l(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(mM,d,f)(w)}function d(w){return i&&y(),x(r),h(w)}function f(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(w)}function h(w){return t.containerState={},e.attempt(mM,p,g)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function g(w){if(w===null){i&&y(),x(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),m(w)}function m(w){if(w===null){v(e.exit("chunkFlow"),!0),x(0),e.consume(w);return}return Ue(w)?(e.consume(w),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),m)}function v(w,S){const _=t.sliceStream(w);if(S&&_.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(_),t.parser.lazy[w.start.line]){let j=i.events.length;for(;j--;)if(i.events[j][1].start.offset<s&&(!i.events[j][1].end||i.events[j][1].end.offset>s))return;const k=t.events.length;let C=k,E,A;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(E){A=t.events[C][1].end;break}E=!0}for(x(r),j=k;j<t.events.length;)t.events[j][1].end={...A},j++;Oa(t.events,C+1,0,t.events.slice(k)),t.events.length=j}}function x(w){let S=n.length;for(;S-- >w;){const _=n[S];t.containerState=_[1],_[0].exit.call(t,e)}n.length=w}function y(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lDe(e,t,n){return Rt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function gM(e){if(e===null||Or(e)||rDe(e))return 1;if(nDe(e))return 2}function NE(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const BS={name:"attention",resolveAll:cDe,tokenize:uDe};function cDe(e,t){let n=-1,r,i,a,s,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 f={...e[r][1].end},h={...e[n][1].start};vM(f,-c),vM(h,c),s={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ci(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ci(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=ci(u,NE(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ci(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ci(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Oa(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 uDe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=gM(r);let a;return s;function s(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=gM(c),f=!d||d===2&&i||n.includes(c),h=!i||i===2&&d||n.includes(r);return u._open=!!(a===42?f:f&&(i||!h)),u._close=!!(a===42?h:h&&(d||!f)),t(c)}}function vM(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const dDe={name:"autolink",tokenize:fDe};function fDe(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return ma(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||Gr(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||Gr(p))&&r++<32?(e.consume(p),l):(r=0,u(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||LS(p)?n(p):(e.consume(p),c)}function u(p){return p===64?(e.consume(p),d):Z$e(p)?(e.consume(p),u):n(p)}function d(p){return Gr(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Gr(p))&&r++<63){const g=p===45?h:f;return e.consume(p),g}return n(p)}}const l0={partial:!0,tokenize:hDe};function hDe(e,t,n){return r;function r(a){return ut(a)?Rt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ue(a)?t(a):n(a)}}const r7={continuation:{tokenize:mDe},exit:gDe,name:"blockQuote",tokenize:pDe};function pDe(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return ut(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function mDe(e,t,n){const r=this;return i;function i(s){return ut(s)?Rt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(r7,t,n)(s)}}function gDe(e){e.exit("blockQuote")}const i7={name:"characterEscape",tokenize:vDe};function vDe(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return tDe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const a7={name:"characterReference",tokenize:yDe};function yDe(e,t,n){const r=this;let i=0,a,s;return l;function l(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,s=Gr,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=eDe,d):(e.enter("characterReferenceValue"),a=7,s=FS,d(f))}function d(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return s===Gr&&!kE(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&i++<a?(e.consume(f),d):n(f)}}const yM={partial:!0,tokenize:bDe},xM={concrete:!0,name:"codeFenced",tokenize:xDe};function xDe(e,t,n){const r=this,i={partial:!0,tokenize:_};let a=0,s=0,l;return c;function c(j){return u(j)}function u(j){const k=r.events[r.events.length-1];return a=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,l=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(j)}function d(j){return j===l?(s++,e.consume(j),d):s<3?n(j):(e.exit("codeFencedFenceSequence"),ut(j)?Rt(e,f,"whitespace")(j):f(j))}function f(j){return j===null||Ue(j)?(e.exit("codeFencedFence"),r.interrupt?t(j):e.check(yM,m,S)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(j))}function h(j){return j===null||Ue(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(j)):ut(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Rt(e,p,"whitespace")(j)):j===96&&j===l?n(j):(e.consume(j),h)}function p(j){return j===null||Ue(j)?f(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||Ue(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(j)):j===96&&j===l?n(j):(e.consume(j),g)}function m(j){return e.attempt(i,S,v)(j)}function v(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),x}function x(j){return a>0&&ut(j)?Rt(e,y,"linePrefix",a+1)(j):y(j)}function y(j){return j===null||Ue(j)?e.check(yM,m,S)(j):(e.enter("codeFlowValue"),w(j))}function w(j){return j===null||Ue(j)?(e.exit("codeFlowValue"),y(j)):(e.consume(j),w)}function S(j){return e.exit("codeFenced"),t(j)}function _(j,k,C){let E=0;return A;function A(M){return j.enter("lineEnding"),j.consume(M),j.exit("lineEnding"),P}function P(M){return j.enter("codeFencedFence"),ut(M)?Rt(j,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):T(M)}function T(M){return M===l?(j.enter("codeFencedFenceSequence"),B(M)):C(M)}function B(M){return M===l?(E++,j.consume(M),B):E>=s?(j.exit("codeFencedFenceSequence"),ut(M)?Rt(j,F,"whitespace")(M):F(M)):C(M)}function F(M){return M===null||Ue(M)?(j.exit("codeFencedFence"),k(M)):C(M)}}}function bDe(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Gw={name:"codeIndented",tokenize:_De},wDe={partial:!0,tokenize:jDe};function _De(e,t,n){const r=this;return i;
vendor: 13,300 bytes, line 754
754function i(u){return e.enter("codeIndented"),Rt(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?s(u):n(u)}function s(u){return u===null?c(u):Ue(u)?e.attempt(wDe,s,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ue(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function jDe(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Rt(e,a,"linePrefix",5)(s)}function a(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):Ue(s)?i(s):n(s)}}const SDe={name:"codeText",previous:NDe,resolve:kDe,tokenize:CDe};function kDe(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function NDe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function CDe(e,t,n){let r=0,i,a;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),r++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(a=e.enter("codeTextSequence"),i=0,d(f)):Ue(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Ue(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",u(f))}}class EDe{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 i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$f(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),$f(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$f(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);$f(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$f(this.left,n.reverse())}}}function $f(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 s7(e){const t={};let n=-1,r,i,a,s,l,c,u;const d=new EDe(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,PDe(d,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=d.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},l=d.slice(i,n),l.unshift(r),d.splice(i,n-i+1,l))}}return Oa(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function PDe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,c=[],u={};let d,f,h=-1,p=n,g=0,m=0;const v=[m];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(m=h+1,v.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):v.pop(),h=v.length;h--;){const x=l.slice(v[h],v[h+1]),y=a.pop();c.push([y,y+x.length-1]),e.splice(y,2,x)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const ODe={resolve:TDe,tokenize:RDe},ADe={partial:!0,tokenize:IDe};function TDe(e){return s7(e),e}function RDe(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):Ue(l)?e.check(ADe,s,a)(l):(e.consume(l),i)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function IDe(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Rt(e,a,"linePrefix")}function a(s){if(s===null||Ue(s))return n(s);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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function o7(e,t,n,r,i,a,s,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(x),e.exit(a),h):x===null||x===32||x===41||LS(x)?n(x):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(x))}function h(x){return x===62?(e.enter(a),e.consume(x),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(l),h(x)):x===null||x===60||Ue(x)?n(x):(e.consume(x),x===92?g:p)}function g(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function m(x){return!d&&(x===null||x===41||Or(x))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(x)):d<u&&x===40?(e.consume(x),d++,m):x===41?(e.consume(x),d--,m):x===null||x===32||x===40||LS(x)?n(x):(e.consume(x),x===92?v:m)}function v(x){return x===40||x===41||x===92?(e.consume(x),m):m(x)}}function l7(e,t,n,r,i,a){const s=this;let l=0,c;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),d}function d(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Ue(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Ue(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!ut(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function c7(e,t,n,r,i,a){let s;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,c):n(h)}function c(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),u(h))}function u(h){return h===s?(e.exit(a),c(s)):h===null?n(h):Ue(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Rt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||Ue(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===s||h===92?(e.consume(h),d):d(h)}}function Sh(e,t){let n;return r;function r(i){return Ue(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?Rt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const MDe={name:"definition",tokenize:DDe},$De={partial:!0,tokenize:LDe};function DDe(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),s(p)}function s(p){return l7.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=xu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return Or(p)?Sh(e,u)(p):u(p)}function u(p){return o7(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt($De,f,f)(p)}function f(p){return ut(p)?Rt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Ue(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function LDe(e,t,n){return r;function r(l){return Or(l)?Sh(e,i)(l):n(l)}function i(l){return c7(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return ut(l)?Rt(e,s,"whitespace")(l):s(l)}function s(l){return l===null||Ue(l)?t(l):n(l)}}const FDe={name:"hardBreakEscape",tokenize:BDe};function BDe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ue(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const UDe={name:"headingAtx",resolve:zDe,tokenize:WDe};function zDe(e,t){let n=e.length-2,r=3,i,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&&(i={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"},Oa(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function WDe(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||Or(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ue(d)?(e.exit("atxHeading"),t(d)):ut(d)?Rt(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||Or(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const HDe=["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"],bM=["pre","script","style","textarea"],qDe={concrete:!0,name:"htmlFlow",resolveTo:KDe,tokenize:YDe},VDe={partial:!0,tokenize:QDe},GDe={partial:!0,tokenize:XDe};function KDe(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 YDe(e,t,n){const r=this;let i,a,s,l,c;return u;function u(D){return d(D)}function d(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),f}function f(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),a=!0,m):D===63?(e.consume(D),i=3,r.interrupt?t:N):ma(D)?(e.consume(D),s=String.fromCharCode(D),v):n(D)}function h(D){return D===45?(e.consume(D),i=2,p):D===91?(e.consume(D),i=5,l=0,g):ma(D)?(e.consume(D),i=4,r.interrupt?t:N):n(D)}function p(D){return D===45?(e.consume(D),r.interrupt?t:N):n(D)}function g(D){const K="CDATA[";return D===K.charCodeAt(l++)?(e.consume(D),l===K.length?r.interrupt?t:T:g):n(D)}function m(D){return ma(D)?(e.consume(D),s=String.fromCharCode(D),v):n(D)}function v(D){if(D===null||D===47||D===62||Or(D)){const K=D===47,ae=s.toLowerCase();return!K&&!a&&bM.includes(ae)?(i=1,r.interrupt?t(D):T(D)):HDe.includes(s.toLowerCase())?(i=6,K?(e.consume(D),x):r.interrupt?t(D):T(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?y(D):w(D))}
vendor: 10,401 bytes, line 754
754return D===45||Gr(D)?(e.consume(D),s+=String.fromCharCode(D),v):n(D)}function x(D){return D===62?(e.consume(D),r.interrupt?t:T):n(D)}function y(D){return ut(D)?(e.consume(D),y):A(D)}function w(D){return D===47?(e.consume(D),A):D===58||D===95||ma(D)?(e.consume(D),S):ut(D)?(e.consume(D),w):A(D)}function S(D){return D===45||D===46||D===58||D===95||Gr(D)?(e.consume(D),S):_(D)}function _(D){return D===61?(e.consume(D),j):ut(D)?(e.consume(D),_):w(D)}function j(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),c=D,k):ut(D)?(e.consume(D),j):C(D)}function k(D){return D===c?(e.consume(D),c=null,E):D===null||Ue(D)?n(D):(e.consume(D),k)}function C(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Or(D)?_(D):(e.consume(D),C)}function E(D){return D===47||D===62||ut(D)?w(D):n(D)}function A(D){return D===62?(e.consume(D),P):n(D)}function P(D){return D===null||Ue(D)?T(D):ut(D)?(e.consume(D),P):n(D)}function T(D){return D===45&&i===2?(e.consume(D),L):D===60&&i===1?(e.consume(D),R):D===62&&i===4?(e.consume(D),H):D===63&&i===3?(e.consume(D),N):D===93&&i===5?(e.consume(D),O):Ue(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(VDe,V,B)(D)):D===null||Ue(D)?(e.exit("htmlFlowData"),B(D)):(e.consume(D),T)}function B(D){return e.check(GDe,F,V)(D)}function F(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),M}function M(D){return D===null||Ue(D)?B(D):(e.enter("htmlFlowData"),T(D))}function L(D){return D===45?(e.consume(D),N):T(D)}function R(D){return D===47?(e.consume(D),s="",$):T(D)}function $(D){if(D===62){const K=s.toLowerCase();return bM.includes(K)?(e.consume(D),H):T(D)}return ma(D)&&s.length<8?(e.consume(D),s+=String.fromCharCode(D),$):T(D)}function O(D){return D===93?(e.consume(D),N):T(D)}function N(D){return D===62?(e.consume(D),H):D===45&&i===2?(e.consume(D),N):T(D)}function H(D){return D===null||Ue(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),H)}function V(D){return e.exit("htmlFlow"),t(D)}}function XDe(e,t,n){const r=this;return i;function i(s){return Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function QDe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(l0,t,n)}}const JDe={name:"htmlText",tokenize:ZDe};function ZDe(e,t,n){const r=this;let i,a,s;return l;function l(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),c}function c(N){return N===33?(e.consume(N),u):N===47?(e.consume(N),_):N===63?(e.consume(N),w):ma(N)?(e.consume(N),C):n(N)}function u(N){return N===45?(e.consume(N),d):N===91?(e.consume(N),a=0,g):ma(N)?(e.consume(N),y):n(N)}function d(N){return N===45?(e.consume(N),p):n(N)}function f(N){return N===null?n(N):N===45?(e.consume(N),h):Ue(N)?(s=f,R(N)):(e.consume(N),f)}function h(N){return N===45?(e.consume(N),p):f(N)}function p(N){return N===62?L(N):N===45?h(N):f(N)}function g(N){const H="CDATA[";return N===H.charCodeAt(a++)?(e.consume(N),a===H.length?m:g):n(N)}function m(N){return N===null?n(N):N===93?(e.consume(N),v):Ue(N)?(s=m,R(N)):(e.consume(N),m)}function v(N){return N===93?(e.consume(N),x):m(N)}function x(N){return N===62?L(N):N===93?(e.consume(N),x):m(N)}function y(N){return N===null||N===62?L(N):Ue(N)?(s=y,R(N)):(e.consume(N),y)}function w(N){return N===null?n(N):N===63?(e.consume(N),S):Ue(N)?(s=w,R(N)):(e.consume(N),w)}function S(N){return N===62?L(N):w(N)}function _(N){return ma(N)?(e.consume(N),j):n(N)}function j(N){return N===45||Gr(N)?(e.consume(N),j):k(N)}function k(N){return Ue(N)?(s=k,R(N)):ut(N)?(e.consume(N),k):L(N)}function C(N){return N===45||Gr(N)?(e.consume(N),C):N===47||N===62||Or(N)?E(N):n(N)}function E(N){return N===47?(e.consume(N),L):N===58||N===95||ma(N)?(e.consume(N),A):Ue(N)?(s=E,R(N)):ut(N)?(e.consume(N),E):L(N)}function A(N){return N===45||N===46||N===58||N===95||Gr(N)?(e.consume(N),A):P(N)}function P(N){return N===61?(e.consume(N),T):Ue(N)?(s=P,R(N)):ut(N)?(e.consume(N),P):E(N)}function T(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),i=N,B):Ue(N)?(s=T,R(N)):ut(N)?(e.consume(N),T):(e.consume(N),F)}function B(N){return N===i?(e.consume(N),i=void 0,M):N===null?n(N):Ue(N)?(s=B,R(N)):(e.consume(N),B)}function F(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||Or(N)?E(N):(e.consume(N),F)}function M(N){return N===47||N===62||Or(N)?E(N):n(N)}function L(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function R(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),$}function $(N){return ut(N)?Rt(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):O(N)}function O(N){return e.enter("htmlTextData"),s(N)}}const CE={name:"labelEnd",resolveAll:r3e,resolveTo:i3e,tokenize:a3e},e3e={tokenize:s3e},t3e={tokenize:o3e},n3e={tokenize:l3e};function r3e(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 i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Oa(e,0,e.length,n),e}function i3e(e,t){let n=e.length,r=0,i,a,s,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=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[s][1].end}},d={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=ci(l,e.slice(a+1,a+r+3)),l=ci(l,[["enter",d,t]]),l=ci(l,NE(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),l=ci(l,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),l=ci(l,e.slice(s+1)),l=ci(l,[["exit",c,t]]),Oa(e,a,e.length,l),e}function a3e(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(h){return a?a._inactive?f(h):(s=r.parser.defined.includes(xu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(e3e,d,s?d:f)(h):h===91?e.attempt(t3e,d,s?u:f)(h):s?d(h):f(h)}function u(h){return e.attempt(n3e,d,f)(h)}function d(h){return t(h)}function f(h){return a._balanced=!0,n(h)}}function s3e(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Or(f)?Sh(e,a)(f):a(f)}function a(f){return f===41?d(f):o7(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Or(f)?Sh(e,c)(f):d(f)}function l(f){return n(f)}function c(f){return f===34||f===39||f===40?c7(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return Or(f)?Sh(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function o3e(e,t,n){const r=this;return i;function i(l){return l7.call(r,e,a,s,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(xu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function l3e(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const c3e={name:"labelStartImage",resolveAll:CE.resolveAll,tokenize:u3e};function u3e(e,t,n){const r=this;return i;function i(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"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const d3e={name:"labelStartLink",resolveAll:CE.resolveAll,tokenize:f3e};function f3e(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Kw={name:"lineEnding",tokenize:h3e};function h3e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Rt(e,t,"linePrefix")}}const lv={name:"thematicBreak",tokenize:p3e};function p3e(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ue(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),ut(u)?Rt(e,l,"whitespace")(u):l(u))}}const vr={continuation:{tokenize:y3e},exit:b3e,name:"list",tokenize:v3e},m3e={partial:!0,tokenize:w3e},g3e={partial:!0,tokenize:x3e};function v3e(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:FS(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(lv,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return FS(p)&&++s<10?(e.consume(p),c):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(l0,r.interrupt?n:d,e.attempt(m3e,h,f))}
vendor: 5,407 bytes, line 754
754function d(p){return r.containerState.initialBlankLine=!0,a++,h(p)}function f(p){return ut(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function y3e(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(l0,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Rt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!ut(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(g3e,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Rt(e,e.attempt(vr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function x3e(e,t,n){const r=this;return Rt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function b3e(e){e.exit(this.containerState.type)}function w3e(e,t,n){const r=this;return Rt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!ut(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const wM={name:"setextUnderline",resolveTo:_3e,tokenize:j3e};function _3e(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function j3e(e,t,n){const r=this;let i;return a;function a(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),ut(u)?Rt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ue(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const S3e={tokenize:k3e};function k3e(e){const t=this,n=e.attempt(l0,r,e.attempt(this.parser.constructs.flowInitial,i,Rt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ODe,i)),"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 i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const N3e={resolveAll:d7()},C3e=u7("string"),E3e=u7("text");function u7(e){return{resolveAll:d7(e==="text"?P3e:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,l);return s;function s(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 f=i[d];let h=-1;if(f)for(;++h<f.length;){const p=f[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function d7(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function P3e(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],i=t.sliceStream(r);let a=i.length,s=-1,l=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-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?s:r.start._bufferIndex+s,_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 O3e={42:vr,43:vr,45:vr,48:vr,49:vr,50:vr,51:vr,52:vr,53:vr,54:vr,55:vr,56:vr,57:vr,62:r7},A3e={91:MDe},T3e={[-2]:Gw,[-1]:Gw,32:Gw},R3e={35:UDe,42:lv,45:[wM,lv],60:qDe,61:wM,95:lv,96:xM,126:xM},I3e={38:a7,92:i7},M3e={[-5]:Kw,[-4]:Kw,[-3]:Kw,33:c3e,38:a7,42:BS,60:[dDe,JDe],91:d3e,92:[FDe,i7],93:CE,95:BS,96:SDe},$3e={null:[BS,N3e]},D3e={null:[42,95]},L3e={null:[]},F3e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:D3e,contentInitial:A3e,disable:L3e,document:O3e,flow:R3e,flowInitial:T3e,insideSpan:$3e,string:I3e,text:M3e},Symbol.toStringTag,{value:"Module"}));function B3e(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
vendor: 14,691 bytes, lines 754-756
754olumn:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],l=[];const c={attempt:k(_),check:k(j),consume:y,enter:w,exit:S,interrupt:k(j,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:f};let d=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function f(P){return s=ci(s,P),v(),s[s.length-1]!==null?[]:(C(t,0),u.events=NE(a,u.events,u),u.events)}function h(P,T){return z3e(p(P),T)}function p(P){return U3e(s,P)}function g(){const{_bufferIndex:P,_index:T,line:B,column:F,offset:M}=r;return{_bufferIndex:P,_index:T,line:B,column:F,offset:M}}function m(P){i[P.line]=P.column,A()}function v(){let P;for(;r._index<s.length;){const T=s[r._index];if(typeof T=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<T.length;)x(T.charCodeAt(r._bufferIndex));else x(T)}}function x(P){d=d(P)}function y(P){Ue(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,A()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=P}function w(P,T){const B=T||{};return B.type=P,B.start=g(),u.events.push(["enter",B,u]),l.push(B),B}function S(P){const T=l.pop();return T.end=g(),u.events.push(["exit",T,u]),T}function _(P,T){C(P,T.from)}function j(P,T){T.restore()}function k(P,T){return B;function B(F,M,L){let R,$,O,N;return Array.isArray(F)?V(F):"tokenize"in F?V([F]):H(F);function H(se){return Q;function Q(ne){const Z=ne!==null&&se[ne],W=ne!==null&&se.null,ee=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(W)?W:W?[W]:[]];return V(ee)(ne)}}function V(se){return R=se,$=0,se.length===0?L:D(se[$])}function D(se){return Q;function Q(ne){return N=E(),O=se,se.partial||(u.currentConstruct=se),se.name&&u.parser.constructs.disable.null.includes(se.name)?ae():se.tokenize.call(T?Object.assign(Object.create(u),T):u,c,K,ae)(ne)}}function K(se){return P(O,N),M}function ae(se){return N.restore(),++$<R.length?D(R[$]):L}}}function C(P,T){P.resolveAll&&!a.includes(P)&&a.push(P),P.resolve&&Oa(u.events,T,u.events.length-T,P.resolve(u.events.slice(T),u)),P.resolveTo&&(u.events=P.resolveTo(u.events,u))}function E(){const P=g(),T=u.previous,B=u.currentConstruct,F=u.events.length,M=Array.from(l);return{from:F,restore:L};function L(){r=P,u.previous=T,u.currentConstruct=B,u.events.length=F,l=M,A()}}function A(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function U3e(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function z3e(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
755`;break}case-3:{s=`\r
756`;break}case-2:{s=t?" ":"	";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function W3e(e){const r={constructs:X$e([F3e,...(e||{}).extensions||[]]),content:i(iDe),defined:[],document:i(sDe),flow:i(S3e),lazy:{},string:i(C3e),text:i(E3e)};return r;function i(a){return s;function s(l){return B3e(r,a,l)}}}function H3e(e){for(;!s7(e););return e}const _M=/[\0\t\n\r]/g;function q3e(){let e=1,t="",n=!0,r;return i;function i(a,s,l){const c=[];let u,d,f,h,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(_M.lastIndex=f,u=_M.exec(a),h=u&&u.index!==void 0?u.index:a.length,p=a.charCodeAt(h),!u){t=a.slice(f);break}if(p===10&&f===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<h&&(c.push(a.slice(f,h)),e+=h-f),p){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}f=h+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const V3e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function G3e(e){return e.replace(V3e,K3e)}function K3e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return n7(n.slice(a?2:1),a?16:10)}return kE(n)||e}const f7={}.hasOwnProperty;function Y3e(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),X3e(n)(H3e(W3e(n).document().write(q3e()(e,t,!0))))}function X3e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(pt),autolinkProtocol:E,autolinkEmail:E,atxHeading:a(Ie),blockQuote:a(W),characterEscape:E,characterReference:E,codeFenced:a(ee),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(ee,s),codeText:a(q,s),codeTextData:E,data:E,codeFlowValue:E,definition:a(re),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(ge),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(qe,s),htmlFlowData:E,htmlText:a(qe,s),htmlTextData:E,image:a(jt),label:s,link:a(pt),listItem:a(Wt),listItemValue:h,listOrdered:a(rn,f),listUnordered:a(rn),paragraph:a(Sn),reference:D,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Ie),strong:a(mt),thematicBreak:a(Gt)},exit:{atxHeading:c(),atxHeadingSequence:_,autolink:c(),autolinkEmail:Z,autolinkProtocol:ne,blockQuote:c(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:se,characterReference:Q,codeFenced:c(v),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:c(x),codeText:c(M),codeTextData:A,data:A,definition:c(),definitionDestinationString:S,definitionLabelString:y,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(T),hardBreakTrailing:c(T),htmlFlow:c(B),htmlFlowData:A,htmlText:c(F),htmlTextData:A,image:c(R),label:O,labelText:$,lineEnding:P,link:c(L),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:K,resourceDestinationString:N,resourceTitleString:H,resource:V,setextHeading:c(C),setextHeadingLineSequence:k,setextHeadingText:j,strong:c(),thematicBreak:c()}};h7(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(J){let le={type:"root",children:[]};const Ae={stack:[le],tokenStack:[],config:t,enter:l,exit:u,buffer:s,resume:d,data:n},Ve=[];let Ze=-1;for(;++Ze<J.length;)if(J[Ze][1].type==="listOrdered"||J[Ze][1].type==="listUnordered")if(J[Ze][0]==="enter")Ve.push(Ze);else{const cn=Ve.pop();Ze=i(J,cn,Ze)}for(Ze=-1;++Ze<J.length;){const cn=t[J[Ze][0]];f7.call(cn,J[Ze][1].type)&&cn[J[Ze][1].type].call(Object.assign({sliceSerialize:J[Ze][2].sliceSerialize},Ae),J[Ze][1])}if(Ae.tokenStack.length>0){const cn=Ae.tokenStack[Ae.tokenStack.length-1];(cn[1]||jM).call(Ae,void 0,cn[0])}for(le.position={start:Cs(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:Cs(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},Ze=-1;++Ze<t.transforms.length;)le=t.transforms[Ze](le)||le;return le}function i(J,le,Ae){let Ve=le-1,Ze=-1,cn=!1,Bn,mn,An,Ct;for(;++Ve<=Ae;){const it=J[Ve];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?Ze++:Ze--,Ct=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(Bn&&!Ct&&!Ze&&!An&&(An=Ve),Ct=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ct=void 0}if(!Ze&&it[0]==="enter"&&it[1].type==="listItemPrefix"||Ze===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(Bn){let U=Ve;for(mn=void 0;U--;){const ie=J[U];if(ie[1].type==="lineEnding"||ie[1].type==="lineEndingBlank"){if(ie[0]==="exit")continue;mn&&(J[mn][1].type="lineEndingBlank",cn=!0),ie[1].type="lineEnding",mn=U}else if(!(ie[1].type==="linePrefix"||ie[1].type==="blockQuotePrefix"||ie[1].type==="blockQuotePrefixWhitespace"||ie[1].type==="blockQuoteMarker"||ie[1].type==="listItemIndent"))break}An&&(!mn||An<mn)&&(Bn._spread=!0),Bn.end=Object.assign({},mn?J[mn][1].start:it[1].end),J.splice(mn||Ve,0,["exit",Bn,it[2]]),Ve++,Ae++}if(it[1].type==="listItemPrefix"){const U={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};Bn=U,J.splice(Ve,0,["enter",U,it[2]]),Ve++,Ae++,An=void 0,Ct=!0}}}return J[le][1]._spread=cn,Ae}function a(J,le){return Ae;function Ae(Ve){l.call(this,J(Ve),Ve),le&&le.call(this,Ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(J,le,Ae){this.stack[this.stack.length-1].children.push(J),this.stack.push(J),this.tokenStack.push([le,Ae||void 0]),J.position={start:Cs(le.start),end:void 0}}function c(J){return le;function le(Ae){J&&J.call(this,Ae),u.call(this,Ae)}}function u(J,le){const Ae=this.stack.pop(),Ve=this.tokenStack.pop();if(Ve)Ve[0].type!==J.type&&(le?le.call(this,J,Ve[0]):(Ve[1]||jM).call(this,J,Ve[0]));else throw new Error("Cannot close `"+J.type+"` ("+jh({start:J.start,end:J.end})+"): it’s not open");Ae.position.end=Cs(J.end)}function d(){return K$e(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(J){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(J),10),this.data.expectingFirstListItemValue=void 0}}function p(){const J=this.resume(),le=this.stack[this.stack.length-1];le.lang=J}function g(){const J=this.resume(),le=this.stack[this.stack.length-1];le.meta=J}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const J=this.resume(),le=this.stack[this.stack.length-1];le.value=J.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const J=this.resume(),le=this.stack[this.stack.length-1];le.value=J.replace(/(\r?\n|\r)$/g,"")}function y(J){const le=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=le,Ae.identifier=xu(this.sliceSerialize(J)).toLowerCase()}function w(){const J=this.resume(),le=this.stack[this.stack.length-1];le.title=J}function S(){const J=this.resume(),le=this.stack[this.stack.length-1];le.url=J}function _(J){const le=this.stack[this.stack.length-1];if(!le.depth){const Ae=this.sliceSerialize(J).length;le.depth=Ae}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function k(J){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(J).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function E(J){const Ae=this.stack[this.stack.length-1].children;let Ve=Ae[Ae.length-1];(!Ve||Ve.type!=="text")&&(Ve=Ee(),Ve.position={start:Cs(J.start),end:void 0},Ae.push(Ve)),this.stack.push(Ve)}function A(J){const le=this.stack.pop();le.value+=this.sliceSerialize(J),le.position.end=Cs(J.end)}function P(J){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=le.children[le.children.length-1];Ae.position.end=Cs(J.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(E.call(this,J),A.call(this,J))}function T(){this.data.atHardBreak=!0}function B(){const J=this.resume(),le=this.stack[this.stack.length-1];le.value=J}function F(){const J=this.resume(),le=this.stack[this.stack.length-1];le.value=J}function M(){const J=this.resume(),le=this.stack[this.stack.length-1];le.value=J}function L(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=le,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function R(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=le,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function $(J){const le=this.sliceSerialize(J),Ae=this.stack[this.stack.length-2];Ae.label=G3e(le),Ae.identifier=xu(le).toLowerCase()}function O(){const J=this.stack[this.stack.length-1],le=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Ve=J.children;Ae.children=Ve}else Ae.alt=le}function N(){const J=this.resume(),le=this.stack[this.stack.length-1];le.url=J}function H(){const J=this.resume(),le=this.stack[this.stack.length-1];le.title=J}function V(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function K(J){const le=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=le,Ae.identifier=xu(this.sliceSerialize(J)).toLowerCase(),this.data.referenceType="full"}function ae(J){this.data.characterReferenceType=J.type}function se(J){const le=this.sliceSerialize(J),Ae=this.data.characterReferenceType;let Ve;Ae?(Ve=n7(le,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ve=kE(le);const Ze=this.stack[this.stack.length-1];Ze.value+=Ve}function Q(J){const le=this.stack.pop();le.position.end=Cs(J.end)}function ne(J){A.call(this,J);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(J)}function Z(J){A.call(this,J);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(J)}function W(){return{type:"blockquote",children:[]}}function ee(){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 ge(){return{type:"emphasis",children:[]}}function Ie(){return{type:"heading",depth:0,children:[]}}function ye(){return{type:"break"}}function qe(){return{type:"html",value:""}}function jt(){return{type:"image",title:null,url:"",alt:null}}function pt(){return{type:"link",title:null,url:"",children:[]}}function rn(J){return{type:"list",ordered:J.type==="listOrdered",start:null,spread:J._spread,children:[]}}function Wt(J){return{type:"listItem",spread:J._spread,checked:null,children:[]}}function Sn(){return{type:"paragraph",children:[]}}function mt(){return{type:"strong",children:[]}}function Ee(){return{type:"text",value:""}}function Gt(){return{type:"thematicBreak"}}}function Cs(e){return{line:e.line,column:e.column,offset:e.offset}}function h7(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?h7(e,r):Q3e(e,r)}}function Q3e(e,t){let n;for(n in t)if(f7.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 jM(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+jh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jh({start:t.start,end:t.end}
vendor: 10,006 bytes, lines 756-760
756)+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+jh({start:t.start,end:t.end})+") is still open")}function J3e(e){const t=this;t.parser=n;function n(r){return Y3e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Z3e(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 e5e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
757`}]}function t5e(e,t){const n=t.value?t.value+`
758`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[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 n5e(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function r5e(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function i5e(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=af(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function a5e(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 s5e(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function p7(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 i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function o5e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p7(e,t);const i={src:af(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function l5e(e,t){const n={src:af(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 c5e(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 u5e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return p7(e,t);const i={href:af(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function d5e(e,t){const n={href:af(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 f5e(e,t,n){const r=e.all(t),i=n?h5e(n):m7(t),a={},s=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.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];(i||l!==0||d.type!=="element"||d.tagName!=="p")&&s.push({type:"text",value:`
759`}),d.type==="element"&&d.tagName==="p"&&!i?s.push(...d.children):s.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
760`});const u={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,u),e.applyData(t,u)}function h5e(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=m7(n[r])}return t}function m7(e){const t=e.spread;return t??e.children.length>1}function p5e(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.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 m5e(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function g5e(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function v5e(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y5e(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=wE(t.children[1]),c=Y9(t.children[t.children.length-1]);l&&c&&(s.position={start:l,end:c}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function x5e(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const f=t.children[c],h={},p=s?s[c]:void 0;p&&(h.align=p);let g={type:"element",tagName:a,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,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 b5e(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const SM=9,kM=32;function w5e(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(NM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(NM(t.slice(i),i>0,!1)),a.join("")}function NM(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===SM||a===kM;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===SM||a===kM;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function _5e(e,t){const n={type:"text",value:w5e(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function j5e(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const S5e={blockquote:Z3e,break:e5e,code:t5e,delete:n5e,emphasis:r5e,footnoteReference:i5e,heading:a5e,html:s5e,imageReference:o5e,image:l5e,inlineCode:c5e,linkReference:u5e,link:d5e,listItem:f5e,list:p5e,paragraph:m5e,root:g5e,strong:v5e,table:y5e,tableCell:b5e,tableRow:x5e,text:_5e,thematicBreak:j5e,toml:Mg,yaml:Mg,definition:Mg,footnoteDefinition:Mg};function Mg(){}const g7=-1,c0=0,kh=1,ox=2,EE=3,PE=4,OE=5,AE=6,v7=7,y7=8,CM=typeof self=="object"?self:globalThis,k5e=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case c0:case g7:return n(s,i);case kh:{const l=n([],i);for(const c of s)l.push(r(c));return l}case ox:{const l=n({},i);for(const[c,u]of s)l[r(c)]=r(u);return l}case EE:return n(new Date(s),i);case PE:{const{source:l,flags:c}=s;return n(new RegExp(l,c),i)}case OE:{const l=n(new Map,i);for(const[c,u]of s)l.set(r(c),r(u));return l}case AE:{const l=n(new Set,i);for(const c of s)l.add(r(c));return l}case v7:{const{name:l,message:c}=s;return n(new CM[l](c),i)}case y7:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(new CM[a](s),i)};return r},EM=e=>k5e(new Map,e)(0),Ac="",{toString:N5e}={},{keys:C5e}=Object,Df=e=>{const t=typeof e;if(t!=="object"||!e)return[c0,t];const n=N5e.call(e).slice(8,-1);switch(n){case"Array":return[kh,Ac];case"Object":return[ox,Ac];case"Date":return[EE,Ac];case"RegExp":return[PE,Ac];case"Map":return[OE,Ac];case"Set":return[AE,Ac];case"DataView":return[kh,n]}return n.includes("Array")?[kh,n]:n.includes("Error")?[v7,n]:[ox,n]},$g=([e,t])=>e===c0&&(t==="function"||t==="symbol"),E5e=(e,t,n,r)=>{const i=(s,l)=>{const c=r.push(s)-1;return n.set(l,c),c},a=s=>{if(n.has(s))return n.get(s);let[l,c]=Df(s);switch(l){case c0:{let d=s;switch(c){case"bigint":l=y7,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([g7],s)}return i([l,d],s)}case kh:{if(c){let h=s;return c==="DataView"?h=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(s)),i([c,[...h]],s)}const d=[],f=i([l,d],s);for(const h of s)d.push(a(h));return f}case ox:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const d=[],f=i([l,d],s);for(const h of C5e(s))(e||!$g(Df(s[h])))&&d.push([a(h),a(s[h])]);return f}case EE:return i([l,s.toISOString()],s);case PE:{const{source:d,flags:f}=s;return i([l,{source:d,flags:f}],s)}case OE:{const d=[],f=i([l,d],s);
vendor: 17,226 bytes, lines 760-766
760for(const[h,p]of s)(e||!($g(Df(h))||$g(Df(p))))&&d.push([a(h),a(p)]);return f}case AE:{const d=[],f=i([l,d],s);for(const h of s)(e||!$g(Df(h)))&&d.push(a(h));return f}}const{message:u}=s;return i([l,{name:c,message:u}],s)};return a},PM=(e,{json:t,lossy:n}={})=>{const r=[];return E5e(!(t||n),!!t,new Map,r)(e),r},lx=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?EM(PM(e,t)):structuredClone(e):(e,t)=>EM(PM(e,t));function P5e(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 O5e(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function A5e(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||P5e,r=e.options.footnoteBackLabel||O5e,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=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),f=String(u.identifier).toUpperCase(),h=af(f.toLowerCase());let p=0;const g=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++p<=m;){g.length>0&&g.push({type:"text",value:" "});let y=typeof n=="string"?n:n(c,p);typeof y=="string"&&(y={type:"text",value:y}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,p),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const y=v.children[v.children.length-1];y&&y.type==="text"?y.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,x),l.push(x)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...lx(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
761`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
762`}]}}const x7=function(e){if(e==null)return M5e;if(typeof e=="function")return u0(e);if(typeof e=="object")return Array.isArray(e)?T5e(e):R5e(e);if(typeof e=="string")return I5e(e);throw new Error("Expected function, string, or object as test")};function T5e(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=x7(e[n]);return u0(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function R5e(e){const t=e;return u0(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function I5e(e){return u0(t);function t(n){return n&&n.type===e}}function u0(e){return t;function t(n,r,i){return!!($5e(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function M5e(){return!0}function $5e(e){return e!==null&&typeof e=="object"&&"type"in e}const b7=[],D5e=!0,OM=!1,L5e="skip";function F5e(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=x7(i),s=r?-1:1;l(e,void 0,[])();function l(c,u,d){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=b7,g,m,v;if((!t||a(c,u,d[d.length-1]||void 0))&&(p=B5e(n(c,d)),p[0]===OM))return p;if("children"in c&&c.children){const x=c;if(x.children&&p[0]!==L5e)for(m=(r?x.children.length:-1)+s,v=d.concat(x);m>-1&&m<x.children.length;){const y=x.children[m];if(g=l(y,m,v)(),g[0]===OM)return g;m=typeof g[1]=="number"?g[1]:m+s}}return p}}}function B5e(e){return Array.isArray(e)?e:typeof e=="number"?[D5e,e]:e==null?b7:[e]}function w7(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),F5e(e,a,l,i);function l(c,u){const d=u[u.length-1],f=d?d.children.indexOf(c):void 0;return s(c,f,d)}}const US={}.hasOwnProperty,U5e={};function z5e(e,t){const n=t||U5e,r=new Map,i=new Map,a=new Map,s={...S5e,...n.handlers},l={all:u,applyData:H5e,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:c,options:n,patch:W5e,wrap:V5e};return w7(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();f.has(h)||f.set(h,d)}}),l;function c(d,f){const h=d.type,p=l.handlers[h];if(US.call(l.handlers,h)&&p)return p(l,d,f);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in d){const{children:m,...v}=d,x=lx(v);return x.children=l.all(d),x}return lx(d)}return(l.options.unknownHandler||q5e)(l,d,f)}function u(d){const f=[];if("children"in d){const h=d.children;let p=-1;for(;++p<h.length;){const g=l.one(h[p],d);if(g){if(p&&h[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=AM(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=AM(m.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function W5e(e,t){e.position&&(t.position=N$e(e))}function H5e(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,lx(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function q5e(e,t){const n=t.data||{},r="value"in t&&!(US.call(n,"hProperties")||US.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 V5e(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
763`});++r<e.length;)r&&n.push({type:"text",value:`
764`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
765`}),n}function AM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function TM(e,t){const n=z5e(e,t),r=n.one(e,void 0),i=A5e(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
766`},i),a}function G5e(e,t){return e&&"run"in e?async function(n,r){const i=TM(n,{file:r,...t});await e.run(i,r)}:function(n,r){return TM(n,{file:r,...e||t})}}function RM(e){if(e)throw e}var cv=Object.prototype.hasOwnProperty,_7=Object.prototype.toString,IM=Object.defineProperty,MM=Object.getOwnPropertyDescriptor,$M=function(t){return typeof Array.isArray=="function"?Array.isArray(t):_7.call(t)==="[object Array]"},DM=function(t){if(!t||_7.call(t)!=="[object Object]")return!1;var n=cv.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cv.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||cv.call(t,i)},LM=function(t,n){IM&&n.name==="__proto__"?IM(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},FM=function(t,n){if(n==="__proto__")if(cv.call(t,n)){if(MM)return MM(t,n).value}else return;return t[n]},K5e=function e(){var t,n,r,i,a,s,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=FM(l,n),i=FM(t,n),l!==i&&(d&&i&&(DM(i)||(a=$M(i)))?(a?(a=!1,s=r&&$M(r)?r:[]):s=r&&DM(r)?r:{},LM(l,{name:n,newValue:e(d,s,i)})):typeof i<"u"&&LM(l,{name:n,newValue:i}));return l};const Yw=ct(K5e);function zS(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 Y5e(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(c,...u){const d=e[++a];let f=-1;if(c){s(c);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,d?X5e(d,l)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function X5e(e,t){let n;return r;function r(...s){const l=e.length>s.length;let c;l&&s.push(i);try{c=e.apply(this,s)}catch(u){const d=u;if(l&&n)throw d;return i(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(s,...l){n||(n=!0,t(s,...l))}function a(s){i(null,s)}}const oa={basename:Q5e,dirname:J5e,extname:Z5e,join:e4e,sep:"/"};function Q5e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Lm(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function J5e(e){if(Lm(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 Z5e(e){Lm(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function e4e(...e){let t=-1,n;for(;++t<e.length;)Lm(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":t4e(n)}function t4e(e){Lm(e);const t=e.codePointAt(0)===47;let n=n4e(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function n4e(e,t){let n="",r=0,i=-1,a=0,s=-1,l,c;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||a===1))if(i!==s-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("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else l===46&&a>-1?a++:a=-1}return n}function Lm(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const r4e={cwd:i4e};function i4e(){return"/"}function WS(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function a4e(e){if(typeof e=="string")e=new URL(e);else if(!WS(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 s4e(e)}function s4e(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Xw=["history","path","basename","stem","extname","dirname"];class j7{constructor(t){let n;t?WS(t)?n={path:t}:typeof t=="string"||o4e(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":r4e.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Xw.length;){const a=Xw[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Xw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?oa.basename(this.path):void 0}set basename(t){Jw(t,"basename"),Qw(t,"basename"),this.path=oa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?oa.dirname(this.path):void 0}set dirname(t){BM(this.basename,"dirname"),this.path=oa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?oa.extname(this.path):void 0}set extname(t){if(Qw(t,"extname"),BM(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=oa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){WS(t)&&(t=a4e(t)),Jw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?oa.basename(this.path,this.extname):void 0}set stem(t){Jw(t,"stem"),Qw(t,"stem"),this.path=oa.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Jn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Qw(e,t){if(e&&e.includes(oa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+oa.sep+"`")}function Jw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function BM(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function o4e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const l4e=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},c4e={}.hasOwnProperty;class TE extends l4e{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=Y5e()}copy(){const t=new TE;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Yw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(t1("data",this.frozen),this.namespace[t]=n,this):c4e.call(this.namespace,t)&&this.namespace[t]||void 0:t?(t1("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 i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Dg(t),r=this.parser||this.Parser;return Zw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zw("process",this.parser||this.Parser),e1("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const l=Dg(t),c=r.parse(l);r.run(c,l,function(d,f,h){if(d||!f||!h)return u(d);const p=f,g=r.stringify(p,h);f4e(g)?h.value=g:h.result=g,u(d,h)});function u(d,f){d||!f?s(d):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Zw("processSync",this.parser||this.Parser),e1("processSync",this.compiler||this.Compiler),this.process(t,i),zM("processSync","process",n),r;function i(a,s){n=!0,RM(a),r=s}}run(t,n,r){UM(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,l){const c=Dg(n);i.run(t,c,u);function u(d,f,h){const p=f||t;d?l(d):s?s(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),zM("runSync","run",r),i;function a(s,l){RM(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=Dg(n),i=this.compiler||this.Compiler;return e1("stringify",i),UM(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(t1("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(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,...f]=u;c(d,f)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(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&&(i.settings=Yw(!0,i.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];a(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...d]);else if(d.length>0){let[p,...g]=d;const m=r[h][1];zS(m)&&zS(p)&&(p=Yw(!0,m,p)),r[h]=[u,p,...g]}}}}
766const u4e=new TE().freeze();function Zw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function e1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function t1(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 UM(e){if(!zS(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zM(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dg(e){return d4e(e)?e:new j7(e)}function d4e(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function f4e(e){return typeof e=="string"||h4e(e)}function h4e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const p4e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",WM=[],HM={allowDangerousHtml:!0},m4e=/^(https?|ircs?|mailto|xmpp)$/i,g4e=[{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 v4e(e){const t=y4e(e),n=x4e(e);return b4e(t.runSync(t.parse(n),n),e)}function y4e(e){const t=e.rehypePlugins||WM,n=e.remarkPlugins||WM,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...HM}:HM;return u4e().use(J3e).use(n).use(G5e,r).use(t)}function x4e(e){const t=e.children||"",n=new j7;return typeof t=="string"&&(n.value=t),n}function b4e(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||w4e;for(const d of g4e)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+p4e+d.id,void 0);return w7(e,u),A$e(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return s?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in Vw)if(Object.hasOwn(Vw,p)&&Object.hasOwn(d.properties,p)){const g=d.properties[p],m=Vw[p];(m===null||m.includes(d.tagName))&&(d.properties[p]=c(String(g||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function w4e(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||m4e.test(e.slice(0,t))?e:""}const _4e="https://hfnnsrngmmfuhssfwhlj.supabase.co/functions/v1/chat-reviews";async function j4e({messages:e,businessId:t,accessToken:n,onDelta:r,onDone:i,onError:a}){var f,h,p,g,m,v;const s=await fetch(_4e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imhmbm5zcm5nbW1mdWhzc2Z3aGxqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzMzMDIyNTksImV4cCI6MjA4ODg3ODI1OX0.cOG14AuXKizGxOndB0gA-YWKB7xn4hJdwxYandovxC8"},body:JSON.stringify({messages:e,business_id:t})});if(!s.ok){const x=await s.json().catch(()=>({}));a(x.error||"Failed to get response");return}if(!s.body){a("No response stream");return}const l=s.body.getReader(),c=new TextDecoder;let u="",d=!1;for(;!d;){const{done:x,value:y}=await l.read();if(x)break;u+=c.decode(y,{stream:!0});let w;for(;(w=u.indexOf(`
767`))!==-1;){let S=u.slice(0,w);if(u=u.slice(w+1),S.endsWith("\r")&&(S=S.slice(0,-1)),S.startsWith(":")||S.trim()===""||!S.startsWith("data: "))continue;const _=S.slice(6).trim();if(_==="[DONE]"){d=!0;break}try{const k=(p=(h=(f=JSON.parse(_).choices)==null?void 0:f[0])==null?void 0:h.delta)==null?void 0:p.content;k&&r(k)}catch{u=S+`
768`+u;break}}}if(u.trim())for(let x of u.split(`
769`)){if(!x||(x.endsWith("\r")&&(x=x.slice(0,-1)),!x.startsWith("data: ")))continue;const y=x.slice(6).trim();if(y!=="[DONE]")try{const S=(v=(m=(g=JSON.parse(y).choices)==null?void 0:g[0])==null?void 0:m.delta)==null?void 0:v.content;S&&r(S)}catch{}}i()}const S4e=["What are the most common complaints?","Summarize overall customer sentiment","Which reviews need urgent attention?","What do customers praise most?"],k4e=()=>{var w,S;const{user:e,loading:t}=Mt(),{businesses:n,isLoading:r}=HC(),{chat:i,loading:a}=qC(),[s,l]=b.useState(""),[c,u]=b.useState([]),[d,f]=b.useState(""),[h,p]=b.useState(!1),g=b.useRef(null),m=b.useRef(null);if(b.useEffect(()=>{n.length>0&&!s&&l(n[0].id)},[n,s]),b.useEffect(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},[c]),t||r||a)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});if(!e)return o.jsx(Yi,{to:"/login",replace:!0});if(!i)return o.jsx(Qn,{children:o.jsx("div",{className:"mx-auto max-w-lg pt-12",children:o.jsx(IMe,{feature:"Review Chat",description:"Chat with your reviews using AI is available on Pro and Business plans."})})});const v=async _=>{const j=_||d.trim();if(!j||!s||h)return;const{data:{session:k}}=await(await RMe(async()=>{const{supabase:P}=await Promise.resolve().then(()=>fee);return{supabase:P}},void 0)).supabase.auth.getSession();if(!(k!=null&&k.access_token))return;const C={role:"user",content:j};u(P=>[...P,C]),f(""),p(!0);let E="";const A=P=>{E+=P,u(T=>{const B=T[T.length-1];return(B==null?void 0:B.role)==="assistant"?T.map((F,M)=>M===T.length-1?{...F,content:E}:F):[...T,{role:"assistant",content:E}]})};try{await j4e({messages:[...c,C],businessId:s,accessToken:k.access_token,onDelta:A,onDone:()=>p(!1),onError:P=>{u(T=>[...T,{role:"assistant",content:`⚠️ ${P}`}]),p(!1)}})}catch{u(P=>[...P,{role:"assistant",content:"⚠️ Something went wrong. Please try again."}]),p(!1)}},x=_=>{l(_),u([])},y=((w=n.find(_=>_.id===s))==null?void 0:w.name)||"";return o.jsx(Qn,{children:o.jsxs("div",{className:"flex h-[calc(100vh-8rem)] flex-col lg:h-[calc(100vh-4rem)]",children:[o.jsxs("div",{className:"flex flex-col gap-3 pb-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"font-display text-3xl font-bold text-foreground flex items-center gap-2",children:[o.jsx(b5,{className:"h-7 w-7 text-primary"}),"Review Chat"]}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Ask questions about your reviews using AI"})]}),n.length>0&&o.jsxs(St,{value:s,onValueChange:x,children:[o.jsxs(wt,{className:"w-full sm:w-64",children:[o.jsx(Jr,{className:"mr-2 h-4 w-4 text-muted-foreground"}),o.jsx(kt,{placeholder:"Select business"})]}),o.jsx(_t,{children:n.map(_=>o.jsx(we,{value:_.id,children:_.name},_.id))})]})]}),o.jsxs(pe,{className:"flex flex-1 flex-col overflow-hidden",children:[o.jsxs("div",{ref:g,className:"flex-1 overflow-y-auto p-4 space-y-4",children:[c.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center py-12 space-y-6",children:[o.jsx("div",{className:"rounded-full bg-primary/10 p-5",children:o.jsx(bn,{className:"h-10 w-10 text-primary"})}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-display text-xl font-semibold text-foreground mb-1",children:"Chat with your reviews"}),o.jsxs("p",{className:"text-sm text-muted-foreground max-w-md",children:["Ask anything about ",o.jsx("strong",{className:"text-foreground",children:y||"your business"}),"'s reviews — trends, complaints, praise, or actionable insights."]})]}),o.jsx("div",{className:"grid gap-2 sm:grid-cols-2 max-w-lg w-full",children:S4e.map(_=>o.jsx(X,{variant:"outline",size:"sm",className:"text-xs text-left h-auto py-2.5 px-3 justify-start whitespace-normal",onClick:()=>v(_),children:_},_))})]}):c.map((_,j)=>o.jsxs("div",{className:`flex gap-3 ${_.role==="user"?"justify-end":"justify-start"}`,children:[_.role==="assistant"&&o.jsx("div",{className:"shrink-0 mt-1 rounded-full bg-primary/10 p-1.5",children:o.jsx(_2,{className:"h-4 w-4 text-primary"})}),o.jsx("div",{className:`max-w-[80%] rounded-2xl px-4 py-3 text-sm leading-relaxed ${_.role==="user"?"bg-primary text-primary-foreground rounded-br-md":"bg-muted text-foreground rounded-bl-md"}`,children:_.role==="assistant"?o.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none [&>p]:mb-2 [&>ul]:mb-2 [&>ol]:mb-2",children:o.jsx(v4e,{children:_.content})}):_.content}),_.role==="user"&&o.jsx("div",{className:"shrink-0 mt-1 rounded-full bg-accent p-1.5",children:o.jsx(Wl,{className:"h-4 w-4 text-accent-foreground"})})]},j)),h&&((S=c[c.length-1])==null?void 0:S.role)!=="assistant"&&o.jsxs("div",{className:"flex gap-3",children:[o.jsx("div",{className:"shrink-0 mt-1 rounded-full bg-primary/10 p-1.5",children:o.jsx(_2,{className:"h-4 w-4 text-primary"})}),o.jsx("div",{className:"bg-muted rounded-2xl rounded-bl-md px-4 py-3",children:o.jsx(ke,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]})]}),o.jsx(de,{className:"border-t border-border p-3",children:o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ds,{ref:m,placeholder:s?"Ask about your reviews...":"Select a business first",value:d,onChange:_=>f(_.target.value),onKeyDown:_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),v())},rows:1,className:"min-h-[42px] max-h-32 resize-none text-sm",disabled:!s||h}),o.jsx(X,{size:"icon",className:"shrink-0 h-[42px] w-[42px]",onClick:()=>v(),disabled:!d.trim()||!s||h,children:h?o.jsx(ke,{className:"h-4 w-4 animate-spin"}):o.jsx(ac,{className:"h-4 w-4"})})]})})]})]})})},N4e=Kb.url;function Lf(e){const t=e.getTime()-Date.now();if(t<=0)return"now";const n=Math.floor(t/(1e3*60*60)),r=Math.floor(t%(1e3*60*60)/(1e3*60));return n>0?`${n}h ${r}m`:`${r}m`}const C4e=()=>{const{user:e,loading:t}=Mt(),{businessId:n}=Kk(),[r,i]=rc(),[a,s]=b.useState(null),[l,c]=b.useState(!0),[u,d]=b.useState(""),[f,h]=b.useState(""),[p,g]=b.useState(""),[m,v]=b.useState(""),[x,y]=b.useState(!1),[w,S]=b.useState(!1),[_,j]=b.useState(!1),[k,C]=b.useState(!1),[E,A]=b.useState(!1),[P,T]=b.useState(!1),[B,F]=b.useState(!1),[M,L]=b.useState(!1),[R,$]=b.useState(!1),[O,N]=b.useState(!1),[H,V]=b.useState({google:0,tripadvisor:0,trustpilot:0,getyourguide:0,yelp:0}),[D,K]=b.useState({google:null,tripadvisor:null,trustpilot:null,getyourguide:null,yelp:null}),[ae,se]=b.useState([]),[Q,ne]=b.useState(null),[Z,W]=b.useState(null),[ee,q]=b.useState(!1),[re,ge]=b.useState(!1),Ie=ae.length>0&&!!(Z!=null&&Z.access_token),ye=async U=>{if(!n)return;const[ie,je,at,$r,na]=await Promise.all([Y.from("reviews").select("id",{count:"exact",head:!0}).eq("business_id",n).eq("source","google"),Y.from("reviews").select("id",{count:"exact",head:!0}).eq("business_id",n).eq("source","tripadvisor"),Y.from("reviews").select("id",{count:"exact",head:!0}).eq("business_id",n).eq("source","trustpilot"),Y.from("reviews").select("id",{count:"exact",head:!0}).eq("business_id",n).eq("source","getyourguide"),Y.from("reviews").select("id",{count:"exact",head:!0}).eq("business_id",n).eq("source","yelp")]);V({google:ie.count??0,tripadvisor:je.count??0,trustpilot:at.count??0,get
769yourguide:$r.count??0,yelp:na.count??0});const Un=(U==null?void 0:U.last_synced_at)??(a==null?void 0:a.last_synced_at)??null;K({google:Un,tripadvisor:Un,trustpilot:Un,getyourguide:Un,yelp:Un})};if(b.useEffect(()=>{if(!e||!n)return;(async()=>{const{data:je}=await Y.from("businesses").select("id, name, address, email, phone, website, google_place_id, google_account_name, google_location_name, tripadvisor_url, trustpilot_url, getyourguide_url, yelp_url, sync_status, sync_message, last_synced_at, review_page_logo_url, review_page_description, reply_tone, reply_instructions, apify_run_id, apify_dataset_id, apify_items_imported, created_at, updated_at, user_id").eq("id",n).single();je&&(s(je),d(je.tripadvisor_url||""),h(je.trustpilot_url||""),g(je.getyourguide_url||""),v(je.yelp_url||""),(je.sync_status==="syncing"||je.sync_status==="processing")&&L(!0),ye(je)),c(!1)})();const ie=Y.channel(`business-${n}`).on("postgres_changes",{event:"UPDATE",schema:"public",table:"businesses",filter:`id=eq.${n}`},je=>{var at,$r;console.log("Business updated:",je.new),s(na=>({...na,...je.new})),je.new.tripadvisor_url!==void 0&&d(je.new.tripadvisor_url||""),(((at=je.old)==null?void 0:at.sync_status)==="syncing"||(($r=je.old)==null?void 0:$r.sync_status)==="processing")&&(je.new.sync_status==="idle"?(G.success("Review import complete!"),L(!1),ye()):je.new.sync_status==="error"&&(G.error(je.new.sync_message||"Import failed"),L(!1)))}).subscribe();return()=>{Y.removeChannel(ie)}},[e,n]),b.useEffect(()=>{if(r.get("gmb_source_connected")==="true"&&n){const U=localStorage.getItem("gmb_source_locations"),ie=localStorage.getItem("gmb_source_tokens");U&&ie&&(se(JSON.parse(U)),W(JSON.parse(ie)),localStorage.removeItem("gmb_source_locations"),localStorage.removeItem("gmb_source_tokens"),localStorage.removeItem("gmb_source_business_id")),r.delete("gmb_source_connected"),i(r,{replace:!0})}},[r,i,n]),b.useEffect(()=>{if(!a||!n)return;const U=a.sync_status==="syncing"||a.sync_status==="processing",ie=!!a.apify_run_id;if(!U||!ie)return;L(!0);const je=setInterval(async()=>{try{const{data:at,error:$r}=await Y.functions.invoke("poll-tripadvisor-import",{body:{business_id:n}});if($r){console.error("Poll error:",$r);return}console.log("Poll result:",at),(at==null?void 0:at.status)==="complete"?(G.success(`Import complete! ${at.totalImported} reviews imported.`),L(!1),ye(),clearInterval(je)):(at==null?void 0:at.status)==="error"?(G.error(`Import failed: ${at.runStatus}`),L(!1),clearInterval(je)):(at==null?void 0:at.newItems)>0&&ye()}catch(at){console.error("Poll error:",at)}},5e3);return()=>clearInterval(je)},[a==null?void 0:a.sync_status,a==null?void 0:a.apify_run_id,n]),t)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});if(!e)return o.jsx(Yi,{to:"/login",replace:!0});const qe=async()=>{if(!n)return;if(ot("tripadvisor",u)){G.error(ot("tripadvisor",u));return}const U=!(a!=null&&a.tripadvisor_url)&&u.trim();F(!0);const{error:ie}=await Y.from("businesses").update({tripadvisor_url:u||null}).eq("id",n);F(!1),ie?G.error("Failed to save TripAdvisor URL"):(G.success("TripAdvisor URL saved"),s(je=>({...je,tripadvisor_url:u||null})),u&&n&&Lc(n,"tripadvisor",u),U&&Ee())},jt=async()=>{if(!n)return;if(ot("trustpilot",f)){G.error(ot("trustpilot",f));return}const U=!(a!=null&&a.trustpilot_url)&&f.trim();j(!0);const{error:ie}=await Y.from("businesses").update({trustpilot_url:f||null}).eq("id",n);j(!1),ie?G.error("Failed to save Trustpilot URL"):(G.success("Trustpilot URL saved"),s(je=>({...je,trustpilot_url:f||null})),f&&n&&Lc(n,"trustpilot",f),U&&pt())},pt=async()=>{A(!0);try{const{data:U,error:ie}=await Y.functions.invoke("fetch-trustpilot-reviews",{body:{business_id:n}});if(ie)throw ie;(U==null?void 0:U.status)==="started"?(G.info("Trustpilot import started! Reviews will stream in as they're found."),L(!0)):G.success(`Synced ${U.total} Trustpilot reviews`)}catch(U){console.error("Trustpilot sync error:",U),G.error("Failed to sync Trustpilot reviews")}finally{A(!1)}},rn=async()=>
769{if(!n)return;if(ot("yelp",m)){G.error(ot("yelp",m));return}const U=!(a!=null&&a.yelp_url)&&m.trim();y(!0);const{error:ie}=await Y.from("businesses").update({yelp_url:m||null}).eq("id",n);y(!1),ie?G.error("Failed to save Yelp URL"):(G.success("Yelp URL saved"),s(je=>({...je,yelp_url:m||null})),m&&n&&Lc(n,"yelp",m),U&&Wt())},Wt=async()=>{S(!0);try{const{data:U,error:ie}=await Y.functions.invoke("fetch-yelp-reviews",{body:{business_id:n}});if(ie)throw ie;(U==null?void 0:U.status)==="started"?(G.info("Yelp import started! Reviews will stream in as they're found."),L(!0)):(U==null?void 0:U.status)==="already_syncing"?G.info("A sync is already running for this business."):U!=null&&U.error?G.error(U.error):G.success("Yelp sync started")}catch(U){console.error("Yelp sync error:",U),G.error("Failed to sync Yelp reviews")}finally{S(!1)}},Sn=async()=>{if(!n)return;if(ot("getyourguide",p)){G.error(ot("getyourguide",p));return}const U=!(a!=null&&a.getyourguide_url)&&p.trim();C(!0);const{error:ie}=await Y.from("businesses").update({getyourguide_url:p||null}).eq("id",n);C(!1),ie?G.error("Failed to save GetYourGuide URL"):(G.success("GetYourGuide URL saved"),s(je=>({...je,getyourguide_url:p||null})),p&&n&&Lc(n,"getyourguide",p),U&&mt())},mt=async()=>{T(!0);try{const{data:U,error:ie}=await Y.functions.invoke("fetch-getyourguide-reviews",{body:{business_id:n}});if(ie)throw ie;(U==null?void 0:U.status)==="started"?(G.info("GetYourGuide import started! Reviews will stream in as they're found."),L(!0)):G.success(`Synced ${U.total} GetYourGuide reviews`)}catch(U){console.error("GetYourGuide sync error:",U),G.error("Failed to sync GetYourGuide reviews")}finally{T(!1)}},Ee=async()=>{if(!(a!=null&&a.tripadvisor_url)){G.error("Add a TripAdvisor URL first");return}L(!0);try{const{data:U,error:ie}=await Y.functions.invoke("fetch-tripadvisor-reviews",{body:{business_id:n}});if(ie)throw ie;(U==null?void 0:U.status)==="started"?G.info("Import started! Reviews will stream in as they're found."):(G.success(`Synced ${U.total} reviews`),L(!1))}catch(U){console.error("TripAdvisor sync error:",U),G.error("Failed to sync TripAdvisor reviews"),L(!1)}},Gt=async()=>{$(!0);try{const{data:U,error:ie}=await Y.functions.invoke("fetch-google-reviews",{body:{business_id:n}});if((U==null?void 0:U.code)==="missing_oauth_tokens"){n&&(await ES(n),s(je=>je&&{...je,google_place_id:null,google_account_name:null,google_location_name:null})),G.error("Google connection lost. Please reconnect it.",{duration:7e3});return}if(ie)throw ie;G.success(`Synced ${U.total} reviews (${U.inserted} new, ${U.updated} updated)`)}catch(U){if(console.error("Google sync error:",U),n&&await s9(U)){await ES(n),s(ie=>ie&&{...ie,google_place_id:null,google_account_name:null,google_location_name:null}),G.error("Google connection lost. Please reconnect it.",{duration:7e3});return}G.error("Failed to sync Google reviews")}finally{$(!1)}},J=async()=>{N(!0);try{const{data:{session:U}}=await Y.auth.getSession();if(!U){G.error("Please sign in first");return}const ie=`${window.location.origin}/google-business-callback`,{data:je,error:at}=await Y.functions.invoke("google-business-auth-url",{body:{redirect_uri:ie,business_name:(a==null?void 0:a.name)||""}});if(at)throw at;je!=null&&je.url&&(localStorage.setItem("gmb_source_business_id",n),localStorage.setItem("gmb_redirect_uri",ie),localStorage.setItem("gmb_business_name",(a==null?void 0:a.name)||""),window.location.href=je.url)}catch(U){console.error("Error starting Google OAuth:",U),G.error("Failed to connect to Google. Please try again.")}finally{N(!1)}},le=async()=>{if(!(!Q||!n||!Z)){q(!0);try{if(!Z.access_token)throw new Error("Google did not return an access token. Please try connecting again.");const{error:U}=await Y.from("business_oauth_tokens").delete().eq("business_id",n);if(U)throw console.error("Failed to clear previous Google OAuth tokens:",U),new Error(`Failed to reset previous Google credentials: ${U.message}`);const{error:ie}=await Y.from("business_oauth_tokens").insert({business_id:n,google_access_token:Z.access_token,google_refresh_token:Z.refresh_token||null});if(ie)throw console.error("Failed to save Google OAuth tokens:",ie),new Error(`Failed to save Google credentials: ${ie.message}`);const{error:je}=await Y.from("businesses").update({google_place_id:Q.placeId||"",google_account_name:Q.accountName,google_location_name:Q.locationName,address:Q.address||(a==null?void 0:a.address)||""}).eq("id",n);if(je)throw je;s(at=>({...at,google_place_id:Q.placeId,google_account_name:Q.accountName,google_location_name:Q.locationName})),se([]),ne(null),W(null),G.success("Google Business connected! Fetching reviews..."),Q.placeId&&Lc(n,"google",`https://search.google.com/local/writereview?placeid=${Q.placeId}`),G.info("Press Sync to import your Google reviews.",{duration:6e3})}catch(U){console.error("Failed to save Google location:",U),G.error("Failed to link Google location")}finally{q(!1)}}},Ae=async()=>
769{if(n){ge(!0);try{const{error:U}=await Y.from("businesses").update({google_place_id:null,google_account_name:null,google_location_name:null}).eq("id",n);if(U)throw U;await Y.from("business_oauth_tokens").delete().eq("business_id",n),s(ie=>({...ie,google_place_id:null,google_account_name:null,google_location_name:null})),G.success("Google Business disconnected")}catch(U){console.error("Failed to disconnect Google:",U),G.error("Failed to disconnect Google")}finally{ge(!1)}}},Ve=!!(a!=null&&a.tripadvisor_url),Ze=!!(a!=null&&a.trustpilot_url),cn=!!(a!=null&&a.getyourguide_url),Bn=!!(a!=null&&a.yelp_url),mn=!!(a!=null&&a.google_location_name)&&!Ie,An=6*60*60*1e3,Ct=U=>{const ie=D[U]?new Date(D[U]):null;return a!=null&&a.last_synced_at&&new Date(a.last_synced_at),ie?Date.now()-ie.getTime()>An:!0},it=U=>{const ie=D[U]?new Date(D[U]):null;return ie?new Date(ie.getTime()+An):null};return o.jsx(Qn,{children:o.jsxs("div",{className:"space-y-6 max-w-2xl",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(on,{to:"/businesses",children:o.jsx(X,{variant:"ghost",size:"icon",className:"h-8 w-8",children:o.jsx(f5,{className:"h-4 w-4"})})}),o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-2xl font-bold text-foreground",children:"Review Sources"}),a&&o.jsx("p",{className:"text-sm text-muted-foreground",children:a.name})]})]}),l?o.jsx("div",{className:"flex h-40 items-center justify-center text-muted-foreground",children:"Loading..."}):a?o.jsxs("div",{className:"space-y-4",children:[(a.sync_status==="syncing"||a.sync_status==="processing")&&o.jsx(pe,{className:"border-primary/30 bg-primary/5",children:o.jsxs(de,{className:"p-4 flex items-center gap-3",children:[o.jsx(ke,{className:"h-5 w-5 animate-spin text-primary shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Import in progress"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.sync_message||"Importing reviews..."})]})]})}),a.sync_status==="error"&&o.jsx(pe,{className:"border-destructive/30 bg-destructive/5",children:o.jsxs(de,{className:"p-4 flex items-center gap-3",children:[o.jsx("span",{className:"text-destructive text-lg shrink-0",children:"⚠"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Import failed"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.sync_message||"An error occurred during import."})]}),o.jsx(X,{size:"sm",variant:"outline",onClick:()=>{const U=(a.sync_message||"").toLowerCase();U.includes("yelp")?Wt():U.includes("getyourguide")||U.includes("gyg")?mt():U.includes("trustpilot")?pt():a.tripadvisor_url?Ee():a.getyourguide_url?mt():a.trustpilot_url?pt():a.yelp_url?Wt():G.error("No source configured to retry")},children:"Retry"})]})}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:o.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",children:[o.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),o.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),o.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),o.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})}),o.jsxs("div",{children:[o.jsx(We,{className:"text-base",children:"Google Business Profile"}),o.jsx(ft,{className:"text-xs",children:"Reviews from Google Maps"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[H.google>0&&o.jsxs(Se,{variant:"secondary",className:"text-xs",children:[H.google.toLocaleStr
769ing()," reviews"]}),mn?o.jsxs(Se,{className:"bg-success/10 text-success border-success/20 gap-1",children:[o.jsx(ar,{className:"h-3 w-3"}),"Connected"]}):o.jsx(Se,{variant:"secondary",className:"text-muted-foreground",children:"Not connected"})]})]})}),o.jsx(de,{className:"pt-0",children:mn?o.jsxs("div",{className:"space-y-2",children:[D.google&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[o.jsx(pf,{className:"h-3 w-3"}),"Last synced ",Tf(new Date(D.google),{addSuffix:!0})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(Tc,{children:o.jsxs(vf,{children:[o.jsx(yf,{asChild:!0,children:o.jsx("span",{children:o.jsxs(X,{size:"sm",variant:"outline",onClick:Gt,disabled:R||!Ct("google"),children:[R?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):o.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),Ct("google")?"Sync Reviews":"Synced Today"]})})}),!Ct("google")&&it("google")&&o.jsx(Rc,{children:o.jsxs("p",{children:["Next sync available in ",Lf(it("google"))]})})]})}),a.google_place_id&&o.jsx(X,{size:"sm",variant:"ghost",asChild:!0,children:o.jsxs("a",{href:`https://search.google.com/local/reviews?placeid=${a.google_place_id}`,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(sr,{className:"mr-1.5 h-3.5 w-3.5"}),"View"]}
769)}),o.jsxs(X,{size:"sm",variant:"outline",onClick:J,disabled:O,children:[O?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):o.jsx(zK,{className:"mr-1.5 h-3.5 w-3.5"}),"Reconnect"]}),o.jsxs(Zb,{children:[o.jsx(kz,{asChild:!0,children:o.jsxs(X,{size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",disabled:re,children:[re?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):o.jsx(GK,{className:"mr-1.5 h-3.5 w-3.5"}),"Disconnect"]})}),o.jsxs(km,{children:[o.jsxs(Nm,{children:[o.jsx(Em,{children:"Disconnect Google Business?"}),o.jsx(Pm,{children:"This will unlink your Google Business Profile. Previously imported reviews will remain, but new reviews won't sync until you reconnect."})]}),o.jsxs(Cm,{children:[o.jsx(Am,{children:"Cancel"}),o.jsx(Om,{onClick:Ae,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]})]})]})]}):ae.length>0?o.jsxs("div",{className:"space-y-3",children:[o.jsx("p",{className:"text-sm text-muted-foreground",children:"Select the Google Business location to link:"}),o.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:ae.map((U,ie)=>o.jsx(pe,{className:`cursor-pointer transition-colors ${Q===U?"border-primary bg-primary/5":"hover:border-primary/50"}`,onClick:()=>ne(U),children:o.jsxs(de,{className:"p-3 flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"font-medium text-sm text-foreground truncate",children:U.title}),U.address&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-0.5",children:[o.jsx(Id,{className:"h-3 w-3 shrink-0"}),o.jsx("span",{className:"truncate",children:U.address})]})]}),Q===U&&o.jsx(ar,{className:"h-5 w-5 text-primary shrink-0"})]})},ie))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(X,{size:"sm",onClick:le,disabled:!Q||ee,children:[ee&&o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Link Location"]}),o.jsx(X,{size:"sm",variant:"outline",onClick:()=>{se([]),ne(null),W(null)},children:"Cancel"})]})]}):o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Connect your Google Business Profile to import and reply to reviews directly."}),o.jsxs(X,{size:"sm",onClick:J,disabled:O,children:[O&&o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Connect with Google"]})]})})]}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"rounded-lg bg-emerald-500/10 p-2",children:o.jsx("img",{src:N4e,alt:"TripAdvisor",className:"h-5 w-5"})}),o.jsxs("div",{children:[o.jsx(We,{className:"text-base",children:"TripAdvisor"}),o.jsx(ft,{className:"text-xs",children:"Reviews from TripAdvisor listings"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[H.tripadvisor>0&&o.jsxs(Se,{variant:"secondary",className:"text-xs",children:[H.tripadvisor.toLocaleString()," reviews"]}),Ve?o.jsxs(Se,{className:"bg-success/10 text-success border-success/20 gap-1",children:[o.jsx(ar,{className:"h-3 w-3"}),"Configured"]}):o.jsx(Se,{variant:"secondary",className:"text-muted-foreground",children:"Not set up"})]})]})}),o.jsxs(de,{className:"space-y-3 pt-0",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-foreground",children:"Activity / Listing URL"}),o.jsx(Te,{placeholder:"https://www.tripadvisor.com/Restaurant_Review-...",value:u,onChange:U=>d(U.target.value)}),ot("tripadvisor",u)?o.jsx("p",{className:"text-xs text-destructive",children:ot("tripadvisor",u)}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste the full TripAdvisor URL for your hotel, restaurant, or attraction."})]}),D.tripadvisor&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[o.jsx(pf,{className:"h-3 w-3"}),"Last synced ",Tf(new Date(D.tripadvisor),{addSuffix:!0})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(X,{size:"sm",onClick:qe,disabled:B||!!ot("tripadvisor",u),children:[B?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,"Save URL"]}),Ve&&o.jsx(Tc,{children:o.jsxs(vf,{children:[o.jsx(yf,{asChild:!0,children:o.jsx("span",{children:o.jsxs(X,{size:"sm",variant:"outline",onClick:Ee,disabled:M||!Ct("tripadvisor"),children:[M?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):o.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),Ct("tripadvisor")?"Sync Reviews":"Synced Today"]})})}),!Ct("tripadvisor")&&it("tripadvisor")&&o.jsx(Rc,{children:o.jsxs("p",{children:["Next sync available in ",Lf(it("tripadvisor"))]})})]})}),Ve&&o.jsx(X,{size:"sm",variant:"ghost",asChild:!0,children:o.jsxs("a",{href:a.tripadvisor_url,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(sr,{className:"mr-1.5 h-3.5 w-3.5"}),"View"]}
769)})]})]})]}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"rounded-lg p-2",style:{backgroundColor:"#00B67A1A"},children:o.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M12 1.5l2.76 6.53L22 8.9l-5 5.27L18.18 22 12 18.27 5.82 22 7 14.17 2 8.9l7.24-.87L12 1.5z",fill:"#00B67A"})})}),o.jsxs("div",{children:[o.jsx(We,{className:"text-base",children:"Trustpilot"}),o.jsx(ft,{className:"text-xs",children:"Reviews from Trustpilot"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[H.trustpilot>0&&o.jsxs(Se,{variant:"secondary",className:"text-xs",children:[H.trustpilot.toLocaleString()," reviews"]}),Ze?o.jsxs(Se,{className:"bg-success/10 text-success border-success/20 gap-1",children:[o.jsx(ar,{className:"h-3 w-3"}),"Configured"]}):o.jsx(Se,{variant:"secondary",className:"text-muted-foreground",children:"Not set up"})]})]})}),o.jsxs(de,{className:"space-y-3 pt-0",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-foreground",children:"Business Page URL"}),o.jsx(Te,{placeholder:"https://www.trustpilot.com/review/example.com",value:f,onChange:U=>h(U.target.value)}),ot("trustpilot",f)?o.jsx("p",{className:"text-xs text-destructive",children:ot("trustpilot",f)}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste your Trustpilot business review page URL."})]}),D.trustpilot&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[o.jsx(pf,{className:"h-3 w-3"}),"Last synced ",Tf(new Date(D.trustpilot),{addSuffix:!0})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(X,{size:"sm",onClick:jt,disabled:_||!!ot("trustpilot",f),children:[_?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,"Save URL"]}),Ze&&o.jsx(Tc,{children:o.jsxs(vf,{children:[o.jsx(yf,{asChild:!0,children:o.jsx("span",{children:o.jsxs(X,{size:"sm",variant:"outline",onClick:pt,disabled:E||!Ct("trustpilot"),children:[E?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):o.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),Ct("trustpilot")?"Sync Reviews":"Synced Today"]})})}),!Ct("trustpilot")&&it("trustpilot")&&o.jsx(Rc,{children:o.jsxs("p",{children:["Next sync available in ",Lf(it("trustpilot"))]})})]})}),Ze&&o.jsx(X,{size:"sm",variant:"ghost",asChild:!0,children:o.jsxs("a",{href:a.trustpilot_url,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(sr,{className:"mr-1.5 h-3.5 w-3.5"}),"View"]}
769)})]})]})]}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"rounded-lg p-2",style:{backgroundColor:"#FF55331A"},children:o.jsx("span",{className:"text-lg font-bold leading-none",style:{color:"#FF5533"},children:"G"})}),o.jsxs("div",{children:[o.jsx(We,{className:"text-base",children:"GetYourGuide"}),o.jsx(ft,{className:"text-xs",children:"Reviews from GetYourGuide activities"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[H.getyourguide>0&&o.jsxs(Se,{variant:"secondary",className:"text-xs",children:[H.getyourguide.toLocaleString()," reviews"]}),cn?o.jsxs(Se,{className:"bg-success/10 text-success border-success/20 gap-1",children:[o.jsx(ar,{className:"h-3 w-3"}),"Configured"]}):o.jsx(Se,{variant:"secondary",className:"text-muted-foreground",children:"Not set up"})]})]})}),o.jsxs(de,{className:"space-y-3 pt-0",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-foreground",children:"Activity URL"}),o.jsx(Te,{placeholder:"https://www.getyourguide.com/activity-t12345/",value:p,onChange:U=>g(U.target.value)}),ot("getyourguide",p)?o.jsx("p",{className:"text-xs text-destructive",children:ot("getyourguide",p)}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste the full GetYourGuide activity page URL."})]}),D.getyourguide&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[o.jsx(pf,{className:"h-3 w-3"}),"Last synced ",Tf(new Date(D.getyourguide),{addSuffix:!0})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(X,{size:"sm",onClick:Sn,disabled:k||!!ot("getyourguide",p),children:[k?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,"Save URL"]}),cn&&o.jsx(Tc,{children:o.jsxs(vf,{children:[o.jsx(yf,{asChild:!0,children:o.jsx("span",{children:o.jsxs(X,{size:"sm",variant:"outline",onClick:mt,disabled:P||!Ct("getyourguide"),children:[P?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):o.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),Ct("getyourguide")?"Sync Reviews":"Synced Today"]})})}),!Ct("getyourguide")&&it("getyourguide")&&o.jsx(Rc,{children:o.jsxs("p",{children:["Next sync available in ",Lf(it("getyourguide"))]})})]})}),cn&&o.jsx(X,{size:"sm",variant:"ghost",asChild:!0,children:o.jsxs("a",{href:a.getyourguide_url,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(sr,{className:"mr-1.5 h-3.5 w-3.5"}),"View"]}
769)})]})]})]}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"rounded-lg p-2",style:{backgroundColor:"#D323231A"},children:o.jsx("span",{className:"text-lg font-bold leading-none",style:{color:"#D32323"},children:"Y"})}),o.jsxs("div",{children:[o.jsx(We,{className:"text-base",children:"Yelp"}),o.jsx(ft,{className:"text-xs",children:"Reviews from your Yelp business page"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[H.yelp>0&&o.jsxs(Se,{variant:"secondary",className:"text-xs",children:[H.yelp.toLocaleString()," reviews"]}),Bn?o.jsxs(Se,{className:"bg-success/10 text-success border-success/20 gap-1",children:[o.jsx(ar,{className:"h-3 w-3"}),"Configured"]}):o.jsx(Se,{variant:"secondary",className:"text-muted-foreground",children:"Not set up"})]})]})}),o.jsxs(de,{className:"space-y-3 pt-0",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-foreground",children:"Business page URL"}),o.jsx(Te,{placeholder:"https://www.yelp.com/biz/your-business",value:m,onChange:U=>v(U.target.value)}),ot("yelp",m)?o.jsx("p",{className:"text-xs text-destructive",children:ot("yelp",m)}
769):o.jsx("p",{className:"text-xs text-muted-foreground",children:"Paste the full Yelp business page URL."})]}),D.yelp&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[o.jsx(pf,{className:"h-3 w-3"}),"Last synced ",Tf(new Date(D.yelp),{addSuffix:!0})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(X,{size:"sm",onClick:rn,disabled:x||!!ot("yelp",m),children:[x?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):null,"Save URL"]}),Bn&&o.jsx(Tc,{children:o.jsxs(vf,{children:[o.jsx(yf,{asChild:!0,children:o.jsx("span",{children:o.jsxs(X,{size:"sm",variant:"outline",onClick:Wt,disabled:w||!Ct("yelp"),children:[w?o.jsx(ke,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):o.jsx(zi,{className:"mr-1.5 h-3.5 w-3.5"}),Ct("yelp")?"Sync Reviews":"Synced Today"]})})}),!Ct("yelp")&&it("yelp")&&o.jsx(Rc,{children:o.jsxs("p",{children:["Next sync available in ",Lf(it("yelp"))]})})]})}),Bn&&o.jsx(X,{size:"sm",variant:"ghost",asChild:!0,children:o.jsxs("a",{href:a.yelp_url,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(sr,{className:"mr-1.5 h-3.5 w-3.5"}),"View"]}
769)})]})]})]})]}):o.jsx("p",{className:"text-muted-foreground",children:"Business not found."}),o.jsxs("div",{className:"mt-6 rounded-lg border border-border bg-muted/50 p-4 text-center text-sm text-muted-foreground",children:["Can't find a review source you need?"," ",o.jsx("a",{href:"https://reviewkit.com/support",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary underline underline-offset-4 hover:text-primary/80",children:"Let us know"})," ","and we'll add it for you."]})]})})},S7=[{code:"USD",symbol:"$",price:45,label:"USD",priceId:"price_1TGy7tHXJhlq0Pk7A65EQ2a4"},{code:"GBP",symbol:"£",price:35,label:"GBP",priceId:"price_1TAvzgHXJhlq0Pk7wrLtzBVd"},{code:"EUR",symbol:"€",price:40,label:"EUR",priceId:"price_1TGy7xHXJhlq0Pk7H8pzZcr0"}];function E4e(e){return S7.find(t=>t.code===e)}function P4e(){try{const e=navigator.languages??[navigator.language];for(const t of e){if(t.startsWith("en-GB")||t.startsWith("en-IE"))return"GBP";if(t.startsWith("de")||t.startsWith("fr")||t.startsWith("es")||t.startsWith("it")||t.startsWith("nl")||t.startsWith("pt"))return"EUR"}}catch{}return"USD"}const O4e=P4e(),A4e=()=>{const{subscription:e,refreshSubscription:t}=Mt(),{businesses:n}=Lo(),[r,i]=b.useState(!1),[a,s]=b.useState(!1),[l,c]=b.useState(!1),[u]=rc(),[d,f]=b.useState(O4e),h=E4e(d),p=!e.subscribed&&!e.trialing&&!e.hadTrial,g=!e.subscribed&&!e.trialing&&e.hadTrial;b.useEffect(()=>{u.get("checkout")==="success"&&(G.success("Subscription activated! It may take a moment to reflect."),t())},[u,t]);const m=async(y=!1)=>{i(!0);try{const w={priceId:h.priceId};y&&(w.trialDays=7);const{data:S,error:_}=await Y.functions.invoke("create-checkout",{body:w});if(_)throw _;S!=null&&S.url&&window.open(S.url,"_blank")}catch{G.error("Failed to start checkout")}finally{i(!1)}},v=async y=>{y(!0);try{const{data:w,error:S}=await Y.functions.invoke("customer-portal");if(S)throw S;w!=null&&w.url&&window.open(w.url,"_blank")}catch{G.error("Failed to open billing portal")}finally{y(!1)}},x=()=>o.jsx("div",{className:"inline-flex items-center rounded-lg border border-border bg-muted/50 p-0.5",children:S7.map(y=>o.jsxs("button",{onClick:()=>f(y.code),className:`px-3 py-1.5 text-xs font-medium rounded-md transition-all ${d===y.code?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}
769`,children:[y.symbol," ",y.label]},y.code))});return o.jsxs("div",{className:"space-y-4",children:[e.trialing&&o.jsxs(pe,{className:"border-primary bg-primary/5",children:[o.jsxs(ze,{children:[o.jsxs(We,{className:"flex items-center gap-2",children:[o.jsx(bn,{className:"h-5 w-5 text-primary"}),"You're on a Free Trial"]}),o.jsx(ft,{children:e.trialEnd?o.jsxs(o.Fragment,{children:["Your trial ends on"," ",o.jsx("span",{className:"font-semibold text-foreground",children:new Date(e.trialEnd).toLocaleDateString()}),". Add a plan now to keep your account active — you won't be charged until the trial ends."]}):o.jsx(o.Fragment,{children:"Add a plan now to keep your account active after your trial ends."})})]}),o.jsxs(de,{className:"space-y-3",children:[o.jsx(x,{}),o.jsxs(X,{onClick:()=>m(!1),disabled:r,children:[r&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Upgrade to ",If.name," — ",h.symbol,h.price,"/location/month"]})]})]}),e.subscribed&&!e.trialing&&o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsxs(We,{className:"flex items-center gap-2",children:[o.jsx(Fv,{className:"h-5 w-5"}),"Current Plan"]}),o.jsxs(ft,{children:["You're on"," ",o.jsx("span",{className:"font-semibold text-foreground",children:If.name}),e.trialing&&e.trialEnd&&o.jsxs(o.Fragment,{children:[" · Trial ends ",new Date(e.trialEnd).toLocaleDateString()]}),!e.trialing&&e.subscriptionEnd&&o.jsxs(o.Fragment,{children:[" · Renews ",new Date(e.subscriptionEnd).toLocaleDateString()]})]})]}),o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/50 px-4 py-3 text-sm",children:[o.jsx(Id,{className:"h-4 w-4 text-muted-foreground shrink-0"}),o.jsxs("span",{className:"text-muted-foreground",children:["You're currently billed for"," ",o.jsxs("span",{className:"font-semibold text-foreground",children:[n.length," location",n.length!==1?"s":""]})," ","at ",h.symbol,h.price,"/location/month"," ","(",h.symbol,n.length*h.price,"/month total)"]})]}),o.jsx(x,{}),o.jsxs("div",{className:"flex flex-wrap gap-3",children:[o.jsxs(X,{onClick:()=>v(s),disabled:a,variant:"outline",children:[a?o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}):o.jsx(sr,{className:"mr-2 h-4 w-4"}),"Manage Subscription"]}),o.jsxs(X,{onClick:()=>v(c),disabled:l,variant:"outline",children:[l?o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}):o.jsx(UK,{className:"mr-2 h-4 w-4"}),"View Past Receipts"]})]})]})]}),!e.subscribed&&!e.trialing&&o.jsxs(pe,{className:p?"border-primary bg-primary/5":"",children:[o.jsxs(ze,{children:[o.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[o.jsx(We,{className:"flex items-center gap-2",children:p?o.jsxs(o.Fragment,{children:[o.jsx(bn,{className:"h-5 w-5 text-primary"}),"Start Your 7-Day Free Trial"]}):o.jsxs(o.Fragment,{children:[o.jsx(Fv,{className:"h-5 w-5"}),"Subscribe to ",If.name]})}),o.jsx(x,{})]}),o.jsx(ft,{children:p?"Try ReviewKit free for 7 days. Your card won't be charged until the trial ends — cancel anytime.":g?"Your free trial has ended. Subscribe to reactivate your account and keep syncing reviews.":"Get access to all features with a simple per-location plan."})]}),o.jsx(de,{children:o.jsxs("div",{className:"rounded-lg border border-border bg-background p-6 space-y-4 max-w-md",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("h3",{className:"font-semibold text-foreground text-lg",children:If.name}),o.jsx(Se,{variant:"secondary",className:"text-xs",children:"All Features"})]}),o.jsxs("p",{className:"mt-1",children:[o.jsxs("span",{className:"text-3xl font-bold text-foreground",children:[h.symbol,h.price]}),o.jsx("span",{className:"text-muted-foreground",children:"/location/month"})]}),p&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"after 7-day free trial"})]}),o.jsx("ul",{className:"space-y-2",children:If.features.map(y=>o.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[o.jsx(To,{className:"h-4 w-4 text-primary shrink-0"}),o.jsx("span",{className:"text-muted-foreground",children:y})]},y))}),o.jsxs(X,{className:"w-full",onClick:()=>m(p),disabled:r,children:[r&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),p?"Start Free Trial":"Subscribe Now"]})]})})]})]})},T4e=()=>{const{user:e}=Mt(),t=_i(),{data:n=[],isLoading:r}=Na({queryKey:["team-members",e==null?void 0:e.id],queryFn:async()=>{const{data:s,error:l}=await Y.from("team_members").select("*").eq("owner_id",e.id).order("created_at",{ascending:!1});if(l)throw l;return s},enabled:!!e}),i=u_({mutationFn:async s=>{const{data:l,error:c}=await Y.functions.invoke("send-team-invite",{body:{email:s}});if(c)throw c;if(l!=null&&l.error)throw new Error(l.error);return l},onSuccess:()=>{G.success("Invitation sent!"),t.invalidateQueries({queryKey:["team-members"]})},onError:s=>{G.error(s.message||"Failed to send invitation")}}),a=u_({mutationFn:async s=>{const{error:l}=await Y.from("team_members").delete().eq("id",s).eq("owner_id",e.id);if(l)throw l},onSuccess:()=>{G.success("Team member removed"),t.invalidateQueries({queryKey:["team-members"]})},onError:()=>{G.error("Failed to remove team member")}});return{members:n,isLoading:r,inviteMember:i,removeMember:a}},R4e=()=>{const[e,t]=b.useState(""),{user:n,isTeamMember:r}=Mt(),{members:i,isLoading:a,inviteMember:s,removeMember:l}=T4e(),{data:c=[],isLoading:u}=Na({queryKey:["my-team-memberships",n==null?void 0:n.id],queryFn:async()=>{const{data:f,error:h}=await Y.from("team_members").select("id, owner_id, role, status, accepted_at").eq("member_id",n.id).eq("status","accepted");if(h)throw h;if(!f||f.length===0)return[];const p=f.map(m=>m.owner_id),{data:g}=await Y.from("profiles").select("user_id, display_name").in("user_id",p);return f.map(m=>{var v;return{...m,ownerName:((v=g==null?void 0:g.find(x=>x.user_id===m.owner_id))==null?void 0:v.display_name)||"Team Owner"}})},enabled:!!n&&r}),d=f=>{f.preventDefault(),e.trim()&&s.mutate(e.trim().toLowerCase(),{onSuccess:()=>t("")})};return o.jsxs("div",{className:"space-y-4",children:[r&&o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsxs(We,{className:"flex items-center gap-2",children:[o.jsx(Ax,{className:"h-5 w-5"}),"Your Team Memberships"]}),o.jsx(ft,{children:"Teams you've been invited to"})]}),o.jsx(de,{children:u?o.jsx("div",{className:"flex justify-center py-6",children:o.jsx(ke,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):c.length===0?o.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No active team memberships"}):o.jsx("div",{className:"space-y-3",children:c.map(f=>o.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-medium uppercase text-primary",children:(f.ownerName||"T").charAt(0)}),o.jsxs("div",{className:"min-w-0",children:[o.jsxs("p",{className:"text-sm font-medium",children:[f.ownerName||"Team Owner","'s team"]}),o.jsx("p",{className:"text-xs text-muted-foreground capitalize",children:f.role})]})]}),o.jsx(Se,{variant:"default",className:"text-xs",children:"Active"})]},f.id))})})]}),!r&&o.jsxs(o.Fragment,{children:[o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsxs(We,{className:"flex items-center gap-2",children:[o.jsx(KK,{className:"h-5 w-5"}),"Invite Team Member"]}),o.jsx(ft,{children:"Add people to your account so they can view and manage your reviews"})]}),o.jsx(de,{children:o.jsxs("form",{onSubmit:d,className:"flex gap-2",children:[o.jsxs("div",{className:"flex-1",children:[o.jsx(Pe,{htmlFor:"invite-email",className:"sr-only",children:"Email"}
769),o.jsx(Te,{id:"invite-email",type:"email",value:e,onChange:f=>t(f.target.value),placeholder:"[email protected]",disabled:s.isPending})]}),o.jsxs(X,{type:"submit",disabled:s.isPending||!e.trim(),children:[s.isPending?o.jsx(ke,{className:"h-4 w-4 animate-spin"}):o.jsx(as,{className:"h-4 w-4"}),o.jsx("span",{className:"ml-1.5 hidden sm:inline",children:"Send Invite"})]})]})})]}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{children:"Team Members"}),o.jsx(ft,{children:i.length===0?"No team members yet":`${i.length} member${i.length!==1?"s":""}`})]}),o.jsx(de,{children:a?o.jsx("div",{className:"flex justify-center py-6",children:o.jsx(ke,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):i.length===0?o.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"Invite someone to get started"}):o.jsx("div",{className:"space-y-3",children:i.map(f=>o.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[o.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium uppercase text-muted-foreground",children:f.email.charAt(0)}),o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:f.email}),o.jsx("p",{className:"text-xs text-muted-foreground capitalize",children:f.role})]})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.jsx(Se,{variant:f.status==="accepted"?"default":"secondary",className:"text-xs",children:f.status==="accepted"?"Active":"Pending"}),o.jsx(X,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:()=>l.mutate(f.id),disabled:l.isPending,children:o.jsx(Md,{className:"h-4 w-4"})})]})]},f.id))})})]})]})]})},I4e=()=>{const{user:e,isTeamMember:t}=Mt(),[n]=rc(),r=n.get("tab")||"profile",[i,a]=b.useState(""),[s,l]=b.useState(""),[c,u]=b.useState(!0),[d,f]=b.useState(!1),[h,p]=b.useState(""),[g,m]=b.useState(!1),[v,x]=b.useState(""),[y,w]=b.useState(""),[S,_]=b.useState(!1),[j,k]=b.useState(!0),[C,E]=b.useState(!0),[A,P]=b.useState(!1),[T,B]=b.useState(!0),[F,M]=b.useState(!1);b.useEffect(()=>{e&&(Y.from("profiles").select("display_name, avatar_url").eq("user_id",e.id).single().then(({data:N})=>{N&&(a(N.display_name||""),l(N.avatar_url||"")),u(!1)}),Y.from("notification_preferences").select("*").eq("user_id",e.id).single().then(({data:N})=>{N&&(k(N.new_review_email),E(N.negative_review_email),P(N.weekly_digest)),B(!1)}))},[e]);const L=async()=>{if(!e)return;f(!0);const{error:N}=await Y.from("profiles").update({display_name:i,avatar_url:s}).eq("user_id",e.id);f(!1),N?G.error("Failed to update profile"):G.success("Profile updated")},R=async()=>{if(!h||h===(e==null?void 0:e.email)){G.error("Please enter a different email address");return}m(!0);const{error:N}=await Y.auth.updateUser({email:h});m(!1),N?G.error(N.message):(G.success("Confirmation email sent to your new address. Please check your inbox."),p(""))},$=async()=>{if(v.length<6){G.error("Password must be at least 6 characters");return}if(v!==y){G.error("Passwords do not match");return}_(!0);const{error:N}=await Y.auth.updateUser({password:v});_(!1),N?G.error(N.message):(G.success("Password updated"),x(""),w(""))},O=async()=>{if(!e)return;M(!0);const{error:N}=await Y.from("notification_preferences").upsert({user_id:e.id,new_review_email:j,negative_review_email:C,weekly_digest:A},{onConflict:"user_id"});M(!1),N?G.error("Failed to save notification preferences"):G.success("Notification preferences saved")};return o.jsx(Qn,{children:o.jsxs("div",{className:"mx-auto max-w-2xl space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-2xl font-bold text-foreground",children:"Settings"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your account and preferences"})]}),o.jsxs(Tm,{defaultValue:r,className:"w-full",children:[o.jsxs(nf,{className:"w-full overflow-x-auto",children:[o.jsxs(Kn,{value:"profile",className:"flex-1 gap-1.5 text-xs sm:text-sm sm:gap-2",children:[o.jsx(Wl,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"hidden sm:inline",children:"Account"})]}),!t&&o.jsxs(Kn,{value:"billing",className:"flex-1 gap-1.5 text-xs sm:text-sm sm:gap-2",children:[o.jsx(Fv,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"hidden sm:inline",children:"Billing"})]}),o.jsxs(Kn,{value:"team",className:"flex-1 gap-1.5 text-xs sm:text-sm sm:gap-2",children:[o.jsx(Ax,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"hidden sm:inline",children:"Team"})]}),o.jsxs(Kn,{value:"notifications",className:"flex-1 gap-1.5 text-xs sm:text-sm sm:gap-2",children:[o.jsx(bK,{className:"h-4 w-4 shrink-0"}),o.jsx("span",{className:"hidden sm:inline",children:"Notifications"})]})]}
769),o.jsxs(kr,{value:"profile",className:"space-y-4 mt-4",children:[o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{children:"Profile Information"}),o.jsx(ft,{children:"Update your display name and avatar"})]}),o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"email",children:"Email"}),o.jsx(Te,{id:"email",value:(e==null?void 0:e.email)||"",disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"displayName",children:"Display Name"}),o.jsx(Te,{id:"displayName",value:i,onChange:N=>a(N.target.value),placeholder:"Your name",disabled:c})]}),o.jsxs(X,{onClick:L,disabled:d||c,children:[d&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Profile"]})]})]}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{children:"Change Email"}),o.jsx(ft,{children:"Update your account email address. A confirmation will be sent to the new address."})]}),o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"currentEmail",children:"Current Email"}),o.jsx(Te,{id:"currentEmail",value:(e==null?void 0:e.email)||"",disabled:!0})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"newEmail",children:"New Email"}),o.jsx(Te,{id:"newEmail",type:"email",value:h,onChange:N=>p(N.target.value),placeholder:"[email protected]"})]}),o.jsxs(X,{onClick:R,disabled:g||!h,children:[g&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Update Email"]})]})]}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{children:"Change Password"}),o.jsx(ft,{children:"Update your account password"})]}),o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"newPassword",children:"New Password"}),o.jsx(Te,{id:"newPassword",type:"password",value:v,onChange:N=>x(N.target.value),placeholder:"••••••••"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{htmlFor:"confirmPassword",children:"Confirm Password"}),o.jsx(Te,{id:"confirmPassword",type:"password",value:y,onChange:N=>w(N.target.value),placeholder:"••••••••"})]}),o.jsxs(X,{onClick:$,disabled:S||!v,children:[S&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Update Password"]})]})]})]}),!t&&o.jsx(kr,{value:"billing",className:"mt-4",children:o.jsx(A4e,{})}),o.jsx(kr,{value:"team",className:"mt-4",children:o.jsx(R4e,{})}),o.jsx(kr,{value:"notifications",className:"space-y-4 mt-4",children:o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{children:"Email Notifications"}),o.jsx(ft,{children:"Choose what you want to be notified about"})]}),o.jsxs(de,{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(Pe,{children:"New review alerts"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Get notified when a new review comes in"})]}),o.jsx(vo,{checked:j,onCheckedChange:k,disabled:T})]}),o.jsx(sx,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(Pe,{children:"Negative review alerts"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Immediate alert for reviews with 2 stars or less"})]}),o.jsx(vo,{checked:C,onCheckedChange:E,disabled:T})]}),o.jsx(sx,{}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsx(Pe,{children:"Weekly digest"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"A summary of your reviews delivered every Monday"})]}),o.jsx(vo,{checked:A,onCheckedChange:P,disabled:T})]}),o.jsxs(X,{onClick:O,disabled:F||T,children:[F&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Preferences"]})]})]})})]})]})})},M4e=()=>{const e=Ao();return b.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),o.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),o.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},$4e={google:{label:"Google",color:"bg-white border border-border hover:border-blue-400 hover:shadow-md",icon:o.jsxs("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",children:[o.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),o.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),o.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),o.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})},tripadvisor:{label:"TripAdvisor",color:"bg-white border border-border hover:border-emerald-400 hover:shadow-md",icon:o.jsx("img",{src:Kb.url,alt:"TripAdvisor",className:"w-6 h-6 object-contain"})},yelp:{label:"Yelp",color:"bg-white border border-border hover:border-red-400 hover:shadow-md",icon:o.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",children:o.jsx("path",{fill:"#D32323",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"})})},facebook:{label:"Facebook",color:"bg-white border border-border hover:border-blue-600 hover:shadow-md",icon:o.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",children:o.jsx("path",{fill:"#1877F2",d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})})},trustpilot:{label:"Trustpilot",color:"bg-white border border-border hover:border-green-500 hover:shadow-md",icon:o.jsx("svg",{className:"w-6 h-6",viewBox:"0 0 24 24",children:o.jsx("path",{fill:"#00B67A",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})})}},D4e="We'd love to hear your feedback! Leave us a review on your preferred platform.",L4e=()=>{const{businessId:e}=Kk(),[t,n]=b.useState(null),[r,i]=b.useState([]),[a,s]=b.useState(!0),[l,c]=b.useState(!1);if(b.useEffect(()=>{if(!e)return;(async()=>{try{const f=await fetch(`https://hfnnsrngmmfuhssfwhlj.supabase.co/functions/v1/get-review-links?business_id=${e}`);if(!f.ok)throw new Error("Not found");const h=await f.json();n(h.business),i(h.links)}catch{c(!0)}finally{s(!1)}})()},[e]),a)return o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-gray-300 border-t-gray-600"})});if(l||!t)return o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"text-2xl font-bold text-gray-800 mb
769-2",children:"Page not found"}),o.jsx("p",{className:"text-gray-500",children:"This review page doesn't exist or has been removed."})]})});const u=t.phone||t.email||t.website;return o.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white flex items-center justify-center px-4 py-12",children:o.jsxs("div",{className:"w-full max-w-md",children:[o.jsxs("div",{className:"text-center mb-8",children:[t.logo_url?o.jsx("img",{src:t.logo_url,alt:t.name,className:"w-16 h-16 rounded-2xl object-cover mx-auto mb-4"}):o.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-gray-900 text-white mb-4",children:o.jsx(pi,{className:"h-8 w-8"})}),o.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-1",children:t.name}),t.address&&o.jsxs("p",{className:"text-sm text-gray-500 flex items-center justify-center gap-1",children:[o.jsx(Id,{className:"h-3.5 w-3.5"}),t.address]}),o.jsx("p",{className:"text-gray-600 mt-3 text-sm",children:t.description||D4e})]}),u&&o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 mb-6",children:[t.phone&&o.jsxs("a",{href:`tel:${t.phone}`,className:"inline-flex items-center gap-1.5 text-sm text-gray-600 hover:text-gray-900 transition-colors bg-white border border-gray-200 rounded-full px-3 py-1.5",children:[o.jsx(_5,{className:"h-3.5 w-3.5"}),t.phone]}),t.email&&o.jsxs("a",{href:`mailto:${t.email}`,className:"inline-flex items-center gap-1.5 text-sm text-gray-600 hover:text-gray-900 transition-colors bg-white border border-gray-200 rounded-full px-3 py-1.5",children:[o.jsx(as,{className:"h-3.5 w-3.5"}),t.email]}),t.website&&o.jsxs("a",{href:t.website.startsWith("http")?t.website:`https://${t.website}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-gray-600 hover:text-gray-900 transition-colors bg-white border border-gray-200 rounded-full px-3 py-1.5",children:[o.jsx(Gh,{className:"h-3.5 w-3.5"}),"Website"]})]}),r.length===0?o.jsx("p",{className:"text-center text-gray-400 text-sm",children:"No review links available yet."}):o.jsx("div",{className:"space-y-3",children:r.map(d=>{const f=d.platform.startsWith("custom:"),h=!f&&$4e[d.platform]||{label:f?d.platform.slice(7):d.platform,color:"bg-white border border-gray-200 hover:shadow-md",icon:o.jsx(sr,{className:"h-6 w-6 text-gray-500"})};return o.jsxs("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:`flex items-center gap-4 p-4 rounded-xl transition-all duration-200 ${h.color}`,children:[o.jsx("div",{className:"shrink-0",children:h.icon}),o.jsx("span",{className:"font-medium text-gray-900 flex-1",children:f?h.label:`Review us on ${h.label}`}),o.jsx(sr,{className:"h-4 w-4 text-gray-400"})]},d.id)})}),o.jsx("a",{href:"https://www.reviewkit.com",target:"_blank",rel:"noopener noreferrer",className:"block text-center text-xs text-gray-300 hover:text-gray-500 transition-colors mt-10",children:"Powered by Review Kit"})]})})},F4e=e=>{const[t,n]=b.useState([]),[r,i]=b.useState(!1),a=b.useCallback(async()=>{i(!0);let u=Y.from("widgets").select("*").order("created_at",{ascending:!1});const{data:d,error:f}=await u;f?G.error("Failed to load widgets"):n(d||[]),i(!1)},[e]);return b.useEffect(()=>{a()},[a]),{widgets:t,isLoading:r,createWidget:async u=>{const{data:{user:d}}=await Y.auth.getUser();if(!d||!e)return null;const{data:f,error:h}=await Y.from("widgets").insert({business_id:e,user_id:d.id,name:u.name||"My Widget",widget_type:u.widget_type||"carousel",theme:u.theme||"light",review_selection_mode:u.review_selection_mode||"auto",selected_review_ids:u.selected_review_ids||[],max_reviews:u.max_reviews||6,min_rating:u.min_rating||4,show_reviewer_photo:u.show_reviewer_photo??!0,show_date:u.show_date??!0,show_source:u.show_source??!0,accent_color:u.accent_color||"#6366f1",border_radius:u.border_radius||"rounded",custom_header:u.custom_header||null}).select().single();return h?(G.error("Failed to create widget"),null):(G.success("Widget created!"),await a(),f)},updateWidget:async(u,d)=>{const{error:f}=await Y.from("widgets").update(d).eq("id",u);return f?(G.error("Failed to update widget"),!1):(G.success("Widget updated!"),await a(),!0)},deleteWidget:async u=>{const{error:d}=await Y.from("widgets").delete().eq("id",u);return d?(G.error("Failed to delete widget"),!1):(G.success("Widget deleted"),await a(),!0)},refetch:a}},B4e=[{id:"s1",reviewer_name:"Sarah Johnson",reviewer_photo_url:null,rating:5,comment:"Abs
769olutely incredible experience! The team went above and beyond to make everything perfect. Highly recommend to anyone looking for quality service.",review_date:"2025-12-15",source:"google"},{id:"s2",reviewer_name:"James Miller",reviewer_photo_url:null,rating:5,comment:"Outstanding from start to finish. Professional, punctual, and the results exceeded all expectations.",review_date:"2025-11-28",source:"trustpilot"},{id:"s3",reviewer_name:"Emily Chen",reviewer_photo_url:null,rating:4,comment:"Great service overall. Very friendly staff and fast turnaround. Would use again without hesitation.",review_date:"2025-11-10",source:"tripadvisor"}],RE={none:"0px",small:"6px",rounded:"12px",pill:"24px"},IE=({rating:e,accentColor:t})=>o.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(n=>o.jsx(pi,{className:"h-3.5 w-3.5",style:{fill:n<=e?t:"transparent",color:n<=e?t:"#d1d5db"}},n))}),n1=({review:e,config:t})=>{const n=t.theme==="dark",r=RE[t.border_radius]||"12px";return o.jsxs("div",{style:{borderRadius:r},className:`border p-3 space-y-2 ${n?"bg-gray-800 border-gray-700 text-gray-100":"bg-white border-gray-200 text-gray-900"}`,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[t.show_reviewer_photo&&o.jsx("div",{className:"h-7 w-7 rounded-full flex items-center justify-center text-xs font-semibold shrink-0",style:{backgroundColor:t.accent_color+"20",color:t.accent_color},children:e.reviewer_name.charAt(0).toUpperCase()}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-xs font-medium truncate",children:e.reviewer_name}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(IE,{rating:e.rating,accentColor:t.accent_color}),t.show_date&&o.jsx("span",{className:`text-[10px] ${n?"text-gray-400":"text-gray-500"}`,children:new Date(e.review_date).toLocaleDateString()})]})]}),t.show_source&&o.jsx("span",{className:`text-[9px] uppercase font-medium px-1 py-0.5 rounded ${n?"bg-gray-700 text-gray-400":"bg-gray-100 text-gray-500"}`,children:e.source})]}),e.comment&&o.jsx("p",{className:`text-xs leading-relaxed ${n?"text-gray-300":"text-gray-600"}`,children:e.comment.length>120?e.comment.slice(0,120)+"…":e.comment})]})},U4e=({config:e,reviews:t})=>{const n=e.theme==="dark",r=RE[e.border_radius]||"12px",i=t.length>0?(t.reduce((a,s)=>a+s.rating,0)/t.length).toFixed(1):"0";return o.jsxs("div",{style:{borderRadius:r},className:`inline-flex items-center gap-2 border px-4 py-2 ${n?"bg-gray-800 border-gray-700 text-gray-100":"bg-white border-gray-200 text-gray-900"}`,children:[o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-lg font-bold",children:i}),o.jsx(IE,{rating:Math.round(Number(i)),accentColor:e.accent_color})]}),o.jsxs("div",{className:`text-xs ${n?"text-gray-400":"text-gray-500"}`,children:["Based on ",t.length," reviews"]})]})},z4e=({config:e,reviews:t})=>{const n=e.theme==="dark",r=RE[e.border_radius]||"12px",i=t.length>0?(t.reduce((a,s)=>a+s.rating,0)/t.length).toFixed(1):"0";return o.jsxs("div",{style:{borderRadius:r},className:`flex items-center justify-center gap-4 border px-4 py-3 ${n?"bg-gray-800 border-gray-700 text-gray-100":"bg-white border-gray-200 text-gray-900"}`,children:[o.jsx(IE,{rating:Math.round(Number(i)),accentColor:e.accent_color}),o.jsxs("span",{className:"text-sm font-semibold",children:[i,"/5"]}),o.jsxs("span",{className:`text-xs ${n?"text-gray-400":"text-gray-500"}`,children:["from ",t.length," reviews"]})]})},W4e=({config:e,reviews:t,className:n=""})=>{const r=t||B4e,i=e.theme==="dark",[a,s]=b.useState(0);return b.useEffect(()=>{if(e.widget_type!=="carousel"||r.length<=1)return;const l=setInterval(()=>s(c=>(c+1)%r.length),4e3);return()=>clearInterval(l)},[e.widget_type,r.length]),o.jsxs("div",{className:`w-full font-sans antialiased p-3 transition-colors ${i?"bg-gray-900 rounded-lg":"bg-gray-50 rounded-lg"} ${n}`,children:[e.custom_header&&o.jsx("p",{className:`text-sm font-semibold mb-2 text-center ${i?"text-gray-200":"text-gray-800"}`,children:e.custom_header}),e.widget_type==="badge"&&o.jsx(U4e,{config:e,reviews:r}),e.widget_type==="strip"&&o.jsx(z4e,{config:e,reviews:r}),e.widget_type==="carousel"&&r.length>0&&o.jsxs("div",{className:"relative overflow-hidden",children:[o.jsx("div",{className:"flex transition-transform duration-500 ease-in-out",style:{transform:`translateX(-${a*100}%)`},children:r.map(l=>o.jsx("div",{className:"w-full flex-shrink-0 px-0.5",children:o.jsx(n1,{review:l,config:e})},l.id))}),r.length>1&&o.jsx("div",{className:"flex justify-center gap-1 mt-2",children:r.map((l,c)=>o.jsx("button",{onClick:()=>s(c),className:"h-1.5 rounded-full transition-all",style:{width:c===a?"16px":"6px",backgroundColor:c===a?e.accent_color:i?"#4b5563":"#d1d5db"}},c))})]}),e.widget_type==="grid"&&o.jsx("div",{className:"grid grid-cols-2 gap-2",children:r.slice(0,4).map(l=>o.jsx(n1,{review:l,config:e},l.id))}),e.widget_type==="wall"&&o.jsx("div",{className:"columns-2 gap-2 space-y-2",children:r.map(l=>o.jsx("div",{className:"break-inside-avoid",children:o.jsx(n1,{review:l,config:e})},l.id))})]})},H4e=[{value:"carousel",label:"Carousel",icon:tN,description:"Auto-scrolling reviews"},{value:"grid",label:"Grid",icon:y5,description:"Responsive grid layout"},{value:"badge",label:"Badge",icon:h5,description:"Compact rating summary"},{value:"wall",label:"Wall of Love",icon:v5,description:"Masonry-style wall"},{value:"strip",label:"Rating Strip",icon:nN,description:"Compact inline bar"}],q4e=["#6366f1","#3b82f6","#10b981","#f59e0b","#ef4444","#ec4899","#8b5cf6","#14b8a6"],V4e=[{value:"none",label:"Sharp"},{value:"small",label:"Small"},{value:"rounded",label:"Rounded"},{value:"pill",label:"Pill"}],G4e=({open:e,onOpenChange:t,widget:n,onSave:r,businesses:i,defaultBusinessId:a,defaultTab:s="config"})=>{var se,Q;const[l,c]=b.useState(!1),[u,d]=b.useState((n==null?void 0:n.business_id)||a||((se=i[0])==null?void 0:se.id)||""),f=((Q=i.find(ne=>ne.id===u))==null?void 0:Q.name)||"",[h,p]=b.useState((n==null?void 0:n.name)||"My Widget"),[g,m]=b.useState((n==null?void 0:n.widget_type)||"carousel"),[v,x]=b.useState((n==null?void 0:n.theme)||"light"),[y,w]=b.useState((n==null?void 0:n.review_selection_mode)||"auto"),[S,_]=b.useState((n==null?void 0:n.max_reviews)||6),[j,k]=b.useState((n==null?void 0:n.min_rating)||4),[C,E]=b.useState((n==null?void 0:n.show_reviewer_photo)??!0),[A,P]=b.useState((n==null?void 0:n.show_date)??!0),[T,B]=b.useState((n==null?void 0:n.show_source)??!0),[F,M]=b.useState((n==null?void 0:n.accent_color)||"#6366f1"),[L,R]=b.useState((n==null?void 0:n.border_radius)||"rounded"),[$,O]=b.useState((n==null?void 0:n.custom_header)||""),N={widget_type:g,theme:v,show_reviewer_photo:C,show_date:A,show_source:T,accent_color:F,border_radius:L,custom_header:$||null},H=async()=>{c(!0),await r({...n?{}:{business_id:u},name:h,widget_type:g,theme:v,review_selection_mode:y,max_reviews:S,min_rating:j,show_reviewer_photo:C,show_date:A,show_source:T,accent_color:F,border_radius:L,custom_header:$||null}),c(!1),t(!1)},V=n?`https://my.reviewkit.com/widget/${n.id}`:null,D=n?`<iframe src="${V}" style="width:100%;border:none;min-height:300px;" title="Reviews - ${f}"></iframe>
769`:null,K=n?`<div id="reviewkit-widget-${n.id}"></div>
770<script>
771(function(){var d=document,f=d.createElement('iframe');f.src='${V}';f.style.cssText='width:100%;border:none;min-height:300px;';f.title='Reviews';d.getElementById('reviewkit-widget-${n.id}').appendChild(f);window.addEventListener('message',function(e){if(e.data&&e.data.type==='reviewkit-resize'&&e.data.id==='${n.id}'){f.style.height=e.data.height+'px'}});})();
772<\/script>`:null,ae=ne=>{navigator.clipboard.writeText(ne),G.success("Embed code copied!")};return o.jsx(sc,{open:e,onOpenChange:t,children:o.jsxs(Mo,{className:"sm:max-w-4xl max-h-[90vh] overflow-y-auto",children:[o.jsx($o,{children:o.jsxs(Do,{className:"font-display",children:[s==="embed"?"Embed Widget":n?"Edit Widget":"Create Widget"," — ",f]})}),o.jsxs(Tm,{defaultValue:s,children:[o.jsxs(nf,{className:"w-full",children:[o.jsx(Kn,{value:"config",className:"flex-1",children:"Configure"}),n&&o.jsx(Kn,{value:"embed",className:"flex-1",children:"Embed Code"})]}),o.jsx(kr,{value:"config",className:"mt-4",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"space-y-4",children:[!n&&i.length>1&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Business"}),o.jsxs(St,{value:u,onValueChange:d,children:[o.jsxs(wt,{className:"h-9",children:[o.jsx(Jr,{className:"mr-1.5 h-3.5 w-3.5 text-muted-foreground"}),o.jsx(kt,{placeholder:"Select business"})]}),o.jsx(_t,{children:i.map(ne=>o.jsx(we,{value:ne.id,children:ne.name},ne.id))})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Widget Name"}),o.jsx(Te,{className:"h-9",value:h,onChange:ne=>p(ne.target.value),placeholder:"e.g. Homepage Reviews"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Widget Style"}),o.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:H4e.map(ne=>o.jsxs("button",{onClick:()=>m(ne.value),className:`flex flex-col items-center gap-1 rounded-lg border p-2 text-center transition-colors ${g===ne.value?"border-primary bg-primary/5 text-foreground":"border-border text-muted-foreground hover:border-primary/40"}`,children:[o.jsx(ne.icon,{className:"h-4 w-4"}),o.jsx("span",{className:"text-[10px] font-medium leading-tight",children:ne.label})]},ne.value))})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Theme"}),o.jsxs(St,{value:v,onValueChange:x,children:[o.jsx(wt,{className:"h-9",children:o.jsx(kt,{})}),o.jsxs(_t,{children:[o.jsx(we,{value:"light",children:"Light"}),o.jsx(we,{value:"dark",children:"Dark"})]})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Border Radius"}),o.jsxs(St,{value:L,onValueChange:R,children:[o.jsx(wt,{className:"h-9",children:o.jsx(kt,{})}),o.jsx(_t,{children:V4e.map(ne=>o.jsx(we,{value:ne.value,children:ne.label},ne.value))})]})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Accent Color"}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[q4e.map(ne=>o.jsx("button",{onClick:()=>M(ne),className:`h-6 w-6 rounded-full border-2 transition-all ${F===ne?"border-foreground scale-110":"border-transparent"}`,style:{backgroundColor:ne}},ne)),o.jsx(Te,{type:"color",value:F,onChange:ne=>M(ne.target.value),className:"h-6 w-8 p-0 border-0 cursor-pointer"})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Custom Header (optional)"}),o.jsx(Te,{className:"h-9",value:$,onChange:ne=>O(ne.target.value),placeholder:"e.g. What our customers say"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Review Selection"}),o.jsxs(St,{value:y,onValueChange:w,children:[o.jsx(wt,{className:"h-9",children:o.jsx(kt,{})}),o.jsxs(_t,{children:[o.jsx(we,{value:"auto",children:"Auto (best reviews)"}),o.jsx(we,{value:"manual",children:"Manual selection"})]})]})]}),y==="auto"&&o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Max Reviews"}),o.jsx(Te,{className:"h-9",type:"number",min:1,max:20,value:S,onChange:ne=>_(Number(ne.target.value))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Min Rating"}),o.jsxs(St,{value:String(j),onValueChange:ne=>k(Number(ne)),children:[o.jsx(wt,{className:"h-9",children:o.jsx(kt,{})}),o.jsx(_t,{children:[1,2,3,4,5].map(ne=>o.jsxs(we,{value:String(ne),children:[ne,"+ stars"]},ne))})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{className:"text-xs",children:"Display Options"}),o.jsx("div",{className:"space-y-1.5",children:[{label:"Reviewer photo",checked:C,onChange:E},{label:"Date",checked:A,onChange:P},{label:"Review source",checked:T,onChange:B}].map(ne=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:ne.label}
772),o.jsx(vo,{checked:ne.checked,onCheckedChange:ne.onChange})]},ne.label))})]}),o.jsxs(X,{className:"w-full",onClick:H,disabled:l||!h.trim(),children:[l&&o.jsx(ke,{className:"mr-2 h-4 w-4 animate-spin"}),n?"Save Changes":"Create Widget"]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(uh,{className:"h-3.5 w-3.5"}),o.jsx("span",{className:"font-medium",children:"Live Preview"})]}),o.jsx("div",{className:"border border-border rounded-lg overflow-hidden",children:o.jsx(W4e,{config:N})})]})]})}),n&&o.jsxs(kr,{value:"embed",className:"space-y-5 mt-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Pe,{children:"Script Tag (Recommended)"}),o.jsx(Se,{variant:"secondary",className:"text-xs",children:"Recommended"})]}),o.jsxs("div",{className:"relative",children:[o.jsx(ds,{readOnly:!0,value:K||"",className:"font-mono text-xs min-h-[120px] bg-muted/50"}),o.jsxs(X,{variant:"outline",size:"sm",className:"absolute top-2 right-2 gap-1.5",onClick:()=>ae(K||""),children:[o.jsx(Vh,{className:"h-3 w-3"})," Copy"]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{children:"iframe (Simple)"}),o.jsxs("div",{className:"relative",children:[o.jsx(ds,{readOnly:!0,value:D||"",className:"font-mono text-xs min-h-[60px] bg-muted/50"}),o.jsxs(X,{variant:"outline",size:"sm",className:"absolute top-2 right-2 gap-1.5",onClick:()=>ae(D||""),children:[o.jsx(Vh,{className:"h-3 w-3"})," Copy"]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{children:"Preview"}),o.jsx("div",{className:"rounded-lg border border-border overflow-hidden",children:o.jsx("iframe",{src:V||"",className:"w-full border-none",style:{minHeight:300},title:"Widget Preview"})})]})]})]})]})})},K4e={carousel:tN,grid:y5,badge:h5,wall:v5,strip:nN},Y4e={carousel:"Carousel",grid:"Grid",badge:"Badge",wall:"Wall of Love",strip:"Rating Strip"};function X4e(){var w;const{businesses:e,isLoading:t}=Lo(),n=((w=e==null?void 0:e[0])==null?void 0:w.id)||null,{widgets:r,isLoading:i,createWidget:a,updateWidget:s,deleteWidget:l,refetch:c}=F4e(),[u,d]=b.useState(!1),[f,h]=b.useState(null),[p,g]=b.useState("config"),m=()=>{h(null),g("config"),d(!0)},v=S=>{h(S),g("config"),d(!0)},x=S=>{h(S),g("embed"),d(!0)},y=async S=>{if(f){const E=await s(f.id,S);return c(),E}const _=S.business_id||n;if(!_)return null;const{data:{user:j}}=await Y.auth.getUser();if(!j)return null;const{data:k,error:C}=await Y.from("widgets").insert({business_id:_,user_id:j.id,name:S.name||"My Widget",widget_type:S.widget_type||"carousel",theme:S.theme||"light",review_selection_mode:S.review_selection_mode||"auto",selected_review_ids:S.selected_review_ids||[],max_reviews:S.max_reviews||6,min_rating:S.min_rating||4,show_reviewer_photo:S.show_reviewer_photo??!0,show_date:S.show_date??!0,show_source:S.show_source??!0,accent_color:S.accent_color||"#6366f1",border_radius:S.border_radius||"rounded",custom_header:S.custom_header||null}).select().single();return C?(G.error("Failed to create widget"),null):(G.success("Widget created!"),c(),k)};return o.jsx(Vf,{children:o.jsxs(Qn,{children:[o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-2xl font-semibold text-foreground",children:"Widgets"}),o.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Embed your best reviews on your website"})]}),o.jsxs(X,{onClick:m,disabled:!n,className:"gap-1.5",children:[o.jsx(_o,{className:"h-4 w-4"}),"New Widget"]})]}),t||i?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(ke,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):n?r.length===0?o.jsx(pe,{children:o.jsxs(de,{className:"py-16 flex flex-col items-center text-center",children:[o.jsx(k2,{className:"h-10 w-10 text-muted-foreground/50 mb-3"}),o.jsx("h3",{className:"font-medium text-foreground mb-1",children:"No widgets yet"}),o.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create a widget to showcase your best reviews on your website."}),o.jsxs(X,{onClick:m,className:"gap-1.5",children:[o.jsx(_o,{className:"h-4 w-4"}),"Create Your First Widget"]})]})}):o.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:r.map(S=>{var k;const _=K4e[S.widget_type]||tN,j=(k=e==null?void 0:e.find(C=>C.id===S.business_id))==null?void 0:k.name;return o.jsx(pe,{className:"group relative",children:o.jsxs(de,{className:"p-5 space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:o.jsx(_,{className:"h-4 w-4 text-primary"})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-medium text-foreground",children:S.name}),o.jsx("p",{className:"text-xs text-muted-foreground",children:Y4e[S.widget_type]||S.widget_type}),j&&o.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-0.5",children:[o.jsx(Jr,{className:"h-3 w-3"}),j]})]})]}),o.jsx(Se,{variant:"secondary",className:"text-[10px]",children:S.theme})]}),o.jsx("div",{className:"flex flex-wrap gap-1.5 text-xs text-muted-foreground",children:o.jsx("span",{children:S.review_selection_mode==="auto"?`Auto · ${S.min_rating}+ stars · Max ${S.max_reviews}`:"Manual selection"})}),o.jsxs("div",{className:"flex gap-2 pt-1",children:[o.jsxs(X,{variant:"outline",size:"sm",className:"flex-1 gap-1.5 text-xs",onClick:()=>v(S),children:[o.jsx(rN,{className:"h-3 w-3"}),"Edit"]}),o.jsxs(X,{variant:"outline",size:"sm",className:"flex-1 gap-1.5 text-xs",onClick:()=>x(S),children:[o.jsx(k2,{className:"h-3 w-3"}),"Get Code"]}),o.jsxs(Zb,{children:[o.jsx(kz,{asChild:!0,children:o.jsx(X,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:o.jsx(Md,{className:"h-3.5 w-3.5"})})}),o.jsxs(km,{children:[o.jsxs(Nm,{children:[o.jsx(Em,{children:"Delete Widget"}),o.jsxs(Pm,{children:['This will permanently delete "',S.name,'" and break any embeds using it.']})]}),o.jsxs(Cm,{children:[o.jsx(Am,{children:"Cancel"}),o.jsx(Om,{onClick:()=>l(S.id),children:"Delete"})]})]})]})]})]})},S.id)})}):o.jsx(pe,{children:o.jsx(de,{className:"py-16 text-center text-muted-foreground",children:"Add a business first to create widgets."})})]}),u&&o.jsx(G4e,{open:u,onOpenChange:d,widget:f,onSave:y,businesses:e||[],defaultBusinessId:n,defaultTab:p})]})})}const Q4e="https://hfnnsrngmmfuhssfwhlj.supabase.co",ME={none:"0px",small:"6px",rounded:"12px",pill:"24px"},$E=({rating:e,accentColor:t})=>o.jsx("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(n=>
772o.jsx(pi,{className:"h-3.5 w-3.5",style:{fill:n<=e?t:"transparent",color:n<=e?t:"#d1d5db"}},n))}),r1=({review:e,widget:t})=>{const n=t.theme==="dark",r=ME[t.border_radius]||"12px",i=t.accent_color||"#6366f1";return o.jsxs("div",{style:{borderRadius:r},className:`border p-4 space-y-3 ${n?"bg-gray-800 border-gray-700 text-gray-100":"bg-white border-gray-200 text-gray-900"}`,children:[o.jsxs("div",{className:"flex items-center gap-3",children:[t.show_reviewer_photo&&o.jsx("div",{className:"h-9 w-9 rounded-full flex items-center justify-center text-sm font-semibold shrink-0",style:{backgroundColor:e.reviewer_photo_url?"transparent":i+"20",color:i},children:e.reviewer_photo_url?o.jsx("img",{src:e.reviewer_photo_url,alt:"",className:"h-9 w-9 rounded-full object-cover"}):e.reviewer_name.charAt(0).toUpperCase()}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:e.reviewer_name}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx($E,{rating:e.rating,accentColor:i}),t.show_date&&o.jsx("span",{className:`text-xs ${n?"text-gray-400":"text-gray-500"}`,children:new Date(e.review_date).toLocaleDateString()})]})]}),t.show_source&&o.jsx("span",{className:`text-[10px] uppercase font-medium px-1.5 py-0.5 rounded ${n?"bg-gray-700 text-gray-400":"bg-gray-100 text-gray-500"}`,children:e.source})]}),e.comment&&o.jsx("p",{className:`text-sm leading-relaxed ${n?"text-gray-300":"text-gray-600"}`,children:e.comment.length>200?e.comment.slice(0,200)+"…":e.comment})]})},J4e=({data:e})=>{const t=e.widget.theme==="dark",n=ME[e.widget.border_radius]||"12px",r=e.widget.accent_color||"#6366f1",i=e.reviews.length>0?(e.reviews.reduce((a,s)=>a+s.rating,0)/e.reviews.length).toFixed(1):"0";return o.jsxs("div",{style:{borderRadius:n},className:`inline-flex items-center gap-3 border px-5 py-3 ${t?"bg-gray-800 border-gray-700 text-gray-100":"bg-white border-gray-200 text-gray-900"}`,children:[o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-2xl font-bold",children:i}),o.jsx($E,{rating:Math.round(Number(i)),accentColor:r})]}),o.jsxs("div",{className:`text-sm ${t?"text-gray-400":"text-gray-500"}`,children:["Based on ",e.reviews.length," reviews"]})]})},Z4e=({data:e})=>{const t=e.widget.theme==="dark",n=ME[e.widget.border_radius]||"12px",r=e.widget.accent_color||"#6366f1",i=e.reviews.length>0?(e.reviews.reduce((a,s)=>a+s.rating,0)/e.reviews.length).toFixed(1):"0";return o.jsxs("div",{style:{borderRadius:n},className:`flex items-center justify-center gap-4 border px-5 py-3 ${t?"bg-gray-800 border-gray-700 text-gray-100":"bg-white border-gray-200 text-gray-900"}`,children:[o.jsx($E,{rating:Math.round(Number(i)),accentColor:r}),o.jsxs("span",{className:"text-sm font-semibold",children:[i,"/5"]}),o.jsxs("span",{className:`text-xs ${t?"text-gray-400":"text-gray-500"}`,children:["from ",e.reviews.length," reviews"]})]})};function eLe(){const{widgetId:e}=Kk(),[t,n]=b.useState(null),[r,i]=b.useState(null),[a,s]=b.useState(0);if(b.useEffect(()=>{e&&fetch(`${Q4e}/functions/v1/get-widget-data?id=${e}`).then(f=>f.json()).then(f=>{f.error?i(f.error):n(f)}).catch(()=>i("Failed to load widget"))},[e]),b.useEffect(()=>{if(!t||t.widget.widget_type!=="carousel"||t.reviews.length<=1)return;const f=setInterval(()=>{s(h=>(h+1)%t.reviews.length)},5e3);return()=>clearInterval(f)},[t]),r)return o.jsx("div",{className:"p-4 text-sm text-red-500",children:r});if(!t)return o.jsx("div",{className:"p-4 text-sm text-gray-400",children:"Loading..."});const{widget:l,reviews:c}=t,u=l.theme==="dark",d=l.accent_color||"#6366f1";return o.jsxs("div",{className:`w-full font-sans antialiased ${u?"bg-gray-900":"bg-transparent"}`,style:{minHeight:"auto"},children:[l.custom_header&&o.jsx("p",{className:`text-base font-semibold mb-3 text-center ${u?"text-gray-200":"text-gray-800"}`,children:l.custom_header}),l.widget_type==="badge"&&o.jsx(J4e,{data:t}),l.widget_type==="strip"&&o.jsx(Z4e,{data:t}),l.widget_type==="carousel"&&c.length>0&&o.jsxs("div",{className:"relative overflow-hidden",children:[o.jsx("div",{className:"flex transition-transform duration-500 ease-in-out",style:{transform:`translateX(-${a*100}%)`},children:c.map(f=>o.jsx("div",{className:"w-full flex-shrink-0 px-1",children:o.jsx(r1,{review:f,widget:l})},f.id))}),c.length>1&&o.jsx("div",{className:"flex justify-center gap-1.5 mt-3",children:c.map((f,h)=>o.jsx("button",{onClick:()=>s(h),className:"h-1.5 rounded-full transition-all",style:{width:h===a?"16px":"6px",backgroundColor:h===a?d:u?"#4b5563":"#d1d5db"}},h))})]}),l.widget_type==="grid"&&o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:c.map(f=>o.jsx(r1,{review:f,widget:l},f.id))}),l.widget_type==="wall"&&o.jsx("div",{className:"columns-1 sm:columns-2 lg:columns-3 gap-3 space-y-3",children:c.map(f=>o.jsx("div",{className:"break-inside-avoid",children:o.jsx(r1,{review:f,widget:l})},f.id))}),o.jsx("div",{className:"mt-3 text-center",children:o.jsx("a",{href:"https://reviewkit.com",target:"_blank",rel:"noopener noreferrer",className:`text-[10px] ${u?"text-gray-500":"text-gray-400"} hover:underline`,children:"Powered by ReviewKit"})})]})}const i1=25,tLe=e=>{const{user:t,subscription:n,isAdmin:r}=Mt(),{trialing:i}=n,a=_i(),{data:s=[],isLoading:l}=Na({queryKey:["invitations",t==null?void 0:t.id,e],queryFn:async()=>{let p=Y.from("review_invitations").select("*").order("created_at",{ascending:!1});e&&(p=p.eq("business_id",e));const{data:g,error:m}=await p;if(m)throw m;return g||[]},enabled:!!t}),c=u_({mutationFn:async({business_id:p,invitations:g})=>{var y;const{data:m}=await Y.auth.getSession(),v=(y=m==null?void 0:m.session)==null?void 0:y.access_token,x=await fetch("https://hfnnsrngmmfuhssfwhlj.supabase.co/functions/v1/send-review-invite",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v}`,apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imhmbm5zcm5nbW1mdWhzc2Z3aGxqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzMzMDIyNTksImV4cCI6MjA4ODg3ODI1OX0.cOG14AuXKizGxOndB0gA-YWKB7xn4hJdwxYandovxC8"},body:JSON.stringify({business_id:p,invitations:g})});if(!x.ok){const w=await x.json();throw new Error(w.error||"Failed to send invitations")}return x.json()},onSuccess:p=>{G.success(`${p.sent} invitation${p.sent!==1?"s":""} sent!`),p.skipped>0&&G.warning(`${p.skipped} invitation${p.skipped!==1?"s were":" was"} not sent — free trial limit of ${i1} reached. Upgrade to send more.`),a.invalidateQueries({queryKey:["invitations"]}),a.invalidateQueries({queryKey:["invitations-total"]})},onError:p=>{G.error(p.message)}}),{data:u=0}=Na({queryKey:["invitations-total",t==null?void 0:t.id],queryFn:async()=>{const{count:p,error:g}=await Y.from("review_invitations").select("id",{count:"exact",head:!0});if(g)throw g;return p??0},enabled:!!t}),d=i&&!r,f=d?Math.max(0,i1-u):1/0,h={total:s.length,sent:s.filter(p=>p.status==="sent"||p.status==="delivered").length,opened:s.filter(p=>p.status==="opened"||p.status==="clicked"||p.status==="completed").length,completed:s.filter(p=>p.status==="clicked"||p.status==="completed").length};return{invitations:s,isLoading:l,sendInvites:c,stats:h,isTrial:d,trialInviteCap:i1,trialInvitesUsed:u,trialInvitesRemaining:f}},nLe=Td("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),k7=b.forwardRef(({className:e,variant:t,...n},r)=>o.jsx("div",{ref:r,role:"alert",className:he(nLe({variant:t}),e),...n}));k7.displayName="Alert";const N7=b.forwardRef(({className:e,...t},n)=>o.jsx("h5",{ref:n,className:he("mb-1 font-medium leading-none tracking-tight",e),...t}));
772N7.displayName="AlertTitle";const C7=b.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:he("text-sm [&_p]:leading-relaxed",e),...t}));C7.displayName="AlertDescription";const rLe="inbox.reviewkit.com",iLe=()=>Math.random().toString(36).slice(2,8),aLe=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,18)||"business",sLe=({business:e})=>{const{updateBusiness:t}=Lo(),[n,r]=b.useState(!1),[i,a]=b.useState(!1),s=!!e.inbound_token,l=s?`${e.inbound_token}@${rLe}`:"Preparing your address…",c=async()=>{s&&(await navigator.clipboard.writeText(l),r(!0),G.success("Address copied"),setTimeout(()=>r(!1),2e3))},u=async f=>{a(!0),await t(e.id,f),a(!1)},d=async()=>{const f=`${aLe(e.name)}-${iLe()}`,{error:h}=await Y.from("businesses").update({inbound_token:f}).eq("id",e.id);if(h){G.error("Could not create a new address");return}G.success("New address created"),await t(e.id,{})};return o.jsxs(pe,{children:[o.jsxs(ze,{className:"pb-3",children:[o.jsxs(We,{className:"text-lg flex items-center gap-2",children:[o.jsx(TK,{className:"h-4 w-4 text-muted-foreground"}),"Auto-invite by BCC"]}),o.jsx(ft,{children:"BCC this address on your booking confirmations and we'll automatically schedule a review request for that customer after their booking."})]}),o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[o.jsx("code",{className:"flex-1 truncate rounded-lg border border-border bg-muted/40 px-3 py-2 text-sm",children:l}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs(X,{variant:"outline",size:"sm",onClick:c,disabled:!s,className:"gap-1.5",children:[n?o.jsx(To,{className:"h-3.5 w-3.5"}):o.jsx(Vh,{className:"h-3.5 w-3.5"}),n?"Copied":"Copy"]}),o.jsxs(X,{variant:"ghost",size:"sm",onClick:d,className:"gap-1.5",children:[o.jsx(zi,{className:"h-3.5 w-3.5"}),"New address"]})]})]}),o.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Enabled"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Only emails sent from your account email or a team member are accepted."})]}),o.jsx(vo,{checked:e.inbound_enabled,disabled:i,onCheckedChange:f=>u({inbound_enabled:f})})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"When a customer is detected"}),o.jsxs(St,{value:e.invite_mode,onValueChange:f=>u({invite_mode:f}),children:[o.jsx(wt,{children:o.jsx(kt,{})}),o.jsxs(_t,{children:[o.jsx(we,{value:"auto",children:"Send automatically"}),o.jsx(we,{value:"approve",children:"Ask me to approve"})]})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Days after booking date"}),o.jsx(Te,{type:"number",min:0,max:60,value:e.invite_days_after_booking,onChange:f=>u({invite_days_after_booking:Number(f.target.value)||0})})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Fallback delay (no date found)"}),o.jsx(Te,{type:"number",min:1,max:60,value:e.invite_fallback_days,onChange:f=>u({invite_fallback_days:Number(f.target.value)||1})})]})]}),o.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Hold new invites for (hours)"}),o.jsx(Te,{type:"number",min:0,max:168,value:e.invite_hold_hours??24,onChange:f=>u({invite_hold_hours:Math.max(0,Number(f.target.value)||0)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Time to cancel before an invite can send — useful if a tour is cancelled. 0 means no hold."})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx(Pe,{className:"text-xs",children:"Don't re-invite the same customer within (days)"}),o.jsx(Te,{type:"number",min:0,max:365,value:e.invite_dedupe_days??90,onChange:f=>u({invite_dedupe_days:Math.max(0,Number(f.target.value)||0)})}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Repeat bookings inside this window are skipped instead of emailed again."})]})]})]})]})};var d0="Checkbox",[oLe,ULe]=Fn(d0),[lLe,DE]=oLe(d0);function cLe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:s,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,p]=Tr({prop:n,defaultProp:i??!1,onChange:c,caller:d0}),[g,m]=b.useState(null),[v,x]=b.useState(null),y=b.useRef(!1),w=g?!!s||!!g.closest("form"):!0,S={checked:h,disabled:a,setChecked:p,control:g,setControl:m,name:l,form:s,value:d,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:yo(i)?!1:i,isFormControl:w,bubbleInput:v,setBubbleInput:x};return o.jsx(lLe,{scope:t,...S,children:uLe(f)?f(S):r})}var E7="CheckboxTrigger",P7=b.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:a,value:s,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:g}=DE(E7,e),m=Qe(i,d),v=b.useRef(c);return b.useEffect(()=>{const x=a==null?void 0:a.form;
772if(x){const y=()=>f(v.current);return x.addEventListener("reset",y),()=>x.removeEventListener("reset",y)}},[a,f]),o.jsx(Ce.button,{type:"button",role:"checkbox","aria-checked":yo(c)?"mixed":c,"aria-required":u,"data-state":I7(c),"data-disabled":l?"":void 0,disabled:l,value:s,...r,ref:m,onKeyDown:me(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:me(n,x=>{f(y=>yo(y)?!0:!y),g&&p&&(h.current=x.isPropagationStopped(),h.current||x.stopPropagation())})})});P7.displayName=E7;var LE=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:s,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return o.jsx(cLe,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:l,required:s,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>o.jsxs(o.Fragment,{children:[o.jsx(P7,{...f,ref:t,__scopeCheckbox:n}),h&&o.jsx(R7,{__scopeCheckbox:n})]})})});LE.displayName=d0;var O7="CheckboxIndicator",A7=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,a=DE(O7,n);return o.jsx(pr,{present:r||yo(a.checked)||a.checked===!0,children:o.jsx(Ce.span,{"data-state":I7(a.checked),"data-disabled":a.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});A7.displayName=O7;var T7="CheckboxBubbleInput",R7=b.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:s,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p}=DE(T7,e),g=Qe(n,p),m=zC(a),v=pN(r);b.useEffect(()=>{const y=h;if(!y)return;const w=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(w,"checked").set,j=!i.current;if(m!==a&&_){const k=new Event("click",{bubbles:j});y.indeterminate=yo(a),_.call(y,yo(a)?!1:a),y.dispatchEvent(k)}},[h,m,a,i]);const x=b.useRef(yo(a)?!1:a);return o.jsx(Ce.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??x.current,required:l,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:g,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});R7.displayName=T7;function uLe(e){return typeof e=="function"}function yo(e){return e==="indeterminate"}function I7(e){return yo(e)?"indeterminate":e?"checked":"unchecked"}const HS=b.forwardRef(({className:e,...t},n)=>o.jsx(LE,{ref:n,className:he("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-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),...t,children:o.jsx(A7,{className:he("flex items-center justify-center text-current"),children:o.jsx(To,{className:"h-4 w-4"})})}));HS.displayName=LE.displayName;const dLe=({businessId:e})=>{const t=_i(),[n,r]=b.useState(""),[i,a]=b.useState(""),[s,l]=b.useState([]),[c,u]=b.useState(null),{data:d=[],isLoading:f}=Na({queryKey:["scheduled-invitations",e],queryFn:async()=>{let _=Y.from("review_invitations").select("id, customer_email, customer_name, booking_date, scheduled_send_at, hold_until, approval_status, status, skip_reason, source").in("status",["scheduled","skipped"]).order("scheduled_send_at",{ascending:!0});e&&(_=_.eq("business_id",e));const{data:j,error:k}=await _;if(k)throw k;return j||[]},refetchInterval:6e4}),h=b.useMemo(()=>{const _=n.trim().toLowerCase();return d.filter(j=>{const k=!_||j.customer_email.toLowerCase().includes(_)||(j.customer_name||"").toLowerCase().includes(_),C=!i||(j.booking_date||"").slice(0,10)===i;return k&&C})},[d,n,i]),p=h.filter(_=>_.status==="scheduled"),g=s.filter(_=>p.some(j=>j.id===_)),m=p.length>0&&g.length===p.length,v=()=>{t.invalidateQueries({queryKey:["scheduled-invitations"]}),t.invalidateQueries({queryKey:["invitations"]})},x=async(_,j,k)=>{const{error:C}=await Y.from("review_invitations").update(j).eq("id",_);if(C){G.error("Could not update this invite");return}G.success(k),v()},y=async _=>{const{error:j}=await Y.from("review_invitations").update({status:"cancelled",approval_status:"cancelled"}).in("id",_);if(j){G.error("Could not cancel these invites");return}G.success(`${_.length} invite${_.length===1?"":"s"} cancelled`),l([]),u(null),v()},w=async _=>{const{error:j}=await Y.from("review_invitations").update({approval_status:"approved",hold_until:null,scheduled_send_at:new Date().toISOString()}).eq("id",_);if(j){G.error("Could not send this invite");return}await Y.functions.invoke("process-scheduled-invites"),G.success("Invite sent"),v()},S=_=>_.status==="skipped"?o.jsx(Se,{variant:"outline",className:"text-muted-foreground",children:"Skipped (recently invited)"}):_.hold_until&&new Date(_.hold_until)>new Date?o.jsxs(Se,{variant:"outline",children:["On hold until ",nn(new Date(_.hold_until),"MMM d, HH:mm")]}):_.approval_status==="approved"?o.jsx(Se,{variant:"secondary",children:"Approved"}):o.jsx(Se,{variant:"outline",children:"Needs approval"});return o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsxs(We,{className:"text-lg flex items-center gap-2",children:[o.jsx(_K,{className:"h-4 w-4 text-muted-foreground"}),"Scheduled Invitations"]}),o.jsx(ft,{children:"Review requests waiting to go out — from BCC'd booking confirmations. Cancel any that are no longer needed, for example if a tour was cancelled."})]}),o.jsxs(de,{children:[o.jsxs("div",{className:"mb-4 grid gap-2 sm:flex sm:flex-wrap sm:items-center",children:[o.jsxs("div",{className:"relative sm:w-64",children:[o.jsx(Uu,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),o.jsx(Te,{placeholder:"Search name or email",className:"w-full pl-9",value:n,onChange:_=>r(_.target.value)})]}),o.jsx(Te,{type:"date",className:"w-full sm:w-[170px]",value:i,onChange:_=>a(_.target.value)}),(n||i)&&o.jsx(X,{variant:"ghost",size:"sm",onClick:()=>{r(""),a("")},children:"Clear"}),o.jsxs("div",{className:"sm:ml-auto sm:flex sm:gap-2",children:[g.length>0&&o.jsxs(X,{variant:"destructive",size:"sm",onClick:()=>u(g),children:["Cancel selected (",g.length,")"]}),(n||i)&&p.length>0&&o.jsxs(X,{variant:"outline",size:"sm",onClick:()=>u(p.map(_=>_.id)),children:["Cancel all shown (",p.length,")"]})]})]}),f?o.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"Loading…"}):h.length===0?o.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:d.length===0?"N
772othing scheduled yet. BCC your inbound address on a booking confirmation to get started.":"No invites match your search."}):o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Rl,{children:[o.jsx(Il,{children:o.jsxs(ir,{children:[o.jsx(rt,{className:"w-10",children:o.jsx(HS,{checked:m,onCheckedChange:_=>l(_?p.map(j=>j.id):[]),"aria-label":"Select all"})}),o.jsx(rt,{children:"Customer"}),o.jsx(rt,{children:"Booking date"}),o.jsx(rt,{children:"Sends on"}),o.jsx(rt,{children:"Status"}),o.jsx(rt,{className:"text-right",children:"Actions"})]})}),o.jsx(Ml,{children:h.map(_=>{const j=_.status==="skipped";return o.jsxs(ir,{className:j?"opacity-60":void 0,children:[o.jsx(tt,{children:!j&&o.jsx(HS,{checked:s.includes(_.id),onCheckedChange:k=>l(C=>k?[...C,_.id]:C.filter(E=>E!==_.id)),"aria-label":`Select ${_.customer_email}`})}),o.jsxs(tt,{children:[o.jsx("div",{className:"font-medium",children:_.customer_name||"—"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:_.customer_email})]}),o.jsx(tt,{className:"text-sm text-muted-foreground",children:_.booking_date?nn(new Date(_.booking_date),"MMM d, yyyy"):"Not detected"}),o.jsx(tt,{children:j?o.jsx("span",{className:"text-sm text-muted-foreground",children:"—"}):o.jsx(Te,{type:"date",className:"h-8 w-[150px]",value:_.scheduled_send_at?_.scheduled_send_at.slice(0,10):"",onChange:k=>x(_.id,{scheduled_send_at:new Date(`${k.target.value}T10:00:00Z`).toISOString()},"Send date updated")})}),o.jsx(tt,{children:S(_)}),o.jsx(tt,{className:"text-right",children:!j&&o.jsxs("div",{className:"flex justify-end gap-1",children:[_.approval_status!=="approved"&&o.jsxs(X,{variant:"ghost",size:"sm",className:"gap-1",onClick:()=>x(_.id,{approval_status:"approved"},"Invite approved"),children:[o.jsx(To,{className:"h-3.5 w-3.5"}),"Approve"]}),o.jsxs(X,{variant:"ghost",size:"sm",className:"gap-1",onClick:()=>w(_.id),children:[o.jsx(ac,{className:"h-3.5 w-3.5"}),"Send now"]}),o.jsxs(X,{variant:"ghost",size:"sm",className:"gap-1 text-muted-foreground",onClick:()=>u([_.id]),children:[o.jsx(Ro,{className:"h-3.5 w-3.5"}),"Cancel"]})]})})]},_.id)})})]})})]}),o.jsx(Zb,{open:c!==null,onOpenChange:_=>!_&&u(null),children:o.jsxs(km,{children:[o.jsxs(Nm,{children:[o.jsxs(Em,{children:["Cancel ",(c==null?void 0:c.length)??0," invite",((c==null?void 0:c.length)??0)===1?"":"s","?"]}),o.jsx(Pm,{children:"These customers will not receive a review request. You can still see them in your invitation history, marked as cancelled."})]}),o.jsxs(Cm,{children:[o.jsx(Am,{children:"Keep them"}),o.jsx(Om,{onClick:()=>c&&y(c),children:"Cancel invites"})]})]})})]})},qM=({open:e,onOpenChange:t,businessId:n,customerName:r,context:i,sentEmail:a=null})=>{const[s,l]=b.useState(!1),[c,u]=b.useState(null),d=!!a,f=async()=>{if(!(!n||d)){l(!0);try{const{data:h,error:p}=await Y.functions.invoke("preview-invite-email",{body:{business_id:n,customer_name:r||null,context:i||null,personalise:!0}});if(p)throw p;if(h!=null&&h.error)throw new Error(h.error);u(h)}catch(h){console.error("Email preview failed:",h),G.error("Couldn't load the email preview. Please try again.")}finally{l(!1)}}};return b.useEffect(()=>{e&&!d&&f()},[e,n]),o.jsx(sc,{open:e,onOpenChange:t,children:o.jsxs(Mo,{className:"max-w-2xl",children:[o.jsxs($o,{children:[o.jsx(Do,{children:d?"Sent email":"Email preview"}),o.jsx(kN,{children:d?"This is the exact email that was delivered to your customer.":"This is what your customer receives. Wording is generated fresh for each customer, so the live email will differ slightly."})]}),d?a!=null&&a.html?o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1 rounded-lg border border-border bg-muted/30 p-3 text-sm",children:[o.jsxs("p",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"To:"})," ",r?`${r} <${a.recipient}>`:a.recipient]}),o.jsxs("p",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Subject:"})," ",a.subject||"—"]}),a.sentAt&&o.jsxs("p",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Sent:"}
772)," ",new Date(a.sentAt).toLocaleString()]})]}),o.jsx("div",{className:"overflow-hidden rounded-lg border border-border bg-background",children:o.jsx("iframe",{srcDoc:a.html,title:"Sent invitation email",sandbox:"",className:"h-[420px] w-full"})})]}):o.jsx("div",{className:"flex h-[420px] items-center justify-center px-6 text-center text-sm text-muted-foreground",children:"A copy of this email wasn't saved. Emails sent from now on are stored and can be viewed here."}):s?o.jsx("div",{className:"flex h-[420px] items-center justify-center",children:o.jsx(ke,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):c?o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1 rounded-lg border border-border bg-muted/30 p-3 text-sm",children:[o.jsxs("p",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"From:"})," ",c.from]}),o.jsxs("p",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"To:"})," ",r?`${r} <[email protected]>`:"[email protected]"]}),o.jsxs("p",{className:"text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Subject:"})," ",c.subject]})]}),o.jsx("div",{className:"overflow-hidden rounded-lg border border-border bg-background",children:o.jsx("iframe",{srcDoc:c.html,title:"Invitation email preview",sandbox:"",className:"h-[420px] w-full"})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(bn,{className:"h-3.5 w-3.5"}),c.personalised?"Personalised with AI":"Standard template (AI personalisation unavailable)"]}),o.jsxs(X,{variant:"outline",size:"sm",className:"gap-1.5",onClick:f,children:[o.jsx(zi,{className:"h-3.5 w-3.5"}),"Regenerate"]})]})]}):o.jsx("div",{className:"flex h-[420px] items-center justify-center text-sm text-muted-foreground",children:"No preview available."})]})})},fLe=({business:e,onRefresh:t})=>{const{links:n,isLoading:r}=r9(e.id),[i,a]=b.useState(!1);if(r)return null;const s=!!e.review_page_logo_url,l=n.length>0;if(s&&l)return null;const c=[!s&&"a custom logo",!l&&"review platform links"].filter(Boolean);return o.jsxs(o.Fragment,{children:[o.jsxs(k7,{variant:"destructive",children:[o.jsx(C5,{className:"h-4 w-4"}),o.jsx(N7,{children:"Business profile page not ready"}),o.jsxs(C7,{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("span",{children:["Your customers will see the public review page when they click the invite link. Finish setting it up by adding ",c.join(" and ")," before sending invitations."]}),o.jsxs(X,{variant:"outline",size:"sm",onClick:()=>a(!0),className:"shrink-0 gap-1.5",children:[o.jsx(w5,{className:"h-3.5 w-3.5"}),"Set up profile page"]})]})]}),o.jsx(a9,{open:i,onOpenChange:u=>{a(u),u||t()},businessId:e.id,businessName:e.name,address:e.address,googlePlaceId:e.google_place_id,tripadvisorUrl:e.tripadvisor_url,reviewPageLogoUrl:e.review_page_logo_url,reviewPageDescription:e.review_page_description,phone:e.phone,email:e.email,website:e.website})]})},hLe=()=>{var V,D;const{user:e,loading:t}=Mt(),{businesses:n,isLoading:r,refetch:i}=Lo(),[a,s]=b.useState(""),{invitations:l,isLoading:c,sendInvites:u,stats:d,isTrial:f,trialInviteCap:h,trialInvitesUsed:p,trialInvitesRemaining:g}=tLe(a||void 0),[m,v]=b.useState([{email:"",name:"",context:""}]),[x,y]=b.useState(""),[w,S]=b.useState(""),[_,j]=b.useState(!1),[k,C]=b.useState(!1),[E,A]=b.useState(null),[P,T]=b.useState("single");if(t)return null;if(!e)return o.jsx(Yi,{to:"/login",replace:!0});const B=n.find(K=>K.id===a),F=()=>v([...m,{email:"",name:"",context:""}]),M=K=>v(m.filter((ae,se)=>se!==K)),L=(K,ae,se)=>{const Q=[...m];Q[K]={...Q[K],[ae]:se},v(Q)},R=()=>x.split(`
773`).map(K=>K.trim()).filter(Boolean).map(K=>{const ae=K.split(",").map(se=>se.trim());return{email:ae[0]||"",name:ae[1]||"",context:w}}).filter(K=>K.email.includes("@")),$=async K=>{if(!a){G.error("Please select a business");return}const ae=K?R():m.filter(Q=>Q.email.includes("@"));if(ae.length===0){G.error("Please add at least one valid email");return}const se=(B==null?void 0:B.invite_dedupe_days)??90;if(se>0){const Q=new Date(Date.now()-se*24*60*60*1e3).toISOString(),ne=ae.map(ee=>ee.email.toLowerCase()),{data:Z}=await Y.from("review_invitations").select("customer_email").eq("business_id",a).in("customer_email",ne).gt("created_at",Q),W=Array.from(new Set((Z||[]).map(ee=>ee.customer_email)));if(W.length>0){const ee=W.slice(0,5).join(", ")+(W.length>5?`, +${W.length-5} more`:"");if(!window.confirm(`${W.length}
773 of these customers were already invited in the last ${se} days (${ee}).
774
775Send anyway?`))return}}u.mutate({business_id:a,invitations:ae.map(Q=>({email:Q.email,...Q.name?{name:Q.name}:{},...Q.context?{context:Q.context}:{}}))}),K?(y(""),S("")):v([{email:"",name:"",context:""}])},O=f?o.jsx("div",{className:"rounded-lg border border-border bg-muted/40 p-3 text-sm text-muted-foreground",children:g>0?o.jsxs(o.Fragment,{children:["Free trial: ",o.jsxs("span",{className:"font-medium text-foreground",children:[p,"/",h]})," invitations used."," ",o.jsx(on,{to:"/settings?tab=billing",className:"font-medium text-primary underline-offset-2 hover:underline",children:"Upgrade"})," ","to send unlimited invitations."]}):o.jsxs(o.Fragment,{children:["You've used all ",h," free trial invitations."," ",o.jsx(on,{to:"/settings?tab=billing",className:"font-medium text-primary underline-offset-2 hover:underline",children:"Upgrade"})," ","to keep inviting customers."]})}):null,N=K=>o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(X,{onClick:()=>$(K),disabled:u.isPending||!a||g<=0,className:"gap-2",children:[o.jsx(ac,{className:"h-4 w-4"}),u.isPending?"Sending...":"Send Invitations"]}),o.jsxs(X,{variant:"outline",onClick:()=>{C(K),j(!0)},disabled:!a,className:"gap-2",children:[o.jsx(uh,{className:"h-4 w-4"}),"Preview email"]})]}),H=K=>{switch(K){case"sent":return o.jsxs(Se,{variant:"secondary",className:"gap-1",children:[o.jsx(as,{className:"h-3 w-3"}),"Sent"]});case"delivered":return o.jsxs(Se,{variant:"secondary",className:"gap-1",children:[o.jsx(LK,{className:"h-3 w-3"}),"Delivered"]});case"opened":return o.jsxs(Se,{variant:"outline",className:"gap-1 border-info text-info",children:[o.jsx(E2,{className:"h-3 w-3"}),"Opened"]});case"clicked":return o.jsxs(Se,{className:"gap-1 bg-primary",children:[o.jsx(DK,{className:"h-3 w-3"}),"Clicked"]});case"completed":return o.jsxs(Se,{className:"gap-1 bg-primary",children:[o.jsx(j2,{className:"h-3 w-3"}),"Completed"]});default:return o.jsx(Se,{variant:"outline",children:K})}};return o.jsx(Qn,{children:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-2xl font-bold text-foreground",children:"Invite Customers"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Send email invitations to your customers asking them to leave a review."})]}),o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{className:"text-lg",children:"Select a Business"}),o.jsx(ft,{children:"Choose which business you want to send invitations for."})]}),o.jsx(de,{children:o.jsxs(St,{value:a,onValueChange:s,children:[o.jsx(wt,{className:"w-full md:w-[360px]",children:o.jsx(kt,{placeholder:"Select a business"})}),o.jsx(_t,{children:n.map(K=>o.jsx(we,{value:K.id,children:K.name},K.id))})]})})]}),B&&o.jsx(fLe,{business:B,onRefresh:i}),o.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[o.jsx(pe,{children:o.jsxs(de,{className:"flex items-center gap-3 p-4",children:[o.jsx("div",{className:"rounded-lg bg-secondary p-2",children:o.jsx(Ax,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-bold text-foreground",children:d.total}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Sent"})]})]})}),o.jsx(pe,{children:o.jsxs(de,{className:"flex items-center gap-3 p-4",children:[o.jsx("div",{className:"rounded-lg bg-secondary p-2",children:o.jsx(as,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-bold text-foreground",children:d.sent}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Delivered"})]})]})}),o.jsx(pe,{children:o.jsxs(de,{className:"flex items-center gap-3 p-4",children:[o.jsx("div",{className:"rounded-lg bg-secondary p-2",children:o.jsx(E2,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-bold text-foreground",children:d.opened}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Opened"})]})]})}),o.jsx(pe,{children:o.jsxs(de,{className:"flex items-center gap-3 p-4",children:[o.jsx("div",{className:"rounded-lg bg-secondary p-2",children:o.jsx(j2,{className:"h-5 w-5 text-primary"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-bold text-foreground",children:d.completed}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"Profile Clicks"})]})]})})]}),a?o.jsxs(Tm,{value:P,onValueChange:T,className:"space-y-6",children:[o.jsxs(nf,{className:"grid w-full grid-cols-2 md:w-auto md:inline-grid md:grid-cols-4",children:[o.jsxs(Kn,{value:"single",className:"gap-1.5",children:[o.jsx(Wl,{className:"h-3.5 w-3.5"}),"Single invites"]}),o.jsxs(Kn,{value:"bulk",className:"gap-1.5",children:[o.jsx(E5,{className:"h-3.5 w-3.5"}),"Bulk invites"]}),o.jsxs(Kn,{value:"auto",className:"gap-1.5",children:[o.jsx(bn,{className:"h-3.5 w-3.5"}),"Auto invites"]}),o.jsxs(Kn,{value:"history",className:"gap-1.5",children:[o.jsx(AK,{className:"h-3.5 w-3.5"}),"History"]})]}),o.jsxs(kr,{value:"single",className:"space-y-6",children:[o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{className:"text-lg",children:"Send Invitations"}),o.jsx(ft,{children:"Enter your customers' email addresses to invite them to leave a review."})]}),o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-4",children:[m.map((K,ae)=>o.jsxs("div",{className:"space-y-2 rounded-lg border border-border p-3",children:[o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[ae===0&&o.jsx(Pe,{className:"text-xs",children:"Email"}),o.jsx(Te,{type:"email",placeholder:"[email protected]",value:K.email,onChange:se=>L(ae,"email",se.target.value)})]}),o.jsxs("div",{className:"flex-1 space-y-1",children:[ae===0&&o.jsx(Pe,{className:"text-xs",children:"Name (optional)"}),o.jsx(Te,{placeholder:"John Doe",value:K.name,onChange:se=>L(ae,"name",se.target.value)})]}),m.length>1&&o.jsx(X,{variant:"ghost",size:"icon",onClick:()=>M(ae),children:o.jsx(Md,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsxs("div",{className:"space-y-1",children:[ae===0&&o.jsx(Pe,{className:"text-xs text-muted-foreground",children:"Context for AI personalisation (optional)"}),o.jsx(Te,{placeholder:"e.g. Purchased the Premium Web Design package last week",value:K.context,onChange:se=>L(ae,"context",se.target.value)})]})]},ae)),o.jsxs(X,{variant:"outline",size:"sm",onClick:F,className:"gap-1",children:[o.jsx(_o,{className:"h-3.5 w-3.5"}),"Add another"]})]}),O,N(!1)]})]}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs(We,{className:"text-lg flex items-center gap-2",children:[o.jsx(uh,{className:"h-4 w-4 text-muted-foreground"}),"Customer Landing Page"]}),o.jsx(ft,{children:"This is the review profile your customers will see when they click the link in the invite email."})]}),o.jsx("div",{className:"flex gap-2",children:o.jsx(X,{variant:"outline",size:"sm",className:"gap-1.5",asChild:!0,children:o.jsxs("a",{href:`https://my.reviewkit.com/r/${a}
775`,target:"_blank",rel:"noopener noreferrer",children:[o.jsx(sr,{className:"h-3.5 w-3.5"}),"Open"]})})})]})}),o.jsxs(de,{children:[o.jsx("div",{className:"rounded-lg border border-border overflow-hidden bg-muted/30",children:o.jsx("iframe",{src:`/r/${a}`,className:"w-full h-[420px] pointer-events-none",title:"Review Profile Preview"})}),o.jsxs("p",{className:"text-xs text-muted-foreground mt-2 text-center",children:["You can customize this page from the ",o.jsx("strong",{children:"Businesses → Profile"})," settings."]})]})]})]}),o.jsx(kr,{value:"bulk",className:"space-y-6",children:o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{className:"text-lg",children:"Bulk Invitations"}),o.jsx(ft,{children:"Paste a list of customer emails to invite them all at once."})]}),o.jsxs(de,{className:"space-y-4",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Pe,{children:"Paste emails (one per line, optionally: email, name)"}),o.jsx(ds,{placeholder:`[email protected], John Doe
776[email protected], Jane Smith
777[email protected]`,value:x,onChange:K=>y(K.target.value),rows:8}),x&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:[R().length," valid email",R().length!==1?"s":""," detected"]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx(Pe,{className:"text-xs text-muted-foreground",children:"Context for AI personalisation (optional — applies to all)"}),o.jsx(Te,{placeholder:"e.g. Attended our grand opening event last Saturday",value:w,onChange:K=>S(K.target.value)})]}),O,N(!0)]})]})}),o.jsxs(kr,{value:"auto",className:"space-y-6",children:[B&&o.jsx(sLe,{business:B}),o.jsx(dLe,{businessId:a})]}),o.jsx(kr,{value:"history",className:"space-y-6",children:o.jsxs(pe,{children:[o.jsxs(ze,{children:[o.jsx(We,{className:"text-lg",children:"Invitation History"}),o.jsx(ft,{children:"Track the status of your sent invitations."})]}),o.jsx(de,{children:c?o.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"Loading…"}):l.length===0?o.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No invitations sent yet for this business."}):o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(Rl,{children:[o.jsx(Il,{children:o.jsxs(ir,{children:[o.jsx(rt,{children:"Customer"}),o.jsx(rt,{children:"Email"}),o.jsx(rt,{children:"Status"}),o.jsx(rt,{children:"Sent"}),o.jsx(rt,{className:"text-right",children:"Email"})]})}),o.jsx(Ml,{children:l.map(K=>o.jsxs(ir,{children:[o.jsx(tt,{className:"font-medium",children:K.customer_name||"—"}),o.jsx(tt,{className:"text-muted-foreground",children:K.customer_email}),o.jsx(tt,{children:H(K.status)}),o.jsx(tt,{className:"text-muted-foreground text-sm",children:K.sent_at?nn(new Date(K.sent_at),"MMM d, yyyy"):"—"}),o.jsx(tt,{className:"text-right",children:o.jsxs(X,{variant:"ghost",size:"sm",className:"gap-1.5",onClick:()=>A(K),children:[o.jsx(uh,{className:"h-3.5 w-3.5"}),"View"]}
777)})]},K.id))})]})})})]})})]}):o.jsx(pe,{children:o.jsx(de,{className:"py-10 text-center text-sm text-muted-foreground",children:"Select a business above to start sending invitations."})}),a&&o.jsxs(o.Fragment,{children:[o.jsx(qM,{open:_,onOpenChange:j,businessId:a,customerName:k?void 0:((V=m[0])==null?void 0:V.name)||void 0,context:k?w||void 0:((D=m[0])==null?void 0:D.context)||void 0}),o.jsx(qM,{open:!!E,onOpenChange:K=>!K&&A(null),businessId:a,customerName:(E==null?void 0:E.customer_name)||void 0,sentEmail:E?{subject:E.sent_subject??null,html:E.sent_html??null,recipient:E.customer_email,sentAt:E.sent_at}:null})]})]})})},pLe=({currentUserId:e})=>{const{toast:t}=Yk(),[n,r]=b.useState(null),i=async l=>{r(l);try{const{data:c,error:u}=await Y.functions.invoke("test-notification",{body:{type:l,target_user_id:e}});if(u)throw u;if(c!=null&&c.error)throw new Error(c.error);t({title:"Test email queued",description:`${a[l]} email sent to ${c.email}. Check your inbox shortly.`})}catch(c){t({title:"Failed to send test",description:c.message,variant:"destructive"})}finally{r(null)}},a={new_review:"New Review Alert",negative_review:"Negative Review Alert",weekly_digest:"Weekly Digest"},s=[{type:"new_review",label:"New Review Alert",description:"Sends a test notification with 2 mock positive reviews",icon:o.jsx(ac,{className:"h-4 w-4"}),color:"text-primary"},{type:"negative_review",label:"Negative Review Alert",description:"Sends a test notification with a 1-star mock review",icon:o.jsx(C5,{className:"h-4 w-4"}),color:"text-destructive"},{type:"weekly_digest",label:"Weekly Digest",description:"Sends a summary of the past 7 days of real review data",icon:o.jsx(Px,{className:"h-4 w-4"}),color:"text-primary"}];return o.jsxs(pe,{children:[o.jsxs(ze,{className:"flex flex-row items-center gap-2 pb-3",children:[o.jsx(as,{className:"h-4 w-4 text-muted-foreground"}),o.jsx(We,{className:"text-sm font-medium",children:"Test Notifications"}),o.jsx(Se,{variant:"outline",className:"text-[10px] ml-auto",children:"Sends to you"})]}),o.jsx(de,{children:o.jsx("div",{className:"grid gap-2 sm:grid-cols-3",children:s.map(({type:l,label:c,description:u,icon:d,color:f})=>o.jsxs("button",{onClick:()=>i(l),disabled:n!==null,className:"flex flex-col items-start gap-1.5 rounded-lg border bg-card p-3 text-left transition-colors hover:bg-muted/50 disabled:opacity-50",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:f,children:d}),o.jsx("span",{className:"text-sm font-medium",children:c})]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:u}),n===l&&o.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[o.jsx(ke,{className:"h-3 w-3 animate-spin"}),"Sending..."]})]},l))})})]})},mLe=Wz,gLe=tE,vLe=rE,yLe=[{event:"signed_up",label:"Signed up"},{event:"welcome_shown",label:"Saw welcome"},{event:"welcome_get_started",label:"Pressed Get started"},{event:"add_business_opened",label:"Opened add business"},{event:"add_business_name_entered",label:"Entered a name"},{event:"add_business_platform_selected",label:"Chose a platform"},{event:"business_created_pending_connection",label:"Business saved (no connection yet)"},{event:"business_added",label:"Platform connected"},{event:"add_business_failed",label:"Save failed"}],xLe=()=>{var r;const[e,t]=b.useState(null);b.useEffect(()=>{(async()=>{const a=new Date(Date.now()-2592e6).toISOString(),{data:s,error:l}=await Y.from("onboarding_events").select("event,user_id").gte("created_at",a).limit(5e3);if(l){t([]);return}t(yLe.map(({event:c,label:u})=>({label:u,users:new Set((s??[]).filter(d=>d.event===c).map(d=>
777d.user_id)).size})))})()},[]);const n=((r=e==null?void 0:e[0])==null?void 0:r.users)??0;return o.jsxs(pe,{children:[o.jsx(ze,{children:o.jsxs(We,{className:"flex items-center gap-2 text-lg",children:[o.jsx(k5,{className:"h-5 w-5 text-primary"}),"Onboarding funnel (last 30 days)"]})}),o.jsx(de,{className:"space-y-3",children:e?n===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps recorded yet — data starts collecting from now on."}):e.map(i=>o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsx("span",{className:"text-foreground",children:i.label}),o.jsxs("span",{className:"text-muted-foreground",children:[i.users," ",n>0&&`(${Math.round(i.users/n*100)}%)`]})]}),o.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-primary",style:{width:`${n>0?i.users/n*100:0}%`}})})]},i.label)):o.jsx(ba,{className:"h-40 w-full"})})]})},bLe=()=>{const{user:e,loading:t}=Mt(),{toast:n}=Yk(),[r,i]=b.useState([]),[a,s]=b.useState(!0),[l,c]=b.useState(""),[u,d]=b.useState(null),[f,h]=b.useState(null),[p,g]=b.useState(null),[m,v]=b.useState(null),[x,y]=b.useState(null),w=async(R,$,O)=>{y(R);try{const{data:N,error:H}=await Y.functions.invoke("admin-grant-access",{body:{target_user_id:R,grant:O}});if(H)throw H;if(N!=null&&N.error)throw new Error(N.error);n({title:O?"Access granted":"Access revoked",description:$}),j()}catch(N){n({title:"Failed",description:N.message,variant:"destructive"})}finally{y(null)}},S=async(R,$)=>{v(R);try{const{data:O,error:N}=await Y.functions.invoke("admin-sync-business",{body:{business_id:R}});if(N)throw N;if(O!=null&&O.error)throw new Error(O.error);n({title:"Sync started",description:`Syncing ${$}...`})}catch(O){n({title:"Sync failed",description:O.message,variant:"destructive"})}finally{v(null)}},_=async(R,$)=>{if(confirm(`Sign in as ${$}? You will be logged out of your current session.`)){g(R);try{const{data:O,error:N}=await Y.functions.invoke("impersonate-user",{body:{target_user_id:R,redirect_url:window.location.origin}});if(N)throw N;if(O!=null&&O.error)throw new Error(O.error);O!=null&&O.url&&window.open(O.url,"_blank")}catch(O){n({title:"Impersonation failed",description:O.message,variant:"destructive"})}finally{g(null)}}};b.useEffect(()=>{e&&Y.from("user_roles").select("role").eq("user_id",e.id).eq("role","admin").maybeSingle().then(({data:R})=>{d(!!R)})},[e]),b.useEffect(()=>{u&&j()},[u]);const j=async(R="")=>{s(!0);try{const{data:$,error:O}=await Y.functions.invoke("admin-dashboard",{body:null,headers:{}});if(O)throw O;i($||[])}catch($){n({title:"Error loading admin data",description:$.message,variant:"destructive"})}finally{s(!1)}},k=b.useMemo(()=>{if(!l)return r;const R=l.toLowerCase();return r.filter($=>$.email.toLowerCase().includes(R)||$.businesses.some(O=>O.name.toLowerCase().includes(R)))},[r,l]);if(t||!e||u===null)return o.jsx(Qn,{children:o.jsxs("div",{className:"space-y-4",children:[o.jsx(ba,{className:"h-8 w-48"}),o.jsx(ba,{className:"h-64 w-full"})]})});if(!u)return o.jsx(Yi,{to:"/",replace:!0});const C=r.reduce((R,$)=>R+$.businesses.length,0),E=r.filter(R=>R.subscription&&(R.subscription.status==="active"||R.subscription.status==="trialing")).length,A=r.reduce((R,$)=>R+$.businesses.filter(O=>O.sync_status==="error").length,0),P=r.filter(R=>R.businesses.length===0).sort((R,$)=>new Date($.created_at).getTime()-new Date(R.created_at).getTime()),T=r.flatMap(R=>R.businesses.filter($=>!$.google_place_id&&!$.tripadvisor_url&&!$.trustpilot_url&&!$.getyourguide_url&&!$.yelp_url).map($=>({...$,email:R.email,userId:R.id}))),B=R=>R?new Date(R).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"Never",F=R=>{if(!R)return"Never";const $=Date.now()-new Date(R).getTime(),O=Math.floor($/(1e3*60*60));return O<1?"< 1 hour ago":O<24?`${O}h ago`:`${Math.floor(O/24)}d ago`},M=R=>R?R==="active"?"default":R==="trialing"?"outline":"destructive":"secondary",L=R=>R?R==="synced"?"default":R==="syncing"?"outline":"destructive":"secondary";return o.jsx(Qn,{children:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(j5,{className:"h-6 w-6 text-primary"}),o.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Admin Dashboard"})]}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[o.jsxs(pe,{children:[o.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[o.jsx(We,{className:"text-sm font-medium text-muted-foreground",children:"Total Users"}),o.jsx(Ax,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(de,{children:o.jsx("div",{className:"text-2xl font-bold",children:r.length})})]}),o.jsxs(pe,{children:[o.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[o.jsx(We,{className:"text-sm font-medium text-muted-foreground",children:"Total Businesses"}),o.jsx(Jr,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(de,{children:o.jsx("div",{className:"text-2xl font-bold",children:C})})]}),o.jsxs(pe,{children:[o.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[o.jsx(We,{className:"text-sm font-medium text-muted-foreground",children:"Active Subscriptions"}),o.jsx(pi,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(de,{children:o.jsx("div",{className:"text-2xl font-bold",children:E})})]}),o.jsxs(pe,{children:[o.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[o.jsx(We,{className:"text-sm font-medium text-muted-foreground",children:"Sync Issues"}),o.jsx(Lv,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(de,{children:o.jsx("div",{className:"text-2xl font-bold text-destructive",children:A})})]})]}),o.jsx(xLe,{}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs(We,{className:"text-base flex items-center gap-2",children:[o.jsx(YK,{className:"h-4 w-4 text-muted-foreground"}),"Signed up, no business (",P.length,")"]})}),o.jsx(de,{children:P.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"Everyone who signed up has added a business."}):o.jsx("div",{className:"rounded-md border",children:o.jsxs(Rl,{children:[o.jsx(Il,{children:o.jsxs(ir,{children:[o.jsx(rt,{children:"Email"}),o.jsx(rt,{children:"Signed up"}),o.jsx(rt,{children:"Last sign-in"}),o.jsx(rt,{className:"text-right",children:"Action"})]})}),o.jsx(Ml,{children:P.map(R=>o.jsxs(ir,{children:[o.jsx(tt,{className:"font-medium",children:R.email}),o.jsx(tt,{className:"text-muted-foreground",children:B(R.created_at)}),o.jsx(tt,{className:"text-muted-foreground",children:F(R.last_sign_in_at)}),o.jsx(tt,{className:"text-right",children:o.jsx(X,{variant:"outline",size:"sm",asChild:!0,children:o.jsxs("a",{href:`mailto:${R.email}?subject=${encodeURIComponent("Need a hand setting up Review Kit?")}`,children:[o.jsx(as,{className:"h-3.5 w-3.5 mr-1.5"}),"Email"]})})})]},R.id))})]})})})]}),o.jsxs(pe,{children:[o.jsx(ze,{className:"pb-3",children:o.jsxs(We,{className:"text-base flex items-center gap-2",children:[o.jsx(Lv,{className:"h-4 w-4 text-muted-foreground"}),"Added a business, no connection (",T.length,")"]})}),o.jsx(de,{children:T.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"Every business has at least one review platform connected."}):o.jsx("div",{className:"rounded-md border",children:o.jsxs(Rl,{children:[o.jsx(Il,{children:o.jsxs(ir,{children:[o.jsx(rt,{children:"Business"}),o.jsx(rt,{children:"Owner"}),o.jsx(rt,{className:"text-right",children:"Action"})]})}),o.jsx(Ml,{children:T.map(R=>o.jsxs(ir,{children:[o.jsx(tt,{className:"font-medium",children:R.name}),o.jsx(tt,{className:"text-muted-foreground",children:R.email}),o.jsx(tt,{className:"text-right",children:o.jsx(X,{variant:"outline",size:"sm",asChild:!0,children:o.jsxs("a",{href:`mailto:${R.email}?subject=${encodeURIComponent(`Need a hand connecting ${R.name}?`)}`,children:[o.jsx(as,{className:"h-3.5 w-3.5 mr-1.5"}),"Email"]})})})]},R.id))})]})})})]}),o.jsx(pLe,{currentUserId:e.id}),o.jsxs("div",{className:"relative max-w-md",children:[o.jsx(Uu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Te,{placeholder:"Search by email or business name...",value:l,onCh
777ange:R=>c(R.target.value),className:"pl-9"})]}),a?o.jsx("div",{className:"space-y-2",children:[...Array(5)].map((R,$)=>o.jsx(ba,{className:"h-16 w-full"},$))}):o.jsx("div",{className:"rounded-md border",children:o.jsxs(Rl,{children:[o.jsx(Il,{children:o.jsxs(ir,{children:[o.jsx(rt,{className:"w-8"}),o.jsx(rt,{children:"Email"}),o.jsx(rt,{children:"Businesses"}),o.jsx(rt,{children:"Subscription"}),o.jsx(rt,{children:"Reviews"}),o.jsx(rt,{children:"Last Sign In"}),o.jsx(rt,{children:"Joined"}),o.jsx(rt,{className:"w-10"})]})}),o.jsxs(Ml,{children:[k.map(R=>{var O,N,H,V,D,K,ae,se,Q,ne,Z,W,ee,q;const $=f===R.id;return o.jsx(mLe,{open:$,onOpenChange:()=>h($?null:R.id),asChild:!0,children:o.jsxs(o.Fragment,{children:[o.jsx(gLe,{asChild:!0,children:o.jsxs(ir,{className:"cursor-pointer hover:bg-muted/50",children:[o.jsx(tt,{children:$?o.jsx(Rd,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Ox,{className:"h-4 w-4 text-muted-foreground"})}),o.jsx(tt,{className:"font-medium",children:R.email}),o.jsx(tt,{children:R.businesses.length}),o.jsx(tt,{children:o.jsx(Se,{variant:M((O=R.subscription)==null?void 0:O.status),children:((N=R.subscription)==null?void 0:N.status)||"none"})}),o.jsx(tt,{children:R.review_count}),o.jsx(tt,{className:"text-muted-foreground text-sm",children:F(R.last_sign_in_at)}),o.jsx(tt,{className:"text-muted-foreground text-sm",children:B(R.created_at)}),o.jsx(tt,{children:o.jsx(X,{variant:"ghost",size:"icon",className:"h-7 w-7",title:`Sign in as ${R.email}`,disabled:p===R.id,onClick:re=>{re.stopPropagation(),_(R.id,R.email)},children:p===R.id?o.jsx(ke,{className:"h-3.5 w-3.5 animate-spin"}):o.jsx(RK,{className:"h-3.5 w-3.5"})})})]})}),o.jsx(vLe,{asChild:!0,children:o.jsx(ir,{children:o.jsx(tt,{colSpan:8,className:"bg-muted/30 p-4",children:o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Businesses"}),R.businesses.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No businesses"}):o.jsx("div",{className:"space-y-2",children:R.businesses.map(re=>o.jsxs("div",{className:"rounded border bg-card p-3 text-sm",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"font-medium",children:re.name}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(X,{variant:"ghost",size:"icon",className:"h-6 w-6",title:`Force sync ${re.name}`,disabled:m===re.id,onClick:()=>S(re.id,re.name),children:m===re.id?o.jsx(ke,{className:"h-3 w-3 animate-spin"}):o.jsx(zi,{className:"h-3 w-3"})}),o.jsx(Se,{variant:L(re.sync_status),className:"text-xs",children:re.sync_status||"never synced"})]})]}),o.jsxs("div",{className:"mt-1 text-muted-foreground text-xs space-y-0.5",children:[o.jsxs("p",{children:["Last synced: ",F(re.last_synced_at)]}),re.sync_message&&o.jsx("p",{className:"text-destructive",children:re.sync_message}),o.jsxs("div",{className:"flex gap-2 mt-1",children:[re.google_place_id&&o.jsx(Se,{variant:"outline",className:"text-xs",children:"Google"}),re.tripadvisor_url&&o.jsx(Se,{variant:"outline",className:"text-xs",children:"TripAdvisor"}),re.trustpilot_url&&o.jsx(Se,{variant:"outline",className:"text-xs",children:"Trustpilot"})]})]})]},re.id))}),R.subscription&&o.jsxs("div",{className:"mt-3",children:[o.jsx("h4",{className:"font-semibold text-sm mb-1",children:"Subscription"}),o.jsxs("div",{className:"text-xs text-muted-foreground space-y-0.5",children:[o.jsxs("p",{children:["Status: ",R.subscription.status]}),o.jsxs("p",{children:["Period end: ",B(R.subscription.current_period_end)]}),R.subscription.trial_end&&o.jsxs("p",{children:["Trial end: ",B(R.subscription.trial_end)]}),o.jsx("p",{className:"font-mono text-[10px]",children:R.subscription.stripe_customer_id})]})]}),o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(PK,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-sm font-semibold",children:"Manual Access"})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[o.jsx(vo,{checked:((H=R.subscription)==null?void 0:H.status)==="active"&&((D=(V=R.subscription)==null?void 0:V.stripe_customer_id)==null?void 0:D.startsWith("manual_grant_")),disabled:x===R.id||((K=R.subscription)==null?void 0:K.status)==="active"&&!((se=(ae=R.subscription)==null?void 0:ae.stripe_customer_id)!=null&&se.startsWith("manual_grant_")),onCheckedChange:re=>w(R.id,R.email,re)}),o.jsx("span",{className:"text-xs text-muted-foreground",children:x===R.id?"Updating...":((Q=R.subscription)==null?void 0:Q.status)==="active"&&!((Z=(ne=R.subscription)==null?void 0:ne.stripe_customer_id)!=null&&Z.startsWith("manual_grant_"))?"Has Stripe subscription":((W=R.subscription)==null?void 0:W.status)==="active"&&((q=(ee=R.subscription)==null?void 0:ee.stripe_customer_id)!=null&&q.startsWith("manual_grant_"))?"Manually granted":"Grant full access"})]})]})]}),o.jsxs("div",{children:[o.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Recent Reviews"}),R.recent_reviews.length===0?o.jsx("p",{className:"text-sm text-muted-foreground",children:"No reviews"}):o.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:R.recent_reviews.map(re=>o.jsxs("div",{className:"rounded border bg-card p-2 text-sm",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"font-medium text-xs",children:re.reviewer_name}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("span",{className:"text-xs",children:["★".repeat(re.rating),"☆".repeat(5-re.rating)]}),o.jsx(Se,{variant:"outline",className:"text-[10px]",children:re.source})]})]}),re.comment&&o.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:re.comment}),o.jsx("p",{className:"text-[10px] text-muted-foreground mt-1",children:B(re.review_date)})]},re.id))})]})]})})})})]})},R.id)}),k.length===0&&o.jsx(ir,{children:o.jsx(tt,{colSpan:8,className:"text-center text-muted-foreground py-8",children:l?"No users found matching your search":"No users found"})})]})]})})]})})},wLe=()=>{const[e]=rc(),t=e.get("token"),n=ps(),{user:r,loading:i}=Mt(),a=_i(),[s,l]=b.useState("loading"),[c,u]=b.useState("");return b.useEffect(()=>{if(i)return;if(!t){l("error"),u("Invalid invitation link");return}if(!r){l("login-required");return}(async()=>{try{const{data:f,error:h}=await Y.functions.invoke("accept-team-invite",{body:{invite_token:t}});if(h)throw h;if(f!=null&&f.error)throw new Error(f.error);await a.invalidateQueries(),l("success")}catch(f){l("error"),u(f.message||"Failed to accept invitation")}})()},[r,i,t]),o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:o.jsxs(pe,{className:"w-full max-w-md",children:[o.jsxs(ze,{className:"text-center",children:[o.jsx(We,{children:"Team Invitation"}),o.jsxs(ft,{children:[s==="loading"&&"Processing your invitation...",s==="login-required"&&"Please log in to accept this invitation",s==="success"&&"You're all set!",s==="error"&&"Something went wrong"]})]}),o.jsxs(de,{className:"flex flex-col items-center gap-4",children:[s==="loading"&&o.jsx(ke,{className:"h-8 w-8 animate-spin text-primary"}),s==="login-required"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"You need to log in or create an account to join the team."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(X,{asChild:!0,children:o.jsx(on,{to:`/login?redirect=${encodeURIComponent(`/accept-invite?token=${t}`)}`,children:"Log In"})}),o.jsx(X,{variant:"outline",asChild:!0,children:o.jsx(on,{to:`/signup?redirect=${encodeURIComponent(`/accept-invite?token=${t}`)}`,children:"Sign Up"})})]})]}),s==="success"&&o.jsxs(o.Fragment,{children:[o.jsx(ar,{className:"h-12 w-12 text-green-500"}),o.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"You've successfully joined the team. You can now view and manage their reviews."}),o.jsx(X,{onClick:()=>n("/"),children:"Go to Dashboard"})]}),s==="error"&&o.jsxs(o.Fragment,{children:[o.jsx(jK,{className:"h-12 w-12 text-destructive"}),o.jsx("p",{className:"text-sm text-muted-foreground text-center",children:c}),o.jsx(X,{variant:"outline",onClick:()=>n("/"),children:"Go to Dashboard"})]})]})]})})},_Le=()=>{var $;const{user:e}=Mt(),{businesses:t,isLoading:n}=Lo(),r=_i(),[i,a]=b.useState(""),[s,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState(1),h=20,[p,g]=b.useState(""),[m,v]=b.useState("all"),[x,y]=b.useState("found_at"),[w,S]=b.useState("desc"),_=i||(($=t[0])==null?void 0:$.id)||"",{data:j=[],isLoading:k}=Na({queryKey:["mentions",_],queryFn:async()=>
777{if(!_)return[];const{data:O,error:N}=await Y.from("mentions").select("*").eq("business_id",_).order("found_at",{ascending:!1});if(N)throw N;return O||[]},enabled:!!e&&!!_}),C=async()=>{if(_){l(!0);try{const{data:O,error:N}=await Y.functions.invoke("search-mentions",{body:{business_id:_}});if(N)throw N;G.success(`Scan complete: ${O.new_mentions} new mention(s) found`),r.invalidateQueries({queryKey:["mentions",_]})}catch(O){G.error(O.message||"Scan failed")}finally{l(!1)}}},E=async O=>{const{error:N}=await Y.from("mentions").update({dismissed:!O.dismissed}).eq("id",O.id);if(N){G.error("Failed to update");return}r.invalidateQueries({queryKey:["mentions",_]})},A=b.useMemo(()=>{const O=new Set;return j.forEach(N=>{N.source_domain&&O.add(N.source_domain)}),Array.from(O).sort()},[j]),P=b.useMemo(()=>{let O=c?j:j.filter(N=>!N.dismissed);if(p.trim()){const N=p.toLowerCase();O=O.filter(H=>(H.title||"").toLowerCase().includes(N)||(H.snippet||"").toLowerCase().includes(N)||(H.source_domain||"").toLowerCase().includes(N)||H.url.toLowerCase().includes(N))}return m!=="all"&&(O=O.filter(N=>N.source_domain===m)),O=[...O].sort((N,H)=>{let V,D;x==="found_at"?(V=N.found_at,D=H.found_at):x==="title"?(V=(N.title||"").toLowerCase(),D=(H.title||"").toLowerCase()):(V=(N.source_domain||"").toLowerCase(),D=(H.source_domain||"").toLowerCase());const K=V<D?-1:V>D?1:0;return w==="asc"?K:-K}),O},[j,c,p,m,x,w]),T=()=>f(1),B=Math.max(1,Math.ceil(P.length/h)),F=Math.min(d,B),M=P.slice((F-1)*h,F*h),L=O=>{x===O?S(N=>N==="asc"?"desc":"asc"):(y(O),S(O==="found_at"?"desc":"asc"))},R=({field:O})=>x!==O?o.jsx(yK,{className:"h-3 w-3"}):w==="asc"?o.jsx(xK,{className:"h-3 w-3"}):o.jsx(gK,{className:"h-3 w-3"});return o.jsx(Qn,{children:o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-2xl font-bold text-foreground",children:"Online Mentions"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"See where your business is mentioned across the web"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[t.length>1&&o.jsxs(St,{value:_,onValueChange:a,children:[o.jsx(wt,{className:"w-[200px]",children:o.jsx(kt,{placeholder:"Select business"})}),o.jsx(_t,{children:t.map(O=>o.jsx(we,{value:O.id,children:O.name},O.id))})]}),o.jsxs(X,{onClick:C,disabled:s||!_,children:[s?o.jsx(ke,{className:"h-4 w-4 animate-spin mr-2"}):o.jsx(Uu,{className:"h-4 w-4 mr-2"}),"Scan Now"]})]})]}),o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsxs("div",{className:"relative w-full",children:[o.jsx(Uu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),o.jsx(Te,{placeholder:"Search mentions by title, snippet, domain, or URL…",value:p,onChange:O=>{g(O.target.value),T()},className:"pl-9"})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsxs(St,{value:m,onValueChange:O=>{v(O),T()},children:[o.jsx(wt,{className:"w-[180px]",children:o.jsx(kt,{placeholder:"All sources"})}),o.jsxs(_t,{children:[o.jsx(we,{value:"all",children:"All sources"}),A.map(O=>o.jsx(we,{value:O,children:O},O))]})]}),o.jsxs(X,{variant:"outline",size:"sm",onClick:()=>{u(!c),T()},children:[c?o.jsx(EK,{className:"h-4 w-4 mr-1"}):o.jsx(uh,{className:"h-4 w-4 mr-1"}),c?"Hide dismissed":"Show dismissed"]}),o.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground mr-1",children:"Sort:"}),o.jsxs(X,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>L("found_at"),children:["Date ",o.jsx(R,{field:"found_at"})]}),o.jsxs(X,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>L("title"),children:["Title ",o.jsx(R,{field:"title"})]}),o.jsxs(X,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>L("source_domain"),children:["Source ",o.jsx(R,{field:"source_domain"})]})]})]})]}),!n&&!k&&P.length>0&&o.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing ",(F-1)*h+1,"–",Math.min(F*h,P.length)," of ",P.length," mention",P.length!==1?"s":"",P.length!==j.length&&` (${j.length} total)`]}),n||k?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(ke,{className:"h-8 w-8 animate-spin text-primary"})}):P.length===0?o.jsx(pe,{children:o.jsxs(de,{className:"flex flex-col items-center py-16 text-center",children:[o.jsx(Gh,{className:"h-12 w-12 text-muted-foreground
777/40 mb-4"}),o.jsx("h3",{className:"text-lg font-semibold text-foreground mb-1",children:"No mentions found"}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:j.length>0?"No mentions match your current filters. Try adjusting your search or filters.":'Click "Scan Now" to search the web for mentions of your business name.'})]})}):o.jsx("div",{className:"grid gap-3",children:M.map(O=>o.jsx(pe,{className:O.dismissed?"opacity-50":"",children:o.jsxs(de,{className:"flex items-start gap-4 py-4 px-5",children:[o.jsx("div",{className:"mt-1 rounded-full bg-primary/10 p-2",children:o.jsx(BK,{className:"h-4 w-4 text-primary"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("a",{href:O.url,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-foreground hover:text-primary truncate transition-colors",children:O.title||O.url}),o.jsx(sr,{className:"h-3 w-3 text-muted-foreground shrink-0"})]}),O.snippet&&o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-2",children:O.snippet}),o.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[O.source_domain&&o.jsx(Se,{variant:"secondary",className:"text-xs",children:O.source_domain}),o.jsx("span",{children:nn(new Date(O.found_at),"MMM d, yyyy")})]})]}),o.jsx(X,{variant:"ghost",size:"icon",className:"shrink-0",onClick:()=>E(O),title:O.dismissed?"Restore":"Dismiss",children:o.jsx(Ro,{className:"h-4 w-4"})})]})},O.id))}),!n&&!k&&B>1&&o.jsxs("div",{className:"flex items-center justify-center gap-2 pt-2",children:[o.jsx(X,{variant:"outline",size:"sm",disabled:F<=1,onClick:()=>f(O=>Math.max(1,O-1)),children:"Previous"}),o.jsx("div",{className:"flex items-center gap-1",children:Array.from({length:B},(O,N)=>N+1).filter(O=>O===1||O===B||Math.abs(O-F)<=1).reduce((O,N,H,V)=>(H>0&&N-V[H-1]>1&&O.push("ellipsis"),O.push(N),O),[]).map((O,N)=>O==="ellipsis"?o.jsx("span",{className:"px-1 text-muted-foreground text-sm",children:"…"},`e-${N}`):o.jsx(X,{variant:O===F?"default":"outline",size:"sm",className:"h-8 w-8 p-0",onClick:()=>f(O),children:O},O))}),o.jsx(X,{variant:"outline",size:"sm",disabled:F>=B,onClick:()=>f(O=>Math.min(B,O+1)),children:"Next"})]})]})})},VM=[{key:"connect_business",icon:Jr,title:"Add your business",description:"On the **Businesses** page press **Add Business**, then fill in your name, address and website.",cta:"Add your business",to:()=>"/businesses?add=true"},{key:"connect_platform",icon:C2,title:"Connect a review platform",description:"On your business card press **Sources**, paste the link to your Google, TripAdvisor, Trustpilot, GetYourGuide or Yelp page, then press **Save URL** (or **Connect** for Google).",cta:"Open Sources",to:e=>e?`/businesses/${e}/sources`:"/businesses"},{key:"import_reviews",icon:zi,title:"Import your reviews",description:"Once a platform is connected, press **Sync** on your business card to pull in your existing reviews.",cta:"Go to Businesses",to:()=>"/businesses"},{key:"brand_profile",icon:w5,title:"Brand your review profile",description:"On your business card press **Profile**, then **Customize Page Branding** to upload your logo and write a short description.",cta:"Brand your profile",to:()=>"/businesses?profile=branding"},{key:"review_links",icon:C2,title:"Add your review links",description:"On your business card press **Profile** and add the review platforms — plus custom links like your website — that appear on your public page.",cta:"Add review links",to:()=>"/businesses?profile=true"},{key:"reply_review",icon:$K,title:"Reply to a review",description:"Open **Reviews**, select a review and press **Reply to Review** — use **AI Suggest** to draft it or write your own.",cta:"Reply to a review",to:()=>"/reviews"},{key:"send_invite",icon:ac,title:"Send a review invitation",description:"Go to **Invitations**, pick **Single invites**, enter a customer's email and press **Send Invitations**.",cta:"Send an invite",to:()=>"/invitations"}],jLe=({text:e})=>{const t=e.split("**");return o.jsx(o.Fragment,{children:t.map((n,r)=>r%2===1?o.jsx("span",{className:"font-medium text-foreground",children:n},r):o.jsx("span",{children:n},r))})},SLe=()=>{const{user:e,loading:t,subscription:n,isAdmin:r}=Mt(),i=NN(),{businesses:a}=Lo(),s=b.useRef(!1),l=b.useRef(!1),c=a.length>0?a[0].id:null;if(b.useEffect(()=>{e&&!s.current&&(s.current=!0,$n("checklist_viewed"))},[e]),b.useEffect(()=>{i.allComplete&&!i.loading&&!l.current&&(l.current=!0,$n("checklist_completed"))},[i.allComplete,i.loading]),t)return o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:o.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});if(!e)return o.jsx(Yi,{to:"/login",replace:!0});const u=!r&&!n.loading&&n.trialing;let d=null;
777if(u&&n.trialEnd){const p=new Date(n.trialEnd).getTime()-Date.now();d=Math.max(0,Math.ceil(p/(1e3*60*60*24)))}const f=Math.round(i.completedCount/i.totalCount*100),h=VM.findIndex(p=>!i.steps[p.key]);return o.jsx(Qn,{children:o.jsxs("div",{className:"mx-auto max-w-2xl space-y-6",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"font-display text-3xl font-bold text-foreground",children:"Getting Started"}),o.jsx("p",{className:"text-muted-foreground",children:"A few quick steps to get the most out of Review Kit."})]}),u&&o.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border border-primary/30 bg-primary/5 px-4 py-3",children:[o.jsx(bn,{className:"h-5 w-5 shrink-0 text-primary"}),o.jsx("p",{className:"flex-1 text-sm text-foreground",children:d!==null?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"font-semibold",children:[d," day",d===1?"":"s"," left"]})," ","in your free trial — finish these steps to see Review Kit's full value."]}):"Your free trial is active — finish these steps to see Review Kit's full value."}),o.jsx(X,{asChild:!0,variant:"outline",size:"sm",children:o.jsx(on,{to:"/settings?tab=billing",children:"See plans"})})]}),i.loading?o.jsxs("div",{className:"space-y-3",children:[o.jsx(ba,{className:"h-3 w-full"}),Array.from({length:7}).map((p,g)=>o.jsx(ba,{className:"h-24 w-full"},g))]}):i.allComplete&&i.collapsed?o.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border border-border bg-card px-4 py-4",children:[o.jsx(O2,{className:"h-6 w-6 shrink-0 text-primary"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"font-medium text-foreground",children:"You're all set!"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"You've completed the setup checklist — your reviews are in good hands."})]}),o.jsxs(X,{variant:"ghost",size:"sm",onClick:()=>i.setCollapsed(!1),children:[o.jsx(Rd,{className:"mr-1 h-4 w-4"}),"View checklist"]})]}):o.jsxs(o.Fragment,{children:[i.allComplete&&o.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border border-primary/30 bg-primary/5 px-4 py-4",children:[o.jsx(O2,{className:"h-6 w-6 shrink-0 text-primary"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("p",{className:"font-medium text-foreground",children:"You're all set!"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"You've completed every step — Review Kit is fully up and running for you."})]}),o.jsxs(X,{variant:"outline",size:"sm",onClick:()=>i.setCollapsed(!0),children:[o.jsx(eN,{className:"mr-1 h-4 w-4"}),"Collapse"]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between text-sm",children:[o.jsxs("span",{className:"font-medium text-foreground",children:[i.completedCount," of ",i.totalCount," complete"]}),o.jsxs("span",{className:"text-muted-foreground",children:[f,"%"]})]}),o.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${f}%`}})})]}),o.jsx("div",{className:"space-y-3",children:VM.map((p,g)=>{const m=i.steps[p.key],v=g===h,x=!m&&!v;
777return o.jsxs("div",{className:`flex items-start gap-4 rounded-lg border p-4 ${m?"border-primary/30 bg-primary/5":v?"border-primary bg-card shadow-sm":"border-border bg-card opacity-60"}`,children:[o.jsx("div",{className:"mt-0.5 shrink-0",children:m?o.jsx(ar,{className:"h-6 w-6 text-primary"}):v?o.jsx(m5,{className:"h-6 w-6 text-primary"}):o.jsx(Fu,{className:"h-5 w-5 text-muted-foreground/40"})}),o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsxs("p",{className:`font-medium ${x?"text-muted-foreground":"text-foreground"}`,children:[g+1,". ",p.title]}),!x&&o.jsx("p",{className:"text-sm text-muted-foreground",children:o.jsx(jLe,{text:p.description})}),v&&o.jsx(X,{asChild:!0,size:"sm",className:"mt-2",children:o.jsx(on,{to:p.to(c),children:p.cta})})]}),o.jsx(p.icon,{className:"mt-1 hidden h-5 w-5 shrink-0 text-muted-foreground/50 sm:block"})]},p.key)})})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-lg border border-border bg-card px-4 py-3",children:[o.jsx(b_,{className:"h-5 w-5 shrink-0 text-primary"}),o.jsx("p",{className:"flex-1 text-sm text-muted-foreground",children:"Prefer a walkthrough? Book a free demo and we'll set everything up with you."}),o.jsx(X,{asChild:!0,variant:"outline",size:"sm",children:o.jsx("a",{href:"https://reviewkit.com/book-a-demo",target:"_blank",rel:"noopener noreferrer",children:"Book a demo"})})]})]})})},kLe=new jq,NLe=()=>o.jsx(Eq,{client:kLe,children:o.jsxs(Tc,{children:[o.jsx(AY,{}),o.jsx(vG,{}),o.jsx($V,{children:o.jsx(hee,{children:o.jsxs(EV,{children:[o.jsx(an,{path:"/",element:o.jsx(dOe,{})}),o.jsx(an,{path:"/getting-started",element:o.jsx(SLe,{})}),o.jsx(an,{path:"/businesses",element:o.jsx(pRe,{})}),o.jsx(an,{path:"/reviews",element:o.jsx(Vf,{children:o.jsx(PMe,{})})}),o.jsx(an,{path:"/google-business-callback",element:o.jsx(OMe,{})}),o.jsx(an,{path:"/chat",element:o.jsx(Vf,{children:o.jsx(k4e,{})})}),o.jsx(an,{path:"/businesses/:businessId/sources",element:o.jsx(Vf,{children:o.jsx(C4e,{})})}),o.jsx(an,{path:"/widgets",element:o.jsx(X4e,{})}),o.jsx(an,{path:"/mentions",element:o.jsx(Vf,{children:o.jsx(_Le,{})})}),o.jsx(an,{path:"/invitations",element:o.jsx(hLe,{})}),o.jsx(an,{path:"/widget/:widgetId",element:o.jsx(eLe,{})}),o.jsx(an,{path:"/settings",element:o.jsx(I4e,{})}),o.jsx(an,{path:"/login",element:o.jsx(TOe,{})}),o.jsx(an,{path:"/signup",element:o.jsx(IOe,{})}),o.jsx(an,{path:"/forgot-password",element:o.jsx($Oe,{})}),o.jsx(an,{path:"/reset-password",element:o.jsx(LOe,{})}),o.jsx(an,{path:"/admin",element:o.jsx(bLe,{})}),o.jsx(an,{path:"/accept-invite",element:o.jsx(wLe,{})}),o.jsx(an,{path:"/r/:businessId",element:o.jsx(L4e,{})}),o.jsx(an,{path:"*",element:o.jsx(M4e,{})})]})})})]})});g3(document.getElementById("root")).render(o.jsx(NLe,{}));

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.