PageSourceSearch

https://safevibe.codes/assets/index-D-diPvFH.js

js safevibe.codes collected 2026-10-09 22:54:44 UTC 524,482 bytes, 153 lines download raw bytes

vendor: 5,800 bytes, lines 1-9
1function _p(e,t){for(var r=0;r<t.length;r++){const s=t[r];if(typeof s!="string"&&!Array.isArray(s)){for(const n in s)if(n!=="default"&&!(n in e)){const a=Object.getOwnPropertyDescriptor(s,n);a&&Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>s[n]})}}}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 n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function r(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(n){if(n.ep)return;n.ep=!0;const a=r(n);fetch(n.href,a)}})();var rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function kp(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}),r}var md={exports:{}},oa={},gd={exports:{}},B={};/**
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 Fn=Symbol.for("react.element"),Sp=Symbol.for("react.portal"),Ep=Symbol.for("react.fragment"),Cp=Symbol.for("react.strict_mode"),Tp=Symbol.for("react.profiler"),Pp=Symbol.for("react.provider"),Ip=Symbol.for("react.context"),Op=Symbol.for("react.forward_ref"),Ap=Symbol.for("react.suspense"),Rp=Symbol.for("react.memo"),Up=Symbol.for("react.lazy"),Tc=Symbol.iterator;function Lp(e){return e===null||typeof e!="object"?null:(e=Tc&&e[Tc]||e["@@iterator"],typeof e=="function"?e:null)}var xd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yd=Object.assign,vd={};function Cs(e,t,r){this.props=e,this.context=t,this.refs=vd,this.updater=r||xd}Cs.prototype.isReactComponent={};Cs.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")};Cs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wd(){}wd.prototype=Cs.prototype;function Nl(e,t,r){this.props=e,this.context=t,this.refs=vd,this.updater=r||xd}var kl=Nl.prototype=new wd;kl.constructor=Nl;yd(kl,Cs.prototype);kl.isPureReactComponent=!0;var Pc=Array.isArray,bd=Object.prototype.hasOwnProperty,Sl={current:null},jd={key:!0,ref:!0,__self:!0,__source:!0};function _d(e,t,r){var s,n={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)bd.call(t,s)&&!jd.hasOwnProperty(s)&&(n[s]=t[s]);var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];n.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)n[s]===void 0&&(n[s]=l[s]);return{$$typeof:Fn,type:e,key:a,ref:o,props:n,_owner:Sl.current}}function $p(e,t){return{$$typeof:Fn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function El(e){return typeof e=="object"&&e!==null&&e.$$typeof===Fn}function Dp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Ic=/\/+/g;function Pa(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Dp(""+e.key):t.toString(36)}function mi(e,t,r,s,n){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Fn:case Sp:o=!0}}if(o)return o=e,n=n(o),e=s===""?"."+Pa(o,0):s,Pc(n)?(r="",e!=null&&(r=e.replace(Ic,"$&/")+"/"),mi(n,t,r,"",function(u){return u})):n!=null&&(El(n)&&(n=$p(n,r+(!n.key||o&&o.key===n.key?"":(""+n.key).replace(Ic,"$&/")+"/")+e)),t.push(n)),1;if(o=0,s=s===""?".":s+":",Pc(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+Pa(a,l);o+=mi(a,t,r,c,n)}else if(c=Lp(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+Pa(a,l++),o+=mi(a,t,r,c,n);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Jn(e,t,r){if(e==null)return e;var s=[],n=0;return mi(e,s,"","",function(a){return t.call(r,a,n++)}),s}function Fp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Pe={current:null},gi={transition:null},Mp={ReactCurrentDispatcher:Pe,ReactCurrentBatchConfig:gi,ReactCurrentOwner:Sl};function Nd(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 5,445 bytes, lines 9-25
9B.Children={map:Jn,forEach:function(e,t,r){Jn(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Jn(e,function(){t++}),t},toArray:function(e){return Jn(e,function(t){return t})||[]},only:function(e){if(!El(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};B.Component=Cs;B.Fragment=Ep;B.Profiler=Tp;B.PureComponent=Nl;B.StrictMode=Cp;B.Suspense=Ap;B.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mp;B.act=Nd;B.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=yd({},e.props),n=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=Sl.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)bd.call(t,c)&&!jd.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:Fn,type:e.type,key:n,ref:a,props:s,_owner:o}};B.createContext=function(e){return e={$$typeof:Ip,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Pp,_context:e},e.Consumer=e};B.createElement=_d;B.createFactory=function(e){var t=_d.bind(null,e);return t.type=e,t};B.createRef=function(){return{current:null}};B.forwardRef=function(e){return{$$typeof:Op,render:e}};B.isValidElement=El;B.lazy=function(e){return{$$typeof:Up,_payload:{_status:-1,_result:e},_init:Fp}};B.memo=function(e,t){return{$$typeof:Rp,type:e,compare:t===void 0?null:t}};B.startTransition=function(e){var t=gi.transition;gi.transition={};try{e()}finally{gi.transition=t}};B.unstable_act=Nd;B.useCallback=function(e,t){return Pe.current.useCallback(e,t)};B.useContext=function(e){return Pe.current.useContext(e)};B.useDebugValue=function(){};B.useDeferredValue=function(e){return Pe.current.useDeferredValue(e)};B.useEffect=function(e,t){return Pe.current.useEffect(e,t)};B.useId=function(){return Pe.current.useId()};B.useImperativeHandle=function(e,t,r){return Pe.current.useImperativeHandle(e,t,r)};B.useInsertionEffect=function(e,t){return Pe.current.useInsertionEffect(e,t)};B.useLayoutEffect=function(e,t){return Pe.current.useLayoutEffect(e,t)};B.useMemo=function(e,t){return Pe.current.useMemo(e,t)};B.useReducer=function(e,t,r){return Pe.current.useReducer(e,t,r)};B.useRef=function(e){return Pe.current.useRef(e)};B.useState=function(e){return Pe.current.useState(e)};B.useSyncExternalStore=function(e,t,r){return Pe.current.useSyncExternalStore(e,t,r)};B.useTransition=function(){return Pe.current.useTransition()};B.version="18.3.1";gd.exports=B;var S=gd.exports;const Re=Np(S),Bp=_p({__proto__:null,default:Re},[S]);/**
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 zp=S,Wp=Symbol.for("react.element"),Vp=Symbol.for("react.fragment"),Hp=Object.prototype.hasOwnProperty,qp=zp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Kp={key:!0,ref:!0,__self:!0,__source:!0};function kd(e,t,r){var s,n={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)Hp.call(t,s)&&!Kp.hasOwnProperty(s)&&(n[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)n[s]===void 0&&(n[s]=t[s]);return{$$typeof:Wp,type:e,key:a,ref:o,props:n,_owner:qp.current}}oa.Fragment=Vp;oa.jsx=kd;oa.jsxs=kd;md.exports=oa;var i=md.exports,Sd={exports:{}},Ge={},Ed={exports:{}},Cd={};/**
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(T,$){var U=T.length;T.push($);e:for(;0<U;){var z=U-1>>>1,oe=T[z];if(0<n(oe,$))T[z]=$,T[U]=oe,U=z;else break e}}function r(T){return T.length===0?null:T[0]}function s(T){if(T.length===0)return null;var $=T[0],U=T.pop();if(U!==$){T[0]=U;e:for(var z=0,oe=T.length,mr=oe>>>1;z<mr;){var mt=2*(z+1)-1,Br=T[mt],gt=mt+1,gr=T[gt];if(0>n(Br,U))gt<oe&&0>n(gr,Br)?(T[z]=gr,T[gt]=U,z=gt):(T[z]=Br,T[mt]=U,z=mt);else if(gt<oe&&0>n(gr,U))T[z]=gr,T[gt]=U,z=gt;else break e}}return $}function n(T,$){var U=T.sortIndex-$.sortIndex;return U!==0?U:T.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],h=1,d=null,f=3,p=!1,w=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(T){for(var $=r(u);$!==null;){if($.callback===null)s(u);else if($.startTime<=T)s(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=r(u)}}function j(T){if(b=!1,y(T),!w)if(r(c)!==null)w=!0,Q(N);else{var $=r(u);$!==null&&K(j,$.startTime-T)}}function N(T,$){w=!1,b&&(b=!1,m(E),E=-1),p=!0;var U=f;try{for(y($),d=r(c);d!==null&&(!(d.expirationTime>$)||T&&!V());
vendor: 9,202 bytes, lines 25-34
25){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var oe=z(d.expirationTime<=$);$=e.unstable_now(),typeof oe=="function"?d.callback=oe:d===r(c)&&s(c),y($)}else s(c);d=r(c)}if(d!==null)var mr=!0;else{var mt=r(u);mt!==null&&K(j,mt.startTime-$),mr=!1}return mr}finally{d=null,f=U,p=!1}}var k=!1,_=null,E=-1,O=5,R=-1;function V(){return!(e.unstable_now()-R<O)}function Oe(){if(_!==null){var T=e.unstable_now();R=T;var $=!0;try{$=_(!0,T)}finally{$?Ze():(k=!1,_=null)}}else k=!1}var Ze;if(typeof g=="function")Ze=function(){g(Oe)};else if(typeof MessageChannel<"u"){var _t=new MessageChannel,P=_t.port2;_t.port1.onmessage=Oe,Ze=function(){P.postMessage(null)}}else Ze=function(){x(Oe,0)};function Q(T){_=T,k||(k=!0,Ze())}function K(T,$){E=x(function(){T(e.unstable_now())},$)}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(T){T.callback=null},e.unstable_continueExecution=function(){w||p||(w=!0,Q(N))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var $=3;break;default:$=f}var U=f;f=$;try{return T()}finally{f=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,$){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var U=f;f=T;try{return $()}finally{f=U}},e.unstable_scheduleCallback=function(T,$,U){var z=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?z+U:z):U=z,T){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=U+oe,T={id:h++,callback:$,priorityLevel:T,startTime:U,expirationTime:oe,sortIndex:-1},U>z?(T.sortIndex=U,t(u,T),r(c)===null&&T===r(u)&&(b?(m(E),E=-1):b=!0,K(j,U-z))):(T.sortIndex=oe,t(c,T),w||p||(w=!0,Q(N))),T},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(T){var $=f;return function(){var U=f;f=$;try{return T.apply(this,arguments)}finally{f=U}}}})(Cd);Ed.exports=Cd;var Jp=Ed.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 Gp=S,Je=Jp;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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 Td=new Set,xn={};function $r(e,t){vs(e,t),vs(e+"Capture",t)}function vs(e,t){for(xn[e]=t,e=0;e<t.length;e++)Td.add(t[e])}var Ot=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fo=Object.prototype.hasOwnProperty,Qp=/^[: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]*$/,Oc={},Ac={};function Zp(e){return fo.call(Ac,e)?!0:fo.call(Oc,e)?!1:Qp.test(e)?Ac[e]=!0:(Oc[e]=!0,!1)}function Yp(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Xp(e,t,r,s){if(t===null||typeof t>"u"||Yp(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.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 Ie(e,t,r,s,n,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new Ie(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new Ie(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Ie(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new Ie(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){je[e]=new Ie(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Ie(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Ie(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Ie(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Ie(e,5,!1,e.toLowerCase(),null,!1,!1)});var Cl=/[\-:]([a-z])/g;function Tl(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Cl,Tl);je[t]=new Ie(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(Cl,Tl);je[t]=new Ie(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(Cl,Tl);je[t]=new Ie(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new Ie(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new Ie("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new Ie(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pl(e,t,r,s){var n=je.hasOwnProperty(t)?je[t]:null;(n!==null?n.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Xp(t,r,n,s)&&(r=null),s||n===null?Zp(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):n.mustUseProperty?e[n.propertyName]=r===null?n.type===3?!1:"":r:(t=n.attributeName,s=n.attributeNamespace,r===null?e.removeAttribute(t):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,s?e.setAttributeNS(s,t,r):e.setAttribute(t,r))))}var Lt=Gp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Gn=Symbol.for("react.element"),Yr=Symbol.for("react.portal"),Xr=Symbol.for("react.fragment"),Il=Symbol.for("react.strict_mode"),po=Symbol.for("react.profiler"),Pd=Symbol.for("react.provider"),Id=Symbol.for("react.context"),Ol=Symbol.for("react.forward_ref"),mo=Symbol.for("react.suspense"),go=Symbol.for("react.suspense_list"),Al=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),Od=Symbol.for("react.offscreen"),Rc=Symbol.iterator;function Ds(e){return e===null||typeof e!="object"?null:(e=Rc&&e[Rc]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Object.assign,Ia;function Gs(e){if(Ia===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ia=t&&t[1]||""}return`
34`+Ia+e}var Oa=!1;function Aa(e,t){if(!e||Oa)return"";Oa=!0;var r=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 s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}
vendor: 4,200 bytes, lines 34-37
34catch(u){if(u&&s&&typeof u.stack=="string"){for(var n=u.stack.split(`
35`),a=s.stack.split(`
36`),o=n.length-1,l=a.length-1;1<=o&&0<=l&&n[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(n[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||n[o]!==a[l]){var c=`
37`+n[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Oa=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Gs(e):""}function em(e){switch(e.tag){case 5:return Gs(e.type);case 16:return Gs("Lazy");case 13:return Gs("Suspense");case 19:return Gs("SuspenseList");case 0:case 2:case 15:return e=Aa(e.type,!1),e;case 11:return e=Aa(e.type.render,!1),e;case 1:return e=Aa(e.type,!0),e;default:return""}}function xo(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 Xr:return"Fragment";case Yr:return"Portal";case po:return"Profiler";case Il:return"StrictMode";case mo:return"Suspense";case go:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Id:return(e.displayName||"Context")+".Consumer";case Pd:return(e._context.displayName||"Context")+".Provider";case Ol:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Al:return t=e.displayName||null,t!==null?t:xo(e.type)||"Memo";case Mt:t=e._payload,e=e._init;try{return xo(e(t))}catch{}}return null}function tm(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 xo(t);case 8:return t===Il?"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 ar(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ad(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rm(e){var t=Ad(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qn(e){e._valueTracker||(e._valueTracker=rm(e))}function Rd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=Ad(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function Ci(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 yo(e,t){var r=t.checked;return ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Uc(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=ar(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ud(e,t){t=t.checked,t!=null&&Pl(e,"checked",t,!1)}function vo(e,t){Ud(e,t);var r=ar(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?wo(e,t.type,r):t.hasOwnProperty("defaultValue")&&wo(e,t.type,ar
vendor: 4,277 bytes, line 37
37(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lc(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function wo(e,t,r){(t!=="number"||Ci(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Qs=Array.isArray;function us(e,t,r,s){if(e=e.options,t){t={};for(var n=0;n<r.length;n++)t["$"+r[n]]=!0;for(r=0;r<e.length;r++)n=t.hasOwnProperty("$"+e[r].value),e[r].selected!==n&&(e[r].selected=n),n&&s&&(e[r].defaultSelected=!0)}else{for(r=""+ar(r),t=null,n=0;n<e.length;n++){if(e[n].value===r){e[n].selected=!0,s&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function bo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(C(91));return ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $c(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(C(92));if(Qs(r)){if(1<r.length)throw Error(C(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:ar(r)}}function Ld(e,t){var r=ar(t.value),s=ar(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),s!=null&&(e.defaultValue=""+s)}function Dc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $d(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 jo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$d(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zn,Dd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,s,n){MSApp.execUnsafeLocalFunction(function(){return e(t,r,s,n)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Zn=Zn||document.createElement("div"),Zn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Zn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yn(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var sn={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},sm=["Webkit","ms","Moz","O"];Object.keys(sn).forEach(function(e){sm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sn[t]=sn[e]})});function Fd(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||sn.hasOwnProperty(e)&&sn[e]?(""+t).trim():t+"px"}function Md(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,n=Fd(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,n):e[r]=n}}var nm=ne({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 _o(e,t){if(t){if(nm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(C(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(C(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(C(61))}if(t.style!=null&&typeof t.style!="object")throw Error(C(62))}}function No(e,t){if(e.indexOf("-")===-1)return typeof t.is=="str
37ing";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 ko=null;function Rl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var So=null,ds=null,hs=null;function Fc(e){if(e=zn(e)){if(typeof So!="function")throw Error(C(280));var t=e.stateNode;t&&(t=ha(t),So(e.stateNode,e.type,t))}}function Bd(e){ds?hs?hs.push(e):hs=[e]:ds=e}function zd(){if(ds){var e=ds,t=hs;if(hs=ds=null,Fc(e),t)for(e=0;e<t.length;e++)Fc(t[e])}}function Wd(e,t){return e(t)}function Vd(){}var Ra=!1;function Hd(e,t,r){if(Ra)return e(t,r);Ra=!0;try{return Wd(e,t,r)}finally{Ra=!1,(ds!==null||hs!==null)&&(Vd(),zd())}}function vn(e,t){var r=e.stateNode;if(r===null)return null;var s=ha(r);if(s===null)return null;r=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(C(231,t,typeof r));return r}var Eo=!1;if(Ot)try{var Fs={};Object.defineProperty(Fs,"passive",{get:function(){Eo=!0}}),window.addEventListener("test",Fs,Fs),window.removeEventListener("test",Fs,Fs)}catch{Eo=!1}function im(e,t,r,s,n,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(h){this.onError(h)}}var nn=!1,Ti=null,Pi=!1,Co=null,am={onError:function(e){nn=!0,Ti=e}};function om(e,t,r,s,n,a,o,l,c){nn=!1,Ti=null,im.apply(am,arguments)}function lm(e,t,r,s,n,a,o,l,c){if(om.apply(this,arguments),nn){if(nn){var u=Ti;nn=!1,Ti=null}else throw Error(C(198));Pi||(Pi=!0,Co=u)}}function Dr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function qd(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 Mc(e){if(Dr(e)!==e)throw Error(C(188))}function cm(e){var t=e.alternate;if(!t){if(t=Dr(e),t===null)throw Error(C(188));return t!==e?null:e}for(var r=e,s=t;;){var n=r.return;if(n===null)break;var a=n.alternate;if(a===null){if(s=n.return,s!==null){r=s;continue}break}if(n.child===a.child){for(a=n.child;a;){if(a===r)return Mc(n),e;if(a===s)return Mc(n),t;a=a.sibling}throw Error(C(188))}if(r.return!==s.return)r=n,s=a;else{for(var o=!1,l=n.child;l;){if(l===r){o=!0,r=n,s=a;break}if(l===s){o=!0,s=n,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,s=n;break}if(l===s){o=!0,s=a,r=n;break}l=l.sibling}if(!o)throw Error(C(189))}}if(r.alternate!==s)throw Error(C(190))}if(r.tag!==3)throw Error(C(188));return r.stateNode.current===r?e:t}function Kd(e){return e=cm(e),e!==null?Jd(e):null}function Jd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Jd(e);if(t!==null)return t;e=e.sibling}return null}var Gd=Je.unstable_scheduleCallback,Bc=Je.unstable_cancelCallback,um=Je.unstable_shouldYield,dm=Je.unstable_requestPaint,le=Je.unstable_now,hm=Je.unstable_getCurrentPriorityLevel,Ul=Je.unstable_ImmediatePriority,Qd=Je.unstable_UserBlockingPriority,Ii=Je.unstable_NormalPriority,fm=Je.unstable_LowPriority,Zd=Je.unstable_IdlePriority,la=null,bt=null;function pm(e){if(bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(la,e,void 0,(e.current.flags&128)===128)}catch{}}var ht=Math.clz32?Math.clz32:xm,mm=Math.log,gm=Math.LN2;function xm(e){return e>>>=0,e===0?32:31-(mm(e)/gm|0)|0}var Yn=64,Xn=4194304;function Zs(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 Oi(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,n=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~n;l!==0?s=Zs(l):(a&=o,a!==0&&(s=Zs(a)))}else o=r&~n,o!==0?s=Zs(o):a!==0&&(s=Zs(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&n)&&(n=s&-s,a=t&-t,n>=a||n===16&&(a&4194240)!==0))return t;if(s&4&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-ht(t),n=1<<r,s|=e[r],t&=~n;return s}function ym(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 vm(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,n=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-ht(a),l=1<<o,c=n[o];c===-1?(!(l&r)||l&s)&&(n[o]=ym(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function To(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Yd(){var e=Yn;return Yn<<=1,!(Yn&4194240)&&(Yn=64),e}function Ua(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 4,080 bytes, line 37
37function Mn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ht(t),e[t]=r}function wm(e,t){var r=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 s=e.eventTimes;for(e=e.expirationTimes;0<r;){var n=31-ht(r),a=1<<n;t[n]=0,s[n]=-1,e[n]=-1,r&=~a}}function Ll(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-ht(r),n=1<<s;n&t|e[s]&t&&(e[s]|=t),r&=~n}}var J=0;function Xd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var eh,$l,th,rh,sh,Po=!1,ei=[],Qt=null,Zt=null,Yt=null,wn=new Map,bn=new Map,Wt=[],bm="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 zc(e,t){switch(e){case"focusin":case"focusout":Qt=null;break;case"dragenter":case"dragleave":Zt=null;break;case"mouseover":case"mouseout":Yt=null;break;case"pointerover":case"pointerout":wn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bn.delete(t.pointerId)}}function Ms(e,t,r,s,n,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:a,targetContainers:[n]},t!==null&&(t=zn(t),t!==null&&$l(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function jm(e,t,r,s,n){switch(t){case"focusin":return Qt=Ms(Qt,e,t,r,s,n),!0;case"dragenter":return Zt=Ms(Zt,e,t,r,s,n),!0;case"mouseover":return Yt=Ms(Yt,e,t,r,s,n),!0;case"pointerover":var a=n.pointerId;return wn.set(a,Ms(wn.get(a)||null,e,t,r,s,n)),!0;case"gotpointercapture":return a=n.pointerId,bn.set(a,Ms(bn.get(a)||null,e,t,r,s,n)),!0}return!1}function nh(e){var t=kr(e.target);if(t!==null){var r=Dr(t);if(r!==null){if(t=r.tag,t===13){if(t=qd(r),t!==null){e.blockedOn=t,sh(e.priority,function(){th(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Io(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);ko=s,r.target.dispatchEvent(s),ko=null}else return t=zn(r),t!==null&&$l(t),e.blockedOn=r,!1;t.shift()}return!0}function Wc(e,t,r){xi(e)&&r.delete(t)}function _m(){Po=!1,Qt!==null&&xi(Qt)&&(Qt=null),Zt!==null&&xi(Zt)&&(Zt=null),Yt!==null&&xi(Yt)&&(Yt=null),wn.forEach(Wc),bn.forEach(Wc)}function Bs(e,t){e.blockedOn===t&&(e.blockedOn=null,Po||(Po=!0,Je.unstable_scheduleCallback(Je.unstable_NormalPriority,_m)))}function jn(e){function t(n){return Bs(n,e)}if(0<ei.length){Bs(ei[0],e);for(var r=1;r<ei.length;r++){var s=ei[r];s.blockedOn===e&&(s.blockedOn=null)}}for(Qt!==null&&Bs(Qt,e),Zt!==null&&Bs(Zt,e),Yt!==null&&Bs(Yt,e),wn.forEach(t),bn.forEach(t),r=0;r<Wt.length;r++)s=Wt[r],s.blockedOn===e&&(s.blockedOn=null);for(;0<Wt.length&&(r=Wt[0],r.blockedOn===null);)nh(r),r.blockedOn===null&&Wt.shift()}var fs=Lt.ReactCurrentBatchConfig,Ai=!0;function Nm(e,t,r,s){var n=J,a=fs.transition;fs.transition=null;try{J=1,Dl(e,t,r,s)}finally{J=n,fs.transition=a}}function km(e,t,r,s){var n=J,a=fs.transition;fs.transition=null;try{J=4,Dl(e,t,r,s)}finally{J=n,fs.transition=a}}function Dl(e,t,r,s){if(Ai){var n=Io(e,t,r,s);if(n===null)Ha(e,t,s,Ri,r),zc(e,s);else if(jm(n,e,t,r,s))s.stopPropagation();else if(zc(e,s),t&4&&-1<bm.indexOf(e)){for(;n!==null;){var a=zn(n);if(a!==null&&eh(a),a=Io(e,t,r,s),a===null&&Ha(e,t,s,Ri,r),a===n)break;n=a}n!==null&&s.stopPropagation()}else Ha(e,t,s,null,r)}}var Ri=null;function Io(e,t,r,s){if(Ri=null,e=Rl(s),e=kr(e),e!==null)if(t=Dr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=qd(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ri=e,null}
vendor: 10,401 bytes, line 37
37function ih(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(hm()){case Ul:return 1;case Qd:return 4;case Ii:case fm:return 16;case Zd:return 536870912;default:return 16}default:return 16}}var Kt=null,Fl=null,yi=null;function ah(){if(yi)return yi;var e,t=Fl,r=t.length,s,n="value"in Kt?Kt.value:Kt.textContent,a=n.length;for(e=0;e<r&&t[e]===n[e];e++);var o=r-e;for(s=1;s<=o&&t[r-s]===n[a-s];s++);return yi=n.slice(e,1<s?1-s:void 0)}function vi(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 ti(){return!0}function Vc(){return!1}function Qe(e){function t(r,s,n,a,o){this._reactName=r,this._targetInst=n,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?ti:Vc,this.isPropagationStopped=Vc,this}return ne(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ti)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ti)},persist:function(){},isPersistent:ti}),t}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ml=Qe(Ts),Bn=ne({},Ts,{view:0,detail:0}),Sm=Qe(Bn),La,$a,zs,ca=ne({},Bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bl,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!==zs&&(zs&&e.type==="mousemove"?(La=e.screenX-zs.screenX,$a=e.screenY-zs.screenY):$a=La=0,zs=e),La)},movementY:function(e){return"movementY"in e?e.movementY:$a}}),Hc=Qe(ca),Em=ne({},ca,{dataTransfer:0}),Cm=Qe(Em),Tm=ne({},Bn,{relatedTarget:0}),Da=Qe(Tm),Pm=ne({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),Im=Qe(Pm),Om=ne({},Ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Am=Qe(Om),Rm=ne({},Ts,{data:0}),qc=Qe(Rm),Um={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lm={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"},$m={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$m[e])?!!t[e]:!1}function Bl(){return Dm}var Fm=ne({},Bn,{key:function(e){if(e.key){var t=Um[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Lm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bl,charCode:function(e){return e.type==="keypress"?vi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mm=Qe(Fm),Bm=ne({},ca,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kc=Qe(Bm),zm=ne({},Bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bl}),Wm=Qe(zm),Vm=ne({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hm=Qe(Vm),qm=ne({},ca,{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}),Km=Qe(qm),Jm=[9,13,27,32],zl=Ot&&"CompositionEvent"in window,an=null;Ot&&"documentMode"in document&&(an=document.documentMode);var Gm=Ot&&"TextEvent"in window&&!an,oh=Ot&&(!zl||an&&8<an&&11>=an),Jc=" ",Gc=!1;function lh(e,t){switch(e){case"keyup":return Jm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ch(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function Qm(e,t){switch(e){case"compositionend":return ch(t);case"keypress":return t.which!==32?null:(Gc=!0,Jc);case"textInput":return e=t.data,e===Jc&&Gc?null:e;default:return null}}function Zm(e,t){if(es)return e==="compositionend"||!zl&&lh(e,t)?(e=ah(),yi=Fl=Kt=null,es=!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 oh&&t.locale!=="ko"?null:t.data;default:return null}}var Ym={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 Qc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ym[e.type]:t==="textarea"}function uh(e,t,r,s){Bd(s),t=Ui(t,"onChange"),0<t.length&&(r=new Ml("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var on=null,_n=null;function Xm(e){bh(e,0)}function ua(e){var t=ss(e);if(Rd(t))return e}function e0(e,t){if(e==="change")return t}var dh=!1;if(Ot){var Fa;if(Ot){var Ma="oninput"in document;if(!Ma){var Zc=document.createElement("div");Zc.setAttribute("oninput","return;"),Ma=typeof Zc.oninput=="function"}Fa=Ma}else Fa=!1;dh=Fa&&(!document.documentMode||9<document.documentMode)}function Yc(){on&&(on.detachEvent("onpropertychange",hh),_n=on=null)}function hh(e){if(e.propertyName==="value"&&ua(_n)){var t=[];uh(t,_n,e,Rl(e)),Hd(Xm,t)}}function t0(e,t,r){e==="focusin"?(Yc(),on=t,_n=r,on.attachEvent("onpropertychange",hh)):e==="focusout"&&Yc()}function r0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ua(_n)}function s0(e,t){if(e==="click")return ua(t)}function n0(e,t){if(e==="input"||e==="change")return ua(t)}function i0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pt=typeof Object.is=="function"?Object.is:i0;function Nn(e,t){if(pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var n=r[s];if(!fo.call(t,n)||!pt(e[n],t[n]))return!1}return!0}function Xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eu(e,t){var r=Xc(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Xc(r)}}function fh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ph(){for(var e=window,t=Ci();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ci(e.document)}return t}function Wl(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 a0(e){var t=ph(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&fh(r.ownerDocument.documentElement,r)){if(s!==null&&Wl(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var n=r.textContent.length,a=Math.min(s.start,n);s=s.end===void 0?a:Math.min(s.end,n),!e.extend&&a>s&&(n=s,s=a,a=n),n=eu(r,a);var o=eu(r,s);n&&o&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var o0=Ot&&"documentMode"in document&&11>=document.documentMode,ts=null,Oo=null,ln=null,Ao=!1;function tu(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ao||ts==null||ts!==Ci(s)||(s=ts,"selectionStart"in s&&Wl(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focu
vendor: 4,500 bytes, line 37
37sNode:s.focusNode,focusOffset:s.focusOffset}),ln&&Nn(ln,s)||(ln=s,s=Ui(Oo,"onSelect"),0<s.length&&(t=new Ml("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=ts)))}function ri(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var rs={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionend:ri("Transition","TransitionEnd")},Ba={},mh={};Ot&&(mh=document.createElement("div").style,"AnimationEvent"in window||(delete rs.animationend.animation,delete rs.animationiteration.animation,delete rs.animationstart.animation),"TransitionEvent"in window||delete rs.transitionend.transition);function da(e){if(Ba[e])return Ba[e];if(!rs[e])return e;var t=rs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in mh)return Ba[e]=t[r];return e}var gh=da("animationend"),xh=da("animationiteration"),yh=da("animationstart"),vh=da("transitionend"),wh=new Map,ru="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 lr(e,t){wh.set(e,t),$r(t,[e])}for(var za=0;za<ru.length;za++){var Wa=ru[za],l0=Wa.toLowerCase(),c0=Wa[0].toUpperCase()+Wa.slice(1);lr(l0,"on"+c0)}lr(gh,"onAnimationEnd");lr(xh,"onAnimationIteration");lr(yh,"onAnimationStart");lr("dblclick","onDoubleClick");lr("focusin","onFocus");lr("focusout","onBlur");lr(vh,"onTransitionEnd");vs("onMouseEnter",["mouseout","mouseover"]);vs("onMouseLeave",["mouseout","mouseover"]);vs("onPointerEnter",["pointerout","pointerover"]);vs("onPointerLeave",["pointerout","pointerover"]);$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$r("onBeforeInput",["compositionend","keypress","textInput","paste"]);$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ys="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(" "),u0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ys));function su(e,t,r){var s=e.type||"unknown-event";e.currentTarget=r,lm(s,t,void 0,e),e.currentTarget=null}function bh(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],n=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&n.isPropagationStopped())break e;su(n,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&n.isPropagationStopped())break e;su(n,l,u),a=c}}}if(Pi)throw e=Co,Pi=!1,Co=null,e}function X(e,t){var r=t[Do];r===void 0&&(r=t[Do]=new Set);var s=e+"__bubble";r.has(s)||(jh(t,e,2,!1),r.add(s))}function Va(e,t,r){var s=0;t&&(s|=4),jh(r,e,s,t)}var si="_reactListening"+Math.random().toString(36).slice(2);function kn(e){if(!e[si]){e[si]=!0,Td.forEach(function(r){r!=="selectionchange"&&(u0.has(r)||Va(r,!1,e),Va(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[si]||(t[si]=!0,Va("selectionchange",!1,t))}}function jh(e,t,r,s){switch(ih(t)){case 1:var n=Nm;break;case 4:n=km;break;default:n=Dl}r=n.bind(null,t,r,e),n=void 0,!Eo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),s?n!==void 0?e.addEventListener(t,r,{capture:!0,passive:n}):e.addEventListener(t,r,!0):n!==void 0?e.addEventListener(t,r,{passive:n}):e.addEventListener(t,r,!1)}function Ha(e,t,r,s,n){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;
vendor: 2,527 bytes, line 37
37if(l===n||l.nodeType===8&&l.parentNode===n)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===n||c.nodeType===8&&c.parentNode===n))return;o=o.return}for(;l!==null;){if(o=kr(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}Hd(function(){var u=a,h=Rl(r),d=[];e:{var f=wh.get(e);if(f!==void 0){var p=Ml,w=e;switch(e){case"keypress":if(vi(r)===0)break e;case"keydown":case"keyup":p=Mm;break;case"focusin":w="focus",p=Da;break;case"focusout":w="blur",p=Da;break;case"beforeblur":case"afterblur":p=Da;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Hc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Cm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Wm;break;case gh:case xh:case yh:p=Im;break;case vh:p=Hm;break;case"scroll":p=Sm;break;case"wheel":p=Km;break;case"copy":case"cut":case"paste":p=Am;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Kc}var b=(t&4)!==0,x=!b&&e==="scroll",m=b?f!==null?f+"Capture":null:f;b=[];for(var g=u,y;g!==null;){y=g;var j=y.stateNode;if(y.tag===5&&j!==null&&(y=j,m!==null&&(j=vn(g,m),j!=null&&b.push(Sn(g,j,y)))),x)break;g=g.return}0<b.length&&(f=new p(f,w,null,r,h),d.push({event:f,listeners:b}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&r!==ko&&(w=r.relatedTarget||r.fromElement)&&(kr(w)||w[At]))break e;if((p||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,p?(w=r.relatedTarget||r.toElement,p=u,w=w?kr(w):null,w!==null&&(x=Dr(w),w!==x||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=u),p!==w)){if(b=Hc,j="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(b=Kc,j="onPointerLeave",m="onPointerEnter",g="pointer"),x=p==null?f:ss(p),y=w==null?f:ss(w),f=new b(j,g+"leave",p,r,h),f.target=x,f.relatedTarget=y,j=null,kr(h)===u&&(b=new b(m,g+"enter",w,r,h),b.target=y,b.relatedTarget=x,j=b),x=j,p&&w)t:{for(b=p,m=w,g=0,y=b;y;y=zr(y))g++;for(y=0,j=m;j;j=zr(j))y++;for(;0<g-y;)b=zr(b),g--;for(;0<y-g;)m=zr(m),y--;for(;g--;){if(b===m||m!==null&&b===m.alternate)break t;b=zr(b),m=zr(m)}b=null}else b=null;p!==null&&nu(d,f,p,b,!1),w!==null&&x!==null&&nu(d,x,w,b,!0)}}
vendor: 5,562 bytes, lines 37-38
37e:{if(f=u?ss(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var N=e0;else if(Qc(f))if(dh)N=n0;else{N=r0;var k=t0}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=s0);if(N&&(N=N(e,u))){uh(d,N,r,h);break e}k&&k(e,f,u),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&wo(f,"number",f.value)}switch(k=u?ss(u):window,e){case"focusin":(Qc(k)||k.contentEditable==="true")&&(ts=k,Oo=u,ln=null);break;case"focusout":ln=Oo=ts=null;break;case"mousedown":Ao=!0;break;case"contextmenu":case"mouseup":case"dragend":Ao=!1,tu(d,r,h);break;case"selectionchange":if(o0)break;case"keydown":case"keyup":tu(d,r,h)}var _;if(zl)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else es?lh(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(oh&&r.locale!=="ko"&&(es||E!=="onCompositionStart"?E==="onCompositionEnd"&&es&&(_=ah()):(Kt=h,Fl="value"in Kt?Kt.value:Kt.textContent,es=!0)),k=Ui(u,E),0<k.length&&(E=new qc(E,e,null,r,h),d.push({event:E,listeners:k}),_?E.data=_:(_=ch(r),_!==null&&(E.data=_)))),(_=Gm?Qm(e,r):Zm(e,r))&&(u=Ui(u,"onBeforeInput"),0<u.length&&(h=new qc("onBeforeInput","beforeinput",null,r,h),d.push({event:h,listeners:u}),h.data=_))}bh(d,t)})}function Sn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ui(e,t){for(var r=t+"Capture",s=[];e!==null;){var n=e,a=n.stateNode;n.tag===5&&a!==null&&(n=a,a=vn(e,r),a!=null&&s.unshift(Sn(e,a,n)),a=vn(e,t),a!=null&&s.push(Sn(e,a,n))),e=e.return}return s}function zr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function nu(e,t,r,s,n){for(var a=t._reactName,o=[];r!==null&&r!==s;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,n?(c=vn(r,a),c!=null&&o.unshift(Sn(r,c,l))):n||(c=vn(r,a),c!=null&&o.push(Sn(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var d0=/\r\n?/g,h0=/\u0000|\uFFFD/g;function iu(e){return(typeof e=="string"?e:""+e).replace(d0,`
38`).replace(h0,"")}function ni(e,t,r){if(t=iu(t),iu(e)!==t&&r)throw Error(C(425))}function Li(){}var Ro=null,Uo=null;function Lo(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 $o=typeof setTimeout=="function"?setTimeout:void 0,f0=typeof clearTimeout=="function"?clearTimeout:void 0,au=typeof Promise=="function"?Promise:void 0,p0=typeof queueMicrotask=="function"?queueMicrotask:typeof au<"u"?function(e){return au.resolve(null).then(e).catch(m0)}:$o;function m0(e){setTimeout(function(){throw e})}function qa(e,t){var r=t,s=0;do{var n=r.nextSibling;if(e.removeChild(r),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(s===0){e.removeChild(n),jn(t);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=n}while(r);jn(t)}function Xt(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 ou(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Ps=Math.random().toString(36).slice(2),wt="__reactFiber$"+Ps,En="__reactProps$"+Ps,At="__reactContainer$"+Ps,Do="__reactEvents$"+Ps,g0="__reactListeners$"+Ps,x0="__reactHandles$"+Ps;function kr(e){var t=e[wt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[At]||r[wt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=ou(e);e!==null;){if(r=e[wt])return r;e=ou(e)}return t}e=r,r=e.parentNode}return null}function zn(e){return e=e[wt]||e[At],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ss(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(C(33))}function ha(e){return e[En]||null}var Fo=[],ns=-1;function cr(e){return{current:e}}function ee(e){0>ns||(e.current=Fo[ns],Fo[ns]=null,ns--)}function Y(e,t){ns++,Fo[ns]=e.current,e.current=t}var or={},Se=cr(or),Fe=cr(!1),Or=or;function ws(e,t){var r=e.type.contextTypes;if(!r)return or;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var n={},a;for(a in r)n[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function Me(e){return e=e.childContextTypes,e!=null}function $i(){ee(Fe),ee(Se)}function lu(e,t,r){if(Se.current!==or)throw Error(C(168));Y(Se,t),Y(Fe,r)}function _h(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var n in s)if(!(n in t))throw Error(C(108,tm(e)||"Unknown",n));return ne({},r,s)}function Di(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||or,Or=Se.current,Y(Se,e),Y(Fe,Fe.current),!0}function cu(e,t,r){var s=e.stateNode;if(!s)throw Error(C(169));r?(e=_h(e,t,Or),s.__reactInternalMemoizedMergedChildContext=e,ee(Fe),ee(Se),Y(Se,e)):ee(Fe),Y(Fe,r)}var Ct=null,fa=!1,Ka=!1;function Nh(e){Ct===null?Ct=[e]:Ct.push(e)}function y0(e){fa=!0,Nh(e)}function ur(){if(!Ka&&Ct!==null){Ka=!0;var e=0,t=J;try{var r=Ct;for(J=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}Ct=null,fa=!1}catch(n){throw Ct!==null&&(Ct=Ct.slice(e+1)),Gd(Ul,ur),n}finally{J=t,Ka=!1}}return null}
vendor: 5,109 bytes, line 38
38var is=[],as=0,Fi=null,Mi=0,Ye=[],Xe=0,Ar=null,Tt=1,Pt="";function vr(e,t){is[as++]=Mi,is[as++]=Fi,Fi=e,Mi=t}function kh(e,t,r){Ye[Xe++]=Tt,Ye[Xe++]=Pt,Ye[Xe++]=Ar,Ar=e;var s=Tt;e=Pt;var n=32-ht(s)-1;s&=~(1<<n),r+=1;var a=32-ht(t)+n;if(30<a){var o=n-n%5;a=(s&(1<<o)-1).toString(32),s>>=o,n-=o,Tt=1<<32-ht(t)+n|r<<n|s,Pt=a+e}else Tt=1<<a|r<<n|s,Pt=e}function Vl(e){e.return!==null&&(vr(e,1),kh(e,1,0))}function Hl(e){for(;e===Fi;)Fi=is[--as],is[as]=null,Mi=is[--as],is[as]=null;for(;e===Ar;)Ar=Ye[--Xe],Ye[Xe]=null,Pt=Ye[--Xe],Ye[Xe]=null,Tt=Ye[--Xe],Ye[Xe]=null}var Ke=null,He=null,te=!1,dt=null;function Sh(e,t){var r=et(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function uu(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ke=e,He=Xt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ke=e,He=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ar!==null?{id:Tt,overflow:Pt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=et(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Ke=e,He=null,!0):!1;default:return!1}}function Mo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Bo(e){if(te){var t=He;if(t){var r=t;if(!uu(e,t)){if(Mo(e))throw Error(C(418));t=Xt(r.nextSibling);var s=Ke;t&&uu(e,t)?Sh(s,r):(e.flags=e.flags&-4097|2,te=!1,Ke=e)}}else{if(Mo(e))throw Error(C(418));e.flags=e.flags&-4097|2,te=!1,Ke=e}}}function du(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ke=e}function ii(e){if(e!==Ke)return!1;if(!te)return du(e),te=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Lo(e.type,e.memoizedProps)),t&&(t=He)){if(Mo(e))throw Eh(),Error(C(418));for(;t;)Sh(e,t),t=Xt(t.nextSibling)}if(du(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(C(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){He=Xt(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}He=null}}else He=Ke?Xt(e.stateNode.nextSibling):null;return!0}function Eh(){for(var e=He;e;)e=Xt(e.nextSibling)}function bs(){He=Ke=null,te=!1}function ql(e){dt===null?dt=[e]:dt.push(e)}var v0=Lt.ReactCurrentBatchConfig;function Ws(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(C(309));var s=r.stateNode}if(!s)throw Error(C(147,e));var n=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=n.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(C(284));if(!r._owner)throw Error(C(290,e))}return e}function ai(e,t){throw e=Object.prototype.toString.call(t),Error(C(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function hu(e){var t=e._init;return t(e._payload)}function Ch(e){function t(m,g){if(e){var y=m.deletions;y===null?(m.deletions=[g],m.flags|=16):y.push(g)}}function r(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function s(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function n(m,g){return m=sr(m,g),m.index=0,m.sibling=null,m}function a(m,g,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<g?(m.flags|=2,g):y):(m.flags|=2,g)):(m.flags|=1048576,g)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,g,y,j){return g===null||g.tag!==6?(g=eo(y,m.mode,j),g.return=m,g):(g=n(g,y),g.return=m,g)}function c(m,g,y,j){var N=y.type;return N===Xr?h(m,g,y.props.children,j,y.key):g!==null&&(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Mt&&hu(N)===g.type)?(j=n(g,y.props),j.ref=Ws(m,g,y),j.return=m,j):(j=Si(y.type,y.key,y.props,null,m.mode,j),j.ref=Ws(m,g,y),j.return=m,j)}function u(m,g,y,j){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=to(y,m.mode,j),g.return=m,g):(g=n(g,y.children||[]),g.return=m,g)}function h(m,g,y,j,N){return g===null||g.tag!==7?(g=Pr(y,m.mode,j,N),g.return=m,g):(g=n(g,y),g.return=m,g)}function d(m,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=eo(""+g,m.mode,y),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Gn:return y=Si(g.type,g.key,g.props,null,m.mode,y),y.ref=Ws(m,null,g),y.return=m,y;case Yr:return g=to(g,m.mode,y),g.return=m,g;case Mt:var j=g._init;return d(m,j(g._payload),y)}if(Qs(g)||Ds(g))return g=Pr(g,m.mode,y,null),g.return=m,g;ai(m,g)}return null}function f(m,g,y,j){var N=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return N!==null?null:l(m,g,""+y,j);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Gn:return y.key===N?c(m,g,y,j):null;case Yr:return y.key===N?u(m,g,y,j):null;case Mt:return N=y._init,f(m,g,N(y._payload),j)}if(Qs(y)||Ds(y))return N!==null?null:h(m,g,y,j,null);ai(m,y)}return null}
vendor: 1,604 bytes, line 38
38function p(m,g,y,j,N){if(typeof j=="string"&&j!==""||typeof j=="number")return m=m.get(y)||null,l(g,m,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Gn:return m=m.get(j.key===null?y:j.key)||null,c(g,m,j,N);case Yr:return m=m.get(j.key===null?y:j.key)||null,u(g,m,j,N);case Mt:var k=j._init;return p(m,g,y,k(j._payload),N)}if(Qs(j)||Ds(j))return m=m.get(y)||null,h(g,m,j,N,null);ai(g,j)}return null}function w(m,g,y,j){for(var N=null,k=null,_=g,E=g=0,O=null;_!==null&&E<y.length;E++){_.index>E?(O=_,_=null):O=_.sibling;var R=f(m,_,y[E],j);if(R===null){_===null&&(_=O);break}e&&_&&R.alternate===null&&t(m,_),g=a(R,g,E),k===null?N=R:k.sibling=R,k=R,_=O}if(E===y.length)return r(m,_),te&&vr(m,E),N;if(_===null){for(;E<y.length;E++)_=d(m,y[E],j),_!==null&&(g=a(_,g,E),k===null?N=_:k.sibling=_,k=_);return te&&vr(m,E),N}for(_=s(m,_);E<y.length;E++)O=p(_,m,E,y[E],j),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?E:O.key),g=a(O,g,E),k===null?N=O:k.sibling=O,k=O);return e&&_.forEach(function(V){return t(m,V)}),te&&vr(m,E),N}function b(m,g,y,j){var N=Ds(y);if(typeof N!="function")throw Error(C(150));if(y=N.call(y),y==null)throw Error(C(151));for(var k=N=null,_=g,E=g=0,O=null,R=y.next();_!==null&&!R.done;E++,R=y.next()){_.index>E?(O=_,_=null):O=_.sibling;var V=f(m,_,R.value,j);if(V===null){_===null&&(_=O);break}e&&_&&V.alternate===null&&t(m,_),g=a(V,g,E),k===null?N=V:k.sibling=V,k=V,_=O}if(R.done)return r(m,_),te&&vr(m,E),N;if(_===null){for(;!R.done;E++,R=y.next())R=d(m,R.value,j),R!==null&&(g=a(R,g,E),k===null?N=R:k.sibling=R,k=R);return te&&vr(m,E),N}for(_=s(m,_);!R.done;
vendor: 6,896 bytes, line 38
38E++,R=y.next())R=p(_,m,E,R.value,j),R!==null&&(e&&R.alternate!==null&&_.delete(R.key===null?E:R.key),g=a(R,g,E),k===null?N=R:k.sibling=R,k=R);return e&&_.forEach(function(Oe){return t(m,Oe)}),te&&vr(m,E),N}function x(m,g,y,j){if(typeof y=="object"&&y!==null&&y.type===Xr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Gn:e:{for(var N=y.key,k=g;k!==null;){if(k.key===N){if(N=y.type,N===Xr){if(k.tag===7){r(m,k.sibling),g=n(k,y.props.children),g.return=m,m=g;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Mt&&hu(N)===k.type){r(m,k.sibling),g=n(k,y.props),g.ref=Ws(m,k,y),g.return=m,m=g;break e}r(m,k);break}else t(m,k);k=k.sibling}y.type===Xr?(g=Pr(y.props.children,m.mode,j,y.key),g.return=m,m=g):(j=Si(y.type,y.key,y.props,null,m.mode,j),j.ref=Ws(m,g,y),j.return=m,m=j)}return o(m);case Yr:e:{for(k=y.key;g!==null;){if(g.key===k)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){r(m,g.sibling),g=n(g,y.children||[]),g.return=m,m=g;break e}else{r(m,g);break}else t(m,g);g=g.sibling}g=to(y,m.mode,j),g.return=m,m=g}return o(m);case Mt:return k=y._init,x(m,g,k(y._payload),j)}if(Qs(y))return w(m,g,y,j);if(Ds(y))return b(m,g,y,j);ai(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(r(m,g.sibling),g=n(g,y),g.return=m,m=g):(r(m,g),g=eo(y,m.mode,j),g.return=m,m=g),o(m)):r(m,g)}return x}var js=Ch(!0),Th=Ch(!1),Bi=cr(null),zi=null,os=null,Kl=null;function Jl(){Kl=os=zi=null}function Gl(e){var t=Bi.current;ee(Bi),e._currentValue=t}function zo(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function ps(e,t){zi=e,Kl=os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(De=!0),e.firstContext=null)}function st(e){var t=e._currentValue;if(Kl!==e)if(e={context:e,memoizedValue:t,next:null},os===null){if(zi===null)throw Error(C(308));os=e,zi.dependencies={lanes:0,firstContext:e}}else os=os.next=e;return t}var Sr=null;function Ql(e){Sr===null?Sr=[e]:Sr.push(e)}function Ph(e,t,r,s){var n=t.interleaved;return n===null?(r.next=r,Ql(t)):(r.next=n.next,n.next=r),t.interleaved=r,Rt(e,s)}function Rt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Bt=!1;function Zl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ih(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 It(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function er(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,q&2){var n=s.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),s.pending=t,Rt(e,r)}return n=s.interleaved,n===null?(t.next=t,Ql(s)):(t.next=n.next,n.next=t),s.interleaved=t,Rt(e,r)}function wi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Ll(e,r)}}function fu(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var n=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?n=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?n=a=t:a=a.next=t}else n=a=t;r={baseState:s.baseState,firstBaseUpdate:n,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Wi(e,t,r,s){var n=e.updateQueue;Bt=!1;var a=n.firstBaseUpdate,o=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c))}if(a!==null){var d=n.baseState;o=0,h=u=c=null,l=a;do{var f=l.lane,p=l.eventTime;if((s&f)===f){h!==null&&(h=h.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,b=l;switch(f=t,p=r,b.tag){case 1:if(w=b.payload,typeof w=="function"){d=w.call(p,d,f);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=b.payload,f=typeof w=="function"?w.call(p,d,f):w,f==null)break e;d=ne({},d,f);break e;case 2:Bt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=n.effects,f===null?n.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(u=h=p,c=d):h=h.next=p,o|=f;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;f=l,l=f.next,f.next=null,n.lastBaseUpdate=f,n.shared.pending=null}}while(!0);if(h===null&&(c=d),n.baseState=c,n.firstBaseUpdate=u,n.lastBaseUpdate=h,t=n.shared.interleaved,t!==null){n=t;do o|=n.lane,n=n.next;while(n!==t)}else a===null&&(n.shared.lanes=0);Ur|=o,e.lanes=o,e.memoizedState=d}}function pu(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],n=s.callback;if(n!==null){if(s.callback=null,s=r,typeof n!="function")throw Error(C(191,n));n.call(s)}}}var Wn={},jt=cr(Wn),Cn=cr(Wn),Tn=cr(Wn);function Er(e){if(e===Wn)throw Error(C(174));return e}function Yl(e,t){switch(Y(Tn,t),Y(Cn,e),Y(jt,Wn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jo(t,e)}ee(jt),Y(jt,t)}function _s(){ee(jt),ee(Cn),ee(Tn)}function Oh(e){Er(Tn.current);var t=Er(jt.current),r=jo(t,e.type);t!==r&&(Y(Cn,e),Y(jt,r))}function Xl(e){Cn.current===e&&(ee(jt),ee(Cn))}var re=cr(0);function Vi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.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 Ja=[];function ec(){for(var e=0;e<Ja.length;e++)Ja[e]._workInProgressVersionPrimary=null;Ja.length=0}var bi=Lt.ReactCurrentDispatcher,Ga=Lt.ReactCurrentBatchConfig,Rr=0,se=null,me=null,xe=null,Hi=!1,cn=!1,Pn=0,w0=0;function _e(){throw Error(C(321))}function tc(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!pt(e[r],t[r]))return!1;return!0}function rc(e,t,r,s,n,a){if(Rr=a,se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bi.current=e===null||e.memoizedState===null?N0:k0,e=r(s,n),cn){a=0;
vendor: 4,973 bytes, line 38
38do{if(cn=!1,Pn=0,25<=a)throw Error(C(301));a+=1,xe=me=null,t.updateQueue=null,bi.current=S0,e=r(s,n)}while(cn)}if(bi.current=qi,t=me!==null&&me.next!==null,Rr=0,xe=me=se=null,Hi=!1,t)throw Error(C(300));return e}function sc(){var e=Pn!==0;return Pn=0,e}function yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xe===null?se.memoizedState=xe=e:xe=xe.next=e,xe}function nt(){if(me===null){var e=se.alternate;e=e!==null?e.memoizedState:null}else e=me.next;var t=xe===null?se.memoizedState:xe.next;if(t!==null)xe=t,me=e;else{if(e===null)throw Error(C(310));me=e,e={memoizedState:me.memoizedState,baseState:me.baseState,baseQueue:me.baseQueue,queue:me.queue,next:null},xe===null?se.memoizedState=xe=e:xe=xe.next=e}return xe}function In(e,t){return typeof t=="function"?t(e):t}function Qa(e){var t=nt(),r=t.queue;if(r===null)throw Error(C(311));r.lastRenderedReducer=e;var s=me,n=s.baseQueue,a=r.pending;if(a!==null){if(n!==null){var o=n.next;n.next=a.next,a.next=o}s.baseQueue=n=a,r.pending=null}if(n!==null){a=n.next,s=s.baseState;var l=o=null,c=null,u=a;do{var h=u.lane;if((Rr&h)===h)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var d={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,o=s):c=c.next=d,se.lanes|=h,Ur|=h}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,pt(s,t.memoizedState)||(De=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,r.lastRenderedState=s}if(e=r.interleaved,e!==null){n=e;do a=n.lane,se.lanes|=a,Ur|=a,n=n.next;while(n!==e)}else n===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Za(e){var t=nt(),r=t.queue;if(r===null)throw Error(C(311));r.lastRenderedReducer=e;var s=r.dispatch,n=r.pending,a=t.memoizedState;if(n!==null){r.pending=null;var o=n=n.next;do a=e(a,o.action),o=o.next;while(o!==n);pt(a,t.memoizedState)||(De=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,s]}function Ah(){}function Rh(e,t){var r=se,s=nt(),n=t(),a=!pt(s.memoizedState,n);if(a&&(s.memoizedState=n,De=!0),s=s.queue,nc($h.bind(null,r,s,e),[e]),s.getSnapshot!==t||a||xe!==null&&xe.memoizedState.tag&1){if(r.flags|=2048,On(9,Lh.bind(null,r,s,n,t),void 0,null),ye===null)throw Error(C(349));Rr&30||Uh(r,t,n)}return n}function Uh(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=se.updateQueue,t===null?(t={lastEffect:null,stores:null},se.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Lh(e,t,r,s){t.value=r,t.getSnapshot=s,Dh(t)&&Fh(e)}function $h(e,t,r){return r(function(){Dh(t)&&Fh(e)})}function Dh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!pt(e,r)}catch{return!0}}function Fh(e){var t=Rt(e,1);t!==null&&ft(t,e,1,-1)}function mu(e){var t=yt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:In,lastRenderedState:e},t.queue=e,e=e.dispatch=_0.bind(null,se,e),[t.memoizedState,e]}function On(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=se.updateQueue,t===null?(t={lastEffect:null,stores:null},se.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e)),e}function Mh(){return nt().memoizedState}function ji(e,t,r,s){var n=yt();se.flags|=e,n.memoizedState=On(1|t,r,void 0,s===void 0?null:s)}function pa(e,t,r,s){var n=nt();s=s===void 0?null:s;var a=void 0;if(me!==null){var o=me.memoizedState;if(a=o.destroy,s!==null&&tc(s,o.deps)){n.memoizedState=On(t,r,a,s);return}}se.flags|=e,n.memoizedState=On(1|t,r,a,s)}function gu(e,t){return ji(8390656,8,e,t)}function nc(e,t){return pa(2048,8,e,t)}function Bh(e,t){return pa(4,2,e,t)}function zh(e,t){return pa(4,4,e,t)}function Wh(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 Vh(e,t,r){return r=r!=null?r.concat([e]):null,pa(4,4,Wh.bind(null,t,e),r)}function ic(){}function Hh(e,t){var r=nt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&tc(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function qh(e,t){var r=nt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&tc(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function Kh(e,t,r){return Rr&21?(pt(r,t)||(r=Yd(),se.lanes|=r,Ur|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,De=!0),e.memoizedState=r)}function b0(e,t){var r=J;J=r!==0&&4>r?r:4,e(!0);var s=Ga.transition;Ga.transition={};try{e(!1),t()}finally{J=r,Ga.transition=s}}function Jh(){return nt().memoizedState}function j0(e,t,r){var s=rr(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},Gh(e))Qh(t,r);else if(r=Ph(e,t,r,s),r!==null){var n=Te();ft(r,e,s,n),Zh(r,t,s)}}function _0(e,t,r){var s=rr(e),n={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};
vendor: 9,043 bytes, lines 38-40
38if(Gh(e))Qh(t,n);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,r);if(n.hasEagerState=!0,n.eagerState=l,pt(l,o)){var c=t.interleaved;c===null?(n.next=n,Ql(t)):(n.next=c.next,c.next=n),t.interleaved=n;return}}catch{}finally{}r=Ph(e,t,n,s),r!==null&&(n=Te(),ft(r,e,s,n),Zh(r,t,s))}}function Gh(e){var t=e.alternate;return e===se||t!==null&&t===se}function Qh(e,t){cn=Hi=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Zh(e,t,r){if(r&4194240){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Ll(e,r)}}var qi={readContext:st,useCallback:_e,useContext:_e,useEffect:_e,useImperativeHandle:_e,useInsertionEffect:_e,useLayoutEffect:_e,useMemo:_e,useReducer:_e,useRef:_e,useState:_e,useDebugValue:_e,useDeferredValue:_e,useTransition:_e,useMutableSource:_e,useSyncExternalStore:_e,useId:_e,unstable_isNewReconciler:!1},N0={readContext:st,useCallback:function(e,t){return yt().memoizedState=[e,t===void 0?null:t],e},useContext:st,useEffect:gu,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ji(4194308,4,Wh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ji(4194308,4,e,t)},useInsertionEffect:function(e,t){return ji(4,2,e,t)},useMemo:function(e,t){var r=yt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=yt();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=j0.bind(null,se,e),[s.memoizedState,e]},useRef:function(e){var t=yt();return e={current:e},t.memoizedState=e},useState:mu,useDebugValue:ic,useDeferredValue:function(e){return yt().memoizedState=e},useTransition:function(){var e=mu(!1),t=e[0];return e=b0.bind(null,e[1]),yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=se,n=yt();if(te){if(r===void 0)throw Error(C(407));r=r()}else{if(r=t(),ye===null)throw Error(C(349));Rr&30||Uh(s,t,r)}n.memoizedState=r;var a={value:r,getSnapshot:t};return n.queue=a,gu($h.bind(null,s,a,e),[e]),s.flags|=2048,On(9,Lh.bind(null,s,a,r,t),void 0,null),r},useId:function(){var e=yt(),t=ye.identifierPrefix;if(te){var r=Pt,s=Tt;r=(s&~(1<<32-ht(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=Pn++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=w0++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},k0={readContext:st,useCallback:Hh,useContext:st,useEffect:nc,useImperativeHandle:Vh,useInsertionEffect:Bh,useLayoutEffect:zh,useMemo:qh,useReducer:Qa,useRef:Mh,useState:function(){return Qa(In)},useDebugValue:ic,useDeferredValue:function(e){var t=nt();return Kh(t,me.memoizedState,e)},useTransition:function(){var e=Qa(In)[0],t=nt().memoizedState;return[e,t]},useMutableSource:Ah,useSyncExternalStore:Rh,useId:Jh,unstable_isNewReconciler:!1},S0={readContext:st,useCallback:Hh,useContext:st,useEffect:nc,useImperativeHandle:Vh,useInsertionEffect:Bh,useLayoutEffect:zh,useMemo:qh,useReducer:Za,useRef:Mh,useState:function(){return Za(In)},useDebugValue:ic,useDeferredValue:function(e){var t=nt();return me===null?t.memoizedState=e:Kh(t,me.memoizedState,e)},useTransition:function(){var e=Za(In)[0],t=nt().memoizedState;return[e,t]},useMutableSource:Ah,useSyncExternalStore:Rh,useId:Jh,unstable_isNewReconciler:!1};function lt(e,t){if(e&&e.defaultProps){t=ne({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Wo(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:ne({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ma={isMounted:function(e){return(e=e._reactInternals)?Dr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=Te(),n=rr(e),a=It(s,n);a.payload=t,r!=null&&(a.callback=r),t=er(e,a,n),t!==null&&(ft(t,e,n,s),wi(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=Te(),n=rr(e),a=It(s,n);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=er(e,a,n),t!==null&&(ft(t,e,n,s),wi(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Te(),s=rr(e),n=It(r,s);n.tag=2,t!=null&&(n.callback=t),t=er(e,n,s),t!==null&&(ft(t,e,s,r),wi(t,e,s))}};function xu(e,t,r,s,n,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!Nn(r,s)||!Nn(n,a):!0}function Yh(e,t,r){var s=!1,n=or,a=t.contextType;return typeof a=="object"&&a!==null?a=st(a):(n=Me(t)?Or:Se.current,s=t.contextTypes,a=(s=s!=null)?ws(e,n):or),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ma,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=a),t}function yu(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&ma.enqueueReplaceState(t,t.state,null)}function Vo(e,t,r,s){var n=e.stateNode;n.props=r,n.state=e.memoizedState,n.refs={},Zl(e);var a=t.contextType;typeof a=="object"&&a!==null?n.context=st(a):(a=Me(t)?Or:Se.current,n.context=ws(e,a)),n.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Wo(e,t,a,r),n.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(t=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),t!==n.state&&ma.enqueueReplaceState(n,n.state,null),Wi(e,r,n,s),n.state=e.memoizedState),typeof n.componentDidMount=="function"&&(e.flags|=4194308)}function Ns(e,t){try{var r="",s=t;do r+=em(s),s=s.return;while(s);var n=r}catch(a){n=`
39Error generating stack: `+a.message+`
40`+a.stack}return{value:e,source:t,stack:n,digest:null}}function Ya(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ho(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var E0=typeof WeakMap=="function"?WeakMap:Map;function Xh(e,t,r){r=It(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){Ji||(Ji=!0,tl=s),Ho(e,t)},r}function ef(e,t,r){r=It(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var n=t.value;r.payload=function(){return s(n)},r.callback=function(){Ho(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Ho(e,t),typeof s!="function"&&(tr===null?tr=new Set([this]):tr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function vu(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new E0;var n=new Set;s.set(t,n)}else n=s.get(t),n===void 0&&(n=new Set,s.set(t,n));n.has(r)||(n.add(r),e=B0.bind(null,e,t,r),t.then(e,e))}function wu(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 bu(e,t,r,s,n){return e.mode&1?(e.flags|=65536,e.lanes=n,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=It(-1,1),t.tag=2,er(r,t,1))),r.lanes|=1),e)}var C0=Lt.ReactCurrentOwner,De=!1;function Ee(e,t,r,s){t.child=e===null?Th(t,null,r,s):js(t,e.child,r,s)}function ju(e,t,r,s,n){r=r.render;var a=t.ref;return ps(t,n),s=rc(e,t,r,s,a,n),r=sc(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Ut(e,t,n)):(te&&r&&Vl(t),t.flags|=1,Ee(e,t,s,n),t.child)}function _u(e,t,r,s,n){if(e===null){var a=r.type;return typeof a=="function"&&!fc(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,tf(e,t,a,s,n)):(e=Si(r.type,null,s,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&n)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:Nn,r(o,s)&&e.ref===t.ref)return Ut(e,t,n)}return t.flags|=1,e=sr(a,s),e.ref=t.ref,e.return=t,t.child=e}function tf(e,t,r,s,n){if(e!==null){var a=e.memoizedProps;if(Nn(a,s)&&e.ref===t.ref)if(De=!1,t.pendingProps=s=a,(e.lanes&n)!==0)e.flags&131072&&(De=!0);else return t.lanes=e.lanes,Ut(e,t,n)}return qo(e,t,r,s,n)}function rf(e,t,r){var s=t.pendingProps,n=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Y(cs,Ve),Ve|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Y(cs,Ve),Ve|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:r,Y(cs,Ve),Ve|=s}else a!==null?(s=a.baseLanes|r,t.memoizedState=null):s=r,Y(cs,Ve),Ve|=s;return Ee(e,t,n,r),t.child}function sf(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}
vendor: 4,710 bytes, line 40
40function qo(e,t,r,s,n){var a=Me(r)?Or:Se.current;return a=ws(t,a),ps(t,n),r=rc(e,t,r,s,a,n),s=sc(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Ut(e,t,n)):(te&&s&&Vl(t),t.flags|=1,Ee(e,t,r,n),t.child)}function Nu(e,t,r,s,n){if(Me(r)){var a=!0;Di(t)}else a=!1;if(ps(t,n),t.stateNode===null)_i(e,t),Yh(t,r,s),Vo(t,r,s,n),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=st(u):(u=Me(r)?Or:Se.current,u=ws(t,u));var h=r.getDerivedStateFromProps,d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&yu(t,o,s,u),Bt=!1;var f=t.memoizedState;o.state=f,Wi(t,s,o,n),c=t.memoizedState,l!==s||f!==c||Fe.current||Bt?(typeof h=="function"&&(Wo(t,r,h,s),c=t.memoizedState),(l=Bt||xu(t,r,l,s,f,c,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,Ih(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:lt(t.type,l),o.props=u,d=t.pendingProps,f=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=st(c):(c=Me(r)?Or:Se.current,c=ws(t,c));var p=r.getDerivedStateFromProps;(h=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||f!==c)&&yu(t,o,s,c),Bt=!1,f=t.memoizedState,o.state=f,Wi(t,s,o,n);var w=t.memoizedState;l!==d||f!==w||Fe.current||Bt?(typeof p=="function"&&(Wo(t,r,p,s),w=t.memoizedState),(u=Bt||xu(t,r,u,s,f,w,c)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,w,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=w),o.props=s,o.state=w,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Ko(e,t,r,s,a,n)}function Ko(e,t,r,s,n,a){sf(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return n&&cu(t,r,!1),Ut(e,t,a);s=t.stateNode,C0.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=js(t,e.child,null,a),t.child=js(t,null,l,a)):Ee(e,t,l,a),t.memoizedState=s.state,n&&cu(t,r,!0),t.child}function nf(e){var t=e.stateNode;t.pendingContext?lu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&lu(e,t.context,!1),Yl(e,t.containerInfo)}function ku(e,t,r,s,n){return bs(),ql(n),t.flags|=256,Ee(e,t,r,s),t.child}var Jo={dehydrated:null,treeContext:null,retryLane:0};function Go(e){return{baseLanes:e,cachePool:null,transitions:null}}function af(e,t,r){var s=t.pendingProps,n=re.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(n&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),Y(re,n&1),e===null)return Bo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=s.children,e=s.fallback,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=ya(o,s,0,null),e=Pr(e,s,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Go(r),t.memoizedState=Jo,e):ac(t,o));if(n=e.memoizedState,n!==null&&(l=n.dehydrated,l!==null))return T0(e,t,o,s,l,n,r);if(a){a=s.fallback,o=t.mode,n=e.child,l=n.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==n?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=sr(n,c),s.subtreeFlags=n.subtreeFlags&14680064),l!==null?a=sr(l,a):(a=Pr(a,o,r,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?Go(r):{base
vendor: 7,490 bytes, line 40
40Lanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=Jo,s}return a=e.child,e=a.sibling,s=sr(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=r),s.return=t,s.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=s,t.memoizedState=null,s}function ac(e,t){return t=ya({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function oi(e,t,r,s){return s!==null&&ql(s),js(t,e.child,null,r),e=ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function T0(e,t,r,s,n,a,o){if(r)return t.flags&256?(t.flags&=-257,s=Ya(Error(C(422))),oi(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,n=t.mode,s=ya({mode:"visible",children:s.children},n,0,null),a=Pr(a,n,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&js(t,e.child,null,o),t.child.memoizedState=Go(o),t.memoizedState=Jo,a);if(!(t.mode&1))return oi(e,t,o,null);if(n.data==="$!"){if(s=n.nextSibling&&n.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(C(419)),s=Ya(a,s,void 0),oi(e,t,o,s)}if(l=(o&e.childLanes)!==0,De||l){if(s=ye,s!==null){switch(o&-o){case 4:n=2;break;case 16:n=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(s.suspendedLanes|o)?0:n,n!==0&&n!==a.retryLane&&(a.retryLane=n,Rt(e,n),ft(s,e,n,-1))}return hc(),s=Ya(Error(C(421))),oi(e,t,o,s)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=z0.bind(null,e),n._reactRetry=t,null):(e=a.treeContext,He=Xt(n.nextSibling),Ke=t,te=!0,dt=null,e!==null&&(Ye[Xe++]=Tt,Ye[Xe++]=Pt,Ye[Xe++]=Ar,Tt=e.id,Pt=e.overflow,Ar=t),t=ac(t,s.children),t.flags|=4096,t)}function Su(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),zo(e.return,t,r)}function Xa(e,t,r,s,n){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:n}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=r,a.tailMode=n)}function of(e,t,r){var s=t.pendingProps,n=s.revealOrder,a=s.tail;if(Ee(e,t,s.children,r),s=re.current,s&2)s=s&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&&Su(e,r,t);else if(e.tag===19)Su(e,r,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}s&=1}if(Y(re,s),!(t.mode&1))t.memoizedState=null;else switch(n){case"forwards":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&Vi(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),Xa(t,!1,n,r,a);break;case"backwards":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Vi(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}Xa(t,!0,r,null,a);break;case"together":Xa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function _i(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ut(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ur|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(C(153));if(t.child!==null){for(e=t.child,r=sr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=sr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function P0(e,t,r){switch(t.tag){case 3:nf(t),bs();break;case 5:Oh(t);break;case 1:Me(t.type)&&Di(t);break;case 4:Yl(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,n=t.memoizedProps.value;Y(Bi,s._currentValue),s._currentValue=n;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Y(re,re.current&1),t.flags|=128,null):r&t.child.childLanes?af(e,t,r):(Y(re,re.current&1),e=Ut(e,t,r),e!==null?e.sibling:null);Y(re,re.current&1);break;case 19:if(s=(r&t.childLanes)!==0,e.flags&128){if(s)return of(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),Y(re,re.current),s)break;return null;case 22:case 23:return t.lanes=0,rf(e,t,r)}return Ut(e,t,r)}var lf,Qo,cf,uf;lf=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Qo=function(){};cf=function(e,t,r,s){var n=e.memoizedProps;if(n!==s){e=t.stateNode,Er(jt.current);var a=null;switch(r){case"input":n=yo(e,n),s=yo(e,s),a=[];break;case"select":n=ne({},n,{value:void 0}),s=ne({},s,{value:void 0}),a=[];break;case"textarea":n=bo(e,n),s=bo(e,s),a=[];break;default:typeof n.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Li)}_o(r,s);var o;r=null;for(u in n)if(!s.hasOwnProperty(u)&&n.hasOwnProperty(u)&&n[u]!=null)if(u==="style"){var l=n[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(xn.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=n!=null?n[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(a||(a=[]),a.push(u,r)),r=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"&&(xn.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&X("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};uf=function(e,t,r,s){r!==s&&(t.flags|=4)};function Vs(e,t){if(!te)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,s|=n.subtreeFlags&14680064,s|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,s|=n.subtreeFlags,s|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function I0(e,t,r){var s=t.pendingProps;switch(Hl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ne(t),null;case 1:return Me(t.type)&&$i(),Ne(t),null;case 3:return s=t.stateNode,_s(),ee(Fe),ee(Se),ec(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ii(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,dt!==null&&(nl(dt),dt=null))),Qo(e,t),Ne(t),null;case 5:Xl(t);var n=Er(Tn.current);if(r=t.type,e!==null&&t.stateNode!=null)cf(e,t,r,s,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);
vendor: 32,339 bytes, line 40
40else{if(!s){if(t.stateNode===null)throw Error(C(166));return Ne(t),null}if(e=Er(jt.current),ii(t)){s=t.stateNode,r=t.type;var a=t.memoizedProps;switch(s[wt]=t,s[En]=a,e=(t.mode&1)!==0,r){case"dialog":X("cancel",s),X("close",s);break;case"iframe":case"object":case"embed":X("load",s);break;case"video":case"audio":for(n=0;n<Ys.length;n++)X(Ys[n],s);break;case"source":X("error",s);break;case"img":case"image":case"link":X("error",s),X("load",s);break;case"details":X("toggle",s);break;case"input":Uc(s,a),X("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},X("invalid",s);break;case"textarea":$c(s,a),X("invalid",s)}_o(r,a),n=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&ni(s.textContent,l,e),n=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&ni(s.textContent,l,e),n=["children",""+l]):xn.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&X("scroll",s)}switch(r){case"input":Qn(s),Lc(s,a,!0);break;case"textarea":Qn(s),Dc(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=Li)}s=n,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$d(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(r,{is:s.is}):(e=o.createElement(r),r==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,r),e[wt]=t,e[En]=s,lf(e,t,!1,!1),t.stateNode=e;e:{switch(o=No(r,s),r){case"dialog":X("cancel",e),X("close",e),n=s;break;case"iframe":case"object":case"embed":X("load",e),n=s;break;case"video":case"audio":for(n=0;n<Ys.length;n++)X(Ys[n],e);n=s;break;case"source":X("error",e),n=s;break;case"img":case"image":case"link":X("error",e),X("load",e),n=s;break;case"details":X("toggle",e),n=s;break;case"input":Uc(e,s),n=yo(e,s),X("invalid",e);break;case"option":n=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},n=ne({},s,{value:void 0}),X("invalid",e);break;case"textarea":$c(e,s),n=bo(e,s),X("invalid",e);break;default:n=s}_o(r,n),l=n;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Md(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Dd(e,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&yn(e,c):typeof c=="number"&&yn(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(xn.hasOwnProperty(a)?c!=null&&a==="onScroll"&&X("scroll",e):c!=null&&Pl(e,a,c,o))}switch(r){case"input":Qn(e),Lc(e,s,!1);break;case"textarea":Qn(e),Dc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+ar(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?us(e,!!s.multiple,a,!1):s.defaultValue!=null&&us(e,!!s.multiple,s.defaultValue,!0);break;default:typeof n.onClick=="function"&&(e.onclick=Li)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ne(t),null;case 6:if(e&&t.stateNode!=null)uf(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(C(166));if(r=Er(Tn.current),Er(jt.current),ii(t)){if(s=t.stateNode,r=t.memoizedProps,s[wt]=t,(a=s.nodeValue!==r)&&(e=Ke,e!==null))switch(e.tag){case 3:ni(s.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ni(s.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[wt]=t,t.stateNode=s}return Ne(t),null;case 13:if(ee(re),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(te&&He!==null&&t.mode&1&&!(t.flags&128))Eh(),bs(),t.flags|=98560,a=!1;else if(a=ii(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(C(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(C(317));a[wt]=t}else bs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ne(t),a=!1}else dt!==null&&(nl(dt),dt=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||re.current&1?ge===0&&(ge=3):hc())),t.updateQueue!==null&&(t.flags|=4),Ne(t),null);case 4:return _s(),Qo(e,t),e===null&&kn(t.stateNode.containerInfo),Ne(t),null;case 10:return Gl(t.type._context),Ne(t),null;case 17:return Me(t.type)&&$i(),Ne(t),null;case 19:if(ee(re),a=t.memoizedState,a===null)return Ne(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)Vs(a,!1);else{if(ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vi(e),o!==null){for(t.flags|=128,Vs(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=r,r=t.child;r!==null;)a=r,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Y(re,re.current&1|2),t.child}e=e.sibling}a.tail!==null&&le()>ks&&(t.flags|=128,s=!0,Vs(a,!1),t.lanes=4194304)}else{if(!s)if(e=Vi(o),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Vs(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!te)return Ne(t),null}else 2*le()-a.renderingStartTime>ks&&r!==1073741824&&(t.flags|=128,s=!0,Vs(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=le(),t.sibling=null,r=re.current,Y(re,s?r&1|2:r&1),t):(Ne(t),null);case 22:case 23:return dc(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Ve&1073741824&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(C(156,t.tag))}function O0(e,t){switch(Hl(t),t.tag){case 1:return Me(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _s(),ee(Fe),ee(Se),ec(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xl(t),null;case 13:if(ee(re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(C(340));bs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ee(re),null;case 4:return _s(),null;case 10:return Gl(t.type._context),null;case 22:case 23:return dc(),null;case 24:return null;default:return null}}var li=!1,ke=!1,A0=typeof WeakSet=="function"?WeakSet:Set,A=null;function ls(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){ae(e,t,s)}else r.current=null}function Zo(e,t,r){try{r()}catch(s){ae(e,t,s)}}var Eu=!1;function R0(e,t){if(Ro=Ai,e=ph(),Wl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var n=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var p;d!==r||n!==0&&d.nodeType!==3||(l=o+n),d!==a||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++u===n&&(l=o),f===a&&++h===s&&(c=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Uo={focusedElem:e,selectionRange:r},Ai=!1,A=t;A!==null;)if(t=A,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,A=e;else for(;A!==null;){t=A;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var b=w.memoizedProps,x=w.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?b:lt(t.type,b),x);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(C(163))}}catch(j){ae(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,A=e;break}A=t.return}return w=Eu,Eu=!1,w}function un(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var n=s=s.next;do{if((n.tag&e)===e){var a=n.destroy;n.destroy=void 0,a!==void 0&&Zo(t,r,a)}n=n.next}while(n!==s)}}function ga(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function Yo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function df(e){var t=e.alternate;t!==null&&(e.alternate=null,df(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wt],delete t[En],delete t[Do],delete t[g0],delete t[x0])),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 hf(e){return e.tag===5||e.tag===3||e.tag===4}function Cu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hf(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 Xo(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Li));else if(s!==4&&(e=e.child,e!==null))for(Xo(e,t,r),e=e.sibling;e!==null;)Xo(e,t,r),e=e.sibling}function el(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(el(e,t,r),e=e.sibling;e!==null;)el(e,t,r),e=e.sibling}var we=null,ct=!1;function $t(e,t,r){for(r=r.child;r!==null;)ff(e,t,r),r=r.sibling}function ff(e,t,r){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(la,r)}catch{}switch(r.tag){case 5:ke||ls(r,t);case 6:var s=we,n=ct;we=null,$t(e,t,r),we=s,ct=n,we!==null&&(ct?(e=we,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):we.removeChild(r.stateNode));break;case 18:we!==null&&(ct?(e=we,r=r.stateNode,e.nodeType===8?qa(e.parentNode,r):e.nodeType===1&&qa(e,r),jn(e)):qa(we,r.stateNode));break;case 4:s=we,n=ct,we=r.stateNode.containerInfo,ct=!0,$t(e,t,r),we=s,ct=n;break;case 0:case 11:case 14:case 15:if(!ke&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){n=s=s.next;do{var a=n,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Zo(r,t,o),n=n.next}while(n!==s)}$t(e,t,r);break;case 1:if(!ke&&(ls(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(l){ae(r,t,l)}$t(e,t,r);break;case 21:$t(e,t,r);break;case 22:r.mode&1?(ke=(s=ke)||r.memoizedState!==null,$t(e,t,r),ke=s):$t(e,t,r);break;default:$t(e,t,r)}}function Tu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new A0),t.forEach(function(s){var n=W0.bind(null,e,s);r.has(s)||(r.add(s),s.then(n,n))})}}function at(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var n=r[s];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:we=l.stateNode,ct=!1;break e;case 3:we=l.stateNode.containerInfo,ct=!0;break e;case 4:we=l.stateNode.containerInfo,ct=!0;break e}l=l.return}if(we===null)throw Error(C(160));ff(a,o,n),we=null,ct=!1;var c=n.alternate;c!==null&&(c.return=null),n.return=null}catch(u){ae(n,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)pf(t,e),t=t.sibling}function pf(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(at(t,e),xt(e),s&4){try{un(3,e,e.return),ga(3,e)}catch(b){ae(e,e.return,b)}try{un(5,e,e.return)}catch(b){ae(e,e.return,b)}}break;case 1:at(t,e),xt(e),s&512&&r!==null&&ls(r,r.return);break;case 5:if(at(t,e),xt(e),s&512&&r!==null&&ls(r,r.return),e.flags&32){var n=e.stateNode;try{yn(n,"")}catch(b){ae(e,e.return,b)}}if(s&4&&(n=e.stateNode,n!=null)){var a=e.memoizedProps,o=r!==null?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&Ud(n,a),No(l,o);var u=No(l,a);for(o=0;o<c.length;o+=2){var h=c[o],d=c[o+1];h==="style"?Md(n,d):h==="dangerouslySetInnerHTML"?Dd(n,d):h==="children"?yn(n,d):Pl(n,h,d,u)}switch(l){case"input":vo(n,a);break;case"textarea":Ld(n,a);break;case"select":var f=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?us(n,!!a.multiple,p,!1):f!==!!a.multiple&&(a.defaultValue!=null?us(n,!!a.multiple,a.defaultValue,!0):us(n,!!a.multiple,a.multiple?[]:"",!1))}n[En]=a}catch(b){ae(e,e.return,b)}}break;case 6:if(at(t,e),xt(e),s&4){if(e.stateNode===null)throw Error(C(162));n=e.stateNode,a=e.memoizedProps;try{n.nodeValue=a}catch(b){ae(e,e.return,b)}}break;case 3:if(at(t,e),xt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{jn(t.containerInfo)}catch(b){ae(e,e.return,b)}break;case 4:at(t,e),xt(e);break;case 13:at(t,e),xt(e),n=e.child,n.flags&8192&&(a=n.memoizedState!==null,n.stateNode.isHidden=a,!a||n.alternate!==null&&n.alternate.memoizedState!==null||(cc=le())),s&4&&Tu(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?(ke=(u=ke)||h,at(t,e),ke=u):at(t,e),xt(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!h&&e.mode&1)for(A=e,h=e.child;h!==null;){for(d=A=h;A!==null;){switch(f=A,p=f.child,f.tag){case 0:case 11:case 14:case 15:un(4,f,f.return);break;case 1:ls(f,f.return);var w=f.stateNode;if(typeof w.componentWillUnmount=="function"){s=f,r=f.return;try{t=s,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(b){ae(s,r,b)}}break;case 5:ls(f,f.return);break;case 22:if(f.memoizedState!==null){Iu(d);continue}}p!==null?(p.return=f,A=p):Iu(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{n=d.stateNode,u?(a=n.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Fd("display",o))}catch(b){ae(e,e.return,b)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(b){ae(e,e.return,b)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:at(t,e),xt(e),s&4&&Tu(e);break;case 21:break;default:at(t,e),xt(e)}}function xt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(hf(r)){var s=r;break e}r=r.return}throw Error(C(160))}switch(s.tag){case 5:var n=s.stateNode;s.flags&32&&(yn(n,""),s.flags&=-33);var a=Cu(e);el(e,a,n);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Cu(e);Xo(e,l,o);break;default:throw Error(C(161))}}catch(c){ae(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function U0(e,t,r){A=e,mf(e)}function mf(e,t,r){for(var s=(e.mode&1)!==0;A!==null;){var n=A,a=n.child;if(n.tag===22&&s){var o=n.memoizedState!==null||li;if(!o){var l=n.alternate,c=l!==null&&l.memoizedState!==null||ke;l=li;var u=ke;if(li=o,(ke=c)&&!u)for(A=n;A!==null;)o=A,c=o.child,o.tag===22&&o.memoizedState!==null?Ou(n):c!==null?(c.return=o,A=c):Ou(n);for(;a!==null;)A=a,mf(a),a=a.sibling;A=n,li=l,ke=u}Pu(e)}else n.subtreeFlags&8772&&a!==null?(a.return=n,A=a):Pu(e)}}function Pu(e){for(;A!==null;){var t=A;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ke||ga(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!ke)if(r===null)s.componentDidMount();else{var n=t.elementType===t.type?r.memoizedProps:lt(t.type,r.memoizedProps);s.componentDidUpdate(n,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&pu(t,a,s);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}pu(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.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 h=u.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&jn(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(C(163))}ke||t.flags&512&&Yo(t)}catch(f){ae(t,t.return,f)}}if(t===e){A=null;break}if(r=t.sibling,r!==null){r.return=t.return,A=r;break}A=t.return}}function Iu(e){for(;A!==null;){var t=A;if(t===e){A=null;break}var r=t.sibling;if(r!==null){r.return=t.return,A=r;break}A=t.return}}function Ou(e){for(;A!==null;){var t=A;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ga(4,t)}catch(c){ae(t,r,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var n=t.return;try{s.componentDidMount()}catch(c){ae(t,n,c)}}var a=t.return;try{Yo(t)}catch(c){ae(t,a,c)}break;case 5:var o=t.return;try{Yo(t)}catch(c){ae(t,o,c)}}}catch(c){ae(t,t.return,c)}if(t===e){A=null;break}var l=t.sibling;if(l!==null){l.return=t.return,A=l;break}A=t.return}}var L0=Math.ceil,Ki=Lt.ReactCurrentDispatcher,oc=Lt.ReactCurrentOwner,tt=Lt.ReactCurrentBatchConfig,q=0,ye=null,fe=null,be=0,Ve=0,cs=cr(0),ge=0,An=null,Ur=0,xa=0,lc=0,dn=null,Le=null,cc=0,ks=1/0,St=null,Ji=!1,tl=null,tr=null,ci=!1,Jt=null,Gi=0,hn=0,rl=null,Ni=-1,ki=0;function Te(){return q&6?le():Ni!==-1?Ni:Ni=le()}function rr(e){return e.mode&1?q&2&&be!==0?be&-be:v0.transition!==null?(ki===0&&(ki=Yd()),ki):(e=J,e!==0||(e=window.event,e=e===void 0?16:ih(e.type)),e):1}function ft(e,t,r,s){if(50<hn)throw hn=0,rl=null,Error(C(185));Mn(e,r,s),(!(q&2)||e!==ye)&&(e===ye&&(!(q&2)&&(xa|=r),ge===4&&Vt(e,be)),Be(e,s),r===1&&q===0&&!(t.mode&1)&&(ks=le()+500,fa&&ur()))}function Be(e,t){var r=e.callbackNode;vm(e,t);var s=Oi(e,e===ye?be:0);if(s===0)r!==null&&Bc(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&Bc(r),t===1)e.tag===0?y0(Au.bind(null,e)):Nh(Au.bind(null,e)),p0(function(){!(q&6)&&ur()}),r=null;else{switch(Xd(s)){case 1:r=Ul;break;case 4:r=Qd;break;case 16:r=Ii;break;case 536870912:r=Zd;break;default:r=Ii}r=_f(r,gf.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function gf(e,t){if(Ni=-1,ki=0,q&6)throw Error(C(327));var r=e.callbackNode;if(ms()&&e.callbackNode!==r)return null;var s=Oi(e,e===ye?be:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Qi(e,s);else{t=s;var n=q;q|=2;var a=yf();(ye!==e||be!==t)&&(St=null,ks=le()+500,Tr(e,t));do try{F0();break}catch(l){xf(e,l)}while(!0);Jl(),Ki.current=a,q=n,fe!==null?t=0:(ye=null,be=0,t=ge)}if(t!==0){if(t===2&&(n=To(e),n!==0&&(s=n,t=sl(e,n))),t===1)throw r=An,Tr(e,0),Vt(e,s),Be(e,le()),r;if(t===6)Vt(e,s);else{if(n=e.current.alternate,!(s&30)&&!$0(n)&&(t=Qi(e,s),t===2&&(a=To(e),a!==0&&(s=a,t=sl(e,a))),t===1))throw r=An,Tr(e,0),Vt(e,s),Be(e,le()),r;switch(e.finishedWork=n,e.finishedLanes=s,t){case 0:case 1:throw Error(C(345));case 2:wr(e,Le,St);break;case 3:if(Vt(e,s),(s&130023424)===s&&(t=cc+500-le(),10<t)){if(Oi(e,0)!==0)break;if(n=e.suspendedLanes,(n&s)!==s){Te(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=$o(wr.bind(null,e,Le,St),t);break}wr(e,Le,St);break;case 4:if(Vt(e,s),(s&4194240)===s)break;for(t=e.eventTimes,n=-1;0<s;){var o=31-ht(s);a=1<<o,o=t[o],o>n&&(n=o),s&=~a}if(s=n,s=le()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*L0(s/1960))-s,10<s){e.timeoutHandle=$o(wr.bind(null,e,Le,St),s);break}wr(e,Le,St);break;case 5:wr(e,Le,St);break;default:throw Error(C(329))}}}return Be(e,le()),e.callbackNode===r?gf.bind(null,e):null}function sl(e,t){var r=dn;return e.current.memoizedState.isDehydrated&&(Tr(e,t).flags|=256),e=Qi(e,t),e!==2&&(t=Le,Le=r,t!==null&&nl(t)),e}function nl(e){Le===null?Le=e:Le.push.apply(Le,e)}function $0(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var n=r[s],a=n.getSnapshot;n=n.value;try{if(!pt(a(),n))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Vt(e,t){for(t&=~lc,t&=~xa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ht(t),s=1<<r;e[r]=-1,t&=~s}}function Au(e){if(q&6)throw Error(C(327));ms();var t=Oi(e,0);if(!(t&1))return Be(e,le()),null;var r=Qi(e,t);if(e.tag!==0&&r===2){var s=To(e);s!==0&&(t=s,r=sl(e,s))}if(r===1)throw r=An,Tr(e,0),Vt(e,t),Be(e,le()),r;if(r===6)throw Error(C(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wr(e,Le,St),Be(e,le()),null}function uc(e,t){var r=q;q|=1;try{return e(t)}finally{q=r,q===0&&(ks=le()+500,fa&&ur())}}function Lr(e){Jt!==null&&Jt.tag===0&&!(q&6)&&ms();var t=q;q|=1;var r=tt.transition,s=J;try{if(tt.transition=null,J=1,e)return e()}finally{J=s,tt.transition=r,q=t,!(q&6)&&ur()}}function dc(){Ve=cs.current,ee(cs)}function Tr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,f0(r)),fe!==null)for(r=fe.return;r!==null;){var s=r;switch(Hl(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&$i();break;case 3:_s(),ee(Fe),ee(Se),ec();break;case 5:Xl(s);break;case 4:_s();break;case 13:ee(re);break;case 19:ee(re);break;case 10:Gl(s.type._context);break;case 22:case 23:dc()}r=r.return}if(ye=e,fe=e=sr(e.current,null),be=Ve=t,ge=0,An=null,lc=xa=Ur=0,Le=dn=null,Sr!==null){for(t=0;t<Sr.length;t++)if(r=Sr[t],s=r.interleaved,s!==null){r.interleaved=null;var n=s.next,a=r.pending;if(a!==null){var o=a.next;a.next=n,s.next=o}r.pending=s}Sr=null}return e}function xf(e,t){do{var r=fe;try{if(Jl(),bi.current=qi,Hi){for(var s=se.memoizedState;s!==null;){var n=s.queue;n!==null&&(n.pending=null),s=s.next}Hi=!1}if(Rr=0,xe=me=se=null,cn=!1,Pn=0,oc.current=null,r===null||r.return===null){ge=1,An=t,fe=null;break}e:{var a=e,o=r.return,l=r,c=t;if(t=be,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,h=l,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=wu(o);if(p!==null){p.flags&=-257,bu(p,o,l,a,t),p.mode&1&&vu(a,u,t),t=p,c=u;var w=t.updateQueue;if(w===null){var b=new Set;b.add(c),t.updateQueue=b}else w.add(c);break e}else{if(!(t&1)){vu(a,u,t),hc();break e}c=Error(C(426))}}else if(te&&l.mode&1){var x=wu(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),bu(x,o,l,a,t),ql(Ns(c,l));break e}}a=c=Ns(c,l),ge!==4&&(ge=2),dn===null?dn=[a]:dn.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var m=Xh(a,c,t);fu(a,m);break e;case 1:l=c;var g=a.type,y=a.stateNode;if(!(a.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(tr===null||!tr.has(y)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=ef(a,l,t);fu(a,j);break e}}a=a.return}while(a!==null)}wf(r)}catch(N){t=N,fe===r&&r!==null&&(fe=r=r.return);continue}break}while(!0)}function yf(){var e=Ki.current;return Ki.current=qi,e===null?qi:e}function hc(){(ge===0||ge===3||ge===2)&&(ge=4),ye===null||!(Ur&268435455)&&!(xa&268435455)||Vt(ye,be)}function Qi(e,t){var r=q;q|=2;var s=yf();(ye!==e||be!==t)&&(St=null,Tr(e,t));do try{D0();break}catch(n){xf(e,n)}while(!0);if(Jl(),q=r,Ki.current=s,fe!==null)throw Error(C(261));return ye=null,be=0,ge}function D0(){for(;fe!==null;)vf(fe)}function F0(){for(;fe!==null&&!um();)vf(fe)}function vf(e){var t=jf(e.alternate,e,Ve);e.memoizedProps=e.pendingProps,t===null?wf(e):fe=t,oc.current=null}function wf(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=O0(r,t),r!==null){r.flags&=32767,fe=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ge=6,fe=null;return}}else if(r=I0(r,t,Ve),r!==null){fe=r;return}if(t=t.sibling,t!==null){fe=t;return}fe=t=e}while(t!==null);ge===0&&(ge=5)}function wr(e,t,r){var s=J,n=tt.transition;try{tt.transition=null,J=1,M0(e,t,r,s)}finally{tt.transition=n,J=s}return null}function M0(e,t,r,s){do ms();while(Jt!==null);if(q&6)throw Error(C(327));r=e.finishedWork;var n=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(C(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(wm(e,a),e===ye&&(fe=ye=null,be=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ci||(ci=!0,_f(Ii,function(){return ms(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=tt.transition,tt.transition=null;var o=J;J=1;var l=q;q|=4,oc.current=null,R0(e,r),pf(r,e),a0(Uo),Ai=!!Ro,Uo=Ro=null,e.current=r,U0(r),dm(),q=l,J=o,tt.transition=a}else e.current=r;if(ci&&(ci=!1,Jt=e,Gi=n),a=e.pendingLanes,a===0&&(tr=null),pm(r.stateNode),Be(e,le()),t!==null)for(s=e.onRecoverableError,r=0;r<t.length;r++)n=t[r],s(n.value,{componentStack:n.stack,digest:n.digest});if(Ji)throw Ji=!1,e=tl,tl=null,e;return Gi&1&&e.tag!==0&&ms(),a=e.pendingLanes,a&1?e===rl?hn++:(hn=0,rl=e):hn=0,ur(),null}function ms(){if(Jt!==null){var e=Xd(Gi),t=tt.transition,r=J;try{if(tt.transition=null,J=16>e?16:e,Jt===null)var s=!1;else{if(e=Jt,Jt=null,Gi=0,q&6)throw Error(C(331));var n=q;for(q|=4,A=e.current;A!==null;){var a=A,o=a.child;if(A.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(A=u;A!==null;){var h=A;switch(h.tag){case 0:case 11:case 15:un(8,h,a)}var d=h.child;if(d!==null)d.return=h,A=d;else for(;A!==null;){h=A;var f=h.sibling,p=h.return;if(df(h),h===u){A=null;break}if(f!==null){f.return=p,A=f;break}A=p}}}var w=a.alternate;if(w!==null){var b=w.child;if(b!==null){w.child=null;do{var x=b.sibling;b.sibling=null,b=x}while(b!==null)}}A=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,A=o;else e:for(;A!==null;){if(a=A,a.flags&2048)switch(a.tag){case 0:case 11:case 15:un(9,a,a.return)}var m=a.sibling;if(m!==null){m.return=a.return,A=m;break e}A=a.return}}var g=e.current;for(A=g;A!==null;){o=A;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,A=y;else e:for(o=g;A!==null;){if(l=A,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ga(9,l)}}catch(N){ae(l,l.return,N)}if(l===o){A=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,A=j;break e}A=l.return}}if(q=n,ur(),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(la,e)}catch{}s=!0}return s}finally{J=r,tt.transition=t}}return!1}function Ru(e,t,r){t=Ns(r,t),t=Xh(e,t,1),e=er(e,t,1),t=Te(),e!==null&&(Mn(e,1,t),Be(e,t))}function ae(e,t,r){if(e.tag===3)Ru(e,e,r);else for(;t!==null;){if(t.tag===3){Ru(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(tr===null||!tr.has(s))){e=Ns(r,e),e=ef(t,e,1),t=er(t,e,1),e=Te(),t!==null&&(Mn(t,1,e),Be(t,e));break}}t=t.return}}function B0(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=Te(),e.pingedLanes|=e.suspendedLanes&r,ye===e&&(be&r)===r&&(ge===4||ge===3&&(be&130023424)===be&&500>le()-cc?Tr(e,0):lc|=r),Be(e,t)}function bf(e,t){t===0&&(e.mode&1?(t=Xn,Xn<<=1,!(Xn&130023424)&&(Xn=4194304)):t=1);var r=Te();e=Rt(e,t),e!==null&&(Mn(e,t,r),Be(e,r))}function z0(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),bf(e,r)}function W0(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(C(314))}s!==null&&s.delete(t),bf(e,r)}var jf;jf=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fe.current)De=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return De=!1,P0(e,t,r);De=!!(e.flags&131072)}else De=!1,te&&t.flags&1048576&&kh(t,Mi,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;_i(e,t),e=t.pendingProps;var n=ws(t,Se.current);ps(t,r),n=rc(null,t,s,e,n,r);var a=sc();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Me(s)?(a=!0,Di(t)):a=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Zl(t),n.updater=ma,t.stateNode=n,n._reactInternals=t,Vo(t,s,e,r),t=Ko(null,t,s,!0,a,r)):(t.tag=0,te&&a&&Vl(t),Ee(null,t,n,r),t=t.child),t;case 16:s=t.elementType;e:{switch(_i(e,t),e=t.pendingProps,n=s._init,s=n(s._payload),t.type=s,n=t.tag=H0(s),e=lt(s,e),n){case 0:t=qo(null,t,s,e,r);break e;case 1:t=Nu(null,t,s,e,r);break e;case 11:t=ju(null,t,s,e,r);break e;case 14:t=_u(null,t,s,lt(s.type,e),r);break e}throw Error(C(306,s,""))}return t;case 0:return s=t.type,n=t.pendingProps,n=t.elementType===s?n:lt(s,n),qo(e,t,s,n,r);case 1:return s=t.type,n=t.pendingProps,n=t.elementType===s?n:lt(s,n),Nu(e,t,s,n,r);case 3:e:{if(nf(t),e===null)throw Error(C(387));s=t.pendingProps,a=t.memoizedState,n=a.element,Ih(e,t),Wi(t,s,null,r);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){n=Ns(Error(C(423)),t),t=ku(e,t,s,r,n);break e}else if(s!==n){n=Ns(Error(C(424)),t),t=ku(e,t,s,r,n);break e}else for(He=Xt(t.stateNode.containerInfo.firstChild),Ke=t,te=!0,dt=null,r=Th(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(bs(),s===n){t=Ut(e,t,r);break e}Ee(e,t,s,r)}t=t.child}return t;case 5:return Oh(t),e===null&&Bo(t),s=t.type,n=t.pendingProps,a=e!==null?e.memoizedProps:null,o=n.children,Lo(s,n)?o=null:a!==null&&Lo(s,a)&&(t.flags|=32),sf(e,t),Ee(e,t,o,r),t.child;case 6:return e===null&&Bo(t),null;case 13:return af(e,t,r);case 4:return Yl(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=js(t,null,s,r):Ee(e,t,s,r),t.child;case 11:return s=t.type,n=t.pendingProps,n=t.elementType===s?n:lt(s,n),ju(e,t,s,n,r);case 7:return Ee(e,t,t.pendingProps,r),t.child;case 8:return Ee(e,t,t.pendingProps.children,r),t.child;case 12:return Ee(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,n=t.pendingProps,a=t.memoizedProps,o=n.value,Y(Bi,s._currentValue),s._currentValue=o,a!==null)if(pt(a.value,o)){if(a.children===n.children&&!Fe.current){t=Ut(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=It(-1,r&-r),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?c.next=c:(c.next=h.next,h.next=c),u.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),zo(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(C(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),zo(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ee(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,s=t.pendingProps.children,ps(t,r),n=st(n),s=s(n),t.flags|=1,Ee(e,t,s,r),t.child;case 14:return s=t.type,n=lt(s,t.pendingProps),n=lt(s.type,n),_u(e,t,s,n,r);case 15:return tf(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,n=t.pendingProps,n=t.elementType===s?n:lt(s,n),_i(e,t),t.tag=1,Me(s)?(e=!0,Di(t)):e=!1,ps(t,r),Yh(t,s,n),Vo(t,s,n,r),Ko(null,t,s,!0,e,r);case 19:return of(e,t,r);case 22:return rf(e,t,r)}throw Error(C(156,t.tag))};function _f(e,t){return Gd(e,t)}function V0(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 10,305 bytes, lines 40-49
40ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function et(e,t,r,s){return new V0(e,t,r,s)}function fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function H0(e){if(typeof e=="function")return fc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ol)return 11;if(e===Al)return 14}return 2}function sr(e,t){var r=e.alternate;return r===null?(r=et(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Si(e,t,r,s,n,a){var o=2;if(s=e,typeof e=="function")fc(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Xr:return Pr(r.children,n,a,t);case Il:o=8,n|=8;break;case po:return e=et(12,r,t,n|2),e.elementType=po,e.lanes=a,e;case mo:return e=et(13,r,t,n),e.elementType=mo,e.lanes=a,e;case go:return e=et(19,r,t,n),e.elementType=go,e.lanes=a,e;case Od:return ya(r,n,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Pd:o=10;break e;case Id:o=9;break e;case Ol:o=11;break e;case Al:o=14;break e;case Mt:o=16,s=null;break e}throw Error(C(130,e==null?e:typeof e,""))}return t=et(o,r,t,n),t.elementType=e,t.type=s,t.lanes=a,t}function Pr(e,t,r,s){return e=et(7,e,s,t),e.lanes=r,e}function ya(e,t,r,s){return e=et(22,e,s,t),e.elementType=Od,e.lanes=r,e.stateNode={isHidden:!1},e}function eo(e,t,r){return e=et(6,e,null,t),e.lanes=r,e}function to(e,t,r){return t=et(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function q0(e,t,r,s,n){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=Ua(0),this.expirationTimes=Ua(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ua(0),this.identifierPrefix=s,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function pc(e,t,r,s,n,a,o,l,c){return e=new q0(e,t,r,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=et(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zl(a),e}function K0(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yr,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}}function Nf(e){if(!e)return or;e=e._reactInternals;e:{if(Dr(e)!==e||e.tag!==1)throw Error(C(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Me(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(C(171))}if(e.tag===1){var r=e.type;if(Me(r))return _h(e,r,t)}return t}function kf(e,t,r,s,n,a,o,l,c){return e=pc(r,s,!0,e,n,a,o,l,c),e.context=Nf(null),r=e.current,s=Te(),n=rr(r),a=It(s,n),a.callback=t??null,er(r,a,n),e.current.lanes=n,Mn(e,n,s),Be(e,s),e}function va(e,t,r,s){var n=t.current,a=Te(),o=rr(n);return r=Nf(r),t.context===null?t.context=r:t.pendingContext=r,t=It(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=er(n,t,o),e!==null&&(ft(e,n,o,a),wi(e,n,o)),o}function Zi(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 Uu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function mc(e,t){Uu(e,t),(e=e.alternate)&&Uu(e,t)}function J0(){return null}var Sf=typeof reportError=="function"?reportError:function(e){console.error(e)};function gc(e){this._internalRoot=e}wa.prototype.render=gc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(C(409));va(e,t,null,null)};wa.prototype.unmount=gc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lr(function(){va(null,e,null,null)}),t[At]=null}};function wa(e){this._internalRoot=e}wa.prototype.unstable_scheduleHydration=function(e){if(e){var t=rh();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Wt.length&&t!==0&&t<Wt[r].priority;r++);Wt.splice(r,0,e),r===0&&nh(e)}};function xc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ba(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lu(){}function G0(e,t,r,s,n){if(n){if(typeof s=="function"){var a=s;s=function(){var u=Zi(o);a.call(u)}}var o=kf(t,s,e,0,null,!1,!1,"",Lu);return e._reactRootContainer=o,e[At]=o.current,kn(e.nodeType===8?e.parentNode:e),Lr(),o}for(;n=e.lastChild;)e.removeChild(n);if(typeof s=="function"){var l=s;s=function(){var u=Zi(c);l.call(u)}}var c=pc(e,0,!1,null,null,!1,!1,"",Lu);return e._reactRootContainer=c,e[At]=c.current,kn(e.nodeType===8?e.parentNode:e),Lr(function(){va(t,c,r,s)}),c}function ja(e,t,r,s,n){var a=r._reactRootContainer;if(a){var o=a;if(typeof n=="function"){var l=n;n=function(){var c=Zi(o);l.call(c)}}va(t,o,e,n)}else o=G0(r,t,e,n,s);return Zi(o)}eh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Zs(t.pendingLanes);r!==0&&(Ll(t,r|1),Be(t,le()),!(q&6)&&(ks=le()+500,ur()))}break;case 13:Lr(function(){var s=Rt(e,1);if(s!==null){var n=Te();ft(s,e,1,n)}}),mc(e,1)}};$l=function(e){if(e.tag===13){var t=Rt(e,134217728);if(t!==null){var r=Te();ft(t,e,134217728,r)}mc(e,134217728)}};th=function(e){if(e.tag===13){var t=rr(e),r=Rt(e,t);if(r!==null){var s=Te();ft(r,e,t,s)}mc(e,t)}};rh=function(){return J};sh=function(e,t){var r=J;try{return J=e,t()}finally{J=r}};So=function(e,t,r){switch(t){case"input":if(vo(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var s=r[t];if(s!==e&&s.form===e.form){var n=ha(s);if(!n)throw Error(C(90));Rd(s),vo(s,n)}}}break;case"textarea":Ld(e,r);break;case"select":t=r.value,t!=null&&us(e,!!r.multiple,t,!1)}};Wd=uc;Vd=Lr;var Q0={usingClientEntryPoint:!1,Events:[zn,ss,ha,Bd,zd,uc]},Hs={findFiberByHostInstance:kr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Z0={bundleType:Hs.bundleType,version:Hs.version,rendererPackageName:Hs.rendererPackageName,rendererConfig:Hs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Kd(e),e===null?null:e.stateNode},findFiberByHostInstance:Hs.findFiberByHostInstance||J0,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 ui=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ui.isDisabled&&ui.supportsFiber)try{la=ui.inject(Z0),bt=ui}catch{}}Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q0;Ge.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xc(t))throw Error(C(200));return K0(e,t,null,r)};Ge.createRoot=function(e,t){if(!xc(e))throw Error(C(299));var r=!1,s="",n=Sf;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=pc(e,1,!1,null,null,r,!1,s,n),e[At]=t.current,kn(e.nodeType===8?e.parentNode:e),new gc(t)};Ge.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(C(188)):(e=Object.keys(e).join(","),Error(C(268,e)));return e=Kd(t),e=e===null?null:e.stateNode,e};Ge.flushSync=function(e){return Lr(e)};Ge.hydrate=function(e,t,r){if(!ba(t))throw Error(C(200));return ja(null,e,t,!0,r)};Ge.hydrateRoot=function(e,t,r){if(!xc(e))throw Error(C(405));var s=r!=null&&r.hydratedSources||null,n=!1,a="",o=Sf;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=kf(t,null,e,1,r??null,n,!1,a,o),e[At]=t.current,kn(e),s)for(e=0;e<s.length;e++)r=s[e],n=r._getVersion,n=n(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,n]:t.mutableSourceEagerHydrationData.push(r,n);return new wa(t)};Ge.render=function(e,t,r){if(!ba(t))throw Error(C(200));return ja(null,e,t,!1,r)};Ge.unmountComponentAtNode=function(e){if(!ba(e))throw Error(C(40));return e._reactRootContainer?(Lr(function(){ja(null,null,e,!1,function(){e._reactRootContainer=null,e[At]=null})}),!0):!1};Ge.unstable_batchedUpdates=uc;Ge.unstable_renderSubtreeIntoContainer=function(e,t,r,s){if(!ba(r))throw Error(C(200));if(e==null||e._reactInternals===void 0)throw Error(C(38));return ja(e,t,r,!1,s)};Ge.version="18.3.1-next-f1338f8080-20240426";function Ef(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ef)}catch(e){console.error(e)}}Ef(),Sd.exports=Ge;var Y0=Sd.exports,Cf,$u=Y0;Cf=$u.createRoot,$u.hydrateRoot;/**
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 Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 4,916 bytes, line 49
49for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Rn.apply(this,arguments)}var Gt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Gt||(Gt={}));const Du="popstate";function X0(e){e===void 0&&(e={});function t(s,n){let{pathname:a,search:o,hash:l}=s.location;return il("",{pathname:a,search:o,hash:l},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(s,n){return typeof n=="string"?n:Yi(n)}return tg(t,r,null,e)}function ce(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tf(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function eg(){return Math.random().toString(36).substr(2,8)}function Fu(e,t){return{usr:e.state,key:e.key,idx:t}}function il(e,t,r,s){return r===void 0&&(r=null),Rn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Is(t):t,{state:r,key:t&&t.key||s||eg()})}function Yi(e){let{pathname:t="/",search:r="",hash:s=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function Is(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function tg(e,t,r,s){s===void 0&&(s={});let{window:n=document.defaultView,v5Compat:a=!1}=s,o=n.history,l=Gt.Pop,c=null,u=h();u==null&&(u=0,o.replaceState(Rn({},o.state,{idx:u}),""));function h(){return(o.state||{idx:null}).idx}function d(){l=Gt.Pop;let x=h(),m=x==null?null:x-u;u=x,c&&c({action:l,location:b.location,delta:m})}function f(x,m){l=Gt.Push;let g=il(b.location,x,m);u=h()+1;let y=Fu(g,u),j=b.createHref(g);try{o.pushState(y,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;n.location.assign(j)}a&&c&&c({action:l,location:b.location,delta:1})}function p(x,m){l=Gt.Replace;let g=il(b.location,x,m);u=h();let y=Fu(g,u),j=b.createHref(g);o.replaceState(y,"",j),a&&c&&c({action:l,location:b.location,delta:0})}function w(x){let m=n.location.origin!=="null"?n.location.origin:n.location.href,g=typeof x=="string"?x:Yi(x);return g=g.replace(/ $/,"%20"),ce(m,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,m)}let b={get action(){return l},get location(){return e(n,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return n.addEventListener(Du,d),c=x,()=>{n.removeEventListener(Du,d),c=null}},createHref(x){return t(n,x)},createURL:w,encodeLocation(x){let m=w(x);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:p,go(x){return o.go(x)}};return b}var Mu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mu||(Mu={}));function rg(e,t,r){return r===void 0&&(r="/"),sg(e,t,r)}function sg(e,t,r,s){let n=typeof t=="string"?Is(t):t,a=yc(n.pathname||"/",r);if(a==null)return null;let o=Pf(e);ng(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=gg(a);l=fg(o[c],u)}return l}function Pf(e,t,r,s){t===void 0&&(t=[]),r===void 0&&(r=[]),s===void 0&&(s="");let n=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(ce(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=nr([s,c.relativePath]),h=r.concat(c);a.children&&a.children.length>0&&(ce(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Pf(a.children,t,h,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:dg(u,a.index),routesMeta:h})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))n(a,o);else for(let c of If(a.path))n(a,o,c)}),t}function If(e){let t=e.split("/");if(t.length===0)return[];let[r,...s]=t,n=r.endsWith("?"),a=r.replace(/\?$/,"");if(s.length===0)return n?[a,""]:[a];let o=If(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),n&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function ng(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:hg(t.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}const ig=/^:[\w-]+$/,ag=3,og=2,lg=1,cg=10,ug=-2,Bu=e=>e==="*";function dg(e,t){let r=e.split("/"),s=r.length;return r.some(Bu)&&(s+=ug),t&&(s+=og),r.filter(n=>!Bu(n)).reduce((n,a)=>n+(ig.test(a)?ag:a===""?lg:cg),s)}function hg(e,t){return e.length===t.length&&e.slice(0,-1).every((s,n)=>s===t[n])?e[e.length-1]-t[t.length-1]:0}function fg(e,t,r){let{routesMeta:s}=e,n={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,h=a==="/"?t:t.slice(a.length)||"/",d=pg({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},h),f=c.route;if(!d)return null;
vendor: 12,888 bytes, lines 49-67
49Object.assign(n,d.params),o.push({params:n,pathname:nr([a,d.pathname]),pathnameBase:wg(nr([a,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(a=nr([a,d.pathnameBase]))}return o}function pg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,s]=mg(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let a=n[0],o=a.replace(/(.)\/+$/,"$1"),l=n.slice(1);return{params:s.reduce((u,h,d)=>{let{paramName:f,isOptional:p}=h;if(f==="*"){let b=l[d]||"";o=a.slice(0,a.length-b.length).replace(/(.)\/+$/,"$1")}const w=l[d];return p&&!w?u[f]=void 0:u[f]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function mg(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Tf(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 s=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),s]}function gg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tf(!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 yc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,s=e.charAt(r);return s&&s!=="/"?null:e.slice(r)||"/"}function xg(e,t){t===void 0&&(t="/");let{pathname:r,search:s="",hash:n=""}=typeof e=="string"?Is(e):e;return{pathname:r?r.startsWith("/")?r:yg(r,t):t,search:bg(s),hash:jg(n)}}function yg(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function ro(e,t,r,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function vg(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function vc(e,t){let r=vg(e);return t?r.map((s,n)=>n===r.length-1?s.pathname:s.pathnameBase):r.map(s=>s.pathnameBase)}function wc(e,t,r,s){s===void 0&&(s=!1);let n;typeof e=="string"?n=Is(e):(n=Rn({},e),ce(!n.pathname||!n.pathname.includes("?"),ro("?","pathname","search",n)),ce(!n.pathname||!n.pathname.includes("#"),ro("#","pathname","hash",n)),ce(!n.search||!n.search.includes("#"),ro("#","search","hash",n)));let a=e===""||n.pathname==="",o=a?"/":n.pathname,l;if(o==null)l=r;else{let d=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;n.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=xg(n,l),u=o&&o!=="/"&&o.endsWith("/"),h=(a||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||h)&&(c.pathname+="/"),c}const nr=e=>e.join("/").replace(/\/\/+/g,"/"),wg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _g(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Of=["post","put","patch","delete"];new Set(Of);const Ng=["get",...Of];new Set(Ng);/**
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 Un(){return Un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Un.apply(this,arguments)}const bc=S.createContext(null),kg=S.createContext(null),dr=S.createContext(null),_a=S.createContext(null),hr=S.createContext({outlet:null,matches:[],isDataRoute:!1}),Af=S.createContext(null);function Sg(e,t){let{relative:r}=t===void 0?{}:t;Os()||ce(!1);let{basename:s,navigator:n}=S.useContext(dr),{hash:a,pathname:o,search:l}=Uf(e,{relative:r}),c=o;return s!=="/"&&(c=o==="/"?s:nr([s,o])),n.createHref({pathname:c,search:l,hash:a})}function Os(){return S.useContext(_a)!=null}function fr(){return Os()||ce(!1),S.useContext(_a).location}function Rf(e){S.useContext(dr).static||S.useLayoutEffect(e)}function Vn(){let{isDataRoute:e}=S.useContext(hr);return e?Fg():Eg()}function Eg(){Os()||ce(!1);let e=S.useContext(bc),{basename:t,future:r,navigator:s}=S.useContext(dr),{matches:n}=S.useContext(hr),{pathname:a}=fr(),o=JSON.stringify(vc(n,r.v7_relativeSplatPath)),l=S.useRef(!1);return Rf(()=>{l.current=!0}),S.useCallback(function(u,h){if(h===void 0&&(h={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=wc(u,JSON.parse(o),a,h.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:nr([t,d.pathname])),(h.replace?s.replace:s.push)(d,h.state,h)},[t,s,o,a,e])}function Uf(e,t){let{relative:r}=t===void 0?{}:t,{future:s}=S.useContext(dr),{matches:n}=S.useContext(hr),{pathname:a}=fr(),o=JSON.stringify(vc(n,s.v7_relativeSplatPath));return S.useMemo(()=>wc(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function Cg(e,t){return Tg(e,t)}function Tg(e,t,r,s){Os()||ce(!1);let{navigator:n}=S.useContext(dr),{matches:a}=S.useContext(hr),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=fr(),h;if(t){var d;let x=typeof t=="string"?Is(t):t;c==="/"||(d=x.pathname)!=null&&d.startsWith(c)||ce(!1),h=x}else h=u;let f=h.pathname||"/",p=f;if(c!=="/"){let x=c.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let w=rg(e,{pathname:p}),b=Rg(w&&w.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:nr([c,n.encodeLocation?n.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:nr([c,n.encodeLocation?n.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,r,s);return t&&b?S.createElement(_a.Provider,{value:{location:Un({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Gt.Pop}},b):b}function Pg(){let e=Dg(),t=_g(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),r?S.createElement("pre",{style:n},r):null,null)}const Ig=S.createElement(Pg,null);class Og extends S.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?S.createElement(hr.Provider,{value:this.props.routeContext},S.createElement(Af.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ag(e){let{routeContext:t,match:r,children:s}=e,n=S.useContext(bc);return n&&n.static&&n.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=r.route.id),S.createElement(hr.Provider,{value:t},s)}function Rg(e,t,r,s){var n;if(t===void 0&&(t=[]),r===void 0&&(r=null),s===void 0&&(s=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(n=r)==null?void 0:n.errors;if(l!=null){let h=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);h>=0||ce(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,u=-1;if(r&&s&&s.v7_partialHydration)for(let h=0;h<o.length;h++){let d=o[h];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=h),d.route.id){let{loaderData:f,errors:p}=r,w=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||w){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((h,d,f)=>{let p,w=!1,b=null,x=null;r&&(p=l&&d.route.id?l[d.route.id]:void 0,b=d.route.errorElement||Ig,c&&(u<0&&f===0?(Mg("route-fallback"),w=!0,x=null):u===f&&(w=!0,x=d.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,f+1)),g=()=>{let y;return p?y=b:w?y=x:d.route.Component?y=S.createElement(d.route.Component,null):d.route.element?y=d.route.element:y=h,S.createElement(Ag,{match:d,routeContext:{outlet:h,matches:m,isDataRoute:r!=null},children:y})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?S.createElement(Og,{location:r.location,revalidation:r.revalidation,component:b,error:p,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()},null)}var Lf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Lf||{}),$f=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}($f||{});function Ug(e){let t=S.useContext(bc);return t||ce(!1),t}function Lg(e){let t=S.useContext(kg);return t||ce(!1),t}function $g(e){let t=S.useContext(hr);return t||ce(!1),t}function Df(e){let t=$g(),r=t.matches[t.matches.length-1];return r.route.id||ce(!1),r.route.id}function Dg(){var e;let t=S.useContext(Af),r=Lg(),s=Df();return t!==void 0?t:(e=r.errors)==null?void 0:e[s]}function Fg(){let{router:e}=Ug(Lf.UseNavigateStable),t=Df($f.UseNavigateStable),r=S.useRef(!1);return Rf(()=>{r.current=!0}),S.useCallback(function(n,a){a===void 0&&(a={}),r.current&&(typeof n=="number"?e.navigate(n):e.navigate(n,Un({fromRouteId:t},a)))},[e,t])}const zu={};function Mg(e,t,r){zu[e]||(zu[e]=!0)}function Bg(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Xs(e){let{to:t,replace:r,state:s,relative:n}=e;Os()||ce(!1);let{future:a,static:o}=S.useContext(dr),{matches:l}=S.useContext(hr),{pathname:c}=fr(),u=Vn(),h=wc(t,vc(l,a.v7_relativeSplatPath),c,n==="path"),d=JSON.stringify(h);return S.useEffect(()=>u(JSON.parse(d),{replace:r,state:s,relative:n}),[u,d,n,r,s]),null}function kt(e){ce(!1)}function zg(e){let{basename:t="/",children:r=null,location:s,navigationType:n=Gt.Pop,navigator:a,static:o=!1,future:l}=e;Os()&&ce(!1);let c=t.replace(/^\/*/,"/"),u=S.useMemo(()=>({basename:c,navigator:a,static:o,future:Un({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=Is(s));let{pathname:h="/",search:d="",hash:f="",state:p=null,key:w="default"}=s,b=S.useMemo(()=>{let x=yc(h,c);return x==null?null:{location:{pathname:x,search:d,hash:f,state:p,key:w},navigationType:n}},[c,h,d,f,p,w,n]);return b==null?null:S.createElement(dr.Provider,{value:u},S.createElement(_a.Provider,{children:r,value:b}))}function Wg(e){let{children:t,location:r}=e;return Cg(al(t),r)}new Promise(()=>{});function al(e,t){t===void 0&&(t=[]);let r=[];return S.Children.forEach(e,(s,n)=>{if(!S.isValidElement(s))return;let a=[...t,n];if(s.type===S.Fragment){r.push.apply(r,al(s.props.children,a));return}s.type!==kt&&ce(!1),!s.props.index||!s.props.children||ce(!1);let o={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=al(s.props.children,a)),r.push(o)}),r}/**
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 ol(){return ol=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
67for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},ol.apply(this,arguments)}function Vg(e,t){if(e==null)return{};var r={},s=Object.keys(e),n,a;for(a=0;a<s.length;a++)n=s[a],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}function Hg(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qg(e,t){return e.button===0&&(!t||t==="_self")&&!Hg(e)}const Kg=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jg="6";try{window.__reactRouterVersion=Jg}catch{}const Gg="startTransition",Wu=Bp[Gg];function Qg(e){let{basename:t,children:r,future:s,window:n}=e,a=S.useRef();a.current==null&&(a.current=X0({window:n,v5Compat:!0}));let o=a.current,[l,c]=S.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},h=S.useCallback(d=>{u&&Wu?Wu(()=>c(d)):c(d)},[c,u]);return S.useLayoutEffect(()=>o.listen(h),[o,h]),S.useEffect(()=>Bg(s),[s]),S.createElement(zg,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:s})}const Zg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ss=S.forwardRef(function(t,r){let{onClick:s,relative:n,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:h,viewTransition:d}
67=t,f=Vg(t,Kg),{basename:p}=S.useContext(dr),w,b=!1;if(typeof u=="string"&&Yg.test(u)&&(w=u,Zg))try{let y=new URL(window.location.href),j=u.startsWith("//")?new URL(y.protocol+u):new URL(u),N=yc(j.pathname,p);j.origin===y.origin&&N!=null?u=N+j.search+j.hash:b=!0}catch{}let x=Sg(u,{relative:n}),m=Xg(u,{replace:o,state:l,target:c,preventScrollReset:h,relative:n,viewTransition:d});function g(y){s&&s(y),y.defaultPrevented||m(y)}return S.createElement("a",ol({},f,{href:w||x,onClick:b||a?s:g,ref:r,target:c}))});var Vu;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Vu||(Vu={}));var Hu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Hu||(Hu={}));function Xg(e,t){let{target:r,replace:s,state:n,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Vn(),u=fr(),h=Uf(e,{relative:o});return S.useCallback(d=>{if(qg(d,r)){d.preventDefault();let f=s!==void 0?s:Yi(u)===Yi(h);c(e,{replace:f,state:n,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,h,s,n,r,e,a,o,l])}var ex={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"};const tx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rx=(e,t)=>{const r=S.forwardRef(({color:s="currentColor",size:n=24,strokeWidth:a=2,absoluteStrokeWidth:o,children:l,...c},u)=>S.createElement("svg",{ref:u,...ex,width:n,height:n,stroke:s,strokeWidth:o?Number(a)*24/Number(n):a,className:`lucide lucide-${tx(e)}`,...c},[...t.map(([h,d])=>S.createElement(h,d)),...(Array.isArray(l)?l:[l])||[]]));return r.displayName=`${e}`,r};var W=rx;const qs=W("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]),sx=W("AlertCircle",[["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"}]]),Ue=W("AlertTriangle",[["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-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ff=W("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Mf=W("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]),gs=W("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["polyline",{points:"22 4 12 14.01 9 11.01",key:"6xbx8j"}]]),en=W("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),tn=W("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),nx=W("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]),ix=W("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),Bf=W("Columns",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"12",x2:"12",y1:"3",y2:"21",key:"1efggb"}]]),so=W("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"}]]),Ir=W("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),qe=W("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]),ll=W("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),di=W("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]),ax=W("FolderOpen",[["path",{d:"m6 14 1.45-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.55 6a2 2 0 0 1-1.94 1.5H4a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.93a2 2 0 0 1 1.66.9l.82 1.2a2 2 0 0 0 1.66.9H18a2 2 0 0 1 2 2v2",key:"1nmvlm"}]]),ox=W("HelpCircle",[["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"}
67]]),zf=W("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"}]]),lx=W("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"}]]),cx=W("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"}]]),ux=W("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"}]]),Wf=W("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]]),Vf=W("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),dx=W("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"}]]),Ei=W("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),Xi=W("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),cl=W("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),ir=W("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",key:"3xmgem"}]]),jc=W("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"}]]),hx=W("Unlock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]),fx=W("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"}]]),br=W("XCircle",[["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"}]]),Ln=W("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ea=W("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),px="modulepreload",mx=function(e){return"/"+e},qu={},As=function(t,r,s){let n=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));n=Promise.allSettled(r.map(c=>{if(c=mx(c),c in qu)return;qu[c]=!0;const u=c.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":px,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return n.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},gx=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>As(async()=>{const{default:s}=await Promise.resolve().then(()=>Rs);return{default:s}},void 0).then(({default:s})=>s(...r)):t=fetch,(...r)=>t(...r)};class _c extends Error{constructor(t,r="FunctionsError",s){super(t),this.name=r,this.context=s}}class Ku extends _c{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Ju extends _c{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Gu extends _c{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var ul;(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"})(ul||(ul={}));var xx=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};class yx{constructor(t,{headers:r={},customFetch:s,region:n=ul.Any}={}){this.url=t,this.headers=r,this.region=n,this.fetch=gx(s)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return xx(this,arguments,void 0,function*(r,s={}){var n;try{const{headers:a,method:o,body:l,signal:c}=s;let u={},{region:h}=s;h||(h=this.region);const d=new URL(`${this.url}/${r}`);h&&h!=="any"&&(u["x-region"]=h,d.searchParams.set("forceFunctionRegion",h));let f;
67l&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)&&(typeof Blob<"u"&&l instanceof Blob||l instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",f=l):typeof l=="string"?(u["Content-Type"]="text/plain",f=l):typeof FormData<"u"&&l instanceof FormData?f=l:(u["Content-Type"]="application/json",f=JSON.stringify(l)));const p=yield this.fetch(d.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),a),body:f,signal:c}).catch(m=>{throw m.name==="AbortError"?m:new Ku(m)}),w=p.headers.get("x-relay-error");if(w&&w==="true")throw new Ju(p);if(!p.ok)throw new Gu(p);let b=((n=p.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),x;return b==="application/json"?x=yield p.json():b==="application/octet-stream"?x=yield p.blob():b==="text/event-stream"?x=p:b==="multipart/form-data"?x=yield p.formData():x=yield p.text(),{data:x,error:null,response:p}}catch(a){return a instanceof Error&&a.name==="AbortError"?{data:null,error:new Ku(a)}:{data:null,error:a,response:a instanceof Gu||a instanceof Ju?a.context:void 0}}})}}var $e={},Nc={},Na={},Hn={},ka={},Sa={},vx=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Es=vx();const wx=Es.fetch,Hf=Es.fetch.bind(Es),qf=Es.Headers,bx=Es.Request,jx=Es.Response,Rs=Object.freeze(Object.defineProperty({__proto__:null,Headers:qf,Request:bx,Response:jx,default:Hf,fetch:wx},Symbol.toStringTag,{value:"Module"})),_x=kp(Rs);var Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});let Nx=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
67de=t.code}};Ea.default=Nx;var Kf=rt&&rt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sa,"__esModule",{value:!0});const kx=Kf(_x),Sx=Kf(Ea);let Ex=class{constructor(t){var r,s;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(r=t.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=t.signal,this.isMaybeSingle=(s=t.isMaybeSingle)!==null&&s!==void 0?s:!1,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=kx.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,r){return this.headers=new Headers(this.headers),this.headers.set(t,r),this}then(t,r){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 s=this.fetch;let n=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async a=>{var o,l,c,u;let h=null,d=null,f=null,p=a.status,w=a.statusText;if(a.ok){if(this.method!=="HEAD"){const g=await a.text();g===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((o=this.headers.get("Accept"))===null||o===void 0)&&o.includes("application/vnd.pgrst.plan+text"))?d=g:d=JSON.parse(g))}const x=(l=this.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),m=(c=a.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");x&&m&&m.length>1&&(f=parseInt(m[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(h={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,f=null,p=406,w="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{const x=await a.text();try{h=JSON.parse(x),Array.isArray(h)&&a.status===404&&(d=[],h=null,p=200,w="OK")}catch{a.status===404&&x===""?(p=204,w="No Content"):h={message:x}}if(h&&this.isMaybeSingle&&(!((u=h==null?void 0:h.details)===null||u===void 0)&&u.includes("0 rows"))&&(h=null,p=200,w="OK"),h&&this.shouldThrowOnError)throw new Sx.default(h)}return{error:h,data:d,count:f,status:p,statusText:w}});return this.shouldThrowOnError||(n=n.catch(a=>{var o,l,c;return{error:{message:`${(o=a==null?void 0:a.name)!==null&&o!==void 0?o:"FetchError"}: ${a==null?void 0:a.message}`,details:`${(l=a==null?void 0:a.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(c=a==null?void 0:a.code)!==null&&c!==void 0?c:""}`},data:null,count:null,status:0,statusText:""}})),n.then(t,r)}returns(){return this}overrideTypes(){return this}};Sa.default=Ex;var Cx=rt&&rt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ka,"__esModule",{value:!0});const Tx=Cx(Sa);let Px=class extends Tx.default{select(t){let r=!1;const s=(t??"*").split("").map(n=>/\s/.test(n)&&!r?"":(n==='"'&&(r=!r),n)).join("");return this.url.searchParams.set("select",s),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:r=!0,nullsFirst:s,foreignTable:n,referencedTable:a=n}={}){const o=a?`${a}.order`:"order",l=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${l?`${l},`:""}${t}.${r?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:r,referencedTable:s=r}={}){const n=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,r,{foreignTable:s,referencedTable:n=s}={}){const a=typeof n>"u"?"offset":`${n}.offset`,o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(a,`${t}`),this.url.searchParams.set(o,`${r-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
67explain({analyze:t=!1,verbose:r=!1,settings:s=!1,buffers:n=!1,wal:a=!1,format:o="text"}={}){var l;const c=[t?"analyze":null,r?"verbose":null,s?"settings":null,n?"buffers":null,a?"wal":null].filter(Boolean).join("|"),u=(l=this.headers.get("Accept"))!==null&&l!==void 0?l:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${u}"; options=${c};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};ka.default=Px;var Ix=rt&&rt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hn,"__esModule",{value:!0});const Ox=Ix(ka);let Ax=class extends Ox.default{eq(t,r){return this.url.searchParams.append(t,`eq.${r}`),this}neq(t,r){return this.url.searchParams.append(t,`neq.${r}`),this}gt(t,r){return this.url.searchParams.append(t,`gt.${r}`),this}gte(t,r){return this.url.searchParams.append(t,`gte.${r}`),this}lt(t,r){return this.url.searchParams.append(t,`lt.${r}`),this}lte(t,r){return this.url.searchParams.append(t,`lte.${r}`),this}like(t,r){return this.url.searchParams.append(t,`like.${r}`),this}likeAllOf(t,r){return this.url.searchParams.append(t,`like(all).{${r.join(",")}}`),this}likeAnyOf(t,r){return this.url.searchParams.append(t,`like(any).{${r.join(",")}}`),this}ilike(t,r){return this.url.searchParams.append(t,`ilike.${r}`),this}ilikeAllOf(t,r){return this.url.searchParams.append(t,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(t,r){return this.url.searchParams.append(t,`ilike(any).{${r.join(",")}}`),this}is(t,r){return this.url.searchParams.append(t,`is.${r}`),this}in(t,r){const s=Array.from(new Set(r)).map(n=>typeof n=="string"&&new RegExp("[,()]").test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${s})`),this}contains(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cs.{${r.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(r)}`),this}containedBy(t,r){return typeof r=="string"?this.url.searchParams.append(t,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(t,`cd.{${r.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(r)}`),this}rangeGt(t,r){return this.url.searchParams.append(t,`sr.${r}`),this}rangeGte(t,r){return this.url.searchParams.append(t,`nxl.${r}`),this}rangeLt(t,r){return this.url.searchParams.append(t,`sl.${r}`),this}rangeLte(t,r){return this.url.searchParams.append(t,`nxr.${r}`),this}rangeAdjacent(t,r){return this.url.searchParams.append(t,`adj.${r}`),this}overlaps(t,r){return typeof r=="string"?this.url.searchParams.append(t,`ov.${r}`):this.url.searchParams.append(t,`ov.{${r.join(",")}}`),this}textSearch(t,r,{config:s,type:n}={}){let a="";n==="plain"?a="pl":n==="phrase"?a="ph":n==="websearch"&&(a="w");const o=s===void 0?"":`(${s})`;return this.url.searchParams.append(t,`${a}fts${o}.${r}`),this}match(t){return Object.entries(t).forEach(([r,s])=>{this.url.searchParams.append(r,`eq.${s}`)}),this}not(t,r,s){return this.url.searchParams.append(t,`not.${r}.${s}`),this}or(t,{foreignTable:r,referencedTable:s=r}={}){const n=s?`${s}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,r,s){return this.url.searchParams.append(t,`${r}.${s}`),this}};Hn.default=Ax;var Rx=rt&&rt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Na,"__esModule",{value:!0});const Ks=Rx(Hn);let Ux=class{constructor(t,{headers:r={},schema:s,fetch:n}){this.url=t,this.headers=new Headers(r),this.schema=s,this.fetch=n}select(t,r){const{head:s=!1,count:n}=r??{},a=s?"HEAD":"GET";let o=!1;const l=(t??"*").split("").map(c=>/\s/.test(c)&&!o?"":(c==='"'&&(o=!o),c)).join("");return this.url.searchParams.set("select",l),n&&this.headers.append("Prefer",`count=${n}`),new Ks.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(t,{count:r,defaultToNull:s=!0}={}){var n;const a="POST";if(r&&this.headers.append("Prefer",`count=${r}`),s||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(o.length>0){const l=[...new Set(o)].map(c=>`"${c}"`);this.url.searchParams.set("columns",l.join(","))}}return new Ks.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}upsert(t,{onConflict:r,ignoreDuplicates:s=!1,count:n,defaultToNull:a=!0}={}){var o;const l="POST";if(this.headers.append("Prefer",`resolution=${s?"ignore":"merge"}-duplicates`),r!==void 0&&this.url.searchParams.set("on_conflict",r),n&&this.headers.append("Prefer",`count=${n}`),a||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((u,h)=>u.concat(Object.keys(h)),[]);if(c.length>0){const u=[...new Set(c)].map(h=>`"${h}"`);this.url.searchParams.set("columns",u.join(","))}}return new Ks.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}update(t,{count:r}={}){var s;const n="PATCH";return r&&this.headers.append("Prefer",`count=${r}`),new Ks.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}delete({count:t}={}){var r;const s="DELETE";return t&&this.headers.append("Prefer",`count=${t}`),new Ks.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}};Na.default=Ux;
67var Jf=rt&&rt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nc,"__esModule",{value:!0});const Lx=Jf(Na),$x=Jf(Hn);let Dx=class Gf{constructor(t,{headers:r={},schema:s,fetch:n}={}){this.url=t,this.headers=new Headers(r),this.schemaName=s,this.fetch=n}from(t){const r=new URL(`${this.url}/${t}`);return new Lx.default(r,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new Gf(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:s=!1,get:n=!1,count:a}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;s||n?(l=s?"HEAD":"GET",Object.entries(r).filter(([d,f])=>f!==void 0).map(([d,f])=>[d,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([d,f])=>{c.searchParams.append(d,f)})):(l="POST",u=r);const h=new Headers(this.headers);return a&&h.set("Prefer",`count=${a}`),new $x.default({method:l,url:c,headers:h,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}};Nc.default=Dx;var Us=rt&&rt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($e,"__esModule",{value:!0});$e.PostgrestError=$e.PostgrestBuilder=$e.PostgrestTransformBuilder=$e.PostgrestFilterBuilder=$e.PostgrestQueryBuilder=$e.PostgrestClient=void 0;const Qf=Us(Nc);$e.PostgrestClient=Qf.default;const Zf=Us(Na);$e.PostgrestQueryBuilder=Zf.default;const Yf=Us(Hn);$e.PostgrestFilterBuilder=Yf.default;const Xf=Us(ka);$e.PostgrestTransformBuilder=Xf.default;const ep=Us(Sa);$e.PostgrestBuilder=ep.default;const tp=Us(Ea);$e.PostgrestError=tp.default;var Fx=$e.default={PostgrestClient:Qf.default,PostgrestQueryBuilder:Zf.default,PostgrestFilterBuilder:Yf.default,PostgrestTransformBuilder:Xf.default,PostgrestBuilder:ep.default,PostgrestError:tp.default};const{PostgrestClient:Mx,PostgrestQueryBuilder:H1,PostgrestFilterBuilder:q1,PostgrestTransformBuilder:K1,PostgrestBuilder:J1,PostgrestError:G1}=Fx;class Bx{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."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const s=r.node,n=parseInt(s.replace(/^v/,"").split(".")[0]);return n>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${n} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${n} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
68import ws from "ws"
69new 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 r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
70
71Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){const s=this.getWebSocketConstructor();return new s(t,r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const zx="2.75.0",Wx=`realtime-js/${zx}`,Vx="1.0.0",dl=1e4,Hx=1e3,qx=100;var fn;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(fn||(fn={}));var pe;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(pe||(pe={}));var ut;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(ut||(ut={}));var hl;(function(e){e.websocket="websocket"})(hl||(hl={}));var _r;
71(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(_r||(_r={}));class Kx{constructor(){this.HEADER_LENGTH=1}decode(t,r){return t.constructor===ArrayBuffer?r(this._binaryDecode(t)):r(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const r=new DataView(t),s=new TextDecoder;return this._decodeBroadcast(t,r,s)}_decodeBroadcast(t,r,s){const n=r.getUint8(1),a=r.getUint8(2);let o=this.HEADER_LENGTH+2;const l=s.decode(t.slice(o,o+n));o=o+n;const c=s.decode(t.slice(o,o+a));o=o+a;const u=JSON.parse(s.decode(t.slice(o,t.byteLength)));return{ref:null,topic:l,event:c,payload:u}}}class rp{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Z;(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"})(Z||(Z={}));const Qu=(e,t,r={})=>{var s;const n=(s=r.skipTypes)!==null&&s!==void 0?s:[];return t?Object.keys(t).reduce((a,o)=>(a[o]=Jx(o,e,t,n),a),{}):{}},Jx=(e,t,r,s)=>{const n=t.find(l=>
71l.name===e),a=n==null?void 0:n.type,o=r[e];return a&&!s.includes(a)?sp(a,o):fl(o)},sp=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return Yx(t,r)}switch(e){case Z.bool:return Gx(t);case Z.float4:case Z.float8:case Z.int2:case Z.int4:case Z.int8:case Z.numeric:case Z.oid:return Qx(t);case Z.json:case Z.jsonb:return Zx(t);case Z.timestamp:return Xx(t);case Z.abstime:case Z.date:case Z.daterange:case Z.int4range:case Z.int8range:case Z.money:case Z.reltime:case Z.text:case Z.time:case Z.timestamptz:case Z.timetz:case Z.tsrange:case Z.tstzrange:return fl(t);default:return fl(t)}},fl=e=>e,Gx=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Qx=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Zx=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},Yx=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,s=e[r];if(e[0]==="{"&&s==="}"){let a;const o=e.slice(1,r);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(l=>sp(t,l))}return e},Xx=e=>typeof e=="string"?e.replace(" ","T"):e,np=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")+"/api/broadcast"};class no{constructor(t,r,s={},n=dl){this.channel=t,this.event=r,this.payload=s,this.timeout=n,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var s;return this._hasReceived(t)&&r((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(s=>s.status===t).forEach(s=>s.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var Zu;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Zu||(Zu={}));class pn{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},n=>{const{onJoin:a,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=pn.syncState(this.state,n,a,o),this.pendingDiffs.forEach(c=>{this.state=pn.syncDiff(this.state,c,a,o)}),this.pendingDiffs=[],l()}),this.channel._on(s.diff,{},n=>{const{onJoin:a,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(n):(this.state=pn.syncDiff(this.state,n,a,o),l())}),this.onJoin((n,a,o)=>{this.channel._trigger("presence",{event:"join",key:n,currentPresences:a,newPresences:o})}),this.onLeave((n,a,o)=>{this.channel._trigger("presence",{event:"leave",key:n,currentPresences:a,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,s,n){const a=this.cloneDeep(t),o=this.transformState(r),l={},c={};return this.map(a,(u,h)=>{o[u]||(c[u]=h)}),this.map(o,(u,h)=>{const d=a[u];if(d){const f=h.map(x=>x.presence_ref),p=d.map(x=>x.presence_ref),w=h.filter(x=>p.indexOf(x.presence_ref)<0),b=d.filter(x=>f.indexOf(x.presence_ref)<0);w.length>0&&(l[u]=w),b.length>0&&(c[u]=b)}else l[u]=h}),this.syncDiff(a,{joins:l,leaves:c},s,n)}static syncDiff(t,r,s,n){const{joins:a,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return s||(s=()=>{}),n||(n=()=>{}),this.map(a,(l,c)=>{var u;const h=(u=t[l])!==null&&u!==void 0?u:[];if(t[l]=this.cloneDeep(c),h.length>0){const d=t[l].map(p=>p.presence_ref),f=h.filter(p=>d.indexOf(p.presence_ref)<0);t[l].unshift(...f)}s(l,h,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;const h=c.map(d=>d.presence_ref);u=u.filter(d=>h.indexOf(d.presence_ref)<0),t[l]=u,n(l,u,c),u.length===0&&delete t[l]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(s=>r(s,t[s]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,s)=>{const n=t[s];return"metas"in n?r[s]=n.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):r[s]=n,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Yu;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Yu||(Yu={}));var mn;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(mn||(mn={}));var Et;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Et||(Et={}));class kc{constructor(t,r={config:{}},s){var n,a;if(this.topic=t,this.params=r,this.socket=s,this.bindings={},this.state=pe.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new no(this,ut.join,this.params,this.timeout),this.rejoinTimer=new rp(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=pe.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=pe.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=pe.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ut.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new pn(this),this.broadcastEndpointURL=np(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((a=(n=this.params.config)===null||n===void 0?void 0:n.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,r=this.timeout){var s,n,a;if(this.socket.isConnected()||this.socket.connect(),this.state==pe.closed){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(n=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(p=>p.filter))!==null&&n!==void 0?n:[],h=!!this.bindings[mn.PRESENCE]&&this.bindings[mn.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,d={},f={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:h}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(p=>t==null?void 0:t(Et.CHANNEL_ERROR,p)),this._onClose(()=>t==null?void 0:t(Et.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:p})=>{var w;if(this.socket.setAuth(),p===void 0){t==null||t(Et.SUBSCRIBED);return}else{const b=this.bindings.postgres_changes,x=(w=b==null?void 0:b.length)!==null&&w!==void 0?w:0,m=[];for(let g=0;g<x;g++){const y=b[g],{filter:{event:j,schema:N,table:k,filter:_}}=y,E=p&&p[g];if(E&&E.event===j&&E.schema===N&&E.table===k&&E.filter===_)m.push(Object.assign(Object.assign({},y),{id:E.id}));else{this.unsubscribe(),this.state=pe.errored,t==null||t(Et.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=m,t&&t(Et.SUBSCRIBED);return}}).receive("error",p=>{this.state=pe.errored,t==null||t(Et.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Et.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,s){return this.state===pe.joined&&t===mn.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(t,r,s)}async send(t,r={}){var s,n;if(!this._canPush()&&t.type==="broadcast"){const{event:a,payload:o}=t,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);return await((n=u.body)===null||n===void 0?void 0:n.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,l,c;const u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>
71a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=pe.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ut.close,"leave",this._joinRef())};this.joinPush.destroy();let s=null;return new Promise(n=>{s=new no(this,ut.leave,{},t),s.receive("ok",()=>{r(),n("ok")}).receive("timeout",()=>{r(),n("timed out")}).receive("error",()=>{n("error")}),s.send(),this._canPush()||s.trigger("ok",{})}).finally(()=>{s==null||s.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=pe.closed,this.bindings={}}async _fetchWithTimeout(t,r,s){const n=new AbortController,a=setTimeout(()=>n.abort(),s),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:n.signal}));return clearTimeout(a),o}_push(t,r,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let n=new no(this,t,r,s);return this._canPush()?n.send():this._addToPushBuffer(n),n}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>qx){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,s){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,s){var n,a;const o=t.toLocaleLowerCase(),{close:l,error:c,leave:u,join:h}=ut;if(s&&[l,c,u,h].indexOf(o)>=0&&s!==this._joinRef())return;let f=this._onMessage(o,r,s);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(n=this.bindings.postgres_changes)===null||n===void 0||n.filter(p=>{var w,b,x;return((w=p.filter)===null||w===void 0?void 0:w.event)==="*"||((x=(b=p.filter)===null||b===void 0?void 0:b.event)===null||x===void 0?void 0:x.toLocaleLowerCase())===o}).map(p=>p.callback(f,s)):(a=this.bindings[o])===null||a===void 0||a.filter(p=>{var w,b,x,m,g,y;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const j=p.id,N=(w=p.filter)===null||w===void 0?void 0:w.event;return j&&((b=r.ids)===null||b===void 0?void 0:b.includes(j))&&(N==="*"||(N==null?void 0:N.toLocaleLowerCase())===((x=r.data)===null||x===void 0?void 0:x.type.toLocaleLowerCase()))}else{const j=(g=(m=p==null?void 0:p.filter)===null||m===void 0?void 0:m.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return j==="*"||j===((y=r==null?void 0:r.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof f=="object"&&"ids"in f){const w=f.data,{schema:b,table:x,commit_timestamp:m,type:g,errors:y}=w;f=Object.assign(Object.assign({},{schema:b,table:x,commit_timestamp:m,eventType:g,new:{},old:{},errors:y}),this._getPayloadRecords(w))}p.callback(f,s)})}_isClosed(){return this.state===pe.closed}_isJoined(){return this.state===pe.joined}_isJoining(){return this.state===pe.joining}_isLeaving(){return this.state===pe.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,s){const n=t.toLocaleLowerCase(),a={type:n,filter:r,callback:s};return this.bindings[n]?this.bindings[n].push(a):this.bindings[n]=[a],this}_off(t,r){const s=t.toLocaleLowerCase();return this.bindings[s]&&(this.bindings[s]=this.bindings[s].filter(n=>{var a;return!(((a=n.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===s&&kc.isEqual(n.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const s in t)if(t[s]!==r[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(ut.close,{},t)}_onError(t){this._on(ut.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=pe.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=Qu(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=Qu(t.columns,t.old_record)),r}}const io=()=>{},hi={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},ey=[1e3,2e3,5e3,1e4],ty=1e4,ry=`
72  addEventListener("message", (e) => {
73    if (e.data.event === "start") {
74      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
75    }
76  });`;class sy{constructor(t,r){var s;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={}
76,this.timeout=dl,this.transport=null,this.heartbeatIntervalMs=hi.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=io,this.ref=0,this.reconnectTimer=null,this.logger=io,this.conn=null,this.sendBuffer=[],this.serializer=new Kx,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=n=>{let a;return n?a=n:typeof fetch>"u"?a=(...o)=>As(async()=>{const{default:l}=await Promise.resolve().then(()=>Rs);return{default:l}},void 0).then(({default:l})=>l(...o)).catch(l=>{throw new Error(`Failed to load @supabase/node-fetch: ${l.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):a=fetch,(...o)=>a(...o)},!(!((s=r==null?void 0:r.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${hl.websocket}`,this.httpEndpoint=np(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Bx.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const r=t.message;throw r.includes("Node.js")?new Error(`${r}
77
78To use Realtime in Node.js, you need to provide a WebSocket implementation:
79
80Option 1: Use Node.js 22+ which has native WebSocket support
81Option 2: Install and provide the "ws" package:
82
83  npm install ws
84
85  import ws from "ws"
86  const client = new RealtimeClient(url, {
87    ...options,
88    transport: ws
89  })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Vx}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const s=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(s),this._setConnectionState("disconnected")},t?this.conn.close(t,r??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,s){this.logger(t,r,s)}connectionState(){switch(this.conn&&this.conn.readyState){case fn.connecting:return _r.Connecting;case fn.open:return _r.Open;case fn.closing:return _r.Closing;default:return _r.Closed}}isConnected(){return this.connectionState()===_r.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){const s=`realtime:${t}`,n=this.getChannels().find(a=>a.topic===s);if(n)return n;{const a=new kc(`realtime:${t}`,r,this);return this.channels.push(a),a}}push(t){const{topic:r,event:s,payload:n,ref:a}=t,o=()=>{this.encode(t,l=>{var c;(c=this.conn)===null||c===void 0||c.send(l)})};this.log("push",`${r} ${s} (${a})`,n),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(Hx,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
89heduleTimeout()},hi.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(s=>s.topic===t&&(s._isJoined()||s._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:s,event:n,payload:a,ref:o}=r,l=o?`(${o})`:"",c=a.status||"";this.log("receive",`${c} ${s} ${n} ${l}`.trim(),a),this.channels.filter(u=>u._isMember(s)).forEach(u=>u._trigger(n,a,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),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))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_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=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
89heduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(ut.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;const s=t.match(/\?/)?"&":"?",n=new URLSearchParams(r);return`${t}${s}${n}`}_workerObjectUrl(t){let r;if(t)r=t;else{const s=new Blob([ry],{type:"application/javascript"});r=URL.createObjectURL(s)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r;t?r=t:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const n={access_token:r,version:Wx};r&&s.updateJoinPayload(n),s.joinedOnce&&s._isJoined()&&s._push(ut.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(s=>{try{s(r)}catch(n){this.log("error",`error in ${t} callback`,n)}})}catch(s){this.log("error",`error triggering ${t} callbacks`,s)}}_setupReconnectionTimer(){this.reconnectTimer=new rp(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},hi.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,s,n,a,o,l,c,u,h;if(this.transport=(r=t==null?void 0:t.transport)!==null&&r!==void 0?r:null,this.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:dl,this.heartbeatIntervalMs=(n=t==null?void 0:t.heartbeatIntervalMs)!==null&&n!==void 0?n:hi.HEARTBEAT_INTERVAL,this.worker=(a=t==null?void 0:t.worker)!==null&&a!==void 0?a:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(l=t==null?void 0:t.heartbeatCallback)!==null&&l!==void 0?l:io,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=t==null?void 0:t.reconnectAfterMs)!==null&&c!==void 0?c:d=>ey[d-1]||ty,this.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:(d,f)=>f(JSON.stringify(d)),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}class Sc extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function he(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class ny extends Sc{constructor(t,r,s){super(t),this.name="StorageApiError",this.status=r,this.statusCode=s}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class pl extends Sc{constructor(t,r){super(t),this.name="StorageUnknownError",this.originalError=r}}var iy=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};const ip=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>As(async()=>{const{default:s}=await Promise.resolve().then(()=>Rs);return{default:s}},void 0).then(({default:s})=>s(...r)):t=fetch,(...r)=>t(...r)},ay=()=>iy(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield As(()=>Promise.resolve().then(()=>Rs),void 0)).Response:Response}),ml=e=>{if(Array.isArray(e))return e.map(r=>ml(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,s])=>{const n=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[n]=ml(s)}),t},oy=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);
89return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var Fr=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};const ao=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),ly=(e,t,r)=>Fr(void 0,void 0,void 0,function*(){const s=yield ay();e instanceof s&&!(r!=null&&r.noResolveJson)?e.json().then(n=>{const a=e.status||500,o=(n==null?void 0:n.statusCode)||a+"";t(new ny(ao(n),a,o))}).catch(n=>{t(new pl(ao(n),n))}):t(new pl(ao(e),e))}),cy=(e,t,r,s)=>{const n={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!s?n:(oy(s)?(n.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),n.body=JSON.stringify(s)):n.body=s,t!=null&&t.duplex&&(n.duplex=t.duplex),Object.assign(Object.assign({},n),r))};function qn(e,t,r,s,n,a){return Fr(this,void 0,void 0,function*(){return new Promise((o,l)=>{e(r,cy(t,s,n,a)).then(c=>{if(!c.ok)throw c;return s!=null&&s.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>ly(c,l,s))})})}function ta(e,t,r,s){return Fr(this,void 0,void 0,function*(){return qn(e,"GET",t,r,s)})}function vt(e,t,r,s,n){return Fr(this,void 0,void 0,function*(){return qn(e,"POST",t,s,n,r)})}function gl(e,t,r,s,n){return Fr(this,void 0,void 0,function*(){return qn(e,"PUT",t,s,n,r)})}function uy(e,t,r,s){return Fr(this,void 0,void 0,function*(){return qn(e,"HEAD",t,Object.assign(Object.assign({},r),{noResolveJson:!0}),s)})}function ap(e,t,r,s,n){return Fr(this,void 0,void 0,function*(){return qn(e,"DELETE",t,s,n,r)})}var dy=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};class hy{constructor(t,r){this.downloadFn=t,this.shouldThrowOnError=r}then(t,r){return this.execute().then(t,r)}execute(){return dy(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(he(t))return{data:null,error:t};throw t}})}}var fy=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};class py{constructor(t,r){this.downloadFn=t,this.shouldThrowOnError=r}asStream(){return new hy(this.downloadFn,this.shouldThrowOnError)}then(t,r){return this.execute().then(t,r)}execute(){return fy(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(he(t))return{data:null,error:t};throw t}})}}var Ae=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};const my={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Xu={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class gy{constructor(t,r={},s,n){this.shouldThrowOnError=!1,this.url=t,this.headers=r,this.bucketId=s,this.fetch=ip(n)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(t,r,s,n){return Ae(this,void 0,void 0,function*(){try{let a;const o=Object.assign(Object.assign({},Xu),n);let l=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&s instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",this.encodeMetadata(c)),a.append("",s)):typeof FormData<"u"&&s instanceof FormData?(a=s,a.append("cacheControl",o.cacheControl),c&&a.append("metadata",this.encodeMetadata(c))):(a=s,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),n!=null&&n.headers&&(l=Object.assign(Object.assign({},l),n.headers));const u=this._removeEmptyFolders(r),h=this._getFinalPath(u),d=yield(t=="PUT"?gl:vt)(this.fetch,`${this.url}/object/${h}`,a,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:u,id:d.Id,fullPath:d.Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(he(a))return{data:null,error:a};throw a}})}upload(t,r,s){return Ae(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,r,s)})}uploadToSignedUrl(t,r,s,n){return Ae(this,void 0,void 0,function*(){const a=this._removeEmptyFolders(t),o=this._getFinalPath(a),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",r);try{let c;const u=Object.assign({upsert:Xu.upsert},n),h=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&s instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",s)):typeof FormData<"u"&&s instanceof FormData?(c=s,c.append("cacheControl",u.cacheControl)):(c=s,h["cache-control"]=`max-age=${u.cacheControl}`,h["content-type"]=u.contentType);
89const d=yield gl(this.fetch,l.toString(),c,{headers:h});return{data:{path:a,fullPath:d.Key},error:null}}catch(c){if(this.shouldThrowOnError)throw c;if(he(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(t,r){return Ae(this,void 0,void 0,function*(){try{let s=this._getFinalPath(t);const n=Object.assign({},this.headers);r!=null&&r.upsert&&(n["x-upsert"]="true");const a=yield vt(this.fetch,`${this.url}/object/upload/sign/${s}`,{},{headers:n}),o=new URL(this.url+a.url),l=o.searchParams.get("token");if(!l)throw new Sc("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:l},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}})}update(t,r,s){return Ae(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,r,s)})}move(t,r,s){return Ae(this,void 0,void 0,function*(){try{return{data:yield vt(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:s==null?void 0:s.destinationBucket},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}})}copy(t,r,s){return Ae(this,void 0,void 0,function*(){try{return{data:{path:(yield vt(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:r,destinationBucket:s==null?void 0:s.destinationBucket},{headers:this.headers})).Key},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}})}createSignedUrl(t,r,s){return Ae(this,void 0,void 0,function*(){try{let n=this._getFinalPath(t),a=yield vt(this.fetch,`${this.url}/object/sign/${n}`,Object.assign({expiresIn:r},s!=null&&s.transform?{transform:s.transform}:{}),{headers:this.headers});const o=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${o}`)},{data:a,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}})}createSignedUrls(t,r,s){return Ae(this,void 0,void 0,function*(){try{const n=yield vt(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:t},{headers:this.headers}),a=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return{data:n.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${a}`):null})),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}})}download(t,r){const n=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=a?`?${a}`:"",l=this._getFinalPath(t),c=()=>ta(this.fetch,`${this.url}/${n}/${l}${o}`,{headers:this.headers,noResolveJson:!0});return new py(c,this.shouldThrowOnError)}info(t){return Ae(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{const s=yield ta(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:ml(s),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}})}exists(t){return Ae(this,void 0,void 0,function*(){const r=this._getFinalPath(t);try{return yield uy(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(he(s)&&s instanceof pl){const n=s.originalError;if([400,404].includes(n==null?void 0:n.status))return{data:!1,error:s}}throw s}})}getPublicUrl(t,r){const s=this._getFinalPath(t),n=[],a=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";a!==""&&n.push(a);const l=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",c=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});c!==""&&n.push(c);let u=n.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${s}${u}`)}}}remove(t){return Ae(this,void 0,void 0,function*(){try{return{data:yield ap(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}})}list(t,r,s){return Ae(this,void 0,void 0,function*(){try{const n=Object.assign(Object.assign(Object.assign({},my),r),{prefix:t||""});return{data:yield vt(this.fetch,`${this.url}/object/list/${this.bucketId}`,n,{headers:this.headers},s),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}})}listV2(t,r){return Ae(this,void 0,void 0,function*(){try{const s=Object.assign({},t);return{data:yield vt(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,s,{headers:this.headers},r),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const r=[];return t.width&&r.push(`width=${t.width}`),t.height&&r.push(`height=${t.height}`),t.resize&&r.push(`resize=${t.resize}`),t.format&&r.push(`format=${t.format}`),t.quality&&r.push(`quality=${t.quality}`),r.join("&")}}const xy="2.75.0",yy={"X-Client-Info":`storage-js/${xy}`};var Wr=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};class vy{constructor(t,r={},s,n){this.shouldThrowOnError=!1;const a=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},yy),r),this.fetch=ip(s)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(){return Wr(this,void 0,void 0,function*(){try{return{data:yield ta(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(he(t))return{data:null,error:t};throw t}})}getBucket(t){return Wr(this,void 0,void 0,function*(){try{return{data:yield ta(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}})}createBucket(t){return Wr(this,arguments,void 0,function*(r,s={public:!1}){try{return{data:yield vt(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:s.type,public:s.public,file_size_limit:s.fileSizeLimit,allowed_mime_types:s.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(he(n))return{data:null,error:n};throw n}})}updateBucket(t,r){return Wr(this,void 0,void 0,function*(){try{return{data:yield gl
89(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(he(s))return{data:null,error:s};throw s}})}emptyBucket(t){return Wr(this,void 0,void 0,function*(){try{return{data:yield vt(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}})}deleteBucket(t){return Wr(this,void 0,void 0,function*(){try{return{data:yield ap(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(he(r))return{data:null,error:r};throw r}})}}class wy extends vy{constructor(t,r={},s,n){super(t,r,s,n)}from(t){return new gy(this.url,this.headers,t,this.fetch)}}const by="2.75.0";let rn="";typeof Deno<"u"?rn="deno":typeof document<"u"?rn="web":typeof navigator<"u"&&navigator.product==="ReactNative"?rn="react-native":rn="node";const jy={"X-Client-Info":`supabase-js-${rn}/${by}`},_y={headers:jy},Ny={schema:"public"},ky={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Sy={};var Ey=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};const Cy=e=>{let t;return e?t=e:typeof fetch>"u"?t=Hf:t=fetch,(...r)=>t(...r)},Ty=()=>typeof Headers>"u"?qf:Headers,Py=(e,t,r)=>{const s=Cy(r),n=Ty();return(a,o)=>Ey(void 0,void 0,void 0,function*(){var l;const c=(l=yield t())!==null&&l!==void 0?l:e;let u=new n(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),s(a,Object.assign(Object.assign({},o),{headers:u}))})};var Iy=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};function Oy(e){return e.endsWith("/")?e:e+"/"}function Ay(e,t){var r,s;const{db:n,auth:a,realtime:o,global:l}=e,{db:c,auth:u,realtime:h,global:d}=t,f={db:Object.assign(Object.assign({},c),n),auth:Object.assign(Object.assign({},u),a),realtime:Object.assign(Object.assign({},h),o),storage:{},global:Object.assign(Object.assign(Object.assign({},d),l),{headers:Object.assign(Object.assign({},(r=d==null?void 0:d.headers)!==null&&r!==void 0?r:{}),(s=l==null?void 0:l.headers)!==null&&s!==void 0?s:{})}),accessToken:()=>Iy(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function Ry(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(Oy(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const op="2.75.0",Qr=30*1e3,xl=3,oo=xl*Qr,Uy="http://localhost:9999",Ly="supabase.auth.token",$y={"X-Client-Info":`gotrue-js/${op}`},yl="X-Supabase-Api-Version",lp={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Dy=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Fy=10*60*1e3;class $n extends Error{constructor(t,r,s){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=s}}function L(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class My extends $n{constructor(t,r,s){super(t,r,s),this.name="AuthApiError",this.status=r,this.code=s}}function By(e){return L(e)&&e.name==="AuthApiError"}class Nr extends $n{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class pr extends $n{constructor(t,r,s,n){super(t,s,n),this.name=r,this.status=s}}class Ft extends pr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function zy(e){return L(e)&&e.name==="AuthSessionMissingError"}class Vr extends pr{constructor(){super("Auth session or user missing","AuthInvalidToken
89ResponseError",500,void 0)}}class fi extends pr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class pi extends pr{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function Wy(e){return L(e)&&e.name==="AuthImplicitGrantRedirectError"}class ed extends pr{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class vl extends pr{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function lo(e){return L(e)&&e.name==="AuthRetryableFetchError"}class td extends pr{constructor(t,r,s){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=s}}class wl extends pr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const ra="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),rd=` 	
90\r=`.split(""),Vy=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<rd.length;t+=1)e[rd[t].charCodeAt(0)]=-2;for(let t=0;t<ra.length;t+=1)e[ra[t].charCodeAt(0)]=t;return e})();function sd(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;r(ra[s]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;r(ra[s]),t.queuedBits-=6}}function cp(e,t,r){const s=Vy[e];if(s>-1)for(t.queue=t.queue<<6|s,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function nd(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},s={utf8seq:0,codepoint:0},n={queue:0,queuedBits:0},a=o=>{Ky(o,s,r)};for(let o=0;o<e.length;o+=1)cp(e.charCodeAt(o),n,a);return t.join("")}function Hy(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 qy(e,t){for(let r=0;r<e.length;r+=1){let s=e.charCodeAt(r);if(s>55295&&s<=56319){const n=(s-55296)*1024&65535;s=(e.charCodeAt(r+1)-56320&65535|n)+65536,r+=1}Hy(s,t)}}function Ky(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let s=1;s<6;s+=1)if(!(e>>7-s&1)){t.utf8seq=s;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&&r(t.codepoint)}}function xs(e){const t=[],r={queue:0,queuedBits:0},s=n=>{t.push(n)};for(let n=0;n<e.length;n+=1)cp(e.charCodeAt(n),r,s);return new Uint8Array(t)}function Jy(e){const t=[];return qy(e,r=>t.push(r)),new Uint8Array(t)}function Cr(e){const t=[],r={queue:0,queuedBits:0},s=n=>{t.push(n)};return e.forEach(n=>sd(n,r,s)),sd(null,r,s),t.join("")}function Gy(e){return Math.round(Date.now()/1e3)+e}function Qy(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const We=()=>typeof window<"u"&&typeof document<"u",xr={tested:!1,writable:!1},up=()=>{if(!We())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(xr.tested)return xr.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),xr.tested=!0,xr.writable=!0}catch{xr.tested=!0,xr.writable=!1}return xr.writable};function Zy(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((n,a)=>{t[a]=n})}catch{}return r.searchParams.forEach((s,n)=>{t[n]=s}),t}const dp=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...r)=>As(async()=>{const{default:s}=await Promise.resolve().then(()=>Rs);return{default:s}},void 0).then(({default:s})=>s(...r)):t=fetch,(...r)=>t(...r)},Yy=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Zr=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},yr=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Dt=async(e,t)=>{await e.removeItem(t)};class Ca{constructor(){this.promise=new Ca.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Ca.promiseConstructor=Promise;function co(e){const t=e.split(".");if(t.length!==3)throw new wl("Invalid JWT structure");for(let s=0;s<t.length;s++)if(!Dy.test(t[s]))throw new wl("JWT not in base64url format");return{header:JSON.parse(nd(t[0])),payload:JSON.parse(nd(t[1])),signature:xs(t[2]),raw:{header:t[0],payload:t[1]}}}async function Xy(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function ev(e,t){return new Promise((s,n)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await e(a);if(!t(a,null,o)){s(o);return}}catch(o){if(!t(a,o)){n(o);return}}})()})}function tv(e){return("0"+e.toString(16)).substr(-2)}function rv(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=r.length;let n="";for(let a=0;a<56;a++)n+=r.charAt(Math.floor(Math.random()*s));return n}return crypto.getRandomValues(t),Array.from(t,tv).join("")}async function sv(e){const r=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",r),n=new Uint8Array(s);return Array.from(n).map(a=>String.fromCharCode(a)).join("")}async function nv(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code 
90challenge method will default to use plain instead of sha256."),e;const r=await sv(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Hr(e,t,r=!1){const s=rv();let n=s;r&&(n+="/PASSWORD_RECOVERY"),await Zr(e,`${t}-code-verifier`,n);const a=await nv(s);return[a,s===a?"plain":"s256"]}const iv=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function av(e){const t=e.headers.get(yl);if(!t||!t.match(iv))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function ov(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 lv(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 cv=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function qr(e){if(!cv.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function uo(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="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 "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function id(e){return JSON.parse(JSON.stringify(e))}var uv=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(e);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(e,s[n])&&(r[s[n]]=e[s[n]]);return r};const jr=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),dv=[502,503,504];async function ad(e){var t;if(!Yy(e))throw new vl(jr(e),0);if(dv.includes(e.status))throw new vl(jr(e),e.status);let r;try{r=await e.json()}catch(a){throw new Nr(jr(a),a)}let s;const n=av(e);if(n&&n.getTime()>=lp["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?s=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(s=r.error_code),s){if(s==="weak_password")throw new td(jr(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(s==="session_not_found")throw new Ft}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new td(jr(r),e.status,r.weak_password.reasons);throw new My(jr(r),e.status||500,s)}const hv=(e,t,r,s)=>{const n={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?n:(n.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),n.body=JSON.stringify(s),Object.assign(Object.assign({},n),r))};async function F(e,t,r,s){var n;const a=Object.assign({},s==null?void 0:s.headers);a[yl]||(a[yl]=lp["2024-01-01"].name),s!=null&&s.jwt&&(a.Authorization=`Bearer ${s.jwt}`);const o=(n=s==null?void 0:s.query)!==null&&n!==void 0?n:{};s!=null&&s.redirectTo&&(o.redirect_to=s.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await fv(e,t,r+l,{headers:a,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(c):{data:Object.assign({},c),error:null}}async function fv(e,t,r,s,n,a){const o=hv(t,s,n,a);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw console.error(c),new vl(jr(c),0)}if(l.ok||await ad(l),s!=null&&s.noResolveJson)return l;try{return await l.json()}catch(c){await ad(c)}}function ot(e){var t;let r=null;gv(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=Gy(e.expires_in)));const s=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:s},error:null}}function od(e){const t=ot(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((r,s)=>r&&typeof s=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Ht(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function pv(e){return{data:e,error:null}}function mv(e){const{action_link:t,email_otp:r,hashed_token:s,redirect_to:n,verification_type:a}=e,o=uv(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:s,redirect_to:n,verification_type:a},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function ld(e){return e}
90function gv(e){return e.access_token&&e.refresh_token&&e.expires_in}const ho=["global","local","others"];var xv=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(e);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(e,s[n])&&(r[s[n]]=e[s[n]]);return r};class yv{constructor({url:t="",headers:r={},fetch:s}){this.url=t,this.headers=r,this.fetch=dp(s),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=ho[0]){if(ho.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${ho.join(", ")}`);try{return await F(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(s){if(L(s))return{data:null,error:s};throw s}}async inviteUserByEmail(t,r={}){try{return await F(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Ht})}catch(s){if(L(s))return{data:{user:null},error:s};throw s}}async generateLink(t){try{const{options:r}=t,s=xv(t,["options"]),n=Object.assign(Object.assign({},s),r);return"newEmail"in s&&(n.new_email=s==null?void 0:s.newEmail,delete n.newEmail),await F(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:mv,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(L(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await F(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ht})}catch(r){if(L(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,s,n,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},h=await F(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:"",per_page:(a=(n=t==null?void 0:t.perPage)===null||n===void 0?void 0:n.toString())!==null&&a!==void 0?a:""},xform:ld});if(h.error)throw h.error;const d=await h.json(),f=(o=h.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=h.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(w=>{const b=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(w.split(";")[1].split("=")[1]);u[`${x}Page`]=b}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(L(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){qr(t);try{return await F(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ht})}catch(r){if(L(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){qr(t);try{return await F(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Ht})}catch(s){if(L(s))return{data:{user:null},error:s};throw s}}async deleteUser(t,r=!1){qr(t);try{return await F(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Ht})}catch(s){if(L(s))return{data:{user:null},error:s};throw s}}async _listFactors(t){qr(t.userId);try{const{data:r,error:s}=await F(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:n=>({data:{factors:n},error:null})});return{data:r,error:s}}catch(r){if(L(r))return{data:null,error:r};throw r}}async _deleteFactor(t){qr(t.userId),qr(t.id);try{return{data:await F(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(L(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,s,n,a,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},h=await F(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:"",per_page:(a=(n=t==null?void 0:t.perPage)===null||n===void 0?void 0:n.toString())!==null&&a!==void 0?a:""},xform:ld});if(h.error)throw h.error;const d=await h.json(),f=(o=h.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=h.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>
900&&(p.forEach(w=>{const b=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(w.split(";")[1].split("=")[1]);u[`${x}Page`]=b}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(L(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await F(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await F(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await F(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await F(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}}function cd(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const Kr={debug:!!(globalThis&&up()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class hp extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class vv extends hp{}async function wv(e,t,r){Kr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const s=new globalThis.AbortController;return t>0&&setTimeout(()=>{s.abort(),Kr.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async n=>{if(n){Kr.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,n.name);try{return await r()}finally{Kr.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,n.name)}}else{if(t===0)throw Kr.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new vv(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Kr.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null,"  "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}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"),await r()}}))}function bv(){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 fp(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function jv(e){return parseInt(e,16)}function _v(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,s=>s.toString(16).padStart(2,"0")).join("")}function Nv(e){var t;const{chainId:r,domain:s,expirationTime:n,issuedAt:a=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:h,uri:d,version:f}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!s)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
91`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=fp(e.address),w=h?`${h}://${s}`:s,b=e.statement?`${e.statement}
92`:"",x=`${w} wants you to sign in with your Ethereum account:
93${p}
94
95${b}`;let m=`URI: ${d}
96Version: ${f}
97Chain ID: ${r}${o?`
98Nonce: ${o}`:""}
99Issued At: ${a.toISOString()}`;if(n&&(m+=`
100Expiration Time: ${n.toISOString()}`),l&&(m+=`
101Not Before: ${l.toISOString()}
101`),c&&(m+=`
102Request ID: ${c}`),u){let g=`
103Resources:`;for(const y of u){if(!y||typeof y!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${y}`);g+=`
104- ${y}`}m+=g}return`${x}
105${m}`}class de extends Error{constructor({message:t,code:r,cause:s,name:n}){var a;super(t,{cause:s}),this.__isWebAuthnError=!0,this.name=(a=n??(s instanceof Error?s.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}}class sa extends de{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function kv({error:e,options:t}){var r,s,n;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 de({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new de({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((s=a.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new de({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new de({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 de({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new de({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 de({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new de({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(mp(o)){if(a.rp.id!==o)return new de({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new de({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 de({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 de({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 de({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function Sv({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new de({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new de({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if(mp(s)){if(r.rpId!==s)return new de({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new de({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new de({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ER
105ROR",cause:e})}return new de({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}var pp=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(e);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(e,s[n])&&(r[s[n]]=e[s[n]]);return r};class Ev{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}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 Cv=new Ev;function Tv(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:r,excludeCredentials:s}=e,n=pp(e,["challenge","user","excludeCredentials"]),a=xs(t).buffer,o=Object.assign(Object.assign({},r),{id:xs(r.id).buffer}),l=Object.assign(Object.assign({},n),{challenge:a,user:o});if(s&&s.length>0){l.excludeCredentials=new Array(s.length);for(let c=0;c<s.length;c++){const u=s[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:xs(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function Pv(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:r}=e,s=pp(e,["challenge","allowCredentials"]),n=xs(t).buffer,a=Object.assign(Object.assign({},s),{challenge:n});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},l),{id:xs(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function Iv(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:Cr(new Uint8Array(e.response.attestationObject)),clientDataJSON:Cr(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Ov(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,s=e.getClientExtensionResults(),n=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Cr(new Uint8Array(n.authenticatorData)),clientDataJSON:Cr(new Uint8Array(n.clientDataJSON)),signature:Cr(new 
105Uint8Array(n.signature)),userHandle:n.userHandle?Cr(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:s,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function mp(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function ud(){var e,t;return!!(We()&&"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 Av(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new sa("Browser returned unexpected credential type",t)}:{data:null,error:new sa("Empty credential response",t)}}catch(t){return{data:null,error:kv({error:t,options:e})}}}async function Rv(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new sa("Browser returned unexpected credential type",t)}:{data:null,error:new sa("Empty credential response",t)}}catch(t){return{data:null,error:Sv({error:t,options:e})}}}const Uv={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"},Lv={userVerification:"preferred",hints:["security-key"]};function na(...e){const t=n=>n!==null&&typeof n=="object"&&!Array.isArray(n),r=n=>n instanceof ArrayBuffer||ArrayBuffer.isView(n),s={};for(const n of e)if(n)for(const a in n){const o=n[a];if(o!==void 0)if(Array.isArray(o))s[a]=o;else if(r(o))s[a]=o;else if(t(o)){const l=s[a];t(l)?s[a]=na(l,o):s[a]=na(o)}else s[a]=o}return s}function $v(e,t){return na(Uv,e,t||{})}function Dv(e,t){return na(Lv,e,t||{})}class Fv{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:r,friendlyName:s,signal:n},a){try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!o)return{data:null,error:l};const c=n??Cv.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${s}`),u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=$v(o.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:h,error:d}=await Av({publicKey:u,signal:c});return h?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:d}}case"request":{const u=Dv(o.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:h,error:d}=await Rv(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:c}));return h?{data:{factorId:t,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:d}}}}catch(o){return L(o)?{data:null,error:o}:{data:null,error:new Nr("Unexpected error in challenge",o)}}}async _verify({challengeId:t,factorId:r,webauthn:s}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:s})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:n}},a){if(!r)return{data:null,error:new $n("rpId is required for WebAuthn authentication")};try{if(!ud())return{data:null,error:new Nr("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:s},signal:n},{request:a});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:s,credential_response:c.credential_response}})}catch(o){return L(o)?{data:null,error:o}:{data:null,error:new Nr("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:n},a){if(!r)return{data:null,error:new $n("rpId is required for WebAuthn registration")};try{if(!ud())return{data:null,error:new Nr("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(h=>{var d;return(d=h.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(h=>h?this.client.mfa.unenroll({factorId:h==null?void 0:h.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:s},signal:n},{create:a});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:s,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return L(o)?{data:null,error:o}:{data:null,error:new Nr("Unexpected error in register",o)}}}}bv();const Mv={url:Uy,storageKey:Ly,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:$y,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function dd(e,t,r){return await r()}const Jr={};class Dn{get jwks(){var t,r;return(r=(t=Jr[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Jr[this.storageKey]=Object.assign(Object.assign({},Jr[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Jr[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Jr[this.storageKey]=Object.assign(Object.assign({},Jr[this.storageKey]),{cachedAt:t})}constructor(t){var r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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,this.instanceID=Dn.nextInstanceID,Dn.nextInstanceID+=1,this.instanceID>0&&We()&&console.warn("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.");const n=Object.assign(Object.assign({},Mv),t);if(this.logDebugMessages=!!n.debug,typeof n.debug=="function"&&(this.logger=n.debug),this.persistSession=n.persistSession,this.storageKey=n.storageKey,this.autoRefreshToken=n.autoRefreshToken,this.admin=new yv({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=dp(n.fetch),this.lock=n.lock||dd,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,n.lock?this.lock=n.lock:We()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=wv:this.lock=dd,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 Fv(this)},this.persistSession?(n.storage?this.storage=n.storage:up()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=cd(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=cd(this.memoryStorage)),We()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${op}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{const r=Zy(window.location.href);let s="none";if(this._isImplicitGrantCallback(r)?s="implicit":await this._isPKCECallback(r)&&(s="pkce"),We()&&this.detectSessionInUrl&&s!=="none"){const{data:n,error:a}=await this._getSessionFromURL(r,s);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),Wy(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 await this._removeSession(),{error:a}}const{session:o,redirectType:l}=n;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return L(r)?{error:r}:{error:new Nr("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,s,n;try{const a=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.captchaToken}},xform:ot}),{data:o,error:l}=a;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(a){if(L(a))return{data:{user:null,session:null},error:a};throw a}}async signUp(t){var r,s,n;try{let a;if("email"in t){const{email:h,password:d,options:f}=t;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await Hr(this.storage,this.storageKey)),a=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:h,password:d,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:p,code_challenge_method:w},xform:ot})}else if("phone"in t){const{phone:h,password:d,options:f}=t;a=await F(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:d,data:(s=f==null?void 0:f.data)!==null&&s!==void 0?s:{},channel:(n=f==null?void 0:f.channel)!==null&&n!==void 0?n:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:ot})}else throw new fi("You must provide either an email or phone number and a password");const{data:o,error:l}=a;if(l||!o)return{data:{user:null,session:null},error:l};const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(a){if(L(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithPassword(t){try{let r;if("email"in t){const{email:a,password:o,options:l}=t;r=await F(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:od})}else if("phone"in t){const{phone:a,password:o,options:l}=t;r=await F(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:od})}else throw new fi("You must provide either an email or phone number and a password");const{data:s,error:n}=r;return n?{data:{user:null,session:null},error:n}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new Vr}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:n})}catch(r){if(L(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(t){var r,s,n,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(n=t.options)===null||n===void 0?void 0:n.queryParams,skipBrowserRedirect:(a=t.o
105ptions)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,s,n,a,o,l,c,u,h,d,f;let p,w;if("message"in t)p=t.message,w=t.signature;else{const{chain:b,wallet:x,statement:m,options:g}=t;let y;if(We())if(typeof x=="object")y=x;else{const O=window;if("ethereum"in O&&typeof O.ethereum=="object"&&"request"in O.ethereum&&typeof O.ethereum.request=="function")y=O.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(g!=null&&g.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=x}const j=new URL((r=g==null?void 0:g.url)!==null&&r!==void 0?r:window.location.href),N=await y.request({method:"eth_requestAccounts"}).then(O=>O).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!N||N.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=fp(N[0]);let _=(s=g==null?void 0:g.signInWithEthereum)===null||s===void 0?void 0:s.chainId;if(!_){const O=await y.request({method:"eth_chainId"});_=jv(O)}const E={domain:j.host,address:k,statement:m,uri:j.href,version:"1",chainId:_,nonce:(n=g==null?void 0:g.signInWithEthereum)===null||n===void 0?void 0:n.nonce,issuedAt:(o=(a=g==null?void 0:g.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=g==null?void 0:g.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=g==null?void 0:g.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=g==null?void 0:g.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(h=g==null?void 0:g.signInWithEthereum)===null||h===void 0?void 0:h.resources};p=Nv(E),w=await y.request({method:"personal_sign",params:[_v(p),k]})}try{const{data:b,error:x}=await F(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:w},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:ot});if(x)throw x;return!b||!b.session||!b.user?{data:{user:null,session:null},error:new Vr}:(b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),{data:Object.assign({},b),error:x})}catch(b){if(L(b))return{data:{user:null,session:null},error:b};throw b}}async signInWithSolana(t){var r,s,n,a,o,l,c,u,h,d,f,p;let w,b;if("message"in t)w=t.message,b=t.signature;else{const{chain:x,wallet:m,statement:g,options:y}=t;let j;if(We())if(typeof m=="object")j=m;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))j=k.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 m!="object"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=m}const N=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in j&&j.signIn){const k=await j.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y==null?void 0:y.signInWithSolana),{version:"1",domain:N.host,uri:N.href}),g?{statement:g}:null));let _;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")_=k[0];
105else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)_=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)w=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),b=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in j)||typeof j.signMessage!="function"||!("publicKey"in j)||typeof j!="object"||!j.publicKey||!("toBase58"in j.publicKey)||typeof j.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${N.host} wants you to sign in with your Solana account:`,j.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${N.href}`,`Issued At: ${(n=(s=y==null?void 0:y.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&n!==void 0?n:new Date().toISOString()}`,...!((a=y==null?void 0:y.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((l=y==null?void 0:y.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((c=y==null?void 0:y.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y==null?void 0:y.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((d=(h=y==null?void 0:y.signInWithSolana)===null||h===void 0?void 0:h.resources)===null||d===void 0)&&d.length?["Resources",...y.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(`
106`);const k=await j.signMessage(new TextEncoder().encode(w),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");b=k}}try{const{data:x,error:m}=await F(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:Cr(b)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:ot});if(m)throw m;return!x||!x.session||!x.user?{data:{user:null,session:null},error:new Vr}:(x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),{data:Object.assign({},x),error:m})}catch(x){if(L(x))return{data:{user:null,session:null},error:x};throw x}}async _exchangeCodeForSession(t){const r=await yr(this.storage,`${this.storageKey}-code-verifier`),[s,n]=(r??"").split("/");try{const{data:a,error:o}=await F(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:s},xform:ot});if(await Dt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!a||!a.session||!a.user?{data:{user:null,session:null,redirectType:null},error:new Vr}:(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:Object.assign(Object.assign({},a),{redirectType:n??null}),error:o})}catch(a){if(L(a))return{data:{user:null,session:null,redirectType:null},error:a};throw a}}async signInWithIdToken(t){try{const{options:r,provider:s,token:n,access_token:a,nonce:o}=t,l=await F(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:n,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:ot}),{data:c,error:u}=l;return u?{data:{user:null,session:null},error:u}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new Vr}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:u})}catch(r){if(L(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(t){var r,s,n,a,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,h=null;this.flowType==="pkce"&&([u,h]=await Hr(this.storage,this.storageKey));const{error:d}=await F(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:h},redirectTo:c==null?void 0:c.emailRedirectTo});return{data:{user:null,session:null},error:d}}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:h}=await F(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(a=c==null?void 0:c.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:h}}throw new fi("You must provide either an email or phone number.")}catch(l){if(L(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(t){var r,s;try{let n,a;"options"in t&&(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo,a=(s=t.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:l}=await F(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:n,xform:ot});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:u,session:c},error:null}}catch(n){if(L(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithSSO(t){var r,s,n;try{let a=null,o=null;return this.flowType==="pkce"&&([a,o]=await Hr(this.storage,this.storageKey)),await F(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:(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&s!==void 0?s:void 0}),!((n=t==null?void 0:t.options)===null||n===void 0)&&n.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:o}),headers:this.headers,xform:pv})}catch(a){if(L(a))return{data:null,error:a};throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:s}=t;if(s)throw s;if(!r)throw new Ft;const{error:n}=await F(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:n}})}catch(t){if(L(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:s,type:n,options:a}=t,{error:o}=await F(this.fetch,"POST",r,{headers:this.headers,body:{email:s,type:n,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:s,type:n,options:a}=t,{data:o,error:l}=await F(this.fetch,"POST",r,{headers:this.headers,body:{phone:s,type:n,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l}}throw new fi("You must provide either an email or phone number and a type")}catch(r){if(L(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await s,await r()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=r();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const n=[...this.pendingInLock];await Promise.all(n),this.pendingInLock.splice(0,n.length)}return await s}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 r=await this.__loadSession();return await t(r)}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 r=await yr(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
106id"),await this._removeSession())),!t)return{data:{session:null},error:null};const s=t.expires_at?t.expires_at*1e3-Date.now()<oo:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",t.expires_at),!s){if(this.userStorage){const o=await yr(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=uo()}if(this.storage.isServer&&t.user){let o=this.suppressGetSessionWarning;t=new Proxy(t,{get:(c,u,h)=>(!o&&u==="user"&&(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."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,u,h))})}return{data:{session:t},error:null}}const{data:n,error:a}=await this._callRefreshToken(t.refresh_token);return a?{data:{session:null},error:a}:{data:{session:n},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await F(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ht}):await this._useSession(async r=>{var s,n,a;const{data:o,error:l}=r;if(l)throw l;return!(!((s=o.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ft}:await F(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&a!==void 0?a:void 0,xform:Ht})})}catch(r){if(L(r))return zy(r)&&(await this._removeSession(),await Dt(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async s=>{const{data:n,error:a}=s;
106if(a)throw a;if(!n.session)throw new Ft;const o=n.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Hr(this.storage,this.storageKey));const{data:u,error:h}=await F(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:Ht});if(h)throw h;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(s){if(L(s))return{data:{user:null},error:s};throw s}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ft;const r=Date.now()/1e3;let s=r,n=!0,a=null;const{payload:o}=co(t.access_token);if(o.exp&&(s=o.exp,n=s<=r),n){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return{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)throw c;a={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:s-r,expires_at:s},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return{data:{user:a.user,session:a},error:null}}catch(r){if(L(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var s;if(!t){const{data:o,error:l}=r;if(l)throw l;t=(s=o.session)!==null&&s!==void 0?s:void 0}if(!(t!=null&&t.refresh_token))throw new Ft;const{data:n,error:a}=await this._callRefreshToken(t.refresh_token);return a?{data:{user:null,session:null},error:a}:n?{data:{user:n.user,session:n},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(L(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(t,r){try{if(!We())throw new pi("No browser detected.");if(t.error||t.error_description||t.error_code)throw new pi(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new ed("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new pi("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new ed("No code detected.");const{data:g,error:y}=await this._exchangeCodeForSession(t.code);if(y)throw y;const j=new URL(window.location.href);return j.searchParams.delete("code"),window.history.replaceState(window.history.state,"",j.toString()),{data:{session:g.session,redirectType:null},error:null}}const{provider_token:s,provider_refresh_token:n,access_token:a,refresh_token:o,expires_in:l,expires_at:c,token_type:u}=t;if(!a||!l||!o||!u)throw new pi("No session defined in URL");const h=Math.round(Date.now()/1e3),d=parseInt(l);let f=h+d;c&&(f=parseInt(c));const p=f-h;p*1e3<=Qr&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);const w=f-d;h-w>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",w,f,h):h-w<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",w,f,h);const{data:b,error:x}=await this._getUser(a);if(x)throw x;const m={provider_token:s,provider_refresh_token:n,access_token:a,expires_in:d,expires_at:f,refresh_token:o,token_type:u,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:m,redirectType:t.type},error:null}}catch(s){if(L(s))return{data:{session:null,redirectType:null},error:s};throw s}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await yr(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var s;const{data:n,error:a}=r;if(a)return{error:a};const o=(s=n.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(By(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return t!=="others"&&(await this._removeSession(),await Dt(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const r=Qy(),s={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,s),(
106async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:s}}}async _emitInitialSession(t){return await this._useSession(async r=>{var s,n;try{const{data:{session:a},error:o}=r;if(o)throw o;await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),console.error(a)}})}async resetPasswordForEmail(t,r={}){let s=null,n=null;this.flowType==="pkce"&&([s,n]=await Hr(this.storage,this.storageKey,!0));try{return await F(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:s,code_challenge_method:n,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(L(a))return{data:null,error:a};throw a}}async getUserIdentities(){var t;try{const{data:r,error:s}=await this.getUser();if(s)throw s;return{data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(r){if(L(r))return{data:null,error:r};throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:s,error:n}=await this._useSession(async a=>{var o,l,c,u,h;const{data:d,error:f}=a;if(f)throw f;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await F(this.fetch,"GET",p,{headers:this.headers,jwt:(h=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&h!==void 0?h:void 0})});if(n)throw n;return We()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),{data:{provider:t.provider,url:s==null?void 0:s.url},error:null}}catch(s){if(L(s))return{data:{provider:t.provider,url:null},error:s};throw s}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var s;try{const{error:n,data:{session:a}}=r;if(n)throw n;const{options:o,provider:l,token:c,access_token:u,nonce:h}=t,d=await F(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(s=a==null?void 0:a.access_token)!==null&&s!==void 0?s:void 0,body:{provider:l,id_token:c,access_token:u,nonce:h,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:ot}),{data:f,error:p}=d;return p?{data:{user:null,session:null},error:p}:!f||!f.session||!f.user?{data:{user:null,session:null},error:new Vr}:(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),{data:f,error:p})}catch(n){if(L(n))return{data:{user:null,session:null},error:n};throw n}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var s,n;const{data:a,error:o}=r;if(o)throw o;return await F(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(n=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&n!==void 0?n:void 0})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const s=Date.now();return await ev(async n=>(n>0&&await Xy(200*Math.pow(2,n-1)),this._debug(r,"refreshing attempt",n),await F(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:ot})),(n,a)=>{const o=200*Math.pow(2,n);return a&&lo(a)&&Date.now()+o-s<Qr})}catch(s){if(this._debug(r,"error",s),L(s))return{data:{session:null,user:null},error:s};throw s}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const s=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",s),We()&&!r.skipBrowserRedirect&&window.location.assign(s),{data:{provider:t,url:s},error:null}}async _recoverAndRefresh(){var t,r;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const n=await yr(this.storage,this.storageKey);if(n&&this.userStorage){let o=await yr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:n.user},await Zr(this.userStorage,this.storageKey+"-user",o)),n.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:uo()}else if(n&&!n.user&&!n.user){const o=await yr(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(n.user=o.user,await Dt(this.storage,this.storageKey+"-user"),await Zr(this.storage,this.storageKey,n)):n.user=uo()}if(this._debug(s,"session from storage",n),!this._isValidSession(n)){this._debug(s,"session is not val
106id"),n!==null&&await this._removeSession();return}const a=((r=n.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<oo;if(this._debug(s,`session has${a?"":" not"} expired with margin of ${oo}s`),a){if(this.autoRefreshToken&&n.refresh_token){const{error:o}=await this._callRefreshToken(n.refresh_token);o&&(console.error(o),lo(o)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(n.user&&n.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(n.access_token);!l&&(o!=null&&o.user)?(n.user=o.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(s,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(s,"error",n),console.error(n);return}finally{this._debug(s,"end")}}async _callRefreshToken(t){var r,s;if(!t)throw new Ft;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const n=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new Ca;const{data:a,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!a.session)throw new Ft;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(n,"error",a),L(a)){const o={data:null,error:a};return lo(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(a),a}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(t,r,s=!0){const n=`#_notifyAllSubscribers(${t})`;this._debug(n,"begin",r,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:t,session:r});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){a.push(c)}});if(await Promise.all(o),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(n,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const r=Object.assign({},t),s=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&r.user&&await Zr(this.userStorage,this.storageKey+"-user",{user:r.user});const n=Object.assign({},r);delete n.user;const a=id(n);await Zr(this.storage,this.storageKey,a)}else{const n=id(r);await Zr(this.storage,this.storageKey,n)}}async _removeSession(){this._debug("#_removeSession()"),await Dt(this.storage,this.storageKey),await Dt(this.storage,this.storageKey+"-code-verifier"),await Dt(this.storage,this.storageKey+"-user"),this.userStorage&&await Dt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&We()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Qr);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}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 r=>{const{data:{session:s}}=r;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const n=Math.floor((s.expires_at*1e3-t)/Qr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${Qr}ms, refresh threshold is ${xl} ticks`),n<=xl&&await this._callRefreshToken(s.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof hp)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!We()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>
106{if(document.visibilityState!=="visible"){this._debug(r,"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,r,s){const n=[`provider=${encodeURIComponent(r)}`];if(s!=null&&s.redirectTo&&n.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s!=null&&s.scopes&&n.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[a,o]=await Hr(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});n.push(l.toString())}if(s!=null&&s.queryParams){const a=new URLSearchParams(s.queryParams);n.push(a.toString())}return s!=null&&s.skipBrowserRedirect&&n.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${t}?${n.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var s;const{data:n,error:a}=r;return a?{data:null,error:a}:await F(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(s=n==null?void 0:n.session)===null||s===void 0?void 0:s.access_token})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _enroll(t){try{return await this._useSession(async r=>{var s,n;const{data:a,error:o}=r;if(o)return{data:null,error:o};const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await F(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(s=a==null?void 0:a.session)===null||s===void 0?void 0:s.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&c.type==="totp"&&(!((n=c==null?void 0:c.totp)===null||n===void 0)&&n.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(r){if(L(r))return{data:null,error:r};throw r}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var s;const{data:n,error:a}=r;if(a)return{data:null,error:a};const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Iv(t.webauthn.credential_response):Ov(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await F(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(s=n==null?void 0:n.session)===null||s===void 0?void 0:s.access_token});return c?{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),{data:l,error:c})})}catch(r){if(L(r))return{data:null,error:r};throw r}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var s;const{data:n,error:a}=r;if(a)return{data:null,error:a};const o=await F(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=n==null?void 0:n.session)===null||s===void 0?void 0:s.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:Tv(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:Pv(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(L(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(t){const{data:r,error:s}=await this._challenge({factorId:t.factorId});return s?{data:null,error:s}:await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:s}=await this.getUser();if(s)return{data:null,error:s};const n={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])n.all.push(a),a.status==="verified"&&n[a.factor_type].push(a);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var r,s;const{data:{session:n},error:a}=t;if(a)return{data:null,error:a};if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=co(n.access_token);let l=null;o.aal&&(l=o.aal);let c=l;((s=(r=n.user.factors)===null||r===void 0?void 0:r.filter(d=>d.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(c="aal2");const h=o.amr||[];return{data:{currentLevel:l,nextLevel:c,currentAuthenticationMethods:h},error:null}}))}async fetchJwk(t,r={keys:[]}){let s=r.keys.find(l=>l.kid===t);if(s)return s;const n=Date.now();if(s=this.jwks.keys.find(l=>l.kid===t),s&&this.jwks_cached_at+Fy>n)return s;const{data:a,error:o}=await F(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=n,s=a.keys.find(l=>l.kid===t),!s)?null:s}async getClaims(t,r={}){try{let s=t;if(!s){const{data:p,error:w}
106=await this.getSession();if(w||!p.session)return{data:null,error:w};s=p.session.access_token}const{header:n,payload:a,signature:o,raw:{header:l,payload:c}}=co(s);r!=null&&r.allowExpired||ov(a.exp);const u=!n.alg||n.alg.startsWith("HS")||!n.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(n.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:p}=await this.getUser(s);if(p)throw p;return{data:{claims:a,header:n,signature:o},error:null}}const h=lv(n.alg),d=await crypto.subtle.importKey("jwk",u,h,!0,["verify"]);if(!await crypto.subtle.verify(h,d,o,Jy(`${l}.${c}`)))throw new wl("Invalid JWT signature");return{data:{claims:a,header:n,signature:o},error:null}}catch(s){if(L(s))return{data:null,error:s};throw s}}}Dn.nextInstanceID=0;const Bv=Dn;class zv extends Bv{constructor(t){super(t)}}var Wv=function(e,t,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(h){try{u(s.next(h))}catch(d){o(d)}}function c(h){try{u(s.throw(h))}catch(d){o(d)}}function u(h){h.done?a(h.value):n(h.value).then(l,c)}u((s=s.apply(e,t||[])).next())})};class Vv{constructor(t,r,s){var n,a,o;this.supabaseUrl=t,this.supabaseKey=r;const l=Ry(t);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);const c=`sb-${l.hostname.split(".")[0]}-auth-token`,u={db:Ny,realtime:Sy,auth:Object.assign(Object.assign({},ky),{storageKey:c}),global:_y},h=Ay(s??{},u);this.storageKey=(n=h.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(a=h.global.headers)!==null&&a!==void 0?a:{},h.accessToken?(this.accessToken=h.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`)}})):this.auth=this._initSupabaseAuthClient((o=h.auth)!==null&&o!==void 0?o:{},this.headers,h.global.fetch),this.fetch=Py(r,this._getAccessToken.bind(this),h.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},h.realtime)),this.rest=new Mx(new URL("rest/v1",l).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch}),this.storage=new wy(this.storageUrl.href,this.headers,this.fetch,s==null?void 0:s.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new yx(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,r={},s={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,r,s)}channel(t,r={config:{}}){return this.realtime.channel(t,r)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){return Wv(this,void 0,void 0,function*(){var t,r;if(this.accessToken)return yield this.accessToken();const{data:s}=yield this.auth.getSession();return(r=(t=s.session)===null||t===void 0?void 0:t.access_token)!==null&&r!==void 0?r:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:r,detectSessionInUrl:s,storage:n,userStorage:a,storageKey:o,flowType:l,lock:c,debug:u},h,d){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new zv({url:this.authUrl.href,headers:Object.assign(Object.assign({},f),h),storageKey:o,autoRefreshToken:t,persistSession:r,detectSessionInUrl:s,storage:n,userStorage:a,flowType:l,lock:c,debug:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new sy(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,s)=>{this._handleTokenChanged(r,"CLIENT",s==null?void 0:s.access_token)})}_handleTokenChanged(t,r,s){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==s?(this.changedAccessToken=s,this.realtime.setAuth(s)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const Hv=(e,t,r)=>new Vv(e,t,r);function qv(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}qv()&&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 N
106ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Kv="https://vznmuiyyvhtiwakkmlfj.supabase.co",Jv="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ6bm11aXl5dmh0aXdha2ttbGZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgzNDQ4MTUsImV4cCI6MjA2MzkyMDgxNX0._ngJCzpYMyVpVqCABWBzHEqdwFw-FhKPyb20z4Q4uu0",Ce=Hv(Kv,Jv,{auth:{autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0}}),gp="safevibe_utm_params",Gv=e=>{const t={},r=e.get("utm_source"),s=e.get("utm_medium"),n=e.get("utm_campaign"),a=e.get("utm_term"),o=e.get("utm_content");return r&&(t.utm_source=r),s&&(t.utm_medium=s),n&&(t.utm_campaign=n),a&&(t.utm_term=a),o&&(t.utm_content=o),t},hd=e=>e.has("utm_source")||e.has("utm_medium")||e.has("utm_campaign")||e.has("utm_term")||e.has("utm_content"),Qv=e=>{try{Object.keys(e).length>0&&(localStorage.setItem(gp,JSON.stringify(e)),console.log("UTM parameters stored:",e))}catch(t){console.warn("Failed to store UTM parameters:",t)}},xp=()=>{try{const e=localStorage.getItem(gp);if(e)return JSON.parse(e)}catch(e){console.warn("Failed to retrieve UTM parameters:",e)}return{}},Mr=async e=>{try{const{data:{session:t}}=await Ce.auth.getSession();if(!(t!=null&&t.access_token))return console.warn("No active session, skipping interaction tracking"),!1;const r=xp(),s={...e,utm_source:e.utm_source||r.utm_source,utm_medium:e.utm_medium||r.utm_medium,utm_campaign:e.utm_campaign||r.utm_campaign,utm_term:e.utm_term||r.utm_term,utm_content:e.utm_content||r.utm_content},a=await fetch("https://vznmuiyyvhtiwakkmlfj.supabase.co/functions/v1/track-interaction",{method:"POST",headers:{Authorization:`Bearer ${t.access_token}`,"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok){const l=await a.text();throw new Error(`HTTP ${a.status}: ${l}`)}const o=await a.json();if(!o.success)throw new Error(o.error||"Failed to track interaction");return console.log("Interaction tracked:",e.event_type),!0}catch(t){return console.warn("Failed to track interaction:",t),!1}},it={MONITOR_COMING_SOON_CLICK:"monitor_coming_soon_click",SIGNUP_BUTTON_CLICK:"signup_button_click",SCAN_INITIATED:"scan_initiated",SCAN_BUTTON_CLICK_HOMEPAGE:"scan_button_click_homepage",PLATFORM_SUPPORT_REQUEST:"platform_support_request",TALK_TO_EXPERT_CLICK:"talk_to_expert_click",IDE_INTEGRATION_BANNER_CLOSE:"ide_integration_banner_close",SIGNUP_COMPLETED:"signup_completed",ABOUT_MOBB_CLICK:"about_mobb_click",SIGNIN_BUTTON_CLICK_HOMEPAGE:"signin_button_click_homepage",SIGNIN_BUTTON_CLICK_SIGNIN_PAGE:"signin_button_click_signin_page",FAQ_CLICK:"faq_click"},Zv=e=>Mr({event_type:it.MONITOR_COMING_SOON_CLICK,context_data:{app_url:e,timestamp:Date.now()}}),Yv=e=>Mr({event_type:it.SIGNUP_BUTTON_CLICK,context_data:{source:e,timestamp:Date.now()}}),Xv=(e,t)=>Mr({event_type:it.SCAN_INITIATED,context_data:{scanned_url:e,platform:t,timestamp:Date.now()}}),e1=(e,t,r,s)=>Mr({event_type:it.PLATFORM_SUPPORT_REQUEST,context_data:{url:e,platform_type:t,notes:r||null,user_email:s||null,timestamp:Date.now()}}),t1=(e,t="scan_modal")=>{const r=s=>{try{return new URL(s.startsWith("http")?s:`https://${s}`).hostname}catch{return s}};return Mr({event_type:it.TALK_TO_EXPERT_CLICK,context_data:{app_hostname:r(e),location:t,timestamp:Date.now()}})},r1=(e="homepage",t)=>Mr({event_type:it.IDE_INTEGRATION_BANNER_CLOSE,context_data:{source:e,time_visible_seconds:t?Math.round(t/1e3):null,timestamp:Date.now()}}),s1=(e="google",t="signin_page")=>Mr({event_type:it.SIGNUP_COMPLETED,context_data:{provider:e,source:t,timestamp:Date.now()}}),Kn=async e=>{try{const t=xp(),r={...e,utm_source:e.utm_source||t.utm_source,utm_medium:e.utm_medium||t.utm_medium,utm_campaign:e.utm_campaign||t.utm_campaign,utm_term:e.utm_term||t.utm_term,utm_content:e.utm_content||t.utm_content},n=await fetch("https://vznmuiyyvhtiwakkmlfj.supabase.co/functions/v1/track-anonymous-interaction",{method:"POST",headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ6bm11aXl5dmh0aXdha2ttbGZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgzNDQ4MTUsImV4cCI6MjA2MzkyMDgxNX0._ngJCzpYMyVpVqCABWBzHEqdwFw-FhKPyb20z4Q4uu0","Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok){const o=await n.text();throw new Error(`HTTP ${n.status}: ${o}`)}const a=await n.json();if(!a.success)throw new Error(a.error||"Failed to track anonymous interaction");return console.log("Anonymous interaction tracked:",e.event_type),!0}catch(t){return console.warn("Failed to track anonymous interaction:",t),!1}},n1=(e,t="homepage")=>{const r=s=>{try{return new URL(s.startsWith("http")?s:`https://${s}`).hostname}catch{return s}};return Kn({event_type:it.SCAN_BUTTON_CLICK_HOMEPAGE,context_data:{app_hostname:r(e),raw_url:e,source:t,timestamp:Date.now()}})},i1=(e="homepage")=>Kn({event_type:it.ABOUT_MOBB_CLICK,context_data:{source:e,timestamp:Date.now()}}),yp=(e="homepage")=>{const t=e==="homepage"?it.SIGNIN_BUTTON_CLICK_HOMEPAGE:it.SIGNIN_BUTTON_CLICK_SIGNIN_PAGE;return Kn({event_type:t,context_data:{source:e,timestamp:Date.now()}})},a1=(e,t="homepage")=>Kn({event_type:it.FAQ_CLICK,context_data:{question_id:e||null,source:t,timestamp:Date.now()}}),o1=async()=>{try{const{data:e,error:t}=await Ce.from("homepage_stats").select("*").order("updated_at",{ascending:!1}).limit(1).maybeSingle();return t?(console.error("Error fetching homepage stats:",t),null):e||{id:"",apps_scanned:0,exposed_databases:0,records_at_risk:0,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}catch(e){return console.error("Failed to fetch homepage stats:",e),null}},l1=()=>{const[e,t]=S.useState(null),[r,s]=S.useState(!0),[n,a]=S.useState(null),o=async()=>{try{s(!0),a(null);const c=await o1();c?t(c):(t({id:"fallback",apps_scanned:1247,exposed_databases:18922,records_at_risk:2847392,updated_at:new Date().toISOString(),created_at:new Date().toISOString()}),a("Using fallback statistics"))}catch(c){console.error("Error loading homepage stats:",c),a(c instanceof Error?c.message:"Failed to load statistics"),t({id:"fallback",apps_scanned:1247,exposed_databases:18922,records_at_risk:2847392,updated_at:new Date().toISOString(),created_at:new Date().toISOString()})}finally{s(!1)}};return S.useEffect(()=>{o()},[]),{stats:e,loading:r,error:n,refetch:async()=>{await o()}}},c1=(e={})=>{const{threshold:t=.1,rootMargin:r="0px 0px -50px 0px",triggerOnce:s=!0}=e,[n,a]=S.useState(!1),o=S.useRef(null);return S.useEffect(()=>{const l=new IntersectionObserver(([u])=>{u.isIntersecting?(a(!0),s&&l.unobserve(u.target)):s||a(!1)},{threshold:t,rootMargin:r}),c=o.current;return c&&l.observe(c),()=>{c&&l.unobserve(c)}},[t,r,s]),{ref:o,isVisible:n}},fd={fadeInUp:{hidden:"opacity-0 translate-y-8 scale-95",visible:"opacity-100 translate-y-0 scale-100"},fadeInDown:{hidden:"opacity-0 -translate-y-8 scale-95",visible:"opacity-100 translate-y-0 scale-100"},fadeInLeft:{hidden:"opacity-0 -translate-x-8 scale-95",visible:"opacity-100 translate-x-0 scale-100"},fadeInRight:{hidden:"opacity-0 translate-x-8 scale-95",visible:"opacity-100 translate-x-0 scale-100"},scaleIn:{hidden:"opacity-0 scale-90",visible:"opacity-100 scale-100"},slideInUp:{hidden:"opacity-0 translate-y-12",visible:"opacity-100 translate-y-0"}},u1=({delay:e=2e3,onClose:t,onLinkClick:r,onShow:s})=>{const[n,a]=S.useState(!1),[o,l]=S.useState(!1);S.useEffect(()=>{const h=setTimeout(()=>{a(!0),s==null||s()},e);return()=>clearTimeout(h)},[e,s]);const c=()=>
106{l(!0),setTimeout(()=>{a(!1),t==null||t()},300)},u=()=>{r==null||r(),window.open("https://vibe.mobb.ai","_blank","noopener,noreferrer")};return n?i.jsxs("div",{className:`fixed bottom-4 right-4 z-50 w-80 max-w-[calc(100vw-2rem)] transition-all duration-300 ease-in-out transform ${o?"translate-y-4 opacity-0 scale-95":"translate-y-0 opacity-100 scale-100"}`,style:{animation:o?"slideOut 0.3s ease-in-out forwards":"slideIn 0.3s ease-in-out forwards"},children:[i.jsxs("div",{className:"bg-gradient-to-r from-primary-500/95 to-primary-600/95 backdrop-blur-sm border border-primary-400/30 rounded-xl p-3 shadow-2xl hover:shadow-3xl transition-shadow duration-300 relative",children:[i.jsx("button",{onClick:c,className:"absolute top-2 right-2 p-1.5 text-white/70 hover:text-white hover:bg-white/20 rounded-full transition-all duration-200 hover:scale-110","aria-label":"Close banner",children:i.jsx(Ln,{className:"w-3.5 h-3.5"})}),i.jsxs("div",{className:"pr-6",children:[i.jsxs("p",{className:"text-white font-semibold text-sm sm:text-base mb-3 leading-relaxed",children:["Vibing through your IDE?",i.jsx("br",{}),"Try our IDE scan & fix integration"]}),i.jsxs("button",{onClick:u,className:"inline-flex items-center space-x-2 bg-white/20 hover:bg-white/30 text-white px-4 py-2 rounded-lg text-sm font-semibold transition-all duration-200 backdrop-blur-sm border border-white/30 hover:border-white/40 hover:scale-105 shadow-lg",children:[i.jsx("span",{children:"See how it works"}),i.jsx(qe,{className:"w-3.5 h-3.5"})]})]})]}),i.jsx("style",{jsx:!0,children:`
107        @keyframes slideIn {
108          from {
109            transform: translateY(20px) translateX(20px);
110            opacity: 0;
111            scale: 0.9;
112          }
113          to {
114            transform: translateY(0) translateX(0);
115            opacity: 1;
116            scale: 1;
117          }
118        }
119
120        @keyframes slideOut {
121          from {
122            transform: translateY(0) translateX(0);
123            opacity: 1;
124            scale: 1;
125          }
126          to {
127            transform: translateY(20px) translateX(20px);
128            opacity: 0;
129            scale: 0.9;
130          }
131        }
132      `})]}):null},qt=e=>{try{if(!e||typeof e!="string")return e;const t=e.startsWith("http")?e:`https://${e}`;let s=new URL(t).hostname.toLowerCase();return s.startsWith("www.")&&(s=s.substring(4)),s}catch(t){return console.warn("Failed to normalize URL:",e,t),e}},gn=e=>{try{if(!e||typeof e!="string")return"Invalid URL";const t=e.startsWith("http")?e:`https://${e}`;return new URL(t).hostname}catch(t){return console.warn("Failed to parse URL:",e,t),e||"Invalid URL"}},bl=e=>{try{if(!e||typeof e!="string")return!1;const t=e.startsWith("http")?e:`https://${e}`;return new URL(t),!0}catch{return!1}},Ec="scan",vp=()=>new URLSearchParams(window.location.search).get(Ec),zt=e=>{const t=new URL(window.location.href);t.searchParams.set(Ec,e),window.history.pushState({},document.title,t.pathname+t.search)},ys=()=>{const e=new URL(window.location.href);e.searchParams.delete(Ec);const t=e.pathname+(e.search||"");window.history.pushState({},document.title,t)},d1=({className:e="w-8 h-8"})=>i.jsxs("svg",{className:e,viewBox:"0 0 149 152",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("mask",{id:"mask0_18_10",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"149",height:"152",children:i.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.6502 0C69.3099 0 89.3004 20.0433 89.3004 44.7679V61.7825H104.16C128.82 61.7825 148.81 81.8258 148.81 106.55C148.81 131.275 128.82 151.318 104.16 151.318H0V44.7679C0 20.0433 19.9906 0 44.6502 0Z",fill:"url(#paint0_linear_18_10)"})}),i.jsxs("g",{mask:"url(#mask0_18_10)",children:[i.jsx("g",{filter:"url(#filter0_f_18_10)",children:i.jsx("path",{d:"M65.2812 181.5C120.915 181.5 166.014 136.4 166.014 80.7667C166.014 25.1334 120.915 -19.9663 65.2812 -19.9663C9.6479 -19.9663 -35.4518 25.1334 -35.4518 80.7667C-35.4518 136.4 9.6479 181.5 65.2812 181.5Z",fill:"#4B73FF"})}),i.jsx("g",{filter:"url(#filter1_f_18_10)",children:i.jsx("path",{d:"M76.3487 123.221C147.6 123.221 205.361 78.1217 205.361 22.4884C205.361 -33.1449 147.6 -78.2446 76.3487 -78.2446C5.09734 -78.2446 -52.6633 -33.1449 -52.6633 22.4884C-52.6633 78.1217 5.09734 123.221 76.3487 123.221Z",fill:"#FF66F4"})}
132),i.jsx("g",{filter:"url(#filter2_f_18_10)",children:i.jsx("path",{d:"M97.3926 95.0049C153.026 95.0049 198.126 55.3976 198.126 6.53953C198.126 -42.3186 153.026 -81.9259 97.3926 -81.9259C41.7593 -81.9259 -3.34039 -42.3186 -3.34039 6.53953C-3.34039 55.3976 41.7593 95.0049 97.3926 95.0049Z",fill:"#FF0105"})}),i.jsx("g",{filter:"url(#filter3_f_18_10)",children:i.jsx("path",{d:"M78.1432 86.0486C111.601 86.0486 138.724 58.9257 138.724 25.4679C138.724 -7.98989 111.601 -35.1128 78.1432 -35.1128C44.6854 -35.1128 17.5625 -7.98989 17.5625 25.4679C17.5625 58.9257 44.6854 86.0486 78.1432 86.0486Z",fill:"#FE7B02"})})]}),i.jsxs("defs",{children:[i.jsxs("filter",{id:"filter0_f_18_10",x:"-80.5964",y:"-65.1109",width:"291.755",height:"291.755",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:"22.5723",result:"effect1_foregroundBlur_18_10"})]}),i.jsxs("filter",{id:"filter1_f_18_10",x:"-97.8079",y:"-123.389",width:"348.313",height:"291.755",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:"22.5723",result:"effect1_foregroundBlur_18_10"})]}),i.jsxs("filter",{id:"filter2_f_18_10",x:"-48.485",y:"-127.07",width:"291.755",height:"267.22",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:"22.5723",result:"effect1_foregroundBlur_18_10"})]}),i.jsxs("filter",{id:"filter3_f_18_10",x:"-27.5821",y:"-80.2574",width:"211.451",height:"211.451",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:"22.5723",result:"effect1_foregroundBlur_18_10"})]}),i.jsxs("linearGradient",{id:"paint0_linear_18_10",x1:"50.0774",y1:"26.5915",x2:"95.4144",y2:"151.261",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{offset:"0.025",stopColor:"#FF8E63"}),i.jsx("stop",{offset:"0.56",stopColor:"#FF7EB0"}),i.jsx("stop",{offset:"0.95",stopColor:"#4B73FF"})]})]})]}),h1=({className:e="w-8 h-8"})=>i.jsxs("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 51 21.9",fill:"white",children:[i.jsx("path",{d:"M24.1 19.3c-4.7 0-7-2.7-7-6.1s3.2-7.7 7.9-7.7 7 2.7 7 6.1-3.2 7.7-7.9 7.7Zm.2-4.3c1.6 0 2.7-1.5 2.7-3.1s-.8-2-2.2-2-2.7 1.5-2.7 3.1.8 2 2.2 2ZM37 19h-4.9l4-18.2H41l-4 18.1Z"}),i.jsx("path",{d:"M9.6 19.3c-1.5 0-3-.5-3.8-1.7L5.5 19 0 21.9.6 19 4.6.8h4.9L8.1 7.2c1.1-1.2 2.2-1.7 3.6-1.7 3 0 4.9 1.9 4.9 5.5s-2.3 8.3-7 8.3Zm1.9-7.3c0 1.7-1.2 3-2.8 3s-1.7-.3-2.2-.9l.8-3.3c.6-.6 1.2-.9 2-.9 1.2 0 2.2.9 2.2 2.2Z",style:{fillRule:"evenodd"}}),i.jsx("path",{d:"M46.1 19.3c-2.8 0-4.9-1-4.9-3.3s0-.7.1-1l1.1-4.9h-2.2l1-4.2h2.2l.8-3.6L49.7 0l-.6 2.3-.8 3.6H51l-1 4.2h-2.7l-.7 3.2v.6c0 .6.4 1.1 1.2 1.1s.6 0 .7-.1v3.9c-.5.4-1.4.5-2.3.5Z"})]}),f1=({className:e="w-8 h-8"})=>i.jsxs("svg",{className:e,viewBox:"0 0 23 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M10.701 8.40793H1.60592C0.710313 8.40793 0 7.69462 0 6.82955V1.57838C0 0.698131 0.725755 0 1.60592 0H9.09508C9.99069 0 10.701 0.713307 10.701 1.57838V8.40793Z",fill:"#fd5402"}),i.jsx("path",{d:"M20.4557 17.5668H10.7109V8.39453H20.4557C21.3987 8.39453 22.1763 9.17128 22.1763 10.1133V15.8481C22.1763 16.8066 21.3987 17.5668 20.4557 17.5668Z",fill:"#fd5402"}),i.jsx("path",{d:"M9.09508 25H1.60592C0.725755 25 0 24.288 0 23.4244V18.1676C0 17.3041 0.725755 16.592 1.60592 16.592H10.701V23.4244C10.701 24.288 9.97525 25 9.09508 25Z",fill:"#fd5402"})]}),p1=({className:e="w-8 h-8"})=>i.jsxs("svg",{className:e,fill:"white",viewBox:"0 0 40 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[i.jsx("path",{d:"M23.3919 0H32.9188C36.7819 0 39.9136 3.13165 39.9136 6.99475V16.0805H36.0006V6.99475C36.0006 6.90167 35.9969 6.80925 35.9898 6.71766L26.4628 16.079C26.4949 16.08 26.5272 16.0805 26.5595 16.0805H36.0006V19.7762H26.5595C22.6964 19.7762 19.4788 16.6139 19.4788 12.7508V3.68923H23.3919V12.7508C23.3919 12.9253 23.4054 13.0977 23.4316 13.2668L33.1682 3.6995C33.0861 3.6927 33.003 3.68923 32.9188 3.68923H23.3919V0Z"}),i.jsx("path",{d:"M13.7688 19.0956L0 3.68759H5.53933L13.6231 12.7337V3.68759H17.7535V17.5746C17.7535 19.6705 15.1654 20.6584 13.7688 19.0956Z"})]}),ve=({children:e,variant:t="fadeInUp",className:r="",delay:s=0})=>{const{ref:n,isVisible:a}=c1({threshold:.1,rootMargin:"0px 0px -50px 0px",triggerOnce:!0});return i.jsx("div",{ref:n,className:`transition-all duration-700 ease-out ${r} ${a?fd[t].visible:fd[t].hidden}`,style:{transitionDelay:`${s}ms`},children:e})},Gr=({question:e,answer:t})=>{const[r,s]=Re.useState(!1),n=()=>{const a=e.toLowerCase().replace(/[^a-z0-9]/g,"_").replace(/_+/g,"_").replace(/^_+|_+$/g,"");a1(a,"homepage"),s(!r)};return i.jsxs("div",{className:"border-b border-gray-700 last:border-b-0",children:[i.jsxs("button",{onClick:n,className:"w-full py-6 text-left flex items-center justify-between hover:text-white transition-colors",children:[i.jsx("h4",{className:"text-lg font-medium text-white pr-4",children:e}),r?i.jsx(tn,{className:"w-5 h-5 text-gray-400 flex-shrink-0"}):i.jsx(en,{className:"w-5 h-5 text-gray-400 flex-shrink-0"})]}),r&&i.jsx("div",{className:"pb-6",children:i.jsx("p",{className:"text-gray-400 leading-relaxed",children:t})})]})},m1=()=>{const e=Vn();Re.useEffect(()=>{window.scrollTo(0,0)},[]);const[t,r]=Re.useState(!0),[s,n]=Re.useState(null),[a,o]=S.useState(""),[l,c]=S.useState(null),[u,h]=S.useState(!1),{stats:d,loading:f,error:p}=l1(),w=async _=>{await Yv(_)},b=async _=>{if(_.preventDefault(),!a.trim()){c("Please enter a URL");return}if(!bl(a.trim())){c("Please enter a valid URL");return}c(null),h(!0);try{localStorage.setItem("pendingUrl",a.trim()),await n1(a.trim(),"homepage"),e("/signin")}catch(E){console.error("Error storing URL:",E),c("An error occurred. Please try again.")}finally{h(!1)}},x=_=>JSON.stringify(_,null,2),m=_=>{switch(_.toLowerCase()){case"uuid":return"text-purple-400";case"text":case"varchar":return"text-green-400";case"integer":case"bigint":case"numeric":return"text-blue-400";case"boolean":return"text-yellow-400";case"timestamp":case"timestamptz":return"text-orange-400";case"json":case"jsonb":return"text-pink-400";default:return"text-gray-400"}},g={url:"taskflow-pro.netlify.app",timestamp:Date.now()-36e5,tables:[{name:"user_profiles",isExposed:!0,recordCount:1247,endpoint:"https://xyzproject.supabase.co/rest/v1/user_profiles",columns:[{name:"id",type:"uuid",nullable:!1},{name:"email",type:"text",nullable:!1},{name:"full_name",type:"text",nullable:!1},{name:"phone_number",type:"text",nullable:!0},{name:"date_of_birth",type:"date",nullable:!0},{name:"social_security",type:"text",nullable:!0},{name:"created_at",type:"timestamptz",nullable:!1}],sampleRecord:{id:"a1b2c3d4-e5f6-7890-abcd-ef1234567890",email:"[email protected]",full_name:"Sarah Johnson",phone_number:"+1-555-0123",date_of_birth:"1985-03-15",social_security:"***-**-4567",created_at:"2024-01-15T10:30:00Z"},isPubliclyInsertable:!0,isPubliclyUpdatable:!0,isPubliclyDeletable:!1},{name:"app_settings",isExposed:!1,recordCount:45,endpoint:"https://xyzproject.supabase.co/rest/v1/app_settings",columns:[{name:"id",type:"uuid",nullable:!1},{name:"setting_key",type:"text",nullable:!1},{name:"setting_value",type:"text",nullable:!1},{name:"is_public",type:"boolean",nullable:!1},{name:"updated_at",type:"timestamptz",nullable:!1}],isPubliclyInsertable:!1,isPubliclyUpdatable:!1,isPubliclyDeletable:!1}]},y=g.tables.filter(_=>_.isExposed).reduce((_,E)=>_+E.recordCount,0),j=g.tables.some(_=>_.isPubliclyInsertable||_.isPubliclyUpdatable||_.isPubliclyDeletable),N=y>0||j?"Public Data Found":"No Public Data Detected",k=N==="No Public Data Detected"?"text-green-500":"text-red-500";return i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-gray-900 via-gray-900 to-gray-800 relative overflow-hidden",children:[i.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[i.jsxs("div",{className:"absolute inset-0 opacity-60",children:[i.jsx("div",{className:"absolute inset-0 animate-pulse",children:Array.from({length:50}).map((_,E)=>i.jsx("div",{className:"absolute w-1 h-1 bg-white rounded-full opacity-80 animate-bounce",style:{left:`${Math.random()*100}%`,top:`${Math.random()*100}%`,animationDelay:`${Math.random()*3}s`,animationDuration:`${2+Math.random()*2}s`}},`fast-${E}`))}),i.jsx("div",{className:"absolute inset-0",children:Array.from({length:30}).map((_,E)=>i.jsx("div",{className:"absolute w-0.5 h-12 bg-gradient-to-b from-blue-200 to-transparent opacity-40",style:{left:`${Math.random()*100}%`,top:`${Math.random()*100}%`,transform:"rotate(75deg)",animation:`starMove ${8+Math.random()*4}s linear infinite`,animationDelay:`${Math.random()*8}s`}},`medium-${E}`))}),i.jsx("div",{className:"absolute inset-0",children:Array.from({length:80}).map((_,E)=>i.jsx("div",{className:"absolute bg-white rounded-full opacity-20",style:{left:`${Math.random()*100}%`,top:`${Math.random()*100}%`,width:`${1+Math.random()*2}px`,height:`${1+Math.random()*2}
132px`,animation:`twinkle ${3+Math.random()*4}s ease-in-out infinite alternate`,animationDelay:`${Math.random()*5}s`}},`slow-${E}`))})]}),i.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl animate-pulse opacity-60"}),i.jsx("div",{className:"absolute top-3/4 right-1/4 w-80 h-80 bg-purple-500/5 rounded-full blur-3xl animate-pulse opacity-40",style:{animationDelay:"2s"}}),i.jsx("div",{className:"absolute top-1/2 left-1/2 w-64 h-64 bg-cyan-500/5 rounded-full blur-3xl animate-pulse opacity-30",style:{animationDelay:"4s"}})]}),i.jsx("style",{jsx:!0,children:`
133        @keyframes starMove {
134          from {
135            transform: translateY(-100vh) rotate(75deg);
136          }
137          to {
138            transform: translateY(100vh) rotate(75deg);
139          }
140        }
141
142        @keyframes twinkle {
143          from {
144            opacity: 0.2;
145            transform: scale(1);
146          }
147          to {
148            opacity: 0.8;
149            transform: scale(1.5);
150          }
151        }
152      `}),i.jsx("header",{className:"bg-gray-800/50 backdrop-blur-sm border-b border-gray-700",children:i.jsx("div",{className:"container mx-auto px-4 py-2 sm:py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"flex items-center space-x-3",children:i.jsxs("svg",{width:"116",height:"34",viewBox:"0 0 116 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-6 sm:h-8 md:h-10 w-auto",children:[i.jsxs("g",{clipPath:"url(#clip0_7513_5528)",children:[i.jsx("path",{d:"M62.0358 20.6564V31.218H57.8091V21.6756C57.8242 20.9561 57.7143 20.2393 57.4843 19.5573C57.3087 19.0375 56.9816 18.5821 56.545 18.2496C56.0705 17.9365 55.5091 17.7816 54.9412 17.807C54.3173 17.7881 53.7051 17.979 53.2025 18.349C52.6843 18.7685 52.309 19.3383 52.1284 19.9801C51.8645 20.8839 51.7431 21.8234 51.7686 22.7647V31.218H47.5375V21.6109C47.607 20.6101 47.3625 19.6126 46.8381 18.7574C46.6053 18.4432 46.2979 18.192 45.9438 18.0262C45.5897 17.8604 45.1999 17.7853 44.8095 17.8076C44.1685 17.7876 43.5386 17.9779 43.016 18.3496C42.4898 18.7676 42.1044 19.3369 41.9117 19.9806C41.6334 20.8818 41.5052 21.8225 41.5321 22.7653V31.2186H37.2695V14.4802H41.5363V16.7178C41.8608 16.146 42.2956 15.6444 42.8154 15.2418C43.3163 14.8617 43.8816 14.5751 44.4842 14.3956C45.0433 14.227 45.6241 14.1415 46.208 14.1419C47.0735 14.1353 47.9315 14.3026 48.7311 14.6339C49.567 14.9918 50.2879 15.5733 50.8146 16.3145C50.8945 16.4289 50.9594 16.5582 51.0344 16.6776C51.5899 15.8457 52.3551 15.175 53.2527 14.7333C54.1014 14.3353 55.0282 14.1315 55.9657 14.1366C57.1955 14.0822 58.4116 14.4143 59.443 15.0863C60.3122 15.6972 60.9924 16.5397 61.4065 17.5179C61.827 18.5103 62.0412 19.5779 62.0362 20.6557",fill:"white"}),i.jsx("path",{d:"M76.269 15.2597C74.9527 14.5013 73.4554 14.1137 71.9364 14.138C70.4008 14.1118 68.8865 14.4992 67.5522 15.2597C66.2842 15.9893 65.24 17.0521 64.533 18.3329C63.8129 19.7237 63.4385 21.2676 63.4414 22.8339C63.4444 24.4001 63.8246 25.9426 64.5499 27.3307C65.2559 28.621 66.2998 29.6947 67.5695 30.4369C68.8969 31.1988 70.406 31.5864 71.9362 31.5587C73.4573 31.5836 74.9561 31.1902 76.2688 30.4214C77.531 29.6749 78.5683 28.6015 79.2712 27.3146C79.9884 25.9265 80.3628 24.3868 80.3628 22.8244C80.3628 21.262 79.9884 19.7223 79.2712 18.3342C78.5669 17.0571 77.5293 15.995 76.2688 15.2613M75.6033 25.5143C75.3074 26.2206 74.8088 26.8232 74.1704 27.2461C73.5021 27.6655 72.7248 27.8781 71.936 27.8572C71.1309 27.8797 70.3367 27.6673 69.6502 27.2461C69.0019 26.8253 68.4917 26.223 68.1833 25.5143C67.5008 23.7854 67.5008 21.8618 68.1833 20.1329C68.4927 19.4337 69.0034 18.8425 69.6502 18.4348C70.3405 18.0243 71.1332 17.8182 71.936 17.8407C72.7225 17.8196 73.4983 18.0259 74.1704 18.4348C74.8072 18.8447 75.3063 19.4363 75.6033 20.1329C76.2628 21.8661 76.2628 23.7811 75.6033 25.5143Z",fill:"white"}),i.jsx("path",{d:"M97.2127 18.1502C96.6454 16.9347 95.7467 15.904 94.6198 15.1766C93.5405 14.4908 92.286 14.1316 91.0074 14.1422C90.1339 14.1388 89.2705 14.329 88.4794 14.6992C87.6699 15.0847 86.9718 15.6699 86.4508 16.3997C86.3559 16.5339 86.2758 16.6732 86.1959 16.8129V7.55371H81.9648V31.2181H86.1959V28.9107C86.2959 29.0749 86.3908 29.2439 86.5008 29.4027C87.0285 30.1301 87.7408 30.7034 88.5642 31.0635C89.3373 31.3898 90.1682 31.5571 91.0074 31.5555V31.5604C92.374 31.5901 93.7157 31.192 94.8449 30.4217C95.9476 29.6352 96.8051 28.5526 97.318 27.299C97.9028 25.8841 98.1919 24.3645 98.1674 22.8337C98.2159 21.2196 97.8893 19.6164 97.2131 18.15M93.426 25.4149C93.1226 26.0972 92.6324 26.6799 92.012 27.0955C91.3648 27.5054 90.6095 27.7116 89.8437 27.6872C89.0891 27.7062 88.3466 27.4946 87.7154 27.0805C87.0981 26.6568 86.6131 26.0672 86.3164 25.3798C85.6569 23.7466 85.6569 21.9212 86.3164 20.2879C86.6111 19.6046 87.0969 19.021 87.7154 18.6073C88.3488 18.1991 89.0905 17.9912 89.8437 18.0106C90.6096 17.9904 91.3643 18.1981 92.012 18.6073C92.6292 19.018 93.119 19.5933 93.426 20.2681C93.7894 21.0734 93.9653 21.9507 93.9406 22.8339C93.9609 23.7215 93.7852 24.6027 93.426 25.4147",fill:"white"}),i.jsx("path",{d:"M115.029 18.1502C114.462 16.9347 113.563 15.904 112.436 15.1766C111.355 14.4902 110.099 14.1309 108.819 14.1422C107.947 14.1394 107.085 14.3296 106.296 14.6992C105.486 15.0848 104.788 15.6699 104.267 16.3997C104.175 16.5341 104.09 16.6736 104.012 16.8175V7.55371H99.7812V31.2182H104.012V28.9107C104.112 29.0749 104.207 29.2439 104.317 29.4027C104.844 30.1312 105.556 30.7047 106.381 31.0635C107.152 31.3893 107.981 31.5566 108.819 31.5555V31.5604C110.187 31.5907 111.53 31.1926 112.661 30.4217C113.763 29.6353 114.621 28.5526 115.134 27.299C115.719 25.8841 116.008 24.3645 115.983 22.8337C116.032 21.2196 115.705 19.6164 115.029 18.15M111.242 25.4149C110.937 26.0962 110.447 26.6784 109.828 27.0955C109.181 27.5054 108.425 27.7116 107.66 27.6872C106.903 27.7056 106.159 27.494 105.526 27.0805C104.911 26.6542 104.427 26.0657 104.126 25.3804C103.472 23.7462 103.472 21.9227 104.126 20.2885C104.423 19.6063 104.908 19.0231 105.526 18.6079C106.161 18.2003 106.904 17.9925 107.659 18.0112C108.425 17.991 109.18 18.1987 109.827 18.6079C110.443 19.0201 110.933 19.5949 111.241 20.2687C111.581 21.084 111.756 21.9586 111.756 22.8419C111.756 23.7253 111.581 24.5999 111.241 25.4152",fill:"white"}),i.jsx("path",{d:"M16.8829 24.7842C10.4967 26.5461 8.23038 29.14 5.46875 30.3667C8.23697 32.2958 11.4753 33.4404 14.8409 33.6795C18.2065 33.9185 21.5741 33.243 24.5872 31.7246C21.7402 27.9835 18.8532 27.7141 16.8829 24.7842Z",fill:"white"}),i.jsx("path",{opacity:"0.6",d:"M22.3984 23.6654C21.2767 23.8229 20.2455 24.0025 19.2891 24.1999C19.1635 24.2261 19.038 24.2515 18.9132 24.2786C18.2552 24.423 17.6008 24.5823 16.95 24.7567L16.8516 24.7842C18.8219 27.7141 21.7093 27.9835 24.5559 31.7252C24.9588 31.5217 25.3531 31.3041 25.7386 31.0724V31.0289C24.6883 28.8077 23.2293 27.3801 22.399 23.665",fill:"white"}),i.jsx("path",{d:"M18.9065 13.6344C19.9572 13.5058 21.0181 13.4831 22.0734 13.5667C22.1159 14.4257 22.0734 15.6541 22.0734 15.6541C22.0734 15.6541 23.655 14.4119 24.3861 15.9961C24.8761 17.0588 24.2511 18.7274 22.2355 20.083C22.0757 20.2099 21.8252 20.3292 21.9624 20.5588C22.0995 20.7885 23.038 20.4738 23.8142 20.2121C26.7624 19.2188 31.5386 17.2072 31.4638 14.5562
152C31.4388 13.6816 30.8117 13.0015 29.9841 12.4817L29.9464 12.4603C24.7882 9.54595 16.4704 11.1435 16.4704 11.1435C16.4704 11.1435 18.9648 9.457 19.723 6.69596C20.3601 4.37732 19.6404 1.32522 19.4017 0.398512C19.3704 0.362498 19.3659 0.300311 19.3387 0.271973C13.6419 0.958395 14.2602 3.36166 7.53354 4.25413C6.30396 6.93664 6.18588 11.5135 6.17742 12.9918C5.62797 13.2028 -0.289075 15.0607 -0.014152 18.3565C0.224364 20.8034 4.84846 21.4775 6.38071 21.6365C6.55783 21.655 4.51962 19.8385 4.27854 18.1996C4.24666 18.0479 4.4224 17.9832 4.50387 18.0166C5.51186 20.1272 7.20587 21.8657 8.23314 21.4627C9.26042 21.0597 9.14903 18.1018 9.35488 17.1609C9.56072 16.2201 10.6197 15.8166 11.1064 16.9134C11.5255 17.8566 12.3367 19.7573 14.3637 19.7809C13.8687 19.0183 13.5428 18.1586 13.4079 17.2595C13.1717 15.0572 14.6292 14.2289 15.6446 14.0154C16.6601 13.8018 18.9065 13.6344 18.9065 13.6344Z",fill:"white"}),i.jsx("path",{opacity:"0.6",d:"M25.797 11.0321C25.797 11.0321 20.7604 1.93489 19.3274 0.271973C19.5667 1.19908 20.3507 4.37673 19.7117 6.69557C18.9513 9.457 16.4492 11.1435 16.4492 11.1435C16.4492 11.1435 21.2349 10.2271 25.8043 11.0487L25.797 11.0321Z",fill:"white"}),i.jsx("path",{opacity:"0.6",d:"M15.6439 14.0155C14.6255 14.2286 13.1643 15.0571 13.4004 17.2595C13.5361 18.159 13.8634 19.019 14.3602 19.7812C14.3883 19.7812 14.4161 19.7826 14.4448 19.7812C14.4861 19.7812 14.5267 19.778 14.5678 19.7761C14.6089 19.7741 14.6447 19.7731 14.6845 19.7696C14.7132 19.7674 14.7424 19.7633 14.7715 19.7605C15.0012 19.7359 15.2287 19.693 15.4516 19.6322C18.1227 18.9102 18.7578 15.5233 18.8936 13.9297C18.8957 13.9043 18.8975 13.8805 18.8993 13.8561C18.901 13.8317 18.9036 13.8041 18.9054 13.7799C18.9087 13.7319 18.9123 13.6772 18.915 13.6333C18.915 13.6333 16.6621 13.8012 15.6435 14.0143",fill:"white"})]}),i.jsx("defs",{children:i.jsx("clipPath",{id:"clip0_7513_5528",children:i.jsx("rect",{width:"116",height:"33.4552",fill:"white",transform:"translate(0 0.272461)"})})})]})}),i.jsxs("div",{className:"flex items-center space-x-3 sm:space-x-6",children:[i.jsx("a",{href:"https://www.mobb.ai/",target:"_blank",rel:"noopener noreferrer",className:"text-gray-300 hover:text-white transition-colors font-medium text-sm sm:text-base",onClick:()=>i1("header"),children:"About Mobb"}),i.jsxs(Ss,{to:"/signin",onClick:()=>{w("header"),yp("homepage")},className:"inline-flex items-center px-2 py-1.5 sm:px-4 sm:py-2 bg-white text-gray-900 font-medium rounded-xl hover:bg-gray-100 transition-all duration-200 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 text-sm sm:text-base",children:[i.jsx(lx,{className:"w-3 h-3 sm:w-4 sm:h-4 mr-1 sm:mr-2"}),"Sign In"]})]})]})})}),i.jsx("div",{className:"container mx-auto px-2 py-8",children:i.jsxs("div",{className:"max-w-8xl mx-auto",children:[i.jsxs("div",{className:"text-center mb-8 animate-fade-in",children:[i.jsx("div",{className:"flex justify-center mb-4",children:i.jsx("img",{src:"/SafeVibes.svg",alt:"SafeVibes",className:"h-16 sm:h-20 md:h-24 lg:h-28 w-auto max-w-full"})}),i.jsx("div",{className:"mb-6"}),i.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-gray-200 mb-6 leading-tight",children:"Find, Fix & Monitor Data Exposure in Your Vibe Apps"}),i.jsx("h2",{className:"text-xl text-gray-400 mb-6 max-w-3xl mx-auto leading-relaxed",children:"Enter a URL to review exposed data:"}),i.jsx("div",{className:"max-w-3xl mx-auto mb-16",children:i.jsxs("form",{onSubmit:b,className:"space-y-4",children:[i.jsxs("div",{className:"hidden sm:flex items-center gap-4",children:[i.jsx("input",{type:"text",value:a,onChange:_=>o(_.target.value),placeholder:"my-app.lovable.app",className:"flex-1 px-6 py-4 bg-gray-800/50 backdrop-blur-sm border border-gray-700 text-white rounded-2xl focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent placeholder-gray-400 text-lg",disabled:u}),i.jsx("button",{type:"submit",disabled:u,className:"inline-flex items-center px-6 py-4 bg-gradient-to-r from-primary-500 to-primary-600 text-white font-bold text-lg rounded-2xl hover:from-primary-600 hover:to-primary-700 transition-all duration-200 shadow-2xl hover:shadow-3xl transform hover:-translate-y-1 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none whitespace-nowrap",children:u?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-6 h-6 border-2 border-white border-t-transparent roun
152ded-full animate-spin mr-3"}),"Starting Scan..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Ei,{className:"w-6 h-6 mr-3"}),"Scan Now"]})})]}),i.jsxs("div",{className:"sm:hidden space-y-4",children:[i.jsx("input",{type:"text",value:a,onChange:_=>o(_.target.value),placeholder:"my-app.lovable.app",className:"w-full px-6 py-4 bg-gray-800/50 backdrop-blur-sm border border-gray-700 text-white rounded-2xl focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent placeholder-gray-400 text-lg",disabled:u}),i.jsx("button",{type:"submit",disabled:u,className:"w-full inline-flex items-center justify-center px-6 py-4 bg-gradient-to-r from-primary-500 to-primary-600 text-white font-bold text-lg rounded-2xl hover:from-primary-600 hover:to-primary-700 transition-all duration-200 shadow-2xl hover:shadow-3xl transform hover:-translate-y-1 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none",children:u?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin mr-3"}),"Starting Scan..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Ei,{className:"w-6 h-6 mr-3"}),"Scan Now"]})})]}),l&&i.jsx("p",{className:"text-red-400 text-sm text-center",children:l})]})}),i.jsx(ve,{variant:"fadeInUp",delay:100,children:i.jsxs("div",{className:"mb-20",children:[i.jsx("h3",{className:"text-2xl font-bold text-gray-200 mb-8",children:"Revealed So Far"}),i.jsxs("div",{className:"grid md:grid-cols-3 gap-8 mb-12 max-w-4xl mx-auto",children:[i.jsx(ve,{variant:"scaleIn",delay:200,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-6",children:[i.jsx("div",{className:"flex items-center justify-center mb-3",children:i.jsx(fx,{className:"w-8 h-8 text-primary-500"})}),i.jsx("div",{className:"text-3xl font-bold text-white mb-2",children:f?i.jsx("div",{className:"w-16 h-8 bg-gray-700 animate-pulse rounded"}):(d==null?void 0:d.apps_scanned.toLocaleString())||"0"}),i.jsx("p",{className:"text-gray-400",children:"Apps Scanned"}),p&&i.jsx("p",{className:"text-xs text-white mt-1",children:"Using cached data"})]})}),i.jsx(ve,{variant:"scaleIn",delay:300,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-6",children:[i.jsx("div",{className:"flex items-center justify-center mb-3",children:i.jsx(Ir,{className:"w-8 h-8 text-warning-500"})}),i.jsx("div",{className:"text-3xl font-bold text-white mb-2",children:f?i.jsx("div",{className:"w-16 h-8 bg-gray-700 animate-pulse rounded"}):(d==null?void 0:d.exposed_databases.toLocaleString())||"0"}),i.jsx("p",{className:"text-gray-400",children:"Exposed Databases"}),p&&i.jsx("p",{className:"text-xs text-white mt-1",children:"Using cached data"})]})}),i.jsx(ve,{variant:"scaleIn",delay:400,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-6",children:[i.jsx("div",{className:"flex items-center justify-center mb-3",children:i.jsx(Ue,{className:"w-8 h-8 text-danger-500"})}),i.jsx("div",{className:"text-3xl font-bold text-white mb-2",children:f?i.jsx("div",{className:"w-16 h-8 bg-gray-700 animate-pulse rounded"}):(d==null?void 0:d.records_at_risk.toLocaleString())||"0"}),i.jsx("p",{className:"text-gray-400",children:"Records at Risk"}),p&&i.jsx("p",{className:"text-xs text-white mt-1",children:"Using cached data"})]})})]})]})})]}),i.jsx(ve,{variant:"fadeInUp",delay:500,children:i.jsxs("div",{className:"mb-16",children:[i.jsx("h3",{className:"text-2xl font-bold text-gray-200 text-center mb-8",children:"Supported Vibe Coding Platforms"}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-6 max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex flex-col items-center space-y-3 p-4 bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl hover:border-gray-600 transition-colors",children:[i.jsx(h1,{className:"w-12 h-12"}),i.jsx("span",{className:"text-sm text-gray-300 text-center font-medium",children:"Bolt.new"})]}),i.jsxs("div",{className:"flex flex-col items-center space-y-3 p-4 bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl hover:border-gray-600 transition-colors",children:[i.jsx(d1,{className:"w-12 h-12"}),i.jsx("span",{className:"text-sm text-gray-300 text-center font-medium",children:"Lovable"})]}),i.jsxs("div",{className:"flex flex-col items-center space-y-3 p-4 bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl hover:border-gray-600 transition-colors",children:[i.jsx("img",{src:"/base44.webp",alt:"Base44",className:"w-12 h-12 object-contain"}),i.jsx("span",{className:"text-sm text-gray-300 text-center font-medium",children:"Base44"})]}),i.jsxs("div",{className:"flex flex-col items-center space-y-3 p-4 bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl hover:border-gray-600 transition-colors",children:[i.jsx(p1,{className:"w-12 h-12"}),i.jsx("span",{className:"text-sm text-gray-300 text-center font-medium",children:"V0 by Vercel"})]}),i.jsxs("div",{className:"flex flex-col items-center space-y-3 p-4 bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl opacity-60",children:[i.jsx(f1,{className:"w-12 h-12"}),i.jsxs("span",{className:"text-xs text-gray-400 text-center",children:["Replit",i.jsx("br",{}),"(Coming soon)"]})]})]})]})}),i.jsx(ve,{variant:"fadeInUp",delay:100,children:i.jsxs("div",{id:"how-it-works",className:"mb-16",children:[i.jsx("h3",{className:"text-2xl font-bold text-gray-200 text-center mb-12",children:"How It Works"}),i.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[i.jsx(ve,{variant:"slideInUp",delay:200,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-8 text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-primary-500/20 rounded-2xl flex items-center justify-center mx-auto mb-6",children:i.jsx("span",{className:"text-2xl font-bold text-primary-500",children:"1"})}),i.jsx("h4",{className:"text-xl font-semibold text-white mb-4",children:"Enter Your App"}),i.jsx("p",{className:"text-gray-400 leading-relaxed",children:"Provide your app URL, that's all we need!"})]})}),i.jsx(ve,{variant:"slideInUp",delay:300,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-8 text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-warning-500/20 rounded-2xl flex items-center justify-center mx-auto mb-6",children:i.jsx("span",{className:"text-2xl font-bold text-warning-500",children:"2"})}),i.jsx("h4",{className:"text-xl font-semibold text-white mb-4",children:"Security Scan"}),i.jsx("p",{className:"text-gray-400 leading-relaxed",children:"We analyze your API endpoints and database queries, classify impact and give your app a security grade."})]})}),i.jsx(ve,{variant:"slideInUp",delay:400,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-8 text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-success-500/20 rounded-2xl flex items-center justify-center mx-auto mb-6",children:i.jsx("span",{className:"text-2xl font-bold text-success-500",children:"3"})}),i.jsx("h4",{className:"text-xl font-semibold text-white mb-4",children:"Fix & Verify"}),i.jsx("p",{className:"text-gray-400 leading-relaxed",children:"Get resolution instructions, apply them and run a verification scan to confirm the vulnerabilities are resolved."})]})})]})]})}),i.jsx(ve,{variant:"fadeInUp",delay:100,children:i.jsxs("div",{className:"mb-16",children:[i.jsx("h3",{className:"text-2xl font-bold text-gray-200 text-center mb-8",children:"Sample Security Report"}),i.jsx("p",{className:"text-gray-400 text-center mb-8 max-w-2xl mx-auto",children:"Here's what a typical scan report looks like. This example shows a task management app with one exposed table containing PII and write access vulnerabilities."}),i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-4 sm:p-8 overflow-hidden",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between mb-6 gap-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h4",{className:"text-xl font-semibold text-white",children:"Security Report"}),i.jsxs("p",{className:"text-gray-400 text-sm sm:text-base break-words",children:[g.url," • ",new Date(g.timestamp).toLocaleStr
152ing()]})]}),i.jsxs("div",{className:"text-left sm:text-right flex-shrink-0",children:[i.jsx("div",{className:`text-lg sm:text-xl font-bold ${k}`,children:N}),i.jsx("p",{className:"text-gray-400 text-sm",children:"Security Status"})]})]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 sm:gap-6 mb-8",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-white mb-1",children:g.tables.length}),i.jsx("p",{className:"text-gray-400 text-xs sm:text-sm",children:"Tables Found"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-danger-500 mb-1",children:g.tables.filter(_=>_.isExposed).length}),i.jsx("p",{className:"text-gray-400 text-xs sm:text-sm",children:"Exposed Tables"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-danger-500 mb-1",children:g.tables.filter(_=>_.isPubliclyInsertable||_.isPubliclyUpdatable||_.isPubliclyDeletable).length}),i.jsx("p",{className:"text-gray-400 text-xs sm:text-sm",children:"Write Access"})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-danger-500 mb-1",children:y.toLocaleString()}),i.jsx("p",{className:"text-gray-400 text-xs sm:text-sm",children:"Exposed Records"})]})]}),i.jsx("div",{className:"space-y-6",children:g.tables.map((_,E)=>{var O;return i.jsxs("div",{className:"bg-gray-700/50 border border-gray-600 rounded-xl p-4 sm:p-6 overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[_.isExposed?i.jsx(br,{className:"w-5 h-5 text-danger-500 flex-shrink-0"}):i.jsx(gs,{className:"w-5 h-5 text-success-500 flex-shrink-0"}),i.jsx("h5",{className:"text-lg font-medium text-white truncate",children:_.name})]}),i.jsx("a",{href:"#",className:"text-white hover:text-primary-300 transition-colors flex-shrink-0",title:"API endpoint",children:i.jsx(qe,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 mb-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Status:"}),i.jsx("span",{className:"ml-2 text-sm font-medium text-white break-words",children:_.isExposed?"Publicly Accessible":"Secure"})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Records:"}),i.jsx("span",{className:"ml-2 text-sm text-white",children:_.recordCount.toLocaleString()})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Columns:"}),i.jsx("span",{className:"ml-2 text-sm text-white",children:((O=_.columns)==null?void 0:O.length)||0})]})]}),(_.isPubliclyInsertable||_.isPubliclyUpdatable||_.isPubliclyDeletable)&&i.jsxs("div",{className:"mb-4 p-3 bg-danger-500/20 border border-danger-500/30 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[i.jsx(Ue,{className:"w-4 h-4 text-white flex-shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-white",children:"Public Write Access Detected"})]}),i.jsxs("div",{className:"flex items-center space-x-4 text-xs",children:[_.isPubliclyInsertable&&i.jsxs("div",{className:"flex items-center space-x-1 text-white",children:[i.jsx(Vf,{className:"w-3 h-3"}),i.jsx("span",{children:"Insert"})]}),_.isPubliclyUpdatable&&i.jsxs("div",{className:"flex items-center space-x-1 text-white",children:[i.jsx(Wf,{className:"w-3 h-3"}),i.jsx("span",{children:"Update"})]}),_.isPubliclyDeletable&&i.jsxs("div",{className:"flex items-center space-x-1 text-white",children:[i.jsx(jc,{className:"w-3 h-3"}),i.jsx("span",{children:"Delete"})]})]})]}),_.columns&&_.columns.length>0&&i.jsxs("div",{className:"mb-4",children:[i.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[i.jsx(Bf,{className:"w-4 h-4 text-white"}),i.jsxs("span",{className:"text-sm font-medium text-white",children:["Column Details (",_.columns.length,")"]})]}),i.jsx("div",{className:"bg-gray-800/50 rounded-lg p-3 sm:p-4 overflow-hidden",children:i.jsxs("div",{className:"grid gap-2",children:[_.columns.slice(0,4).map((R,V)=>i.jsxs("div",{className:"flex items-center justify-between py-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center space-x-2 min-w-0 flex-1",children:[i.jsx(Ir,{className:"w-3 h-3 text-gray-400 flex-shrink-0"}),i.jsx("span",{className:"text-white text-sm truncate",children:R.name}),R.nullable&&i.jsx("span",{className:"text-xs bg-gray-600 text-gray-300 px-1 py-0.5 rounded flex-shrink-0",children:"nullable"})]}),i.jsx("span",{className:`text-xs font-mono ${m(R.type)} flex-shrink-0 ml-2`,children:R.type})]},V)),_.columns.length>4&&i.jsxs("div",{className:"text-xs text-gray-400 pt-1",children:["... and ",_.columns.length-4," more columns"]})]})})]}
152),_.isExposed&&i.jsx("div",{className:"p-3 sm:p-4 bg-danger-500/10 border border-danger-500/20 rounded-lg overflow-hidden",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(Ue,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h6",{className:"font-medium text-white mb-2",children:"Critical Security Risk"}),i.jsxs("p",{className:"text-sm text-gray-300 mb-3 break-words",children:["This table contains sensitive personal information including email addresses, phone numbers, and social security numbers.",(_.isPubliclyInsertable||_.isPubliclyUpdatable||_.isPubliclyDeletable)&&" Public write access allows anyone to modify or delete user data."]}),_.sampleRecord&&i.jsxs("div",{className:"mb-3",children:[i.jsx("div",{className:"mb-2",children:i.jsx("span",{className:"text-sm font-medium text-white",children:"Sample Exposed Data:"})}),i.jsx("div",{className:"p-3 bg-gray-800 rounded-lg overflow-hidden",children:i.jsx("pre",{className:"text-xs text-gray-300 overflow-x-auto whitespace-pre-wrap break-all",children:x(_.sampleRecord)})})]}),i.jsx("button",{className:"text-sm text-white hover:text-primary-300 font-medium transition-colors",children:"View Fix Instructions →"})]})]})})]},E)})})]})]})}),i.jsx(ve,{variant:"fadeInUp",delay:100,children:i.jsxs("div",{className:"mb-16",children:[i.jsx("h3",{className:"text-2xl font-bold text-gray-200 text-center mb-12",children:"Frequently Asked Questions"}),i.jsx("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-8 max-w-4xl mx-auto",children:i.jsxs("div",{className:"space-y-0",children:[i.jsx(Gr,{question:"What is SafeVibe.Codes?",answer:"SafeVibe.Codes is a specialized security scanner designed for AI-generated applications. We analyze apps built with modern coding platforms like Bolt.new, Lovable, and Base44 to identify data exposure vulnerabilities and security risks that are commonly overlooked during rapid AI-assisted development."}),i.jsx(Gr,{question:"What kind of apps do you scan?",answer:"We scan web applications built with AI coding platforms including Bolt.new, Lovable, Base44, and soon Replit and v0 by Vercel. Our scanner works with apps that use Supabase or Base44 as their backend database, analyzing both the frontend code and database configurations for security vulnerabilities."}),i.jsx(Gr,{question:"What info do I need to provide to start a scan?",answer:"You only need to provide your application's URL. Our scanner automatically discovers your app's architecture, extracts API endpoints from JavaScript bundles, and identifies database connections. No additional credentials or access tokens are required from you."}),i.jsx(Gr,{question:"Do you store or access our actual data?",answer:"We analyze your app's API responses using test queries and sample the data. We store one sample record from each exposed table so you can get a sense of what's exposed. We never access or store your full database - only what's already publicly accessible through your API endpoints."}),i.jsx(Gr,{question:"How is this different from other security scanners?",answer:"We specialize in AI-generated applications and understand their unique patterns and vulnerabilities. While traditional scanners analyze static code, we focus on the specific security issues that emerge from AI development platforms - like exposed endpoints, missing access controls, and data flow problems that AI tools often overlook when prioritizing functionality over security."}),i.jsx(Gr,{question:"How long does a scan take?",answer:"Most scans show results immediately, depending on your app's complexity and number of endpoints, this can take up to a couple of minutes. Our scanner works in real-time, analyzing JavaScript bundles and probing database endpoints to provide instant security insights."})]})})]})}),i.jsx(ve,{variant:"fadeInUp",delay:100,children:i.jsxs("div",{className:"grid lg:grid-cols-3 gap-8 mb-16",children:[i.jsx(ve,{variant:"scaleIn",delay:200,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm p-6 rounded-2xl border border-gray-700 hover:border-gray-600 transition-colors",children:[i.jsx("div",{className:"w-12 h-12 bg-success-500/20 rounded-xl flex items-center justify-center mb-4",children:i.jsx(ll,{className:"w-6 h-6 text-success-500"})}),i.jsx("h3",{className:"text-xl font-semibold text-gray-200 mb-3",children:"Exposure Detection"}),i.jsx("p",{className:"text-gray-400 leading-relaxed",children:"Automatically discover publicly accessible database tables and quantify potential data exposure risks."})]})}),i.jsx(ve,{variant:"scaleIn",delay:300,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm p-6 rounded-2xl border border-gray-700 hover:border-gray-600 transition-colors",children:[i.jsx("div",{className:"w-12 h-12 bg-primary-500/20 rounded-xl flex items-center justify-center mb-4",children:i.jsx(ea,{className:"w-6 h-6 text-primary-500"})}),i.jsx("h3",{className:"text-xl font-semibold text-gray-200 mb-3",children:"Instant Analysis"}),i.jsx("p",{className:"text-gray-400 leading-relaxed",children:"Parse JavaScript bundles in real-time to extract credentials and identify vulnerable endpoints across multiple platforms."})]})}),i.jsx(ve,{variant:"scaleIn",delay:400,children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm p-6 rounded-2xl border border-gray-700 hover:border-gray-600 transition-colors",children:[i.jsx("div",{className:"w-12 h-12 bg-warning-500/20 rounded-xl flex items-center justify-center mb-4",children:i.jsx(zf,{className:"w-6 h-6 text-warning-500"})}),i.jsx("h3",{className:"text-xl font-semibold text-gray-200 mb-3",children:"Fix Guidance"}),i.jsx("p",{className:"text-gray-400 leading-relaxed",children:"Get step-by-step instructions to secure your data with proper access controls and security best practices."})]})})]})}),i.jsx(ve,{variant:"fadeInUp",delay:100,children:i.jsxs("div",{className:"bg-gradient-to-r from-primary-500/10 to-primary-600/10 border border-primary-500/20 rounded-2xl p-12 text-center mb-16",children:[i.jsx("h3",{className:"text-3xl font-bold text-gray-200 mb-4",children:"Ready to Secure Your Application?"}),i.jsx("p",{className:"text-xl text-gray-300 mb-8 max-w-3xl mx-auto leading-relaxed",children:"Don't let a simple oversight turn into a major data breach. Most AI-generated apps have at least one database exposure - let's find yours before someone else does."}),i.jsxs(Ss,{to:"/signin?mode=signup",onClick:()=>w("final-cta"),className:"inline-flex items-center px-8 py-4 bg-gradient-to-r from-primary-500 to-primary-600 text-white font-bold text-lg rounded-2xl hover:from-primary-600 hover:to-primary-700 transition-all duration-200 shadow-2xl hover:shadow-3xl transform hover:-translate-y-1",children:[i.jsx(Ei,{className:"w-6 h-6 mr-3"}),"Start a Free Scan"]})]})}),i.jsx(ve,{variant:"fadeInUp",delay:200,children:i.jsx("div",{className:"bg-gray-800/30 backdrop-blur-sm border border-gray-700 rounded-2xl p-8 max-w-3xl mx-auto mb-16",children:i.jsxs("div",{className:"flex items-start space-x-4",children:[i.jsx("div",{className:"w-8 h-8 bg-warning-500/20 rounded-lg flex items-center justify-center flex-shrink-0 mt-1",children:i.jsx(ir,{className:"w-4 h-4 text-warning-500"})}),i.jsxs("div",{className:"text-left",children:[i.jsx("h4",{className:"text-lg font-semibold text-white mb-2",children:"Ethical Security Testing"}),i.jsx("p",{className:"text-gray-400 leading-relaxed",children:"Safe Vibe Codes is designed for testing your own applications only. Use this tool responsibly and ensure you have proper authorization before scanning any application. We promote responsible disclosure and ethical security practices."})]})]})})})]})}),t&&i.jsx(u1,{delay:3e3,onClose:()=>{const _=s?Date.now()-s:void 0;r1("homepage",_),r(!1)},onLinkClick:()=>{Kn({event_type:"ide_integration_banner_click",context_data:{source:"homepage",target_url:"https://vibe.mobb.ai",timestamp:Date.now()}})},onShow:()=>n(Date.now())})]})},g1=({onSignInWithGoogle:e})=>{const[t,r]=S.useState(!1),[s,n]=S.useState(null),a=async()=>{yp("signin_page"),r(!0),n(null);try{await e()}catch(o){n(o instanceof Error?o.message:"Authentication failed")}finally{r(!1)}};return i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-gray-900 via-gray-900 to-gray-800",children:[i.jsx("header",{className:"bg-gray-800/50 backdrop-blur-sm border-b border-gray-700",children:i.jsx("div",{className:"container mx-auto px-4 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(Ss,{to:"/",className:"flex items-center space-x-3",children:i.jsx("img",{src:"/mobb-logo.svg",alt:"Mobb AI Coding Assistant",className:"h-10 w-auto"})}),i.jsx(Ss,{to:"/",className:"text-gray-400 hover:text-white transition-colors",children:"← Back to Home"})]})})}),i.jsx("div",{className:"container mx-auto px-4 py-16",children:i.jsx("div",{className:"max-w-md mx-auto",children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-8",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-primary-500 to-primary-700 rounded-2xl flex items-center justify-center mx-auto mb-4",children:i.jsx(ir,{className:"w-8 h-8 text-white"})}),i.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Welcome to Safe Vibe Codes"}),i.jsx("p",{className:"text-gray-400",children:"Sign in to start scanning your applications for security vulnerabilities"})]}),s&&i.jsx("div",{className:"mb-6 p-4 bg-danger-500/10 border border-danger-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(sx,{className:"w-5 h-5 text-danger-400"}),i.jsx("span",{className:"text-sm text-danger-400",children:s})]})}),i.jsxs("button",{onClick:a,disabled:t,className:"w-full flex items-center justify-center px-6 py-4 bg-white text-gray-900 font-medium rounded-xl hover:bg-gray-100 transition-all duration-200 shadow-lg hover:shadow-xl disabled:opacity-50 disabled:cursor-not-allowed transform hover:-translate-y-0.5",children:[i.jsxs("svg",{className:"w-5 h-5 mr-3",viewBox:"0 0 24 24",children:[i.jsx("path",{fill:"currentColor",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"}),i.jsx("path",{fill:"currentColor",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"}),i.jsx("path",{fill:"currentColor",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"}),i.jsx("path",{fill:"currentColor",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?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-5 h-5 border-2 border-gray-600 border-t-transparent roun
152ded-full animate-spin mr-3"}),"Signing in..."]}):"Continue with Google"]})]})})})]})},x1=()=>i.jsxs("div",{className:"min-h-screen bg-gray-900 text-white",children:[i.jsx("div",{className:"bg-gray-800 border-b border-gray-700",children:i.jsx("div",{className:"max-w-4xl mx-auto px-4 py-6",children:i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsxs(Ss,{to:"/",className:"flex items-center space-x-2 text-gray-400 hover:text-white transition-colors",children:[i.jsx(Ff,{className:"w-4 h-4"}),i.jsx("span",{children:"Back to Scanner"})]}),i.jsx("div",{className:"h-6 w-px bg-gray-600"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ir,{className:"w-5 h-5 text-primary-500"}),i.jsx("h1",{className:"text-xl font-semibold",children:"Fix Instructions for Supabase Apps"})]})]})})}),i.jsx("div",{className:"max-w-4xl mx-auto px-4 py-8",children:i.jsxs("div",{className:"space-y-8",children:[i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(Ue,{className:"w-6 h-6 text-warning-500 flex-shrink-0 mt-1"}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl font-semibold mb-3",children:"Why This Matters"}),i.jsx("p",{className:"text-gray-300 mb-4",children:"Your Supabase tables are publicly accessible without authentication. This means anyone on the internet can potentially read, and sometimes modify, your data. This is a critical security vulnerability that needs immediate attention."}),i.jsxs("p",{className:"text-gray-300",children:["The solution is to implement ",i.jsx("strong",{children:"Row Level Security (RLS)"})," - Supabase's built-in security feature that allows you to control who can access what data."]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"1"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Access Your Supabase Dashboard"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("p",{className:"text-gray-300",children:["1. Go to ",i.jsxs("a",{href:"https://supabase.com/dashboard",target:"_blank",rel:"noopener noreferrer",className:"text-primary-400 hover:text-primary-300 inline-flex items-center",children:["supabase.com/dashboard ",i.jsx(qe,{className:"w-3 h-3 ml-1"})]})]}),i.jsx("p",{className:"text-gray-300",children:"2. Sign in to your account and select your project"}),i.jsxs("p",{className:"text-gray-300",children:["3. Navigate to the ",i.jsx("strong",{children:"Authentication"})," section in the left sidebar"]})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"2"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Navigate to Table Editor"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("p",{className:"text-gray-300",children:["1. In your Supabase dashboard, click on ",i.jsx("strong",{children:"Table Editor"})," in the left sidebar"]}),i.jsx("p",{className:"text-gray-300",children:"2. You'll see a list of all your database tables"}),i.jsx("p",{className:"text-gray-300",children:"3. Look for the tables that were flagged as exposed in your scan results"})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"3"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Enable Row Level Security"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"text-gray-300",children:"1. Click on the table you want to secure"}),i.jsxs("p",{className:"text-gray-300",children:["2. Look for the ",i.jsx("strong",{children:"RLS"})," toggle switch at the top of the table view"]}),i.jsx("p",{className:"text-gray-300",children:"3. Click the toggle to enable RLS - it should turn green/blue when enabled"}),i.jsx("div",{className:"p-3 bg-warning-500/10 border border-warning-500/20 rounded-lg",children:i.jsxs("p",{className:"text-sm text-warning-200",children:[i.jsx("strong",{children:"Important:"})," Enabling RLS without policies will block ALL access to your table, including from your application. Make sure to create policies in the next step."]})})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"4"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Create RLS Policies"}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("p",{className:"text-gray-300",children:["1. After enabling RLS, click on the ",i.jsx("strong",{children:"Policies"})," tab for your table"]}),i.jsxs("p",{className:"text-gray-300",children:["2. Click ",i.jsx("strong",{children:"Create Policy"})," to add a new security policy"]}),i.jsx("p",{className:"text-gray-300",children:"3. Choose the appropriate policy template based on your needs:"}),i.jsxs("div",{className:"ml-4 space-y-3",children:[i.jsxs("div",{className:"p-3 bg-gray-700/50 rounded-lg",children:[i.jsx("h4",{className:"font-medium text-white mb-2",children:"For User-Specific Data:"}),i.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"If your table contains user-specific data (like user profiles, user posts, etc.):"}),i.jsx("div",{className:"p-2 bg-gray-800 rounded text-sm font-mono text-green-400",children:"auth.uid() = user_id"})]}),i.jsxs("div",{className:"p-3 bg-gray-700/50 rounded-lg",children:[i.jsx("h4",{className:"font-medium text-white mb-2",children:"For Public Read-Only Data:"}),i.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"If your table contains data that should be readable by everyone but not writable:"}),i.jsxs("div",{className:"p-2 bg-gray-800 rounded text-sm font-mono text-green-400",children:["SELECT: true",i.jsx("br",{}),"INSERT/UPDATE/DELETE: false"]}
152)]}),i.jsxs("div",{className:"p-3 bg-gray-700/50 rounded-lg",children:[i.jsx("h4",{className:"font-medium text-white mb-2",children:"For Authenticated Users Only:"}),i.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"If your table should only be accessible to logged-in users:"}),i.jsx("div",{className:"p-2 bg-gray-800 rounded text-sm font-mono text-green-400",children:"auth.role() = 'authenticated'"})]})]})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Test Your Policies"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("p",{className:"text-gray-300",children:["1. After creating your policies, test them using the ",i.jsx("strong",{children:"SQL Editor"})," in your Supabase dashboard"]}),i.jsx("p",{className:"text-gray-300",children:"2. Try running queries with different authentication states to ensure your policies work correctly"}),i.jsx("p",{className:"text-gray-300",children:"3. Test your application to make sure it still works as expected"}),i.jsx("p",{className:"text-gray-300",children:"4. Run another scan with Safe Vibe Codes to verify the tables are now properly secured"})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(Ir,{className:"w-6 h-6 text-primary-500 flex-shrink-0 mt-1"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Resources"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("a",{href:"https://supabase.com/docs/guides/auth/row-level-security",target:"_blank",rel:"noopener noreferrer",className:"text-primary-400 hover:text-primary-300 inline-flex items-center",children:["Official Supabase RLS Documentation ",i.jsx(qe,{className:"w-3 h-3 ml-1"})]}),i.jsx("br",{}),i.jsxs("a",{href:"https://supabase.com/docs/guides/auth/row-level-security#policy-examples",target:"_blank",rel:"noopener noreferrer",className:"text-primary-400 hover:text-primary-300 inline-flex items-center",children:["RLS Policy Examples ",i.jsx(qe,{className:"w-3 h-3 ml-1"})]}),i.jsx("br",{}),i.jsxs("a",{href:"https://supabase.com/docs/guides/auth/row-level-security#testing-policies",target:"_blank",rel:"noopener noreferrer",className:"text-primary-400 hover:text-primary-300 inline-flex items-center",children:["Testing RLS Policies ",i.jsx(qe,{className:"w-3 h-3 ml-1"})]})]})]})]})}),i.jsx("div",{className:"bg-success-500/10 border border-success-500/20 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(gs,{className:"w-6 h-6 text-success-500 flex-shrink-0 mt-1"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"You're All Set!"}),i.jsx("p",{className:"text-gray-300",children:"Once you've implemented RLS on your exposed tables, your data will be properly secured. Remember to test your application thoroughly and run another scan to verify everything is working correctly."})]})]})})]})})]}),y1=()=>i.jsxs("div",{className:"min-h-screen bg-gray-900 text-white",children:[i.jsx("div",{className:"bg-gray-800 border-b border-gray-700",children:i.jsx("div",{className:"max-w-4xl mx-auto px-4 py-6",children:i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsxs(Ss,{to:"/",className:"flex items-center space-x-2 text-gray-400 hover:text-white transition-colors",children:[i.jsx(Ff,{className:"w-4 h-4"}),i.jsx("span",{children:"Back to Scanner"})]}),i.jsx("div",{className:"h-6 w-px bg-gray-600"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ir,{className:"w-5 h-5 text-primary-500"}),i.jsx("h1",{className:"text-xl font-semibold",children:"Fix Instructions for Base44 Apps"})]})]})})}),i.jsx("div",{className:"max-w-4xl mx-auto px-4 py-8",children:i.jsxs("div",{className:"space-y-8",children:[i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(Ue,{className:"w-6 h-6 text-warning-500 flex-shrink-0 mt-1"}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl font-semibold mb-3",children:"Why This Matters"}),i.jsx("p",{className:"text-gray-300 mb-4",children:"Your Base44 data entities are publicly accessible without proper authentication. This means anyone on the internet can potentially read, and sometimes modify, your data. This is a critical security vulnerability that needs immediate attention."}),i.jsxs("p",{className:"text-gray-300",children:["The solution is to implement ",i.jsx("strong",{children:"Row Level Security (RLS)"})," restrictions through Base44's security management interface."]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"1"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Access Your Base44 Workspace"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"text-gray-300",children:"1. Log in to your Base44 account"}),i.jsxs("p",{className:"text-gray-300",children:["2. Navigate to your project's ",i.jsx("strong",{children:"Worksp
152ace"})]}),i.jsx("p",{className:"text-gray-300",children:"3. You should see your workspace dashboard with various management options"})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"2"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Navigate to Security Settings"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("p",{className:"text-gray-300",children:["1. In your Base44 workspace, look for the ",i.jsx("strong",{children:"Security"})," section"]}),i.jsxs("p",{className:"text-gray-300",children:["2. Click on ",i.jsx("strong",{children:"Security"})," to access the security management interface"]}),i.jsx("p",{className:"text-gray-300",children:"3. This will take you to the security configuration panel where you can manage data entity access"})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"3"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Locate Your Data Entities"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("p",{className:"text-gray-300",children:["1. In the Security section, look for a list of ",i.jsx("strong",{children:"Data Entities"})]}),i.jsx("p",{className:"text-gray-300",children:"2. Find the specific data entities that were flagged as exposed in your scan results"}),i.jsx("p",{className:"text-gray-300",children:"3. These entities correspond to the tables/collections that contain your application data"}),i.jsx("div",{className:"p-3 bg-info-500/10 border border-info-500/20 rounded-lg",children:i.jsxs("p",{className:"text-sm text-info-200",children:[i.jsx("strong",{children:"Tip:"})," The entity names should match the table names shown in your scan results."]})})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"4"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Add RLS Restrictions"}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-gray-300",children:"1. Click on the data entity you want to secure"}),i.jsxs("p",{className:"text-gray-300",children:["2. Look for ",i.jsx("strong",{children:"RLS Restrictions"})," or ",i.jsx("strong",{children:"Security Rules"})," options"]}),i.jsxs("p",{className:"text-gray-300",children:["3. Click ",i.jsx("strong",{children:"Add RLS Restriction"})," to create a new security rule"]}),i.jsxs("div",{className:"ml-4 space-y-3",children:[i.jsxs("div",{className:"p-3 bg-gray-700/50 rounded-lg",children:[i.jsx("h4",{className:"font-medium text-white mb-2",children:"Common RLS Restriction Types:"}),i.jsxs("ul",{className:"text-sm text-gray-300 space-y-1",children:[i.jsxs("li",{children:["• ",i.jsx("strong",{children:"User-based access:"})," Restrict access to data owned by the authenticated user"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"Role-based access:"})," Restrict access based on user roles (admin, user, etc.)"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"Authentication required:"})," Require users to be logged in to access data"]}),i.jsxs("li",{children:["• ",i.jsx("strong",{children:"Read-only access:"})," Allow reading but prevent modifications"]})]})]}),i.jsxs("div",{className:"p-3 bg-gray-700/50 rounded-lg",children:[i.jsx("h4",{className:"font-medium text-white mb-2",children:"Example Configuration:"}),i.jsx("p",{className:"text-sm text-gray-300 mb-2",children:"For user-specific data (like user profiles, user posts):"}),i.jsxs("div",{className:"p-2 bg-gray-800 rounded text-sm font-mono text-green-400",children:["Access Rule: user_id = auth.user_id",i.jsx("br",{}),"Operation: SELECT, INSERT, UPDATE, DELETE"]}
vendor: 5,693 bytes, line 152
152)]})]})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"5"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Configure Access Permissions"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"text-gray-300",children:"1. For each RLS restriction, configure the specific permissions:"}),i.jsxs("div",{className:"ml-4 space-y-2",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("span",{className:"text-gray-300",children:"•"}),i.jsx("strong",{className:"text-white",children:"SELECT:"}),i.jsx("span",{className:"text-gray-300",children:"Who can read/view the data"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("span",{className:"text-gray-300",children:"•"}),i.jsx("strong",{className:"text-white",children:"INSERT:"}),i.jsx("span",{className:"text-gray-300",children:"Who can create new records"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("span",{className:"text-gray-300",children:"•"}),i.jsx("strong",{className:"text-white",children:"UPDATE:"}),i.jsx("span",{className:"text-gray-300",children:"Who can modify existing records"})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("span",{className:"text-gray-300",children:"•"}),i.jsx("strong",{className:"text-white",children:"DELETE:"}),i.jsx("span",{className:"text-gray-300",children:"Who can remove records"})]})]}),i.jsx("p",{className:"text-gray-300",children:"2. Set appropriate restrictions for each operation based on your security requirements"}),i.jsx("p",{className:"text-gray-300",children:"3. Save your configuration"})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center text-white font-bold flex-shrink-0",children:"6"}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Test and Verify"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("p",{className:"text-gray-300",children:"1. Test your application to ensure it still works correctly with the new restrictions"}),i.jsx("p",{className:"text-gray-300",children:"2. Try accessing your data entities as different user types to verify the restrictions work"}),i.jsx("p",{className:"text-gray-300",children:"3. Run another scan with Safe Vibe Codes to verify the entities are now properly secured"}),i.jsx("div",{className:"p-3 bg-warning-500/10 border border-warning-500/20 rounded-lg",children:i.jsxs("p",{className:"text-sm text-warning-200",children:[i.jsx("strong",{children:"Important:"})," Make sure your application still functions correctly after implementing RLS restrictions. Test all user flows to ensure legitimate users can still access their data."]})})]})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(Ir,{className:"w-6 h-6 text-primary-500 flex-shrink-0 mt-1"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Best Practices"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-start space-x-2",children:[i.jsx("span",{className:"text-primary-500 mt-1",children:"•"}),i.jsx("span",{className:"text-gray-300",children:"Always implement the principle of least privilege - grant only the minimum access required"})]}),i.jsxs("div",{className:"flex items-start space-x-2",children:[i.jsx("span",{className:"text-primary-500 mt-1",children:"•"}),i.jsx("span",{className:"text-gray-300",children:"Test your security rules thoroughly with different user scenarios"})]}),i.jsxs("div",{className:"flex items-start space-x-2",children:[i.jsx("span",{className:"text-primary-500 mt-1",children:"•"}),i.jsx("span",{className:"text-gray-300",children:"Regularly audit your data entity access permissions"})]}),i.jsxs("div",{className:"flex items-start space-x-2",children:[i.jsx("span",{className:"text-primary-500 mt-1",children:"•"}),i.jsx("span",{className:"text-gray-300",children:"Keep your Base44 platform updated to ensure you have the latest security features"})]})]})]})]})}),i.jsx("div",{className:"bg-success-500/10 border border-success-500/20 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(gs,{className:"w-6 h-6 text-success-500 flex-shrink-0 mt-1"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"You're All Set!"}),i.jsx("p",{className:"text-gray-300",children:"Once you've implemented RLS restrictions on your exposed data entities, your data will be properly secured. Remember to test your application thoroughly and run another scan to verify everything is working correctly."})]})]})}),i.jsx("div",{className:"bg-gray-800/50 border border-gray-700 rounded-xl p-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(ix,{className:"w-6 h-6 text-primary-500 flex-shrink-0 mt-1"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Need Help?"}),i.jsx("p",{className:"text-gray-300 mb-3",children:"If you're having trouble implementing these security measures or need specific guidance for your use case, 
152consider reaching out to the Base44 support team or consulting with a security expert."}),i.jsx("p",{className:"text-gray-300",children:"Remember: securing your data is crucial for protecting your users and maintaining their trust."})]})]})})]})})]}),v1=({user:e,activeTab:t,onTabChange:r,onSignOut:s})=>{const n=Vn(),a=o=>{r(o),n(`/${o}`)};return i.jsx("header",{className:"bg-gray-800/50 backdrop-blur-sm border-b border-gray-700",children:i.jsx("div",{className:"container mx-auto px-2 sm:px-4 py-2 sm:py-4",children:i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:"flex items-center flex-shrink-0",children:i.jsx("img",{src:"/mobb-logo.svg",alt:"Mobb AI Coding Assistant",className:"h-5 sm:h-8 w-auto"})}),i.jsxs("nav",{className:"flex items-center space-x-1 flex-shrink-0",children:[i.jsxs("button",{onClick:()=>a("scan"),className:`inline-flex items-center px-2 sm:px-4 py-1 sm:py-2 rounded-lg text-xs sm:text-sm font-medium transition-colors ${t==="scan"?"bg-gray-600 text-white":"text-gray-300 hover:bg-gray-700 hover:text-white"}`,children:[i.jsx(Ei,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"hidden sm:inline ml-1",children:"Scan"})]}),i.jsxs("button",{onClick:()=>a("my-apps"),className:`inline-flex items-center px-2 sm:px-4 py-1 sm:py-2 rounded-lg text-xs sm:text-sm font-medium transition-colors ${t==="my-apps"?"bg-gray-600 text-white":"text-gray-300 hover:bg-gray-700 hover:text-white"}`,children:[i.jsx(ax,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"hidden sm:inline ml-1",children:"Apps"})]})]}),i.jsxs("div",{className:"flex items-center gap-1 sm:gap-3 flex-shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-1 sm:gap-2",children:[i.jsx("img",{src:e.picture,alt:e.name,className:"w-6 h-6 sm:w-8 sm:h-8 rounded-full"}),i.jsxs("div",{className:"hidden lg:block",children:[i.jsx("p",{className:"text-sm font-medium text-white",children:e.name}),i.jsx("p",{className:"text-xs text-gray-400",children:e.email})]})]}),i.jsx("button",{onClick:s,className:"p-1 sm:p-2 text-gray-400 hover:text-white hover:bg-gray-700 rounded-lg transition-colors",title:"Sign Out",children:i.jsx(cx,{className:"w-4 h-4"})})]})]})})})},wp="safevibe_support_requests",w1=async e=>{const t={...e,id:crypto.randomUUID(),status:"pending",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};try{if(!await e1(e.url,e.platform_type,e.notes,e.user_email))throw new Error("Failed to submit support request to server");console.log("Support request submitted to database:",t)}catch(r){console.warn("Failed to submit to database, storing locally as fallback:",r);const n=[...bp(),t];localStorage.setItem(wp,JSON.stringify(n))}return t},bp=()=>{try{const e=localStorage.getItem(wp);return e?JSON.parse(e):[]}catch(e){return console.error("Failed to load support requests:",e),[]}},b1=(e,t)=>{const r=bp(),s=Date.now()-24*60*60*1e3;return r.some(n=>n.url===e&&n.user_id===t&&n.status==="pending"&&n.created_at&&new Date(n.created_at).getTime()>s)},j1=({isOpen:e,onClose:t,url:r,userId:s,userEmail:n})=>{const[a,o]=S.useState(""),[l,c]=S.useState(""),[u,h]=S.useState(!1),[d,f]=S.useState(!1),p=b1(r,s),w=async x=>{if(x.preventDefault(),!(u||p)&&a.trim()){h(!0);try{await w1({user_id:s,url:r,platform_type:a.trim(),user_email:n,notes:l.trim()}),f(!0)}catch(m){console.error("Failed to submit support request:",m)}finally{h(!1)}}},b=()=>{t(),setTimeout(()=>{o(""),c(""),f(!1)},300)};return e?i.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center p-4 z-50",children:i.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full max-h-[90vh] overflow-y-auto",children:[i.jsxs("div",{className:"flex items-center justify-between p-6 border-b",children:[i.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Request Platform Support"}),i.jsx("button",{onClick:b,className:"text-gray-400 hover:text-gray-500 transition-colors",children:i.jsx(Ln,{size:24})})]}),i.jsx("div",{className:"p-6",children:d?i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(cl,{className:"w-8 h-8 text-green-600"})}),i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Request Submitted!"}
152),i.jsx("p",{className:"text-gray-600 mb-4",children:"Thank you for requesting support for this platform. Your request has been sent to our development team. We'll prioritize platforms based on user demand and notify you via email when support is added."}),i.jsx("button",{onClick:b,className:"w-full px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors",children:"Close"})]}):p?i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4",children:i.jsx(qe,{className:"w-8 h-8 text-blue-600"})}),i.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Recently Requested"}),i.jsx("p",{className:"text-gray-600 mb-4",children:"You've already submitted a support request for this website in the last 24 hours. Feel free to submit again later if you have additional information to provide."}),i.jsx("button",{onClick:b,className:"w-full px-4 py-2 bg-gray-600 text-white rounded-lg hover:bg-gray-700 transition-colors",children:"Close"})]}):i.jsxs("form",{onSubmit:w,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"We currently support Supabase and Base44 applications. Help us expand by requesting support for this platform. Your request will be stored in our development backlog:"}),i.jsx("div",{className:"p-3 bg-gray-50 rounded-lg mb-4",children:i.jsx("p",{className:"text-sm font-medium text-gray-900 break-all",children:r})})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"platformType",className:"block text-sm font-medium text-gray-700 mb-2",children:"What platform did you use to build it? *"}),i.jsx("input",{type:"text",id:"platformType",value:a,onChange:x=>o(x.target.value),placeholder:"e.g. Netlify, Vercel, WordPress, Shopify, React, Next.js...",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500",required:!0}),i.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Tell us what tools, frameworks, or services you used to create this website"})]}),i.jsxs("div",{children:[i.jsx("label",{htmlFor:"notes",className:"block text-sm font-medium text-gray-700 mb-2",children:"Additional notes (optional)"}),i.jsx("textarea",{id:"notes",value:l,onChange:x=>c(x.target.value),rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-none",placeholder:"Any additional information about this platform or website..."})]}),i.jsxs("div",{className:"flex gap-3 pt-4",children:[i.jsx("button",{type:"button",onClick:b,className:"flex-1 px-4 py-2 text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:u||!a.trim(),className:"flex-1 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:u?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),"Submitting..."]}):i.jsxs(i.Fragment,{children:[i.jsx(cl,{size:16}),"Submit Request"]})})]})]})})]})}):null},Js=e=>{const t=e.columns&&e.columns.length>0,r=e.sampleRecord&&typeof e.sampleRecord=="object";if(!t&&!r)return{hasSensitiveData:!1,sensitiveColumns:[],sensitiveTypes:[]};const s={email:/\b(email|e_mail|mail)\b|@/i,phone:/\b(phone|mobile|tel|cell|contact)\b/i,ssn:/\b(ssn|social_security|social_sec)\b/i,address:/\b(address|street|city|state|zip|postal|country|region)\b/i,dob:/\b(birth|dob|date_of_birth|birthday)\b|\bage\b(?!.*message)/i,password:/\b(password|pwd|pass|hash|salt|secret|credential|credentials|code)\b/i,device:/\b(device|ip|browser|user_agent|fingerprint)\b/i},n=[],a=new Set;if(t)for(const o of e.columns){const l=o.name.toLowerCase();for(const[c,u]of Object.entries(s))u.test(l)&&(n.push({name:o.name,type:o.type,sensitiveType:c}),a.add(c))}if(r){const o=e.sampleRecord,l=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;for(const[c,u]of Object.entries(o)){const h=c.toLowerCase();for(const[d,f]of Object.entries(s))f.test(h)&&(n.find(w=>w.name===c)||(n.push({name:c,type:"detected_from_sample",sensitiveType:d}),a.add(d)));u&&typeof u=="string"&&(l.test(u)&&(n.find(f=>f.name===c)||(n.push({name:c,type:"detected_from_content",sensitiveType:"email"}),a.add("email"))),(u.startsWith("http://")||u.startsWith("https://"))&&(n.find(f=>f.name===c)||(n.push({name:c,type:"detected_from_content",sensitiveType:"url"}),a.add("url"))))}}return{hasSensitiveData:n.length>0,sensitiveColumns:n,sensitiveTypes:Array.from(a)}},jl=e=>{const t=ia(e),r=aa(e);return t>0||r?{status:"public_data_found",color:"text-red-500",message:"Public Data Found",description:`${t>
1520?`${t.toLocaleString()} records publicly accessible`:""}${t>0&&r?", ":""}${r?"public write access detected":""}`}:{status:"protected",color:"text-green-500",message:"No Public Data Detected",description:"No public data access detected"}},ia=e=>e.filter(t=>t.isExposed).reduce((t,r)=>t+r.recordCount,0),aa=e=>e.some(t=>t.isPubliclyInsertable||t.isPubliclyUpdatable||t.isPubliclyDeletable),Ls=()=>{const[e,t]=S.useState(null),[r,s]=S.useState(!0);S.useEffect(()=>{(async()=>{const{data:{session:p}}=await Ce.auth.getSession();p!=null&&p.user&&t(n(p.user)),s(!1)})();const{data:{subscription:f}}=Ce.auth.onAuthStateChange(async(p,w)=>{var b,x;if(console.log("🔐 Auth state change:",{event:p,userId:(b=w==null?void 0:w.user)==null?void 0:b.id}),w!=null&&w.user){if(t(n(w.user)),p==="SIGNED_IN"){const m=new Date(w.user.created_at),y=new Date().getTime()-m.getTime(),j=y<1e4,N=((x=w.user.app_metadata)==null?void 0:x.provider)||"email";if(console.log("🔍 Auth tracking debug:",{userId:w.user.id,userCreatedAt:m.toISOString(),timeSinceCreation:y,isRecentSignup:j,provider:N}),j){const k=`signup_tracked_${w.user.id}`;localStorage.getItem(k)||(console.log("🎉 New user signup detected, tracking completion:",{provider:N,userId:w.user.id}),s1(N,"signin_page"),localStorage.setItem(k,"true"))}}}else t(null);s(!1)});return()=>f.unsubscribe()},[]);const n=d=>{var w,b;const f=d.user_metadata,p=(w=d.app_metadata)==null?void 0:w.provider;return{id:d.id,email:d.email||"",name:(f==null?void 0:f.full_name)||(f==null?void 0:f.name)||((b=d.email)==null?void 0:b.split("@")[0])||"User",picture:(f==null?void 0:f.avatar_url)||(f==null?void 0:f.picture)||`https://ui-avatars.com/api/?name=${encodeURIComponent((f==null?void 0:f.full_name)||d.email||"User")}&background=0066ff&color=fff`,provider:p||"email"}},a=()=>window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?"http://localhost:5173":window.location.origin;return{user:e,loading:r,signInWithGoogle:async()=>{try{const{error:d}=await Ce.auth.signInWithOAuth({provider:"google",options:{redirectTo:a()}});if(d)throw console.error("Google sign in error:",d),d}catch(d){throw console.error("Failed to sign in with Google:",d),d}},signInWithGitHub:async()=>{try{const{error:d}=await Ce.auth.signInWithOAuth({provider:"github",options:{redirectTo:a()}});if(d)throw console.error("GitHub sign in error:",d),d}catch(d){throw console.error("Failed to sign in with GitHub:",d),d}},signInWithEmail:async(d,f)=>{try{const{error:p}=await Ce.auth.signInWithPassword({email:d,password:f});if(p)throw console.error("Email sign in error:",p),p}catch(p){throw console.error("Failed to sign in with email:",p),p}},signUpWithEmail:async(d,f,p)=>{try{const w={email:d,password:f,options:{data:{full_name:p}}},{error:b}=await Ce.auth.signUp(w);if(b)throw console.error("Email sign up error:",b),b}catch(w){throw console.error("Failed to sign up with email:",w),w}},signOut:async()=>{try{const{error:d}=await Ce.auth.signOut();if(d)throw console.error("Sign out error:",d),d}catch(d){throw console.error("Failed to sign out:",d),d}}}},jp=({scanResult:e,isOpen:t,onClose:r,userId:s,userEmail:n,onRescan:a})=>{var z,oe,mr,mt,Br,gt,gr;const o=Vn();Ls();const[l,c]=Re.useState(()=>{const v={};return e.tables.forEach(I=>{v[I.name]=!I.isExposed||I.recordCount===0}),v}),[u,h]=Re.useState("tables"),[d,f]=Re.useState({}),[p,w]=Re.useState(!1),[b,x]=Re.useState(!1),[m,g]=Re.useState(!1),[y,j]=Re.useState(!1);if(Re.useEffect(()=>{if(y){const v=setTimeout(()=>{j(!1)},3e3);return()=>clearTimeout(v)}},[y]),Re.useEffect(()=>{t&&(g(!1),j(!1))},[t]),!t)return null;const N=v=>{navigator.clipboard.writeText(v)},k=v=>{c(I=>({...I,[v]:!I[v]}))},_=v=>{f(I=>({...I,[v]:I[v]===void 0?!1:!I[v]}))},E=(v,I)=>{try{const D=I.startsWith("http")?I:`https://${I}`;return new URL(v,D).toString()}catch{return`${I}${v}`}},O=v=>v===0?"text-gray-400":v>=200&&v<300?"text-green-400":v>=400&&v<500?"text-orange-400":v>=500?"text-red-400":"text-gray-400",R=v=>v===0?"bg-gray-500/20 text-gray-300":v>=200&&v<300?"bg-green-500/20 text-green-300":v>=400&&v<500?"bg-orange-500/20 text-orange-300":v>=500?"bg-red-500/20 text-red-300":"bg-gray-500/20 text-gray-300",V=(v,I=100,D=50)=>{if(v==null)return v;if(typeof v=="string")return v.length>I?v.substring(0,I)+"...[truncated]":v;if(Array.isArray(v))return v.length>10?[...v.slice(0,10).map(M=>V(M,I,D)),"...["+(v.length-10)+" more items]"]:v.map(M=>V(M,I,D));if(typeof v=="object"){const M=Object.keys(v);if(M.length>D){const G={};
152return M.slice(0,D).forEach(ue=>{G[ue]=V(v[ue],I,D)}),G["...[truncated]"]=`${M.length-D} more fields`,G}const H={};return M.forEach(G=>{H[G]=V(v[G],I,D)}),H}return v},Oe=(v,I)=>{if(!v)return i.jsx("span",{className:"text-gray-400",children:"No sample data available"});const D=V(v),M=Js(I),H=new Set(M.sensitiveColumns.map(ie=>ie.name)),G=(ie,ze,Ta=0)=>{const Nt=H.has(ie),$s="  ".repeat(Ta);return ze===null?i.jsxs("span",{children:[i.jsxs("span",{className:"text-gray-400",children:[$s,'"']}),i.jsx("span",{className:Nt?"text-red-300 font-medium":"text-blue-300",children:ie}),i.jsx("span",{className:"text-gray-400",children:'": '}),i.jsx("span",{className:"text-gray-500",children:"null"})]},ie):typeof ze=="string"?i.jsxs("span",{children:[i.jsxs("span",{className:"text-gray-400",children:[$s,'"']}),i.jsx("span",{className:Nt?"text-red-300 font-medium":"text-blue-300",children:ie}),i.jsx("span",{className:"text-gray-400",children:'": "'}),i.jsx("span",{className:Nt?"text-red-200":"text-green-300",children:ze}),i.jsx("span",{className:"text-gray-400",children:'"'})]},ie):typeof ze=="number"?i.jsxs("span",{children:[i.jsxs("span",{className:"text-gray-400",children:[$s,'"']}),i.jsx("span",{className:Nt?"text-red-300 font-medium":"text-blue-300",children:ie}),i.jsx("span",{className:"text-gray-400",children:'": '}),i.jsx("span",{className:Nt?"text-red-200":"text-purple-300",children:ze})]},ie):typeof ze=="boolean"?i.jsxs("span",{children:[i.jsxs("span",{className:"text-gray-400",children:[$s,'"']}),i.jsx("span",{className:Nt?"text-red-300 font-medium":"text-blue-300",children:ie}),i.jsx("span",{className:"text-gray-400",children:'": '}),i.jsx("span",{className:Nt?"text-red-200":"text-yellow-300",children:ze.toString()})]},ie):i.jsxs("span",{children:[i.jsxs("span",{className:"text-gray-400",children:[$s,'"']}),i.jsx("span",{className:Nt?"text-red-300 font-medium":"text-blue-300",children:ie}),i.jsx("span",{className:"text-gray-400",children:'": '}),i.jsx("span",{className:Nt?"text-red-200":"text-gray-300",children:JSON.stringify(ze)})]},ie)},ue=Object.entries(D);return i.jsxs("div",{className:"font-mono text-sm",children:[i.jsx("span",{className:"text-gray-400",children:"{"}),i.jsx("br",{}),ue.map(([ie,ze],Ta)=>i.jsxs("div",{children:[G(ie,ze,1),Ta<ue.length-1&&i.jsx("span",{className:"text-gray-400",children:","}),i.jsx("br",{})]},ie)),i.jsx("span",{className:"text-gray-400",children:"}"})]})},Ze=v=>{switch(v.toLowerCase()){case"uuid":return"text-purple-400";case"text":case"varchar":return"text-green-400";case"integer":case"bigint":case"numeric":return"text-blue-400";case"boolean":return"text-yellow-400";case"timestamp":case"timestamptz":case"date":return"text-orange-400";case"json":case"jsonb":return"text-pink-400";case"array":return"text-indigo-400";case"enum":return"text-cyan-400";default:return"text-gray-400"}},_t=v=>v==="api_discovery"?"This table was discovered by scanning the API endpoints but is not referenced in your frontend code. This could indicate a backend-only table that may be unintentionally exposed.":"This table was found referenced in your frontend JavaScript code.",P=v=>{const I={email:{label:"Email",color:"bg-red-500/20 text-red-300"},phone:{label:"Phone",color:"bg-red-500/20 text-red-300"},ssn:{label:"SSN",color:"bg-red-500/20 text-red-300"},password:{label:"Password",color:"bg-red-500/20 text-red-300"},address:{label:"Address",color:"bg-orange-500/20 text-orange-300"},dob:{label:"DOB",color:"bg-orange-500/20 text-orange-300"},device:{label:"Device",color:"bg-orange-500/20 text-orange-300"}};return v.map(D=>I[D]||{label:D,color:"bg-gray-500/20 text-gray-300"})},Q=v=>{const I=Js(v);if(!I.hasSensitiveData)return 0;const D=["email","phone","ssn","password"],M=["address","dob","device"],H=I.sensitiveTypes.some(ue=>D.includes(ue)),G=I.sensitiveTypes.some(ue=>M.includes(ue));return H?3:G?2:1},K=v=>[...v].sort((I,D)=>{if(I.isExposed!==D.isExposed)return D.isExposed?1:-1;if(!I.isExposed&&!D.isExposed){const ie=I.isPubliclyInsertable||I.isPubliclyUpdatable||I.isPubliclyDeletable,ze=D.isPubliclyInsertable||D.isPubliclyUpdatable||D.isPubliclyDeletable;if(ie!==ze)return ze?1:-1}const M=Q(I),H=Q(D);if(M!==H)return H-M;const G=I.isExposed?I.recordCount:0,ue=D.isExposed?D.recordCount:0;return G!==ue?ue-G:I.recordCount!==D.recordCount?D.recordCount-I.recordCount:I.name.localeCompare(D.name)}
152),T=ia(e.tables),$=aa(e.tables),U=jl(e.tables);return e.tables.filter(v=>v.discoveredVia==="frontend_code"||!v.discoveredVia),e.tables.filter(v=>v.discoveredVia==="api_discovery"),i.jsxs("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-2 sm:p-4",children:[i.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-2xl max-w-6xl w-full max-h-[95vh] sm:max-h-[90vh] overflow-hidden flex flex-col",children:[i.jsx("div",{className:"p-3 sm:p-6 border-b border-gray-700",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between sm:block",children:[i.jsx("h2",{className:"text-lg sm:text-2xl font-bold text-white",children:"Scan Results"}),i.jsx("button",{onClick:r,className:"p-1 text-gray-400 hover:text-white hover:bg-gray-700 rounded-lg transition-colors sm:hidden",children:i.jsx(Ln,{className:"w-5 h-5"})})]}),i.jsxs("p",{className:"text-gray-400 mt-1 break-words text-sm sm:text-base",children:[gn(e.url),i.jsxs("span",{className:"hidden sm:inline",children:[" • ",new Date(e.timestamp).toLocaleString()]}),e.platform&&i.jsx("span",{className:"ml-2 px-2 py-1 bg-primary-500/20 text-white text-xs rounded-md",children:e.platform.toUpperCase()})]})]}),i.jsxs("div",{className:"flex items-center justify-between sm:justify-end gap-2 sm:gap-3 flex-shrink-0",children:[i.jsxs("a",{href:"https://calendly.com/tomer-mobb/safevibe-15-minutes-consultation",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center space-x-1 text-xs sm:text-sm text-gray-400 hover:text-white transition-colors",title:"Schedule a 15-minute consultation",onClick:()=>t1(e.url,"scan_modal"),children:[i.jsx(Mf,{className:"w-4 h-4"}),i.jsx("span",{children:"Talk to Expert"})]}),i.jsx("button",{onClick:async()=>{if(a)try{g(!0),await a(e.url,()=>{g(!1),j(!0)})||g(!1)}catch(v){console.error("Rescan failed:",v),g(!1)}else o("/scan",{state:{url:e.url,authenticatedScan:!1}}),r()},disabled:m,className:`inline-flex items-center px-2 sm:px-4 py-1 sm:py-2 text-white text-xs sm:text-sm font-medium rounded-lg transition-colors ${m?"bg-primary-400 cursor-not-allowed":y?"bg-green-600 hover:bg-green-700":"bg-primary-600 hover:bg-primary-700"}`,children:m?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-4 h-4 mr-1 sm:mr-2 border-2 border-white border-t-transparent rounded-full animate-spin"}),i.jsx("span",{className:"hidden sm:inline",children:"Rescanning..."}),i.jsx("span",{className:"sm:hidden",children:"Scanning..."})]}):y?i.jsxs(i.Fragment,{children:[i.jsx(gs,{className:"w-4 h-4 mr-1 sm:mr-2"}),"Updated!"]}):i.jsxs(i.Fragment,{children:[i.jsx(Xi,{className:"w-4 h-4 mr-1 sm:mr-2"}),"Rescan"]})}),i.jsx("button",{onClick:r,className:"hidden sm:block p-2 text-gray-400 hover:text-white hover:bg-gray-700 rounded-lg transition-colors",children:i.jsx(Ln,{className:"w-5 h-5"})})]})]})}),y&&i.jsx("div",{className:"mx-3 sm:mx-6 mt-3 sm:mt-4 p-3 bg-green-500/10 border border-green-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(gs,{className:"w-5 h-5 text-green-400 flex-shrink-0"}),i.jsxs("p",{className:"text-sm text-green-300",children:[i.jsx("span",{className:"font-medium",children:"Scan updated!"})," Latest results are now displayed below."]})]})}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-3 sm:p-6 space-y-4 sm:space-y-6",children:[i.jsxs("div",{className:"bg-gray-700/50 border border-gray-600 rounded-xl p-3 sm:p-6",children:[i.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-white mb-3 sm:mb-4",children:"Security Overview"}),e.status==="completed"&&i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-3 sm:gap-6",children:[i.jsxs("div",{className:"text-center col-span-2 sm:col-span-1",children:[i.jsx("div",{className:`text-lg sm:text-xl font-bold mb-1 sm:mb-2 ${U.color}`,children:U.message}),i.jsx("p",{className:"text-gray-400 text-xs sm:text-sm",children:U.description})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-2xl sm:text-3xl font-bold text-white mb-1 sm:mb-2",children:e.tables.length}),i.jsxs("p",{className:"text-gray-400 text-xs sm:text-sm",children:[e.platform==="base44"?"Entities":"Tables"," Found"]})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:`text-2xl sm:text-3xl font-bold mb-1 sm:mb-2 ${e.tables.filter(v=>v.isExposed).length===0?"text-green-400":"text-red-400"}`,children:e.tables.filter(v=>v.isExposed).length}),i.jsxs("p",{className:"text-gray-400 text-xs sm:text-sm",children:["Exposed ",e.platform==="base44"?"Entities":"Tables"]})]}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:`text-2xl sm:text-3xl font-bold mb-1 sm:mb-2 ${$?"text-red-400":"text-green-400"}`,children:e.tables.filter(v=>v.isPubliclyInsertable||v.isPubliclyUpdatable||v.isPubliclyDeletable).length}),i.jsx("p",{className:"text-gray-400 text-xs sm:text-sm",children:"Write Access"})]}),i.jsx("div",{className:"text-center col-span-2 sm:col-span-1",children:i.jsx("div",{className:`inline-flex items-center px-4 py-2 rounded-xl border-2 ${T===0?"bg-green-500/20 border-green-500/50 text-green-400":"bg-red-500/20 border-red-500/50 text-red-400"}`,children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"text-3xl sm:text-4xl font-black",children:T.toLocaleStr
152ing()}),i.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide opacity-90 mt-1",children:"Exposed Records"})]})})})]}),e.status==="error"&&i.jsx("div",{className:"space-y-4",children:e.errorType==="credentials_error"?i.jsx("div",{className:"p-6 bg-orange-500/10 border border-orange-500/20 rounded-xl",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(Ue,{className:"w-6 h-6 text-orange-400 flex-shrink-0 mt-1"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h4",{className:"text-lg font-medium text-white mb-3",children:"Database Connection Failed"}),i.jsx("p",{className:"text-sm text-gray-300 leading-relaxed mb-4",children:e.userFriendlyError||"Unable to connect to the application database. The credentials may be invalid or the database may be unreachable."}),i.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 mb-4",children:[i.jsx("p",{className:"text-sm text-gray-300 mb-3",children:i.jsx("strong",{children:"Common causes:"})}),i.jsxs("ul",{className:"text-sm text-gray-300 space-y-1 list-disc list-inside",children:[i.jsx("li",{children:"Demo applications with expired or invalid credentials"}),i.jsx("li",{children:"Database access restricted to specific domains or IP addresses"}),i.jsx("li",{children:"API keys that have been revoked or rotated"}),i.jsx("li",{children:"Development/testing databases that are offline"}),i.jsx("li",{children:"Row Level Security (RLS) preventing anonymous access"})]})]}),i.jsxs("div",{className:"bg-blue-500/10 border border-blue-500/20 rounded-lg p-4",children:[i.jsxs("p",{className:"text-sm text-blue-300 mb-2",children:[i.jsx("strong",{children:"💡 This is actually good news!"})," It means the app's credentials aren't publicly accessible even though they're embedded in the code."]}),i.jsx("p",{className:"text-xs text-blue-400",children:"However, if this is your app, you should still consider securing the credentials properly."})]})]})]})}):e.errorType==="auth_token_error"?i.jsx("div",{className:"p-6 bg-blue-500/10 border border-blue-500/20 rounded-xl",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(ir,{className:"w-6 h-6 text-blue-400 flex-shrink-0 mt-1"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h4",{className:"text-lg font-medium text-white mb-3",children:"Authentication Required"}),i.jsx("p",{className:"text-sm text-gray-300 leading-relaxed mb-4",children:e.userFriendlyError||"This app requires user authentication to access data. Row Level Security (RLS) is likely enabled to protect sensitive information."}),i.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 mb-4",children:[i.jsx("p",{className:"text-sm text-gray-300 mb-3",children:i.jsx("strong",{children:"How to scan authenticated apps:"})}),i.jsxs("ol",{className:"text-sm text-gray-300 space-y-2 list-decimal list-inside",children:[i.jsxs("li",{children:["Enable the ",i.jsx("strong",{children:'"Authenticated Scan"'})," toggle in the scan form"]}),i.jsx("li",{children:"Provide login credentials for a test user account"}),i.jsx("li",{children:"We'll scan the app as that authenticated user"}),i.jsx("li",{children:"This reveals what data is accessible to logged-in users"})]})]}),i.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 rounded-lg p-4",children:[i.jsx("p",{className:"text-sm text-red-300 mb-3",children:i.jsx("strong",{children:"⚠️ Run an authenticated scan to make sure your data is safe!"})}),i.jsx("p",{className:"text-xs text-red-400 mb-3",children:"Authentication blocking might not be comprehensive - verify what data is actually accessible to logged-in users."}),i.jsxs("button",{onClick:()=>{o("/scan",{state:{url:e.url,authenticatedScan:!0}}),r()},className:"inline-flex items-center px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium rounded-lg transition-colors",children:[i.jsx(ir,{className:"w-4 h-4 mr-2"}),"Let's do it"]})]})]})]})}):e.errorType==="network_error"?i.jsx("div",{className:"p-6 bg-red-500/10 border border-red-500/20 rounded-xl",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(br,{className:"w-6 h-6 text-red-400 flex-shrink-0 mt-1"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h4",{className:"text-lg font-medium text-white mb-3",children:"Website Unreachable"}),i.jsx("p",{className:"text-sm text-gray-300 leading-relaxed mb-4",children:e.userFriendlyError||"This website appears to be unreachable or experiencing issues. Please try again later."}),i.jsx("div",{className:"bg-gray-800/50 rounded-lg p-4",children:i.jsxs("p",{className:"text-sm text-gray-300",children:[i.jsx("strong",{children:"💡 Suggestion:"})," Check if the website is accessible in your browser, then try scanning again in a few minutes."]})})]})]})}):e.errorType==="unsupported_platform"?i.jsx("div",{className:"p-6 bg-blue-500/10 border border-blue-500/20 rounded-xl",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(ox,{className:"w-6 h-6 text-blue-400 flex-shrink-0 mt-1"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h4",{className:"text-lg font-medium text-white mb-3",children:"We couldn't find a database configured on this app"}),i.jsx("p",{className:"text-sm text-gray-300 leading-relaxed mb-4",children:e.userFriendlyError||"This means this website is either not vibe-coded, or it' a static page with no database configured."}),i.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 mb-4",children:[i.jsxs("p",{className:"text-sm text-gray-300 mb-2",children:[i.jsx("strong",{children:"📝 Help us improve:"})," If this is a relevant vibe-coded app from an unsupported platform, let us know and we'll add it to our list."]}),i.jsx("p",{className:"text-sm text-gray-400",children:"Currently supported: Supabase based apps - Bolt.new, Lovable, V0 - and Base44"})]}),s&&i.jsxs("button",{onClick:()=>w(!0),className:"inline-flex items-center space-x-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors text-sm font-medium",children:[i.jsx(cl,{className:"w-4 h-4"}),i.jsx("span",{children:"Request Platform Support"})]})]})]})}):(z=e.error)!=null&&z.includes("🔒 Authentication Required:")||(oe=e.error)!=null&&oe.includes("403 Forbidden")||(mr=e.error)!=null&&mr.includes("Failed to get app data: 403")||(mt=e.error)!=null&&mt.includes("Failed to get app ID: 403")?i.jsx("div",{className:"p-6 bg-warning-500/10 border border-warning-500/20 rounded-xl",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx("div",{className:"text-2xl",children:"🔒"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h4",{className:"text-lg font-medium text-white mb-3",children:"Authentication Required"}),i.jsx("p",{className:"text-sm text-gray-300 leading-relaxed mb-4",children:"Your website requires login credentials to access data. While I cannot authenticate myself, this doesn't necessarily mean your data is secure."}),i.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4 mb-4",children:[i.jsxs("p",{className:"text-sm text-gray-300 mb-2",children:[i.jsx("strong",{children:"⚠️ Important:"})," If your site allows public registration or uses weak authentication, sensitive data could still be exposed."]}),i.jsxs("p",{className:"text-sm text-gray-300",children:[i.jsx("strong",{children:"💡 Recommendation:"})," Consider running an authenticated scan with an unprivileged test account to get a complete security assessment."]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"flex items-center space-x-2 text-sm text-gray-400",children:i.jsx("span",{children:'💡 Tip: Use the "Authenticated Scan" toggle in the scan form to provide login credentials'})}),i.jsx("button",{onClick:()=>{o("/scan",{state:{url:e.url,authenticatedScan:!0}}),r()},className:"inline-flex items-center px-4 py-2 bg-primary-600 hover:bg-primary-700 text-white text-sm font-medium rounded-lg transition-colors",children:"Run authenticated scan"})]})]})]})}):i.jsx("div",{className:"p-6 bg-gray-500/10 border border-gray-500/20 rounded-xl",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(br,{className:"w-6 h-6 text-gray-400 flex-shrink-0 mt-1"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h4",{className:"text-lg font-medium text-white mb-3",children:"Scan Error"}),i.jsx("p",{className:"text-sm text-gray-300 leading-relaxed mb-4 break-words",children:e.userFriendlyError||e.error||"An unexpected error occurred during the scan."}),e.userFriendlyError&&e.error&&i.jsxs("details",{className:"mb-4",children:[i.jsx("summary",{className:"text-sm text-gray-400 cursor-pointer hover:text-gray-300",children:"Show technical details"}),i.jsx("div",{className:"mt-2 p-3 bg-gray-800/50 rounded-lg",children:i.jsx("code",{className:"text-xs text-gray-300 break-all",children:e.error})})]}),i.jsx("p",{className:"text-sm text-gray-400",children:"Try scanning again, or contact support if the problem persists."})]})]})})})]}),e.platform==="supabase"&&e.tables.length>0&&i.jsxs("div",{className:"bg-gray-700/50 border border-gray-600 rounded-xl p-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-white mb-3",children:"Discovery Summary"}),i.jsxs("div",{className:"space-y-2 mb-4",children:[i.jsxs("p",{className:"text-sm text-gray-400",children:[e.tables.length," tables detected:"]}),i.jsx("div",{className:"max-h-80 overflow-y-auto space-y-1",children:K(e.tables).map((v,I)=>{const D=Js(v),M=v.isPubliclyInsertable||v.isPubliclyUpdatable||v.isPubliclyDeletable,H=P(D.sensitiveTypes);return i.jsxs("div",{className:"grid grid-cols-12 items-center gap-2 py-2 px-2 bg-gray-800/50 rounded text-sm",children:[i.jsx("div",{className:"col-span-4",children:i.jsx("button",{onClick:()=>{const G=document.getElementById(`table-${v.name}`);G&&G.scrollIntoView({behavior:"smooth",block:"start"})},className:"text-gray-300 font-mono hover:text-white transition-colors text-left truncate w-full",children:v.name})}),i.jsx("div",{className:"col-span-3 text-center",children:v.isExposed&&i.jsx("div",{className:"inline-flex items-center px-3 py-1 bg-red-500/20 border border-red-500/30 rounded-full",children:i.jsxs("span",{className:"text-sm text-red-400 font-bold",children:[v.recordCount.toLocaleStr
152ing()," exposed records"]})})}),i.jsxs("div",{className:"col-span-5 flex items-center justify-end space-x-1 flex-wrap gap-1",children:[i.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${v.isExposed?"bg-red-500/20 text-red-300":"bg-green-500/20 text-green-300"}`,children:v.isExposed?"EXPOSED":"NO EXPOSED DATA"}),M&&i.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium bg-red-500/20 text-red-300",children:"PUBLIC WRITE ACCESS"}),D.hasSensitiveData&&v.isExposed&&i.jsx("span",{className:"text-xs px-2 py-0.5 rounded font-medium bg-orange-500/20 text-orange-300 border border-orange-500/30",children:"CHECK DATA"}),H.slice(0,3).map((G,ue)=>i.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-sm font-medium bg-gray-600/30 text-gray-300 border border-gray-500/30",children:G.label},ue)),H.length>3&&i.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded-full font-medium bg-gray-500/20 text-gray-300",children:["+",H.length-3," more"]})]})]},I)})})]}),e.supabaseUrl&&i.jsxs("div",{className:"border-t border-gray-600 pt-3",children:[i.jsxs("button",{onClick:()=>x(!b),className:"flex items-center justify-between w-full text-left hover:bg-gray-600/30 rounded p-2 transition-colors",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Supabase Credentials"}),e.status==="error"&&e.errorType==="credentials_error"&&i.jsx("span",{className:"text-xs px-2 py-0.5 bg-orange-500/20 text-orange-300 rounded-full",children:"Connection Failed"})]}),b?i.jsx(tn,{className:"w-4 h-4 text-gray-400"}):i.jsx(en,{className:"w-4 h-4 text-gray-400"})]}),b&&i.jsxs("div",{className:"mt-2 p-3 bg-gray-800/30 rounded-lg",children:[e.status==="error"&&e.errorType==="credentials_error"&&i.jsx("div",{className:"mb-3 p-2 bg-orange-500/10 border border-orange-500/20 rounded-lg",children:i.jsx("p",{className:"text-xs text-orange-300",children:"⚠️ Credentials found but couldn't connect to database."})}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1",children:"Supabase URL"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("code",{className:"flex-1 bg-gray-800 px-2 py-1 rounded text-xs text-gray-300 break-all",children:e.supabaseUrl}),i.jsx("button",{onClick:()=>N(e.supabaseUrl),className:"p-1 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors flex-shrink-0",title:"Copy to clipboard",children:i.jsx(so,{className:"w-3 h-3"})})]})]}),e.apiKey&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1",children:"API Key (JWT)"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsxs("code",{className:"flex-1 bg-gray-800 px-2 py-1 rounded text-xs text-gray-300 font-mono break-all",children:[e.apiKey.substring(0,30),"..."]}),i.jsx("button",{onClick:()=>N(e.apiKey),className:"p-1 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors flex-shrink-0",title:"Copy to clipboard",children:i.jsx(so,{className:"w-3 h-3"})})]})]})]})]})]})]}),e.platform==="base44"&&e.tables.length>0&&i.jsxs("div",{className:"bg-gray-700/50 border border-gray-600 rounded-xl p-4",children:[i.jsx("h3",{className:"text-lg font-semibold text-white mb-3",children:"Discovery Summary"}),i.jsxs("div",{className:"space-y-2 mb-4",children:[i.jsxs("p",{className:"text-sm text-gray-400",children:[e.tables.length," entities detected:"]}),i.jsx("div",{className:"max-h-80 overflow-y-auto space-y-1",children:K(e.tables).map((v,I)=>{const D=Js(v),M=v.isPubliclyInsertable||v.isPubliclyUpdatable||v.isPubliclyDeletable,H=P(D.sensitiveTypes);return i.jsxs("div",{className:"grid grid-cols-12 items-center gap-2 py-2 px-2 bg-gray-800/50 rounded text-sm",children:[i.jsx("div",{className:"col-span-4",children:i.jsx("button",{onClick:()=>{const G=document.getElementById(`table-${v.name}`);G&&G.scrollIntoView({behavior:"smooth",block:"start"})},className:"text-gray-300 font-mono hover:text-white transition-colors text-left truncate w-full",children:v.name})}),i.jsx("div",{className:"col-span-3 text-center",children:v.isExposed&&i.jsx("div",{className:"inline-flex items-center px-3 py-1 bg-red-500/20 border border-red-500/30 rounded-full",children:i.jsxs("span",{className:"text-sm text-red-400 font-bold",children:[v.recordCount.toLocaleStr
152ing()," exposed records"]})})}),i.jsxs("div",{className:"col-span-5 flex items-center justify-end space-x-1 flex-wrap gap-1",children:[i.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-medium ${v.isExposed?"bg-red-500/20 text-red-300":"bg-green-500/20 text-green-300"}`,children:v.isExposed?"EXPOSED":"NO EXPOSED DATA"}),M&&i.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium bg-red-500/20 text-red-300",children:"PUBLIC WRITE ACCESS"}),D.hasSensitiveData&&v.isExposed&&i.jsx("span",{className:"text-xs px-2 py-0.5 rounded font-medium bg-orange-500/20 text-orange-300 border border-orange-500/30",children:"CHECK DATA"}),H.slice(0,3).map((G,ue)=>i.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-sm font-medium bg-gray-600/30 text-gray-300 border border-gray-500/30",children:G.label},ue)),H.length>3&&i.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded-full font-medium bg-gray-500/20 text-gray-300",children:["+",H.length-3," more"]})]})]},I)})})]}),e.base44AppId&&i.jsxs("div",{className:"border-t border-gray-600 pt-3",children:[i.jsxs("button",{onClick:()=>x(!b),className:"flex items-center justify-between w-full text-left hover:bg-gray-600/30 rounded p-2 transition-colors",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Base44 Application Details"}),e.status==="error"&&e.errorType==="credentials_error"&&i.jsx("span",{className:"text-xs px-2 py-0.5 bg-orange-500/20 text-orange-300 rounded-full",children:"Connection Failed"})]}),b?i.jsx(tn,{className:"w-4 h-4 text-gray-400"}):i.jsx(en,{className:"w-4 h-4 text-gray-400"})]}),b&&i.jsxs("div",{className:"mt-2 p-3 bg-gray-800/30 rounded-lg",children:[e.status==="error"&&e.errorType==="credentials_error"&&i.jsx("div",{className:"mb-3 p-2 bg-orange-500/10 border border-orange-500/20 rounded-lg",children:i.jsx("p",{className:"text-xs text-orange-300",children:"⚠️ Base44 application detected but backend connection failed."})}),i.jsx("div",{className:"space-y-3",children:i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1",children:"Application ID"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("code",{className:"flex-1 bg-gray-800 px-2 py-1 rounded text-xs text-gray-300 break-all",children:e.base44AppId}),i.jsx("button",{onClick:()=>N(e.base44AppId),className:"p-1 text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors flex-shrink-0",title:"Copy to clipboard",children:i.jsx(so,{className:"w-3 h-3"})})]})]})})]})]})]}),i.jsxs("div",{className:"bg-gray-700/50 border border-gray-600 rounded-xl overflow-hidden",children:[i.jsx("div",{className:"border-b border-gray-600",children:i.jsxs("div",{className:"flex",children:[i.jsx("button",{onClick:()=>h("tables"),className:`px-6 py-4 text-sm font-medium transition-colors ${u==="tables"?"bg-gray-600 text-white border-b-2 border-primary-500":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Ir,{className:"w-4 h-4"}),i.jsx("span",{children:e.platform==="base44"?"Entities":"Tables"}),i.jsx("span",{className:"bg-gray-500 text-white text-xs px-2 py-1 rounded-full",children:e.tables.length})]})}),i.jsx("button",{onClick:()=>h("functions"),className:`px-6 py-4 text-sm font-medium transition-colors ${u==="functions"?"bg-gray-600 text-white border-b-2 border-primary-500":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(qs,{className:"w-4 h-4"}),i.jsx("span",{children:"Backend Functions"}),i.jsx("span",{className:"bg-gray-500 text-white text-xs px-2 py-1 rounded-full",children:(((Br=e.edgeFunctionResults)==null?void 0:Br.length)||0)+(((gt=e.backendFunctions)==null?void 0:gt.length)||0)}),i.jsx("span",{className:"bg-primary-500/20 text-primary-300 text-xs px-2 py-1 rounded-full font-medium",children:"BETA"})]})}),i.jsx("button",{onClick:()=>h("pages"),className:`px-6 py-4 text-sm font-medium transition-colors ${u==="pages"?"bg-gray-600 text-white border-b-2 border-primary-500":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(di,{className:"w-4 h-4"}),i.jsx("span",{children:"Pages"}),i.jsx("span",{className:"bg-gray-500 text-white text-xs px-2 py-1 rounded-full",children:((gr=e.pages)==null?void 0:gr.totalPages)||0}),i.jsx("span",{className:"bg-primary-500/20 text-primary-300 text-xs px-2 py-1 rounded-full font-medium",children:"BETA"})]})})]})}),i.jsxs("div",{className:"p-3 sm:p-6",children:[u==="tables"&&i.jsxs("div",{children:[i.jsxs("h3",{className:"text-lg sm:text-xl font-semibold text-white mb-4 sm:mb-6",children:[e.platform==="base44"?"Entity":"Table"," Analysis"]}),e.tables.length>0?i.jsx("div",{className:"space-y-3 sm:space-y-4",children:K(e.tables).map(v=>{const I=Js(v),D=P(I.sensitiveTypes);return i.jsxs("div",{id:`table-${v.name}`,className:`bg-gray-800/50 border rounded-xl p-3 sm:p-6 overflow-hidden ${I.hasSensitiveData?"border-red-500/50":"border-gray-600"}`,children:[i.jsxs("div",{className:"mb-3 sm:mb-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-3 min-w-0 flex-1",children:[v.isExposed?i.jsx(br,{className:"w-4 h-4 sm:w-5 sm:h-5 text-red-400 flex-shrink-0"}):i.jsx(gs,{className:"w-4 h-4 sm:w-5 sm:h-5 text-green-400 flex-shrink-0"}),i.jsx("h4",{className:"text-base sm:text-lg font-medium text-white break-words",children:v.name})]}),i.jsx("a",{href:v.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-primary-300 transition-colors flex-shrink-0",title:"Open API endpoint",children:i.jsx(qe,{className:"w-4 h-4 text-white"})})]}),i.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${v.isExposed?"bg-red-500/20 text-red-300":"bg-green-500/20 text-green-300"}`,children:v.isExposed?"EXPOSED":"NO EXPOSED DATA"}),I.hasSensitiveData&&v.isExposed&&i.jsx("span",{className:"text-xs px-2 py-1 rounded font-medium bg-orange-500/20 text-orange-300 border border-orange-500/30",children:"CHECK DATA"}),(v.isPubliclyInsertable||v.isPubliclyUpdatable||v.isPubliclyDeletable)&&i.jsx("span",{className:"text-xs px-2 py-1 rounded-full font-medium bg-red-500/20 text-red-300",children:"PUBLIC WRITE ACCESS"}),e.platform==="supabase"&&v.discoveredVia==="api_discovery"&&i.jsx("span",{className:"text-xs px-2 py-1 rounded-full font-medium bg-orange-500/20 text-orange-300",children:"API DISCOVERED"})]})]}),I.hasSensitiveData&&i.jsx("div",{className:"mb-3 sm:mb-4 flex flex-wrap gap-2 hidden sm:flex",children:D.map((M,H)=>i.jsx("span",{className:"px-2 py-1 rounded-sm text-xs font-medium bg-gray-600/30 text-gray-300 border border-gray-500/30",children:M.label},H))}),e.platform==="supabase"&&v.discoveredVia==="api_discovery"&&i.jsx("div",{className:"mb-3 sm:mb-4 p-2 sm:p-3 bg-warning-500/10 border border-warning-500/20 rounded-lg hidden sm:block",children:i.jsxs("div",{className:"flex items-start space-x-2",children:[i.jsx(Xi,{className:"w-4 h-4 text-white flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"text-sm text-white",children:[i.jsx("p",{className:"font-medium mb-1",children:"API-Discovered Table"}),i.jsx("p",{className:"text-xs sm:text-sm",children:_t(v.discoveredVia)})]})]})}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-4 mb-3 sm:mb-4",children:[i.jsxs("div",{className:"min-w-0 flex justify-between sm:block",children:[i.jsx("span",{className:"text-xs sm:text-sm text-gray-400",children:"Records:"}),v.isExposed?i.jsx("div",{className:"inline-flex items-center px-2 py-1 bg-red-500/20 border border-red-500/30 rounded-full sm:ml-2",children:i.jsx("span",{className:"text-xs sm:text-sm text-red-400 font-bold",children:v.recordCount.toLocaleStr
152ing()})}):i.jsx("span",{className:"text-xs sm:text-sm text-white font-medium sm:ml-2",children:v.recordCount.toLocaleString()})]}),i.jsxs("div",{className:"min-w-0 flex justify-between sm:block",children:[i.jsx("span",{className:"text-xs sm:text-sm text-gray-400",children:e.platform==="base44"?"Properties:":"Columns:"}),i.jsx("span",{className:"text-xs sm:text-sm text-white font-medium sm:ml-2",children:v.columns?v.columns.length:"Unknown"})]}),i.jsxs("div",{className:"min-w-0 flex justify-between sm:block",children:[i.jsx("span",{className:"text-xs sm:text-sm text-gray-400",children:"Status:"}),i.jsx("span",{className:`text-xs sm:text-sm font-medium sm:ml-2 ${v.isExposed?"text-red-300":"text-green-300"}`,children:v.isExposed?"Exposed":"Secure"})]})]}),(v.isPubliclyInsertable||v.isPubliclyUpdatable||v.isPubliclyDeletable)&&i.jsxs("div",{className:"mb-3 sm:mb-4 p-2 sm:p-3 bg-danger-500/20 border border-danger-500/30 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-2 mb-1 sm:mb-2",children:[i.jsx(Ue,{className:"w-3 h-3 sm:w-4 sm:h-4 text-white flex-shrink-0"}),i.jsx("span",{className:"text-xs sm:text-sm font-medium text-white",children:"Public Write Access"})]}),i.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-4 text-xs",children:[v.isPubliclyInsertable&&i.jsxs("div",{className:"flex items-center space-x-1 text-white",children:[i.jsx(Vf,{className:"w-3 h-3"}),i.jsx("span",{className:"hidden sm:inline",children:"Insert"}),i.jsx("span",{className:"sm:hidden",children:"+"})]}),v.isPubliclyUpdatable&&i.jsxs("div",{className:"flex items-center space-x-1 text-white",children:[i.jsx(Wf,{className:"w-3 h-3"}),i.jsx("span",{className:"hidden sm:inline",children:"Update"}),i.jsx("span",{className:"sm:hidden",children:"✏️"})]}),v.isPubliclyDeletable&&i.jsxs("div",{className:"flex items-center space-x-1 text-white",children:[i.jsx(jc,{className:"w-3 h-3"}),i.jsx("span",{className:"hidden sm:inline",children:"Delete"}),i.jsx("span",{className:"sm:hidden",children:"🗑️"})]})]})]}),v.columns&&v.columns.length>0&&i.jsxs("div",{className:"mb-3 sm:mb-4",children:[i.jsxs("button",{onClick:()=>k(v.name),className:"inline-flex items-center space-x-2 text-xs sm:text-sm text-white hover:text-primary-300 font-medium transition-colors mb-2 sm:mb-3",children:[i.jsx(Bf,{className:"w-3 h-3 sm:w-4 sm:h-4 text-white"}),i.jsxs("span",{className:"text-white",children:[l[v.name]?"Hide":"Show"," ",e.platform==="base44"?"Properties":"Columns"," (",v.columns.length,")"]})]}),l[v.name]&&i.jsx("div",{className:"bg-gray-900/50 rounded-lg p-2 sm:p-4 overflow-hidden",children:i.jsx("div",{className:"grid gap-2 sm:gap-3",children:v.columns.map((M,H)=>{const G=I.sensitiveColumns.some(ie=>ie.name===M.name),ue=I.sensitiveColumns.find(ie=>ie.name===M.name);return i.jsxs("div",{className:`flex items-center justify-between py-1 sm:py-2 border-b last:border-b-0 min-w-0 ${G?"border-red-500/30 bg-red-500/5":"border-gray-600"}`,children:[i.jsxs("div",{className:"flex items-center space-x-2 sm:space-x-3 min-w-0 flex-1",children:[i.jsx(Ir,{className:"w-3 h-3 sm:w-4 sm:h-4 text-gray-400 flex-shrink-0"}),i.jsx("span",{className:"text-white font-medium truncate text-sm sm:text-base",children:M.name}),G&&i.jsx("span",{className:"text-xs bg-red-500/20 text-red-300 px-1 sm:px-2 py-1 rounded flex-shrink-0",children:ue==null?void 0:ue.sensitiveType}),M.nullable&&i.jsx("span",{className:"text-xs bg-gray-600 text-gray-300 px-1 sm:px-2 py-1 rounded flex-shrink-0 hidden sm:inline",children:"nullable"})]}),i.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2 flex-shrink-0",children:[i.jsx("span",{className:`text-xs sm:text-sm font-mono ${Ze(M.type)}`,children:M.type}),M.default&&i.jsxs("span",{className:"text-xs text-gray-400 truncate max-w-16 sm:max-w-20 hidden sm:inline",title:`default: ${M.default}`,children:["default: ",M.default]})]})]},H)})})})]}),v.error&&i.jsx("div",{className:"mb-3 sm:mb-4 p-2 sm:p-3 bg-warning-500/10 border border-warning-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-start space-x-2",children:[i.jsx(Ue,{className:"w-3 h-3 sm:w-4 sm:h-4 text-white flex-shrink-0 mt-0.5"}),i.jsxs("span",{className:"text-xs sm:text-sm text-white break-words",children:["Probe error: ",v.error]})]})}),v.writeAccessError&&i.jsx("div",{className:"mb-3 sm:mb-4 p-2 sm:p-3 bg-warning-500/10 border border-warning-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-start space-x-2",children:[i.jsx(Ue,{className:"w-3 h-3 sm:w-4 sm:h-4 text-white flex-shrink-0 mt-0.5"}),i.jsxs("span",{className:"text-xs sm:text-sm text-white break-words",children:["Write access test error: ",v.writeAccessError]})]})}),v.isExposed&&i.jsx("div",{className:"mt-3 sm:mt-4 p-3 sm:p-4 bg-danger-500/10 border border-danger-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-start space-x-2 sm:space-x-3",children:[i.jsx(Ue,{className:"w-4 h-4 sm:w-5 sm:h-5 text-white flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h5",{className:"font-medium text-white mb-2 text-sm sm:text-base",children:"Security Risk Detected"}),i.jsxs("p",{className:"text-xs sm:text-sm text-gray-300 mb-2 sm:mb-3 break-words leading-relaxed",children:["This ",e.platform==="base44"?"entity":"table"," is publicly accessible with ",v.recordCount," records",v.columns&&` across ${v.columns.length} ${e.platform==="base44"?"properties":"columns"}`,".",(v.isPubliclyInsertable||v.isPubliclyUpdatable||v.isPubliclyDeletable)&&" Additionally, this data allows public write operations.",i.jsxs("span",{className:"hidden sm:inline",children:[e.platform==="supabase"&&" Consider implementing Row Level Security (RLS) to protect sensitive data.",e.platform==="base44"&&" Consider implementing proper access controls to protect sensitive data.",v.discoveredVia==="api_discovery"&&" Since this table was not found in your frontend code, it may be a backend-only table that is unintentionally exposed."]})]}),v.sampleRecord&&i.jsxs("div",{className:"mb-2 sm:mb-3",children:[i.jsxs("div",{className:"mb-1 sm:mb-2 flex items-center justify-between",children:[i.jsx("span",{className:"text-xs sm:text-sm font-medium text-white",children:"Sample Data:"}),(()=>{const M=JSON.stringify(v.sampleRecord).length,H=JSON.stringify(V(v.sampleRecord)).length;return M>H&&i.jsxs("span",{className:"text-xs text-orange-300 bg-orange-500/20 px-1 sm:px-2 py-1 rounded hidden sm:inline",children:["Truncated (",(M/1024).toFixed(1),"KB → ",(H/1024).toFixed(1),"KB)"]}
152)})()]}),i.jsx("div",{className:"p-2 sm:p-3 bg-gray-800 rounded-lg overflow-hidden",children:i.jsx("div",{className:"text-xs overflow-x-auto whitespace-pre-wrap break-words max-h-48 sm:max-h-96 overflow-y-auto",children:Oe(v.sampleRecord,v)})})]}),i.jsx("button",{className:"text-xs sm:text-sm text-white hover:text-gray-200 font-medium transition-colors",onClick:()=>{const H=`/fix-instructions/${e.platform||"supabase"}`;window.open(H,"_blank")},children:"View Fix Instructions →"})]})]})})]},v.name)})}):i.jsxs("div",{className:"text-center py-8",children:[i.jsx(Ir,{className:"w-12 h-12 text-gray-500 mx-auto mb-4"}),i.jsxs("p",{className:"text-gray-400",children:["No ",e.platform==="base44"?"entities":"tables"," found"]})]})]}),u==="functions"&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-3 mb-6",children:[i.jsx(qs,{className:"w-6 h-6 text-white"}),i.jsx("h3",{className:"text-xl font-semibold text-white",children:"Backend Functions"}),i.jsx("span",{className:"bg-primary-500/20 text-primary-300 text-xs px-3 py-1 rounded-full font-medium",children:"BETA FEATURE"})]}),i.jsx("div",{className:"mb-4 p-4 bg-blue-500/10 border border-blue-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(ea,{className:"w-5 h-5 text-blue-400 flex-shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-white mb-2",children:"Edge Function Detection (Beta)"}),i.jsx("p",{className:"text-sm text-gray-300",children:"This feature automatically discovers and tests backend functions (like Supabase Edge Functions) found in your application code. Function calls are probed to understand their behavior and potential security risks."})]})]})}),e.edgeFunctionResults&&e.edgeFunctionResults.length>0||e.backendFunctions&&e.backendFunctions.length>0?i.jsxs("div",{className:"space-y-4",children:[e.edgeFunctionResults&&e.edgeFunctionResults.map(v=>{const I=v.error||v.status===0,D=v.status>=200&&v.status<300,M=v.responseBody&&v.responseBody.trim().length>0;return i.jsxs("div",{className:`bg-gray-800/50 border rounded-xl p-6 overflow-hidden ${I?"border-gray-600":D?"border-success-500/30":"border-warning-500/30"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[i.jsx(qs,{className:"w-5 h-5 text-white flex-shrink-0"}),i.jsx("h4",{className:"text-lg font-medium text-white truncate",children:v.name}),i.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${R(v.status)}`,children:v.status===0?"Network Error":`${v.status} ${v.statusText}`}),v.discoveredCalls>0&&i.jsxs("span",{className:"text-xs bg-gray-600 text-gray-300 px-2 py-1 rounded",children:[v.discoveredCalls," call",v.discoveredCalls>1?"s":""," found"]})]}),i.jsx("a",{href:v.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-primary-300 transition-colors flex-shrink-0",title:"Open function endpoint",children:i.jsx(qe,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"grid md:grid-cols-3 gap-4 mb-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Status:"}),i.jsx("span",{className:`ml-2 text-sm font-medium ${O(v.status)}`,children:v.status===0?"Network Error":v.status>=200&&v.status<300?"Accessible":v.status>=400&&v.status<500?"Client Error":"Server Error"})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Endpoint:"}),i.jsx("span",{className:"ml-2 text-sm text-white truncate",children:v.endpoint.split("/").pop()})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Calls Found:"}),i.jsx("span",{className:"ml-2 text-sm text-white",children:v.discoveredCalls})]})]}),D&&i.jsxs("div",{className:"mb-4 p-3 bg-warning-500/10 border border-warning-500/20 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Ue,{className:"w-4 h-4 text-white flex-shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-white",children:"Function Accessible"})]}),i.jsx("p",{className:"text-sm text-gray-300 mt-1",children:"This backend function responded successfully. Review the response to ensure no sensitive data is exposed."})]}),I&&i.jsxs("div",{className:"mb-4 p-3 bg-gray-600/20 border border-gray-500/20 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(br,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-white",children:"Function Error"})]}),i.jsx("p",{className:"text-sm text-gray-300 mt-1",children:v.error||`Request failed with status ${v.status}`})]}),i.jsxs("div",{className:"mb-4",children:[i.jsxs("button",{onClick:()=>_(v.name),className:"inline-flex items-center space-x-2 text-sm text-white hover:text-primary-300 font-medium transition-colors",children:[d[v.name]===!1?i.jsx(en,{className:"w-4 h-4"}):i.jsx(tn,{className:"w-4 h-4"}),i.jsxs("span",{children:[d[v.name]===!1?"Show":"Hide"," Function Details"]}
152)]}),d[v.name]!==!1&&i.jsxs("div",{className:"mt-3 space-y-4",children:[v.inferredPayload&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Inferred Request Payload"}),i.jsx("div",{className:"bg-gray-900/50 rounded-lg p-3",children:i.jsx("pre",{className:"text-xs text-gray-300 overflow-x-auto",children:(()=>{try{return JSON.stringify(JSON.parse(v.inferredPayload),null,2)}catch{return v.inferredPayload}})()})})]}),Object.keys(v.responseHeaders).length>0&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Response Headers"}),i.jsx("div",{className:"bg-gray-900/50 rounded-lg p-3",children:i.jsx("div",{className:"space-y-1",children:Object.entries(v.responseHeaders).map(([H,G])=>i.jsxs("div",{className:"flex text-xs",children:[i.jsxs("span",{className:"text-blue-300 font-medium w-32 flex-shrink-0",children:[H,":"]}),i.jsx("span",{className:"text-gray-300 truncate",children:G})]},H))})})]}),M&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Response Body"}),i.jsx("div",{className:"bg-gray-900/50 rounded-lg p-3",children:i.jsx("pre",{className:"text-xs text-gray-300 overflow-x-auto whitespace-pre-wrap break-words",children:v.responseBody})})]})]})]})]},v.name)}),e.backendFunctions&&e.backendFunctions.map(v=>{const I=v.error||v.status===0,D=v.status>=200&&v.status<300;return i.jsxs("div",{className:`bg-gray-800/50 border rounded-xl p-6 overflow-hidden ${I?"border-gray-600":D?"border-success-500/30":"border-warning-500/30"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[i.jsx(qs,{className:"w-5 h-5 text-white flex-shrink-0"}),i.jsx("h4",{className:"text-lg font-medium text-white truncate",children:v.name}),i.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${R(v.status)}`,children:v.status===0?"Network Error":`${v.status}`}),i.jsx("span",{className:"text-xs bg-purple-500/20 text-purple-300 px-2 py-1 rounded",children:"Base44 Function"})]}),i.jsx("a",{href:v.endpoint,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-primary-300 transition-colors flex-shrink-0",title:"Open function endpoint",children:i.jsx(qe,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"grid md:grid-cols-3 gap-4 mb-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Status:"}),i.jsx("span",{className:`ml-2 text-sm font-medium ${O(v.status)}`,children:v.status===0?"Network Error":v.accessible?"Accessible":"Not Accessible"})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Response Time:"}),i.jsx("span",{className:"ml-2 text-sm text-white",children:v.responseTime?`${v.responseTime}ms`:"N/A"})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Endpoint:"}),i.jsx("span",{className:"ml-2 text-sm text-white truncate",children:v.endpoint.split("/").pop()})]})]}),v.accessible&&i.jsxs("div",{className:"mb-4 p-3 bg-warning-500/10 border border-warning-500/20 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Ue,{className:"w-4 h-4 text-white flex-shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-white",children:"Function Accessible"})]}),i.jsx("p",{className:"text-sm text-gray-300 mt-1",children:"This backend function responded successfully. Review the response to ensure no sensitive data is exposed."})]}),I&&i.jsxs("div",{className:"mb-4 p-3 bg-gray-600/20 border border-gray-500/20 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(br,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-white",children:"Function Error"})]}),i.jsx("p",{className:"text-sm text-gray-300 mt-1",children:v.error||`Request failed with status ${v.status}`})]}),i.jsxs("div",{className:"mb-4",children:[i.jsxs("button",{onClick:()=>_(v.name),className:"inline-flex items-center space-x-2 text-sm text-white hover:text-primary-300 font-medium transition-colors",children:[d[v.name]===!1?i.jsx(en,{className:"w-4 h-4"}):i.jsx(tn,{className:"w-4 h-4"}),i.jsxs("span",{children:[d[v.name]===!1?"Show":"Hide"," Function Details"]}
152)]}),d[v.name]!==!1&&i.jsx("div",{className:"mt-3 space-y-4",children:v.response&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2",children:"Response"}),i.jsx("div",{className:"bg-gray-900/50 rounded-lg p-3",children:i.jsx("pre",{className:"text-xs text-gray-300 overflow-x-auto whitespace-pre-wrap break-words",children:typeof v.response=="string"?v.response:JSON.stringify(v.response,null,2)})})]})})]})]},v.name)})]}):i.jsxs("div",{className:"text-center py-8",children:[i.jsx(qs,{className:"w-12 h-12 text-gray-500 mx-auto mb-4"}),i.jsx("p",{className:"text-gray-400 mb-2",children:"No backend functions detected"}),i.jsx("p",{className:"text-sm text-gray-500",children:"Backend functions will appear here when discovered and probed during scanning."})]})]}),u==="pages"&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center space-x-3 mb-6",children:[i.jsx(di,{className:"w-6 h-6 text-white"}),i.jsx("h3",{className:"text-xl font-semibold text-white",children:"Page Security Analysis"}),i.jsx("span",{className:"bg-primary-500/20 text-primary-300 text-xs px-3 py-1 rounded-full font-medium",children:"BETA FEATURE"})]}),i.jsx("div",{className:"mb-4 p-4 bg-blue-500/10 border border-blue-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(ir,{className:"w-5 h-5 text-blue-400 flex-shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-medium text-white mb-2",children:"Page Discovery and Security Testing (Beta)"}),i.jsx("p",{className:"text-sm text-gray-300",children:"This feature automatically discovers application pages from frontend routes, sitemaps, and common paths. It tests for unauthorized access to sensitive pages like admin panels and identifies potential security risks."})]})]})}),e.pages&&e.pages.pages.length>0?i.jsxs("div",{children:[i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[i.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-white",children:e.pages.totalPages}),i.jsx("div",{className:"text-sm text-gray-400",children:"Total Pages"})]}),i.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-orange-400",children:e.pages.sensitivePagesFound}),i.jsx("div",{className:"text-sm text-gray-400",children:"Sensitive Pages"})]}),i.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[i.jsx("div",{className:`text-2xl font-bold ${e.pages.unsecuredSensitivePages>0?"text-red-400":"text-green-400"}`,children:e.pages.unsecuredSensitivePages}),i.jsx("div",{className:"text-sm text-gray-400",children:"Unsecured Sensitive"})]}),i.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[i.jsx("div",{className:"text-2xl font-bold text-blue-400",children:e.pages.discoveryMethods.length}),i.jsx("div",{className:"text-sm text-gray-400",children:"Discovery Methods"})]})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("h4",{className:"text-sm font-medium text-gray-400 mb-2",children:"Discovery Methods Used"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:e.pages.discoveryMethods.map(v
152=>i.jsx("span",{className:"bg-gray-700 text-gray-300 text-xs px-2 py-1 rounded",children:v.replace("_"," ").replace(/\b\w/g,I=>I.toUpperCase())},v))})]}),i.jsx("div",{className:"space-y-4",children:e.pages.pages.sort((v,I)=>{const D={critical:4,high:3,medium:2,low:1},M=D[v.sensitivityLevel],H=D[I.sensitivityLevel];if(M!==H)return H-M;if(v.sensitivityLevel!=="low"&&I.sensitivityLevel!=="low"){if(v.status===200&&I.status!==200)return-1;if(v.status!==200&&I.status===200)return 1}return v.path.localeCompare(I.path)}).map(v=>{const I=v.status===200,D=v.sensitivityLevel==="high"||v.sensitivityLevel==="critical",M=D&&I&&!v.requiresAuth;return i.jsxs("div",{className:`bg-gray-800/50 border rounded-xl p-6 ${M?"border-red-500/50":D?"border-orange-500/30":"border-gray-700"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[i.jsx(di,{className:"w-5 h-5 text-white flex-shrink-0"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h4",{className:"text-lg font-medium text-white truncate",children:v.path}),i.jsx("p",{className:"text-sm text-gray-400 truncate",children:E(v.path,e.url)})]}),i.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${R(v.status)}`,children:v.status===0?"Network Error":v.status}),i.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${v.sensitivityLevel==="critical"?"bg-red-500/20 text-red-300":v.sensitivityLevel==="high"?"bg-orange-500/20 text-orange-300":v.sensitivityLevel==="medium"?"bg-yellow-500/20 text-yellow-300":"bg-gray-500/20 text-gray-300"}`,children:v.sensitivityLevel.toUpperCase()}),i.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${v.pageType==="admin"?"bg-red-500/20 text-red-300":v.pageType==="protected"?"bg-yellow-500/20 text-yellow-300":v.pageType==="api"?"bg-blue-500/20 text-blue-300":"bg-green-500/20 text-green-300"}`,children:v.pageType.toUpperCase()}),v.requiresAuth?i.jsx(zf,{className:"w-4 h-4 text-green-400"}):I?i.jsx(hx,{className:"w-4 h-4 text-orange-400"}):null]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(nx,{className:"w-4 h-4 text-gray-400"}),i.jsxs("span",{className:"text-sm text-gray-400",children:[v.responseTime,"ms"]}),i.jsx("a",{href:E(v.path,e.url),target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-primary-300 transition-colors",title:"Open page in new tab",children:i.jsx(qe,{className:"w-4 h-4"})})]})]}),M&&i.jsxs("div",{className:"mb-4 p-3 bg-red-500/10 border border-red-500/20 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Ue,{className:"w-4 h-4 text-red-400 flex-shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-white",children:"Security Risk: Unsecured Sensitive Page"})]}),i.jsx("p",{className:"text-sm text-gray-300 mt-1",children:"This sensitive page is accessible without authentication. This could expose administrative functions or sensitive information to unauthorized users."})]}),i.jsxs("div",{className:"grid md:grid-cols-3 gap-4 mb-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Title:"}),i.jsx("span",{className:"ml-2 text-sm text-white",children:v.title||"No title"})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Discovery:"}),i.jsx("span",{className:"ml-2 text-sm text-white",children:v.discoveredVia.replace("_"," ").replace(/\b\w/g,H=>H.toUpperCase())})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Content Size:"}),i.jsx("span",{className:"ml-2 text-sm text-white",children:v.contentLength?`${(v.contentLength/1024).toFixed(1)}KB`:"Unknown"})]})]}),(v.hasLoginForm||v.hasAdminFeatures)&&i.jsxs("div",{className:"mb-4",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Features detected:"}),i.jsxs("div",{className:"flex space-x-2 mt-1",children:[v.hasLoginForm&&i.jsx("span",{className:"bg-blue-500/20 text-blue-300 text-xs px-2 py-1 rounded",children:"Login Form"}),v.hasAdminFeatures&&i.jsx("span",{className:"bg-red-500/20 text-red-300 text-xs px-2 py-1 rounded",children:"Admin Features"})]})]}),v.redirectsTo&&i.jsxs("div",{className:"mb-4",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Redirects to:"}),i.jsx("span",{className:"ml-2 text-sm text-blue-300",children:v.redirectsTo})]}),v.error&&i.jsxs("div",{className:"mb-4 p-3 bg-gray-600/20 border border-gray-500/20 rounded-lg",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(br,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),i.jsx("span",{className:"text-sm font-medium text-white",children:"Error"})]}),i.jsx("p",{className:"text-sm text-gray-300 mt-1",children:v.error})]})]},v.path)})})]}):i.jsxs("div",{className:"text-center py-8",children:[i.jsx(di,{className:"w-12 h-12 text-gray-500 mx-auto mb-4"}),i.jsx("p",{className:"text-gray-400 mb-2",children:"No pages analyzed"}),i.jsx("p",{className:"text-sm text-gray-500",children:"Page discovery and security analysis will appear here when completed during scanning."})]})]})]})]})]})]}),i.jsx(j1,{isOpen:p,onClose:()=>w(!1),url:e.url,userId:s||"",userEmail:n})]})},Cc=()=>{const[e,t]=S.useState([]),[r,s]=S.useState([]),[n,a]=S.useState(!0),{user:o}=Ls(),l=async()=>
152{if(!o){t([]),s([]),a(!1);return}try{const{data:d,error:f}=await Ce.from("scan_results").select("*").eq("user_id",o.id).order("timestamp",{ascending:!1}).limit(100);if(f){console.error("Error loading scan history:",f);return}if(d){const w=d.map(x=>({id:x.id,url:x.url,timestamp:x.timestamp,platform:x.platform,supabaseUrl:x.supabase_url,apiKey:x.api_key,base44AppId:x.base44_app_id,tables:x.tables||[],edgeFunctionResults:x.edge_function_results||[],backendFunctions:x.backend_functions||[],pages:x.pages||void 0,status:x.status,error:x.error,user_id:x.user_id,is_authenticated:x.is_authenticated||!1})).filter(x=>x.status==="completed"&&x.tables.length>0&&(x.platform==="supabase"&&x.supabaseUrl||x.platform==="base44"&&x.base44AppId||!x.platform&&x.supabaseUrl));t(w);const b=new Map;w.forEach(x=>{const m=qt(x.url),g=b.get(m);g?x.timestamp>g.lastScan?b.set(m,{...g,lastScan:x.timestamp,scanCount:g.scanCount+1,lastResult:x}):b.set(m,{...g,scanCount:g.scanCount+1}):b.set(m,{url:x.url,lastScan:x.timestamp,scanCount:1,lastResult:x,user_id:x.user_id})}),s(Array.from(b.values()))}}catch(d){console.error("Error loading scan history:",d)}finally{a(!1)}};S.useEffect(()=>{l()},[o]);const c=async d=>{var f;if(!o)return console.error("Cannot save scan result: user not authenticated"),d;try{const p={...d,user_id:o.id,url:qt(d.url)};console.log("Attempting to save scan result:",{user_id:p.user_id,url:p.url,timestamp:p.timestamp,platform:p.platform,supabase_url:p.supabaseUrl,api_key:p.apiKey?"[REDACTED]":null,base44_app_id:p.base44AppId,tables_count:((f=p.tables)==null?void 0:f.length)||0,status:p.status,error:p.error});const w={user_id:p.user_id,url:p.url,timestamp:p.timestamp,platform:p.platform||null,supabase_url:p.supabaseUrl||null,api_key:p.apiKey||null,base44_app_id:p.base44AppId||null,tables:p.tables||[],edge_function_results:p.edgeFunctionResults||[],backend_functions:p.backendFunctions||[],pages:p.pages||null,status:p.status||"completed",error:p.error||null,is_authenticated:p.is_authenticated||!1};console.log("Insert data prepared (no ID - will be auto-generated):",{...w,api_key:w.api_key?"[REDACTED]":null});const{data:b,error:x}=await Ce.from("scan_results").insert([w]).select();if(x)throw console.error("Supabase insert error details:",{code:x.code,message:x.message,details:x.details,hint:x.hint}),x;if(console.log("Successfully saved scan result:",b),b&&b.length>0){const m={id:b[0].id,user_id:b[0].user_id,url:b[0].url,timestamp:b[0].timestamp,platform:b[0].platform,supabaseUrl:b[0].supabase_url,apiKey:b[0].api_key,base44AppId:b[0].base44_app_id,tables:b[0].tables||[],edgeFunctionResults:b[0].edge_function_results||[],status:b[0].status,error:b[0].error,is_authenticated:b[0].is_authenticated||!1};if(m.status==="completed"&&m.tables.length>0&&(m.platform==="supabase"&&m.supabaseUrl||m.platform==="base44"&&m.base44AppId||!m.platform&&m.supabaseUrl)){const y=[m,...e].slice(0,50);t(y);const j=qt(m.url),N=r.findIndex(_=>qt(_.url)===j);let k;N>=0?(k=[...r],k[N]={...k[N],lastScan:m.timestamp,scanCount:k[N].scanCount+1,lastResult:m}):k=[{url:m.url,lastScan:m.timestamp,scanCount:1,lastResult:m,user_id:m.user_id},...r],s(k)}return m}else return d}catch(p){console.error("Failed to save scan result:",p),p&&typeof p=="object"&&console.error("Error details:",JSON.stringify(p,null,2));const w=[d,...e].slice(0,50);return t(w),localStorage.setItem("safe-vibe-scan-history",JSON.stringify(w)),d}},u=async d=>{if(!o){console.error("Cannot delete scan result: user not authenticated");return}try{const{error:f}=await Ce.from("scan_results").delete().eq("id",d).eq("user_id",o.id);if(f)throw console.error("Error deleting scan result:",f),f;const p=e.filter(b=>b.id!==d);t(p);const w=new Map;p.forEach(b=>{const x=qt(b.url),m=w.get(x);m?b.timestamp>m.lastScan?w.set(x,{...m,lastScan:b.timestamp,scanCount:m.scanCount+1,lastResult:b}):w.set(x,{...m,scanCount:m.scanCount+1}):w.set(x,{url:b.url,lastScan:b.timestamp,scanCount:1,lastResult:b,user_id:b.user_id})}),s(Array.from(w.values()))}catch(f){console.error("Failed to delete scan result:",f)}},h=S.useCallback(async d=>{if(!o)return console.error("Cannot fetch scan: user not authenticated"),null;const f=e.find(p=>p.id===d);if(f)return f;try{const{data:p,error:w}=await Ce.from("scan_results").select("*").eq("id",d).eq("user_id",o.id
152).single();if(w){if(w.code==="PGRST116")return null;throw console.error("Error fetching scan by ID:",w),w}return p?{id:p.id,url:p.url,timestamp:p.timestamp,platform:p.platform,supabaseUrl:p.supabase_url,apiKey:p.api_key,base44AppId:p.base44_app_id,tables:p.tables||[],edgeFunctionResults:p.edge_function_results||[],backendFunctions:p.backend_functions||[],pages:p.pages||void 0,status:p.status,error:p.error,user_id:p.user_id,is_authenticated:p.is_authenticated||!1}:null}catch(p){return console.error("Failed to fetch scan by ID:",p),null}},[o,e]);return{scanHistory:e,scannedApps:r,loading:n,addScanResult:c,deleteScanResult:u,refreshHistory:l,getScanById:h}},_1=({className:e="w-8 h-8"})=>i.jsxs("svg",{className:e,viewBox:"0 0 149 152",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("mask",{id:"mask0_18_10",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"149",height:"152",children:i.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.6502 0C69.3099 0 89.3004 20.0433 89.3004 44.7679V61.7825H104.16C128.82 61.7825 148.81 81.8258 148.81 106.55C148.81 131.275 128.82 151.318 104.16 151.318H0V44.7679C0 20.0433 19.9906 0 44.6502 0Z",fill:"url(#paint0_linear_18_10)"})}),i.jsxs("g",{mask:"url(#mask0_18_10)",children:[i.jsx("g",{filter:"url(#filter0_f_18_10)",children:i.jsx("path",{d:"M65.2812 181.5C120.915 181.5 166.014 136.4 166.014 80.7667C166.014 25.1334 120.915 -19.9663 65.2812 -19.9663C9.6479 -19.9663 -35.4518 25.1334 -35.4518 80.7667C-35.4518 136.4 9.6479 181.5 65.2812 181.5Z",fill:"#4B73FF"})}),i.jsx("g",{filter:"url(#filter1_f_18_10)",children:i.jsx("path",{d:"M76.3487 123.221C147.6 123.221 205.361 78.1217 205.361 22.4884C205.361 -33.1449 147.6 -78.2446 76.3487 -78.2446C5.09734 -78.2446 -52.6633 -33.1449 -52.6633 22.4884C-52.6633 78.1217 5.09734 123.221 76.3487 123.221Z",fill:"#FF66F4"})}),i.jsx("g",{filter:"url(#filter2_f_18_10)",children:i.jsx("path",{d:"M97.3926 95.0049C153.026 95.0049 198.126 55.3976 198.126 6.53953C198.126 -42.3186 153.026 -81.9259 97.3926 -81.9259C41.7593 -81.9259 -3.34039 -42.3186 -3.34039 6.53953C-3.34039 55.3976 41.7593 95.0049 97.3926 95.0049Z",fill:"#FF0105"})}),i.jsx("g",{filter:"url(#filter3_f_18_10)",children:i.jsx("path",{d:"M78.1432 86.0486C111.601 86.0486 138.724 58.9257 138.724 25.4679C138.724 -7.98989 111.601 -35.1128 78.1432 -35.1128C44.6854 -35.1128 17.5625 -7.98989 17.5625 25.4679C17.5625 58.9257 44.6854 86.0486 78.1432 86.0486Z",fill:"#FE7B02"})})]}),i.jsxs("defs",{children:[i.jsxs("filter",{id:"filter0_f_18_10",x:"-80.5964",y:"-65.1109",width:"291.755",height:"291.755",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:"22.5723",result:"effect1_foregroundBlur_18_10"})]}),i.jsxs("filter",{id:"filter1_f_18_10",x:"-97.8079",y:"-123.389",width:"348.313",height:"291.755",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:"22.5723",result:"effect1_foregroundBlur_18_10"})]}),i.jsxs("filter",{id:"filter2_f_18_10",x:"-48.485",y:"-127.07",width:"291.755",height:"267.22",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:"22.5723",result:"effect1_foregroundBlur_18_10"})]}),i.jsxs("filter",{id:"filter3_f_18_10",x:"-27.5821",y:"-80.2574",width:"211.451",height:"211.451",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[i.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),i.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),i.jsx("feGaussianBlur",{stdDeviation:"22.5723",result:"effect1_foregroundBlur_18_10"})]}),i.jsxs("linearGradient",{id:"paint0_linear_18_10",x1:"50.0774",y1:"26.5915",x2:"95.4144",y2:"151.261",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{offset:"0.025",stopColor:"#FF8E63"}),i.jsx("stop",{offset:"0.56",stopColor:"#FF7EB0"}),i.jsx("stop",{offset:"0.95",stopColor:"#4B73FF"})]})]})]}),N1=({className:e="w-8 h-8"})=>i.jsxs("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 51 21.9",fill:"white",children:[i.jsx("path",{d:"M24.1 19.3c-4.7 0-7-2.7-7-6.1s3.2-7.7 7.9-7.7 7 2.7 7 6.1-3.2 7.7-7.9 7.7Zm.2-4.3c1.6 0 2.7-1.5 2.7-3.1s-.8-2-2.2-2-2.7 1.5-2.7 3.1.8 2 2.2 2ZM37 19h-4.9l4-18.2H41l-4 18.1Z"}),i.jsx("path",{d:"M9.6 19.3c-1.5 0-3-.5-3.8-1.7L5.5 19 0 21.9.6 19 4.6.8h4.9L8.1 7.2c1.1-1.2 2.2-1.7 3.6-1.7 3 0 4.9 1.9 4.9 5.5s-2.3 8.3-7 8.3Zm1.9-7.3c0 1.7-1.2 3-2.8 3s-1.7-.3-2.2-.9l.8-3.3c.6-.6 1.2-.9 2-.9 1.2 0 2.2.9 2.2 2.2Z",style:{fillRule:"evenodd"}}),i.jsx("path",{d:"M46.1 19.3c-2.8 0-4.9-1-4.9-3.3s0-.7.1-1l1.1-4.9h-2.2l1-4.2h2.2l.8-3.6L49.7 0l-.6 2.3-.8 3.6H51l-1 4.2h-2.7l-.7 3.2v.6c0 .6.4 1.1 1.2 1.1s.6 0 .7-.1v3.9c-.5.4-1.4.5-2.3.5Z"})]}),k1=({className:e="w-8 h-8"})=>i.jsxs("svg",{className:e,viewBox:"0 0 23 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M10.701 8.40793H1.60592C0.710313 8.40793 0 7.69462 0 6.82955V1.57838C0 0.698131 0.725755 0 1.60592 0H9.09508C9.99069 0 10.701 0.713307 10.701 1.57838V8.40793Z",fill:"#fd5402"}),i.jsx("path",{d:"M20.4557 17.5668H10.7109V8.39453H20.4557C21.3987 8.39453 22.1763 9.17128 22.1763 10.1133V15.8481C22.1763 16.8066 21.3987 17.5668 20.45
15257 17.5668Z",fill:"#fd5402"}),i.jsx("path",{d:"M9.09508 25H1.60592C0.725755 25 0 24.288 0 23.4244V18.1676C0 17.3041 0.725755 16.592 1.60592 16.592H10.701V23.4244C10.701 24.288 9.97525 25 9.09508 25Z",fill:"#fd5402"})]}),S1=({className:e="w-8 h-8"})=>i.jsxs("svg",{className:e,fill:"white",viewBox:"0 0 40 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[i.jsx("path",{d:"M23.3919 0H32.9188C36.7819 0 39.9136 3.13165 39.9136 6.99475V16.0805H36.0006V6.99475C36.0006 6.90167 35.9969 6.80925 35.9898 6.71766L26.4628 16.079C26.4949 16.08 26.5272 16.0805 26.5595 16.0805H36.0006V19.7762H26.5595C22.6964 19.7762 19.4788 16.6139 19.4788 12.7508V3.68923H23.3919V12.7508C23.3919 12.9253 23.4054 13.0977 23.4316 13.2668L33.1682 3.6995C33.0861 3.6927 33.003 3.68923 32.9188 3.68923H23.3919V0Z"}),i.jsx("path",{d:"M13.7688 19.0956L0 3.68759H5.53933L13.6231 12.7337V3.68759H17.7535V17.5746C17.7535 19.6705 15.1654 20.6584 13.7688 19.0956Z"})]}),E1=({onScan:e,scanning:t,userId:r,userEmail:s})=>{const n=fr(),{user:a}=Ls(),{getScanById:o}=Cc(),[l,c]=S.useState(""),[u,h]=S.useState(!1),[d,f]=S.useState(""),[p,w]=S.useState(null),[b,x]=S.useState(!1),[m,g]=S.useState(!1);S.useEffect(()=>{const N=n.state;N!=null&&N.url&&c(N.url),N!=null&&N.authenticatedScan&&h(N.authenticatedScan),N&&window.history.replaceState({},document.title)},[n.state]),S.useEffect(()=>{const N=vp();N&&a&&o&&(g(!0),o(N).then(k=>{k?(w(k),x(!0)):ys()}).catch(k=>{console.error("Failed to load scan from URL:",k),ys()}).finally(()=>{g(!1)}))},[a,o,n.search]),S.useEffect(()=>{const N=localStorage.getItem("pendingUrl");N&&a&&(c(N),localStorage.removeItem("pendingUrl"))},[a]);const y=async()=>{if(!l||!a)return;const N=await e(l,u?d:void 0);w(N),x(!0),N.id&&zt(N.id)},j=()=>{x(!1),w(null),ys()};return i.jsx("div",{className:"container mx-auto px-4 py-8",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("div",{className:"mb-8",children:i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-8",children:[i.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Scan Your Application"}),i.jsx("p",{className:"text-gray-300 mb-6 leading-relaxed",children:"Add your app url to discover exposed data."}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:space-x-4 space-y-4 sm:space-y-0 mb-6",children:[i.jsx("div",{className:"flex-1",children:i.jsx("input",{type:"url",value:l,onChange:N=>c(N.target.value),placeholder:"https://your-app.lovable.app",className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",disabled:t})}),i.jsxs("button",{onClick:y,disabled:!l||t,className:"w-full sm:w-auto px-8 py-3 bg-primary-500 text-white font-medium rounded-xl hover:bg-primary-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center sm:justify-start space-x-2",children:[i.jsx(Xi,{className:"w-4 h-4"}),i.jsx("span",{children:t?"Scanning...":"Scan"})]})]}),i.jsxs("div",{className:"flex items-center space-x-3 mb-6",children:[i.jsx("button",{onClick:()=>h(!u),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${u?"bg-primary-500":"bg-gray-600"}`,disabled:t,children:i.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${u?"translate-x-6":"translate-x-1"}`})}),i.jsx("label",{className:"text-sm font-medium text-gray-300",children:"Authenticated Scan"})]}),u&&i.jsxs("div",{className:"mb-6 p-6 bg-gray-700/50 border border-gray-600 rounded-xl",children:[i.jsx("h3",{className:"text-lg font-medium text-white mb-4",children:"Authenticated Scan Configuration"}),i.jsxs("div",{className:"mb-6",children:[i.jsx("p",{className:"text-gray-300 mb-4 leading-relaxed",children:"This feature allows you to test your application's security with a low-privileged user account. We'll check if this user can access unauthorized data or perform actions they shouldn't be able to."}),i.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg",children:[i.jsx("h4",{className:"text-sm font-medium text-white mb-3",children:"How to get your authentication token:"}),i.jsxs("ol",{className:"text-sm text-gray-300 space-y-2",children:[i.jsxs("li",{className:"flex items-start",children:[i.jsx("span",{className:"inline-block w-6 h-6 bg-primary-500 text-white text-xs rounded-full text-center leading-6 mr-3 flex-shrink-0",children:"1"}),i.jsx("span",{children:"Login to your application with an unprivileged user account"})]}),i.jsxs("li",{className:"flex items-start",children:[i.jsx("span",{className:"inline-block w-6 h-6 bg-primary-500 text-white text-xs rounded-full text-center leading-6 mr-3 flex-shrink-0",children:"2"}),i.jsx("span",{children:"Open your browser's Developer Tools (F12 or right-click → Inspect)"})]}),i.jsxs("li",{className:"flex items-start",children:[i.jsx("span",{className:"inline-block w-6 h-6 bg-primary-500 text-white text-xs rounded-full text-center leading-6 mr-3 flex-shrink-0",children:"3"}),i.jsxs("span",{children:["Go to ",i.jsx("code",{className:"bg-gray-700 px-2 py-1 rounded text-xs",children:"Application"})," → ",i.jsx("code",{className:"bg-gray-700 px-2 py-1 rounded text-xs",children:"Local Storage"})]})]}),i.jsxs("li",{className:"flex items-start",children:[i.jsx("span",{className:"inline-block w-6 h-6 bg-primary-500 text-white text-xs rounded-full text-center leading-6 mr-3 flex-shrink-0",children:"4"}),i.jsx("span",{children:"Look for your website URL and find the authentication token"})]}),i.jsxs("li",{className:"flex items-start",children:[i.jsx("span",{className:"inline-block w-6 h-6 bg-primary-500 text-white text-xs rounded-full text-center leading-6 mr-3 flex-shrink-0",children:"5"}),i.jsxs("span",{children:["Copy the token starting with ",i.jsx("code",{className:"bg-gray-700 px-2 py-1 rounded text-xs",children:"eyJ..."})," and paste it below"]})]})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-3",children:"Authentication Token"}),i.jsx("textarea",{value:d,onChange:N=>f(N.target.value),placeholder:"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent resize-none",rows:3,disabled:t}),i.jsx("p",{className:"text-xs text-gray-400 mt-2",children:'The token should be a JWT (JSON Web Token) starting with "eyJ"'})]})]}),i.jsx("p",{className:"text-sm text-gray-400 mb-6",children:"By 
152scanning, I confirm I own the scanned application."}),i.jsxs("div",{className:"border-t border-gray-700 pt-6",children:[i.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"Supported Platforms"}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[i.jsxs("div",{className:"flex flex-col items-center space-y-2 p-3 bg-gray-700/30 rounded-lg",children:[i.jsx(N1,{className:"w-8 h-8"}),i.jsx("span",{className:"text-sm text-gray-300 text-center",children:"Bolt.new"})]}),i.jsxs("div",{className:"flex flex-col items-center space-y-2 p-3 bg-gray-700/30 rounded-lg",children:[i.jsx(_1,{className:"w-8 h-8"}),i.jsx("span",{className:"text-sm text-gray-300 text-center",children:"Lovable"})]}),i.jsxs("div",{className:"flex flex-col items-center space-y-2 p-3 bg-gray-700/30 rounded-lg",children:[i.jsx("img",{src:"/base44.webp",alt:"Base44",className:"w-8 h-8 object-contain"}),i.jsx("span",{className:"text-sm text-gray-300 text-center",children:"Base44"})]}),i.jsxs("div",{className:"flex flex-col items-center space-y-2 p-3 bg-gray-700/30 rounded-lg",children:[i.jsx(S1,{className:"w-8 h-8"}),i.jsx("span",{className:"text-sm text-gray-300 text-center",children:"V0 by Vercel"})]}),i.jsxs("div",{className:"flex flex-col items-center space-y-2 p-3 bg-gray-700/30 rounded-lg opacity-60",children:[i.jsx(k1,{className:"w-8 h-8"}),i.jsxs("span",{className:"text-xs text-gray-400 text-center",children:["Replit",i.jsx("br",{}),"(Coming soon)"]})]})]})]}),t&&i.jsx("div",{className:"mt-6 text-center",children:i.jsxs("div",{className:"inline-flex items-center space-x-3 text-white",children:[i.jsx("div",{className:"w-5 h-5 border-2 border-primary-400 border-t-transparent rounded-full animate-spin"}),i.jsx("span",{className:"text-gray-300",children:"Analyzing JavaScript bundles and probing database endpoints..."})]})})]})}),p&&i.jsx(jp,{scanResult:p,isOpen:b,onClose:j,userId:r,userEmail:s,onRescan:async(N,k)=>{if(!a)return!1;const _=await e(N);return w(_),_.id&&zt(_.id),k&&k(),!0}})]})})},C1=({isOpen:e,onClose:t,appName:r})=>e?i.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:i.jsxs("div",{className:"bg-gray-800 border border-gray-700 rounded-2xl max-w-md w-full overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-700",children:[i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx("div",{className:"w-10 h-10 bg-primary-500/20 rounded-xl flex items-center justify-center",children:i.jsx(ea,{className:"w-5 h-5 text-white"})}),i.jsx("h2",{className:"text-xl font-bold text-white",children:"Monitoring Coming Soon"})]}),i.jsx("button",{onClick:t,className:"p-2 text-gray-400 hover:text-white hover:bg-gray-700 rounded-lg transition-colors",children:i.jsx(Ln,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-6",children:[i.jsxs("div",{className:"text-center mb-6",children:[i.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-primary-500/20 to-primary-600/20 rounded-2xl flex items-center justify-center mx-auto mb-4",children:i.jsx(ea,{className:"w-8 h-8 text-white"})}),r&&i.jsxs("h3",{className:"text-lg font-semibold text-white mb-2",children:["Monitor ",gn(r)]}),i.jsx("p",{className:"text-gray-300 leading-relaxed mb-4",children:"Monitoring is coming up soon. We've added you to the waitlist and will notify you by email once this feature is released."}),i.jsx("div",{className:"bg-primary-500/10 border border-primary-500/20 rounded-xl p-4 mb-6",children:i.jsxs("div",{className:"flex items-start space-x-3",children:[i.jsx(ux,{className:"w-5 h-5 text-white flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"text-left",children:[i.jsx("h4",{className:"text-sm font-medium text-white mb-1",children:"What to Expect"}),i.jsx("p",{className:"text-sm text-gray-300",children:"Get instant alerts when your app's data exposure changes, new vulnerabilities are detected, or security configurations are modified."})]})]})})]}),i.jsx("button",{onClick:t,className:"w-full px-6 py-3 bg-primary-500 text-white font-medium rounded-xl hover:bg-primary-600 transition-colors",children:"Got it, thanks!"})]})]})}):null,T1=({scanHistory:e,scannedApps:t,loading:r=!1,scanning:s=!1,onDeleteScan:n,onRefresh:a,onRerunScan:o,userId:l,userEmail:c})=>{const u=fr(),{user:h}=Ls(),{getScanById:d}=Cc(),[f,p]=S.useState(null),[w,b]=S.useState(!1),[x,m]=S.useState(null),[g,y]=S.useState(!1),[j,N]=S.useState(null),[k,_]=S.useState(!1);S.useEffect(()=>{const P=vp();if(P&&h&&d){const Q=e.find(K=>K.id===P);if(Q){p(Q),b(!0);return}_(!0),d(P).then(K=>{K?(p(K),b(!0)):ys()}).catch(K=>{console.error("Failed to load scan from URL:",K),ys()}).finally(()=>{_(!1)})}},[h,d,u.search]);const E=async P=>{n&&confirm("Are you sure you want to delete this scan result?")&&n(P)},O=P=>{p(P),b(!0),P.id&&zt(P.id)},R=P=>{p(P.lastResult),b(!0),P.lastResult.id&&zt(P.lastResult.id)},V=async P=>{if(o&&h){m(P);try{const Q=await o(P);p(Q),b(!0),Q.id&&zt(Q.id)}catch(Q){console.error("Failed to rerun scan:",Q);try{const K=await o(P);p(K),b(!0),K.id&&zt(K.id)}catch(K){console.error("Failed to rerun scan after credit check error:",K)}}finally{m(null)}}},Oe=async P=>{N(P),y(!0),await Zv(P)},Ze=()=>{y(!1),N(null)},_t=()=>{b(!1),p(null),ys()};return r?i.jsx("div",{className:"container mx-auto px-2 sm:px-4 py-8",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-white",children:"My Apps"}),i.jsx("div",{className:"w-6 h-6 border-2 border-primary-500 border-t-transparent roun
152ded-full animate-spin"})]}),i.jsx("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-12 text-center",children:i.jsx("p",{className:"text-gray-400",children:"Loading your applications..."})})]})}):i.jsx("div",{className:"container mx-auto px-2 sm:px-4 py-8",children:i.jsxs("div",{className:"max-w-6xl mx-auto",children:[i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl font-bold text-white",children:"My Apps"}),a&&i.jsxs("button",{onClick:a,disabled:s,className:"inline-flex items-center px-4 py-2 bg-gray-700 hover:bg-gray-600 text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[i.jsx(dx,{className:`w-4 h-4 mr-2 ${s?"animate-spin":""}`}),"Refresh"]})]}),s&&i.jsx("div",{className:"mb-6 bg-primary-500/10 border border-primary-500/20 rounded-xl p-4",children:i.jsxs("div",{className:"flex items-center space-x-3",children:[i.jsx("div",{className:"w-5 h-5 border-2 border-primary-400 border-t-transparent rounded-full animate-spin"}),i.jsx("span",{className:"text-white font-medium",children:x?`Rescanning ${gn(x)}...`:"Scanning in progress..."})]})}),t.length>0&&i.jsx("div",{className:"mb-8",children:i.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 sm:gap-8",children:t.map((P,Q)=>{const K=ia(P.lastResult.tables),T=aa(P.lastResult.tables),$=jl(P.lastResult.tables),U=x===P.url;return i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-4 sm:p-6 hover:border-gray-600 transition-colors cursor-pointer group",onClick:()=>!U&&R(P),children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center space-x-2 min-w-0 flex-1",children:[i.jsx("div",{className:`w-3 h-3 rounded-full flex-shrink-0 ${U?"bg-primary-500 animate-pulse":$.status==="protected"?"bg-green-500":"bg-red-500"}`}),i.jsx("h4",{className:"font-medium text-gray-200 truncate group-hover:text-white transition-colors min-w-0",children:gn(P.url)})]}),i.jsxs("div",{className:"flex items-center space-x-2 flex-shrink-0",children:[i.jsx("button",{onClick:z=>{z.stopPropagation(),R(P)},className:"p-1 text-gray-400 hover:text-white transition-colors opacity-0 group-hover:opacity-100",title:"View scan details",children:i.jsx(ll,{className:"w-4 h-4"})}),bl(P.url)&&i.jsx("a",{href:P.url.startsWith("http")?P.url:`https://${P.url}`,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors",onClick:z=>z.stopPropagation(),children:i.jsx(qe,{className:"w-4 h-4"})})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Security Status"}),i.jsx("span",{className:`text-sm font-bold ${$.color}`,children:$.message})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Total Scans"}),i.jsx("span",{className:"text-sm text-gray-300",children:P.scanCount})]}),i.jsxs("div",{className:"flex justify-between",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Last Scan"}),i.jsx("span",{className:"text-sm text-gray-300",children:new Date(P.lastScan).toLocaleDateString()})]}),i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Exposed Records"}),i.jsx("div",{className:`px-3 py-1 rounded-full text-sm font-bold ${K>0?"bg-red-500/20 border border-red-500/30 text-red-400":"bg-green-500/20 border border-green-500/30 text-green-400"}`,children:K.toLocaleString()})]})]}),(P.lastResult.tables.some(z=>z.isExposed)||T)&&i.jsx("div",{className:"mt-4 p-3 bg-danger-500/10 border border-danger-500/20 rounded-lg",children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(Ue,{className:"w-4 h-4 text-white"}),i.jsxs("span",{className:"text-sm text-gray-300",children:[P.lastResult.tables.filter(z=>z.isExposed).length," exposed tables",T&&", write access detected"]})]})}),o&&i.jsx("div",{className:"mt-4 pt-4 border-t border-gray-700",children:i.jsx("button",{onClick:z=>{z.stopPropagation(),V(P.url)},disabled:U||s,className:`w-full inline-flex items-center justify-center px-4 py-2 text-white text-sm font-medium rounded-lg transition-colors ${U?"bg-primary-400 cursor-not-allowed":"bg-primary-600 hover:bg-primary-700"}`,children:U?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-4 h-4 mr-2 border-2 border-white border-t-transparent roun
152ded-full animate-spin"}),"Rescanning..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Xi,{className:"w-4 h-4 mr-2"}),"Rescan"]})})}),i.jsx("div",{className:"mt-4 pt-4 border-t border-gray-700",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Monitor"}),i.jsx("button",{onClick:z=>{z.stopPropagation(),Oe(P.url)},className:"relative inline-flex h-6 w-11 items-center rounded-full bg-gray-600 transition-colors hover:bg-gray-500",title:"Monitor this app for changes",children:i.jsx("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white transition-transform translate-x-1"})})]})})]},`${P.url}-${Q}`)})})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-semibold text-white mb-6",children:"Recent Scans"}),e.length===0?i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-12 text-center",children:[i.jsx(ir,{className:"w-12 h-12 text-gray-500 mx-auto mb-4"}),i.jsx("h4",{className:"text-lg font-medium text-white mb-2",children:"No scans yet"}),i.jsx("p",{className:"text-gray-400",children:"Start by scanning your first application to see security insights."})]}):i.jsx("div",{className:"space-y-4",children:e.map((P,Q)=>{const K=ia(P.tables),T=aa(P.tables),$=jl(P.tables);return i.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-4 sm:p-6 hover:border-gray-600 transition-colors cursor-pointer group",onClick:()=>O(P),children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[i.jsx("div",{className:`w-3 h-3 rounded-full flex-shrink-0 ${P.status==="completed"?$.status==="protected"?"bg-green-500":"bg-red-500":P.status==="error"?"bg-red-500":"bg-gray-500"}`}),i.jsx("h4",{className:"font-medium text-gray-200 group-hover:text-white transition-colors truncate min-w-0",children:gn(P.url)}),bl(P.url)&&i.jsx("a",{href:P.url.startsWith("http")?P.url:`https://${P.url}`,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-white transition-colors flex-shrink-0",onClick:U=>U.stopPropagation(),children:i.jsx(qe,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"flex items-center space-x-4 flex-shrink-0",children:[i.jsxs("div",{className:"flex items-center space-x-4 text-sm text-gray-400",children:[i.jsxs("div",{className:"flex items-center space-x-1",children:[i.jsx(Mf,{className:"w-4 h-4"}),i.jsx("span",{children:new Date(P.timestamp).toLocaleDateString()})]}),i.jsx("span",{children:new Date(P.timestamp).toLocaleTimeString()})]}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("button",{onClick:U=>{U.stopPropagation(),O(P)},className:"p-2 text-gray-400 hover:text-white hover:bg-gray-700 rounded-lg transition-colors opacity-0 group-hover:opacity-100",title:"View scan details",children:i.jsx(ll,{className:"w-4 h-4"})}),n&&P.id&&i.jsx("button",{onClick:U=>{U.stopPropagation(),E(P.id)},className:"p-2 text-gray-400 hover:text-danger-400 hover:bg-gray-700 rounded-lg transition-colors opacity-0 group-hover:opacity-100",title:"Delete scan",children:i.jsx(jc,{className:"w-4 h-4"})})]})]})]}),P.status==="completed"&&i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 gap-3 sm:gap-4",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-xs sm:text-sm text-gray-400 block truncate",children:"Security Status"}),i.jsx("div",{className:`text-sm sm:text-base font-bold ${$.color}`,children:$.message})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-xs sm:text-sm text-gray-400 block truncate",children:"Tables"}),i.jsx("div",{className:"text-base sm:text-lg font-medium text-gray-300",children:P.tables.length})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-xs sm:text-sm text-gray-400 block truncate",children:"Exposed"}),i.jsx("div",{className:"text-base sm:text-lg font-medium text-white",children:P.tables.filter(U=>U.isExposed).length})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-xs sm:text-sm text-gray-400 block truncate",children:"Public Write Access"}),i.jsx("div",{className:`text-base sm:text-lg font-medium ${T?"text-danger-500":"text-success-500"}`,children:P.tables.filter(U=>U.isPubliclyInsertable||U.isPubliclyUpdatable||U.isPubliclyDeletable).length})]}),i.jsxs("div",{className:"min-w-0 col-span-2 sm:col-span-1",children:[i.jsx("span",{className:"text-xs sm:text-sm text-gray-400 block truncate",children:"Exposed Records"}),i.jsx("div",{className:`inline-block px-3 py-1 rounded-full text-sm font-bold ${K>0?"bg-red-500/20 border border-red-500/30 text-red-400":"bg-green-500/20 border border-green-500/30 text-green-400"}
152`,children:K.toLocaleString()})]})]}),P.status==="error"&&i.jsxs("div",{className:"text-danger-400 text-sm",children:["Error: ",P.error]})]},P.id||`scan-${Q}`)})})]}),f&&i.jsx(jp,{scanResult:f,isOpen:w,onClose:_t,userId:l,userEmail:c,onRescan:o?async(P,Q)=>{if(!h)return!1;try{const K=await o(P);return p(K),K.id&&zt(K.id),Q&&Q(),!0}catch(K){console.error("Error during rescan from modal:",K);try{const T=await o(P);return p(T),T.id&&zt(T.id),Q&&Q(),!0}catch(T){return console.error("Failed to rescan from modal after credit check error:",T),!1}}}:void 0}),i.jsx(C1,{isOpen:g,onClose:Ze,appName:j||void 0})]})})},_l=(e,t)=>{const r=/<script[^>]+src=["']([^"']+)["'][^>]*>/gi,s=[];let n;for(;(n=r.exec(e))!==null;){const a=n[1];if(a.includes("index")||a.includes("main")||a.includes("app")||a.includes("bundle")||a.match(/\w+-[a-f0-9]{8,}\.(js|mjs)$/)){const o=a.startsWith("http")?a:new URL(a,t).href;s.push(o)}}return s},P1=e=>{const t=[/["'](https:\/\/[a-zA-Z0-9-]+\.supabase\.co)["']/g,/VITE_SUPABASE_URL['"]\s*:\s*["'](https:\/\/[a-zA-Z0-9-]+\.supabase\.co)["']/g,/import\.meta\.env\.VITE_SUPABASE_URL.*?["'](https:\/\/[a-zA-Z0-9-]+\.supabase\.co)["']/g,/process\.env\.VITE_SUPABASE_URL.*?["'](https:\/\/[a-zA-Z0-9-]+\.supabase\.co)["']/g];for(const r of t){const s=e.matchAll(r);for(const n of s)if(n[1])return n[1]}return null},I1=e=>{const t=/["'](eyJ[a-zA-Z0-9_-]+\.eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+)["']/g,r=e.matchAll(t);for(const s of r){const n=s[1],a=n.split(".");if(a.length===3)try{const o=JSON.parse(atob(a[0]));if(o.alg&&o.typ==="JWT")return n}catch{continue}}return null},O1=e=>{const t=new Set,r=[/\.from\s*\(\s*["']([a-zA-Z_][a-zA-Z0-9_]*)["']\s*\)/g,/\.from\s*\(\s*'([a-zA-Z_][a-zA-Z0-9_]*)'\s*\)/g,/supabase\.from\s*\(\s*["']([a-zA-Z_][a-zA-Z0-9_]*)["']\s*\)/g];for(const s of r){const n=e.matchAll(s);for(const a of n)a[1]&&a[1].length>0&&t.add(a[1])}return Array.from(t)},A1=(e,t)=>{console.log(`Extracting payload for function: ${t}`);const r=[new RegExp(`fetch\\s*\\([^,]*functions\\/v1\\/${t}[^,]*,\\s*\\{([^}]*(?:\\{[^}]*\\}[^}]*)*)\\}`,"g"),new RegExp(`const\\s+[a-zA-Z_$][a-zA-Z0-9_$]*\\s*=\\s*[^;]*functions\\/v1\\/${t}[^;]*;[\\s\\S]*?fetch\\s*\\([^,]*,\\s*\\{([^}]*(?:\\{[^}]*\\}[^}]*)*)\\}`,"g")];for(const a of r){const o=e.matchAll(a);for(const l of o){const c=l[1];console.log(`Found fetch options for ${t}:`,c);const u=[/body\s*:\s*JSON\.stringify\s*\(\s*(\{[^}]*(?:\{[^}]*\}[^}]*)*\})\s*\)/g,/body\s*:\s*JSON\.stringify\s*\(\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\)/g,/body\s*:\s*JSON\.stringify\s*\(\s*\{\s*([^}]+)\s*\}\s*\)/g];for(const h of u){const d=h.exec(c);if(d&&d[1]){let f=d[1].trim();return console.log(`Extracted payload for ${t}:`,f),!f.startsWith("{")&&f.includes(",")?f=`{ ${f.split(",").map(w=>w.trim()).map(w=>`${w}: ${w}`).join(", ")} }`:f.startsWith("{")||(f=`{ ${f}: ${f} }`),f}}}}const n=new RegExp(`${t}[\\s\\S]{0,500}JSON\\.stringify\\s*\\(\\s*([^)]+)\\s*\\)`,"g").exec(e);if(n&&n[1]){let a=n[1].trim();return console.log(`Fallback payload extraction for ${t}:`,a),!a.startsWith("{")&&a.includes(",")&&(a=`{ ${a.split(",").map(l=>l.trim()).map(l=>`${l}: ${l}`).join(", ")} }`),a}console.log(`No payload found for ${t}`)},R1=e=>{const t=new Map,r=[/\/functions\/v1\/([a-zA-Z_][a-zA-Z0-9_-]*)/g,/const\s+[a-zA-Z_$][a-zA-Z0-9_$]*\s*=\s*[^;]*\/functions\/v1\/([a-zA-Z_][a-zA-Z0-9_-]*)/g],s=new Set;for(const a of r){const o=e.matchAll(a);for(const l of o){const c=l[1];c&&s.add(c)}}console.log("Discovered Edge Functions:",Array.from(s));for(const a of s){const o=new RegExp(`functions\\/v1\\/${a}`,"g"),l=(e.match(o)||[]).length,c=A1(e,a);t.set(a,{name:a,endpoint:`/functions/v1/${a}`,inferredPayload:c,discoveredCalls:l})}const n=Array.from(t.values());return console.log("Final Edge Functions extraction:",n),n},U1=e=>{const t=new Set,r=[/<Route[^>]+path=["']([^"']+)["'][^>]*>/gi,/<Route[^>]+path=["']([^"']+)["'][^>]*>/gi,/Route\s*\(\s*\{[^}]*path\s*:\s*["']([^"']+)["'][^}]*\}/gi,/\{\s*path\s*:\s*["']([^"']+)["'][^}]*\}/gi],s=[/router\.push\s*\(\s*["']([^"']+)["']/gi,/Router\.push\s*\(\s*["']([^"']+)["']/gi,/href\s*=\s*["']([^"']+)["']/gi,/<Link[^>]+to=["']([^"']+)["'][^>]*>/gi],n=[/\{\s*path\s*:\s*["']([^"']+)["'][^}]*component/gi,/<router-link[^>]+to=["']([^"']+)["'][^>]*>/gi,/\$router\.push\s*\(\s*["']([^"']+)["']/gi],a=[...r,...s,...n];for(const c of a){const u=e.matchAll(c);for(const h of u){const d=h[1];if(d&&d.startsWith("/")){let f=d;f=f.replace(/\/:[^\/]+/g,""),f=f.replace(/\/\[[^\]]+\]/g,""),f=f.replace(/\/:[^\/]+/g,""),f&&f!=="/"&&t.add(f),d!==f&&d.length>1&&t.add(d)}}}const o=[/window\.location\.href\s*=\s*["']([^"']+)["']/gi,/location\.href\s*=\s*["']([^"']+)["']/gi,/navigate\s*\(\s*["']([^"']+)["']/gi,/history\.push\s*\(\s*["']([^"']+)["']/gi];for(const c of o){const u=e.matchAll(c);for(const h of u){const d=h[1];d&&d.startsWith("/")&&d.length>1&&t.add(d)}}const l=Array.from(t).filter(c=>{const u=c.toLowerCase();return!u.includes(".")&&!u.includes("?")&&!u.includes("#")&&!u.includes("http")&&c.length>1});return console.log("Discovered routes:",l),l},L1=Object.freeze(Object.defineProperty({__proto__:null,extractApiKey:I1,extractBundleUrls:_l,extractEdgeFunctionCalls:R1,extractRoutes:U1,extractSupabaseUrl:P1,extractTableNames:O1},Symbol.toStringTag,{value:"Module"})),$1=()=>{const[e,t]=S.useState(!1),r=(p,w)=>{const b=p instanceof Error?p.message:p,x=b.toLowerCase();return x.includes("500")||x.includes("503")||x.includes("502")||x.includes("connection")||x.includes("network")||x.includes("unreachable")||x.includes("refused")||x.includes("failed to fetch")?{errorType:"network_error",userFriendlyError:"This website appears to be unreachable or experiencing issues. Please try again later."}:x.includes("timeout")||x.includes("timed out")?{errorType:"timeout",userFriendlyError:"The scan timed out. The website may be slow to respond. Please try again."}:x.includes("no javascript bundles")||x.includes("no supabase")||x.includes("not found")||x.includes("extract")||x.includes("could not extract")||x.includes("no api key")||x.includes("no supabase url")||x.includes("failed to extract credentials")||w.includes("appian.com")||w.includes("salesforce.com")||w.includes("wordpress.com")||w.includes("squarespace.com")?{errorType:"unsupported_platform",userFriendlyError:"This means this website is either not vibe-coded, or it' a static page with no database configured."}:b.includes("🔒 Authentication Required:")||x.includes("authentication required")||x.includes("your website requires login credentials")&&x.includes("authenticate")?{errorType:"auth_token_error",userFriendlyError:b.includes("🔒 Authentication Required:")?b.replace("🔒 Authentication Required:","").trim():'This app requires user authentication to access data. Use the "Authenticated Scan" toggle to provide login credentials.'}:(x.includes("failed to probe supabase")||x.includes("probe supabase"))&&(x.includes("401")||x.includes("403"))&&(b.includes("supabaseUrl")||b.includes("apiKey")||x.includes("credentials valid")||x.includes("extracted credentials"))&&(x.includes("rls")||x.includes("row level security")||x.includes("unauthorized")||b.includes("JWT")||b.includes("session"))?{errorType:"auth_token_error",userFriendlyError:'This app requires user authentication to access data (Row Level Security is enabled). Use the "Authenticated Scan" toggle to provide login credentials.'}:(x.includes("failed to probe supabase")||x.includes("probe supabase"))&&(x.includes("400")||x.includes("401")||x.includes("403"))&&(b.includes("supabaseUrl")||b.includes("apiKey")||x.includes("credentials valid")||x.includes("extracted credentials"))?{errorType:"credentials_error",userFriendlyError:"Found Supabase credentials in the app, but unable to connect to the database. The API key may be invalid, expired, or the database may be unreachable. This often happens with demo apps or apps with restricted database access."}:(x.includes("failed to probe supabase")||x.includes("probe supabase"))&&(x.includes("400")||x.includes("401")||x.includes("403"))?{errorType:"unsupported_platform",userFriendlyError:"This website type is not supported yet. We currently support Supabase and Base44 applications. Would you like to request support for this platform?"}:(x.includes("failed to probe base44")||x.includes("probe base44"))&&(x.includes("400")||x.includes("401")||x.includes("403"))?{errorType:"credentials_error",userFriendlyError:"Found Base44 credentials in the app, but unable to connect to the backend. The app may be offline, have restricted access, or the credentials may be invalid."}:x.includes("credentials")||x.includes("unauthorized")||x.includes("api key")||x.includes("invalid")?{errorType:"credentials_error",userFriendlyError:"Unable to access the application database. The app may have restricted access or invalid configuration."}:{errorType:"unknown",userFriendlyError:"An unexpected error occurred during the scan. Please try again or c
152ontact support if the issue persists."}},s=async(p,w="html")=>{const x=await fetch("https://vznmuiyyvhtiwakkmlfj.supabase.co/functions/v1/fetch-url",{method:"POST",headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ6bm11aXl5dmh0aXdha2ttbGZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgzNDQ4MTUsImV4cCI6MjA2MzkyMDgxNX0._ngJCzpYMyVpVqCABWBzHEqdwFw-FhKPyb20z4Q4uu0","Content-Type":"application/json"},body:JSON.stringify({url:p,type:w})});if(!x.ok)throw new Error(`Failed to fetch URL: ${x.status} ${x.statusText}`);const m=await x.json();if(!m.success)throw new Error(m.error||"Failed to fetch URL content");return m.content},n=async(p,w,b,x,m)=>{const y=await fetch("https://vznmuiyyvhtiwakkmlfj.supabase.co/functions/v1/probe-supabase",{method:"POST",headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ6bm11aXl5dmh0aXdha2ttbGZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgzNDQ4MTUsImV4cCI6MjA2MzkyMDgxNX0._ngJCzpYMyVpVqCABWBzHEqdwFw-FhKPyb20z4Q4uu0","Content-Type":"application/json"},body:JSON.stringify({supabaseUrl:p,apiKey:w,tables:b,edgeFunctions:x,authToken:m})});if(!y.ok)throw new Error(`Failed to probe Supabase: ${y.status} ${y.statusText}`);const j=await y.json();if(j.debug&&j.debug.errors&&j.debug.errors.length>0&&console.log("⚠️ API Discovery had errors:",j.debug.errors),!j.success)throw new Error(j.error||"Failed to probe Supabase database");if(!j.credentialsValid)throw new Error("Invalid Supabase credentials");const N=j.tables||[],k=N.filter(E=>E.discoveredVia==="frontend_code"),_=N.filter(E=>E.discoveredVia==="api_discovery");return console.log("📊 Table Discovery Summary:"),console.log(`   - Total tables found: ${N.length}`),console.log(`   - From frontend code: ${k.length}`),console.log(`   - From API discovery: ${_.length}`),console.log(`   - Frontend tables: ${k.map(E=>E.name).join(", ")}`),console.log(`   - API-discovered tables: ${_.map(E=>E.name).join(", ")}`),{tables:j.tables||[],edgeFunctionResults:j.edgeFunctionResults||[]}},a=async(p,w)=>{const x=await fetch("https://vznmuiyyvhtiwakkmlfj.supabase.co/functions/v1/probe-base44",{method:"POST",headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ6bm11aXl5dmh0aXdha2ttbGZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgzNDQ4MTUsImV4cCI6MjA2MzkyMDgxNX0._ngJCzpYMyVpVqCABWBzHEqdwFw-FhKPyb20z4Q4uu0","Content-Type":"application/json"},body:JSON.stringify({url:p,authToken:w})});let m;try{m=await x.json()}catch{throw new Error(`Failed to probe Base44: ${x.status} ${x.statusText}`)}if(!m.success)throw new Error(m.error||"Failed to probe Base44 application");return{appId:m.appId,tables:m.tables||[],functions:m.functions||[]}},o=async(p,w=[],b)=>{const m=await fetch("https://vznmuiyyvhtiwakkmlfj.supabase.co/functions/v1/probe-pages",{method:"POST",headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZ6bm11aXl5dmh0aXdha2ttbGZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDgzNDQ4MTUsImV4cCI6MjA2MzkyMDgxNX0._ngJCzpYMyVpVqCABWBzHEqdwFw-FhKPyb20z4Q4uu0","Content-Type":"application/json"},body:JSON.stringify({url:p,discoveredRoutes:w,authToken:b})});let g;try{g=await m.json()}catch{throw new Error(`Failed to probe pages: ${m.status} ${m.statusText}`)}if(!g.success)throw new Error(g.error||"Failed to probe application pages");return g.result},l=async p=>{try{if(console.log("Starting platform detection for URL:",p),p.toLowerCase().includes("base44.app"))return console.log("Detected Base44 platform via URL domain"),"base44";try{console.log("Fetching HTML content to detect platform...");const b=await s(p,"html"),x=`<!DOCTYPE html>
153<html data-theme="base44"`,m=b.substring(0,x.length);if(console.log("HTML start:",m),console.log("Looking for Base44 signature:",x),m===x)return console.log("Detected Base44 platform via HTML content signature"),"base44";if(b.replace(/\s+/g," ").trim().substring(0,100).toLowerCase().includes('html data-theme="base44"'))return console.log("Detected Base44 platform via normalized HTML content"),"base44";console.log("Base44 signature not found in HTML content, defaulting to Supabase")}catch(b){console.warn("Failed to fetch HTML content for platform detection:",b),console.log("Falling back to URL-based detection")}return console.log("Detected Supabase platform (default)"),"supabase"}catch(w){return console.error("Error in platform detection:",w),console.log("Platform detection failed, defaulting to Supabase"),"supabase"}},c=async p=>{try{const w=p.startsWith("http")?p:`https://${p}`,b=await s(w,"html"),x=_l(b,w);if(x.length===0)throw new Error("No JavaScript bundles found in the page");let m={supabaseUrl:null,apiKey:null,tables:[],edgeFunctions:[],routes:[]};for(const g of x)try{const y=await s(g,"javascript"),j=await u(y);if(j.supabaseUrl&&j.apiKey){m=j;break}if(!m.supabaseUrl&&j.supabaseUrl&&(m.supabaseUrl=j.supabaseUrl),!m.apiKey&&j.apiKey&&(m.apiKey=j.apiKey),j.tables.length>0&&(m.tables=[...new Set([...m.tables,...j.tables])]),j.edgeFunctions.length>0){const N=new Map;m.edgeFunctions.forEach(k=>{N.set(k.name,k)}),j.edgeFunctions.forEach(k=>{const _=N.get(k.name);_?(_.discoveredCalls+=k.discoveredCalls,k.inferredPayload&&(!_.inferredPayload||k.inferredPayload.length>_.inferredPayload.length)&&(_.inferredPayload=k.inferredPayload)):N.set(k.name,k)}),m.edgeFunctions=Array.from(N.values())}j.routes.length>0&&(m.routes=[...new Set([...m.routes,...j.routes])])}catch(y){console.warn(`Failed to parse bundle ${g}:`,y);continue}if(!m.supabaseUrl)throw new Error("No Supabase URL found in JavaScript bundles");if(!m.apiKey)throw new Error("No Supabase API key found in JavaScript bundles");return m}catch(w){throw new Error(`Failed to extract credentials: ${w instanceof Error?w.message:"Unknown error"}`)}},u=async p=>{const{extractSupabaseUrl:w,extractApiKey:b,extractTableNames:x,extractEdgeFunctionCalls:m,extractRoutes:g}=await As(async()=>{const{extractSupabaseUrl:E,extractApiKey:O,extractTableNames:R,extractEdgeFunctionCalls:V,extractRoutes:Oe}=await Promise.resolve().then(()=>L1);return{extractSupabaseUrl:E,extractApiKey:O,extractTableNames:R,extractEdgeFunctionCalls:V,extractRoutes:Oe}},void 0),y=w(p),j=b(p),N=x(p),k=m(p),_=g(p);return{supabaseUrl:y,apiKey:j,tables:N,edgeFunctions:k,routes:_}},h=async(p,w)=>{var O,R;const b=Date.now();console.log("Starting Supabase scan:",{timestamp:b,url:p,hasAuthToken:!!w});const{supabaseUrl:x,apiKey:m,tables:g,edgeFunctions:y,routes:j}=await c(p);if(!x||!m)throw new Error("Could not extract Supabase credentials from the application");console.log("Discovered Edge Functions:",y);const{tables:N,edgeFunctionResults:k}=await n(x,m,g,y,w),_=await o(p,j,w),E={user_id:"",url:qt(p),timestamp:b,platform:"supabase",supabaseUrl:x,apiKey:m,tables:N,edgeFunctions:y,edgeFunctionResults:k,pages:_,status:"completed",is_authenticated:!!w};return console.log("Supabase scan completed successfully:",{url:E.url,timestamp:E.timestamp,tablesFound:E.tables.length,edgeFunctionsFound:((O=E.edgeFunctions)==null?void 0:O.length)||0,edgeFunctionResultsFound:((R=E.edgeFunctionResults)==null?void 0:R.length)||0,status:E.status}),E},d=async(p,w)=>{var k;const b=Date.now();console.log("Starting Base44 scan:",{timestamp:b,url:p,hasAuthToken:!!w});let x=[];try{const _=p.startsWith("http")?p:`https://${p}`,E=await s(_,"html"),O=_l(E,_);for(const R of O)try{const V=await s(R,"javascript"),Oe=await u(V);x=[...new Set([...x,...Oe.routes])]}catch(V){console.warn(`Failed to parse bundle for routes: ${R}`,V)}}catch(_){console.warn("Failed to extract routes for Base44 app:",_)}const{appId:m,tables:g,functions:y}=await a(p,w),j=await o(p,x,w),N={user_id:"",url:qt(p),timestamp:b,platform:"base44",base44AppId:m,tables:g,backendFunctions:y,pages:j,status:"completed",is_authenticated:!!w};return console.log("Base44 scan completed successfully:",{url:N.url,timestamp:N.timestamp,appId:N.base44AppId,tablesFound:N.tables.length,functionsFound:((k=N.backendFunctions)==null?void 0:k.length)||0,status:N.status}),N};return{scanning:e,scanApp:async(p,w,b)=>{t(!0);try{const x=await l(p);console.log(`Detected platform: ${x} for URL: ${p}`),await Xv(p,x);let m;return x==="base44"?m=await d(p,w):m=await h(p,w),m}catch(x){const{errorType:m,userFriendlyError:g}=r(x instanceof Error?x:new Error(String(x)),p),y={user_id:"",url:qt(p),timestamp:Date.now(),platform:"supabase",tables:[],status:"error",error:x instanceof Error?x.message:"Unknown error occurred",errorType:m,userFriendlyError:g,is_authenticated:!!w};return console.log("Scan failed:",{url:y.url,platform:y.platform,error:y.error,errorType:y.errorType,userFriendlyError:y.userFriendlyError,status:y.status}),y}finally{t(!1)}}}},pd=({children:e})=>{const{user:t,loading:r}=Ls();return r?i.jsx("div",{className:"min-h-screen bg-gray-900 flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-8 h-8 border-2 border-primary-500 border-t-transparent roun
153ded-full animate-spin mx-auto mb-4"}),i.jsx("p",{className:"text-gray-400",children:"Loading..."})]})}):t?i.jsx(i.Fragment,{children:e}):i.jsx(Xs,{to:"/",replace:!0})},D1=()=>{const e=fr(),{user:t,loading:r,signInWithGoogle:s,signInWithGitHub:n,signInWithEmail:a,signUpWithEmail:o,signOut:l}=Ls();S.useEffect(()=>{const _=new URLSearchParams(e.search),E=_.get("ref");if(E&&(/^[A-Z0-9]{8}$/i.test(E)?(console.log("Referral code detected:",E.toUpperCase()),localStorage.setItem("safevibe_referral_code",E.toUpperCase())):console.warn("Invalid referral code format:",E)),hd(_)){const V=Gv(_);Qv(V)}const O=new URL(window.location.href);let R=!1;if(E&&/^[A-Z0-9]{8}$/i.test(E)&&(O.searchParams.delete("ref"),R=!0),hd(O.searchParams)&&(O.searchParams.delete("utm_source"),O.searchParams.delete("utm_medium"),O.searchParams.delete("utm_campaign"),O.searchParams.delete("utm_term"),O.searchParams.delete("utm_content"),R=!0),R){const V=O.pathname+(O.search||"");window.history.replaceState({},document.title,V)}},[e.search]),S.useEffect(()=>{if(t&&!r){const _=sessionStorage.getItem("pending_oauth_referral");_&&(console.log("🚀 Processing pending OAuth referral for user:",t.id),h(_,t.id),sessionStorage.removeItem("pending_oauth_referral"))}},[t,r]);const{scanning:c,scanApp:u}=$1(),h=async(_,E)=>{try{console.log("🔍 Processing OAuth referral:",{referralCode:_,userId:E});const{data:O,error:R}=await Ce.auth.getUser();if(R||!O.user){console.error("❌ Failed to get user data for referral check:",R);return}const V=new Date(O.user.created_at).getTime(),Ze=Date.now()-V,_t=Ze<3e4;if(console.log("👤 OAuth user check:",{createdAt:O.user.created_at,timeDiffSeconds:Math.round(Ze/1e3),isNewUser:_t}),!_t){console.log("👋 Existing user signed in with referral link - skipping credit award");return}console.log("🎉 New user detected via OAuth - processing referral credit");const{data:P,error:Q}=await Ce.functions.invoke("award-referral-credit",{body:{referralCode:_.toUpperCase(),newUserId:E}});Q?console.error("❌ Error awarding OAuth referral credit:",Q):console.log("✅ OAuth referral credit result:",P)}catch(O){console.error("💥 Failed to process OAuth referral:",O)}},{scanHistory:d,scannedApps:f,loading:p,addScanResult:w,deleteScanResult:b,refreshHistory:x}=Cc(),m=async(_,E)=>{const O=await u(_,E,t==null?void 0:t.id);return t&&(O.user_id=t.id),await w(O)},g=async(_,E)=>{const O=await u(_,E,t==null?void 0:t.id);t&&(O.user_id=t.id);const R=await w(O);return await x(),R},y=S.useRef("");if(S.useEffect(()=>{e.pathname==="/my-apps"&&t&&!p?y.current!=="/my-apps"&&(y.current="/my-apps",x()):e.pathname!=="/my-apps"&&(y.current="")},[e.pathname,t,p]),r)return i.jsx("div",{className:"min-h-screen bg-gray-900 flex items-center justify-center",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-8 h-8 border-2 border-primary-500 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),i.jsx("p",{className:"text-gray-400",children:"Loading..."})]})});const j=t&&(e.pathname==="/scan"||e.pathname==="/my-apps"),N=e.pathname==="/my-apps"?"my-apps":"scan",k=()=>t?!p&&f.length>0?"/my-apps":"/scan":"/";return i.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-gray-900 via-gray-900 to-gray-800",children:[j&&i.jsx(v1,{user:t,activeTab:N,onTabChange:()=>{},onSignOut:l}),i.jsxs(Wg,{children:[i.jsx(kt,{path:"/",element:t?i.jsx(Xs,{to:k(),replace:!0}):i.jsx(m1,{})}),i.jsx(kt,{path:"/signin",element:t?i.jsx(Xs,{to:k(),replace:!0}):i.jsx(g1,{onSignInWithGoogle:s,onSignInWithGitHub:n,onSignInWithEmail:a,onSignUpWithEmail:o})}),i.jsx(kt,{path:"/fix-instructions/supabase",element:i.jsx(x1,{})}),i.jsx(kt,{path:"/fix-instructions/base44",element:i.jsx(y1,{})}),i.jsx(kt,{path:"/scan",element:i.jsx(pd,{children:i.jsx("main",{children:i.jsx(E1,{onScan:m,scanning:c,userId:t==null?void 0:t.id,userEmail:t==null?void 0:t.email})})})}),i.jsx(kt,{path:"/my-apps",element:i.jsx(pd,{children:i.jsx("main",{children:i.jsx(T1,{scanHistory:d,scannedApps:f,loading:p,onDeleteScan:b,onRefresh:x,onRerunScan:g,scanning:c,userId:t==null?void 0:t.id,userEmail:t==null?void 0:t.email})})})}),i.jsx(kt,{path:"/history",element:i.jsx(Xs,{to:"/my-apps",replace:!0})}),i.jsx(kt,{path:"*",element:i.jsx(Xs,{to:"/",replace:!0})})]})]})};function F1(){return i.jsx(Qg,{children:i.jsx(D1,{})})}Cf(document.getElementById("root")).render(i.jsx(S.StrictMode,{children:i.jsx(F1,{})}));

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.