vendor: 5,119 bytes, line 1
1function og(r,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in r)){const u=Object.getOwnPropertyDescriptor(a,l);u&&Object.defineProperty(r,l,u.get?u:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function s(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(l){if(l.ep)return;l.ep=!0;const u=s(l);fetch(l.href,u)}})();function lg(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Tl={exports:{}},Ts={},Pl={exports:{}},fe={};var dh;function ug(){if(dh)return fe;dh=1;var r=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),y=Symbol.iterator;function _(b){return b===null||typeof b!="object"?null:(b=y&&b[y]||b["@@iterator"],typeof b=="function"?b:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,O={};function N(b,$,ne){this.props=b,this.context=$,this.refs=O,this.updater=ne||E}N.prototype.isReactComponent={},N.prototype.setState=function(b,$){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,$,"setState")},N.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function D(){}D.prototype=N.prototype;function M(b,$,ne){this.props=b,this.context=$,this.refs=O,this.updater=ne||E}var U=M.prototype=new D;U.constructor=M,j(U,N.prototype),U.isPureReactComponent=!0;var q=Array.isArray,ue=Object.prototype.hasOwnProperty,Y={current:null},oe={key:!0,ref:!0,__self:!0,__source:!0};function ye(b,$,ne){var ie,de={},he=null,pe=null;if($!=null)for(ie in $.ref!==void 0&&(pe=$.ref),$.key!==void 0&&(he=""+$.key),$)ue.call($,ie)&&!oe.hasOwnProperty(ie)&&(de[ie]=$[ie]);var we=arguments.length-2;if(we===1)de.children=ne;else if(1<we){for(var je=Array(we),ht=0;ht<we;ht++)je[ht]=arguments[ht+2];de.children=je}if(b&&b.defaultProps)for(ie in we=b.defaultProps,we)de[ie]===void 0&&(de[ie]=we[ie]);return{$$typeof:r,type:b,key:he,ref:pe,props:de,_owner:Y.current}}function te(b,$){return{$$typeof:r,type:b.type,key:$,ref:b.ref,props:b.props,_owner:b._owner}}function ce(b){return typeof b=="object"&&b!==null&&b.$$typeof===r}function ge(b){var $={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(ne){return $[ne]})}var Ee=/\/+/g;function Te(b,$){return typeof b=="object"&&b!==null&&b.key!=null?ge(""+b.key):$.toString(36)}function Le(b,$,ne,ie,de){var he=typeof b;(he==="undefined"||he==="boolean")&&(b=null);var pe=!1;if(b===null)pe=!0;else switch(he){case"string":case"number":pe=!0;break;case"object":switch(b.$$typeof){case r:case t:pe=!0}}if(pe)return pe=b,de=de(pe),b=ie===""?"."+Te(pe,0):ie,q(de)?(ne="",b!=null&&(ne=b.replace(Ee,"$&/")+"/"),Le(de,$,ne,"",function(ht){return ht})):de!=null&&(ce(de)&&(de=te(de,ne+(!de.key||pe&&pe.key===de.key?"":(""+de.key).replace(Ee,"$&/")+"/")+b)),$.push(de)),1;if(pe=0,ie=ie===""?".":ie+":",q(b))for(var we=0;we<b.length;we++){he=b[we];var je=ie+Te(he,we);pe+=Le(he,$,ne,je,de)}else if(je=_(b),typeof je=="function")for(b=je.call(b),we=0;!(he=b.next()).done;)he=he.value,je=ie+Te(he,we++),pe+=Le(he,$,ne,je,de);else if(he==="object")throw $=String(b),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return pe}function Qe(b,$,ne){if(b==null)return b;var ie=[],de=0;return Le(b,ie,"","",function(he){return $.call(ne,he,de++)}),ie}function B(b){if(b._status===-1){var $=b._result;$=$(),$.then(function(ne){(b._status===0||b._status===-1)&&(b._status=1,b._result=ne)},function(ne){(b._status===0||b._status===-1)&&(b._status=2,b._result=ne)}),b._status===-1&&(b._status=0,b._result=$)}if(b._status===1)return b._result.default;throw b._result}var C={current:null},T={transition:null},H={ReactCurrentDispatcher:C,ReactCurrentBatchConfig:T,ReactCurrentOwner:Y};function L(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 8,045 bytes, line 1
1return fe.Children={map:Qe,forEach:function(b,$,ne){Qe(b,function(){$.apply(this,arguments)},ne)},count:function(b){var $=0;return Qe(b,function(){$++}),$},toArray:function(b){return Qe(b,function($){return $})||[]},only:function(b){if(!ce(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},fe.Component=N,fe.Fragment=s,fe.Profiler=l,fe.PureComponent=M,fe.StrictMode=a,fe.Suspense=m,fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,fe.act=L,fe.cloneElement=function(b,$,ne){if(b==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+b+".");var ie=j({},b.props),de=b.key,he=b.ref,pe=b._owner;if($!=null){if($.ref!==void 0&&(he=$.ref,pe=Y.current),$.key!==void 0&&(de=""+$.key),b.type&&b.type.defaultProps)var we=b.type.defaultProps;for(je in $)ue.call($,je)&&!oe.hasOwnProperty(je)&&(ie[je]=$[je]===void 0&&we!==void 0?we[je]:$[je])}var je=arguments.length-2;if(je===1)ie.children=ne;else if(1<je){we=Array(je);for(var ht=0;ht<je;ht++)we[ht]=arguments[ht+2];ie.children=we}return{$$typeof:r,type:b.type,key:de,ref:he,props:ie,_owner:pe}},fe.createContext=function(b){return b={$$typeof:c,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},b.Provider={$$typeof:u,_context:b},b.Consumer=b},fe.createElement=ye,fe.createFactory=function(b){var $=ye.bind(null,b);return $.type=b,$},fe.createRef=function(){return{current:null}},fe.forwardRef=function(b){return{$$typeof:p,render:b}},fe.isValidElement=ce,fe.lazy=function(b){return{$$typeof:w,_payload:{_status:-1,_result:b},_init:B}},fe.memo=function(b,$){return{$$typeof:g,type:b,compare:$===void 0?null:$}},fe.startTransition=function(b){var $=T.transition;T.transition={};try{b()}finally{T.transition=$}},fe.unstable_act=L,fe.useCallback=function(b,$){return C.current.useCallback(b,$)},fe.useContext=function(b){return C.current.useContext(b)},fe.useDebugValue=function(){},fe.useDeferredValue=function(b){return C.current.useDeferredValue(b)},fe.useEffect=function(b,$){return C.current.useEffect(b,$)},fe.useId=function(){return C.current.useId()},fe.useImperativeHandle=function(b,$,ne){return C.current.useImperativeHandle(b,$,ne)},fe.useInsertionEffect=function(b,$){return C.current.useInsertionEffect(b,$)},fe.useLayoutEffect=function(b,$){return C.current.useLayoutEffect(b,$)},fe.useMemo=function(b,$){return C.current.useMemo(b,$)},fe.useReducer=function(b,$,ne){return C.current.useReducer(b,$,ne)},fe.useRef=function(b){return C.current.useRef(b)},fe.useState=function(b){return C.current.useState(b)},fe.useSyncExternalStore=function(b,$,ne){return C.current.useSyncExternalStore(b,$,ne)},fe.useTransition=function(){return C.current.useTransition()},fe.version="18.3.1",fe}var hh;function uu(){return hh||(hh=1,Pl.exports=ug()),Pl.exports}var fh;function cg(){if(fh)return Ts;fh=1;var r=uu(),t=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(p,m,g){var w,y={},_=null,E=null;g!==void 0&&(_=""+g),m.key!==void 0&&(_=""+m.key),m.ref!==void 0&&(E=m.ref);for(w in m)a.call(m,w)&&!u.hasOwnProperty(w)&&(y[w]=m[w]);if(p&&p.defaultProps)for(w in m=p.defaultProps,m)y[w]===void 0&&(y[w]=m[w]);return{$$typeof:t,type:p,key:_,ref:E,props:y,_owner:l.current}}return Ts.Fragment=s,Ts.jsx=c,Ts.jsxs=c,Ts}var ph;function dg(){return ph||(ph=1,Tl.exports=cg()),Tl.exports}var h=dg(),I=uu();const hg=lg(I),fg=og({__proto__:null,default:hg},[I]);var ra={},Nl={exports:{}},ct={},Rl={exports:{}},Ol={};var mh;function pg(){return mh||(mh=1,(function(r){function t(T,H){var L=T.length;T.push(H);e:for(;0<L;){var b=L-1>>>1,$=T[b];if(0<l($,H))T[b]=H,T[L]=$,L=b;else break e}}function s(T){return T.length===0?null:T[0]}function a(T){if(T.length===0)return null;var H=T[0],L=T.pop();if(L!==H){T[0]=L;e:for(var b=0,$=T.length,ne=$>>>1;b<ne;){var ie=2*(b+1)-1,de=T[ie],he=ie+1,pe=T[he];if(0>l(de,L))he<$&&0>l(pe,de)?(T[b]=pe,T[he]=L,b=he):(T[b]=de,T[ie]=L,b=ie);else if(he<$&&0>l(pe,L))T[b]=pe,T[he]=L,b=he;else break e}}return H}function l(T,H){var L=T.sortIndex-H.sortIndex;return L!==0?L:T.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var c=Date,p=c.now();r.unstable_now=function(){return c.now()-p}}var m=[],g=[],w=1,y=null,_=3,E=!1,j=!1,O=!1,N=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function U(T){for(var H=s(g);H!==null;){if(H.callback===null)a(g);else if(H.startTime<=T)a(g),H.sortIndex=H.expirationTime,t(m,H);else break;H=s(g)}}function q(T){if(O=!1,U(T),!j)if(s(m)!==null)j=!0,B(ue);else{var H=s(g);H!==null&&C(q,H.startTime-T)}}function ue(T,H){j=!1,O&&(O=!1,D(ye),ye=-1),E=!0;var L=_;try{for(U(H),y=s(m);y!==null&&(!(y.expirationTime>H)||T&&!ge());){var b=y.callback;if(typeof b=="function"){y.callback=null,_=y.priorityLevel;var $=b(y.expirationTime<=H);H=r.unstable_now(),typeof $=="function"?y.callback=$:y===s(m)&&a(m),U(H)}else a(m);y=s(m)}if(y!==null)var ne=!0;else{var ie=s(g);ie!==null&&C(q,ie.startTime-H),ne=!1}return ne}finally{y=null,_=L,E=!1}}var Y=!1,oe=null,ye=-1,te=5,ce=-1;function ge(){return!(r.unstable_now()-ce<te)}function Ee(){if(oe!==null){var T=r.unstable_now();ce=T;var H=!0;try{H=oe(!0,T)}finally{H?Te():(Y=!1,oe=null)}}else Y=!1}var Te;if(typeof M=="function")Te=function(){M(Ee)};else if(typeof MessageChannel<"u"){var Le=new MessageChannel,Qe=Le.port2;Le.port1.onmessage=Ee,Te=function(){Qe.postMessage(null)}}else Te=function(){N(Ee,0)};function B(T){oe=T,Y||(Y=!0,Te())}function C(T,H){ye=N(function(){T(r.unstable_now())},H)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(T){T.callback=null},r.unstable_continueExecution=function(){j||E||(j=!0,B(ue))},r.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"):te=0<T?Math.floor(1e3/T):5},r.unstable_getCurrentPriorityLevel=function(){return _},r.unstable_getFirstCallbackNode=function(){return s(m)},r.unstable_next=function(T){switch(_){case 1:case 2:case 3:var H=3;break;default:H=_}var L=_;_=H;try{return T()}finally{_=L}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(T,H){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var L=_;_=T;try{return H()}finally{_=L}},r.unstable_scheduleCallback=function(T,H,L){var b=r.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?b+L:b):L=b,T){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=L+$,T={id:w++,callback:H,priorityLevel:T,startTime:L,expirationTime:$,sortIndex:-1},L>b?(T.sortIndex=L,t(g,T),s(m)===null&&T===s(g)&&(O?(D(ye),ye=-1):O=!0,C(q,L-b))):(T.sortIndex=$,t(m,T),j||E||(j=!0,B(ue))),T},r.unstable_shouldYield=ge,r.unstable_wrapCallback=function(T){var H=_;return function(){var L=_;_=H;try{return T.apply(this,arguments)}finally{_=L}}}})(Ol)),Ol}var gh;function mg(){return gh||(gh=1,Rl.exports=pg()),Rl.exports}var vh;function gg(){if(vh)return ct;vh=1;var r=uu(),t=mg();function s(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,l={};
vendor: 47,164 bytes, lines 1-6
1function u(e,n){c(e,n),c(e+"Capture",n)}function c(e,n){for(l[e]=n,e=0;e<n.length;e++)a.add(n[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[: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]*$/,w={},y={};function _(e){return m.call(y,e)?!0:m.call(w,e)?!1:g.test(e)?y[e]=!0:(w[e]=!0,!1)}function E(e,n,i,o){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return o?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,n,i,o){if(n===null||typeof n>"u"||E(e,n,i,o))return!0;if(o)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function O(e,n,i,o,d,f,v){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=o,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=f,this.removeEmptyString=v}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new O(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];N[n]=new O(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new O(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new O(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){N[e]=new O(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new O(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new O(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new O(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new O(e,5,!1,e.toLowerCase(),null,!1,!1)});var D=/[\-:]([a-z])/g;function M(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 n=e.replace(D,M);N[n]=new O(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(D,M);N[n]=new O(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(D,M);N[n]=new O(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new O(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new O("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new O(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,n,i,o){var d=N.hasOwnProperty(n)?N[n]:null;(d!==null?d.type!==0:o||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,i,d,o)&&(i=null),o||d===null?_(n)&&(i===null?e.removeAttribute(n):e.setAttribute(n,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(n=d.attributeName,o=d.attributeNamespace,i===null?e.removeAttribute(n):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,o?e.setAttributeNS(o,n,i):e.setAttribute(n,i))))}var q=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ue=Symbol.for("react.element"),Y=Symbol.for("react.portal"),oe=Symbol.for("react.fragment"),ye=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),ce=Symbol.for("react.provider"),ge=Symbol.for("react.context"),Ee=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),Le=Symbol.for("react.suspense_list"),Qe=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),T=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=T&&e[T]||e["@@iterator"],typeof e=="function"?e:null)}var L=Object.assign,b;function $(e){if(b===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);b=n&&n[1]||""}return` 2`+b+e}var ne=!1;function ie(e,n){if(!e||ne)return"";ne=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(A){var o=A}Reflect.construct(e,[],n)}else{try{n.call()}catch(A){o=A}e.call(n.prototype)}else{try{throw Error()}catch(A){o=A}e()}}catch(A){if(A&&o&&typeof A.stack=="string"){for(var d=A.stack.split(` 3`),f=o.stack.split(` 4`),v=d.length-1,x=f.length-1;1<=v&&0<=x&&d[v]!==f[x];)x--;for(;1<=v&&0<=x;v--,x--)if(d[v]!==f[x]){if(v!==1||x!==1)do if(v--,x--,0>x||d[v]!==f[x]){var k=` 5`+d[v].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),k}while(1<=v&&0<=x);break}}}finally{ne=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?$(e):""}function de(e){switch(e.tag){case 5:return $(e.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return""}}function he(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 oe:return"Fragment";case Y:return"Portal";case te:return"Profiler";case ye:return"StrictMode";case Te:return"Suspense";case Le:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ge:return(e.displayName||"Context")+".Consumer";case ce:return(e._context.displayName||"Context")+".Provider";case Ee:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qe:return n=e.displayName||null,n!==null?n:he(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return he(e(n))}catch{}}return null}function pe(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(n);case 8:return n===ye?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function we(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ht(e){var n=je(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),o=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,f=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(v){o=""+v,f.call(this,v)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return o},setValue:function(v){o=""+v},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ks(e){e._valueTracker||(e._valueTracker=ht(e))}function vu(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),o="";return e&&(o=je(e)?e.checked?"true":"false":e.value),e=o,e!==i?(n.setValue(e),!0):!1}function Gs(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 La(e,n){var i=n.checked;return L({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function yu(e,n){var i=n.defaultValue==null?"":n.defaultValue,o=n.checked!=null?n.checked:n.defaultChecked;i=we(n.value!=null?n.value:i),e._wrapperState={initialChecked:o,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function wu(e,n){n=n.checked,n!=null&&U(e,"checked",n,!1)}function Ia(e,n){wu(e,n);var i=we(n.value),o=n.type;if(i!=null)o==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Ua(e,n.type,i):n.hasOwnProperty("defaultValue")&&Ua(e,n.type,we(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function xu(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var o=n.type;if(!(o!=="submit"&&o!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Ua(e,n,i){(n!=="number"||Gs(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Hr=Array.isArray;function Yn(e,n,i,o){if(e=e.options,n){n={};for(var d=0;d<i.length;d++)n["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=n.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&o&&(e[i].defaultSelected=!0)}else{for(i=""+we(i),n=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,o&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function $a(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(s(91));return L({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _u(e,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(s(92));if(Hr(i)){if(1<i.length)throw Error(s(93));i=i[0]}n=i}n==null&&(n=""),i=n}e._wrapperState={initialValue:we(i)}}function ku(e,n){var i=we(n.value),o=we(n.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),n.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),o!=null&&(e.defaultValue=""+o)}function bu(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Su(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 Da(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Su(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Js,Eu=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,o,d){MSApp.execUnsafeLocalFunction(function(){return e(n,i,o,d)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(Js=Js||document.createElement("div"),Js.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Js.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Wr(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var Vr={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},dp=["Webkit","ms","Moz","O"];Object.keys(Vr).forEach(function(e){dp.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Vr[n]=Vr[e]})});function ju(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||Vr.hasOwnProperty(e)&&Vr[e]?(""+n).trim():n+"px"}function Cu(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var o=i.indexOf("--")===0,d=ju(i,n[i],o);i==="float"&&(i="cssFloat"),o?e.setProperty(i,d):e[i]=d}}var hp=L({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 Ma(e,n){if(n){if(hp[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(s(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(s(61))}if(n.style!=null&&typeof n.style!="object")throw Error(s(62))}}function Ba(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fa=null;function za(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ha=null,Qn=null,Xn=null;function Tu(e){if(e=fs(e)){if(typeof Ha!="function")throw Error(s(280));var n=e.stateNode;n&&(n=yi(n),Ha(e.stateNode,e.type,n))}}function Pu(e){Qn?Xn?Xn.push(e):Xn=[e]:Qn=e}function Nu(){if(Qn){var e=Qn,n=Xn;if(Xn=Qn=null,Tu(e),n)for(e=0;e<n.length;e++)Tu(n[e])}}function Ru(e,n){return e(n)}function Ou(){}var Wa=!1;function Au(e,n,i){if(Wa)return e(n,i);Wa=!0;try{return Ru(e,n,i)}finally{Wa=!1,(Qn!==null||Xn!==null)&&(Ou(),Nu())}}function qr(e,n){var i=e.stateNode;if(i===null)return null;var o=yi(i);if(o===null)return null;i=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,n,typeof i));return i}var Va=!1;if(p)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){Va=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{Va=!1}function fp(e,n,i,o,d,f,v,x,k){var A=Array.prototype.slice.call(arguments,3);try{n.apply(i,A)}catch(z){this.onError(z)}}var Gr=!1,Ys=null,Qs=!1,qa=null,pp={onError:function(e){Gr=!0,Ys=e}};function mp(e,n,i,o,d,f,v,x,k){Gr=!1,Ys=null,fp.apply(pp,arguments)}function gp(e,n,i,o,d,f,v,x,k){if(mp.apply(this,arguments),Gr){if(Gr){var A=Ys;Gr=!1,Ys=null}else throw Error(s(198));Qs||(Qs=!0,qa=A)}}function Rn(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function Lu(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function Iu(e){if(Rn(e)!==e)throw Error(s(188))}function vp(e){var n=e.alternate;if(!n){if(n=Rn(e),n===null)throw Error(s(188));return n!==e?null:e}for(var i=e,o=n;;){var d=i.return;if(d===null)break;var f=d.alternate;if(f===null){if(o=d.return,o!==null){i=o;continue}break}if(d.child===f.child){for(f=d.child;f;){if(f===i)return Iu(d),e;if(f===o)return Iu(d),n;f=f.sibling}throw Error(s(188))}if(i.return!==o.return)i=d,o=f;else{for(var v=!1,x=d.child;x;){if(x===i){v=!0,i=d,o=f;break}if(x===o){v=!0,o=d,i=f;break}x=x.sibling}if(!v){for(x=f.child;x;){if(x===i){v=!0,i=f,o=d;break}if(x===o){v=!0,o=f,i=d;break}x=x.sibling}if(!v)throw Error(s(189))}}if(i.alternate!==o)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:n}function Uu(e){return e=vp(e),e!==null?$u(e):null}function $u(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=$u(e);if(n!==null)return n;e=e.sibling}return null}var Du=t.unstable_scheduleCallback,Mu=t.unstable_cancelCallback,yp=t.unstable_shouldYield,wp=t.unstable_requestPaint,Ie=t.unstable_now,xp=t.unstable_getCurrentPriorityLevel,Ka=t.unstable_ImmediatePriority,Bu=t.unstable_UserBlockingPriority,Xs=t.unstable_NormalPriority,_p=t.unstable_LowPriority,Fu=t.unstable_IdlePriority,Zs=null,Ut=null;function kp(e){if(Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(Zs,e,void 0,(e.current.flags&128)===128)}catch{}}var Et=Math.clz32?Math.clz32:Ep,bp=Math.log,Sp=Math.LN2;function Ep(e){return e>>>=0,e===0?32:31-(bp(e)/Sp|0)|0}var ei=64,ti=4194304;function Jr(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 ni(e,n){var i=e.pendingLanes;if(i===0)return 0;var o=0,d=e.suspendedLanes,f=e.pingedLanes,v=i&268435455;if(v!==0){var x=v&~d;x!==0?o=Jr(x):(f&=v,f!==0&&(o=Jr(f)))}else v=i&~d,v!==0?o=Jr(v):f!==0&&(o=Jr(f));if(o===0)return 0;if(n!==0&&n!==o&&(n&d)===0&&(d=o&-o,f=n&-n,d>=f||d===16&&(f&4194240)!==0))return n;if((o&4)!==0&&(o|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=o;0<n;)i=31-Et(n),d=1<<i,o|=e[i],n&=~d;return o}function jp(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 Cp(e,n){for(var i=e.suspendedLanes,o=e.pingedLanes,d=e.expirationTimes,f=e.pendingLanes;0<f;){var v=31-Et(f),x=1<<v,k=d[v];k===-1?((x&i)===0||(x&o)!==0)&&(d[v]=jp(x,n)):k<=n&&(e.expiredLanes|=x),f&=~x}}function Ga(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zu(){var e=ei;return ei<<=1,(ei&4194240)===0&&(ei=64),e}function Ja(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function Yr(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Et(n),e[n]=i}function Tp(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-Et(i),f=1<<d;n[d]=0,o[d]=-1,e[d]=-1,i&=~f}}function Ya(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var o=31-Et(i),d=1<<o;d&n|e[o]&n&&(e[o]|=n),i&=~d}}var xe=0;function Hu(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Wu,Qa,Vu,qu,Ku,Xa=!1,ri=[],on=null,ln=null,un=null,Qr=new Map,Xr=new Map,cn=[],Pp="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 Gu(e,n){switch(e){case"focusin":case"focusout":on=null;break;case"dragenter":case"dragleave":ln=null;break;case"mouseover":case"mouseout":un=null;break;case"pointerover":case"pointerout":Qr.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xr.delete(n.pointerId)}}function Zr(e,n,i,o,d,f){return e===null||e.nativeEvent!==f?(e={blockedOn:n,domEventName:i,eventSystemFlags:o,nativeEvent:f,targetContainers:[d]},n!==null&&(n=fs(n),n!==null&&Qa(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function Np(e,n,i,o,d){switch(n){case"focusin":return on=Zr(on,e,n,i,o,d),!0;case"dragenter":return ln=Zr(ln,e,n,i,o,d),!0;case"mouseover":return un=Zr(un,e,n,i,o,d),!0;case"pointerover":var f=d.pointerId;return Qr.set(f,Zr(Qr.get(f)||null,e,n,i,o,d)),!0;case"gotpointercapture":return f=d.pointerId,Xr.set(f,Zr(Xr.get(f)||null,e,n,i,o,d)),!0}return!1}function Ju(e){var n=On(e.target);if(n!==null){var i=Rn(n);if(i!==null){if(n=i.tag,n===13){if(n=Lu(i),n!==null){e.blockedOn=n,Ku(e.priority,function(){Vu(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function si(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=eo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var o=new i.constructor(i.type,i);Fa=o,i.target.dispatchEvent(o),Fa=null}else return n=fs(i),n!==null&&Qa(n),e.blockedOn=i,!1;n.shift()}return!0}function Yu(e,n,i){si(e)&&i.delete(n)}function Rp(){Xa=!1,on!==null&&si(on)&&(on=null),ln!==null&&si(ln)&&(ln=null),un!==null&&si(un)&&(un=null),Qr.forEach(Yu),Xr.forEach(Yu)}function es(e,n){e.blockedOn===n&&(e.blockedOn=null,Xa||(Xa=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rp)))}function ts(e){function n(d){return es(d,e)}if(0<ri.length){es(ri[0],e);for(var i=1;i<ri.length;i++){var o=ri[i];o.blockedOn===e&&(o.blockedOn=null)}}for(on!==null&&es(on,e),ln!==null&&es(ln,e),un!==null&&es(un,e),Qr.forEach(n),Xr.forEach(n),i=0;i<cn.length;i++)o=cn[i],o.blockedOn===e&&(o.blockedOn=null);for(;0<cn.length&&(i=cn[0],i.blockedOn===null);)Ju(i),i.blockedOn===null&&cn.shift()}var Zn=q.ReactCurrentBatchConfig,ii=!0;function Op(e,n,i,o){var d=xe,f=Zn.transition;Zn.transition=null;try{xe=1,Za(e,n,i,o)}finally{xe=d,Zn.transition=f}}function Ap(e,n,i,o){var d=xe,f=Zn.transition;Zn.transition=null;try{xe=4,Za(e,n,i,o)}finally{xe=d,Zn.transition=f}}function Za(e,n,i,o){if(ii){var d=eo(e,n,i,o);if(d===null)yo(e,n,o,ai,i),Gu(e,o);else if(Np(d,e,n,i,o))o.stopPropagation();else if(Gu(e,o),n&4&&-1<Pp.indexOf(e)){for(;d!==null;){var f=fs(d);if(f!==null&&Wu(f),f=eo(e,n,i,o),f===null&&yo(e,n,o,ai,i),f===d)break;d=f}d!==null&&o.stopPropagation()}else yo(e,n,o,null,i)}}var ai=null;function eo(e,n,i,o){if(ai=null,e=za(o),e=On(e),e!==null)if(n=Rn(e),n===null)e=null;else if(i=n.tag,i===13){if(e=Lu(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return ai=e,null}function Qu(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(xp()){case Ka:return 1;case Bu:return 4;case Xs:case _p:return 16;case Fu:return 536870912;default:return 16}default:return 16}}var dn=null,to=null,oi=null;function Xu(){if(oi)return oi;var e,n=to,i=n.length,o,d="value"in dn?dn.value:dn.textContent,f=d.length;for(e=0;e<i&&n[e]===d[e];e++);var v=i-e;for(o=1;o<=v&&n[i-o]===d[f-o];o++);return oi=d.slice(e,1<o?1-o:void 0)}function li(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function ui(){return!0}function Zu(){return!1}function ft(e){function n(i,o,d,f,v){this._reactName=i,this._targetInst=d,this.type=o,this.nativeEvent=f,this.target=v,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(i=e[x],this[x]=i?i(f):f[x]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?ui:Zu,this.isPropagationStopped=Zu,this}return L(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=ui)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ui)},persist:function(){},isPersistent:ui}),n}var er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},no=ft(er),ns=L({},er,{view:0,detail:0}),Lp=ft(ns),ro,so,rs,ci=L({},ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ao,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!==rs&&(rs&&e.type==="mousemove"?(ro=e.screenX-rs.screenX,so=e.screenY-rs.screenY):so=ro=0,rs=e),ro)},movementY:function(e){return"movementY"in e?e.movementY:so}}),ec=ft(ci),Ip=L({},ci,{dataTransfer:0}),Up=ft(Ip),$p=L({},ns,{relatedTarget:0}),io=ft($p),Dp=L({},er,{animationName:0,elapsedTime:0,pseudoElement:0}),Mp=ft(Dp),Bp=L({},er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fp=ft(Bp),zp=L({},er,{data:0}),tc=ft(zp),Hp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wp={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"},Vp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qp(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Vp[e])?!!n[e]:!1}function ao(){return qp}var Kp=L({},ns,{key:function(e){if(e.key){var n=Hp[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ao,charCode:function(e){return e.type==="keypress"?li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Gp=ft(Kp),Jp=L({},ci,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nc=ft(Jp),Yp=L({},ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ao}),Qp=ft(Yp),Xp=L({},er,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zp=ft(Xp),em=L({},ci,{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}),tm=ft(em),nm=[9,13,27,32],oo=p&&"CompositionEvent"in window,ss=null;p&&"documentMode"in document&&(ss=document.documentMode);var rm=p&&"TextEvent"in window&&!ss,rc=p&&(!oo||ss&&8<ss&&11>=ss),sc=" ",ic=!1;function ac(e,n){switch(e){case"keyup":return nm.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tr=!1;function sm(e,n){switch(e){case"compositionend":return oc(n);case"keypress":return n.which!==32?null:(ic=!0,sc);case"textInput":return e=n.data,e===sc&&ic?null:e;default:return null}}function im(e,n){if(tr)return e==="compositionend"||!oo&&ac(e,n)?(e=Xu(),oi=to=dn=null,tr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return rc&&n.locale!=="ko"?null:n.data;default:return null}}var am={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 lc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!am[e.type]:n==="textarea"}function uc(e,n,i,o){Pu(o),n=mi(n,"onChange"),0<n.length&&(i=new no("onChange","change",null,i,o),e.push({event:i,listeners:n}))}var is=null,as=null;function om(e){Cc(e,0)}function di(e){var n=ar(e);if(vu(n))return e}function lm(e,n){if(e==="change")return n}var cc=!1;if(p){var lo;if(p){var uo="oninput"in document;if(!uo){var dc=document.createElement("div");dc.setAttribute("oninput","return;"),uo=typeof dc.oninput=="function"}lo=uo}else lo=!1;cc=lo&&(!document.documentMode||9<document.documentMode)}function hc(){is&&(is.detachEvent("onpropertychange",fc),as=is=null)}function fc(e){if(e.propertyName==="value"&&di(as)){var n=[];uc(n,as,e,za(e)),Au(om,n)}}function um(e,n,i){e==="focusin"?(hc(),is=n,as=i,is.attachEvent("onpropertychange",fc)):e==="focusout"&&hc()}function cm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return di(as)}function dm(e,n){if(e==="click")return di(n)}function hm(e,n){if(e==="input"||e==="change")return di(n)}function fm(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var jt=typeof Object.is=="function"?Object.is:fm;function os(e,n){if(jt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),o=Object.keys(n);if(i.length!==o.length)return!1;for(o=0;o<i.length;o++){var d=i[o];if(!m.call(n,d)||!jt(e[d],n[d]))return!1}return!0}function pc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mc(e,n){var i=pc(e);e=0;for(var o;i;){if(i.nodeType===3){if(o=e+i.textContent.length,e<=n&&o>=n)return{node:i,offset:n-e};e=o}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=pc(i)}}function gc(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?gc(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function vc(){for(var e=window,n=Gs();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=Gs(e.document)}return n}function co(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function pm(e){var n=vc(),i=e.focusedElem,o=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&gc(i.ownerDocument.documentElement,i)){if(o!==null&&co(i)){if(n=o.start,e=o.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,f=Math.min(o.start,d);o=o.end===void 0?f:Math.min(o.end,d),!e.extend&&f>o&&(d=o,o=f,f=d),d=mc(i,f);var v=mc(i,o);d&&v&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(n=n.createRange(),n.setStart(d.node,d.offset),e.removeAllRanges(),f>o?(e.addRange(n),e.extend(v.node,v.offset)):(n.setEnd(v.node,v.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)e=n[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mm=p&&"documentMode"in document&&11>=document.documentMode,nr=null,ho=null,ls=null,fo=!1;function yc(e,n,i){var o=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;fo||nr==null||nr!==Gs(o)||(o=nr,"selectionStart"in o&&co(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ls&&os(ls,o)||(ls=o,o=mi(ho,"onSelect"),0<o.length&&(n=new no("onSelect","select",null,n,i),e.push({event:n,listeners:o}),n.target=nr)))}function hi(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var rr={animationend:hi("Animation","AnimationEnd"),animationiteration:hi("Animation","AnimationIteration"),animationstart:hi("Animation","AnimationStart"),transitionend:hi("Transition","TransitionEnd")},po={},wc={};p&&(wc=document.createElement("div").style,"AnimationEvent"in window||(delete rr.animationend.animation,delete rr.animationiteration.animation,delete rr.animationstart.animation),"TransitionEvent"in window||delete rr.transitionend.transition);function fi(e){if(po[e])return po[e];if(!rr[e])return e;var n=rr[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in wc)return po[e]=n[i];return e}var xc=fi("animationend"),_c=fi("animationiteration"),kc=fi("animationstart"),bc=fi("transitionend"),Sc=new Map,Ec="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 hn(e,n){Sc.set(e,n),u(n,[e])}for(var mo=0;mo<Ec.length;mo++){var go=Ec[mo],gm=go.toLowerCase(),vm=go[0].toUpperCase()+go.slice(1);hn(gm,"on"+vm)}hn(xc,"onAnimationEnd"),hn(_c,"onAnimationIteration"),hn(kc,"onAnimationStart"),hn("dblclick","onDoubleClick"),hn("focusin","onFocus"),hn("focusout","onBlur"),hn(bc,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var us="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(" "),ym=new Set("cancel close invalid load scroll toggle".split(" ").concat(us));function jc(e,n,i){var o=e.type||"unknown-event";e.currentTarget=i,gp(o,n,void 0,e),e.currentTarget=null}function Cc(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var o=e[i],d=o.event;o=o.listeners;e:{var f=void 0;if(n)for(var v=o.length-1;0<=v;v--){var x=o[v],k=x.instance,A=x.currentTarget;if(x=x.listener,k!==f&&d.isPropagationStopped())break e;jc(d,x,A),f=k}else for(v=0;v<o.length;v++){if(x=o[v],k=x.instance,A=x.currentTarget,x=x.listener,k!==f&&d.isPropagationStopped())break e;jc(d,x,A),f=k}}}if(Qs)throw e=qa,Qs=!1,qa=null,e}function be(e,n){var i=n[So];i===void 0&&(i=n[So]=new Set);var o=e+"__bubble";i.has(o)||(Tc(n,e,2,!1),i.add(o))}function vo(e,n,i){var o=0;n&&(o|=4),Tc(i,e,o,n)}var pi="_reactListening"+Math.random().toString(36).slice(2);function cs(e){if(!e[pi]){e[pi]=!0,a.forEach(function(i){i!=="selectionchange"&&(ym.has(i)||vo(i,!1,e),vo(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[pi]||(n[pi]=!0,vo("selectionchange",!1,n))}}function Tc(e,n,i,o){switch(Qu(n)){case 1:var d=Op;break;case 4:d=Ap;break;default:d=Za}i=d.bind(null,n,i,e),d=void 0,!Va||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),o?d!==void 0?e.addEventListener(n,i,{capture:!0,passive:d}):e.addEventListener(n,i,!0):d!==void 0?e.addEventListener(n,i,{passive:d}):e.addEventListener(n,i,!1)}function yo(e,n,i,o,d){var f=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var x=o.stateNode.containerInfo;if(x===d||x.nodeType===8&&x.parentNode===d)break;if(v===4)for(v=o.return;v!==null;){var k=v.tag;if((k===3||k===4)&&(k=v.stateNode.containerInfo,k===d||k.nodeType===8&&k.parentNode===d))return;v=v.return}for(;x!==null;){if(v=On(x),v===null)return;if(k=v.tag,k===5||k===6){o=f=v;continue e}x=x.parentNode}}o=o.return}Au(function(){var A=f,z=za(i),W=[];e:{var F=Sc.get(e);if(F!==void 0){var G=no,Q=e;switch(e){case"keypress":if(li(i)===0)break e;case"keydown":case"keyup":G=Gp;break;case"focusin":Q="focus",G=io;break;case"focusout":Q="blur",G=io;break;case"beforeblur":case"afterblur":G=io;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=ec;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=Up;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=Qp;break;case xc:case _c:case kc:G=Mp;break;case bc:G=Zp;break;case"scroll":G=Lp;break;case"wheel":G=tm;break;case"copy":case"cut":case"paste":G=Fp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=nc}var Z=(n&4)!==0,Ue=!Z&&e==="scroll",P=Z?F!==null?F+"Capture":null:F;Z=[];for(var S=A,R;S!==null;){R=S;var V=R.stateNode;if(R.tag===5&&V!==null&&(R=V,P!==null&&(V=qr(S,P),V!=null&&Z.push(ds(S,V,R)))),Ue)break;S=S.return}0<Z.length&&(F=new G(F,Q,null,i,z),W.push({event:F,listeners:Z}))}}if((n&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",G=e==="mouseout"||e==="pointerout",F&&i!==Fa&&(Q=i.relatedTarget||i.fromElement)&&(On(Q)||Q[Wt]))break e;if((G||F)&&(F=z.window===z?z:(F=z.ownerDocument)?F.defaultView||F.parentWindow:window,G?(Q=i.relatedTarget||i.toElement,G=A,Q=Q?On(Q):null,Q!==null&&(Ue=Rn(Q),Q!==Ue||Q.tag!==5&&Q.tag!==6)&&(Q=null)):(G=null,Q=A),G!==Q)){if(Z=ec,V="onMouseLeave",P="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(Z=nc,V="onPointerLeave",P="onPointerEnter",S="pointer"),Ue=G==null?F:ar(G),R=Q==null?F:ar(Q),F=new Z(V,S+"leave",G,i,z),F.target=Ue,F.relatedTarget=R,V=null,On(z)===A&&(Z=new Z(P,S+"enter",Q,i,z),Z.target=R,Z.relatedTarget=Ue,V=Z),Ue=V,G&&Q)t:{for(Z=G,P=Q,S=0,R=Z;R;R=sr(R))S++;for(R=0,V=P;V;V=sr(V))R++;for(;0<S-R;)Z=sr(Z),S--;for(;0<R-S;)P=sr(P),R--;for(;S--;){if(Z===P||P!==null&&Z===P.alternate)break t;Z=sr(Z),P=sr(P)}Z=null}else Z=null;G!==null&&Pc(W,F,G,Z,!1),Q!==null&&Ue!==null&&Pc(W,Ue,Q,Z,!0)}}e:{if(F=A?ar(A):window,G=F.nodeName&&F.nodeName.toLowerCase(),G==="select"||G==="input"&&F.type==="file")var ee=lm;else if(lc(F))if(cc)ee=hm;else{ee=cm;var re=um}else(G=F.nodeName)&&G.toLowerCase()==="input"&&(F.type==="checkbox"||F.type==="radio")&&(ee=dm);if(ee&&(ee=ee(e,A))){uc(W,ee,i,z);break e}re&&re(e,F,A),e==="focusout"&&(re=F._wrapperState)&&re.controlled&&F.type==="number"&&Ua(F,"number",F.value)}switch(re=A?ar(A):window,e){case"focusin":(lc(re)||re.contentEditable==="true")&&(nr=re,ho=A,ls=null);break;case"focusout":ls=ho=nr=null;break;case"mousedown":fo=!0;break;case"contextmenu":case"mouseup":case"dragend":fo=!1,yc(W,i,z);break;case"selectionchange":if(mm)break;case"keydown":case"keyup":yc(W,i,z)}var se;if(oo)e:{switch(e){case"compositionstart":var le="onCompositionStart";break e;case"compositionend":le="onCompositionEnd";break e;case"compositionupdate":le="onCompositionUpdate";break e}le=void 0}else tr?ac(e,i)&&(le="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(le="onCompositionStart");le&&(rc&&i.locale!=="ko"&&(tr||le!=="onCompositionStart"?le==="onCompositionEnd"&&tr&&(se=Xu()):(dn=z,to="value"in dn?dn.value:dn.textContent,tr=!0)),re=mi(A,le),0<re.length&&(le=new tc(le,e,null,i,z),W.push({event:le,listeners:re}),se?le.data=se:(se=oc(i),se!==null&&(le.data=se)))),(se=rm?sm(e,i):im(e,i))&&(A=mi(A,"onBeforeInput"),0<A.length&&(z=new tc("onBeforeInput","beforeinput",null,i,z),W.push({event:z,listeners:A}),z.data=se))}Cc(W,n)})}function ds(e,n,i){return{instance:e,listener:n,currentTarget:i}}function mi(e,n){for(var i=n+"Capture",o=[];e!==null;){var d=e,f=d.stateNode;d.tag===5&&f!==null&&(d=f,f=qr(e,i),f!=null&&o.unshift(ds(e,f,d)),f=qr(e,n),f!=null&&o.push(ds(e,f,d))),e=e.return}return o}function sr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Pc(e,n,i,o,d){for(var f=n._reactName,v=[];i!==null&&i!==o;){var x=i,k=x.alternate,A=x.stateNode;if(k!==null&&k===o)break;x.tag===5&&A!==null&&(x=A,d?(k=qr(i,f),k!=null&&v.unshift(ds(i,k,x))):d||(k=qr(i,f),k!=null&&v.push(ds(i,k,x)))),i=i.return}v.length!==0&&e.push({event:n,listeners:v})}var wm=/\r\n?/g,xm=/\u0000|\uFFFD/g;function Nc(e){return(typeof e=="string"?e:""+e).replace(wm,` 6`).replace(xm,"")}function gi(e,n,i){if(n=Nc(n),Nc(e)!==n&&i)throw Error(s(425))}function vi(){}var wo=null,xo=null;function _o(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var ko=typeof setTimeout=="function"?setTimeout:void 0,_m=typeof clearTimeout=="function"?clearTimeout:void 0,Rc=typeof Promise=="function"?Promise:void 0,km=typeof queueMicrotask=="function"?queueMicrotask:typeof Rc<"u"?function(e){return Rc.resolve(null).then(e).catch(bm)}:ko;function bm(e){setTimeout(function(){throw e})}function bo(e,n){var i=n,o=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(o===0){e.removeChild(d),ts(n);return}o--}else i!=="$"&&i!=="$?"&&i!=="$!"||o++;i=d}while(i);ts(n)}function fn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Oc(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return e;n--}else i==="/$"&&n++}e=e.previousSibling}return null}var ir=Math.random().toString(36).slice(2),$t="__reactFiber$"+ir,hs="__reactProps$"+ir,Wt="__reactContainer$"+ir,So="__reactEvents$"+ir,Sm="__reactListeners$"+ir,Em="__reactHandles$"+ir;function On(e){var n=e[$t];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Wt]||i[$t]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=Oc(e);e!==null;){if(i=e[$t])return i;e=Oc(e)}return n}e=i,i=e.parentNode}return null}function fs(e){return e=e[$t]||e[Wt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ar(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function yi(e){return e[hs]||null}var Eo=[],or=-1;function pn(e){return{current:e}}function Se(e){0>or||(e.current=Eo[or],Eo[or]=null,or--)}function _e(e,n){or++,Eo[or]=e.current,e.current=n}var mn={},Xe=pn(mn),it=pn(!1),An=mn;function lr(e,n){var i=e.type.contextTypes;if(!i)return mn;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===n)return o.__reactInternalMemoizedMaskedChildContext;var d={},f;for(f in i)d[f]=n[f];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=d),d}function at(e){return e=e.childContextTypes,e!=null}function wi(){Se(it),Se(Xe)}function Ac(e,n,i){if(Xe.current!==mn)throw Error(s(168));_e(Xe,n),_e(it,i)}function Lc(e,n,i){var o=e.stateNode;if(n=n.childContextTypes,typeof o.getChildContext!="function")return i;o=o.getChildContext();for(var d in o)if(!(d in n))throw Error(s(108,pe(e)||"Unknown",d));return L({},i,o)}function xi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mn,An=Xe.current,_e(Xe,e),_e(it,it.current),!0}function Ic(e,n,i){var o=e.stateNode;if(!o)throw Error(s(169));i?(e=Lc(e,n,An),o.__reactInternalMemoizedMergedChildContext=e,Se(it),Se(Xe),_e(Xe,e)):Se(it),_e(it,i)}var Vt=null,_i=!1,jo=!1;function Uc(e){Vt===null?Vt=[e]:Vt.push(e)}function jm(e){_i=!0,Uc(e)}function gn(){if(!jo&&Vt!==null){jo=!0;var e=0,n=xe;try{var i=Vt;
vendor: 8,888 bytes, line 6
6for(xe=1;e<i.length;e++){var o=i[e];do o=o(!0);while(o!==null)}Vt=null,_i=!1}catch(d){throw Vt!==null&&(Vt=Vt.slice(e+1)),Du(Ka,gn),d}finally{xe=n,jo=!1}}return null}var ur=[],cr=0,ki=null,bi=0,yt=[],wt=0,Ln=null,qt=1,Kt="";function In(e,n){ur[cr++]=bi,ur[cr++]=ki,ki=e,bi=n}function $c(e,n,i){yt[wt++]=qt,yt[wt++]=Kt,yt[wt++]=Ln,Ln=e;var o=qt;e=Kt;var d=32-Et(o)-1;o&=~(1<<d),i+=1;var f=32-Et(n)+d;if(30<f){var v=d-d%5;f=(o&(1<<v)-1).toString(32),o>>=v,d-=v,qt=1<<32-Et(n)+d|i<<d|o,Kt=f+e}else qt=1<<f|i<<d|o,Kt=e}function Co(e){e.return!==null&&(In(e,1),$c(e,1,0))}function To(e){for(;e===ki;)ki=ur[--cr],ur[cr]=null,bi=ur[--cr],ur[cr]=null;for(;e===Ln;)Ln=yt[--wt],yt[wt]=null,Kt=yt[--wt],yt[wt]=null,qt=yt[--wt],yt[wt]=null}var pt=null,mt=null,Ce=!1,Ct=null;function Dc(e,n){var i=bt(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=e,n=e.deletions,n===null?(e.deletions=[i],e.flags|=16):n.push(i)}function Mc(e,n){switch(e.tag){case 5:var i=e.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,pt=e,mt=fn(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,pt=e,mt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=Ln!==null?{id:qt,overflow:Kt}:null,e.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=bt(18,null,null,0),i.stateNode=n,i.return=e,e.child=i,pt=e,mt=null,!0):!1;default:return!1}}function Po(e){return(e.mode&1)!==0&&(e.flags&128)===0}function No(e){if(Ce){var n=mt;if(n){var i=n;if(!Mc(e,n)){if(Po(e))throw Error(s(418));n=fn(i.nextSibling);var o=pt;n&&Mc(e,n)?Dc(o,i):(e.flags=e.flags&-4097|2,Ce=!1,pt=e)}}else{if(Po(e))throw Error(s(418));e.flags=e.flags&-4097|2,Ce=!1,pt=e}}}function Bc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pt=e}function Si(e){if(e!==pt)return!1;if(!Ce)return Bc(e),Ce=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!_o(e.type,e.memoizedProps)),n&&(n=mt)){if(Po(e))throw Fc(),Error(s(418));for(;n;)Dc(e,n),n=fn(n.nextSibling)}if(Bc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(n===0){mt=fn(e.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}e=e.nextSibling}mt=null}}else mt=pt?fn(e.stateNode.nextSibling):null;return!0}function Fc(){for(var e=mt;e;)e=fn(e.nextSibling)}function dr(){mt=pt=null,Ce=!1}function Ro(e){Ct===null?Ct=[e]:Ct.push(e)}var Cm=q.ReactCurrentBatchConfig;function ps(e,n,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(s(309));var o=i.stateNode}if(!o)throw Error(s(147,e));var d=o,f=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===f?n.ref:(n=function(v){var x=d.refs;v===null?delete x[f]:x[f]=v},n._stringRef=f,n)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Ei(e,n){throw e=Object.prototype.toString.call(n),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function zc(e){var n=e._init;return n(e._payload)}function Hc(e){function n(P,S){if(e){var R=P.deletions;R===null?(P.deletions=[S],P.flags|=16):R.push(S)}}function i(P,S){if(!e)return null;for(;S!==null;)n(P,S),S=S.sibling;return null}function o(P,S){for(P=new Map;S!==null;)S.key!==null?P.set(S.key,S):P.set(S.index,S),S=S.sibling;return P}function d(P,S){return P=Sn(P,S),P.index=0,P.sibling=null,P}function f(P,S,R){return P.index=R,e?(R=P.alternate,R!==null?(R=R.index,R<S?(P.flags|=2,S):R):(P.flags|=2,S)):(P.flags|=1048576,S)}function v(P){return e&&P.alternate===null&&(P.flags|=2),P}function x(P,S,R,V){return S===null||S.tag!==6?(S=kl(R,P.mode,V),S.return=P,S):(S=d(S,R),S.return=P,S)}function k(P,S,R,V){var ee=R.type;return ee===oe?z(P,S,R.props.children,V,R.key):S!==null&&(S.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===B&&zc(ee)===S.type)?(V=d(S,R.props),V.ref=ps(P,S,R),V.return=P,V):(V=Ji(R.type,R.key,R.props,null,P.mode,V),V.ref=ps(P,S,R),V.return=P,V)}function A(P,S,R,V){return S===null||S.tag!==4||S.stateNode.containerInfo!==R.containerInfo||S.stateNode.implementation!==R.implementation?(S=bl(R,P.mode,V),S.return=P,S):(S=d(S,R.children||[]),S.return=P,S)}function z(P,S,R,V,ee){return S===null||S.tag!==7?(S=Hn(R,P.mode,V,ee),S.return=P,S):(S=d(S,R),S.return=P,S)}function W(P,S,R){if(typeof S=="string"&&S!==""||typeof S=="number")return S=kl(""+S,P.mode,R),S.return=P,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ue:return R=Ji(S.type,S.key,S.props,null,P.mode,R),R.ref=ps(P,null,S),R.return=P,R;case Y:return S=bl(S,P.mode,R),S.return=P,S;case B:var V=S._init;return W(P,V(S._payload),R)}if(Hr(S)||H(S))return S=Hn(S,P.mode,R,null),S.return=P,S;Ei(P,S)}return null}function F(P,S,R,V){var ee=S!==null?S.key:null;if(typeof R=="string"&&R!==""||typeof R=="number")return ee!==null?null:x(P,S,""+R,V);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case ue:return R.key===ee?k(P,S,R,V):null;case Y:return R.key===ee?A(P,S,R,V):null;case B:return ee=R._init,F(P,S,ee(R._payload),V)}if(Hr(R)||H(R))return ee!==null?null:z(P,S,R,V,null);Ei(P,R)}return null}function G(P,S,R,V,ee){if(typeof V=="string"&&V!==""||typeof V=="number")return P=P.get(R)||null,x(S,P,""+V,ee);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case ue:return P=P.get(V.key===null?R:V.key)||null,k(S,P,V,ee);case Y:return P=P.get(V.key===null?R:V.key)||null,A(S,P,V,ee);case B:var re=V._init;return G(P,S,R,re(V._payload),ee)}if(Hr(V)||H(V))return P=P.get(R)||null,z(S,P,V,ee,null);Ei(S,V)}return null}function Q(P,S,R,V){for(var ee=null,re=null,se=S,le=S=0,We=null;se!==null&&le<R.length;le++){se.index>le?(We=se,se=null):We=se.sibling;var ve=F(P,se,R[le],V);if(ve===null){se===null&&(se=We);break}e&&se&&ve.alternate===null&&n(P,se),S=f(ve,S,le),re===null?ee=ve:re.sibling=ve,re=ve,se=We}if(le===R.length)return i(P,se),Ce&&In(P,le),ee;if(se===null){for(;le<R.length;le++)se=W(P,R[le],V),se!==null&&(S=f(se,S,le),re===null?ee=se:re.sibling=se,re=se);return Ce&&In(P,le),ee}for(se=o(P,se);le<R.length;le++)We=G(se,P,le,R[le],V),We!==null&&(e&&We.alternate!==null&&se.delete(We.key===null?le:We.key),S=f(We,S,le),re===null?ee=We:re.sibling=We,re=We);return e&&se.forEach(function(En){return n(P,En)}),Ce&&In(P,le),ee}function Z(P,S,R,V){var ee=H(R);if(typeof ee!="function")throw Error(s(150));if(R=ee.call(R),R==null)throw Error(s(151));for(var re=ee=null,se=S,le=S=0,We=null,ve=R.next();se!==null&&!ve.done;le++,ve=R.next()){se.index>le?(We=se,se=null):We=se.sibling;var En=F(P,se,ve.value,V);if(En===null){se===null&&(se=We);break}e&&se&&En.alternate===null&&n(P,se),S=f(En,S,le),re===null?ee=En:re.sibling=En,re=En,se=We}if(ve.done)return i(P,se),Ce&&In(P,le),ee;if(se===null){for(;!ve.done;le++,ve=R.next())ve=W(P,ve.value,V),ve!==null&&(S=f(ve,S,le),re===null?ee=ve:re.sibling=ve,re=ve);return Ce&&In(P,le),ee}for(se=o(P,se);!ve.done;le++,ve=R.next())ve=G(se,P,le,ve.value,V),ve!==null&&(e&&ve.alternate!==null&&se.delete(ve.key===null?le:ve.key),S=f(ve,S,le),re===null?ee=ve:re.sibling=ve,re=ve);return e&&se.forEach(function(ag){return n(P,ag)}),Ce&&In(P,le),ee}function Ue(P,S,R,V){if(typeof R=="object"&&R!==null&&R.type===oe&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case ue:e:{for(var ee=R.key,re=S;re!==null;){if(re.key===ee){if(ee=R.type,ee===oe){if(re.tag===7){i(P,re.sibling),S=d(re,R.props.children),S.return=P,P=S;break e}}else if(re.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===B&&zc(ee)===re.type){i(P,re.sibling),S=d(re,R.props),S.ref=ps(P,re,R),S.return=P,P=S;break e}i(P,re);break}else n(P,re);re=re.sibling}R.type===oe?(S=Hn(R.props.children,P.mode,V,R.key),S.return=P,P=S):(V=Ji(R.type,R.key,R.props,null,P.mode,V),V.ref=ps(P,S,R),V.return=P,P=V)}return v(P);case Y:e:{for(re=R.key;S!==null;){if(S.key===re)if(S.tag===4&&S.stateNode.containerInfo===R.containerInfo&&S.stateNode.implementation===R.implementation){i(P,S.sibling),S=d(S,R.children||[]),S.return=P,P=S;break e}else{i(P,S);break}else n(P,S);S=S.sibling}S=bl(R,P.mode,V),S.return=P,P=S}return v(P);case B:return re=R._init,Ue(P,S,re(R._payload),V)}if(Hr(R))return Q(P,S,R,V);if(H(R))return Z(P,S,R,V);Ei(P,R)}return typeof R=="string"&&R!==""||typeof R=="number"?(R=""+R,S!==null&&S.tag===6?(i(P,S.sibling),S=d(S,R),S.return=P,P=S):(i(P,S),S=kl(R,P.mode,V),S.return=P,P=S),v(P)):i(P,S)}return Ue}var hr=Hc(!0),Wc=Hc(!1),ji=pn(null),Ci=null,fr=null,Oo=null;function Ao(){Oo=fr=Ci=null}function Lo(e){var n=ji.current;Se(ji),e._currentValue=n}function Io(e,n,i){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===i)break;e=e.return}}
vendor: 5,523 bytes, line 6
6function pr(e,n){Ci=e,Oo=fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(ot=!0),e.firstContext=null)}function xt(e){var n=e._currentValue;if(Oo!==e)if(e={context:e,memoizedValue:n,next:null},fr===null){if(Ci===null)throw Error(s(308));fr=e,Ci.dependencies={lanes:0,firstContext:e}}else fr=fr.next=e;return n}var Un=null;function Uo(e){Un===null?Un=[e]:Un.push(e)}function Vc(e,n,i,o){var d=n.interleaved;return d===null?(i.next=i,Uo(n)):(i.next=d.next,d.next=i),n.interleaved=i,Gt(e,o)}function Gt(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var vn=!1;function $o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qc(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jt(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function yn(e,n,i){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(me&2)!==0){var d=o.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),o.pending=n,Gt(e,i)}return d=o.interleaved,d===null?(n.next=n,Uo(o)):(n.next=d.next,d.next=n),o.interleaved=n,Gt(e,i)}function Ti(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var o=n.lanes;o&=e.pendingLanes,i|=o,n.lanes=i,Ya(e,i)}}function Kc(e,n){var i=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,i===o)){var d=null,f=null;if(i=i.firstBaseUpdate,i!==null){do{var v={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};f===null?d=f=v:f=f.next=v,i=i.next}while(i!==null);f===null?d=f=n:f=f.next=n}else d=f=n;i={baseState:o.baseState,firstBaseUpdate:d,lastBaseUpdate:f,shared:o.shared,effects:o.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function Pi(e,n,i,o){var d=e.updateQueue;vn=!1;var f=d.firstBaseUpdate,v=d.lastBaseUpdate,x=d.shared.pending;if(x!==null){d.shared.pending=null;var k=x,A=k.next;k.next=null,v===null?f=A:v.next=A,v=k;var z=e.alternate;z!==null&&(z=z.updateQueue,x=z.lastBaseUpdate,x!==v&&(x===null?z.firstBaseUpdate=A:x.next=A,z.lastBaseUpdate=k))}if(f!==null){var W=d.baseState;v=0,z=A=k=null,x=f;do{var F=x.lane,G=x.eventTime;if((o&F)===F){z!==null&&(z=z.next={eventTime:G,lane:0,tag:x.tag,payload:x.payload,callback:x.callback,next:null});e:{var Q=e,Z=x;switch(F=n,G=i,Z.tag){case 1:if(Q=Z.payload,typeof Q=="function"){W=Q.call(G,W,F);break e}W=Q;break e;case 3:Q.flags=Q.flags&-65537|128;case 0:if(Q=Z.payload,F=typeof Q=="function"?Q.call(G,W,F):Q,F==null)break e;W=L({},W,F);break e;case 2:vn=!0}}x.callback!==null&&x.lane!==0&&(e.flags|=64,F=d.effects,F===null?d.effects=[x]:F.push(x))}else G={eventTime:G,lane:F,tag:x.tag,payload:x.payload,callback:x.callback,next:null},z===null?(A=z=G,k=W):z=z.next=G,v|=F;if(x=x.next,x===null){if(x=d.shared.pending,x===null)break;F=x,x=F.next,F.next=null,d.lastBaseUpdate=F,d.shared.pending=null}}while(!0);if(z===null&&(k=W),d.baseState=k,d.firstBaseUpdate=A,d.lastBaseUpdate=z,n=d.shared.interleaved,n!==null){d=n;do v|=d.lane,d=d.next;while(d!==n)}else f===null&&(d.shared.lanes=0);Mn|=v,e.lanes=v,e.memoizedState=W}}function Gc(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var o=e[n],d=o.callback;if(d!==null){if(o.callback=null,o=i,typeof d!="function")throw Error(s(191,d));d.call(o)}}}var ms={},Dt=pn(ms),gs=pn(ms),vs=pn(ms);function $n(e){if(e===ms)throw Error(s(174));return e}function Do(e,n){switch(_e(vs,n),_e(gs,e),_e(Dt,ms),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Da(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Da(n,e)}Se(Dt),_e(Dt,n)}function mr(){Se(Dt),Se(gs),Se(vs)}function Jc(e){$n(vs.current);var n=$n(Dt.current),i=Da(n,e.type);n!==i&&(_e(gs,e),_e(Dt,i))}function Mo(e){gs.current===e&&(Se(Dt),Se(gs))}var Pe=pn(0);function Ni(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Bo=[];function Fo(){for(var e=0;e<Bo.length;e++)Bo[e]._workInProgressVersionPrimary=null;Bo.length=0}var Ri=q.ReactCurrentDispatcher,zo=q.ReactCurrentBatchConfig,Dn=0,Ne=null,Me=null,ze=null,Oi=!1,ys=!1,ws=0,Tm=0;function Ze(){throw Error(s(321))}function Ho(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!jt(e[i],n[i]))return!1;return!0}function Wo(e,n,i,o,d,f){if(Dn=f,Ne=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Ri.current=e===null||e.memoizedState===null?Om:Am,e=i(o,d),ys){f=0;do{if(ys=!1,ws=0,25<=f)throw Error(s(301));f+=1,ze=Me=null,n.updateQueue=null,Ri.current=Lm,e=i(o,d)}while(ys)}if(Ri.current=Ii,n=Me!==null&&Me.next!==null,Dn=0,ze=Me=Ne=null,Oi=!1,n)throw Error(s(300));return e}function Vo(){var e=ws!==0;return ws=0,e}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?Ne.memoizedState=ze=e:ze=ze.next=e,ze}
vendor: 4,100 bytes, line 6
6function _t(){if(Me===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var n=ze===null?Ne.memoizedState:ze.next;if(n!==null)ze=n,Me=e;else{if(e===null)throw Error(s(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},ze===null?Ne.memoizedState=ze=e:ze=ze.next=e}return ze}function xs(e,n){return typeof n=="function"?n(e):n}function qo(e){var n=_t(),i=n.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var o=Me,d=o.baseQueue,f=i.pending;if(f!==null){if(d!==null){var v=d.next;d.next=f.next,f.next=v}o.baseQueue=d=f,i.pending=null}if(d!==null){f=d.next,o=o.baseState;var x=v=null,k=null,A=f;do{var z=A.lane;if((Dn&z)===z)k!==null&&(k=k.next={lane:0,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),o=A.hasEagerState?A.eagerState:e(o,A.action);else{var W={lane:z,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null};k===null?(x=k=W,v=o):k=k.next=W,Ne.lanes|=z,Mn|=z}A=A.next}while(A!==null&&A!==f);k===null?v=o:k.next=x,jt(o,n.memoizedState)||(ot=!0),n.memoizedState=o,n.baseState=v,n.baseQueue=k,i.lastRenderedState=o}if(e=i.interleaved,e!==null){d=e;do f=d.lane,Ne.lanes|=f,Mn|=f,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function Ko(e){var n=_t(),i=n.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var o=i.dispatch,d=i.pending,f=n.memoizedState;if(d!==null){i.pending=null;var v=d=d.next;do f=e(f,v.action),v=v.next;while(v!==d);jt(f,n.memoizedState)||(ot=!0),n.memoizedState=f,n.baseQueue===null&&(n.baseState=f),i.lastRenderedState=f}return[f,o]}function Yc(){}function Qc(e,n){var i=Ne,o=_t(),d=n(),f=!jt(o.memoizedState,d);if(f&&(o.memoizedState=d,ot=!0),o=o.queue,Go(ed.bind(null,i,o,e),[e]),o.getSnapshot!==n||f||ze!==null&&ze.memoizedState.tag&1){if(i.flags|=2048,_s(9,Zc.bind(null,i,o,d,n),void 0,null),He===null)throw Error(s(349));(Dn&30)!==0||Xc(i,n,d)}return d}function Xc(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Ne.updateQueue,n===null?(n={lastEffect:null,stores:null},Ne.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function Zc(e,n,i,o){n.value=i,n.getSnapshot=o,td(n)&&nd(e)}function ed(e,n,i){return i(function(){td(n)&&nd(e)})}function td(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!jt(e,i)}catch{return!0}}function nd(e){var n=Gt(e,1);n!==null&&Rt(n,e,1,-1)}function rd(e){var n=Mt();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:e},n.queue=e,e=e.dispatch=Rm.bind(null,Ne,e),[n.memoizedState,e]}function _s(e,n,i,o){return e={tag:e,create:n,destroy:i,deps:o,next:null},n=Ne.updateQueue,n===null?(n={lastEffect:null,stores:null},Ne.updateQueue=n,n.lastEffect=e.next=e):(i=n.lastEffect,i===null?n.lastEffect=e.next=e:(o=i.next,i.next=e,e.next=o,n.lastEffect=e)),e}function sd(){return _t().memoizedState}function Ai(e,n,i,o){var d=Mt();Ne.flags|=e,d.memoizedState=_s(1|n,i,void 0,o===void 0?null:o)}function Li(e,n,i,o){var d=_t();o=o===void 0?null:o;var f=void 0;if(Me!==null){var v=Me.memoizedState;if(f=v.destroy,o!==null&&Ho(o,v.deps)){d.memoizedState=_s(n,i,f,o);return}}Ne.flags|=e,d.memoizedState=_s(1|n,i,f,o)}function id(e,n){return Ai(8390656,8,e,n)}function Go(e,n){return Li(2048,8,e,n)}function ad(e,n){return Li(4,2,e,n)}function od(e,n){return Li(4,4,e,n)}function ld(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function ud(e,n,i){return i=i!=null?i.concat([e]):null,Li(4,4,ld.bind(null,n,e),i)}function Jo(){}function cd(e,n){var i=_t();n=n===void 0?null:n;var o=i.memoizedState;return o!==null&&n!==null&&Ho(n,o[1])?o[0]:(i.memoizedState=[e,n],e)}function dd(e,n){var i=_t();n=n===void 0?null:n;var o=i.memoizedState;return o!==null&&n!==null&&Ho(n,o[1])?o[0]:(e=e(),i.memoizedState=[e,n],e)}function hd(e,n,i){return(Dn&21)===0?(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=i):(jt(i,n)||
vendor: 6,813 bytes, lines 6-8
6(i=zu(),Ne.lanes|=i,Mn|=i,e.baseState=!0),n)}function Pm(e,n){var i=xe;xe=i!==0&&4>i?i:4,e(!0);var o=zo.transition;zo.transition={};try{e(!1),n()}finally{xe=i,zo.transition=o}}function fd(){return _t().memoizedState}function Nm(e,n,i){var o=kn(e);if(i={lane:o,action:i,hasEagerState:!1,eagerState:null,next:null},pd(e))md(n,i);else if(i=Vc(e,n,i,o),i!==null){var d=rt();Rt(i,e,o,d),gd(i,n,o)}}function Rm(e,n,i){var o=kn(e),d={lane:o,action:i,hasEagerState:!1,eagerState:null,next:null};if(pd(e))md(n,d);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=n.lastRenderedReducer,f!==null))try{var v=n.lastRenderedState,x=f(v,i);if(d.hasEagerState=!0,d.eagerState=x,jt(x,v)){var k=n.interleaved;k===null?(d.next=d,Uo(n)):(d.next=k.next,k.next=d),n.interleaved=d;return}}catch{}i=Vc(e,n,d,o),i!==null&&(d=rt(),Rt(i,e,o,d),gd(i,n,o))}}function pd(e){var n=e.alternate;return e===Ne||n!==null&&n===Ne}function md(e,n){ys=Oi=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function gd(e,n,i){if((i&4194240)!==0){var o=n.lanes;o&=e.pendingLanes,i|=o,n.lanes=i,Ya(e,i)}}var Ii={readContext:xt,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},Om={readContext:xt,useCallback:function(e,n){return Mt().memoizedState=[e,n===void 0?null:n],e},useContext:xt,useEffect:id,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,Ai(4194308,4,ld.bind(null,n,e),i)},useLayoutEffect:function(e,n){return Ai(4194308,4,e,n)},useInsertionEffect:function(e,n){return Ai(4,2,e,n)},useMemo:function(e,n){var i=Mt();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var o=Mt();return n=i!==void 0?i(n):n,o.memoizedState=o.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},o.queue=e,e=e.dispatch=Nm.bind(null,Ne,e),[o.memoizedState,e]},useRef:function(e){var n=Mt();return e={current:e},n.memoizedState=e},useState:rd,useDebugValue:Jo,useDeferredValue:function(e){return Mt().memoizedState=e},useTransition:function(){var e=rd(!1),n=e[0];return e=Pm.bind(null,e[1]),Mt().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var o=Ne,d=Mt();if(Ce){if(i===void 0)throw Error(s(407));i=i()}else{if(i=n(),He===null)throw Error(s(349));(Dn&30)!==0||Xc(o,n,i)}d.memoizedState=i;var f={value:i,getSnapshot:n};return d.queue=f,id(ed.bind(null,o,f,e),[e]),o.flags|=2048,_s(9,Zc.bind(null,o,f,i,n),void 0,null),i},useId:function(){var e=Mt(),n=He.identifierPrefix;if(Ce){var i=Kt,o=qt;i=(o&~(1<<32-Et(o)-1)).toString(32)+i,n=":"+n+"R"+i,i=ws++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=Tm++,n=":"+n+"r"+i.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Am={readContext:xt,useCallback:cd,useContext:xt,useEffect:Go,useImperativeHandle:ud,useInsertionEffect:ad,useLayoutEffect:od,useMemo:dd,useReducer:qo,useRef:sd,useState:function(){return qo(xs)},useDebugValue:Jo,useDeferredValue:function(e){var n=_t();return hd(n,Me.memoizedState,e)},useTransition:function(){var e=qo(xs)[0],n=_t().memoizedState;return[e,n]},useMutableSource:Yc,useSyncExternalStore:Qc,useId:fd,unstable_isNewReconciler:!1},Lm={readContext:xt,useCallback:cd,useContext:xt,useEffect:Go,useImperativeHandle:ud,useInsertionEffect:ad,useLayoutEffect:od,useMemo:dd,useReducer:Ko,useRef:sd,useState:function(){return Ko(xs)},useDebugValue:Jo,useDeferredValue:function(e){var n=_t();return Me===null?n.memoizedState=e:hd(n,Me.memoizedState,e)},useTransition:function(){var e=Ko(xs)[0],n=_t().memoizedState;return[e,n]},useMutableSource:Yc,useSyncExternalStore:Qc,useId:fd,unstable_isNewReconciler:!1};function Tt(e,n){if(e&&e.defaultProps){n=L({},n),e=e.defaultProps;for(var i in e)n[i]===void 0&&(n[i]=e[i]);return n}return n}function Yo(e,n,i,o){n=e.memoizedState,i=i(o,n),i=i==null?n:L({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ui={isMounted:function(e){return(e=e._reactInternals)?Rn(e)===e:!1},enqueueSetState:function(e,n,i){e=e._reactInternals;var o=rt(),d=kn(e),f=Jt(o,d);f.payload=n,i!=null&&(f.callback=i),n=yn(e,f,d),n!==null&&(Rt(n,e,d,o),Ti(n,e,d))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var o=rt(),d=kn(e),f=Jt(o,d);f.tag=1,f.payload=n,i!=null&&(f.callback=i),n=yn(e,f,d),n!==null&&(Rt(n,e,d,o),Ti(n,e,d))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=rt(),o=kn(e),d=Jt(i,o);d.tag=2,n!=null&&(d.callback=n),n=yn(e,d,o),n!==null&&(Rt(n,e,o,i),Ti(n,e,o))}};function vd(e,n,i,o,d,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,f,v):n.prototype&&n.prototype.isPureReactComponent?!os(i,o)||!os(d,f):!0}function yd(e,n,i){var o=!1,d=mn,f=n.contextType;return typeof f=="object"&&f!==null?f=xt(f):(d=at(n)?An:Xe.current,o=n.contextTypes,f=(o=o!=null)?lr(e,d):mn),n=new n(i,f),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Ui,e.stateNode=n,n._reactInternals=e,o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=f),n}function wd(e,n,i,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,o),n.state!==e&&Ui.enqueueReplaceState(n,n.state,null)}function Qo(e,n,i,o){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},$o(e);var f=n.contextType;typeof f=="object"&&f!==null?d.context=xt(f):(f=at(n)?An:Xe.current,d.context=lr(e,f)),d.state=e.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(Yo(e,n,f,i),d.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(n=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),n!==d.state&&Ui.enqueueReplaceState(d,d.state,null),Pi(e,i,d,o),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function gr(e,n){try{var i="",o=n;do i+=de(o),o=o.return;while(o);var d=i}catch(f){d=` 7Error generating stack: `+f.message+` 8`+f.stack}return{value:e,source:n,stack:d,digest:null}}function Xo(e,n,i){return{value:e,source:null,stack:i??null,digest:n??null}}function Zo(e,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var Im=typeof WeakMap=="function"?WeakMap:Map;function xd(e,n,i){i=Jt(-1,i),i.tag=3,i.payload={element:null};var o=n.value;
vendor: 11,912 bytes, line 8
8return i.callback=function(){Hi||(Hi=!0,pl=o),Zo(e,n)},i}function _d(e,n,i){i=Jt(-1,i),i.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var d=n.value;i.payload=function(){return o(d)},i.callback=function(){Zo(e,n)}}var f=e.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(i.callback=function(){Zo(e,n),typeof o!="function"&&(xn===null?xn=new Set([this]):xn.add(this));var v=n.stack;this.componentDidCatch(n.value,{componentStack:v!==null?v:""})}),i}function kd(e,n,i){var o=e.pingCache;if(o===null){o=e.pingCache=new Im;var d=new Set;o.set(n,d)}else d=o.get(n),d===void 0&&(d=new Set,o.set(n,d));d.has(i)||(d.add(i),e=Jm.bind(null,e,n,i),n.then(e,e))}function bd(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Sd(e,n,i,o,d){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=Jt(-1,1),n.tag=2,yn(i,n,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Um=q.ReactCurrentOwner,ot=!1;function nt(e,n,i,o){n.child=e===null?Wc(n,null,i,o):hr(n,e.child,i,o)}function Ed(e,n,i,o,d){i=i.render;var f=n.ref;return pr(n,d),o=Wo(e,n,i,o,f,d),i=Vo(),e!==null&&!ot?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,Yt(e,n,d)):(Ce&&i&&Co(n),n.flags|=1,nt(e,n,o,d),n.child)}function jd(e,n,i,o,d){if(e===null){var f=i.type;return typeof f=="function"&&!_l(f)&&f.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=f,Cd(e,n,f,o,d)):(e=Ji(i.type,null,o,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(f=e.child,(e.lanes&d)===0){var v=f.memoizedProps;if(i=i.compare,i=i!==null?i:os,i(v,o)&&e.ref===n.ref)return Yt(e,n,d)}return n.flags|=1,e=Sn(f,o),e.ref=n.ref,e.return=n,n.child=e}function Cd(e,n,i,o,d){if(e!==null){var f=e.memoizedProps;if(os(f,o)&&e.ref===n.ref)if(ot=!1,n.pendingProps=o=f,(e.lanes&d)!==0)(e.flags&131072)!==0&&(ot=!0);else return n.lanes=e.lanes,Yt(e,n,d)}return el(e,n,i,o,d)}function Td(e,n,i){var o=n.pendingProps,d=o.children,f=e!==null?e.memoizedState:null;if(o.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(yr,gt),gt|=i;else{if((i&1073741824)===0)return e=f!==null?f.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,_e(yr,gt),gt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=f!==null?f.baseLanes:i,_e(yr,gt),gt|=o}else f!==null?(o=f.baseLanes|i,n.memoizedState=null):o=i,_e(yr,gt),gt|=o;return nt(e,n,d,i),n.child}function Pd(e,n){var i=n.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function el(e,n,i,o,d){var f=at(i)?An:Xe.current;return f=lr(n,f),pr(n,d),i=Wo(e,n,i,o,f,d),o=Vo(),e!==null&&!ot?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,Yt(e,n,d)):(Ce&&o&&Co(n),n.flags|=1,nt(e,n,i,d),n.child)}function Nd(e,n,i,o,d){if(at(i)){var f=!0;xi(n)}else f=!1;if(pr(n,d),n.stateNode===null)Di(e,n),yd(n,i,o),Qo(n,i,o,d),o=!0;else if(e===null){var v=n.stateNode,x=n.memoizedProps;v.props=x;var k=v.context,A=i.contextType;typeof A=="object"&&A!==null?A=xt(A):(A=at(i)?An:Xe.current,A=lr(n,A));var z=i.getDerivedStateFromProps,W=typeof z=="function"||typeof v.getSnapshotBeforeUpdate=="function";W||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(x!==o||k!==A)&&wd(n,v,o,A),vn=!1;var F=n.memoizedState;v.state=F,Pi(n,o,v,d),k=n.memoizedState,x!==o||F!==k||it.current||vn?(typeof z=="function"&&(Yo(n,i,z,o),k=n.memoizedState),(x=vn||vd(n,i,x,o,F,k,A))?(W||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(n.flags|=4194308)):(typeof v.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=k),v.props=o,v.state=k,v.context=A,o=x):(typeof v.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{v=n.stateNode,qc(e,n),x=n.memoizedProps,A=n.type===n.elementType?x:Tt(n.type,x),v.props=A,W=n.pendingProps,F=v.context,k=i.contextType,typeof k=="object"&&k!==null?k=xt(k):(k=at(i)?An:Xe.current,k=lr(n,k));var G=i.getDerivedStateFromProps;(z=typeof G=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(x!==W||F!==k)&&wd(n,v,o,k),vn=!1,F=n.memoizedState,v.state=F,Pi(n,o,v,d);var Q=n.memoizedState;x!==W||F!==Q||it.current||vn?(typeof G=="function"&&(Yo(n,i,G,o),Q=n.memoizedState),(A=vn||vd(n,i,A,o,F,Q,k)||!1)?(z||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(o,Q,k),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(o,Q,k)),typeof v.componentDidUpdate=="function"&&(n.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof v.componentDidUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Q),v.props=o,v.state=Q,v.context=k,o=A):(typeof v.componentDidUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),o=!1)}return tl(e,n,i,o,f,d)}function tl(e,n,i,o,d,f){Pd(e,n);var v=(n.flags&128)!==0;if(!o&&!v)return d&&Ic(n,i,!1),Yt(e,n,f);o=n.stateNode,Um.current=n;var x=v&&typeof i.getDerivedStateFromError!="function"?null:o.render();return n.flags|=1,e!==null&&v?(n.child=hr(n,e.child,null,f),n.child=hr(n,null,x,f)):nt(e,n,x,f),n.memoizedState=o.state,d&&Ic(n,i,!0),n.child}function Rd(e){var n=e.stateNode;n.pendingContext?Ac(e,n.pendingContext,n.pendingContext!==n.context):n.context&&Ac(e,n.context,!1),Do(e,n.containerInfo)}function Od(e,n,i,o,d){return dr(),Ro(d),n.flags|=256,nt(e,n,i,o),n.child}var nl={dehydrated:null,treeContext:null,retryLane:0};function rl(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ad(e,n,i){var o=n.pendingProps,d=Pe.current,f=!1,v=(n.flags&128)!==0,x;if((x=v)||(x=e!==null&&e.memoizedState===null?!1:(d&2)!==0),x?(f=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),_e(Pe,d&1),e===null)return No(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(v=o.children,e=o.fallback,f?(o=n.mode,f=n.child,v={mode:"hidden",children:v},(o&1)===0&&f!==null?(f.childLanes=0,f.pendingProps=v):f=Yi(v,o,0,null),e=Hn(e,o,i,null),f.return=n,e.return=n,f.sibling=e,n.child=f,n.child.memoizedState=rl(i),n.memoizedState=nl,e):sl(n,v));if(d=e.memoizedState,d!==null&&(x=d.dehydrated,x!==null))return $m(e,n,v,o,x,d,i);if(f){f=o.fallback,v=n.mode,d=e.child,x=d.sibling;var k={mode:"hidden",children:o.children};return(v&1)===0&&n.child!==d?(o=n.child,o.childLanes=0,o.pendingProps=k,n.deletions=null):(o=Sn(d,k),o.subtreeFlags=d.subtreeFlags&14680064),x!==null?f=Sn(x,f):(f=Hn(f,v,i,null),f.flags|=2),f.return=n,o.return=n,o.sibling=f,n.child=o,o=f,f=n.child,v=e.child.memoizedState,v=v===null?rl(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},f.memoizedState=v,f.childLanes=e.childLanes&~i,n.memoizedState=nl,o}return f=e.child,e=f.sibling,o=Sn(f,{mode:"visible",children:o.children}),(n.mode&1)===0&&(o.lanes=i),o.return=n,o.sibling=null,e!==null&&(i=n.deletions,i===null?(n.deletions=[e],n.flags|=16):i.push(e)),n.child=o,n.memoizedState=null,o}function sl(e,n){return n=Yi({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function $i(e,n,i,o){return o!==null&&Ro(o),hr(n,e.child,null,i),e=sl(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function $m(e,n,i,o,d,f,v){if(i)return n.flags&256?(n.flags&=-257,o=Xo(Error(s(422))),$i(e,n,v,o)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(f=o.fallback,d=n.mode,o=Yi({mode:"visible",children:o.children},d,0,null),f=Hn(f,d,v,null),f.flags|=2,o.return=n,f.return=n,o.sibling=f,n.child=o,(n.mode&1)!==0&&hr(n,e.child,null,v),n.child.memoizedState=rl(v),n.memoizedState=nl,f);if((n.mode&1)===0)return $i(e,n,v,null);if(d.data==="$!"){if(o=d.nextSibling&&d.nextSibling.dataset,o)var x=o.dgst;return o=x,f=Error(s(419)),o=Xo(f,o,void 0),$i(e,n,v,o)}if(x=(v&e.childLanes)!==0,ot||x){if(o=He,o!==null){switch(v&-v){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(o.suspendedLanes|v))!==0?0:d,d!==0&&d!==f.retryLane&&(f.retryLane=d,Gt(e,d),Rt(o,e,d,-1))}return xl(),o=Xo(Error(s(421))),$i(e,n,v,o)}return d.data==="$?"?(n.flags|=128,n.child=e.child,n=Ym.bind(null,e),d._reactRetry=n,null):(e=f.treeContext,mt=fn(d.nextSibling),pt=n,Ce=!0,Ct=null,e!==null&&(yt[wt++]=qt,yt[wt++]=Kt,yt[wt++]=Ln,qt=e.id,Kt=e.overflow,Ln=n),n=sl(n,o.children),n.flags|=4096,n)}function Ld(e,n,i){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),Io(e.return,n,i)}function il(e,n,i,o,d){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:i,tailMode:d}:(f.isBackwards=n,f.rendering=null,f.renderingStartTime=0,f.last=o,f.tail=i,f.tailMode=d)}function Id(e,n,i){var o=n.pendingProps,d=o.revealOrder,f=o.tail;if(nt(e,n,o.children,i),o=Pe.current,(o&2)!==0)o=o&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ld(e,i,n);else if(e.tag===19)Ld(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}if(_e(Pe,o),(n.mode&1)===0)n.memoizedState=null;else switch(d){case"forwards":for(i=n.child,d=null;i!==null;)e=i.alternate,e!==null&&Ni(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=n.child,n.child=null):(d=i.sibling,i.sibling=null),il(n,!1,d,i,f);break;case"backwards":for(i=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Ni(e)===null){n.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}il(n,!0,i,null,f);break;case"together":il(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Di(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Yt(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),Mn|=n.lanes,(i&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(s(153));if(n.child!==null){for(e=n.child,i=Sn(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=Sn(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function Dm(e,n,i){switch(n.tag){case 3:Rd(n),dr();break;case 5:Jc(n);break;case 1:at(n.type)&&xi(n);break;case 4:Do(n,n.stateNode.containerInfo);break;case 10:var o=n.type._context,d=n.memoizedProps.value;_e(ji,o._currentValue),o._currentValue=d;break;case 13:if(o=n.memoizedState,o!==null)return o.dehydrated!==null?(_e(Pe,Pe.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?Ad(e,n,i):(_e(Pe,Pe.current&1),e=Yt(e,n,i),e!==null?e.sibling:null);_e(Pe,Pe.current&1);break;case 19:if(o=(i&n.childLanes)!==0,(e.flags&128)!==0){if(o)return Id(e,n,i);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),_e(Pe,Pe.current),o)break;return null;case 22:case 23:return n.lanes=0,Td(e,n,i)}return Yt(e,n,i)}var Ud,al,$d,Dd;
vendor: 4,506 bytes, line 8
8Ud=function(e,n){for(var i=n.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},al=function(){},$d=function(e,n,i,o){var d=e.memoizedProps;if(d!==o){e=n.stateNode,$n(Dt.current);var f=null;switch(i){case"input":d=La(e,d),o=La(e,o),f=[];break;case"select":d=L({},d,{value:void 0}),o=L({},o,{value:void 0}),f=[];break;case"textarea":d=$a(e,d),o=$a(e,o),f=[];break;default:typeof d.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=vi)}Ma(i,o);var v;i=null;for(A in d)if(!o.hasOwnProperty(A)&&d.hasOwnProperty(A)&&d[A]!=null)if(A==="style"){var x=d[A];for(v in x)x.hasOwnProperty(v)&&(i||(i={}),i[v]="")}else A!=="dangerouslySetInnerHTML"&&A!=="children"&&A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(l.hasOwnProperty(A)?f||(f=[]):(f=f||[]).push(A,null));for(A in o){var k=o[A];if(x=d?.[A],o.hasOwnProperty(A)&&k!==x&&(k!=null||x!=null))if(A==="style")if(x){for(v in x)!x.hasOwnProperty(v)||k&&k.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in k)k.hasOwnProperty(v)&&x[v]!==k[v]&&(i||(i={}),i[v]=k[v])}else i||(f||(f=[]),f.push(A,i)),i=k;else A==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,x=x?x.__html:void 0,k!=null&&x!==k&&(f=f||[]).push(A,k)):A==="children"?typeof k!="string"&&typeof k!="number"||(f=f||[]).push(A,""+k):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&(l.hasOwnProperty(A)?(k!=null&&A==="onScroll"&&be("scroll",e),f||x===k||(f=[])):(f=f||[]).push(A,k))}i&&(f=f||[]).push("style",i);var A=f;(n.updateQueue=A)&&(n.flags|=4)}},Dd=function(e,n,i,o){i!==o&&(n.flags|=4)};function ks(e,n){if(!Ce)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function et(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,o=0;if(n)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,o|=d.subtreeFlags&14680064,o|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,o|=d.subtreeFlags,o|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=o,e.childLanes=i,n}function Mm(e,n,i){var o=n.pendingProps;switch(To(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(n),null;case 1:return at(n.type)&&wi(),et(n),null;case 3:return o=n.stateNode,mr(),Se(it),Se(Xe),Fo(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(Si(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Ct!==null&&(vl(Ct),Ct=null))),al(e,n),et(n),null;case 5:Mo(n);var d=$n(vs.current);if(i=n.type,e!==null&&n.stateNode!=null)$d(e,n,i,o,d),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!o){if(n.stateNode===null)throw Error(s(166));return et(n),null}if(e=$n(Dt.current),Si(n)){o=n.stateNode,i=n.type;var f=n.memoizedProps;switch(o[$t]=n,o[hs]=f,e=(n.mode&1)!==0,i){case"dialog":be("cancel",o),be("close",o);break;case"iframe":case"object":case"embed":be("load",o);break;case"video":case"audio":for(d=0;d<us.length;d++)be(us[d],o);break;case"source":be("error",o);break;case"img":case"image":case"link":be("error",o),be("load",o);break;case"details":be("toggle",o);break;case"input":yu(o,f),be("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!f.multiple},be("invalid",o);break;case"textarea":_u(o,f),be("invalid",o)}Ma(i,f),d=null;for(var v in f)if(f.hasOwnProperty(v)){var x=f[v];v==="children"?typeof x=="string"?o.textContent!==x&&(f.suppressHydrationWarning!==!0&&gi(o.textContent,x,e),d=["children",x]):typeof x=="number"&&o.textContent!==""+x&&(f.suppressHydrationWarning!==!0&&gi(o.textContent,x,e),d=["children",""+x]):l.hasOwnProperty(v)&&x!=null&&v==="onScroll"&&be("scroll",o)}switch(i){case"input":Ks(o),xu(o,f,!0);break;case"textarea":Ks(o),bu(o);break;case"select":case"option":break;default:typeof f.onClick=="function"&&(o.onclick=vi)}o=d,n.updateQueue=o,o!==null&&(n.flags|=4)}else{v=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Su(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>
8",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=v.createElement(i,{is:o.is}):(e=v.createElement(i),i==="select"&&(v=e,o.multiple?v.multiple=!0:o.size&&(v.size=o.size))):e=v.createElementNS(e,i),e[$t]=n,e[hs]=o,Ud(e,n,!1,!1),n.stateNode=e;e:{switch(v=Ba(i,o),i){case"dialog":be("cancel",e),be("close",e),d=o;break;case"iframe":case"object":case"embed":be("load",e),d=o;break;case"video":case"audio":for(d=0;d<us.length;d++)be(us[d],e);d=o;break;case"source":be("error",e),d=o;break;case"img":case"image":case"link":be("error",e),be("load",e),d=o;break;case"details":be("toggle",e),d=o;break;case"input":yu(e,o),d=La(e,o),be("invalid",e);break;case"option":d=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},d=L({},o,{value:void 0}),be("invalid",e);break;case"textarea":_u(e,o),d=$a(e,o),be("invalid",e);break;default:d=o}Ma(i,d),x=d;for(f in x)if(x.hasOwnProperty(f)){var k=x[f];f==="style"?Cu(e,k):f==="dangerouslySetInnerHTML"?(k=k?k.__html:void 0,k!=null&&Eu(e,k)):f==="children"?typeof k=="string"?(i!=="textarea"||k!=="")&&Wr(e,k):typeof k=="number"&&Wr(e,""+k):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(l.hasOwnProperty(f)?k!=null&&f==="onScroll"&&be("scroll",e):k!=null&&U(e,f,k,v))}switch(i){case"input":Ks(e),xu(e,o,!1);break;case"textarea":Ks(e),bu(e);break;case"option":o.value!=null&&e.setAttribute("value",""+we(o.value));break;case"select":e.multiple=!!o.multiple,f=o.value,f!=null?Yn(e,!!o.multiple,f,!1):o.defaultValue!=null&&Yn(e,!!o.multiple,o.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=vi)}switch(i){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return et(n),null;case 6:if(e&&n.stateNode!=null)Dd(e,n,e.memoizedProps,o);else{if(typeof o!="string"&&n.stateNode===null)throw Error(s(166));if(i=$n(vs.current),$n(Dt.current),Si(n)){if(o=n.stateNode,i=n.memoizedProps,o[$t]=n,(f=o.nodeValue!==i)&&(e=pt,e!==null))switch(e.tag){case 3:gi(o.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gi(o.nodeValue,i,(e.mode&1)!==0)}f&&(n.flags|=4)}else o=(i.nodeType===9?i:i.ownerDocument).createTextNode(o),o[$t]=n,n.stateNode=o}return et(n),null;case 13:if(Se(Pe),o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ce&&mt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Fc(),dr(),n.flags|=98560,f=!1;else if(f=Si(n),o!==null&&o.dehydrated!==null){if(e===null){if(!f)throw Error(s(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[$t]=n}else dr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;et(n),f=!1}else Ct!==null&&(vl(Ct),Ct=null),f=!0;if(!f)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(o=o!==null,o!==(e!==null&&e.memoizedState!==null)&&o&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Pe.current&1)!==0?Be===0&&(Be=3):xl())),n.updateQueue!==null&&(n.flags|=4),et(n),null);case 4:return mr(),al(e,n),e===null&&cs(n.stateNode.containerInfo),et(n),null;case 10:return Lo(n.type._context),et(n),null;case 17:return at(n.type)&&wi(),et(n),null;case 19:if(Se(Pe),f=n.memoizedState,f===null)return et(n),null;if(o=(n.flags&128)!==0,v=f.rendering,v===null)if(o)ks(f,!1);else{if(Be!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(v=Ni(e),v!==null){for(n.flags|=128,ks(f,!1),o=v.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),n.subtreeFlags=0,o=i,i=n.child;i!==null;)f=i,e=o,f.flags&=14680066,v=f.alternate,v===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=v.childLanes,f.lanes=v.lanes,f.child=v.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=v.memoizedProps,f.memoizedState=v.memoizedState,f.updateQueue=v.updateQueue,f.type=v.type,e=v.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return _e(Pe,Pe.current&1|2),n.child}e=e.sibling}f.tail!==null&&Ie()>wr&&(n.flags|=128,o=!0,ks(f,!1),n.lanes=4194304)}else{if(!o)if(e=Ni(v),e!==null){if(n.flags|=128,o=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),ks(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!Ce)return et(n),null}else 2*Ie()-f.renderingStartTime>wr&&i!==1073741824&&(n.flags|=128,o=!0,ks(f,!1),n.lanes=4194304);f.isBackwards?(v.sibling=n.child,n.child=v):(i=f.last,i!==null?i.sibling=v:n.child=v,f.last=v)}return f.tail!==null?(n=f.tail,f.rendering=n,f.tail=n.sibling,f.renderingStartTime=Ie(),n.sibling=null,i=Pe.current,_e(Pe,o?i&1|2:i&1),n):(et(n),null);case 22:case 23:return wl(),o=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(n.flags|=8192),o&&(n.mode&1)!==0?(gt&1073741824)!==0&&(et(n),n.subtreeFlags&6&&(n.flags|=8192)):et(n),null;case 24:return null;case 25:return null}throw Error(s(156,n.tag))}function Bm(e,n){switch(To(n),n.tag){case 1:return at(n.type)&&wi(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return mr(),Se(it),Se(Xe),Fo(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Mo(n),null;case 13:if(Se(Pe),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(s(340));dr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Se(Pe),null;case 4:return mr(),null;case 10:return Lo(n.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}
vendor: 4,210 bytes, line 8
8var Mi=!1,tt=!1,Fm=typeof WeakSet=="function"?WeakSet:Set,J=null;function vr(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(o){Oe(e,n,o)}else i.current=null}function ol(e,n,i){try{i()}catch(o){Oe(e,n,o)}}var Md=!1;function zm(e,n){if(wo=ii,e=vc(),co(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var o=i.getSelection&&i.getSelection();if(o&&o.rangeCount!==0){i=o.anchorNode;var d=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{i.nodeType,f.nodeType}catch{i=null;break e}var v=0,x=-1,k=-1,A=0,z=0,W=e,F=null;t:for(;;){for(var G;W!==i||d!==0&&W.nodeType!==3||(x=v+d),W!==f||o!==0&&W.nodeType!==3||(k=v+o),W.nodeType===3&&(v+=W.nodeValue.length),(G=W.firstChild)!==null;)F=W,W=G;for(;;){if(W===e)break t;if(F===i&&++A===d&&(x=v),F===f&&++z===o&&(k=v),(G=W.nextSibling)!==null)break;W=F,F=W.parentNode}W=G}i=x===-1||k===-1?null:{start:x,end:k}}else i=null}i=i||{start:0,end:0}}else i=null;for(xo={focusedElem:e,selectionRange:i},ii=!1,J=n;J!==null;)if(n=J,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,J=e;else for(;J!==null;){n=J;try{var Q=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Q!==null){var Z=Q.memoizedProps,Ue=Q.memoizedState,P=n.stateNode,S=P.getSnapshotBeforeUpdate(n.elementType===n.type?Z:Tt(n.type,Z),Ue);P.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var R=n.stateNode.containerInfo;R.nodeType===1?R.textContent="":R.nodeType===9&&R.documentElement&&R.removeChild(R.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(V){Oe(n,n.return,V)}if(e=n.sibling,e!==null){e.return=n.return,J=e;break}J=n.return}return Q=Md,Md=!1,Q}function bs(e,n,i){var o=n.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var d=o=o.next;do{if((d.tag&e)===e){var f=d.destroy;d.destroy=void 0,f!==void 0&&ol(n,i,f)}d=d.next}while(d!==o)}}function Bi(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var o=i.create;i.destroy=o()}i=i.next}while(i!==n)}}function ll(e){var n=e.ref;if(n!==null){var i=e.stateNode;e.tag,e=i,typeof n=="function"?n(e):n.current=e}}function Bd(e){var n=e.alternate;n!==null&&(e.alternate=null,Bd(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[$t],delete n[hs],delete n[So],delete n[Sm],delete n[Em])),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 Fd(e){return e.tag===5||e.tag===3||e.tag===4}function zd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fd(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 ul(e,n,i){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=vi));else if(o!==4&&(e=e.child,e!==null))for(ul(e,n,i),e=e.sibling;e!==null;)ul(e,n,i),e=e.sibling}function cl(e,n,i){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(cl(e,n,i),e=e.sibling;e!==null;)cl(e,n,i),e=e.sibling}var qe=null,Pt=!1;function wn(e,n,i){for(i=i.child;i!==null;)Hd(e,n,i),i=i.sibling}function Hd(e,n,i){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(Zs,i)}catch{}switch(i.tag){case 5:tt||vr(i,n);case 6:var o=qe,d=Pt;qe=null,wn(e,n,i),qe=o,Pt=d,qe!==null&&(Pt?(e=qe,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):qe.removeChild(i.stateNode));break;case 18:qe!==null&&(Pt?(e=qe,i=i.stateNode,e.nodeType===8?bo(e.parentNode,i):e.nodeType===1&&bo(e,i),ts(e)):bo(qe,i.stateNode));break;case 4:o=qe,d=Pt,qe=i.stateNode.containerInfo,Pt=!0,wn(e,n,i),qe=o,Pt=d;break;case 0:case 11:case 14:case 15:if(!tt&&(o=i.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){d=o=o.next;
vendor: 16,995 bytes, line 8
8do{var f=d,v=f.destroy;f=f.tag,v!==void 0&&((f&2)!==0||(f&4)!==0)&&ol(i,n,v),d=d.next}while(d!==o)}wn(e,n,i);break;case 1:if(!tt&&(vr(i,n),o=i.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=i.memoizedProps,o.state=i.memoizedState,o.componentWillUnmount()}catch(x){Oe(i,n,x)}wn(e,n,i);break;case 21:wn(e,n,i);break;case 22:i.mode&1?(tt=(o=tt)||i.memoizedState!==null,wn(e,n,i),tt=o):wn(e,n,i);break;default:wn(e,n,i)}}function Wd(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Fm),n.forEach(function(o){var d=Qm.bind(null,e,o);i.has(o)||(i.add(o),o.then(d,d))})}}function Nt(e,n){var i=n.deletions;if(i!==null)for(var o=0;o<i.length;o++){var d=i[o];try{var f=e,v=n,x=v;e:for(;x!==null;){switch(x.tag){case 5:qe=x.stateNode,Pt=!1;break e;case 3:qe=x.stateNode.containerInfo,Pt=!0;break e;case 4:qe=x.stateNode.containerInfo,Pt=!0;break e}x=x.return}if(qe===null)throw Error(s(160));Hd(f,v,d),qe=null,Pt=!1;var k=d.alternate;k!==null&&(k.return=null),d.return=null}catch(A){Oe(d,n,A)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Vd(n,e),n=n.sibling}function Vd(e,n){var i=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nt(n,e),Bt(e),o&4){try{bs(3,e,e.return),Bi(3,e)}catch(Z){Oe(e,e.return,Z)}try{bs(5,e,e.return)}catch(Z){Oe(e,e.return,Z)}}break;case 1:Nt(n,e),Bt(e),o&512&&i!==null&&vr(i,i.return);break;case 5:if(Nt(n,e),Bt(e),o&512&&i!==null&&vr(i,i.return),e.flags&32){var d=e.stateNode;try{Wr(d,"")}catch(Z){Oe(e,e.return,Z)}}if(o&4&&(d=e.stateNode,d!=null)){var f=e.memoizedProps,v=i!==null?i.memoizedProps:f,x=e.type,k=e.updateQueue;if(e.updateQueue=null,k!==null)try{x==="input"&&f.type==="radio"&&f.name!=null&&wu(d,f),Ba(x,v);var A=Ba(x,f);for(v=0;v<k.length;v+=2){var z=k[v],W=k[v+1];z==="style"?Cu(d,W):z==="dangerouslySetInnerHTML"?Eu(d,W):z==="children"?Wr(d,W):U(d,z,W,A)}switch(x){case"input":Ia(d,f);break;case"textarea":ku(d,f);break;case"select":var F=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!f.multiple;var G=f.value;G!=null?Yn(d,!!f.multiple,G,!1):F!==!!f.multiple&&(f.defaultValue!=null?Yn(d,!!f.multiple,f.defaultValue,!0):Yn(d,!!f.multiple,f.multiple?[]:"",!1))}d[hs]=f}catch(Z){Oe(e,e.return,Z)}}break;case 6:if(Nt(n,e),Bt(e),o&4){if(e.stateNode===null)throw Error(s(162));d=e.stateNode,f=e.memoizedProps;try{d.nodeValue=f}catch(Z){Oe(e,e.return,Z)}}break;case 3:if(Nt(n,e),Bt(e),o&4&&i!==null&&i.memoizedState.isDehydrated)try{ts(n.containerInfo)}catch(Z){Oe(e,e.return,Z)}break;case 4:Nt(n,e),Bt(e);break;case 13:Nt(n,e),Bt(e),d=e.child,d.flags&8192&&(f=d.memoizedState!==null,d.stateNode.isHidden=f,!f||d.alternate!==null&&d.alternate.memoizedState!==null||(fl=Ie())),o&4&&Wd(e);break;case 22:if(z=i!==null&&i.memoizedState!==null,e.mode&1?(tt=(A=tt)||z,Nt(n,e),tt=A):Nt(n,e),Bt(e),o&8192){if(A=e.memoizedState!==null,(e.stateNode.isHidden=A)&&!z&&(e.mode&1)!==0)for(J=e,z=e.child;z!==null;){for(W=J=z;J!==null;){switch(F=J,G=F.child,F.tag){case 0:case 11:case 14:case 15:bs(4,F,F.return);break;case 1:vr(F,F.return);var Q=F.stateNode;if(typeof Q.componentWillUnmount=="function"){o=F,i=F.return;try{n=o,Q.props=n.memoizedProps,Q.state=n.memoizedState,Q.componentWillUnmount()}catch(Z){Oe(o,i,Z)}}break;case 5:vr(F,F.return);break;case 22:if(F.memoizedState!==null){Gd(W);continue}}G!==null?(G.return=F,J=G):Gd(W)}z=z.sibling}e:for(z=null,W=e;;){if(W.tag===5){if(z===null){z=W;try{d=W.stateNode,A?(f=d.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"):(x=W.stateNode,k=W.memoizedProps.style,v=k!=null&&k.hasOwnProperty("display")?k.display:null,x.style.display=ju("display",v))}catch(Z){Oe(e,e.return,Z)}}}else if(W.tag===6){if(z===null)try{W.stateNode.nodeValue=A?"":W.memoizedProps}catch(Z){Oe(e,e.return,Z)}}else if((W.tag!==22&&W.tag!==23||W.memoizedState===null||W===e)&&W.child!==null){W.child.return=W,W=W.child;continue}if(W===e)break e;for(;W.sibling===null;){if(W.return===null||W.return===e)break e;z===W&&(z=null),W=W.return}z===W&&(z=null),W.sibling.return=W.return,W=W.sibling}}break;case 19:Nt(n,e),Bt(e),o&4&&Wd(e);break;case 21:break;default:Nt(n,e),Bt(e)}}function Bt(e){var n=e.flags;if(n&2){try{e:{for(var i=e.return;i!==null;){if(Fd(i)){var o=i;break e}i=i.return}throw Error(s(160))}switch(o.tag){case 5:var d=o.stateNode;o.flags&32&&(Wr(d,""),o.flags&=-33);var f=zd(e);cl(e,f,d);break;case 3:case 4:var v=o.stateNode.containerInfo,x=zd(e);ul(e,x,v);break;default:throw Error(s(161))}}catch(k){Oe(e,e.return,k)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Hm(e,n,i){J=e,qd(e)}function qd(e,n,i){for(var o=(e.mode&1)!==0;J!==null;){var d=J,f=d.child;if(d.tag===22&&o){var v=d.memoizedState!==null||Mi;if(!v){var x=d.alternate,k=x!==null&&x.memoizedState!==null||tt;x=Mi;var A=tt;if(Mi=v,(tt=k)&&!A)for(J=d;J!==null;)v=J,k=v.child,v.tag===22&&v.memoizedState!==null?Jd(d):k!==null?(k.return=v,J=k):Jd(d);for(;f!==null;)J=f,qd(f),f=f.sibling;J=d,Mi=x,tt=A}Kd(e)}else(d.subtreeFlags&8772)!==0&&f!==null?(f.return=d,J=f):Kd(e)}}function Kd(e){for(;J!==null;){var n=J;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:tt||Bi(5,n);break;case 1:var o=n.stateNode;if(n.flags&4&&!tt)if(i===null)o.componentDidMount();else{var d=n.elementType===n.type?i.memoizedProps:Tt(n.type,i.memoizedProps);o.componentDidUpdate(d,i.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var f=n.updateQueue;f!==null&&Gc(n,f,o);break;case 3:var v=n.updateQueue;if(v!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}Gc(n,v,i)}break;case 5:var x=n.stateNode;if(i===null&&n.flags&4){i=x;var k=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":k.autoFocus&&i.focus();break;case"img":k.src&&(i.src=k.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var A=n.alternate;if(A!==null){var z=A.memoizedState;if(z!==null){var W=z.dehydrated;W!==null&&ts(W)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}tt||n.flags&512&&ll(n)}catch(F){Oe(n,n.return,F)}}if(n===e){J=null;break}if(i=n.sibling,i!==null){i.return=n.return,J=i;break}J=n.return}}function Gd(e){for(;J!==null;){var n=J;if(n===e){J=null;break}var i=n.sibling;if(i!==null){i.return=n.return,J=i;break}J=n.return}}function Jd(e){for(;J!==null;){var n=J;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{Bi(4,n)}catch(k){Oe(n,i,k)}break;case 1:var o=n.stateNode;if(typeof o.componentDidMount=="function"){var d=n.return;try{o.componentDidMount()}catch(k){Oe(n,d,k)}}var f=n.return;try{ll(n)}catch(k){Oe(n,f,k)}break;case 5:var v=n.return;try{ll(n)}catch(k){Oe(n,v,k)}}}catch(k){Oe(n,n.return,k)}if(n===e){J=null;break}var x=n.sibling;if(x!==null){x.return=n.return,J=x;break}J=n.return}}var Wm=Math.ceil,Fi=q.ReactCurrentDispatcher,dl=q.ReactCurrentOwner,kt=q.ReactCurrentBatchConfig,me=0,He=null,$e=null,Ke=0,gt=0,yr=pn(0),Be=0,Ss=null,Mn=0,zi=0,hl=0,Es=null,lt=null,fl=0,wr=1/0,Qt=null,Hi=!1,pl=null,xn=null,Wi=!1,_n=null,Vi=0,js=0,ml=null,qi=-1,Ki=0;function rt(){return(me&6)!==0?Ie():qi!==-1?qi:qi=Ie()}function kn(e){return(e.mode&1)===0?1:(me&2)!==0&&Ke!==0?Ke&-Ke:Cm.transition!==null?(Ki===0&&(Ki=zu()),Ki):(e=xe,e!==0||(e=window.event,e=e===void 0?16:Qu(e.type)),e)}function Rt(e,n,i,o){if(50<js)throw js=0,ml=null,Error(s(185));Yr(e,i,o),((me&2)===0||e!==He)&&(e===He&&((me&2)===0&&(zi|=i),Be===4&&bn(e,Ke)),ut(e,o),i===1&&me===0&&(n.mode&1)===0&&(wr=Ie()+500,_i&&gn()))}function ut(e,n){var i=e.callbackNode;Cp(e,n);var o=ni(e,e===He?Ke:0);if(o===0)i!==null&&Mu(i),e.callbackNode=null,e.callbackPriority=0;else if(n=o&-o,e.callbackPriority!==n){if(i!=null&&Mu(i),n===1)e.tag===0?jm(Qd.bind(null,e)):Uc(Qd.bind(null,e)),km(function(){(me&6)===0&&gn()}),i=null;else{switch(Hu(o)){case 1:i=Ka;break;case 4:i=Bu;break;case 16:i=Xs;break;case 536870912:i=Fu;break;default:i=Xs}i=ih(i,Yd.bind(null,e))}e.callbackPriority=n,e.callbackNode=i}}function Yd(e,n){if(qi=-1,Ki=0,(me&6)!==0)throw Error(s(327));var i=e.callbackNode;if(xr()&&e.callbackNode!==i)return null;var o=ni(e,e===He?Ke:0);if(o===0)return null;if((o&30)!==0||(o&e.expiredLanes)!==0||n)n=Gi(e,o);else{n=o;var d=me;me|=2;var f=Zd();(He!==e||Ke!==n)&&(Qt=null,wr=Ie()+500,Fn(e,n));do try{Km();break}catch(x){Xd(e,x)}while(!0);Ao(),Fi.current=f,me=d,$e!==null?n=0:(He=null,Ke=0,n=Be)}if(n!==0){if(n===2&&(d=Ga(e),d!==0&&(o=d,n=gl(e,d))),n===1)throw i=Ss,Fn(e,0),bn(e,o),ut(e,Ie()),i;if(n===6)bn(e,o);else{if(d=e.current.alternate,(o&30)===0&&!Vm(d)&&(n=Gi(e,o),n===2&&(f=Ga(e),f!==0&&(o=f,n=gl(e,f))),n===1))throw i=Ss,Fn(e,0),bn(e,o),ut(e,Ie()),i;switch(e.finishedWork=d,e.finishedLanes=o,n){case 0:case 1:throw Error(s(345));case 2:zn(e,lt,Qt);break;case 3:if(bn(e,o),(o&130023424)===o&&(n=fl+500-Ie(),10<n)){if(ni(e,0)!==0)break;if(d=e.suspendedLanes,(d&o)!==o){rt(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=ko(zn.bind(null,e,lt,Qt),n);break}zn(e,lt,Qt);break;case 4:if(bn(e,o),(o&4194240)===o)break;for(n=e.eventTimes,d=-1;0<o;){var v=31-Et(o);f=1<<v,v=n[v],v>d&&(d=v),o&=~f}if(o=d,o=Ie()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Wm(o/1960))-o,10<o){e.timeoutHandle=ko(zn.bind(null,e,lt,Qt),o);break}zn(e,lt,Qt);break;case 5:zn(e,lt,Qt);break;default:throw Error(s(329))}}}return ut(e,Ie()),e.callbackNode===i?Yd.bind(null,e):null}function gl(e,n){var i=Es;return e.current.memoizedState.isDehydrated&&(Fn(e,n).flags|=256),e=Gi(e,n),e!==2&&(n=lt,lt=i,n!==null&&vl(n)),e}function vl(e){lt===null?lt=e:lt.push.apply(lt,e)}function Vm(e){for(var n=e;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var o=0;o<i.length;o++){var d=i[o],f=d.getSnapshot;d=d.value;try{if(!jt(f(),d))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function bn(e,n){for(n&=~hl,n&=~zi,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var i=31-Et(n),o=1<<i;e[i]=-1,n&=~o}}function Qd(e){if((me&6)!==0)throw Error(s(327));xr();var n=ni(e,0);if((n&1)===0)return ut(e,Ie()),null;var i=Gi(e,n);if(e.tag!==0&&i===2){var o=Ga(e);o!==0&&(n=o,i=gl(e,o))}if(i===1)throw i=Ss,Fn(e,0),bn(e,n),ut(e,Ie()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,zn(e,lt,Qt),ut(e,Ie()),null}function yl(e,n){var i=me;me|=1;try{return e(n)}finally{me=i,me===0&&(wr=Ie()+500,_i&&gn())}}function Bn(e){_n!==null&&_n.tag===0&&(me&6)===0&&xr();var n=me;me|=1;var i=kt.transition,o=xe;try{if(kt.transition=null,xe=1,e)return e()}finally{xe=o,kt.transition=i,me=n,(me&6)===0&&gn()}}function wl(){gt=yr.current,Se(yr)}function Fn(e,n){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,_m(i)),$e!==null)for(i=$e.return;i!==null;){var o=i;switch(To(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&wi();break;case 3:mr(),Se(it),Se(Xe),Fo();break;case 5:Mo(o);break;case 4:mr();break;case 13:Se(Pe);break;case 19:Se(Pe);break;case 10:Lo(o.type._context);break;case 22:case 23:wl()}i=i.return}if(He=e,$e=e=Sn(e.current,null),Ke=gt=n,Be=0,Ss=null,hl=zi=Mn=0,lt=Es=null,Un!==null){for(n=0;n<Un.length;n++)if(i=Un[n],o=i.interleaved,o!==null){i.interleaved=null;var d=o.next,f=i.pending;if(f!==null){var v=f.next;f.next=d,o.next=v}i.pending=o}Un=null}return e}function Xd(e,n){do{var i=$e;try{if(Ao(),Ri.current=Ii,Oi){for(var o=Ne.memoizedState;o!==null;){var d=o.queue;d!==null&&(d.pending=null),o=o.next}Oi=!1}if(Dn=0,ze=Me=Ne=null,ys=!1,ws=0,dl.current=null,i===null||i.return===null){Be=1,Ss=n,$e=null;break}e:{var f=e,v=i.return,x=i,k=n;if(n=Ke,x.flags|=32768,k!==null&&typeof k=="object"&&typeof k.then=="function"){var A=k,z=x,W=z.tag;if((z.mode&1)===0&&(W===0||W===11||W===15)){var F=z.alternate;F?(z.updateQueue=F.updateQueue,z.memoizedState=F.memoizedState,z.lanes=F.lanes):(z.updateQueue=null,z.memoizedState=null)}var G=bd(v);if(G!==null){G.flags&=-257,Sd(G,v,x,f,n),G.mode&1&&kd(f,A,n),n=G,k=A;var Q=n.updateQueue;if(Q===null){var Z=new Set;Z.add(k),n.updateQueue=Z}else Q.add(k);break e}else{if((n&1)===0){kd(f,A,n),xl();break e}k=Error(s(426))}}else if(Ce&&x.mode&1){var Ue=bd(v);if(Ue!==null){(Ue.flags&65536)===0&&(Ue.flags|=256),Sd(Ue,v,x,f,n),Ro(gr(k,x));break e}}f=k=gr(k,x),Be!==4&&(Be=2),Es===null?Es=[f]:Es.push(f),f=v;do{switch(f.tag){case 3:f.flags|=65536,n&=-n,f.lanes|=n;var P=xd(f,k,n);Kc(f,P);break e;case 1:x=k;var S=f.type,R=f.stateNode;if((f.flags&128)===0&&(typeof S.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(xn===null||!xn.has(R)))){f.flags|=65536,n&=-n,f.lanes|=n;var V=_d(f,x,n);Kc(f,V);break e}}f=f.return}while(f!==null)}th(i)}catch(ee){n=ee,$e===i&&i!==null&&($e=i=i.return);continue}break}while(!0)}function Zd(){var e=Fi.current;return Fi.current=Ii,e===null?Ii:e}function xl(){(Be===0||Be===3||Be===2)&&(Be=4),He===null||(Mn&268435455)===0&&(zi&268435455)===0||bn(He,Ke)}function Gi(e,n){var i=me;me|=2;var o=Zd();(He!==e||Ke!==n)&&(Qt=null,Fn(e,n));do try{qm();break}catch(d){Xd(e,d)}while(!0);if(Ao(),me=i,Fi.current=o,$e!==null)throw Error(s(261));return He=null,Ke=0,Be}function qm(){for(;$e!==null;)eh($e)}function Km(){for(;$e!==null&&!yp();)eh($e)}function eh(e){var n=sh(e.alternate,e,gt);e.memoizedProps=e.pendingProps,n===null?th(e):$e=n,dl.current=null}function th(e){var n=e;do{var i=n.alternate;if(e=n.return,(n.flags&32768)===0){if(i=Mm(i,n,gt),i!==null){$e=i;return}}else{if(i=Bm(i,n),i!==null){i.flags&=32767,$e=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Be=6,$e=null;return}}if(n=n.sibling,n!==null){$e=n;return}$e=n=e}while(n!==null);Be===0&&(Be=5)}function zn(e,n,i){var o=xe,d=kt.transition;try{kt.transition=null,xe=1,Gm(e,n,i,o)}finally{kt.transition=d,xe=o}return null}function Gm(e,n,i,o){do xr();while(_n!==null);if((me&6)!==0)throw Error(s(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var f=i.lanes|i.childLanes;if(Tp(e,f),e===He&&($e=He=null,Ke=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Wi||(Wi=!0,ih(Xs,function(){return xr(),null})),f=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||f){f=kt.transition,kt.transition=null;var v=xe;xe=1;var x=me;me|=4,dl.current=null,zm(e,i),Vd(i,e),pm(xo),ii=!!wo,xo=wo=null,e.current=i,Hm(i),wp(),me=x,xe=v,kt.transition=f}else e.current=i;if(Wi&&(Wi=!1,_n=e,Vi=d),f=e.pendingLanes,f===0&&(xn=null),kp(i.stateNode),ut(e,Ie()),n!==null)for(o=e.onRecoverableError,i=0;i<n.length;i++)d=n[i],o(d.value,{componentStack:d.stack,digest:d.digest});if(Hi)throw Hi=!1,e=pl,pl=null,e;return(Vi&1)!==0&&e.tag!==0&&xr(),f=e.pendingLanes,(f&1)!==0?e===ml?js++:(js=0,ml=e):js=0,gn(),null}function xr(){if(_n!==null){var e=Hu(Vi),n=kt.transition,i=xe;try{if(kt.transition=null,xe=16>e?16:e,_n===null)var o=!1;else{if(e=_n,_n=null,Vi=0,(me&6)!==0)throw Error(s(331));var d=me;for(me|=4,J=e.current;J!==null;){var f=J,v=f.child;if((J.flags&16)!==0){var x=f.deletions;if(x!==null){for(var k=0;k<x.length;k++){var A=x[k];for(J=A;J!==null;){var z=J;switch(z.tag){case 0:case 11:case 15:bs(8,z,f)}var W=z.child;if(W!==null)W.return=z,J=W;else for(;J!==null;){z=J;var F=z.sibling,G=z.return;if(Bd(z),z===A){J=null;break}if(F!==null){F.return=G,J=F;break}J=G}}}var Q=f.alternate;if(Q!==null){var Z=Q.child;if(Z!==null){Q.child=null;do{var Ue=Z.sibling;Z.sibling=null,Z=Ue}while(Z!==null)}}J=f}}if((f.subtreeFlags&2064)!==0&&v!==null)v.return=f,J=v;else e:for(;J!==null;){if(f=J,(f.flags&2048)!==0)switch(f.tag){case 0:case 11:case 15:bs(9,f,f.return)}var P=f.sibling;if(P!==null){P.return=f.return,J=P;break e}J=f.return}}var S=e.current;for(J=S;J!==null;){v=J;var R=v.child;if((v.subtreeFlags&2064)!==0&&R!==null)R.return=v,J=R;else e:for(v=S;J!==null;){if(x=J,(x.flags&2048)!==0)try{switch(x.tag){case 0:case 11:case 15:Bi(9,x)}}catch(ee){Oe(x,x.return,ee)}if(x===v){J=null;break e}var V=x.sibling;if(V!==null){V.return=x.return,J=V;break e}J=x.return}}if(me=d,gn(),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(Zs,e)}catch{}o=!0}return o}finally{xe=i,kt.transition=n}}return!1}function nh(e,n,i){n=gr(i,n),n=xd(e,n,1),e=yn(e,n,1),n=rt(),e!==null&&(Yr(e,1,n),ut(e,n))}function Oe(e,n,i){if(e.tag===3)nh(e,e,i);else for(;n!==null;){if(n.tag===3){nh(n,e,i);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(xn===null||!xn.has(o))){e=gr(i,e),e=_d(n,e,1),n=yn(n,e,1),e=rt(),n!==null&&(Yr(n,1,e),ut(n,e));break}}n=n.return}}function Jm(e,n,i){var o=e.pingCache;o!==null&&o.delete(n),n=rt(),e.pingedLanes|=e.suspendedLanes&i,He===e&&(Ke&i)===i&&(Be===4||Be===3&&(Ke&130023424)===Ke&&500>Ie()-fl?Fn(e,0):hl|=i),ut(e,n)}
vendor: 4,477 bytes, line 8
8function rh(e,n){n===0&&((e.mode&1)===0?n=1:(n=ti,ti<<=1,(ti&130023424)===0&&(ti=4194304)));var i=rt();e=Gt(e,n),e!==null&&(Yr(e,n,i),ut(e,i))}function Ym(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),rh(e,i)}function Qm(e,n){var i=0;switch(e.tag){case 13:var o=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(s(314))}o!==null&&o.delete(n),rh(e,i)}var sh;sh=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||it.current)ot=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return ot=!1,Dm(e,n,i);ot=(e.flags&131072)!==0}else ot=!1,Ce&&(n.flags&1048576)!==0&&$c(n,bi,n.index);switch(n.lanes=0,n.tag){case 2:var o=n.type;Di(e,n),e=n.pendingProps;var d=lr(n,Xe.current);pr(n,i),d=Wo(null,n,o,e,d,i);var f=Vo();return n.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,at(o)?(f=!0,xi(n)):f=!1,n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,$o(n),d.updater=Ui,n.stateNode=d,d._reactInternals=n,Qo(n,o,e,i),n=tl(null,n,o,!0,f,i)):(n.tag=0,Ce&&f&&Co(n),nt(null,n,d,i),n=n.child),n;case 16:o=n.elementType;e:{switch(Di(e,n),e=n.pendingProps,d=o._init,o=d(o._payload),n.type=o,d=n.tag=Zm(o),e=Tt(o,e),d){case 0:n=el(null,n,o,e,i);break e;case 1:n=Nd(null,n,o,e,i);break e;case 11:n=Ed(null,n,o,e,i);break e;case 14:n=jd(null,n,o,Tt(o.type,e),i);break e}throw Error(s(306,o,""))}return n;case 0:return o=n.type,d=n.pendingProps,d=n.elementType===o?d:Tt(o,d),el(e,n,o,d,i);case 1:return o=n.type,d=n.pendingProps,d=n.elementType===o?d:Tt(o,d),Nd(e,n,o,d,i);case 3:e:{if(Rd(n),e===null)throw Error(s(387));o=n.pendingProps,f=n.memoizedState,d=f.element,qc(e,n),Pi(n,o,null,i);var v=n.memoizedState;if(o=v.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},n.updateQueue.baseState=f,n.memoizedState=f,n.flags&256){d=gr(Error(s(423)),n),n=Od(e,n,o,i,d);break e}else if(o!==d){d=gr(Error(s(424)),n),n=Od(e,n,o,i,d);break e}else for(mt=fn(n.stateNode.containerInfo.firstChild),pt=n,Ce=!0,Ct=null,i=Wc(n,null,o,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(dr(),o===d){n=Yt(e,n,i);break e}nt(e,n,o,i)}n=n.child}return n;case 5:return Jc(n),e===null&&No(n),o=n.type,d=n.pendingProps,f=e!==null?e.memoizedProps:null,v=d.children,_o(o,d)?v=null:f!==null&&_o(o,f)&&(n.flags|=32),Pd(e,n),nt(e,n,v,i),n.child;case 6:return e===null&&No(n),null;case 13:return Ad(e,n,i);case 4:return Do(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=hr(n,null,o,i):nt(e,n,o,i),n.child;case 11:return o=n.type,d=n.pendingProps,d=n.elementType===o?d:Tt(o,d),Ed(e,n,o,d,i);case 7:return nt(e,n,n.pendingProps,i),n.child;case 8:return nt(e,n,n.pendingProps.children,i),n.child;case 12:return nt(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(o=n.type._context,d=n.pendingProps,f=n.memoizedProps,v=d.value,_e(ji,o._currentValue),o._currentValue=v,f!==null)if(jt(f.value,v)){if(f.children===d.children&&!it.current){n=Yt(e,n,i);break e}}else for(f=n.child,f!==null&&(f.return=n);f!==null;){var x=f.dependencies;if(x!==null){v=f.child;for(var k=x.firstContext;k!==null;){if(k.context===o){if(f.tag===1){k=Jt(-1,i&-i),k.tag=2;var A=f.updateQueue;if(A!==null){A=A.shared;var z=A.pending;z===null?k.next=k:(k.next=z.next,z.next=k),A.pending=k}}f.lanes|=i,k=f.alternate,k!==null&&(k.lanes|=i),Io(f.return,i,n),x.lanes|=i;break}k=k.next}}else if(f.tag===10)v=f.type===n.type?null:f.child;else if(f.tag===18){if(v=f.return,v===null)throw Error(s(341));v.lanes|=i,x=v.alternate,x!==null&&(x.lanes|=i),Io(v,i,n),v=f.sibling}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===n){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}nt(e,n,d.children,i),n=n.child}return n;case 9:return d=n.type,o=n.pendingProps.children,pr(n,i),d=xt(d),o=o(d),n.flags|=1,nt(e,n,o,i),n.child;case 14:return o=n.type,d=Tt(o,n.pendingProps),d=Tt(o.type,d),jd(e,n,o,d,i);case 15:return Cd(e,n,n.type,n.pendingProps,i);case 17:return o=n.type,d=n.pendingProps,d=n.elementType===o?d:Tt(o,d),Di(e,n),n.tag=1,at(o)?(e=!0,xi(n)):e=!1,pr(n,i),yd(n,o,d),Qo(n,o,d,i),tl(null,n,o,!0,e,i);case 19:return Id(e,n,i);case 22:return Td(e,n,i)}throw Error(s(156,n.tag))};function ih(e,n){return Du(e,n)}function Xm(e,n,i,o){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 5,231 bytes, line 8
8ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,n,i,o){return new Xm(e,n,i,o)}function _l(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zm(e){if(typeof e=="function")return _l(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ee)return 11;if(e===Qe)return 14}return 2}function Sn(e,n){var i=e.alternate;return i===null?(i=bt(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Ji(e,n,i,o,d,f){var v=2;if(o=e,typeof e=="function")_l(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case oe:return Hn(i.children,d,f,n);case ye:v=8,d|=8;break;case te:return e=bt(12,i,n,d|2),e.elementType=te,e.lanes=f,e;case Te:return e=bt(13,i,n,d),e.elementType=Te,e.lanes=f,e;case Le:return e=bt(19,i,n,d),e.elementType=Le,e.lanes=f,e;case C:return Yi(i,d,f,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ce:v=10;break e;case ge:v=9;break e;case Ee:v=11;break e;case Qe:v=14;break e;case B:v=16,o=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return n=bt(v,i,n,d),n.elementType=e,n.type=o,n.lanes=f,n}function Hn(e,n,i,o){return e=bt(7,e,o,n),e.lanes=i,e}function Yi(e,n,i,o){return e=bt(22,e,o,n),e.elementType=C,e.lanes=i,e.stateNode={isHidden:!1},e}function kl(e,n,i){return e=bt(6,e,null,n),e.lanes=i,e}function bl(e,n,i){return n=bt(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function eg(e,n,i,o,d){this.tag=n,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=Ja(0),this.expirationTimes=Ja(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ja(0),this.identifierPrefix=o,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Sl(e,n,i,o,d,f,v,x,k){return e=new eg(e,n,i,x,k),n===1?(n=1,f===!0&&(n|=8)):n=0,f=bt(3,null,null,n),e.current=f,f.stateNode=e,f.memoizedState={element:o,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},$o(f),e}function tg(e,n,i){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,key:o==null?null:""+o,children:e,containerInfo:n,implementation:i}}function ah(e){if(!e)return mn;e=e._reactInternals;e:{if(Rn(e)!==e||e.tag!==1)throw Error(s(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(at(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(at(i))return Lc(e,i,n)}return n}function oh(e,n,i,o,d,f,v,x,k){return e=Sl(i,o,!0,e,d,f,v,x,k),e.context=ah(null),i=e.current,o=rt(),d=kn(i),f=Jt(o,d),f.callback=n??null,yn(i,f,d),e.current.lanes=d,Yr(e,d,o),ut(e,o),e}function Qi(e,n,i,o){var d=n.current,f=rt(),v=kn(d);return i=ah(i),n.context===null?n.context=i:n.pendingContext=i,n=Jt(f,v),n.payload={element:e},o=o===void 0?null:o,o!==null&&(n.callback=o),e=yn(d,n,v),e!==null&&(Rt(e,d,v,f),Ti(e,d,v)),v}function Xi(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function lh(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function El(e,n){lh(e,n),(e=e.alternate)&&lh(e,n)}function ng(){return null}var uh=typeof reportError=="function"?reportError:function(e){console.error(e)};function jl(e){this._internalRoot=e}Zi.prototype.render=jl.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(s(409));Qi(e,n,null,null)},Zi.prototype.unmount=jl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Bn(function(){Qi(null,e,null,null)}),n[Wt]=null}};function Zi(e){this._internalRoot=e}Zi.prototype.unstable_scheduleHydration=function(e){if(e){var n=qu();e={blockedOn:null,target:e,priority:n};for(var i=0;i<cn.length&&n!==0&&n<cn[i].priority;i++);cn.splice(i,0,e),i===0&&Ju(e)}};function Cl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ea(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ch(){}function rg(e,n,i,o,d){if(d){if(typeof o=="function"){var f=o;o=function(){var A=Xi(v);f.call(A)}}var v=oh(n,o,e,0,null,!1,!1,"",ch);return e._reactRootContainer=v,e[Wt]=v.current,cs(e.nodeType===8?e.parentNode:e),Bn(),v}for(;
vendor: 1,322 bytes, line 8
8d=e.lastChild;)e.removeChild(d);if(typeof o=="function"){var x=o;o=function(){var A=Xi(k);x.call(A)}}var k=Sl(e,0,!1,null,null,!1,!1,"",ch);return e._reactRootContainer=k,e[Wt]=k.current,cs(e.nodeType===8?e.parentNode:e),Bn(function(){Qi(n,k,i,o)}),k}function ta(e,n,i,o,d){var f=i._reactRootContainer;if(f){var v=f;if(typeof d=="function"){var x=d;d=function(){var k=Xi(v);x.call(k)}}Qi(n,v,e,d)}else v=rg(i,n,e,d,o);return Xi(v)}Wu=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var i=Jr(n.pendingLanes);i!==0&&(Ya(n,i|1),ut(n,Ie()),(me&6)===0&&(wr=Ie()+500,gn()))}break;case 13:Bn(function(){var o=Gt(e,1);if(o!==null){var d=rt();Rt(o,e,1,d)}}),El(e,1)}},Qa=function(e){if(e.tag===13){var n=Gt(e,134217728);if(n!==null){var i=rt();Rt(n,e,134217728,i)}El(e,134217728)}},Vu=function(e){if(e.tag===13){var n=kn(e),i=Gt(e,n);if(i!==null){var o=rt();Rt(i,e,n,o)}El(e,n)}},qu=function(){return xe},Ku=function(e,n){var i=xe;try{return xe=e,n()}finally{xe=i}},Ha=function(e,n,i){switch(n){case"input":if(Ia(e,i),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var o=i[n];if(o!==e&&o.form===e.form){var d=yi(o);if(!d)throw Error(s(90));vu(o),Ia(o,d)}}}break;
8case"textarea":ku(e,i);break;case"select":n=i.value,n!=null&&Yn(e,!!i.multiple,n,!1)}},Ru=yl,Ou=Bn;var sg={usingClientEntryPoint:!1,Events:[fs,ar,yi,Pu,Nu,yl]},Cs={findFiberByHostInstance:On,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ig={bundleType:Cs.bundleType,version:Cs.version,rendererPackageName:Cs.rendererPackageName,rendererConfig:Cs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:q.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Uu(e),e===null?null:e.stateNode},findFiberByHostInstance:Cs.findFiberByHostInstance||ng,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 na=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!na.isDisabled&&na.supportsFiber)try{Zs=na.inject(ig),Ut=na}catch{}}return ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sg,ct.createPortal=function(e,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Cl(n))throw Error(s(200));return tg(e,n,null,i)},ct.createRoot=function(e,n){if(!Cl(e))throw Error(s(299));var i=!1,o="",d=uh;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(d=n.onRecoverableError)),n=Sl(e,1,!1,null,null,i,!1,o,d),e[Wt]=n.current,cs(e.nodeType===8?e.parentNode:e),new jl(n)},ct.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=Uu(n),e=e===null?null:e.stateNode,e},ct.flushSync=function(e){return Bn(e)},ct.hydrate=function(e,n,i){if(!ea(n))throw Error(s(200));return ta(null,e,n,!0,i)},ct.hydrateRoot=function(e,n,i){if(!Cl(e))throw Error(s(405));var o=i!=null&&i.hydratedSources||null,d=!1,f="",v=uh;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),n=oh(n,null,e,1,i??null,d,!1,f,v),e[Wt]=n.current,cs(e),o)for(e=0;e<o.length;e++)i=o[e],d=i._getVersion,d=d(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,d]:n.mutableSourceEagerHydrationData.push(i,d);return new Zi(n)},ct.render=function(e,n,i){if(!ea(n))throw Error(s(200));return ta(null,e,n,!1,i)},ct.unmountComponentAtNode=function(e){if(!ea(e))throw Error(s(40));return e._reactRootContainer?(Bn(function(){ta(null,null,e,!1,function(){e._reactRootContainer=null,e[Wt]=null})}),!0):!1},ct.unstable_batchedUpdates=yl,ct.unstable_renderSubtreeIntoContainer=function(e,n,i,o){if(!ea(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return ta(e,n,i,!1,o)},ct.version="18.3.1-next-f1338f8080-20240426",ct}var yh;function Cf(){if(yh)return Nl.exports;yh=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(t){console.error(t)}}return r(),Nl.exports=gg(),Nl.exports}var wh;function vg(){if(wh)return ra;wh=1;var r=Cf();return ra.createRoot=r.createRoot,ra.hydrateRoot=r.hydrateRoot,ra}var yg=vg();Cf();function $s(){return $s=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])}return r},$s.apply(this,arguments)}var Tn;(function(r){r.Pop="POP",r.Push="PUSH",r.Replace="REPLACE"})(Tn||(Tn={}));const xh="popstate";function wg(r){r===void 0&&(r={});function t(a,l){let{pathname:u,search:c,hash:p}=a.location;return zl("",{pathname:u,search:c,hash:p},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function s(a,l){return typeof l=="string"?l:ma(l)}return _g(t,s,null,r)}function Re(r,t){if(r===!1||r===null||typeof r>"u")throw new Error(t)}function cu(r,t){if(!r){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xg(){return Math.random().toString(36).substr(2,8)}function _h(r,t){return{usr:r.state,key:r.key,idx:t}}function zl(r,t,s,a){return s===void 0&&(s=null),$s({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof t=="string"?$r(t):t,{state:s,key:t&&t.key||a||xg()})}function ma(r){let{pathname:t="/",search:s="",hash:a=""}=r;return s&&s!=="?"&&(t+=s.charAt(0)==="?"?s:"?"+s),a&&a!=="#"&&(t+=a.charAt(0)==="#"?a:"#"+a),t}function $r(r){let t={};if(r){let s=r.indexOf("#");s>=0&&(t.hash=r.substr(s),r=r.substr(0,s));let a=r.indexOf("?");a>=0&&(t.search=r.substr(a),r=r.substr(0,a)),r&&(t.pathname=r)}return t}function _g(r,t,s,a){a===void 0&&(a={});let{window:l=document.defaultView,v5Compat:u=!1}=a,c=l.history,p=Tn.Pop,m=null,g=w();g==null&&(g=0,c.replaceState($s({},c.state,{idx:g}),""));function w(){return(c.state||{idx:null}).idx}function y(){p=Tn.Pop;let N=w(),D=N==null?null:N-g;g=N,m&&m({action:p,location:O.location,delta:D})}function _(N,D){p=Tn.Push;let M=zl(O.location,N,D);g=w()+1;let U=_h(M,g),q=O.createHref(M);try{c.pushState(U,"",q)}catch(ue){if(ue instanceof DOMException&&ue.name==="DataCloneError")throw ue;l.location.assign(q)}u&&m&&m({action:p,location:O.location,delta:1})}function E(N,D){p=Tn.Replace;let M=zl(O.location,N,D);g=w();let U=_h(M,g),q=O.createHref(M);c.replaceState(U,"",q),u&&m&&m({action:p,location:O.location,delta:0})}function j(N){let D=l.location.origin!=="null"?l.location.origin:l.location.href,M=typeof N=="string"?N:ma(N);return M=M.replace(/ $/,"%20"),Re(D,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,D)}let O={get action(){return p},get location(){return r(l,c)},listen(N){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(xh,y),m=N,()=>{l.removeEventListener(xh,y),m=null}},createHref(N){return t(l,N)},createURL:j,encodeLocation(N){let D=j(N);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:_,replace:E,go(N){return c.go(N)}};return O}var kh;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(kh||(kh={}));function kg(r,t,s){return s===void 0&&(s="/"),bg(r,t,s)}function bg(r,t,s,a){let l=typeof t=="string"?$r(t):t,u=Lr(l.pathname||"/",s);if(u==null)return null;
vendor: 2,018 bytes, line 8
8let c=Tf(r);Sg(c);let p=null;for(let m=0;p==null&&m<c.length;++m){let g=Ig(u);p=Ag(c[m],g)}return p}function Tf(r,t,s,a){t===void 0&&(t=[]),s===void 0&&(s=[]),a===void 0&&(a="");let l=(u,c,p)=>{let m={relativePath:p===void 0?u.path||"":p,caseSensitive:u.caseSensitive===!0,childrenIndex:c,route:u};m.relativePath.startsWith("/")&&(Re(m.relativePath.startsWith(a),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(a.length));let g=Pn([a,m.relativePath]),w=s.concat(m);u.children&&u.children.length>0&&(Re(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Tf(u.children,t,w,g)),!(u.path==null&&!u.index)&&t.push({path:g,score:Rg(g,u.index),routesMeta:w})};return r.forEach((u,c)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))l(u,c);else for(let m of Pf(u.path))l(u,c,m)}),t}function Pf(r){let t=r.split("/");if(t.length===0)return[];let[s,...a]=t,l=s.endsWith("?"),u=s.replace(/\?$/,"");if(a.length===0)return l?[u,""]:[u];let c=Pf(a.join("/")),p=[];return p.push(...c.map(m=>m===""?u:[u,m].join("/"))),l&&p.push(...c),p.map(m=>r.startsWith("/")&&m===""?"/":m)}function Sg(r){r.sort((t,s)=>t.score!==s.score?s.score-t.score:Og(t.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}const Eg=/^:[\w-]+$/,jg=3,Cg=2,Tg=1,Pg=10,Ng=-2,bh=r=>r==="*";function Rg(r,t){let s=r.split("/"),a=s.length;return s.some(bh)&&(a+=Ng),t&&(a+=Cg),s.filter(l=>!bh(l)).reduce((l,u)=>l+(Eg.test(u)?jg:u===""?Tg:Pg),a)}function Og(r,t){return r.length===t.length&&r.slice(0,-1).every((a,l)=>a===t[l])?r[r.length-1]-t[t.length-1]:0}function Ag(r,t,s){let{routesMeta:a}=r,l={},u="/",c=[];for(let p=0;p<a.length;++p){let m=a[p],g=p===a.length-1,w=u==="/"?t:t.slice(u.length)||"/",y=Hl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},w),_=m.route;if(!y)return null;
vendor: 7,030 bytes, line 8
8Object.assign(l,y.params),c.push({params:l,pathname:Pn([u,y.pathname]),pathnameBase:Bg(Pn([u,y.pathnameBase])),route:_}),y.pathnameBase!=="/"&&(u=Pn([u,y.pathnameBase]))}return c}function Hl(r,t){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[s,a]=Lg(r.path,r.caseSensitive,r.end),l=t.match(s);if(!l)return null;let u=l[0],c=u.replace(/(.)\/+$/,"$1"),p=l.slice(1);return{params:a.reduce((g,w,y)=>{let{paramName:_,isOptional:E}=w;if(_==="*"){let O=p[y]||"";c=u.slice(0,u.length-O.length).replace(/(.)\/+$/,"$1")}const j=p[y];return E&&!j?g[_]=void 0:g[_]=(j||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:c,pattern:r}}function Lg(r,t,s){t===void 0&&(t=!1),s===void 0&&(s=!0),cu(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let a=[],l="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,p,m)=>(a.push({paramName:p,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(a.push({paramName:"*"}),l+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":r!==""&&r!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),a]}function Ig(r){try{return r.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return cu(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),r}}function Lr(r,t){if(t==="/")return r;if(!r.toLowerCase().startsWith(t.toLowerCase()))return null;let s=t.endsWith("/")?t.length-1:t.length,a=r.charAt(s);return a&&a!=="/"?null:r.slice(s)||"/"}const Ug=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$g=r=>Ug.test(r);function Dg(r,t){t===void 0&&(t="/");let{pathname:s,search:a="",hash:l=""}=typeof r=="string"?$r(r):r,u;if(s)if($g(s))u=s;else{if(s.includes("//")){let c=s;s=s.replace(/\/\/+/g,"/"),cu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(c+" -> "+s))}s.startsWith("/")?u=Sh(s.substring(1),"/"):u=Sh(s,t)}else u=t;return{pathname:u,search:Fg(a),hash:zg(l)}}function Sh(r,t){let s=t.replace(/\/+$/,"").split("/");return r.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function Al(r,t,s,a){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(a)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Mg(r){return r.filter((t,s)=>s===0||t.route.path&&t.route.path.length>0)}function du(r,t){let s=Mg(r);return t?s.map((a,l)=>l===s.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function hu(r,t,s,a){a===void 0&&(a=!1);let l;typeof r=="string"?l=$r(r):(l=$s({},r),Re(!l.pathname||!l.pathname.includes("?"),Al("?","pathname","search",l)),Re(!l.pathname||!l.pathname.includes("#"),Al("#","pathname","hash",l)),Re(!l.search||!l.search.includes("#"),Al("#","search","hash",l)));let u=r===""||l.pathname==="",c=u?"/":l.pathname,p;if(c==null)p=s;else{let y=t.length-1;if(!a&&c.startsWith("..")){let _=c.split("/");for(;_[0]==="..";)_.shift(),y-=1;l.pathname=_.join("/")}p=y>=0?t[y]:"/"}let m=Dg(l,p),g=c&&c!=="/"&&c.endsWith("/"),w=(u||c===".")&&s.endsWith("/");return!m.pathname.endsWith("/")&&(g||w)&&(m.pathname+="/"),m}const Pn=r=>r.join("/").replace(/\/\/+/g,"/"),Bg=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Fg=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,zg=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Hg(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Nf=["post","put","patch","delete"];new Set(Nf);const Wg=["get",...Nf];new Set(Wg);function Ds(){return Ds=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])}return r},Ds.apply(this,arguments)}const Ea=I.createContext(null),Rf=I.createContext(null),nn=I.createContext(null),ja=I.createContext(null),rn=I.createContext({outlet:null,matches:[],isDataRoute:!1}),Of=I.createContext(null);function Vg(r,t){let{relative:s}=t===void 0?{}:t;Dr()||Re(!1);let{basename:a,navigator:l}=I.useContext(nn),{hash:u,pathname:c,search:p}=Ca(r,{relative:s}),m=c;return a!=="/"&&(m=c==="/"?a:Pn([a,c])),l.createHref({pathname:m,search:p,hash:u})}function Dr(){return I.useContext(ja)!=null}function sn(){return Dr()||Re(!1),I.useContext(ja).location}function Af(r){I.useContext(nn).static||I.useLayoutEffect(r)}function Mr(){let{isDataRoute:r}=I.useContext(rn);return r?iv():qg()}function qg(){Dr()||Re(!1);let r=I.useContext(Ea),{basename:t,future:s,navigator:a}=I.useContext(nn),{matches:l}=I.useContext(rn),{pathname:u}=sn(),c=JSON.stringify(du(l,s.v7_relativeSplatPath)),p=I.useRef(!1);return Af(()=>{p.current=!0}),I.useCallback(function(g,w){if(w===void 0&&(w={}),!p.current)return;if(typeof g=="number"){a.go(g);return}let y=hu(g,JSON.parse(c),u,w.relative==="path");r==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Pn([t,y.pathname])),(w.replace?a.replace:a.push)(y,w.state,w)},[t,a,c,u,r])}const Lf=I.createContext(null);function Br(){return I.useContext(Lf)}function Kg(r){let t=I.useContext(rn).outlet;return t&&I.createElement(Lf.Provider,{value:r},t)}function Ca(r,t){let{relative:s}=t===void 0?{}:t,{future:a}=I.useContext(nn),{matches:l}=I.useContext(rn),{pathname:u}=sn(),c=JSON.stringify(du(l,a.v7_relativeSplatPath));return I.useMemo(()=>hu(r,JSON.parse(c),u,s==="path"),[r,c,u,s])}function Gg(r,t){return Jg(r,t)}function Jg(r,t,s,a){Dr()||Re(!1);let{navigator:l}=I.useContext(nn),{matches:u}=I.useContext(rn),c=u[u.length-1],p=c?c.params:{};c&&c.pathname;let m=c?c.pathnameBase:"/";c&&c.route;let g=sn(),w;if(t){var y;let N=typeof t=="string"?$r(t):t;m==="/"||(y=N.pathname)!=null&&y.startsWith(m)||Re(!1),w=N}else w=g;let _=w.pathname||"/",E=_;if(m!=="/"){let N=m.replace(/^\//,"").split("/");E="/"+_.replace(/^\//,"").split("/").slice(N.length).join("/")}let j=kg(r,{pathname:E}),O=ev(j&&j.map(N=>Object.assign({},N,{params:Object.assign({},p,N.params),pathname:Pn([m,l.encodeLocation?l.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?m:Pn([m,l.encodeLocation?l.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),u,s,a);return t&&O?I.createElement(ja.Provider,{value:{location:Ds({pathname:"/",search:"",hash:"",state:null,key:"default"},w),navigationType:Tn.Pop}},O):O}function Yg(){let r=sv(),t=Hg(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),s=r instanceof Error?r.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return I.createElement(I.Fragment,null,I.createElement("h2",null,"Unexpected Application
8Error!"),I.createElement("h3",{style:{fontStyle:"italic"}},t),s?I.createElement("pre",{style:l},s):null,null)}const Qg=I.createElement(Yg,null);class Xg extends I.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,s){return s.location!==t.location||s.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:s.error,location:s.location,revalidation:t.revalidation||s.revalidation}}componentDidCatch(t,s){console.error("React Router caught the following error during render",t,s)}render(){return this.state.error!==void 0?I.createElement(rn.Provider,{value:this.props.routeContext},I.createElement(Of.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Zg(r){let{routeContext:t,match:s,children:a}=r,l=I.useContext(Ea);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),I.createElement(rn.Provider,{value:t},a)}function ev(r,t,s,a){var l;if(t===void 0&&(t=[]),s===void 0&&(s=null),a===void 0&&(a=null),r==null){var u;if(!s)return null;if(s.errors)r=s.matches;else if((u=a)!=null&&u.v7_partialHydration&&t.length===0&&!s.initialized&&s.matches.length>0)r=s.matches;else return null}let c=r,p=(l=s)==null?void 0:l.errors;if(p!=null){let w=c.findIndex(y=>y.route.id&&p?.[y.route.id]!==void 0);w>=0||Re(!1),c=c.slice(0,Math.min(c.length,w+1))}let m=!1,g=-1;if(s&&a&&a.v7_partialHydration)for(let w=0;w<c.length;w++){let y=c[w];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(g=w),y.route.id){let{loaderData:_,errors:E}=s,j=y.route.loader&&_[y.route.id]===void 0&&(!E||E[y.route.id]===void 0);if(y.route.lazy||j){m=!0,g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}return c.reduceRight((w,y,_)=>{let E,j=!1,O=null,N=null;s&&(E=p&&y.route.id?p[y.route.id]:void 0,O=y.route.errorElement||Qg,m&&(g<0&&_===0?(av("route-fallback"),j=!0,N=null):g===_&&(j=!0,N=y.route.hydrateFallbackElement||null)));let D=t.concat(c.slice(0,_+1)),M=()=>{let U;return E?U=O:j?U=N:y.route.Component?U=I.createElement(y.route.Component,null):y.route.element?U=y.route.element:U=w,I.createElement(Zg,{match:y,routeContext:{outlet:w,matches:D,isDataRoute:s!=null},children:U})};return s&&(y.route.ErrorBoundary||y.route.errorElement||_===0)?I.createElement(Xg,{location:s.location,revalidation:s.revalidation,component:O,error:E,children:M(),routeContext:{outlet:null,matches:D,isDataRoute:!0}}):M()},null)}var If=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(If||{}),Uf=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(Uf||{});function tv(r){let t=I.useContext(Ea);return t||Re(!1),t}function nv(r){let t=I.useContext(Rf);return t||Re(!1),t}function rv(r){let t=I.useContext(rn);return t||Re(!1),t}function $f(r){let t=rv(),s=t.matches[t.matches.length-1];return s.route.id||Re(!1),s.route.id}function sv(){var r;let t=I.useContext(Of),s=nv(),a=$f();return t!==void 0?t:(r=s.errors)==null?void 0:r[a]}function iv(){let{router:r}
8=tv(If.UseNavigateStable),t=$f(Uf.UseNavigateStable),s=I.useRef(!1);return Af(()=>{s.current=!0}),I.useCallback(function(l,u){u===void 0&&(u={}),s.current&&(typeof l=="number"?r.navigate(l):r.navigate(l,Ds({fromRouteId:t},u)))},[r,t])}const Eh={};function av(r,t,s){Eh[r]||(Eh[r]=!0)}function ov(r,t){r?.v7_startTransition,r?.v7_relativeSplatPath}function ga(r){let{to:t,replace:s,state:a,relative:l}=r;Dr()||Re(!1);let{future:u,static:c}=I.useContext(nn),{matches:p}=I.useContext(rn),{pathname:m}=sn(),g=Mr(),w=hu(t,du(p,u.v7_relativeSplatPath),m,l==="path"),y=JSON.stringify(w);return I.useEffect(()=>g(JSON.parse(y),{replace:s,state:a,relative:l}),[g,y,l,s,a]),null}function lv(r){return Kg(r.context)}function Ot(r){Re(!1)}function uv(r){let{basename:t="/",children:s=null,location:a,navigationType:l=Tn.Pop,navigator:u,static:c=!1,future:p}=r;Dr()&&Re(!1);let m=t.replace(/^\/*/,"/"),g=I.useMemo(()=>({basename:m,navigator:u,static:c,future:Ds({v7_relativeSplatPath:!1},p)}),[m,p,u,c]);typeof a=="string"&&(a=$r(a));let{pathname:w="/",search:y="",hash:_="",state:E=null,key:j="default"}=a,O=I.useMemo(()=>{let N=Lr(w,m);return N==null?null:{location:{pathname:N,search:y,hash:_,state:E,key:j},navigationType:l}},[m,w,y,_,E,j,l]);return O==null?null:I.createElement(nn.Provider,{value:g},I.createElement(ja.Provider,{children:s,value:O}))}function cv(r){let{children:t,location:s}=r;return Gg(Wl(t),s)}new Promise(()=>{});function Wl(r,t){t===void 0&&(t=[]);let s=[];return I.Children.forEach(r,(a,l)=>{if(!I.isValidElement(a))return;let u=[...t,l];if(a.type===I.Fragment){s.push.apply(s,Wl(a.props.children,u));return}a.type!==Ot&&Re(!1),!a.props.index||!a.props.children||Re(!1);let c={id:a.props.id||u.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(c.children=Wl(a.props.children,u)),s.push(c)}),s}function va(){return va=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])}return r},va.apply(this,arguments)}function Df(r,t){if(r==null)return{};var s={},a=Object.keys(r),l,u;for(u=0;u<a.length;u++)l=a[u],!(t.indexOf(l)>=0)&&(s[l]=r[l]);return s}function dv(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function hv(r,t){return r.button===0&&(!t||t==="_self")&&!dv(r)}const fv=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],pv=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],mv="6";try{window.__reactRouterVersion=mv}catch{}const gv=I.createContext({isTransitioning:!1}),vv="startTransition",jh=fg[vv];function yv(r){let{basename:t,children:s,future:a,window:l}=r,u=I.useRef();u.current==null&&(u.current=wg({window:l,v5Compat:!0}));let c=u.current,[p,m]=I.useState({action:c.action,location:c.location}),{v7_startTransition:g}=a||{},w=I.useCallback(y=>{g&&jh?jh(()=>m(y)):m(y)},[m,g]);return I.useLayoutEffect(()=>c.listen(w),[c,w]),I.useEffect(()=>ov(a),[a]),I.createElement(uv,{basename:t,children:s,location:p.location,navigationType:p.action,navigator:c,future:a})}const wv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jn=I.forwardRef(function(t,s){let{onClick:a,relative:l,reloadDocument:u,replace:c,state:p,target:m,to:g,preventScrollReset:w,viewTransition:y}=t,_=Df(t,fv),{basename:E}=I.useContext(nn),j,O=!1;if(typeof g=="string"&&xv.test(g)&&(j=g,wv))try{let U=new URL(window.location.href),q=g.startsWith("//")?new URL(U.protocol+g):new URL(g),ue=Lr(q.pathname,E);q.origin===U.origin&&ue!=null?g=ue+q.search+q.hash:O=!0}catch{}let N=Vg(g,{relative:l}),D=bv(g,{replace:c,state:p,target:m,preventScrollReset:w,relative:l,viewTransition:y});function M(U){a&&a(U),U.defaultPrevented||D(U)}return I.createElement("a",va({},_,{href:j||N,onClick:O||u?a:M,ref:s,target:m}))}),_v=I.forwardRef(function(t,s){let{"aria-current":a="page",caseSensitive:l=!1,className:u="",end:c=!1,style:p,to:m,viewTransition:g,children:w}=t,y=Df(t,pv),_=Ca(m,{relative:y.relative}),E=sn(),j=I.useContext(Rf),{navigator:O,basename:N}=I.useContext(nn),D=j!=null&&Sv(_)&&g===!0,M=O.encodeLocation?O.encodeLocation(_).pathname:_.pathname,U=E.pathname,q=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;l||(U=U.toLowerCase(),q=q?q.toLowerCase():null,M=M.toLowerCase()),q&&N&&(q=Lr(q,N)||q);const ue=M!=="/"&&M.endsWith("/")?M.length-1:M.length;let Y=U===M||!c&&U.startsWith(M)&&U.charAt(ue)==="/",oe=q!=null&&(q===M||!c&&q.startsWith(M)&&q.charAt(M.length)==="/"),ye={isActive:Y,isPending:oe,isTransitioning:D},te=Y?a:void 0,ce;typeof u=="function"?ce=u(ye):ce=[u,Y?"active":null,oe?"pending":null,D?"transitioning":null].filter(
8Boolean).join(" ");let ge=typeof p=="function"?p(ye):p;return I.createElement(Jn,va({},y,{"aria-current":te,className:ce,ref:s,style:ge,to:m,viewTransition:g}),typeof w=="function"?w(ye):w)});var Vl;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(Vl||(Vl={}));var Ch;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(Ch||(Ch={}));function kv(r){let t=I.useContext(Ea);return t||Re(!1),t}function bv(r,t){let{target:s,replace:a,state:l,preventScrollReset:u,relative:c,viewTransition:p}=t===void 0?{}:t,m=Mr(),g=sn(),w=Ca(r,{relative:c});return I.useCallback(y=>{if(hv(y,s)){y.preventDefault();let _=a!==void 0?a:ma(g)===ma(w);m(r,{replace:_,state:l,preventScrollReset:u,relative:c,viewTransition:p})}},[g,m,w,a,l,s,r,u,c,p])}function Sv(r,t){t===void 0&&(t={});let s=I.useContext(gv);s==null&&Re(!1);let{basename:a}=kv(Vl.useViewTransitionState),l=Ca(r,{relative:t.relative});if(!s.isTransitioning)return!1;let u=Lr(s.currentLocation.pathname,a)||s.currentLocation.pathname,c=Lr(s.nextLocation.pathname,a)||s.nextLocation.pathname;return Hl(l.pathname,c)!=null||Hl(l.pathname,u)!=null}function Ta(r,t){var s={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&t.indexOf(a)<0&&(s[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(r);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(r,a[l])&&(s[a[l]]=r[a[l]]);return s}function Ev(r,t,s,a){function l(u){return u instanceof s?u:new s(function(c){c(u)})}return new(s||(s=Promise))(function(u,c){function p(w){try{g(a.next(w))}catch(y){c(y)}}function m(w){try{g(a.throw(w))}catch(y){c(y)}}function g(w){w.done?u(w.value):l(w.value).then(p,m)}g((a=a.apply(r,t||[])).next())})}const jv=r=>r?(...t)=>r(...t):(...t)=>fetch(...t);class fu extends Error{constructor(t,s="FunctionsError",a){super(t),this.name=s,this.context=a}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class Cv extends fu{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Th extends fu{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Ph extends fu{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var ql;(function(r){r.Any="any",r.ApNortheast1="ap-northeast-1",r.ApNortheast2="ap-northeast-2",r.ApSouth1="ap-south-1",r.ApSoutheast1="ap-southeast-1",r.ApSoutheast2="ap-southeast-2",r.CaCentral1="ca-central-1",r.EuCentral1="eu-central-1",r.EuWest1="eu-west-1",r.EuWest2="eu-west-2",r.EuWest3="eu-west-3",r.SaEast1="sa-east-1",r.UsEast1="us-east-1",r.UsWest1="us-west-1",r.UsWest2="us-west-2"})(ql||(ql={}));class Tv{constructor(t,{headers:s={},customFetch:a,region:l=ql.Any}={}){this.url=t,this.headers=s,this.region=l,this.fetch=jv(a)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return Ev(this,arguments,void 0,function*(s,a={}){var l;let u,c;try{const{headers:p,method:m,body:g,signal:w,timeout:y}=a;let _={},{region:E}=a;E||(E=this.region);const j=new URL(`${this.url}/${s}`);E&&E!=="any"&&(_["x-region"]=E,j.searchParams.set("forceFunctionRegion",E));let O;g&&(p&&!Object.prototype.hasOwnProperty.call(p,"Content-Type")||!p)?typeof Blob<"u"&&g instanceof Blob||g instanceof ArrayBuffer?(_["Content-Type"]="application/octet-stream",O=g):typeof g=="string"?(_["Content-Type"]="text/plain",O=g):typeof FormData<"u"&&g instanceof FormData?O=g:(_["Content-Type"]="application/json",O=JSON.stringify(g)):g&&typeof g!="string"&&!(typeof Blob<"u"&&g instanceof Blob)&&!(g instanceof ArrayBuffer)&&!(typeof FormData<"u"&&g instanceof FormData)?O=JSON.stringify(g):O=g;let N=w;y&&(c=new AbortController,u=setTimeout(()=>c.abort(),y),w?(N=c.signal,w.addEventListener("abort",()=>c.abort())):N=c.signal);const D=yield this.fetch(j.toString(),{method:m||"POST",headers:Object.assign(Object.assign(Object.assign({},_),this.headers),p),body:O,signal:N}).catch(ue=>{throw new Cv(ue)}),M=D.headers.get("x-relay-error");
8if(M&&M==="true")throw new Th(D);if(!D.ok)throw new Ph(D);let U=((l=D.headers.get("Content-Type"))!==null&&l!==void 0?l:"text/plain").split(";")[0].trim(),q;return U==="application/json"?q=yield D.json():U==="application/octet-stream"||U==="application/pdf"?q=yield D.blob():U==="text/event-stream"?q=D:U==="multipart/form-data"?q=yield D.formData():q=yield D.text(),{data:q,error:null,response:D}}catch(p){return{data:null,error:p,response:p instanceof Ph||p instanceof Th?p.context:void 0}}finally{u&&clearTimeout(u)}})}}const Mf=3,Nh=r=>Math.min(1e3*2**r,3e4),Pv=[520,503],Bf=["GET","HEAD","OPTIONS"];var Nv=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Rh(r,t){return new Promise(s=>{if(t?.aborted){s();return}const a=setTimeout(()=>{t?.removeEventListener("abort",l),s()},r);function l(){clearTimeout(a),s()}t?.addEventListener("abort",l)})}function Rv(r,t,s,a){return!(!a||s>=Mf||!Bf.includes(r)||!Pv.includes(t))}var Ov=class{constructor(r){var t,s,a,l,u;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=r.method,this.url=r.url,this.headers=new Headers(r.headers),this.schema=r.schema,this.body=r.body,this.shouldThrowOnError=(t=r.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=r.signal,this.isMaybeSingle=(s=r.isMaybeSingle)!==null&&s!==void 0?s:!1,this.shouldStripNulls=(a=r.shouldStripNulls)!==null&&a!==void 0?a:!1,this.urlLengthLimit=(l=r.urlLengthLimit)!==null&&l!==void 0?l:8e3,this.retryEnabled=(u
8=r.retry)!==null&&u!==void 0?u:!0,r.fetch?this.fetch=r.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(r,t){return this.headers=new Headers(this.headers),this.headers.set(r,t),this}retry(r){return this.retryEnabled=r,this}then(r,t){var s=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const c=this.headers.get("Accept");c==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!c||c==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const a=this.fetch;let u=(async()=>{let c=0;for(;;){const g=new Headers(s.headers);c>0&&g.set("X-Retry-Count",String(c));let w;try{w=await a(s.url.toString(),{method:s.method,headers:g,body:JSON.stringify(s.body,(y,_)=>typeof _=="bigint"?_.toString():_),signal:s.signal})}catch(y){if(y?.name==="AbortError"||y?.code==="ABORT_ERR"||!Bf.includes(s.method))throw y;if(s.retryEnabled&&c<Mf){const _=Nh(c);c++,await Rh(_,s.signal);continue}throw y}if(Rv(s.method,w.status,c,s.retryEnabled)){var p,m;const y=(p=(m=w.headers)===null||m===void 0?void 0:m.get("Retry-After"))!==null&&p!==void 0?p:null,_=y!==null?Math.max(0,parseInt(y,10)||0)*1e3:Nh(c);await w.text(),c++,await Rh(_,s.signal);continue}return await s.processResponse(w)}})();return this.shouldThrowOnError||(u=u.catch(c=>{var p;let m="",g="",w="";const y=c?.cause;if(y){var _,E,j,O;const M=(_=y?.message)!==null&&_!==void 0?_:"",U=(E=y?.code)!==null&&E!==void 0?E:"";m=`${(j=c?.name)!==null&&j!==void 0?j:"FetchError"}: ${c?.message}`,m+=` 9 10Caused by: ${(O=y?.name)!==null&&O!==void 0?O:"Error"}: ${M}`,U&&(m+=` (${U})`),y?.stack&&(m+=` 11${y.stack}`)}else{var N;m=(N=c?.stack)!==null&&N!==void 0?N:""}const D=this.url.toString().length;return c?.name==="AbortError"||c?.code==="ABORT_ERR"?(w="",g="Request was aborted (timeout or manual cancellation)",D>this.urlLengthLimit&&(g+=`. Note: Your request URL is ${D} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(y?.name==="HeadersOverflowError"||y?.code==="UND_ERR_HEADERS_OVERFLOW")&&(w="",g="HTTP headers exceeded server limits (typically 16KB)",D>this.urlLengthLimit&&(g+=`. Your request URL is ${D} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(p=c?.name)!==null&&p!==void 0?p:"FetchError"}: ${c?.message}`,details:m,hint:g,code:w},data:null,count:null,status:0,statusText:""}})),u.then(r,t)}async processResponse(r){var t=this;let s=null,a=null,l=null,u=r.status,c=r.statusText;if(r.ok){var p,m;if(t.method!=="HEAD"){var g;const _=await r.text();_===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((g=t.headers.get("Accept"))===null||g===void 0)&&g.includes("application/vnd.pgrst.plan+text"))?a=_:a=JSON.parse(_))}const w=(p=t.headers.get("Prefer"))===null||p===void 0?void 0:p.match(/count=(exact|planned|estimated)/),y=(m=r.headers.get("content-range"))===null||m===void 0?void 0:m.split("/");w&&y&&y.length>1&&(l=parseInt(y[1])),t.isMaybeSingle&&Array.isArray(a)&&(a.length>1?(s={code:"PGRST116",details:`Results contain ${a.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},a=null,l=null,u=406,c="Not Acceptable"):a.length===1?a=a[0]:a=null)}else{const w=await r.text();try{s=JSON.parse(w),Array.isArray(s)&&r.status===404&&(a=[],s=null,u=200,c="OK")}catch{r.status===404&&w===""?(u=204,c="No Content"):s={message:w}}if(s&&t.shouldThrowOnError)throw new Nv(s)}return{success:s===null,error:s,data:a,count:l,status:u,statusText:c}}returns(){return this}overrideTypes(){return this}},Av=class extends Ov{select(r){let t=!1;const s=(r??"*").split("").map(a=>/\s/.test(a)&&!t?"":(a==='"'&&(t=!t),a)).join("");return this.url.searchParams.set("select",s),this.headers.append("Prefer","return=representation"),this}order(r,{ascending:t=!0,nullsFirst:s,foreignTable:a,referencedTable:l=a}={}){const u=l?`${l}.order`:"order",c=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${c?`${c},`:""}${r}.${t?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(r,{foreignTable:t,referencedTable:s=t}={}){const a=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(a,`${r}`),this}range(r,t,{foreignTable:s,referencedTable:a=s}={}){const l=typeof a>"u"?"offset":`${a}.offset`,u=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(l,`${r}`),this.url.searchParams.set(u,`${t-r+1}`),this}abortSignal(r){return this.signal=r,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
11explain({analyze:r=!1,verbose:t=!1,settings:s=!1,buffers:a=!1,wal:l=!1,format:u="text"}={}){var c;const p=[r?"analyze":null,t?"verbose":null,s?"settings":null,a?"buffers":null,l?"wal":null].filter(Boolean).join("|"),m=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${m}"; options=${p};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(r){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${r}`),this}};const Oh=new RegExp("[,()]");var Tr=class extends Av{eq(r,t){return this.url.searchParams.append(r,`eq.${t}`),this}neq(r,t){return this.url.searchParams.append(r,`neq.${t}`),this}gt(r,t){return this.url.searchParams.append(r,`gt.${t}`),this}gte(r,t){return this.url.searchParams.append(r,`gte.${t}`),this}lt(r,t){return this.url.searchParams.append(r,`lt.${t}`),this}lte(r,t){return this.url.searchParams.append(r,`lte.${t}`),this}like(r,t){return this.url.searchParams.append(r,`like.${t}`),this}likeAllOf(r,t){return this.url.searchParams.append(r,`like(all).{${t.join(",")}}`),this}likeAnyOf(r,t){return this.url.searchParams.append(r,`like(any).{${t.join(",")}}`),this}ilike(r,t){return this.url.searchParams.append(r,`ilike.${t}`),this}ilikeAllOf(r,t){return this.url.searchParams.append(r,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(r,t){return this.url.searchParams.append(r,`ilike(any).{${t.join(",")}}`),this}regexMatch(r,t){return this.url.searchParams.append(r,`match.${t}`),this}regexIMatch(r,t){return this.url.searchParams.append(r,`imatch.${t}`),this}is(r,t){return this.url.searchParams.append(r,`is.${t}`),this}isDistinct(r,t){return this.url.searchParams.append(r,`isdistinct.${t}`),this}in(r,t){const s=Array.from(new Set(t)).map(a=>typeof a=="string"&&Oh.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(r,`in.(${s})`),this}notIn(r,t){const s=Array.from(new Set(t)).map(a=>typeof a=="string"&&Oh.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(r,`not.in.(${s})`),this}contains(r,t){return typeof t=="string"?this.url.searchParams.append(r,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(r,`cs.{${t.join(",")}}`):this.url.searchParams.append(r,`cs.${JSON.stringify(t)}`),this}containedBy(r,t){return typeof t=="string"?this.url.searchParams.append(r,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(r,`cd.{${t.join(",")}}`):this.url.searchParams.append(r,`cd.${JSON.stringify(t)}`),this}rangeGt(r,t){return this.url.searchParams.append(r,`sr.${t}`),this}rangeGte(r,t){return this.url.searchParams.append(r,`nxl.${t}`),this}rangeLt(r,t){return this.url.searchParams.append(r,`sl.${t}`),this}rangeLte(r,t){return this.url.searchParams.append(r,`nxr.${t}`),this}rangeAdjacent(r,t){return this.url.searchParams.append(r,`adj.${t}`),this}overlaps(r,t){return typeof t=="string"?this.url.searchParams.append(r,`ov.${t}`):this.url.searchParams.append(r,`ov.{${t.join(",")}}`),this}textSearch(r,t,{config:s,type:a}={}){let l="";a==="plain"?l="pl":a==="phrase"?l="ph":a==="websearch"&&(l="w");const u=s===void 0?"":`(${s})`;return this.url.searchParams.append(r,`${l}fts${u}.${t}`),this}match(r){return Object.entries(r).filter(([t,s])=>s!==void 0).forEach(([t,s])=>{this.url.searchParams.append(t,`eq.${s}`)}),this}not(r,t,s){return this.url.searchParams.append(r,`not.${t}.${s}`),this}or(r,{foreignTable:t,referencedTable:s=t}={}){const a=s?`${s}.or`:"or";return this.url.searchParams.append(a,`(${r})`),this}filter(r,t,s){return this.url.searchParams.append(r,`${t}.${s}`),this}},Lv=class{constructor(r,{headers:t={},schema:s,fetch:a,urlLengthLimit:l=8e3,retry:u}){this.url=r,this.headers=new Headers(t),this.schema=s,this.fetch=a,this.urlLengthLimit=l,this.retry=u}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(r,t){const{head:s=!1,count:a}=t??{},l=s?"HEAD":"GET";let u=!1;const c=(r??"*").split("").map(g=>/\s/.test(g)&&!u?"":(g==='"'&&(u=!u),g)).join(""),{url:p,headers:m}=this.cloneRequestState();return p.searchParams.set("select",c),a&&m.append("Prefer",`count=${a}`),new Tr({method:l,url:p,headers:m,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(r,{count:t,defaultToNull:s=!0}={}){var a;const l="POST",{url:u,headers:c}=this.cloneRequestState();if(t&&c.append("Prefer",`count=${t}`),s||c.append("Prefer","missing=default"),Array.isArray(r)){const p=r.reduce((m,g)=>m.concat(Object.keys(g)),[]);if(p.length>0){const m=[...new Set(p)].map(g=>`"${g}"`);u.searchParams.set("columns",m.join(","))}}return new Tr({method:l,url:u,headers:c,schema:this.schema,body:r,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(r,{onConflict:t,ignoreDuplicates:s=!1,count:a,defaultToNull:l=!0}={}){var u;const c="POST",{url:p,headers:m}=this.cloneRequestState();if(m.append("Prefer",`resolution=${s?"ignore":"merge"}-duplicates`),t!==void 0&&p.searchParams.set("on_conflict",t),a&&m.append("Prefer",`count=${a}`),l||m.append("Prefer","missing=default"),Array.isArray(r)){const g=r.reduce((w,y)=>w.concat(Object.keys(y)),[]);if(g.length>0){const w=[...new Set(g)].map(y=>`"${y}"`);p.searchParams.set("columns",w.join(","))}}return new Tr({method:c,url:p,headers:m,schema:this.schema,body:r,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(r,{count:t}={}){var s;const a="PATCH",{url:l,headers:u}=this.cloneRequestState();return t&&u.append("Prefer",`count=${t}`),new Tr({method:a,url:l,headers:u,schema:this.schema,body:r,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:r}={}){var t;const s="DELETE",{url:a,headers:l}=this.cloneRequestState();return r&&l.append("Prefer",`count=${r}`),new Tr({method:s,url:a,headers:l,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Ms(r){"@babel/helpers - typeof";return Ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ms(r)}function Iv(r,t){if(Ms(r)!="object"||!r)return r;var s=r[Symbol.toPrimitive];if(s!==void 0){var a=s.call(r,t);if(Ms(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function Uv(r){var t=Iv(r,"string");return Ms(t)=="symbol"?t:t+""}function $v(r,t,s){return(t=Uv(t))in r?Object.defineProperty(r,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[t]=s,r}function Ah(r,t){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),s.push.apply(s,a)}return s}function sa(r){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};
11t%2?Ah(Object(s),!0).forEach(function(a){$v(r,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(s)):Ah(Object(s)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(s,a))})}return r}var Dv=class Ff{constructor(t,{headers:s={},schema:a,fetch:l,timeout:u,urlLengthLimit:c=8e3,retry:p}={}){this.url=t,this.headers=new Headers(s),this.schemaName=a,this.urlLengthLimit=c;const m=l??globalThis.fetch;u!==void 0&&u>0?this.fetch=(g,w)=>{const y=new AbortController,_=setTimeout(()=>y.abort(),u),E=w?.signal;if(E){if(E.aborted)return clearTimeout(_),m(g,w);const j=()=>{clearTimeout(_),y.abort()};return E.addEventListener("abort",j,{once:!0}),m(g,sa(sa({},w),{},{signal:y.signal})).finally(()=>{clearTimeout(_),E.removeEventListener("abort",j)})}return m(g,sa(sa({},w),{},{signal:y.signal})).finally(()=>clearTimeout(_))}:this.fetch=m,this.retry=p}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new Lv(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new Ff(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,s={},{head:a=!1,get:l=!1,count:u}={}){var c;let p;const m=new URL(`${this.url}/rpc/${t}`);let g;const w=E=>E!==null&&typeof E=="object"&&(!Array.isArray(E)||E.some(w)),y=a&&Object.values(s).some(w);y?(p="POST",g=s):a||l?(p=a?"HEAD":"GET",Object.entries(s).filter(([E,j])=>j!==void 0).map(([E,j])=>[E,Array.isArray(j)?`{${j.join(",")}}`:`${j}`]).forEach(([E,j])=>{m.searchParams.append(E,j)})):(p="POST",g=s);const _=new Headers(this.headers);return y?_.set("Prefer",u?`count=${u},return=minimal`:"return=minimal"):u&&_.set("Prefer",`count=${u}`),new Tr({method:p,url:m,headers:_,schema:this.schemaName,body:g,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class Mv{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const s=globalThis;if(typeof globalThis<"u"&&typeof s.WebSocket<"u")return{type:"native",wsConstructor:s.WebSocket};const a=typeof global<"u"?global:void 0;if(a&&typeof a.WebSocket<"u")return{type:"native",wsConstructor:a.WebSocket};if(typeof globalThis<"u"&&typeof s.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"&&s.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const l=globalThis.process;if(l){const u=l.versions;if(u&&u.node){const c=u.node,p=parseInt(c.replace(/^v/,"").split(".")[0]);return p>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${p} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${p} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 12import ws from "ws" 13new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let s=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(s+=` 14 15Suggested solution: ${t.workaround}`),new Error(s)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const Bv="2.106.1",Fv=`realtime-js/${Bv}`,zv="1.0.0",zf="2.0.0",Hv=zf,Wv=1e4,Vv=100,jn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Hf={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Kl={connecting:"connecting",closing:"closing",closed:"closed"};class qv{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,s){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return s(this._binaryEncodeUserBroadcastPush(t));let a=[t.join_ref,t.ref,t.topic,t.event,t.payload];return s(JSON.stringify(a))}_binaryEncodeUserBroadcastPush(t){var s;return this._isArrayBuffer((s=t.payload)===null||s===void 0?void 0:s.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var s,a;const l=(a=(s=t.payload)===null||s===void 0?void 0:s.payload)!==null&&a!==void 0?a:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,l)}_encodeJsonUserBroadcastPush(t){var s,a;const l=(a=(s=t.payload)===null||s===void 0?void 0:s.payload)!==null&&a!==void 0?a:{},c=new TextEncoder().encode(JSON.stringify(l)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,c)}_encodeUserBroadcastPush(t,s,a){var l,u;const c=t.topic,p=(l=t.ref)!==null&&l!==void 0?l:"",m=(u=t.join_ref)!==null&&u!==void 0?u:"",g=t.payload.event,w=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},y=Object.keys(w).length===0?"":JSON.stringify(w);if(m.length>255)throw new Error(`joinRef length ${m.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`ref length ${p.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`topic length ${c.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`userEvent length ${g.length} exceeds maximum of 255`);if(y.length>255)throw new Error(`metadata length ${y.length} exceeds maximum of 255`);const _=this.USER_BROADCAST_PUSH_META_LENGTH+m.length+p.length+c.length+g.length+y.length,E=new ArrayBuffer(this.HEADER_LENGTH+_);let j=new DataView(E),O=0;j.setUint8(O++,this.KINDS.userBroadcastPush),j.setUint8(O++,m.length),j.setUint8(O++,p.length),j.setUint8(O++,c.length),j.setUint8(O++,g.length),j.setUint8(O++,y.length),j.setUint8(O++,s),Array.from(m,D=>j.setUint8(O++,D.charCodeAt(0))),Array.from(p,D=>j.setUint8(O++,D.charCodeAt(0))),Array.from(c,D=>j.setUint8(O++,D.charCodeAt(0))),Array.from(g,D=>j.setUint8(O++,D.charCodeAt(0))),Array.from(y,D=>j.setUint8(O++,D.charCodeAt(0)));var N=new Uint8Array(E.byteLength+a.byteLength);return N.set(new Uint8Array(E),0),N.set(new Uint8Array(a),E.byteLength),N.buffer}decode(t,s){if(this._isArrayBuffer(t)){let a=this._binaryDecode(t);return s(a)}if(typeof t=="string"){const a=JSON.parse(t),[l,u,c,p,m]=a;
15return s({join_ref:l,ref:u,topic:c,event:p,payload:m})}return s({})}_binaryDecode(t){const s=new DataView(t),a=s.getUint8(0),l=new TextDecoder;if(a===this.KINDS.userBroadcast)return this._decodeUserBroadcast(t,s,l)}_decodeUserBroadcast(t,s,a){const l=s.getUint8(1),u=s.getUint8(2),c=s.getUint8(3),p=s.getUint8(4);let m=this.HEADER_LENGTH+4;const g=a.decode(t.slice(m,m+l));m=m+l;const w=a.decode(t.slice(m,m+u));m=m+u;const y=a.decode(t.slice(m,m+c));m=m+c;const _=t.slice(m,t.byteLength),E=p===this.JSON_ENCODING?JSON.parse(a.decode(_)):_,j={type:this.BROADCAST_EVENT,event:w,payload:E};return c>0&&(j.meta=JSON.parse(y)),{join_ref:null,ref:null,topic:g,event:this.BROADCAST_EVENT,payload:j}}_isArrayBuffer(t){var s;return t instanceof ArrayBuffer||((s=t?.constructor)===null||s===void 0?void 0:s.name)==="ArrayBuffer"}_pick(t,s){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([a])=>s.includes(a)))}}var ke;(function(r){r.abstime="abstime",r.bool="bool",r.date="date",r.daterange="daterange",r.float4="float4",r.float8="float8",r.int2="int2",r.int4="int4",r.int4range="int4range",r.int8="int8",r.int8range="int8range",r.json="json",r.jsonb="jsonb",r.money="money",r.numeric="numeric",r.oid="oid",r.reltime="reltime",r.text="text",r.time="time",r.timestamp="timestamp",r.timestamptz="timestamptz",r.timetz="timetz",r.tsrange="tsrange",r.tstzrange="tstzrange"})(ke||(ke={}));const Lh=(r,t,s={})=>{var a;const l=(a=s.skipTypes)!==null&&a!==void 0?a:[];return t?Object.keys(t).reduce((u,c)=>(u[c]=Kv(c,r,t,l),u),{}):{}},Kv=(r,t,s,a)=>{const l=t.find(p=>p.name===r),u=l?.type,c=s[r];return u&&!a.includes(u)?Wf(u,c):Gl(c)},Wf=(r,t)=>{if(r.charAt(0)==="_"){const s=r.slice(1,r.length);return Qv(t,s)}switch(r){case ke.bool:return Gv(t);case ke.float4:case ke.float8:case ke.int2:case ke.int4:case ke.int8:case ke.numeric:case ke.oid:return Jv(t);case ke.json:case ke.jsonb:return Yv(t);case ke.timestamp:return Xv(t);case ke.abstime:case ke.date:case ke.daterange:case ke.int4range:case ke.int8range:case ke.money:case ke.reltime:case ke.text:case ke.time:case ke.timestamptz:case ke.timetz:case ke.tsrange:case ke.tstzrange:return Gl(t);default:return Gl(t)}},Gl=r=>r,Gv=r=>{switch(r){case"t":return!0;case"f":return!1;default:return r}},Jv=r=>{if(typeof r=="string"){const t=parseFloat(r);if(!Number.isNaN(t))return t}return r},Yv=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch{return r}return r},Qv=(r,t)=>{if(typeof r!="string")return r;const s=r.length-1,a=r[s];if(r[0]==="{"&&a==="}"){let u;const c=r.slice(1,s);try{u=JSON.parse("["+c+"]")}catch{u=c?c.split(","):[]}return u.map(p=>Wf(t,p))}return r},Xv=r=>typeof r=="string"?r.replace(" ","T"):r,Vf=r=>{const t=new URL(r);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var Ls=r=>typeof r=="function"?r:function(){return r},Zv=typeof self<"u"?self:null,Pr=typeof window<"u"?window:null,zt=Zv||Pr||globalThis,ey="2.0.0",ty=1e4,ny=1e3,Ht={connecting:0,open:1,closing:2,closed:3},dt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Zt={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Jl={longpoll:"longpoll",websocket:"websocket"},ry={complete:4},Yl="base64url.bearer.phx.",ia=class{constructor(r,t,s,a){this.channel=r,this.event=t,this.payload=s||function(){return{}},this.receivedResp=null,this.timeout=a,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(r){this.timeout=r,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(r,t){return this.hasReceived(r)&&t(this.receivedResp.response),this.recHooks.push({status:r,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}
vendor: 8,135 bytes, line 15
15matchReceive({status:r,response:t,_ref:s}){this.recHooks.filter(a=>a.status===r).forEach(a=>a.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,r=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=r,this.matchReceive(r)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(r){return this.receivedResp&&this.receivedResp.status===r}trigger(r,t){this.channel.trigger(this.refEvent,{status:r,response:t})}},qf=class{constructor(r,t){this.callback=r,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},sy=class{constructor(r,t,s){this.state=dt.closed,this.topic=r,this.params=Ls(t||{}),this.socket=s,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ia(this,Zt.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new qf(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=dt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this.joinPush.receive("error",a=>{this.state=dt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,a),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=dt.closed,this.socket.remove(this)}),this.onError(a=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,a),this.isJoining()&&this.joinPush.reset(),this.state=dt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new ia(this,Zt.leave,Ls({}),this.timeout).send(),this.state=dt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Zt.reply,(a,l)=>{this.trigger(this.replyEventName(l),a)})}join(r=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=r,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(r=>r.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=dt.closed,this.bindings=[]}onClose(r){this.on(Zt.close,r)}onError(r){return this.on(Zt.error,t=>r(t))}on(r,t){let s=this.bindingRef++;return this.bindings.push({event:r,ref:s,callback:t}),s}off(r,t){this.bindings=this.bindings.filter(s=>!(s.event===r&&(typeof t>"u"||t===s.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(r,t,s=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${r}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let a=new ia(this,r,function(){return t},s);return this.canPush()?a.send():(a.startTimeout(),this.pushBuffer.push(a)),a}leave(r=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=dt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Zt.close,"leave")},s=new ia(this,Zt.leave,Ls({}),r);return s.receive("ok",()=>t()).receive("timeout",()=>t()),s.send(),this.canPush()||s.trigger("ok",{}),s}onMessage(r,t,s){return t}filterBindings(r,t,s){return!0}isMember(r,t,s,a){return this.topic!==r?!1:a&&a!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:r,event:t,payload:s,joinRef:a}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(r=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=dt.joining,this.joinPush.resend(r))}trigger(r,t,s,a){let l=this.onMessage(r,t,s,a);if(t&&!l)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let u=this.bindings.filter(c=>c.event===r&&this.filterBindings(c,t,s));for(let c=0;c<u.length;c++)u[c].callback(l,s,a||this.joinRef())}replyEventName(r){return`chan_reply_${r}`}isClosed(){return this.state===dt.closed}isErrored(){return this.state===dt.errored}isJoined(){return this.state===dt.joined}isJoining(){return this.state===dt.joining}isLeaving(){return this.state===dt.leaving}},ya=class{static request(r,t,s,a,l,u,c){if(zt.XDomainRequest){let p=new zt.XDomainRequest;return this.xdomainRequest(p,r,t,a,l,u,c)}else if(zt.XMLHttpRequest){let p=new zt.XMLHttpRequest;return this.xhrRequest(p,r,t,s,a,l,u,c)}else{if(zt.fetch&&zt.AbortController)return this.fetchRequest(r,t,s,a,l,u,c);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(r,t,s,a,l,u,c){let p={method:r,headers:s,body:a},m=null;return l&&(m=new AbortController,setTimeout(()=>m.abort(),l),p.signal=m.signal),zt.fetch(t,p).then(g=>g.text()).then(g=>this.parseJSON(g)).then(g=>c&&c(g)).catch(g=>{g.name==="AbortError"&&u?u():c&&c(null)}),m}static xdomainRequest(r,t,s,a,l,u,c){return r.timeout=l,r.open(t,s),r.onload=()=>{let p=this.parseJSON(r.responseText);c&&c(p)},u&&(r.ontimeout=u),r.onprogress=()=>{},r.send(a),r}static xhrRequest(r,t,s,a,l,u,c,p){r.open(t,s,!0),r.timeout=u;for(let[m,g]of Object.entries(a))r.setRequestHeader(m,g);return r.onerror=()=>p&&p(null),r.onreadystatechange=()=>{if(r.readyState===ry.complete&&p){let m=this.parseJSON(r.responseText);p(m)}},c&&(r.ontimeout=c),r.send(l),r}static parseJSON(r){if(!r||r==="")return null;try{return JSON.parse(r)}catch{return console&&console.log("failed to parse JSON response",r),null}}static serialize(r,t){let s=[];for(var a in r){if(!Object.prototype.hasOwnProperty.call(r,a))continue;let l=t?`${t}[${a}]`:a,u=r[a];typeof u=="object"?s.push(this.serialize(u,l)):s.push(encodeURIComponent(l)+"="+encodeURIComponent(u))}return s.join("&")}static appendParams(r,t){if(Object.keys(t).length===0)return r;let s=r.match(/\?/)?"&":"?";return`${r}${s}${this.serialize(t)}`}},iy=r=>{let t="",s=new Uint8Array(r),a=s.byteLength;for(let l=0;l<a;l++)t+=String.fromCharCode(s[l]);return btoa(t)},_r=class{constructor(r,t){t&&t.length===2&&t[1].startsWith(Yl)&&(this.authToken=atob(t[1].slice(Yl.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(r),this.readyState=Ht.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(r){return r.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Jl.websocket),"$1/"+Jl.longpoll)}endpointURL(){return ya.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(r,t,s){this.close(r,t,s),this.readyState=Ht.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Ht.open||this.readyState===Ht.connecting}poll(){const r={Accept:"application/json"};this.authToken&&(r["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",r,null,()=>this.ontimeout(),t=>{if(t){var{status:s,token:a,messages:l}=t;if(s===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=a}else s=0;switch(s){case 200:l.forEach(u=>{setTimeout(()=>this.onmessage({data:u}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Ht.open,this.onopen({}),this.poll();break;
15case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${s}`)}})}send(r){typeof r!="string"&&(r=iy(r)),this.currentBatch?this.currentBatch.push(r):this.awaitingBatchAck?this.batchBuffer.push(r):(this.currentBatch=[r],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(r){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},r.join(` 16`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(r,t,s){for(let l of this.reqs)l.abort();this.readyState=Ht.closed;let a=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:r,reason:t,wasClean:s});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",a)):this.onclose(a)}ajax(r,t,s,a,l){let u,c=()=>{this.reqs.delete(u),a()};u=ya.request(r,this.endpointURL(),t,s,this.timeout,c,p=>{this.reqs.delete(u),this.isActive()&&l(p)}),this.reqs.add(u)}},ay=class Rs{constructor(t,s={}){let a=s.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(a.state,l=>{let{onJoin:u,onLeave:c,onSync:p}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Rs.syncState(this.state,l,u,c),this.pendingDiffs.forEach(m=>{this.state=Rs.syncDiff(this.state,m,u,c)}),this.pendingDiffs=[],p()}),this.channel.on(a.diff,l=>{let{onJoin:u,onLeave:c,onSync:p}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(l):(this.state=Rs.syncDiff(this.state,l,u,c),p())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Rs.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,s,a,l){let u=this.clone(t),c={},p={};return this.map(u,(m,g)=>{s[m]||(p[m]=g)}),this.map(s,(m,g)=>{let w=u[m];if(w){let y=g.metas.map(O=>O.phx_ref),_=w.metas.map(O=>O.phx_ref),E=g.metas.filter(O=>_.indexOf(O.phx_ref)<0),j=w.metas.filter(O=>y.indexOf(O.phx_ref)<0);E.length>0&&(c[m]=g,c[m].metas=E),j.length>0&&(p[m]=this.clone(w),p[m].metas=j)}else c[m]=g}),this.syncDiff(u,{joins:c,leaves:p},a,l)}static syncDiff(t,s,a,l){let{joins:u,leaves:c}=this.clone(s);return a||(a=function(){}),l||(l=function(){}),this.map(u,(p,m)=>{let g=t[p];if(t[p]=this.clone(m),g){let w=t[p].metas.map(_=>_.phx_ref),y=g.metas.filter(_=>w.indexOf(_.phx_ref)<0);t[p].metas.unshift(...y)}a(p,g,m)}),this.map(c,(p,m)=>{let g=t[p];if(!g)return;let w=m.metas.map(y=>y.phx_ref);g.metas=g.metas.filter(y=>w.indexOf(y.phx_ref)<0),l(p,g,m),g.metas.length===0&&delete t[p]}),t}static list(t,s){return s||(s=function(a,l){return l}),this.map(t,(a,l)=>s(a,l))}static map(t,s){return Object.getOwnPropertyNames(t).map(a=>s(a,t[a]))}static clone(t){return JSON.parse(JSON.stringify(t))}},aa={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(r,t){if(r.payload.constructor===ArrayBuffer)return t(this.binaryEncode(r));{let s=[r.join_ref,r.ref,r.topic,r.event,r.payload];return t(JSON.stringify(s))}},decode(r,t){if(r.constructor===ArrayBuffer)return t(this.binaryDecode(r));{let[s,a,l,u,c]=JSON.parse(r);return t({join_ref:s,ref:a,topic:l,event:u,payload:c})}},binaryEncode(r){let{join_ref:t,ref:s,event:a,topic:l,payload:u}=r,c=this.META_LENGTH+t.length+s.length+l.length+a.length,p=new ArrayBuffer(this.HEADER_LENGTH+c),m=new DataView(p),g=0;m.setUint8(g++,this.KINDS.push),m.setUint8(g++,t.length),m.setUint8(g++,s.length),m.setUint8(g++,l.length),m.setUint8(g++,a.length),Array.from(t,y=>m.setUint8(g++,y.charCodeAt(0))),Array.from(s,y=>m.setUint8(g++,y.charCodeAt(0))),Array.from(l,y=>
16m.setUint8(g++,y.charCodeAt(0))),Array.from(a,y=>m.setUint8(g++,y.charCodeAt(0)));var w=new Uint8Array(p.byteLength+u.byteLength);return w.set(new Uint8Array(p),0),w.set(new Uint8Array(u),p.byteLength),w.buffer},binaryDecode(r){let t=new DataView(r),s=t.getUint8(0),a=new TextDecoder;switch(s){case this.KINDS.push:return this.decodePush(r,t,a);case this.KINDS.reply:return this.decodeReply(r,t,a);case this.KINDS.broadcast:return this.decodeBroadcast(r,t,a)}},decodePush(r,t,s){let a=t.getUint8(1),l=t.getUint8(2),u=t.getUint8(3),c=this.HEADER_LENGTH+this.META_LENGTH-1,p=s.decode(r.slice(c,c+a));c=c+a;let m=s.decode(r.slice(c,c+l));c=c+l;let g=s.decode(r.slice(c,c+u));c=c+u;let w=r.slice(c,r.byteLength);return{join_ref:p,ref:null,topic:m,event:g,payload:w}},decodeReply(r,t,s){let a=t.getUint8(1),l=t.getUint8(2),u=t.getUint8(3),c=t.getUint8(4),p=this.HEADER_LENGTH+this.META_LENGTH,m=s.decode(r.slice(p,p+a));p=p+a;let g=s.decode(r.slice(p,p+l));p=p+l;let w=s.decode(r.slice(p,p+u));p=p+u;let y=s.decode(r.slice(p,p+c));p=p+c;let _=r.slice(p,r.byteLength),E={status:y,response:_};return{join_ref:m,ref:g,topic:w,event:Zt.reply,payload:E}},decodeBroadcast(r,t,s){let a=t.getUint8(1),l=t.getUint8(2),u=this.HEADER_LENGTH+2,c=s.decode(r.slice(u,u+a));u=u+a;let p=s.decode(r.slice(u,u+l));u=u+l;let m=r.slice(u,r.byteLength);return{join_ref:null,ref:null,topic:c,event:p,payload:m}}},oy=class{constructor(r,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||ty,this.transport=t.transport||zt.WebSocket||_r,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let s=null;try{s=zt&&zt.sessionStorage}catch{}this.sessionStore=t.sessionStorage||s,this.establishedConnections=0,this.defaultEncoder=aa.encode.bind(aa),this.defaultDecoder=aa.decode.bind(aa),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==_r?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let a=null;Pr&&Pr.addEventListener&&(Pr.addEventListener("pagehide",l=>{this.conn&&(this.disconnect(),a=this.connectClock)}),Pr.addEventListener("pageshow",l=>{a===this.connectClock&&(a=null,this.connect())}),Pr.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=l=>t.rejoinAfterMs?t.rejoinAfterMs(l):[1e3,2e3,5e3][l-1]||1e4,this.reconnectAfterMs=l=>t.reconnectAfterMs?t.reconnectAfterMs(l):[10,50,100,150,200,250,500,1e3,2e3][l-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(l,u,c)=>{console.log(`${l}: ${u}`,c)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Ls(t.params||{}),this.endPoint=`${r}/${Jl.websocket}`,this.vsn=t.vsn||ey,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new qf(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return _r}replaceTransport(r){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=r}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let r=ya.appendParams(ya.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return r.charAt(0)!=="/"?r:r.charAt(1)==="/"?`${this.protocol()}:${r}`:`${this.protocol()}://${location.host}${r}`}disconnect(r,t,s){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,r&&r()},t,s)}connect(r){r&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Ls(r)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==_r?this.connectWithF
vendor: 4,353 bytes, line 16
16allback(_r,this.longPollFallbackMs):this.transportConnect())}log(r,t,s){this.logger&&this.logger(r,t,s)}hasLogger(){return this.logger!==null}onOpen(r){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,r]),t}onClose(r){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,r]),t}onError(r){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,r]),t}onMessage(r){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,r]),t}onHeartbeat(r){this.heartbeatCallback=r}ping(r){if(!this.isConnected())return!1;let t=this.makeRef(),s=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let a=this.onMessage(l=>{l.ref===t&&(this.off([a]),r(Date.now()-s))});return!0}transportName(r){return r===_r?"LongPoll":r.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let r;this.authToken&&(r=["phoenix",`${Yl}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),r),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(r){return this.sessionStore&&this.sessionStore.getItem(r)}storeSession(r,t){this.sessionStore&&this.sessionStore.setItem(r,t)}connectWithFallback(r,t=2500){clearTimeout(this.fallbackTimer);let s=!1,a=!0,l,u,c=this.transportName(r),p=m=>{this.log("transport",`falling back to ${c}...`,m),this.off([l,u]),a=!1,this.replaceTransport(r),this.transportConnect()};if(this.getSession(`phx:fallback:${c}`))return p("memorized");this.fallbackTimer=setTimeout(p,t),u=this.onError(m=>{this.log("transport","error",m),a&&!s&&(clearTimeout(this.fallbackTimer),p(m))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(s=!0,!a){let m=this.transportName(r);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${m}`,"true"),this.log("transport",`established ${m} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(p,t),this.ping(m=>{this.log("transport","connected to primary after",m),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),ny,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(r,t,s){if(!this.conn)return r&&r();const a=this.conn;this.waitForBufferDone(a,()=>{t?a.close(t,s||""):a.close(),this.waitForSocketClosed(a,()=>{this.conn===a&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),r&&r()})})}waitForBufferDone(r,t,s=1){if(s===5||!r.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(r,t,s+1)},150*s)}waitForSocketClosed(r,t,s=1){if(s===5||r.readyState===Ht.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(r,t,s+1)},150*s)}onConnClose(r){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",r),this.triggerChanError(r),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",r)}onConnError(r){this.hasLogger()&&this.log("transport","error",r);let t=this.transport,s=this.establishedConnections;this.triggerStateCallbacks("error",r,t,s),(t===this.transport||s>0)&&this.triggerChanError(r)}
16triggerChanError(r){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Zt.error,r)})}connectionState(){switch(this.conn&&this.conn.readyState){case Ht.connecting:return"connecting";case Ht.open:return"open";case Ht.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(r){this.off(r.stateChangeRefs),this.channels=this.channels.filter(t=>t!==r)}off(r){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([s])=>r.indexOf(s)===-1)}channel(r,t={}){let s=new sy(r,t,this);return this.channels.push(s),s}push(r){if(this.hasLogger()){let{topic:t,event:s,payload:a,ref:l,join_ref:u}=r;this.log("push",`${t} ${s} (${u}, ${l})`,a)}this.isConnected()?this.encode(r,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(r,t=>this.conn.send(t)))}makeRef(){let r=this.ref+1;return r===this.ref?this.ref=0:this.ref=r,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(r=>r()),this.sendBuffer=[])}onConnMessage(r){this.decode(r.data,t=>{let{topic:s,event:a,payload:l,ref:u,join_ref:c}=t;if(u&&u===this.pendingHeartbeatRef){const p=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(l.status==="ok"?"ok":"error",p)}catch(m){this.log("error","error in heartbeat callback",m)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${l.status||""} ${s} ${a} ${u&&"("+u+")"||""}`.trim(),l);for(let p=0;p<this.channels.length;p++){const m=this.channels[p];m.isMember(s,a,l,c)&&m.trigger(a,l,u,c)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(r,...t){try{this.stateChangeCallbacks[r].forEach(([s,a])=>{try{a(...t)}catch(l){this.log("error",`error in ${r} callback`,l)}})}catch(s){this.log("error",`error triggering ${r} callbacks`,s)}}leaveOpenTopic(r){let t=this.channels.find(s=>s.topic===r&&(s.isJoined()||s.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${r}"`),t.leave())}};class Is{constructor(t,s){const a=uy(s);this.presence=new ay(t.getChannel(),a),this.presence.onJoin((l,u,c)=>{const p=Is.onJoinPayload(l,u,c);t.getChannel().trigger("presence",p)}),this.presence.onLeave((l,u,c)=>{const p=Is.onLeavePayload(l,u,c);t.getChannel().trigger("presence",p)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return Is.transformState(this.presence.state)}static transformState(t){return t=ly(t),Object.getOwnPropertyNames(t).reduce((s,a)=>{const l=t[a];return s[a]=pa(l),s},{})}static onJoinPayload(t,s,a){const l=Ih(s),u=pa(a);return{event:"join",key:t,currentPresences:l,newPresences:u}}static onLeavePayload(t,s,a){const l=Ih(s),u=pa(a);return{event:"leave",key:t,currentPresences:l,leftPresences:u}}}function pa(r){return r.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function ly(r){return JSON.parse(JSON.stringify(r))}function uy(r){return r?.events&&{events:r.events}}function Ih(r){return r?.metas?pa(r):[]}var Uh;(function(r){r.SYNC="sync",r.JOIN="join",r.LEAVE="leave"})(Uh||(Uh={}));class cy{get state(){return this.presenceAdapter.state}constructor(t,s){this.channel=t,this.presenceAdapter=new Is(this.channel.channelAdapter,s)}}function dy(r){if(r instanceof Error)return r;if(typeof r=="string")return new Error(r);if(r&&typeof r=="object"){const t=r;
16if(typeof t.code=="number"){const s=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${s}`,{cause:r})}return new Error("channel error: transport failure",{cause:r})}return new Error("channel error: connection lost")}class hy{constructor(t,s,a){const l=fy(a);this.channel=t.getSocket().channel(s,l),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,s){return this.channel.on(t,s)}off(t,s){this.channel.off(t,s)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,s,a){let l;try{l=this.channel.push(t,s,a)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>Vv){const u=this.channel.pushBuffer.shift();u.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${u.event}`,u.payload())}return l}updateJoinPayload(t){const s=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},s),t)}canPush(){return this.socket.isConnected()&&this.state===jn.joined}isJoined(){return this.state===jn.joined}isJoining(){return this.state===jn.joining}isClosed(){return this.state===jn.closed}isLeaving(){return this.state===jn.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function fy(r){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config)}}var $h;(function(r){r.ALL="*",r.INSERT="INSERT",r.UPDATE="UPDATE",r.DELETE="DELETE"})($h||($h={}));var Or;(function(r){r.BROADCAST="broadcast",r.PRESENCE="presence",r.POSTGRES_CHANGES="postgres_changes",r.SYSTEM="system"})(Or||(Or={}));var en;(function(r){r.SUBSCRIBED="SUBSCRIBED",r.TIMED_OUT="TIMED_OUT",r.CLOSED="CLOSED",r.CHANNEL_ERROR="CHANNEL_ERROR"})(en||(en={}));class Us{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,s={config:{}},a){var l,u;if(this.topic=t,this.params=s,this.socket=a,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},s.config),this.channelAdapter=new hy(this.socket.socketAdapter,t,this.params),this.presence=new cy(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Vf(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((u=(l=this.params.config)===null||l===void 0?void 0:l.broadcast)===null||u===void 0)&&u.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,s=this.timeout){var a,l,u;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:c,presence:p,private:m}}=this.params,g=(l=(a=this.bindings.postgres_changes)===null||a===void 0?void 0:a.map(E=>E.filter))!==null&&l!==void 0?l:[],w=!!this.bindings[Or.PRESENCE]&&this.bindings[Or.PRESENCE].length>0||((u=this.params.config.presence)===null||u===void 0?void 0:u.enabled)===!0,y={},_={broadcast:c,presence:Object.assign(Object.assign({},p),{enabled:w}),postgres_changes:g,private:m};this.socket.accessTokenValue&&(y.access_token=this.socket.accessTokenValue),this._onError(E=>{t?.(en.CHANNEL_ERROR,dy(E))}),this._onClose(()=>t?.(en.CLOSED)),this.updateJoinPayload(Object.assign({config:_},y)),this._updateFilterMessage(),this.channelAdapter.subscribe(s).receive("ok",async({postgres_changes:E})=>{if(this.socket._isManualToken()||this.socket.setAuth(),E===void 0){t?.(en.SUBSCRIBED);return}this._updatePostgresBindings(E,t)}).receive("error",E=>{this.state=jn.errored;const j=Object.values(E).join(", ")||"error";t?.(en.CHANNEL_ERROR,new Error(j,{cause:E}))}).receive("timeout",()=>{t?.(en.TIMED_OUT)})}return this}_updatePostgresBindings(t,s){var a;const l=this.bindings.postgres_changes,u=(a=l?.length)!==null&&a!==void 0?a:0,c=[];for(let p=0;p<u;p++){const m=l[p],{filter:{event:g,schema:w,table:y,filter:_}}=m,E=t&&t[p];if(E&&E.event===g&&Us.isFilterValueEqual(E.schema,w)&&Us.isFilterValueEqual(E.table,y)&&Us.isFilterValueEqual(E.filter,_))c.push(Object.assign(Object.assign({},m),{id:E.id}));else{this.unsubscribe(),this.state=jn.errored,s?.(en.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=c,this.state!=jn.errored&&s&&s(en.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,s={}){return await this.send({type:"presence",event:"track",payload:t},s.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,s,a){const l=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),u=t===Or.PRESENCE||t===Or.POSTGRES_CHANGES;if(l&&u)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,s,a)}async httpSend(t,s,a={}){var l;if(s==null)return Promise.reject(new Error("Payload is required for httpSend()"));const u={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(u.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:u,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:s,private:this.private}]})},p=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(l=a.timeout)!==null&&l!==void 0?l:this.timeout);if(p.status===202)return{success:!0};let m=p.statusText;
16try{const g=await p.json();m=g.error||g.message||m}catch{}return Promise.reject(new Error(m))}async send(t,s={}){var a,l;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:u,payload:c}=t,p={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(p.Authorization=`Bearer ${this.socket.accessTokenValue}`);const m={method:"POST",headers:p,body:JSON.stringify({messages:[{topic:this.subTopic,event:u,payload:c,private:this.private}]})};try{const g=await this._fetchWithTimeout(this.broadcastEndpointURL,m,(a=s.timeout)!==null&&a!==void 0?a:this.timeout);return await((l=g.body)===null||l===void 0?void 0:l.cancel()),g.ok?"ok":"error"}catch(g){return g instanceof Error&&g.name==="AbortError"?"timed out":"error"}}else return new Promise(u=>{var c,p,m;const g=this.channelAdapter.push(t.type,t,s.timeout||this.timeout);t.type==="broadcast"&&!(!((m=(p=(c=this.params)===null||c===void 0?void 0:c.config)===null||p===void 0?void 0:p.broadcast)===null||m===void 0)&&m.ack)&&u("ok"),g.receive("ok",()=>u("ok")),g.receive("error",()=>u("error")),g.receive("timeout",()=>u("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(s=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>s("ok")).receive("timeout",()=>s("timed out")).receive("error",()=>s("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,s,a){const l=new AbortController,u=setTimeout(()=>l.abort(),a),c=await this.socket.fetch(t,Object.assign(Object.assign({},s),{signal:l.signal}));return clearTimeout(u),c}_on(t,s,a){const l=t.toLocaleLowerCase(),u=this.channelAdapter.on(t,a),c={type:l,filter:s,callback:a,ref:u};return this.bindings[l]?this.bindings[l].push(c):this.bindings[l]=[c],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,s,a)=>{var l,u,c,p,m,g,w;const y=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(y,a))return!1;const _=(l=this.bindings[y])===null||l===void 0?void 0:l.find(E=>E.ref===t.ref);if(!_)return!0;if(["broadcast","presence","postgres_changes"].includes(y))if("id"in _){const E=_.id,j=(u=_.filter)===null||u===void 0?void 0:u.event;return E&&((c=s.ids)===null||c===void 0?void 0:c.includes(E))&&(j==="*"||j?.toLocaleLowerCase()===((p=s.data)===null||p===void 0?void 0:p.type.toLocaleLowerCase()))}else{const E=(g=(m=_?.filter)===null||m===void 0?void 0:m.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return E==="*"||E===((w=s?.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return _.type.toLocaleLowerCase()===y})}_notThisChannelEvent(t,s){const{close:a,error:l,leave:u,join:c}=Hf;return s&&[a,l,u,c].includes(t)&&s!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,s,a)=>{if(typeof s=="object"&&"ids"in s){const l=s.data,{schema:u,table:c,commit_timestamp:p,type:m,errors:g}=l;return Object.assign(Object.assign({},{schema:u,table:c,commit_timestamp:p,eventType:m,new:{},old:{},errors:g}),this._getPayloadRecords(l))}return s})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const s in t.bindings)for(const a of t.bindings[s])this._on(a.type,a.filter,a.callback)}static isFilterValueEqual(t,s){return(t??void 0)===(s??void 0)}_getPayloadRecords(t){const s={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(s.new=Lh(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(s.old=Lh(t.columns,t.old_record)),s}}class py{constructor(t,s){this.socket=new oy(t,s)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,s,a,l=1e4){return new Promise(u=>{setTimeout(()=>u("timeout"),l),this.socket.disconnect(()=>{t(),u("ok")},s,a)})}push(t){this.socket.push(t)}log(t,s,a){this.socket.log(t,s,a)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Kl.connecting}isDisconnecting(){return this.socket.connectionState()==Kl.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Dh={HEARTBEAT_INTERVAL:25e3},my=[1e3,2e3,5e3,1e4],gy=1e4;function vy(){const r=new Map;return{get length(){return r.size},clear(){r.clear()},getItem(t){return r.has(t)?r.get(t):null},key(t){var s;return(s=Array.from(r.keys())[t])!==null&&s!==void 0?s:null},removeItem(t){r.delete(t)},setItem(t,s){r.set(t,String(s))}}}function yy(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return vy()}const wy=` 17 addEventListener("message", (e) => { 18 if (e.data.event === "start") { 19 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 20 } 21 });`;class xy{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,s){var a;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
21,this.ref=0,this.serializer=new qv,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=u=>u?(...c)=>u(...c):(...c)=>fetch(...c),!(!((a=s?.params)===null||a===void 0)&&a.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=s.params.apikey;const l=this._initializeOptions(s);this.socketAdapter=new py(t,l),this.httpEndpoint=Vf(t),this.fetch=this._resolveFetch(s?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const s=t.message;throw s.includes("Node.js")?new Error(`${s} 22 23To use Realtime in Node.js, you need to provide a WebSocket implementation: 24 25Option 1: Use Node.js 22+ which has native WebSocket support 26Option 2: Install and provide the "ws" package: 27 28 npm install ws 29 30 import ws from "ws" 31 const client = new RealtimeClient(url, { 32 ...options, 33 transport: ws 34 })`):new Error(`WebSocket not available: ${s}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,s){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,s)}getChannels(){return this.channels}async removeChannel(t){const s=await t.unsubscribe();return s==="ok"&&t.teardown(),s}async removeAllChannels(){const t=this.channels.map(async a=>{const l=await a.unsubscribe();return a.teardown(),l}),s=await Promise.all(t);return await this.disconnect(),s}log(t,s,a){this.socketAdapter.log(t,s,a)}connectionState(){return this.socketAdapter.connectionState()||Kl.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,s={config:{}}){const a=`realtime:${t}`,l=this.getChannels().find(u=>u.topic===a);if(l)return l;{const u=new Us(`realtime:${t}`,s,this);return this._cancelPendingDisconnect(),this.channels.push(u),u}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(s=>s.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
34this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let s,a=!1;if(t)s=t,a=!0;else if(this.accessToken)try{s=await this.accessToken()}catch(l){this.log("error","Error fetching access token from callback",l),s=this.accessTokenValue}else s=this.accessTokenValue;a?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=s&&(this.accessTokenValue=s,this.channels.forEach(l=>{const u={access_token:s,version:Fv};s&&l.updateJoinPayload(u),l.joinedOnce&&l.channelAdapter.isJoined()&&l.channelAdapter.push(Hf.access_token,{access_token:s})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(s=>{this.log("error",`Error setting auth in ${t}`,s)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(s=>{this.log("error","error waiting for auth on connect",s)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(s,a)=>{s=="sent"&&this._setAuthSafely(),t&&t(s,a)}}_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=s=>{this.log("worker","worker error",s.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=s=>{s.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let s;if(t)s=t;else{const a=new Blob([wy],{type:"application/javascript"});s=URL.createObjectURL(a)}return s}_initializeOptions(t){var s,a,l,u,c,p,m,g,w,y,_,E;this.worker=(s=t?.worker)!==null&&s!==void 0?s:!1,this.accessToken=(a=t?.accessToken)!==null&&a!==void 0?a:null;const j={};j.timeout=(l=t?.timeout)!==null&&l!==void 0?l:Wv,j.heartbeatIntervalMs=(u=t?.heartbeatIntervalMs)!==null&&u!==void 0?u:Dh.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(c=t?.disconnectOnEmptyChannelsAfterMs)!==null&&c!==void 0?c:2*((p=t?.heartbeatIntervalMs)!==null&&p!==void 0?p:Dh.HEARTBEAT_INTERVAL),j.transport=(m=t?.transport)!==null&&m!==void 0?m:Mv.getWebSocketConstructor(),j.params=t?.params,j.logger=t?.logger,j.heartbeatCallback=this._wrapHeartbeatCallback(t?.heartbeatCallback),j.sessionStorage=(g=t?.sessionStorage)!==null&&g!==void 0?g:yy(),j.reconnectAfterMs=(w=t?.reconnectAfterMs)!==null&&w!==void 0?w:(M=>my[M-1]||gy);let O,N;const D=(y=t?.vsn)!==null&&y!==void 0?y:Hv;switch(D){case zv:O=(M,U)=>U(JSON.stringify(M)),N=(M,U)=>U(JSON.parse(M));break;case zf:O=this.serializer.encode.bind(this.serializer),N=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${j.vsn}`)}if(j.vsn=D,j.encode=(_=t?.encode)!==null&&_!==void 0?_:O,j.decode=(E=t?.decode)!==null&&E!==void 0?E:N,j.beforeReconnect=this._reconnectAuth.bind(this),(t?.logLevel||t?.log_level)&&(this.logLevel=t.logLevel||t.log_level,j.params=Object.assign(Object.assign({},j.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t?.workerUrl,j.autoSendHeartbeat=!this.worker}return j}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
34var Bs=class extends Error{constructor(r,t){super(r),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function _y(r,t,s){const a=new URL(t,r);if(s)for(const[l,u]of Object.entries(s))u!==void 0&&a.searchParams.set(l,u);return a.toString()}async function ky(r){return!r||r.type==="none"?{}:r.type==="bearer"?{Authorization:`Bearer ${r.token}`}:r.type==="header"?{[r.name]:r.value}:r.type==="custom"?await r.getHeaders():{}}function by(r){const t=r.fetchImpl??globalThis.fetch;return{async request({method:s,path:a,query:l,body:u,headers:c}){const p=_y(r.baseUrl,a,l),m=await ky(r.auth),g=await t(p,{method:s,headers:{...u?{"Content-Type":"application/json"}:{},...m,...c},body:u?JSON.stringify(u):void 0}),w=await g.text(),y=(g.headers.get("content-type")||"").includes("application/json"),_=y&&w?JSON.parse(w):w;if(!g.ok){const E=y?_:void 0,j=E?.error;throw new Bs(j?.message??`Request failed with status ${g.status}`,{status:g.status,icebergType:j?.type,icebergCode:j?.code,details:E})}return{status:g.status,headers:g.headers,data:_}}}}function oa(r){return r.join("�")}var Sy=class{constructor(r,t=""){this.client=r,this.prefix=t}async listNamespaces(r){const t=r?{parent:oa(r.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(a=>({namespace:a}))}async createNamespace(r,t){const s={namespace:r.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:s})).data}async dropNamespace(r){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${oa(r.namespace)}`})}async loadNamespaceMetadata(r){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${oa(r.namespace)}`})).data.properties}}async namespaceExists(r){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${oa(r.namespace)}`}),!0}catch(t){if(t instanceof Bs&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(r,t){try{return await this.createNamespace(r,t)}catch(s){if(s instanceof Bs&&s.status===409)return;throw s}}};function kr(r){return r.join("�")}var Ey=class{constructor(r,t="",s){this.client=r,this.prefix=t,this.accessDelegation=s}async listTables(r){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${kr(r.namespace)}/tables`})).data.identifiers}async createTable(r,t){const s={};return this.accessDelegation&&(s["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${kr(r.namespace)}/tables`,body:t,headers:s})).data.metadata}async updateTable(r,t){const s=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${kr(r.namespace)}/tables/${r.name}`,body:t});return{"metadata-location":s.data["metadata-location"],metadata:s.data.metadata}}async dropTable(r,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${kr(r.namespace)}/tables/${r.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(r){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${kr(r.namespace)}/tables/${r.name}`,headers:t})).data.metadata}async tableExists(r){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${kr(r.namespace)}/tables/${r.name}`,headers:t}),!0}catch(s){if(s instanceof Bs&&s.status===404)return!1;throw s}}async createTableIfNotExists(r,t){try{return await this.createTable(r,t)}catch(s){if(s instanceof Bs&&s.status===409)return await this.loadTable({namespace:r.namespace,name:t.name});throw s}}},jy=class{constructor(r){let t="v1";r.catalogName&&(t+=`/${r.catalogName}`);const s=r.baseUrl.endsWith("/")?r.baseUrl:`${r.baseUrl}/`;this.client=by({baseUrl:s,auth:r.auth,fetchImpl:r.fetch}),this.accessDelegation=r.accessDelegation?.join(","),this.namespaceOps=new Sy(this.client,t),this.tableOps=new Ey(this.client,t,this.accessDelegation)}async listNamespaces(r){return this.namespaceOps.listNamespaces(r)}async createNamespace(r,t){return this.namespaceOps.createNamespace(r,t)}async dropNamespace(r){await this.namespaceOps.dropNamespace(r)}async loadNamespaceMetadata(r){return this.namespaceOps.loadNamespaceMetadata(r)}
34async listTables(r){return this.tableOps.listTables(r)}async createTable(r,t){return this.tableOps.createTable(r,t)}async updateTable(r,t){return this.tableOps.updateTable(r,t)}async dropTable(r,t){await this.tableOps.dropTable(r,t)}async loadTable(r){return this.tableOps.loadTable(r)}async namespaceExists(r){return this.namespaceOps.namespaceExists(r)}async tableExists(r){return this.tableOps.tableExists(r)}async createNamespaceIfNotExists(r,t){return this.namespaceOps.createNamespaceIfNotExists(r,t)}async createTableIfNotExists(r,t){return this.tableOps.createTableIfNotExists(r,t)}};function Fs(r){"@babel/helpers - typeof";return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fs(r)}function Cy(r,t){if(Fs(r)!="object"||!r)return r;var s=r[Symbol.toPrimitive];if(s!==void 0){var a=s.call(r,t);if(Fs(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function Ty(r){var t=Cy(r,"string");return Fs(t)=="symbol"?t:t+""}function Py(r,t,s){return(t=Ty(t))in r?Object.defineProperty(r,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[t]=s,r}function Mh(r,t){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),s.push.apply(s,a)}return s}function ae(r){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?Mh(Object(s),!0).forEach(function(a){Py(r,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(s)):Mh(Object(s)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(s,a))})}return r}var Pa=class extends Error{constructor(r,t="storage",s,a){super(r),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=s,this.statusCode=a}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Na(r){return typeof r=="object"&&r!==null&&"__isStorageError"in r}var Ql=class extends Pa{constructor(r,t,s,a="storage"){super(r,a,t,s),this.name=a==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=s}toJSON(){return ae({},super.toJSON())}},Kf=class extends Pa{constructor(r,t,s="storage"){super(r,s),this.name=s==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function wa(r,t,s){const a=ae({},r),l=t.toLowerCase();for(const u of Object.keys(a))u.toLowerCase()===l&&delete a[u];return a[l]=s,a}function Ny(r){const t={};for(const[s,a]of Object.entries(r))t[s.toLowerCase()]=a;return t}const Ry=r=>r?(...t)=>r(...t):(...t)=>fetch(...t),Oy=r=>{if(typeof r!="object"||r===null)return!1;const t=Object.getPrototypeOf(r);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},Xl=r=>{if(Array.isArray(r))return r.map(s=>Xl(s));if(typeof r=="function"||r!==Object(r))return r;const t={};return Object.entries(r).forEach(([s,a])=>{const l=s.replace(/([-_][a-z])/gi,u=>u.toUpperCase().replace(/[-_]/g,""));t[l]=Xl(a)}),t},Ay=r=>!r||typeof r!="string"||r.length===0||r.length>100||r.trim()!==r||r.includes("/")||r.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(r),Bh=r=>{if(typeof r=="object"&&r!==null){const t=r;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const s=t.error;if(typeof s.message=="string")return s.message}}return JSON.stringify(r)},Ly=async(r,t,s,a)=>{if(r!==null&&typeof r=="object"&&"json"in r&&typeof r.json=="function"){const l=r;let u=parseInt(String(l.status),10);Number.isFinite(u)||(u=500),l.json().then(c=>{const p=c?.statusCode||c?.code||u+"";t(new Ql(Bh(c),u,p,a))}).catch(()=>{const c=u+"";t(new Ql(l.statusText||`HTTP ${u} error`,u,c,a))})}else t(new Kf(Bh(r),r,a))},Iy=(r,t,s,a)=>{const l={method:r,headers:t?.headers||{}};if(r==="GET"||r==="HEAD"||!a)return ae(ae({},l),s);if(Oy(a)){var u;const c=t?.headers||{};let p;for(const[m,g]of Object.entries(c))m.toLowerCase()==="content-type"&&(p=g);l.headers=wa(c,"Content-Type",(u=p)!==null&&u!==void 0?u:"application/json"),l.body=JSON.stringify(a)}else l.body=a;return t?.duplex&&(l.duplex=t.duplex),ae(ae({},l),s)};async function Ps(r,t,s,a,l,u,c){return new Promise((p,m)=>{r(s,Iy(t,a,l,u)).then(g=>{if(!g.ok)throw g;if(a?.noResolveJson)return g;if(c==="vectors"){const w=g.headers.get("content-type");if(g.headers.get("content-length")==="0"||g.status===204)return{};if(!w||!w.includes("application/json"))return{}}return g.json()}).then(g=>p(g)).catch(g=>Ly(g,m,a,c))})}function Gf(r="storage"){return{get:async(t,s,a,l)=>Ps(t,"GET",s,a,l,void 0,r),post:async(t,s,a,l,u)=>Ps(t,"POST",s,l,u,a,r),put:async(t,s,a,l,u)=>Ps(t,"PUT",s,l,u,a,r),head:async(t,s,a,l)=>Ps(t,"HEAD",s,ae(ae({},a),{},{noResolveJson:!0}),l,void 0,r),remove:async(t,s,a,l,u)=>Ps(t,"DELETE",s,l,u,a,r)}}const Uy=Gf("storage"),{get:zs,post:Lt,put:Zl,head:$y,remove:pu}=Uy,vt=Gf("vectors");var Fr=class{constructor(r,t={},s,a="storage"){this.shouldThrowOnError=!1,this.url=r,this.headers=Ny(t),this.fetch=Ry(s),this.namespace=a}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(r,t){return this.headers=wa(this.headers,r,t),this}async handleOperation(r){var t=this;try{return{data:await r(),error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(Na(s))return{data:null,error:s};throw s}}};let Jf;Jf=Symbol.toStringTag;var Dy=class{constructor(r,t){this.downloadFn=r,this.shouldThrowOnError=t,this[Jf]="StreamDownloadBuilder",this.promise=null}
34then(r,t){return this.getPromise().then(r,t)}catch(r){return this.getPromise().catch(r)}finally(r){return this.getPromise().finally(r)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var r=this;try{return{data:(await r.downloadFn()).body,error:null}}catch(t){if(r.shouldThrowOnError)throw t;if(Na(t))return{data:null,error:t};throw t}}};let Yf;Yf=Symbol.toStringTag;var My=class{constructor(r,t){this.downloadFn=r,this.shouldThrowOnError=t,this[Yf]="BlobDownloadBuilder",this.promise=null}asStream(){return new Dy(this.downloadFn,this.shouldThrowOnError)}then(r,t){return this.getPromise().then(r,t)}catch(r){return this.getPromise().catch(r)}finally(r){return this.getPromise().finally(r)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var r=this;try{return{data:await(await r.downloadFn()).blob(),error:null}}catch(t){if(r.shouldThrowOnError)throw t;if(Na(t))return{data:null,error:t};throw t}}};const By={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Fh={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var Fy=class extends Fr{constructor(r,t={},s,a){super(r,t,a,"storage"),this.bucketId=s}async uploadOrUpdate(r,t,s,a){var l=this;return l.handleOperation(async()=>{let u;const c=ae(ae({},Fh),a);let p=ae(ae({},l.headers),r==="POST"&&{"x-upsert":String(c.upsert)});const m=c.metadata;if(typeof Blob<"u"&&s instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),m&&u.append("metadata",l.encodeMetadata(m)),u.append("",s)):typeof FormData<"u"&&s instanceof FormData?(u=s,u.has("cacheControl")||u.append("cacheControl",c.cacheControl),m&&!u.has("metadata")&&u.append("metadata",l.encodeMetadata(m))):(u=s,p["cache-control"]=`max-age=${c.cacheControl}`,p["content-type"]=c.contentType,m&&(p["x-metadata"]=l.toBase64(l.encodeMetadata(m))),(typeof ReadableStream<"u"&&u instanceof ReadableStream||u&&typeof u=="object"&&"pipe"in u&&typeof u.pipe=="function")&&!c.duplex&&(c.duplex="half")),a?.headers)for(const[_,E]of Object.entries(a.headers))p=wa(p,_,E);const g=l._removeEmptyFolders(t),w=l._getFinalPath(g),y=await(r=="PUT"?Zl:Lt)(l.fetch,`${l.url}/object/${w}`,u,ae({headers:p},c?.duplex?{duplex:c.duplex}:{}));return{path:g,id:y.Id,fullPath:y.Key}})}async upload(r,t,s){return this.uploadOrUpdate("POST",r,t,s)}async uploadToSignedUrl(r,t,s,a){var l=this;const u=l._removeEmptyFolders(r),c=l._getFinalPath(u),p=new URL(l.url+`/object/upload/sign/${c}`);return p.searchParams.set("token",t),l.handleOperation(async()=>{let m;const g=ae(ae({},Fh),a);let w=ae(ae({},l.headers),{"x-upsert":String(g.upsert)});const y=g.metadata;if(typeof Blob<"u"&&s instanceof Blob?(m=new FormData,m.append("cacheControl",g.cacheControl),y&&m.append("metadata",l.encodeMetadata(y)),m.append("",s)):typeof FormData<"u"&&s instanceof FormData?(m=s,m.has("cacheControl")||m.append("cacheControl",g.cacheControl),y&&!m.has("metadata")&&m.append("metadata",l.encodeMetadata(y))):(m=s,w["cache-control"]=`max-age=${g.cac
34heControl}`,w["content-type"]=g.contentType,y&&(w["x-metadata"]=l.toBase64(l.encodeMetadata(y))),(typeof ReadableStream<"u"&&m instanceof ReadableStream||m&&typeof m=="object"&&"pipe"in m&&typeof m.pipe=="function")&&!g.duplex&&(g.duplex="half")),a?.headers)for(const[_,E]of Object.entries(a.headers))w=wa(w,_,E);return{path:u,fullPath:(await Zl(l.fetch,p.toString(),m,ae({headers:w},g?.duplex?{duplex:g.duplex}:{}))).Key}})}async createSignedUploadUrl(r,t){var s=this;return s.handleOperation(async()=>{let a=s._getFinalPath(r);const l=ae({},s.headers);t?.upsert&&(l["x-upsert"]="true");const u=await Lt(s.fetch,`${s.url}/object/upload/sign/${a}`,{},{headers:l}),c=new URL(s.url+u.url),p=c.searchParams.get("token");if(!p)throw new Pa("No token returned by API");return{signedUrl:c.toString(),path:r,token:p}})}async update(r,t,s){return this.uploadOrUpdate("PUT",r,t,s)}async move(r,t,s){var a=this;return a.handleOperation(async()=>await Lt(a.fetch,`${a.url}/object/move`,{bucketId:a.bucketId,sourceKey:r,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:a.headers}))}async copy(r,t,s){var a=this;return a.handleOperation(async()=>({path:(await Lt(a.fetch,`${a.url}/object/copy`,{bucketId:a.bucketId,sourceKey:r,destinationKey:t,de
34stinationBucket:s?.destinationBucket},{headers:a.headers})).Key}))}async createSignedUrl(r,t,s){var a=this;return a.handleOperation(async()=>{let l=a._getFinalPath(r);const u=typeof s?.transform=="object"&&s.transform!==null&&Object.keys(s.transform).length>0;let c=await Lt(a.fetch,`${a.url}/object/sign/${l}`,ae({expiresIn:t},u?{transform:s.transform}:{}),{headers:a.headers});const p=new URLSearchParams;s?.download&&p.set("download",s.download===!0?"":s.download),s?.cacheNonce!=null&&p.set("cacheNonce",String(s.cacheNonce));const m=p.toString();return{signedUrl:encodeURI(`${a.url}${c.signedURL}${m?`&${m}`:""}`)}})}async createSignedUrls(r,t,s){var a=this;return a.handleOperation(async()=>{const l=await Lt(a.fetch,`${a.url}/object/sign/${a.bucketId}`,{expiresIn:t,paths:r},{headers:a.headers}),u=new URLSearchParams;s?.download&&u.set("download",s.download===!0?"":s.download),s?.cacheNonce!=null&&u.set("cacheNonce",String(s.cacheNonce));const c=u.toString();return l.map(p=>ae(ae({},p),{},{signedUrl:p.signedURL?encodeURI(`${a.url}${p.signedURL}${c?`&${c}`:""}`):null}))})}download(r,t,s){const a=typeof t?.transform=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",l=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(l,t.transform),t?.cacheNonce!=null&&l.set("cacheNonce",String(t.cacheNonce));const u=l.toString(),c=this._getFinalPath(r),p=()=>zs(this.fetch,`${this.url}/${a}/${c}${u?`?${u}`:""}`,{headers:this.headers,noResolveJson:!0},s);return new My(p,this.shouldThrowOnError)}async info(r){var t=this;const s=t._getFinalPath(r);return t.handleOperation(async()=>Xl(await zs(t.fetch,`${t.url}/object/info/${s}`,{headers:t.headers})))}async exists(r){var t=this;const s=t._getFinalPath(r);try{return await $y(t.fetch,`${t.url}/object/${s}`,{headers:t.headers}),{data:!0,error:null}}catch(l){if(t.shouldThrowOnError)throw l;if(Na(l)){var a;const u=l instanceof Ql?l.status:l instanceof Kf?(a=l.originalError)===null||a===void 0?void 0:a.status:void 0;if(u!==void 0&&[400,404].includes(u))return{data:!1,error:l}}throw l}}getPublicUrl(r,t){const s=this._getFinalPath(r),a=new URLSearchParams;t?.download&&a.set("download",t.download===!0?"":t.download),t?.transform&&this.applyTransformOptsToQuery(a,t.transform),t?.cacheNonce!=null&&a.set("cacheNonce",String(t.cacheNonce));const l=a.toString(),u=typeof t?.transform=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${u}/public/${s}`)+(l?`?${l}`:"")}}}async remove(r){var t=this;return t.handleOperation(async()=>await pu(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:r},{headers:t.headers}))}async list(r,t,s){var a=this;return a.handleOperation(async()=>{const l=ae(ae(ae({},By),t),{},{prefix:r||""});return await Lt(a.fetch,`${a.url}/object/list/${a.bucketId}`,l,{headers:a.headers},s)})}async listV2(r,t){var s=this;return s.handleOperation(async()=>{const a=ae({},r);return await Lt(s.fetch,`${s.url}/object/list-v2/${s.bucketId}`,a,{headers:s.headers},t)})}encodeMetadata(r){return JSON.stringify(r)}toBase64(r){return typeof Buffer<"u"?Buffer.from(r).toString("base64"):btoa(r)}_getFinalPath(r){return`${this.bucketId}/${r.replace(/^\/+/,"")}`}_removeEmptyFolders(r){return r.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(r,t){return t.width&&r.set("width",t.width.toString()),t.height&&r.set("height",t.height.toString()),t.resize&&r.set("resize",t.resize),t.format&&r.set("format",t.format),t.quality&&r.set("quality",t.quality.toString()),r}};const zy="2.106.1",qs={"X-Client-Info":`storage-js/${zy}`};var Hy=class extends Fr{constructor(r,t={},s,a){const l=new URL(r);a?.useNewHostname&&/supabase\.(co|in|red)$/.test(l.hostname)&&!l.hostname.includes("storage.supabase.")&&(l.hostname=l.hostname.replace("supabase.","storage.supabase."));const u=l.href.replace(/\/$/,""),c=ae(ae({},qs),t);super(u,c,s,"storage")}async listBuckets(r){var t=this;return t.handleOperation(async()=>{const s=t.listBucketOptionsToQueryString(r);return await zs(t.fetch,`${t.url}/bucket${s}`,{headers:t.headers})})}async getBucket(r){var t=this;return t.handleOperation(async()=>await zs(t.fetch,`${t.url}/bucket/${r}`,{headers:t.headers}))}async createBucket(r,t={public:!1}){var s=this;return s.handleOperation(async()=>await Lt(s.fetch,`${s.url}/bucket`,{id:r,name:r,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:s.headers}))}async updateBucket(r,t){var s=this;return s.handleOperation(async()=>await Zl(s.fetch,`${s.url}/bucket/${r}`,{id:r,name:r,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:s.headers}))}async emptyBucket(r){var t=this;return t.handleOperation(async()=>await Lt(t.fetch,`${t.url}/bucket/${r}/empty`,{},{headers:t.headers}))}async deleteBucket(r){var t=this;return t.handleOperation(async()=>await pu(t.fetch,`${t.url}/bucket/${r}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(r){const t={};return r&&("limit"in r&&(t.limit=String(r.limit)),"offset"in r&&(t.offset=String(r.offset)),r.search&&(t.search=r.search),r.s
34ortColumn&&(t.sortColumn=r.sortColumn),r.sortOrder&&(t.sortOrder=r.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},Wy=class extends Fr{constructor(r,t={},s){const a=r.replace(/\/$/,""),l=ae(ae({},qs),t);super(a,l,s,"storage")}async createBucket(r){var t=this;return t.handleOperation(async()=>await Lt(t.fetch,`${t.url}/bucket`,{name:r},{headers:t.headers}))}async listBuckets(r){var t=this;return t.handleOperation(async()=>{const s=new URLSearchParams;r?.limit!==void 0&&s.set("limit",r.limit.toString()),r?.offset!==void 0&&s.set("offset",r.offset.toString()),r?.sortColumn&&s.set("sortColumn",r.sortColumn),r?.sortOrder&&s.set("sortOrder",r.sortOrder),r?.search&&s.set("search",r.search);const a=s.toString(),l=a?`${t.url}/bucket?${a}`:`${t.url}/bucket`;return await zs(t.fetch,l,{headers:t.headers})})}async deleteBucket(r){var t=this;return t.handleOperation(async()=>await pu(t.fetch,`${t.url}/bucket/${r}`,{},{headers:t.headers}))}from(r){var t=this;if(!Ay(r))throw new Pa("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const s=new jy({baseUrl:this.url,catalogName:r,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),a=this.shouldThrowOnError;return new Proxy(s,{get(l,u){const c=l[u];return typeof c!="function"?c:async(...p)=>{try{return{data:await c.apply(l,p),error:null}}catch(m){if(a)throw m;return{data:null,error:m}}}}})}},Vy=class extends Fr{constructor(r,t={},s){const a=r.replace(/\/$/,""),l=ae(ae({},qs),{},{"Content-Type":"application/json"},t);super(a,l,s,"vectors")}async createIndex(r){var t=this;return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/CreateIndex`,r,{headers:t.headers})||{})}async getIndex(r,t){var s=this;return s.handleOperation(async()=>await vt.post(s.fetch,`${s.url}/GetIndex`,{vectorBucketName:r,indexName:t},{headers:s.headers}))}async listIndexes(r){var t=this;return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/ListIndexes`,r,{headers:t.headers}))}async deleteIndex(r,t){var s=this;return s.handleOperation(async()=>await vt.post(s.fetch,`${s.url}/DeleteIndex`,{vectorBucketName:r,indexName:t},{headers:s.headers})||{})}},qy=class extends Fr{constructor(r,t={},s){const a=r.replace(/\/$/,""),l=ae(ae({},qs),{},{"Content-Type":"application/json"},t);super(a,l,s,"vectors")}async putVectors(r){var t=this;if(r.vectors.length<1||r.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/PutVectors`,r,{headers:t.headers})||{})}async getVectors(r){var t=this;return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/GetVectors`,r,{headers:t.headers}))}async listVectors(r){var t=this;if(r.segmentCount!==void 0){if(r.segmentCount<1||r.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(r.segmentIndex!==void 0&&(r.segmentIndex<0||r.segmentIndex>=r.segmentCount))throw new Error(`segmentIndex must be between 0 and ${r.segmentCount-1}`)}return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/ListVectors`,r,{headers:t.headers}))}async queryVectors(r){var t=this;return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/QueryVectors`,r,{headers:t.headers}))}async deleteVectors(r){var t=this;if(r.keys.length<1||r.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/DeleteVectors`,r,{headers:t.headers})||{})}},Ky=class extends Fr{constructor(r,t={},s){const a=r.replace(/\/$/,""),l=ae(ae({},qs),{},{"Content-Type":"application/json"},t);super(a,l,s,"vectors")}async createBucket(r){var t=this;return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:r},{headers:t.headers})||{})}async getBucket(r){var t=this;return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:r},{headers:t.headers}))}async listBuckets(r={}){var t=this;return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/ListVectorBuckets`,r,{headers:t.headers}))}async deleteBucket(r){var t=this;return t.handleOperation(async()=>await vt.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:r},{headers:t.headers})||{})}},Gy=class extends Ky{constructor(r,t={}){super(r,t.headers||{},t.fetch)}from(r){return new Jy(this.url,this.headers,r,this.fetch)}async createBucket(r){var t=()=>super.createBucket,s=this;return t().call(s,r)}async getBucket(r){var t=()=>super.getBucket,s=this;return t().call(s,r)}async listBuckets(r={}){var t=()=>super.listBuckets,s=this;return t().call(s,r)}async deleteBucket(r){var t=()=>super.deleteBucket,s=this;return t().call(s,r)}},Jy=class extends Vy{constructor(r,t,s,a){super(r,t,a),this.vectorBucketName=s}async createIndex(r){var t=()=>super.createIndex,s=this;return t().call(s,ae(ae({},r),{},{vectorBucketName:s.vectorBucketName}))}async listIndexes(r={}){var t=()=>super.listIndexes,s=this;return t().call(s,ae(ae({},r),{},{vectorBucketName:s.vectorBucketName}))}async getIndex(r){var t=()=>super.getIndex,s=this;return t().call(s,s.vectorBucketName,r)}async deleteIndex(r){var t=()=>super.deleteIndex,s=this;return t().call(s,s.vectorBucketName,r)}index(r){return new Yy(this.url,this.headers,this.vectorBucketName,r,this.fetch)}},Yy=class extends qy{constructor(r,t,s,a,l){super(r,t,l),this.vectorBucketName=s,this.indexName=a}async putVectors(r){var t=()=>super.putVectors,s=this;return t().call(s,ae(ae({},r),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async getVectors(r){var t=()=>super.getVectors,s=this;return t().call(s,ae(ae({},r),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async listVectors(r={}){var t=()=>super.listVectors,s=this;return t().call(s,ae(ae({},r),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async queryVectors(r){var t=()=>super.queryVectors,s=this;return t().call(s,ae(ae({},r),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}async deleteVectors(r){var t=()=>super.deleteVectors,s=this;return t().call(s,ae(ae({},r),{},{vectorBucketName:s.vectorBucketName,indexName:s.indexName}))}},Qy=class extends Hy{constructor(r,t={},s,a){super(r,t,s,a)}from(r){return new Fy(this.url,this.headers,r,this.fetch)}get vectors(){return new Gy(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Wy(this.url+"/iceberg",this.headers,this.fetch)}};const Qf="2.106.1",Nr=30*1e3,eu=3,Ll=eu*Nr,Xy="http://localhost:9999",Zy="supabase.auth.token",e0={"X-Client-Info":`gotrue-js/${Qf}`},tu="X-Supabase-Api-Version",Xf={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},t0=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,n0=600*1e3;
34class Ir extends Error{constructor(t,s,a){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=s,this.code=a}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function K(r){return typeof r=="object"&&r!==null&&"__isAuthError"in r}class r0 extends Ir{constructor(t,s,a){super(t,s,a),this.name="AuthApiError",this.status=s,this.code=a}}function s0(r){return K(r)&&r.name==="AuthApiError"}class It extends Ir{constructor(t,s){super(t),this.name="AuthUnknownError",this.originalError=s}}class an extends Ir{constructor(t,s,a,l){super(t,a,l),this.name=s,this.status=a}}class Ve extends an{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function la(r){return K(r)&&r.name==="AuthSessionMissingError"}class br extends an{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class ua extends an{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class ca extends an{constructor(t,s=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function i0(r){return K(r)&&r.name==="AuthImplicitGrantRedirectError"}class zh extends an{constructor(t,s=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class a0 extends an{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class nu extends an{constructor(t,s){super(t,"AuthRetryableFetchError",s,void 0)}}function Il(r){return K(r)&&r.name==="AuthRetryableFetchError"}class Hh extends an{constructor(t,s,a){super(t,"AuthWeakPasswordError",s,"weak_password"),this.reasons=a}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class ru extends an{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const xa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Wh=` 35\r=`.split(""),o0=(()=>{const r=new Array(128);for(let t=0;t<r.length;t+=1)r[t]=-1;for(let t=0;t<Wh.length;t+=1)r[Wh[t].charCodeAt(0)]=-2;for(let t=0;t<xa.length;t+=1)r[xa[t].charCodeAt(0)]=t;return r})();function Vh(r,t,s){if(r!==null)for(t.queue=t.queue<<8|r,t.queuedBits+=8;t.queuedBits>=6;){const a=t.queue>>t.queuedBits-6&63;s(xa[a]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const a=t.queue>>t.queuedBits-6&63;s(xa[a]),t.queuedBits-=6}}function Zf(r,t,s){const a=o0[r];if(a>-1)for(t.queue=t.queue<<6|a,t.queuedBits+=6;t.queuedBits>=8;)s(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(a===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(r)}"`)}}function qh(r){const t=[],s=c=>{t.push(String.fromCodePoint(c))},a={utf8seq:0,codepoint:0},l={queue:0,queuedBits:0},u=c=>{c0(c,a,s)};for(let c=0;c<r.length;c+=1)Zf(r.charCodeAt(c),l,u);return t.join("")}function l0(r,t){if(r<=127){t(r);return}else if(r<=2047){t(192|r>>6),t(128|r&63);return}else if(r<=65535){t(224|r>>12),t(128|r>>6&63),t(128|r&63);return}else if(r<=1114111){t(240|r>>18),t(128|r>>12&63),t(128|r>>6&63),t(128|r&63);return}throw new Error(`Unrecognized Unicode codepoint: ${r.toString(16)}`)}function u0(r,t){for(let s=0;s<r.length;s+=1){let a=r.charCodeAt(s);if(a>55295&&a<=56319){const l=(a-55296)*1024&65535;a=(r.charCodeAt(s+1)-56320&65535|l)+65536,s+=1}l0(a,t)}}function c0(r,t,s){if(t.utf8seq===0){if(r<=127){s(r);return}for(let a=1;a<6;a+=1)if((r>>7-a&1)===0){t.utf8seq=a;break}if(t.utf8seq===2)t.codepoint=r&31;else if(t.utf8seq===3)t.codepoint=r&15;else if(t.utf8seq===4)t.codepoint=r&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(r<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|r&63,t.utf8seq-=1,t.utf8seq===0&&s(t.codepoint)}}function Ar(r){const t=[],s={queue:0,queuedBits:0},a=l=>{t.push(l)};for(let l=0;l<r.length;l+=1)Zf(r.charCodeAt(l),s,a);return new Uint8Array(t)}function d0(r){const t=[];return u0(r,s=>t.push(s)),new Uint8Array(t)}function Kn(r){const t=[],s={queue:0,queuedBits:0},a=l=>{t.push(l)};return r.forEach(l=>Vh(l,s,a)),Vh(null,s,a),t.join("")}function h0(r){return Math.round(Date.now()/1e3)+r}function f0(){return Symbol("auth-callback")}const Je=()=>typeof window<"u"&&typeof document<"u",Wn={tested:!1,writable:!1},ep=()=>
35{if(!Je())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Wn.tested)return Wn.writable;const r=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(r,r),globalThis.localStorage.removeItem(r),Wn.tested=!0,Wn.writable=!0}catch{Wn.tested=!0,Wn.writable=!1}return Wn.writable};function p0(r){const t={},s=new URL(r);if(s.hash&&s.hash[0]==="#")try{new URLSearchParams(s.hash.substring(1)).forEach((l,u)=>{t[u]=l})}catch{}return s.searchParams.forEach((a,l)=>{t[l]=a}),t}const tp=r=>r?(...t)=>r(...t):(...t)=>fetch(...t),m0=r=>typeof r=="object"&&r!==null&&"status"in r&&"ok"in r&&"json"in r&&typeof r.json=="function",Rr=async(r,t,s)=>{await r.setItem(t,JSON.stringify(s))},Vn=async(r,t)=>{const s=await r.getItem(t);if(!s)return null;try{return JSON.parse(s)}catch{return null}},Ge=async(r,t)=>{await r.removeItem(t)};class Ra{constructor(){this.promise=new Ra.promiseConstructor((t,s)=>{this.resolve=t,this.reject=s})}}Ra.promiseConstructor=Promise;function da(r){const t=r.split(".");if(t.length!==3)throw new ru("Invalid JWT structure");for(let a=0;a<t.length;a++)if(!t0.test(t[a]))throw new ru("JWT not in base64url format");return{header:JSON.parse(qh(t[0])),payload:JSON.parse(qh(t[1])),signature:Ar(t[2]),raw:{header:t[0],payload:t[1]}}}async function g0(r){return await new Promise(t=>{setTimeout(()=>t(null),r)})}function v0(r,t){return new Promise((a,l)=>{(async()=>{for(let u=0;u<1/0;u++)try{const c=await r(u);if(!t(u,null,c)){a(c);return}}catch(c){if(!t(u,c)){l(c);return}}})()})}function y0(r){return("0"+r.toString(16)).substr(-2)}function w0(){const t=new Uint32Array(56);if(typeof crypto>"u"){const s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",a=s.length;let l="";for(let u=0;u<56;u++)l+=s.charAt(Math.floor(Math.random()*a));return l}return crypto.getRandomValues(t),Array.from(t,y0).join("")}async function x0(r){const s=new TextEncoder().encode(r),a=await crypto.subtle.digest("SHA-256",s),l=new Uint8Array(a);return Array.from(l).map(u=>String.fromCharCode(u)).join("")}async function _0(r){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),r;const s=await x0(r);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Sr(r,t,s=!1){const a=w0();let l=a;s&&(l+="/recovery"),await Rr(r,`${t}-code-verifier`,l);const u=await _0(a);return[u,a===u?"plain":"s256"]}const k0=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function b0(r){const t=r.headers.get(tu);if(!t||!t.match(k0))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function S0(r){if(!r)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(r<=t)throw new Error("JWT has expired")}function E0(r){switch(r){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 j0=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Xt(r){if(!j0.test(r))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function At(r){if(!r.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Ul(){const r={};return new Proxy(r,{get:(t,s)=>{if(s==="__isUserNotAvailableProxy")return!0;if(typeof s=="symbol"){const a=s.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="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 "${s}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,s)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${s}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,s)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${s}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function C0(r,t){return new Proxy(r,{get:(s,a,l)=>{if(a==="__isInsecureUserWarningProxy")return!0;
35if(typeof a=="symbol"){const u=a.toString();if(u==="Symbol(Symbol.toPrimitive)"||u==="Symbol(Symbol.toStringTag)"||u==="Symbol(util.inspect.custom)"||u==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(s,a,l)}return!t.value&&typeof a=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(s,a,l)}})}function Kh(r){return JSON.parse(JSON.stringify(r))}const qn=r=>{if(typeof r=="object"&&r!==null){const t=r;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(r)},T0=[502,503,504,520,521,522,523,524,530];async function Gh(r){var t;if(!m0(r))throw new nu(qn(r),0);if(T0.includes(r.status))throw new nu(qn(r),r.status);let s;try{s=await r.json()}catch(u){throw new It(qn(u),u)}let a;const l=b0(r);if(l&&l.getTime()>=Xf["2024-01-01"].timestamp&&typeof s=="object"&&s&&typeof s.code=="string"?a=s.code:typeof s=="object"&&s&&typeof s.error_code=="string"&&(a=s.error_code),a){if(a==="weak_password")throw new Hh(qn(s),r.status,((t=s.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(a==="session_not_found")throw new Ve}else if(typeof s=="object"&&s&&typeof s.weak_password=="object"&&s.weak_password&&Array.isArray(s.weak_password.reasons)&&s.weak_password.reasons.length&&s.weak_password.reasons.reduce((u,c)=>u&&typeof c=="string",!0))throw new Hh(qn(s),r.status,s.weak_password.reasons);throw new r0(qn(s),r.status||500,a)}const P0=(r,t,s,a)=>{const l={method:r,headers:t?.headers||{}};return r==="GET"?l:(l.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),l.body=JSON.stringify(a),Object.assign(Object.assign({},l),s))};async function X(r,t,s,a){var l;const u=Object.assign({},a?.headers);u[tu]||(u[tu]=Xf["2024-01-01"].name),a?.jwt&&(u.Authorization=`Bearer ${a.jwt}`);const c=(l=a?.query)!==null&&l!==void 0?l:{};a?.redirectTo&&(c.redirect_to=a.redirectTo);const p=Object.keys(c).length?"?"+new URLSearchParams(c).toString():"",m=await N0(r,t,s+p,{headers:u,noResolveJson:a?.noResolveJson},{},a?.body);return a?.xform?a?.xform(m):{data:Object.assign({},m),error:null}}async function N0(r,t,s,a,l,u){const c=P0(t,a,l,u);let p;try{p=await r(s,Object.assign({},c))}catch(m){throw console.error(m),new nu(qn(m),0)}if(p.ok||await Gh(p),a?.noResolveJson)return p;try{return await p.json()}catch(m){await Gh(m)}}function St(r){var t;let s=null;A0(r)&&(s=Object.assign({},r),r.expires_at||(s.expires_at=h0(r.expires_in)));const a=(t=r.user)!==null&&t!==void 0?t:null;return{data:{session:s,user:a},error:null}}function Jh(r){const t=St(r);return!t.error&&r.weak_password&&typeof r.weak_password=="object"&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.message&&typeof r.weak_password.message=="string"&&r.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0)&&(t.data.weak_password=r.weak_password),t}function Cn(r){var t;return{data:{user:(t=r.user)!==null&&t!==void 0?t:r},error:null}}function R0(r){return{data:r,error:null}}function O0(r){const{action_link:t,email_otp:s,hashed_token:a,redirect_to:l,verification_type:u}=r,c=Ta(r,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),p={action_link:t,email_otp:s,hashed_token:a,redirect_to:l,verification_type:u},m=Object.assign({},c);return{data:{properties:p,user:m},error:null}}function Yh(r){return r}function A0(r){return!!r.access_token&&!!r.refresh_token&&!!r.expires_in}const $l=["global","local","others"];class L0{_encodePathSegment(t){if(t==="."||t==="..")throw new Ir("Invalid path segment");return encodeURIComponent(t)}constructor({url:t="",headers:s={},fetch:a,experimental:l}){this.url=t,this.headers=s,this.fetch=tp(a),this.experimental=l??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,s=$l[0]){if($l.indexOf(s)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${$l.join(", ")}`);try{return await X(this.fetch,"POST",`${this.url}/logout?scope=${s}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(a){if(K(a))return{data:null,error:a};throw a}}async inviteUserByEmail(t,s={}){try{return await X(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:s.data},headers:this.headers,redirectTo:s.redirectTo,xform:Cn})}catch(a){if(K(a))return{data:{user:null},error:a};throw a}}async generateLink(t){try{const{options:s}=t,a=Ta(t,["options"]),l=Object.assign(Object.assign({},a),s);return"newEmail"in a&&(l.new_email=a?.newEmail,delete l.newEmail),await X(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:l,headers:this.headers,xform:O0,redirectTo:s?.redirectTo})}catch(s){if(K(s))return{data:{properties:null,user:null},error:s};throw s}}async createUser(t){try{return await X(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Cn})}catch(s){if(K(s))return{data:{user:null},error:s};throw s}}async listUsers(t){var s,a,l,u,c,p,m;
35try{const g={nextPage:null,lastPage:0,total:0},w=await X(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(s=t?.page)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:"",per_page:(u=(l=t?.perPage)===null||l===void 0?void 0:l.toString())!==null&&u!==void 0?u:""},xform:Yh});if(w.error)throw w.error;const y=await w.json(),_=(c=w.headers.get("x-total-count"))!==null&&c!==void 0?c:0,E=(m=(p=w.headers.get("link"))===null||p===void 0?void 0:p.split(","))!==null&&m!==void 0?m:[];return E.length>0&&(E.forEach(j=>{const O=parseInt(j.split(";")[0].split("=")[1].substring(0,1)),N=JSON.parse(j.split(";")[1].split("=")[1]);g[`${N}Page`]=O}),g.total=parseInt(_)),{data:Object.assign(Object.assign({},y),g),error:null}}catch(g){if(K(g))return{data:{users:[]},error:g};throw g}}async getUserById(t){Xt(t);try{return await X(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Cn})}catch(s){if(K(s))return{data:{user:null},error:s};throw s}}async updateUserById(t,s){Xt(t);try{return await X(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:s,headers:this.headers,xform:Cn})}catch(a){if(K(a))return{data:{user:null},error:a};throw a}}async deleteUser(t,s=!1){Xt(t);try{return await X(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:s},xform:Cn})}catch(a){if(K(a))return{data:{user:null},error:a};throw a}}async _listFactors(t){Xt(t.userId);try{const{data:s,error:a}=await X(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:l=>({data:{factors:l},error:null})});return{data:s,error:a}}catch(s){if(K(s))return{data:null,error:s};throw s}}async _deleteFactor(t){Xt(t.userId),Xt(t.id);try{return{data:await X(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(s){if(K(s))return{data:null,error:s};throw s}}async _listOAuthClients(t){var s,a,l,u,c,p,m;try{const g={nextPage:null,lastPage:0,total:0},w=await X(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(s=t?.page)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:"",per_page:(u=(l=t?.perPage)===null||l===void 0?void 0:l.toString())!==null&&u!==void 0?u:""},xform:Yh});if(w.error)throw w.error;const y=await w.json(),_=(c=w.headers.get("x-total-count"))!==null&&c!==void 0?c:0,E=(m=(p=w.headers.get("link"))===null||p===void 0?void 0:p.split(","))!==null&&m!==void 0?m:[];return E.length>0&&(E.forEach(j=>{const O=parseInt(j.split(";")[0].split("=")[1].substring(0,1)),N=JSON.parse(j.split(";")[1].split("=")[1]);g[`${N}Page`]=O}),g.total=parseInt(_)),{data:Object.assign(Object.assign({},y),g),error:null}}catch(g){if(K(g))return{data:{clients:[]},error:g};throw g}}async _createOAuthClient(t){try{return await X(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(K(s))return{data:null,error:s};throw s}}async _getOAuthClient(t){try{const s=this._encodePathSegment(t);return await X(this.fetch,"GET",`${this.url}/admin/oauth/clients/${s}`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(s){if(K(s))return{data:null,error:s};throw s}}async _updateOAuthClient(t,s){try{const a=this._encodePathSegment(t);return await X(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${a}`,{body:s,headers:this.headers,xform:l=>({data:l,error:null})})}catch(a){if(K(a))return{data:null,error:a};throw a}}async _deleteOAuthClient(t){try{const s=this._encodePathSegment(t);return await X(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${s}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(K(s))return{data:null,error:s};throw s}}async _regenerateOAuthClientSecret(t){try{const s=this._encodePathSegment(t);return await X(this.fetch,"POST",`${this.url}/admin/oauth/clients/${s}/regenerate_secret`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(s){if(K(s))return{data:null,error:s};throw s}}async _listCustomProviders(t){try{const s={};return t?.type&&(s.type=t.type),await X(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:s,xform:a=>{var l;return{data:{providers:(l=a?.providers)!==null&&l!==void 0?l:[]},error:null}}})}catch(s){if(K(s))return{data:{providers:[]},error:s};throw s}}async _createCustomProvider(t){try{return await X(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(K(s))return{data:null,error:s};throw s}}async _getCustomProvider(t){try{const s=this._encodePathSegment(t);return await X(this.fetch,"GET",`${this.url}/admin/custom-providers/${s}`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(s){if(K(s))return{data:null,error:s};throw s}}async _updateCustomProvider(t,s){try{const a=this._encodePathSegment(t);return await X(this.fetch,"PUT",`${this.url}/admin/custom-providers/${a}`,{body:s,headers:this.headers,xform:l=>({data:l,error:null})})}catch(a){if(K(a))return{data:null,error:a};throw a}}async _deleteCustomProvider(t){try{const s=this._encodePathSegment(t);
35return await X(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${s}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(K(s))return{data:null,error:s};throw s}}async _adminListPasskeys(t){At(this.experimental),Xt(t.userId);try{return await X(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(K(s))return{data:null,error:s};throw s}}async _adminDeletePasskey(t){At(this.experimental),Xt(t.userId),Xt(t.passkeyId);try{return await X(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(s){if(K(s))return{data:null,error:s};throw s}}}function Qh(r={}){return{getItem:t=>r[t]||null,setItem:(t,s)=>{r[t]=s},removeItem:t=>{delete r[t]}}}const Ft={debug:!!(globalThis&&ep()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class np extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class Xh extends np{}async function I0(r,t,s){Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",r,t);const a=new globalThis.AbortController;let l;t>0&&(l=setTimeout(()=>{a.abort(),Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",r)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(r,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:a.signal},async u=>{if(u){clearTimeout(l),Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",r,u.name);try{return await s()}finally{Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",r,u.name)}}else{if(t===0)throw Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",r),new Xh(`Acquiring an exclusive Navigator LockManager lock "${r}" immediately failed`);if(Ft.debug)try{const c=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(c,null," "))}catch(c){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",c)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(l),await s()}})}catch(u){if(t>0&&clearTimeout(l),u!==null&&typeof u=="object"&&"name"in u&&u.name==="AbortError"&&t>0){if(a.signal.aborted)return Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",r),console.warn(`@supabase/gotrue-js: Lock "${r}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(r,{mode:"exclusive",steal:!0},async c=>{if(c){Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",r,c.name);try{return await s()}finally{Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",r,c.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await s()}));throw Ft.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",r),new Xh(`Lock "${r}" was released because another request stole it`)}throw u}}function U0(){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 rp(r){if(!/^0x[a-fA-F0-9]{40}$/.test(r))throw new Error(`@supabase/auth-js: Address "${r}" is invalid.`);return r.toLowerCase()}function $0(r){return parseInt(r,16)}function D0(r){const t=new TextEncoder().encode(r);return"0x"+Array.from(t,a=>a.toString(16).padStart(2,"0")).join("")}function M0(r){var t;const{chainId:s,domain:a,expirationTime:l,issuedAt:u=new Date,nonce:c,notBefore:p,requestId:m,resources:g,scheme:w,uri:y,version:_}=r;{if(!Number.isInteger(s))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${s}`);if(!a)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(c&&c.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${c}`);if(!y)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(_!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${_}`);if(!((t=r.statement)===null||t===void 0)&&t.includes(` 36`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${r.statement}`)}const E=rp(r.address),j=w?`${w}://${a}`:a,O=r.statement?`${r.statement} 37`:"",N=`${j} wants you to sign in with your Ethereum account: 38${E} 39 40${O}`;let D=`URI: ${y} 41Version: ${_} 42Chain ID: ${s}${c?` 43Nonce: ${c}`:""} 44Issued At: ${u.toISOString()}`;if(l&&(D+=` 45Expiration Time: ${l.toISOString()}`),p&&(D+=` 46Not Before: ${p.toISOString()}`),m&&(D+=` 47Request ID: ${m}`),g){let M=` 48Resources:`;
48for(const U of g){if(!U||typeof U!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${U}`);M+=` 49- ${U}`}D+=M}return`${N} 50${D}`}class De extends Error{constructor({message:t,code:s,cause:a,name:l}){var u;super(t,{cause:a}),this.__isWebAuthnError=!0,this.name=(u=l??(a instanceof Error?a.name:void 0))!==null&&u!==void 0?u:"Unknown Error",this.code=s}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class _a extends De{constructor(t,s){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:s,message:t}),this.name="WebAuthnUnknownError",this.originalError=s}}function B0({error:r,options:t}){var s,a,l;const{publicKey:u}=t;if(!u)throw Error("options was missing required publicKey property");if(r.name==="AbortError"){if(t.signal instanceof AbortSignal)return new De({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:r})}else if(r.name==="ConstraintError"){if(((s=u.authenticatorSelection)===null||s===void 0?void 0:s.requireResidentKey)===!0)return new De({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:r});if(t.mediation==="conditional"&&((a=u.authenticatorSelection)===null||a===void 0?void 0:a.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:r});if(((l=u.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new De({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:r})}else{if(r.name==="InvalidStateError")return new De({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:r});if(r.name==="NotAllowedError")return new De({message:r.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r});if(r.name==="NotSupportedError")return u.pubKeyCredParams.filter(p=>p.type==="public-key").length===0?new De({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:r}):new De({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:r});if(r.name==="SecurityError"){const c=window.location.hostname;if(sp(c)){if(u.rp.id!==c)return new De({message:`The RP ID "${u.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:r})}else return new De({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:r})}else if(r.name==="TypeError"){if(u.user.id.byteLength<1||u.user.id.byteLength>64)return new De({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:r})}else if(r.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:r})}return new De({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r})}function F0({error:r,options:t}){const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if(r.name==="AbortError"){if(t.signal instanceof AbortSignal)return new De({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:r})}else{if(r.name==="NotAllowedError")return new De({message:r.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r});if(r.name==="SecurityError"){const a=window.location.hostname;if(sp(a)){if(s.rpId!==a)return new De({message:`The RP ID "${s.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:r})}else return new De({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:r})}else if(r.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
50ROR",cause:r})}return new De({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r})}class z0{createNewAbortSignal(){if(this.controller){const s=new Error("Cancelling existing WebAuthn API call for new one");s.name="AbortError",this.controller.abort(s)}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 su=new z0;function Zh(r){if(!r)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(r);const{challenge:t,user:s,excludeCredentials:a}=r,l=Ta(r,["challenge","user","excludeCredentials"]),u=Ar(t).buffer,c=Object.assign(Object.assign({},s),{id:Ar(s.id).buffer}),p=Object.assign(Object.assign({},l),{challenge:u,user:c});if(a&&a.length>0){p.excludeCredentials=new Array(a.length);for(let m=0;m<a.length;m++){const g=a[m];p.excludeCredentials[m]=Object.assign(Object.assign({},g),{id:Ar(g.id).buffer,type:g.type||"public-key",transports:g.transports})}}return p}function ef(r){if(!r)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(r);const{challenge:t,allowCredentials:s}=r,a=Ta(r,["challenge","allowCredentials"]),l=Ar(t).buffer,u=Object.assign(Object.assign({},a),{challenge:l});if(s&&s.length>0){u.allowCredentials=new Array(s.length);for(let c=0;c<s.length;c++){const p=s[c];u.allowCredentials[c]=Object.assign(Object.assign({},p),{id:Ar(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return u}function tf(r){var t;if("toJSON"in r&&typeof r.toJSON=="function")return r.toJSON();const s=r;return{id:r.id,rawId:r.id,response:{attestationObject:Kn(new Uint8Array(r.response.attestationObject)),clientDataJSON:Kn(new Uint8Array(r.response.clientDataJSON))},type:"public-key",clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:(t=s.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function nf(r){var t;if("toJSON"in r&&typeof r.toJSON=="function")return r.toJSON();const s=r,a=r.getClientExtensionResults(),l=r.response;return{id:r.id,rawId:r.id,response:{authenticatorData:Kn(new Uint8Array(l.authenticatorData)),clientDataJSON:Kn(new Uint8Array(l.clientDataJSON)),signature:Kn(new Uint8Array(l.signature)),userHandle:l.userHandle?Kn(new Uint8Array(l.userHandle)):void 0},type:"public-key",clientExtensionResults:a,authenticatorAttachment:(t=s.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function sp(r){return r==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(r)}function ka(){var r,t;return!!(Je()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((r=navigator?.credentials)===null||r===void 0?void 0:r.create)=="function"&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.get)=="function")}async function ip(r){try{const t=await navigator.credentials.create(r);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new _a("Browser returned unexpected credential type",t)}:{data:null,error:new _a("Empty credential response",t)}}catch(t){return{data:null,error:B0({error:t,options:r})}}}async function ap(r){try{const t=await navigator.credentials.get(r);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new _a("Browser returned unexpected credential type",t)}:{data:null,error:new _a("Empty credential response",t)}}catch(t){return{data:null,error:F0({error:t,options:r})}}}const H0={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},W0={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function ba(...r){const t=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),s=l=>l instanceof ArrayBuffer||ArrayBuffer.isView(l),a={};for(const l of r)if(l)for(const u in l){const c=l[u];if(c!==void 0)if(Array.isArray(c))a[u]=c;else if(s(c))a[u]=c;else if(t(c)){const p=a[u];t(p)?a[u]=ba(p,c):a[u]=ba(c)}else a[u]=c}return a}function V0(r,t){return ba(H0,r,t||{})}function q0(r,t){return ba(W0,r,t||{})}class K0{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:s,friendlyName:a,signal:l},u){var c;try{const{data:p,error:m}=await this.client.mfa.challenge({factorId:t,webauthn:s});if(!p)return{data:null,error:m};const g=l??su.createNewAbortSignal();if(p.webauthn.type==="create"){const{user:w}=p.webauthn.credential_options.publicKey;if(!w.name){const y=a;if(y)w.name=`${w.id}:${y}`;else{const E=(await this.client.getUser()).data.user,j=((c=E?.user_metadata)===null||c===void 0?void 0:c.name)||E?.email||E?.id||"User";w.name=`${w.id}:${j}`}}w.displayName||(w.displayName=w.name)}switch(p.webauthn.type){case"create":{const w=V0(p.webauthn.credential_options.publicKey,u?.create),{data:y,error:_}=await ip({publicKey:w,signal:g});return y?{data:{factorId:t,challengeId:p.id,webauthn:{type:p.webauthn.type,credential_response:y}},error:null}:{data:null,error:_}}case"request":{const w=q0(p.webauthn.credential_options.publicKey,u?.request),{data:y,error:_}=await ap(Object.assign(Object.assign({},p.webauthn.credential_options),{publicKey:w,signal:g}));return y?{data:{factorId:t,challengeId:p.id,webauthn:{type:p.webauthn.type,credential_response:y}},error:null}:{data:null,error:_}}}}catch(p){return K(p)?{data:null,error:p}:{data:null,error:new It("Unexpected error in challenge",p)}}}async _verify({challengeId:t,factorId:s,webauthn:a}){return this.client.mfa.verify({factorId:s,challengeId:t,webauthn:a})}async _authenticate({factorId:t,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:l}={}},u){if(!s)return{data:null,error:new Ir("rpId is required for WebAuthn authentication")};try{if(!ka())return{data:null,error:new It("Browser does not support WebAuthn",null)};const{data:c,error:p}=await this.challenge({factorId:t,webauthn:{rpId:s,rpOrigins:a},signal:l},{request:u});if(!c)return{data:null,error:p};const{webauthn:m}=c;return this._verify({factorId:t,challengeId:c.challengeId,webauthn:{type:m.type,rpId:s,rpOrigins:a,credential_response:m.credential_response}})}catch(c){return K(c)?{data:null,error:c}:{data:null,error:new It("Unexpected error in authenticate",c)}}}async _register({friendlyName:t,webauthn:{rpId:s=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:l}={}},u){if(!s)return{data:null,error:new Ir("rpId is required for WebAuthn registration")};try{if(!ka())return{data:null,error:new It("Browser does not support WebAuthn",null)};const{data:c,error:p}=await this._enroll({friendlyName:t});if(!c)return await this.client.mfa.listFactors().then(w=>
50{var y;return(y=w.data)===null||y===void 0?void 0:y.all.find(_=>_.factor_type==="webauthn"&&_.friendly_name===t&&_.status!=="unverified")}).then(w=>w?this.client.mfa.unenroll({factorId:w?.id}):void 0),{data:null,error:p};const{data:m,error:g}=await this._challenge({factorId:c.id,friendlyName:c.friendly_name,webauthn:{rpId:s,rpOrigins:a},signal:l},{create:u});return m?this._verify({factorId:c.id,challengeId:m.challengeId,webauthn:{rpId:s,rpOrigins:a,type:m.webauthn.type,credential_response:m.webauthn.credential_response}}):{data:null,error:g}}catch(c){return K(c)?{data:null,error:c}:{data:null,error:new It("Unexpected error in register",c)}}}}U0();const G0={url:Xy,storageKey:Zy,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:e0,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function rf(r,t,s){return await s()}const Er={};class Hs{get jwks(){var t,s;return(s=(t=Er[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&s!==void 0?s:{keys:[]}}set jwks(t){Er[this.storageKey]=Object.assign(Object.assign({},Er[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,s;return(s=(t=Er[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&s!==void 0?s:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Er[this.storageKey]=Object.assign(Object.assign({},Er[this.storageKey]),{cachedAt:t})}constructor(t){var s,a,l,u;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const c=Object.assign(Object.assign({},G0),t);if(this.storageKey=c.storageKey,this.instanceID=(s=Hs.nextInstanceID[this.storageKey])!==null&&s!==void 0?s:0,Hs.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!c.debug,typeof c.debug=="function"&&(this.logger=c.debug),this.instanceID>0&&Je()){const p=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(p),this.logDebugMessages&&console.trace(p)}if(this.persistSession=c.persistSession,this.autoRefreshToken=c.autoRefreshToken,this.experimental=(a=c.experimental)!==null&&a!==void 0?a:{},this.admin=new L0({url:c.url,headers:c.headers,fetch:c.fetch,experimental:this.experimental}),this.url=c.url,this.headers=c.headers,this.fetch=tp(c.fetch),this.lock=c.lock||rf,this.detectSessionInUrl=c.detectSessionInUrl,this.flowType=c.flowType,this.hasCustomAuthorizationHeader=c.hasCustomAuthorizationHeader,this.throwOnError=c.throwOnError,this.lockAcquireTimeout=c.lockAcquireTimeout,c.lock?this.lock=c.lock:this.persistSession&&Je()&&(!((l=globalThis?.navigator)===null||l===void 0)&&l.locks)?this.lock=I0:this.lock=rf,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 K0(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(c.storage?this.storage=c.storage:ep()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Qh(this.memoryStorage)),c.userStorage&&(this.userStorage=c.userStorage)):(this.memoryStorage={},this.storage=Qh(this.memoryStorage)),Je()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(p){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",p)}(u=this.broadcastChannel)===null||u===void 0||u.addEventListener("message",async p=>{this._debug("received broadcast notification from other tab or client",p);try{await this._notifyAllSubscribers(p.data.event,p.data.session,!1)}catch(m){this._debug("#broadcastChannel","error",m)}})}c.skipAutoInitialize||this.initialize().catch(p=>{this._debug("#initialize()","error",p)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Qf}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let s={},a="none";if(Je()&&(s=p0(window.location.href),this._isImplicitGrantCallback(s)?a="implicit":await this._isPKCECallback(s)&&(a="pkce")),Je()&&this.detectSessionInUrl&&a!=="none"){const{data:l,error:u}=await this._getSessionFromURL(s,a);if(u){if(this._debug("#_initialize()","error detecting session from URL",u),i0(u)){const m=(t=u.details)===null||t===void 0?void 0:t.code;if(m==="identity_already_exists"||m==="identity_not_found"||m==="single_identity_not_deletable")return{error:u}}return{error:u}}const{session:c,redirectType:p}=l;return this._debug("#_initialize()","detected session in URL",c,"redirect type",p),await this._saveSession(c),setTimeout(async()=>{p==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",c):await this._notifyAllSubscribers("SIGNED_IN",c)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(s){return K(s)?this._returnResult({error:s}):this._returnResult({error:new It("Unexpected error during initialization",s)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var s,a,l;try{const u=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(a=(s=t?.options)===null||s===void 0?void 0:s.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:(l=t?.options)===null||l===void 0?void 0:l.captchaToken}},xform:St}),{data:c,error:p}=u;if(p||!c)return this._returnResult({data:{user:null,session:null},error:p});const m=c.session,g=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",m)),this._returnResult({data:{user:g,session:m},error:null})}catch(u){if(K(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signUp(t){var s,a,l;try{let u;if("email"in t){const{email:w,password:y,options:_}=t;let E=null,j=null;this.flowType==="pkce"&&([E,j]=await Sr(this.storage,this.storageKey)),u=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:_?.emailRedirectTo,body:{email:w,password:y,data:(s=_?.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:_?.captchaToken},code_challenge:E,code_challenge_method:j},xform:St})}else if("phone"in t){const{phone:w,password:y,options:_}=t;u=await X(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:w,password:y,data:(a=_?.data)!==null&&a!==void 0?a:{},channel:(l=_?.channel)!==null&&l!==void 0?l:"sms",gotrue_meta_security:{captcha_token:_?.captchaToken}},xform:St})}else throw new ua("You must provide either an email or phone number and a password");const{data:c,error:p}=u;if(p||!c)return await Ge(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:p});const m=c.session,g=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",m)),this._returnResult({data:{user:g,session:m},error:null})}catch(u){if(await Ge(this.storage,`${this.storageKey}-code-verifier`),K(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async signInWithPassword(t){try{let s;if("email"in t){const{email:u,password:c,options:p}=t;s=await X(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:u,password:c,gotrue_meta_security:{captcha_token:p?.captchaToken}},xform:Jh})}else if("phone"in t){const{phone:u,password:c,options:p}=t;s=await X(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:u,password:c,gotrue_meta_security:{captcha_token:p?.captchaToken}},xform:Jh})}else throw new ua("You must provide either an email or phone number and a password");const{data:a,error:l}=s;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a||!a.session||!a.user){const u=new br;return this._returnResult({data:{user:null,session:null},error:u})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign({user:a.user,session:a.session},a.weak_password?{weakPassword:a.weak_password}:null),error:l})}catch(s){if(K(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOAuth(t){var s,a,l,u;return await this._handleProviderSignIn(t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:(u=t.options)===null||u===void 0?void 0:u.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:s}=t;switch(s){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${s}"`)}}async signInWithEthereum(t){var s,a,l,u,c,p,m,g,w,y,_;let E,j;if("message"in t)E=t.message,j=t.signature;else{const{chain:O,wallet:N,statement:D,options:M}=t;let U;if(Je())if(typeof N=="object")U=N;else{const te=window;if("ethereum"in te&&typeof te.ethereum=="object"&&"request"in te.ethereum&&typeof te.ethereum.request=="function")U=te.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 N!="object"||!M?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");U=N}const q=new URL((s=M?.url)!==null&&s!==void 0?s:window.location.href),ue=await U.request({method:"eth_requestAccounts"}).then(te=>
50te).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!ue||ue.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const Y=rp(ue[0]);let oe=(a=M?.signInWithEthereum)===null||a===void 0?void 0:a.chainId;if(!oe){const te=await U.request({method:"eth_chainId"});oe=$0(te)}const ye={domain:q.host,address:Y,statement:D,uri:q.href,version:"1",chainId:oe,nonce:(l=M?.signInWithEthereum)===null||l===void 0?void 0:l.nonce,issuedAt:(c=(u=M?.signInWithEthereum)===null||u===void 0?void 0:u.issuedAt)!==null&&c!==void 0?c:new Date,expirationTime:(p=M?.signInWithEthereum)===null||p===void 0?void 0:p.expirationTime,notBefore:(m=M?.signInWithEthereum)===null||m===void 0?void 0:m.notBefore,requestId:(g=M?.signInWithEthereum)===null||g===void 0?void 0:g.requestId,resources:(w=M?.signInWithEthereum)===null||w===void 0?void 0:w.resources};E=M0(ye),j=await U.request({method:"personal_sign",params:[D0(E),Y]})}try{const{data:O,error:N}=await X(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:E,signature:j},!((y=t.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(_=t.options)===null||_===void 0?void 0:_.captchaToken}}:null),xform:St});if(N)throw N;if(!O||!O.session||!O.user){const D=new br;return this._returnResult({data:{user:null,session:null},error:D})}return O.session&&(await this._saveSession(O.session),await this._notifyAllSubscribers("SIGNED_IN",O.session)),this._returnResult({data:Object.assign({},O),error:N})}catch(O){if(K(O))return this._returnResult({data:{user:null,session:null},error:O});throw O}}async signInWithSolana(t){var s,a,l,u,c,p,m,g,w,y,_,E;let j,O;if("message"in t)j=t.message,O=t.signature;else{const{chain:N,wallet:D,statement:M,options:U}=t;let q;if(Je())if(typeof D=="object")q=D;else{const Y=window;if("solana"in Y&&typeof Y.solana=="object"&&("signIn"in Y.solana&&typeof Y.solana.signIn=="function"||"signMessage"in Y.solana&&typeof Y.solana.signMessage=="function"))q=Y.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 D!="object"||!U?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");q=D}const ue=new URL((s=U?.url)!==null&&s!==void 0?s:window.location.href);if("signIn"in q&&q.signIn){const Y=await q.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},U?.signInWithSolana),{version:"1",domain:ue.host,uri:ue.href}),M?{statement:M}:null));let oe;if(Array.isArray(Y)&&Y[0]&&typeof Y[0]=="object")oe=Y[0];else if(Y&&typeof Y=="object"&&"signedMessage"in Y&&"signature"in Y)oe=Y;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in oe&&"signature"in oe&&(typeof oe.signedMessage=="string"||oe.signedMessage instanceof Uint8Array)&&oe.signature instanceof Uint8Array)j=typeof oe.signedMessage=="string"?oe.signedMessage:new TextDecoder().decode(oe.signedMessage),O=oe.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in q)||typeof q.signMessage!="function"||!("publicKey"in q)||typeof q!="object"||!q.publicKey||!("toBase58"in q.publicKey)||typeof q.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");j=[`${ue.host} wants you to sign in with your Solana account:`,q.publicKey.toBase58(),...M?["",M,""]:[""],"Version: 1",`URI: ${ue.href}`,`Issued At: ${(l=(a=U?.signInWithSolana)===null||a===void 0?void 0:a.issuedAt)!==null&&l!==void 0?l:new Date().toISOString()}`,...!((u=U?.signInWithSolana)===null||u===void 0)&&u.notBefore?[`Not Before: ${U.signInWithSolana.notBefore}`]:[],...!((c=U?.signInWithSolana)===null||c===void 0)&&c.expirationTime?[`Expiration Time: ${U.signInWithSolana.expirationTime}`]:[],...!((p=U?.signInWithSolana)===null||p===void 0)&&p.chainId?[`Chain ID: ${U.signInWithSolana.chainId}`]:[],...!((m=U?.signInWithSolana)===null||m===void 0)&&m.nonce?[`Nonce: ${U.signInWithSolana.nonce}`]:[],...!((g=U?.signInWithSolana)===null||g===void 0)&&g.requestId?[`Request ID: ${U.signInWithSolana.requestId}`]:[],...!((y=(w=U?.signInWithSolana)===null||w===void 0?void 0:w.resources)===null||y===void 0)&&y.length?["Resources",...U.signInWithSolana.resources.map(oe=>`- ${oe}`)]:[]].join(` 51`);const Y=await q.signMessage(new TextEncoder().encode(j),"utf8");if(!Y||!(Y instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");O=Y}}try{const{data:N,error:D}=await X(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:j,signature:Kn(O)},!((_=t.options)===null||_===void 0)&&_.captchaToken?{gotrue_meta_security:{captcha_token:(E=t.options)===null||E===void 0?void 0:E.
51captchaToken}}:null),xform:St});if(D)throw D;if(!N||!N.session||!N.user){const M=new br;return this._returnResult({data:{user:null,session:null},error:M})}return N.session&&(await this._saveSession(N.session),await this._notifyAllSubscribers("SIGNED_IN",N.session)),this._returnResult({data:Object.assign({},N),error:D})}catch(N){if(K(N))return this._returnResult({data:{user:null,session:null},error:N});throw N}}async _exchangeCodeForSession(t){const s=await Vn(this.storage,`${this.storageKey}-code-verifier`),[a,l]=(s??"").split("/");try{if(!a&&this.flowType==="pkce")throw new a0;const{data:u,error:c}=await X(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:a},xform:St});if(await Ge(this.storage,`${this.storageKey}-code-verifier`),c)throw c;if(!u||!u.session||!u.user){const p=new br;return this._returnResult({data:{user:null,session:null,redirectType:null},error:p})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers(l==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u.session)),this._returnResult({data:Object.assign(Object.assign({},u),{redirectType:l??null}),error:c})}catch(u){if(await Ge(this.storage,`${this.storageKey}-code-verifier`),K(u))return this._returnResult({data:{user:null,session:null,redirectType:null},error:u});throw u}}async signInWithIdToken(t){try{const{options:s,provider:a,token:l,access_token:u,nonce:c}=t,p=await X(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:a,id_token:l,access_token:u,nonce:c,gotrue_meta_security:{captcha_token:s?.captchaToken}},xform:St}),{data:m,error:g}=p;if(g)return this._returnResult({data:{user:null,session:null},error:g});if(!m||!m.session||!m.user){const w=new br;return this._returnResult({data:{user:null,session:null},error:w})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:m,error:g})}catch(s){if(K(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithOtp(t){var s,a,l,u,c;try{if("email"in t){const{email:p,options:m}=t;let g=null,w=null;this.flowType==="pkce"&&([g,w]=await Sr(this.storage,this.storageKey));const{error:y}=await X(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:p,data:(s=m?.data)!==null&&s!==void 0?s:{},create_user:(a=m?.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:m?.captchaToken},code_challenge:g,code_challenge_method:w},redirectTo:m?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:y})}if("phone"in t){const{phone:p,options:m}=t,{data:g,error:w}=await X(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:p,data:(l=m?.data)!==null&&l!==void 0?l:{},create_user:(u=m?.shouldCreateUser)!==null&&u!==void 0?u:!0,gotrue_meta_security:{captcha_token:m?.captchaToken},channel:(c=m?.channel)!==null&&c!==void 0?c:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:g?.message_id},error:w})}throw new ua("You must provide either an email or phone number.")}catch(p){if(await Ge(this.storage,`${this.storageKey}-code-verifier`),K(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}}async verifyOtp(t){var s,a;try{let l,u;"options"in t&&(l=(s=t.options)===null||s===void 0?void 0:s.redirectTo,u=(a=t.options)===null||a===void 0?void 0:a.captchaToken);const{data:c,error:p}=await X(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:u}}),redirectTo:l,xform:St});if(p)throw p;if(!c)throw new Error("An error occurred on token verification.");const m=c.session,g=c.user;return m?.access_token&&(await this._saveSession(m),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",m)),this._returnResult({data:{user:g,session:m},error:null})}catch(l){if(K(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async signInWithSSO(t){var s,a,l,u,c;try{let p=null,m=null;this.flowType==="pkce"&&([p,m]=await Sr(this.storage,this.storageKey));const g=await X(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:(a=(s=t.options)===null||s===void 0?void 0:s.redirectTo)!==null&&a!==void 0?a:void 0}),!((l=t?.options)===null||l===void 0)&&l.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:p,code_challenge_method:m}),headers:this.headers,xform:R0});return!((u=g.data)===null||u===void 0)&&u.url&&Je()&&!(!((c=t.options)===null||c===void 0)&&c.skipBrowserRedirect)&&window.location.assign(g.data.url),this._returnResult(g)}catch(p){if(await Ge(this.storage,`${this.storageKey}-code-verifier`),K(p))return this._returnResult({data:null,error:p});throw p}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:s},error:a}=t;if(a)throw a;if(!s)throw new Ve;const{error:l}=await X(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:s.access_token});return this._returnResult({data:{user:null,session:null},error:l})})}catch(t){if(K(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const s=`${this.url}/resend`;if("email"in t){const{email:a,type:l,options:u}=t,{error:c}=await X(this.fetch,"POST",s,{headers:this.headers,body:{email:a,type:l,gotrue_meta_security:{captcha_token:u?.captchaToken}},redirectTo:u?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:c})}else if("phone"in t){const{phone:a,type:l,options:u}=t,{data:c,error:p}=await X(this.fetch,"POST",s,{headers:this.headers,body:{phone:a,type:l,gotrue_meta_security:{captcha_token:u?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:c?.message_id},error:p})}throw new ua("You must provide either an email or phone number and a type")}catch(s){if(K(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async s=>s))}async _acquireLock(t,s){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const a=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),l=(async()=>(await a,await s()))();return this.pendingInLock.push((async()=>{try{await l}catch{}})()),l}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const a=s();for(this.pendingInLock.push((async()=>{try{await a}catch{}})()),await a;this.pendingInLock.length;){const l=[...this.pendingInLock];await Promise.all(l),this.pendingInLock.splice(0,l.length)}return await a}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 s=await this.__loadSession();return await t(s)}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 s=await Vn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",s),s!==null&&(this._isValidSession(s)?t=s:(this._debug("#getSession()","session from storage is not val
51id"),await this._removeSession())),!t)return{data:{session:null},error:null};const a=t.expires_at?t.expires_at*1e3-Date.now()<Ll:!1;if(this._debug("#__loadSession()",`session has${a?"":" not"} expired`,"expires_at",t.expires_at),!a){if(this.userStorage){const c=await Vn(this.userStorage,this.storageKey+"-user");c?.user?t.user=c.user:t.user=Ul()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const c={value:this.suppressGetSessionWarning};t.user=C0(t.user,c),c.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:l,error:u}=await this._callRefreshToken(t.refresh_token);return u?this._returnResult({data:{session:null},error:u}):this._returnResult({data:{session:l},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const s=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return s.data.user&&(this.suppressGetSessionWarning=!0),s}async _getUser(t){try{return t?await X(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Cn}):await this._useSession(async s=>{var a,l,u;const{data:c,error:p}=s;if(p)throw p;return!(!((a=c.session)===null||a===void 0)&&a.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Ve}:await X(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(u=(l=c.session)===null||l===void 0?void 0:l.access_token)!==null&&u!==void 0?u:void 0,xform:Cn})})}catch(s){if(K(s))return la(s)&&(await this._removeSession(),await Ge(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:s});throw s}}async updateUser(t,s={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,s))}async _updateUser(t,s={}){try{return await this._useSession(async a=>{const{data:l,error:u}=a;if(u)throw u;if(!l.session)throw new Ve;const c=l.session;let p=null,m=null;this.flowType==="pkce"&&t.email!=null&&([p,m]=await Sr(this.storage,this.storageKey));const{data:g,error:w}=await X(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:s?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:p,code_challenge_method:m}),jwt:c.access_token,xform:Cn});if(w)throw w;return c.user=g.user,await this._saveSession(c),await this._notifyAllSubscribers("USER_UPDATED",c),this._returnResult({data:{user:c.user},error:null})})}catch(a){if(await Ge(this.storage,`${this.storageKey}-code-verifier`),K(a))return this._returnResult({data:{user:null},error:a});throw a}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Ve;const s=Date.now()/1e3;let a=s,l=!0,u=null;const{payload:c}=da(t.access_token);if(c.exp&&(a=c.exp,l=a<=s),l){const{data:p,error:m}=await this._callRefreshToken(t.refresh_token);if(m)return this._returnResult({data:{user:null,session:null},error:m});if(!p)return{data:{user:null,session:null},error:null};u=p}else{const{data:p,error:m}=await this._getUser(t.access_token);if(m)return this._returnResult({data:{user:null,session:null},error:m});u={access_token:t.access_token,refresh_token:t.refresh_token,user:p.user,token_type:"bearer",expires_in:a-s,expires_at:a},await this._saveSession(u),await this._notifyAllSubscribers("SIGNED_IN",u)}return this._returnResult({data:{user:u.user,session:u},error:null})}catch(s){if(K(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async s=>{var a;if(!t){const{data:c,error:p}=s;if(p)throw p;t=(a=c.session)!==null&&a!==void 0?a:void 0}if(!t?.refresh_token)throw new Ve;const{data:l,error:u}=await this._callRefreshToken(t.refresh_token);return u?this._returnResult({data:{user:null,session:null},error:u}):l?this._returnResult({data:{user:l.user,session:l},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(s){if(K(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async _getSessionFromURL(t,s){var a;try{if(!Je())throw new ca("No browser detected.");
51if(t.error||t.error_description||t.error_code)throw new ca(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(s){case"implicit":if(this.flowType==="pkce")throw new zh("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ca("Not a valid implicit grant flow url.");break;default:}if(s==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new zh("No code detected.");const{data:U,error:q}=await this._exchangeCodeForSession(t.code);if(q)throw q;const ue=new URL(window.location.href);return ue.searchParams.delete("code"),window.history.replaceState(window.history.state,"",ue.toString()),{data:{session:U.session,redirectType:(a=U.redirectType)!==null&&a!==void 0?a:null},error:null}}const{provider_token:l,provider_refresh_token:u,access_token:c,refresh_token:p,expires_in:m,expires_at:g,token_type:w}=t;if(!c||!m||!p||!w)throw new ca("No session defined in URL");const y=Math.round(Date.now()/1e3),_=parseInt(m);let E=y+_;g&&(E=parseInt(g));const j=E-y;j*1e3<=Nr&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${j}s, should have been closer to ${_}s`);const O=E-_;y-O>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",O,E,y):y-O<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",O,E,y);const{data:N,error:D}=await this._getUser(c);if(D)throw D;const M={provider_token:l,provider_refresh_token:u,access_token:c,expires_in:_,expires_at:E,refresh_token:p,token_type:w,user:N.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:M,redirectType:t.type},error:null})}catch(l){if(K(l))return this._returnResult({data:{session:null,redirectType:null},error:l});throw l}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const s=await Vn(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&s)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async s=>{var a;const{data:l,error:u}=s;if(u&&!la(u))return this._returnResult({error:u});const c=(a=l.session)===null||a===void 0?void 0:a.access_token;if(c){const{error:p}=await this.admin.signOut(c,t);if(p&&!(s0(p)&&(p.status===404||p.status===401||p.status===403)||la(p)))return this._returnResult({error:p})}return t!=="others"&&(await this._removeSession(),await Ge(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const s=f0(),a={id:s,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",s),this.stateChangeEmitters.delete(s)}};return this._debug("#onAuthStateChange()","registered callback with id",s),this.stateChangeEmitters.set(s,a),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(s)})))(),{data:{subscription:a}}}async _emitInitialSession(t){return await this._useSession(async s=>{var a,l;try{const{data:{session:u},error:c}=s;if(c)throw c;await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",u)),this._debug("INITIAL_SESSION","callback id",t,"session",u)}catch(u){await((l=this.stateChangeEmitters.get(t))===null||l===void 0?void 0:l.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",u),la(u)?console.warn(u):console.error(u)}})}async resetPasswordForEmail(t,s={}){let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Sr(this.storage,this.storageKey,!0));try{return await X(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:a,code_challenge_method:l,gotrue_meta_security:{captcha_token:s.captchaToken}},headers:this.headers,redirectTo:s.redirectTo})}catch(u){if(await Ge(this.storage,`${this.storageKey}-code-verifier`),K(u))return this._returnResult({data:null,error:u});throw u}}async getUserIdentities(){var t;try{const{data:s,error:a}=await this.getUser();if(a)throw a;return this._returnResult({data:{identities:(t=s.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var s;try{const{data:a,error:l}=await this._useSession(async u=>{var c,p,m,g,w;const{data:y,error:_}=u;if(_)throw _;const E=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(c=t.options)===null||c===void 0?void 0:c.redirectTo,scopes:(p=t.options)===null||p===void 0?void 0:p.scopes,queryParams:(m=t.options)===null||m===void 0?void 0:m.queryParams,skipBrowserRedirect:!0});return await X(this.fetch,"GET",E,{headers:this.headers,jwt:(w=(g=y.session)===null||g===void 0?void 0:g.access_token)!==null&&w!==void 0?w:void 0})});if(l)throw l;return Je()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(a?.url),this._returnResult({data:{provider:t.provider,url:a?.url},error:null})}catch(a){if(K(a))return this._returnResult({data:{provider:t.provider,url:null},error:a});throw a}}async linkIdentityIdToken(t){return await this._useSession(async s=>{var a;try{const{error:l,data:{session:u}}=s;if(l)throw l;const{options:c,provider:p,token:m,access_token:g,nonce:w}=t,y=await X(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(a=u?.access_token)!==null&&a!==void 0?a:void 0,body:{provider:p,id_token:m,access_token:g,nonce:w,link_identity:!0,gotrue_meta_security:{captcha_token:c?.captchaToken}},xform:St}),{data:_,error:E}=y;return E?this._returnResult({data:{user:null,session:null},error:E}):!_||!_.session||!_.user?this._returnResult({data:{user:null,session:null},error:new br}):(_.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("USER_UPDATED",_.
51session)),this._returnResult({data:_,error:E}))}catch(l){if(await Ge(this.storage,`${this.storageKey}-code-verifier`),K(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}})}async unlinkIdentity(t){try{return await this._useSession(async s=>{var a,l;const{data:u,error:c}=s;if(c)throw c;return await X(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(l=(a=u.session)===null||a===void 0?void 0:a.access_token)!==null&&l!==void 0?l:void 0})})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async _refreshAccessToken(t){const s=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{const a=Date.now();return await v0(async l=>(l>0&&await g0(200*Math.pow(2,l-1)),this._debug(s,"refreshing attempt",l),await X(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:St})),(l,u)=>{const c=200*Math.pow(2,l);return u&&Il(u)&&Date.now()+c-a<Nr})}catch(a){if(this._debug(s,"error",a),K(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}finally{this._debug(s,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,s){const a=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:s.redirectTo,scopes:s.scopes,queryParams:s.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",s,"url",a),Je()&&!s.skipBrowserRedirect&&window.location.assign(a),{data:{provider:t,url:a},error:null}}async _recoverAndRefresh(){var t,s;const a="#_recoverAndRefresh()";this._debug(a,"begin");try{const l=await Vn(this.storage,this.storageKey);if(l&&this.userStorage){let c=await Vn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!c&&(c={user:l.user},await Rr(this.userStorage,this.storageKey+"-user",c)),l.user=(t=c?.user)!==null&&t!==void 0?t:Ul()}else if(l&&!l.user&&!l.user){const c=await Vn(this.storage,this.storageKey+"-user");c&&c?.user?(l.user=c.user,await Ge(this.storage,this.storageKey+"-user"),await Rr(this.storage,this.storageKey,l)):l.user=Ul()}if(this._debug(a,"session from storage",l),!this._isValidSession(l)){this._debug(a,"session is not valid"),l!==null&&await this._removeSession();return}const u=((s=l.expires_at)!==null&&s!==void 0?s:1/0)*1e3-Date.now()<Ll;if(this._debug(a,`session has${u?"":" not"} expired with margin of ${Ll}s`),u){if(this.autoRefreshToken&&l.refresh_token){const{error:c}=await this._callRefreshToken(l.refresh_token);c&&(console.error(c),Il(c)||(this._debug(a,"refresh failed with a non-retryable error, removing the session",c),await this._removeSession()))}}else if(l.user&&l.user.__isUserNotAvailableProxy===!0)try{const{data:c,error:p}=await this._getUser(l.access_token);!p&&c?.user?(l.user=c.user,await this._saveSession(l),await this._notifyAllSubscribers("SIGNED_IN",l)):this._debug(a,"could not get user data, skipping SIGNED_IN notification")}catch(c){console.error("Error getting user data:",c),this._debug(a,"error getting user data, skipping SIGNED_IN notification",c)}else await this._notifyAllSubscribers("SIGNED_IN",l)}catch(l){this._debug(a,"error",l),console.error(l);return}finally{this._debug(a,"end")}}async _callRefreshToken(t){var s,a;if(!t)throw new Ve;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const l=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(l,"begin");try{this.refreshingDeferred=new Ra;const{data:u,error:c}=await this._refreshAccessToken(t);if(c)throw c;if(!u.session)throw new Ve;await this._saveSession(u.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",u.session);const p={data:u.session,error:null};return this.refreshingDeferred.resolve(p),p}catch(u){if(this._debug(l,"error",u),K(u)){const c={data:null,error:u};return Il(u)||await this._removeSession(),(s=this.refreshingDeferred)===null||s===void 0||s.resolve(c),c}throw(a=this.refreshingDeferred)===null||a===void 0||a.reject(u),u}finally{this.refreshingDeferred=null,this._debug(l,"end")}}async _notifyAllSubscribers(t,s,a=!0){const l=`#_notifyAllSubscribers(${t})`;this._debug(l,"begin",s,`broadcast = ${a}`);try{this.broadcastChannel&&a&&this.broadcastChannel.postMessage({event:t,session:s});const u=[],c=Array.from(this.stateChangeEmitters.values()).map(async p=>{try{await p.callback(t,s)}catch(m){u.push(m)}});if(await Promise.all(c),u.length>0){for(let p=0;p<u.length;p+=1)console.error(u[p]);throw u[0]}}finally{this._debug(l,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Ge(this.storage,`${this.storageKey}-code-verifier`);const s=Object.assign({},t),a=s.user&&s.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!a&&s.user&&await Rr(this.userStorage,this.storageKey+"-user",{user:s.user});const l=Object.assign({},s);delete l.user;const u=Kh(l);await Rr(this.storage,this.storageKey,u)}else{const l=Kh(s);await Rr(this.storage,this.storageKey,l)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Ge(this.storage,this.storageKey),await Ge(this.storage,this.storageKey+"-code-verifier"),await Ge(this.storage,this.storageKey+"-user"),this.userStorage&&await Ge(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Je()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}
51catch(s){console.error("removing visibilitychange callback failed",s)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Nr);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const s=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=s,s&&typeof s=="object"&&typeof s.unref=="function"?s.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(s)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const s=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,s&&clearTimeout(s)}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 s=>{const{data:{session:a}}=s;if(!a||!a.refresh_token||!a.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const l=Math.floor((a.expires_at*1e3-t)/Nr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${l} ticks, a tick lasts ${Nr}ms, refresh threshold is ${eu} ticks`),l<=eu&&await this._callRefreshToken(a.refresh_token)})}catch(s){console.error("Auto refresh tick failed with error. This is likely a transient error.",s)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof np)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Je()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const s=`#_onVisibilityChanged(${t})`;this._debug(s,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(s,"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,s,a){const l=[`provider=${encodeURIComponent(s)}`];if(a?.redirectTo&&l.push(`redirect_to=${encodeURIComponent(a.redirectTo)}`),a?.scopes&&l.push(`scopes=${encodeURIComponent(a.scopes)}`),this.flowType==="pkce"){const[u,c]=await Sr(this.storage,this.storageKey),p=new URLSearchParams({code_challenge:`${encodeURIComponent(u)}`,code_challenge_method:`${encodeURIComponent(c)}`});l.push(p.toString())}if(a?.queryParams){const u=new URLSearchParams(a.queryParams);l.push(u.toString())}return a?.skipBrowserRedirect&&l.push(`skip_http_redirect=${a.skipBrowserRedirect}`),`${t}?${l.join("&")}`}async _unenroll(t){try{return await this._useSession(async s=>{var a;const{data:l,error:u}=s;return u?this._returnResult({data:null,error:u}):await X(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(a=l?.session)===null||a===void 0?void 0:a.access_token})})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async _enroll(t){try{return await this._useSession(async s=>{var a,l;const{data:u,error:c}=s;if(c)return this._returnResult({data:null,error:c});const p=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:m,error:g}=await X(this.fetch,"POST",`${this.url}/factors`,{body:p,headers:this.headers,jwt:(a=u?.session)===null||a===void 0?void 0:a.access_token});return g?this._returnResult({data:null,error:g}):(t.factorType==="totp"&&m.type==="totp"&&(!((l=m?.totp)===null||l===void 0)&&l.qr_code)&&(m.totp.qr_code=`data:image/svg+xml;utf-8,${m.totp.qr_code}`),this._returnResult({data:m,error:null}))})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async s=>{var a;const{data:l,error:u}=s;if(u)return this._returnResult({data:null,error:u});const c=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?tf(t.webauthn.credential_response):nf(t.webauthn.credential_response)})}:{code:t.code}),{data:p,error:m}=await X(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:c,headers:this.headers,jwt:(a=l?.session)===null||a===void 0?void 0:a.access_token});return m?this._returnResult({data:null,error:m}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+p.expires_in},p)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",p),this._returnResult({data:p,error:m}))})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async s=>{var a;const{data:l,error:u}=s;if(u)return this._returnResult({data:null,error:u});const c=await X(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(a=l?.session)===null||a===void 0?void 0:a.access_token});if(c.error)return c;const{data:p}=c;if(p.type!=="webauthn")return{data:p,error:null};switch(p.webauthn.type){case"create":return{data:Object.assign(Object.assign({},p),{webauthn:Object.assign(Object.assign({},p.webauthn),{credential_options:Object.assign(Object.assign({},p.webauthn.credential_options),{publicKey:Zh(p.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},p),{webauthn:Object.assign(Object.assign({},p.webauthn),{credential_options:Object.assign(Object.assign({},p.webauthn.credential_options),{publicKey:ef(p.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}})}async _challengeAndVerify(t){const{data:s,error:a}=await this._challenge({factorId:t.factorId});return a?this._returnResult({data:null,error:a}):await this._verify({factorId:t.factorId,challengeId:s.id,code:t.code})}async _listFactors(){var t;const{data:{user:s},error:a}=await this.getUser();if(a)return{data:null,error:a};const l={all:[],phone:[],totp:[],webauthn:[]};for(const u of(t=s?.factors)!==null&&t!==void 0?t:[])l.all.push(u),u.status==="verified"&&l[u.factor_type].push(u);return{data:l,error:null}}async _getAuthenticatorAssuranceLevel(t){var s,a,l,u;if(t)try{const{payload:E}=da(t);let j=null;E.aal&&(j=E.aal);let O=j;const{data:{user:N},error:D}=await this.getUser(t);if(D)return this._returnResult({data:null,error:D});((a=(s=N?.factors)===null||s===void 0?void 0:s.filter(q=>q.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(O="aal2");const U=E.amr||[];return{data:{currentLevel:j,nextLevel:O,currentAuthenticationMethods:U},error:null}}
51catch(E){if(K(E))return this._returnResult({data:null,error:E});throw E}const{data:{session:c},error:p}=await this.getSession();if(p)return this._returnResult({data:null,error:p});if(!c)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:m}=da(c.access_token);let g=null;m.aal&&(g=m.aal);let w=g;((u=(l=c.user.factors)===null||l===void 0?void 0:l.filter(E=>E.status==="verified"))!==null&&u!==void 0?u:[]).length>0&&(w="aal2");const _=m.amr||[];return{data:{currentLevel:g,nextLevel:w,currentAuthenticationMethods:_},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async s=>{const{data:{session:a},error:l}=s;return l?this._returnResult({data:null,error:l}):a?await X(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:a.access_token,xform:u=>({data:u,error:null})}):this._returnResult({data:null,error:new Ve})})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async _approveAuthorization(t,s){try{return await this._useSession(async a=>{const{data:{session:l},error:u}=a;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new Ve});const c=await X(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:l.access_token,body:{action:"approve"},xform:p=>({data:p,error:null})});
51return c.data&&c.data.redirect_url&&Je()&&!s?.skipBrowserRedirect&&window.location.assign(c.data.redirect_url),c})}catch(a){if(K(a))return this._returnResult({data:null,error:a});throw a}}async _denyAuthorization(t,s){try{return await this._useSession(async a=>{const{data:{session:l},error:u}=a;if(u)return this._returnResult({data:null,error:u});if(!l)return this._returnResult({data:null,error:new Ve});const c=await X(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:l.access_token,body:{action:"deny"},xform:p=>({data:p,error:null})});return c.data&&c.data.redirect_url&&Je()&&!s?.skipBrowserRedirect&&window.location.assign(c.data.redirect_url),c})}catch(a){if(K(a))return this._returnResult({data:null,error:a});throw a}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:s},error:a}=t;return a?this._returnResult({data:null,error:a}):s?await X(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,xform:l=>({data:l,error:null})}):this._returnResult({data:null,error:new Ve})})}catch(t){if(K(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async s=>{const{data:{session:a},error:l}=s;return l?this._returnResult({data:null,error:l}):a?(await X(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Ve})})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async fetchJwk(t,s={keys:[]}){let a=s.keys.find(p=>p.kid===t);if(a)return a;const l=Date.now();if(a=this.jwks.keys.find(p=>p.kid===t),a&&this.jwks_cached_at+n0>l)return a;const{data:u,error:c}=await X(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(c)throw c;return!u.keys||u.keys.length===0||(this.jwks=u,this.jwks_cached_at=l,a=u.keys.find(p=>p.kid===t),!a)?null:a}async getClaims(t,s={}){try{let a=t;if(!a){const{data:E,error:j}
51=await this.getSession();if(j||!E.session)return this._returnResult({data:null,error:j});a=E.session.access_token}const{header:l,payload:u,signature:c,raw:{header:p,payload:m}}=da(a);s?.allowExpired||S0(u.exp);const g=!l.alg||l.alg.startsWith("HS")||!l.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(l.kid,s?.keys?{keys:s.keys}:s?.jwks);if(!g){const{error:E}=await this.getUser(a);if(E)throw E;return{data:{claims:u,header:l,signature:c},error:null}}const w=E0(l.alg),y=await crypto.subtle.importKey("jwk",g,w,!0,["verify"]);if(!await crypto.subtle.verify(w,y,c,d0(`${p}.${m}`)))throw new ru("Invalid JWT signature");return{data:{claims:u,header:l,signature:c},error:null}}catch(a){if(K(a))return this._returnResult({data:null,error:a});throw a}}async signInWithPasskey(t){var s,a,l;At(this.experimental);try{if(!ka())return this._returnResult({data:null,error:new It("Browser does not support WebAuthn",null)});const{data:u,error:c}=await this._startPasskeyAuthentication({options:{captchaToken:(s=t?.options)===null||s===void 0?void 0:s.captchaToken}});if(c||!u)return this._returnResult({data:null,error:c});const p=ef(u.options),m=(l=(a=t?.options)===null||a===void 0?void 0:a.signal)!==null&&l!==void 0?l:su.createNewAbortSignal(),{data:g,error:w}=await ap({publicKey:p,signal:m});if(w||!g)return this._returnResult({data:null,error:w??new It("WebAuthn ceremony failed",null)});const y=nf(g);return this._verifyPasskeyAuthentication({challengeId:u.challenge_id,credential:y})}catch(u){if(K(u))return this._returnResult({data:null,error:u});throw u}}async registerPasskey(t){var s,a;At(this.experimental);try{if(!ka())return this._returnResult({data:null,error:new It("Browser does not support WebAuthn",null)});const{data:l,error:u}=await this._startPasskeyRegistration();if(u||!l)return this._returnResult({data:null,error:u});const c=Zh(l.options),p=(a=(s=t?.options)===null||s===void 0?void 0:s.signal)!==null&&a!==void 0?a:su.createNewAbortSignal(),{data:m,error:g}=await ip({publicKey:c,signal:p});if(g||!m)return this._returnResult({data:null,error:g??new It("WebAuthn ceremony failed",null)});const w=tf(m);return this._verifyPasskeyRegistration({challengeId:l.challenge_id,credential:w})}catch(l){if(K(l))return this._returnResult({data:null,error:l});throw l}}async _startPasskeyRegistration(){At(this.experimental);try{return await this._useSession(async t=>{const{data:{session:s},error:a}=t;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new Ve});const{data:l,error:u}=await X(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:s.access_token,body:{}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:l,error:null})})}catch(t){if(K(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){At(this.experimental);try{return await this._useSession(async s=>{const{data:{session:a},error:l}=s;if(l)return this._returnResult({data:null,error:l});if(!a)return this._returnResult({data:null,error:new Ve});const{data:u,error:c}=await X(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:a.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:u,error:null})})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyAuthentication(t){var s;At(this.experimental);try{const{data:a,error:l}=await X(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(s=t?.options)===null||s===void 0?void 0:s.captchaToken}}});return l?this._returnResult({data:null,error:l}):this._returnResult({data:a,error:null})}catch(a){if(K(a))return this._returnResult({data:null,error:a});throw a}}async _verifyPasskeyAuthentication(t){At(this.experimental);try{const{data:s,error:a}=await X(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:St});return a?this._returnResult({data:null,error:a}):(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:s,error:null}))}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async _listPasskeys(){At(this.experimental);try{return await this._useSession(async t=>{const{data:{session:s},error:a}=t;if(a)return this._returnResult({data:null,error:a});if(!s)return this._returnResult({data:null,error:new Ve});const{data:l,error:u}=await X(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:s.access_token,xform:c=>({data:c,error:null})});return u?this._returnResult({data:null,error:u}):this._returnResult({data:l,error:null})})}catch(t){if(K(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){At(this.experimental);try{return await this._useSession(async s=>{const{data:{session:a},error:l}=s;if(l)return this._returnResult({data:null,error:l});if(!a)return this._returnResult({data:null,error:new Ve});const{data:u,error:c}=await X(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:a.access_token,body:{friendly_name:t.friendlyName}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:u,error:null})})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}async _deletePasskey(t){At(this.experimental);try{return await this._useSession(async s=>{const{data:{session:a},error:l}=s;if(l)return this._returnResult({data:null,error:l});if(!a)return this._returnResult({data:null,error:new Ve});const{error:u}
51=await X(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:a.access_token,noResolveJson:!0});return u?this._returnResult({data:null,error:u}):this._returnResult({data:null,error:null})})}catch(s){if(K(s))return this._returnResult({data:null,error:s});throw s}}}Hs.nextInstanceID={};const J0=Hs,Y0="2.106.1";let Os="";typeof Deno<"u"?Os="deno":typeof document<"u"?Os="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Os="react-native":Os="node";const Q0={"X-Client-Info":`supabase-js-${Os}/${Y0}`},X0={headers:Q0},Z0={schema:"public"},ew={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},tw={},nw={enabled:!1,respectSamplingDecision:!0};function rw(r,t,s,a){function l(u){return u instanceof s?u:new s(function(c){c(u)})}return new(s||(s=Promise))(function(u,c){function p(w){try{g(a.next(w))}catch(y){c(y)}}function m(w){try{g(a.throw(w))}catch(y){c(y)}}function g(w){w.done?u(w.value):l(w.value).then(p,m)}g((a=a.apply(r,[])).next())})}let Dl=null;const sw="@opentelemetry/api";function iw(){return Dl===null&&(Dl=import(sw).catch(()=>null)),Dl}function aw(){return rw(this,void 0,void 0,function*(){try{const r=yield iw();if(!r||!r.propagation||!r.context)return null;const t={};r.propagation.inject(r.context.active(),t);const s=t.traceparent;return s?{traceparent:s,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function ow(r){if(!r||typeof r!="string")return null;const t=r.split("-");if(t.length!==4)return null;const[s,a,l,u]=t;if(s.length!==2||a.length!==32||l.length!==16||u.length!==2)return null;const c=/^[0-9a-f]+$/i;return!c.test(s)||!c.test(a)||!c.test(l)||!c.test(u)||a==="00000000000000000000000000000000"||l==="0000000000000000"?null:{version:s,traceId:a,parentId:l,traceFlags:u,isSampled:(parseInt(u,16)&1)===1}}function lw(r,t){if(!r||!t||t.length===0)return!1;let s;if(r instanceof URL)s=r;else try{s=new URL(r)}catch{return!1}for(const a of t)try{if(typeof a=="string"){if(uw(s.hostname,a))return!0}else if(a instanceof RegExp){if(a.test(s.hostname))return!0}else if(typeof a=="function"&&a(s))return!0}catch{continue}return!1}function uw(r,t){if(t===r)return!0;if(t.startsWith("*.")){const s=t.slice(2);if(r.endsWith(s)&&(r===s||r.endsWith("."+s)))return!0}return!1}function cw(r){const t=[];try{const s=new URL(r);t.push(s.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function Ws(r){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(r)}function dw(r,t){if(Ws(r)!="object"||!r)return r;var s=r[Symbol.toPrimitive];if(s!==void 0){var a=s.call(r,t);if(Ws(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function hw(r){var t=dw(r,"string");return Ws(t)=="symbol"?t:t+""}function fw(r,t,s){return(t=hw(t))in r?Object.defineProperty(r,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[t]=s,r}function sf(r,t){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),s.push.apply(s,a)}return s}function Ae(r){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?sf(Object(s),!0).forEach(function(a){fw(r,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(s)):sf(Object(s)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(s,a))})}return r}const pw=r=>r?(...t)=>r(...t):(...t)=>fetch(...t),mw=()=>Headers,gw=(r,t,s,a,l)=>{const u=pw(a),c=mw(),p=l?.enabled===!0,m=l?.respectSamplingDecision!==!1,g=p?cw(t):null;return async(w,y)=>{var _;const E=(_=await s())!==null&&_!==void 0?_:r;let j=new c(y?.headers);if(j.has("apikey")||j.set("apikey",r),j.has("Authorization")||j.set("Authorization",`Bearer ${E}`),g){const O=await vw(w,g,m);O&&(O.traceparent&&!j.has("traceparent")&&j.set("traceparent",O.traceparent),O.tracestate&&!j.has("tracestate")&&j.set("tracestate",O.tracestate),O.baggage&&!j.has("baggage")&&j.set("baggage",O.baggage))}return u(w,Ae(Ae({},y),{},{headers:j}))}};async function vw(r,t,s){if(!lw(typeof r=="string"||r instanceof URL?r:r.url,t))return null;const a=await aw();if(!a||!a.traceparent)return null;if(s){const l=ow(a.traceparent);if(l&&!l.isSampled)return null}return a}function af(r){return typeof r=="boolean"?{enabled:r}:r}function yw(r){return r.endsWith("/")?r:r+"/"}function ww(r,t){var s,a,l,u,c,p;const{db:m,auth:g,realtime:w,global:y}=r,{db:_,auth:E,realtime:j,global:O}=t,N=af(r.tracePropagation),D=af(t.tracePropagation),M={db:Ae(Ae({},_),m),auth:Ae(Ae({},E),g),realtime:Ae(Ae({},j),w),storage:{},global:Ae(Ae(Ae({},O),y),{},{headers:Ae(Ae({},(s=O?.headers)!==null&&s!==void 0?s:{}),(a=y?.headers)!==null&&a!==void 0?a:{})}),tracePropagation:{enabled:(l=(u=N?.enabled)!==null&&u!==void 0?u:D?.enabled)!==null&&l!==void 0?l:!1,respectSamplingDecision:(c=(p=N?.respectSamplingDecision)!==null&&p!==void 0?p:D?.respectSamplingDecision)!==null&&c!==void 0?c:!0},accessToken:async()=>""};return r.accessToken?M.accessToken=r.accessToken:delete M.accessToken,M}function xw(r){const t=r?.trim();if(!t)throw new Error("supabaseUrl is required.");
51if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(yw(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var _w=class extends J0{constructor(r){super(r)}},kw=class{constructor(r,t,s){var a,l;this.supabaseUrl=r,this.supabaseKey=t;const u=xw(r);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",u),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",u),this.storageUrl=new URL("storage/v1",u),this.functionsUrl=new URL("functions/v1",u);const c=`sb-${u.hostname.split(".")[0]}-auth-token`,p={db:Z0,realtime:tw,auth:Ae(Ae({},ew),{},{storageKey:c}),global:X0,tracePropagation:nw},m=ww(s??{},p);if(this.settings=m,this.storageKey=(a=m.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(l=m.global.headers)!==null&&l!==void 0?l:{},m.accessToken)this.accessToken=m.accessToken,this.auth=new Proxy({},{get:(w,y)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(y)} is not possible`)}});else{var g;this.auth=this._initSupabaseAuthClient((g=m.auth)!==null&&g!==void 0?g:{},this.headers,m.global.fetch)}this.fetch=gw(t,r,this._getAccessToken.bind(this),m.global.fetch,m.tracePropagation),this.realtime=this._initRealtimeClient(Ae({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},m.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(w=>this.realtime.setAuth(w)).catch(w=>console.warn("Failed to set initial Realtime auth token:",w)),this.rest=new Dv(new URL("rest/v1",u).href,{headers:this.headers,schema:m.db.schema,fetch:this.fetch,timeout:m.db.timeout,urlLengthLimit:m.db.urlLengthLimit}),this.storage=new Qy(this.storageUrl.href,this.headers,this.fetch,s?.storage),m.accessToken||this._listenForAuthEvents()}get functions(){return new Tv(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(r){return this.rest.from(r)}schema(r){return this.rest.schema(r)}rpc(r,t={},s={head:!1,get:!1,count:void 0}){return this.rest.rpc(r,t,s)}channel(r,t={config:{}}){return this.realtime.channel(r,t)}getChannels(){return this.realtime.getChannels()}removeChannel(r){return this.realtime.removeChannel(r)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var r=this,t,s;if(r.accessToken)return await r.accessToken();const{data:a}=await r.auth.getSession();return(t=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&t!==void 0?t:r.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:r,persistSession:t,detectSessionInUrl:s,storage:a,userStorage:l,storageKey:u,flowType:c,lock:p,debug:m,throwOnError:g,experimental:w,lockAcquireTimeout:y,skipAutoInitialize:_},E,j){const O={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new _w({url:this.authUrl.href,headers:Ae(Ae({},O),E),storageKey:u,autoRefreshToken:r,persistSession:t,detectSessionInUrl:s,storage:a,userStorage:l,flowType:c,lock:p,debug:m,throwOnError:g,experimental:w,fetch:j,lockAcquireTimeout:y,skipAutoInitialize:_,hasCustomAuthorizationHeader:Object.keys(this.headers).some(N=>N.toLowerCase()==="authorization")})}_initRealtimeClient(r){return new xy(this.realtimeUrl.href,Ae(Ae({},r),{},{params:Ae(Ae({},{apikey:this.supabaseKey}),r?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,t)=>{this._handleTokenChanged(r,"CLIENT",t?.access_token)})}_handleTokenChanged(r,t,s){(r==="TOKEN_REFRESHED"||r==="SIGNED_IN")&&this.changedAccessToken!==s?(this.changedAccessToken=s,this.realtime.setAuth(s)):r==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const bw=(r,t,s)=>new kw(r,t,s);function Sw(){if(typeof window<"u")return!1;const r=globalThis.process;if(!r)return!1;const t=r.version;if(t==null)return!1;const s=t.match(/^v(\d+)\./);return s?parseInt(s[1],10)<=18:!1}Sw()&&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
51ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Ew="https://dythjgjccybwrpcgoxmf.supabase.co",jw="sb_publishable_ZhFj8txMklnLnLofXkW9IQ_CDUMznrU",tn=bw(Ew,jw,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0}}),op=I.createContext({session:null,user:null,loading:!0,signIn:async()=>{},signUp:async()=>{},signOut:async()=>{}});function Cw({children:r}){const[t,s]=I.useState(null),[a,l]=I.useState(!0);I.useEffect(()=>{let c=!0;tn.auth.getSession().then(({data:m})=>{c&&(s(m?.session||null),l(!1))});const{data:p}=tn.auth.onAuthStateChange((m,g)=>{s(g||null),l(!1)});return()=>{c=!1,p?.subscription?.unsubscribe?.()}},[]);const u={session:t,user:t?.user||null,loading:a,async signIn({email:c,password:p}){const{data:m,error:g}=await tn.auth.signInWithPassword({email:c,password:p});if(g)throw g;return m},async signUp({email:c,password:p}){const{data:m,error:g}=await tn.auth.signUp({email:c,password:p});if(g)throw g;return m},async signOut(){await tn.auth.signOut()}};return h.jsx(op.Provider,{value:u,children:r})}function Oa(){return I.useContext(op)}function Sa({size:r=22}){return h.jsxs("svg",{viewBox:"0 0 128 128",width:r,height:r,"aria-hidden":"true",children:[h.jsxs("defs",{children:[h.jsxs("linearGradient",{id:"lmBody",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[h.jsx("stop",{offset:"0%",stopColor:"#FF7BD2"}),h.jsx("stop",{offset:"100%",stopColor:"#E957B5"})]}),h.jsxs("linearGradient",{id:"lmTop",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[h.jsx("stop",{offset:"0%",stopColor:"#9D7BFF"}),h.jsx("stop",{offset:"100%",stopColor:"#7AA2FF"})]}),h.jsxs("linearGradient",{id:"lmLeft",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[h.jsx("stop",{offset:"0%",stopColor:"#9DBEFF"}),h.jsx("stop",{offset:"100%",stopColor:"#7AA2FF"})]}),h.jsxs("linearGradient",{id:"lmAperture",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[h.jsx("stop",{offset:"0%",stopColor:"#FBE8FF",stopOpacity:"0.95"}),h.jsx("stop",{offset:"100%",stopColor:"#E8E0FF",stopOpacity:"0.85"})]})]}),h.jsx("rect",{x:"10",y:"22",width:"108",height:"84",rx:"18",fill:"url(#lmBody)"}),h.jsx("rect",{x:"24",y:"36",width:"80",height:"56",rx:"9",fill:"url(#lmAperture)"}),h.jsx("path",{d:"M24 36 L104 36 L98 43 L30 43 Z",fill:"url(#lmTop)"}),h.jsx("path",{d:"M24 36 L30 43 L30 85 L24 92 Z",fill:"url(#lmLeft)",opacity:"0.85"})]})}function iu(){return h.jsxs("span",{className:"inline-flex items-baseline gap-0.5 leading-none",children:[h.jsx("span",{className:"font-display text-[20px] text-ink-900 tracking-tightish",children:"context"}),h.jsx("span",{className:"font-mono text-[12.5px] text-ink-500 ml-0.5",children:".io"})]})}const Tw="https://context-io-backend.onrender.com";class mu extends Error{constructor(t,{status:s,data:a}={}){super(t),this.name="ApiError",this.status=s,this.data=a}}class Nn extends mu{constructor(){super("Your session has expired. Please sign in again.",{status:401}),this.name="SessionExpiredError"}}async function Pw(){const{data:r}=await tn.auth.getSession();return r?.session?.access_token||null}async function Nw(){const{data:r,error:t}=await tn.auth.refreshSession();return t?null:r?.session?.access_token||null}async function Rw(r){if((r.headers.get("content-type")||"").includes("application/json"))try{return await r.json()}catch{return null}try{return await r.text()}catch{return null}}async function st(r,{method:t="GET",body:s,headers:a={}}={}){const l=async m=>{const g={...a};return s!==void 0&&(g["Content-Type"]="application/json"),m&&(g.Authorization=`Bearer ${m}`),fetch(`${Tw}${r}`,{method:t,headers:g,body:s===void 0?void 0:JSON.stringify(s)})};let u=await Pw(),c=await l(u);if(c.status===401){const m=await Nw();if(!m)throw await tn.auth.signOut().catch(()=>{}),new Nn;if(c=await l(m),c.status===401)throw await tn.auth.signOut().catch(()=>{}),new Nn}const p=await Rw(c);if(!c.ok){const m=p&&typeof p=="object"&&(p.error||p.message)||`Request failed (${c.status}).`;throw new mu(m,{status:c.status,data:p})}return p}const Fe={me:()=>st("/me"),cancelSubscription:()=>st("/subscription/cancel",{method:"POST"}),resumeSubscription:()=>st("/subscription/resume",{method:"POST"}),getProfile:()=>st("/profile"),saveProfile:r=>st("/profile",{method:"POST",body:r}),listProfiles:()=>st("/profiles"),createProfile:r=>st("/profiles",{method:"POST",body:r}),updateProfile:(r,t)=>st(`/profiles/${encodeURIComponent(r)}`,{method:"PUT",body:t}),deleteProfile:r=>st(`/profiles/${encodeURIComponent(r)}`,{method:"DELETE"}),activateProfile:r=>st(`/profiles/${encodeURIComponent(r)}/activate`,{method:"POST"}),getUsage:()=>st("/me"),listRules:r=>{const t=r?`?profile_id=${encodeURIComponent(r)}`:"";return st(`/meaning-rules${t}`)},createRule:(r,t)=>{const s=r?`?profile_id=${encodeURIComponent(r)}`:"";return st(`/meaning-rules${s}`,{method:"POST",body:t})},updateRule:(r,t,s)=>st(`/meaning-rules/${encodeURIComponent(t)}`,{method:"PUT",body:s}),deleteRule:(r,t)=>st(`/meaning-rules/${encodeURIComponent(t)}`,{method:"DELETE"})},Gn={basicProfile:"basicProfile",detailedProfile:"detailedProfile",meaningRules:"meaningRules",multipleProfiles:"multipleProfiles"};function Ur(r,t){return r?r.features&&typeof r.features[t]=="boolean"?r.features[t]:t===Gn.basicProfile:!1}function Aa(r){return(r&&r.plan)==="pro"}const Ow=[{to:"/dashboard",label:"Dashboard"},{to:"/profile",label:"Professional Profile"},{to:"/usage",label:"Usage"},{to:"/meaning-rules",label:"Meaning Rules",proFeature:Gn.meaningRules},{to:"/upgrade",label:"Plan & Pricing"},{to:"/account",label:"Account"}];function Aw(){const{user:r,signOut:t}=Oa(),s=Mr(),{pathname:a}=sn(),[l,u]=I.useState(null);I.useEffect(()=>{let p=!1;return(async()=>{try{const m=await Fe.me();p||u(m)}catch(m){m instanceof Nn&&s("/login",{replace:!0})}})(),()=>{p=!0}},[a,s]);const c=l?.plan||"free";return h.jsxs("div",{className:"min-h-screen flex flex-col",children:[h.jsx("header",{className:"sticky top-0 z-20 backdrop-blur-xl bg-white/55 border-b border-[rgba(15,15,18,0.06)]",children:h.jsxs("div",{className:"mx-auto max-w-7xl px-5 sm:px-8 h-14 flex items-center gap-4",children:[h.jsxs(Jn,{to:"/profile",className:"flex items-center gap-2.5 group",children:[h.jsx(Sa,{size:22}),h.jsx(iu,{}),h.jsx("span",{className:"hidden md:inline-block ml-3 text-[11px] uppercase tracking-[0.22em] text-ink-500 font-mono",children:"Worksp
51ace"})]}),h.jsx("div",{className:"flex-1"}),h.jsxs("span",{className:"plan-badge "+(c==="pro"?"is-pro":""),children:[h.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:c==="pro"?"#E957B5":"#9494A0",boxShadow:c==="pro"?"0 0 0 3px rgba(233,87,181,0.18)":"none"}}),c]}),h.jsx("div",{className:"hidden sm:flex items-center text-[12.5px] text-ink-500 font-mono max-w-[200px] truncate",children:r?.email||"â"}),h.jsx("button",{onClick:async()=>{await t(),s("/login",{replace:!0})},className:"btn-ghost text-[12.5px] !py-1.5 !px-3",title:"Sign out",children:"Sign out"})]})}),h.jsxs("div",{className:"mx-auto max-w-7xl w-full px-5 sm:px-8 py-8 md:py-12 flex-1 grid md:grid-cols-[220px_1fr] gap-8 md:gap-12",children:[h.jsxs("aside",{className:"md:sticky md:top-20 self-start",children:[h.jsx("nav",{className:"flex md:flex-col gap-1 overflow-x-auto md:overflow-visible -mx-1 px-1 pb-2 md:pb-0",children:Ow.map(p=>{const m=p.proFeature&&!Ur(l,p.proFeature);return h.jsx(_v,{to:p.to,className:({isActive:g})=>"nav-item whitespace-nowrap "+(g?"is-active":""),children:h.jsxs("span",{className:"label flex items-center gap-2",children:[p.label,m&&h.jsx("span",{className:"text-[9px] uppercase tracking-[0.14em] font-mono text-accent-magenta opacity-80 not-italic font-sans",title:"Pro feature",children:"Pro"})]})},p.to)})}),l&&h.jsxs("div",{className:"hidden md:block mt-8 card p-4",children:[h.jsx("div",{className:"eyebrow mb-2",children:"This month"}),h.jsx(Lw,{me:l})]})]}),h.jsx("main",{className:"min-w-0 animate-fade-up",children:h.jsx(lv,{context:{me:l,refetchMe:()=>Fe.me().then(u).catch(()=>{})}})})]})]})}function Lw({me:r}){const t=r?.usage?.used??0,s=r?.usage?.limit??50,a=Math.min(100,Math.round(t/Math.max(1,s)*100));return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-baseline justify-between mb-1.5",children:[h.jsxs("span",{className:"font-display text-[22px] text-ink-900 tracking-tightish leading-none",children:[t,h.jsxs("span",{className:"text-ink-400 font-display",children:[" / ",s]})]}),h.jsxs("span",{className:"text-[11px] text-ink-500 font-mono",children:[a,"%"]})]}),h.jsx("div",{className:"h-1 rounded-full bg-cream-300 overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-accent-pink to-accent-violet transition-all duration-700",style:{width:`${a}%`}})}),h.jsx("div",{className:"mt-2 text-[11.5px] text-ink-500 italic font-display",children:"Translations used"})]})}function Iw({label:r="Loading"}){return h.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center gap-4",children:[h.jsx(Sa,{size:28}),h.jsxs("div",{className:"text-ink-500 text-[13px] tracking-tightish",children:[r,h.jsx("span",{className:"animate-pulse-soft",children:"â¦"})]})]})}function Ye({className:r=""}){return h.jsx("div",{className:"rounded-xl bg-gradient-to-r from-cream-200 via-white to-cream-200 bg-[length:200%_100%] "+r,style:{animation:"shimmer 1.8s ease-in-out infinite"}})}if(typeof document<"u"&&!document.getElementById("cio-shimmer")){const r=document.createElement("style");r.id="cio-shimmer",r.textContent=` 52 @keyframes shimmer { 53 0% { background-position: 100% 0; } 54 100% { background-position: -100% 0; } 55 } 56 `,document.head.appendChild(r)}function gu({title:r="Something went wrong",message:t,onRetry:s}){return h.jsxs("div",{className:"card p-6 flex flex-col gap-3",children:[h.jsx("div",{className:"text-ink-900 font-medium",children:r}),t&&h.jsx("div",{className:"text-[13px] text-ink-500 leading-relaxed",children:t}),s&&h.jsx("div",{children:h.jsx("button",{className:"btn-ghost",onClick:s,children:"Try again"})})]})}function Uw({title:r,description:t,action:s}){return h.jsxs("div",{className:"card p-10 flex flex-col items-center text-center gap-3",children:[h.jsx("div",{className:"display text-3xl",children:r}),t&&h.jsx("div",{className:"text-[13.5px] text-ink-500 max-w-sm leading-relaxed",children:t}),s]})}function $w({children:r}){const{session:t,loading:s}=Oa(),a=sn();return s?h.jsx(Iw,{label:"Restoring session"}):t?r:h.jsx(ga,{to:"/login",replace:!0,state:{from:a.pathname}})}const lp=[{code:"auto",label:"Auto-detect"},{code:"en",label:"English"},{code:"he",label:"Hebrew"},{code:"es",label:"Spanish"},{code:"fr",label:"French"},{code:"de",label:"German"},{code:"it",label:"Italian"},{code:"pt",label:"Portuguese"},{code:"ar",label:"Arabic"},{code:"zh",label:"Chinese"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"ru",label:"Russian"},{code:"hi",label:"Hindi"},{code:"tr",label:"Turkish"},{code:"nl",label:"Dutch"},{code:"pl",label:"Polish"},{code:"sv",label:"Swedish"}],Dw=lp,Mw=lp.filter(r=>r.code!=="auto"),of=[{value:"natural-professional",label:"Natural / Professional",hint:"The default â fluent professional voice."},{value:"professional",label:"Professional",hint:"Polished business register."},{value:"formal",label:"Formal",hint:"Reserved, official correspondence."},{value:"neutral",label:"Neutral",hint:"Plain professional prose."},{value:"conversational",label:"Conversational",hint:"Spoken-style, friendly."},{value:"academic",label:"Academic",hint:"Scholarly and precise."},{value:"executive",label:"Executive",hint:"Crisp, decision-ready phrasing."},{value:"plain",label:"Plain language",hint:"Simple â for non-specialist readers."}],lf=[{value:"auto",label:"Auto",hint:"Detect from the page where you'll paste."},{value:"chat",label:"Chat",hint:"WhatsApp, Slack â short and direct."},{value:"email",label:"Email",hint:"Polished, suitable for a colleague or client."},{value:"client-update",label:"Client update",hint:"Clear, tactful, constructive."},{value:"report",label:"Report",hint:"Document-ready, structured prose."},{value:"technical-note",label:"Technical note",hint:"Compact, precise, dense with terminology."},{value:"formal-document",label:"Formal document",hint:"Maximum precision â contracts, legal memos."}],Ml={profile_name:"",profession:"",professional_context:"",source_language:"en",target_language:"en",tone:"natural-professional",output_format:"auto"};function Bw(){const{me:r,refetchMe:t}=Br(),s=Ur(r,Gn.detailedProfile),a=Ur(r,Gn.multipleProfiles),l=Aa(r),[u,c]=I.useState(Ml),[p,m]=I.useState(Ml),[g,w]=I.useState(!0),[y,_]=I.useState(null),[E,j]=I.useState(!1),[O,N]=I.useState(null),[D,M]=I.useState([]),[U,q]=I.useState(null),[ue,Y]=I.useState(null),[oe,ye]=I.use
56State({mode:"idle"});async function te(){w(!0),_(null);try{const C=await Fe.getProfile(),T=C&&C.profile||{},H={...Ml,...qw(T)};c(H),m(H)}catch(C){C instanceof Nn||_(C.message||"Could not load your profile.")}finally{w(!1)}}async function ce(){if(a){Y(null);try{const C=await Fe.listProfiles();M(Array.isArray(C?.profiles)?C.profiles:[]),q(C?.active_profile_id||null)}catch(C){C instanceof Nn||Y(C.message||"Could not load your profiles.")}}}I.useEffect(()=>{te(),ce()},[a]);async function ge(C){C.preventDefault(),j(!0),_(null);try{const T={...u};s||delete T.professional_context,await Fe.saveProfile(T),m(u),N(Date.now()),await Promise.all([t?.(),ce()]),setTimeout(()=>N(null),1800)}catch(T){_(T.message||"Could not save your profile.")}finally{j(!1)}}const Ee=!Kw(u,p);async function Te(C){if(C!==U&&!(Ee&&!window.confirm("You have unsaved changes on the current profile. Switch anyway and discard them?"))){Y(null);try{await Fe.activateProfile(C),q(C),await te(),await t?.()}catch(T){Y(T.message||"Could not switch profile.")}}}async function Le(C){const T=(C||"").trim();if(T){Y(null);try{const L=(await Fe.createProfile({profile_name:T}))?.profile?.id;await ce(),L&&(await Fe.activateProfile(L),q(L),await te(),await t?.()),ye({mode:"idle"})}catch(H){Y(H.message||"Could not create profile.")}}}async function Qe(C,T){const H=(T||"").trim();if(H){Y(null);try{await Fe.updateProfile(C,{profile_name:H}),await ce(),C===U&&(c(L=>({...L,profile_name:H})),m(L=>({...L,profile_name:H}))),ye({mode:"idle"})}catch(L){Y(L.message||"Could not rename profile.")}}}async function B(C){Y(null);try{await Fe.deleteProfile(C),await ce(),ye({mode:"idle"})}catch(T){T instanceof mu&&T.status===409?Y("Switch to a different profile before deleting this one."):Y(T.message||"Could not delete profile.")}}return h.jsxs("div",{className:"flex flex-col gap-8",children:[h.jsx(zr,{eyebrow:l?"Workspace · Pro":"Workspace · Basic",title:h.jsxs(h.Fragment,{children:["Professional ",h.jsx("em",{children:"Profile."})]}),description:"Your saved defaults. Context.io uses these whenever you translate, unless you override them for a specific request."}),a&&h.jsx(Fw,{profiles:D,activeId:U,picker:oe,setPicker:ye,onSwitch:Te,onCreate:Le,onRename:Qe,onDelete:B,error:ue,onDismissError:()=>Y(null)}),g?h.jsxs("div",{className:"card-elev p-8 flex flex-col gap-5",children:[h.jsx(Ye,{className:"h-7 w-1/3"}),h.jsx(Ye,{className:"h-12 w-full"}),h.jsx(Ye,{className:"h-32 w-full"}),h.jsxs("div",{className:"grid sm:grid-cols-2 gap-5",children:[h.jsx(Ye,{className:"h-12"}),h.jsx(Ye,{className:"h-12"})]})]}):y?h.jsx(gu,{message:y,onRetry:te}):h.jsxs("form",{onSubmit:ge,className:"card-elev p-6 sm:p-8 flex flex-col gap-7",children:[h.jsx(df,{eyebrow:"Active profession profile",hint:a?"What you do, your audience, your terminology. Edits here apply to the selected profile above.":"What you do, your audience, your terminology."}),h.jsx(jr,{label:"Profile name",hint:"A short label, just for you.",children:h.jsx("input",{className:"input input-lg",type:"text",maxLength:60,value:u.profile_name,onChange:C=>c({...u,profile_name:C.target.value}),placeholder:"e.g. Default · Google Ads"})}),h.jsx(jr,{label:"Profession",hint:"A short title for what you do. Used as the lens for your translations.",children:h.jsx("input",{className:"input input-lg",type:"text",maxLength:120,value:u.profession,onChange:C=>c({...u,profession:C.target.value}),placeholder:"e.g. Cardiologist, Google Ads specialist, M&A Lawyer"})}),h.jsx(Ww,{value:u.professional_context,onChange:C=>c({...u,professional_context:C}),locked:!s}),h.jsx("div",{className:"hairline -mx-6 sm:-mx-8"}),h.jsx(df,{eyebrow:"Workspace defaults",hint:a?"Shared across every profile. Languages and tone follow you, not the profession.":"Languages, tone, and format used by default for every translation."}),h.jsxs("div",{className:"grid sm:grid-cols-2 gap-5",children:[h.jsx(jr,{label:"Source language",children:h.jsx(As,{value:u.source_language,onChange:C=>c({...u,source_language:C}),options:Dw.map(C=>({value:C.code,label:C.label}))})}),h.jsx(jr,{label:"Target language",children:h.jsx(As,{value:u.target_language,onChange:C=>c({...u,target_language:C}),options:Mw.map(C=>
56({value:C.code,label:C.label}))})})]}),h.jsxs("div",{className:"grid sm:grid-cols-2 gap-5",children:[h.jsx(jr,{label:"Preferred tone",hint:hf(of,u.tone),children:h.jsx(As,{value:u.tone,onChange:C=>c({...u,tone:C}),options:of.map(C=>({value:C.value,label:C.label}))})}),h.jsx(jr,{label:"Default output format",hint:hf(lf,u.output_format),children:h.jsx(As,{value:u.output_format,onChange:C=>c({...u,output_format:C}),options:lf.map(C=>({value:C.value,label:C.label}))})})]}),h.jsx("div",{className:"hairline -mx-6 sm:-mx-8"}),h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsx("div",{className:"text-[12.5px] text-ink-500 font-mono min-h-[1.25rem]",children:O?h.jsx("span",{className:"text-accent-magenta italic font-display text-[15px]",children:"Saved."}):Ee?"Unsaved changes":"All changes saved"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",className:"btn-ghost",disabled:!Ee||E,onClick:()=>c(p),children:"Discard"}),h.jsx("button",{type:"submit",className:"btn-accent",disabled:!Ee||E,children:E?"Savingâ¦":"Save changes"})]})]}),y&&h.jsx("div",{className:"text-[12.5px] text-accent-magenta",children:y})]})]})}function Fw({profiles:r,activeId:t,picker:s,setPicker:a,onSwitch:l,onCreate:u,onRename:c,onDelete:p,error:m,onDismissError:g}){const w=r.find(y=>y.id===t)||null;return h.jsxs("section",{className:"card-elev p-5 sm:p-6 flex flex-col gap-4",children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"field-label",children:"Profession profile"}),h.jsx("span",{className:"field-hint",children:"Switch between profiles. Your active one feeds every translation."})]}),s.mode==="idle"&&h.jsx("button",{type:"button",className:"btn-ghost text-[12.5px]",onClick:()=>a({mode:"creating"}),children:"+ New profile"})]}),s.mode==="idle"&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex-1",children:h.jsx(As,{value:t||"",onChange:y=>l(y),options:r.length===0?[{value:"",label:"No profiles yet"}]:r.map(y=>({value:y.id,label:y.profile_name||"Untitled profile"}))})}),w&&h.jsxs(h.Fragment,{children:[h.jsx(cf,{title:"Rename this profile",onClick:()=>a({mode:"renaming",id:w.id,value:w.profile_name||""}),children:h.jsx(zw,{})}),h.jsx(cf,{title:r.length<=1?"You need at least one profile":"Delete this profile",onClick:()=>a({mode:"confirming-delete",id:w.id}),disabled:r.length<=1,tone:"danger",children:h.jsx(Hw,{})})]})]}),s.mode==="creating"&&h.jsx(uf,{label:"Name your new profile",placeholder:"e.g. M&A · Boutique advisory",submitLabel:"Create",onSubmit:y=>u(y),onCancel:()=>a({mode:"idle"})}),s.mode==="renaming"&&h.jsx(uf,{label:"Rename profile",placeholder:"Profile name",submitLabel:"Save",initialValue:s.value,onSubmit:y=>c(s.id,y),onCancel:()=>a({mode:"idle"})}),s.mode==="confirming-delete"&&h.jsxs("div",{className:"flex items-center justify-between gap-3 bg-cream-200/60 border border-line rounded-xl px-4 py-3",children:[h.jsxs("span",{className:"text-[13px] text-ink-700",children:["Delete ",h.jsx("em",{className:"font-display italic text-[15px] text-ink-900",children:w?.profile_name||"this profile"}),"?",h.jsx("span",{className:"block text-[11.5px] text-ink-500 mt-0.5",children:"This can't be undone."})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[h.jsx("button",{type:"button",className:"btn-ghost",onClick:()=>a({mode:"idle"}),children:"Cancel"}),h.jsx("button",{type:"button",className:"btn-accent",style:{background:"var(--accent-magenta, #C234A8)",borderColor:"var(--accent-magenta, #C234A8)"},onClick:()=>p(s.id),children:"Delete"})]})]}),m&&h.jsxs("div",{className:"flex items-start justify-between gap-3 text-[12.5px] text-accent-magenta bg-accent-magenta/[0.06] border border-accent-magenta/15 rounded-lg px-3 py-2",children:[h.jsx("span",{children:m}),h.jsx("button",{type:"button",className:"text-ink-400 hover:text-ink-700 leading-none",onClick:g,"aria-label":"Dismiss",children:"Ã"})]})]})}function uf({label:r,placeholder:t,submitLabel:s,initialValue:a="",onSubmit:l,onCancel:u}){const[c,p]=I.useState(a);return h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx("span",{className:"field-label",children:r}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{autoFocus:!0,t
56ype:"text",maxLength:60,className:"input input-lg flex-1",placeholder:t,value:c,onChange:m=>p(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),l(c)),m.key==="Escape"&&(m.preventDefault(),u())}}),h.jsx("button",{type:"button",className:"btn-ghost",onClick:u,children:"Cancel"}),h.jsx("button",{type:"button",className:"btn-accent",onClick:()=>l(c),disabled:!c.trim(),children:s})]})]})}function cf({children:r,onClick:t,disabled:s,title:a,tone:l}){const u=l==="danger"?"hover:text-accent-magenta hover:bg-accent-magenta/[0.08]":"hover:text-ink-900 hover:bg-cream-200";return h.jsx("button",{type:"button",title:a,onClick:t,disabled:s,className:"shrink-0 w-10 h-10 rounded-lg flex items-center justify-center text-ink-500 border border-line transition-colors duration-150 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent "+u,children:r})}function zw(){return h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",fill:"none",children:[h.jsx("path",{d:"M9.5 1.5l3 3-7.5 7.5H2v-3l7.5-7.5z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),h.jsx("path",{d:"M8.5 2.5l3 3",stroke:"currentColor",strokeWidth:"1.2"})]})}function Hw(){return h.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",fill:"none",children:h.jsx("path",{d:"M2.5 3.5h9M5 3.5V2.5a1 1 0 011-1h2a1 1 0 011 1v1M3.5 3.5l.6 8a1 1 0 001 .9h3.8a1 1 0 001-.9l.6-8",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function df({eyebrow:r,hint:t}){return h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"eyebrow",children:r}),t&&h.jsx("span",{className:"field-hint",children:t})]})}function Ww({value:r,onChange:t,locked:s}){return h.jsxs("label",{className:"flex flex-col gap-2",children:[h.jsxs("span",{className:"field-label flex items-center justify-between",children:[h.jsx("span",{children:"Professional Context"}),s&&h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[10px] uppercase tracking-[0.14em] font-mono text-accent-magenta normal-case",children:[h.jsx(Vw,{}),h.jsx("span",{className:"uppercase tracking-[0.14em]",children:"Pro"})]})]}),h.jsx("span",{className:"field-hint",children:s?"Pro plans let you write a rich long-form context (up to 2000 characters) â your field, audience, jargon preferences. The translator reads
56it before every request.":"Describe your field, specialty, audience, and terminology preferences. The more specific you are, the better Context.io preserves meaning."}),h.jsxs("div",{className:"relative "+(s?"select-none":""),children:[h.jsx("textarea",{className:"textarea "+(s?"!bg-cream-200/60 !text-ink-400 !border-[rgba(15,15,18,0.06)] cursor-not-allowed placeholder:!text-ink-300":""),rows:5,maxLength:2e3,disabled:s,"aria-disabled":s||void 0,value:r,onChange:a=>t(a.target.value),placeholder:"Example: Google Ads specialist for B2B SaaS lead gen. I write client-friendly Hebrew updates. Preserve PPC terms like conversions, broad match, search terms, and low-intent queries."}),s&&h.jsxs(h.Fragment,{children:[h.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-xl opacity-40",style:{background:"repeating-linear-gradient(135deg, rgba(15,15,18,0.04) 0px, rgba(15,15,18,0.04) 6px, transparent 6px, transparent 14px)"}}),h.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-20 rounded-b-xl bg-gradient-to-t from-cream-100 to-transparent"}),h.jsx("div",{className:"absolute right-3 bottom-3 flex items-center gap-2",children:h.jsx(Jn,{to:"/upgrade",className:"btn-accent !py-1.5 !px-3 text-[12px] pointer-events-auto shadow-md",children:"Upgrade to edit"})})]})]}),!s&&h.jsxs("div",{className:"mt-1 flex justify-end text-[11px] text-ink-400 font-mono",children:[r.length," / 2000"]})]})}function Vw(){return h.jsxs("svg",{width:"10",height:"12",viewBox:"0 0 11 13","aria-hidden":"true",children:[h.jsx("rect",{x:"1",y:"6",width:"9",height:"6.5",rx:"1.5",fill:"currentColor",opacity:"0.85"}),h.jsx("path",{d:"M2.5 6V4a3 3 0 0 1 6 0v2",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})}function zr({eyebrow:r,title:t,description:s,right:a}){return h.jsxs("div",{className:"flex items-start justify-between gap-6",children:[h.jsxs("div",{className:"max-w-2xl",children:[h.jsx("div",{className:"eyebrow mb-3",children:r}),h.jsx("h1",{className:"display text-4xl sm:text-5xl",children:t}),s&&h.jsx("p",{className:"mt-4 text-ink-600 text-[14.5px] leading-relaxed",children:s})]}),a]})}function jr({label:r,hint:t,children:s}){return h.jsxs("label",{className:"flex flex-col gap-2",children:[h.jsx("span",{className:"field-label",children:r}),s,t&&h.jsx("span",{className:"field-hint",children:t})]})}function As({value:r,onChange:t,options:s}){return h.jsxs("div",{className:"relative",children:[h.jsx("select",{className:"input input-lg appearance-none pr-9",value:r,onChange:a=>t(a.target.value),children:s.map(a=>h.jsx("option",{value:a.value,children:a.label},a.value))}),h.jsx("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-[70%] w-2 h-2 border-r border-b border-ink-500 rotate-45","aria-hidden":"true"})]})}function qw(r){return{profile_name:r.profile_name||"",profession:r.profession||"",professional_context:r.professional_context||"",source_language:r.source_language||"en",target_language:r.target_language||"en",tone:r.tone||"natural-professional",output_format:r.output_format||"auto"}}function hf(r,t){return r.find(a=>a.value===t)?.hint}function Kw(r,t){for(const s of Object.keys(r))if(r[s]!==t[s])return!1;for(const s of Object.keys(t))if(r[s]!==t[s])return!1;return!0}const ff={meaningRules:{eyebrow:"Pro feature",title:h.jsxs(h.Fragment,{children:["Meaning ",h.jsx("em",{children:"Rules."})]}),headline:"Translation that knows your terms â by name.",description:"Teach Context.io what specific words mean in your work. Every translation across every page picks them up â preferred forms, forbidden ones, examples, your notes. Pro users keep an unlimited library of rules.",benefits:["Per-term meaning rules with preferred + avoid translations","Used in every translation â no manual setup per request","Examples and notes attached to each rule","Syncs with the extension automatically"]},detailedProfile:{eyebrow:"Pro feature",title:h.jsxs(h.Fragment,{children:["Detailed ",h.jsx("em",{children:"Profile."})]}),headline:"Describe your professional world, in full.",description:"Free profiles cover the basics â job title, languages, tone. Pro profiles let you write a rich Professional Context: your field, your audience, your jargon preferences, your style. The translator reads
56it before every request.",benefits:["Long-form Professional Context (up to 2000 characters)","Persisted across the extension and the portal","Used as the primary lens for every translation","Edit anytime, takes effect on the next request"]},multipleProfiles:{eyebrow:"Pro feature",title:h.jsxs(h.Fragment,{children:["Multiple ",h.jsx("em",{children:"Profiles."})]}),headline:"One you for client work. Another for your own.",description:"Save several professional profiles and switch between them instantly. Useful when you wear more than one hat â different domains, different languages, different audiences.",benefits:["Up to 5 saved profiles","Switch in one click from the extension","Each profile keeps its own meaning rules"]},default:{eyebrow:"Pro feature",title:h.jsxs(h.Fragment,{children:["This is a ",h.jsx("em",{children:"Pro"})," feature."]}),headline:"Upgrade to unlock advanced configuration.",description:"Pro plans unlock advanced settings: detailed professional profiles, custom meaning rules, multiple profiles, and higher monthly limits.",benefits:["Detailed professional profile","Custom meaning rules","Higher monthly translation limits","Priority access to new features"]}};function Gw({feature:r,preview:t,me:s}){const a=ff[r]||ff.default,l=Mr();return h.jsxs("div",{className:"flex flex-col gap-8",children:[h.jsx(zr,{eyebrow:a.eyebrow,title:a.title,description:a.description}),h.jsxs("div",{className:"grid lg:grid-cols-[1.05fr_1fr] gap-5",children:[h.jsxs("div",{className:"card-elev p-6 sm:p-9 relative overflow-hidden flex flex-col gap-6",children:[h.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 w-[420px] h-[420px] rounded-full glow-pink blur-3xl"}),h.jsx("div",{className:"pointer-events-none absolute -bottom-24 -left-24 w-[380px] h-[380px] rounded-full glow-violet blur-3xl"}),h.jsxs("div",{className:"relative",children:[h.jsxs("div",{className:"eyebrow-accent mb-3 flex items-center gap-2",children:[h.jsx(Jw,{}),"Locked on the Free plan"]}),h.jsx("h3",{className:"display text-3xl sm:text-4xl",children:a.headline}),h.jsx("ul",{className:"mt-6 flex flex-col gap-2.5 text-[14px] text-ink-700 max-w-md",children:a.benefits.map((u,c)=>h.jsxs("li",{className:"flex items-baseline gap-3",children:[h.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-gradient-to-br from-accent-pink to-accent-magenta translate-y-[5px] shrink-0","aria-hidden":"true"}),h.jsx("span",{children:u})]},c))}),h.jsxs("div",{className:"mt-8 flex items-center gap-3 flex-wrap",children:[h.jsx("button",{className:"btn-accent",onClick:()=>l("/upgrade"),children:"Upgrade to Pro"}),h.jsx("span",{className:"text-[12.5px] text-ink-500 font-mono",children:"Pricing coming soon"})]})]})]}),h.jsx("div",{className:"relative",children:h.jsxs("div",{className:"card-elev p-6 sm:p-7 relative overflow-hidden",children:[h.jsxs("div",{className:"eyebrow mb-3 flex items-center gap-2",children:["Preview",h.jsx("span",{className:"text-[10px] text-ink-400 font-mono tracking-[0.14em]",children:"· how it looks for Pro users"})]}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{"aria-hidden":"true",className:"opacity-[0.92] pointer-events-none select-none",children:t||h.jsx(Yw,{})}),h.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-cream-100 to-transparent"})]})]})})]})]})}function Jw(){return h.jsxs("svg",{width:"11",height:"13",viewBox:"0 0 11 13","aria-hidden":"true",children:[h.jsx("rect",{x:"1",y:"6",width:"9",height:"6.5",rx:"1.5",fill:"currentColor",opacity:"0.85"}),h.jsx("path",{d:"M2.5 6V4a3 3 0 0 1 6 0v2",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})}function Yw(){return h.jsx("div",{className:"flex flex-col gap-4",children:[1,2,3].map(r=>h.jsxs("div",{className:"card p-5 !shadow-none border-[rgba(15,15,18,0.05)]",children:[h.jsxs("div",{className:"eyebrow mb-2",children:["Item ",r]}),h.jsx("div",{className:"display text-xl",children:"An advanced setting."}),h.jsx("div",{className:"mt-2 text-[13px] text-ink-500 leading-relaxed",children:"Free users see a preview. Pro users see â and edit â the real thing."})]},r))})}function Qw({feature:r,children:t,...s}){const a=Br()||{},{me:l}=a;return l?Aa(l)&&(!r||Ur(l,r))?t:h.jsx(Gw,{me:l,feature:r,...s}):null}function Xw(){const{session:r,signIn:t,signUp:s,loading:a}=Oa(),l=Mr(),c=sn().state?.from||"/profile";if(!a&&r)return h.jsx(ga,{to:c,replace:!0});const[p,m]=I.useState("signin"),[g,w]=I.useState(""),[y,_]=I.useState(""),[E,j]=I.useState(!1),[O,N]=I.useState(null),[D,M]=I.useState(null);async function U(q){q.preventDefault(),N(null),M(null),j(!0);try{p==="signin"?(await t({email:g.trim(),password:y}),l(c,{replace:!0})):(await s({email:g.trim(),password:y}))?.session?l(c,{replace:!0}):(M("Check your inbox to confirm your email, then sign in."),m("signin"))}catch(ue){N(Zw(ue))}finally{j(!1)}}return h.jsxs("div",{className:"min-h-screen grid lg:grid-cols-[1.1fr_1fr]",children:[h.jsxs("div",{className:"hidden lg:flex flex-col justify-between p-12 xl:p-16 relative overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-3 relative z-10",children:[h.jsx(Sa,{size:26}),h.jsx(iu,{})]}),h.jsxs("div",{className:"relative z-10 max-w-lg animate-fade-up",children:[h.jsx("div",{className:"eyebrow mb-6",children:"Private workspace"}),h.jsxs("h1",{className:"display text-5xl xl:text-[68px] leading-[0.95]",children:["A translator that",h.jsxs("span",{className:"block",children:[h.jsx("span",{className:"italic font-display text-accent-magenta",children:"remembers"})," your field."]})]}),h.jsx("p",{className:"mt-7 text-ink-600 text-[15px] leading-relaxed max-w-md",children:"Sign in to manage your professional context, your monthly translation usage, and your custom meaning rules."})]}),h.jsx("div",{className:"relative z-10 text-[11px] uppercase tracking-[0.22em] text-ink-500 font-mono",children:"context.
56io · workspace"}),h.jsx("div",{className:"pointer-events-none absolute -bottom-32 -left-32 w-[520px] h-[520px] rounded-full glow-pink blur-2xl animate-wash-drift"}),h.jsx("div",{className:"pointer-events-none absolute top-1/3 -right-24 w-[420px] h-[420px] rounded-full glow-violet blur-2xl animate-wash-drift",style:{animationDelay:"-8s"}}),h.jsx("div",{className:"pointer-events-none absolute top-10 left-1/3 w-[280px] h-[280px] rounded-full glow-blue blur-2xl"})]}),h.jsxs("div",{className:"flex items-center justify-center p-6 sm:p-10 relative",children:[h.jsx("div",{className:"lg:hidden pointer-events-none absolute -top-32 right-0 w-[400px] h-[400px] rounded-full glow-pink blur-2xl"}),h.jsx("div",{className:"lg:hidden pointer-events-none absolute -bottom-32 -left-32 w-[400px] h-[400px] rounded-full glow-violet blur-2xl"}),h.jsxs("div",{className:"card-elev w-full max-w-sm p-8 sm:p-10 animate-fade-up relative",children:[h.jsxs("div",{className:"lg:hidden flex items-center gap-3 mb-8",children:[h.jsx(Sa,{size:24}),h.jsx(iu,{})]}),h.jsx("div",{className:"eyebrow-accent mb-3",children:p==="signin"?"Sign in":"Create account"}),h.jsx("h2",{className:"display text-3xl mb-8",children:p==="signin"?h.jsxs(h.Fragment,{children:["Welcome ",h.jsx("span",{className:"italic text-accent-magenta",children:"back."})]}):h.jsxs(h.Fragment,{children:["Get ",h.jsx("span",{className:"italic text-accent-magenta",children:"started."})]})}),h.jsxs("form",{onSubmit:U,className:"flex flex-col gap-4",autoComplete:"on",children:[h.jsxs("label",{className:"flex flex-col gap-1.5",children:[h.jsx("span",{className:"field-label",children:"Email"}),h.jsx("input",{type:"email",required:!0,autoComplete:"email",className:"input input-lg",value:g,onChange:q=>w(q.target.value),placeholder:"[email protected]"})]}),h.jsxs("label",{className:"flex flex-col gap-1.5",children:[h.jsx("span",{className:"field-label",children:"Password"}),h.jsx("input",{type:"password",required:!0,autoComplete:p==="signin"?"current-password":"new-password",minLength:6,className:"input input-lg",value:y,onChange:q=>_(q.target.value),placeholder:p==="signup"?"At least 6 characters":"â¢â¢â¢â¢â¢â¢â¢â¢"})]}),O&&h.jsx("div",{className:"text-[12.5px] text-accent-magenta mt-1 leading-snug",children:O}),D&&h.jsx("div",{className:"text-[12.5px] text-accent-violet mt-1 leading-snug",children:D}),h.jsx("button",{type:"submit",disabled:E,className:"btn-accent mt-2 w-full",children:E?p==="signin"?"Signing inâ¦":"Creating accountâ¦":p==="signin"?"Sign in":"Create account"})]}),h.jsx("div",{className:"mt-6 text-[13px] text-ink-500",children:p==="signin"?h.jsxs(h.Fragment,{children:["Don't have an account?"," ",h.jsx("button",{type:"button",onClick:()=>{m("signup"),N(null)},className:"text-ink-900 hover:text-accent-magenta transition-colors underline underline-offset-4 decoration-ink-300",children:"Create one"})]}):h.jsxs(h.Fragment,{children:["Already have an account?"," ",h.jsx("button",{type:"button",onClick:()=>{m("signin"),N(null)},className:"text-ink-900 hover:text-accent-magenta transition-colors underline underline-offset-4 decoration-ink-300",children:"Sign in"})]})})]})]})]})}function Zw(r){const t=r&&r.message||"";return/invalid login credentials/i.test(t)?"Email or password is incorrect.":/email not confirmed/i.test(t)?"Please confirm your email before signing in.":/user already registered/i.test(t)?"An account with this email already exists. Try signing in instead.":/password.*at least/i.test(t)?"Password must be at least 6 characters.":/rate limit/i.test(t)?"Too many attempts. Wait a minute and try again.":t||"Could not complete the request. Please try again."}function ex(){const{me:r}=Br()||{};if(!r)return h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsx(Ye,{className:"h-12 w-1/3"}),h.jsx(Ye,{className:"h-48"}),h.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[h.jsx(Ye,{className:"h-28"}),h.jsx(Ye,{className:"h-28"}),h.jsx(Ye,{className:"h-28"}),h.jsx(Ye,{className:"h-28"})]})]});const t=r.basicProfile&&r.basicProfile.profile_name||r.user&&r.user.email&&r.user.email.split("@")[0]||"there";return h.jsxs("div",{className:"flex flex-col gap-8",children:[h.jsxs("div",{children:[h.jsx("div",{className:"eyebrow mb-3",children:"Worksp
56ace"}),h.jsxs("h1",{className:"display text-4xl sm:text-5xl",children:["Hello, ",h.jsxs("em",{className:"text-accent-magenta",children:[t,"."]})]}),h.jsx("p",{className:"mt-4 text-ink-600 text-[14.5px] max-w-2xl leading-relaxed",children:"Your Context.io workspace. Track your usage, edit your professional profile, and manage your translation library."})]}),h.jsx(tx,{me:r}),r.hasProfessionalProfile?h.jsx(sx,{me:r}):h.jsx(ax,{me:r}),h.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[h.jsx(fa,{to:"/profile",eyebrow:"Profile",title:"Professional Profile",description:"Your saved defaults â profession, languages, tone, format."}),h.jsx(fa,{to:"/usage",eyebrow:"Usage",title:"Translation Credits",description:"Translations used this month and what your plan includes."}),h.jsx(fa,{to:"/meaning-rules",eyebrow:"Library",title:"Meaning Rules",description:"Per-term overrides so your jargon translates the way you mean it.",locked:!Ur(r,Gn.meaningRules)}),h.jsx(fa,{to:"/account",eyebrow:"Account",title:"Account & Plan",description:"Identity, plan, billing, and sign-out."})]})]})}function tx({me:r}){const t=Aa(r),s=r.usage?.used??0,a=r.usage?.limit??(t?2e3:50),l=Math.max(0,a-s),u=Math.min(100,Math.round(s/Math.max(1,a)*100)),c=r.usage?.resetAt,p=!t&&u>=80,m=!t&&u>=100;return h.jsxs("div",{className:"card-elev p-6 sm:p-9 relative overflow-hidden",children:[h.jsx("div",{className:"pointer-events-none absolute -top-32 -right-24 w-[420px] h-[420px] rounded-full glow-pink blur-3xl"}),h.jsxs("div",{className:"relative flex flex-wrap items-end justify-between gap-6",children:[h.jsxs("div",{children:[h.jsx("div",{className:"eyebrow",children:"Translations this month"}),h.jsxs("div",{className:"mt-3 flex items-baseline gap-2 font-display",children:[h.jsx("span",{className:"text-ink-900 text-6xl sm:text-7xl tracking-tighter leading-none",children:s}),h.jsxs("span",{className:"text-ink-400 text-3xl tracking-tighter",children:["/ ",a]})]}),h.jsxs("div",{className:"mt-3 text-[14px] text-ink-600",children:[h.jsx("em",{className:"font-display italic text-accent-magenta",children:l})," ","translation",l===1?"":"s"," remaining",c&&h.jsxs(h.Fragment,{children:[" · resets ",lx(c)]})]})]}),h.jsx("span",{className:"plan-badge "+(t?"is-pro":""),children:t?"pro":"free"})]}),h.jsx("div",{className:"relative mt-7 h-1.5 rounded-full bg-cream-300 overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-accent-pink via-accent-violet to-accent-blue transition-all duration-700",style:{width:`${u}%`}})}),p&&h.jsxs("div",{className:"relative mt-6 flex items-center justify-between gap-4 flex-wrap p-4 rounded-xl border border-accent-pink/30 bg-accent-pink/[0.06]",children:[h.jsx("div",{className:"text-[13.5px] text-ink-700 max-w-md leading-relaxed",children:m?h.jsxs(h.Fragment,{children:[h.jsx("strong",{className:"text-accent-magenta",children:"You're at your monthly limit."})," ","Upgrade to keep translating this month."]}):h.jsxs(h.Fragment,{children:["You're ",h.jsxs("strong",{className:"text-accent-magenta",children:[u,"%"]})," through your monthly free translations. Upgrade to Pro for 2,000 per month."]})}),h.jsx(Jn,{to:"/upgrade",className:"btn-accent !py-2",children:"Upgrade"})]})]})}const nx={"natural-professional":"Natural / Professional",professional:"Professional",formal:"Formal",neutral:"Neutral",conversational:"Conversational",academic:"Academic",executive:"Executive",plain:"Plain language"},rx={auto:"Auto · detect from page",chat:"Chat",email:"Email","client-update":"Client update",report:"Report","technical-note":"Technical note","formal-document":"Formal document"};function pf(r){if(!r)return"â";if(r==="auto")return"Auto-detect";try{return new Intl.DisplayNames(void 0,{type:"language"}).of(r)||r}catch{return r}}function sx({me:r}){const t=r.basicProfile||{},s=r.professionalProfile,a=t.profession||"",l=t.profile_name||"",u=pf(t.source_language),c=pf(t.target_language),p=nx[t.tone]||t.tone||"â",m=rx[t.output_format]||t.output_format||"â",g=s&&s.professional_context;return h.jsxs("div",{className:"card p-6 sm:p-7",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"eyebrow mb-2",children:"Currently translating as"}),a?h.jsxs("h3",{className:"display text-3xl tracking-tightish leading-tight",children:[a,l&&h.jsxs("span",{className:"text-ink-400 text-2xl",children:[" · ",l]})]}):h.jsx("h3",{className:"display text-3xl text-ink-400",children:h.jsx("em",{children:"No profession set."})})]}),h.jsx(Jn,{to:"/profile",className:"btn-ghost !py-1.5 !px-3 text-[12.5px] shrink-0",children:"Edit profile"})]}),g&&h.jsxs("p",{className:"mt-4 text-[14px] text-ink-700 leading-relaxed italic font-display",children:['"',ix(g,220),'"']}),h.jsx("div",{className:"hairline mt-5"}),h.jsxs("dl",{className:"mt-4 grid grid-cols-2 sm:grid-cols-4 gap-4",children:[h.jsx(ha,{label:"Source",value:u}),h.jsx(ha,{label:"Target",value:c}),h.jsx(ha,{label:"Tone",value:p}),h.jsx(ha,{label:"Format",value:m})]})]})}function ha({label:r,value:t}){return h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"eyebrow mb-1.5",children:r}),h.jsx("div",{className:"text-[14px] text-ink-800 font-medium truncate",children:t})]})}function ix(r,t){if(!r)return"";if(r=r.trim(),r.length<=t)return r;const s=r.slice(0,t),a=s.lastIndexOf(" ");return(a>t*.6?s.slice(0,a):s)+"â¦"}function ax({me:r}){const t=[{title:"Set your professional profile",description:"Tell Context.
56io your profession, languages, and preferred tone. This becomes the lens for every translation.",action:{to:"/profile",label:"Open profile"},done:!1},{title:"Install the Chrome extension",description:"The extension is where the translating actually happens â select text on any page, press Ctrl/Cmd+C, and Context.io reads it through your profile.",action:{href:"https://chrome.google.com/webstore",label:"Get extension"},done:!1},{title:"Try a translation",description:"Open any page in a language you read and copy a sentence. You'll see Context.io's reading next to the literal one.",action:null,done:!1}];return h.jsxs("div",{className:"card-elev p-6 sm:p-8 relative overflow-hidden",children:[h.jsx("div",{className:"pointer-events-none absolute -top-24 -right-16 w-[360px] h-[360px] rounded-full glow-violet blur-3xl"}),h.jsx("div",{className:"pointer-events-none absolute -bottom-16 -left-16 w-[300px] h-[300px] rounded-full glow-pink blur-3xl"}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"eyebrow-accent",children:"Welcome"}),h.jsxs("h3",{className:"mt-2 display text-3xl sm:text-4xl",children:["Let's set up your ",h.jsx("em",{children:"workspace."})]}),h.jsx("p",{className:"mt-3 text-ink-600 text-[14.5px] max-w-xl leading-relaxed",children:"Three quick steps. After this, Context.io knows how to read your professional language and writes it back to you."}),h.jsx("ol",{className:"mt-6 flex flex-col gap-3",children:t.map((s,a)=>h.jsxs("li",{className:"card p-5 !shadow-none border border-[rgba(15,15,18,0.06)] flex items-start gap-4",children:[h.jsx("div",{className:"font-display text-2xl text-accent-magenta tracking-tighter leading-none shrink-0 w-8",children:String(a+1).padStart(2,"0")}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-ink-900 text-[15px] font-medium leading-tight",children:s.title}),h.jsx("div",{className:"mt-1 text-[13.5px] text-ink-500 leading-relaxed",children:s.description})]}),s.action&&(s.action.to?h.jsx(Jn,{to:s.action.to,className:"btn-primary !py-1.5 !px-3 text-[12.5px] shrink-0",children:s.action.label}):h.jsxs("a",{href:s.action.href,target:"_blank",rel:"noreferrer",className:"btn-ghost !py-1.5 !px-3 text-[12.5px] shrink-0",children:[s.action.label," â"]}))]},a))})]})]})}function fa({to:r,eyebrow:t,title:s,description:a,locked:l}){return h.jsxs(Jn,{to:r,className:"card p-6 group hover:bg-white/80 transition-colors flex flex-col gap-2 relative",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"eyebrow",children:t}),l&&h.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] uppercase tracking-[0.14em] font-mono text-accent-magenta",children:[h.jsx(ox,{})," Pro"]})]}),h.jsx("h3",{className:"display text-2xl leading-tight",children:s}),h.jsx("p",{className:"text-[13.5px] text-ink-500 leading-relaxed",children:a}),h.jsx("span",{className:"text-ink-400 group-hover:text-accent-magenta transition-colors text-[13px] font-mono mt-2","aria-hidden":"true",children:"Open â"})]})}function ox(){return h.jsxs("svg",{width:"9",height:"11",viewBox:"0 0 11 13","aria-hidden":"true",children:[h.jsx("rect",{x:"1",y:"6",width:"9",height:"6.5",rx:"1.5",fill:"currentColor",opacity:"0.85"}),h.jsx("path",{d:"M2.5 6V4a3 3 0 0 1 6 0v2",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})}function lx(r){if(!r)return"next month";try{return new Date(r).toLocaleDateString(void 0,{day:"numeric",month:"short"})}catch{return"next month"}}function ux(){const{me:r}=Br(),[t,s]=I.useState(r||null),[a,l]=I.useState(!r),[u,c]=I.useState(null);async function p(){l(!0),c(null);try{s(await Fe.getUsage())}catch(m){m instanceof Nn||c(m.message||"Could not load your usage.")}finally{l(!1)}}return I.useEffect(()=>{r?s(r):p()},[r]),h.jsxs("div",{className:"flex flex-col gap-8",children:[h.jsx(zr,{eyebrow:"Usage",title:h.jsxs(h.Fragment,{children:["Translation ",h.jsx("em",{children:"Credits."})]}),description:"Your translation activity for the current month, the limits on your plan, and what changes when you upgrade."}),a?h.jsxs("div",{className:"grid sm:grid-cols-2 gap-5",children:[h.jsx(Ye,{className:"h-44"}),h.jsx(Ye,{className:"h-44"}),h.jsx(Ye,{className:"h-32 sm:col-span-2"})]}):u?h.jsx(gu,{message:u,onRetry:p}):h.jsx(cx,{me:t})]})}function cx({me:r}){const t=r?.plan||"free",s=r?.usage?.used??0,a=r?.usage?.limit??50,l=r?.usage?.month,u=r?.maxChars??700,c=Math.max(0,a-s),p=Math.min(100,Math.round(s/Math.max(1,a)*100)),m=t==="pro";return h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-5",children:[h.jsxs("div",{className:"lg:col-span-2 card-elev p-6 sm:p-9 relative overflow-hidden",children:[h.jsx("div",{className:"pointer-events-none absolute -top-32 -right-32 w-[420px] h-[420px] rounded-full glow-pink blur-3xl"}),h.jsxs("div",{className:"relative flex flex-wrap items-end justify-between gap-6",children:[h.jsxs("div",{children:[h.jsx("div",{className:"eyebrow",children:"Translations this month"}),h.jsxs("div",{className:"mt-3 flex items-baseline gap-2 font-display",children:[h.jsx("span",{className:"text-ink-900 text-7xl tracking-tighter leading-none",children:s}),h.jsxs("span",{className:"text-ink-400 text-3xl tracking-tighter",children:["/ ",a]})]}),h.jsxs("div",{className:"mt-2 text-[14px] text-ink-600",children:[h.jsx("em",{className:"not-italic font-display italic text-accent-magenta",children:c})," ","translation",c===1?"":"s"," remaining."]})]}),h.jsxs("div",{className:"flex flex-col items-end gap-1",children:[h.jsx("span",{className:"plan-badge "+(m?"is-pro":""),children:t}),h.jsxs("span",{className:"text-[11px] uppercase tracking-[0.18em] text-ink-500 font-mono",children:["Resets ",hx(l)]})]})]}),h.jsx("div",{className:"relative mt-8 h-1.5 rounded-full bg-cream-300 overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-accent-pink via-accent-violet to-accent-blue transition-all duration-700",style:{width:`${p}%`}})}),h.jsxs("div",{className:"relative mt-2 flex justify-between text-[11px] text-ink-500 font-mono",children:[h.jsxs("span",{children:[p,"% used"]}),h.jsxs("span",{children:["Window: ",dx(l)]})]})]}),h.jsx(mf,{label:"Max characters per translation",value:u.toLocaleStr
56ing(),sub:m?"Pro plan â longer selections allowed in one translation.":"Free plan â keep individual selections under this length."}),h.jsx(mf,{label:"Billing",value:m?"Active":"No billing on file",sub:m?"Pro plan.":"You're on the free plan."}),h.jsxs("div",{className:"lg:col-span-2 card p-6 sm:p-9 relative overflow-hidden",children:[h.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 w-[360px] h-[360px] rounded-full glow-violet blur-3xl"}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"eyebrow-accent",children:"Pricing"}),h.jsxs("h3",{className:"mt-2 display text-3xl",children:["Pro at ",h.jsx("em",{children:"$19/mo."})]}),h.jsx("p",{className:"mt-4 text-ink-600 text-[14.5px] max-w-xl leading-relaxed",children:"Pro unlocks 2,000 translations a month, selections up to 4,000 characters, and custom Meaning Rules applied to every translation. Your current usage and profile carry over automatically when billing goes live."}),h.jsxs("div",{className:"mt-5 flex flex-wrap gap-2 text-[11.5px] font-mono uppercase tracking-[0.14em] text-ink-500",children:[h.jsx("span",{className:"px-2.5 py-1 rounded-full border border-[rgba(15,15,18,0.10)] bg-white/60",children:"2,000 translations / month"}),h.jsx("span",{className:"px-2.5 py-1 rounded-full border border-[rgba(15,15,18,0.10)] bg-white/60",children:"4,000 characters per translation"}),h.jsx("span",{className:"px-2.5 py-1 rounded-full border border-[rgba(15,15,18,0.10)] bg-white/60",children:"meaning rules in every call"})]})]})]})]})}function mf({label:r,value:t,sub:s}){return h.jsxs("div",{className:"card p-6",children:[h.jsx("div",{className:"eyebrow mb-2",children:r}),h.jsx("div",{className:"display text-3xl",children:t}),s&&h.jsx("div",{className:"mt-2 text-[13.5px] text-ink-500 leading-relaxed",children:s})]})}function dx(r){return r?new Date(r+"T00:00:00Z").toLocaleDateString(void 0,{month:"long",year:"numeric",timeZone:"UTC"}):"â"}function hx(r){if(!r)return"next month";const t=new Date(r+"T00:00:00Z");return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth()+1,1)).toLocaleDateString(void 0,{day:"numeric",month:"short",timeZone:"UTC"})}const up={term:"",user_meaning:"",preferred_translation:"",avoid_translation:"",example_sentence:"",notes:""};function fx(){const{me:r}=Br()||{},t=Ur(r,Gn.multipleProfiles),[s,a]=I.useState([]),[l,u]=I.useState(null),[c,p]=I.useState(!1),[m,g]=I.useState(null),[w,y]=I.useState([]),[_,E]=I.useState(!0),[j,O]=I.useState(null),[N,D]=I.useState(null);I.useEffect(()=>{let te=!1;async function ce(){try{const ge=await Fe.listProfiles();if(te)return;const Ee=Array.isArray(ge?.profiles)?ge.profiles:[];a(Ee);const Te=ge?.active_profile_id||Ee[0]?.id||null;u(Te)}catch(ge){ge instanceof Nn||g(ge.message||"Could not load your profiles.")}finally{te||p(!0)}}return t?ce():p(!0),()=>{te=!0}},[t]);async function M(te){E(!0),O(null);try{const ce=await Fe.listRules(te),ge=Array.isArray(ce)?ce:ce?.rules||ce?.meaning_rules||[];y(ge)}catch(ce){ce instanceof Nn||O(ce)}finally{E(!1)}}I.useEffect(()=>{if(c){if(t&&!l){E(!1),y([]);return}M(l),D(null)}},[l,c,t]);async function U(te){const ce=await Fe.createRule(l,te),ge=ce?.rule||ce;y(Ee=>[ge,...Ee]),D(null)}async function q(te,ce){const ge=await Fe.updateRule(l,te,ce),Ee=ge?.rule||ge;y(Te=>Te.map(Le=>Le.id===te?{...Le,...Ee}:Le)),D(null)}async function ue(te){confirm("Delete this meaning rule? This can't be undone.")&&(await Fe.deleteRule(l,te),y(ce=>ce.filter(ge=>ge.id!==te)),D(null))}const Y=j&&(j.status===404||/not found/i.test(j.message||"")),oe=s.find(te=>te.id===l),ye=oe?.profile_name||(t?"":"Your rules");return h.jsxs("div",{className:"flex flex-col gap-8",children:[h.jsx(zr,{eyebrow:ye?`Library · ${ye}`:"Library",title:h.jsxs(h.Fragment,{children:["Meaning ",h.jsx("em",{children:"Rules."})]}),description:"Teach Context.io what specific terms mean in your professional world. Each profile has its own set of rules â switch profiles to view or edit a different set.",right:!Y&&h.jsx("button",{className:"btn-accent",disabled:N==="create"||t&&!l,onClick:()=>D("create"),children:"+ New rule"})}),t&&c&&s.length>0&&h.jsx(px,{profiles:s,selectedId:l,onSelect:u,error:m}),_?h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsx(Ye,{className:"h-28"}),h.jsx(Ye,{className:"h-28"}),h.jsx(Ye,{className:"h-28"})]}):Y?h.jsx(yx,{}):j?h.jsx(gu,{message:j.message,onRetry:()=>M(l)}):h.jsxs(h.Fragment,{children:[N==="create"&&h.jsx(gf,{initial:up,onCancel:()=>D(null),onSubmit:U,submitLabel:"Create rule"}),w.length===0&&N!=="create"?h.jsx(Uw,{title:h.jsxs(h.Fragment,{children:["No rules ",h.jsx("em",{className:"not-italic font-display italic text-accent-magenta",children:"yet"}),oe?h.jsxs(h.Fragment,{children:[" for ",h.jsx("em",{className:"not-italic font-display italic",children:oe.profile_name}),"."]}):"."]}
56),description:"Add your first rule to teach Context.io how a term should be interpreted in this profile.",action:h.jsx("button",{className:"btn-accent mt-2",onClick:()=>D("create"),children:"+ Create the first rule"})}):h.jsx("ul",{className:"flex flex-col gap-4",children:w.map((te,ce)=>h.jsx("li",{className:"animate-fade-up",style:{animationDelay:`${Math.min(ce*40,240)}ms`},children:N===te.id?h.jsx(gf,{initial:te,onCancel:()=>D(null),onSubmit:ge=>q(te.id,ge),onDelete:()=>ue(te.id),submitLabel:"Save changes"}):h.jsx(gx,{rule:te,onEdit:()=>D(te.id)})},te.id||te.term+ce))})]})]})}function px({profiles:r,selectedId:t,onSelect:s,error:a}){return h.jsxs("section",{className:"card-elev p-5 sm:p-6 flex flex-col gap-3",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsx("span",{className:"field-label",children:"Editing rules for"}),h.jsx("span",{className:"field-hint",children:"Each profile has its own meaning rules. Switching here only changes which set you're viewing, not your active profile."})]}),h.jsx("div",{className:"min-w-[14rem]",children:h.jsx(mx,{value:t||"",onChange:s,options:r.map(l=>({value:l.id,label:l.profile_name||"Untitled profile"}))})})]}),a&&h.jsx("div",{className:"text-[12.5px] text-accent-magenta",children:a})]})}function mx({value:r,onChange:t,options:s}){return h.jsxs("div",{className:"relative",children:[h.jsx("select",{className:"input input-lg appearance-none pr-9 w-full",value:r,onChange:a=>t(a.target.value),children:s.map(a=>h.jsx("option",{value:a.value,children:a.label},a.value))}),h.jsx("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-[70%] w-2 h-2 border-r border-b border-ink-500 rotate-45","aria-hidden":"true"})]})}function gx({rule:r,onEdit:t}){return h.jsxs("article",{className:"card p-6 sm:p-7 hover:bg-white/70 transition-colors",children:[h.jsxs("header",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"eyebrow mb-1.5",children:"Term"}),h.jsx("h3",{className:"display text-2xl break-words",children:r.term})]}),h.jsx("button",{onClick:t,className:"btn-ghost !py-1.5 !px-3 text-[12.5px] shrink-0",children:"Edit"})]}),h.jsxs("div",{className:"mt-5 flex flex-col gap-5",children:[h.jsx(Ns,{label:"Meaning in your work",children:h.jsx("p",{className:"text-ink-800 text-[14.5px] leading-relaxed whitespace-pre-wrap",children:r.user_meaning||h.jsx(vx,{children:"Not specified."})})}),(r.preferred_translation||r.avoid_translation)&&h.jsxs("div",{className:"grid sm:grid-cols-2 gap-5",children:[r.preferred_translation&&h.jsx(Ns,{label:"Preferred translation",accent:"ok",children:h.jsx("p",{className:"font-mono text-ink-800 text-[14.5px]",children:r.preferred_translation})}),r.avoid_translation&&h.jsx(Ns,{label:"Avoid",accent:"warn",children:h.jsx("p",{className:"font-mono text-ink-800 text-[14.5px] line-through decoration-accent-pink/60",children:r.avoid_translation})})]}),r.example_sentence&&h.jsx(Ns,{label:"Example",children:h.jsxs("p",{className:"text-ink-600 text-[14.5px] leading-relaxed font-display italic",children:['"',r.example_sentence,'"']})}),r.notes&&h.jsx(Ns,{label:"Notes",children:h.jsx("p",{className:"text-ink-500 text-[13.5px] leading-relaxed",children:r.notes})})]})]})}function Ns({label:r,accent:t,children:s}){const a=t==="ok"?"eyebrow text-accent-violet":t==="warn"?"eyebrow text-accent-magenta":"eyebrow";return h.jsxs("div",{children:[h.jsx("div",{className:a+" mb-1.5",children:r}),s]})}function vx({children:r}){return h.jsx("span",{className:"text-ink-400 italic font-display",children:r})}function gf({initial:r,onCancel:t,onSubmit:s,onDelete:a,submitLabel:l}){const[u,c]=I.useState({...up,...r}),[p,m]=I.useState(!1),[g,w]=I.useState(null);async function y(_){if(_.preventDefault(),!u.term.trim()||!u.user_meaning.trim()){w("Term and meaning are required.");return}m(!0),w(null);try{await s({term:u.term.trim(),user_meaning:u.user_meaning.trim(),preferred_translation:u.preferred_translation.trim(),avoid_translation:u.avoid_translation.trim(),example_sentence:u.example_sentence.trim(),notes:u.notes.trim()})}catch(E){w(E.message||"Could not save this rule.")}finally{m(!1)}}return h.jsxs("form",{onSubmit:y,className:"card-elev p-6 sm:p-7 flex flex-col gap-6 animate-fade-up",children:[h.jsxs("div",{children:[h.jsx("div",{className:"eyebrow-accent mb-3",children:r.id?"Edit rule":"New meaning rule"}),h.jsx("p",{className:"text-ink-600 text-[13.5px] leading-relaxed max-w-2xl",children:"Teach Context.
56io what this term means in your professional world, so it can preserve the meaning when translating or rewriting."})]}),h.jsx(Cr,{label:"Term or phrase",hint:"The word or phrase as it appears in your source text.",required:!0,children:h.jsx("input",{className:"input input-lg font-mono",value:u.term,maxLength:120,onChange:_=>c({...u,term:_.target.value}),placeholder:"conversion"})}),h.jsx(Cr,{label:"What does this mean in your work?",hint:"Describe the term the way you would explain it to a new colleague in your field.",required:!0,children:h.jsx("textarea",{className:"textarea",value:u.user_meaning,maxLength:1e3,onChange:_=>c({...u,user_meaning:_.target.value}),placeholder:"In Google Ads, a conversion means a valuable tracked action â a lead, signup, purchase, call, or trial start. It does not mean a general 'change.'"})}),h.jsxs("div",{className:"grid sm:grid-cols-2 gap-5",children:[h.jsx(Cr,{label:"Preferred translation, if you have one",children:h.jsx("input",{className:"input input-lg font-mono",value:u.preferred_translation,onChange:_=>c({...u,preferred_translation:_.target.value}),placeholder:"××ר×"})}),h.jsx(Cr,{label:"Translations or meanings to avoid",children:h.jsx("input",{className:"input input-lg font-mono",value:u.avoid_translation,onChange:_=>c({...u,avoid_translation:_.target.value}),placeholder:"ש×× ××"})})]}),h.jsx(Cr,{label:"Example sentence",hint:"A real sentence where this term appears.",children:h.jsx("input",{className:"input input-lg",value:u.example_sentence,maxLength:500,onChange:_=>c({...u,example_sentence:_.target.value}),placeholder:"The campaign generated 42 conversions this week."})}),h.jsx(Cr,{label:"Notes",hint:"Anything else worth knowing.",children:h.jsx("textarea",{className:"textarea !min-h-[80px]",rows:2,value:u.notes,maxLength:500,onChange:_=>c({...u,notes:_.target.value})})}),h.jsx("div",{className:"hairline -mx-6 sm:-mx-7"}),h.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[h.jsx("div",{className:"text-[12.5px] text-accent-magenta min-h-[1.25rem]",children:g||""}),h.jsxs("div",{className:"flex items-center gap-2",children:[a&&h.jsx("button",{type:"button",className:"btn-danger",onClick:a,children:"Delete"}),h.jsx("button",{type:"button",className:"btn-ghost",onClick:t,children:"Cancel"}),h.jsx("button",{type:"submit",className:"btn-accent",disabled:p,children:p?"Savingâ¦":l})]})]})]})}function Cr({label:r,hint:t,required:s,children:a}){return h.jsxs("label",{className:"flex flex-col gap-2",children:[h.jsxs("span",{className:"field-label",children:[r,s&&h.jsx("span",{className:"text-accent-magenta ml-1",children:"*"})]}),a,t&&h.jsx("span",{className:"field-hint",children:t})]})}function yx(){return h.jsxs("div",{className:"card-elev p-8 flex flex-col gap-4 relative overflow-hidden",children:[h.jsx("div",{className:"pointer-events-none absolute -top-24 -right-16 w-72 h-72 rounded-full glow-violet blur-3xl"}),h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"eyebrow-accent",children:"Coming online"}),h.jsxs("h3",{className:"mt-2 display text-3xl",children:["Meaning Rules sync ",h.jsx("em",{children:"isn't deployed yet."})]}),h.jsxs("p",{className:"mt-4 text-ink-600 text-[14.5px] max-w-2xl leading-relaxed",children:["The portal is ready, but the backend doesn't expose"," ",h.jsx("code",{className:"font-mono text-ink-800 bg-cream-200 px-1.5 py-0.5 rounded",children:"/meaning-rules"})," ","yet. When that endpoint is live, your rules will sync automatically â no changes here required."]})]})]})}function wx(){const{user:r,signOut:t}=Oa(),s=Mr();async function a(){await t(),s("/login",{replace:!0})}return h.jsxs("div",{className:"flex flex-col gap-8 max-w-2xl",children:[h.jsx(zr,{eyebrow:"Account",title:h.jsx(h.Fragment,{children:h.jsx("em",{children:"Account."})}
56),description:"Your identity in Context.io."}),h.jsxs("div",{className:"card-elev p-6 sm:p-8 flex flex-col gap-5",children:[h.jsx(Bl,{label:"Email",value:r?.email||"â",mono:!0}),h.jsx("div",{className:"hairline"}),h.jsx(Bl,{label:"User ID",value:r?.id||"â",mono:!0,subtle:!0}),h.jsx("div",{className:"hairline"}),h.jsx(Bl,{label:"Member since",value:r?.created_at?new Date(r.created_at).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}):"â"})]}),h.jsxs("div",{className:"card p-6 sm:p-8 flex flex-col gap-5",children:[h.jsxs("div",{children:[h.jsx("div",{className:"eyebrow mb-1.5",children:"Session"}),h.jsxs("h3",{className:"display text-2xl",children:["Sign out of ",h.jsx("em",{children:"this device."})]}),h.jsx("p",{className:"mt-2 text-[14px] text-ink-600 leading-relaxed",children:"You'll need to sign in again next time you open the portal."})]}),h.jsx("div",{children:h.jsx("button",{className:"btn-ghost",onClick:a,children:"Sign out"})})]})]})}function Bl({label:r,value:t,mono:s,subtle:a}){return h.jsxs("div",{className:"flex items-center justify-between gap-6",children:[h.jsx("span",{className:"field-label",children:r}),h.jsx("span",{className:(s?"font-mono ":"")+(a?"text-ink-500 text-[12.5px] ":"text-ink-900 text-[14px] ")+"truncate",children:t})]})}function vf(r,t,s,a,l,u,c){try{var p=r[u](c),m=p.value}catch(g){return void s(g)}p.done?t(m):Promise.resolve(m).then(a,l)}function xx(r){return function(){var t=this,s=arguments;return new Promise(function(a,l){var u=r.apply(t,s);function c(m){vf(u,a,l,c,p,"next",m)}function p(m){vf(u,a,l,c,p,"throw",m)}c(void 0)})}}function _x(r,t,s){return(t=Sx(t))in r?Object.defineProperty(r,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[t]=s,r}function yf(r,t){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);t&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),s.push.apply(s,a)}return s}function au(r){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?yf(Object(s),!0).forEach(function(a){_x(r,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(s)):yf(Object(s)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(s,a))})}return r}function cp(r,t){if(r==null)return{};var s,a,l=kx(r,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(r);for(a=0;a<u.length;a++)s=u[a],t.includes(s)||{}.propertyIsEnumerable.call(r,s)&&(l[s]=r[s])}return l}function kx(r,t){if(r==null)return{};var s={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(t.includes(a))continue;s[a]=r[a]}return s}function ou(){ou=function(){return t};var r,t={},s=Object.prototype,a=s.hasOwnProperty,l=Object.defineProperty||function(B,C,T){B[C]=T.value},u=typeof Symbol=="function"?Symbol:{},c=u.iterator||"@@iterator",p=u.asyncIterator||"@@asyncIterator",m=u.toStringTag||"@@toStringTag";function g(B,C,T){return Object.defineProperty(B,C,{value:T,enumerable:!0,configurable:!0,writable:!0}),B[C]}try{g({},"")}catch{g=function(C,T,H){return C[T]=H}}function w(B,C,T,H){var L=C&&C.prototype instanceof D?C:D,b=Object.create(L.prototype),$=new Le(H||[]);return l(b,"_invoke",{value:ce(B,T,$)}),b}function y(B,C,T){try{return{type:"normal",arg:B.call(C,T)}}catch(H){return{type:"throw",arg:H}}}t.wrap=w;var _="suspendedStart",E="suspendedYield",j="executing",O="completed",N={};function D(){}function M(){}function U(){}var q={};g(q,c,function(){return this});var ue=Object.getPrototypeOf,Y=ue&&ue(ue(Qe([])));Y&&Y!==s&&a.call(Y,c)&&(q=Y);var oe=U.prototype=D.prototype=Object.create(q);function ye(B){["next","throw","return"].forEach(function(C){g(B,C,function(T){return this._invoke(C,T)})})}function te(B,C){function T(L,b,$,ne){var ie=y(B[L],B,b);if(ie.type!=="throw"){var de=ie.arg,he=de.value;return he&&typeof he=="object"&&a.call(he,"__await")?C.resolve(he.__await).then(function(pe){T("next",pe,$,ne)},function(pe){T("throw",pe,$,ne)}):C.resolve(he).then(function(pe){de.value=pe,$(de)},function(pe){return T("throw",pe,$,ne)})}ne(ie.arg)}var H;l(this,"_invoke",{value:function(L,b){function $(){return new C(function(ne,ie){T(L,b,ne,ie)})}return H=H?H.then($,$):$()}})}
vendor: 4,656 bytes, line 56
56function ce(B,C,T){var H=_;return function(L,b){if(H===j)throw Error("Generator is already running");if(H===O){if(L==="throw")throw b;return{value:r,done:!0}}for(T.method=L,T.arg=b;;){var $=T.delegate;if($){var ne=ge($,T);if(ne){if(ne===N)continue;return ne}}if(T.method==="next")T.sent=T._sent=T.arg;else if(T.method==="throw"){if(H===_)throw H=O,T.arg;T.dispatchException(T.arg)}else T.method==="return"&&T.abrupt("return",T.arg);H=j;var ie=y(B,C,T);if(ie.type==="normal"){if(H=T.done?O:E,ie.arg===N)continue;return{value:ie.arg,done:T.done}}ie.type==="throw"&&(H=O,T.method="throw",T.arg=ie.arg)}}}function ge(B,C){var T=C.method,H=B.iterator[T];if(H===r)return C.delegate=null,T==="throw"&&B.iterator.return&&(C.method="return",C.arg=r,ge(B,C),C.method==="throw")||T!=="return"&&(C.method="throw",C.arg=new TypeError("The iterator does not provide a '"+T+"' method")),N;var L=y(H,B.iterator,C.arg);if(L.type==="throw")return C.method="throw",C.arg=L.arg,C.delegate=null,N;var b=L.arg;return b?b.done?(C[B.resultName]=b.value,C.next=B.nextLoc,C.method!=="return"&&(C.method="next",C.arg=r),C.delegate=null,N):b:(C.method="throw",C.arg=new TypeError("iterator result is not an object"),C.delegate=null,N)}function Ee(B){var C={tryLoc:B[0]};1 in B&&(C.catchLoc=B[1]),2 in B&&(C.finallyLoc=B[2],C.afterLoc=B[3]),this.tryEntries.push(C)}function Te(B){var C=B.completion||{};C.type="normal",delete C.arg,B.completion=C}function Le(B){this.tryEntries=[{tryLoc:"root"}],B.forEach(Ee,this),this.reset(!0)}function Qe(B){if(B||B===""){var C=B[c];if(C)return C.call(B);if(typeof B.next=="function")return B;if(!isNaN(B.length)){var T=-1,H=function L(){for(;++T<B.length;)if(a.call(B,T))return L.value=B[T],L.done=!1,L;return L.value=r,L.done=!0,L};return H.next=H}}throw new TypeError(typeof B+" is not iterable")}return M.prototype=U,l(oe,"constructor",{value:U,configurable:!0}),l(U,"constructor",{value:M,configurable:!0}),M.displayName=g(U,m,"GeneratorFunction"),t.isGeneratorFunction=function(B){var C=typeof B=="function"&&B.constructor;return!!C&&(C===M||(C.displayName||C.name)==="GeneratorFunction")},t.mark=function(B){return Object.setPrototypeOf?Object.setPrototypeOf(B,U):(B.__proto__=U,g(B,m,"GeneratorFunction")),B.prototype=Object.create(oe),B},t.awrap=function(B){return{__await:B}},ye(te.prototype),g(te.prototype,p,function(){return this}),t.AsyncIterator=te,t.async=function(B,C,T,H,L){L===void 0&&(L=Promise);var b=new te(w(B,C,T,H),L);return t.isGeneratorFunction(C)?b:b.next().then(function($){return $.done?$.value:b.next()})},ye(oe),g(oe,m,"Generator"),g(oe,c,function(){return this}),g(oe,"toString",function(){return"[object Generator]"}),t.keys=function(B){var C=Object(B),T=[];for(var H in C)T.push(H);return T.reverse(),function L(){for(;T.length;){var b=T.pop();if(b in C)return L.value=b,L.done=!1,L}return L.done=!0,L}},t.values=Qe,Le.prototype={constructor:Le,reset:function(B){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Te),!B)for(var C in this)C.charAt(0)==="t"&&a.call(this,C)&&!isNaN(+C.slice(1))&&(this[C]=r)},stop:function(){this.done=!0;var B=this.tryEntries[0].completion;if(B.type==="throw")throw B.arg;return this.rval},dispatchException:function(B){if(this.done)throw B;var C=this;function T(ie,de){return b.type="throw",b.arg=B,C.next=ie,de&&(C.method="next",C.arg=r),!!de}for(var H=this.tryEntries.length-1;H>=0;--H){var L=this.tryEntries[H],b=L.completion;if(L.tryLoc==="root")return T("end");if(L.tryLoc<=this.prev){var $=a.call(L,"catchLoc"),ne=a.call(L,"finallyLoc");if($&&ne){if(this.prev<L.catchLoc)return T(L.catchLoc,!0);if(this.prev<L.finallyLoc)return T(L.finallyLoc)}else if($){if(this.prev<L.catchLoc)return T(L.catchLoc,!0)}else{if(!ne)throw Error("try statement without catch or finally");if(this.prev<L.finallyLoc)return T(L.finallyLoc)}}}},abrupt:function(B,C){for(var T=this.tryEntries.length-1;T>=0;--T){var H=this.tryEntries[T];if(H.tryLoc<=this.prev&&a.call(H,"finallyLoc")&&this.prev<H.finallyLoc){var L=H;break}}L&&(B==="break"||B==="continue")&&L.tryLoc<=C&&C<=L.finallyLoc&&(L=null);var b=L?L.completion:{};return b.type=B,b.arg=C,L?(this.method="next",this.next=L.finallyLoc,N):this.complete(b)},complete:function(B,C){if(B.type==="throw")throw B.arg;return B.type==="break"||B.type==="continue"?this.next=B.arg:B.type==="return"?(this.rval=this.arg=B.arg,this.method="return",this.next="end"):B.type==="normal"&&C&&(this.next=C),N},finish:function(B){for(var C=this.tryEntries.length-1;C>=0;--C){var T=this.tryEntries[C];if(T.finallyLoc===B)return this.complete(T.completion,T.afterLoc),Te(T),N}}
56,catch:function(B){for(var C=this.tryEntries.length-1;C>=0;--C){var T=this.tryEntries[C];if(T.tryLoc===B){var H=T.completion;if(H.type==="throw"){var L=H.arg;Te(T)}return L}}throw Error("illegal catch attempt")},delegateYield:function(B,C,T){return this.delegate={iterator:Qe(B),resultName:C,nextLoc:T},this.method==="next"&&(this.arg=r),N}},t}function bx(r,t){if(typeof r!="object"||!r)return r;var s=r[Symbol.toPrimitive];if(s!==void 0){var a=s.call(r,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function Sx(r){var t=bx(r,"string");return typeof t=="symbol"?t:t+""}var Vs={CLASSIC:"classic",V1:"v1"},Ex=Vs.V1,jx="https://cdn.paddle.com/paddle/paddle.js",Cx="https://cdn.paddle.com/paddle/v2/paddle.js",Tx={url:jx},Px={url:Cx};function Nx(r){return document.querySelector('script[src="'.concat(r,'"]'))||void 0}function Rx(r){var t=document.createElement("script");t.src=r;var s=document.head||document.body;if(!s)throw new Error("Cannot inject Paddle.js. It needs a <head> or <body> element.");return s.appendChild(t),t}var Fl={classic:void 0,v1:void 0},Ox={classic:"PaddleClassic",v1:"PaddleBillingV1"};function Ax(r){var t,s=(t=Lx(r))===null||t===void 0?void 0:t.url;if(s){var a=Fl[r],l=Ox[r];return a!==void 0?a:(Fl[r]=new Promise(function(u,c){if(typeof window>"u"){u(void 0);return}if(window[l]){u(window[l]);return}try{var p=Nx(s);p||(p=Rx(s)),p.addEventListener("load",function(){window[l]?u(window[l]):c(new Error("Paddle.js not available"))}),p.addEventListener("error",function(){c(new Error("Failed to load Paddle.js - ".concat(r)))})}catch(m){c(m);return}}),Fl[r])}}function Lx(r){if(r===Vs.CLASSIC)return Tx;if(r===Vs.V1)return Px;console.error("[Paddle] Unknown Paddle Version")}var Ix=["environment","version"],Ux=["environment","version"];function $x(r,t){var s=r.environment;r.version;var a=cp(r,Ix);try{s&&t.Environment.set(s),t.Initialized?t.Update(au({},a)):t.Initialize(au({},a))}catch(l){console.warn("[Paddle] Paddle Initialization failed. Please check the inputs",l)}}function Dx(r,t){var s=r.environment;r.version;var a=cp(r,Ux);try{s&&t.Environment.set(s),t.Setup(au({},a))}catch(l){console.warn("[Paddle] Paddle Initialization failed. Please check the inputs",l)}}var wf;(function(r){r.CHECKOUT_LOADED="checkout.loaded",r.CHECKOUT_CLOSED="checkout.closed",r.CHECKOUT_UPDATED="checkout.updated",r.CHECKOUT_COMPLETED="checkout.completed",r.CHECKOUT_ERROR="checkout.error",r.CHECKOUT_FAILED="checkout.failed",r.CHECKOUT_ITEMS_UPDATED="checkout.items.updated",r.CHECKOUT_ITEMS_REMOVED="checkout.items.removed",r.CHECKOUT_CUSTOMER_CREATED="checkout.customer.created",r.CHECKOUT_CUSTOMER_UPDATED="checkout.customer.updated",r.CHECKOUT_CUSTOMER_REMOVED="checkout.customer.removed",r.CHECKOUT_PAYMENT_SELECTED="checkout.payment.selected",r.CHECKOUT_PAYMENT_INITIATED="checkout.payment.initiated",r.CHECKOUT_PAYMENT_FAILED="checkout.payment.failed",r.CHECKOUT_PAYMENT_ERROR="checkout.payment.error",r.CHECKOUT_DISCOUNT_APPLIED="checkout.discount.applied",r.CHECKOUT_DISCOUNT_REMOVED="checkout.discount.removed",r.CHECKOUT_UPSELL_CANCELED="checkout.upsell.canceled"})(wf||(wf={}));var xf;(function(r){r.DAY="day",r.WEEK="week",r.MONTH="month",r.YEAR="year"})(xf||(xf={}));var _f;(function(r){r.ALIPAY="alipay",r.APPLE_PAY="apple-pay",r.CARD="card",r.GOOGLE_PAY="google-pay",r.IDEAL="ideal",r.PAYPAL="paypal",r.WECHAT_PAY="wechat-pay",r.WIRE_TRANSFER="wire-transfer",r.NONE="none"})(_f||(_f={}));var kf;(function(r){r.AMERICAN_EXPRESS="american_express",r.DINERS_CLUB="diners_club",r.DISCOVER="discover",r.JCB="jcb",r.MADA="mada",r.MAESTRO="maestro",r.MASTER_CARD="mastercard",r.UNION_PAY="union_pay",r.VISA="visa",r.UNKNOWN="unknown"})(kf||(kf={}));var bf;(function(r){r.DRAFT="draft",r.READY="ready",r.COMPLETED="completed",r.BILLED="billed",r.canceled="canceled",r.PAST_DUE="past_due"})(bf||(bf={}));function Mx(r){return lu.apply(this,arguments)}function lu(){return lu=xx(ou().mark(function r(t){var s,a;return ou().wrap(function(u){for(;;
56)switch(u.prev=u.next){case 0:return s=t?.version||Ex,u.next=3,Ax(s);case 3:if(a=u.sent,!a){u.next=9;break}return t&&(s===Vs.V1?$x(t,a):s===Vs.CLASSIC&&Dx(t,a)),u.abrupt("return",a);case 9:return console.error("[Paddle] Error Loading Paddle"),u.abrupt("return");case 11:case"end":return u.stop()}},r)})),lu.apply(this,arguments)}const Sf="live_18848f57b0611532a8fa197fd78",Ef="pri_01ktv8xg72dbq1dkh7fq5q7atw",Bx="production",Fx=[{label:"50 translations / month",included:!0},{label:"700 characters per translation",included:!0},{label:"Basic professional profile",included:!0},{label:"Language, tone, output format",included:!0},{label:"Detailed Professional Context",included:!1},{label:"Custom meaning rules",included:!1},{label:"Multiple profiles",included:!1}],zx=[{label:"2,000 translations / month",included:!0,highlight:!0},{label:"4,000 characters per translation",included:!0,highlight:!0},{label:"Detailed Professional Context",included:!0},{label:"Custom meaning rules",included:!0},{label:"Multiple profiles",included:!0},{label:"Language, tone, output format",included:!0},{label:"Priority access to new features",included:!0}];function Hx(){const{me:r}=Br()||{},t=Aa(r),s=r?.subscription_status==="canceling",[a,l]=I.useState(null),[u,c]=I.useState("idle"),[p,m]=I.useState(""),[g,w]=I.useState("idle"),[y,_]=I.useState(""),E=I.useCallback(async()=>{for(let M=0;M<6;M++){await new Promise(U=>setTimeout(U,2e3));try{if((await Fe.me())?.plan==="pro"){window.location.reload();return}}catch{}}window.location.reload()},[]);I.useEffect(()=>{if(t||!Sf)return;let M=!1;return Mx({environment:Bx,token:Sf,eventCallback:U=>{U?.name==="checkout.completed"&&(c("activating"),E())}}).then(U=>{!M&&U&&l(U)}).catch(()=>{M||m("Couldn't load checkout. Please refresh and try again.")}),()=>{M=!0}},[t,E]);const j=I.useCallback(()=>{if(!a||!Ef||!r?.user?.id){m("Checkout isn't ready yet â give it a second and try again.");return}m(""),c("opening"),a.Checkout.open({settings:{displayMode:"overlay",theme:"light"},items:[{priceId:Ef,quantity:1}],customData:{userId:r.user.id},...r.user.email?{customer:{email:r.user.email}}:{}})},[a,r]),O=I.useCallback(async()=>{_(""),w("working");try{await Fe.cancelSubscription(),window.location.reload()}catch(M){_(M?.message||"Couldn't cancel â please try again."),w("confirming")}},[]),N=I.useCallback(async()=>{_(""),w("working");try{await Fe.resumeSubscription(),window.location.reload()}catch(M){_(M?.message||"Couldn't renew â please try again."),w("idle")}},[]);let D;return t&&s?D=h.jsxs("div",{className:"flex flex-col gap-3 w-full",children:[h.jsxs("p",{className:"text-[13px] text-ink-600",children:["Your Pro plan is set to ",h.jsx("strong",{className:"text-accent-magenta font-medium",children:"cancel at the end of your billing period"}),". You'll keep full access until then."]}),h.jsx("button",{type:"button",onClick:N,disabled:g==="working",className:"btn-accent w-full justify-center",children:g==="working"?"Renewingâ¦":"Renew Pro"}),y&&h.jsx("p",{className:"text-[12px] text-accent-magenta",children:y})]}):t&&(g==="confirming"||g==="working")?D=h.jsxs("div",{className:"flex flex-col gap-3 w-full",children:[h.jsx("p",{className:"text-[13px] text-ink-600",children:"Cancel Pro? You'll keep full access until the end of your current billing period, then drop to Free."}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{type:"button",onClick:()=>w("idle"),disabled:g==="working",className:"btn-accent flex-1 justify-center",children:"Keep Pro"}),h.jsx("button",{type:"button",onClick:O,disabled:g==="working",className:"flex-1 justify-center rounded-lg border border-accent-pink/40 text-accent-magenta text-[13px] py-2.5 hover:bg-accent-pink/5 disabled:opacity-50 transition-colors",children:g==="working"?"Cancelingâ¦":"Cancel anyway"})]}),y&&h.jsx("p",{className:"text-[12px] text-accent-magenta",children:y})]}):t?D=h.jsx("button",{type:"button",onClick:()=>{_(""),w("confirming")},className:"text-[13px] text-ink-500 hover:text-accent-magenta transition-colors self-start",children:"Cancel Pro"}):D=h.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h.jsx("button",{type:"button",onClick:j,disabled:!a||u==="activating",className:"btn-accent w-full justify-center",children:u==="activating"?"Activating your Pro accessâ¦":a?"Upgrade to Pro â $19/mo":"Loadingâ¦"}),p&&h.jsx("p",{className:"text-[12px] text-accent-magenta",children:p})]}),h.jsxs("div",{className:"flex flex-col gap-10",children:[h.jsx(zr,{eyebrow:"Plans",title:t?h.jsxs(h.Fragment,{children:["You're on ",h.jsx("em",{children:"Pro."})]}):h.jsxs(h.Fragment,{children:["Upgrade to ",h.jsx("em",{children:"Pro."})]}),description:t?"Thanks for being a Pro user. Everything advanced is unlocked.":"Unlock 2,000 translations a month, detailed professional context, custom meaning rules, and more."}),h.jsxs("div",{className:"grid lg:grid-cols-2 gap-5",children:[h.jsx(jf,{name:"Free",tagline:"Everything you need to try it.",price:"$0",period:"forever",features:Fx,current:!t}),h.jsx(jf,{name:"Pro",tagline:"For professionals who translate every day.",price:"$19",period:"/mo",features:zx,accent:!0,current:t,cta:D})]})]})}function jf({name:r,tagline:t,price:s,period:a,features:l,accent:u,current:c,cta:p}){return h.jsxs("div",{className:"card-elev p-7 sm:p-8 relative overflow-hidden flex flex-col gap-6 "+(u?"border-accent-pink/30":""),children:[u&&h.jsx("div",{className:"pointer-events-none absolute -top-24 -right-24 w-[360px] h-[360px] rounded-full glow-pink blur-3xl"}),h.jsxs("div",{className:"relative",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"eyebrow",children:r}),c&&h.jsx("span",{className:"plan-badge !text-accent-magenta !border-accent-pink/30 bg-white/60",children:"Your plan"})]}),h.jsx("h3",{className:"display text-3xl mt-2",children:t}),h.jsxs("div",{className:"mt-5 flex items-baseline gap-2",children:[h.jsx("span",{className:"display text-4xl",children:s}),a&&h.jsx("span",{className:"text-ink-400 text-[14px]",children:a})]})]}),h.jsx("ul",{className:"relative flex flex-col gap-2.5",children:l.map((m,g)=>h.jsxs("li",{className:"flex items-baseline gap-3 text-[13.5px]",children:[m.included?h.jsx(Wx,{className:"text-accent-magenta"}):h.jsx(Vx,{className:"text-ink-300"}),h.jsx("span",{className:m.included?"text-ink-800":"text-ink-400 line-through",children:m.label})]},g))}),p&&h.jsx("div",{className:"relative",children:p})]})}function Wx({className:r=""}){return h.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",className:r+" shrink-0 translate-y-[3px]","aria-hidden":"true",children:h.jsx("path",{d:"M3 7.5 L6 10.5 L11 4.5",stroke:"currentColor",strokeWidth:"1.6",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}function Vx({className:r=""}){return h.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",className:r+" shrink-0 translate-y-[3px]","aria-hidden":"true",children:h.jsx("path",{d:"M3 7 L11 7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function qx(){return h.jsxs(cv,{children:[h.jsx(Ot,{path:"/login",element:h.jsx(Xw,{})}),h.jsxs(Ot,{element:h.jsx($w,{children:h.jsx(Aw,{})}),children:[h.jsx(Ot,{path:"/dashboard",element:h.jsx(ex,{})}),h.jsx(Ot,{path:"/profile",element:h.jsx(Bw,{})}),h.jsx(Ot,{path:"/usage",element:h.jsx(ux,{})}),h.jsx(Ot,{path:"/upgrade",element:h.jsx(Hx,{})}),h.jsx(Ot,{path:"/account",element:h.jsx(wx,{})}),h.jsx(Ot,{path:"/meaning-rules",element:h.jsx(Qw,{feature:Gn.meaningRules,children:h.jsx(fx,{})})})]}),h.jsx(Ot,{path:"/",element:h.jsx(ga,{to:"/dashboard",replace:!0})}),h.jsx(Ot,{path:"*",element:h.jsx(ga,{to:"/dashboard",replace:!0})})]})}yg.createRoot(document.getElementById("root")).render(h.jsx(I.StrictMode,{children:h.jsx(yv,{children:h.jsx(Cw,{children:h.jsx(qx,{})})})}));
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.