PageSourceSearch

https://www.aibvf.com/assets/app-Da1gua_E.js

js aibvf.com collected 2026-10-09 22:05:07 UTC 573,437 bytes, 147 lines download raw bytes

vendor: 5,910 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BVFTab-CT8XXsWN.js","assets/AiAdvisor-iMYtlEGE.js","assets/PortfolioTab-Bgf44RbP.js","assets/RegulatoryTab-DmFv0FmM.js","assets/RegulatoryTab-D_hEU4vo.css","assets/ChangeEnablementTab-D7IOqG_S.js","assets/ChangeEnablementTab-B96ybulL.css","assets/HealthcareModule-DItJHEau.js","assets/HealthcareModule-Cxb6oZiq.css","assets/PaceLayerDiagnostic-uWexslTX.js","assets/PaceLayerDiagnostic-C4QEALBH.css"])))=>i.map(i=>d[i]);
2(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function r(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(c){if(c.ep)return;c.ep=!0;const d=r(c);fetch(c.href,d)}})();var mu={exports:{}},Ir={};var cm;function C0(){if(cm)return Ir;cm=1;var a=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(l,c,d){var f=null;if(d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),"key"in c){d={};for(var p in c)p!=="key"&&(d[p]=c[p])}else d=c;return c=d.ref,{$$typeof:a,type:l,key:f,ref:c!==void 0?c:null,props:d}}return Ir.Fragment=n,Ir.jsx=r,Ir.jsxs=r,Ir}var um;function k0(){return um||(um=1,mu.exports=C0()),mu.exports}var u=k0(),gu={exports:{}},ye={};var dm;function O0(){if(dm)return ye;dm=1;var a=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),x=Symbol.iterator;function E(S){return S===null||typeof S!="object"?null:(S=x&&S[x]||S["@@iterator"],typeof S=="function"?S:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,C={};function D(S,N,G){this.props=S,this.context=N,this.refs=C,this.updater=G||T}D.prototype.isReactComponent={},D.prototype.setState=function(S,N){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,N,"setState")},D.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function q(){}q.prototype=D.prototype;function L(S,N,G){this.props=S,this.context=N,this.refs=C,this.updater=G||T}var X=L.prototype=new q;X.constructor=L,k(X,D.prototype),X.isPureReactComponent=!0;var ne=Array.isArray;function K(){}var Q={H:null,A:null,T:null,S:null},me=Object.prototype.hasOwnProperty;function le(S,N,G){var Y=G.ref;return{$$typeof:a,type:S,key:N,ref:Y!==void 0?Y:null,props:G}}function $e(S,N){return le(S.type,N,S.props)}function Me(S){return typeof S=="object"&&S!==null&&S.$$typeof===a}function Pe(S){var N={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(G){return N[G]})}var oe=/\/+/g;function je(S,N){return typeof S=="object"&&S!==null&&S.key!=null?Pe(""+S.key):N.toString(36)}function Se(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(K,K):(S.status="pending",S.then(function(N){S.status==="pending"&&(S.status="fulfilled",S.value=N)},function(N){S.status==="pending"&&(S.status="rejected",S.reason=N)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function I(S,N,G,Y,Z){var J=typeof S;(J==="undefined"||J==="boolean")&&(S=null);var de=!1;if(S===null)de=!0;else switch(J){case"bigint":case"string":case"number":de=!0;break;case"object":switch(S.$$typeof){case a:case n:de=!0;break;case v:return de=S._init,I(de(S._payload),N,G,Y,Z)}}if(de)return Z=Z(S),de=Y===""?"."+je(S,0):Y,ne(Z)?(G="",de!=null&&(G=de.replace(oe,"$&/")+"/"),I(Z,N,G,"",function(Vt){return Vt})):Z!=null&&(Me(Z)&&(Z=$e(Z,G+(Z.key==null||S&&S.key===Z.key?"":(""+Z.key).replace(oe,"$&/")+"/")+de)),N.push(Z)),1;de=0;var ge=Y===""?".":Y+":";if(ne(S))for(var Oe=0;Oe<S.length;Oe++)Y=S[Oe],J=ge+je(Y,Oe),de+=I(Y,N,G,J,Z);else if(Oe=E(S),typeof Oe=="function")for(S=Oe.call(S),Oe=0;!(Y=S.next()).done;)Y=Y.value,J=ge+je(Y,Oe++),de+=I(Y,N,G,J,Z);else if(J==="object"){if(typeof S.then=="function")return I(Se(S),N,G,Y,Z);throw N=String(S),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return de}function B(S,N,G){if(S==null)return S;var Y=[],Z=0;return I(S,Y,"","",function(J){return N.call(G,J,Z++)}),Y}function ee(S){if(S._status===-1){var N=S._result;N=N(),N.then(function(G){(S._status===0||S._status===-1)&&(S._status=1,S._result=G)},function(G){(S._status===0||S._status===-1)&&(S._status=2,S._result=G)}),S._status===-1&&(S._status=0,S._result=N)}if(S._status===1)return S._result.default;throw S._result}var ve=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var N=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(N))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)}
vendor: 14,603 bytes, line 2
2,P={map:B,forEach:function(S,N,G){B(S,function(){N.apply(this,arguments)},G)},count:function(S){var N=0;return B(S,function(){N++}),N},toArray:function(S){return B(S,function(N){return N})||[]},only:function(S){if(!Me(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ye.Activity=_,ye.Children=P,ye.Component=D,ye.Fragment=r,ye.Profiler=c,ye.PureComponent=L,ye.StrictMode=l,ye.Suspense=m,ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,ye.__COMPILER_RUNTIME={__proto__:null,c:function(S){return Q.H.useMemoCache(S)}},ye.cache=function(S){return function(){return S.apply(null,arguments)}},ye.cacheSignal=function(){return null},ye.cloneElement=function(S,N,G){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var Y=k({},S.props),Z=S.key;if(N!=null)for(J in N.key!==void 0&&(Z=""+N.key),N)!me.call(N,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&N.ref===void 0||(Y[J]=N[J]);var J=arguments.length-2;if(J===1)Y.children=G;else if(1<J){for(var de=Array(J),ge=0;ge<J;ge++)de[ge]=arguments[ge+2];Y.children=de}return le(S.type,Z,Y)},ye.createContext=function(S){return S={$$typeof:f,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:d,_context:S},S},ye.createElement=function(S,N,G){var Y,Z={},J=null;if(N!=null)for(Y in N.key!==void 0&&(J=""+N.key),N)me.call(N,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(Z[Y]=N[Y]);var de=arguments.length-2;if(de===1)Z.children=G;else if(1<de){for(var ge=Array(de),Oe=0;Oe<de;Oe++)ge[Oe]=arguments[Oe+2];Z.children=ge}if(S&&S.defaultProps)for(Y in de=S.defaultProps,de)Z[Y]===void 0&&(Z[Y]=de[Y]);return le(S,J,Z)},ye.createRef=function(){return{current:null}},ye.forwardRef=function(S){return{$$typeof:p,render:S}},ye.isValidElement=Me,ye.lazy=function(S){return{$$typeof:v,_payload:{_status:-1,_result:S},_init:ee}},ye.memo=function(S,N){return{$$typeof:y,type:S,compare:N===void 0?null:N}},ye.startTransition=function(S){var N=Q.T,G={};Q.T=G;try{var Y=S(),Z=Q.S;Z!==null&&Z(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(K,ve)}catch(J){ve(J)}finally{N!==null&&G.types!==null&&(N.types=G.types),Q.T=N}},ye.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},ye.use=function(S){return Q.H.use(S)},ye.useActionState=function(S,N,G){return Q.H.useActionState(S,N,G)},ye.useCallback=function(S,N){return Q.H.useCallback(S,N)},ye.useContext=function(S){return Q.H.useContext(S)},ye.useDebugValue=function(){},ye.useDeferredValue=function(S,N){return Q.H.useDeferredValue(S,N)},ye.useEffect=function(S,N){return Q.H.useEffect(S,N)},ye.useEffectEvent=function(S){return Q.H.useEffectEvent(S)},ye.useId=function(){return Q.H.useId()},ye.useImperativeHandle=function(S,N,G){return Q.H.useImperativeHandle(S,N,G)},ye.useInsertionEffect=function(S,N){return Q.H.useInsertionEffect(S,N)},ye.useLayoutEffect=function(S,N){return Q.H.useLayoutEffect(S,N)},ye.useMemo=function(S,N){return Q.H.useMemo(S,N)},ye.useOptimistic=function(S,N){return Q.H.useOptimistic(S,N)},ye.useReducer=function(S,N,G){return Q.H.useReducer(S,N,G)},ye.useRef=function(S){return Q.H.useRef(S)},ye.useState=function(S){return Q.H.useState(S)},ye.useSyncExternalStore=function(S,N,G){return Q.H.useSyncExternalStore(S,N,G)},ye.useTransition=function(){return Q.H.useTransition()},ye.version="19.2.4",ye}var hm;function ed(){return hm||(hm=1,gu.exports=O0()),gu.exports}var w=ed(),yu={exports:{}},Hr={},vu={exports:{}},bu={};var fm;function B0(){return fm||(fm=1,(function(a){function n(I,B){var ee=I.length;I.push(B);e:for(;0<ee;){var ve=ee-1>>>1,P=I[ve];if(0<c(P,B))I[ve]=B,I[ee]=P,ee=ve;else break e}}function r(I){return I.length===0?null:I[0]}function l(I){if(I.length===0)return null;var B=I[0],ee=I.pop();if(ee!==B){I[0]=ee;e:for(var ve=0,P=I.length,S=P>>>1;ve<S;){var N=2*(ve+1)-1,G=I[N],Y=N+1,Z=I[Y];if(0>c(G,ee))Y<P&&0>c(Z,G)?(I[ve]=Z,I[Y]=ee,ve=Y):(I[ve]=G,I[N]=ee,ve=N);else if(Y<P&&0>c(Z,ee))I[ve]=Z,I[Y]=ee,ve=Y;else break e}}return B}function c(I,B){var ee=I.sortIndex-B.sortIndex;return ee!==0?ee:I.id-B.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var f=Date,p=f.now();a.unstable_now=function(){return f.now()-p}}var m=[],y=[],v=1,_=null,x=3,E=!1,T=!1,k=!1,C=!1,D=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function X(I){for(var B=r(y);B!==null;){if(B.callback===null)l(y);else if(B.startTime<=I)l(y),B.sortIndex=B.expirationTime,n(m,B);else break;B=r(y)}}function ne(I){if(k=!1,X(I),!T)if(r(m)!==null)T=!0,K||(K=!0,Pe());else{var B=r(y);B!==null&&Se(ne,B.startTime-I)}}var K=!1,Q=-1,me=5,le=-1;function $e(){return C?!0:!(a.unstable_now()-le<me)}function Me(){if(C=!1,K){var I=a.unstable_now();le=I;var B=!0;try{e:{T=!1,k&&(k=!1,q(Q),Q=-1),E=!0;var ee=x;try{t:{for(X(I),_=r(m);_!==null&&!(_.expirationTime>I&&$e());){var ve=_.callback;if(typeof ve=="function"){_.callback=null,x=_.priorityLevel;var P=ve(_.expirationTime<=I);if(I=a.unstable_now(),typeof P=="function"){_.callback=P,X(I),B=!0;break t}_===r(m)&&l(m),X(I)}else l(m);_=r(m)}if(_!==null)B=!0;else{var S=r(y);S!==null&&Se(ne,S.startTime-I),B=!1}}break e}finally{_=null,x=ee,E=!1}B=void 0}}finally{B?Pe():K=!1}}}var Pe;if(typeof L=="function")Pe=function(){L(Me)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,je=oe.port2;oe.port1.onmessage=Me,Pe=function(){je.postMessage(null)}}else Pe=function(){D(Me,0)};function Se(I,B){Q=D(function(){I(a.unstable_now())},B)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(I){I.callback=null},a.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):me=0<I?Math.floor(1e3/I):5},a.unstable_getCurrentPriorityLevel=function(){return x},a.unstable_next=function(I){switch(x){case 1:case 2:case 3:var B=3;break;default:B=x}var ee=x;x=B;try{return I()}finally{x=ee}},a.unstable_requestPaint=function(){C=!0},a.unstable_runWithPriority=function(I,B){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var ee=x;x=I;try{return B()}finally{x=ee}},a.unstable_scheduleCallback=function(I,B,ee){var ve=a.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ve+ee:ve):ee=ve,I){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=ee+P,I={id:v++,callback:B,priorityLevel:I,startTime:ee,expirationTime:P,sortIndex:-1},ee>ve?(I.sortIndex=ee,n(y,I),r(m)===null&&I===r(y)&&(k?(q(Q),Q=-1):k=!0,Se(ne,ee-ve))):(I.sortIndex=P,n(m,I),T||E||(T=!0,K||(K=!0,Pe()))),I},a.unstable_shouldYield=$e,a.unstable_wrapCallback=function(I){var B=x;return function(){var ee=x;x=B;try{return I.apply(this,arguments)}finally{x=ee}}}})(bu)),bu}var pm;function D0(){return pm||(pm=1,vu.exports=B0()),vu.exports}var _u={exports:{}},_t={};var mm;function N0(){if(mm)return _t;mm=1;var a=ed();function n(m){var y="https://react.dev/errors/"+m;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)y+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var l={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},c=Symbol.for("react.portal");function d(m,y,v){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:_==null?null:""+_,children:m,containerInfo:y,implementation:v}}var f=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(m,y){if(m==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return _t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,_t.createPortal=function(m,y){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(n(299));return d(m,y,null,v)},_t.flushSync=function(m){var y=f.T,v=l.p;try{if(f.T=null,l.p=2,m)return m()}finally{f.T=y,l.p=v,l.d.f()}},_t.preconnect=function(m,y){typeof m=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,l.d.C(m,y))},_t.prefetchDNS=function(m){typeof m=="string"&&l.d.D(m)},_t.preinit=function(m,y){if(typeof m=="string"&&y&&typeof y.as=="string"){var v=y.as,_=p(v,y.crossOrigin),x=typeof y.integrity=="string"?y.integrity:void 0,E=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;v==="style"?l.d.S(m,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:_,integrity:x,fetchPriority:E}):v==="script"&&l.d.X(m,{crossOrigin:_,integrity:x,fetchPriority:E,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},_t.preinitModule=function(m,y){if(typeof m=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var v=p(y.as,y.crossOrigin);l.d.M(m,{crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&l.d.M(m)},_t.preload=function(m,y){if(typeof m=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var v=y.as,_=p(v,y.crossOrigin);l.d.L(m,v,{crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},_t.preloadModule=function(m,y){if(typeof m=="string")if(y){var v=p(y.as,y.crossOrigin);l.d.m(m,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else l.d.m(m)},_t.requestFormReset=function(m){l.d.r(m)},_t.unstable_batchedUpdates=function(m,y){return m(y)},_t.useFormState=function(m,y,v){return f.H.useFormState(m,y,v)},_t.useFormStatus=function(){return f.H.useHostTransitionStatus()},_t.version="19.2.4",_t}var gm;function M0(){if(gm)return _u.exports;gm=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(n){console.error(n)}}return a(),_u.exports=N0(),_u.exports}var ym;function z0(){if(ym)return Hr;ym=1;var a=D0(),n=ed(),r=M0();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(d(e)!==e)throw Error(l(188))}function y(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,s=t;;){var o=i.return;if(o===null)break;var h=o.alternate;if(h===null){if(s=o.return,s!==null){i=s;continue}break}if(o.child===h.child){for(h=o.child;h;){if(h===i)return m(o),e;if(h===s)return m(o),t;h=h.sibling}throw Error(l(188))}if(i.return!==s.return)i=o,s=h;else{for(var g=!1,b=o.child;b;){if(b===i){g=!0,i=o,s=h;break}if(b===s){g=!0,s=o,i=h;break}b=b.sibling}if(!g){for(b=h.child;b;){if(b===i){g=!0,i=h,s=o;break}if(b===s){g=!0,s=h,i=o;break}b=b.sibling}if(!g)throw Error(l(189))}}if(i.alternate!==s)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var _=Object.assign,x=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),L=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),me=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),$e=Symbol.for("react.memo_cache_sentinel"),Me=Symbol.iterator;function Pe(e){return e===null||typeof e!="object"?null:(e=Me&&e[Me]||e["@@iterator"],typeof e=="function"?e:null)}var oe=Symbol.for("react.client.reference");function je(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case D:return"Profiler";case C:return"StrictMode";case ne:return"Suspense";case K:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case L:return e.displayName||"Context";case q:return(e._context.displayName||"Context")+".Consumer";case X:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:je(e.type)||"Memo";case me:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}var Se=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},ve=[],P=-1;function S(e){return{current:e}}function N(e){0>P||(e.current=ve[P],ve[P]=null,P--)}function G(e,t){P++,ve[P]=e.current,e.current=t}var Y=S(null),Z=S(null),J=S(null),de=S(null);function ge(e,t){switch(G(J,t),G(Z,e),G(Y,null),t.nodeType){case 9:case 11:e=(e
vendor: 1,131 bytes, lines 2-4
2=t.documentElement)&&(e=e.namespaceURI)?Bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bp(t),e=Dp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}N(Y),G(Y,e)}function Oe(){N(Y),N(Z),N(J)}function Vt(e){e.memoizedState!==null&&G(de,e);var t=Y.current,i=Dp(t,e.type);t!==i&&(G(Z,e),G(Y,i))}function Li(e){Z.current===e&&(N(Y),N(Z)),de.current===e&&(N(de),zr._currentValue=ee)}var Pa,ut;function sn(e){if(Pa===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Pa=t&&t[1]||"",ut=-1<i.stack.indexOf(`
3    at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4`+Pa+e+ut}var Va=!1;function Ii(e,t){if(!e||Va)return"";Va=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(F){var U=F}Reflect.construct(e,[],V)}else{try{V.call()}catch(F){U=F}e.call(V.prototype)}}else{try{throw Error()}catch(F){U=F}
vendor: 10,900 bytes, lines 4-9
4(V=e())&&typeof V.catch=="function"&&V.catch(function(){})}}catch(F){if(F&&U&&typeof F.stack=="string")return[F.stack,U.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=s.DetermineComponentFrameRoot(),g=h[0],b=h[1];if(g&&b){var A=g.split(`
5`),z=b.split(`
6`);for(o=s=0;s<A.length&&!A[s].includes("DetermineComponentFrameRoot");)s++;for(;o<z.length&&!z[o].includes("DetermineComponentFrameRoot");)o++;if(s===A.length||o===z.length)for(s=A.length-1,o=z.length-1;1<=s&&0<=o&&A[s]!==z[o];)o--;for(;1<=s&&0<=o;s--,o--)if(A[s]!==z[o]){if(s!==1||o!==1)do if(s--,o--,0>o||A[s]!==z[o]){var H=`
7`+A[s].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=s&&0<=o);break}}}finally{Va=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?sn(i):""}function to(e,t){switch(e.tag){case 26:case 27:case 5:return sn(e.type);case 16:return sn("Lazy");case 13:return e.child!==t&&t!==null?sn("Suspense Fallback"):sn("Suspense");case 19:return sn("SuspenseList");case 0:case 15:return Ii(e.type,!1);case 11:return Ii(e.type.render,!1);case 1:return Ii(e.type,!0);case 31:return sn("Activity");default:return""}}function ss(e){try{var t="",i=null;do t+=to(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
8Error generating stack: `+s.message+`
9`+s.stack}}var Ga=Object.prototype.hasOwnProperty,W=a.unstable_scheduleCallback,ie=a.unstable_cancelCallback,ce=a.unstable_shouldYield,kt=a.unstable_requestPaint,dt=a.unstable_now,ls=a.unstable_getCurrentPriorityLevel,Ka=a.unstable_ImmediatePriority,pi=a.unstable_UserBlockingPriority,Hi=a.unstable_NormalPriority,Ya=a.unstable_LowPriority,os=a.unstable_IdlePriority,cs=a.log,us=a.unstable_setDisableYieldValue,Ot=null,Bt=null;function Hn(e){if(typeof cs=="function"&&us(e),Bt&&typeof Bt.setStrictMode=="function")try{Bt.setStrictMode(Ot,e)}catch{}}var Dt=Math.clz32?Math.clz32:my,fy=Math.log,py=Math.LN2;function my(e){return e>>>=0,e===0?32:31-(fy(e)/py|0)|0}var ds=256,hs=262144,fs=4194304;function mi(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ps(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var o=0,h=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var b=s&134217727;return b!==0?(s=b&~h,s!==0?o=mi(s):(g&=b,g!==0?o=mi(g):i||(i=b&~e,i!==0&&(o=mi(i))))):(b=s&~h,b!==0?o=mi(b):g!==0?o=mi(g):i||(i=s&~e,i!==0&&(o=mi(i)))),o===0?0:t!==0&&t!==o&&(t&h)===0&&(h=o&-o,i=t&-t,h>=i||h===32&&(i&4194048)!==0)?t:o}function Wa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gy(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hd(){var e=fs;return fs<<=1,(fs&62914560)===0&&(fs=4194304),e}function no(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ja(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function yy(e,t,i,s,o,h){var g=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var b=e.entanglements,A=e.expirationTimes,z=e.hiddenUpdates;for(i=g&~i;0<i;){var H=31-Dt(i),V=1<<H;b[H]=0,A[H]=-1;var U=z[H];if(U!==null)for(z[H]=null,H=0;H<U.length;H++){var F=U[H];F!==null&&(F.lane&=-536870913)}i&=~V}s!==0&&fd(e,s,0),h!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=h&~(g&~t))}function fd(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Dt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function pd(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-Dt(i),o=1<<s;o&t|e[s]&t&&(e[s]|=t),i&=~o}}function md(e,t){var i=t&-t;return i=(i&42)!==0?1:io(i),(i&(e.suspendedLanes|t))!==0?0:i}function io(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ao(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function gd(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:nm(e.type))}function yd(e,t){var i=B.p;try{return B.p=e,t()}finally{B.p=i}}var qn=Math.random().toString(36).slice(2),ht="__reactFiber$"+qn,St="__reactProps$"+qn,qi="__reactContainer$"+qn,ro="__reactEvents$"+qn,vy="__reactListeners$"+qn,by="__reactHandles$"+qn,vd="__reactResources$"+qn,Qa="__reactMarker$"+qn;function so(e){delete e[ht],delete e[St],delete e[ro],delete e[vy],delete e[by]}function $i(e){var t=e[ht];if(t)return t;for(var i=e.parentNode;i;){if(t=i[qi]||i[ht]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Ip(e);e!==null;){if(i=e[ht])return i;e=Ip(e)}return t}e=i,i=e.parentNode}return null}function Pi(e){if(e=e[ht]||e[qi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Xa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Vi(e){var t=e[vd];return t||(t=e[vd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ot(e){e[Qa]=!0}var bd=new Set,_d={};function gi(e,t){Gi(e,t),Gi(e+"Capture",t)}function Gi(e,t){for(_d[e]=t,e=0;e<t.length;e++)bd.add(t[e])}var _y=RegExp("^[: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]*$"),xd={},wd={};function xy(e){return Ga.call(wd,e)?!0:Ga.call(xd,e)?!1:_y.test(e)?wd[e]=!0:(xd[e]=!0,!1)}function ms(e,t,i){if(xy(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function gs(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function bn(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function Gt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wy(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var o=s.get,h=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(g){i=""+g,h.call(this,g)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(g){i=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lo(e){if(!e._valueTracker){var t=Sd(e)?"checked":"value";e._valueTracker=wy(e,t,""+e[t])}}function Ed(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Sd(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function ys(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}}var Sy=/[\n"\\]/g;function Kt(e){return e.replace(Sy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function oo(e,t,i,s,o,h,g,b){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Gt(t)):e.value!==""+Gt(t)&&(e.value=""+Gt(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?co(e,g,Gt(t)):i!=null?co(e,g,Gt(i)):s!=null&&e.removeAttribute("value"),o==null&&h!=null&&(e.defaultChecked=!!h),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+Gt(b):e.removeAttribute("name")}function Ad(e,t,i,s,o,h,g,b){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){lo(e);return}i=i!=null?""+Gt(i):"",t=t!=null?""+Gt(t):i,b||t===e.value||(e.value=t),e.defaultValue=t}s=s??o,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=b?e.checked:!!s,e.defaultChecked=!!s,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),lo(e)}function co(e,t,i){t==="number"&&ys(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Ki(e,t,i,s){if(e=e.options,t){t={};for(var o=0;o<i.length;o++)t["$"+i[o]]=!0;for(i=0;i<e.length;i++)o=t.hasOwnProperty("$"+e[i].value),e[i].selected!==o&&(e[i].selected=o),o&&s&&(e[i].defaultSelected=!0)}else{for(i=""+Gt(i),t=null,o=0;o<e.length;o++){if(e[o].value===i){e[o].selected=!0,s&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function jd(e,t,i){if(t!=null&&(t=""+Gt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Gt(i):""}function Td(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(l(92));if(Se(s)){if(1<s.length)throw Error(l(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Gt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),lo(e)}function Yi(e,t){if(t){var i=e.firstChild;
vendor: 4,140 bytes, line 9
9if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Ey=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Rd(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||Ey.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Cd(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var o in t)s=t[o],t.hasOwnProperty(o)&&i[o]!==s&&Rd(e,o,s)}else for(var h in t)t.hasOwnProperty(h)&&Rd(e,h,t[h])}function uo(e){if(e.indexOf("-")===-1)return!1;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 Ay=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
9-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),jy=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vs(e){return jy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function _n(){}var ho=null;function fo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wi=null,Ji=null;function kd(e){var t=Pi(e);if(t&&(e=t.stateNode)){var i=e[St]||null;e:switch(e=t.stateNode,t.type){case"input":if(oo(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Kt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var o=s[St]||null;if(!o)throw Error(l(90));oo(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Ed(s)}break e;case"textarea":jd(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Ki(e,!!i.multiple,t,!1)}}}var po=!1;function Od(e,t,i){if(po)return e(t,i);po=!0;try{var s=e(t);return s}finally{if(po=!1,(Wi!==null||Ji!==null)&&(rl(),Wi&&(t=Wi,e=Ji,Ji=Wi=null,kd(t),e)))for(t=0;t<e.length;t++)kd(e[t])}}function Za(e,t){var i=e.stateNode;if(i===null)return null;var s=i[St]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,t,typeof i));return i}var xn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mo=!1;if(xn)try{var er={};Object.defineProperty(er,"passive",{get:function(){mo=!0}}),window.addEventListener("test",er,er),window.removeEventListener("test",er,er)}catch{mo=!1}var $n=null,go=null,bs=null;function Bd(){if(bs)return bs;var e,t=go,i=t.length,s,o="value"in $n?$n.value:$n.textContent,h=o.length;for(e=0;e<i&&t[e]===o[e];e++);var g=i-e;for(s=1;s<=g&&t[i-s]===o[h-s];s++);return bs=o.slice(e,1<s?1-s:void 0)}function _s(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function xs(){return!0}function Dd(){return!1}function Et(e){function t(i,s,o,h,g){this._reactName=i,this._targetInst=o,this.type=s,this.nativeEvent=h,this.target=g,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(i=e[b],this[b]=i?i(h):h[b]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?xs:Dd,this.isPropagationStopped=Dd,this}return _(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=xs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=xs)},persist:function(){},isPersistent:xs}),t}var yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ws=Et(yi),tr=_({},yi,{view:0,detail:0}),Ty=Et(tr),yo,vo,nr,Ss=_({},tr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_o,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!==nr&&(nr&&e.type==="mousemove"?(yo=e.screenX-nr.screenX,vo=e.screenY-nr.screenY):vo=yo=0,nr=e),yo)},movementY:function(e){return"movementY"in e?e.movementY:vo}}),Nd=Et(Ss),Ry=_({},Ss,{dataTransfer:0}),Cy=Et(Ry),ky=_({},tr,{relatedTarget:0}),bo=Et(ky),Oy=_({},yi,{animationName:0,elapsedTime:0,pseudoElement:0}),By=Et(Oy),Dy=_({},yi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ny=Et(Dy),My=_({},yi,{data:0}),Md=Et(My),zy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Uy={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"},Fy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ly(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fy[e])?!!t[e]:!1}function _o(){return Ly}var Iy=_({},tr,{key:function(e){if(e.key){var t=zy[e.key]||e.key;if(t!=="Unidentified")return t}
vendor: 5,186 bytes, line 9
9return e.type==="keypress"?(e=_s(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Uy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_o,charCode:function(e){return e.type==="keypress"?_s(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_s(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hy=Et(Iy),qy=_({},Ss,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zd=Et(qy),$y=_({},tr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_o}),Py=Et($y),Vy=_({},yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gy=Et(Vy),Ky=_({},Ss,{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}),Yy=Et(Ky),Wy=_({},yi,{newState:0,oldState:0}),Jy=Et(Wy),Qy=[9,13,27,32],xo=xn&&"CompositionEvent"in window,ir=null;xn&&"documentMode"in document&&(ir=document.documentMode);var Xy=xn&&"TextEvent"in window&&!ir,Ud=xn&&(!xo||ir&&8<ir&&11>=ir),Fd=" ",Ld=!1;function Id(e,t){switch(e){case"keyup":return Qy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qi=!1;function Zy(e,t){switch(e){case"compositionend":return Hd(t);case"keypress":return t.which!==32?null:(Ld=!0,Fd);case"textInput":return e=t.data,e===Fd&&Ld?null:e;default:return null}}function ev(e,t){if(Qi)return e==="compositionend"||!xo&&Id(e,t)?(e=Bd(),bs=go=$n=null,Qi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ud&&t.locale!=="ko"?null:t.data;default:return null}}var tv={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 qd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tv[e.type]:t==="textarea"}function $d(e,t,i,s){Wi?Ji?Ji.push(s):Ji=[s]:Wi=s,t=hl(t,"onChange"),0<t.length&&(i=new ws("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var ar=null,rr=null;function nv(e){jp(e,0)}function Es(e){var t=Xa(e);if(Ed(t))return e}function Pd(e,t){if(e==="change")return t}var Vd=!1;if(xn){var wo;if(xn){var So="oninput"in document;if(!So){var Gd=document.createElement("div");Gd.setAttribute("oninput","return;"),So=typeof Gd.oninput=="function"}wo=So}else wo=!1;Vd=wo&&(!document.documentMode||9<document.documentMode)}function Kd(){ar&&(ar.detachEvent("onpropertychange",Yd),rr=ar=null)}function Yd(e){if(e.propertyName==="value"&&Es(rr)){var t=[];$d(t,rr,e,fo(e)),Od(nv,t)}}function iv(e,t,i){e==="focusin"?(Kd(),ar=t,rr=i,ar.attachEvent("onpropertychange",Yd)):e==="focusout"&&Kd()}function av(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Es(rr)}function rv(e,t){if(e==="click")return Es(t)}function sv(e,t){if(e==="input"||e==="change")return Es(t)}function lv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:lv;function sr(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var o=i[s];if(!Ga.call(t,o)||!Nt(e[o],t[o]))return!1}return!0}function Wd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jd(e,t){var i=Wd(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Wd(i)}}function Qd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ys(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=ys(e.document)}return t}function Eo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var ov=xn&&"documentMode"in document&&11>=document.documentMode,Xi=null,Ao=null,lr=null,jo=!1;function Zd(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;jo||Xi==null||Xi!==ys(s)||(s=Xi,"selectionStart"in s&&Eo(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focu
vendor: 19,010 bytes, line 9
9sNode:s.focusNode,focusOffset:s.focusOffset}),lr&&sr(lr,s)||(lr=s,s=hl(Ao,"onSelect"),0<s.length&&(t=new ws("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Xi)))}function vi(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Zi={animationend:vi("Animation","AnimationEnd"),animationiteration:vi("Animation","AnimationIteration"),animationstart:vi("Animation","AnimationStart"),transitionrun:vi("Transition","TransitionRun"),transitionstart:vi("Transition","TransitionStart"),transitioncancel:vi("Transition","TransitionCancel"),transitionend:vi("Transition","TransitionEnd")},To={},eh={};xn&&(eh=document.createElement("div").style,"AnimationEvent"in window||(delete Zi.animationend.animation,delete Zi.animationiteration.animation,delete Zi.animationstart.animation),"TransitionEvent"in window||delete Zi.transitionend.transition);function bi(e){if(To[e])return To[e];if(!Zi[e])return e;var t=Zi[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in eh)return To[e]=t[i];return e}var th=bi("animationend"),nh=bi("animationiteration"),ih=bi("animationstart"),cv=bi("transitionrun"),uv=bi("transitionstart"),dv=bi("transitioncancel"),ah=bi("transitionend"),rh=new Map,Ro="abort auxClick beforeToggle 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(" ");Ro.push("scrollEnd");function ln(e,t){rh.set(e,t),gi(t,[e])}var As=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Yt=[],ea=0,Co=0;function js(){for(var e=ea,t=Co=ea=0;t<e;){var i=Yt[t];Yt[t++]=null;var s=Yt[t];Yt[t++]=null;var o=Yt[t];Yt[t++]=null;var h=Yt[t];if(Yt[t++]=null,s!==null&&o!==null){var g=s.pending;g===null?o.next=o:(o.next=g.next,g.next=o),s.pending=o}h!==0&&sh(i,o,h)}}function Ts(e,t,i,s){Yt[ea++]=e,Yt[ea++]=t,Yt[ea++]=i,Yt[ea++]=s,Co|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function ko(e,t,i,s){return Ts(e,t,i,s),Rs(e)}function _i(e,t){return Ts(e,null,null,t),Rs(e)}function sh(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var o=!1,h=e.return;h!==null;)h.childLanes|=i,s=h.alternate,s!==null&&(s.childLanes|=i),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(o=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,o&&t!==null&&(o=31-Dt(i),e=h.hiddenUpdates,s=e[o],s===null?e[o]=[t]:s.push(t),t.lane=i|536870912),h):null}function Rs(e){if(50<Cr)throw Cr=0,Lc=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ta={};function hv(e,t,i,s){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mt(e,t,i,s){return new hv(e,t,i,s)}function Oo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wn(e,t){var i=e.alternate;return i===null?(i=Mt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function lh(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Cs(e,t,i,s,o,h){var g=0;if(s=e,typeof e=="function")Oo(e)&&(g=1);else if(typeof e=="string")g=y0(e,i,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Mt(31,i,t,o),e.elementType=le,e.lanes=h,e;case k:return xi(i.children,o,h,t);case C:g=8,o|=24;break;case D:return e=Mt(12,i,t,o|2),e.elementType=D,e.lanes=h,e;case ne:return e=Mt(13,i,t,o),e.elementType=ne,e.lanes=h,e;case K:return e=Mt(19,i,t,o),e.elementType=K,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case L:g=10;break e;case q:g=9;break e;case X:g=11;break e;case Q:g=14;break e;case me:g=16,s=null;break e}g=29,i=Error(l(130,e===null?"null":typeof e,"")),s=null}return t=Mt(g,i,t,o),t.elementType=e,t.type=s,t.lanes=h,t}function xi(e,t,i,s){return e=Mt(7,e,s,t),e.lanes=i,e}function Bo(e,t,i){return e=Mt(6,e,null,t),e.lanes=i,e}function oh(e){var t=Mt(18,null,null,0);return t.stateNode=e,t}function Do(e,t,i){return t=Mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ch=new WeakMap;function Wt(e,t){if(typeof e=="object"&&e!==null){var i=ch.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ss(t)},ch.set(e,t),t)}return{value:e,source:t,stack:ss(t)}}var na=[],ia=0,ks=null,or=0,Jt=[],Qt=0,Pn=null,mn=1,gn="";function Sn(e,t){na[ia++]=or,na[ia++]=ks,ks=e,or=t}function uh(e,t,i){Jt[Qt++]=mn,Jt[Qt++]=gn,Jt[Qt++]=Pn,Pn=e;var s=mn;e=gn;var o=32-Dt(s)-1;s&=~(1<<o),i+=1;var h=32-Dt(t)+o;if(30<h){var g=o-o%5;h=(s&(1<<g)-1).toString(32),s>>=g,o-=g,mn=1<<32-Dt(t)+o|i<<o|s,gn=h+e}else mn=1<<h|i<<o|s,gn=e}function No(e){e.return!==null&&(Sn(e,1),uh(e,1,0))}function Mo(e){for(;e===ks;)ks=na[--ia],na[ia]=null,or=na[--ia],na[ia]=null;for(;e===Pn;)Pn=Jt[--Qt],Jt[Qt]=null,gn=Jt[--Qt],Jt[Qt]=null,mn=Jt[--Qt],Jt[Qt]=null}function dh(e,t){Jt[Qt++]=mn,Jt[Qt++]=gn,Jt[Qt++]=Pn,mn=t.id,gn=t.overflow,Pn=e}var ft=null,Ve=null,Ce=!1,Vn=null,Xt=!1,zo=Error(l(519));function Gn(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw cr(Wt(t,e)),zo}function hh(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[ht]=e,t[St]=s,i){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(i=0;i<Or.length;i++)Ae(Or[i],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),Ad(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),Td(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||kp(t.textContent,i)?(s.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),s.onScroll!=null&&Ae("scroll",t),s.onScrollEnd!=null&&Ae("scrollend",t),s.onClick!=null&&(t.onclick=_n),t=!0):t=!1,t||Gn(e,!0)}function fh(e){for(ft=e.return;ft;)switch(ft.tag){case 5:case 31:case 13:Xt=!1;return;case 27:case 3:Xt=!0;return;default:ft=ft.return}}function aa(e){if(e!==ft)return!1;if(!Ce)return fh(e),Ce=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||eu(e.type,e.memoizedProps)),i=!i),i&&Ve&&Gn(e),fh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Ve=Lp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Ve=Lp(e)}else t===27?(t=Ve,si(e.type)?(e=ru,ru=null,Ve=e):Ve=t):Ve=ft?en(e.stateNode.nextSibling):null;return!0}function wi(){Ve=ft=null,Ce=!1}function Uo(){var e=Vn;return e!==null&&(Rt===null?Rt=e:Rt.push.apply(Rt,e),Vn=null),e}function cr(e){Vn===null?Vn=[e]:Vn.push(e)}var Fo=S(null),Si=null,En=null;function Kn(e,t,i){G(Fo,t._currentValue),t._currentValue=i}function An(e){e._currentValue=Fo.current,N(Fo)}function Lo(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Io(e,t,i,s){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var h=o.dependencies;if(h!==null){var g=o.child;h=h.firstContext;e:for(;h!==null;){var b=h;h=o;for(var A=0;A<t.length;A++)if(b.context===t[A]){h.lanes|=i,b=h.alternate,b!==null&&(b.lanes|=i),Lo(h.return,i,e),s||(g=null);break e}h=b.next}}else if(o.tag===18){if(g=o.return,g===null)throw Error(l(341));g.lanes|=i,h=g.alternate,h!==null&&(h.lanes|=i),Lo(g,i,e),g=null}else g=o.child;if(g!==null)g.return=o;else for(g=o;g!==null;){if(g===e){g=null;break}if(o=g.sibling,o!==null){o.return=g.return,g=o;break}g=g.return}o=g}}function ra(e,t,i,s){e=null;for(var o=t,h=!1;o!==null;){if(!h){if((o.flags&524288)!==0)h=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var g=o.alternate;if(g===null)throw Error(l(387));if(g=g.memoizedProps,g!==null){var b=o.type;Nt(o.pendingProps.value,g.value)||(e!==null?e.push(b):e=[b])}}else if(o===de.current){if(g=o.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(zr):e=[zr])}o=o.return}e!==null&&Io(t,e,i,s),t.flags|=262144}function Os(e){for(e=e.firstContext;e!==null;){if(!Nt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ei(e){Si=e,En=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function pt(e){return ph(Si,e)}function Bs(e,t){return Si===null&&Ei(e),ph(e,t)}function ph(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},En===null){if(e===null)throw Error(l(308));En=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else En=En.next=t;return i}var fv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},pv=a.unstable_scheduleCallback,mv=a.unstable_NormalPriority,et={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ho(){return{controller:new fv,data:new Map,refCount:0}}function ur(e){e.refCount--,e.refCount===0&&pv(mv,function(){e.controller.abort()})}var dr=null,qo=0,sa=0,la=null;function gv(e,t){if(dr===null){var i=dr=[];qo=0,sa=Vc(),la={status:"pending",value:void 0,then:function(s){i.push(s)}}}return qo++,t.then(mh,mh),t}function mh(){if(--qo===0&&dr!==null){la!==null&&(la.status="fulfilled");var e=dr;dr=null,sa=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function yv(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(o){i.push(o)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var o=0;o<i.length;o++)(0,i[o])(t)},function(o){for(s.status="rejected",s.reason=o,o=0;o<i.length;o++)(0,i[o])(void 0)}),s}var gh=I.S;I.S=function(e,t){ep=dt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&gv(e,t),gh!==null&&gh(e,t)};var Ai=S(null);function $o(){var e=Ai.current;return e!==null?e:He.pooledCache}function Ds(e,t){t===null?G(Ai,Ai.current):G(Ai,t.pool)}function yh(){var e=$o();return e===null?null:{parent:et._currentValue,pool:e}}var oa=Error(l(460)),Po=Error(l(474)),Ns=Error(l(542)),Ms={then:function(){}};function vh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function bh(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(_n,_n),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xh(e),e;default:if(typeof t.status=="string")t.then(_n,_n);else{if(e=He,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=s}},function(s){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,xh(e),e}throw Ti=t,oa}}function ji(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ti=i,oa):i}}var Ti=null;function _h(){if(Ti===null)throw Error(l(459));var e=Ti;return Ti=null,e}function xh(e){if(e===oa||e===Ns)throw Error(l(483))}var ca=null,hr=0;function zs(e){var t=hr;return hr+=1,ca===null&&(ca=[]),bh(ca,e,t)}function fr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Us(e,t){throw t.$$typeof===x?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wh(e){function t(O,j){if(e){var M=O.deletions;M===null?(O.deletions=[j],O.flags|=16):M.push(j)}}function i(O,j){if(!e)return null;for(;j!==null;)t(O,j),j=j.sibling;return null}function s(O){for(var j=new Map;O!==null;)O.key!==null?j.set(O.key,O):j.set(O.index,O),O=O.sibling;return j}function o(O,j){return O=wn(O,j),O.index=0,O.sibling=null,O}function h(O,j,M){return O.index=M,e?(M=O.alternate,M!==null?(M=M.index,M<j?(O.flags|=67108866,j):M):(O.flags|=67108866,j)):(O.flags|=1048576,j)}function g(O){return e&&O.alternate===null&&(O.flags|=67108866),O}function b(O,j,M,$){return j===null||j.tag!==6?(j=Bo(M,O.mode,$),j.return=O,j):(j=o(j,M),j.return=O,j)}function A(O,j,M,$){var ue=M.type;return ue===k?H(O,j,M.props.children,$,M.key):j!==null&&(j.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===me&&ji(ue)===j.type)?(j=o(j,M.props),fr(j,M),j.return=O,j):(j=Cs(M.type,M.key,M.props,null,O.mode,$),fr(j,M),j.return=O,j)}function z(O,j,M,$){return j===null||j.tag!==4||j.stateNode.containerInfo!==M.containerInfo||j.stateNode.implementation!==M.implementation?(j=Do(M,O.mode,$),j.return=O,j):(j=o(j,M.children||[]),j.return=O,j)}function H(O,j,M,$,ue){return j===null||j.tag!==7?(j=xi(M,O.mode,$,ue),j.return=O,j):(j=o(j,M),j.return=O,j)}function V(O,j,M){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=Bo(""+j,O.mode,M),j.return=O,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case E:return M=Cs(j.type,j.key,j.props,null,O.mode,M),fr(M,j),M.return=O,M;case T:return j=Do(j,O.mode,M),j.return=O,j;case me:return j=ji(j),V(O,j,M)}if(Se(j)||Pe(j))return j=xi(j,O.mode,M,null),j.return=O,j;if(typeof j.then=="function")return V(O,zs(j),M);if(j.$$typeof===L)return V(O,Bs(O,j),M);Us(O,j)}return null}function U(O,j,M,$){var ue=j!==null?j.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return ue!==null?null:b(O,j,""+M,$);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case E:return M.key===ue?A(O,j,M,$):null;case T:return M.key===ue?z(O,j,M,$):null;case me:return M=ji(M),U(O,j,M,$)}if(Se(M)||Pe(M))return ue!==null?null:H(O,j,M,$,null);if(typeof M.then=="function")return U(O,j,zs(M),$);if(M.$$typeof===L)return U(O,j,Bs(O,M),$);Us(O,M)}return null}function F(O,j,M,$,ue){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return O=O.get(M)||null,b(j,O,""+$,ue);if(typeof $=="object"&&$!==null){switch($.$$typeof){case E:return O=O.get($.key===null?M:$.key)||null,A(j,O,$,ue);case T:return O=O.get($.key===null?M:$.key)||null,z(j,O,$,ue);case me:return $=ji($),F(O,j,M,$,ue)}if(Se($)||Pe($))return O=O.get(M)||null,H(j,O,$,ue,null);if(typeof $.then=="function")return F(O,j,M,zs($),ue);if($.$$typeof===L)return F(O,j,M,Bs(j,$),ue);Us(j,$)}return null}function ae(O,j,M,$){for(var ue=null,Be=null,re=j,xe=j=0,Re=null;re!==null&&xe<M.length;xe++){re.index>xe?(Re=re,re=null):Re=re.sibling;var De=U(O,re,M[xe],$);if(De===null){re===null&&(re=Re);break}e&&re&&De.alternate===null&&t(O,re),j=h(De,j,xe),Be===null?ue=De:Be.sibling=De,Be=De,re=Re}if(xe===M.length)return i(O,re),Ce&&Sn(O,xe),ue;if(re===null){for(;xe<M.length;xe++)re=V(O,M[xe],$),re!==null&&(j=h(re,j,xe),Be===null?ue=re:Be.sibling=re,Be=re);return Ce&&Sn(O,xe),ue}for(re=s(re);xe<M.length;xe++)Re=F(re,O,xe,M[xe],$),Re!==null&&(e&&Re.alternate!==null&&re.delete(Re.key===null?xe:Re.key),j=h(Re,j,xe),Be===null?ue=Re:Be.sibling=Re,Be=Re);return e&&re.forEach(function(di){return t(O,di)}),Ce&&Sn(O,xe),ue}function he(O,j,M,$){if(M==null)throw Error(l(151));for(var ue=null,Be=null,re=j,xe=j=0,Re=null,De=M.next();re!==null&&!De.done;xe++,De=M.next()){re.index>xe?(Re=re,re=null):Re=re.sibling;var di=U(O,re,De.value,$);if(di===null){re===null&&(re=Re);break}e&&re&&di.alternate===null&&t(O,re),j=h(di,j,xe),Be===null?ue=di:Be.sibling=di,Be=di,re=Re}if(De.done)return i(O,re),Ce&&Sn(O,xe),ue;if(re===null){for(;!De.done;xe++,De=M.next())De=V(O,De.value,$),De!==null&&(j=h(De,j,xe),Be===null?ue=De:Be.sibling=De,Be=De);return Ce&&Sn(O,xe),ue}for(re=s(re);!De.done;xe++,De=M.next())De=F(re,O,xe,De.value,$),De!==null&&(e&&De.alternate!==null&&re.delete(De.key===null?xe:De.key),j=h(De,j,xe),Be===null?ue=De:Be.sibling=De,Be=De);return e&&re.forEach(function(R0){return t(O,R0)}),Ce&&Sn(O,xe),ue}function Ie(O,j,M,$){if(typeof M=="object"&&M!==null&&M.type===k&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case E:e:{for(var ue=M.key;j!==null;){if(j.key===ue){if(ue=M.type,ue===k){if(j.tag===7){i(O,j.sibling),$=o(j,M.props.children),$.return=O,O=$;break e}}else if(j.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===me&&ji(ue)===j.type){i(O,j.sibling),$=o(j,M.props),fr($,M),$.return=O,O=$;break e}i(O,j);break}else t(O,j);j=j.sibling}M.type===k?($=xi(M.props.children,O.mode,$,M.key),$.return=O,O=$):($=Cs(M.type,M.key,M.props,null,O.mode,$),fr($,M),$.return=O,O=$)}return g(O);case T:e:{for(ue=M.key;j!==null;){if(j.key===ue)if(j.tag===4&&j.stateNode.containerInfo===M.containerInfo&&j.stateNode.implementation===M.implementation){i(O,j.sibling),$=o(j,M.children||[]),$.return=O,O=$;break e}else{i(O,j);break}else t(O,j);j=j.sibling}$=Do(M,O.mode,$),$.return=O,O=$}return g(O);case me:return M=ji(M),Ie(O,j,M,$)}if(Se(M))return ae(O,j,M,$);if(Pe(M)){if(ue=Pe(M),typeof ue!="function")throw Error(l(150));return M=ue.call(M),he(O,j,M,$)}if(typeof M.then=="function")return Ie(O,j,zs(M),$);if(M.$$typeof===L)return Ie(O,j,Bs(O,M),$);Us(O,M)}
vendor: 4,891 bytes, line 9
9return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,j!==null&&j.tag===6?(i(O,j.sibling),$=o(j,M),$.return=O,O=$):(i(O,j),$=Bo(M,O.mode,$),$.return=O,O=$),g(O)):i(O,j)}return function(O,j,M,$){try{hr=0;var ue=Ie(O,j,M,$);return ca=null,ue}catch(re){if(re===oa||re===Ns)throw re;var Be=Mt(29,re,null,O.mode);return Be.lanes=$,Be.return=O,Be}}}var Ri=wh(!0),Sh=wh(!1),Yn=!1;function Vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Jn(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Ne&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=Rs(e),sh(e,null,i),t}return Ts(e,s,t,i),Rs(e)}function pr(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,pd(e,i)}}function Ko(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var o=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var g={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?o=h=g:h=h.next=g,i=i.next}while(i!==null);h===null?o=h=t:h=h.next=t}else o=h=t;i={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:h,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Yo=!1;function mr(){if(Yo){var e=la;if(e!==null)throw e}}function gr(e,t,i,s){Yo=!1;var o=e.updateQueue;Yn=!1;var h=o.firstBaseUpdate,g=o.lastBaseUpdate,b=o.shared.pending;if(b!==null){o.shared.pending=null;var A=b,z=A.next;A.next=null,g===null?h=z:g.next=z,g=A;var H=e.alternate;H!==null&&(H=H.updateQueue,b=H.lastBaseUpdate,b!==g&&(b===null?H.firstBaseUpdate=z:b.next=z,H.lastBaseUpdate=A))}if(h!==null){var V=o.baseState;g=0,H=z=A=null,b=h;do{var U=b.lane&-536870913,F=U!==b.lane;if(F?(Te&U)===U:(s&U)===U){U!==0&&U===sa&&(Yo=!0),H!==null&&(H=H.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var ae=e,he=b;U=t;var Ie=i;switch(he.tag){case 1:if(ae=he.payload,typeof ae=="function"){V=ae.call(Ie,V,U);break e}V=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=he.payload,U=typeof ae=="function"?ae.call(Ie,V,U):ae,U==null)break e;V=_({},V,U);break e;case 2:Yn=!0}}U=b.callback,U!==null&&(e.flags|=64,F&&(e.flags|=8192),F=o.callbacks,F===null?o.callbacks=[U]:F.push(U))}else F={lane:U,tag:b.tag,payload:b.payload,callback:b.callback,next:null},H===null?(z=H=F,A=V):H=H.next=F,g|=U;if(b=b.next,b===null){if(b=o.shared.pending,b===null)break;F=b,b=F.next,F.next=null,o.lastBaseUpdate=F,o.shared.pending=null}}while(!0);H===null&&(A=V),o.baseState=A,o.firstBaseUpdate=z,o.lastBaseUpdate=H,h===null&&(o.shared.lanes=0),ti|=g,e.lanes=g,e.memoizedState=V}}function Eh(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Ah(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Eh(i[e],t)}var ua=S(null),Fs=S(0);function jh(e,t){e=Nn,G(Fs,e),G(ua,t),Nn=e|t.baseLanes}function Wo(){G(Fs,Nn),G(ua,ua.current)}function Jo(){Nn=Fs.current,N(ua),N(Fs)}var zt=S(null),Zt=null;function Qn(e){var t=e.alternate;G(Xe,Xe.current&1),G(zt,e),Zt===null&&(t===null||ua.current!==null||t.memoizedState!==null)&&(Zt=e)}function Qo(e){G(Xe,Xe.current),G(zt,e),Zt===null&&(Zt=e)}function Th(e){e.tag===22?(G(Xe,Xe.current),G(zt,e),Zt===null&&(Zt=e)):Xn()}function Xn(){G(Xe,Xe.current),G(zt,zt.current)}function Ut(e){N(zt),Zt===e&&(Zt=null),N(Xe)}var Xe=S(0);function Ls(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||iu(i)||au(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var jn=0,be=null,Fe=null,tt=null,Is=!1,da=!1,Ci=!1,Hs=0,yr=0,ha=null,vv=0;function We(){throw Error(l(321))}function Xo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Nt(e[i],t[i]))return!1;return!0}function Zo(e,t,i,s,o,h){return jn=h,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?df:pc,Ci=!1,h=i(s,o),Ci=!1,da&&(h=Ch(t,i,s,o)),Rh(e),h}function Rh(e){I.H=_r;var t=Fe!==null&&Fe.next!==null;if(jn=0,tt=Fe=be=null,Is=!1,yr=0,ha=null,t)throw Error(l(300));
vendor: 10,979 bytes, line 9
9e===null||nt||(e=e.dependencies,e!==null&&Os(e)&&(nt=!0))}function Ch(e,t,i,s){be=e;var o=0;do{if(da&&(ha=null),yr=0,da=!1,25<=o)throw Error(l(301));if(o+=1,tt=Fe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}I.H=hf,h=t(i,s)}while(da);return h}function bv(){var e=I.H,t=e.useState()[0];return t=typeof t.then=="function"?vr(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(be.flags|=1024),t}function ec(){var e=Hs!==0;return Hs=0,e}function tc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function nc(e){if(Is){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Is=!1}jn=0,tt=Fe=be=null,da=!1,yr=Hs=0,ha=null}function wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?be.memoizedState=tt=e:tt=tt.next=e,tt}function Ze(){if(Fe===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=tt===null?be.memoizedState:tt.next;if(t!==null)tt=t,Fe=e;else{if(e===null)throw be.alternate===null?Error(l(467)):Error(l(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},tt===null?be.memoizedState=tt=e:tt=tt.next=e}return tt}function qs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vr(e){var t=yr;return yr+=1,ha===null&&(ha=[]),e=bh(ha,e,t),t=be,(tt===null?t.memoizedState:tt.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?df:pc),e}function $s(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return vr(e);if(e.$$typeof===L)return pt(e)}throw Error(l(438,String(e)))}function ic(e){var t=null,i=be.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=be.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=qs(),be.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=$e;return t.index++,i}function Tn(e,t){return typeof t=="function"?t(e):t}function Ps(e){var t=Ze();return ac(t,Fe,e)}function ac(e,t,i){var s=e.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=i;var o=e.baseQueue,h=s.pending;if(h!==null){if(o!==null){var g=o.next;o.next=h.next,h.next=g}t.baseQueue=o=h,s.pending=null}if(h=e.baseState,o===null)e.memoizedState=h;else{t=o.next;var b=g=null,A=null,z=t,H=!1;do{var V=z.lane&-536870913;if(V!==z.lane?(Te&V)===V:(jn&V)===V){var U=z.revertLane;if(U===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),V===sa&&(H=!0);else if((jn&U)===U){z=z.next,U===sa&&(H=!0);continue}else V={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},A===null?(b=A=V,g=h):A=A.next=V,be.lanes|=U,ti|=U;V=z.action,Ci&&i(h,V),h=z.hasEagerState?z.eagerState:i(h,V)}else U={lane:V,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},A===null?(b=A=U,g=h):A=A.next=U,be.lanes|=V,ti|=V;z=z.next}while(z!==null&&z!==t);if(A===null?g=h:A.next=b,!Nt(h,e.memoizedState)&&(nt=!0,H&&(i=la,i!==null)))throw i;e.memoizedState=h,e.baseState=g,e.baseQueue=A,s.lastRenderedState=h}return o===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function rc(e){var t=Ze(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var s=i.dispatch,o=i.pending,h=t.memoizedState;if(o!==null){i.pending=null;var g=o=o.next;do h=e(h,g.action),g=g.next;while(g!==o);Nt(h,t.memoizedState)||(nt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),i.lastRenderedState=h}return[h,s]}function kh(e,t,i){var s=be,o=Ze(),h=Ce;if(h){if(i===void 0)throw Error(l(407));i=i()}else i=t();var g=!Nt((Fe||o).memoizedState,i);if(g&&(o.memoizedState=i,nt=!0),o=o.queue,oc(Dh.bind(null,s,o,e),[e]),o.getSnapshot!==t||g||tt!==null&&tt.memoizedState.tag&1){if(s.flags|=2048,fa(9,{destroy:void 0},Bh.bind(null,s,o,i,t),null),He===null)throw Error(l(349));h||(jn&127)!==0||Oh(s,t,i)}return i}function Oh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=be.updateQueue,t===null?(t=qs(),be.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Bh(e,t,i,s){t.value=i,t.getSnapshot=s,Nh(t)&&Mh(e)}function Dh(e,t,i){return i(function(){Nh(t)&&Mh(e)})}function Nh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Nt(e,i)}catch{return!0}}function Mh(e){var t=_i(e,2);t!==null&&Ct(t,e,2)}function sc(e){var t=wt();if(typeof e=="function"){var i=e;if(e=i(),Ci){Hn(!0);try{i()}finally{Hn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:e},t}function zh(e,t,i,s){return e.baseState=i,ac(e,Fe,typeof s=="function"?s:Tn)}function _v(e,t,i,s,o){if(Ks(e))throw Error(l(485));if(e=t.action,e!==null){var h={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){h.listeners.push(g)}};I.T!==null?i(!0):h.isTransition=!1,s(h),i=t.pending,i===null?(h.next=t.pending=h,Uh(t,h)):(h.next=i.next,t.pending=i.next=h)}}function Uh(e,t){var i=t.action,s=t.payload,o=e.state;if(t.isTransition){var h=I.T,g={};I.T=g;try{var b=i(o,s),A=I.S;A!==null&&A(g,b),Fh(e,t,b)}catch(z){lc(e,t,z)}finally{h!==null&&g.types!==null&&(h.types=g.types),I.T=h}}else try{h=i(o,s),Fh(e,t,h)}catch(z){lc(e,t,z)}}function Fh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Lh(e,t,s)},function(s){return lc(e,t,s)}):Lh(e,t,i)}function Lh(e,t,i){t.status="fulfilled",t.value=i,Ih(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Uh(e,i)))}function lc(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,Ih(t),t=t.next;while(t!==s)}e.action=null}function Ih(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Hh(e,t){return t}function qh(e,t){if(Ce){var i=He.formState;if(i!==null){e:{var s=be;if(Ce){if(Ve){t:{for(var o=Ve,h=Xt;o.nodeType!==8;){if(!h){o=null;break t}if(o=en(o.nextSibling),o===null){o=null;break t}}h=o.data,o=h==="F!"||h==="F"?o:null}if(o){Ve=en(o.nextSibling),s=o.data==="F!";break e}}Gn(s)}s=!1}s&&(t=i[0])}}return i=wt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hh,lastRenderedState:t},i.queue=s,i=of.bind(null,be,s),s.dispatch=i,s=sc(!1),h=fc.bind(null,be,!1,s.queue),s=wt(),o={state:t,dispatch:null,action:e,pending:null},s.queue=o,i=_v.bind(null,be,o,h,i),o.dispatch=i,s.memoizedState=e,[t,i,!1]}function $h(e){var t=Ze();return Ph(t,Fe,e)}function Ph(e,t,i){if(t=ac(e,t,Hh)[0],e=Ps(Tn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=vr(t)}catch(g){throw g===oa?Ns:g}else s=t;t=Ze();var o=t.queue,h=o.dispatch;return i!==t.memoizedState&&(be.flags|=2048,fa(9,{destroy:void 0},xv.bind(null,o,i),null)),[s,h,e]}function xv(e,t){e.action=t}function Vh(e){var t=Ze(),i=Fe;if(i!==null)return Ph(t,i,e);Ze(),t=t.memoizedState,i=Ze();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function fa(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=be.updateQueue,t===null&&(t=qs(),be.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Gh(){return Ze().memoizedState}function Vs(e,t,i,s){var o=wt();be.flags|=e,o.memoizedState=fa(1|t,{destroy:void 0},i,s===void 0?null:s)}function Gs(e,t,i,s){var o=Ze();s=s===void 0?null:s;var h=o.memoizedState.inst;Fe!==null&&s!==null&&Xo(s,Fe.memoizedState.deps)?o.memoizedState=fa(t,h,i,s):(be.flags|=e,o.memoizedState=fa(1|t,h,i,s))}function Kh(e,t){Vs(8390656,8,e,t)}function oc(e,t){Gs(2048,8,e,t)}function wv(e){be.flags|=4;var t=be.updateQueue;if(t===null)t=qs(),be.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Yh(e){var t=Ze().memoizedState;return wv({ref:t,nextImpl:e}),function(){if((Ne&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Wh(e,t){return Gs(4,2,e,t)}function Jh(e,t){return Gs(4,4,e,t)}function Qh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Xh(e,t,i){i=i!=null?i.concat([e]):null,Gs(4,4,Qh.bind(null,t,e),i)}function cc(){}function Zh(e,t){var i=Ze();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&Xo(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function ef(e,t){var i=Ze();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&Xo(t,s[1]))return s[0];if(s=e(),Ci){Hn(!0);try{e()}finally{Hn(!1)}}return i.memoizedState=[s,t],s}function uc(e,t,i){return i===void 0||(jn&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=np(),be.lanes|=e,ti|=e,i)}function tf(e,t,i,s){return Nt(i,t)?i:ua.current!==null?(e=uc(e,i,s),Nt(e,t)||(nt=!0),e):(jn&42)===0||(jn&1073741824)!==0&&(Te&261930)===0?(nt=!0,e.memoizedState=i):(e=np(),be.lanes|=e,ti|=e,t)}function nf(e,t,i,s,o){var h=B.p;B.p=h!==0&&8>h?h:8;var g=I.T,b={};I.T=b,fc(e,!1,t,i);try{var A=o(),z=I.S;if(z!==null&&z(b,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var H=yv(A,s);br(e,t,H,It(e))}else br(e,t,s,It(e))}catch(V){br(e,t,{then:function(){},status:"rejected",reason:V},It())}finally{B.p=h,g!==null&&b.types!==null&&(g.types=b.types),I.T=g}}function Sv(){}function dc(e,t,i,s){if(e.tag!==5)throw Error(l(476));var o=af(e).queue;nf(e,o,t,ee,i===null?Sv:function(){return rf(e),i(s)})}function af(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:ee},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rf(e){var t=af(e);t.next===null&&(t=e.alternate.memoizedState),br(e,t.next.queue,{},It())}function hc(){return pt(zr)}function sf(){return Ze().memoizedState}function lf(){return Ze().memoizedState}function Ev(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=It();e=Wn(i);var s=Jn(t,e,i);s!==null&&(Ct(s,t,i),pr(s,t,i)),t={cache:Ho()},e.payload=t;return}t=t.return}}function Av(e,t,i){var s=It();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ks(e)?cf(t,i):(i=ko(e,t,i,s),i!==null&&(Ct(i,e,s),uf(i,t,s)))}function of(e,t,i){var s=It();br(e,t,i,s)}function br(e,t,i,s){var o={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Ks(e))cf(t,o);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var g=t.lastRenderedState,b
vendor: 4,388 bytes, line 9
9=h(g,i);if(o.hasEagerState=!0,o.eagerState=b,Nt(b,g))return Ts(e,t,o,0),He===null&&js(),!1}catch{}if(i=ko(e,t,o,s),i!==null)return Ct(i,e,s),uf(i,t,s),!0}return!1}function fc(e,t,i,s){if(s={lane:2,revertLane:Vc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ks(e)){if(t)throw Error(l(479))}else t=ko(e,i,s,2),t!==null&&Ct(t,e,2)}function Ks(e){var t=e.alternate;return e===be||t!==null&&t===be}function cf(e,t){da=Is=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function uf(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,pd(e,i)}}var _r={readContext:pt,use:$s,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useLayoutEffect:We,useInsertionEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useSyncExternalStore:We,useId:We,useHostTransitionStatus:We,useFormState:We,useActionState:We,useOptimistic:We,useMemoCache:We,useCacheRefresh:We};_r.useEffectEvent=We;var df={readContext:pt,use:$s,useCallback:function(e,t){return wt().memoizedState=[e,t===void 0?null:t],e},useContext:pt,useEffect:Kh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Vs(4194308,4,Qh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var i=wt();t=t===void 0?null:t;var s=e();if(Ci){Hn(!0);try{e()}finally{Hn(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=wt();if(i!==void 0){var o=i(t);if(Ci){Hn(!0);try{i(t)}finally{Hn(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=Av.bind(null,be,e),[s.memoizedState,e]},useRef:function(e){var t=wt();return e={current:e},t.memoizedState=e},useState:function(e){e=sc(e);var t=e.queue,i=of.bind(null,be,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:cc,useDeferredValue:function(e,t){var i=wt();return uc(i,e,t)},useTransition:function(){var e=sc(!1);return e=nf.bind(null,be,e.queue,!0,!1),wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=be,o=wt();if(Ce){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),He===null)throw Error(l(349));(Te&127)!==0||Oh(s,t,i)}o.memoizedState=i;var h={value:i,getSnapshot:t};return o.queue=h,Kh(Dh.bind(null,s,h,e),[e]),s.flags|=2048,fa(9,{destroy:void 0},Bh.bind(null,s,h,i,t),null),i},useId:function(){var e=wt(),t=He.identifierPrefix;if(Ce){var i=gn,s=mn;i=(s&~(1<<32-Dt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Hs++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=vv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:hc,useFormState:qh,useActionState:qh,useOptimistic:function(e){var t=wt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=fc.bind(null,be,!0,i),i.dispatch=t,[e,t]},useMemoCache:ic,useCacheRefresh:function(){return wt().memoizedState=Ev.bind(null,be)},useEffectEvent:function(e){var t=wt(),i={impl:e};return t.memoizedState=i,function(){if((Ne&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},pc={readContext:pt,use:$s,useCallback:Zh,useContext:pt,useEffect:oc,useImperativeHandle:Xh,useInsertionEffect:Wh,useLayoutEffect:Jh,useMemo:ef,useReducer:Ps,useRef:Gh,useState:function(){return Ps(Tn)},useDebugValue:cc,useDeferredValue:function(e,t){var i=Ze();return tf(i,Fe.memoizedState,e,t)},useTransition:function(){var e=Ps(Tn)[0],t=Ze().memoizedState;return[typeof e=="boolean"?e:vr(e),t]},useSyncExternalStore:kh,useId:sf,useHostTransitionStatus:hc,useFormState:$h,useActionState:$h,useOptimistic:function(e,t){var i=Ze();return zh(i,Fe,e,t)},useMemoCache:ic,useCacheRefresh:lf};pc.useEffectEvent=Yh;var hf={readContext:pt,use:$s,useCallback:Zh,useContext:pt,useEffect:oc,useImperativeHandle:Xh,useInsertionEffect:Wh,useLayoutEffect:Jh,useMemo:ef,useReducer:rc,useRef:Gh,useState:function(){return rc(Tn)},useDebugValue:cc,useDeferredValue:function(e,t){var i=Ze();return Fe===null?uc(i,e,t):tf(i,Fe.memoizedState,e,t)},useTransition:function(){var e=rc(Tn)[0],t=Ze().memoizedState;return[typeof e=="boolean"?e:vr(e),t]},useSyncExternalStore:kh,useId:sf,useHostTransitionStatus:hc,useFormState:Vh,useActionState:Vh,useOptimistic:function(e,t){var i=Ze();
vendor: 4,346 bytes, line 9
9return Fe!==null?zh(i,Fe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ic,useCacheRefresh:lf};hf.useEffectEvent=Yh;function mc(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:_({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var gc={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=It(),o=Wn(s);o.payload=t,i!=null&&(o.callback=i),t=Jn(e,o,s),t!==null&&(Ct(t,e,s),pr(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=It(),o=Wn(s);o.tag=1,o.payload=t,i!=null&&(o.callback=i),t=Jn(e,o,s),t!==null&&(Ct(t,e,s),pr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=It(),s=Wn(i);s.tag=2,t!=null&&(s.callback=t),t=Jn(e,s,i),t!==null&&(Ct(t,e,i),pr(t,e,i))}};function ff(e,t,i,s,o,h,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,h,g):t.prototype&&t.prototype.isPureReactComponent?!sr(i,s)||!sr(o,h):!0}function pf(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&gc.enqueueReplaceState(t,t.state,null)}function ki(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=_({},i));for(var o in e)i[o]===void 0&&(i[o]=e[o])}return i}function mf(e){As(e)}function gf(e){console.error(e)}function yf(e){As(e)}function Ys(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function vf(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function yc(e,t,i){return i=Wn(i),i.tag=3,i.payload={element:null},i.callback=function(){Ys(e,t)},i}function bf(e){return e=Wn(e),e.tag=3,e}function _f(e,t,i,s){var o=i.type.getDerivedStateFromError;if(typeof o=="function"){var h=s.value;e.payload=function(){return o(h)},e.callback=function(){vf(t,i,s)}}var g=i.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){vf(t,i,s),typeof o!="function"&&(ni===null?ni=new Set([this]):ni.add(this));var b=s.stack;this.componentDidCatch(s.value,{componentStack:b!==null?b:""})})}function jv(e,t,i,s,o){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&ra(t,i,o,!0),i=zt.current,i!==null){switch(i.tag){case 31:case 13:return Zt===null?sl():i.alternate===null&&Je===0&&(Je=3),i.flags&=-257,i.flags|=65536,i.lanes=o,s===Ms?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),qc(e,s,o)),!1;case 22:return i.flags|=65536,s===Ms?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),qc(e,s,o)),!1}throw Error(l(435,i.tag))}return qc(e,s,o),sl(),!1}if(Ce)return t=zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,s!==zo&&(e=Error(l(422),{cause:s}),cr(Wt(e,i)))):(s!==zo&&(t=Error(l(423),{cause:s}),cr(Wt(t,i))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,s=Wt(s,i),o=yc(e.stateNode,s,o),Ko(e,o),Je!==4&&(Je=2)),!1;var h=Error(l(520),{cause:s});if(h=Wt(h,i),Rr===null?Rr=[h]:Rr.push(h),Je!==4&&(Je=2),t===null)return!0;s=Wt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=o&-o,i.lanes|=e,e=yc(i.stateNode,s,e),Ko(i,e),!1;case 1:if(t=i.type,h=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(ni===null||!ni.has(h))))return i.flags|=65536,o&=-o,i.lanes|=o,o=bf(o),_f(o,e,i,s),Ko(i,o),!1}i=i.return}while(i!==null);return!1}var vc=Error(l(461)),nt=!1;function mt(e,t,i,s){t.child=e===null?Sh(t,null,i,s):Ri(t,e.child,i,s)}function xf(e,t,i,s,o){i=i.render;var h=t.ref;if("ref"in s){var g={};for(var b in s)b!=="ref"&&(g[b]=s[b])}else g=s;return Ei(t),s=Zo(e,t,i,g,h,o),b=ec(),e!==null&&!nt?(tc(e,t,o),Rn(e,t,o)):(Ce&&b&&No(t),t.flags|=1,mt(e,t,s,o),t.child)}function wf(e,t,i,s,o){if(e===null){var h=i.type;return typeof h=="function"&&!Oo(h)&&h.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=h,Sf(e,t,h,s,o)):(e=Cs(i.type,null,s,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!jc(e,o)){var g=h.memoizedProps;
vendor: 9,287 bytes, line 9
9if(i=i.compare,i=i!==null?i:sr,i(g,s)&&e.ref===t.ref)return Rn(e,t,o)}return t.flags|=1,e=wn(h,s),e.ref=t.ref,e.return=t,t.child=e}function Sf(e,t,i,s,o){if(e!==null){var h=e.memoizedProps;if(sr(h,s)&&e.ref===t.ref)if(nt=!1,t.pendingProps=s=h,jc(e,o))(e.flags&131072)!==0&&(nt=!0);else return t.lanes=e.lanes,Rn(e,t,o)}return bc(e,t,i,s,o)}function Ef(e,t,i,s){var o=s.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|i:i,e!==null){for(s=t.child=e.child,o=0;s!==null;)o=o|s.lanes|s.childLanes,s=s.sibling;s=o&~h}else s=0,t.child=null;return Af(e,t,h,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ds(t,h!==null?h.cachePool:null),h!==null?jh(t,h):Wo(),Th(t);else return s=t.lanes=536870912,Af(e,t,h!==null?h.baseLanes|i:i,i,s)}else h!==null?(Ds(t,h.cachePool),jh(t,h),Xn(),t.memoizedState=null):(e!==null&&Ds(t,null),Wo(),Xn());return mt(e,t,o,i),t.child}function xr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Af(e,t,i,s,o){var h=$o();return h=h===null?null:{parent:et._currentValue,pool:h},t.memoizedState={baseLanes:i,cachePool:h},e!==null&&Ds(t,null),Wo(),Th(t),e!==null&&ra(e,t,s,!0),t.childLanes=o,null}function Ws(e,t){return t=Qs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function jf(e,t,i){return Ri(t,e.child,null,i),e=Ws(t,t.pendingProps),e.flags|=2,Ut(t),t.memoizedState=null,e}function Tv(e,t,i){var s=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ce){if(s.mode==="hidden")return e=Ws(t,s),t.lanes=536870912,xr(null,e);if(Qo(t),(e=Ve)?(e=Fp(e,Xt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pn!==null?{id:mn,overflow:gn}:null,retryLane:536870912,hydrationErrors:null},i=oh(e),i.return=t,t.child=i,ft=t,Ve=null)):e=null,e===null)throw Gn(t);return t.lanes=536870912,null}return Ws(t,s)}var h=e.memoizedState;if(h!==null){var g=h.dehydrated;if(Qo(t),o)if(t.flags&256)t.flags&=-257,t=jf(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(nt||ra(e,t,i,!1),o=(i&e.childLanes)!==0,nt||o){if(s=He,s!==null&&(g=md(s,i),g!==0&&g!==h.retryLane))throw h.retryLane=g,_i(e,g),Ct(s,e,g),vc;sl(),t=jf(e,t,i)}else e=h.treeContext,Ve=en(g.nextSibling),ft=t,Ce=!0,Vn=null,Xt=!1,e!==null&&dh(t,e),t=Ws(t,s),t.flags|=4096;return t}return e=wn(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Js(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function bc(e,t,i,s,o){return Ei(t),i=Zo(e,t,i,s,void 0,o),s=ec(),e!==null&&!nt?(tc(e,t,o),Rn(e,t,o)):(Ce&&s&&No(t),t.flags|=1,mt(e,t,i,o),t.child)}function Tf(e,t,i,s,o,h){return Ei(t),t.updateQueue=null,i=Ch(t,s,i,o),Rh(e),s=ec(),e!==null&&!nt?(tc(e,t,h),Rn(e,t,h)):(Ce&&s&&No(t),t.flags|=1,mt(e,t,i,h),t.child)}function Rf(e,t,i,s,o){if(Ei(t),t.stateNode===null){var h=ta,g=i.contextType;typeof g=="object"&&g!==null&&(h=pt(g)),h=new i(s,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=gc,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=s,h.state=t.memoizedState,h.refs={},Vo(t),g=i.contextType,h.context=typeof g=="object"&&g!==null?pt(g):ta,h.state=t.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(mc(t,i,g,s),h.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(g=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),g!==h.state&&gc.enqueueReplaceState(h,h.state,null),gr(t,s,h,o),mr(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){h=t.stateNode;var b=t.memoizedProps,A=ki(i,b);h.props=A;var z=h.context,H=i.contextType;g=ta,typeof H=="object"&&H!==null&&(g=pt(H));var V=i.getDerivedStateFromProps;H=typeof V=="function"||typeof h.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,H||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b||z!==g)&&pf(t,h,s,g),Yn=!1;var U=t.memoizedState;h.state=U,gr(t,s,h,o),mr(),z=t.memoizedState,b||U!==z||Yn?(typeof V=="function"&&(mc(t,i,V,s),z=t.memoizedState),(A=Yn||ff(t,i,A,s,U,z,g))?(H||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=z),h.props=s,h.state=z,h.context=g,s=A):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{h=t.stateNode,Go(e,t),g=t.memoizedProps,H=ki(i,g),h.props=H,V=t.pendingProps,U=h.context,z=i.contextType,A=ta,typeof z=="object"&&z!==null&&(A=pt(z)),b=i.getDerivedStateFromProps,(z=typeof b=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(g!==V||U!==A)&&pf(t,h,s,A),Yn=!1,U=t.memoizedState,h.state=U,gr(t,s,h,o),mr();var F=t.memoizedState;g!==V||U!==F||Yn||e!==null&&e.dependencies!==null&&Os(e.dependencies)?(typeof b=="function"&&(mc(t,i,b,s),F=t.memoizedState),(H=Yn||ff(t,i,H,s,U,F,A)||e!==null&&e.dependencies!==null&&Os(e.dependencies))?(z||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,F,A),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,F,A)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||g===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=F),h.props=s,h.state=F,h.context=A,s=H):(typeof h.componentDidUpdate!="function"||g===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),s=!1)}return h=s,Js(e,t),s=(t.flags&128)!==0,h||s?(h=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&s?(t.child=Ri(t,e.child,null,o),t.child=Ri(t,null,i,o)):mt(e,t,i,o),t.memoizedState=h.state,e=t.child):e=Rn(e,t,o),e}function Cf(e,t,i,s){return wi(),t.flags|=256,mt(e,t,i,s),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:yh()}}function wc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Lt),e}function kf(e,t,i){var s=t.pendingProps,o=!1,h=(t.flags&128)!==0,g;if((g=h)||(g=e!==null&&e.memoizedState===null?!1:(Xe.current&2)!==0),g&&(o=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ce){if(o?Qn(t):Xn(),(e=Ve)?(e=Fp(e,Xt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pn!==null?{id:mn,overflow:gn}:null,retryLane:536870912,hydrationErrors:null},i=oh(e),i.return=t,t.child=i,ft=t,Ve=null)):e=null,e===null)throw Gn(t);return au(e)?t.lanes=32:t.lanes=536870912,null}var b=s.children;return s=s.fallback,o?(Xn(),o=t.mode,b=Qs({mode:"hidden",children:b},o),s=xi(s,o,i,null),b.return=t,s.return=t,b.sibling=s,t.child=b,s=t.child,s.memoizedState=xc(i),s.childLanes=wc(e,g,i),t.memoizedState=_c,xr(null,s)):(Qn(t),Sc(t,b))}var A=e.memoizedState;if(A!==null&&(b=A.dehydrated,b!==null)){if(h)t.flags&256?(Qn(t),t.flags&=-257,t=Ec(e,t,i)):t.memoizedState!==null?(Xn(),t.child=e.child,t.flags|=128,t=null):(Xn(),b=s.fallback,o=t.mode,s=Qs({mode:"visible",children:s.children},o),b=xi(b,o,i,null),b.flags|=2,s.return=t,b.return=t,s.sibling=b,t.child=s,Ri(t,e.child,null,i),s=t.child,s.memoizedState=xc(i),s.childLanes=wc(e,g,i),t.memoizedState=_c,t=xr(null,s));else if(Qn(t),au(b)){if(g=b.nextSibling&&b.nextSibling.dataset,g)var z=g.dgst;g=z,s=Error(l(419)),s.stack="",s.digest=g,cr({value:s,source:null,stack:null}),t=Ec(e,t,i)}else if(nt||ra(e,t,i,!1),g=(i&e.childLanes)!==0,nt||g){if(g=He,g!==null&&(s=md(g,i),s!==0&&s!==A.retryLane))throw A.retryLane=s,_i(e,s),Ct(g,e,s),vc;iu(b)||sl(),t=Ec(e,t,i)}else iu(b)?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,Ve=en(b.nextSibling),ft=t,Ce=!0,Vn=null,Xt=!1,e!==null&&dh(t,e),t=Sc(t,s.children),t.flags|=4096);return t}return o?(Xn(),b=s.fallback,o=t.mode,A=e.child,z=A.sibling,s=wn(A,{mode:"hidden",children:s.children}),s.subtreeFlags=A.subtreeFlags&65011712,z!==null?b=wn(z,b):(b=xi(b,o,i,null),b.flags|=2),b.return=t,s.return=t,s.sibling=b,t.child=s,xr(null,s),s=t.child,b=e.child.memoizedState,b
vendor: 9,088 bytes, line 9
9===null?b=xc(i):(o=b.cachePool,o!==null?(A=et._currentValue,o=o.parent!==A?{parent:A,pool:A}:o):o=yh(),b={baseLanes:b.baseLanes|i,cachePool:o}),s.memoizedState=b,s.childLanes=wc(e,g,i),t.memoizedState=_c,xr(e.child,s)):(Qn(t),i=e.child,e=i.sibling,i=wn(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=i,t.memoizedState=null,i)}function Sc(e,t){return t=Qs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Qs(e,t){return e=Mt(22,e,null,t),e.lanes=0,e}function Ec(e,t,i){return Ri(t,e.child,null,i),e=Sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Of(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Lo(e.return,t,i)}function Ac(e,t,i,s,o,h){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:o,treeForkCount:h}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=s,g.tail=i,g.tailMode=o,g.treeForkCount=h)}function Bf(e,t,i){var s=t.pendingProps,o=s.revealOrder,h=s.tail;s=s.children;var g=Xe.current,b=(g&2)!==0;if(b?(g=g&1|2,t.flags|=128):g&=1,G(Xe,g),mt(e,t,s,i),s=Ce?or:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Of(e,i,t);else if(e.tag===19)Of(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(o){case"forwards":for(i=t.child,o=null;i!==null;)e=i.alternate,e!==null&&Ls(e)===null&&(o=i),i=i.sibling;i=o,i===null?(o=t.child,t.child=null):(o=i.sibling,i.sibling=null),Ac(t,!1,o,i,h,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ls(e)===null){t.child=o;break}e=o.sibling,o.sibling=i,i=o,o=e}Ac(t,!0,i,null,h,s);break;case"together":Ac(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Rn(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ti|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(ra(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=wn(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=wn(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Os(e)))}function Rv(e,t,i){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Kn(t,et,e.memoizedState.cache),wi();break;case 27:case 5:Vt(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Kn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qo(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Qn(t),t.flags|=128,null):(i&t.child.childLanes)!==0?kf(e,t,i):(Qn(t),e=Rn(e,t,i),e!==null?e.sibling:null);Qn(t);break;case 19:var o=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(ra(e,t,i,!1),s=(i&t.childLanes)!==0),o){if(s)return Bf(e,t,i);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),G(Xe,Xe.current),s)break;return null;case 22:return t.lanes=0,Ef(e,t,i,t.pendingProps);case 24:Kn(t,et,e.memoizedState.cache)}return Rn(e,t,i)}function Df(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)nt=!0;else{if(!jc(e,i)&&(t.flags&128)===0)return nt=!1,Rv(e,t,i);nt=(e.flags&131072)!==0}else nt=!1,Ce&&(t.flags&1048576)!==0&&uh(t,or,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=ji(t.elementType),t.type=e,typeof e=="function")Oo(e)?(s=ki(e,s),t.tag=1,t=Rf(null,t,e,s,i)):(t.tag=0,t=bc(null,t,e,s,i));else{if(e!=null){var o=e.$$typeof;if(o===X){t.tag=11,t=xf(null,t,e,s,i);break e}else if(o===Q){t.tag=14,t=wf(null,t,e,s,i);break e}}throw t=je(e)||e,Error(l(306,t,""))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,o=ki(s,t.pendingProps),Rf(e,t,s,o,i);case 3:e:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(l(387));s=t.pendingProps;var h=t.memoizedState;o=h.element,Go(e,t),gr(t,s,null,i);var g=t.memoizedState;if(s=g.cache,Kn(t,et,s),s!==h.cache&&Io(t,[et],i,!0),mr(),s=g.element,h.isDehydrated)if(h={element:s,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Cf(e,t,s,i);break e}else if(s!==o){o=Wt(Error(l(424)),t),cr(o),t=Cf(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ve=en(e.firstChild),ft=t,Ce=!0,Vn=null,Xt=!0,i=Sh(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(wi(),s===o){t=Rn(e,t,i);break e}mt(e,t,s,i)}t=t.child}return t;case 26:return Js(e,t),e===null?(i=Pp(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ce||(i=t.type,e=t.pendingProps,s=fl(J.current).createElement(i),s[ht]=t,s[St]=e,gt(s,i,e),ot(s),t.stateNode=s):t.memoizedState=Pp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Vt(t),e===null&&Ce&&(s=t.stateNode=Hp(t.type,t.pendingProps,J.current),ft=t,Xt=!0,o=Ve,si(t.type)?(ru=o,Ve=en(s.firstChild)):Ve=o),mt(e,t,t.pendingProps.children,i),Js(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ce&&((o=s=Ve)&&(s=a0(s,t.type,t.pendingProps,Xt),s!==null?(t.stateNode=s,ft=t,Ve=en(s.firstChild),Xt=!1,o=!0):o=!1),o||Gn(t)),Vt(t),o=t.type,h=t.pendingProps,g=e!==null?e.memoizedProps:null,s=h.children,eu(o,h)?s=null:g!==null&&eu(o,g)&&(t.flags|=32),t.memoizedState!==null&&(o=Zo(e,t,bv,null,null,i),zr._currentValue=o),Js(e,t),mt(e,t,s,i),t.child;case 6:return e===null&&Ce&&((e=i=Ve)&&(i=r0(i,t.pendingProps,Xt),i!==null?(t.stateNode=i,ft=t,Ve=null,e=!0):e=!1),e||Gn(t)),null;case 13:return kf(e,t,i);case 4:return ge(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Ri(t,null,s,i):mt(e,t,s,i),t.child;case 11:return xf(e,t,t.type,t.pendingProps,i);case 7:return mt(e,t,t.pendingProps,i),t.child;case 8:return mt(e,t,t.pendingProps.children,i),t.child;case 12:return mt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,Kn(t,t.type,s.value),mt(e,t,s.children,i),t.child;case 9:return o=t.type._context,s=t.pendingProps.children,Ei(t),o=pt(o),s=s(o),t.flags|=1,mt(e,t,s,i),t.child;case 14:return wf(e,t,t.type,t.pendingProps,i);case 15:return Sf(e,t,t.type,t.pendingProps,i);case 19:return Bf(e,t,i);case 31:return Tv(e,t,i);case 22:return Ef(e,t,i,t.pendingProps);case 24:return Ei(t),s=pt(et),e===null?(o=$o(),o===null&&(o=He,h=Ho(),o.pooledCache=h,h.refCount++,h!==null&&(o.pooledCacheLanes|=i),o=h),t.memoizedState={parent:s,cache:o},Vo(t),Kn(t,et,o)):((e.lanes&i)!==0&&(Go(e,t),gr(t,null,null,i),mr()),o=e.memoizedState,h=t.memoizedState,o.parent!==s?(o={parent:s,cache:s},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Kn(t,et,s)):(s=h.cache,Kn(t,et,s),s!==o.cache&&Io(t,[et],i,!0))),mt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Cn(e){e.flags|=4}function Tc(e,t,i,s,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(sp())e.flags|=8192;else throw Ti=Ms,Po}else e.flags&=-16777217}function Nf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Wp(t))if(sp())e.flags|=8192;else throw Ti=Ms,Po}function Xs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?hd():536870912,e.lanes|=t,ya|=t)}function wr(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ge(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags&65011712,s|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)i|=o.lanes|o.childLanes,s|=o.subtreeFlags,s|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function Cv(e,t,i){var s=t.pendingProps;switch(Mo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(t),null;case 1:return Ge(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),An(et),Oe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(aa(t)?Cn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Uo())),Ge(t),null;case 26:var o=t.type,h=t.memoizedState;return e===null?(Cn(t),h!==null?(Ge(t),Nf(t,h)):(Ge(t),Tc(t,o,null,s,i))):h?h!==e.memoizedState?(Cn(t),Ge(t),Nf(t,h)):(Ge(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Cn(t),Ge(t),Tc(t,o,e,s,i)),null;case 27:if(Li(t),i=J.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Cn(t);
vendor: 5,003 bytes, line 9
9else{if(!s){if(t.stateNode===null)throw Error(l(166));return Ge(t),null}e=Y.current,aa(t)?hh(t):(e=Hp(o,s,i),t.stateNode=e,Cn(t))}return Ge(t),null;case 5:if(Li(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Cn(t);else{if(!s){if(t.stateNode===null)throw Error(l(166));return Ge(t),null}if(h=Y.current,aa(t))hh(t);else{var g=fl(J.current);switch(h){case 1:h=g.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:h=g.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":h=g.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":h=g.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":h=g.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof s.is=="string"?g.createElement("select",{is:s.is}):g.createElement("select"),s.multiple?h.multiple=!0:s.size&&(h.size=s.size);break;default:h=typeof s.is=="string"?g.createElement(o,{is:s.is}):g.createElement(o)}}h[ht]=t,h[St]=s;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)h.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=h;e:switch(gt(h,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Cn(t)}}return Ge(t),Tc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Cn(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=J.current,aa(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,o=ft,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[ht]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||kp(e.nodeValue,i)),e||Gn(t,!0)}else e=fl(e).createTextNode(s),e[ht]=t,t.stateNode=e}return Ge(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=aa(t),i!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[ht]=t}else wi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),e=!1}else i=Uo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Ut(t),t):(Ut(t),null);if((t.flags&128)!==0)throw Error(l(558))}return Ge(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=aa(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[ht]=t}else wi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),o=!1}else o=Uo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Ut(t),t):(Ut(t),null)}return Ut(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==o&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Xs(t,t.updateQueue),Ge(t),null);case 4:return Oe(),e===null&&Wc(t.stateNode.containerInfo),Ge(t),null;case 10:return An(t.type),Ge(t),null;case 19:if(N(Xe),s=t.memoizedState,s===null)return Ge(t),null;if(o=(t.flags&128)!==0,h=s.rendering,h===null)if(o)wr(s,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Ls(e),h!==null){for(t.flags|=128,wr(s,!1),e=h.updateQueue,t.updateQueue=e,Xs(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)lh(i,e),i=i.sibling;return G(Xe,Xe.current&1|2),Ce&&Sn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&dt()>il&&(t.flags|=128,o=!0,wr(s,!1),t.lanes=4194304)}else{if(!o)if(e=Ls(h),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Xs(t,e),wr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!Ce)return Ge(t),null}else 2*dt()-s.renderingStartTime>il&&i!==536870912&&(t.flags|=128,o=!0,wr(s,!1),t.lanes=4194304);s.isBackwards?(h.sibling=t.child,t.child=h):(e=s.last,e!==null?e.sibling=h:t.child=h,s.last=h)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=dt(),e.sibling=null,i=Xe.current,G(Xe,o?i&1|2:i&1),Ce&&Sn(t,s.treeForkCount),e):(Ge(t),null);case 22:case 23:return Ut(t),Jo(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),i=t.updateQueue,i!==null&&Xs(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&N(A
vendor: 22,176 bytes, line 9
9i),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),An(et),Ge(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function kv(e,t){switch(Mo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return An(et),Oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Li(t),null;case 31:if(t.memoizedState!==null){if(Ut(t),t.alternate===null)throw Error(l(340));wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ut(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return N(Xe),null;case 4:return Oe(),null;case 10:return An(t.type),null;case 22:case 23:return Ut(t),Jo(),e!==null&&N(Ai),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return An(et),null;case 25:return null;default:return null}}function Mf(e,t){switch(Mo(t),t.tag){case 3:An(et),Oe();break;case 26:case 27:case 5:Li(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Ut(t);break;case 13:Ut(t);break;case 19:N(Xe);break;case 10:An(t.type);break;case 22:case 23:Ut(t),Jo(),e!==null&&N(Ai);break;case 24:An(et)}}function Sr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var o=s.next;i=o;do{if((i.tag&e)===e){s=void 0;var h=i.create,g=i.inst;s=h(),g.destroy=s}i=i.next}while(i!==o)}}catch(b){Ue(t,t.return,b)}}function Zn(e,t,i){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var h=o.next;s=h;do{if((s.tag&e)===e){var g=s.inst,b=g.destroy;if(b!==void 0){g.destroy=void 0,o=t;var A=i,z=b;try{z()}catch(H){Ue(o,A,H)}}}s=s.next}while(s!==h)}}catch(H){Ue(t,t.return,H)}}function zf(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Ah(t,i)}catch(s){Ue(e,e.return,s)}}}function Uf(e,t,i){i.props=ki(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Ue(e,t,s)}}function Er(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(o){Ue(e,t,o)}}function yn(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(o){Ue(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(o){Ue(e,t,o)}else i.current=null}function Ff(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(o){Ue(e,e.return,o)}}function Rc(e,t,i){try{var s=e.stateNode;Xv(s,e.type,i,t),s[St]=t}catch(o){Ue(e,e.return,o)}}function Lf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&si(e.type)||e.tag===4}function Cc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Lf(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.tag===27&&si(e.type)||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 kc(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=_n));else if(s!==4&&(s===27&&si(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(kc(e,t,i),e=e.sibling;e!==null;)kc(e,t,i),e=e.sibling}function Zs(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&si(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Zs(e,t,i),e=e.sibling;e!==null;)Zs(e,t,i),e=e.sibling}function If(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);gt(t,s,i),t[ht]=e,t[St]=i}catch(h){Ue(e,e.return,h)}}var kn=!1,it=!1,Oc=!1,Hf=typeof WeakSet=="function"?WeakSet:Set,ct=null;function Ov(e,t){if(e=e.containerInfo,Xc=_l,e=Xd(e),Eo(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var o=s.anchorOffset,h=s.focusNode;s=s.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var g=0,b=-1,A=-1,z=0,H=0,V=e,U=null;t:for(;;){for(var F;V!==i||o!==0&&V.nodeType!==3||(b=g+o),V!==h||s!==0&&V.nodeType!==3||(A=g+s),V.nodeType===3&&(g+=V.nodeValue.length),(F=V.firstChild)!==null;)U=V,V=F;for(;;){if(V===e)break t;if(U===i&&++z===o&&(b=g),U===h&&++H===s&&(A=g),(F=V.nextSibling)!==null)break;V=U,U=V.parentNode}V=F}i=b===-1||A===-1?null:{start:b,end:A}}else i=null}i=i||{start:0,end:0}}else i=null;for(Zc={focusedElem:e,selectionRange:i},_l=!1,ct=t;ct!==null;)if(t=ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ct=e;else for(;ct!==null;){switch(t=ct,h=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)o=e[i],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,i=t,o=h.memoizedProps,h=h.memoizedState,s=i.stateNode;try{var ae=ki(i.type,o);e=s.getSnapshotBeforeUpdate(ae,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(he){Ue(i,i.return,he)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)nu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":nu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,ct=e;break}ct=t.return}}function qf(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Bn(e,i),s&4&&Sr(5,i);break;case 1:if(Bn(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(g){Ue(i,i.return,g)}else{var o=ki(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){Ue(i,i.return,g)}}s&64&&zf(i),s&512&&Er(i,i.return);break;case 3:if(Bn(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Ah(e,t)}catch(g){Ue(i,i.return,g)}}break;case 27:t===null&&s&4&&If(i);case 26:case 5:Bn(e,i),t===null&&s&4&&Ff(i),s&512&&Er(i,i.return);break;case 12:Bn(e,i);break;case 31:Bn(e,i),s&4&&Vf(e,i);break;case 13:Bn(e,i),s&4&&Gf(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Iv.bind(null,i),s0(e,i))));break;case 22:if(s=i.memoizedState!==null||kn,!s){t=t!==null&&t.memoizedState!==null||it,o=kn;var h=it;kn=s,(it=t)&&!h?Dn(e,i,(i.subtreeFlags&8772)!==0):Bn(e,i),kn=o,it=h}break;case 30:break;default:Bn(e,i)}}function $f(e){var t=e.alternate;t!==null&&(e.alternate=null,$f(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&so(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ke=null,At=!1;function On(e,t,i){for(i=i.child;i!==null;)Pf(e,t,i),i=i.sibling}function Pf(e,t,i){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Ot,i)}catch{}switch(i.tag){case 26:it||yn(i,t),On(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:it||yn(i,t);var s=Ke,o=At;si(i.type)&&(Ke=i.stateNode,At=!1),On(e,t,i),Dr(i.stateNode),Ke=s,At=o;break;case 5:it||yn(i,t);case 6:if(s=Ke,o=At,Ke=null,On(e,t,i),Ke=s,At=o,Ke!==null)if(At)try{(Ke.nodeType===9?Ke.body:Ke.nodeName==="HTML"?Ke.ownerDocument.body:Ke).removeChild(i.stateNode)}catch(h){Ue(i,t,h)}else try{Ke.removeChild(i.stateNode)}catch(h){Ue(i,t,h)}break;case 18:Ke!==null&&(At?(e=Ke,zp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Aa(e)):zp(Ke,i.stateNode));break;case 4:s=Ke,o=At,Ke=i.stateNode.containerInfo,At=!0,On(e,t,i),Ke=s,At=o;break;case 0:case 11:case 14:case 15:Zn(2,i,t),it||Zn(4,i,t),On(e,t,i);break;case 1:it||(yn(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Uf(i,t,s)),On(e,t,i);break;case 21:On(e,t,i);break;case 22:it=(s=it)||i.memoizedState!==null,On(e,t,i),it=s;break;default:On(e,t,i)}}function Vf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Aa(e)}catch(i){Ue(t,t.return,i)}}}function Gf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Aa(e)}catch(i){Ue(t,t.return,i)}}function Bv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Hf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Hf),t;default:throw Error(l(435,e.tag))}}function el(e,t){var i=Bv(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var o=Hv.bind(null,e,s);s.then(o,o)}})}function jt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var o=i[s],h=e,g=t,b=g;e:for(;b!==null;){switch(b.tag){case 27:if(si(b.type)){Ke=b.stateNode,At=!1;break e}break;case 5:Ke=b.stateNode,At=!1;break e;case 3:case 4:Ke=b.stateNode.containerInfo,At=!0;break e}b=b.return}if(Ke===null)throw Error(l(160));Pf(h,g,o),Ke=null,At=!1,h=o.alternate,h!==null&&(h.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Kf(t,e),t=t.sibling}var on=null;function Kf(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jt(t,e),Tt(e),s&4&&(Zn(3,e,e.return),Sr(3,e),Zn(5,e,e.return));break;case 1:jt(t,e),Tt(e),s&512&&(it||i===null||yn(i,i.return)),s&64&&kn&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var o=on;if(jt(t,e),Tt(e),s&512&&(it||i===null||yn(i,i.return)),s&4){var h=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,o=o.ownerDocument||o;t:switch(s){case"title":h=o.getElementsByTagName("title")[0],(!h||h[Qa]||h[ht]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=o.createElement(s),o.head.insertBefore(h,o.querySelector("head > title"))),gt(h,s,i),h[ht]=e,ot(h),s=h;break e;case"link":var g=Kp("link","href",o).get(s+(i.href||""));if(g){for(var b=0;b<g.length;b++)if(h=g[b],h.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&h.getAttribute("rel")===(i.rel==null?null:i.rel)&&h.getAttribute("title")===(i.title==null?null:i.title)&&h.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){g.splice(b,1);break t}}h=o.createElement(s),gt(h,s,i),o.head.appendChild(h);break;case"meta":if(g=Kp("meta","content",o).get(s+(i.content||""))){for(b=0;b<g.length;b++)if(h=g[b],h.getAttribute("content")===(i.content==null?null:""+i.content)&&h.getAttribute("name")===(i.name==null?null:i.name)&&h.getAttribute("property")===(i.property==null?null:i.property)&&h.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&h.getAttribute("charset")===(i.charSet==null?null:i.charSet)){g.splice(b,1);break t}}h=o.createElement(s),gt(h,s,i),o.head.appendChild(h);break;default:throw Error(l(468,s))}h[ht]=e,ot(h),s=h}e.stateNode=s}else Yp(o,e.type,e.stateNode);else e.stateNode=Gp(o,s,e.memoizedProps);else h!==s?(h===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):h.count--,s===null?Yp(o,e.type,e.stateNode):Gp(o,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Rc(e,e.memoizedProps,i.memoizedProps)}break;case 27:jt(t,e),Tt(e),s&512&&(it||i===null||yn(i,i.return)),i!==null&&s&4&&Rc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(jt(t,e),Tt(e),s&512&&(it||i===null||yn(i,i.return)),e.flags&32){o=e.stateNode;try{Yi(o,"")}catch(ae){Ue(e,e.return,ae)}}s&4&&e.stateNode!=null&&(o=e.memoizedProps,Rc(e,o,i!==null?i.memoizedProps:o)),s&1024&&(Oc=!0);break;case 6:if(jt(t,e),Tt(e),s&4){if(e.stateNode===null)throw Error(l(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(ae){Ue(e,e.return,ae)}}break;case 3:if(gl=null,o=on,on=pl(t.containerInfo),jt(t,e),on=o,Tt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Aa(t.containerInfo)}catch(ae){Ue(e,e.return,ae)}Oc&&(Oc=!1,Yf(e));break;case 4:s=on,on=pl(e.stateNode.containerInfo),jt(t,e),Tt(e),on=s;break;case 12:jt(t,e),Tt(e);break;case 31:jt(t,e),Tt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,el(e,s)));break;case 13:jt(t,e),Tt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(nl=dt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,el(e,s)));break;case 22:o=e.memoizedState!==null;var A=i!==null&&i.memoizedState!==null,z=kn,H=it;if(kn=z||o,it=H||A,jt(t,e),it=H,kn=z,Tt(e),s&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(i===null||A||kn||it||Oi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){A=i=t;try{if(h=A.stateNode,o)g=h.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{b=A.stateNode;var V=A.memoizedProps.style,U=V!=null&&V.hasOwnProperty("display")?V.display:null;b.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(ae){Ue(A,A.return,ae)}}}else if(t.tag===6){if(i===null){A=t;try{A.stateNode.nodeValue=o?"":A.memoizedProps}catch(ae){Ue(A,A.return,ae)}}}else if(t.tag===18){if(i===null){A=t;try{var F=A.stateNode;o?Up(F,!0):Up(A.stateNode,!1)}catch(ae){Ue(A,A.return,ae)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,el(e,i))));break;case 19:jt(t,e),Tt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,el(e,s)));break;case 30:break;case 21:break;default:jt(t,e),Tt(e)}}function Tt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Lf(s)){i=s;break}s=s.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var o=i.stateNode,h=Cc(e);Zs(e,h,o);break;case 5:var g=i.stateNode;i.flags&32&&(Yi(g,""),i.flags&=-33);var b=Cc(e);Zs(e,b,g);break;case 3:case 4:var A=i.stateNode.containerInfo,z=Cc(e);kc(e,z,A);break;default:throw Error(l(161))}}catch(H){Ue(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Yf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Bn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)qf(e,t.alternate,t),t=t.sibling}function Oi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Zn(4,t,t.return),Oi(t);break;case 1:yn(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Uf(t,t.return,i),Oi(t);break;case 27:Dr(t.stateNode);case 26:case 5:yn(t,t.return),Oi(t);break;case 22:t.memoizedState===null&&Oi(t);break;case 30:Oi(t);break;default:Oi(t)}e=e.sibling}}function Dn(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,o=e,h=t,g=h.flags;switch(h.tag){case 0:case 11:case 15:Dn(o,h,i),Sr(4,h);break;case 1:if(Dn(o,h,i),s=h,o=s.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(z){Ue(s,s.return,z)}if(s=h,o=s.updateQueue,o!==null){var b=s.stateNode;try{var A=o.shared.hiddenCallbacks;if(A!==null)for(o.shared.hiddenCallbacks=null,o=0;o<A.length;o++)Eh(A[o],b)}catch(z){Ue(s,s.return,z)}}i&&g&64&&zf(h),Er(h,h.return);break;case 27:If(h);case 26:case 5:Dn(o,h,i),i&&s===null&&g&4&&Ff(h),Er(h,h.return);break;case 12:Dn(o,h,i);break;case 31:Dn(o,h,i),i&&g&4&&Vf(o,h);break;case 13:Dn(o,h,i),i&&g&4&&Gf(o,h);break;case 22:h.memoizedState===null&&Dn(o,h,i),Er(h,h.return);break;case 30:break;default:Dn(o,h,i)}t=t.sibling}}function Bc(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&ur(i))}function Dc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ur(e))}function cn(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wf(e,t,i,s),t=t.sibling}function Wf(e,t,i,s){var o=t.flags;switch(t.tag){case 0:case 11:case 15:cn(e,t,i,s),o&2048&&Sr(9,t);break;case 1:cn(e,t,i,s);break;case 3:cn(e,t,i,s),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ur(e)));break;case 12:if(o&2048){cn(e,t,i,s),e=t.stateNode;try{var h=t.memoizedProps,g=h.id,b=h.onPostCommit;typeof b=="function"&&b(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){Ue(t,t.return,A)}}else cn(e,t,i,s);break;case 31:cn(e,t,i,s);break;case 13:cn(e,t,i,s);break;case 23:break;case 22:h=t.stateNode,g=t.alternate,t.memoizedState!==null?h._visibility&2?cn(e,t,i,s):Ar(e,t):h._visibility&2?cn(e,t,i,s):(h._visibility|=2,pa(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),o&2048&&Bc(g,t);break;case 24:cn(e,t,i,s),o&2048&&Dc(t.alternate,t);break;default:cn(e,t,i,s)}}function pa(e,t,i,s,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,g=t,b=i,A=s,z=g.flags;switch(g.tag){case 0:case 11:case 15:pa(h,g,b,A,o),Sr(8,g);break;case 23:break;case 22:var H=g.stateNode;g.memoizedState!==null?H._visibility&2?pa(h,g,b,A,o):Ar(h,g):(H._visibility|=2,pa(h,g,b,A,o)),o&&z&2048&&Bc(g.alternate,g);break;case 24:pa(h,g,b,A,o),o&&z&2048&&Dc(g.alternate,g);break;default:pa(h,g,b,A,o)}t=t.sibling}}function Ar(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,o=s.flags;switch(s.tag){case 22:Ar(i,s),o&2048&&Bc(s.alternate,s);break;case 24:Ar(i,s),o&2048&&Dc(s.alternate,s);break;default:Ar(i,s)}t=t.sibling}}var jr=8192;function ma(e,t,i){if(e.subtreeFlags&jr)for(e=e.child;e!==null;)Jf(e,t,i),e=e.sibling}function Jf(e,t,i){switch(e.tag){case 26:ma(e,t,i),e.flags&jr&&e.memoizedState!==null&&v0(i,on,e.memoizedState,e.memoizedProps);break;case 5:ma(e,t,i);break;case 3:case 4:var s=on;on=pl(e.stateNode.containerInfo),ma(e,t,i),on=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=jr,jr=16777216,ma(e,t,i),jr=s):ma(e,t,i));break;default:ma(e,t,i)}}function Qf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Tr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];ct=s,Zf(s,e)}Qf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xf(e),e=e.sibling}function Xf(e){switch(e.tag){case 0:case 11:case 15:Tr(e),e.flags&2048&&Zn(9,e,e.return);break;case 3:Tr(e);break;case 12:Tr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,tl(e)):Tr(e);break;default:Tr(e)}}function tl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];ct=s,Zf(s,e)}Qf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Zn(8,t,t.return),tl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,tl(t));break;default:tl(t)}e=e.sibling}}function Zf(e,t){for(;ct!==null;){var i=ct;switch(i.tag){case 0:case 11:case 15:Zn(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ur(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,ct=s;else e:for(i=e;ct!==null;){s=ct;var o=s.sibling,h=s.return;if($f(s),s===i){ct=null;break e}if(o!==null){o.return=h,ct=o;break e}ct=h}}}var Dv={getCacheForType:function(e){var t=pt(et),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return pt(et).controller.signal}},Nv=typeof WeakMap=="function"?WeakMap:Map,Ne=0,He=null,Ee=null,Te=0,ze=0,Ft=null,ei=!1,ga=!1,Nc=!1,Nn=0,Je=0,ti=0,Bi=0,Mc=0,Lt=0,ya=0,Rr=null,Rt=null,zc=!1,nl=0,ep=0,il=1/0,al=null,ni=null,rt=0,ii=null,va=null,Mn=0,Uc=0,Fc=null,tp=null,Cr=0,Lc=null;function It(){return(Ne&2)!==0&&Te!==0?Te&-Te:I.T!==null?Vc():gd()}function np(){if(Lt===0)if((Te&536870912)===0||Ce){var e=hs;hs<<=1,(hs&3932160)===0&&(hs=262144),Lt=e}else Lt=536870912;return e=zt.current,e!==null&&(e.flags|=32),Lt}function Ct(e,t,i){(e===He&&(ze===2||ze===9)||e.cancelPendingCommit!==null)&&(ba(e,0),ai(e,Te,Lt,!1)),Ja(e,i),((Ne&2)===0||e!==He)&&(e===He&&((Ne&2)===0&&(Bi|=i),Je===4&&ai(e,Te,Lt,!1)),vn(e))}function ip(e,t,i){if((Ne&6)!==0)throw Error(l(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Wa(e,t),o=s?Uv(e,t):Hc(e,t,!0),h=s;do{if(o===0){ga&&!s&&ai(e,t,0,!1);break}else{if(i=e.current.alternate,h&&!Mv(i)){o=Hc(e,t,!1),h=!1;continue}if(o===2){if(h=t,e.errorRecoveryDisabledLanes&h)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var b=e;o=Rr;var A=b.current.memoizedState.isDehydrated;if(A&&(ba(b,g).flags|=256),g=Hc(b,g,!1),g!==2){if(Nc&&!A){b.errorRecoveryDisabledLanes|=h,Bi|=h,o=4;break e}h=Rt,Rt=o,h!==null&&(Rt===null?Rt=h:Rt.push.apply(Rt,h))}o=g}if(h=!1,o!==2)continue}}if(o===1){ba(e,0),ai(e,t,0,!0);break}e:{switch(s=e,h=o,h){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:ai(s,t,Lt,!ei);break e;case 2:Rt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(o=nl+300-dt(),10<o)){if(ai(s,t,Lt,!ei),ps(s,0,!0)!==0)break e;Mn=t,s.timeoutHandle=Np(ap.bind(null,s,i,Rt,al,zc,t,Lt,Bi,ya,ei,h,"Throttled",-0,0),o);break e}ap(s,i,Rt,al,zc,t,Lt,Bi,ya,ei,h,null,-0,0)}}break}while(!0);vn(e)}function ap(e,t,i,s,o,h,g,b,A,z,H,V,U,F){if(e.timeoutHandle=-1,V=t.subtreeFlags,V&8192||(V&16785408)===16785408){V={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_n},Jf(t,h,V);
vendor: 13,565 bytes, line 9
9var ae=(h&62914560)===h?nl-dt():(h&4194048)===h?ep-dt():0;if(ae=b0(V,ae),ae!==null){Mn=h,e.cancelPendingCommit=ae(hp.bind(null,e,t,h,i,s,o,g,b,A,H,V,null,U,F)),ai(e,h,g,!z);return}}hp(e,t,h,i,s,o,g,b,A)}function Mv(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var o=i[s],h=o.getSnapshot;o=o.value;try{if(!Nt(h(),o))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ai(e,t,i,s){t&=~Mc,t&=~Bi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var o=t;0<o;){var h=31-Dt(o),g=1<<h;s[h]=-1,o&=~g}i!==0&&fd(e,i,t)}function rl(){return(Ne&6)===0?(kr(0),!1):!0}function Ic(){if(Ee!==null){if(ze===0)var e=Ee.return;else e=Ee,En=Si=null,nc(e),ca=null,hr=0,e=Ee;for(;e!==null;)Mf(e.alternate,e),e=e.return;Ee=null}}function ba(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,t0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Mn=0,Ic(),He=e,Ee=i=wn(e.current,null),Te=t,ze=0,Ft=null,ei=!1,ga=Wa(e,t),Nc=!1,ya=Lt=Mc=Bi=ti=Je=0,Rt=Rr=null,zc=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-Dt(s),h=1<<o;t|=e[o],s&=~h}return Nn=t,js(),i}function rp(e,t){be=null,I.H=_r,t===oa||t===Ns?(t=_h(),ze=3):t===Po?(t=_h(),ze=4):ze=t===vc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ft=t,Ee===null&&(Je=1,Ys(e,Wt(t,e.current)))}function sp(){var e=zt.current;return e===null?!0:(Te&4194048)===Te?Zt===null:(Te&62914560)===Te||(Te&536870912)!==0?e===Zt:!1}function lp(){var e=I.H;return I.H=_r,e===null?_r:e}function op(){var e=I.A;return I.A=Dv,e}function sl(){Je=4,ei||(Te&4194048)!==Te&&zt.current!==null||(ga=!0),(ti&134217727)===0&&(Bi&134217727)===0||He===null||ai(He,Te,Lt,!1)}function Hc(e,t,i){var s=Ne;Ne|=2;var o=lp(),h=op();(He!==e||Te!==t)&&(al=null,ba(e,t)),t=!1;var g=Je;e:do try{if(ze!==0&&Ee!==null){var b=Ee,A=Ft;switch(ze){case 8:Ic(),g=6;break e;case 3:case 2:case 9:case 6:zt.current===null&&(t=!0);var z=ze;if(ze=0,Ft=null,_a(e,b,A,z),i&&ga){g=0;break e}break;default:z=ze,ze=0,Ft=null,_a(e,b,A,z)}}zv(),g=Je;break}catch(H){rp(e,H)}while(!0);return t&&e.shellSuspendCounter++,En=Si=null,Ne=s,I.H=o,I.A=h,Ee===null&&(He=null,Te=0,js()),g}function zv(){for(;Ee!==null;)cp(Ee)}function Uv(e,t){var i=Ne;Ne|=2;var s=lp(),o=op();He!==e||Te!==t?(al=null,il=dt()+500,ba(e,t)):ga=Wa(e,t);e:do try{if(ze!==0&&Ee!==null){t=Ee;var h=Ft;t:switch(ze){case 1:ze=0,Ft=null,_a(e,t,h,1);break;case 2:case 9:if(vh(h)){ze=0,Ft=null,up(t);break}t=function(){ze!==2&&ze!==9||He!==e||(ze=7),vn(e)},h.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:vh(h)?(ze=0,Ft=null,up(t)):(ze=0,Ft=null,_a(e,t,h,7));break;case 5:var g=null;switch(Ee.tag){case 26:g=Ee.memoizedState;case 5:case 27:var b=Ee;if(g?Wp(g):b.stateNode.complete){ze=0,Ft=null;var A=b.sibling;if(A!==null)Ee=A;else{var z=b.return;z!==null?(Ee=z,ll(z)):Ee=null}break t}}ze=0,Ft=null,_a(e,t,h,5);break;case 6:ze=0,Ft=null,_a(e,t,h,6);break;case 8:Ic(),Je=6;break e;default:throw Error(l(462))}}Fv();break}catch(H){rp(e,H)}while(!0);return En=Si=null,I.H=s,I.A=o,Ne=i,Ee!==null?0:(He=null,Te=0,js(),Je)}function Fv(){for(;Ee!==null&&!ce();)cp(Ee)}function cp(e){var t=Df(e.alternate,e,Nn);e.memoizedProps=e.pendingProps,t===null?ll(e):Ee=t}function up(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Tf(i,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=Tf(i,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:nc(t);default:Mf(i,t),t=Ee=lh(t,Nn),t=Df(i,t,Nn)}e.memoizedProps=e.pendingProps,t===null?ll(e):Ee=t}function _a(e,t,i,s){En=Si=null,nc(t),ca=null,hr=0;var o=t.return;try{if(jv(e,o,t,i,Te)){Je=1,Ys(e,Wt(i,e.current)),Ee=null;return}}catch(h){if(o!==null)throw Ee=o,h;Je=1,Ys(e,Wt(i,e.current)),Ee=null;return}t.flags&32768?(Ce||s===1?e=!0:ga||(Te&536870912)!==0?e=!1:(ei=e=!0,(s===2||s===9||s===3||s===6)&&(s=zt.current,s!==null&&s.tag===13&&(s.flags|=16384))),dp(t,e)):ll(t)}function ll(e){var t=e;do{if((t.flags&32768)!==0){dp(t,ei);return}e=t.return;var i=Cv(t.alternate,t,Nn);if(i!==null){Ee=i;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Je===0&&(Je=5)}function dp(e,t){do{var i=kv(e.alternate,e);if(i!==null){i.flags&=32767,Ee=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ee=e;return}Ee=e=i}while(e!==null);Je=6,Ee=null}function hp(e,t,i,s,o,h,g,b,A){e.cancelPendingCommit=null;do ol();while(rt!==0);if((Ne&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(h=t.lanes|t.childLanes,h|=Co,yy(e,i,h,g,b,A),e===He&&(Ee=He=null,Te=0),va=t,ii=e,Mn=i,Uc=h,Fc=o,tp=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,qv(Hi,function(){return yp(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=I.T,I.T=null,o=B.p,B.p=2,g=Ne,Ne|=4;try{Ov(e,t,i)}finally{Ne=g,B.p=o,I.T=s}}rt=1,fp(),pp(),mp()}}function fp(){if(rt===1){rt=0;var e=ii,t=va,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=I.T,I.T=null;var s=B.p;B.p=2;var o=Ne;Ne|=4;try{Kf(t,e);var h=Zc,g=Xd(e.containerInfo),b=h.focusedElem,A=h.selectionRange;if(g!==b&&b&&b.ownerDocument&&Qd(b.ownerDocument.documentElement,b)){if(A!==null&&Eo(b)){var z=A.start,H=A.end;if(H===void 0&&(H=z),"selectionStart"in b)b.selectionStart=z,b.selectionEnd=Math.min(H,b.value.length);else{var V=b.ownerDocument||document,U=V&&V.defaultView||window;if(U.getSelection){var F=U.getSelection(),ae=b.textContent.length,he=Math.min(A.start,ae),Ie=A.end===void 0?he:Math.min(A.end,ae);!F.extend&&he>Ie&&(g=Ie,Ie=he,he=g);var O=Jd(b,he),j=Jd(b,Ie);if(O&&j&&(F.rangeCount!==1||F.anchorNode!==O.node||F.anchorOffset!==O.offset||F.focusNode!==j.node||F.focusOffset!==j.offset)){var M=V.createRange();M.setStart(O.node,O.offset),F.removeAllRanges(),he>Ie?(F.addRange(M),F.extend(j.node,j.offset)):(M.setEnd(j.node,j.offset),F.addRange(M))}}}}for(V=[],F=b;F=F.parentNode;)F.nodeType===1&&V.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<V.length;b++){var $=V[b];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}_l=!!Xc,Zc=Xc=null}finally{Ne=o,B.p=s,I.T=i}}e.current=t,rt=2}}function pp(){if(rt===2){rt=0;var e=ii,t=va,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=I.T,I.T=null;var s=B.p;B.p=2;var o=Ne;Ne|=4;try{qf(e,t.alternate,t)}finally{Ne=o,B.p=s,I.T=i}}rt=3}}function mp(){if(rt===4||rt===3){rt=0,kt();var e=ii,t=va,i=Mn,s=tp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?rt=5:(rt=0,va=ii=null,gp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(ni=null),ao(i),t=t.stateNode,Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Ot,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=I.T,o=B.p,B.p=2,I.T=null;try{for(var h=e.onRecoverableError,g=0;g<s.length;g++){var b=s[g];h(b.value,{componentStack:b.stack})}}finally{I.T=t,B.p=o}}(Mn&3)!==0&&ol(),vn(e),o=e.pendingLanes,(i&261930)!==0&&(o&42)!==0?e===Lc?Cr++:(Cr=0,Lc=e):Cr=0,kr(0)}}function gp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ur(t)))}function ol(){return fp(),pp(),mp(),yp()}function yp(){if(rt!==5)return!1;var e=ii,t=Uc;Uc=0;var i=ao(Mn),s=I.T,o=B.p;try{B.p=32>i?32:i,I.T=null,i=Fc,Fc=null;var h=ii,g=Mn;if(rt=0,va=ii=null,Mn=0,(Ne&6)!==0)throw Error(l(331));var b=Ne;if(Ne|=4,Xf(h.current),Wf(h,h.current,g,i),Ne=b,kr(0,!1),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Ot,h)}catch{}return!0}finally{B.p=o,I.T=s,gp(e,t)}}function vp(e,t,i){t=Wt(i,t),t=yc(e.stateNode,t,2),e=Jn(e,t,2),e!==null&&(Ja(e,2),vn(e))}function Ue(e,t,i){if(e.tag===3)vp(e,e,i);else for(;t!==null;){if(t.tag===3){vp(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ni===null||!ni.has(s))){e=Wt(i,e),i=bf(2),s=Jn(t,i,2),s!==null&&(_f(i,s,t,e),Ja(s,2),vn(s));break}}t=t.return}}function qc(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new Nv;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(i)||(Nc=!0,o.add(i),e=Lv.bind(null,e,t,i),t.then(e,e))}function Lv(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,He===e&&(Te&i)===i&&(Je===4||Je===3&&(Te&62914560)===Te&&300>dt()-nl?(Ne&2)===0&&ba(e,0):Mc|=i,ya===Te&&(ya=0)),vn(e)}function bp(e,t){t===0&&(t=hd()),e=_i(e,t),e!==null&&(Ja(e,t),vn(e))}function Iv(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),bp(e,i)}function Hv(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(i=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),bp(e,i)}function qv(e,t){return W(e,t)}var cl=null,xa=null,$c=!1,ul=!1,Pc=!1,ri=0;function vn(e){e!==xa&&e.next===null&&(xa===null?cl=xa=e:xa=xa.next=e),ul=!0,$c||($c=!0,Pv())}function kr(e,t){if(!Pc&&ul){Pc=!0;do for(var i=!1,s=cl;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var h=0;else{var g=s.suspendedLanes,b=s.pingedLanes;h=(1<<31-Dt(42|e)+1)-1,h&=o&~(g&~b),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,Sp(s,h))}else h=Te,h=ps(s,s===He?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||Wa(s,h)||(i=!0,Sp(s,h));s=s.next}while(i);Pc=!1}}function $v(){_p()}function _p(){ul=$c=!1;var e=0;ri!==0&&e0()&&(e=ri);for(var t=dt(),i=null,s=cl;s!==null;){var o=s.next,h=xp(s,t);h===0?(s.next=null,i===null?cl=o:i.next=o,o===null&&(xa=i)):(i=s,(e!==0||(h&3)!==0)&&(ul=!0)),s=o}rt!==0&&rt!==5||kr(e),ri!==0&&(ri=0)}function xp(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var g=31-Dt(h),b=1<<g,A=o[g];A===-1?((b&i)===0||(b&s)!==0)&&(o[g]=gy(b,t)):A<=t&&(e.expiredLanes|=b),h&=~b}if(t=He,i=Te,i=ps(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(ze===2||ze===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ie(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Wa(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&ie(s),ao(i)){case 2:case 8:i=pi;break;case 32:i=Hi;break;case 268435456:i=os;break;default:i=Hi}return s=wp.bind(null,e),i=W(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&ie(s),e.callbackPriority=2,e.callbackNode=null,2}function wp(e,t){if(rt!==0&&rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(ol()&&e.callbackNode!==i)return null;var s=Te;return s=ps(e,e===He?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(ip(e,s,t),xp(e,dt()),e.callbackNode!=null&&e.callbackNode===i?wp.bind(null,e):null)}function Sp(e,t){if(ol())return null;ip(e,t,!0)}function Pv(){n0(function(){(Ne&6)!==0?W(Ka,$v):_p()})}function Vc(){if(ri===0){var e=sa;e===0&&(e=ds,ds<<=1,(ds&261888)===0&&(ds=256)),ri=e}return ri}function Ep(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:vs(""+e)}function Ap(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function Vv(e,t,i,s,o){if(t==="submit"&&i&&i.stateNode===o){var h=Ep((o[St]||null).action),g=s.submitter;g&&(t=(t=g[St]||null)?Ep(t.formAction):g.getAttribute("formAction"),t!==null&&(h=t,g=null));var b=new ws("action","action",null,s,o);e.push({event:b,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ri!==0){var A=g?Ap(o,g):new FormData(o);dc(i,{pending:!0,data:A,method:o.method,action:h},null,A)}}else typeof h=="function"&&(b.preventDefault(),A=g?Ap(o,g):new FormData(o),dc(i,{pending:!0,data:A,method:o.method,action:h},h,A))},currentTarget:o}]})}}for(var Gc=0;Gc<Ro.length;Gc++){var Kc=Ro[Gc],Gv=Kc.toLowerCase(),Kv=Kc[0].toUpperCase()+Kc.slice(1);ln(Gv,"on"+Kv)}ln(th,"onAnimationEnd"),ln(nh,"onAnimationIteration"),ln(ih,"onAnimationStart"),ln("dblclick","onDoubleClick"),ln("focusin","onFocus"),ln("focusout","onBlur"),ln(cv,"onTransitionRun"),ln(uv,"onTransitionStart"),ln(dv,"onTransitionCancel"),ln(ah,"onTransitionEnd"),Gi("onMouseEnter",["mouseout","mouseover"]),Gi("onMouseLeave",["mouseout","mouseover"]),Gi("onPointerEnter",["pointerout","pointerover"]),Gi("onPointerLeave",["pointerout","pointerover"]),gi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gi("onBeforeInput",["compositionend","keypress","textInput","paste"]),gi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Or="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(" "),Yv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Or));
vendor: 4,088 bytes, line 9
9function jp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],o=s.event;s=s.listeners;e:{var h=void 0;if(t)for(var g=s.length-1;0<=g;g--){var b=s[g],A=b.instance,z=b.currentTarget;if(b=b.listener,A!==h&&o.isPropagationStopped())break e;h=b,o.currentTarget=z;try{h(o)}catch(H){As(H)}o.currentTarget=null,h=A}else for(g=0;g<s.length;g++){if(b=s[g],A=b.instance,z=b.currentTarget,b=b.listener,A!==h&&o.isPropagationStopped())break e;h=b,o.currentTarget=z;try{h(o)}catch(H){As(H)}o.currentTarget=null,h=A}}}}function Ae(e,t){var i=t[ro];i===void 0&&(i=t[ro]=new Set);var s=e+"__bubble";i.has(s)||(Tp(t,e,2,!1),i.add(s))}function Yc(e,t,i){var s=0;t&&(s|=4),Tp(i,e,s,t)}var dl="_reactListening"+Math.random().toString(36).slice(2);function Wc(e){if(!e[dl]){e[dl]=!0,bd.forEach(function(i){i!=="selectionchange"&&(Yv.has(i)||Yc(i,!1,e),Yc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dl]||(t[dl]=!0,Yc("selectionchange",!1,t))}}function Tp(e,t,i,s){switch(nm(t)){case 2:var o=w0;break;case 8:o=S0;break;default:o=uu}i=o.bind(null,t,i,e),o=void 0,!mo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),s?o!==void 0?e.addEventListener(t,i,{capture:!0,passive:o}):e.addEventListener(t,i,!0):o!==void 0?e.addEventListener(t,i,{passive:o}):e.addEventListener(t,i,!1)}function Jc(e,t,i,s,o){var h=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var g=s.tag;if(g===3||g===4){var b=s.stateNode.containerInfo;if(b===o)break;if(g===4)for(g=s.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===o)return;g=g.return}for(;b!==null;){if(g=$i(b),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){s=h=g;continue e}b=b.parentNode}}s=s.return}Od(function(){var z=h,H=fo(i),V=[];e:{var U=rh.get(e);if(U!==void 0){var F=ws,ae=e;switch(e){case"keypress":if(_s(i)===0)break e;case"keydown":case"keyup":F=Hy;break;case"focusin":ae="focus",F=bo;break;case"focusout":ae="blur",F=bo;break;case"beforeblur":case"afterblur":F=bo;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":F=Nd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=Cy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=Py;break;case th:case nh:case ih:F=By;break;case ah:F=Gy;break;case"scroll":case"scrollend":F=Ty;break;case"wheel":F=Yy;break;case"copy":case"cut":case"paste":F=Ny;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=zd;break;case"toggle":case"beforetoggle":F=Jy}var he=(t&4)!==0,Ie=!he&&(e==="scroll"||e==="scrollend"),O=he?U!==null?U+"Capture":null:U;he=[];for(var j=z,M;j!==null;){var $=j;if(M=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||M===null||O===null||($=Za(j,O),$!=null&&he.push(Br(j,$,M))),Ie)break;j=j.return}0<he.length&&(U=new F(U,ae,null,i,H),V.push({event:U,listeners:he}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",U&&i!==ho&&(ae=i.relatedTarget||i.fromElement)&&($i(ae)||ae[qi]))break e;if((F||U)&&(U=H.window===H?H:(U=H.ownerDocument)?U.defaultView||U.parentWindow:window,F?(ae=i.relatedTarget||i.toElement,F=z,ae=ae?$i(ae):null,ae!==null&&(Ie=d(ae),he=ae.tag,ae!==Ie||he!==5&&he!==27&&he!==6)&&(ae=null)):(F=null,ae=z),F!==ae)){if(he=Nd,$="onMouseLeave",O="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(he=zd,$="onPointerLeave",O="onPointerEnter",j="pointer"),Ie=F==null?U:Xa(F),M=ae==null?U:Xa(ae),U=new he($,j+"leave",F,i,H),U.target=Ie,U.relatedTarget=M,$=null,$i(H)===z&&(he=new he(O,j+"enter",ae,i,H),he.target=M,he.relatedTarget=Ie,$=he),Ie=$,F&&ae)t:{for(he=Wv,O=F,j=ae,M=0,$=O;$;$=he($))M++;$=0;for(var ue=j;ue;ue=he(ue))$++;for(;0<M-$;)O=he(O),M--;for(;0<$-M;)j=he(j),$--;for(;M--;){if(O===j||j!==null&&O===j.alternate){he=O;break t}O=he(O),j=he(j)}he=null}else he=null;F!==null&&Rp(V,U,F,he,!1),ae!==null&&Ie!==null&&Rp(V,Ie,ae,he,!0)}}
vendor: 5,189 bytes, lines 9-10
9e:{if(U=z?Xa(z):window,F=U.nodeName&&U.nodeName.toLowerCase(),F==="select"||F==="input"&&U.type==="file")var Be=Pd;else if(qd(U))if(Vd)Be=sv;else{Be=av;var re=iv}else F=U.nodeName,!F||F.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?z&&uo(z.elementType)&&(Be=Pd):Be=rv;if(Be&&(Be=Be(e,z))){$d(V,Be,i,H);break e}re&&re(e,U,z),e==="focusout"&&z&&U.type==="number"&&z.memoizedProps.value!=null&&co(U,"number",U.value)}switch(re=z?Xa(z):window,e){case"focusin":(qd(re)||re.contentEditable==="true")&&(Xi=re,Ao=z,lr=null);break;case"focusout":lr=Ao=Xi=null;break;case"mousedown":jo=!0;break;case"contextmenu":case"mouseup":case"dragend":jo=!1,Zd(V,i,H);break;case"selectionchange":if(ov)break;case"keydown":case"keyup":Zd(V,i,H)}var xe;if(xo)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else Qi?Id(e,i)&&(Re="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Re="onCompositionStart");Re&&(Ud&&i.locale!=="ko"&&(Qi||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&Qi&&(xe=Bd()):($n=H,go="value"in $n?$n.value:$n.textContent,Qi=!0)),re=hl(z,Re),0<re.length&&(Re=new Md(Re,e,null,i,H),V.push({event:Re,listeners:re}),xe?Re.data=xe:(xe=Hd(i),xe!==null&&(Re.data=xe)))),(xe=Xy?Zy(e,i):ev(e,i))&&(Re=hl(z,"onBeforeInput"),0<Re.length&&(re=new Md("onBeforeInput","beforeinput",null,i,H),V.push({event:re,listeners:Re}),re.data=xe)),Vv(V,e,z,i,H)}jp(V,t)})}function Br(e,t,i){return{instance:e,listener:t,currentTarget:i}}function hl(e,t){for(var i=t+"Capture",s=[];e!==null;){var o=e,h=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||h===null||(o=Za(e,i),o!=null&&s.unshift(Br(e,o,h)),o=Za(e,t),o!=null&&s.push(Br(e,o,h))),e.tag===3)return s;e=e.return}return[]}function Wv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rp(e,t,i,s,o){for(var h=t._reactName,g=[];i!==null&&i!==s;){var b=i,A=b.alternate,z=b.stateNode;if(b=b.tag,A!==null&&A===s)break;b!==5&&b!==26&&b!==27||z===null||(A=z,o?(z=Za(i,h),z!=null&&g.unshift(Br(i,z,A))):o||(z=Za(i,h),z!=null&&g.push(Br(i,z,A)))),i=i.return}g.length!==0&&e.push({event:t,listeners:g})}var Jv=/\r\n?/g,Qv=/\u0000|\uFFFD/g;function Cp(e){return(typeof e=="string"?e:""+e).replace(Jv,`
10`).replace(Qv,"")}function kp(e,t){return t=Cp(t),Cp(e)===t}function Le(e,t,i,s,o,h){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Yi(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Yi(e,""+s);break;case"className":gs(e,"class",s);break;case"tabIndex":gs(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":gs(e,i,s);break;case"style":Cd(e,s,h);break;case"data":if(t!=="object"){gs(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=vs(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(i==="formAction"?(t!=="input"&&Le(e,t,"name",o.name,o,null),Le(e,t,"formEncType",o.formEncType,o,null),Le(e,t,"formMethod",o.formMethod,o,null),Le(e,t,"formTarget",o.formTarget,o,null)):(Le(e,t,"encType",o.encType,o,null),Le(e,t,"method",o.method,o,null),Le(e,t,"target",o.target,o,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=vs(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=_n);break;case"onScroll":s!=null&&Ae("scroll",e);break;case"onScrollEnd":s!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=vs(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
10ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),ms(e,"popover",s);break;case"xlinkActuate":bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":bn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":bn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":bn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":bn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":ms(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Ay.get(i)||i,ms(e,i,s))}}function Qc(e,t,i,s,o,h){switch(i){case"style":Cd(e,s,h);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(l(61));if(i=s.__html,i!=null){if(o.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Yi(e,s):(typeof s=="number"||typeof s=="bigint")&&Yi(e,""+s);break;case"onScroll":s!=null&&Ae("scroll",e);break;case"onScrollEnd":s!=null&&Ae("scrollend",e);break;case"onClick":s!=null&&(e.onclick=_n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_d.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(o=i.endsWith("Capture"),t=i.slice(2,o?i.length-7:void 0),h=e[St]||null,h=h!=null?h[i]:null,typeof h=="function"&&e.removeEventListener(t,h,o),typeof s=="function")){typeof h!="function"&&h!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,o);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):ms(e,i,s)}}}function gt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var s=!1,o=!1,h;for(h in i)if(i.hasOwnProperty(h)){var g=i[h];if(g!=null)switch(h){case"src":s=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Le(e,t,h,g,i,null)}}o&&Le(e,t,"srcSet",i.srcSet,i,null),s&&Le(e,t,"src",i.src,i,null);return;case"input":Ae("invalid",e);var b=h=g=o=null,A=null,z=null;for(s in i)if(i.hasOwnProperty(s)){var H=i[s];if(H!=null)switch(s){case"name":o=H;break;case"type":g=H;break;case"checked":A=H;break;case"defaultChecked":z=H;break;case"value":h=H;break;case"defaultValue":b=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(l(137,t));break;default:Le(e,t,s,H,i,null)}}Ad(e,h,b,A,z,g,o,!1);return;case"select":Ae("invalid",e),s=g=h=null;for(o in i)if(i.hasOwnProperty(o)&&(b=i[o],b!=null))switch(o){case"value":h=b;break;case"defaultValue":g=b;break;case"multiple":s=b;default:Le(e,t,o,b,i,null)}t=h,i=g,e.multiple=!!s,t!=null?Ki(e,!!s,t,!1):i!=null&&Ki(e,!!s,i,!0);return;case"textarea":Ae("invalid",e),h=o=s=null;for(g in i)if(i.hasOwnProperty(g)&&(b=i[g],b!=null))switch(g){case"value":s=b;break;case"defaultValue":o=b;break;case"children":h=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(l(91));break;default:Le(e,t,g,b,i,null)}Td(e,s,o,h);return;case"option":for(A in i)i.hasOwnProperty(A)&&(s=i[A],s!=null)&&(A==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":Le(e,t,A,s,i,null));return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(s=0;s<Or.length;s++)Ae(Or[s],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in i)if(i.hasOwnProperty(z)&&(s=i[z],s!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Le(e,t,z,s,i,null)}return;default:if(uo(t)){for(H in i)i.hasOwnProperty(H)&&(s=i[H],s!==void 0&&Qc(e,t,H,s,i,void 0));return}}for(b in i)i.hasOwnProperty(b)&&(s=i[b],s!=null&&Le(e,t,b,s,i,null))}function Xv(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,h=null,g=null,b=null,A=null,z=null,H=null;for(F in i){var V=i[F];if(i.hasOwnProperty(F)&&V!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":A=V;default:s.hasOwnProperty(F)||Le(e,t,F,null,s,V)}}for(var U in s){var F=s[U];if(V=i[U],s.hasOwnProperty(U)&&(F!=null||V!=null))switch(U){case"type":h=F;break;case"name":o=F;break;case"checked":z=F;break;case"defaultChecked":H=F;break;case"value":g=F;break;case"defaultValue":b=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(137,t));break;default:F!==V&&Le(e,t,U,F,s,V)}}oo(e,g,b,A,z,H,h,o);return;case"select":F=g=b=U=null;for(h in i)if(A=i[h],i.hasOwnProperty(h)&&A!=null)switch(h){case"value":break;case"multiple":F=A;default:s.hasOwnProperty(h)||Le(e,t,h,null,s,A)}for(o in s)if(h=s[o],A=i[o],s.hasOwnProperty(o)&&(h!=null||A!=null))switch(o){case"value":U=h;break;case"defaultValue":b=h;break;case"multiple":g=h;default:h!==A&&Le(e,t,o,h,s,A)}
vendor: 4,778 bytes, line 10
10t=b,i=g,s=F,U!=null?Ki(e,!!i,U,!1):!!s!=!!i&&(t!=null?Ki(e,!!i,t,!0):Ki(e,!!i,i?[]:"",!1));return;case"textarea":F=U=null;for(b in i)if(o=i[b],i.hasOwnProperty(b)&&o!=null&&!s.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Le(e,t,b,null,s,o)}for(g in s)if(o=s[g],h=i[g],s.hasOwnProperty(g)&&(o!=null||h!=null))switch(g){case"value":U=o;break;case"defaultValue":F=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(l(91));break;default:o!==h&&Le(e,t,g,o,s,h)}jd(e,U,F);return;case"option":for(var ae in i)U=i[ae],i.hasOwnProperty(ae)&&U!=null&&!s.hasOwnProperty(ae)&&(ae==="selected"?e.selected=!1:Le(e,t,ae,null,s,U));for(A in s)U=s[A],F=i[A],s.hasOwnProperty(A)&&U!==F&&(U!=null||F!=null)&&(A==="selected"?e.selected=U&&typeof U!="function"&&typeof U!="symbol":Le(e,t,A,U,s,F));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var he in i)U=i[he],i.hasOwnProperty(he)&&U!=null&&!s.hasOwnProperty(he)&&Le(e,t,he,null,s,U);for(z in s)if(U=s[z],F=i[z],s.hasOwnProperty(z)&&U!==F&&(U!=null||F!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(l(137,t));break;default:Le(e,t,z,U,s,F)}return;default:if(uo(t)){for(var Ie in i)U=i[Ie],i.hasOwnProperty(Ie)&&U!==void 0&&!s.hasOwnProperty(Ie)&&Qc(e,t,Ie,void 0,s,U);for(H in s)U=s[H],F=i[H],!s.hasOwnProperty(H)||U===F||U===void 0&&F===void 0||Qc(e,t,H,U,s,F);return}}for(var O in i)U=i[O],i.hasOwnProperty(O)&&U!=null&&!s.hasOwnProperty(O)&&Le(e,t,O,null,s,U);for(V in s)U=s[V],F=i[V],!s.hasOwnProperty(V)||U===F||U==null&&F==null||Le(e,t,V,U,s,F)}function Op(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Zv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var o=i[s],h=o.transferSize,g=o.initiatorType,b=o.duration;if(h&&b&&Op(g)){for(g=0,b=o.responseEnd,s+=1;s<i.length;s++){var A=i[s],z=A.startTime;if(z>b)break;var H=A.transferSize,V=A.initiatorType;H&&Op(V)&&(A=A.responseEnd,g+=H*(A<b?1:(b-z)/(A-z)))}if(--s,t+=8*(h+g)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Xc=null,Zc=null;function fl(e){return e.nodeType===9?e:e.ownerDocument}function Bp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Dp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function eu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tu=null;function e0(){var e=window.event;return e&&e.type==="popstate"?e===tu?!1:(tu=e,!0):(tu=null,!1)}var Np=typeof setTimeout=="function"?setTimeout:void 0,t0=typeof clearTimeout=="function"?clearTimeout:void 0,Mp=typeof Promise=="function"?Promise:void 0,n0=typeof queueMicrotask=="function"?queueMicrotask:typeof Mp<"u"?function(e){return Mp.resolve(null).then(e).catch(i0)}:Np;function i0(e){setTimeout(function(){throw e})}function si(e){return e==="head"}function zp(e,t){var i=t,s=0;do{var o=i.nextSibling;if(e.removeChild(i),o&&o.nodeType===8)if(i=o.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(o),Aa(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")Dr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Dr(i);for(var h=i.firstChild;h;){var g=h.nextSibling,b=h.nodeName;h[Qa]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&h.rel.toLowerCase()==="stylesheet"||i.removeChild(h),h=g}}else i==="body"&&Dr(e.ownerDocument.body);i=o}while(i);Aa(t)}function Up(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function nu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":nu(i),so(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function a0(e,t,i,s){for(;
vendor: 7,053 bytes, line 10
10e.nodeType===1;){var o=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Qa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=en(e.nextSibling),e===null)break}return null}function r0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=en(e.nextSibling),e===null))return null;return e}function Fp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=en(e.nextSibling),e===null))return null;return e}function iu(e){return e.data==="$?"||e.data==="$~"}function au(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function s0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function en(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var ru=null;function Lp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return en(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function Ip(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Hp(e,t,i){switch(t=fl(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Dr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);so(e)}var tn=new Map,qp=new Set;function pl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var zn=B.d;B.d={f:l0,r:o0,D:c0,C:u0,L:d0,m:h0,X:p0,S:f0,M:m0};function l0(){var e=zn.f(),t=rl();return e||t}function o0(e){var t=Pi(e);t!==null&&t.tag===5&&t.type==="form"?rf(t):zn.r(e)}var wa=typeof document>"u"?null:document;function $p(e,t,i){var s=wa;if(s&&typeof t=="string"&&t){var o=Kt(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof i=="string"&&(o+='[crossorigin="'+i+'"]'),qp.has(o)||(qp.add(o),e={rel:e,crossOrigin:i,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),gt(t,"link",e),ot(t),s.head.appendChild(t)))}}function c0(e){zn.D(e),$p("dns-prefetch",e,null)}function u0(e,t){zn.C(e,t),$p("preconnect",e,t)}function d0(e,t,i){zn.L(e,t,i);var s=wa;if(s&&e&&t){var o='link[rel="preload"][as="'+Kt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(o+='[imagesrcset="'+Kt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(o+='[imagesizes="'+Kt(i.imageSizes)+'"]')):o+='[href="'+Kt(e)+'"]';var h=o;switch(t){case"style":h=Sa(e);break;case"script":h=Ea(e)}tn.has(h)||(e=_({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),tn.set(h,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(Nr(h))||t==="script"&&s.querySelector(Mr(h))||(t=s.createElement("link"),gt(t,"link",e),ot(t),s.head.appendChild(t)))}}function h0(e,t){zn.m(e,t);var i=wa;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Kt(s)+'"][href="'+Kt(e)+'"]',h=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ea(e)}if(!tn.has(h)&&(e=_({rel:"modulepreload",href:e},t),tn.set(h,e),i.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Mr(h)))return}s=i.createElement("link"),gt(s,"link",e),ot(s),i.head.appendChild(s)}}}function f0(e,t,i){zn.S(e,t,i);var s=wa;if(s&&e){var o=Vi(s).hoistableStyles,h=Sa(e);t=t||"default";var g=o.get(h);if(!g){var b={loading:0,preload:null};if(g=s.querySelector(Nr(h)))b.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":t},i),(i=tn.get(h))&&su(e,i);var A=g=s.createElement("link");ot(A),gt(A,"link",e),A._p=new Promise(function(z,H){A.onload=z,A.onerror=H}),A.addEventListener("load",function(){b.loading|=1}),A.addEventListener("error",function(){b.loading|=2}),b.loading|=4,ml(g,t,s)}g={type:"stylesheet",instance:g,count:1,state:b},o.set(h,g)}}}function p0(e,t){zn.X(e,t);var i=wa;if(i&&e){var s=Vi(i).hoistableScripts,o=Ea(e),h=s.get(o);h||(h=i.querySelector(Mr(o)),h||(e=_({src:e,async:!0},t),(t=tn.get(o))&&lu(e,t),h=i.createElement("script"),ot(h),gt(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(o,h))}}function m0(e,t){zn.M(e,t);var i=wa;if(i&&e){var s=Vi(i).hoistableScripts,o=Ea(e),h=s.get(o);h||(h=i.querySelector(Mr(o)),h||(e=_({src:e,async:!0,type:"module"},t),(t=tn.get(o))&&lu(e,t),h=i.createElement("script"),ot(h),gt(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(o,h))}}function Pp(e,t,i,s){var o=(o=J.current)?pl(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Sa(i.href),i=Vi(o).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Sa(i.href);var h=Vi(o).hoistableStyles,g=h.get(e);if(g||(o=o.ownerDocument||o,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,g),(h=o.querySelector(Nr(e)))&&!h._p&&(g.instance=h,g.state.loading=5),tn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},tn.set(e,i),h||g0(o,e,i,g.state))),t&&s===null)throw Error(l(528,""));return g}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?
vendor: 4,581 bytes, line 10
10(t=Ea(i),i=Vi(o).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Sa(e){return'href="'+Kt(e)+'"'}function Nr(e){return'link[rel="stylesheet"]['+e+"]"}function Vp(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function g0(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),gt(t,"link",i),ot(t),e.head.appendChild(t))}function Ea(e){return'[src="'+Kt(e)+'"]'}function Mr(e){return"script[async]"+e}function Gp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Kt(i.href)+'"]');if(s)return t.instance=s,ot(s),s;var o=_({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ot(s),gt(s,"style",o),ml(s,i.precedence,e),t.instance=s;case"stylesheet":o=Sa(i.href);var h=e.querySelector(Nr(o));if(h)return t.state.loading|=4,t.instance=h,ot(h),h;s=Vp(i),(o=tn.get(o))&&su(s,o),h=(e.ownerDocument||e).createElement("link"),ot(h);var g=h;return g._p=new Promise(function(b,A){g.onload=b,g.onerror=A}),gt(h,"link",s),t.state.loading|=4,ml(h,i.precedence,e),t.instance=h;case"script":return h=Ea(i.src),(o=e.querySelector(Mr(h)))?(t.instance=o,ot(o),o):(s=i,(o=tn.get(h))&&(s=_({},i),lu(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),ot(o),gt(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,ml(s,i.precedence,e));return t.instance}function ml(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,h=o,g=0;g<s.length;g++){var b=s[g];if(b.dataset.precedence===t)h=b;else if(h!==o)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function lu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var gl=null;function Kp(e,t,i){if(gl===null){var s=new Map,o=gl=new Map;o.set(i,s)}else o=gl,s=o.get(i),s||(s=new Map,o.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),o=0;o<i.length;o++){var h=i[o];if(!(h[Qa]||h[ht]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var g=h.getAttribute(t)||"";g=e+g;var b=s.get(g);b?b.push(h):s.set(g,[h])}}return s}function Yp(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function y0(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Wp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function v0(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var o=Sa(s.href),h=t.querySelector(Nr(o));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=yl.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=h,ot(h);return}h=t.ownerDocument||t,s=Vp(s),(o=tn.get(o))&&su(s,o),h=h.createElement("link"),ot(h);var g=h;g._p=new Promise(function(b,A){g.onload=b,g.onerror=A}),gt(h,"link",s),i.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=yl.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var ou=0;function b0(e,t){return e.stylesheets&&e.count===0&&bl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&bl(e,e.stylesheets),e.unsu
vendor: 10,526 bytes, line 10
10spend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&ou===0&&(ou=62500*Zv());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&bl(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>ou?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function yl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var vl=null;function bl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vl=new Map,t.forEach(_0,e),vl=null,yl.call(e))}function _0(e,t){if(!(t.state.loading&4)){var i=vl.get(e);if(i)var s=i.get(null);else{i=new Map,vl.set(e,i);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<o.length;h++){var g=o[h];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(i.set(g.dataset.precedence,g),s=g)}s&&i.set(null,s)}o=t.instance,g=o.getAttribute("data-precedence"),h=i.get(g)||s,h===s&&i.set(null,o),i.set(g,o),this.count++,s=yl.bind(this),o.addEventListener("load",s),o.addEventListener("error",s),h?h.parentNode.insertBefore(o,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var zr={$$typeof:L,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function x0(e,t,i,s,o,h,g,b,A){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=no(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=no(0),this.hiddenUpdates=no(null),this.identifierPrefix=s,this.onUncaughtError=o,this.onCaughtError=h,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Jp(e,t,i,s,o,h,g,b,A,z,H,V){return e=new x0(e,t,i,g,A,z,H,V,b),t=1,h===!0&&(t|=24),h=Mt(3,null,null,t),e.current=h,h.stateNode=e,t=Ho(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:s,isDehydrated:i,cache:t},Vo(h),e}function Qp(e){return e?(e=ta,e):ta}function Xp(e,t,i,s,o,h){o=Qp(o),s.context===null?s.context=o:s.pendingContext=o,s=Wn(t),s.payload={element:i},h=h===void 0?null:h,h!==null&&(s.callback=h),i=Jn(e,s,t),i!==null&&(Ct(i,e,t),pr(i,e,t))}function Zp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function cu(e,t){Zp(e,t),(e=e.alternate)&&Zp(e,t)}function em(e){if(e.tag===13||e.tag===31){var t=_i(e,67108864);t!==null&&Ct(t,e,67108864),cu(e,67108864)}}function tm(e){if(e.tag===13||e.tag===31){var t=It();t=io(t);var i=_i(e,t);i!==null&&Ct(i,e,t),cu(e,t)}}var _l=!0;function w0(e,t,i,s){var o=I.T;I.T=null;var h=B.p;try{B.p=2,uu(e,t,i,s)}finally{B.p=h,I.T=o}}function S0(e,t,i,s){var o=I.T;I.T=null;var h=B.p;try{B.p=8,uu(e,t,i,s)}finally{B.p=h,I.T=o}}function uu(e,t,i,s){if(_l){var o=du(s);if(o===null)Jc(e,t,s,xl,i),im(e,s);else if(A0(o,e,t,i,s))s.stopPropagation();else if(im(e,s),t&4&&-1<E0.indexOf(e)){for(;o!==null;){var h=Pi(o);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var g=mi(h.pendingLanes);if(g!==0){var b=h;for(b.pendingLanes|=2,b.entangledLanes|=2;g;){var A=1<<31-Dt(g);b.entanglements[1]|=A,g&=~A}vn(h),(Ne&6)===0&&(il=dt()+500,kr(0))}}break;case 31:case 13:b=_i(h,2),b!==null&&Ct(b,h,2),rl(),cu(h,2)}if(h=du(s),h===null&&Jc(e,t,s,xl,i),h===o)break;o=h}o!==null&&s.stopPropagation()}else Jc(e,t,s,null,i)}}function du(e){return e=fo(e),hu(e)}var xl=null;function hu(e){if(xl=null,e=$i(e),e!==null){var t=d(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=p(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xl=e,null}function nm(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ls()){case Ka:return 2;case pi:return 8;case Hi:case Ya:return 32;case os:return 268435456;default:return 32}default:return 32}}var fu=!1,li=null,oi=null,ci=null,Ur=new Map,Fr=new Map,ui=[],E0="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".split(" ");function im(e,t){switch(e){case"focusin":case"focusout":li=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ci=null;break;case"pointerover":case"pointerout":Ur.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fr.delete(t.pointerId)}}function Lr(e,t,i,s,o,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:h,targetContainers:[o]},t!==null&&(t=Pi(t),t!==null&&em(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function A0(e,t,i,s,o){switch(t){case"focusin":return li=Lr(li,e,t,i,s,o),!0;case"dragenter":return oi=Lr(oi,e,t,i,s,o),!0;case"mouseover":return ci=Lr(ci,e,t,i,s,o),!0;case"pointerover":var h=o.pointerId;return Ur.set(h,Lr(Ur.get(h)||null,e,t,i,s,o)),!0;case"gotpointercapture":return h=o.pointerId,Fr.set(h,Lr(Fr.get(h)||null,e,t,i,s,o)),!0}return!1}function am(e){var t=$i(e.target);if(t!==null){var i=d(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,yd(e.priority,function(){tm(i)});return}}else if(t===31){if(t=p(i),t!==null){e.blockedOn=t,yd(e.priority,function(){tm(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=du(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);ho=s,i.target.dispatchEvent(s),ho=null}else return t=Pi(i),t!==null&&em(t),e.blockedOn=i,!1;t.shift()}return!0}function rm(e,t,i){wl(e)&&i.delete(t)}function j0(){fu=!1,li!==null&&wl(li)&&(li=null),oi!==null&&wl(oi)&&(oi=null),ci!==null&&wl(ci)&&(ci=null),Ur.forEach(rm),Fr.forEach(rm)}function Sl(e,t){e.blockedOn===t&&(e.blockedOn=null,fu||(fu=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,j0)))}var El=null;function sm(e){El!==e&&(El=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){El===e&&(El=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],o=e[t+2];if(typeof s!="function"){if(hu(s||i)===null)continue;break}var h=Pi(i);h!==null&&(e.splice(t,3),t-=3,dc(h,{pending:!0,data:o,method:i.method,action:s},s,o))}}))}function Aa(e){function t(A){return Sl(A,e)}li!==null&&Sl(li,e),oi!==null&&Sl(oi,e),ci!==null&&Sl(ci,e),Ur.forEach(t),Fr.forEach(t);for(var i=0;i<ui.length;i++){var s=ui[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<ui.length&&(i=ui[0],i.blockedOn===null);)am(i),i.blockedOn===null&&ui.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var o=i[s],h=i[s+1],g=o[St]||null;if(typeof h=="function")g||sm(i);else if(g){var b=null;if(h&&h.hasAttribute("formAction")){if(o=h,g=h[St]||null)b=g.formAction;else if(hu(o)!==null)continue}else b=g.action;typeof b=="function"?i[s+1]=b:(i.splice(s,3),s-=3),sm(i)}}}function lm(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(g){return o=g})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function pu(e){this._internalRoot=e}Al.prototype.render=pu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,s=It();Xp(i,s,e,t,null,null)},Al.prototype.unmount=pu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xp(e.current,2,null,e,null,null),rl(),t[qi]=null}};function Al(e){this._internalRoot=e}Al.prototype.unstable_scheduleHydration=function(e){if(e){var t=gd();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ui.length&&t!==0&&t<ui[i].priority;i++);ui.splice(i,0,e),i===0&&am(e)}};var om=n.version;if(om!=="19.2.4")throw Error(l(527,om,"19.2.4"));B.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=y(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var T0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};
10if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jl.isDisabled&&jl.supportsFiber)try{Ot=jl.inject(T0),Bt=jl}catch{}}return Hr.createRoot=function(e,t){if(!c(e))throw Error(l(299));var i=!1,s="",o=mf,h=gf,g=yf;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Jp(e,1,!1,null,null,i,s,null,o,h,g,lm),e[qi]=t.current,Wc(e),new pu(t)},Hr.hydrateRoot=function(e,t,i){if(!c(e))throw Error(l(299));var s=!1,o="",h=mf,g=gf,b=yf,A=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError),i.formState!==void 0&&(A=i.formState)),t=Jp(e,1,!0,t,i??null,s,o,A,h,g,b,lm),t.context=Qp(null),i=t.current,s=It(),s=io(s),o=Wn(s),o.callback=null,Jn(i,o,s),i=s,t.current.lanes=i,Ja(t,i),vn(t),e[qi]=t.current,Wc(e),new Al(t)},Hr.version="19.2.4",Hr}var vm;function U0(){if(vm)return yu.exports;vm=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(n){console.error(n)}}return a(),yu.exports=z0(),yu.exports}var F0=U0();var td=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,mg=/^[\\/]{2}/;function L0(a,n){return n+a.replace(/\\/g,"/")}var bm="popstate";function _m(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function I0(a={}){function n(l,c){let d=c.state?.masked,{pathname:f,search:p,hash:m}=d||l.location;return Lu("",{pathname:f,search:p,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default",d?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function r(l,c){return typeof c=="string"?c:Yr(c)}return q0(n,r,null,a)}function Ye(a,n){if(a===!1||a===null||typeof a>"u")throw new Error(n)}function an(a,n){if(!a){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function H0(){return Math.random().toString(36).substring(2,10)}function xm(a,n){return{usr:a.state,key:a.key,idx:n,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function Lu(a,n,r=null,l,c){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof n=="string"?Fa(n):n,state:r,key:n&&n.key||l||H0(),mask:c}}function Yr({pathname:a="/",search:n="",hash:r=""}){return n&&n!=="?"&&(a+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(a+=r.charAt(0)==="#"?r:"#"+r),a}function Fa(a){let n={};if(a){let r=a.indexOf("#");r>=0&&(n.hash=a.substring(r),a=a.substring(0,r));let l=a.indexOf("?");l>=0&&(n.search=a.substring(l),a=a.substring(0,l)),a&&(n.pathname=a)}return n}function q0(a,n,r,l={}){let{window:c=document.defaultView,v5Compat:d=!1}=l,f=c.history,p="POP",m=null,y=v();y==null&&(y=0,f.replaceState({...f.state,idx:y},""));function v(){return(f.state||{idx:null}).idx}function _(){p="POP";let C=v(),D=C==null?null:C-y;y=C,m&&m({action:p,location:k.location,delta:D})}function x(C,D){p="PUSH";let q=_m(C)?C:Lu(k.location,C,D);y=v()+1;let L=xm(q,y),X=k.createHref(q.mask||q);try{f.pushState(L,"",X)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;c.location.assign(X)}d&&m&&m({action:p,location:k.location,delta:1})}function E(C,D){p="REPLACE";let q=_m(C)?C:Lu(k.location,C,D);y=v();let L=xm(q,y),X=k.createHref(q.mask||q);f.replaceState(L,"",X),d&&m&&m({action:p,location:k.location,delta:0})}function T(C){return $0(c,C)}let k={get action(){return p},get location(){return a(c,f)},listen(C){if(m)throw new Error("A history only accepts one active listener");return c.addEventListener(bm,_),m=C,()=>{c.removeEventListener(bm,_),m=null}},createHref(C){return n(c,C)},createURL:T,encodeLocation(C){let D=T(C);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:x,replace:E,go(C){return f.go(C)}};return k}function $0(a,n,r=!1){let l="http://localhost";a&&(l=a.location.origin!=="null"?a.location.origin:a.location.href),Ye(l,"No window.location.(origin|href) available to create URL");let c=typeof n=="string"?n:Yr(n);return c=c.replace(/ $/,"%20"),!r&&mg.test(c)&&(c=l+c),new URL(c,l)}function gg(a,n,r="/"){return P0(a,n,r,!1)}function P0(a,n,r,l,c){let d=typeof n=="string"?Fa(n):n,f=Fn(d.pathname||"/",r);if(f==null)return null;let p=V0(a),m=null,y=nb(f);for(let v=0;m==null&&v<p.length;++v)m=tb(p[v],y,l);return m}function V0(a){let n=yg(a);return G0(n),n}function yg(a,n=[],r=[],l="",c=!1){let d=(f,p,m=c,y)=>{let v={relativePath:y===void 0?f.path||"":y,caseSensitive:f.caseSensitive===!0,childrenIndex:
10p,route:f};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(l)&&m)return;Ye(v.relativePath.startsWith(l),`Absolute route path "${v.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(l.length)}let _=fn([l,v.relativePath]),x=r.concat(v);f.children&&f.children.length>0&&(Ye(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${_}".`),yg(f.children,n,x,_,m)),!(f.path==null&&!f.index)&&n.push({path:_,score:Z0(_,f.index),routesMeta:x.map((E,T)=>{let[k,C]=_g(E.relativePath,E.caseSensitive,T===x.length-1);return{...E,matcher:k,compiledParams:C}})})};return a.forEach((f,p)=>{if(f.path===""||!f.path?.includes("?"))d(f,p);else for(let m of vg(f.path))d(f,p,!0,m)}),n}function vg(a){let n=a.split("/");if(n.length===0)return[];let[r,...l]=n,c=r.endsWith("?"),d=r.replace(/\?$/,"");if(l.length===0)return c?[d,""]:[d];let f=vg(l.join("/")),p=[];return p.push(...f.map(m=>m===""?d:[d,m].join("/"))),c&&p.push(...f),p.map(m=>a.startsWith("/")&&m===""?"/":m)}function G0(a){a.sort((n,r)=>n.score!==r.score?r.score-n.score:eb(n.routesMeta.map(l=>l.childrenIndex),r.routesMeta.map(l=>l.childrenIndex)))}var K0=/^:[\w-]+$/,Y0=3,W0=2,J0=1,Q0=10,X0=-2,wm=a=>a==="*";function Z0(a,n){let r=a.split("/"),l=r.length;return r.some(wm)&&(l+=X0),n&&(l+=W0),r.filter(c=>!wm(c)).reduce((c,d)=>c+(K0.test(d)?Y0:d===""?J0:Q0),l)}function eb(a,n){return a.length===n.length&&a.slice(0,-1).every((l,c)=>l===n[c])?a[a.length-1]-n[n.length-1]:0}function tb(a,n,r=!1){let{routesMeta:l}=a,c={},d="/",f=[];for(let p=0;p<l.length;++p){let m=l[p],y=p===l.length-1,v=d==="/"?n:n.slice(d.length)||"/",_={path:m.relativePath,caseSensitive:m.caseSensitive,end:y},x=m.matcher&&m.compiledParams?bg(_,v,m.matcher,m.compiledParams):Il(_,v),E=m.route;if(!x&&y&&r&&!l[l.length-1].route.index&&(x=Il({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!x)return null;
10Object.assign(c,x.params),f.push({params:c,pathname:fn([d,x.pathname]),pathnameBase:rb(fn([d,x.pathnameBase])),route:E}),x.pathnameBase!=="/"&&(d=fn([d,x.pathnameBase]))}return f}function Il(a,n){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[r,l]=_g(a.path,a.caseSensitive,a.end);return bg(a,n,r,l)}function bg(a,n,r,l){let c=n.match(r);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:l.reduce((y,{paramName:v,isOptional:_},x)=>{if(v==="*"){let T=p[x]||"";f=d.slice(0,d.length-T.length).replace(/(.)\/+$/,"$1")}const E=p[x];return _&&!E?y[v]=void 0:y[v]=(E||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:f,pattern:a}}function _g(a,n=!1,r=!0){an(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let l=[],c="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,m,y,v)=>{if(l.push({paramName:p,isOptional:m!=null}),m){let _=v.charAt(y+f.length);return _&&_!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(l.push({paramName:"*"}),c+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?c+="\\/*$":a!==""&&a!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,n?void 0:"i"),l]}function nb(a){try{return a.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return an(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),a}}function Fn(a,n){if(n==="/")return a;
10if(!a.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,l=a.charAt(r);return l&&l!=="/"?null:a.slice(r)||"/"}function ib(a,n="/"){let{pathname:r,search:l="",hash:c=""}=typeof a=="string"?Fa(a):a,d;return r?(r=xg(r),r.startsWith("/")?d=Sm(r.substring(1),"/"):d=Sm(r,n)):d=n,{pathname:d,search:sb(l),hash:lb(c)}}function Sm(a,n){let r=Hl(n).split("/");return a.split("/").forEach(c=>{c===".."?r.length>1&&r.pop():c!=="."&&r.push(c)}),r.length>1?r.join("/"):"/"}function xu(a,n,r,l){return`Cannot include a '${a}' character in a manually specified \`to.${n}\` field [${JSON.stringify(l)}].  Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ab(a){return a.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function nd(a){let n=ab(a);return n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase)}function Gl(a,n,r,l=!1){let c;typeof a=="string"?c=Fa(a):(c={...a},Ye(!c.pathname||!c.pathname.includes("?"),xu("?","pathname","search",c)),Ye(!c.pathname||!c.pathname.includes("#"),xu("#","pathname","hash",c)),Ye(!c.search||!c.search.includes("#"),xu("#","search","hash",c)));let d=a===""||c.pathname==="",f=d?"/":c.pathname,p;if(f==null)p=r;else{let _=n.length-1;if(!l&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),_-=1;c.pathname=x.join("/")}p=_>=0?n[_]:"/"}let m=ib(c,p),y=f&&f!=="/"&&f.endsWith("/"),v=(d||f===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(y||v)&&(m.pathname+="/"),m}var xg=a=>a.replace(/[\\/]{2,}/g,"/"),fn=a=>xg(a.join("/")),Hl=a=>a.replace(/\/+$/,""),rb=a=>Hl(a).replace(/^\/*/,"/"),sb=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,lb=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,ob=class{constructor(a,n,r,l=!1){this.status=a,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function cb(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function ub(a){let n=a.map(r=>r.route.path).filter(Boolean);return fn(n)||"/"}var wg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Sg(a,n){let r=a;if(typeof r!="string"||!td.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let l=r,c=!1;if(wg)try{let d=new URL(window.location.href),f=mg.test(r)?new URL(L0(r,d.protocol)):new URL(r),p=Fn(f.pathname,n);f.origin===d.origin&&p!=null?r=p+f.search+f.hash:c=!0}catch{an(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:c,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Eg=["POST","PUT","PATCH","DELETE"];new Set(Eg);var db=["GET",...Eg];new Set(db);var hb=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function fb(a){try{return hb.includes(new URL(a).protocol)}catch{return!1}}var La=w.createContext(null);La.displayName="DataRouter";var Kl=w.createContext(null);Kl.displayName="DataRouterState";var Ag=w.createContext(!1);function pb(){return w.useContext(Ag)}var jg=w.createContext({isTransitioning:!1});jg.displayName="ViewTransition";var mb=w.createContext(new Map);mb.displayName="Fetchers";var gb=w.createContext(null);gb.displayName="Await";var Pt=w.createContext(null);Pt.displayName="Navigation";var is=w.createContext(null);is.displayName="Location";var pn=w.createContext({outlet:null,matches:[],isDataRoute:!1});pn.displayName="Route";var id=w.createContext(null);id.displayName="RouteError";var Tg="REACT_ROUTER_ERROR",yb="REDIRECT",vb="ROUTE_ERROR_RESPONSE";function bb(a){if(a.startsWith(`${Tg}:${yb}:{`))try{let n=JSON.parse(a.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function _b(a){if(a.startsWith(`${Tg}:${vb}:{`))try{let n=JSON.parse(a.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new ob(n.status,n.statusText,n.data)}catch{}}function xb(a,{relative:n}={}){Ye(Ia(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:l}=w.useContext(Pt),{hash:c,pathname:d,search:f}=as(a,{relative:n}),p=d;return r!=="/"&&(p=d==="/"?r:fn([r,d])),l.createHref({pathname:p,search:f,hash:c})}function Ia(){return w.useContext(is)!=null}function rn(){return Ye(Ia(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(is).location}var Rg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cg(a){w.useContext(Pt).static||w.useLayoutEffect(a)}function Ha(){let{isDataRoute:a}=w.useContext(pn);return a?Mb():wb()}function wb(){Ye(Ia(),"useNavigate() may be used only in the context of a <Router> component.");let a=w.useContext(La),{basename:n,navigator:r}=w.useContext(Pt),{matches:l}=w.useContext(pn),{pathname:c}=rn(),d=JSON.stringify(nd(l)),f=w.useRef(!1);return Cg(()=>{f.current=!0}),w.useCallback((m,y={})=>
10{if(an(f.current,Rg),!f.current)return;if(typeof m=="number"){r.go(m);return}let v=Gl(m,JSON.parse(d),c,y.relative==="path");a==null&&n!=="/"&&(v.pathname=v.pathname==="/"?n:fn([n,v.pathname])),(y.replace?r.replace:r.push)(v,y.state,y)},[n,r,d,c,a])}w.createContext(null);function Sb(){let{matches:a}=w.useContext(pn);return a[a.length-1]?.params??{}}function as(a,{relative:n}={}){let{matches:r}=w.useContext(pn),{pathname:l}=rn(),c=JSON.stringify(nd(r));return w.useMemo(()=>Gl(a,JSON.parse(c),l,n==="path"),[a,c,l,n])}function Eb(a,n){return kg(a,n)}function kg(a,n,r){Ye(Ia(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=w.useContext(Pt),{matches:c}=w.useContext(pn),d=c[c.length-1],f=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",y=d&&d.route;{let C=y&&y.path||"";Bg(p,!y||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
12Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let v=rn(),_;if(n){let C=typeof n=="string"?Fa(n):n;Ye(m==="/"||C.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${C.pathname}" was given in the \`location\` prop.`),_=C}else _=v;let x=_.pathname||"/",E=x;if(m!=="/"){let C=m.replace(/^\//,"").split("/");E="/"+x.replace(/^\//,"").split("/").slice(C.length).join("/")}let T=r&&r.state.matches.length?r.state.matches.map(C=>Object.assign(C,{route:r.manifest[C.route.id]||C.route})):gg(a,{pathname:E});an(y||T!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),an(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let k=Cb(T&&T.map(C=>Object.assign({},C,{params:Object.assign({},f,C.params),pathname:fn([m,l.encodeLocation?l.encodeLocation(C.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:fn([m,l.encodeLocation?l.encodeLocation(C.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),c,r);return n&&k?w.createElement(is.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,..._},navigationType:"POP"}},k):k}function Ab(){let a=Nb(),n=cb(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,l="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:l},d={padding:"2px 4px",backgroundColor:l},f=null;return console.error("Error handled by React Router default ErrorBoundary:",a),f=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:d},"ErrorBoundary")," or"," ",w.createElement("code",{style:d},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},n),r?w.createElement("pre",{style:c},r):null,f)}var jb=w.createElement(Ab,null),Og=class extends w.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,n){return n.location!==a.location||n.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:n.error,location:n.location,revalidation:a.revalidation||n.revalidation}}componentDidCatch(a,n){this.props.onError?this.props.onError(a,n):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=_b(a.digest);r&&(a=r)}
12let n=a!==void 0?w.createElement(pn.Provider,{value:this.props.routeContext},w.createElement(id.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?w.createElement(Tb,{error:a},n):n}};Og.contextType=Ag;var wu=new WeakMap;function Tb({children:a,error:n}){let{basename:r}=w.useContext(Pt);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let l=bb(n.digest);if(l){let c=wu.get(n);if(c)throw c;let d=Sg(l.location,r),f=d.absoluteURL||d.to;if(fb(f))throw new Error("Invalid redirect location");if(wg&&!wu.get(n))if(d.isExternal||l.reloadDocument)window.location.href=f;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:l.replace}));throw wu.set(n,p),p}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return a}function Rb({routeContext:a,match:n,children:r}){let l=w.useContext(La);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(pn.Provider,{value:a},r)}function Cb(a,n=[],r){let l=r?.state;if(a==null){if(!l)return null;if(l.errors)a=l.matches;else if(n.length===0&&!l.initialized&&l.matches.length>0)a=l.matches;else return null}let c=a,d=l?.errors;if(d!=null){let v=c.findIndex(_=>_.route.id&&d?.[_.route.id]!==void 0);Ye(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),c=c.slice(0,Math.min(c.length,v+1))}let f=!1,p=-1;if(r&&l){f=l.renderFallback;for(let v=0;v<c.length;v++){let _=c[v];if((_.route.HydrateFallback||_.route.hydrateFallbackElement)&&(p=v),_.route.id){let{loaderData:x,errors:E}=l,T=_.route.loader&&!x.hasOwnProperty(_.route.id)&&(!E||E[_.route.id]===void 0);if(_.route.lazy||T){r.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let m=r?.onError,y=l&&m?(v,_)=>{m(v,{location:l.location,params:l.matches?.[0]?.params??{},pattern:ub(l.matches),errorInfo:_})}:void 0;return c.reduceRight((v,_,x)=>{let E,T=!1,k=null,C=null;l&&(E=d&&_.route.id?d[_.route.id]:void 0,k=_.route.errorElement||jb,f&&(p<0&&x===0?(Bg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,C=null):p===x&&(T=!0,C=_.route.hydrateFallbackElement||null)));let D=n.concat(c.slice(0,x+1)),q=()=>{let L;return E?L=k:T?L=C:_.route.Component?L=w.createElement(_.route.Component,null):_.route.element?L=_.route.element:L=v,w.createElement(Rb,{match:_,routeContext:{outlet:v,matches:D,isDataRoute:l!=null},children:L})};return l&&(_.route.ErrorBoundary||_.route.errorElement||x===0)?w.createElement(Og,{location:l.location,revalidation:l.revalidation,component:k,error:E,children:q(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:y}):q()},null)}function ad(a){return`${a} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function kb(a){let n=w.useContext(La);return Ye(n,ad(a)),n}function Ob(a){let n=w.useContext(Kl);return Ye(n,ad(a)),n}function Bb(a){let n=w.useContext(pn);return Ye(n,ad(a)),n}function rd(a){let n=Bb(a),r=n.matches[n.matches.length-1];return Ye(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function Db(){return rd("useRouteId")}function Nb(){let a=w.useContext(id),n=Ob("useRouteError"),r=rd("useRouteError");return a!==void 0?a:n.errors?.[r]}function Mb(){let{router:a}=kb("useNavigate"),n=rd("useNavigate"),r=w.useRef(!1);return Cg(()=>{r.current=!0}),w.useCallback(async(c,d={})=>{an(r.current,Rg),r.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:n,...d}))},[a,n])}var Em={};function Bg(a,n,r){!n&&!Em[a]&&(Em[a]=!0,an(!1,r))}w.memo(zb);function zb({routes:a,manifest:n,future:r,state:l,isStatic:c,onError:d}){return kg(a,void 0,{manifest:n,state:l,isStatic:c,onError:d})}function Iu({to:a,replace:n,state:r,relative:l}){Ye(Ia(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=w.useContext(Pt);an(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=w.useContext(pn),{pathname:f}=rn(),p=Ha(),m=Gl(a,nd(d),f,l==="path"),y=JSON.stringify(m);return w.useEffect(()=>{p(JSON.parse(y),{replace:n,state:r,relative:l})},[p,y,l,n,r]),null}function nn(a){Ye(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ub({basename:a="/",children:n=null,location:r,navigationType:l="POP",navigator:c,static:d=!1,useTransitions:f}){Ye(!Ia(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=a.replace(/^\/*/,"/"),m=w.useMemo(()=>({basename:p,navigator:c,static:d,useTransitions:f,future:{}}),[p,c,d,f]);typeof r=="string"&&(r=Fa(r));let{pathname:y="/",search:v="",hash:_="",state:x=null,key:E="default",mask:T}=r,k=w.useMemo(()=>{let C=Fn(y,p);return C==null?null:{location:{pathname:C,search:v,hash:_,state:x,key:E,mask:T},navigationType:l}},[p,y,v,_,x,E,l,T]);
12return an(k!=null,`<Router basename="${p}"> is not able to match the URL "${y}${v}${_}" because it does not start with the basename, so the <Router> won't render anything.`),k==null?null:w.createElement(Pt.Provider,{value:m},w.createElement(is.Provider,{children:n,value:k}))}function Fb({children:a,location:n}){return Eb(Hu(a),n)}function Hu(a,n=[]){let r=[];return w.Children.forEach(a,(l,c)=>{if(!w.isValidElement(l))return;let d=[...n,c];if(l.type===w.Fragment){r.push.apply(r,Hu(l.props.children,d));return}Ye(l.type===nn,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ye(!l.props.index||!l.props.children,"An index route cannot have child routes.");let f={id:l.props.id||d.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=Hu(l.props.children,d)),r.push(f)}),r}var Ul="get",Fl="application/x-www-form-urlencoded";function Yl(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function Lb(a){return Yl(a)&&a.tagName.toLowerCase()==="button"}function Ib(a){return Yl(a)&&a.tagName.toLowerCase()==="form"}function Hb(a){return Yl(a)&&a.tagName.toLowerCase()==="input"}function qb(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function $b(a,n){return a.button===0&&(!n||n==="_self")&&!qb(a)}function qu(a=""){return new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((n,r)=>{let l=a[r];return n.concat(Array.isArray(l)?l.map(c=>[r,c]):[[r,l]])},[]))}function Pb(a,n){let r=qu(a);return n&&n.forEach((l,c)=>{r.has(c)||n.getAll(c).forEach(d=>{r.append(c,d)})}),r}var Tl=null;function Vb(){if(Tl===null)try{new FormData(document.createElement("form"),0),Tl=!1}catch{Tl=!0}return Tl}var Gb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Su(a){return a!=null&&!Gb.has(a)?(an(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Fl}"`),null):a}function Kb(a,n){let r,l,c,d,f;if(Ib(a)){let p=a.getAttribute("action");l=p?Fn(p,n):null,r=a.getAttribute("method")||Ul,c=Su(a.getAttribute("enctype"))||Fl,d=new FormData(a)}else if(Lb(a)||Hb(a)&&(a.type==="submit"||a.type==="image")){let p=a.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=a.getAttribute("formaction")||p.getAttribute("action");if(l=m?Fn(m,n):null,r=a.getAttribute("formmethod")||p.getAttribute("method")||Ul,c=Su(a.getAttribute("formenctype"))||Su(p.getAttribute("enctype"))||Fl,d=new FormData(p,a),!Vb()){let{name:y,type:v,value:_}=a;if(v==="image"){let x=y?`${y}.`:"";d.append(`${x}x`,"0"),d.append(`${x}y`,"0")}else y&&d.append(y,_)}}else{if(Yl(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ul,l=null,c=Fl,f=a}return d&&c==="text/plain"&&(f=d,d=void 0),{action:l,method:r.toLowerCase(),encType:c,formData:d,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function sd(a,n){if(a===!1||a===null||typeof a>"u")throw new Error(n)}function Dg(a,n,r,l){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${l}`:c.pathname=`${c.pathname}.${l}`:c.pathname==="/"?c.pathname=`_root.${l}`:n&&Fn(c.pathname,n)==="/"?c.pathname=`${Hl(n)}/_root.${l}`:c.pathname=`${Hl(c.pathname)}.${l}`,c}async function Yb(a,n){if(a.id in n)return n[a.id];try{let r=await import(a.module);return n[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.
12isSpaMode,window.location.reload(),new Promise(()=>{})}}function Wb(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function Jb(a,n,r){let l=await Promise.all(a.map(async c=>{let d=n.routes[c.route.id];if(d){let f=await Yb(d,r);return f.links?f.links():[]}return[]}));return e_(l.flat(1).filter(Wb).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Am(a,n,r,l,c,d){let f=(m,y)=>r[y]?m.route.id!==r[y].route.id:!0,p=(m,y)=>r[y].pathname!==m.pathname||r[y].route.path?.endsWith("*")&&r[y].params["*"]!==m.params["*"];return d==="assets"?n.filter((m,y)=>f(m,y)||p(m,y)):d==="data"?n.filter((m,y)=>{let v=l.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(f(m,y)||p(m,y))return!0;if(m.route.shouldRevalidate){let _=m.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function Qb(a,n,{includeHydrateFallback:r}={}){return Xb(a.map(l=>{let c=n.routes[l.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}
12function Xb(a){return[...new Set(a)]}function Zb(a){let n={},r=Object.keys(a).sort();for(let l of r)n[l]=a[l];return n}function e_(a,n){let r=new Set;return new Set(n),a.reduce((l,c)=>{let d=JSON.stringify(Zb(c));return r.has(d)||(r.add(d),l.push({key:d,link:c})),l},[])}function ld(){let a=w.useContext(La);return sd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function t_(){let a=w.useContext(Kl);return sd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var od=w.createContext(void 0);od.displayName="FrameworkContext";function Wl(){let a=w.useContext(od);return sd(a,"You must render this element inside a <HydratedRouter> element"),a}function n_(a,n){let r=w.useContext(od),[l,c]=w.useState(!1),[d,f]=w.useState(!1),{onFocus:p,onBlur:m,onMouseEnter:y,onMouseLeave:v,onTouchStart:_}=n,x=w.useRef(null);w.useEffect(()=>{if(a==="render"&&f(!0),a==="viewport"){let k=D=>{D.forEach(q=>{f(q.isIntersecting)})},C=new IntersectionObserver(k,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[a]),w.useEffect(()=>{if(l){let k=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(k)}}},[l]);let E=()=>{c(!0)},T=()=>{c(!1),f(!1)};return r?a!=="intent"?[d,x,{}]:[d,x,{onFocus:qr(p,E),onBlur:qr(m,T),onMouseEnter:qr(y,E),onMouseLeave:qr(v,T),onTouchStart:qr(_,E)}]:[!1,x,{}]}function qr(a,n){return r=>{a&&a(r),r.defaultPrevented||n(r)}}function i_({page:a,...n}){let r=pb(),{nonce:l}=Wl(),{router:c}=ld(),d=w.useMemo(()=>gg(c.routes,a,c.basename),[c.routes,a,c.basename]);return d?(n.nonce==null&&l&&(n={...n,nonce:l}),r?w.createElement(r_,{page:a,matches:d,...n}):w.createElement(s_,{page:a,matches:d,...n})):null}function a_(a){let{manifest:n,routeModules:r}=Wl(),[l,c]=w.useState([]);return w.useEffect(()=>{let d=!1;return Jb(a,n,r).then(f=>{d||c(f)}),()=>{d=!0}},[a,n,r]),l}function r_({page:a,matches:n,...r}){let l=rn(),{future:c}=Wl(),{basename:d}=ld(),f=w.useMemo(()=>{if(a===l.pathname+l.search+l.hash)return[];let p=Dg(a,d,c.v8_trailingSlashAwareDataRequests,"rsc"),m=!1,y=[];for(let v of n)typeof v.route.shouldRevalidate=="function"?m=!0:y.push(v.route.id);return m&&y.length>0&&p.searchParams.set("_routes",y.join(",")),[p.pathname+p.search]},[d,c.v8_trailingSlashAwareDataRequests,a,l,n]);return w.createElement(w.Fragment,null,f.map(p=>w.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...r})))}function s_({page:a,matches:n,...r}){let l=rn(),{future:c,manifest:d,routeModules:f}=Wl(),{basename:p}=ld(),{loaderData:m,matches:y}=t_(),v=w.useMemo(()=>Am(a,n,y,d,l,"data"),[a,n,y,d,l]),_=w.useMemo(()=>Am(a,n,y,d,l,"assets"),[a,n,y,d,l]),x=w.useMemo(()=>{if(a===l.pathname+l.search+l.hash)return[];let k=new Set,C=!1;if(n.forEach(q=>{let L=d.routes[q.route.id];!L||!L.hasLoader||(!v.some(X=>X.route.id===q.route.id)&&q.route.id in m&&f[q.route.id]?.shouldRevalidate||L.hasClientLoader?C=!0:k.add(q.route.id))}),k.size===0)return[];let D=Dg(a,p,c.v8_trailingSlashAwareDataRequests,"data");return C&&k.size>0&&D.searchParams.set("_routes",n.filter(q=>k.has(q.route.id)).map(q=>q.route.id).join(",")),[D.pathname+D.search]},[p,c.v8_trailingSlashAwareDataRequests,m,l,d,v,n,a,f]),E=w.useMemo(()=>Qb(_,d),[_,d]),T=a_(_);return w.createElement(w.Fragment,null,x.map(k=>w.createElement("link",{key:k,rel:"prefetch",as:"fetch",href:k,...r})),E.map(k=>w.createElement("link",{key:k,rel:"modulepreload",href:k,...r})),T.map(({key:k,link:C})=>w.createElement("link",{key:k,nonce:r.nonce,...C,crossOrigin:C.crossOrigin??r.crossOrigin})))}function l_(...a){return n=>{a.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var o_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{o_&&(window.__reactRouterVersion="7.18.2")}catch{}function c_({basename:a,children:n,useTransitions:r,window:l}){let c=w.useRef();c.current==null&&(c.current=I0({window:l,v5Compat:!0}));let d=c.current,[f,p]=w.useState({action:d.action,location:d.location}),m=w.useCallback(y=>{r===!1?p(y):w.startTransition(()=>p(y))},[r]);return w.useLayoutEffect(()=>d.listen(m),[d,m]),w.createElement(Ub,{basename:a,children:n,location:f.location,navigationType:f.action,navigator:d,useTransitions:r})}var Ng=w.forwardRef(function({onClick:n,discover:r="render",prefetch:l="none",relative:c,reloadDocument:d,replace:f,mask:p,state:m,target:y,to:v,preventScrollReset:_,viewTransition:x,defaultShouldRevalidate:E,...T},k){let{basename:C,navigator:D,useTransitions:q}=w.useContext(Pt),L=typeof v=="string"&&td.test(v),X=Sg(v,C);v=X.to;let ne=xb(v,{relative:c}
12),K=rn(),Q=null;if(p){let Se=Gl(p,[],K.mask?K.mask.pathname:"/",!0);C!=="/"&&(Se.pathname=Se.pathname==="/"?C:fn([C,Se.pathname])),Q=D.createHref(Se)}let[me,le,$e]=n_(l,T),Me=f_(v,{replace:f,mask:p,state:m,target:y,preventScrollReset:_,relative:c,viewTransition:x,defaultShouldRevalidate:E,useTransitions:q});function Pe(Se){n&&n(Se),Se.defaultPrevented||Me(Se)}let oe=!(X.isExternal||d),je=w.createElement("a",{...T,...$e,href:(oe?Q:void 0)||X.absoluteURL||ne,onClick:oe?Pe:n,ref:l_(k,le),target:y,"data-discover":!L&&r==="render"?"true":void 0});return me&&!L?w.createElement(w.Fragment,null,je,w.createElement(i_,{page:ne})):je});Ng.displayName="Link";var u_=w.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:l="",end:c=!1,style:d,to:f,viewTransition:p,children:m,...y},v){let _=as(f,{relative:y.relative}),x=rn(),E=w.useContext(Kl),{navigator:T,basename:k}=w.useContext(Pt),C=E!=null&&b_(_)&&p===!0,D=T.encodeLocation?T.encodeLocation(_).pathname:_.pathname,q=x.pathname,L=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;r||(q=q.toLowerCase(),L=L?L.toLowerCase():null,D=D.toLowerCase()),L&&k&&(L=Fn(L,k)||L);const X=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let ne=q===D||!c&&q.startsWith(D)&&q.charAt(X)==="/",K=L!=null&&(L===D||!c&&L.startsWith(D)&&L.charAt(D.length)==="/"),Q={isActive:ne,isPending:K,isTransitioning:C},me=ne?n:void 0,le;typeof l=="function"?le=l(Q):le=[l,ne?"active":null,K?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let $e=typeof d=="function"?d(Q):d;return w.createElement(Ng,{...y,"aria-current":me,className:le,ref:v,style:$e,to:f,viewTransition:p},typeof m=="function"?m(Q):m)});u_.displayName="NavLink";var d_=w.forwardRef(({discover:a="render",fetcherKey:n,navigate:r,reloadDocument:l,replace:c,state:d,method:f=Ul,action:p,onSubmit:m,relative:y,preventScrollReset:v,viewTransition:_,defaultShouldRevalidate:x,...E},T)=>{let{useTransitions:k}=w.useContext(Pt),C=y_(),D=v_(p,{relative:y}),q=f.toLowerCase()==="get"?"get":"post",L=typeof p=="string"&&td.test(p),X=ne=>{if(m&&m(ne),ne.defaultPrevented)return;ne.preventDefault();let K=ne.nativeEvent.submitter,Q=K?.getAttribute("formmethod")||f,me=()=>C(K||ne.currentTarget,{fetcherKey:n,method:Q,navigate:r,replace:c,state:d,relative:y,preventScrollReset:v,viewTransition:_,defaultShouldRevalidate:x});k&&r!==!1?w.startTransition(()=>me()):me()};return w.createElement("form",{ref:T,method:q,action:D,onSubmit:l?m:X,...E,"data-discover":!L&&a==="render"?"true":void 0})});d_.displayName="Form";function h_(a){return`${a} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mg(a){let n=w.useContext(La);return Ye(n,h_(a)),n}function f_(a,{target:n,replace:r,mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:p,defaultShouldRevalidate:m,useTransitions:y}={}){let v=Ha(),_=rn(),x=as(a,{relative:f});return w.useCallback(E=>{if($b(E,n)){E.preventDefault();let T=r!==void 0?r:Yr(_)===Yr(x),k=()=>v(a,{replace:T,mask:l,state:c,preventScrollReset:d,relative:f,viewTransition:p,defaultShouldRevalidate:m});y?w.startTransition(()=>k()):k()}},[_,v,x,r,l,c,n,a,d,f,p,m,y])}function p_(a){an(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let n=w.useRef(qu(a)),r=w.useRef(!1),l=rn(),c=w.useMemo(()=>Pb(l.search,r.current?null:n.current),[l.search]),d=Ha(),f=w.useCallback((p,m)=>{const y=qu(typeof p=="function"?p(new URLSearchParams(c)):p);r.current=!0,d("?"+y,m)},[d,c]);return[c,f]}var m_=0,g_=()=>`__${String(++m_)}__`;function y_(){let{router:a}=Mg("useSubmit"),{basename:n}=w.useContext(Pt),r=Db(),l=a.fetch,c=a.navigate;return w.useCallback(async(d,f={})=>{let{action:p,method:m,encType:y,formData:v,body:_}=Kb(d,n);if(f.navigate===!1){let x=f.fetcherKey||g_();await l(x,r,f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:v,body:_,formMethod:f.method||m,formEncType:f.encType||y,flushSync:f.flushSync})}else await c(f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:v,body:_,formMethod:f.method||m,formEncType:f.encType||y,replace:f.replace,state:f.state,fromRouteId:r,flushSync:f.flushSync,viewTransition:f.viewTransition})},[l,c,n,r])}function v_(a,{relative:n}={}){let{basename:r}=w.useContext(Pt),l=w.useContext(pn);Ye(l,"useFormAction must be used inside a RouteContext");let[c]=l.matches.slice(-1),d={...as(a||".",{relative:n})},f=rn();if(a==null){d.search=f.search;let p=new URLSearchParams(d.search),m=p.getAll("index");if(m.some(v=>v==="")){p.delete("index"),m.filter(_=>_).forEach(_=>p.append("index",_));let v=p.toString();d.search=v?`?${v}`:""}}return(!a||a===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(d.pathname=d.pathname==="/"?r:fn([r,d.pathname])),Yr(d)}function b_(a,{relative:n}={}){let r=w.useContext(jg);Ye(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=Mg("useViewTransitionState"),c=as(a,{relative:n});if(!r.isTransitioning)return!1;let d=Fn(r.currentLocation.pathname,l)||r.currentLocation.pathname,f=Fn(r.nextLocation.pathname,l)||r.nextLocation.pathname;return Il(c.pathname,f)!=null||Il(c.pathname,d)!=null}function Jl(a,n){var r={};for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&n.indexOf(l)<0&&(r[l]=a[l]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,l=Object.getOwnPropertySymbols(a);c<l.length;c++)n.indexOf(l[c])<0&&Object.prototype.propertyIsEnumerable.call(a,l[c])&&(r[l[c]]=a[l[c]]);return r}function __(a,n,r,l){function c(d){return d instanceof r?d:new r(function(f){f(d)})}return new(r||(r=Promise))(function(d,f){function p(v){try{y(l.next(v))}catch(_){f(_)}}function m(v){try{y(l.throw(v))}catch(_){f(_)}}function y(v){v.done?d(v.value):c(v.value).then(p,m)}y((l=l.apply(a,n||[])).next())})}const x_=a=>a?(...n)=>a(...n):(...n)=>fetch(...n);
12class cd extends Error{constructor(n,r="FunctionsError",l){super(n),this.name=r,this.context=l}}class w_ extends cd{constructor(n){super("Failed to send a request to the Edge Function","FunctionsFetchError",n)}}class jm extends cd{constructor(n){super("Relay Error invoking the Edge Function","FunctionsRelayError",n)}}class Tm extends cd{constructor(n){super("Edge Function returned a non-2xx status code","FunctionsHttpError",n)}}var $u;(function(a){a.Any="any",a.ApNortheast1="ap-northeast-1",a.ApNortheast2="ap-northeast-2",a.ApSouth1="ap-south-1",a.ApSoutheast1="ap-southeast-1",a.ApSoutheast2="ap-southeast-2",a.CaCentral1="ca-central-1",a.EuCentral1="eu-central-1",a.EuWest1="eu-west-1",a.EuWest2="eu-west-2",a.EuWest3="eu-west-3",a.SaEast1="sa-east-1",a.UsEast1="us-east-1",a.UsWest1="us-west-1",a.UsWest2="us-west-2"})($u||($u={}));class S_{constructor(n,{headers:r={},customFetch:l,region:c=$u.Any}={}){this.url=n,this.headers=r,this.region=c,this.fetch=x_(l)}setAuth(n){this.headers.Authorization=`Bearer ${n}`}invoke(n){return __(this,arguments,void 0,function*(r,l={}){var c;let d,f;try{const{headers:p,method:m,body:y,signal:v,timeout:_}=l;let x={},{region:E}=l;E||(E=this.region);const T=new URL(`${this.url}/${r}`);E&&E!=="any"&&(x["x-region"]=E,T.searchParams.set("forceFunctionRegion",E));let k;y&&(p&&!Object.prototype.hasOwnProperty.call(p,"Content-Type")||!p)?typeof Blob<"u"&&y instanceof Blob||y instanceof ArrayBuffer?(x["Content-Type"]="application/octet-stream",k=y):typeof y=="string"?(x["Content-Type"]="text/plain",k=y):typeof FormData<"u"&&y instanceof FormData?k=y:(x["Content-Type"]="application/json",k=JSON.stringify(y)):y&&typeof y!="string"&&!(typeof Blob<"u"&&y instanceof Blob)&&!(y instanceof ArrayBuffer)&&!(typeof FormData<"u"&&y instanceof FormData)?k=JSON.stringify(y):k=y;let C=v;_&&(f=new AbortController,d=setTimeout(()=>f.abort(),_),v?(C=f.signal,v.addEventListener("abort",()=>f.abort())):C=f.signal);const D=yield this.fetch(T.toString(),{method:m||"POST",headers:Object.assign(Object.assign(Object.assign({},x),this.headers),p),body:k,signal:C}).catch(ne=>{throw new w_(ne)}),q=D.headers.get("x-relay-error");if(q&&q==="true")throw new jm(D);if(!D.ok)throw new Tm(D);let L=((c=D.headers.get("Content-Type"))!==null&&c!==void 0?c:"text/plain").split(";")[0].trim(),X;return L==="application/json"?X=yield D.json():L==="application/octet-stream"||L==="application/pdf"?X=yield D.blob():L==="text/event-stream"?X=D:L==="multipart/form-data"?X=yield D.formData():X=yield D.text(),{data:X,error:null,response:D}}catch(p){return{data:null,error:p,response:p instanceof Tm||p instanceof jm?p.context:void 0}}finally{d&&clearTimeout(d)}})}}var E_=class extends Error{constructor(a){super(a.message),this.name="PostgrestError",this.details=a.details,this.hint=a.hint,this.co
12de=a.code}},A_=class{constructor(a){var n,r,l;this.shouldThrowOnError=!1,this.method=a.method,this.url=a.url,this.headers=new Headers(a.headers),this.schema=a.schema,this.body=a.body,this.shouldThrowOnError=(n=a.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=a.signal,this.isMaybeSingle=(r=a.isMaybeSingle)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(l=a.urlLengthLimit)!==null&&l!==void 0?l:8e3,a.fetch?this.fetch=a.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(a,n){return this.headers=new Headers(this.headers),this.headers.set(a,n),this}then(a,n){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const l=this.fetch;let c=l(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async d=>{let f=null,p=null,m=null,y=d.status,v=d.statusText;if(d.ok){var _,x;if(r.method!=="HEAD"){var E;const D=await d.text();D===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((E=r.headers.get("Accept"))===null||E===void 0)&&E.includes("application/vnd.pgrst.plan+text"))?p=D:p=JSON.parse(D))}const k=(_=r.headers.get("Prefer"))===null||_===void 0?void 0:_.match(/count=(exact|planned|estimated)/),C=(x=d.headers.get("content-range"))===null||x===void 0?void 0:x.split("/");k&&C&&C.length>1&&(m=parseInt(C[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(p)&&(p.length>1?(f={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,m=null,y=406,v="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{var T;const k=await d.text();try{f=JSON.parse(k),Array.isArray(f)&&d.status===404&&(p=[],f=null,y=200,v="OK")}catch{d.status===404&&k===""?(y=204,v="No Content"):f={message:k}}if(f&&r.isMaybeSingle&&(!(f==null||(T=f.details)===null||T===void 0)&&T.includes("0 rows"))&&(f=null,y=200,v="OK"),f&&r.shouldThrowOnError)throw new E_(f)}return{error:f,data:p,count:m,status:y,statusText:v}});return this.shouldThrowOnError||(c=c.catch(d=>{var f;let p="",m="",y="";const v=d?.cause;if(v){var _,x,E,T;const D=(_=v?.message)!==null&&_!==void 0?_:"",q=(x=v?.code)!==null&&x!==void 0?x:"";p=`${(E=d?.name)!==null&&E!==void 0?E:"FetchError"}: ${d?.message}`,p+=`
13
14Caused by: ${(T=v?.name)!==null&&T!==void 0?T:"Error"}: ${D}`,q&&(p+=` (${q})`),v?.stack&&(p+=`
15${v.stack}`)}else{var k;p=(k=d?.stack)!==null&&k!==void 0?k:""}const C=this.url.toString().length;return d?.name==="AbortError"||d?.code==="ABORT_ERR"?(y="",m="Request was aborted (timeout or manual cancellation)",C>this.urlLengthLimit&&(m+=`. Note: Your request URL is ${C} 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.`)):(v?.name==="HeadersOverflowError"||v?.code==="UND_ERR_HEADERS_OVERFLOW")&&(y="",m="HTTP headers exceeded server limits (typically 16KB)",C>this.urlLengthLimit&&(m+=`. Your request URL is ${C} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(f=d?.name)!==null&&f!==void 0?f:"FetchError"}: ${d?.message}`,details:p,hint:m,code:y},data:null,count:null,status:0,statusText:""}})),c.then(a,n)}returns(){return this}overrideTypes(){return this}},j_=class extends A_{select(a){let n=!1;const r=(a??"*").split("").map(l=>/\s/.test(l)&&!n?"":(l==='"'&&(n=!n),l)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(a,{ascending:n=!0,nullsFirst:r,foreignTable:l,referencedTable:c=l}={}){const d=c?`${c}.order`:"order",f=this.url.searchParams.get(d);return this.url.searchParams.set(d,`${f?`${f},`:""}${a}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(a,{foreignTable:n,referencedTable:r=n}={}){const l=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(l,`${a}`),this}range(a,n,{foreignTable:r,referencedTable:l=r}={}){const c=typeof l>"u"?"offset":`${l}.offset`,d=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(c,`${a}`),this.url.searchParams.set(d,`${n-a+1}`),this}abortSignal(a){return this.signal=a,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
15explain({analyze:a=!1,verbose:n=!1,settings:r=!1,buffers:l=!1,wal:c=!1,format:d="text"}={}){var f;const p=[a?"analyze":null,n?"verbose":null,r?"settings":null,l?"buffers":null,c?"wal":null].filter(Boolean).join("|"),m=(f=this.headers.get("Accept"))!==null&&f!==void 0?f:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${d}; for="${m}"; options=${p};`),d==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(a){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${a}`),this}};const Rm=new RegExp("[,()]");var Ba=class extends j_{eq(a,n){return this.url.searchParams.append(a,`eq.${n}`),this}neq(a,n){return this.url.searchParams.append(a,`neq.${n}`),this}gt(a,n){return this.url.searchParams.append(a,`gt.${n}`),this}gte(a,n){return this.url.searchParams.append(a,`gte.${n}`),this}lt(a,n){return this.url.searchParams.append(a,`lt.${n}`),this}lte(a,n){return this.url.searchParams.append(a,`lte.${n}`),this}like(a,n){return this.url.searchParams.append(a,`like.${n}`),this}likeAllOf(a,n){return this.url.searchParams.append(a,`like(all).{${n.join(",")}}`),this}likeAnyOf(a,n){return this.url.searchParams.append(a,`like(any).{${n.join(",")}}`),this}ilike(a,n){return this.url.searchParams.append(a,`ilike.${n}`),this}ilikeAllOf(a,n){return this.url.searchParams.append(a,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(a,n){return this.url.searchParams.append(a,`ilike(any).{${n.join(",")}}`),this}regexMatch(a,n){return this.url.searchParams.append(a,`match.${n}`),this}regexIMatch(a,n){return this.url.searchParams.append(a,`imatch.${n}`),this}is(a,n){return this.url.searchParams.append(a,`is.${n}`),this}isDistinct(a,n){return this.url.searchParams.append(a,`isdistinct.${n}`),this}in(a,n){const r=Array.from(new Set(n)).map(l=>typeof l=="string"&&Rm.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(a,`in.(${r})`),this}notIn(a,n){const r=Array.from(new Set(n)).map(l=>typeof l=="string"&&Rm.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(a,`not.in.(${r})`),this}contains(a,n){return typeof n=="string"?this.url.searchParams.append(a,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(a,`cs.{${n.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(n)}`),this}containedBy(a,n){return typeof n=="string"?this.url.searchParams.append(a,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(a,`cd.{${n.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(n)}`),this}rangeGt(a,n){return this.url.searchParams.append(a,`sr.${n}`),this}rangeGte(a,n){return this.url.searchParams.append(a,`nxl.${n}`),this}rangeLt(a,n){return this.url.searchParams.append(a,`sl.${n}`),this}rangeLte(a,n){return this.url.searchParams.append(a,`nxr.${n}`),this}rangeAdjacent(a,n){return this.url.searchParams.append(a,`adj.${n}`),this}overlaps(a,n){return typeof n=="string"?this.url.searchParams.append(a,`ov.${n}`):this.url.searchParams.append(a,`ov.{${n.join(",")}}`),this}textSearch(a,n,{config:r,type:l}={}){let c="";l==="plain"?c="pl":l==="phrase"?c="ph":l==="websearch"&&(c="w");const d=r===void 0?"":`(${r})`;return this.url.searchParams.append(a,`${c}fts${d}.${n}`),this}match(a){return Object.entries(a).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(a,n,r){return this.url.searchParams.append(a,`not.${n}.${r}`),this}or(a,{foreignTable:n,referencedTable:r=n}={}){const l=r?`${r}.or`:"or";return this.url.searchParams.append(l,`(${a})`),this}filter(a,n,r){return this.url.searchParams.append(a,`${n}.${r}`),this}},T_=class{constructor(a,{headers:n={},schema:r,fetch:l,urlLengthLimit:c=8e3}){this.url=a,this.headers=new Headers(n),this.schema=r,this.fetch=l,this.urlLengthLimit=c}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(a,n){const{head:r=!1,count:l}=n??{},c=r?"HEAD":"GET";let d=!1;const f=(a??"*").split("").map(y=>/\s/.test(y)&&!d?"":(y==='"'&&(d=!d),y)).join(""),{url:p,headers:m}=this.cloneRequestState();return p.searchParams.set("select",f),l&&m.append("Prefer",`count=${l}`),new Ba({method:c,url:p,headers:m,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(a,{count:n,defaultToNull:r=!0}={}){var l;const c="POST",{url:d,headers:f}=this.cloneRequestState();if(n&&f.append("Prefer",`count=${n}`),r||f.append("Prefer","missing=default"),Array.isArray(a)){const p=a.reduce((m,y)=>m.concat(Object.keys(y)),[]);if(p.length>0){const m=[...new Set(p)].map(y=>`"${y}"`);d.searchParams.set("columns",m.join(","))}}
15return new Ba({method:c,url:d,headers:f,schema:this.schema,body:a,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(a,{onConflict:n,ignoreDuplicates:r=!1,count:l,defaultToNull:c=!0}={}){var d;const f="POST",{url:p,headers:m}=this.cloneRequestState();if(m.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),n!==void 0&&p.searchParams.set("on_conflict",n),l&&m.append("Prefer",`count=${l}`),c||m.append("Prefer","missing=default"),Array.isArray(a)){const y=a.reduce((v,_)=>v.concat(Object.keys(_)),[]);if(y.length>0){const v=[...new Set(y)].map(_=>`"${_}"`);p.searchParams.set("columns",v.join(","))}}return new Ba({method:f,url:p,headers:m,schema:this.schema,body:a,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch,urlLengthLimit:this.urlLengthLimit})}update(a,{count:n}={}){var r;const l="PATCH",{url:c,headers:d}=this.cloneRequestState();return n&&d.append("Prefer",`count=${n}`),new Ba({method:l,url:c,headers:d,schema:this.schema,body:a,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:a}={}){var n;const r="DELETE",{url:l,headers:c}=this.cloneRequestState();return a&&c.append("Prefer",`count=${a}`),new Ba({method:r,url:l,headers:c,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}};function Wr(a){"@babel/helpers - typeof";return Wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Wr(a)}function R_(a,n){if(Wr(a)!="object"||!a)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var l=r.call(a,n);if(Wr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(a)}function C_(a){var n=R_(a,"string");return Wr(n)=="symbol"?n:n+""}function k_(a,n,r){return(n=C_(n))in a?Object.defineProperty(a,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[n]=r,a}function Cm(a,n){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);n&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(a,c).enumerable})),r.push.apply(r,l)}return r}function Rl(a){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Cm(Object(r),!0).forEach(function(l){k_(a,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Cm(Object(r)).forEach(function(l){Object.defineProperty(a,l,Object.getOwnPropertyDescriptor(r,l))})}return a}var O_=class zg{constructor(n,{headers:r={},schema:l,fetch:c,timeout:d,urlLengthLimit:f=8e3}={}){this.url=n,this.headers=new Headers(r),this.schemaName=l,this.urlLengthLimit=f;const p=c??globalThis.fetch;d!==void 0&&d>0?this.fetch=(m,y)=>{const v=new AbortController,_=setTimeout(()=>v.abort(),d),x=y?.signal;if(x){if(x.aborted)return clearTimeout(_),p(m,y);const E=()=>{clearTimeout(_),v.abort()};return x.addEventListener("abort",E,{once:!0}),p(m,Rl(Rl({},y),{},{signal:v.signal})).finally(()=>{clearTimeout(_),x.removeEventListener("abort",E)})}return p(m,Rl(Rl({},y),{},{signal:v.signal})).finally(()=>clearTimeout(_))}:this.fetch=p}from(n){if(!n||typeof n!="string"||n.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new T_(new URL(`${this.url}/${n}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(n){return new zg(this.url,{headers:this.headers,schema:n,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(n,r={},{head:l=!1,get:c=!1,count:d}={}){var f;let p;const m=new URL(`${this.url}/rpc/${n}`);let y;const v=E=>E!==null&&typeof E=="object"&&(!Array.isArray(E)||E.some(v)),_=l&&Object.values(r).some(v);_?(p="POST",y=r):l||c?(p=l?"HEAD":"GET",Object.entries(r).filter(([E,T])=>T!==void 0).map(([E,T])=>[E,Array.isArray(T)?`{${T.join(",")}}`:`${T}`]).forEach(([E,T])=>{m.searchParams.append(E,T)})):(p="POST",y=r);const x=new Headers(this.headers);return _?x.set("Prefer",d?`count=${d},return=minimal`:"return=minimal"):d&&x.set("Prefer",`count=${d}`),new Ba({method:p,url:m,headers:x,schema:this.schemaName,body:y,fetch:(f=this.fetch)!==null&&f!==void 0?f:fetch,urlLengthLimit:this.urlLengthLimit})}};class B_{constructor(){}static detectEnvironment(){var n;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((n=navigator.userAgent)===null||n===void 0)&&n.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 r=globalThis.process;if(r){const l=r.versions;if(l&&l.node){const c=l.node,d=parseInt(c.replace(/^v/,"").split(".")[0]);return d>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${d} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${d} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
16import ws from "ws"
17new 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 n=this.detectEnvironment();if(n.constructor)return n.constructor;let r=n.error||"WebSocket not supported in this environment.";throw n.workaround&&(r+=`
18
19Suggested solution: ${n.workaround}`),new Error(r)}static createWebSocket(n,r){const l=this.getWebSocketConstructor();return new l(n,r)}static isWebSocketSupported(){try{const n=this.detectEnvironment();return n.type==="native"||n.type==="ws"}catch{return!1}}}const D_="2.95.3",N_=`realtime-js/${D_}`,M_="1.0.0",Ug="2.0.0",km=Ug,Pu=1e4,z_=1e3,U_=100;var hi;(function(a){a[a.connecting=0]="connecting",a[a.open=1]="open",a[a.closing=2]="closing",a[a.closed=3]="closed"})(hi||(hi={}));var lt;(function(a){a.closed="closed",a.errored="errored",a.joined="joined",a.joining="joining",a.leav
19ing="leaving"})(lt||(lt={}));var hn;(function(a){a.close="phx_close",a.error="phx_error",a.join="phx_join",a.reply="phx_reply",a.leave="phx_leave",a.access_token="access_token"})(hn||(hn={}));var Vu;(function(a){a.websocket="websocket"})(Vu||(Vu={}));var zi;(function(a){a.Connecting="connecting",a.Open="open",a.Closing="closing",a.Closed="closed"})(zi||(zi={}));class F_{constructor(n){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=n??[]}encode(n,r){if(n.event===this.BROADCAST_EVENT&&!(n.payload instanceof ArrayBuffer)&&typeof n.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(n));let l=[n.join_ref,n.ref,n.topic,n.event,n.payload];return r(JSON.stringify(l))}_binaryEncodeUserBroadcastPush(n){var r;return this._isArrayBuffer((r=n.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(n):this._encodeJsonUserBroadcastPush(n)}_encodeBinaryUserBroadcastPush(n){var r,l;const c=(l=(r=n.payload)===null||r===void 0?void 0:r.payload)!==null&&l!==void 0?l:new ArrayBuffer(0);return this._encodeUserBroadcastPush(n,this.BINARY_ENCODING,c)}_encodeJsonUserBroadcastPush(n){var r,l;const c=(l=(r=n.payload)===null||r===void 0?void 0:r.payload)!==null&&l!==void 0?l:{},f=new TextEncoder().encode(JSON.stringify(c)).buffer;return this._encodeUserBroadcastPush(n,this.JSON_ENCODING,f)}_encodeUserBroadcastPush(n,r,l){var c,d;const f=n.topic,p=(c=n.ref)!==null&&c!==void 0?c:"",m=(d=n.join_ref)!==null&&d!==void 0?d:"",y=n.payload.event,v=this.allowedMetadataKeys?this._pick(n.payload,this.allowedMetadataKeys):{},_=Object.keys(v).length===0?"":JSON.stringify(v);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(f.length>255)throw new Error(`topic length ${f.length} exceeds maximum of 255`);if(y.length>255)throw new Error(`userEvent length ${y.length} exceeds maximum of 255`);if(_.length>255)throw new Error(`metadata length ${_.length} exceeds maximum of 255`);const x=this.USER_BROADCAST_PUSH_META_LENGTH+m.length+p.length+f.length+y.length+_.length,E=new ArrayBuffer(this.HEADER_LENGTH+x);let T=new DataView(E),k=0;T.setUint8(k++,this.KINDS.userBroadcastPush),T.setUint8(k++,m.length),T.setUint8(k++,p.length),T.setUint8(k++,f.length),T.setUint8(k++,y.length),T.setUint8(k++,_.length),T.setUint8(k++,r),Array.from(m,D=>T.setUint8(k++,D.charCodeAt(0))),Array.from(p,D=>T.setUint8(k++,D.charCodeAt(0))),Array.from(f,D=>T.setUint8(k++,D.charCodeAt(0))),Array.from(y,D=>T.setUint8(k++,D.charCodeAt(0))),Array.from(_,D=>T.setUint8(k++,D.charCodeAt(0)));var C=new Uint8Array(E.byteLength+l.byteLength);return C.set(new Uint8Array(E),0),C.set(new Uint8Array(l),E.byteLength),C.buffer}decode(n,r){if(this._isArrayBuffer(n)){let l=this._binaryDecode(n);return r(l)}if(typeof n=="string"){const l=JSON.parse(n),[c,d,f,p,m]=l;return r({join_ref:c,ref:d,topic:f,event:p,payload:m})}return r({})}_binaryDecode(n){const r=new DataView(n),l=r.getUint8(0),c=new TextDecoder;if(l===this.KINDS.userBroadcast)return this._decodeUserBroadcast(n,r,c)}_decodeUserBroadcast(n,r,l){const c=r.getUint8(1),d=r.getUint8(2),f=r.getUint8(3),p=r.getUint8(4);let m=this.HEADER_LENGTH+4;const y=l.decode(n.slice(m,m+c));m=m+c;const v=l.decode(n.slice(m,m+d));m=m+d;const _=l.decode(n.slice(m,m+f));m=m+f;
19const x=n.slice(m,n.byteLength),E=p===this.JSON_ENCODING?JSON.parse(l.decode(x)):x,T={type:this.BROADCAST_EVENT,event:v,payload:E};return f>0&&(T.meta=JSON.parse(_)),{join_ref:null,ref:null,topic:y,event:this.BROADCAST_EVENT,payload:T}}_isArrayBuffer(n){var r;return n instanceof ArrayBuffer||((r=n?.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(n,r){return!n||typeof n!="object"?{}:Object.fromEntries(Object.entries(n).filter(([l])=>r.includes(l)))}}class Fg{constructor(n,r){this.callback=n,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=n,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var qe;(function(a){a.abstime="abstime",a.bool="bool",a.date="date",a.daterange="daterange",a.float4="float4",a.float8="float8",a.int2="int2",a.int4="int4",a.int4range="int4range",a.int8="int8",a.int8range="int8range",a.json="json",a.jsonb="jsonb",a.money="money",a.numeric="numeric",a.oid="oid",a.reltime="reltime",a.text="text",a.time="time",a.timestamp="timestamp",a.timestamptz="timestamptz",a.timetz="timetz",a.tsrange="tsrange",a.tstzrange="tstzrange"})(qe||(qe={}));const Om=(a,n,r={})=>{var l;const c=(l=r.skipTypes)!==null&&l!==void 0?l:[];return n?Object.keys(n).reduce((d,f)=>(d[f]=L_(f,a,n,c),d),{}):{}},L_=(a,n,r,l)=>{const c=n.find(p=>p.name===a),d=c?.type,f=r[a];return d&&!l.includes(d)?Lg(d,f):Gu(f)},Lg=(a,n)=>{if(a.charAt(0)==="_"){const r=a.slice(1,a.length);return $_(n,r)}switch(a){case qe.bool:return I_(n);case qe.float4:case qe.float8:case qe.int2:case qe.int4:case qe.int8:case qe.numeric:case qe.oid:return H_(n);case qe.json:case qe.jsonb:return q_(n);case qe.timestamp:return P_(n);case qe.abstime:case qe.date:case qe.daterange:case qe.int4range:case qe.int8range:case qe.money:case qe.reltime:case qe.text:case qe.time:case qe.timestamptz:case qe.timetz:case qe.tsrange:case qe.tstzrange:return Gu(n);default:return Gu(n)}},Gu=a=>a,I_=a=>{switch(a){case"t":return!0;case"f":return!1;default:return a}},H_=a=>{if(typeof a=="string"){const n=parseFloat(a);if(!Number.isNaN(n))return n}return a},q_=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch{return a}return a},$_=(a,n)=>{if(typeof a!="string")return a;const r=a.length-1,l=a[r];if(a[0]==="{"&&l==="}"){let d;const f=a.slice(1,r);try{d=JSON.parse("["+f+"]")}catch{d=f?f.split(","):[]}return d.map(p=>Lg(n,p))}return a},P_=a=>typeof a=="string"?a.replace(" ","T"):a,Ig=a=>{const n=new URL(a);return n.protocol=n.protocol.replace(/^ws/i,"http"),n.pathname=n.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),n.pathname===""||n.pathname==="/"?n.pathname="/api/broadcast":n.pathname=n.pathname+"/api/broadcast",n.href};class Eu{constructor(n,r,l={},c=Pu){this.channel=n,this.event=r,this.payload=l,this.timeout=c,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(n){this.timeout=n,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(n){this.payload=Object.assign(Object.assign({},this.payload),n)}receive(n,r){var l;return this._hasReceived(n)&&r((l=this.receivedResp)===null||l===void 0?void 0:l.response),this.recHooks.push({status:n,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const n=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},n),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(n,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:n,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}
vendor: 5,059 bytes, line 19
19_matchReceive({status:n,response:r}){this.recHooks.filter(l=>l.status===n).forEach(l=>l.callback(r))}_hasReceived(n){return this.receivedResp&&this.receivedResp.status===n}}var Bm;(function(a){a.SYNC="sync",a.JOIN="join",a.LEAVE="leave"})(Bm||(Bm={}));class Vr{constructor(n,r){this.channel=n,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const l=r?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(l.state,{},c=>{const{onJoin:d,onLeave:f,onSync:p}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Vr.syncState(this.state,c,d,f),this.pendingDiffs.forEach(m=>{this.state=Vr.syncDiff(this.state,m,d,f)}),this.pendingDiffs=[],p()}),this.channel._on(l.diff,{},c=>{const{onJoin:d,onLeave:f,onSync:p}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(c):(this.state=Vr.syncDiff(this.state,c,d,f),p())}),this.onJoin((c,d,f)=>{this.channel._trigger("presence",{event:"join",key:c,currentPresences:d,newPresences:f})}),this.onLeave((c,d,f)=>{this.channel._trigger("presence",{event:"leave",key:c,currentPresences:d,leftPresences:f})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(n,r,l,c){const d=this.cloneDeep(n),f=this.transformState(r),p={},m={};return this.map(d,(y,v)=>{f[y]||(m[y]=v)}),this.map(f,(y,v)=>{const _=d[y];if(_){const x=v.map(C=>C.presence_ref),E=_.map(C=>C.presence_ref),T=v.filter(C=>E.indexOf(C.presence_ref)<0),k=_.filter(C=>x.indexOf(C.presence_ref)<0);T.length>0&&(p[y]=T),k.length>0&&(m[y]=k)}else p[y]=v}),this.syncDiff(d,{joins:p,leaves:m},l,c)}static syncDiff(n,r,l,c){const{joins:d,leaves:f}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return l||(l=()=>{}),c||(c=()=>{}),this.map(d,(p,m)=>{var y;const v=(y=n[p])!==null&&y!==void 0?y:[];if(n[p]=this.cloneDeep(m),v.length>0){const _=n[p].map(E=>E.presence_ref),x=v.filter(E=>_.indexOf(E.presence_ref)<0);n[p].unshift(...x)}l(p,v,m)}),this.map(f,(p,m)=>{let y=n[p];if(!y)return;const v=m.map(_=>_.presence_ref);y=y.filter(_=>v.indexOf(_.presence_ref)<0),n[p]=y,c(p,y,m),y.length===0&&delete n[p]}),n}static map(n,r){return Object.getOwnPropertyNames(n).map(l=>r(l,n[l]))}static transformState(n){return n=this.cloneDeep(n),Object.getOwnPropertyNames(n).reduce((r,l)=>{const c=n[l];return"metas"in c?r[l]=c.metas.map(d=>(d.presence_ref=d.phx_ref,delete d.phx_ref,delete d.phx_ref_prev,d)):r[l]=c,r},{})}static cloneDeep(n){return JSON.parse(JSON.stringify(n))}onJoin(n){this.caller.onJoin=n}onLeave(n){this.caller.onLeave=n}onSync(n){this.caller.onSync=n}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Dm;(function(a){a.ALL="*",a.INSERT="INSERT",a.UPDATE="UPDATE",a.DELETE="DELETE"})(Dm||(Dm={}));var Gr;(function(a){a.BROADCAST="broadcast",a.PRESENCE="presence",a.POSTGRES_CHANGES="postgres_changes",a.SYSTEM="system"})(Gr||(Gr={}));var Un;(function(a){a.SUBSCRIBED="SUBSCRIBED",a.TIMED_OUT="TIMED_OUT",a.CLOSED="CLOSED",a.CHANNEL_ERROR="CHANNEL_ERROR"})(Un||(Un={}));class Ma{constructor(n,r={config:{}},l){var c,d;if(this.topic=n,this.params=r,this.socket=l,this.bindings={},this.state=lt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=n.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new Eu(this,hn.join,this.params,this.timeout),this.rejoinTimer=new Fg(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(f=>f.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=lt.closed,this.socket._remove(this)}),this._onError(f=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,f),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",f=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,f),this.state=lt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(hn.reply,{},(f,p)=>{this._trigger(this._replyEventName(p),f)}),this.presence=new Vr(this),this.broadcastEndpointURL=Ig(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((d=(c=this.params.config)===null||c===void 0?void 0:c.broadcast)===null||d===void 0)&&d.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(n,r=this.timeout){var l,c,d;if(this.socket.isConnected()||this.socket.connect(),this.state==lt.closed){const{config:{broadcast:f,presence:p,private:m}}=this.params,y=(c=(l=this.bindings.postgres_changes)===null||l===void 0?void 0:l.map(E=>
19E.filter))!==null&&c!==void 0?c:[],v=!!this.bindings[Gr.PRESENCE]&&this.bindings[Gr.PRESENCE].length>0||((d=this.params.config.presence)===null||d===void 0?void 0:d.enabled)===!0,_={},x={broadcast:f,presence:Object.assign(Object.assign({},p),{enabled:v}),postgres_changes:y,private:m};this.socket.accessTokenValue&&(_.access_token=this.socket.accessTokenValue),this._onError(E=>n?.(Un.CHANNEL_ERROR,E)),this._onClose(()=>n?.(Un.CLOSED)),this.updateJoinPayload(Object.assign({config:x},_)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:E})=>{var T;if(this.socket._isManualToken()||this.socket.setAuth(),E===void 0){n?.(Un.SUBSCRIBED);return}else{const k=this.bindings.postgres_changes,C=(T=k?.length)!==null&&T!==void 0?T:0,D=[];for(let q=0;q<C;q++){const L=k[q],{filter:{event:X,schema:ne,table:K,filter:Q}}=L,me=E&&E[q];if(me&&me.event===X&&Ma.isFilterValueEqual(me.schema,ne)&&Ma.isFilterValueEqual(me.table,K)&&Ma.isFilterValueEqual(me.filter,Q))D.push(Object.assign(Object.assign({},L),{id:me.id}));else{this.unsubscribe(),this.state=lt.errored,n?.(Un.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=D,n&&n(Un.SUBSCRIBED);return}}).receive("error",E=>{this.state=lt.errored,n?.(Un.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(E).join(", ")||"error")))}).receive("timeout",()=>{n?.(Un.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(n,r={}){return await this.send({type:"presence",event:"track",payload:n},r.timeout||this.timeout)}async untrack(n={}){return await this.send({type:"presence",event:"untrack"},n)}on(n,r,l){return this.state===lt.joined&&n===Gr.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(n,r,l)}async httpSend(n,r,l={}){var c;if(r==null)return Promise.reject("Payload is required for httpSend()");const d={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(d.Authorization=`Bearer ${this.socket.accessTokenValue}`);const f={method:"POST",headers:d,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:r,private:this.private}]})},p=await this._fetchWithTimeout(this.broadcastEndpointURL,f,(c=l.timeout)!==null&&c!==void 0?c:this.timeout);if(p.status===202)return{success:!0};let m=p.statusText;try{const y=await p.json();m=y.error||y.message||m}catch{}return Promise.reject(new Error(m))}async send(n,r={}){var l,c;if(!this._canPush()&&n.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
19in the future. Please use httpSend() explicitly for REST delivery.");const{event:d,payload:f}=n,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:d,payload:f,private:this.private}]})};try{const y=await this._fetchWithTimeout(this.broadcastEndpointURL,m,(l=r.timeout)!==null&&l!==void 0?l:this.timeout);return await((c=y.body)===null||c===void 0?void 0:c.cancel()),y.ok?"ok":"error"}catch(y){return y.name==="AbortError"?"timed out":"error"}}else return new Promise(d=>{var f,p,m;const y=this._push(n.type,n,r.timeout||this.timeout);n.type==="broadcast"&&!(!((m=(p=(f=this.params)===null||f===void 0?void 0:f.config)===null||p===void 0?void 0:p.broadcast)===null||m===void 0)&&m.ack)&&d("ok"),y.receive("ok",()=>d("ok")),y.receive("error",()=>d("error")),y.receive("timeout",()=>d("timed out"))})}updateJoinPayload(n){this.joinPush.updatePayload(n)}unsubscribe(n=this.timeout){this.state=lt.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(hn.close,"leave",this._joinRef())};this.joinPush.destroy();let l=null;return new Promise(c=>{l=new Eu(this,hn.leave,{},n),l.receive("ok",()=>{r(),c("ok")}).receive("timeout",()=>{r(),c("timed out")}).receive("error",()=>{c("error")}),l.send(),this._canPush()||l.trigger("ok",{})}).finally(()=>{l?.destroy()})}teardown(){this.pushBuffer.forEach(n=>n.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=lt.closed,this.bindings={}}async _fetchWithTimeout(n,r,l){const c=new AbortController,d=setTimeout(()=>c.abort(),l),f=await this.socket.fetch(n,Object.assign(Object.assign({},r),{signal:c.signal}));return clearTimeout(d),f}_push(n,r,l=this.timeout){if(!this.joinedOnce)throw`tried to push '${n}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let c=new Eu(this,n,r,l);return this._canPush()?c.send():this._addToPushBuffer(c),c}_addToPushBuffer(n){if(n.startTimeout(),this.pushBuffer.push(n),this.pushBuffer.length>U_){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(n,r,l){return r}_isMember(n){return this.topic===n}_joinRef(){return this.joinPush.ref}_trigger(n,r,l){var c,d;const f=n.toLocaleLowerCase(),{close:p,error:m,leave:y,join:v}=hn;if(l&&[p,m,y,v].indexOf(f)>=0&&l!==this._joinRef())return;let x=this._onMessage(f,r,l);if(r&&!x)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(f)?(c=this.bindings.postgres_changes)===null||c===void 0||c.filter(E=>{var T,k,C;return((T=E.filter)===null||T===void 0?void 0:T.event)==="*"||((C=(k=E.filter)===null||k===void 0?void 0:k.event)===null||C===void 0?void 0:C.toLocaleLowerCase())===f}).map(E=>E.callback(x,l)):(d=this.bindings[f])===null||d===void 0||d.filter(E=>{var T,k,C,D,q,L;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in E){const X=E.id,ne=(T=E.filter)===null||T===void 0?void 0:T.event;return X&&((k=r.ids)===null||k===void 0?void 0:k.includes(X))&&(ne==="*"||ne?.toLocaleLowerCase()===((C=r.data)===null||C===void 0?void 0:C.type.toLocaleLowerCase()))}else{const X=(q=(D=E?.filter)===null||D===void 0?void 0:D.event)===null||q===void 0?void 0:q.toLocaleLowerCase();return X==="*"||X===((L=r?.event)===null||L===void 0?void 0:L.toLocaleLowerCase())}else return E.type.toLocaleLowerCase()===f}).map(E=>{if(typeof x=="object"&&"ids"in x){const T=x.data,{schema:k,table:C,commit_timestamp:D,type:q,errors:L}=T;x=Object.assign(Object.assign({},{schema:k,table:C,commit_timestamp:D,eventType:q,new:{},old:{},errors:L}),this._getPayloadRecords(T))}E.callback(x,l)})}_isClosed(){return this.state===lt.closed}_isJoined(){return this.state===lt.joined}_isJoining(){return this.state===lt.joining}_isLeaving(){return this.state===lt.leaving}_replyEventName(n){return`chan_reply_${n}`}_on(n,r,l){const c=n.toLocaleLowerCase(),d={type:c,filter:r,callback:l};return this.bindings[c]?this.bindings[c].push(d):this.bindings[c]=[d],this}_off(n,r){const l=n.toLocaleLowerCase();return this.bindings[l]&&(this.bindings[l]=this.bindings[l].filter(c=>{var d;return!(((d=c.type)===null||d===void 0?void 0:d.toLocaleLowerCase())===l&&Ma.isEqual(c.filter,r))})),this}static isEqual(n,r){if(Object.keys(n).length!==Object.keys(r).length)return!1;for(const l in n)if(n[l]!==r[l])return!1;return!0}static isFilterValueEqual(n,r){return(n??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(n){this._on(hn.close,{},n)}_onError(n){this._on(hn.error,{},r=>n(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(n=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=lt.joining,this.joinPush.resend(n))}_getPayloadRecords(n){const r={new:{},old:{}};
19return(n.type==="INSERT"||n.type==="UPDATE")&&(r.new=Om(n.columns,n.record)),(n.type==="UPDATE"||n.type==="DELETE")&&(r.old=Om(n.columns,n.old_record)),r}}const Au=()=>{},Cl={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},V_=[1e3,2e3,5e3,1e4],G_=1e4,K_=`
20  addEventListener("message", (e) => {
21    if (e.data.event === "start") {
22      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
23    }
24  });`;class Y_{constructor(n,r){var l;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Pu,this.transport=null,this.heartbeatIntervalMs=Cl.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Au,this.ref=0,this.reconnectTimer=null,this.vsn=km,this.logger=Au,this.conn=null,this.sendBuffer=[],this.serializer=new F_,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=c=>c?(...d)=>c(...d):(...d)=>fetch(...d),!(!((l=r?.params)===null||l===void 0)&&l.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${n}/${Vu.websocket}`,this.httpEndpoint=Ig(n),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=B_.createWebSocket(this.endpointURL())}catch(n){this._setConnectionState("disconnected");const r=n.message;throw r.includes("Node.js")?new Error(`${r}
25
26To use Realtime in Node.js, you need to provide a WebSocket implementation:
27
28Option 1: Use Node.js 22+ which has native WebSocket support
29Option 2: Install and provide the "ws" package:
30
31  npm install ws
32
33  import ws from "ws"
34  const client = new RealtimeClient(url, {
35    ...options,
36    transport: ws
37  })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(n,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const l=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(l),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(n?this.conn.close(n,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(n){const r=await n.unsubscribe();return r==="ok"&&this._remove(n),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const n=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),n}log(n,r,l){this.logger(n,r,l)}connectionState(){switch(this.conn&&this.conn.readyState){case hi.connecting:return zi.Connecting;case hi.open:return zi.Open;case hi.closing:return zi.Closing;default:return zi.Closed}}isConnected(){return this.connectionState()===zi.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(n,r={config:{}}){const l=`realtime:${n}`,c=this.getChannels().find(d=>d.topic===l);if(c)return c;{const d=new Ma(`realtime:${n}`,r,this);return this.channels.push(d),d}}push(n){const{topic:r,event:l,payload:c,ref:d}=n,f=()=>{this.encode(n,p=>{var m;(m=this.conn)===null||m===void 0||m.send(p)})};this.log("push",`${r} ${l} (${d})`,c),this.isConnected()?f():this.sendBuffer.push(f)}async setAuth(n=null){this._authPromise=this._performAuth(n);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var n;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(n=this.conn)===null||n===void 0||n.close(z_,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
vendor: 3,886 bytes, line 37
37heduleTimeout()},Cl.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(n){this.heartbeatCallback=n}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(n=>n()),this.sendBuffer=[])}_makeRef(){let n=this.ref+1;return n===this.ref?this.ref=0:this.ref=n,this.ref.toString()}_leaveOpenTopic(n){let r=this.channels.find(l=>l.topic===n&&(l._isJoined()||l._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${n}"`),r.unsubscribe())}_remove(n){this.channels=this.channels.filter(r=>r.topic!==n.topic)}_onConnMessage(n){this.decode(n.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply"&&r.ref&&r.ref===this.pendingHeartbeatRef){const y=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",y)}catch(v){this.log("error","error in heartbeat callback",v)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:l,event:c,payload:d,ref:f}=r,p=f?`(${f})`:"",m=d.status||"";this.log("receive",`${m} ${l} ${c} ${p}`.trim(),d),this.channels.filter(y=>y._isMember(l)).forEach(y=>y._trigger(c,d,f)),this._triggerStateCallbacks("message",r)})}_clearTimer(n){var r;n==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):n==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=n=>this._onConnError(n),this.conn.onmessage=n=>this._onConnMessage(n),this.conn.onclose=n=>this._onConnClose(n),this.conn.readyState===hi.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===hi.open||this.conn.readyState===hi.connecting)try{this.conn.close()}catch(n){this.log("error","Error closing connection",n)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(n=>n.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const n=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(n),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.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)}_onConnClose(n){var r;this._setConnectionState("disconnected"),this.log("transport","close",n),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
37heduleTimeout(),this._triggerStateCallbacks("close",n)}_onConnError(n){this._setConnectionState("disconnected"),this.log("transport",`${n}`),this._triggerChanError(),this._triggerStateCallbacks("error",n);try{this.heartbeatCallback("error")}catch(r){this.log("error","error in heartbeat callback",r)}}_triggerChanError(){this.channels.forEach(n=>n._trigger(hn.error))}_appendParams(n,r){if(Object.keys(r).length===0)return n;const l=n.match(/\?/)?"&":"?",c=new URLSearchParams(r);return`${n}${l}${c}`}_workerObjectUrl(n){let r;if(n)r=n;else{const l=new Blob([K_],{type:"application/javascript"});r=URL.createObjectURL(l)}return r}_setConnectionState(n,r=!1){this._connectionState=n,n==="connecting"?this._wasManualDisconnect=!1:n==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(n=null){let r,l=!1;if(n)r=n,l=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(c){this.log("error","Error fetching access token from callback",c),r=this.accessTokenValue}else r=this.accessTokenValue;l?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(c=>{const d={access_token:r,version:N_};r&&c.updateJoinPayload(d),c.joinedOnce&&c._isJoined()&&c._push(hn.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(n="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${n}`,r)})}_triggerStateCallbacks(n,r){try{this.stateChangeCallbacks[n].forEach(l=>{try{l(r)}catch(c){this.log("error",`error in ${n} callback`,c)}})}catch(l){this.log("error",`error triggering ${n} callbacks`,l)}}_setupReconnectionTimer(){this.reconnectTimer=new Fg(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Cl.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(n){var r,l,c,d,f,p,m,y,v,_,x,E;switch(this.transport=(r=n?.transport)!==null&&r!==void 0?r:null,this.timeout=(l=n?.timeout)!==null&&l!==void 0?l:Pu,this.heartbeatIntervalMs=(c=n?.heartbeatIntervalMs)!==null&&c!==void 0?c:Cl.HEARTBEAT_INTERVAL,this.worker=(d=n?.worker)!==null&&d!==void 0?d:!1,this.accessToken=(f=n?.accessToken)!==null&&f!==void 0?f:null,this.heartbeatCallback=(p=n?.heartbeatCallback)!==null&&p!==void 0?p:Au,this.vsn=(m=n?.vsn)!==null&&m!==void 0?m:km,n?.params&&(this.params=n.params),n?.logger&&(this.logger=n.logger),(n?.logLevel||n?.log_level)&&(this.logLevel=n.logLevel||n.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(y=n?.reconnectAfterMs)!==null&&y!==void 0?y:(T=>V_[T-1]||G_),this.vsn){case M_:this.encode=(v=n?.encode)!==null&&v!==void 0?v:((T,k)=>k(JSON.stringify(T))),this.decode=(_=n?.decode)!==null&&_!==void 0?_:((T,k)=>k(JSON.parse(T)));break;case Ug:this.encode=(x=n?.encode)!==null&&x!==void 0?x:this.serializer.encode.bind(this.serializer),this.decode=(E=n?.decode)!==null&&E!==void 0?E:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=n?.workerUrl}}}var Jr=class extends Error{constructor(a,n){super(a),this.name="IcebergError",this.status=n.status,this.icebergType=n.icebergType,this.icebergCode=n.icebergCode,this.details=n.details,this.isCommitStateUnknown=n.icebergType==="CommitStateUnknownException"||[500,502,504].includes(n.status)&&n.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function W_(a,n,r){const l=new URL(n,a);if(r)for(const[c,d]of Object.entries(r))d!==void 0&&l.searchParams.set(c,d);return l.toString()}async function J_(a){return!a||a.type==="none"?{}:a.type==="bearer"?{Authorization:`Bearer ${a.token}`}:a.type==="header"?{[a.name]:a.value}:a.type==="custom"?await a.getHeaders():{}}function Q_(a){const n=a.fetchImpl??globalThis.fetch;return{async request({method:r,path:l,query:c,body:d,headers:f}){const p=W_(a.baseUrl,l,c),m=await J_(a.auth),y=await n(p,{method:r,headers:{...d?{"Content-Type":"application/json"}:{},...m,...f},body:d?JSON.stringify(d):void 0}),v=await y.text(),_=(y.headers.get("content-type")||"").includes("application/json"),x=_&&v?JSON.parse(v):v;if(!y.ok){const E=_?x:void 0,T=E?.error;throw new Jr(T?.message??`Request failed with status ${y.status}`,{status:y.status,icebergType:T?.type,icebergCode:T?.code,details:E})}return{status:y.status,headers:y.headers,data:x}}}}function kl(a){return a.join("�")}var X_=class{constructor(a,n=""){this.client=a,this.prefix=n}async listNamespaces(a){const n=a?{parent:kl(a.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:n})).data.namespaces.map(l=>({namespace:l}))}async createNamespace(a,n){const r={namespace:a.namespace,properties:n?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(a){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${kl(a.namespace)}`})}async loadNamespaceMetadata(a){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${kl(a.namespace)}`})).data.properties}}async namespaceExists(a){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${kl(a.namespace)}`}),!0}catch(n){if(n instanceof Jr&&n.status===404)return!1;throw n}}async createNamespaceIfNotExists(a,n){try{return await this.createNamespace(a,n)}catch(r){if(r instanceof Jr&&r.status===409)return;throw r}}};function ja(a){return a.join("�")}var Z_=class{constructor(a,n="",r){this.client=a,this.prefix=n,this.accessDelegation=r}async listTables(a){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ja(a.namespace)}/tables`})).data.identifiers}async createTable(a,n){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ja(a.namespace)}/tables`,body:n,headers:r})).data.metadata}async updateTable(a,n){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ja(a.namespace)}/tables/${a.name}`,body:n});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(a,n){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ja(a.namespace)}/tables/${a.name}`,query:{purgeRequested:String(n?.purge??!1)}})}async loadTable(a){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ja(a.namespace)}/tables/${a.name}`,headers:n})).data.metadata}async tableExists(a){const n={};this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ja(a.namespace)}/tables/${a.name}`,headers:n}),!0}catch(r){if(r instanceof Jr&&r.status===404)return!1;throw r}}async createTableIfNotExists(a,n){try{return await this.createTable(a,n)}catch(r){if(r instanceof Jr&&r.status===409)return await this.loadTable({namespace:a.namespace,name:n.name});throw r}}},ex=class{constructor(a){let n="v1";a.catalogName&&(n+=`/${a.catalogName}`);const r=a.baseUrl.endsWith("/")?a.baseUrl:`${a.baseUrl}/`;this.client=Q_({baseUrl:r,auth:a.auth,fetchImpl:a.fetch}),this.accessDelegation=a.accessDelegation?.join(","),this.namespaceOps=new X_(this.client,n),this.tableOps=new Z_(this.client,n,this.accessDelegation)}async listNamespaces(a){return this.namespaceOps.listNamespaces(a)}async createNamespace(a,n){return this.namespaceOps.createNamespace(a,n)}async dropNamespace(a){await this.namespaceOps.dropNamespace(a)}async loadNamespaceMetadata(a){return this.namespaceOps.loadNamespaceMetadata(a)}async listTables(a){return this.tableOps.listTables(a)}
37async createTable(a,n){return this.tableOps.createTable(a,n)}async updateTable(a,n){return this.tableOps.updateTable(a,n)}async dropTable(a,n){await this.tableOps.dropTable(a,n)}async loadTable(a){return this.tableOps.loadTable(a)}async namespaceExists(a){return this.namespaceOps.namespaceExists(a)}async tableExists(a){return this.tableOps.tableExists(a)}async createNamespaceIfNotExists(a,n){return this.namespaceOps.createNamespaceIfNotExists(a,n)}async createTableIfNotExists(a,n){return this.tableOps.createTableIfNotExists(a,n)}},Ql=class extends Error{constructor(a,n="storage",r,l){super(a),this.__isStorageError=!0,this.namespace=n,this.name=n==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=l}};function Xl(a){return typeof a=="object"&&a!==null&&"__isStorageError"in a}var Ol=class extends Ql{constructor(a,n,r,l="storage"){super(a,l,n,r),this.name=l==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Hg=class extends Ql{constructor(a,n,r="storage"){super(a,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=n}};const tx=a=>a?(...n)=>a(...n):(...n)=>fetch(...n),nx=a=>{if(typeof a!="object"||a===null)return!1;const n=Object.getPrototypeOf(a);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in a)&&!(Symbol.iterator in a)},Ku=a=>{if(Array.isArray(a))return a.map(r=>Ku(r));if(typeof a=="function"||a!==Object(a))return a;const n={};return Object.entries(a).forEach(([r,l])=>{const c=r.replace(/([-_][a-z])/gi,d=>d.toUpperCase().replace(/[-_]/g,""));n[c]=Ku(l)}),n},ix=a=>!a||typeof a!="string"||a.length===0||a.length>100||a.trim()!==a||a.includes("/")||a.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(a);function Qr(a){"@babel/helpers - typeof";return Qr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qr(a)}function ax(a,n){if(Qr(a)!="object"||!a)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var l=r.call(a,n);if(Qr(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(a)}function rx(a){var n=ax(a,"string");return Qr(n)=="symbol"?n:n+""}function sx(a,n,r){return(n=rx(n))in a?Object.defineProperty(a,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[n]=r,a}function Nm(a,n){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);n&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(a,c).enumerable})),r.push.apply(r,l)}return r}function pe(a){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Nm(Object(r),!0).forEach(function(l){sx(a,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Nm(Object(r)).forEach(function(l){Object.defineProperty(a,l,Object.getOwnPropertyDescriptor(r,l))})}return a}const Mm=a=>{var n;return a.msg||a.message||a.error_description||(typeof a.error=="string"?a.error:(n=a.error)===null||n===void 0?void 0:n.message)||JSON.stringify(a)},lx=async(a,n,r,l)=>{if(a&&typeof a=="object"&&"status"in a&&"ok"in a&&typeof a.status=="number"&&!r?.noResolveJson){const c=a,d=c.status||500;if(typeof c.json=="function")c.json().then(f=>{const p=f?.statusCode||f?.code||d+"";n(new Ol(Mm(f),d,p,l))}).catch(()=>{if(l==="vectors"){const f=d+"";n(new Ol(c.statusText||`HTTP ${d} error`,d,f,l))}else{const f=d+"";n(new Ol(c.statusText||`HTTP ${d} error`,d,f,l))}});else{const f=d+"";n(new Ol(c.statusText||`HTTP ${d} error`,d,f,l))}}else n(new Hg(Mm(a),a,l))},ox=(a,n,r,l)=>{const c={method:a,headers:n?.headers||{}};return a==="GET"||a==="HEAD"||!l?pe(pe({},c),r):(nx(l)?(c.headers=pe({"Content-Type":"application/json"},n?.headers),c.body=JSON.stringify(l)):c.body=l,n?.duplex&&(c.duplex=n.duplex),pe(pe({},c),r))};async function $r(a,n,r,l,c,d,f){return new Promise((p,m)=>{a(r,ox(n,l,c,d)).then(y=>{if(!y.ok)throw y;if(l?.noResolveJson)return y;if(f==="vectors"){const v=y.headers.get("content-type");if(y.headers.get("content-length")==="0"||y.status===204)return{};if(!v||!v.includes("application/json"))return{}}return y.json()}).then(y=>p(y)).catch(y=>lx(y,m,l,f))})}function qg(a="storage"){return{get:async(n,r,l,c)=>$r(n,"GET",r,l,c,void 0,a),post:async(n,r,l,c,d)=>$r(n,"POST",r,c,d,l,a),put:async(n,r,l,c,d)=>$r(n,"PUT",r,c,d,l,a),head:async(n,r,l,c)=>$r(n,"HEAD",r,pe(pe({},l),{},{noResolveJson:!0}),c,void 0,a),remove:async(n,r,l,c,d)=>$r(n,"DELETE",r,c,d,l,a)}}const cx=qg("storage"),{get:Xr,post:dn,put:Yu,head:ux,remove:ud}=cx,$t=qg("vectors");var qa=class{constructor(a,n={},r,l="storage"){this.shouldThrowOnError=!1,this.url=a,this.headers=n,this.fetch=tx(r),this.namespace=l}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(a){var n=this;try{return{data:await a(),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Xl(r))return{data:null,error:r};throw r}}},dx=class{constructor(a,n){this.downloadFn=a,this.shouldThrowOnError=n}then(a,n){return this.execute().then(a,n)}async execute(){var a=this;try{return{data:(await a.downloadFn()).body,error:null}}catch(n){if(a.shouldThrowOnError)throw n;if(Xl(n))return{data:null,error:n};throw n}}};let $g;$g=Symbol.toStringTag;var hx=class{constructor(a,n){this.downloadFn=a,this.shouldThrowOnError=n,this[$g]="BlobDownloadBuilder",this.promise=null}asStream(){return new dx(this.downloadFn,this.shouldThrowOnError)}then(a,n){return this.getPromise().then(a,n)}catch(a){return this.getPromise().catch(a)}finally(a){return this.getPromise().finally(a)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var a=this;try{return{data:await(await a.downloadFn()).blob(),error:null}}catch(n){if(a.shouldThrowOnError)throw n;if(Xl(n))return{data:null,error:n};throw n}}};const fx={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},zm={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var px=class extends qa{constructor(a,n={},r,l){super(a,n,l,"storage"),this.bucketId=r}async uploadOrUpdate(a,n,r,l){var c=this;return c.handleOperation(async()=>{let d;const f=pe(pe({},zm),l);let p=pe(pe({},c.headers),a==="POST"&&{"x-upsert":String(f.upsert)});const m=f.metadata;typeof Blob<"u"&&r instanceof Blob?(d=new FormData,d.append("cacheControl",f.cacheControl),m&&d.append("metadata",c.encodeMetadata(m)),d.append("",r)):typeof FormData<"u"&&r instanceof FormData?(d=r,d.has("cacheControl")||d.append("cacheControl",f.cacheControl),m&&!d.has("metadata")&&d.append("metadata",c.encodeMetadata(m))):(d=r,p["cache-control"]=`max-age=${f.cac
37heControl}`,p["content-type"]=f.contentType,m&&(p["x-metadata"]=c.toBase64(c.encodeMetadata(m))),(typeof ReadableStream<"u"&&d instanceof ReadableStream||d&&typeof d=="object"&&"pipe"in d&&typeof d.pipe=="function")&&!f.duplex&&(f.duplex="half")),l?.headers&&(p=pe(pe({},p),l.headers));const y=c._removeEmptyFolders(n),v=c._getFinalPath(y),_=await(a=="PUT"?Yu:dn)(c.fetch,`${c.url}/object/${v}`,d,pe({headers:p},f?.duplex?{duplex:f.duplex}:{}));return{path:y,id:_.Id,fullPath:_.Key}})}async upload(a,n,r){return this.uploadOrUpdate("POST",a,n,r)}async uploadToSignedUrl(a,n,r,l){var c=this;const d=c._removeEmptyFolders(a),f=c._getFinalPath(d),p=new URL(c.url+`/object/upload/sign/${f}`);return p.searchParams.set("token",n),c.handleOperation(async()=>{let m;const y=pe({upsert:zm.upsert},l),v=pe(pe({},c.headers),{"x-upsert":String(y.upsert)});return typeof Blob<"u"&&r instanceof Blob?(m=new FormData,m.append("cacheControl",y.cacheControl),m.append("",r)):typeof FormData<"u"&&r instanceof FormData?(m=r,m.append("cacheControl",y.cacheControl)):(m=r,v["cache-control"]=`max-age=${y.cacheControl}`,v["content-type"]=y.contentType),{path:d,fullPath:(await Yu(c.fetch,p.toString(),m,{headers:v})).Key}})}async createSignedUploadUrl(a,n){var r=this;return r.handleOperation(async()=>{let l=r._getFinalPath(a);const c=pe({},r.headers);n?.upsert&&(c["x-upsert"]="true");const d=await dn(r.fetch,`${r.url}/object/upload/sign/${l}`,{},{headers:c}),f=new URL(r.url+d.url),p=f.searchParams.get("token");if(!p)throw new Ql("No token returned by API");return{signedUrl:f.toString(),path:a,token:p}})}async update(a,n,r){return this.uploadOrUpdate("PUT",a,n,r)}async move(a,n,r){var l=this;return l.handleOperation(async()=>await dn(l.fetch,`${l.url}/object/move`,{bucketId:l.bucketId,sourceKey:a,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:l.headers}))}async copy(a,n,r){var l=this;return l.handleOperation(async()=>({path:(await dn(l.fetch,`${l.url}/object/copy`,{bucketId:l.bucketId,sourceKey:a,destinationKey:n,destinationBucket:r?.destinationBucket},{headers:l.headers})).Key}))}async createSignedUrl(a,n,r){var l=this;return l.handleOperation(async()=>{let c=l._getFinalPath(a),d=await dn(l.fetch,`${l.url}/object/sign/${c}`,pe({expiresIn:n},r?.transform?{transform:r.transform}:{}),{headers:l.headers});const f=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{signedUrl:encodeURI(`${l.url}${d.signedURL}${f}`)}})}async createSignedUrls(a,n,r){var l=this;return l.handleOperation(async()=>{const c=await dn(l.fetch,`${l.url}/object/sign/${l.bucketId}`,{expiresIn:n,paths:a},{headers:l.headers}),d=r?.download?`&download=${r.download===!0?"":r.download}`:"";return c.map(f=>pe(pe({},f),{},{signedUrl:f.signedURL?encodeURI(`${l.url}${f.signedURL}${d}`):null}))})}download(a,n,r){const l=typeof n?.transform<"u"?"render/image/authenticated":"object",c=this.transformOptsToQueryString(n?.transform||{}),d=c?`?${c}`:"",f=this._getFinalPath(a),p=()=>Xr(this.fetch,`${this.url}/${l}/${f}${d}`,{headers:this.headers,noResolveJson:!0},r);return new hx(p,this.shouldThrowOnError)}async info(a){var n=this;const r=n._getFinalPath(a);return n.handleOperation(async()=>Ku(await Xr(n.fetch,`${n.url}/object/info/${r}`,{headers:n.headers})))}async exists(a){var n=this;const r=n._getFinalPath(a);try{return await ux(n.fetch,`${n.url}/object/${r}`,{headers:n.headers}),{data:!0,error:null}}catch(l){if(n.shouldThrowOnError)throw l;if(Xl(l)&&l instanceof Hg){const c=l.originalError;if([400,404].includes(c?.status))return{data:!1,error:l}}throw l}}getPublicUrl(a,n){const r=this._getFinalPath(a),l=[],c=n?.download?`download=${n.download===!0?"":n.download}`:"";c!==""&&l.push(c);const d=typeof n?.transform<"u"?"render/image":"object",f=this.transformOptsToQueryString(n?.transform||{});f!==""&&l.push(f);let p=l.join("&");return p!==""&&(p=`?${p}`),{data:{publicUrl:encodeURI(`${this.url}/${d}/public/${r}${p}`)}}}async remove(a){var n=this;return n.handleOperation(async()=>await ud(n.fetch,`${n.url}/object/${n.bucketId}`,{prefixes:a},{headers:n.headers}))}async list(a,n,r){var l=this;return l.handleOperation(async()=>{const c=pe(pe(pe({},fx),n),{},{prefix:a||""});return await dn(l.fetch,`${l.url}/object/list/${l.bucketId}`,c,{headers:l.headers},r)})}async listV2(a,n){var r=this;return r.handleOperation(async()=>{const l=pe({},a);return await dn(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,l,{headers:r.headers},n)})}encodeMetadata(a){return JSON.stringify(a)}toBase64(a){return typeof Buffer<"u"?Buffer.from(a).toString("base64"):btoa(a)}_getFinalPath(a){return`${this.bucketId}/${a.replace(/^\/+/,"")}`}_removeEmptyFolders(a){return a.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(a){const n=[];return a.width&&n.push(`width=${a.width}`),a.height&&n.push(`height=${a.height}`),a.resize&&n.push(`resize=${a.resize}`),a.format&&n.push(`format=${a.format}`),a.quality&&n.push(`quality=${a.quality}`),n.join("&")}};const mx="2.95.3",rs={"X-Client-Info":`storage-js/${mx}`};var gx=class extends qa{constructor(a,n={},r,l){const c=new URL(a);l?.useNewHostname&&/supabase\.(co|in|red)$/.test(c.hostname)&&!c.hostname.includes("storage.supabase.")&&(c.hostname=c.hostname.replace("supabase.","storage.supabase."));const d=c.href.replace(/\/$/,""),f=pe(pe({},rs),n);super(d,f,r,"storage")}async listBuckets(a){var n=this;return n.handleOperation(async()=>{const r=n.listBucketOptionsToQueryString(a);return await Xr(n.fetch,`${n.url}/bucket${r}`,{headers:n.headers})})}async getBucket(a){var n=this;return n.handleOperation(async()=>await Xr(n.fetch,`${n.url}/bucket/${a}`,{headers:n.headers}))}async createBucket(a,n={public:!1}){var r=this;return r.handleOperation(async()=>await dn(r.fetch,`${r.url}/bucket`,{id:a,name:a,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:r.headers}))}async updateBucket(a,n){var r=this;return r.handleOperation(async()=>await Yu(r.fetch,`${r.url}/bucket/${a}`,{id:a,name:a,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(a){var n=this;return n.handleOperation(async()=>await dn(n.fetch,`${n.url}/bucket/${a}
37/empty`,{},{headers:n.headers}))}async deleteBucket(a){var n=this;return n.handleOperation(async()=>await ud(n.fetch,`${n.url}/bucket/${a}`,{},{headers:n.headers}))}listBucketOptionsToQueryString(a){const n={};return a&&("limit"in a&&(n.limit=String(a.limit)),"offset"in a&&(n.offset=String(a.offset)),a.search&&(n.search=a.search),a.sortColumn&&(n.sortColumn=a.sortColumn),a.sortOrder&&(n.sortOrder=a.sortOrder)),Object.keys(n).length>0?"?"+new URLSearchParams(n).toString():""}},yx=class extends qa{constructor(a,n={},r){const l=a.replace(/\/$/,""),c=pe(pe({},rs),n);super(l,c,r,"storage")}async createBucket(a){var n=this;return n.handleOperation(async()=>await dn(n.fetch,`${n.url}/bucket`,{name:a},{headers:n.headers}))}async listBuckets(a){var n=this;return n.handleOperation(async()=>{const r=new URLSearchParams;a?.limit!==void 0&&r.set("limit",a.limit.toString()),a?.offset!==void 0&&r.set("offset",a.offset.toString()),a?.sortColumn&&r.set("sortColumn",a.sortColumn),a?.sortOrder&&r.set("sortOrder",a.sortOrder),a?.search&&r.set("search",a.search);const l=r.toString(),c=l?`${n.url}/bucket?${l}`:`${n.url}/bucket`;return await Xr(n.fetch,c,{headers:n.headers})})}async deleteBucket(a){var n=this;return n.handleOperation(async()=>await ud(n.fetch,`${n.url}/bucket/${a}`,{},{headers:n.headers}))}from(a){var n=this;if(!ix(a))throw new Ql("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 r=new ex({baseUrl:this.url,catalogName:a,auth:{type:"custom",getHeaders:async()=>n.headers},fetch:this.fetch}),l=this.shouldThrowOnError;return new Proxy(r,{get(c,d){const f=c[d];return typeof f!="function"?f:async(...p)=>{try{return{data:await f.apply(c,p),error:null}}catch(m){if(l)throw m;return{data:null,error:m}}}}})}},vx=class extends qa{constructor(a,n={},r){const l=a.replace(/\/$/,""),c=pe(pe({},rs),{},{"Content-Type":"application/json"},n);super(l,c,r,"vectors")}async createIndex(a){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/CreateIndex`,a,{headers:n.headers})||{})}async getIndex(a,n){var r=this;return r.handleOperation(async()=>await $t.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:a,indexName:n},{headers:r.headers}))}async listIndexes(a){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/ListIndexes`,a,{headers:n.headers}))}async deleteIndex(a,n){var r=this;return r.handleOperation(async()=>await $t.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:a,indexName:n},{headers:r.headers})||{})}},bx=class extends qa{constructor(a,n={},r){const l=a.replace(/\/$/,""),c=pe(pe({},rs),{},{"Content-Type":"application/json"},n);super(l,c,r,"vectors")}async putVectors(a){var n=this;if(a.vectors.length<1||a.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/PutVectors`,a,{headers:n.headers})||{})}async getVectors(a){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/GetVectors`,a,{headers:n.headers}))}async listVectors(a){var n=this;if(a.segmentCount!==void 0){if(a.segmentCount<1||a.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(a.segmentIndex!==void 0&&(a.segmentIndex<0||a.segmentIndex>=a.segmentCount))throw new Error(`segmentIndex must be between 0 and ${a.segmentCount-1}`)}return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/ListVectors`,a,{headers:n.headers}))}async queryVectors(a){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/QueryVectors`,a,{headers:n.headers}))}async deleteVectors(a){var n=this;if(a.keys.length<1||a.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/DeleteVectors`,a,{headers:n.headers})||{})}},_x=class extends qa{constructor(a,n={},r){const l=a.replace(/\/$/,""),c=pe(pe({},rs),{},{"Content-Type":"application/json"},n);super(l,c,r,"vectors")}async createBucket(a){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/CreateVectorBucket`,{vectorBucketName:a},{headers:n.headers})||{})}async getBucket(a){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/GetVectorBucket`,{vectorBucketName:a},{headers:n.headers}))}async listBuckets(a={}){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/ListVectorBuckets`,a,{headers:n.headers}))}async deleteBucket(a){var n=this;return n.handleOperation(async()=>await $t.post(n.fetch,`${n.url}/DeleteVectorBucket`,{vectorBucketName:a},{headers:n.headers})||{})}},xx=class extends _x{constructor(a,n={}){super(a,n.headers||{},n.fetch)}from(a){return new wx(this.url,this.headers,a,this.fetch)}async createBucket(a){var n=()=>super.createBucket,r=this;return n().call(r,a)}async getBucket(a){var n=()=>super.getBucket,r=this;return n().call(r,a)}async listBuckets(a={}){var n=()=>super.listBuckets,r=this;return n().call(r,a)}async deleteBucket(a){var n=()=>super.deleteBucket,r=this;return n().call(r,a)}},wx=class extends vx{constructor(a,n,r,l){super(a,n,l),this.vectorBucketName=r}async createIndex(a){var n=()=>super.createIndex,r=this;return n().call(r,pe(pe({},a),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(a={}){var n=()=>super.listIndexes,r=this;return n().call(r,pe(pe({},a),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(a){var n=()=>super.getIndex,r=this;return n().call(r,r.vectorBucketName,a)}async deleteIndex(a){var n=()=>super.deleteIndex,r=this;return n().call(r,r.vectorBucketName,a)}index(a){return new Sx(this.url,this.headers,this.vectorBucketName,a,this.fetch)}},Sx=class extends bx{constructor(a,n,r,l,c){super(a,n,c),this.vectorBucketName=r,this.indexName=l}async putVectors(a){var n=()=>super.putVectors,r=this;return n().call(r,pe(pe({},a),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(a){var n=()=>super.getVectors,r=this;return n().call(r,pe(pe({},a),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(a={}){var n=()=>super.listVectors,r=this;return n().call(r,pe(pe({},a),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(a){var n=()=>super.queryVectors,r=this;return n().call(r,pe(pe({},a),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(a){var n=()=>super.deleteVectors,r=this;return n().call(r,pe(pe({},a),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},Ex=class extends gx{constructor(a,n={},r,l){super(a,n,r,l)}from(a){return new px(this.url,this.headers,a,this.fetch)}get vectors(){return new xx(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new yx(this.url+"/iceberg",this.headers,this.fetch)}};const Pg="2.95.3",Da=30*1e3,Wu=3,ju=Wu*Da,Ax="http://localhost:9999",jx="supabase.auth.token",Tx={"X-Client-Info":`gotrue-js/${Pg}`}
37,Ju="X-Supabase-Api-Version",Vg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},Rx=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,Cx=600*1e3;class Zr extends Error{constructor(n,r,l){super(n),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=l}}function se(a){return typeof a=="object"&&a!==null&&"__isAuthError"in a}class kx extends Zr{constructor(n,r,l){super(n,r,l),this.name="AuthApiError",this.status=r,this.code=l}}function Ox(a){return se(a)&&a.name==="AuthApiError"}class Ui extends Zr{constructor(n,r){super(n),this.name="AuthUnknownError",this.originalError=r}}class Ln extends Zr{constructor(n,r,l,c){super(n,l,c),this.name=r,this.status=l}}class qt extends Ln{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Tu(a){return se(a)&&a.name==="AuthSessionMissingError"}class Ta extends Ln{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Bl extends Ln{constructor(n){super(n,"AuthInvalidCredentialsError",400,void 0)}}class Dl extends Ln{constructor(n,r=null){super(n,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function Bx(a){return se(a)&&a.name==="AuthImplicitGrantRedirectError"}class Um extends Ln{constructor(n,r=null){super(n,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Dx extends Ln{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 Qu extends Ln{constructor(n,r){super(n,"AuthRetryableFetchError",r,void 0)}}function Ru(a){return se(a)&&a.name==="AuthRetryableFetchError"}class Fm extends Ln{constructor(n,r,l){super(n,"AuthWeakPasswordError",r,"weak_password"),this.reasons=l}}class Xu extends Ln{constructor(n){super(n,"AuthInvalidJwtError",400,"invalid_jwt")}}const ql="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Lm=` 	
38\r=`.split(""),Nx=(()=>{const a=new Array(128);for(let n=0;n<a.length;n+=1)a[n]=-1;for(let n=0;n<Lm.length;n+=1)a[Lm[n].charCodeAt(0)]=-2;for(let n=0;n<ql.length;n+=1)a[ql[n].charCodeAt(0)]=n;return a})();function Im(a,n,r){if(a!==null)for(n.queue=n.queue<<8|a,n.queuedBits+=8;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;r(ql[l]),n.queuedBits-=6}else if(n.queuedBits>0)for(n.queue=n.queue<<6-n.queuedBits,n.queuedBits=6;n.queuedBits>=6;){const l=n.queue>>n.queuedBits-6&63;r(ql[l]),n.queuedBits-=6}}function Gg(a,n,r){const l=Nx[a];if(l>-1)for(n.queue=n.queue<<6|l,n.queuedBits+=6;n.queuedBits>=8;)r(n.queue>>n.queuedBits-8&255),n.queuedBits-=8;else{if(l===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(a)}"`)}}function Hm(a){const n=[],r=f=>{n.push(String.fromCodePoint(f))},l={utf8seq:0,codepoint:0},c={queue:0,queuedBits:0},d=f=>{Ux(f,l,r)};for(let f=0;f<a.length;f+=1)Gg(a.charCodeAt(f),c,d);return n.join("")}function Mx(a,n){if(a<=127){n(a);return}else if(a<=2047){n(192|a>>6),n(128|a&63);return}else if(a<=65535){n(224|a>>12),n(128|a>>6&63),n(128|a&63);return}else if(a<=1114111){n(240|a>>18),n(128|a>>12&63),n(128|a>>6&63),n(128|a&63);return}throw new Error(`Unrecognized Unicode codepoint: ${a.toString(16)}`)}function zx(a,n){for(let r=0;r<a.length;r+=1){let l=a.charCodeAt(r);if(l>55295&&l<=56319){const c=(l-55296)*1024&65535;l=(a.charCodeAt(r+1)-56320&65535|c)+65536,r+=1}Mx(l,n)}}function Ux(a,n,r){if(n.utf8seq===0){if(a<=127){r(a);return}for(let l=1;l<6;l+=1)if((a>>7-l&1)===0){n.utf8seq=l;break}if(n.utf8seq===2)n.codepoint=a&31;else if(n.utf8seq===3)n.codepoint=a&15;else if(n.utf8seq===4)n.codepoint=a&7;else throw new Error("Invalid UTF-8 sequence");n.utf8seq-=1}else if(n.utf8seq>0){if(a<=127)throw new Error("Invalid UTF-8 sequence");n.codepoint=n.codepoint<<6|a&63,n.utf8seq-=1,n.utf8seq===0&&r(n.codepoint)}}function za(a){const n=[],r={queue:0,queuedBits:0},l=c=>{n.push(c)};for(let c=0;c<a.length;
38c+=1)Gg(a.charCodeAt(c),r,l);return new Uint8Array(n)}function Fx(a){const n=[];return zx(a,r=>n.push(r)),new Uint8Array(n)}function Fi(a){const n=[],r={queue:0,queuedBits:0},l=c=>{n.push(c)};return a.forEach(c=>Im(c,r,l)),Im(null,r,l),n.join("")}function Lx(a){return Math.round(Date.now()/1e3)+a}function Ix(){return Symbol("auth-callback")}const vt=()=>typeof window<"u"&&typeof document<"u",Di={tested:!1,writable:!1},Kg=()=>{if(!vt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Di.tested)return Di.writable;const a=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(a,a),globalThis.localStorage.removeItem(a),Di.tested=!0,Di.writable=!0}catch{Di.tested=!0,Di.writable=!1}return Di.writable};function Hx(a){const n={},r=new URL(a);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((c,d)=>{n[d]=c})}catch{}return r.searchParams.forEach((l,c)=>{n[c]=l}),n}const Yg=a=>a?(...n)=>a(...n):(...n)=>fetch(...n),qx=a=>typeof a=="object"&&a!==null&&"status"in a&&"ok"in a&&"json"in a&&typeof a.json=="function",Na=async(a,n,r)=>{await a.setItem(n,JSON.stringify(r))},Ni=async(a,n)=>{const r=await a.getItem(n);if(!r)return null;try{return JSON.parse(r)}catch{return r}},yt=async(a,n)=>{await a.removeItem(n)};class Zl{constructor(){this.promise=new Zl.promiseConstructor((n,r)=>{this.resolve=n,this.reject=r})}}Zl.promiseConstructor=Promise;function Nl(a){const n=a.split(".");if(n.length!==3)throw new Xu("Invalid JWT structure");for(let l=0;l<n.length;l++)if(!Rx.test(n[l]))throw new Xu("JWT not in base64url format");return{header:JSON.parse(Hm(n[0])),payload:JSON.parse(Hm(n[1])),signature:za(n[2]),raw:{header:n[0],payload:n[1]}}}async function $x(a){return await new Promise(n=>{setTimeout(()=>n(null),a)})}function Px(a,n){return new Promise((l,c)=>{(async()=>{for(let d=0;d<1/0;d++)try{const f=await a(d);if(!n(d,null,f)){l(f);return}}catch(f){if(!n(d,f)){c(f);return}}})()})}function Vx(a){return("0"+a.toString(16)).substr(-2)}function Gx(){const n=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",l=r.length;let c="";for(let d=0;d<56;d++)c+=r.charAt(Math.floor(Math.random()*l));return c}return crypto.getRandomValues(n),Array.from(n,Vx).join("")}async function Kx(a){const r=new TextEncoder().encode(a),l=await crypto.subtle.digest("SHA-256",r),c=new Uint8Array(l);return Array.from(c).map(d=>String.fromCharCode(d)).join("")}
38async function Yx(a){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."),a;const r=await Kx(a);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ra(a,n,r=!1){const l=Gx();let c=l;r&&(c+="/PASSWORD_RECOVERY"),await Na(a,`${n}-code-verifier`,c);const d=await Yx(l);return[d,l===d?"plain":"s256"]}const Wx=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Jx(a){const n=a.headers.get(Ju);if(!n||!n.match(Wx))return null;try{return new Date(`${n}T00:00:00.0Z`)}catch{return null}}function Qx(a){if(!a)throw new Error("Missing exp claim");const n=Math.floor(Date.now()/1e3);if(a<=n)throw new Error("JWT has expired")}function Xx(a){switch(a){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 Zx=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ca(a){if(!Zx.test(a))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Cu(){const a={};return new Proxy(a,{get:(n,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const l=r.toString();if(l==="Symbol(Symbol.toPrimitive)"||l==="Symbol(Symbol.toStringTag)"||l==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(n,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(n,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function e1(a,n){return new Proxy(a,{get:(r,l,c)=>{if(l==="__isInsecureUserWarningProxy")return!0;if(typeof l=="symbol"){const d=l.toString();if(d==="Symbol(Symbol.toPrimitive)"||d==="Symbol(Symbol.toStringTag)"||d==="Symbol(util.inspect.custom)"||d==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,l,c)}return!n.value&&typeof l=="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."),n.value=!0),Reflect.get(r,l,c)}})}function qm(a){return JSON.parse(JSON.stringify(a))}const Mi=a=>a.msg||a.message||a.error_description||a.error||JSON.stringify(a),t1=[502,503,504];async function $m(a){var n;if(!qx(a))throw new Qu(Mi(a),0);if(t1.includes(a.status))throw new Qu(Mi(a),a.status);let r;try{r=await a.json()}catch(d){throw new Ui(Mi(d),d)}let l;const c=Jx(a);if(c&&c.getTime()>=Vg["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?l=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(l=r.error_code),l){if(l==="weak_password")throw new Fm(Mi(r),a.status,((n=r.weak_password)===null||n===void 0?void 0:n.reasons)||[]);if(l==="session_not_found")throw new qt}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((d,f)=>d&&typeof f=="string",!0))throw new Fm(Mi(r),a.status,r.weak_password.reasons);throw new kx(Mi(r),a.status||500,l)}const n1=(a,n,r,l)=>{const c={method:a,headers:n?.headers||{}};return a==="GET"?c:(c.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},n?.headers),c.body=JSON.stringify(l),Object.assign(Object.assign({},c),r))};async function fe(a,n,r,l){var c;const d=Object.assign({},l?.headers);d[Ju]||(d[Ju]=Vg["2024-01-01"].name),l?.jwt&&(d.Authorization=`Bearer ${l.jwt}`);const f=(c=l?.query)!==null&&c!==void 0?c:{};l?.redirectTo&&(f.redirect_to=l.redirectTo);const p=Object.keys(f).length?"?"+new URLSearchParams(f).toString():"",m=await i1(a,n,r+p,{headers:d,noResolveJson:l?.
vendor: 4,358 bytes, line 38
38noResolveJson},{},l?.body);return l?.xform?l?.xform(m):{data:Object.assign({},m),error:null}}async function i1(a,n,r,l,c,d){const f=n1(n,l,c,d);let p;try{p=await a(r,Object.assign({},f))}catch(m){throw console.error(m),new Qu(Mi(m),0)}if(p.ok||await $m(p),l?.noResolveJson)return p;try{return await p.json()}catch(m){await $m(m)}}function un(a){var n;let r=null;s1(a)&&(r=Object.assign({},a),a.expires_at||(r.expires_at=Lx(a.expires_in)));const l=(n=a.user)!==null&&n!==void 0?n:a;return{data:{session:r,user:l},error:null}}function Pm(a){const n=un(a);return!n.error&&a.weak_password&&typeof a.weak_password=="object"&&Array.isArray(a.weak_password.reasons)&&a.weak_password.reasons.length&&a.weak_password.message&&typeof a.weak_password.message=="string"&&a.weak_password.reasons.reduce((r,l)=>r&&typeof l=="string",!0)&&(n.data.weak_password=a.weak_password),n}function fi(a){var n;return{data:{user:(n=a.user)!==null&&n!==void 0?n:a},error:null}}function a1(a){return{data:a,error:null}}function r1(a){const{action_link:n,email_otp:r,hashed_token:l,redirect_to:c,verification_type:d}=a,f=Jl(a,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),p={action_link:n,email_otp:r,hashed_token:l,redirect_to:c,verification_type:d},m=Object.assign({},f);return{data:{properties:p,user:m},error:null}}function Vm(a){return a}function s1(a){return a.access_token&&a.refresh_token&&a.expires_in}const ku=["global","local","others"];class l1{constructor({url:n="",headers:r={},fetch:l}){this.url=n,this.headers=r,this.fetch=Yg(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)}}async signOut(n,r=ku[0]){if(ku.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${ku.join(", ")}`);try{return await fe(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:n,noResolveJson:!0}),{data:null,error:null}}catch(l){if(se(l))return{data:null,error:l};throw l}}async inviteUserByEmail(n,r={}){try{return await fe(this.fetch,"POST",`${this.url}/invite`,{body:{email:n,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:fi})}catch(l){if(se(l))return{data:{user:null},error:l};throw l}}async generateLink(n){try{const{options:r}=n,l=Jl(n,["options"]),c=Object.assign(Object.assign({},l),r);return"newEmail"in l&&(c.new_email=l?.newEmail,delete c.newEmail),await fe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:c,headers:this.headers,xform:r1,redirectTo:r?.redirectTo})}catch(r){if(se(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(n){try{return await fe(this.fetch,"POST",`${this.url}/admin/users`,{body:n,headers:this.headers,xform:fi})}catch(r){if(se(r))return{data:{user:null},error:r};throw r}}async listUsers(n){var r,l,c,d,f,p,m;try{const y={nextPage:null,lastPage:0,total:0},v=await fe(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(r=n?.page)===null||r===void 0?void 0:r.toString())!==null&&l!==void 0?l:"",per_page:(d=(c=n?.perPage)===null||c===void 0?void 0:c.toString())!==null&&d!==void 0?d:""},xform:Vm});if(v.error)throw v.error;const _=await v.json(),x=(f=v.headers.get("x-total-count"))!==null&&f!==void 0?f:0,E=(m=(p=v.headers.get("link"))===null||p===void 0?void 0:p.split(","))!==null&&m!==void 0?m:[];return E.length>0&&(E.forEach(T=>{const k=parseInt(T.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(T.split(";")[1].split("=")[1]);y[`${C}Page`]=k}),y.total=parseInt(x)),{data:Object.assign(Object.assign({},_),y),error:null}}catch(y){if(se(y))return{data:{users:[]},error:y};throw y}}async getUserById(n){Ca(n);try{return await fe(this.fetch,"GET",`${this.url}/admin/users/${n}`,{headers:this.headers,xform:fi})}catch(r){if(se(r))return{data:{user:null},error:r};throw r}}async updateUserById(n,r){Ca(n);try{return await fe(this.fetch,"PUT",`${this.url}/admin/users/${n}`,{body:r,headers:this.headers,xform:fi})}catch(l){if(se(l))return{data:{user:null},error:l};throw l}}async deleteUser(n,r=!1){Ca(n);
38try{return await fe(this.fetch,"DELETE",`${this.url}/admin/users/${n}`,{headers:this.headers,body:{should_soft_delete:r},xform:fi})}catch(l){if(se(l))return{data:{user:null},error:l};throw l}}async _listFactors(n){Ca(n.userId);try{const{data:r,error:l}=await fe(this.fetch,"GET",`${this.url}/admin/users/${n.userId}/factors`,{headers:this.headers,xform:c=>({data:{factors:c},error:null})});return{data:r,error:l}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _deleteFactor(n){Ca(n.userId),Ca(n.id);try{return{data:await fe(this.fetch,"DELETE",`${this.url}/admin/users/${n.userId}/factors/${n.id}`,{headers:this.headers}),error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _listOAuthClients(n){var r,l,c,d,f,p,m;try{const y={nextPage:null,lastPage:0,total:0},v=await fe(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(l=(r=n?.page)===null||r===void 0?void 0:r.toString())!==null&&l!==void 0?l:"",per_page:(d=(c=n?.perPage)===null||c===void 0?void 0:c.toString())!==null&&d!==void 0?d:""},xform:Vm});if(v.error)throw v.error;const _=await v.json(),x=(f=v.headers.get("x-total-count"))!==null&&f!==void 0?f:0,E=(m=(p=v.headers.get("link"))===null||p===void 0?void 0:p.split(","))!==null&&m!==void 0?m:[];return E.length>0&&(E.forEach(T=>{const k=parseInt(T.split(";")[0].split("=")[1].substring(0,1)),C=JSON.parse(T.split(";")[1].split("=")[1]);y[`${C}Page`]=k}),y.total=parseInt(x)),{data:Object.assign(Object.assign({},_),y),error:null}}catch(y){if(se(y))return{data:{clients:[]},error:y};throw y}}async _createOAuthClient(n){try{return await fe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _getOAuthClient(n){try{return await fe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}async _updateOAuthClient(n,r){try{return await fe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:r,headers:this.headers,xform:l=>({data:l,error:null})})}catch(l){if(se(l))return{data:null,error:l};throw l}}async _deleteOAuthClient(n){try{return await fe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${n}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(se(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(n){try{return await fe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${n}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(se(r))return{data:null,error:r};throw r}}}function Gm(a={}){return{getItem:n=>a[n]||null,setItem:(n,r)=>{a[n]=r},removeItem:n=>{delete a[n]}}}const ka={debug:!!(globalThis&&Kg()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Wg extends Error{constructor(n){super(n),this.isAcquireTimeout=!0}}class o1 extends Wg{}async function c1(a,n,r){ka.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",a,n);const l=new globalThis.AbortController;return n>0&&setTimeout(()=>{l.abort(),ka.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",a)},n),await Promise.resolve().then(()=>globalThis.navigator.locks.request(a,n===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:l.signal},async c=>{if(c){ka.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",a,c.name);try{return await r()}finally{ka.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",a,c.name)}}else{if(n===0)throw ka.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",a),new o1(`Acquiring an exclusive Navigator LockManager lock "${a}" immediately failed`);if(ka.debug)try{const d=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(d,null,"  "))}catch(d){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",d)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function u1(){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 Jg(a){if(!/^0x[a-fA-F0-9]{40}$/.test(a))throw new Error(`@supabase/auth-js: Address "${a}
38" is invalid.`);return a.toLowerCase()}function d1(a){return parseInt(a,16)}function h1(a){const n=new TextEncoder().encode(a);return"0x"+Array.from(n,l=>l.toString(16).padStart(2,"0")).join("")}function f1(a){var n;const{chainId:r,domain:l,expirationTime:c,issuedAt:d=new Date,nonce:f,notBefore:p,requestId:m,resources:y,scheme:v,uri:_,version:x}=a;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!l)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(f&&f.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${f}`);if(!_)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(x!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${x}`);if(!((n=a.statement)===null||n===void 0)&&n.includes(`
39`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${a.statement}`)}const E=Jg(a.address),T=v?`${v}://${l}`:l,k=a.statement?`${a.statement}
40`:"",C=`${T} wants you to sign in with your Ethereum account:
41${E}
42
43${k}`;let D=`URI: ${_}
44Version: ${x}
45Chain ID: ${r}${f?`
46Nonce: ${f}`:""}
47Issued At: ${d.toISOString()}`;if(c&&(D+=`
48Expiration Time: ${c.toISOString()}`),p&&(D+=`
49Not Before: ${p.toISOString()}`),m&&(D+=`
50Request ID: ${m}`),y){let q=`
51Resources:`;for(const L of y){if(!L||typeof L!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${L}`);q+=`
52- ${L}`}D+=q}return`${C}
53${D}`}class at extends Error{constructor({message:n,code:r,cause:l,name:c}){var d;super(n,{cause:l}),this.__isWebAuthnError=!0,this.name=(d=c??(l instanceof Error?l.name:void 0))!==null&&d!==void 0?d:"Unknown Error",this.code=r}}class $l extends at{constructor(n,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:n}),this.name="WebAuthnUnknownError",this.originalError=r}}function p1({error:a,options:n}){var r,l,c;const{publicKey:d}=n;if(!d)throw Error("options was missing required publicKey property");if(a.name==="AbortError"){if(n.signal instanceof AbortSignal)return new at({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:a})}else if(a.name==="ConstraintError"){if(((r=d.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new at({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:a});if(n.mediation==="conditional"&&((l=d.authenticatorSelection)===null||l===void 0?void 0:l.userVerification)==="required")return new at({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:a});if(((c=d.authenticatorSelection)===null||c===void 0?void 0:c.userVerification)==="required")return new at({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:a})}else{if(a.name==="InvalidStateError")return new at({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:a});if(a.name==="NotAllowedError")return new at({message:a.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:a});if(a.name==="NotSupportedError")return d.pubKeyCredParams.filter(p=>p.type==="public-key").length===0?new at({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:a}):new at({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:a});if(a.name==="SecurityError"){const f=window.location.hostname;if(Qg(f)){if(d.rp.id!==f)return new at({message:`The RP ID "${d.rp.id}
53" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:a})}else return new at({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:a})}else if(a.name==="TypeError"){if(d.user.id.byteLength<1||d.user.id.byteLength>64)return new at({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:a})}else if(a.name==="UnknownError")return new at({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:a})}return new at({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:a})}function m1({error:a,options:n}){const{publicKey:r}=n;if(!r)throw Error("options was missing required publicKey property");if(a.name==="AbortError"){if(n.signal instanceof AbortSignal)return new at({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:a})}else{if(a.name==="NotAllowedError")return new at({message:a.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:a});if(a.name==="SecurityError"){const l=window.location.hostname;if(Qg(l)){if(r.rpId!==l)return new at({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:a})}else return new at({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:a})}else if(a.name==="UnknownError")return new at({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:a})}return new at({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:a})}class g1{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const n=new AbortController;return this.controller=n,n.signal}cancelCeremony(){if(this.controller){const n=new Error("Manually cancelling existing WebAuthn API call");n.name="AbortError",this.controller.abort(n),this.controller=void 0}}}const y1=new g1;function v1(a){if(!a)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(a);const{challenge:n,user:r,excludeCredentials:l}=a,c=Jl(a,["challenge","user","excludeCredentials"]),d=za(n).buffer,f=Object.assign(Object.assign({},r),{id:za(r.id).buffer}),p=Object.assign(Object.assign({},c),{challenge:d,user:f});if(l&&l.length>0){p.excludeCredentials=new Array(l.length);for(let m=0;m<l.length;m++){const y=l[m];p.excludeCredentials[m]=Object.assign(Object.assign({},y),{id:za(y.id).buffer,type:y.type||"public-key",transports:y.transports})}}return p}function b1(a){if(!a)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(a);const{challenge:n,allowCredentials:r}=a,l=Jl(a,["challenge","allowCredentials"]),c=za(n).buffer,d=Object.assign(Object.assign({},l),{challenge:c});if(r&&r.length>0){d.allowCredentials=new Array(r.length);for(let f=0;f<r.length;f++){const p=r[f];d.allowCredentials[f]=Object.assign(Object.assign({},p),{id:za(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return d}function _1(a){var n;if("toJSON"in a&&typeof a.toJSON=="function")return a.toJSON();const r=a;return{id:a.id,rawId:a.id,response:{attestationObject:Fi(new Uint8Array(a.response.attestationObject)),clientDataJSON:Fi(new Uint8Array(a.response.clientDataJSON))},type:"public-key",clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:(n=r.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function x1(a){var n;if("toJSON"in a&&typeof a.toJSON=="function")return a.toJSON();const r=a,l=a.getClientExtensionResults(),c=a.response;return{id:a.id,rawId:a.id,response:{authenticatorData:Fi(new Uint8Array(c.authenticatorData)),clientDataJSON:Fi(new Uint8Array(c.clientDataJSON)),signature:Fi(new Uint8Array(c.signature)),userHandle:c.userHandle?Fi(new Uint8Array(c.userHandle)):void 0},type:"public-key",clientExtensionResults:l,authenticatorAttachment:(n=r.authenticatorAttachment)!==null&&n!==void 0?n:void 0}}function Qg(a){return a==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(a)}function Km(){var a,n;return!!(vt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((a=navigator?.credentials)===null||a===void 0?void 0:a.create)=="function"&&typeof((n=navigator?.credentials)===null||n===void 0?void 0:n.get)=="function")}async function w1(a){try{const n=await navigator.credentials.create(a);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new $l("Browser returned unexpected credential type",n)}:{data:null,error:new $l("Empty credential response",n)}}catch(n){return{data:null,error:p1({error:n,options:a})}}}async function S1(a){try{const n=await navigator.credentials.get(a);return n?n instanceof PublicKeyCredential?{data:n,error:null}:{data:null,error:new $l("Browser returned unexpected credential type",n)}:{data:null,error:new $l("Empty credential response",n)}}catch(n){return{data:null,error:m1({error:n,options:a})}}}const E1={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},A1={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Pl(...a){const n=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),r=c=>c instanceof ArrayBuffer||ArrayBuffer.isView(c),l={};for(const c of a)if(c)for(const d in c){const f=c[d];if(f!==void 0)if(Array.isArray(f))l[d]=f;else if(r(f))l[d]=f;else if(n(f)){const p=l[d];n(p)?l[d]=Pl(p,f):l[d]=Pl(f)}else l[d]=f}return l}function j1(a,n){return Pl(E1,a,n||{})}function T1(a,n){return Pl(A1,a,n||{})}class R1{constructor(n){this.client=n,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(n){return this.client.mfa.enroll(Object.assign(Object.assign({},n),{factorType:"webauthn"}))}async _challenge({factorId:n,webauthn:r,friendlyName:l,signal:c},d){var f;try{const{data:p,error:m}=await this.client.mfa.challenge({factorId:n,webauthn:r});if(!p)return{data:null,error:m};const y=c??y1.createNewAbortSignal();if(p.webauthn.type==="create"){const{user:v}=p.webauthn.credential_options.publicKey;if(!v.name){const _=l;if(_)v.name=`${v.id}:${_}`;else{const E=(await this.client.getUser()).data.user,T=((f=E?.user_metadata)===null||f===void 0?void 0:f.name)||E?.email||E?.id||"User";v.name=`${v.id}:${T}`}}
53v.displayName||(v.displayName=v.name)}switch(p.webauthn.type){case"create":{const v=j1(p.webauthn.credential_options.publicKey,d?.create),{data:_,error:x}=await w1({publicKey:v,signal:y});return _?{data:{factorId:n,challengeId:p.id,webauthn:{type:p.webauthn.type,credential_response:_}},error:null}:{data:null,error:x}}case"request":{const v=T1(p.webauthn.credential_options.publicKey,d?.request),{data:_,error:x}=await S1(Object.assign(Object.assign({},p.webauthn.credential_options),{publicKey:v,signal:y}));return _?{data:{factorId:n,challengeId:p.id,webauthn:{type:p.webauthn.type,credential_response:_}},error:null}:{data:null,error:x}}}}catch(p){return se(p)?{data:null,error:p}:{data:null,error:new Ui("Unexpected error in challenge",p)}}}async _verify({challengeId:n,factorId:r,webauthn:l}){return this.client.mfa.verify({factorId:r,challengeId:n,webauthn:l})}async _authenticate({factorId:n,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:c}={}},d){if(!r)return{data:null,error:new Zr("rpId is required for WebAuthn authentication")};try{if(!Km())return{data:null,error:new Ui("Browser does not support WebAuthn",null)};const{data:f,error:p}=await this.challenge({factorId:n,webauthn:{rpId:r,rpOrigins:l},signal:c},{request:d});if(!f)return{data:null,error:p};const{webauthn:m}=f;return this._verify({factorId:n,challengeId:f.challengeId,webauthn:{type:m.type,rpId:r,rpOrigins:l,credential_response:m.credential_response}})}catch(f){return se(f)?{data:null,error:f}:{data:null,error:new Ui("Unexpected error in authenticate",f)}}}async _register({friendlyName:n,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:l=typeof window<"u"?[window.location.origin]:void 0,signal:c}={}},d){if(!r)return{data:null,error:new Zr("rpId is required for WebAuthn registration")};try{if(!Km())return{data:null,error:new Ui("Browser does not support WebAuthn",null)};const{data:f,error:p}=await this._enroll({friendlyName:n});if(!f)return await this.client.mfa.listFactors().then(v=>{var _;return(_=v.data)===null||_===void 0?void 0:_.all.find(x=>x.factor_type==="webauthn"&&x.friendly_name===n&&x.status!=="unverified")}).then(v=>v?this.client.mfa.unenroll({factorId:v?.id}):void 0),{data:null,error:p};const{data:m,error:y}=await this._challenge({factorId:f.id,friendlyName:f.friendly_name,webauthn:{rpId:r,rpOrigins:l},signal:c},{create:d});return m?this._verify({factorId:f.id,challengeId:m.challengeId,webauthn:{rpId:r,rpOrigins:l,type:m.webauthn.type,credential_response:m.webauthn.credential_response}}):{data:null,error:y}}catch(f){return se(f)?{data:null,error:f}:{data:null,error:new Ui("Unexpected error in register",f)}}}}u1();const C1={url:Ax,storageKey:jx,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Tx,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function Ym(a,n,r){return await r()}const Oa={};class es{get jwks(){var n,r;return(r=(n=Oa[this.storageKey])===null||n===void 0?void 0:n.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(n){Oa[this.storageKey]=Object.assign(Object.assign({},Oa[this.storageKey]),{jwks:n})}get jwks_cached_at(){var n,r;return(r=(n=Oa[this.storageKey])===null||n===void 0?void 0:n.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(n){Oa[this.storageKey]=Object.assign(Object.assign({},Oa[this.storageKey]),{cachedAt:n})}constructor(n){var r,l,c;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 d=Object.assign(Object.assign({},C1),n);if(this.storageKey=d.storageKey,this.instanceID=(r=es.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,es.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!d.debug,typeof d.debug=="function"&&(this.logger=
53d.debug),this.instanceID>0&&vt()){const f=`${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(f),this.logDebugMessages&&console.trace(f)}if(this.persistSession=d.persistSession,this.autoRefreshToken=d.autoRefreshToken,this.admin=new l1({url:d.url,headers:d.headers,fetch:d.fetch}),this.url=d.url,this.headers=d.headers,this.fetch=Yg(d.fetch),this.lock=d.lock||Ym,this.detectSessionInUrl=d.detectSessionInUrl,this.flowType=d.flowType,this.hasCustomAuthorizationHeader=d.hasCustomAuthorizationHeader,this.throwOnError=d.throwOnError,this.lockAcquireTimeout=d.lockAcquireTimeout,d.lock?this.lock=d.lock:this.persistSession&&vt()&&(!((l=globalThis?.navigator)===null||l===void 0)&&l.locks)?this.lock=c1:this.lock=Ym,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 R1(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(d.storage?this.storage=d.storage:Kg()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Gm(this.memoryStorage)),d.userStorage&&(this.userStorage=d.userStorage)):(this.memoryStorage={},this.storage=Gm(this.memoryStorage)),vt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(f){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",f)}(c=this.broadcastChannel)===null||c===void 0||c.addEventListener("message",async f=>{this._debug("received broadcast notification from other tab or client",f);try{await this._notifyAllSubscribers(f.data.event,f.data.session,!1)}catch(p){this._debug("#broadcastChannel","error",p)}})}this.initialize().catch(f=>{this._debug("#initialize()","error",f)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(n){if(this.throwOnError&&n&&n.error)throw n.error;return n}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Pg}) ${new Date().toISOString()}`}_debug(...n){return this.logDebugMessages&&this.logger(this._logPrefix(),...n),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 n;try{let r={},l="none";if(vt()&&(r=Hx(window.location.href),this._isImplicitGrantCallback(r)?l="implicit":await this._isPKCECallback(r)&&(l="pkce")),vt()&&this.detectSessionInUrl&&l!=="none"){const{data:c,error:d}=await this._getSessionFromURL(r,l);if(d){if(this._debug("#_initialize()","error detecting session from URL",d),Bx(d)){const m=(n=d.details)===null||n===void 0?void 0:n.code;if(m==="identity_already_exists"||m==="identity_not_found"||m==="single_identity_not_deletable")return{error:d}}return{error:d}}const{session:f,redirectType:p}=c;return this._debug("#_initialize()","detected session in URL",f,"redirect type",p),await this._saveSession(f),setTimeout(async()=>{p==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",f):await this._notifyAllSubscribers("SIGNED_IN",f)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return se(r)?this._returnResult({error:r}):this._returnResult({error:new Ui("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(n){var r,l,c;try{const d=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(l=(r=n?.options)===null||r===void 0?void 0:r.data)!==null&&l!==void 0?l:{},gotrue_meta_security:{captcha_token:(c=n?.options)===null||c===void 0?void 0:c.captchaToken}},xform:un}),{data:f,error:p}=d;if(p||!f)return this._returnResult({data:{user:null,session:null},error:p});const m=f.session,y=f.user;return f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("SIGNED_IN",m)),this._returnResult({data:{user:y,session:m},error:null})}catch(d){if(se(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async signUp(n){var r,l,c;try{let d;if("email"in n){const{email:v,password:_,options:x}=n;let E=null,T=null;this.flowType==="pkce"&&([E,T]=await Ra(this.storage,this.storageKey)),d=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:x?.emailRedirectTo,body:{email:v,password:_,data:(r=x?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:x?.captchaToken},code_challenge:E,code_challenge_method:T},xform:un})}else if("phone"in n){const{phone:v,password:_,options:x}=n;d=await fe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:v,password:_,data:(l=x?.data)!==null&&l!==void 0?l:{},channel:(c=x?.channel)!==null&&c!==void 0?c:"sms",gotrue_meta_security:{captcha_token:x?.captchaToken}},xform:un})}else throw new Bl("You must provide either an email or phone number and a password");const{data:f,error:p}=d;if(p||!f)return await yt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:p});const m=f.session,y=f.user;return f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("SIGNED_IN",m)),this._returnResult({data:{user:y,session:m},error:null})}catch(d){if(await yt(this.storage,`${this.storageKey}-code-verifier`),se(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async signInWithPassword(n){try{let r;if("email"in n){const{email:d,password:f,options:p}=n;r=await fe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:d,password:f,gotrue_meta_security:{captcha_token:p?.captchaToken}},xform:Pm})}else if("phone"in n){const{phone:d,password:f,options:p}=n;r=await fe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:d,password:f,gotrue_meta_security:{captcha_token:p?.captchaToken}},xform:Pm})}else throw new Bl("You must provide either an email or phone number and a password");const{data:l,error:c}=r;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const d=new Ta;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:Object.assign({user:l.user,session:l.session},l.weak_password?{weakPassword:l.weak_password}:null),error:c})}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(n){var r,l,c,d;return await this._handleProviderSignIn(n.provider,{redirectTo:(r=n.options)===null||r===void 0?void 0:r.redirectTo,scopes:(l=n.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=n.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:(d=n.options)===null||d===void 0?void 0:d.skipBrowserRedirect})}async exchangeCodeForSession(n){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(n))}async signInWithWeb3(n){const{chain:r}=n;switch(r){case"ethereum":return await this.signInWithEthereum(n);case"solana":return await this.signInWithSolana(n);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(n){var r,l,c,d,f,p,m,y,v,_,x;let E,T;if("message"in n)E=n.message,T=n.signature;else{const{chain:k,wallet:C,statement:D,options:q}=n;let L;if(vt())if(typeof C=="object")L=C;else{const le=window;if("ethereum"in le&&typeof le.ethereum=="object"&&"request"in le.ethereum&&typeof le.ethereum.request=="function")L=le.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 C!="object"||!q?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");L=C}const X=new URL((r=q?.url)!==null&&r!==void 0?r:window.location.href),ne=await L.request({method:"eth_requestAccounts"}).then(le=>le).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!ne||ne.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const K=Jg(ne[0]);let Q=(l=q?.signInWithEthereum)===null||l===void 0?void 0:l.chainId;if(!Q){const le=await L.request({method:"eth_chainId"});Q=d1(le)}const me={domain:X.host,address:K,statement:D,uri:X.href,version:"1",chainId:Q,nonce:(c=q?.signInWithEthereum)===null||c===void 0?void 0:c.nonce,issuedAt:(f=(d=q?.signInWithEthereum)===null||d===void 0?void 0:d.issuedAt)!==null&&f!==void 0?f:new Date,expirationTime:(p=q?.signInWithEthereum)===null||p===void 0?void 0:p.expirationTime,notBefore:(m=q?.signInWithEthereum)===null||m===void 0?void 0:m.notBefore,requestId:(y=q?.signInWithEthereum)===null||y===void 0?void 0:y.requestId,resources:(v=q?.signInWithEthereum)===null||v===void 0?void 0:v.resources};E=f1(me),T=await L.request({method:"personal_sign",params:[h1(E),K]})}try{const{data:k,error:C}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:E,signature:T},!((_=n.options)===null||_===void 0)&&_.captchaToken?{gotrue_meta_security:{captcha_token:(x=n.options)===null||x===void 0?void 0:x.captchaToken}}:null),xform:un});if(C)throw C;if(!k||!k.session||!k.user){const D=new Ta;return this._returnResult({data:{user:null,session:null},error:D})}return k.session&&(await this._saveSession(k.session),await this._notifyAllSubscribers("SIGNED_IN",k.session)),this._returnResult({data:Object.assign({},k),error:C})}catch(k){if(se(k))return this._returnResult({data:{user:null,session:null},error:k});throw k}}async signInWithSolana(n){var r,l,c,d,f,p,m,y,v,_,x,E;let T,k;if("message"in n)T=n.message,k=n.signature;else{const{chain:C,wallet:D,statement:q,options:L}=n;let X;if(vt())if(typeof D=="object")X=D;else{const K=window;if("solana"in K&&typeof K.solana=="object"&&("signIn"in K.solana&&typeof K.solana.signIn=="function"||"signMessage"in K.solana&&typeof K.solana.signMessage=="function"))X=K.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof D!="object"||!L?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");X=D}const ne=new URL((r=L?.url)!==null&&r!==void 0?r:window.location.href);
53if("signIn"in X&&X.signIn){const K=await X.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},L?.signInWithSolana),{version:"1",domain:ne.host,uri:ne.href}),q?{statement:q}:null));let Q;if(Array.isArray(K)&&K[0]&&typeof K[0]=="object")Q=K[0];else if(K&&typeof K=="object"&&"signedMessage"in K&&"signature"in K)Q=K;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in Q&&"signature"in Q&&(typeof Q.signedMessage=="string"||Q.signedMessage instanceof Uint8Array)&&Q.signature instanceof Uint8Array)T=typeof Q.signedMessage=="string"?Q.signedMessage:new TextDecoder().decode(Q.signedMessage),k=Q.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in X)||typeof X.signMessage!="function"||!("publicKey"in X)||typeof X!="object"||!X.publicKey||!("toBase58"in X.publicKey)||typeof X.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");T=[`${ne.host} wants you to sign in with your Solana account:`,X.publicKey.toBase58(),...q?["",q,""]:[""],"Version: 1",`URI: ${ne.href}`,`Issued At: ${(c=(l=L?.signInWithSolana)===null||l===void 0?void 0:l.issuedAt)!==null&&c!==void 0?c:new Date().toISOString()}`,...!((d=L?.signInWithSolana)===null||d===void 0)&&d.notBefore?[`Not Before: ${L.signInWithSolana.notBefore}`]:[],...!((f=L?.signInWithSolana)===null||f===void 0)&&f.expirationTime?[`Expiration Time: ${L.signInWithSolana.expirationTime}`]:[],...!((p=L?.signInWithSolana)===null||p===void 0)&&p.chainId?[`Chain ID: ${L.signInWithSolana.chainId}`]:[],...!((m=L?.signInWithSolana)===null||m===void 0)&&m.nonce?[`Nonce: ${L.signInWithSolana.nonce}`]:[],...!((y=L?.signInWithSolana)===null||y===void 0)&&y.requestId?[`Request ID: ${L.signInWithSolana.requestId}`]:[],...!((_=(v=L?.signInWithSolana)===null||v===void 0?void 0:v.resources)===null||_===void 0)&&_.length?["Resources",...L.sign
53InWithSolana.resources.map(Q=>`- ${Q}`)]:[]].join(`
54`);const K=await X.signMessage(new TextEncoder().encode(T),"utf8");if(!K||!(K instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");k=K}}try{const{data:C,error:D}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:T,signature:Fi(k)},!((x=n.options)===null||x===void 0)&&x.captchaToken?{gotrue_meta_security:{captcha_token:(E=n.options)===null||E===void 0?void 0:E.captchaToken}}:null),xform:un});if(D)throw D;if(!C||!C.session||!C.user){const q=new Ta;return this._returnResult({data:{user:null,session:null},error:q})}return C.session&&(await this._saveSession(C.session),await this._notifyAllSubscribers("SIGNED_IN",C.session)),this._returnResult({data:Object.assign({},C),error:D})}catch(C){if(se(C))return this._returnResult({data:{user:null,session:null},error:C});throw C}}async _exchangeCodeForSession(n){const r=await Ni(this.storage,`${this.storageKey}-code-verifier`),[l,c]=(r??"").split("/");try{if(!l&&this.flowType==="pkce")throw new Dx;const{data:d,error:f}=await fe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:n,code_verifier:l},xform:un});if(await yt(this.storage,`${this.storageKey}-code-verifier`),f)throw f;if(!d||!d.session||!d.user){const p=new Ta;return this._returnResult({data:{user:null,session:null,redirectType:null},error:p})}return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",d.session)),this._returnResult({data:Object.assign(Object.assign({},d),{redirectType:c??null}),error:f})}catch(d){if(await yt(this.storage,`${this.storageKey}-code-verifier`),se(d))return this._returnResult({data:{user:null,session:null,redirectType:null},error:d});throw d}}async signInWithIdToken(n){try{const{options:r,provider:l,token:c,access_token:d,nonce:f}=n,p=await fe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:l,id_token:c,access_token:d,nonce:f,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:un}),{data:m,error:y}=p;if(y)return this._returnResult({data:{user:null,session:null},error:y});if(!m||!m.session||!m.user){const v=new Ta;return this._returnResult({data:{user:null,session:null},error:v})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:m,error:y})}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(n){var r,l,c,d,f;try{if("email"in n){const{email:p,options:m}=n;let y=null,v=null;this.flowType==="pkce"&&([y,v]=await Ra(this.storage,this.storageKey));const{error:_}=await fe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:p,data:(r=m?.data)!==null&&r!==void 0?r:{},create_user:(l=m?.shouldCreateUser)!==null&&l!==void 0?l:!0,gotrue_meta_security:{captcha_token:m?.captchaToken},code_challenge:y,code_challenge_method:v},redirectTo:m?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:_})}if("phone"in n){const{phone:p,options:m}=n,{data:y,error:v}=await fe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:p,data:(c=m?.data)!==null&&c!==void 0?c:{},create_user:(d=m?.shouldCreateUser)!==null&&d!==void 0?d:!0,gotrue_meta_security:{captcha_token:m?.captchaToken},channel:(f=m?.channel)!==null&&f!==void 0?f:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:y?.message_id},error:v})}throw new Bl("You must provide either an email or phone number.")}catch(p){if(await yt(this.storage,`${this.storageKey}-code-verifier`),se(p))return this._returnResult({data:{user:null,session:null},error:p});throw p}}async verifyOtp(n){var r,l;try{let c,d;"options"in n&&(c=(r=n.options)===null||r===void 0?void 0:r.redirectTo,d=(l=n.options)===null||l===void 0?void 0:l.captchaToken);const{data:f,error:p}=await fe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},n),{gotrue_meta_security:{captcha_token:d}}),redirectTo:c,xform:un});if(p)throw p;if(!f)throw new Error("An error occurred on token verification.");const m=f.session,y=f.user;return m?.access_token&&(await this._saveSession(m),await this._notifyAllSubscribers(n.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",m)),this._returnResult({data:{user:y,session:m},error:null})}catch(c){if(se(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signInWithSSO(n){var r,l,c,d,f;try{let p=null,m=null;this.flowType==="pkce"&&([p,m]=await Ra(this.storage,this.storageKey));const y=await fe(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in n?{provider_id:n.providerId}:null),"domain"in n?{domain:n.domain}:null),{redirect_to:(l=(r=n.options)===null||r===void 0?void 0:r.redirectTo)!==null&&l!==void 0?l:void 0}),!((c=n?.options)===null||c===void 0)&&c.captchaToken?{gotrue_meta_security:{captcha_token:n.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:p,code_challenge_method:m}),headers:this.headers,xform:a1});return!((d=y.data)===null||d===void 0)&&d.url&&vt()&&!(!((f=n.options)===null||f===void 0)&&f.skipBrowserRedirect)&&window.location.assign(y.data.url),this._returnResult(y)}catch(p){if(await yt(this.storage,`${this.storageKey}-code-verifier`),se(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 n=>{const{data:{session:r},error:l}=n;if(l)throw l;if(!r)throw new qt;const{error:c}=await fe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:c})})}catch(n){if(se(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async resend(n){try{const r=`${this.url}/resend`;if("email"in n){const{email:l,type:c,options:d}=n,{error:f}=await fe(this.fetch,"POST",r,{headers:this.headers,body:{email:l,type:c,gotrue_meta_security:{captcha_token:d?.captchaToken}},redirectTo:d?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}else if("phone"in n){const{phone:l,type:c,options:d}=n,{data:f,error:p}=await fe(this.fetch,"POST",r,{headers:this.headers,body:{phone:l,type:c,gotrue_meta_security:{captcha_token:d?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:f?.message_id},error:p})}throw new Bl("You must provide either an email or phone number and a type")}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(n,r){this._debug("#_acquireLock","begin",n);try{if(this.lockAcquired){const l=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),c=(async()=>(await l,await r()))();return this.pendingInLock.push((async()=>{try{await c}catch{}})()),c}return await this.lock(`lock:${this.storageKey}`,n,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const l=r();for(this.pendingInLock.push((async()=>{try{await l}catch{}})()),await l;this.pendingInLock.length;){const c=[...this.pendingInLock];await Promise.all(c),this.pendingInLock.splice(0,c.length)}return await l}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(n){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await n(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let n=null;const r=await Ni(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?n=r:(this._debug("#getSession()","session from storage is not val
54id"),await this._removeSession())),!n)return{data:{session:null},error:null};const l=n.expires_at?n.expires_at*1e3-Date.now()<ju:!1;if(this._debug("#__loadSession()",`session has${l?"":" not"} expired`,"expires_at",n.expires_at),!l){if(this.userStorage){const f=await Ni(this.userStorage,this.storageKey+"-user");f?.user?n.user=f.user:n.user=Cu()}if(this.storage.isServer&&n.user&&!n.user.__isUserNotAvailableProxy){const f={value:this.suppressGetSessionWarning};n.user=e1(n.user,f),f.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:n},error:null}}const{data:c,error:d}=await this._callRefreshToken(n.refresh_token);return d?this._returnResult({data:{session:null},error:d}):this._returnResult({data:{session:c},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(n){if(n)return await this._getUser(n);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(n){try{return n?await fe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:n,xform:fi}):await this._useSession(async r=>{var l,c,d;const{data:f,error:p}=r;if(p)throw p;return!(!((l=f.session)===null||l===void 0)&&l.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new qt}:await fe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(d=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&d!==void 0?d:void 0,xform:fi})})}catch(r){if(se(r))return Tu(r)&&(await this._removeSession(),await yt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(n,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(n,r))}async _updateUser(n,r={}){try{return await this._useSession(async l=>{const{data:c,error:d}=l;if(d)throw d;if(!c.session)throw new qt;const f=c.session;let p=null,m=null;this.flowType==="pkce"&&n.email!=null&&([p,m]=await Ra(this.storage,this.storageKey));const{data:y,error:v}=await fe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},n),{code_challenge:p,code_challenge_method:m}),jwt:f.access_token,xform:fi});if(v)throw v;return f.user=y.user,await this._saveSession(f),await this._notifyAllSubscribers("USER_UPDATED",f),this._returnResult({data:{user:f.user},error:null})})}catch(l){if(await yt(this.storage,`${this.storageKey}-code-verifier`),se(l))return this._returnResult({data:{user:null},error:l});throw l}}async setSession(n){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(n))}async _setSession(n){try{if(!n.access_token||!n.refresh_token)throw new qt;const r=Date.now()/1e3;let l=r,c=!0,d=null;const{payload:f}=Nl(n.access_token);if(f.exp&&(l=f.exp,c=l<=r),c){const{data:p,error:m}=await this._callRefreshToken(n.refresh_token);if(m)return this._returnResult({data:{user:null,session:null},error:m});if(!p)return{data:{user:null,session:null},error:null};d=p}else{const{data:p,error:m}=await this._getUser(n.access_token);if(m)return this._returnResult({data:{user:null,session:null},error:m});d={access_token:n.access_token,refresh_token:n.refresh_token,user:p.user,token_type:"bearer",expires_in:l-r,expires_at:l},await this._saveSession(d),await this._notifyAllSubscribers("SIGNED_IN",d)}return this._returnResult({data:{user:d.user,session:d},error:null})}catch(r){if(se(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(n){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(n))}async _refreshSession(n){try{return await this._useSession(async r=>{var l;if(!n){const{data:f,error:p}=r;if(p)throw p;n=(l=f.session)!==null&&l!==void 0?l:void 0}if(!n?.refresh_token)throw new qt;const{data:c,error:d}=await this._callRefreshToken(n.refresh_token);return d?this._returnResult({data:{user:null,session:null},error:d}):c?this._returnResult({data:{user:c.user,session:c},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(se(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(n,r){try{if(!vt())throw new Dl("No browser detected.");
54if(n.error||n.error_description||n.error_code)throw new Dl(n.error_description||"Error in URL with unspecified error_description",{error:n.error||"unspecified_error",code:n.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Um("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Dl("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!n.code)throw new Um("No code detected.");const{data:q,error:L}=await this._exchangeCodeForSession(n.code);if(L)throw L;const X=new URL(window.location.href);return X.searchParams.delete("code"),window.history.replaceState(window.history.state,"",X.toString()),{data:{session:q.session,redirectType:null},error:null}}const{provider_token:l,provider_refresh_token:c,access_token:d,refresh_token:f,expires_in:p,expires_at:m,token_type:y}=n;if(!d||!p||!f||!y)throw new Dl("No session defined in URL");const v=Math.round(Date.now()/1e3),_=parseInt(p);let x=v+_;m&&(x=parseInt(m));const E=x-v;E*1e3<=Da&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${E}s, should have been closer to ${_}s`);const T=x-_;v-T>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",T,x,v):v-T<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",T,x,v);const{data:k,error:C}=await this._getUser(d);if(C)throw C;const D={provider_token:l,provider_refresh_token:c,access_token:d,expires_in:_,expires_at:x,refresh_token:f,token_type:y,user:k.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:D,redirectType:n.type},error:null})}catch(l){if(se(l))return this._returnResult({data:{session:null,redirectType:null},error:l});throw l}}_isImplicitGrantCallback(n){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),n):!!(n.access_token||n.error_description)}async _isPKCECallback(n){const r=await Ni(this.storage,`${this.storageKey}-code-verifier`);return!!(n.code&&r)}async signOut(n={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(n))}async _signOut({scope:n}={scope:"global"}){return await this._useSession(async r=>{var l;const{data:c,error:d}=r;if(d&&!Tu(d))return this._returnResult({error:d});const f=(l=c.session)===null||l===void 0?void 0:l.access_token;if(f){const{error:p}=await this.admin.signOut(f,n);if(p&&!(Ox(p)&&(p.status===404||p.status===401||p.status===403)||Tu(p)))return this._returnResult({error:p})}return n!=="others"&&(await this._removeSession(),await yt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(n){const r=Ix(),l={id:r,callback:n,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,l),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:l}}}async _emitInitialSession(n){return await this._useSession(async r=>{var l,c;try{const{data:{session:d},error:f}=r;if(f)throw f;await((l=this.stateChangeEmitters.get(n))===null||l===void 0?void 0:l.callback("INITIAL_SESSION",d)),this._debug("INITIAL_SESSION","callback id",n,"session",d)}catch(d){await((c=this.stateChangeEmitters.get(n))===null||c===void 0?void 0:c.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",n,"error",d),console.error(d)}})}async resetPasswordForEmail(n,r={}){let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Ra(this.storage,this.storageKey,!0));try{return await fe(this.fetch,"POST",`${this.url}/recover`,{body:{email:n,code_challenge:l,code_challenge_method:c,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(d){if(await yt(this.storage,`${this.storageKey}-code-verifier`),se(d))return this._returnResult({data:null,error:d});throw d}}async getUserIdentities(){var n;try{const{data:r,error:l}=await this.getUser();if(l)throw l;return this._returnResult({data:{identities:(n=r.user.identities)!==null&&n!==void 0?n:[]},error:null})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(n){return"token"in n?this.linkIdentityIdToken(n):this.linkIdentityOAuth(n)}async linkIdentityOAuth(n){var r;try{const{data:l,error:c}=await this._useSession(async d=>{var f,p,m,y,v;const{data:_,error:x}=d;if(x)throw x;const E=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,n.provider,{redirectTo:(f=n.options)===null||f===void 0?void 0:f.redirectTo,scopes:(p=n.options)===null||p===void 0?void 0:p.scopes,queryParams:(m=n.options)===null||m===void 0?void 0:m.queryParams,skipBrowserRedirect:!0});return await fe(this.fetch,"GET",E,{headers:this.headers,jwt:(v=(y=_.session)===null||y===void 0?void 0:y.access_token)!==null&&v!==void 0?v:void 0})});if(c)throw c;return vt()&&!(!((r=n.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(l?.url),this._returnResult({data:{provider:n.provider,url:l?.url},error:null})}catch(l){if(se(l))return this._returnResult({data:{provider:n.provider,url:null},error:l});throw l}}async linkIdentityIdToken(n){return await this._useSession(async r=>{var l;try{const{error:c,data:{session:d}}=r;if(c)throw c;const{options:f,provider:p,token:m,access_token:y,nonce:v}=n,_=await fe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(l=d?.access_token)!==null&&l!==void 0?l:void 0,body:{provider:p,id_token:m,access_token:y,nonce:v,link_identity:!0,gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:un}),{data:x,error:E}=_;return E?this._returnResult({data:{user:null,session:null},error:E}):!x||!x.session||!x.user?this._returnResult({data:{user:null,session:null},error:new Ta}):(x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("USER_UPDATED",x.session)),this._returnResult({data:x,error:E}))}catch(c){if(await yt(this.storage,`${this.storageKey}-code-verifier`),se(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}})}async unlinkIdentity(n){try{return await this._useSession(async r=>{var l,c;const{data:d,error:f}=r;if(f)throw f;
54return await fe(this.fetch,"DELETE",`${this.url}/user/identities/${n.identity_id}`,{headers:this.headers,jwt:(c=(l=d.session)===null||l===void 0?void 0:l.access_token)!==null&&c!==void 0?c:void 0})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(n){const r=`#_refreshAccessToken(${n.substring(0,5)}...)`;this._debug(r,"begin");try{const l=Date.now();return await Px(async c=>(c>0&&await $x(200*Math.pow(2,c-1)),this._debug(r,"refreshing attempt",c),await fe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:n},headers:this.headers,xform:un})),(c,d)=>{const f=200*Math.pow(2,c);return d&&Ru(d)&&Date.now()+f-l<Da})}catch(l){if(this._debug(r,"error",l),se(l))return this._returnResult({data:{session:null,user:null},error:l});throw l}finally{this._debug(r,"end")}}_isValidSession(n){return typeof n=="object"&&n!==null&&"access_token"in n&&"refresh_token"in n&&"expires_at"in n}async _handleProviderSignIn(n,r){const l=await this._getUrlForProvider(`${this.url}/authorize`,n,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",n,"options",r,"url",l),vt()&&!r.skipBrowserRedirect&&window.location.assign(l),{data:{provider:n,url:l},error:null}}async _recoverAndRefresh(){var n,r;const l="#_recoverAndRefresh()";this._debug(l,"begin");try{const c=await Ni(this.storage,this.storageKey);if(c&&this.userStorage){let f=await Ni(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!f&&(f={user:c.user},await Na(this.userStorage,this.storageKey+"-user",f)),c.user=(n=f?.user)!==null&&n!==void 0?n:Cu()}else if(c&&!c.user&&!c.user){const f=await Ni(this.storage,this.storageKey+"-user");f&&f?.user?(c.user=f.user,await yt(this.storage,this.storageKey+"-user"),await Na(this.storage,this.storageKey,c)):c.user=Cu()}if(this._debug(l,"session from storage",c),!this._isValidSession(c)){this._debug(l,"session is not valid"),c!==null&&await this._removeSession();return}const d=((r=c.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<ju;if(this._debug(l,`session has${d?"":" not"} expired with margin of ${ju}s`),d){if(this.autoRefreshToken&&c.refresh_token){const{error:f}=await this._callRefreshToken(c.refresh_token);f&&(console.error(f),Ru(f)||(this._debug(l,"refresh failed with a non-retryable error, removing the session",f),await this._removeSession()))}}else if(c.user&&c.user.__isUserNotAvailableProxy===!0)try{const{data:f,error:p}=await this._getUser(c.access_token);!p&&f?.user?(c.user=f.user,await this._saveSession(c),await this._notifyAllSubscribers("SIGNED_IN",c)):this._debug(l,"could not get user data, skipping SIGNED_IN notification")}catch(f){console.error("Error getting user data:",f),this._debug(l,"error getting user data, skipping SIGNED_IN notification",f)}else await this._notifyAllSubscribers("SIGNED_IN",c)}catch(c){this._debug(l,"error",c),console.error(c);return}finally{this._debug(l,"end")}}async _callRefreshToken(n){var r,l;if(!n)throw new qt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const c=`#_callRefreshToken(${n.substring(0,5)}...)`;this._debug(c,"begin");try{this.refreshingDeferred=new Zl;const{data:d,error:f}=await this._refreshAccessToken(n);if(f)throw f;if(!d.session)throw new qt;await this._saveSession(d.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",d.session);const p={data:d.session,error:null};return this.refreshingDeferred.resolve(p),p}catch(d){if(this._debug(c,"error",d),se(d)){const f={data:null,error:d};return Ru(d)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(f),f}throw(l=this.refreshingDeferred)===null||l===void 0||l.reject(d),d}finally{this.refreshingDeferred=null,this._debug(c,"end")}}async _notifyAllSubscribers(n,r,l=!0){const c=`#_notifyAllSubscribers(${n})`;this._debug(c,"begin",r,`broadcast = ${l}`);try{this.broadcastChannel&&l&&this.broadcastChannel.postMessage({event:n,session:r});const d=[],f=Array.from(this.stateChangeEmitters.values()).map(async p=>{try{await p.callback(n,r)}catch(m){d.push(m)}});if(await Promise.all(f),d.length>0){for(let p=0;p<d.length;p+=1)console.error(d[p]);throw d[0]}}finally{this._debug(c,"end")}}async _saveSession(n){this._debug("#_saveSession()",n),this.suppressGetSessionWarning=!0,await yt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},n),l=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!l&&r.user&&await Na(this.userStorage,this.storageKey+"-user",{user:r.user});const c=Object.assign({},r);delete c.user;const d=qm(c);await Na(this.storage,this.storageKey,d)}else{const c=qm(r);await Na(this.storage,this.storageKey,c)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await yt(this.storage,this.storageKey),await yt(this.storage,this.storageKey+"-code-verifier"),await yt(this.storage,this.storageKey+"-user"),this.userStorage&&await yt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const n=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{n&&vt()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",n)}
54catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const n=setInterval(()=>this._autoRefreshTokenTick(),Da);this.autoRefreshTicker=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const n=this.autoRefreshTicker;this.autoRefreshTicker=null,n&&clearInterval(n);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}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 n=Date.now();try{return await this._useSession(async r=>{const{data:{session:l}}=r;if(!l||!l.refresh_token||!l.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const c=Math.floor((l.expires_at*1e3-n)/Da);this._debug("#_autoRefreshTokenTick()",`access token expires in ${c} ticks, a tick lasts ${Da}ms, refresh threshold is ${Wu} ticks`),c<=Wu&&await this._callRefreshToken(l.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(n){if(n.isAcquireTimeout||n instanceof Wg)this._debug("auto refresh token tick lock not available");else throw n}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!vt()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(n){this._debug("#visibilityChangedCallback","error",n)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(n){console.error("_handleVisibilityChange",n)}}async _onVisibilityChanged(n){const r=`#_onVisibilityChanged(${n})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),n||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(n,r,l){const c=[`provider=${encodeURIComponent(r)}`];if(l?.redirectTo&&c.push(`redirect_to=${encodeURIComponent(l.redirectTo)}`),l?.scopes&&c.push(`scopes=${encodeURIComponent(l.scopes)}`),this.flowType==="pkce"){const[d,f]=await Ra(this.storage,this.storageKey),p=new URLSearchParams({code_challenge:`${encodeURIComponent(d)}`,code_challenge_method:`${encodeURIComponent(f)}`});c.push(p.toString())}if(l?.queryParams){const d=new URLSearchParams(l.queryParams);c.push(d.toString())}return l?.skipBrowserRedirect&&c.push(`skip_http_redirect=${l.skipBrowserRedirect}`),`${n}?${c.join("&")}`}async _unenroll(n){try{return await this._useSession(async r=>{var l;const{data:c,error:d}=r;return d?this._returnResult({data:null,error:d}):await fe(this.fetch,"DELETE",`${this.url}/factors/${n.factorId}`,{headers:this.headers,jwt:(l=c?.session)===null||l===void 0?void 0:l.access_token})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(n){try{return await this._useSession(async r=>{var l,c;const{data:d,error:f}=r;if(f)return this._returnResult({data:null,error:f});const p=Object.assign({friendly_name:n.friendlyName,factor_type:n.factorType},n.factorType==="phone"?{phone:n.phone}:n.factorType==="totp"?{issuer:n.issuer}:{}),{data:m,error:y}=await fe(this.fetch,"POST",`${this.url}/factors`,{body:p,headers:this.headers,jwt:(l=d?.session)===null||l===void 0?void 0:l.access_token});return y?this._returnResult({data:null,error:y}):(n.factorType==="totp"&&m.type==="totp"&&(!((c=m?.totp)===null||c===void 0)&&c.qr_code)&&(m.totp.qr_code=`data:image/svg+xml;utf-8,${m.totp.qr_code}`),this._returnResult({data:m,error:null}))})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _verify(n){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var l;const{data:c,error:d}=r;if(d)return this._returnResult({data:null,error:d});const f=Object.assign({challenge_id:n.challengeId},"webauthn"in n?{webauthn:Object.assign(Object.assign({},n.webauthn),{credential_response:n.webauthn.type==="create"?_1(n.webauthn.credential_response):x1(n.webauthn.credential_response)})}:{code:n.code}),{data:p,error:m}=await fe(this.fetch,"POST",`${this.url}/factors/${n.factorId}/verify`,{body:f,headers:this.headers,jwt:(l=c?.session)===null||l===void 0?void 0:l.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(r){if(se(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(n){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var l;const{data:c,error:d}=r;if(d)return this._returnResult({data:null,error:d});const f=await fe(this.fetch,"POST",`${this.url}/factors/${n.factorId}/challenge`,{body:n,headers:this.headers,jwt:(l=c?.session)===null||l===void 0?void 0:l.access_token});if(f.error)return f;const{data:p}=f;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:v1(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:b1(p.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(n){const{data:r,error:l}=await this._challenge({factorId:n.factorId});return l?this._returnResult({data:null,error:l}):await this._verify({factorId:n.factorId,challengeId:r.id,code:n.code})}async _listFactors(){var n;const{data:{user:r},error:l}=await this.getUser();if(l)return{data:null,error:l};const c={all:[],phone:[],totp:[],webauthn:[]};for(const d of(n=r?.factors)!==null&&n!==void 0?n:[])c.all.push(d),d.status==="verified"&&c[d.factor_type].push(d);return{data:c,error:null}}async _getAuthenticatorAssuranceLevel(n){var r,l,c,d;if(n)try{const{payload:E}=Nl(n);let T=null;E.aal&&(T=E.aal);let k=T;const{data:{user:C},error:D}=await this.getUser(n);if(D)return this._returnResult({data:null,error:D});((l=(r=C?.factors)===null||r===void 0?void 0:r.filter(X=>X.status==="verified"))!==null&&l!==void 0?l:[]).length>0&&(k="aal2");const L=E.amr||[];return{data:{currentLevel:T,nextLevel:k,currentAuthenticationMethods:L},error:null}}
54catch(E){if(se(E))return this._returnResult({data:null,error:E});throw E}const{data:{session:f},error:p}=await this.getSession();if(p)return this._returnResult({data:null,error:p});if(!f)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:m}=Nl(f.access_token);let y=null;m.aal&&(y=m.aal);let v=y;((d=(c=f.user.factors)===null||c===void 0?void 0:c.filter(E=>E.status==="verified"))!==null&&d!==void 0?d:[]).length>0&&(v="aal2");const x=m.amr||[];return{data:{currentLevel:y,nextLevel:v,currentAuthenticationMethods:x},error:null}}async _getAuthorizationDetails(n){try{return await this._useSession(async r=>{const{data:{session:l},error:c}=r;return c?this._returnResult({data:null,error:c}):l?await fe(this.fetch,"GET",`${this.url}/oauth/authorizations/${n}`,{headers:this.headers,jwt:l.access_token,xform:d=>({data:d,error:null})}):this._returnResult({data:null,error:new qt})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(n,r){try{return await this._useSession(async l=>{const{data:{session:c},error:d}=l;if(d)return this._returnResult({data:null,error:d});if(!c)return this._returnResult({data:null,error:new qt});const f=await fe(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:c.access_token,body:{action:"approve"},xform:p=>({data:p,error:null})});return f.data&&f.data.redirect_url&&vt()&&!r?.skipBrowserRedirect&&window.location.assign(f.data.redirect_url),f})}catch(l){if(se(l))return this._returnResult({data:null,error:l});throw l}}async _denyAuthorization(n,r){try{return await this._useSession(async l=>{const{data:{session:c},error:d}=l;if(d)return this._returnResult({data:null,error:d});if(!c)return this._returnResult({data:null,error:new qt});const f=await fe(this.fetch,"POST",`${this.url}/oauth/authorizations/${n}/consent`,{headers:this.headers,jwt:c.access_token,body:{action:"deny"},xform:p=>({data:p,error:null})});return f.data&&f.data.redirect_url&&vt()&&!r?.skipBrowserRedirect&&window.location.assign(f.data.redirect_url),f})}catch(l){if(se(l))return this._returnResult({data:null,error:l});throw l}}async _listOAuthGrants(){try{return await this._useSession(async n=>{const{data:{session:r},error:l}=n;return l?this._returnResult({data:null,error:l}):r?await fe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:c=>({data:c,error:null})}):this._returnResult({data:null,error:new qt})})}catch(n){if(se(n))return this._returnResult({data:null,error:n});throw n}}async _revokeOAuthGrant(n){try{return await this._useSession(async r=>{const{data:{session:l},error:c}=r;return c?this._returnResult({data:null,error:c}):l?(await fe(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:l.access_token,query:{client_id:n.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new qt})})}catch(r){if(se(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(n,r={keys:[]}){let l=r.keys.find(p=>p.kid===n);if(l)return l;const c=Date.now();if(l=this.jwks.keys.find(p=>p.kid===n),l&&this.jwks_cached_at+Cx>c)return l;const{data:d,error:f}=await fe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(f)throw f;return!d.keys||d.keys.length===0||(this.jwks=d,this.jwks_cached_at=c,l=d.keys.find(p=>p.kid===n),!l)?null:l}async getClaims(n,r={}){try{let l=n;if(!l){const{data:E,error:T}
54=await this.getSession();if(T||!E.session)return this._returnResult({data:null,error:T});l=E.session.access_token}const{header:c,payload:d,signature:f,raw:{header:p,payload:m}}=Nl(l);r?.allowExpired||Qx(d.exp);const y=!c.alg||c.alg.startsWith("HS")||!c.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(c.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!y){const{error:E}=await this.getUser(l);if(E)throw E;return{data:{claims:d,header:c,signature:f},error:null}}const v=Xx(c.alg),_=await crypto.subtle.importKey("jwk",y,v,!0,["verify"]);if(!await crypto.subtle.verify(v,_,f,Fx(`${p}.${m}`)))throw new Xu("Invalid JWT signature");return{data:{claims:d,header:c,signature:f},error:null}}catch(l){if(se(l))return this._returnResult({data:null,error:l});throw l}}}es.nextInstanceID={};const k1=es,O1="2.95.3";let Pr="";typeof Deno<"u"?Pr="deno":typeof document<"u"?Pr="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Pr="react-native":Pr="node";const B1={"X-Client-Info":`supabase-js-${Pr}/${O1}`},D1={headers:B1},N1={schema:"public"},M1={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},z1={};function ts(a){"@babel/helpers - typeof";return ts=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ts(a)}function U1(a,n){if(ts(a)!="object"||!a)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var l=r.call(a,n);if(ts(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(a)}function F1(a){var n=U1(a,"string");return ts(n)=="symbol"?n:n+""}function L1(a,n,r){return(n=F1(n))in a?Object.defineProperty(a,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[n]=r,a}function Wm(a,n){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);n&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(a,c).enumerable})),r.push.apply(r,l)}return r}function Qe(a){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Wm(Object(r),!0).forEach(function(l){L1(a,l,r[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Wm(Object(r)).forEach(function(l){Object.defineProperty(a,l,Object.getOwnPropertyDescriptor(r,l))})}return a}const I1=a=>a?(...n)=>a(...n):(...n)=>fetch(...n),H1=()=>Headers,q1=(a,n,r)=>{const l=I1(r),c=H1();return async(d,f)=>{var p;const m=(p=await n())!==null&&p!==void 0?p:a;let y=new c(f?.headers);return y.has("apikey")||y.set("apikey",a),y.has("Authorization")||y.set("Authorization",`Bearer ${m}`),l(d,Qe(Qe({},f),{},{headers:y}))}};function $1(a){return a.endsWith("/")?a:a+"/"}function P1(a,n){var r,l;const{db:c,auth:d,realtime:f,global:p}=a,{db:m,auth:y,realtime:v,global:_}=n,x={db:Qe(Qe({},m),c),auth:Qe(Qe({},y),d),realtime:Qe(Qe({},v),f),storage:{},global:Qe(Qe(Qe({},_),p),{},{headers:Qe(Qe({},(r=_?.headers)!==null&&r!==void 0?r:{}),(l=p?.headers)!==null&&l!==void 0?l:{})}),accessToken:async()=>""};return a.accessToken?x.accessToken=a.accessToken:delete x.accessToken,x}function V1(a){const n=a?.trim();if(!n)throw new Error("supabaseUrl is required.");if(!n.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL($1(n))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var G1=class extends k1{constructor(a){super(a)}},K1=class{constructor(a,n,r){var l,c;this.supabaseUrl=a,this.supabaseKey=n;const d=V1(a);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",d),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",d),this.storageUrl=new URL("storage/v1",d),this.functionsUrl=new URL("functions/v1",d);const f=`sb-${d.hostname.split(".")[0]}-auth-token`,p={db:N1,realtime:z1,auth:Qe(Qe({},M1),{},{storageKey:f}),global:D1},m=P1(r??{},p);if(this.storageKey=(l=m.auth.storageKey)!==null&&l!==void 0?l:"",this.headers=(c=m.global.headers)!==null&&c!==void 0?c:{},m.accessToken)this.accessToken=m.accessToken,this.auth=new Proxy({},{get:(v,_)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(_)} is not possible`)}});else{var y;this.auth=this._initSupabaseAuthClient((y=m.auth)!==null&&y!==void 0?y:{},this.headers,m.global.fetch)}this.fetch=q1(n,this._getAccessToken.bind(this),m.global.fetch),this.realtime=this._initRealtimeClient(Qe({headers:this.headers,accessToken:this._getAccessToken.bind(this)},m.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(v=>this.realtime.setAuth(v)).catch(v=>console.warn("Failed to set initial Realtime auth token:",v)),this.rest=new O_(new URL("rest/v1",d).href,{headers:this.headers,schema:m.db.schema,fetch:this.fetch,timeout:m.db.timeout,urlLengthLimit:m.db.urlLengthLimit}),this.storage=new Ex(this.storageUrl.href,this.headers,this.fetch,r?.storage),m.accessToken||this._listenForAuthEvents()}get functions(){return new S_(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(a){return this.rest.from(a)}schema(a){return this.rest.schema(a)}rpc(a,n={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(a,n,r)}channel(a,n={config:{}}){return this.realtime.channel(a,n)}getChannels(){return this.realtime.getChannels()}removeChannel(a){return this.realtime.removeChannel(a)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var a=this,n,r;if(a.accessToken)return await a.accessToken();const{data:l}=await a.auth.getSession();return(n=(r=l.session)===null||r===void 0?void 0:r.access_token)!==null&&n!==void 0?n:a.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:a,persistSession:n,detectSessionInUrl:r,storage:l,userStorage:c,storageKey:d,flowType:f,lock:p,debug:m,throwOnError:y},v,_){const x={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new G1({url:this.authUrl.href,headers:Qe(Qe({},x),v),storageKey:d,autoRefreshToken:a,persistSession:n,detectSessionInUrl:r,storage:l,userStorage:c,flowType:f,lock:p,debug:m,throwOnError:y,fetch:_,hasCu
54stomAuthorizationHeader:Object.keys(this.headers).some(E=>E.toLowerCase()==="authorization")})}_initRealtimeClient(a){return new Y_(this.realtimeUrl.href,Qe(Qe({},a),{},{params:Qe(Qe({},{apikey:this.supabaseKey}),a?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((a,n)=>{this._handleTokenChanged(a,"CLIENT",n?.access_token)})}_handleTokenChanged(a,n,r){(a==="TOKEN_REFRESHED"||a==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):a==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Y1=(a,n,r)=>new K1(a,n,r);function W1(){if(typeof window<"u")return!1;const a=globalThis.process;if(!a)return!1;const n=a.version;if(n==null)return!1;const r=n.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}W1()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const J1=`https://cqjtjyunnpgaukwgifeq.supabase.co
55`,Q1=`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNxanRqeXVubnBnYXVrd2dpZmVxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzA5MDI5ODcsImV4cCI6MjA4NjQ3ODk4N30.p-UW5RuxtPoF64LK6_W2SuvGJ674gD1eI0UG9Thrcj4
56`,_e=Y1(J1,Q1),Xg=w.createContext({});function X1({children:a}){const[n,r]=w.useState(null),[l,c]=w.useState(null),[d,f]=w.useState(null),[p,m]=w.useState(!0);w.useEffect(()=>{async function _(E){const{data:T,error:k}=await _e.rpc("sync_user_id");if(k){console.error("[Auth] sync_user_id RPC failed:",k.message);const C=await _e.from("users").select("*").eq("id",E).single();C.data?f(C.data):console.error("[Auth] NO user record found for uid:",E)}else T?f(T):console.error("[Auth] sync_user_id returned null — no users row matches this email");m(!1)}_e.auth.getSession().then(({data:{session:E}})=>{r(E),c(E?.user??null),E?.user?_(E.user.id):m(!1)});const{data:{subscription:x}}=_e.auth.onAuthStateChange((E,T)=>{r(T),c(T?.user??null),T?.user?_(T.user.id):(f(null),m(!1))});return()=>x.unsubscribe()},[]);async function y(){await _e.auth.signOut(),f(null)}const v=d?.role==="admin";return u.jsx(Xg.Provider,{value:{session:n,user:l,userMeta:d,loading:p,isAdmin:v,signOut:y},children:a})}function $a(){return w.useContext(Xg)}const Zg=w.createContext({}),Ou=["company","revenue","cost_base","ebitda","industry","hurdle_rate","transformation_readiness","decision_confidence_threshold","financial_weight","strategic_weight","adoption_weight","risk_weight","mission_priorities","wizard_completed"],Z1=["name","fn","tier","budget","cm_budget","horizon","owner","risk","outcome","sensitivity","revenue_impact","pilot_answers","strategic_objective","status","actual_revenue_impact","lessons_learned","mission_priority_index","confidence_score","readiness_indicators","agent_tasks"],ew=["initiative_id","task_name","current_owner_role","decision_authority","deterministic_score","repetitive_score","risk_score","documented_score","oversight_model","escalation_path","quality_metrics","knowledge_gaps"],Jm=["deterministic_score","repetitive_score","risk_score","documented_score"],tw=["current_owner_role","decision_authority","oversight_model","escalation_path","quality_metrics","knowledge_gaps"];function Qm({children:a}){const{userMeta:n,isAdmin:r,user:l}=$a(),{orgId:c}=Sb(),[d,f]=w.useState(null),p=d||(r&&c?c:n?.org_id),[m,y]=w.useState({company:"",revenue:"",cost_base:"",ebitda:"",industry:"universal",hurdle_rate:"3.0",transformation_readiness:"traditional",decision_confidence_threshold:"60"}),[v,_]=w.useState([]),[x,E]=w.useState([]),[T,k]=w.useState([]),[C,D]=w.useState(null),[q,L]=w.useState(!0),X=w.useRef(m);X.current=m,w.useEffect(()=>{if(!p){L(!1);return}let P=!1;async function S(){L(!0),y({company:"",revenue:"",cost_base:"",ebitda:"",industry:"universal",hurdle_rate:"3.0",transformation_readiness:"traditional",decision_confidence_threshold:"60"}),_([]),E([]),k([]);const[G,Y,Z,J,de]=await Promise.all([_e.from("profiles").select("*").eq("org_id",p).single(),_e.from("portfolio_initiatives").select("*").eq("org_id",p).order("created_at",{ascending:!0}),_e.from("organisations").select("*").eq("id",p).single(),_e.from("agent_tasks").select("*").eq("org_id",p).order("created_at",{ascending:!0}),_e.from("bvf_function_rows").select("*").eq("org_id",p)]);let ge=Y.data;(!ge||Y.error&&Y.error.code==="42P01")&&(ge=(await _e.from("initiatives").select("*").eq("org_id",p).order("created_at",{ascending:!0})).data||[]),!P&&(G.data&&y(Oe=>({...Oe,...G.data})),ge&&_(ge),Z.data&&D(Z.data),J.data&&E(J.data),de.data&&k(de.data),L(!1))}S();const N=[];return()=>
56{P=!0,N.forEach(G=>_e.removeChannel(G))}},[p]);const ne=w.useCallback(P=>{y(S=>({...S,...P}))},[]),K=w.useCallback(async()=>{if(!p)return;const P=X.current,S={org_id:p};Ou.forEach(G=>{G in P&&(S[G]=P[G])});const{error:N}=await _e.from("profiles").upsert(S,{onConflict:"org_id"});N&&console.error("[Persist] error:",N)},[p]),Q=w.useCallback(async P=>{let S=p;if(!S){const Z=P.company&&P.company.trim()||"My Organisation",{data:J,error:de}=await _e.from("organisations").insert({name:Z,industry:P.industry||"universal"}).select().single();if(de)throw new Error("Failed to create organisation: "+de.message);if(S=J.id,l?.id){const{error:ge}=await _e.rpc("bootstrap_user_org",{target_org_id:S});ge&&console.error("[Save] Failed to link user to org:",ge.message)}f(S)}y(Z=>({...Z,...P,org_id:S}));const N={...X.current,...P},G={org_id:S};Ou.forEach(Z=>{Z in N&&(G[Z]=N[Z])});const{error:Y}=await _e.from("profiles").upsert(G,{onConflict:"org_id"});if(Y)throw new Error(Y.message);return S},[p,l]),me=w.useCallback(async P=>{const S=P.org_id||p;if(!S)throw new Error("We couldn't find your organisation. Please check your organisation name or ask your workspace admin to invite you directly.");const N={org_id:S};if(Z1.forEach(G=>{G in P&&(N[G]=P[G])}),P.id){const{error:G}=await _e.from("portfolio_initiatives").update(N).eq("id",P.id).eq("org_id",S);if(G)throw new Error(G.message);const Y={...P,...N};return _(Z=>Z.map(J=>J.id===P.id?{...J,...Y}:J)),Y}else{const{data:G,error:Y}=await _e.from("portfolio_initiatives").insert(N).select().single();if(Y)throw new Error(Y.message);return _(Z=>[...Z,G]),G}},[p]),le=w.useCallback(async()=>{let P=p;if(!P){const{data:ge,error:Oe}=await _e.from("organisations").insert({name:"Northstar Manufacturing",industry:"manufacturing"}).select().single();if(Oe)throw new Error("Failed to create sample organisation: "+Oe.message);if(P=ge.id,l?.id){const{error:Vt}=await _e.rpc("bootstrap_user_org",{target_org_id:P});Vt&&console.error("[Sample] Failed to link user to org:",Vt.message)}f(P)}const S={company:"Northstar Manufacturing",revenue:"500M",cost_base:"350M",ebitda:"75M",industry:"manufacturing",transformation_readiness:"traditional",wizard_completed:!0,mission_priorities:[{title:"Reduce operating cost by 12% through workflow redesign",description:""},{title:"Improve order-to-cash cycle time by 25%",description:""},{title:"Build auditable AI governance for EU AI Act readiness",description:""}]},N={org_id:P};Ou.forEach(ge=>{ge in S&&(N[ge]=S[ge])});const{error:G}=await _e.from("profiles").upsert(N,{onConflict:"org_id"});if(G)throw new Error(G.message);const Y=[{name:"Agentic Order Exception Resolver",fn:"supply",tier:"gen3",budget:"3.2M",cm_budget:"240K",horizon:"Now (0-90 days)",owner:"COO / CIO",risk:"High",outcome:"Reduce order exception cycle time by 30%",status:"In Flight",mission_priority_index:1,strategic_objective:"Customer Experience"},{name:"Predictive Maintenance Copilot",fn:"it",tier:"gen2",budget:"1.4M",cm_budget:"210K",horizon:"Next (3-12 months)",owner:"CIO / Plant Ops",risk:"Medium",outcome:"Reduce unplanned downtime by 15%",status:"Planning",mission_priority_index:0,strategic_objective:"Cost Reduction"},{name:"Invoice Matching Automation",fn:"finance",tier:"gen1",budget:"650K",cm_budget:"90K",horizon:"Now (0-90 days)",owner:"CFO / Shared Services",risk:"Low",outcome:"Reduce invoice exception handling and improve close",status:"Live",mission_priority_index:0,strategic_objective:"Cost Reduction"}],Z=new Set(v.map(ge=>ge.name)),J=Y.filter(ge=>!Z.has(ge.name)).map(ge=>({...ge,org_id:P}));let de=[];if(J.length>0){const{data:ge,error:Oe}=await _e.from("portfolio_initiatives").insert(J).select();if(Oe)throw new Error(Oe.message);de=ge||[],_(Vt=>[...Vt,...de])}return y(ge=>({...ge,...S,org_id:P})),{inserted:de.length}},[p,l,v]),$e=w.useCallback(async P=>{_(S=>S.filter(N=>N.id!==P)),E(S=>S.filter(N=>N.initiative_id!==P)),await _e.from("portfolio_initiatives").delete().eq("id",P)},[]),Me=w.useCallback(async P=>{if(!p)throw new Error("We couldn't find your organisation. Please check your organisation name or ask your workspace admin to invite you directly.");const S=J=>{const de=parseInt(J,10);return isNaN(de)?null:Math.max(1,Math.min(10,de))},N=Jm.map(J=>S(P[J])).filter(J=>J!=null),G=N.length>0?N.reduce((J,de)=>J+de,0)/N.length:0,Y=G>=7?"Green":G>=4?"Amber":"Red",Z={org_id:p};
56if(ew.forEach(J=>{J in P&&(Z[J]=P[J])}),Jm.forEach(J=>{J in Z&&(Z[J]=S(Z[J]))}),tw.forEach(J=>{J in Z&&Z[J]===""&&(Z[J]=null)}),Z.agent_readiness=Y,P.id){const{error:J}=await _e.from("agent_tasks").update(Z).eq("id",P.id);if(J)throw new Error(J.message);E(de=>de.map(ge=>ge.id===P.id?{...ge,...Z}:ge))}else{const{data:J,error:de}=await _e.from("agent_tasks").insert(Z).select().single();if(de)throw new Error(de.message);return E(ge=>[...ge,J]),J}},[p]),Pe=w.useCallback(async P=>{E(S=>S.filter(N=>N.id!==P)),await _e.from("agent_tasks").delete().eq("id",P)},[]),oe=P=>P?((P.driver_lead||0)+(P.driver_inspire||0)+(P.driver_care||0)+(P.driver_empower||0)+(P.driver_build||0)+(P.driver_collaborate||0)-6)/24*100:0,je=P=>{if(!P)return 1;const S={critical:.5,high_risk:.5,weak:.5,at_risk:.75,moderate:.75,on_track:.9,strong:.9,compliant:1,exceptional:1,outcome_linked:1};let N=1,G=0,Y=0;return[P.regulatory_readiness,P.clinical_validation,P.clinician_time_reclaimed,P.interoperability].forEach(Z=>{const J=S[Z]||1;J===.5?G++:J===.75&&Y++}),G>0?N=.5:Y>0&&(N=.9*Math.pow(.9,Y-1)),Math.max(.5,N)},Se=w.useCallback(async P=>{if(!p)return null;try{const{data:S,error:N}=await _e.from("initiative_driver_scores").select("*").eq("org_id",p).eq("initiative_id",P).single();if(N&&N.code!=="PGRST116")throw N;return S}catch(S){return console.error("Error fetching driver scores:",S),null}},[p]),I=w.useCallback(async P=>{if(!p)return null;try{const{data:S,error:N}=await _e.from("initiative_healthcare_scores").select("*").eq("org_id",p).eq("initiative_id",P).single();if(N&&N.code!=="PGRST116")throw N;return S}catch(S){return console.error("Error fetching healthcare scores:",S),null}},[p]),B=w.useCallback(async()=>{if(!p)return null;try{const{data:P,error:S}=await _e.from("pace_layer_scores").select("*").eq("org_id",p).single();if(S&&S.code!=="PGRST116")throw S;return P}catch(P){return console.error("Error fetching pace layer scores:",P),null}},[p]),ee=p?{id:p,...C,industry:m.industry||C?.industry}:null,ve=w.useCallback(async P=>{if(!p)return;const S={org_id:p,function_name:P.function_name,board_kpis:P.board_kpis||null,external_pressures:P.external_pressures||null,business_initiatives:P.business_initiatives||null,operating_kpis:P.operating_kpis||null,ai_capabilities:P.ai_capabilities||null,process_function:P.process_function||null};if(P.id){const{error:N}=await _e.from("bvf_function_rows").update(S).eq("id",P.id);if(N)throw new Error(N.message);k(G=>G.map(Y=>Y.id===P.id?{...Y,...S}:Y))}else{const{data:N,error:G}=await _e.from("bvf_function_rows").upsert(S,{onConflict:"org_id,function_name"}).select().single();if(G)throw new Error(G.message);return k(Y=>Y.find(J=>J.org_id===p&&J.function_name===P.function_name)?Y.map(J=>J.id===N.id?N:J):[...Y,N]),N}},[p]);return u.jsx(Zg.Provider,{value:{profile:m,initiatives:v,agentTasks:x,bvfRows:T,organisation:C,loading:q,saveProfile:Q,updateProfileLocal:ne,persistProfile:K,saveInitiative:me,deleteInitiative:$e,seedSampleWorkspace:le,saveAgentTask:Me,deleteAgentTask:Pe,saveBvfRow:ve,org:ee,supabase:_e,calculateCEPercentage:oe,calculateHealthcareReadinessFactor:je,fetchDriverScores:Se,fetchHealthcareScores:I,fetchPaceLayerScores:B},children:a})}const nw="https://www.aibvf.com";function iw(a="/portfolio"){const n=nw,r=new URL("/auth/callback",n);return r.searchParams.set("next",a),r.href}function aw(a){return!a||!a.startsWith("/")||a.startsWith("//")?"/portfolio":a}const Bu="aibvf.portfolioHandoff",Zu="aibvf.pendingPortfolioHandoff";function rw(){try{const a=JSON.parse(window.sessionStorage.getItem(Bu)||"null");if(a?.proposal&&(!a.expiresAt||Date.parse(a.expiresAt)>=Date.now()))return a;a&&window.sessionStorage.removeItem(Bu);const n=JSON.parse(window.localStorage.getItem(Zu)||"null");return n?.handoff?.proposal&&Date.parse(n.expiresAt)>=Date.now()?(window.sessionStorage.setItem(Bu,JSON.stringify(n.handoff)),n.handoff):(window.localStorage.removeItem(Zu),null)}catch{return null}}function Xm(a){return a==null?"Value range not resolved":new Intl.NumberFormat("en-GB",{style:"currency",currency:"EUR",notation:"compact",maximumFractionDigits:1}).format(a)}function sw(){const[a,n]=w.useState(""),[r,l]=w.useState(""),[c,d]=w.useState(!1),[f,p]=w.useState(!1),[m]=w.useState(()=>rw());async function y(_){if(_.preventDefault(),!a||!a.includes("@")){l("Enter a valid work email address.");return}l(""),d(!0);try{m&&window.localStorage.setItem(Zu,JSON.stringify({handoff:m,expiresAt:m.expiresAt||new Date(Date.now()+3600*1e3).toISOString()}));const{error:x}=await _e.auth.signInWithOtp({email:a.trim().toLowerCase(),options:{emailRedirectTo:iw("/portfolio"),shouldCreateUser:!0}});if(x)throw x;p(!0)}catch(x){l(x.message||"The sign-in link could not be sent, please try again.")}finally{d(!1)}}const v=m?.initiative;return u.jsxs("main",{style:{minHeight:"100vh",background:"#EDF2F6",color:"#14243A",fontFamily:"'DM Sans', Arial, sans-serif"},children:[u.jsx("header",{style:{background:"#172C4B",padding:"18px clamp(20px, 5vw, 72px)"},children:u.jsxs("a",{href:"/start",style:{display:"inline-flex",alignItems:"center",gap:11,color:"#FFFFFF",textDecoration:"none"},children:[u.jsx("span",{style:{width:38,height:38,display:"grid",placeItems:"center",border:"2px s
56olid #C98237",borderRadius:8,color:"#E2A667",fontFamily:"Georgia, serif",fontWeight:700,fontSize:13},children:"BVF"}),u.jsxs("span",{children:[u.jsxs("strong",{style:{display:"block",fontSize:15},children:["Craig Horton ",u.jsx("span",{style:{color:"#E2A667"},children:"Advisory"})]}),u.jsx("small",{style:{color:"#BDCAD8",fontSize:10},children:"AI business value framework"})]})]})}),u.jsxs("div",{className:"login-layout",style:{width:"min(1080px, calc(100% - 40px))",margin:"0 auto",padding:"56px 0 72px",display:"grid",gridTemplateColumns:"minmax(0, 1.15fr) minmax(330px, .85fr)",gap:48,alignItems:"start"},children:[u.jsxs("section",{children:[u.jsx("p",{style:{margin:"0 0 12px",color:"#A85F22",fontSize:12,fontWeight:700},children:"Private portfolio workspace"}),u.jsx("h1",{style:{margin:"0 0 18px",maxWidth:620,color:"#14243A",fontFamily:"'Playfair Display', Georgia, serif",fontSize:"clamp(36px, 5vw, 58px)",lineHeight:1.03},children:"Keep the decision with the evidence behind it."}),u.jsx("p",{style:{margin:"0 0 28px",maxWidth:650,color:"#40536C",fontSize:18,lineHeight:1.65},children:"Use a work email to create a private organisation workspace, then decide whether the provisional assessment should enter the portfolio. The account keeps the evidence, owners and re-score history connected."}),m?u.jsxs("section",{style:{padding:"22px 24px",background:"#FFFFFF",border:"1px solid #D6DEE8",borderLeft:"4px solid #B87333",boxShadow:"0 10px 26px rgba(22,44,75,.07)"},children:[u.jsx("div",{style:{color:"#9A5C21",fontSize:11,fontWeight:700,marginBottom:7},children:"Assessment waiting in this browser"}),u.jsx("h2",{style:{margin:"0 0 11px",color:"#14243A",fontSize:20,lineHeight:1.35},children:m.proposal}),u.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px 18px",color:"#40536C",fontSize:13},children:[u.jsx("strong",{style:{color:"#9A5C21"},children:v?.classification||"Provisional"}),u.jsxs("span",{children:[Xm(v?.net_low_eur)," to ",Xm(v?.net_high_eur)]}),u.jsxs("span",{children:["Decision score ",v?.confidence??"not resolved"," of 100"]})]}),u.jsx("p",{style:{margin:"13px 0 0",color:"#66788F",fontSize:12,lineHeight:1.55},children:"This record expires after one hour, and it still requires your confirmation before it enters the portfolio."})]}):u.jsxs("section",{style:{padding:"20px 22px",borderTop:"1px solid #CBD6E1",borderBottom:"1px solid #CBD6E1"},children:[u.jsx("strong",{style:{display:"block",marginBottom:7},children:"No assessment is waiting"}),u.jsx("span",{style:{color:"#66788F",fontSize:14},children:"Create an empty workspace here, or return to the public assessment and test one initiative first."})]}),u.jsxs("div",{style:{display:"grid",gap:12,marginTop:28},children:[u.jsxs("div",{children:[u.jsx("strong",{style:{display:"block",marginBottom:3},children:"Passwordless access"}),u.jsx("span",{style:{color:"#66788F",fontSize:13},children:"Supabase sends a magic link to the email address you enter."})]}),u.jsxs("div",{children:[u.jsx("strong",{style:{display:"block",marginBottom:3},children:"Organisation boundary"}),u.jsx("span",{style:{color:"#66788F",fontSize:13},children:"Portfolio records are scoped to your organisation through database row-level security."})]}),u.jsxs("div",{children:[u.jsx("strong",{style:{display:"block",marginBottom:3},children:"Your decision to save"}),u.jsx("span",{style:{color:"#66788F",fontSize:13},children:"The public assessment stays in the browser until you confirm the portfolio import."})]})]})]}),u.jsxs("section",{style:{padding:30,background:"#FFFFFF",borderTop:"3px solid #B87333",boxShadow:"0 12px 32px rgba(22,44,75,.1)"},children:[u.jsx("h2",{style:{margin:"0 0 7px",color:"#14243A",fontSize:24},children:"Create or open your workspace"}),u.jsx("p",{style:{margin:"0 0 24px",color:"#66788F",fontSize:14,lineHeight:1.5},children:"New and returning users follow the same secure email-link process."}),r&&u.jsx("div",{role:"alert",style:{marginBottom:16,padding:"11px 13px",background:"#FFF1F0",borderLeft:"3px solid #B42318",color:"#8E1B12",fontSize:13},children:r}),f?u.jsxs("div",{style:{padding:"18px 0 4px"},children:[u.jsx("strong",{style:{display:"block",marginBottom:8,fontSize:18},children:"Check your inbox"}),u.jsxs("p",{style:{margin:0,color:"#40536C",lineHeight:1.6},children:["Open the sign-in link sent to ",u.jsx("strong",{children:a})," in this browser, the pending assessment will continue into the workspace."]})]}):u.jsxs("form",{onSubmit:y,children:[u.jsx("label",{htmlFor:"workspace-email",style:{display:"block",marginBottom:7,fontSize:13,fontWeight:700},children:"Work email"}),u.jsx("input",{id:"workspace-email",type:"email",value:a,onChange:_=>n(_.target.value),placeholder:"[email protected]",autoComplete:"email",required:!0,style:{width:"100%",minHeight:48,padding:"11px 13px",border:"1px solid #BFCBD7",borderRadius:4,background:"#F5F8FB",color:"#14243A",fontSize:15}}),u.jsx("button",{type:"submit",disabled:c,style:{width:"100%",minHeight:48,marginTop:14,border:0,borderRadius:4,background:"#B87333",color:"#FFFFFF",fontWeight:700,fontSize:14,cursor:c?"wait":"pointer",opacity:c?.65:1},children:c?"Sending the secure link...":"Email my secure sign-in link"}),u.jsx("p",{style:{margin:"13px 0 0",color:"#66788F",fontSize:11,lineHeight:1.5},children:"By continuing, you ask AI BVF to create or open an organisation-scoped workspace for this email address. Do not enter confidential assessment content on a shared device."})]}),u.jsx("a",{href:"/start",style:{display:"inline-block",marginTop:22,color:"#9A5C21",fontSize:13,fontWeight:700,textDecoration:"none"},children:"Return to the assessment"})]})]}),u.jsx("style",{children:"@media (max-width: 820px) { .login-layout { grid-template-columns: 1fr !important; gap: 28px !important; padding-top: 36px !important; } }"})]})}const lw="modulepreload",ow=function(a){return"/"+a},Zm={},In=function(n,r,l){let c=Promise.resolve();if(r&&r.length>
560){let m=function(y){return Promise.all(y.map(v=>Promise.resolve(v).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");c=m(r.map(y=>{if(y=ow(y),y in Zm)return;Zm[y]=!0;const v=y.endsWith(".css"),_=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${_}`))return;const x=document.createElement("link");if(x.rel=v?"stylesheet":lw,v||(x.as="script"),x.crossOrigin="",x.href=y,p&&x.setAttribute("nonce",p),document.head.appendChild(x),v)return new Promise((E,T)=>{x.addEventListener("load",E),x.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(f){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=f,window.dispatchEvent(p),!p.defaultPrevented)throw f}return c.then(f=>{for(const p of f||[])p.status==="rejected"&&d(p.reason);return n().catch(d)})};function ey(){return w.useContext(Zg)}const dd=[{id:"finance",label:"Finance & CFO",icon:"◈"},{id:"hr",label:"HR & Workforce",icon:"◎"},{id:"sales",label:"Sales & Revenue",icon:"◆"},{id:"supply",label:"Supply Chain",icon:"⬡"},{id:"cx",label:"Customer Experience",icon:"◉"},{id:"risk",label:"Risk & Compliance",icon:"◪"},{id:"it",label:"IT & Platform",icon:"◫"},{id:"rd",label:"R&D / Innovation",icon:"◬"}],sS=[{id:"board",label:"Board KPIs",note:"NORTH ↑"},{id:"external",label:"External Pressures",note:"↓"},{id:"initiatives",label:"Business Initiatives",note:"↓"},{id:"operating",label:"Operating KPIs",note:"↓"},{id:"process",label:"Process / Function",note:"↓"},{id:"ai",label:"AI Capabilities",note:"SOUTH ↓"}],lS={board:"Write here… (e.g. inventory efficiency, supplier risk, margin protection)",external:"Write here… (e.g. inflation, regulation, competitive pressure)",initiatives:"Write here… (e.g. cost reduction programme, ERP upgrade)",operating:"Write here… (e.g. cycle time, forecast accuracy, cost per unit)",process:"Write here… (e.g. record-to-report, order-to-cash)",ai:"Write here… (e.g. predictive forecasting, anomaly detection)"},cw=[{id:"gen1",label:"Gen 1 — Automation",short:"Gen 1",color:"#9BAEC8",desc:"RPA, rule-based automation, workflow triggers"},{id:"gen2",label:"Gen 2 — GenAI",short:"Gen 2",color:"#B87333",desc:"LLM-powered assistants, content generation, semantic search"},{id:"gen3",label:"Gen 3 — Agentic",short:"Gen 3",color:"#8B5CF6",desc:"Autonomous multi-step agents, decision-making, self-orchestration"}],uw={finance:{rev:{lo:.01,hi:.03},cost:{lo:.03,hi:.06},ebt:{lo:0,hi:0},drivers:["Close cycle reduction","FP&A and forecasting","Anomaly detection and write-off prevention","Capital allocation"],source:"AI BVF modelled planning range"},hr:{rev:{lo:.005,hi:.015},cost:{lo:.02,hi:.04},ebt:{lo:0,hi:0},drivers:["Attrition and replacement cost","HR service operations","Onboarding","Skills-based workforce deployment"],source:"AI BVF modelled planning range"},sales:{rev:{lo:.03,hi:.08},cost:{lo:.01,hi:.025},ebt:{lo:0,hi:0},drivers:["Personalisation","Lead and pipeline quality","Deal coaching","Sales operations"],source:"AI BVF modelled planning range"},supply:{rev:{lo:.005,hi:.015},cost:{lo:.04,hi:.09},ebt:{lo:.005,hi:.015},drivers:["Unplanned downtime","Inventory holding cost","Quality and rework","Service levels"],source:"AI BVF modelled planning range"},cx:{rev:{lo:.02,hi:.05},cost:{lo:.02,hi:.05},ebt:{lo:0,hi:0},drivers:["Self-service and containment","Handling time and first-contact resolution","Retention and customer lifetime value"],source:"AI BVF modelled planning range"},risk:{rev:{lo:.005,hi:.01},cost:{lo:.02,hi:.04},ebt:{lo:0,hi:0},drivers:["False positives and case handling","Regulatory reporting effort","Continuous control monitoring","Approval cycle time"],source:"AI BVF modelled planning range"},it:{rev:{lo:.005,hi:.015},cost:{lo:.03,hi:.07},ebt:{lo:0,hi:0},drivers:["Incident volume and resolution time","AIOps prevention","Service automation","Platform throughput"],source:"AI BVF modelled planning range"},rd:{rev:{lo:.01,hi:.04},cost:{lo:.01,hi:.03},ebt:{lo:0,hi:0},drivers:["Development cycle time","Design and simulation","Research and IP analysis","R&D resource allocation"],source:"AI BVF modelled planning range"}},eg={universal:{finance:1,hr:1,sales:1,supply:1,cx:1,risk:1,it:1,rd:1},creative:{finance:1,hr:1,sales:1.3,supply:1,cx:1.3,risk:1,it:1,rd:1.2},education:{finance:1,hr:1.2,sales:1,supply:1,cx:1,risk:1,it:1.2,rd:1.4},energy:{finance:1,hr:1,sales:1,supply:1.4,cx:1,risk:1.3,it:1.3,rd:1},financial:{finance:1.4,hr:1.1,sales:1.2,supply:.7,cx:1.3,risk:1.5,it:1.1,rd:.8},healthcare:{finance:1.1,hr:1.1,sales:1,supply:.8,cx:1.1,risk:1.4,it:1,rd:1.5},logistics:{finance:1.2,hr:1,sales:1,supply:1.5,cx:1,risk:1,it:1.3,rd:1},manufacturing:{finance:1,hr:1,sales:.9,supply:1.4,cx:.9,risk:1.1,it:1.3,rd:1.1},nonprofit:{finance:1.1,hr:1.2,sales:1,supply:1,cx:1.2,risk:1,it:1,rd:1},professional:{finance:1,hr:1.2,sales:1.4,supply:1,cx:1.3,risk:1,it:1,rd:1},public_sector:{finance:1,hr:1.2,sales:1,supply:1,cx:1,risk:1.3,it:1.2,rd:1},real_estate:{finance:1.3,hr:1,sales:1.2,supply:1.2,cx:1,risk:1,it:1,rd:1},retail:{finance:1,hr:1,sales:1.4,supply:1.2,cx:1.4,risk:.9,it:1,rd:.8},technology:{finance:1,hr:1.1,sales:1.2,supply:.8,cx:1.1,risk:1,it:1.4,rd:1.4}},oS={finance:{board:{c:"Operating Income · Free Cash Flow · Revenue Growth"},external:{c:"Inflation · FX volatility · Interest rate cycles · Tariffs"},initiatives:{c:"Finance transformation · Cost reduction · Capital reallocation"},operating:{c:"Close cycle time · Forecast accuracy · Cost-to-finance ratio"}
56,process:{c:"Record-to-report · Procure-to-pay · Order-to-cash · Treasury operations"},ai:{c:"Predictive forecasting · Automated close · GenAI FP&A · Anomaly detection"}},hr:{board:{c:"Talent retention · Workforce productivity · Cost-per-hire"},external:{c:"Skills shortage · Hybrid work complexity · Generational shifts"},initiatives:{c:"Workforce transformation · Upskilling · Culture change"},operating:{c:"Time-to-hire · Employee NPS · Attrition rate · Training completion"},process:{c:"Hire-to-retire · Performance management · Learning & development · Payroll"},ai:{c:"GenAI HR service desk · Skills intelligence · Predictive attrition · Onboarding automation"}},sales:{board:{c:"Revenue growth · New market entry · Customer lifetime value"},external:{c:"Consumer pricing sensitivity · Private label rise · Market saturation"},initiatives:{c:"New market expansion · Account growth · Sales productivity"},operating:{c:"Win rate · Pipeline velocity · Average deal size · Forecast accuracy"},process:{c:"Lead-to-cash · Account planning · Quote-to-order · Territory management"},ai:{c:"Predictive lead scoring · AI deal coaching · Revenue intelligence · Dynamic pricing"}},supply:{board:{c:"Inventory efficiency · Supplier risk · Margin protection"},external:{c:"Geopolitics · Tariffs · Climate disruption · PPWR / ESPR"},initiatives:{c:"Supply chain digitalisation · Nearshoring · ESG traceability"},operating:{c:"OEE · On-time delivery · Inventory turns · Defect rate · Yield"},process:{c:"Plan-to-produce · Source-to-deliver · Warehouse operations · Returns management"},ai:{c:"Demand sensing · Predictive maintenance · ESG traceability · Quality inspection AI"}},cx:{board:{c:"Customer retention · NPS · Revenue from existing customers"},external:{c:"Shifting expectations · Digital-native competition · Channel proliferation"},initiatives:{c:"CX transformation · Omnichannel · Personalisation at scale"},operating:{c:"CSAT · First Contact Resolution · AHT · Self-service deflection rate"},process:{c:"Enquiry-to-resolution · Onboarding · Retention & renewal · Feedback loop"},ai:{c:"GenAI service agents · Sentiment analysis · Personalisation engines · Proactive outreach"}},risk:{board:{c:"Risk-adjusted margin · Regulatory fines avoidance · Audit confidence"},external:{c:"EU AI Act · DORA · CSRD · AML/sanctions · ESPR"},initiatives:{c:"Regulatory transformation · Fraud reduction · ESG reporting · Model risk"},operating:{c:"False positive rate · Audit cycle time · Compliance coverage · Fraud loss ratio"},process:{c:"Risk assessment · Compliance monitoring · Incident response · Audit & reporting"},ai:{c:"Regulatory AI · AML/fraud detection · ESG reporting automation · Model risk governance"}},it:{board:{c:"IT cost ratio · Platform resilience · Technology debt reduction"},external:{c:"Vendor consolidation · Cybersecurity escalation · Cloud cost pressure"},initiatives:{c:"Platform consolidation · Technical debt · IT modernisation"},operating:{c:"MTTR · Incident volume · Platform health score · Deflection rate"},process:{c:"Request-to-deploy · Incident management · Change management · Capacity planning"},ai:{c:"AIOps · Predictive incident management · GenAI ITSM · Automated remediation"}},rd:{board:{c:"Innovation pipeline · Time-to-market · IP value creation"},external:{c:"Competitor innovation pace · Patent landscape · Regulatory timelines"},initiatives:{c:"Product innovation · Clinical development · R&D efficiency"},operating:{c:"Time-to-prototype · R&D cost-per-outcome · Trial success rate"},process:{c:"Ideation-to-prototype · Testing & validation · IP management · Technology transfer"},ai:{c:"Generative design · Literature synthesis · Simulation acceleration · IP analysis"}}},cS=[{id:"euai",label:"EU AI Act",color:"#FF4444",icon:"⚖",shortLabel:"EU AI Act",risk:"High Risk",timeline:"Aug 2026 — Feb 2027",obligations:["High-risk AI systems must register in EU database","Mandatory conformity assessments for high-risk use cases","Human oversight requirements for automated decisions","Incident reporting to national authorities within 15 days"],costDrivers:["Compliance audit & gap assessment","Technical documentation & logging infrastru
56cture","Human oversight staffing","Registration & conformity process"],costRange:{lo:5e-4,hi:.002},desc:"The EU AI Act classifies AI systems by risk. High-risk categories include HR, credit scoring, critical infrastructure, and law enforcement. Full compliance mandatory by August 2026.",source:"EU AI Act — Regulation 2024/1689, Aug 2024"},{id:"dora",label:"DORA",color:"#F59E0B",icon:"🛡",shortLabel:"DORA",risk:"Financial Services",timeline:"Jan 2025",obligations:["ICT risk management framework with AI oversight","Third-party AI provider risk assessments","Digital operational resilience testing (TLPT)","Incident classification & reporting within 4 hours"],costDrivers:["ICT risk framework uplift for AI systems","Third-party provider due diligence","Resilience testing programme","Reporting infrastructure"],costRange:{lo:.001,hi:.003},desc:"DORA applies to all financial entities in the EU including banks, insurers, investment firms, and crypto-asset service providers. AI systems must be included in ICT risk frameworks.",source:"DORA — Regulation 2022/2554, in force Jan 2025"},{id:"csrd",label:"CSRD",color:"#22C55E",icon:"🌱",shortLabel:"CSRD",risk:"ESG Reporting",timeline:"2024–2028 phased",obligations:["Mandatory AI-assisted ESG data collection & reporting","Third-party verification of sustainability claims","Double materiality assessment including AI impact","Value chain emissions including AI energy consumption"],costDrivers:["ESG data platform & AI tooling","Third-party assurance engagement","Internal ESG reporting capability","Technology carbon footprint measurement"],costRange:{lo:3e-4,hi:.0015},desc:"CSRD requires large companies to report on environmental and social impact including AI-related energy consumption. AI can both assist reporting and must be reported on.",source:"CSRD — Directive 2022/2464, phased 2024–2028"},{id:"gdpr",label:"GDPR / AI",color:"#8B5CF6",icon:"🔒",shortLabel:"GDPR AI",risk:"Data Privacy",timeline:"Ongoing",obligations:["Automated decision-making rights (Art. 22) for AI","Data minimisation requirements in model training","Privacy impact assessments for AI use cases","Right to explanation for AI-driven decisions"],costDrivers:["Privacy-by-design AI development uplift","Data governance & lineage tooling","DPO capacity for AI assessments","Explainability layer development"],costRange:{lo:2e-4,hi:.001},desc:"GDPR's Article 22 restricts solely automated decisions with legal effects. AI deployments in HR, credit, and customer service face the highest exposure.",source:"GDPR Art. 22 — as applied to AI systems, EDPB Guidelines 2023"}],uS=[{key:"sponsored",q:"Does this initiative have named C-suite sponsorship?"},{key:"owner",q:"Is there a named business owner accountable for adoption?"},{key:"scaled",q:"Has this moved beyond pilot / PoC stage?"},{key:"kpi",q:"Is success tied to a specific board-level KPI?"},{key:"funded",q:"Is the change management budget separately funded?"}],ns={universal:"Universal / Other",creative:"Creative & Media",education:"Education & Research",energy:"Energy & Utilities",financial:"Financial Services",healthcare:"Healthcare / MedTech",logistics:"Logistics & Transportation",manufacturing:"Manufacturing & Supply Chain",nonprofit:"Non-Profit & NGO",professional:"Professional Services",public_sector:"Public Sector & Government",real_estate:"Real Estate & Construction",retail:"Retail / Consumer",technology:"Technology"},Ua=[{id:"siloed",label:"Siloed & Bureaucratic",multiplier:2},{id:"traditional",label:"Traditional Hierarchy",multiplier:1.5},{id:"agile",label:"Agile & Collaborative",multiplier:.7}],dS={agile:{low:.85,high:1,label:"Agile & Collaborative"},traditional:{low:.5,high:.7,label:"Traditional Hierarchy"},siloed:{low:.25,high:.4,label:"Siloed & Bureaucratic"}},hS=["Cost Reduction","Revenue Growth","Competitive Necessity","Regulatory Compliance","Customer Experience","Risk Mitigation"],fS=[{title:"Priority 1",description:"Click to define your first mission priority",linked_objectives:[]},{title:"Priority 2",description:"Click to define your second mission priority",linked_objectives:[]},{title:"Priority 3",description:"Click to define your third mission priority",linked_objectives:[]}],pS=["Planning","In Flight","Live","Retired"],dw={gen1:12,gen2:18,gen3:24},hw={"Competitive Necessity":100,"Regulatory Compliance":90,"Revenue Growth":80,"Customer Experience":70,"Risk Mitigation":60,"Cost Reduction":50},fw={"Safe for Agentic AI":100,"Low Risk":100,"Safe to Deploy":100,"Proceed with Caution":70,"Moderate Risk":70,"Enhanced Governance Required":40},mS={green:{label:"At reference",bg:"rgba(34,197,94,0.2)",border:"#22C55E",text:"#22C55E",desc:"≥ 10% allocated, at or above the AI BVF planning reference"},amber:{label:"Below reference",bg:"rgba(245,158,11,0.2)",border:"#F59
56E0B",text:"#F59E0B",desc:"5–10% allocated, test whether the change plan is fully funded"},red:{label:"Low allocation",bg:"rgba(255,68,68,0.2)",border:"#FF4444",text:"#FF4444",desc:"< 5% allocated, named change resources and activities may be missing"}};function Du(a){return!a||a===0?"—":a>=1e9?`€${(a/1e9).toFixed(1)}B`:a>=1e6?`€${(a/1e6).toFixed(1)}M`:a>=1e3?`€${(a/1e3).toFixed(0)}K`:`€${a.toFixed(0)}`}function bt(a){if(!a)return 0;const n=String(a).replace(/[€,\s]/g,"").toUpperCase();return/BN$/.test(n)||n.endsWith("B")?parseFloat(n)*1e9:/MN$/.test(n)||n.endsWith("M")?parseFloat(n)*1e6:n.endsWith("K")?parseFloat(n)*1e3:parseFloat(n)||0}function gS(a,n){return n>0?(a/n*100).toFixed(1)+"%":"—"}function yS(a,n){if(!n)return null;const r=a/n;return r>=.1?"green":r>=.05?"amber":"red"}function vS(a){const n=eg[a]||eg.universal,r={};return dd.forEach(l=>{const c=uw[l.id],d=n[l.id]||1;r[l.id]={rev:{lo:c.rev.lo*d,hi:c.rev.hi*d},cost:{lo:c.cost.lo*d,hi:c.cost.hi*d},ebt:{lo:c.ebt.lo*d,hi:c.ebt.hi*d},drivers:c.drivers,source:c.source}}),r}function bS(a,n){const r=bt(n.revenue),l=bt(n.cost_base),c=bt(n.ebitda);let d=0,f=0,p=0,m=0,y=0,v=0;return dd.forEach(_=>{const x=a[_.id];d+=r*x.rev.lo,f+=r*x.rev.hi,p+=l*x.cost.lo,m+=l*x.cost.hi,y+=c*x.ebt.lo,v+=c*x.ebt.hi}),{rL:d,rH:f,cL:p,cH:m,eL:y,eH:v,totL:p+d*.2+y,totH:m+f*.2+v}}function ty(a){if(!a)return null;const n=Object.values(a);if(n.every(c=>!c))return null;const r=n.filter(c=>c==="yes").length,l=n.filter(c=>c).length;return{score:r,total:l,label:r>=4?"LOW RISK":r>=2?"PILOT TRAP RISK":"CRITICAL PILOT TRAP",color:r>=4?"#22C55E":r>=2?"#F59E0B":"#FF4444"}}function pw(a){return a==="finance"||a==="hr"||a==="risk"?"Agent-Proof":a==="it"||a==="sales"||a==="supply"||a==="rd"?"Agent-Augmented":"Agent-Replaceable"}function mw(a,n){const r={icon:"🟢",color:"#00875A",bg:"#E3FCEF",border:"#00875A"},l={icon:"🟡",color:"#B45309",bg:"#FFFBEB",border:"#F59E0B"},c={icon:"🔴",color:"#B91C1C",bg:"#FEF2F2",border:"#EF4444"};return a==="Agent-Proof"?n==="gen1"?{...r,label:"Low Risk",desc:"Rule-based automation is safe for systems of record"}:n==="gen2"?{...l,label:"Moderate Risk",desc:"GenAI on systems of record requires human oversight of outputs"}:{...c,label:"Enhanced Governance Required",desc:"Systems of record requiring deterministic precision — human oversight and audit trails essential for agentic deployment"}:a==="Agent-Augmented"?n==="gen1"?{...r,label:"Low Risk",desc:"Rule-based automation is low risk for this function"}:n==="gen2"?{...r,label:"Safe to Deploy",desc:"GenAI enhances human judgment effectively in this function"}:{...l,label:"Proceed with Caution",desc:"AI enhances human judgment — agentic deployment viable with appropriate guardrails"}:n==="gen1"?{...r,label:"Low Risk",desc:"Rule-based automation is low risk for this function"}:n==="gen2"?{...r,label:"Safe to Deploy",desc:"GenAI is well-suited for this function with standard controls"}:{...r,label:"Safe for Agentic AI",desc:"Core workflows well-suited for autonomous AI agents — low governance risk"}}function ny(a){return a.revenue&&a.cost_base&&a.ebitda}function _S(a,n){const r=bt(a),l=bt(n);return r<=0||l<=0?null:l/r*12}function xS(a,n){if(a===null)return null;const r=Ua.find(c=>c.id===n),l=r?r.multiplier:1.5;return a*l}function iy(a,n){if(!a||a.tier!=="gen3")return{adoptionPenalty:0,riskPenalty:0};const r=n.filter(p=>p.initiative_id===a.id),l=r.length===0?-15:0,c=r.filter(p=>p.agent_readiness==="Green"||p.agent_readiness==="Amber"),d=c.filter(p=>!p.oversight_model||!p.escalation_path||!p.quality_metrics),f=c.length>0?Math.round(-20*(d.length/c.length)):0;return{adoptionPenalty:l,riskPenalty:f}}function wS(a){if(!a||a.length===0)return 0;const n=a.filter(r=>r.oversight_model&&r.escalation_path&&r.quality_metrics);return Math.round(n.length/a.length*100)}function ay(a,n){const r=dw[a];if(!r)return 0;const l=Ua.find(f=>f.id===n),c=l?l.multiplier:1.5,d=r*c;return d<=r?100:d>=r*3?0:Math.floor(100*r/d)}function ry(a){return a&&hw[a]||0}function sy(a,n,r,l=null,c=[]){let d=a==="agile"?100:a==="traditional"?60:30;if(n){const f=n.funded;f==="yes"?d+=20:f==="partial"?d+=10:f==="no"&&(d-=20)}if(r==="Low"?d+=10:r==="High"&&(d-=10),l&&c.length>0){const{adoptionPenalty:f}=iy(l,c);d+=f}return Math.max(0,Math.min(100,d))}function ly(a,n,r,l=null,c=[]){const d=pw(a),f=mw(d,n);let p=fw[f.label]||50;const m=ty(r);let y;if(m&&m.total>0){const v=m.score*20;y=Math.round((p+v)/2)}else y=p;if(l&&c.length>0){const{riskPenalty:v}=iy(l,c);y+=v}return Math.max(0,Math.min(100,y))}function SS(a,n,r=[]){if(!a.tier)return null;const l=n.transformation_readiness||"traditional",c=ay(a.tier,l),d=ry(a.strategic_objective),f=sy(l,a.pilot_answers,a.risk,a,r),p=ly(a.fn,a.tier,a.pilot_answers,a,r),x=Math.round((c*30+d*40+f*20+p*10)/100),E=Array.isArray(a.readiness_indicators)?[...a.readiness_indicators].reverse().find(D=>D?.type==="aibvf_assessment"):null,T=Number(a.confidence_score??E?.confidence),k=Number.isFinite(T),C=E?.scores||{};return{score:k?Math.max(0,Math.min(100,Math.round(T))):x,financial:Number.isFinite(Number(C.financial_return))?Number(C.financial_return):c,strategic:Number.isFinite(Number(C.strategic_alignment))?Number(C.strategic_alignment):d,adoption:Number.isFinite(Number(C.change_enablement))?Number(C.change_enablement):f,risk:Number.isFinite(Number(C.governance_risk))?100-Number(C.governance_risk):p,source:k?"aibvf_assessment":"portfolio_model"}}function ES(a,n,r,l=[]){if(!a.tier)return null;const c=ay(a.tier,r),d=ry(a.strategic_objective),f=sy(r,a.pilot_answers,a.risk,a,l),p=ly(a.fn,a.tier,a.pilot_answers,a,l);return{score:Math.round((c*30+d*40+f*20+p*10)/100),financial:c,strategic:d,adoption:f,risk:p}}const oy=60;function gw(){return oy}function AS(a,n){if(a==null)return null;const r=Number.isFinite(Number.parseFloat(n))?Number.parseFloat(n):oy;return a>=r?{label:"✓",color:"#22C55E",bg:"rgba(34,197,94,0.2)",status:"pass"}:a>=r-15?{label:"⚠",color:"#F59E0B",bg:"rgba(245,158,11,0.2)",status:"close"}:{label:"✗",color:"#FF4444",bg:"rgba(255,68,68,0.2)",status:"fail"}}function yw(){const{profile:a,updateProfileLocal:n,persistProfile:r}=ey(),[l,c]=w.useState(!1),d=w.useRef(null),[f,p]=w.useState(!1),m=w.useRef(null),y=ny(a),v=gw(),_=!y||l;w.useEffect(()=>()=>{d.current&&(clearTimeout(d.current),r())},[r]);const x=w.useCallback((D,q)=>{n({[D]:q}),["revenue","cost_base","ebitda","transformation_readiness","industry"].includes(D)&&(p(!0),clearTimeout(m.current),m.current=setTimeout(()=>p(!1),1200)),clearTimeout(d.current),d.current=setTimeout(()=>{r()},600)},[n,r]),E=bt(a.revenue),T=bt(a.cost_base),k=bt(a.ebitda),C=y?[{l:"Company",v:a.company||"—"},{l:"Industry",v:ns[a.industry]||"—"},{l:"Revenue",v:Du(E)},{l:"Cost Base",v:Du(T)},{l:"EBITDA",v:Du(k)},{l:"Decision threshold",v:`${v}%`},{l:"Readiness",v:Ua.find(D=>D.id===(a.transformation_readiness||"traditional"))?.label||"Traditional"}]:[];return u.jsxs("div",{style:{borderBottom:"1px solid #D2DBE5",background:"#F7F9FB"},children:[u.jsxs("button",{onClick:()=>y&&c(D=>!D),"aria-expanded":_,style:{width:"100%",padding:"12px clamp(20px, 4vw, 56px)",background:"transparent",border:"none",cursor:y?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"space-between",gap:16},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,flexWrap:"wrap"},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[u.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:y?"#5FE0A0":"#F7C46B",boxShadow:`0 0 6px ${y?"#5FE0A0":"#F7C46B"}`}}),u.jsx("span",{style:{fontSize:11,fontFamily:"'Trebuchet MS', sans-serif",color:y?"#18864B":"#9A5C21",fontWeight:700,letterSpacing:0},children:y?"Company profile active":"Enter the company profile"})]}),y&&u.jsxs("div",{style:{display:"flex",gap:20,flexWrap:"wrap",alignItems:"center"},children:[C.map(D=>u.jsxs("div",{style:{display:"flex",gap:6,alignItems:"baseline"},children:[u.jsx("span",{style:{fontSize:9,color:"#60748A",fontFamily:"'Trebuchet MS', sans-serif",letterSpacing:0},children:D.l}),u.jsx("span",{style:{fontSize:12,color:"#172C4B",fontFamily:"'Trebuchet MS', sans-serif",fontWeight:600},children:D.v})]}
56,D.l)),f&&u.jsx("span",{style:{fontSize:10,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif",fontStyle:"italic",animation:"bvf-fade-in-out 1.2s forwards"},children:"Recalculating benchmarks..."})]})]}),u.jsx("span",{style:{color:"#B87333",fontSize:14},children:_?"▲":"▼"})]}),_&&u.jsx("div",{style:{padding:"0 clamp(20px, 4vw, 56px) 24px"},children:u.jsxs("div",{className:"grid-auto",style:{marginBottom:14},children:[u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Company Name"}),u.jsx("input",{type:"text",value:a.company||"",placeholder:"e.g. Philips",onChange:D=>x("company",D.target.value)})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Annual Revenue"}),u.jsx("input",{type:"text",value:a.revenue||"",placeholder:"e.g. 500M",onChange:D=>x("revenue",D.target.value)})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Annual Cost Base"}),u.jsx("input",{type:"text",value:a.cost_base||"",placeholder:"e.g. 350M",onChange:D=>x("cost_base",D.target.value)})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Current EBITDA"}),u.jsx("input",{type:"text",value:a.ebitda||"",placeholder:"e.g. 75M",onChange:D=>x("ebitda",D.target.value)})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Industry"}),u.jsx("select",{value:a.industry||"universal",onChange:D=>x("industry",D.target.value),children:Object.entries(ns).map(([D,q])=>u.jsx("option",{value:D,children:q},D))})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Transformation Readiness"}),u.jsx("select",{value:a.transformation_readiness||"traditional",onChange:D=>x("transformation_readiness",D.target.value),children:Ua.map(D=>u.jsx("option",{value:D.id,children:D.label},D.id))}),u.jsxs("div",{style:{fontSize:10,color:"#60748A",marginTop:3,fontFamily:"'Trebuchet MS', sans-serif"},children:["Payback multiplier: ",(Ua.find(D=>D.id===(a.transformation_readiness||"traditional"))?.multiplier||1.5).toFixed(1),"×"]})]})]})})]})}const ke={overlay:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.85)",overflow:"auto",padding:"24px 0"},container:{maxWidth:640,margin:"0 auto",background:"#0F1E35",border:"1px solid rgba(184,115,51,0.3)",borderRadius:6,overflow:"hidden",position:"relative"},header:{padding:"28px 36px 20px",background:"linear-gradient(135deg,rgba(13,31,60,0.95),rgba(22,45,78,0.95))",borderBottom:"3px solid #B87333"},body:{padding:"24px 36px 32px"},brand:{fontSize:9,letterSpacing:3,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif",marginBottom:6},title:{fontSize:20,fontWeight:700,color:"#FFFFFF",fontFamily:"Georgia, serif",marginBottom:4},subtitle:{fontSize:12,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",fontStyle:"italic"},skip:{position:"absolute",top:14,right:20,background:"transparent",border:"none",color:"#DCE4EF",fontSize:11,fontFamily:"'Trebuchet MS', sans-serif",cursor:"pointer",textDecoration:"underline"},stepIndicator:{display:"flex",gap:8,marginBottom:20},stepDot:a=>({flex:1,height:3,borderRadius:2,background:a?"#B87333":"rgba(255,255,255,0.15)"}),timeLabel:{fontSize:10,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif",fontStyle:"italic",marginBottom:16},statBlock:{textAlign:"center",padding:"16px 12px",background:"rgba(184,115,51,0.08)",border:"1px solid rgba(184,115,51,0.2)",borderRadius:4},statNum:{fontSize:28,fontWeight:800,color:"#B87333",fontFamily:"Georgia, serif",display:"block",lineHeight:1},statLabel:{fontSize:9,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",letterSpacing:1,textTransform:"uppercase",marginTop:4,display:"block"},statSource:{fontSize:8,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",marginTop:2,display:"block"},fieldNote:{fontSize:10,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif",marginTop:4,lineHeight:1.4},errorBox:{marginTop:12,padding:"8px 12px",background:"rgba(255,68,68,0.12)",border:"1px solid #F27B74",borderRadius:3,color:"#F27B74",fontSize:11,fontFamily:"'Trebuchet MS', sans-serif"}};function vw({onClose:a,profile:n,saveProfile:r,saveInitiative:l}){const[c,d]=w.useState(0),[f,p]=w.useState(["","",""]),[m,y]=w.useState({company:n.company||"",revenue:n.revenue||"",cost_base:n.cost_base||"",ebitda:n.ebitda||"",industry:n.industry||"universal",transformation_readiness:n.transformation_readiness||"traditional"}),[v,_]=w.useState({name:"",fn:"it",tier:"gen2",budget:"",mission_priority_index:0}),[x,E]=w.useState(0),[T,k]=w.useState(!1),[C,D]=w.useState(""),[q,L]=w.useState(!1),[X,ne]=w.useState(null),K=f.every(B=>B.trim()),Q=m.revenue.trim()&&m.ebitda.trim();async function me(){L(!0),ne(null);try{await r({mission_priorities:f.map(B=>({title:B.trim(),description:""}))}),d(2)}catch(B){ne(B.message||"Failed to save priorities")}finally{L(!1)}}async function le(){L(!0),ne(null);try{await r(m),d(3)}catch(B){ne(B.message||"Failed to save profile")}finally{L(!1)}}async function $e(){if(v.name.trim()){L(!0),ne(null);try{const B={name:v.name,fn:v.fn,tier:v.tier,budget:v.budget,mission_priority_index:v.mission_priority_index,risk:"Medium",horizon:"Now (0–90 days)",status:"Planning"};await l(B);
56const ee=x+1;E(ee),D(v.name),ee>=2?(await r({mission_priorities:f.map(ve=>({title:ve.trim(),description:""}))}),d(4)):k(!0)}catch(B){ne(B.message||"Failed to save initiative")}finally{L(!1)}}}function Me(){_({name:"",fn:"it",tier:"gen2",budget:"",mission_priority_index:0}),k(!1),ne(null)}async function Pe(){await r({mission_priorities:f.map(B=>({title:B.trim(),description:""}))}),d(4)}async function oe(){await r({wizard_completed:!0}),a()}async function je(){await r({wizard_completed:!0}),a()}const Se=["Welcome to the AI Business Value Framework","Define Your Mission-Critical Priorities","Your Organisation Profile","Add Your First AI Initiative","Your Framework Is Ready"],I=["Understanding why governance is the real AI challenge","Everything in the BVF flows from your strategic priorities","Scales the planning range to your organisation and keeps each assumption visible","Link your first initiative to what matters most","Your AI portfolio is now connected to your strategy"];return u.jsx("div",{style:ke.overlay,onClick:B=>{B.target===B.currentTarget&&c<4&&oe()},children:u.jsxs("div",{style:ke.container,children:[c<4&&u.jsx("button",{style:ke.skip,onClick:oe,children:"Skip Quick Start"}),u.jsxs("div",{style:ke.header,children:[u.jsx("div",{style:ke.brand,children:"QUICK START WIZARD"}),u.jsx("div",{style:ke.title,children:Se[c]}),u.jsx("div",{style:ke.subtitle,children:I[c]})]}),u.jsxs("div",{style:ke.body,children:[c<4&&u.jsx("div",{style:ke.stepIndicator,children:[0,1,2,3].map(B=>u.jsx("div",{style:ke.stepDot(c>=B)},B))}),c===0&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:10,marginBottom:20},children:[u.jsxs("div",{style:ke.statBlock,children:[u.jsx("span",{style:ke.statNum,children:"88%"}),u.jsx("span",{style:ke.statLabel,children:"Use AI in at least one function"}),u.jsx("span",{style:ke.statSource,children:"McKinsey 2025"})]}),u.jsxs("div",{style:ke.statBlock,children:[u.jsx("span",{style:ke.statNum,children:"39%"}),u.jsx("span",{style:ke.statLabel,children:"Report enterprise EBIT impact"}),u.jsx("span",{style:ke.statSource,children:"McKinsey 2025"})]}),u.jsxs("div",{style:ke.statBlock,children:[u.jsx("span",{style:ke.statNum,children:"50%+"}),u.jsx("span",{style:ke.statLabel,children:"GenAI projects abandoned after PoC"}),u.jsx("span",{style:ke.statSource,children:"Gartner 2026"})]})]}),u.jsxs("div",{style:{padding:"16px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(184,115,51,0.2)",borderRadius:4,marginBottom:20},children:[u.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#F6F9FD",fontFamily:"Georgia, serif",marginBottom:8},children:"The problem is never the technology."}),u.jsx("div",{style:{fontSize:11,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",lineHeight:1.7,marginBottom:10},children:"AI initiatives fail because they are disconnected from enterprise strategy, underfunded on change management, and blocked by governance structures that move at a different speed to the technology being deployed."}),u.jsx("div",{style:{fontSize:11,fontWeight:700,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif",marginBottom:8},children:"Complete this 5-minute setup and receive:"}),u.jsxs("ul",{style:{margin:0,paddingLeft:18,fontSize:11,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",lineHeight:1.8},children:[u.jsxs("li",{children:[u.jsx("span",{style:{color:"#F6F9FD",fontWeight:600},children:"Decision Confidence Score"})," — Stop, Fix, or Accelerate for each initiative"]}),u.jsxs("li",{children:[u.jsx("span",{style:{color:"#F6F9FD",fontWeight:600},children:"Strategic Alignment Map"})," — every initiative traced to a mission-critical priority"]}),u.jsxs("li",{children:[u.jsx("span",{style:{color:"#F6F9FD",fontWeight:600},children:"Transformation Readiness Score"})," — with € cost of organisational drag quantified"]}),u.jsxs("li",{children:[u.jsx("span",{style:{color:"#F6F9FD",fontWeight:600},children:"Change management assessment"})," — against the AI BVF 10% review point"]}),u.jsxs("li",{children:[u.jsx("span",{style:{color:"#F6F9FD",fontWeight:600},children:"90-Day Roadmap"})," — specific actions to align your pace layers"]})]})]}),u.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:u.jsx("button",{className:"btn",onClick:()=>d(1),children:"Start with your priorities →"})})]}),c===1&&u.jsxs(u.Fragment,{children:[u.jsx("div",{style:ke.timeLabel,children:"~1 minute · This is the foundation of your entire framework"}),u.jsx("div",{style:{padding:"12px 16px",marginBottom:16,background:"rgba(184,115,51,0.08)",border:"1px solid rgba(184,115,51,0.25)",borderRadius:4},children:u.jsx("div",{style:{fontSize:11,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",lineHeight:1.6},children:"Every AI initiative in your portfolio will be evaluated against these priorities. Start with your most important — the one your board holds you accountable for first."})}),u.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:f.map((B,ee)=>u.jsxs("div",{children:[u.jsxs("span",{className:"fl",children:[ee===0?"⭐ "
56:""," Priority ",ee+1,ee===0?" — Most Important":""]}),u.jsx("input",{type:"text",value:B,placeholder:ee===0?"e.g., Revenue Growth 5% by Q4":ee===1?"e.g., Cost Reduction €50M":"e.g., Customer NPS +15 points",onChange:ve=>{const P=[...f];P[ee]=ve.target.value,p(P)}}),ee===0&&u.jsx("div",{style:ke.fieldNote,children:"Your highest priority. All AI initiatives will be ranked by their contribution to this first."})]},ee))}),u.jsx("div",{style:{fontSize:10,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif",fontStyle:"italic",marginTop:12,lineHeight:1.4},children:"You can add up to 6 priorities and refine them later in the BVF tab."}),X&&u.jsx("div",{style:ke.errorBox,children:X}),u.jsxs("div",{style:{marginTop:20,display:"flex",justifyContent:"space-between"},children:[u.jsx("button",{className:"btn-ghost",onClick:()=>{ne(null),d(0)},children:"Back"}),u.jsx("button",{className:"btn",onClick:me,disabled:!K||q,children:q?"Saving...":"Next — Company Profile →"})]})]}),c===2&&u.jsxs(u.Fragment,{children:[u.jsx("div",{style:ke.timeLabel,children:"~2 minutes · Selects the initial planning assumptions"}),u.jsxs("div",{className:"grid-auto",style:{gap:12},children:[u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Company Name"}),u.jsx("input",{type:"text",value:m.company,placeholder:"e.g. Philips",onChange:B=>y({...m,company:B.target.value})})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Annual Revenue *"}),u.jsx("input",{type:"text",value:m.revenue,placeholder:"e.g. 500M",onChange:B=>y({...m,revenue:B.target.value})}),u.jsx("div",{style:ke.fieldNote,children:"Used to scale the planning range, it does not imply how much your organisation should invest."})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Annual Cost Base"}),u.jsx("input",{type:"text",value:m.cost_base,placeholder:"e.g. 350M",onChange:B=>y({...m,cost_base:B.target.value})}),u.jsx("div",{style:ke.fieldNote,children:"Identifies where AI can drive the greatest efficiency gains across your organisation."})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Current EBITDA *"}),u.jsx("input",{type:"text",value:m.ebitda,placeholder:"e.g. 75M",onChange:B=>y({...m,ebitda:B.target.value})}),u.jsx("div",{style:ke.fieldNote,children:"Sets your financial return threshold. Estimates are fine — this data is private to your workspace and never shared."})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Industry"}),u.jsx("select",{value:m.industry,onChange:B=>y({...m,industry:B.target.value}),children:Object.entries(ns).map(([B,ee])=>u.jsx("option",{value:B,children:ee},B))}),u.jsx("div",{style:ke.fieldNote,children:"Applies the AI BVF industry assumptions and shows the regulatory questions relevant to your organisation."})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Transformation Readiness"}),u.jsx("select",{value:m.transformation_readiness,onChange:B=>y({...m,transformation_readiness:B.target.value}),children:Ua.map(B=>u.jsx("option",{value:B.id,children:B.label},B.id))}),u.jsx("div",{style:ke.fieldNote,children:"Honest assessment of your organisation's change capability. Most organisations overestimate this — the BVF will tell you where the gaps are."})]})]}),X&&u.jsx("div",{style:ke.errorBox,children:X}),u.jsxs("div",{style:{marginTop:20,display:"flex",justifyContent:"space-between"},children:[u.jsx("button",{className:"btn-ghost",onClick:()=>{ne(null),d(1)},children:"Back"}),u.jsx("button",{className:"btn",onClick:le,disabled:!Q||q,children:q?"Saving...":"Next — Add Initiative →"})]})]}),c===3&&u.jsxs(u.Fragment,{children:[u.jsx("div",{style:ke.timeLabel,children:"~1 minute · Link your AI investment to your strategy"}),T?u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{textAlign:"center",padding:"20px 16px",marginBottom:16,background:"rgba(34,197,94,0.08)",border:"1px solid rgba(34,197,94,0.3)",borderRadius:4},children:[u.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#5FE0A0",fontFamily:"'Trebuchet MS', sans-serif",marginBottom:4},children:"Initiative saved ✓"}),u.jsxs("div",{style:{fontSize:12,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif"},children:['"',C,'" is now linked to your strategic priorities.']})]}),u.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:12},children:[u.jsx("button",{className:"btn-ghost",onClick:Me,children:"+ Add Another Initiative"}),u.jsx("button",{className:"btn",onClick:Pe,children:"Finish Setup →"})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{padding:"10px 14px",marginBottom:14,background:"rgba(184,115,51,0.08)",border:"1px solid rgba(184,115,51,0.2)",borderRadius:4},children:u.jsxs("div",{style:{fontSize:11,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",lineHeight:1.6},children:["Add the AI initiative you most want to evaluate. It will receive a ",u.jsx("span",{style:{color:"#B87333",fontWeight:600},children:"Decision Confidence Score"})," — your verdict on whether to Stop, Fix, or Accelerate."]})}),u.jsxs("div",{className:"grid-auto",style:{gap:12},children:[u.jsxs("div",{style:{gridColumn:"1/-1"},children:[u.jsx("span",{className:"fl",children:"Initiative Name *"}),u.jsx("input",{type:"text",value:v.name,placeholder:"e.g. GenAI Customer Service Agent",onChange:B=>_({...v,name:B.target.value})})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Links to Mission Priority"}),u.jsx("select",{value:v.mission_priority_index,onChange:B=>_({...v,mission_priority_index:parseInt(B.target.value,10)}),children:f.map((B,ee)=>
56u.jsxs("option",{value:ee,children:["Priority ",ee+1,": ",B]},ee))}),u.jsx("div",{style:ke.fieldNote,children:"This is the strategic connection that makes AI governance meaningful. Which priority does this initiative serve?"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Function"}),u.jsx("select",{value:v.fn,onChange:B=>_({...v,fn:B.target.value}),children:dd.map(B=>u.jsxs("option",{value:B.id,children:[B.icon," ",B.label]},B.id))})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"Total Budget"}),u.jsx("input",{type:"text",value:v.budget,placeholder:"e.g. 2M",onChange:B=>_({...v,budget:B.target.value})})]}),u.jsxs("div",{children:[u.jsx("span",{className:"fl",children:"AI Generation Tier"}),u.jsx("select",{value:v.tier,onChange:B=>_({...v,tier:B.target.value}),children:cw.map(B=>u.jsx("option",{value:B.id,children:B.label},B.id))})]})]}),X&&u.jsx("div",{style:ke.errorBox,children:X}),u.jsxs("div",{style:{marginTop:20,display:"flex",justifyContent:"space-between"},children:[x===0&&u.jsx("button",{className:"btn-ghost",onClick:()=>{ne(null),d(2)},children:"Back"}),x>0&&u.jsx("div",{}),u.jsx("button",{className:"btn",onClick:$e,disabled:!v.name.trim()||q,children:q?"Saving...":"Add Initiative →"})]})]})]}),c===4&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{textAlign:"center",padding:"16px 0 8px"},children:[u.jsx("div",{style:{fontSize:36,marginBottom:12},children:"✓"}),u.jsx("div",{style:{fontSize:16,fontWeight:700,color:"#5FE0A0",fontFamily:"Georgia, serif",marginBottom:8},children:"Your framework is ready."}),u.jsxs("div",{style:{fontSize:12,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",lineHeight:1.6,marginBottom:24},children:["Your AI initiatives are now connected to your mission-critical priorities.",u.jsx("br",{}),"The BVF will score each initiative and show you exactly where to focus."]})]}),u.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,marginBottom:24},children:[{icon:"🎯",label:"View your Decision Confidence Scores",desc:"See Stop / Fix / Accelerate for each initiative",tab:"Portfolio"},{icon:"📊",label:"Explore the BVF Framework",desc:"See how your AI portfolio maps to your priorities",tab:"BVF"},{icon:"📋",label:"Review your Alignment Map",desc:"Check strategic fit and governance readiness",tab:"Alignment"}].map((B,ee)=>u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"12px 14px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:4},children:[u.jsx("span",{style:{fontSize:20},children:B.icon}),u.jsxs("div",{children:[u.jsx("div",{style:{fontSize:12,fontWeight:700,color:"#F6F9FD",fontFamily:"'Trebuchet MS', sans-serif"},children:B.label}),u.jsx("div",{style:{fontSize:10,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif"},children:B.desc})]})]},ee))}),u.jsx("div",{style:{display:"flex",justifyContent:"center"},children:u.jsx("button",{className:"btn",onClick:je,style:{padding:"12px 32px",fontSize:13},children:"Enter the Platform →"})})]})]})]})})}async function bw(a){const n=a?.context;if(n&&typeof n.clone=="function")try{const r=await n.clone().json();if(r?.error)return r.error}catch{}return a?.message||"Team service request failed"}async function eo(a,n={}){const{data:r,error:l}=await _e.functions.invoke("admin-auth",{body:{action:a,...n}});if(l)throw new Error(await bw(l));if(r?.error)throw new Error(r.error);return r}async function cy(a,n,r="client"){return eo("invite_user",{email:a,org_id:n,role:r})}async function _w(a){return(await eo("list_users",{org_id:a})).users}async function xw(a,n){return eo("delete_user",{user_id:a,org_id:n})}async function ww(a,n){return eo("resend_invite",{email:a,org_id:n})}const st={overlay:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.85)",overflow:"auto",padding:"24px 0"},container:{maxWidth:600,margin:"0 auto",background:"#0F1E35",border:"1px solid rgba(184,115,51,0.3)",borderRadius:6,overflow:"hidden",position:"relative"},header:{padding:"28px 36px 20px",background:"linear-gradient(135deg,rgba(13,31,60,0.95),rgba(22,45,78,0.95))",borderBottom:"3px solid #B87333",display:"flex",justifyContent:"space-between",alignItems:"flex-start"},title:{fontSize:18,fontWeight:700,color:"#fff",letterSpacing:-.3},closeBtn:{background:"none",border:"none",color:"#DCE4EF",fontSize:18,cursor:"pointer",padding:"0 4px",lineHeight:1},section:{padding:"24px 36px",borderBottom:"1px solid rgba(184,115,51,0.1)"},label:{fontSize:9,letterSpacing:2.5,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif",fontWeight:600,marginBottom:6,textTransform:"uppercase",display:"block"},input:{width:"100%",padding:"8px 10px",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(184,115,51,0.25)",borderRadius:3,color:"#fff",fontSize:13,fontFamily:"'Trebuchet MS', sans-serif",outline:"none",boxSizing:"border-box"},select:{padding:"8px 10px",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(184,115,51,0.25)",borderRadius:3,color:"#fff",fontSize:13,fontFamily:"'Trebuchet MS', sans-serif",outline:"none",cursor:"pointer"},row:{display:"flex",alignItems:"center",gap:10,padding:"10px 0",borderBottom:"1px solid rgba(255,255,255,0.07)"},badge:a=>({fontSize:9,fontWeight:700,letterSpacing:1,padding:"2px 6px",borderRadius:2,background:a==="copper"?"rgba(184,115,51,0.15)":"rgba(255,255,255,0.09)",color:a==="copper"?"#D9A672":"#DCE4EF",textTransform:"uppercase"}),statusDot:a=>({width:7,height:7,borderRadius:"50%",background:a?"#34C77B":"#DCE4EF",display:"inline-block",flexShrink:0}),msg:a=>({fontSize:12,marginTop:10,padding:"8px 12px",borderRadius:3,background:a?"rgba(255,68,68,0.1)":"rgba(76,175,80,0.1)",border:`1px solid ${a?"rgba(255,68,68,0.3)":"rgba(76,175,80,0.3)"}`,color:a?"#F27B74":"#34C77B"}),ghostBtn:{background:"none",border:"1px solid rgba(184,115,51,0.25)",borderRadius:3,color:"#B87333",fontSize:10,fontWeight:600,padding:"4px 10px",cursor:"pointer",fontFamily:"'Trebuchet MS', sans-serif"}};function Sw({orgId:a,onClose:n}){const{user:r}=$a(),[l,c]=w.useState(""),[d,f]=w.useState("client"),[p,m]=w.useState([]),[y,v]=w.useState(!0),[_,x]=w.useState(!1),[E,T]=w.useState(null),[k,C]=w.useState({}),D=w.useCallback(async()=>
56{if(!a)return;v(!0);const{data:K,error:Q}=await _e.from("users").select("*").eq("org_id",a);if(Q){console.error("[MembersPanel] Failed to load users:",Q),v(!1);return}let me={};try{(await _w(a)).forEach(Me=>{me[Me.id]=Me})}catch($e){console.error("[MembersPanel] listAuthUsers error:",$e)}const le=(K||[]).map($e=>{const Me=me[$e.id];return{...$e,active:!!Me?.last_sign_in_at,lastSignIn:Me?.last_sign_in_at||null}});m(le),v(!1)},[a]);w.useEffect(()=>{const K=window.setTimeout(()=>{D()},0);return()=>window.clearTimeout(K)},[D]);async function q(K){if(K.preventDefault(),T(null),!l.trim()){T({text:"Email is required.",isError:!0});return}x(!0);try{const Q=await cy(l.trim(),a,d);T({text:Q.message,isError:!1}),c(""),D()}catch(Q){T({text:"Invite failed: "+Q.message,isError:!0})}x(!1)}async function L(K){C(Q=>({...Q,[K.id]:!0}));try{await ww(K.email,a),T({text:`Invite resent to ${K.email}`,isError:!1})}catch(Q){T({text:"Resend failed: "+Q.message,isError:!0})}C(Q=>({...Q,[K.id]:!1}))}async function X(K){if(!(K.id===r?.id||!window.confirm(`Remove ${K.email} from the organisation?`))){C(me=>({...me,[K.id]:!0}));try{await xw(K.id,a),T({text:`${K.email} removed.`,isError:!1})}catch(me){T({text:"Remove failed: "+me.message,isError:!0})}C(me=>({...me,[K.id]:!1})),D()}}function ne(K){return K?new Date(K).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"}):""}return u.jsx("div",{style:st.overlay,onClick:K=>{K.target===K.currentTarget&&n()},children:u.jsxs("div",{style:st.container,children:[u.jsxs("div",{style:st.header,children:[u.jsxs("div",{children:[u.jsx("div",{style:st.label,children:"TEAM MANAGEMENT"}),u.jsx("div",{style:st.title,children:"Members"})]}),u.jsx("button",{style:st.closeBtn,onClick:n,title:"Close",children:"×"})]}),u.jsxs("div",{style:st.section,children:[u.jsx("div",{style:st.label,children:"INVITE USER"}),u.jsxs("form",{onSubmit:q,style:{display:"flex",gap:10,alignItems:"flex-end",flexWrap:"wrap"},children:[u.jsx("div",{style:{flex:1,minWidth:200},children:u.jsx("input",{type:"email",placeholder:"[email protected]",value:l,onChange:K=>c(K.target.value),style:st.input})}),u.jsxs("select",{value:d,onChange:K=>f(K.target.value),style:st.select,children:[u.jsx("option",{value:"client",children:"Member"}),u.jsx("option",{value:"admin",children:"Admin"})]}),u.jsx("button",{type:"submit",className:"btn",disabled:_,style:{fontSize:12,padding:"8px 18px",opacity:_?.6:1},children:_?"Sending...":"Send Invite"})]}),E&&u.jsx("div",{style:st.msg(E.isError),children:E.text})]}),u.jsxs("div",{style:{...st.section,borderBottom:"none"},children:[u.jsx("div",{style:st.label,children:"MEMBERS"}),y?u.jsx("div",{style:{fontSize:12,color:"#DCE4EF",padding:"12px 0"},children:"Loading..."}):p.length===0?u.jsx("div",{style:{fontSize:12,color:"#DCE4EF",padding:"12px 0"},children:"No members yet. Send an invite above."}):p.map(K=>u.jsxs("div",{style:st.row,children:[u.jsx("span",{style:st.statusDot(K.active),title:K.active?"Active":"Pending"}),u.jsxs("div",{style:{flex:1,minWidth:0},children:[u.jsx("div",{style:{fontSize:13,color:"#fff",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:K.email}),K.active&&K.lastSignIn&&u.jsxs("div",{style:{fontSize:10,color:"#DCE4EF",marginTop:2},children:["Last active ",ne(K.lastSignIn)]})]}),u.jsx("span",{style:st.badge(K.role==="admin"?"copper":"default"),children:K.role==="admin"?"Admin":"Member"}),u.jsx("span",{style:st.badge(K.active?"copper":"default"),children:K.active?"Active":"Pending"}),u.jsxs("div",{style:{display:"flex",gap:6,flexShrink:0},children:[!K.active&&u.jsx("button",{style:st.ghostBtn,onClick:()=>L(K),disabled:k[K.id],children:k[K.id]?"...":"Resend"}),K.id!==r?.id&&u.jsx("button",{style:{...st.ghostBtn,borderColor:"rgba(255,68,68,0.3)",color:"#F27B74"},onClick:()=>X(K),disabled:k[K.id],children:k[K.id]?"...":"Remove"})]})]},K.id))]})]})})}const xt={overlay:{position:"fixed",inset:0,zIndex:9999,background:"rgba(0,0,0,0.85)",overflow:"auto",padding:"24px 0"},container:{maxWidth:640,margin:"0 auto",background:"#0F1E35",border:"1px solid rgba(184,115,51,0.3)",borderRadius:6,overflow:"hidden",position:"relative"},header:{padding:"28px 36px 20px",background:"linear-gradient(135deg,rgba(13,3
561,60,0.95),rgba(22,45,78,0.95))",borderBottom:"3px solid #B87333"},brand:{fontSize:9,letterSpacing:3,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif",marginBottom:6},title:{fontSize:20,fontWeight:700,color:"#FFFFFF",fontFamily:"Georgia, serif",marginBottom:4},subtitle:{fontSize:12,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",fontStyle:"italic"},close:{position:"absolute",top:14,right:20,background:"transparent",border:"none",color:"#DCE4EF",fontSize:20,cursor:"pointer",lineHeight:1},body:{padding:"24px 36px 32px"},stepCard:{padding:"14px 16px",marginBottom:12,background:"rgba(255,255,255,0.06)",border:"1px solid rgba(184,115,51,0.15)",borderRadius:4,borderLeft:"3px solid #B87333"},stepNum:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"50%",background:"rgba(184,115,51,0.2)",color:"#B87333",fontSize:11,fontWeight:700,fontFamily:"'Trebuchet MS', sans-serif",marginRight:8,flexShrink:0},stepTitle:{fontSize:13,fontWeight:700,color:"#FFFFFF",fontFamily:"Georgia, serif"},stepText:{fontSize:11,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",lineHeight:1.55,marginTop:6},footer:{padding:"16px 36px",borderTop:"1px solid rgba(184,115,51,0.15)",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:8},footerText:{fontSize:10,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif"},secondaryButton:{padding:"12px 24px",fontSize:12,fontWeight:700,fontFamily:"'Trebuchet MS', sans-serif",cursor:"pointer",borderRadius:4,color:"#B87333",background:"rgba(184,115,51,0.08)",border:"1px solid rgba(184,115,51,0.35)",letterSpacing:.5}},tg=a=>({padding:"8px 20px",fontSize:12,fontWeight:600,fontFamily:"'Trebuchet MS', sans-serif",cursor:"pointer",border:"none",borderRadius:4,transition:"all 0.2s",background:a?"rgba(184,115,51,0.2)":"transparent",color:a?"#B87333":"#DCE4EF",borderBottom:a?"2px solid #B87333":"2px solid transparent"}),Ew=[{title:"Quick Start Wizard",enterprise:"First time? Click 'Quick Start Wizard' to be guided through setup in 5 minutes. The wizard sequences company profile, priority definition and initiative linking automatically.",partner:"Run the Quick Start Wizard with the client at the start of every engagement. It structures the discovery conversation and populates the framework in real time."},{title:"Company Profile",enterprise:"Enter your company name, revenue, cost base and EBITDA. Select your industry vertical. This selects the disclosed AI BVF planning assumptions.",partner:"Enter the client's company name and financials. Select their industry. This selects the disclosed AI BVF planning assumptions."},{title:"Mission-Critical Priorities",enterprise:"Define up to 6 priorities your board is focused on this year. These are the strategic anchors for your AI portfolio.",partner:"Define the client's top 6 board-level priorities. These anchor the entire transformation narrative."},{title:"AI Portfolio",enterprise:"Add each AI initiative you are running or planning. Capture tier (Gen 1/2/3), budget, revenue impact and CM allocation.",partner:"Walk through each initiative with the client. The Pilot Trap Diagnostic identifies governance gaps automatically."},{title:"Review Value Potential",enterprise:"Your initial AI value range is calculated from disclosed planning assumptions. Replace them with measured evidence before funding.",partner:"Show the client the modelled readiness scenario, then ask for the delay, rework and adoption data that should replace the assumptions."},{title:"CM Health Check",enterprise:"Review change funding against the AI BVF 10% review point, then test whether the actual work is named and costed.",partner:"Identify which initiatives are underfunded on CM — this is typically the biggest risk in any portfolio."},{title:"AI Advisor",enterprise:"Click Get AI Recommendations for an instant board-ready analysis of your portfolio.",partner:"Run the AI Advisor with the client in the room — it generates ACCELERATE / FIX / STOP recommendations instantly."},{title:"Export",enterprise:"Download your Board Summary PDF, Portfolio Export, or 90-Day Roadmap.",partner:"Export the board-ready PDF. This is the artefact the client takes to their executive team."}];function Aw({onClose:a,onLaunchWizard:n,onLoadSample:r,sampleLoading:l=!1}){const[c,d]=w.useState("enterprise");return u.jsx("div",{style:xt.overlay,onClick:f=>{f.target===f.currentTarget&&a()},children:u.jsxs("div",{style:xt.container,children:[u.jsx("button",{style:xt.close,onClick:a,children:"×"}),u.jsxs("div",{style:xt.header,children:[u.jsx("div",{style:xt.brand,children:"CRAIG HORTON · AI TRANSFORMATION ADVISORY · 2026"}),u.jsx("div",{style:xt.title,children:"AI Business Value Framework — Quick Start Guide"}),u.jsx("div",{style:xt.subtitle,children:c==="enterprise"?"You are building your AI governance view":"You are running this with a client"})]}),u.jsxs("div",{style:xt.body,children:[u.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:4,marginBottom:20,background:"rgba(255,255,255,0.04)",borderRadius:4,padding:4},children:[u.jsx("button",{style:tg(c==="enterprise"),onClick:()=>d("enterprise"),children:"Enterprise"}),u.jsx("button",{style:tg(c==="partner"),onClick:()=>d("partner"),children:"GSI Partner"})]}),u.jsxs("div",{style:{textAlign:"center",marginBottom:24},children:[u.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:10,flexWrap:"wrap"},children:[u.jsx("button",{onClick:n,style:{padding:"12px 28px",fontSize:13,fontWeight:700,fontFamily:"'Trebuchet MS', sans-serif",curs
56or:"pointer",border:"none",borderRadius:4,color:"#fff",background:"linear-gradient(135deg, #B87333, #D9A672)",boxShadow:"0 2px 12px rgba(184,115,51,0.3)",letterSpacing:.5},children:"Launch Quick Start Wizard"}),r&&u.jsx("button",{onClick:r,disabled:l,style:{...xt.secondaryButton,opacity:l?.65:1},children:l?"Loading Sample...":"Load Sample Workspace"})]}),u.jsx("div",{style:{fontSize:10,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif",marginTop:6,fontStyle:"italic"},children:"Guided setup or instant sample data for a board-ready demo"})]}),Ew.map((f,p)=>u.jsxs("div",{style:xt.stepCard,children:[u.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[u.jsx("span",{style:xt.stepNum,children:p}),u.jsx("span",{style:xt.stepTitle,children:f.title})]}),u.jsx("div",{style:xt.stepText,children:c==="enterprise"?f.enterprise:f.partner})]},p))]}),u.jsxs("div",{style:xt.footer,children:[u.jsx("div",{style:xt.footerText,children:"Questions? Contact Craig Horton Advisory"}),u.jsx("div",{style:{...xt.footerText,color:"#B87333"},children:"AI BVF engine 0.10.4 · 2026"})]})]})})}const jw=["strategic_alignment","financial_return","change_enablement","governance_risk"];function Ml(a){return String(a||"").trim().toLowerCase().replace(/\s+/g," ")}function Tw(a){return Array.isArray(a?.readiness_indicators)&&[...a.readiness_indicators].reverse().find(n=>n?.type==="aibvf_assessment")||null}function Rw(a){const n=String(a||"").trim(),r=n.split(/\s+/).filter(Boolean);return n.length>=60&&r.length>=10&&!/^(yes|no|partial|n\/?a|none)[.!]?$/i.test(n)}function uy(a){return a?.decision_evidence?jw.every(n=>{const r=a.decision_evidence[n],l=r?.decision_ready===!0||r?.decision_ready==null&&r?.ready===!0;return Number.isFinite(Number(r?.score))&&l&&Rw(r?.note)}):!1}function dy(a,n={}){const r=Number(a?.net_low_eur),l=Number(a?.net_high_eur),c=bt(n.revenue||a?.profile_snapshot?.revenue),d=bt(n.ebitda||a?.profile_snapshot?.ebitda),f=[];return(!Number.isFinite(r)||!Number.isFinite(l)||r<0||l<r)&&f.push("The value range is incomplete or internally inconsistent."),Number.isFinite(l)&&c>0&&l>c*.25&&f.push("The upper value range exceeds 25% of annual revenue."),Number.isFinite(l)&&d>0&&l>d&&f.push("The upper value range exceeds current annual EBITDA."),{requires_reconciliation:f.length>0,reasons:f}}function ng(a,n={},r=null){const l=a?.profile||{},c=[],d=r?.id||n.org_id,f=n.company||r?.name||"";l.source_org_id&&d&&l.source_org_id!==d&&c.push("The assessment belongs to a different organisation workspace."),l.company&&f&&Ml(l.company)!==Ml(f)&&c.push(`The assessment names ${l.company}, while this workspace belongs to ${f}.`);const p=bt(l.revenue),m=bt(n.revenue);p>0&&m>0&&Math.abs(p-m)/Math.max(p,m)>.1&&c.push("The assessment revenue differs from the company profile by more than 10%.");const y=Ml(l.industry),v=Ml(n.industry);return y&&v&&y!=="universal"&&v!=="universal"&&y!==v&&c.push("The assessment industry does not match the company profile."),c}function jS(a,n={}){const r=Tw(a);if(!r)return{assessment:null,evidenceReady:!1,valueReview:{requires_reconciliation:!1,reasons:[]},fundingReady:!1};const l=uy(r),c=dy(r,n),d=r.classification==="Accelerate"&&l&&!c.requires_reconciliation;return{assessment:r,evidenceReady:l,valueReview:c,fundingReady:d}}const Cw=w.lazy(()=>In(()=>import("./BVFTab-CT8XXsWN.js"),__vite__mapDeps([0,1]))),kw=w.lazy(()=>In(()=>import("./PortfolioTab-Bgf44RbP.js"),__vite__mapDeps([2,1]))),Ow=w.lazy(()=>In(()=>import("./CMHealthTab-JSh-6SIb.js"),[])),Bw=w.lazy(()=>In(()=>import("./RegulatoryTab-DmFv0FmM.js"),__vite__mapDeps([3,4]))),Dw=w.lazy(()=>In(()=>import("./AlignmentTab-s_QrPm-7.js"),[])),Nw=w.lazy(()=>In(()=>import("./BenchmarksTab-CjYfoJq0.js"),[])),Mw=w.lazy(()=>In(()=>import("./ChangeEnablementTab-D7IOqG_S.js"),__vite__mapDeps([5,6]))),zw=w.lazy(()=>In(()=>import("./HealthcareModule-DItJHEau.js"),__vite__mapDeps([7,8]))),Uw=w.lazy(()=>In(()=>import("./PaceLayerDiagnostic-uWexslTX.js"),__vite__mapDeps([9,10]))),Kr="aibvf.portfolioHandoff",Vl="aibvf.pendingPortfolioHandoff",Nu={BVF:"value-map",Portfolio:"decisions","Change Enablement":"change-plan",Healthcare:"healthcare","Pace Layer":"pace-layer","CM Health":"cm-health","Alignment Map":"alignment-map",Regulatory:"regulatory",Benchmarks:"benchmarks"},zl={Healthcare:{question:"Does the clinical case have the evidence and controls required to proceed?",detail:"Use this view to identify the clinical, regulatory and adoption conditions that make an initiative Accelerate, Fix or Stop.",next:["Portfolio","Change Enablement"]},"Pace Layer":{question:"Can the organisation make decisions and change the work at the pace this portfolio requires?",detail:"Use the result to identify where slow governance, funding or learning cycles make an initiative Fix before more money is committed.",next:["Portfolio","Change Enablement"]},"CM Health":{question:"Has each initiative funded the people and adoption work needed to realise value?",detail:"Use the funding gap to decide which initiatives need a costed change plan before the portfolio decision can move.",next:["Portfolio","Change Enablement"]},"Alignment Map":{question:"Can the board see how each initiative connects to an outcome, its value range and its decision evidence?",detail:"Use this board view to challenge initiatives without a named objective, then return to the decision queue and act on them.",next:["Portfolio","BVF"]},Regulatory:{question:"Which control or regulatory condition changes the decision now?",detail:"Use this view to record the control gap, owner and timing, then return to the initiative decision with the evidence.",next:["Portfolio"]},Benchmarks:{question:"Which assumptions are supported by published evidence, and which still need company data?",detail:"Use the source record to challenge the value and readiness assumptions before confirming the portfolio decision.",next:["BVF","Portfolio"]}};function Fw(){try{const a=JSON.parse(window.sessionStorage.getItem(Kr)||"null");if(a?.version===1&&a?.proposal&&(!a.expiresAt||Date.parse(a.expiresAt)>=Date.now()))return a;window.sessionStorage.removeItem(Kr);const n=JSON.parse(window.localStorage.getItem(Vl)||"null");return n?.handoff?.version===1&&n.handoff?.proposal&&Date.parse(n.expiresAt)>=Date.now()?(window.sessionStorage.setItem(Kr,JSON.stringify(n.handoff)),n.handoff):(window.localStorage.removeItem(Vl),null)}catch{return null}}function Lw(a){const r=(a.match(/(?:considering|proposing|building|deploying|implementing|exploring|weighing)\s+(?:an?\s+)?([^.!?]+)[.!?]?$/i)?.[1]||a).trim();return r.charAt(0).toUpperCase()+r.slice(1,119)}function Ll(a){return a?new Intl.NumberFormat("en-GB",{style:"currency",currency:"EUR",notation:"compact",maximumFractionDigits:1}).format(a):"Revenue not resolved"}function Iw(a,n,r){const l=n.company||r?.name||"The organisation",c=[`${l}
56 is assessing this initiative: ${a?.proposal||"AI initiative"}`,bt(n.revenue)>0?`Annual revenue is ${Ll(bt(n.revenue))}.`:"",n.industry?`The industry is ${n.industry.replaceAll("_"," ")}.`:"",n.transformation_readiness?`The organisation is ${n.transformation_readiness}.`:""].filter(Boolean),d=new URLSearchParams({proposal:c.join(" ")});return a?.initiative?.id&&d.set("initiative",a.initiative.id),r?.id&&d.set("source_org",r.id),d.set("source_company",l.slice(0,120)),`/start?${d.toString()}`}function ig(){const{signOut:a,user:n,isAdmin:r}=$a(),{profile:l,initiatives:c,agentTasks:d,loading:f,saveProfile:p,saveInitiative:m,seedSampleWorkspace:y,bvfRows:v,org:_}=ey(),x=Ha(),[E,T]=p_(),[k,C]=w.useState(1),[D,q]=w.useState(!1),[L,X]=w.useState(!1),[ne,K]=w.useState(!1),[Q,me]=w.useState(!1),[le,$e]=w.useState(()=>Fw()),[Me,Pe]=w.useState(!1),[oe,je]=w.useState(""),Se=w.useMemo(()=>ng(le,l,_),[_,le,l]),I=w.useMemo(()=>[{label:"BVF",icon:"◈"},{label:"Portfolio",icon:"⬡"},{label:"Change Enablement",icon:"⚙"},{label:"Healthcare",icon:"🏥",hidden:_?.industry!=="healthcare"},{label:"Pace Layer",icon:"◎"},{label:"CM Health",icon:"◉"},{label:"Alignment Map",icon:"◬"},{label:"Regulatory",icon:"⚖"},{label:"Benchmarks",icon:"◧"}],[_?.industry]),B=w.useMemo(()=>I.filter(W=>!W.hidden),[I]),ee=E.get("initiative")||"",ve=c.some(W=>W.id===ee)?ee:"",P=w.useCallback((W,ie=!1)=>{const ce=new URLSearchParams(window.location.search);Object.prototype.hasOwnProperty.call(W,"tab")&&(W.tab?ce.set("tab",W.tab):ce.delete("tab")),Object.prototype.hasOwnProperty.call(W,"initiativeId")&&(W.initiativeId?ce.set("initiative",W.initiativeId):ce.delete("initiative")),T(ce,{replace:ie})},[T]);w.useEffect(()=>{const W=E.get("tab");if(!W)return;const ie=B.findIndex(ce=>Nu[ce.label]===W);ie>=0&&ie!==k&&C(ie)},[k,E,B]),w.useEffect(()=>{if(!f&&!(ee&&ve)){if(ee&&!ve){P({initiativeId:c[0]?.id||""},!0);return}!ee&&c.length>0&&P({initiativeId:c[0].id},!0)}},[c,f,ee,ve,P]);const S=w.useRef({}),[N,G]=w.useState(new Set),Y=w.useCallback(W=>{switch(B[W]?.label){case"BVF":return JSON.stringify([v?.length,l.revenue,l.cost_base,l.ebitda,l.transformation_readiness,l.industry]);case"Portfolio":return JSON.stringify(c.map(ce=>[ce.id,ce.budget,ce.cm_budget,ce.fn,ce.status].join(",")));case"CM Health":return JSON.stringify(c.map(ce=>[ce.id,ce.cm_budget,ce.budget].join(",")));case"Alignment Map":return JSON.stringify([l.mission_priorities?.length,c.map(ce=>ce.mission_priority_index).join(",")]);case"Regulatory":return JSON.stringify(c.map(ce=>[ce.id,ce.risk].join(",")));case"Benchmarks":return JSON.stringify([l.revenue,l.cost_base,l.industry]);default:return""}},[l,c,v,B]),Z=w.useCallback(W=>{S.current[k]=Y(k),G(ie=>{const ce=new Set(ie);return ce.delete(W),ce}),S.current[W]=Y(W),C(W),P({tab:Nu[B[W]?.label]||""}),B[W]?.label==="Change Enablement"&&window.AIBVFJourney&&window.AIBVFJourney.track("change_plan_opened",{entry_route:"portfolio",industry:l.industry})},[k,Y,l.industry,P,B]),J=w.useCallback(W=>{P({initiativeId:W})},[P]),de=w.useCallback(W=>{const ie=B.findIndex(ce=>ce.label===W);ie>=0&&Z(ie)},[Z,B]);w.useEffect(()=>{const W=new Set;for(let ie=0;ie<B.length;ie++){if(ie===k)continue;const ce=S.current[ie];ce!==void 0&&ce!==Y(ie)&&W.add(ie)}W.size>0&&G(ie=>{const ce=new Set(ie);return W.forEach(kt=>ce.add(kt)),ce})},[l,c,v,k,Y,B.length]);const ge=ny(l),Oe=c.reduce((W,ie)=>W+bt(ie.budget),0),Vt=c.reduce((W,ie)=>W+bt(ie.cm_budget),0),Li=c.length>0&&Oe>0&&Vt/Oe<.1,Pa=c.some(W=>{const ie=ty(W.pilot_answers);return ie&&ie.score<2}),ut=B[k]?.label,sn={Portfolio:{label:"Decisions",description:"What should we fund, fix or stop?"},BVF:{label:"Value map",description:"How does the work connect to board outcomes?"},"Change Enablement":{label:"Change plan",description:"What must change for adoption?"}},Va=["Portfolio","BVF","Change Enablement"].map(W=>({tab:B.find(ie=>ie.label===W),index:B.findIndex(ie=>ie.label===W)})).filter(W=>W.tab&&W.index>=0),Ii=B.map((W,ie)=>({tab:W,index:ie})).filter(({tab:W})=>!sn[W.label]),to=w.useCallback(async()=>{me(!0);try{await y(),K(!1);const W=B.findIndex(ie=>ie.label==="Portfolio");Z(W>=0?W:0)}catch(W){console.error("[Sample] Failed to load sample workspace:",W),alert(W.message||"Failed to load sample workspace")}finally{me(!1)}},[Z,y,B]),ss=w.useCallback(()=>{window.sessionStorage.removeItem(Kr),window.localStorage.removeItem(Vl),$e(null),je("")},[]),Ga=w.useCallback(async()=>
56{if(le){Pe(!0),je("");try{const W=ng(le,l,_);if(W.length)throw new Error(`This assessment cannot enter the portfolio yet. ${W.join(" ")}`);const ie=le.profile||{},ce=le.initiative||{},kt=ce.id?c.find(Ot=>Ot.id===ce.id):null,dt={...!l.company&&ie.company?{company:ie.company}:{},...bt(l.revenue)<=0&&ie.revenue?{revenue:String(ie.revenue)}:{},...(!l.industry||l.industry==="universal")&&ie.industry?{industry:ie.industry}:{},...!l.transformation_readiness&&ie.transformation_readiness?{transformation_readiness:ie.transformation_readiness}:{},wizard_completed:!0},ls=_?.id||await p({company:ie.company||"My Organisation",...dt});_?.id&&Object.keys(dt).length>1&&await p(dt);const Ka={org_id:ls,company:l.company||ie.company||_?.name||"",revenue:l.revenue||ie.revenue||"",cost_base:l.cost_base||"",ebitda:l.ebitda||"",industry:l.industry||ie.industry||"universal",transformation_readiness:l.transformation_readiness||ie.transformation_readiness||"traditional",captured_at:new Date().toISOString()},pi={type:"aibvf_assessment",source:le.source||"/start",assessed_at:le.createdAt,classification:ce.classification,confidence:ce.confidence,net_low_eur:ce.net_low_eur,net_high_eur:ce.net_high_eur,reason:ce.reason,scores:ce.scores,pillar_basis:ce.pillar_basis,decision_evidence:ce.decision_evidence,work_architecture:ce.work_architecture,change_plan:ce.change_plan,source_org_id:ie.source_org_id||null,profile_snapshot:Ka,evidence_quality:{decision_ready:uy(ce),standard:"Four scored pillars with a substantive supporting record for each pillar."},value_review:dy(ce,Ka)},Hi=Array.isArray(kt?.readiness_indicators)?kt.readiness_indicators.filter(Ot=>!(pi.assessed_at&&Ot?.type==="aibvf_assessment"&&Ot.source===pi.source&&Ot.assessed_at===pi.assessed_at)):[],Ya=await m({...kt?{id:kt.id}:{},org_id:ls,name:kt?.name||Lw(le.proposal),fn:ce.fn||"it",tier:ce.tier||"gen2",risk:kt?.risk||"Medium",outcome:kt?.outcome||le.proposal,status:kt?.status||"Planning",confidence_score:ce.confidence??null,readiness_indicators:[...Hi,pi]});window.AIBVFJourney&&window.AIBVFJourney.track("portfolio_import_confirmed",{entry_route:"portfolio",classification:ce.classification,industry:le.profile?.industry}),window.sessionStorage.removeItem(Kr),window.localStorage.removeItem(Vl),$e(null);const os=ce.classification==="Fix"?"Change Enablement":"Portfolio",cs=B.findIndex(Ot=>Ot.label===os),us=cs>=0?cs:0;C(us),P({tab:Nu[B[us]?.label]||"",initiativeId:Ya?.id||kt?.id||""}),Ya?.id&&window.setTimeout(()=>document.querySelector(`tr[data-initiative-id="${Ya.id}"]`)?.scrollIntoView({behavior:"smooth",block:"center"}),100)}catch(W){je(W.message||"The assessment could not be added to this portfolio.")}finally{Pe(!1)}}},[c,_,le,l,p,m,P,B]);if(le&&!f){const W=le.initiative||{};return u.jsxs("main",{style:{minHeight:"100vh",background:"#EDF2F6",color:"#14243A",fontFamily:"'DM Sans', Arial, sans-serif"},children:[u.jsx("header",{style:{background:"#172C4B",padding:"18px clamp(20px, 5vw, 72px)"},children:u.jsxs("a",{href:"/start",style:{display:"inline-flex",alignItems:"center",gap:11,color:"#FFFFFF",textDecoration:"none"},children:[u.jsx("span",{style:{width:38,height:38,display:"grid",placeItems:"center",border:"2px solid #C98237",borderRadius:8,color:"#E2A667",fontFamily:"Georgia, serif",fontWeight:700,fontSize:13},children:"BVF"}),u.jsxs("span",{children:[u.jsxs("strong",{style:{display:"block",fontSize:15},children:["Craig Horton ",u.jsx("span",{style:{color:"#E2A667"},children:"Advisory"})]}),u.jsx("small",{style:{color:"#BDCAD8",fontSize:10},children:"AI business value framework"})]})]})}),u.jsxs("div",{style:{width:"min(880px, calc(100% - 40px))",margin:"0 auto",padding:"56px 0 72px"},children:[u.jsx("p",{style:{margin:"0 0 10px",color:"#A85F22",fontSize:12,fontWeight:700},children:"Your assessment is ready"}),u.jsx("h1",{style:{margin:"0 0 16px",color:"#14243A",fontFamily:"'Playfair Display', Georgia, serif",fontSize:"clamp(34px, 5vw, 52px)",lineHeight:1.06},children:"Add this decision to your portfolio"}),u.jsx("p",{style:{margin:"0 0 30px",maxWidth:720,color:"#40536C",fontSize:17,lineHeight:1.65},children:"Check the record below, then add it once. The company context, decision evidence, work-design answers, value range and verdict will enter the same initiative record."}),u.jsxs("section",{style:{padding:"26px",background:"#FFFFFF",border:"1px solid #D6DEE8",borderTop:"4px solid #B87333",boxShadow:"0 12px 30px rgba(22,44,75,.08)"},children:[u.jsx("h2",{style:{margin:"0 0 16px",color:"#14243A",fontSize:21,lineHeight:1.4},children:le.proposal}),u.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:14,padding:"16px 0",borderTop:"1px solid #DCE4EC",borderBottom:"1px solid #DCE4EC"},children:[u.jsxs("div",{children:[u.jsx("small",{style:{display:"block",color:"#66788F",marginBottom:4},children:"Direction"}),u.jsx("strong",{style:{color:"#9A5C21"},children:W.classification||"Provisional"})]}),u.jsxs("div",{children:[u.jsx("small",{style:{display:"block",color:"#66788F",marginBottom:4},children:"Modelled value"}),u.jsxs("strong",{children:[Ll(W.net_low_eur)," to ",Ll(W.net_high_eur)]})]}),u.jsxs("div",{children:[u.jsx("small",{style:{display:"block",color:"#66788F",marginBottom:4},children:"Decision score"}),u.jsxs("strong",{children:[W.confidence??"Not resolved"," of 100"]})]})]}),u.jsxs("dl",{style:{display:"grid",gridTemplateColumns:"minmax(120px, 180px) 1fr",gap:"10px 18px",margin:"20px 0 0",fontSize:14},children:[u.jsx("dt",{style:{color:"#66788F"},children:"Company"}),u.jsx("dd",{style:{margin:0,fontWeight:700},children:le.profile?.company||l.company||_?.name||"Confirm in the company profile"}),u.jsx("dt",{style:{color:"#66788F"},children:"Industry"}),u.jsx("dd",{style:{margin:0,fontWeight:700},children:le.profile?.industry?.replaceAll("_"," ")||"Not resolved"}),u.jsx("dt",{style:{color:"#66788F"},children:"Annual revenue"}),u.jsx("dd",{style:{margin:0,fontWeight:700},children:Ll(le.profile?.revenue)}),u.jsx("dt",{style:{color:"#66788F"},children:"Readiness"}),u.jsx("dd",{style:{margin:0,fontWeight:700},children:le.profile?.transformation_readiness||"Not resolved"}),u.jsx("dt",{style:{color:"#66788F"},children:"Function and AI type"}),u.jsxs("dd",{style:{margin:0,fontWeight:700},children:[W.fn||"Not resolved"," · ",W.tier||"Not resolved"]})]}),Se.length>0&&u.jsxs("div",{role:"alert",style:{marginTop:18,padding:"14px 16px",background:"#FFF3F2",borderLeft:"3px solid #B42318",color:"#6F241F",fontSize:13,lineHeight:1.55},children:[u.jsx("strong",{style:{display:"block",marginBottom:5},children:"This assessment does not match the active company."}),Se.map(ie=>u.jsx("div",{children:ie},ie)),u.jsx("a",{href:Iw(le,l,_),style:{display:"inline-block",marginTop:10,color:"#8F2119",fontWeight:700},children:"Reassess it with this company’s profile"})]}),oe&&u.jsx("div",{role:"alert",style:{marginTop:18,padding:"11px 13px",background:"#FFF1F0",borderLeft:"3px solid #B42318",color:"#8E1B12",fontSize:13},children:oe}),u.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:12,marginTop:24},children:[u.jsx("button",{onClick:Ga,disabled:Me||Se.length>0,style:{minHeight:46,padding:"10px 18px",border:0,borderRadius:4,background:"#B87333",color:"#FFFFFF",fontWeight:700,cursor:Me?"wait":"pointer",opacity:Me||Se.length>0?.55:1},children:Me?"Adding the assessment...":W.classification==="Fix"?"Add and open the change plan":"Add assessment to portfolio"}),u.jsx("button",{onClick:ss,disabled:Me,style:{minHeight:46,padding:"10px 18px",border:"1px solid #BFCBD7",borderRadius:4,background:"#FFFFFF",color:"#40536C",fontWeight:700,cursor:"pointer"},children:"Discard this assessment"})]})]})]})]})}return u.jsxs("div",{className:"workspace-shell",style:{minHeight:"100vh",background:"#EDF2F6",color:"#172C4B"},children:[u.jsxs("div",{className:"workspace-header",style:{padding:"18px clamp(20px, 4vw, 56px)",borderBottom:"1px solid #243D5F",background:"#172C4B",display:"flex",justifyContent:"space-between",alignItems:"flex-start",flexWrap:"wrap",gap:12},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[u.jsx("img",{src:"/bvf-logo.svg",alt:"BVF",style:{height:36}}),u.jsxs("div",{children:[u.jsx("div",{style:{fontSize:9,letterSpacing:4,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif",fontWeight:600,marginBottom:6},children:"Craig Horton · AI transformation advisory · 2026"}),u.jsx("h1",{style:{fontSize:24,fontWeight:700,letterSpacing:-.5,marginBottom:3,color:"#FFFFFF"},children:"AI Business Value Framework"}),u.jsx("p",{style:{fontSize:12,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",fontStyle:"italic"},children:"Every AI investment mapped to the evidence and decisions that matter"})]})]}),u.jsxs("div",{className:"workspace-header__actions",style:{display:"flex",gap:10,alignItems:"center"},children:[u.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>K(!0),children:"? Help"}),r&&u.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>x("/admin"),children:"Admin"}),r&&u.jsx("button",{className:"btn-ghost btn-sm",onClick:()=>X(!0),children:"Team"}),u.jsx("span",{style:{fontSize:11,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif"},children:n?.email}),u.jsx("button",{className:"btn-ghost btn-sm",onClick:a,children:"Sign out"})]})]}),u.jsx(yw,{}),u.jsxs("div",{className:"workspace-tab-nav",style:{padding:"0 clamp(20px, 4vw, 56px)",borderBottom:"1px solid #D2DBE5",background:"#FFFFFF",display:"flex",gap:4,alignItems:"stretch",overflowX:"auto"},children:[Va.map(({tab:W,index:ie})=>u.jsxs("button",{className:"workspace-primary-tab",onClick:()=>Z(ie),style:{padding:"12px 18px 11px",background:"transparent",border:"none",borderBottom:ie===k?"2px solid #B87333":"2px s
56olid transparent",color:ie===k?"#172C4B":"#60748A",fontSize:12,fontFamily:"'DM Sans', sans-serif",fontWeight:ie===k?700:500,cursor:"pointer",whiteSpace:"nowrap",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:1},children:[u.jsxs("span",{children:[sn[W.label].label,W.label==="Portfolio"&&Pa?" · attention":"",W.label==="BVF"&&!ge?" · profile needed":"",N.has(ie)?" · updated":""]}),u.jsx("span",{style:{color:"#60748A",fontSize:10,fontWeight:400},children:sn[W.label].description})]},W.label)),u.jsxs("label",{className:"workspace-more-tab",style:{marginLeft:"auto",minWidth:190,padding:"9px 0 8px"},children:[u.jsx("span",{style:{display:"block",marginBottom:3,color:"#60748A",fontSize:9},children:"More analysis"}),u.jsxs("select",{value:Ii.some(({index:W})=>W===k)?String(k):"",onChange:W=>W.target.value&&Z(Number(W.target.value)),style:{minHeight:32,padding:"4px 28px 4px 9px",fontSize:11},children:[u.jsx("option",{value:"",children:"Choose a specialist view"}),Ii.map(({tab:W,index:ie})=>u.jsxs("option",{value:ie,children:[W.label,W.label==="CM Health"&&Li?" · attention":""]},W.label))]})]})]}),u.jsxs("div",{className:"workspace-content",style:{maxWidth:1440,margin:"0 auto",padding:"32px clamp(20px, 4vw, 56px) 56px"},children:[c.length>0&&ut==="Portfolio"&&u.jsxs("section",{className:"workspace-initiative-focus","aria-label":"Initiative in focus",style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px 16px",marginBottom:18,padding:"12px 14px",background:"#FFFFFF",border:"1px solid #D2DBE5"},children:[u.jsx("label",{htmlFor:"workspace-initiative",style:{color:"#60748A",fontSize:11,fontWeight:700},children:"Initiative in focus"}),u.jsx("select",{id:"workspace-initiative",value:ve,onChange:W=>J(W.target.value),style:{minHeight:36,minWidth:"min(360px, 100%)",padding:"6px 30px 6px 10px",border:"1px solid #BFCBD7",background:"#FFFFFF",color:"#172C4B"},children:c.map(W=>u.jsx("option",{value:W.id,children:W.name||"Untitled initiative"},W.id))}),u.jsx("span",{style:{color:"#66788F",fontSize:11},children:"This initiative is carried into its assessment, change plan and shared link."})]}),zl[ut]&&u.jsxs("section",{className:"decision-context","aria-label":"How this view changes the decision",children:[u.jsxs("div",{className:"decision-context__copy",children:[u.jsx("span",{className:"fl",children:"How this view changes the decision"}),u.jsx("h2",{children:zl[ut].question}),u.jsx("p",{children:zl[ut].detail})]}),u.jsx("div",{className:"decision-context__actions",children:zl[ut].next.map(W=>u.jsx("button",{type:"button",className:"btn-sec",onClick:()=>de(W),children:W==="Portfolio"?"Back to decisions":W==="BVF"?"Open value map":"Open change plan"},W))})]}),u.jsxs(w.Suspense,{fallback:u.jsx("div",{style:{padding:"32px 0",color:"#60748A"},children:"Opening this view..."}),children:[ut==="BVF"&&u.jsx(Cw,{}),ut==="Portfolio"&&u.jsx(kw,{selectedInitiativeId:ve,onSelectInitiative:J}),ut==="Change Enablement"&&u.jsx(Mw,{selectedInitiativeId:ve,onSelectInitiative:J}),ut==="Healthcare"&&u.jsx(zw,{selectedInitiativeId:ve,onSelectInitiative:J}),ut==="Pace Layer"&&u.jsx(Uw,{}),ut==="CM Health"&&u.jsx(Ow,{}),ut==="Regulatory"&&u.jsx(Bw,{}),ut==="Alignment Map"&&u.jsx(Dw,{}),ut==="Benchmarks"&&u.jsx(Nw,{})]})]}),u.jsxs("div",{style:{padding:"12px 40px",borderTop:"1px solid #D2DBE5",background:"#FFFFFF",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:8},children:[u.jsx("div",{style:{fontSize:10,color:"#60748A",fontFamily:"'Trebuchet MS', sans-serif"},children:"AI BVF engine 0.10.4 · Craig Horton · 2026 · published evidence + disclosed planning assumptions"}),u.jsx("div",{style:{fontSize:10,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif"},children:"[email protected] · linkedin.com/in/craig-horton-7a27128"})]}),D&&u.jsx(vw,{onClose:()=>q(!1),profile:l,saveProfile:p,saveInitiative:m,initiatives:c,agentTasks:d}),L&&u.jsx(Sw,{orgId:l.org_id,onClose:()=>X(!1)}),ne&&u.jsx(Aw,{onClose:()=>{K(!1),l.wizard_completed||p({wizard_completed:!0})},onLaunchWizard:()=>{K(!1),q(!0)},onLoadSample:to,sampleLoading:Q})]})}const Hw=["Craig Horton Advisory","Fast Slow","Kuik"];function qw(){const{signOut:a,user:n}=$a(),r=Ha(),[l,c]=w.useState([]),[d,f]=w.useState([]),[p,m]=w.useState(!0),[y,v]=w.useState(!1),[_,x]=w.useState(""),[E,T]=w.useState(""),[k,C]=w.useState("client"),[D,q]=w.useState(""),[L,X]=w.useState(!1),[ne,K]=w.useState(""),[Q,me]=w.useState("universal"),le=w.useCallback(async()=>{m(!0);const[oe,je]=await Promise.all([_e.from("organisations").select("*").order("created_at",{ascending:!1}),_e.from("users").select("*").order("email")]);oe.data&&c(oe.data),je.data&&f(je.data),m(!1)},[]);w.useEffect(()=>{const oe=window.setTimeout(()=>{le()},0);return()=>window.clearTimeout(oe)},[le]);async function $e(oe){if(oe.preventDefault(),!ne.trim())return;const{data:je}=await _e.from("organisations").select("id").ilike("name",ne.trim()).limit(1);if(je&&je.length>0){q('Organisation "'+ne.trim()+'" already exists.');return}const{error:Se}=await _e.from("organisations").insert({name:ne.trim(),industry:Q});if(Se){q("Error: "+Se.message);return}K(""),X(!1),le()}async function Me(oe){if(oe.preventDefault(),q(""),!_||!E){q("Email and organisation required");return}try{const je=await cy(_.trim(),E,k);q(je.message),x(""),le()}catch(je){q("Error: "+je.message)}}
56function Pe(oe){r(`/workspace/${oe}`)}return u.jsxs("div",{className:"workspace-shell admin-shell",style:{minHeight:"100vh",background:"#EDF2F6",color:"#172C4B"},children:[u.jsxs("div",{style:{padding:"24px 40px 16px",borderBottom:"1px solid #243D5F",background:"#172C4B",display:"flex",justifyContent:"space-between",alignItems:"flex-start",flexWrap:"wrap",gap:12},children:[u.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14},children:[u.jsx("img",{src:"/bvf-logo.svg",alt:"BVF",style:{height:36}}),u.jsxs("div",{children:[u.jsx("div",{style:{fontSize:9,letterSpacing:4,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif",fontWeight:600,marginBottom:6},children:"Craig Horton · AI transformation advisory · 2026"}),u.jsx("h1",{style:{fontSize:24,fontWeight:700,letterSpacing:-.5,marginBottom:3,color:"#FFFFFF"},children:"Admin dashboard"}),u.jsx("p",{style:{fontSize:12,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",fontStyle:"italic"},children:"Manage client organisations and users"})]})]}),u.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[u.jsx("span",{style:{fontSize:11,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif"},children:n?.email}),u.jsx("button",{className:"btn-ghost btn-sm",onClick:a,children:"Sign out"})]})]}),u.jsxs("div",{className:"workspace-content",style:{maxWidth:1440,margin:"0 auto",padding:"32px clamp(20px, 4vw, 56px)"},children:[u.jsxs("div",{style:{display:"flex",gap:10,marginBottom:24,flexWrap:"wrap"},children:[u.jsx("button",{className:"btn",onClick:()=>X(!L),children:"+ New Organisation"}),u.jsx("button",{className:"btn-ghost",onClick:()=>v(!y),children:"+ Invite User"})]}),L&&u.jsxs("form",{onSubmit:$e,style:{marginBottom:24,padding:"22px 26px",background:"rgba(184,115,51,0.07)",border:"1px solid #B87333",borderRadius:4},children:[u.jsx("span",{className:"fl",children:"New Organisation"}),u.jsxs("div",{style:{display:"flex",gap:14,marginTop:10,flexWrap:"wrap"},children:[u.jsxs("div",{style:{flex:2,minWidth:200},children:[u.jsx("span",{className:"fl",children:"Name"}),u.jsx("input",{type:"text",value:ne,onChange:oe=>K(oe.target.value),placeholder:"e.g. Philips Healthcare"})]}),u.jsxs("div",{style:{flex:1,minWidth:150},children:[u.jsx("span",{className:"fl",children:"Industry"}),u.jsx("select",{value:Q,onChange:oe=>me(oe.target.value),children:Object.entries(ns).map(([oe,je])=>u.jsx("option",{value:oe,children:je},oe))})]}),u.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:10},children:[u.jsx("button",{type:"submit",className:"btn btn-sm",children:"Create"}),u.jsx("button",{type:"button",className:"btn-ghost btn-sm",onClick:()=>X(!1),children:"Cancel"})]})]})]}),y&&u.jsxs("form",{onSubmit:Me,style:{marginBottom:24,padding:"22px 26px",background:"rgba(184,115,51,0.07)",border:"1px solid #B87333",borderRadius:4},children:[u.jsx("span",{className:"fl",children:"Invite User"}),D&&u.jsx("div",{style:{marginTop:8,padding:"8px 12px",borderRadius:3,background:D.startsWith("Error")?"rgba(255,68,68,0.2)":"rgba(34,197,94,0.2)",border:`1px solid ${D.startsWith("Error")?"#F27B74":"#5FE0A0"}`,color:D.startsWith("Error")?"#F27B74":"#5FE0A0",fontSize:11,fontFamily:"'Trebuchet MS', sans-serif"},children:D}),u.jsxs("div",{style:{display:"flex",gap:14,marginTop:10,flexWrap:"wrap"},children:[u.jsxs("div",{style:{flex:2,minWidth:200},children:[u.jsx("span",{className:"fl",children:"Email"}),u.jsx("input",{type:"email",value:_,onChange:oe=>x(oe.target.value),placeholder:"[email protected]"})]}),u.jsxs("div",{style:{flex:1,minWidth:150},children:[u.jsx("span",{className:"fl",children:"Organisation"}),u.jsxs("select",{value:E,onChange:oe=>T(oe.target.value),children:[u.jsx("option",{value:"",children:"Select..."}),l.map(oe=>u.jsx("option",{value:oe.id,children:oe.name},oe.id))]})]}),u.jsxs("div",{style:{flex:1,minWidth:120},children:[u.jsx("span",{className:"fl",children:"Role"}),u.jsxs("select",{value:k,onChange:oe=>C(oe.target.value),children:[u.jsx("option",{value:"client",children:"Client"}),u.jsx("option",{value:"admin",children:"Admin"})]})]}),u.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:10},children:[u.jsx("button",{type:"submit",className:"btn btn-sm",children:"Invite"}),u.jsx("button",{type:"button",className:"btn-ghost btn-sm",onClick:()=>v(!1),children:"Cancel"})]})]})]}),u.jsxs("div",{style:{marginBottom:24,padding:"22px 28px",background:"rgba(184,115,51,0.07)",border:"1px solid rgba(184,115,51,0.28)",borderLeft:"4px solid #B87333",borderRadius:3},children:[u.jsx("span",{className:"fl",children:"Facilitator Guide"}),u.jsxs("div",{style:{fontSize:13,color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif",lineHeight:1.7,marginTop:8},children:[u.jsxs("p",{style:{marginBottom:10},children:[u.jsx("strong",{style:{color:"#B87333"},children:"Step 1, profile:"})," Start by entering the client's company name, revenue, cost base and EBITDA, then select the industry to apply the disclosed planning assumptions."]}),u.jsxs("p",{style:{marginBottom:10},children:[u.jsx("strong",{style:{color:"#B87333"},children:"Step 2, BVF exploration:"})," Walk through each function and layer, using the planning range to identify the evidence needed for each value claim."]}),u.jsxs("p",{style:{marginBottom:10},children:[u.jsx("strong",{style:{color:"#B87333"},children:"Step 3 — Portfolio Build:"})," Add each AI initiative the client is running or planning. Capture tier, budget, CM allocation, and run the Pilot Trap Diagnostic."]}),u.jsxs("p",{style:{marginBottom:10},children:[u.jsx("strong",{style:{color:"#B87333"},children:"Step 4 — CM health check:"})," Review the aggregate allocation against the AI BVF 10% review point, then test whether the change work is named and costed."]}),u.jsxs("p",{style:{marginBottom:10},children:[u.jsx("strong",{style:{color:"#B87333"},children:"Step 5 — Regulatory:"})," Select applicable regulatory frameworks and review compliance cost implications against revenue."]}),u.jsxs("p",{children:[u.jsx("strong",{style:{color:"#B87333"},children:"Step 6 — Alignment Map:"})," Present the board-ready summary. This is the artefact the client takes to their board."]})]})]}),u.jsxs("span",{className:"fl",style:{marginBottom:14,display:"block"},children:["Client Organisations (",l.length,")"]}),p?u.jsx("div",{style:{padding:40,textAlign:"center",color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif"},children:"Loading..."}):l.length===0?u.jsx("div",{style:{padding:48,textAlign:"center",border:"1px dashed rgba(184,115,51,0.25)",borderRadius:4,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif",fontStyle:"italic"},children:"No organisations yet. Create one above."}):u.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:14},children:l.map(oe=>{const je=d.filter(Se=>Se.org_id===oe.id);return u.jsxs("div",{style:{padding:"18px 22px",background:"rgba(255,255,255,0.06)",border:"1px solid rgba(184,115,51,0.25)",borderTop:"3px solid #B87333",borderRadius:3,cursor:"pointer"},onClick:()=>Pe(oe.id),children:[u.jsx("div",{style:{fontSize:15,fontWeight:700,color:"#F6F9FD",fontFamily:"'Trebuchet MS', sans-serif",marginBottom:4},children:oe.name}),u.jsxs("div",{style:{fontSize:11,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif",marginBottom:10},children:[ns[oe.industry]||"Universal / Other"," · ",je.length," user",je.length!==1?"s":""]}),u.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:je.map(Se=>u.jsxs("span",{style:{padding:"2px 8px",fontSize:10,borderRadius:2,background:"rgba(255,255,255,0.09)",border:"1px solid rgba(255,255,255,0.1)",color:"#A7B6C9",fontFamily:"'Trebuchet MS', sans-serif"},children:[Se.email," (",Se.role,")"]},Se.id))}
56),u.jsx("div",{style:{marginTop:10,fontSize:10,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif"},children:"Click to open workspace →"}),!Hw.includes(oe.name)&&u.jsx("button",{onClick:async Se=>{if(Se.stopPropagation(),!window.confirm("Delete this organisation?"))return;const{error:I}=await _e.from("organisations").delete().eq("id",oe.id);I?(console.error("Delete error:",I),alert("Delete failed: "+I.message)):c(B=>B.filter(ee=>ee.id!==oe.id))},style:{marginTop:"8px",padding:"6px 14px",background:"#E5544C",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px"},children:"Delete"})]},oe.id)})})]}),u.jsxs("div",{style:{padding:"12px 40px",borderTop:"1px solid rgba(184,115,51,0.1)",display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:8},children:[u.jsx("div",{style:{fontSize:10,color:"#DCE4EF",fontFamily:"'Trebuchet MS', sans-serif"},children:"AI BVF engine 0.10.4 · Craig Horton · 2026 · published evidence + disclosed planning assumptions"}),u.jsx("div",{style:{fontSize:10,color:"#B87333",fontFamily:"'Trebuchet MS', sans-serif"},children:"[email protected] · linkedin.com/in/craig-horton-7a27128"})]})]})}function $w(){return w.useEffect(()=>{document.title="AI BVF v1.0 Public Protocol"},[]),u.jsxs("div",{className:"protocol-page",style:R.page,children:[u.jsx("header",{style:R.topbar,children:u.jsxs("div",{style:R.topbarInner,children:[u.jsxs("div",{style:R.brand,children:[u.jsx("span",{style:R.brandMark,children:"◇"}),u.jsx("span",{style:R.brandName,children:"AI BVF.OPEN"})]}),u.jsxs("nav",{style:R.nav,children:[u.jsx("a",{href:"#abstract",style:R.navLink,children:"Abstract"}),u.jsx("a",{href:"/protocol/scorer",style:{...R.navLink,color:"#B87333"},children:"Scorer"}),u.jsx("a",{href:"/protocol/validate",style:R.navLink,children:"Validate"}),u.jsx("a",{href:"/bvf-protocol.schema.json",style:R.navLink,children:"Schema"}),u.jsx("a",{href:"#cite",style:R.navLink,children:"Cite"})]})]})}),u.jsxs("main",{style:R.main,children:[u.jsx("div",{style:R.docRef,children:"AIBVF-PROTO-001 · v1.0 · Draft"}),u.jsx("h1",{style:R.h1,children:"AI BVF v1.0 — AI Business Value Framework Public Protocol"}),u.jsx("div",{style:R.metaBox,children:u.jsx("table",{style:R.metaTable,children:u.jsxs("tbody",{children:[u.jsxs("tr",{children:[u.jsx("td",{style:R.metaKey,children:"Document Reference"}),u.jsx("td",{style:R.metaVal,children:"AIBVF-PROTO-001"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.metaKey,children:"Version"}),u.jsx("td",{style:R.metaVal,children:"1.0 (Draft Standard)"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.metaKey,children:"Last revision"}),u.jsx("td",{style:R.metaVal,children:"2026-08-18"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.metaKey,children:"Editor"}),u.jsx("td",{style:R.metaVal,children:"Craig Horton, AI BVF Working Group"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.metaKey,children:"Status"}),u.jsx("td",{style:R.metaVal,children:"Open for public comment"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.metaKey,children:"License"}),u.jsx("td",{style:R.metaVal,children:"CC-BY-4.0 (grammar) · Proprietary (corpus, marks)"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.metaKey,children:"Schema URI"}),u.jsx("td",{style:R.metaVal,children:u.jsx("a",{href:"/bvf-protocol.schema.json",style:R.link,children:"bvf-protocol.schema.json"})})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.metaKey,children:"Stable ID"}),u.jsx("td",{style:R.metaVal,children:"urn:aibvf:proto:1.0"})]})]})})}),u.jsxs("section",{style:R.statusBlock,children:[u.jsx("div",{style:R.statusLabel,children:"STATUS OF THIS DOCUMENT"}),u.jsx("p",{style:R.p,children:"This is a draft specification of the AI Business Value Framework (AI BVF) Public Protocol. It defines a neutral, machine-readable standard for scoring AI transformation initiatives. Any organisation, consultancy, or regulator may adopt this protocol without licence fee. Reference implementations, benchmark corpora, and the AI BVF-Certified Analyst credential are governed separately."})]}),u.jsxs("section",{id:"abstract",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"Abstract"}),u.jsx("p",{style:R.p,children:"Enterprises evaluate AI initiatives using opaque, proprietary methodologies that resist comparison across firms, industries, and advisory vendors. AI BVF defines a common grammar for this evaluation: eight functions, six strategy layers, three AI generations, four scoring pillars, and three classifications (Accelerate, Fix, Stop
56). Conformant tools produce portable JSON portfolios that any other conformant tool can read, score, and benchmark."})]}),u.jsxs("section",{id:"install",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"Get your first assessment"}),u.jsxs("p",{style:R.p,children:[u.jsx("a",{href:"/start",style:R.link,children:"Assess an initiative in your browser"})," without an account. Describe the proposal, organisation, intended outcome and known constraints in plain English. The assessment separates supplied evidence from planning assumptions."]}),u.jsx("h3",{style:R.h3,children:"Use your AI assistant"}),u.jsx("p",{style:R.p,children:"After connecting AI BVF, try this prompt:"}),u.jsx("pre",{style:R.pre,children:`Assess this initiative with AI BVF: We are a EUR 300m retailer
57considering a GenAI assistant for customer service. We want to reduce
58response time. Identify missing evidence and explain your assumptions.`}),u.jsxs("p",{style:R.p,children:["Ask your assistant to use ",u.jsx("code",{style:R.code,children:"assess_ai_initiative"}),". Review the provisional verdict, estimated inputs and missing evidence, then correct the assumptions before using the assessment in a funding decision."]}),u.jsx("h3",{style:R.h3,children:"Hosted connector"}),u.jsx("p",{style:R.p,children:"In Claude, open Settings, Connectors, Add custom connector and enter this URL. Custom connector availability depends on your account and workspace settings."}),u.jsx("pre",{style:R.pre,children:"https://mcp.aibvf.com/api/mcp"}),u.jsx("p",{style:R.p,children:"The hosted connector runs the assessment on the AI BVF server and exposes 13 tools. Share only information you are authorised to send to your assistant and the hosted service."}),u.jsx("h3",{style:R.h3,children:"Local MCP server"}),u.jsx("p",{style:R.p,children:"Install Node.js, then add this configuration to a host that supports local MCP servers, such as Claude Desktop. Restart the host after saving."}),u.jsx("pre",{style:R.pre,children:`{
59  "mcpServers": {
60    "aibvf": {
61      "command": "npx",
62      "args": ["-y", "aibvf-mcp@latest"]
63    }
64  }
65}`}),u.jsxs("p",{style:R.p,children:["On Windows, if the host cannot launch npx directly, use",u.jsx("code",{style:R.code,children:"cmd"})," as the command and",u.jsx("code",{style:R.code,children:'["/c", "npx", "-y", "aibvf-mcp@latest"]'})," as the arguments. Local MCP scoring runs on your computer; your assistant still processes the conversation."]}),u.jsxs("p",{style:R.p,children:["Local telemetry is optional. When enabled, it includes the tool name, verdict, confidence and a stable anonymous installation identifier. See the ",u.jsx("a",{href:"https://github.com/Craig-Horton/ai-bvf/tree/main/packages/mcp#anonymous-usage-telemetry",style:R.link,children:"package documentation"})," for configuration and disclosure."]}),u.jsxs("p",{style:R.p,children:["Both connectors expose 13 tools, including",u.jsx("code",{style:R.code,children:"assess_ai_initiative"}),",",u.jsx("code",{style:R.code,children:"score_initiative"}),",",u.jsx("code",{style:R.code,children:"score_portfolio"})," and",u.jsx("code",{style:R.code,children:"recommend_improvements"}),". An Accelerate recommendation requires evidence that the workflow, roles, decision rights and measures are ready, as well as meeting the scoring thresholds."]}),u.jsx("h3",{style:R.h3,children:"JavaScript / TypeScript"}),u.jsx("pre",{style:R.pre,children:"npm install @aibvf/core"}),u.jsx("pre",{style:R.pre,children:`import { score, validate } from '@aibvf/core';
66
67const r = score({
68  industry: 'manufacturing',
69  revenue_eur: 2_400_000_000,
70  function: 'supply',
71  ai_tier: 'gen2',
72  readiness: 'traditional',
73  scores: {
74    strategic_alignment: 72, financial_return: 64,
75    change_enablement: 48, governance_risk: 35,
76  },
77});
78// r.classification → 'Fix'
79// r.net_low_eur, r.net_high_eur: modelled value in EUR
80// Initiative-specific delivery and operating costs are not deducted.`}),u.jsx("p",{style:R.p,children:"The value range is a planning hypothesis that uses company revenue and disclosed assumptions. Initiative-specific delivery and operating costs must be reconciled separately. The confidence field is a rule-based index derived from pillar scores and input coverage, not a probability that the decision is correct."}),u.jsx("h3",{style:R.h3,children:"Python"}),u.jsx("pre",{style:R.pre,children:"pip install aibvf"}),u.jsx("pre",{style:R.pre,children:`from aibvf import score, validate
81
82r = score(
83    industry='manufacturing', revenue_eur=2_400_000_000,
84    function='supply', ai_tier='gen2', readiness='traditional',
85    scores={'strategic_alignment': 72, 'financial_return': 64,
86            'change_enablement': 48, 'governance_risk': 35},
87)`}),u.jsx("h3",{style:R.h3,children:"Browser (no install)"}),u.jsxs("p",{style:R.p,children:["The ",u.jsx("a",{href:"/protocol/scorer",style:R.link,children:"browser assessment"})," scores locally. Anonymous journey events record assessment progress. Save in this browser keeps a local review record on this browser profile. Continue to workspace transfers the assessment for a separate sign-in and save step."]}),u.jsxs("p",{style:R.p,children:["Source: ",u.jsx("a",{href:"https://github.com/Craig-Horton/ai-bvf",style:R.link,children:"github.com/Craig-Horton/ai-bvf"})," · ","MIT for code, CC-BY-4.0 for spec."]})]}),u.jsxs("section",{id:"toc",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"Contents"}),u.jsxs("ol",{style:R.toc,children:[u.jsx("li",{children:u.jsx("a",{href:"#install",style:R.link,children:"Install and use"})}),u.jsx("li",{children:u.jsx("a",{href:"#s1",style:R.link,children:"Introduction"})}),u.jsx("li",{children:u.jsx("a",{href:"#s2",style:R.link,children:"Conformance"})}),u.jsx("li",{children:u.jsx("a",{href:"#s3",style:R.link,children:"Taxonomy"})}),u.jsx("li",{children:u.jsx("a",{href:"#s4",style:R.link,children:"Four-Pillar Scoring"})}),u.jsx("li",{children:u.jsx("a",{href:"#s5",style:R.link,children:"Classification"})}),u.jsx("li",{children:u.jsx("a",{href:"#s6",style:R.link,children:"Wire Format"})}),u.jsx("li",{children:u.jsx("a",{href:"#s7",style:R.link,children:"Reference API"})}),u.jsx("li",{children:u.jsx("a",{href:"#s8",style:R.link,children:"Benchmark Commons"})}),u.jsx("li",{children:u.jsx("a",{href:"#s9",style:R.link,children:"Compliance Mapping"})}),u.jsx("li",{children:u.jsx("a",{href:"#s10",style:R.link,children:"Certification Programme"})}),u.jsx("li",{children:u.jsx("a",{href:"#s11",style:R.link,children:"References"})})]})]}),u.jsxs("section",{id:"s1",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"1. Introduction"}),u.jsx("p",{style:R.p,children:"The absence of a shared scoring standard for AI initiatives is an active cost. Boards receive contradictory readouts. Regulators lack consistent disclosure. Consultancies duplicate methodology. AI BVF closes the gap by publishing the grammar whilst letting implementations compete on quality."}),u.jsx("p",{style:R.p,children:"Published research defines the enterprise problem and informs the questions in this specification. AI BVF rate ranges, multipliers and weights are disclosed planning assumptions, and no external source is presented as publishing or endorsing them."})]}),u.jsxs("section",{id:"s2",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"2. Conformance"}),u.jsxs("p",{style:R.p,children:["A tool is ",u.jsx("em",{children:"AI BVF-conformant"})," if it can (a) export a portfolio that validates against ",u.jsx("code",{style:R.code,children:"bvf-protocol.schema.json"}),", and (b) ingest any conforming portfolio without loss of required fields. The keywords ",u.jsx("strong",{children:"MUST"}),",",u.jsx("strong",{children:" SHOULD"}),", and ",u.jsx("strong",{children:"MAY"})," follow RFC 2119."]})]}),u.jsxs("section",{id:"s3",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"3. Taxonomy"}),u.jsx("h3",{style:R.h3,children:"3.1 Functions"}),u.jsx("p",{style:R.p,children:"Finance · HR · Sales · Supply Chain · Customer Experience · Risk & Compliance · IT · R&D"}),u.jsx("h3",{style:R.h3,children:"3.2 Layers"}),u.jsx("p",{style:R.p,children:"Board KPIs → External Pressures → Business Initiatives → Operating KPIs → Process / Function → AI Capabilities"}),u.jsx("h3",{style:R.h3,children:"3.3 AI Generations"}),u.jsx("p",{style:R.p,children:"Gen 1 (Automation) · Gen 2 (Generative) · Gen 3 (Agentic)"}),u.jsx("h3",{style:R.h3,children:"3.4 Deployment Buckets"}),u.jsx("p",{style:R.p,children:"Agent-Proof (enhanced governance) · Agent-Augmented (proceed with caution) · Agent-Replaceable (safe for autonomy)"})]}),u.jsxs("section",{id:"s4",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"4. Four-Pillar Scoring"}),u.jsxs("p",{style:R.p,children:["Every initiative ",u.jsx("strong",{children:"MUST"})," be scored on four pillars, each as a value in [0, 100] with an optional confidence and evidence array."]}),u.jsxs("table",{style:R.dataTable,children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:R.th,children:"Pillar"}),u.jsx("th",{style:R.th,children:"Definition"}),u.jsx("th",{style:R.th,children:"Anchor Sources"})]})}),u.jsxs("tbody",{children:[u.jsxs("tr",{children:[u.jsx("td",{style:R.td,children:"Strategic alignment"}),u.jsx("td",{style:R.td,children:"Link between the initiative and a named board KPI."}),u.jsx("td",{style:R.td,children:"AI BVF policy rule"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.td,children:"Financial return"}),u.jsx("td",{style:R.td,children:"Modelled revenue lift, cost take-out, or margin protection."}),u.jsx("td",{style:R.td,children:"AI BVF planning range"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.td,children:"Change enablement"}),u.jsx("td",{style:R.td,children:"Readiness across the EY and Oxford six drivers."}),u.jsx("td",{style:R.td,children:"Published study plus AI BVF scoring rule"})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.td,children:"Governance & Risk"}),u.jsx("td",{style:R.td,children:"EU AI Act classification, DORA, CSRD, GDPR exposure."}),u.jsx("td",{style:R.td,children:"EU regulation, Accenture"})]})]})]})]}),u.jsxs("section",{id:"s5",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"5. Classification"}),u.jsxs("p",{style:R.p,children:["A conformant tool ",u.jsx("strong",{children:"MUST"})," map the four-pillar scores to one of three classifications. The default mapping is reference only; regulated industries ",u.jsx("strong",{children:"MAY"})," substitute a stricter variant."]}),u.jsxs("ul",{style:R.ul,children:[u.jsxs("li",{children:[u.jsx("strong",{children:"Accelerate"})," — strategic alignment, financial return and change enablement each ≥ 60, governance risk ≤ 40, and all four work-design checks recorded as ready."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Fix"})," — the Stop conditions do not apply, but a scoring threshold or work-design check still blocks Accelerate."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Stop"})," — governance risk ≥ 70 or financial return ≤ 20."]})]}),u.jsx("p",{style:R.p,children:"The current engine applies Stop first. Work-design checks cover workflow, roles, decision rights and measures; missing or partial records hold an otherwise qualifying initiative at Fix. Supplied scores and records remain subject to accountable-owner review."})]}),u.jsxs("section",{id:"s6",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"6. Wire Format"}),u.jsx("p",{style:R.p,children:"Portfolios are JSON documents that validate against the published schema. The minimal conforming document:"}),u.jsx("pre",{style:R.pre,children:`{
88  "bvf_version": "1.0",
89  "organization": {
90    "name": "Acme SE",
91    "industry": "manufacturing"
92  },
93  "initiatives": [
94    {
95      "id": "predictive-maintenance-eu",
96      "name": "Predictive maintenance rollout, EU plants",
97      "function": "supply",
98      "ai_tier": "gen2",
99      "bucket": "Agent-Augmented",
100      "scores": {
101        "strategic_alignment": { "value": 82 },
102        "financial_return":    { "value": 71 },
103        "change_enablement":   { "value": 54 },
104        "governance_risk":     { "value": 38 }
105      },
106      "classification": "Fix",
107      "decision_confidence": 68
108    }
109  ]
110}`})]}),u.jsxs("section",{id:"s7",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"7. Reference API"}),u.jsxs("p",{style:R.p,children:["Conformant providers ",u.jsx("strong",{children:"SHOULD"})," expose these endpoints:"]}),u.jsxs("table",{style:R.dataTable,children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:R.th,children:"Method"}),u.jsx("th",{style:R.th,children:"Path"}),u.jsx("th",{style:R.th,children:"Purpose"})]})}),u.jsxs("tbody",{children:[u.jsxs("tr",{children:[u.jsx("td",{style:R.tdMono,children:"POST"}),u.jsx("td",{style:R.tdMono,children:"/v1/score"}),u.jsx("td",{style:R.td,children:"Validate a portfolio, return classifications."})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.tdMono,children:"GET"}),u.jsxs("td",{style:R.tdMono,children:["/v1/benchmarks/","{function}","/","{industry}"]}),u.jsx("td",{style:R.td,children:"Return the AI BVF planning rate, evidence status and use guidance."})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.tdMono,children:"GET"}),u.jsxs("td",{style:R.tdMono,children:["/v1/compliance/","{framework}"]}),u.jsx("td",{style:R.td,children:"Return regulatory obligations mapped to BVF fields."})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.tdMono,children:"POST"}),u.jsx("td",{style:R.tdMono,children:"/v1/commons/contribute"}),u.jsx("td",{style:R.td,children:"Submit anonymised portfolio to the Benchmark Commons."})]})]})]})]}),u.jsxs("section",{id:"s8",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"8. Benchmark Commons"}),u.jsx("p",{style:R.p,children:"The Commons is a proprietary corpus of anonymised, AI BVF-conformant portfolios contributed by adopting organisations. Contributors receive access to aggregate benchmarks stratified by function, industry, and region. The Commons is operated under the Contributor Terms published alongside this specification."})]}),u.jsxs("section",{id:"s9",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"9. Compliance Mapping"}),u.jsx("p",{style:R.p,children:"These draft mappings identify topics for regulatory review. An industry label or scoring output does not establish legal compliance, clinical validation or a completed DORA assessment. A qualified reviewer must determine the obligations and supporting evidence."}),u.jsxs("table",{style:R.dataTable,children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:R.th,children:"Framework"}),u.jsx("th",{style:R.th,children:"AI BVF Field"}),u.jsx("th",{style:R.th,children:"Disclosure"})]})}),u.jsxs("tbody",{children:[u.jsxs("tr",{children:[u.jsx("td",{style:R.td,children:"EU AI Act"}),u.jsx("td",{style:R.tdMono,children:"initiative.bucket"}),u.jsx("td",{style:R.td,children:"High-risk classification evidence."})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.td,children:"DORA"}),u.jsx("td",{style:R.tdMono,children:"scores.governance_risk"}),u.jsx("td",{style:R.td,children:"ICT AI risk register entry."})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.td,children:"CSRD"}),u.jsx("td",{style:R.tdMono,children:"ai_tier, bucket"}),u.jsx("td",{style:R.td,children:"AI energy and materiality disclosure."})]}),u.jsxs("tr",{children:[u.jsx("td",{style:R.td,children:"GDPR / Art. 22"}),u.jsx("td",{style:R.tdMono,children:"bucket, function"}),u.jsx("td",{style:R.td,children:"Automated decision exposure."})]})]})]})]}),u.jsxs("section",{id:"s10",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"10. Certification Programme"}
110),u.jsxs("p",{style:R.p,children:["The ",u.jsx("strong",{children:"AI BVF-Certified Analyst"})," credential verifies that a practitioner can produce conformant portfolios, interpret benchmark data, and brief a board committee on classification outcomes. Certification is a separately governed programme. Certification marks are not licensed under this specification."]})]}),u.jsxs("section",{id:"s11",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"11. References"}),u.jsxs("ol",{style:R.refs,children:[u.jsxs("li",{children:[u.jsxs("a",{href:"https://www.mckinsey.com/capabilities/quantumblack/our-insights/the-state-of-ai/",children:["McKinsey — ",u.jsx("em",{children:"The state of AI 2025"})]}),"."]}),u.jsxs("li",{children:[u.jsxs("a",{href:"https://www.deloitte.com/global/en/issues/generative-ai/ai-roi-the-paradox-of-rising-investment-and-elusive-returns.html",children:["Deloitte — ",u.jsx("em",{children:"AI ROI: The paradox of rising investment and elusive returns"}),", 2025"]}),"."]}),u.jsxs("li",{children:[u.jsxs("a",{href:"https://www.gartner.com/en/articles/genai-project-failure",children:["Gartner — ",u.jsx("em",{children:"Why 50% of GenAI projects fail"}),", 2026"]}),"."]}),u.jsxs("li",{children:[u.jsxs("a",{href:"https://www.prosci.com/blog/how-to-budget-for-change-management",children:["Prosci — ",u.jsx("em",{children:"How to budget for change management"}),", reviewed 2026"]}),"."]}),u.jsxs("li",{children:[u.jsxs("a",{href:"https://www.ey.com/en_uk/insights/consulting/how-transformations-with-humans-at-the-center-can-double-your-success",children:["EY and Oxford Saïd, ",u.jsx("em",{children:"Humans at the centre of transformation"})]}),"."]}),u.jsx("li",{children:"European Union — Regulation 2024/1689 (AI Act); Regulation 2022/2554 (DORA); Directive 2022/2464 (CSRD)."}),u.jsxs("li",{children:["IETF RFC 2119 — ",u.jsx("em",{children:"Key words for use in RFCs to Indicate Requirement Levels"}),"."]})]})]}),u.jsxs("section",{id:"cite",style:R.section,children:[u.jsx("h2",{style:R.h2,children:"Cite this specification"}),u.jsx("pre",{style:R.pre,children:`Horton, C. (2026). AI BVF v1.0 — AI Business Value Framework Public
111Protocol (AIBVF-PROTO-001). AI BVF Working Group. urn:aibvf:proto:1.0
112Retrieved from https://www.aibvf.com/protocol`})]}),u.jsxs("footer",{style:R.footer,children:[u.jsx("div",{children:"AI BVF Working Group · AIBVF-PROTO-001 · v1.0 Draft · 2026-08-18"}),u.jsx("div",{style:R.footerDim,children:"Specification text licensed under CC-BY-4.0. Benchmark corpus, API operation, and certification marks are proprietary and governed separately."})]})]})]})}const R={page:{minHeight:"100vh",background:"#EDF2F6",color:"#2B3D52",fontFamily:"'Charter', 'Iowan Old Style', Georgia, 'Times New Roman', serif",fontSize:16,lineHeight:1.6},topbar:{borderBottom:"1px solid #243D5F",background:"#172C4B"},topbarInner:{maxWidth:920,margin:"0 auto",padding:"14px 32px",display:"flex",alignItems:"center",justifyContent:"space-between"},brand:{display:"flex",alignItems:"center",gap:10,fontFamily:"'IBM Plex Mono', 'Menlo', monospace",fontSize:13,letterSpacing:2,color:"#F6F9FD"},brandMark:{color:"#B87333",fontSize:18},brandName:{fontWeight:700},nav:{display:"flex",gap:22,fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:12},navLink:{color:"#DCE4EF",textDecoration:"none",letterSpacing:.5},main:{maxWidth:820,margin:"0 auto",padding:"56px 32px 96px"},docRef:{fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,letterSpacing:2.5,color:"#A7B6C9",textTransform:"uppercase",marginBottom:16},h1:{fontFamily:"'Charter', 'Iowan Old Style', Georgia, serif",fontSize:34,fontWeight:700,lineHeight:1.2,color:"#172C4B",marginBottom:28,letterSpacing:-.3},metaBox:{background:"#FFFFFF",border:"1px solid #D2DBE5",padding:"18px 22px",marginBottom:36},metaTable:{width:"100%",borderCollapse:"collapse"},metaKey:{fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,color:"#A7B6C9",letterSpacing:1.5,textTransform:"uppercase",padding:"4px 16px 4px 0",verticalAlign:"top",whiteSpace:"nowrap",width:"30%"},metaVal:{fontSize:14,color:"#2B3D52",padding:"4px 0",fontFamily:"'IBM Plex Mono', Menlo, monospace"},statusBlock:{borderLeft:"3px solid #B87333",background:"#FFF7EF",padding:"16px 22px",marginBottom:48},statusLabel:{fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:10,letterSpacing:2.5,color:"#D9A672",marginBottom:6,fontWeight:700},section:{marginBottom:44,scrollMarginTop:24},h2:{fontFamily:"'Charter', Georgia, serif",fontSize:22,fontWeight:700,color:"#172C4B",borderBottom:"1px solid rgba(184,115,51,0.22)",paddingBottom:6,marginBottom:14},h3:{fontSize:15,fontWeight:700,color:"#D9A672",marginTop:18,marginBottom:6,fontFamily:"'IBM Plex Mono', Menlo, monospace",letterSpacing:.5},p:{marginBottom:12,color:"#2B3D52"},toc:{paddingLeft:22,lineHeight:1.9},link:{color:"#D9A672",textDecoration:"underline",textDecorationColor:"rgba(184,115,51,0.6)"},code:{fontFamily:"'IBM Plex Mono', Menlo, monospace",background:"#F1F4F7",padding:"1px 6px",borderRadius:3,fontSize:13,color:"#9A5C21"},pre:{fontFamily:"'IBM Plex Mono', Menlo, monospace",background:"#172C4B",color:"#F4F7FA",padding:"18px 22px",fontSize:13,lineHeight:1.55,overflow:"auto",borderRadius:4,margin:"10px 0",border:"1px solid #243D5F"},ul:{paddingLeft:22,lineHeight:1.85},dataTable:{width:"100%",borderCollapse:"collapse",marginTop:8,border:"1px solid #D2DBE5",background:"#FFFFFF"},th:{textAlign:"left",padding:"10px 14px",fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,letterSpacing:1.5,textTransform:"uppercase",color:"#60748A",borderBottom:"1px solid #D2DBE5",background:"#F7F9FB"},td:{padding:"10px 14px",fontSize:14,borderBottom:"1px solid #D2DBE5",verticalAlign:"top"},tdMono:{padding:"10px 14px",fontSize:13,fontFamily:"'IBM Plex Mono', Menlo, monospace",borderBottom:"1px solid #D2DBE5",color:"#9A5C21",verticalAlign:"top"},refs:{paddingLeft:22,lineHeight:1.8,fontSize:14,color:"#2B3D52"},footer:{marginTop:56,paddingTop:20,borderTop:"1px solid #D2DBE5",fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,color:"#60748A",letterSpacing:.5},footerDim:{marginTop:6,color:"#60748A"}},ag=`{
113  "bvf_version": "1.0",
114  "organization": {
115    "name": "Acme SE",
116    "industry": "manufacturing",
117    "region": "EU",
118    "revenue_eur": 2400000000,
119    "headcount": 11500
120  },
121  "initiatives": [
122    {
123      "id": "predictive-maintenance-eu",
124      "name": "Predictive maintenance rollout, EU plants",
125      "function": "supply",
126      "ai_tier": "gen2",
127      "bucket": "Agent-Augmented",
128      "scores": {
129        "strategic_alignment": { "value": 82, "confidence": 75 },
130        "financial_return":    { "value": 71, "confidence": 60 },
131        "change_enablement":   { "value": 54, "confidence": 55 },
132        "governance_risk":     { "value": 38, "confidence": 70 }
133      },
134      "classification": "Fix",
135      "decision_confidence": 68,
136      "pilot_gate": { "sponsored": true, "owner": true, "scaled": false, "kpi": true, "funded": true },
137      "compliance": ["eu_ai_act", "csrd"]
138    }
139  ],
140  "benchmark_consent": { "contribute_anonymised": true, "retain_org_identity": false }
141}`,rg=["universal","creative","education","energy","financial","healthcare","logistics","manufacturing","nonprofit","professional","public_sector","real_estate","retail","technology"],sg=["finance","hr","sales","supply","cx","risk","it","rd"],lg=["gen1","gen2","gen3"],og=["Agent-Proof","Agent-Augmented","Agent-Replaceable"],cg=["Accelerate","Fix","Stop"],ug=["eu_ai_act","dora","csrd","gdpr_ai"],Pw=["strategic_alignment","financial_return","change_enablement","governance_risk"];function Vw(a){const n=[],r=(l,c)=>n.push({path:l,msg:c});return!a||typeof a!="object"||Array.isArray(a)?(r("","Document must be a JSON object."),{valid:!1,errors:n}):(a.bvf_version!=="1.0"&&r("bvf_version",'Required. Must be the string "1.0".'),a.organization?((!a.organization.name||typeof a.organization.name!="string")&&r("organization.name","Required string."),rg.includes(a.organization.industry)||r("organization.industry",`Must be one of: ${rg.join(", ")}.`),a.organization.revenue_eur!==void 0&&(typeof a.organization.revenue_eur!="number"||a.organization.revenue_eur<0)&&r("organization.revenue_eur","Must be a non-negative number."),a.organization.headcount!==void 0&&(!Number.isInteger(a.organization.headcount)||a.organization.headcount<0)&&r("organization.headcount","Must be a non-negative integer.")):r("organization","Required object."),!Array.isArray(a.initiatives)||a.initiatives.length===0?r("initiatives","Required. Must be a non-empty array."):a.initiatives.forEac
141h((l,c)=>{const d=`initiatives[${c}]`;if((!l.id||!/^[a-z0-9-]{1,64}$/.test(l.id))&&r(`${d}.id`,"Required. Lowercase letters, digits, and hyphens only (max 64 chars)."),!l.name||typeof l.name!="string"?r(`${d}.name`,"Required string (max 240 chars)."):l.name.length>240&&r(`${d}.name`,"Exceeds 240 characters."),sg.includes(l.function)||r(`${d}.function`,`Must be one of: ${sg.join(", ")}.`),lg.includes(l.ai_tier)||r(`${d}.ai_tier`,`Must be one of: ${lg.join(", ")} (gen1=Automation, gen2=GenAI, gen3=Agentic).`),l.bucket!==void 0&&!og.includes(l.bucket)&&r(`${d}.bucket`,`Must be one of: ${og.join(", ")}.`),!l.scores||typeof l.scores!="object"?r(`${d}.scores`,"Required object with all four pillar scores."):Pw.forEach(f=>{if(!l.scores[f]||typeof l.scores[f]!="object"){r(`${d}.scores.${f}`,"Required pillar score object.");return}const p=l.scores[f].value;(typeof p!="number"||p<0||p>100)&&r(`${d}.scores.${f}.value`,"Required. Number in [0, 100].");const m=l.scores[f].confidence;m!==void 0&&(typeof m!="number"||m<0||m>100)&&r(`${d}.scores.${f}.confidence`,"Optional. Number in [0, 100]."),l.scores[f].evidence!==void 0&&!Array.isArray(l.scores[f].evidence)&&r(`${d}.scores.${f}.evidence`,"Optional. Must be an array of strings.")}),l.classification!==void 0&&!cg.includes(l.classification)&&r(`${d}.classification`,`Must be one of: ${cg.join(", ")}.`),l.decision_confidence!==void 0){const f=l.decision_confidence;(typeof f!="number"||f<0||f>100)&&r(`${d}.decision_confidence`,"Must be a number in [0, 100].")}l.compliance!==void 0&&(Array.isArray(l.compliance)?l.compliance.forEach((f,p)=>{ug.includes(f)||r(`${d}.compliance[${p}]`,`Must be one of: ${ug.join(", ")}.`)}):r(`${d}.compliance`,"Must be an array."))}),{valid:n.length===0,errors:n})}function Gw(){const[a,n]=w.useState(ag),[r,l]=w.useState(null);w.useEffect(()=>{document.title="AI BVF — Validate a Portfolio"},[]);const c=()=>{try{const p=JSON.parse(a),m=Vw(p);l({parseOk:!0,...m})}catch(p){l({parseOk:!1,parseError:p.message})}},d=()=>{n(ag),l(null)},f=()=>{n(""),l(null)};return u.jsxs("div",{style:we.page,children:[u.jsx("header",{style:we.topbar,children:u.jsxs("div",{style:we.topbarInner,children:[u.jsxs("div",{style:we.brand,children:[u.jsx("span",{style:we.brandMark,children:"◇"}),u.jsx("span",{style:we.brandName,children:"AI BVF.OPEN"})]}),u.jsxs("nav",{style:we.nav,children:[u.jsx("a",{href:"/protocol",style:we.navLink,children:"Spec"}),u.jsx("a",{href:"/protocol/validate",style:{...we.navLink,color:"#B87333"},children:"Validate"}),u.jsx("a",{href:"/bvf-protocol.schema.json",style:we.navLink,children:"Schema"})]})]})}),u.jsxs("main",{style:we.main,children:[u.jsx("div",{style:we.docRef,children:"AIBVF-PROTO-001 · Reference Validator"}),u.jsx("h1",{style:we.h1,children:"Validate a Portfolio"}),u.jsx("p",{style:we.lede,children:"Paste any AI BVF v1.0 portfolio JSON below. Validation runs locally in your browser; nothing is uploaded. A passing document is ready for submission to the Benchmark Commons or attachment to a regulatory disclosure."}),u.jsxs("div",{style:we.toolbar,children:[u.jsx("button",{onClick:c,style:we.primaryBtn,children:"Validate"}),u.jsx("button",{onClick:d,style:we.ghostBtn,children:"Load example"}),u.jsx("button",{onClick:f,style:we.ghostBtn,children:"Clear"}),u.jsx("div",{style:we.hint,children:"Conformance is local and deterministic. No network calls."})]}),u.jsx("textarea",{value:a,onChange:p=>{n(p.target.value),l(null)},spellCheck:!1,style:we.textarea,placeholder:'{ "bvf_version": "1.0", "organization": { ... }, "initiatives": [ ... ] }'}),r&&u.jsx("section",{style:we.resultBox,children:r.parseOk?r.valid?u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{...we.badge,background:"#34C77B",color:"#FFF"},children:"CONFORMANT · AI BVF v1.0"}),u.jsxs("div",{style:we.resultBody,children:[u.jsx("div",{style:we.okTitle,children:"Passes conformance."}),u.jsxs("p",{style:we.okText,children:["This portfolio validates against ",u.jsx("code",{style:we.code,children:"bvf-protocol.schema.json"}),". You may attach the AI BVF conformance badge to your documentation:"]}),u.jsx("pre",{style:we.okPre,children:"![AI BVF v1.0 Conformant](https://img.shields.io/badge/AI_BVF-v1.0_Conformant-15803D)"})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{style:{...we.badge,background:"#E9A63C",color:"#FFF"},children:["NON-CONFORMANT · ",r.errors.length," ISSUE",r.errors.length===1?"":"S"]}),u.jsxs("div",{style:we.resultBody,children:[u.jsx("div",{style:we.errTitle,children:"Issues to resolve"}),u.jsxs("table",{style:we.errTable,children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:we.errTh,children:"JSON Path"}),u.jsx("th",{style:we.errTh,children:"Issue"})]})}),u.jsx("tbody",{children:r.errors.map((p,m)=>u.jsxs("tr",{children:[u.jsx("td",{style:we.errTdMono,children:p.path||"(root)"}),u.jsx("td",{style:we.errTd,children:p.msg})]},m))})]})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{style:{...we.badge,background:"#E5544C",color:"#FFF"},children:"INVALID JSON"}),u.jsxs("div",{style:we.resultBody,children:[u.jsx("div",{style:we.errTitle,children:"Parser error"}),u.jsx("pre",{style:we.errPre,children:r.parseError})]})]})}),u.jsxs("footer",{style:we.footer,children:[u.jsx("div",{children:"AI BVF Working Group · AIBVF-PROTO-001 · Reference Validator · v1.0 Draft"}),u.jsx("div",{style:we.footerDim,children:"Validator source: deterministic JSON Schema subset. For programmatic use, fetch the schema and validate with Ajv or any JSON Schema 2020-12 validator."})]})]})]})}const we={page:{minHeight:"100vh",background:"#0F1E35",color:"#F6F9FD",fontFamily:"'Charter', 'Iowan Old Style', Georgia, serif",fontSize:16,lineHeight:1.6},topbar:{borderBottom:"1px solid #1F3757",background:"#132540"},topbarInner:{maxWidth:920,margin:"0 auto",padding:"14px 32px",display:"flex",alignItems:"center",justifyContent:"space-between"},brand:{display:"flex",alignItems:"center",gap:10,fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:13,letterSpacing:2,color:"#D9A672"},brandMark:{color:"#B87333",fontSize:18},brandName:{fontWeight:700},nav:{display:"flex",gap:22,fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:12},navLink:{color:"#D9A672",textDecoration:"none",letterSpacing:.5},main:{maxWidth:920,margin:"0 auto",padding:"56px 32px 96px"},docRef:{fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,letterSpacing:2.5,color:"#A7B6C9",textTransform:"uppercase",marginBottom:16},h1:{fontSize:34,fontWeight:700,lineHeight:1.2,color:"#F6F9FD",marginBottom:16,letterSpacing:-.3},lede:{fontSize:17,color:"#DCE4EF",marginBottom:28,maxWidth:720},toolbar:{display:"flex",gap:10,alignItems:"center",marginBottom:14,flexWrap:"wrap"},primaryBtn:{background:"#D9A672",color:"#132540",border:"none",padding:"10px 22px",fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:12,letterSpacing:1.5,textTransform:"uppercase",cursor:"pointer",borderRadius:3},ghostBtn:{background:"#132540",color:"#D9A672",border:"1px solid #1F3757",padding:"9px 18px",fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:12,letterSpacing:1.5,textTransform:"uppercase",cursor:"pointer",borderRadius:3},hint:{fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,color:"#A7B6C9",marginLeft:"auto"},textarea:{width:"100%",minHeight:340,fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:13,lineHeight:1.55,padding:"16px 20px",background:"#0B1626",color:"#DCE4EF",border:"1px solid #A7B6C9",borderRadius:4,outline:"none",resize:"vertical"},resultBox:{marginTop:22,background:"#132540",border:"1px solid #1F3757",borderRadius:4},badge:{display:"inline-block",fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,letterSpacing:2,fontWeight:700,padding:"8px 14px",margin:18,borderRadius:2},resultBody:{padding:"0 22px 22px"},okTitle:{fontSize:18,fontWeight:700,color:"#34C77B",marginBottom:8},okText:{fontSize:15,color:"#DCE4EF",marginBottom:12},okPre:{fontFamily:"'IBM Plex Mono', Menlo, monospace",background:"#0B1626",color:"#DCE4EF",padding:"14px 18px",fontSize:13,overflow:"auto",borderRadius:3},errTitle:{fontSize:15,fontWeight:700,color:"#F6F9FD",marginBottom:12,fontFamily:"'IBM Plex Mono', Menlo, monospace",letterSpacing:1,textTransform:"uppercase"},errPre:{fontFamily:"'IBM Plex Mono', Menlo, monospace",background:"#0B1626",color:"#DCE4EF",padding:"14px 18px",fontSize:13,borderRadius:3},errTable:{width:"100%",borderCollapse:"collapse",border:"1px solid #172C4B"},errTh:{textAlign:"left",padding:"10px 14px",fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,letterSpacing:1.5,textTransform:"uppercase",color:"#A7B6C9",background:"#172C4B",borderBottom:"1px solid #1F3757"},errTd:{padding:"10px 14px",fontSize:14,borderBottom:"1px solid #172C4B",verticalAlign:"top"},errTdMono:{padding:"10px 14px",fontSize:13,fontFamily:"'IBM Plex Mono', Menlo, monospace",borderBottom:"1px solid #172C4B",color:"#E9A63C",verticalAlign:"top",whiteSpace:"nowrap"},code:{fontFamily:"'IBM Plex Mono', Menlo, monospace",background:"#172C4B",padding:"1px 6px",borderRadius:3,fontSize:13,color:"#D9A672"},footer:{marginTop:56,paddingTop:20,borderTop:"1px solid #1F3757",fontFamily:"'IBM Plex Mono', Menlo, monospace",fontSize:11,color:"#A7B6C9",letterSpacing:.5},footerDim:{marginTop:6,color:"#A7B6C9"}},Kw="aibvf.workflowHandoff",Yw="aibvf.workflowReturn",dg={finance:{name:"month-end close and reporting",activities:16,integrations:8,exception:18,authority:"committee"},hr:{name:"hiring and onboarding",activities:12,integrations:5,exception:14,authority:"delegated"},sales:{name:"lead-to-order",activities:11,integrations:6,exception:16,authority:"delegated"},supply:{name:"planning and fulfilment",activities:15,integrations:9,exception:22,authority:"committee"},cx:{name:"customer-service resolution",activities:10,integrations:4,exception:15,authority:"delegated"},risk:{name:"risk review and approval",activities:14,integrations:7,exception:20,authority:"committee"},it:{name:"incident resolution",activities:12,integrations:8,exception:18,authority:"delegated"},rd:{name:"research and development review",activities:9,integrations:4,exception:12,authority:"single"}},Ww=[["waWorkflow","Workflow redesigned"],["waRoles","Roles rewritten"],["waRights","Decision rights named"],["waMeasures","Measures updated"]];function Jw(){try{return JSON.parse(window.sessionStorage.getItem(Kw)||"null")}catch{return null}}function Qw(a){return Number.isFinite(a)?Math.abs(a)>=1e9?`€${(a/1e9).toFixed(2)}bn`:Math.abs(a)>=1e6?`€${(a/1e6).toFixed(1)}m`:Math.abs(a)>=1e3?`€${Math.round(a/1e3)}
141k`:`€${Math.round(a)}`:"Not available"}function Xw(a){return a===!0?"Yes":a===!1?"No":"Not answered"}function Zw(a,n){const r=n.exception/100,l=Math.min(n.integrations/15,1),c=n.authority==="delegated"?1.5:n.authority==="committee"?1.2:1,d={strategic:Math.round(a.sa),financial:Math.round(a.fr*(1-r*.5)),change:Math.round(a.ce*(1-l*.3)),governance:Math.round(Math.min(a.gr+r*30+(c-1)*25,100))},f=n.authority==="delegated"&&n.activities>=10&&n.exception>=25;let p="Fix",m="The workflow can proceed after the operating gaps below are redesigned and measured.";f||d.governance>=70||d.financial<=20?(p="Stop",m="Workflow drag exceeds the AI case, remove or simplify the work before an agent is added."):d.strategic>=60&&d.financial>=60&&d.change>=60&&d.governance<=40&&(p="Accelerate",m="The workflow remains viable after exception, integration and authority drag are applied.");const y=a.revenue*(r*.015)*(n.activities/10)*c;return{verdict:p,reason:m,scores:d,drag:y}}function eS(){const[a]=w.useState(Jw),n=a?.state,r=dg[n?.fn]||dg.cx,[l,c]=w.useState(()=>({activities:r.activities,integrations:r.integrations,exception:r.exception,authority:r.authority})),[d,f]=w.useState(null),[p,m]=w.useState(0),y=w.useMemo(()=>n?Zw(n,l):null,[n,l]);w.useEffect(()=>{n&&window.AIBVFJourney&&window.AIBVFJourney.track("workflow_test_opened",{entry_route:a?.entryRoute||"decision_workspace",industry:n.industry})},[a?.entryRoute,n]);const v=(E,T)=>c(k=>({...k,[E]:T})),_=()=>{f(y),m(2),window.AIBVFJourney&&window.AIBVFJourney.track("workflow_test_completed",{entry_route:a?.entryRoute||"decision_workspace",verdict:y.verdict,industry:n.industry}),window.scrollTo({top:0,behavior:"smooth"})},x=()=>{if(!a?.returnUrl||!d)return;window.sessionStorage.setItem(Yw,JSON.stringify({workflowActivities:l.activities,workflowIntegrations:l.integrations,workflowException:l.exception,workflowAuthority:l.authority,workflowVerdict:d.verdict,workflowScores:d.scores,workflowDragEur:d.drag}));const E=new URL(a.returnUrl,window.location.origin);E.searchParams.delete("continue"),E.searchParams.set("rescore","1"),E.searchParams.set("from","workflow"),window.AIBVFJourney&&window.AIBVFJourney.track("workflow_test_returned",{entry_route:a?.entryRoute||"decision_workspace",verdict:d.verdict,industry:n.industry}),window.location.assign(E.href)};return n?u.jsxs("div",{style:te.page,children:[u.jsx(fg,{}),u.jsx(hg,{}),u.jsxs("div",{className:"workflow-progress",style:te.progress,children:[u.jsx("span",{style:te.done,children:"1 Assessment complete"}),u.jsx("span",{style:p<2?te.current:te.done,children:"2 Workflow test"}),u.jsx("span",{style:p===2?te.current:te.waiting,children:"3 Updated decision"})]}),u.jsxs("main",{style:te.main,children:[u.jsx("div",{style:te.eyebrow,children:p===0?"Your AI BVF assessment is here":p===1?"Workflow evidence":"Workflow test c
141omplete"}),u.jsx("h1",{style:te.h1,children:p===0?"Now test the workflow behind it.":p===1?"Describe the workflow as it works today.":"Take the workflow evidence back to the decision."}),u.jsx("p",{style:te.lede,children:p===0?"We carried the proposal, scores and work-design answers into this page. Check what arrived, then continue when you are ready to describe the workflow.":p===1?"Use measured process data where it exists, keep the starting assumptions where it does not, then run the workflow test.":"The workflow test has changed the evidence behind the original scores. Review the effect below, then return to the same decision and update it."}),p===0&&u.jsxs(u.Fragment,{children:[u.jsxs("section",{style:te.record,children:[u.jsx("div",{style:te.recordLabel,children:"Proposal carried from AI BVF"}),u.jsx("p",{style:te.proposal,children:n.proposal||`${r.name} AI initiative`}),u.jsxs("div",{style:te.scoreGrid,children:[u.jsx(Ht,{label:"Strategic alignment",value:n.sa}),u.jsx(Ht,{label:"Financial return",value:n.fr}),u.jsx(Ht,{label:"Change enablement",value:n.ce}),u.jsx(Ht,{label:"Governance risk",value:n.gr})]}),u.jsx("div",{style:te.architectureGrid,children:Ww.map(([E,T])=>u.jsx(Ht,{label:T,value:Xw(n[E]),small:!0},E))})]}),u.jsxs("section",{style:te.instructions,"aria-label":"How to use the workflow test",children:[u.jsx(Mu,{number:"1",title:"Check what arrived",text:"Read the proposal, scores and work-design answers above, then correct the workflow assumptions where your evidence differs."}),u.jsx(Mu,{number:"2",title:"Describe the workflow",text:"Count the activities and systems, use the measured exception or rework rate, then name who controls the end-to-end decision."}),u.jsx(Mu,{number:"3",title:"Run and return",text:"Run the workflow test, read what it changes, then return to the AI BVF and update the decision with this evidence."})]}),u.jsxs("div",{style:te.actionRow,children:[u.jsx("a",{href:a.returnUrl,style:te.secondaryLink,children:"Back to the decision"}),u.jsx("button",{type:"button",style:te.primaryButton,onClick:()=>{m(1),window.scrollTo({top:0,behavior:"smooth"})},children:"Describe the workflow"})]})]}),p===1&&u.jsxs("section",{style:te.formSection,children:[u.jsx("div",{style:te.eyebrow,children:"Workflow evidence"}),u.jsxs("h2",{style:te.h2,children:["Confirm the shape of the ",r.name," workflow."]}),u.jsx("p",{style:te.assumptionNote,children:"These values are starting assumptions for this function, they are not recorded evidence. Change them where your process data says otherwise."}),u.jsx(zu,{label:"Activities from trigger to completion",help:"Count decisions, hand-offs, queues and rework steps, not the number of teams involved.",value:l.activities,min:1,max:30,onChange:E=>v("activities",E)}),u.jsx(zu,{label:"Systems or integrations touched",help:"Include ERP, CRM, identity, ticketing and internal systems used anywhere in the workflow.",value:l.integrations,min:0,max:20,onChange:E=>v("integrations",E)}),u.jsx(zu,{label:"Exception or rework rate",help:"Use the percentage of cases needing manual intervention, correction or escalation.",value:l.exception,suffix:"%",min:0,max:60,onChange:E=>v("exception",E)}),u.jsx("label",{style:te.fieldLabel,htmlFor:"workflow-authority",children:"Who controls the end-to-end decision?"}),u.jsx("p",{style:te.help,children:"Choose the authority people use in practice, including extra approvals that are absent from the process document."}),u.jsxs("select",{id:"workflow-authority",style:te.select,value:l.authority,onChange:E=>v("authority",E.target.value),children:[u.jsx("option",{value:"single",children:"One named owner"}),u.jsx("option",{value:"committee",children:"Committee sign-off"}),u.jsx("option",{value:"delegated",children:"Delegated approval chain"})]}),u.jsxs("div",{style:te.actionRow,children:[u.jsx("button",{type:"button",style:te.secondaryButton,onClick:()=>{m(0),window.scrollTo({top:0,behavior:"smooth"})},children:"Review what arrived"}),u.jsx("button",{type:"button",style:te.primaryButton,onClick:_,children:"Run the workflow test"})]})]}),p===2&&d&&u.jsxs("section",{style:{...te.result,borderLeftColor:d.verdict==="Stop"?"#B42318":d.verdict==="Accelerate"?"#237A4C":"#B87333"},children:[u.jsx("div",{style:te.eyebrow,children:"Workflow verdict"}),u.jsx("h2",{style:te.resultVerdict,children:d.verdict}),u.jsx("p",{style:te.resultReason,children:d.reason}),u.jsxs("div",{style:te.resultFacts,children:[u.jsx(Ht,{label:"Modelled annual workflow drag",value:Qw(d.drag)}),u.jsx(Ht,{label:"Exception or rework",value:`${l.exception}%`}),u.jsx(Ht,{label:"Activities",value:l.activities}),u.jsx(Ht,{label:"Authority",value:l.authority==="single"?"One owner":l.authority==="committee"?"Committee":"Delegated chain"})]}),u.jsx("h3",{style:{...te.h3,marginBottom:10},children:"Effect on the assessment"}),u.jsxs("div",{style:te.resultFacts,children:[u.jsx(Ht,{label:"Strategic alignment",value:`${n.sa} to ${d.scores.strategic}`}),u.jsx(Ht,{label:"Financial return",value:`${n.fr} to ${d.scores.financial}`}),u.jsx(Ht,{label:"Change enablement",value:`${n.ce} to ${d.scores.change}`}),u.jsx(Ht,{label:"Governance risk",value:`${n.gr} to ${d.scores.governance}`})]}),u.jsx("p",{style:te.modelNote,children:"These are modelled effects from the workflow shape, use the underlying process evidence when you decide whether to change the scores."}),u.jsx("p",{style:te.returnCopy,children:"Return to the evidence page with this workflow result attached, update the four pillar scores where this changes the case, then update the decision."}),u.jsx("button",{type:"button",style:te.primaryButton,onClick:x,children:"Return to AI BVF and update the decision"})]})]})]}):u.jsxs("div",{style:te.page,children:[u.jsx(fg,{}),u.jsx(hg,{}),u.jsxs("main",{style:te.main,children:[u.jsx("div",{style:te.eyebrow,children:"Workflow test"}),u.jsx("h1",{style:te.h1,children:"Start with an AI BVF assessment."}),u.jsx("p",{style:te.lede,children:"The workflow test uses the proposal, scores and work-design answers from the assessment, so there is nothing useful to test until that decision record exists."}),u.jsx("a",{href:"/start",style:te.primaryLink,children:"Assess an initiative"})]})]})}function hg(){return u.jsx("header",{style:te.header,children:u.jsxs("div",{className:"workflow-header-inner",style:te.headerInner,children:[u.jsxs("a",{href:"/start",style:te.brand,children:[u.jsx("span",{style:te.mark,children:"BVF"}),u.jsxs("span",{children:[u.jsxs("strong",{style:te.brandName,children:["Craig Horton ",u.jsx("b",{style:te.brandAccent,children:"Adv
141isory"})]}),u.jsx("small",{style:te.brandSmall,children:"AI business value framework"})]})]}),u.jsxs("nav",{className:"workflow-nav",style:te.nav,children:[u.jsx("a",{href:"/start",style:te.navLink,children:"Decision"}),u.jsx("span",{style:te.navCurrent,children:"Workflow test"})]})]})})}function fg(){return u.jsx("style",{children:`
142    @media (max-width: 600px) {
143      .workflow-header-inner { align-items: flex-start !important; flex-direction: column; gap: 13px !important; }
144      .workflow-nav { width: 100%; justify-content: space-between; gap: 8px !important; font-size: 12px !important; }
145      .workflow-progress { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px !important; white-space: normal !important; font-size: 10px !important; text-align: center; }
146    }
147  `})}function Ht({label:a,value:n,small:r=!1}){return u.jsxs("div",{style:r?te.smallValue:te.value,children:[u.jsx("span",{style:te.valueLabel,children:a}),u.jsx("strong",{style:te.valueNumber,children:n})]})}function Mu({number:a,title:n,text:r}){return u.jsxs("div",{style:te.instruction,children:[u.jsx("span",{style:te.number,children:a}),u.jsxs("div",{children:[u.jsx("h3",{style:te.h3,children:n}),u.jsx("p",{style:te.instructionText,children:r})]})]})}function zu({label:a,help:n,value:r,suffix:l="",min:c,max:d,onChange:f}){return u.jsxs("div",{style:te.field,children:[u.jsxs("label",{style:te.fieldLabel,children:[a,u.jsxs("strong",{style:te.fieldValue,children:[r,l]})]}),u.jsx("p",{style:te.help,children:n}),u.jsx("input",{style:te.range,type:"range",min:c,max:d,value:r,onChange:p=>f(Number(p.target.value))})]})}const te={page:{minHeight:"100vh",background:"#EDF2F6",color:"#24364B",fontFamily:"'DM Sans', Arial, sans-serif"},header:{background:"#132540",borderBottom:"1px solid #1F3757"},headerInner:{maxWidth:1120,margin:"0 auto",padding:"16px 28px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:24,flexWrap:"wrap"},brand:{display:"flex",alignItems:"center",gap:12,color:"#FFFFFF",textDecoration:"none"},mark:{width:38,height:38,display:"grid",placeItems:"center",border:"2px solid #B87333",borderRadius:8,color:"#B87333",fontFamily:"'Playfair Display', Georgia, serif",fontSize:14,fontWeight:700},brandName:{display:"block",fontSize:14,lineHeight:1.05},brandAccent:{color:"#E2A667",fontWeight:600},brandSmall:{display:"block",marginTop:4,color:"#BDC9D7",fontSize:9,letterSpacing:1.3},nav:{display:"flex",gap:20,alignItems:"center",flexWrap:"wrap",fontSize:13,fontWeight:700},navLink:{color:"#E2A667",textDecoration:"none"},navCurrent:{color:"#FFFFFF"},progress:{display:"flex",justifyContent:"center",gap:28,padding:"13px 20px",overflowX:"auto",background:"#FFFFFF",borderBottom:"1px solid #D2DBE5",whiteSpace:"nowrap",fontSize:12,fontWeight:700},done:{color:"#237A4C"},current:{color:"#9A551D"},waiting:{color:"#8090A3"},main:{maxWidth:960,margin:"0 auto",padding:"52px 28px 72px"},eyebrow:{marginBottom:12,color:"#9A551D",fontSize:12,fontWeight:700},h1:{maxWidth:760,margin:"0 0 16px",color:"#172C4B",fontFamily:"'Playfair Display', Georgia, serif",fontSize:"clamp(38px, 5vw, 58px)",lineHeight:1.05},h2:{margin:"0 0 14px",color:"#172C4B",fontFamily:"'Playfair Display', Georgia, serif",fontSize:28,lineHeight:1.15},h3:{margin:"0 0 5px",color:"#172C4B",fontSize:16},lede:{maxWidth:760,margin:"0 0 30px",color:"#43576E",fontSize:18,lineHeight:1.6},record:{marginBottom:24,padding:24,background:"#FFFFFF",border:"1px solid #D2DBE5",borderLeft:"4px solid #B87333",borderRadius:"0 8px 8px 0"},recordLabel:{marginBottom:8,color:"#9A551D",fontSize:12,fontWeight:700},proposal:{margin:"0 0 20px",color:"#172C4B",fontSize:17,fontWeight:700,lineHeight:1.5},scoreGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:10,marginBottom:10},architectureGrid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:10},value:{padding:"14px 15px",background:"#F2F5F8",border:"1px solid #DCE3EA"},smallValue:{padding:"10px 12px",background:"#FFFFFF",border:"1px solid #DCE3EA"},valueLabel:{display:"block",marginBottom:4,color:"#62758A",fontSize:12},valueNumber:{color:"#172C4B",fontSize:17,overflowWrap:"anywhere"},instructions:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(220px, 1fr))",gap:1,marginBottom:34,background:"#D2DBE5",border:"1px solid #D2DBE5"},instruction:{display:"grid",gridTemplateColumns:"32px 1fr",gap:12,padding:18,background:"#FFFFFF"},number:{width:28,height:28,display:"grid",placeItems:"center",background:"#B87333",color:"#FFFFFF",fontWeight:700},instructionText:{margin:0,color:"#62758A",fontSize:14,lineHeight:1.55},formSection:{padding:26,background:"#FFFFFF",border:"1px solid #D2DBE5",borderTop:"3px solid #B87333",borderRadius:"0 0 8px 8px"},assumptionNote:{margin:"0 0 26px",padding:"12px 14px",background:"#FFF7EF",borderLeft:"3px solid #B87333",color:"#43576E",fontSize:13,lineHeight:1.55},field:{marginBottom:26},fieldLabel:{display:"flex",justifyContent:"space-between",gap:16,marginBottom:4,color:"#172C4B",fontSize:15,fontWeight:700},fieldValue:{color:"#B87333",fontSize:18},help:{margin:"0 0 10px",color:"#62758A",fontSize:13,lineHeight:1.5},range:{width:"100%",accentColor:"#B87333"},select:{width:"100%",minHeight:44,marginBottom:24,padding:"10px 12px",border:"1px solid #BCC9D6",borderRadius:4,background:"#FFFFFF",color:"#172C4B",font:"inherit"},primaryButton:{minHeight:44,padding:"11px 18px",border:0,borderRadius:4,background:"#B87333",color:"#FFFFFF",font:"inherit",fontWeight:700,cursor:"pointer"},secondaryButton:{minHeight:44,padding:"10px 17px",border:"1px solid #B87333",borderRadius:4,background:"#FFFFFF",color:"#9A551D",font:"inherit",fontWeight:700,cursor:"pointer"},primaryLink:{display:"inline-flex",padding:"11px 18px",borderRadius:4,background:"#B87333",color:"#FFFFFF",fontWeight:700,textDecoration:"none"},secondaryLink:{display:"inline-flex",minHeight:44,alignItems:"center",padding:"10px 17px",border:"1px solid #B87333",borderRadius:4,background:"#FFFFFF",color:"#9A551D",fontWeight:700,textDecoration:"none"},actionRow:{display:"flex",justifyContent:"space-between",gap:12,flexWrap:"wrap"},result:{marginTop:28,padding:26,background:"#FFFFFF",border:"1px solid #D2DBE5",borderLeft:"5px solid #B87333",borderRadius:"0 8px 8px 0"},resultVerdict:{margin:"0 0 10px",color:"#172C4B",fontFamily:"'Playfair Display', Georgia, serif",fontSize:42},resultReason:{maxWidth:720,margin:"0 0 20px",color:"#43576E",fontSize:17,lineHeight:1.6},resultFacts:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(170px, 1fr))",gap:10,marginBottom:20},modelNote:{maxWidth:720,margin:"-4px 0 20px",color:"#62758A",fontSize:13,lineHeight:1.55},returnCopy:{maxWidth:720,margin:"0 0 16px",color:"#43576E",fontSize:15,lineHeight:1.6}};function tS(){const a=Ha(),[n,r]=w.useState("");return w.useEffect(()=>{let l=!0;async function c(){const d=new URLSearchParams(window.location.search),f=new URLSearchParams(window.location.hash.replace(/^#/,"")),p=aw(d.get("next")),m=d.get("error_description")||f.get("error_description");if(m){l&&r(m);return}try{const y=d.get("code");if(y){const{error:x}=await _e.auth.exchangeCodeForSession(y);if(x)throw x}const{data:v,error:_}=await _e.auth.getSession();if(_)throw _;
147if(!v.session)throw new Error("The sign-in link is invalid or has expired. Request a new link and open it in the same browser.");l&&a(p,{replace:!0})}catch(y){l&&r(y.message||"The sign-in link could not be completed.")}}return c(),()=>{l=!1}},[a]),u.jsx("main",{style:{minHeight:"100vh",display:"grid",placeItems:"center",padding:24,background:"#EDF2F6",color:"#14243A",fontFamily:"'DM Sans', Arial, sans-serif"},children:u.jsxs("section",{style:{width:"min(460px, 100%)",padding:30,borderTop:"3px solid #B87333",background:"#FFFFFF",boxShadow:"0 12px 32px rgba(22,44,75,.1)"},children:[u.jsx("p",{style:{margin:"0 0 8px",color:"#9A5C21",fontSize:12,fontWeight:700},children:"Secure workspace access"}),u.jsx("h1",{style:{margin:"0 0 12px",fontFamily:"'Playfair Display', Georgia, serif",fontSize:30},children:"Opening your workspace"}),n?u.jsxs(u.Fragment,{children:[u.jsx("p",{role:"alert",style:{margin:"0 0 18px",padding:"12px 14px",borderLeft:"3px solid #B42318",background:"#FFF1F0",color:"#8E1B12",lineHeight:1.55},children:n}),u.jsx("a",{href:"/login",style:{color:"#9A5C21",fontWeight:700},children:"Request a new secure link"})]}):u.jsx("p",{style:{margin:0,color:"#40536C",lineHeight:1.6},children:"The link is being verified, then your private portfolio will open."})]})})}const pg={"/portfolio":{title:"AI portfolio decisions | AI BVF",description:"Compare AI initiatives, preserve their evidence and decide what to fund, fix or stop."},"/login":{title:"Private portfolio sign in | AI BVF",description:"Open a private AI BVF workspace and keep each initiative connected to its evidence and decision history."},"/welcome":{title:"AI BVF | business value framework",description:"Assess AI initiatives against value, change readiness and governance before budget is committed."},"/protocol":{title:"AI BVF protocol | open decision rules",description:"Read the open rules, inputs and audit structure behind every Accelerate, Fix or Stop verdict."},"/protocol/validate":{title:"Validate an AI BVF record",description:"Check an AI BVF decision record against the published protocol and required evidence structure."},"/protocol/scorer":{title:"Score an AI initiative | AI BVF",description:"Score an AI initiative against strategic value, financial return, change readiness and governance risk."},"/protocol/workflow":{title:"Redesign AI work | AI BVF",description:"Redesign the workflow, roles, decision rights, measures and controls required to operate AI responsibly."}};function nS(){const{pathname:a}=rn();return w.useEffect(()=>{const n=a.startsWith("/workspace/")?pg["/portfolio"]:pg[a];if(!n)return;document.title=n.title;let r=document.querySelector('meta[name="description"]');r||(r=document.createElement("meta"),r.setAttribute("name","description"),document.head.appendChild(r)),r.setAttribute("content",n.description)},[a]),null}function Uu({children:a,adminOnly:n=!1}){const{user:r,loading:l,isAdmin:c}=$a();return l?u.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(160deg, #0F1E35 0%, #172C4B 100%)",color:"#B87333",fontSize:14,fontFamily:"'Trebuchet MS', sans-serif"},children:"Loading..."}):r?n&&!c?u.jsx(Iu,{to:"/portfolio"}):a:u.jsx(Iu,{to:"/login"})}function Fu(){return w.useEffect(()=>{window.location.replace("/start")},[]),u.jsx("div",{style:{minHeight:"100vh",display:"grid",placeItems:"center",background:"#EDF2F6",color:"#40536C"},children:"Opening the assessment..."})}function iS(){const{user:a}=$a();return u.jsxs(u.Fragment,{children:[u.jsx(nS,{}),u.jsxs(Fb,{children:[u.jsx(nn,{path:"/login",element:a?u.jsx(Iu,{to:"/portfolio"}):u.jsx(sw,{})}),u.jsx(nn,{path:"/auth/callback",element:u.jsx(tS,{})}),u.jsx(nn,{path:"/welcome",element:u.jsx(Fu,{})}),u.jsx(nn,{path:"/protocol",element:u.jsx($w,{})}),u.jsx(nn,{path:"/protocol/validate",element:u.jsx(Gw,{})}),u.jsx(nn,{path:"/protocol/scorer",element:u.jsx(Fu,{})}),u.jsx(nn,{path:"/protocol/workflow",element:u.jsx(eS,{})}),u.jsx(nn,{path:"/admin",element:u.jsx(Uu,{adminOnly:!0,children:u.jsx(qw,{})})}),u.jsx(nn,{path:"/workspace/:orgId",element:u.jsx(Uu,{adminOnly:!0,children:u.jsx(Qm,{children:u.jsx(ig,{})})})}),u.jsx(nn,{path:"/portfolio",element:u.jsx(Uu,{children:u.jsx(Qm,{children:u.jsx(ig,{})})})}),u.jsx(nn,{path:"/",element:u.jsx(Fu,{})})]})]})}function aS(){return u.jsx(c_,{children:u.jsx(X1,{children:u.jsx(iS,{})})})}class rS extends w.Component{state={hasError:!1,error:null};static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("Uncaught error in React tree:",n,r)}handleReload=()=>{window.location.reload()};render(){return this.state.hasError?u.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:20,padding:24,textAlign:"center",background:"linear-gradient(160deg, #0F1E35 0%, #172C4B 100%)",color:"#E6EDF6",fontFamily:"'Trebuchet MS', sans-serif"},children:[u.jsx("h1",{style:{margin:0,fontSize:22,color:"#B87333"},children:"Something went wrong"}),u.jsx("p",{style:{margin:0,maxWidth:420,fontSize:14,lineHeight:1.5,opacity:.85},children:"The app hit an unexpected error. Reloading usually fixes it. If it keeps happening, let us know what you were doing."}),u.jsx("button",{type:"button",onClick:this.handleReload,style:{padding:"10px 20px",fontSize:14,fontFamily:"'Trebuchet MS', sans-serif",color:"#0F1E35",background:"#B87333",border:"none",borderRadius:6,cursor:"pointer"},children:"Reload"}),!1]}):this.props.children}}const hy=document.getElementById("root");
147if(!hy)throw new Error("Failed to find the root element (#root) in index.html");F0.createRoot(hy).render(u.jsx(w.StrictMode,{children:u.jsx(rS,{children:u.jsx(aS,{})})}));export{cw as A,oS as B,yS as C,fS as D,_e as E,dd as F,cS as G,uw as H,eg as I,sS as L,uS as P,dS as R,hS as S,ns as a,lS as b,Ua as c,SS as d,vS as e,Du as f,jS as g,gw as h,pw as i,u as j,mw as k,ty as l,gS as m,dw as n,pS as o,bt as p,AS as q,w as r,bS as s,Tw as t,ey as u,_S as v,xS as w,mS as x,ES as y,wS as z};

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.