PageSourceSearch

https://hashtelegraph.com/assets/index-DmLZxq8s.js

js hashtelegraph.com collected 2026-10-02 04:48:01 UTC 614,341 bytes, 67 lines download raw bytes

vendor: 12,748 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RootClientIsland-YDs1FgN_.js","assets/AuthContext-BcT2tnas.js","assets/use-toast-CE4rTcKd.js","assets/index-DKQroI0i.js","assets/index-CICJ-oR6.js","assets/index-DF4uq1mV.js","assets/index-ybg0bLXR.js","assets/index-BirTdwBG.js","assets/use-mobile-DR2ZDpiY.js","assets/rotate-ccw-C-b6ZIhp.js","assets/loader-circle-BJyDwyFM.js","assets/index-CMAy8_VN.js","assets/send-DDnizw5q.js","assets/index-CZugjLlr.js","assets/Sidebar-C6JkMLIE.js","assets/ru-C0yq1oeJ.js","assets/button-DlN1-myb.js","assets/PopularArticles-DSTMH2nc.js","assets/flame-C8HgbisQ.js","assets/pin-_cCLlLqI.js","assets/index-uIAhIImT.js","assets/ArticleContent-bd7_pc_4.js","assets/mediaPath-Bvk0CbKe.js","assets/use-view-tracker-BSH4AZ79.js","assets/CategoryPageView-xACQtvP7.js","assets/chevron-right-BrBLERt8.js","assets/_slug-DSAuiE5U.js","assets/_slug-B8RS0q_P.js","assets/_subslug-D2VbfzMm.js"])))=>i.map(i=>d[i]);
2function Rb(e,t){for(var r=0;r<t.length;r++){const s=t[r];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(s,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function My(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var td={exports:{}},ao={},rd={exports:{}},Se={};var jg;function Cb(){if(jg)return Se;jg=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function v(j){return j===null||typeof j!="object"?null:(j=g&&j[g]||j["@@iterator"],typeof j=="function"?j:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function _(j,q,me){this.props=j,this.context=q,this.refs=x,this.updater=me||w}_.prototype.isReactComponent={},_.prototype.setState=function(j,q){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,q,"setState")},_.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function E(){}E.prototype=_.prototype;function R(j,q,me){this.props=j,this.context=q,this.refs=x,this.updater=me||w}var A=R.prototype=new E;A.constructor=R,b(A,_.prototype),A.isPureReactComponent=!0;var I=Array.isArray,$=Object.prototype.hasOwnProperty,F={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function z(j,q,me){var ye,fe={},xe=null,Ee=null;if(q!=null)for(ye in q.ref!==void 0&&(Ee=q.ref),q.key!==void 0&&(xe=""+q.key),q)$.call(q,ye)&&!M.hasOwnProperty(ye)&&(fe[ye]=q[ye]);var be=arguments.length-2;if(be===1)fe.children=me;else if(1<be){for(var Re=Array(be),Qe=0;Qe<be;Qe++)Re[Qe]=arguments[Qe+2];fe.children=Re}if(j&&j.defaultProps)for(ye in be=j.defaultProps,be)fe[ye]===void 0&&(fe[ye]=be[ye]);return{$$typeof:e,type:j,key:xe,ref:Ee,props:fe,_owner:F.current}}function V(j,q){return{$$typeof:e,type:j.type,key:q,ref:j.ref,props:j.props,_owner:j._owner}}function K(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function te(j){var q={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(me){return q[me]})}var G=/\/+/g;function ae(j,q){return typeof j=="object"&&j!==null&&j.key!=null?te(""+j.key):q.toString(36)}function ce(j,q,me,ye,fe){var xe=typeof j;(xe==="undefined"||xe==="boolean")&&(j=null);var Ee=!1;if(j===null)Ee=!0;else switch(xe){case"string":case"number":Ee=!0;break;case"object":switch(j.$$typeof){case e:case t:Ee=!0}}if(Ee)return Ee=j,fe=fe(Ee),j=ye===""?"."+ae(Ee,0):ye,I(fe)?(me="",j!=null&&(me=j.replace(G,"$&/")+"/"),ce(fe,q,me,"",function(Qe){return Qe})):fe!=null&&(K(fe)&&(fe=V(fe,me+(!fe.key||Ee&&Ee.key===fe.key?"":(""+fe.key).replace(G,"$&/")+"/")+j)),q.push(fe)),1;if(Ee=0,ye=ye===""?".":ye+":",I(j))for(var be=0;be<j.length;be++){xe=j[be];var Re=ye+ae(xe,be);Ee+=ce(xe,q,me,Re,fe)}else if(Re=v(j),typeof Re=="function")for(j=Re.call(j),be=0;!(xe=j.next()).done;)xe=xe.value,Re=ye+ae(xe,be++),Ee+=ce(xe,q,me,Re,fe);else if(xe==="object")throw q=String(j),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return Ee}function we(j,q,me){if(j==null)return j;var ye=[],fe=0;return ce(j,ye,"","",function(xe){return q.call(me,xe,fe++)}),ye}function pe(j){if(j._status===-1){var q=j._result;q=q(),q.then(function(me){(j._status===0||j._status===-1)&&(j._status=1,j._result=me)},function(me){(j._status===0||j._status===-1)&&(j._status=2,j._result=me)}),j._status===-1&&(j._status=0,j._result=q)}if(j._status===1)return j._result.default;throw j._result}var W={current:null},D={transition:null},Y={ReactCurrentDispatcher:W,ReactCurrentBatchConfig:D,ReactCurrentOwner:F};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Se.Children={map:we,forEach:function(j,q,me){we(j,function(){q.apply(this,arguments)},me)},count:function(j){var q=0;return we(j,function(){q++}),q},toArray:function(j){return we(j,function(q){return q})||[]},only:function(j){if(!K(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},Se.Component=_,Se.Fragment=r,Se.Profiler=o,Se.PureComponent=R,Se.StrictMode=s,Se.Suspense=h,Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Se.act=Z,Se.cloneElement=function(j,q,me){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var ye=b({},j.props),fe=j.key,xe=j.ref,Ee=j._owner;if(q!=null){if(q.ref!==void 0&&(xe=q.ref,Ee=F.current),q.key!==void 0&&(fe=""+q.key),j.type&&j.type.defaultProps)var be=j.type.defaultProps;for(Re in q)$.call(q,Re)&&!M.hasOwnProperty(Re)&&(ye[Re]=q[Re]===void 0&&be!==void 0?be[Re]:q[Re])}var Re=arguments.length-2;if(Re===1)ye.children=me;else if(1<Re){be=Array(Re);for(var Qe=0;Qe<Re;Qe++)be[Qe]=arguments[Qe+2];ye.children=be}return{$$typeof:e,type:j.type,key:fe,ref:xe,props:ye,_owner:Ee}},Se.createContext=function(j){return j={$$typeof:c,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:a,_context:j},j.Consumer=j},Se.createElement=z,Se.createFactory=function(j){var q=z.bind(null,j);return q.type=j,q},Se.createRef=function(){return{current:null}},Se.forwardRef=function(j){return{$$typeof:u,render:j}},Se.isValidElement=K,Se.lazy=function(j){return{$$typeof:m,_payload:{_status:-1,_result:j},_init:pe}},Se.memo=function(j,q){return{$$typeof:f,type:j,compare:q===void 0?null:q}},Se.startTransition=function(j){var q=D.transition;D.transition={};try{j()}finally{D.transition=q}},Se.unstable_act=Z,Se.useCallback=function(j,q){return W.current.useCallback(j,q)},Se.useContext=function(j){return W.current.useContext(j)},Se.useDebugValue=function(){},Se.useDeferredValue=function(j){return W.current.useDeferredValue(j)},Se.useEffect=function(j,q){return W.current.useEffect(j,q)},Se.useId=function(){return W.current.useId()},Se.useImperativeHandle=function(j,q,me){return W.current.useImperativeHandle(j,q,me)},Se.useInsertionEffect=function(j,q){return W.current.useInsertionEffect(j,q)},Se.useLayoutEffect=function(j,q){return W.current.useLayoutEffect(j,q)},Se.useMemo=function(j,q){return W.current.useMemo(j,q)},Se.useReducer=function(j,q,me){return W.current.useReducer(j,q,me)},Se.useRef=function(j){return W.current.useRef(j)},Se.useState=function(j){return W.current.useState(j)},Se.useSyncExternalStore=function(j,q,me){return W.current.useSyncExternalStore(j,q,me)},Se.useTransition=function(){return W.current.useTransition()},Se.version="18.3.1",Se}var Ng;function zo(){return Ng||(Ng=1,rd.exports=Cb()),rd.exports}var Mg;function Tb(){if(Mg)return ao;Mg=1;var e=zo(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(u,h,f){var m,g={},v=null,w=null;f!==void 0&&(v=""+f),h.key!==void 0&&(v=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)s.call(h,m)&&!a.hasOwnProperty(m)&&(g[m]=h[m]);if(u&&u.defaultProps)for(m in h=u.defaultProps,h)g[m]===void 0&&(g[m]=h[m]);return{$$typeof:t,type:u,key:v,ref:w,props:g,_owner:o.current}}return ao.Fragment=r,ao.jsx=c,ao.jsxs=c,ao}var $g;function Pb(){return $g||($g=1,td.exports=Tb()),td.exports}var P=Pb(),O=zo();const fi=My(O),yj=Rb({__proto__:null,default:fi},[O]);var sl={},nd={exports:{}},kt={},sd={exports:{}},id={};var Dg;function Ab(){return Dg||(Dg=1,(function(e){function t(D,Y){var Z=D.length;D.push(Y);e:for(;0<Z;){var j=Z-1>>>1,q=D[j];if(0<o(q,Y))D[j]=Y,D[Z]=q,Z=j;else break e}}function r(D){return D.length===0?null:D[0]}function s(D){if(D.length===0)return null;var Y=D[0],Z=D.pop();if(Z!==Y){D[0]=Z;e:for(var j=0,q=D.length,me=q>>>1;j<me;){var ye=2*(j+1)-1,fe=D[ye],xe=ye+1,Ee=D[xe];if(0>o(fe,Z))xe<q&&0>o(Ee,fe)?(D[j]=Ee,D[xe]=Z,j=xe):(D[j]=fe,D[ye]=Z,j=ye);else if(xe<q&&0>o(Ee,Z))D[j]=Ee,D[xe]=Z,j=xe;else break e}}return Y}function o(D,Y){var Z=D.sortIndex-Y.sortIndex;return Z!==0?Z:D.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var h=[],f=[],m=1,g=null,v=3,w=!1,b=!1,x=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(D){for(var Y=r(f);Y!==null;){if(Y.callback===null)s(f);else if(Y.startTime<=D)s(f),Y.sortIndex=Y.expirationTime,t(h,Y);else break;Y=r(f)}}function I(D){if(x=!1,A(D),!b)if(r(h)!==null)b=!0,pe($);else{var Y=r(f);Y!==null&&W(I,Y.startTime-D)}}function $(D,Y){b=!1,x&&(x=!1,E(z),z=-1),w=!0;var Z=v;try{for(A(Y),g=r(h);g!==null&&(!(g.expirationTime>Y)||D&&!te());){var j=g.callback;if(typeof j=="function"){g.callback=null,v=g.priorityLevel;var q=j(g.expirationTime<=Y);Y=e.unstable_now(),typeof q=="function"?g.callback=q:g===r(h)&&s(h),A(Y)}else s(h);g=r(h)}if(g!==null)var me=!0;else{var ye=r(f);ye!==null&&W(I,ye.startTime-Y),me=!1}return me}finally{g=null,v=Z,w=!1}}var F=!1,M=null,z=-1,V=5,K=-1;function te(){return!(e.unstable_now()-K<V)}function G(){if(M!==null){var D=e.unstable_now();K=D;var Y=!0;try{Y=M(!0,D)}finally{Y?ae():(F=!1,M=null)}}else F=!1}var ae;if(typeof R=="function")ae=function(){R(G)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,we=ce.port2;ce.port1.onmessage=G,ae=function(){we.postMessage(null)}}else ae=function(){_(G,0)};function pe(D){M=D,F||(F=!0,ae())}function W(D,Y){z=_(function(){D(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_continueExecution=function(){b||w||(b=!0,pe($))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(h)},e.unstable_next=function(D){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var Z=v;v=Y;try{return D()}finally{v=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,Y){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var Z=v;v=D;try{return Y()}finally{v=Z}},e.unstable_scheduleCallback=function(D,Y,Z){var j=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?j+Z:j):Z=j,D){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=Z+q,D={id:m++,callback:Y,priorityLevel:D,startTime:Z,expirationTime:q,sortIndex:-1},Z>j?(D.sortIndex=Z,t(f,D),r(h)===null&&D===r(f)&&(x?(E(z),z=-1):x=!0,W(I,Z-j))):(D.sortIndex=q,t(h,D),b||w||(b=!0,pe($))),D}
vendor: 4,196 bytes, line 2
2,e.unstable_shouldYield=te,e.unstable_wrapCallback=function(D){var Y=v;return function(){var Z=v;v=Y;try{return D.apply(this,arguments)}finally{v=Z}}}})(id)),id}var Ug;function Ob(){return Ug||(Ug=1,sd.exports=Ab()),sd.exports}var Fg;function Ib(){if(Fg)return kt;Fg=1;var e=zo(),t=Ob();function r(n){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+n,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function a(n,i){c(n,i),c(n+"Capture",i)}function c(n,i){for(o[n]=i,n=0;n<i.length;n++)s.add(i[n])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[: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]*$/,m={},g={};function v(n){return h.call(g,n)?!0:h.call(m,n)?!1:f.test(n)?g[n]=!0:(m[n]=!0,!1)}function w(n,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function b(n,i,l,d){if(i===null||typeof i>"u"||w(n,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function x(n,i,l,d,p,y,S){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=p,this.mustUseProperty=l,this.propertyName=n,this.type=i,this.sanitizeURL=y,this.removeEmptyString=S}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){_[n]=new x(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var i=n[0];_[i]=new x(i,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){_[n]=new x(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){_[n]=new x(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){_[n]=new x(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){_[n]=new x(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){_[n]=new x(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){_[n]=new x(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){_[n]=new x(n,5,!1,n.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function R(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode
2-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var i=n.replace(E,R);_[i]=new x(i,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var i=n.replace(E,R);_[i]=new x(i,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var i=n.replace(E,R);_[i]=new x(i,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){_[n]=new x(n,1,!1,n.toLowerCase(),null,!1,!1)}),_.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){_[n]=new x(n,1,!1,n.toLowerCase(),null,!0,!0)});function A(n,i,l,d){var p=_.hasOwnProperty(i)?_[i]:null;(p!==null?p.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(b(i,l,p,d)&&(l=null),d||p===null?v(i)&&(l===null?n.removeAttribute(i):n.setAttribute(i,""+l)):p.mustUseProperty?n[p.propertyName]=l===null?p.type===3?!1:"":l:(i=p.attributeName,d=p.attributeNamespace,l===null?n.removeAttribute(i):(p=p.type,l=p===3||p===4&&l===!0?"":""+l,d?n.setAttributeNS(d,i,l):n.setAttribute(i,l))))}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),F=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),K=Symbol.for("react.provider"),te=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),ce=Symbol.for("react.suspense_list"),we=Symbol.for("react.memo"),pe=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),D=Symbol.iterator;function Y(n){return n===null||typeof n!="object"?null:(n=D&&n[D]||n["@@iterator"],typeof n=="function"?n:null)}var Z=Object.assign,j;function q(n){if(j===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);j=i&&i[1]||""}return`
3`+j+n}var me=!1;function ye(n,i){if(!n||me)return"";me=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(H){var d=H}Reflect.construct(n,[],i)}else{try{i.call()}catch(H){d=H}n.call(i.prototype)}else{try{throw Error()}catch(H){d=H}n()}}catch(H){if(H&&d&&typeof H.stack=="string"){for(var p=H.stack.split(`
4`),y=d.stack.split(`
5`),S=p.length-1,C=y.length-1;1<=S&&0<=C&&p[S]!==y[C];)C--;for(;1<=S&&0<=C;S--,C--)if(p[S]!==y[C]){if(S!==1||C!==1)do if(S--,C--,0>C||p[S]!==y[C]){var L=`
6`+p[S].replace(" at new "," at ");return n.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",n.displayName)),L}while(1<=S&&0<=C);break}}}finally{me=!1,Error.prepareStackTrace=l}return(n=n?n.displayName||n.name:"")?q(n):""}function fe(n){switch(n.tag){case 5:return q(n.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return n=ye(n.type,!1),n;case 11:return n=ye(n.type.render,!1),n;case 1:return n=ye(n.type,!0),n;default:return""}}function xe(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case M:return"Fragment";case F:return"Portal";case V:return"Profiler";case z:return"StrictMode";case ae:return"Suspense";case ce:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case te:return(n.displayName||"Context")+".Consumer";case K:return(n._context.displayName||"Context")+".Provider";case G:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case we:return i=n.displayName||null,i!==null?i:xe(n.type)||"Memo";case pe:i=n._payload,n=n._init;try{return xe(n(i))}catch{}}return null}function Ee(n){var i=n.type;switch(n.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=i.render,n=n.displayName||n.name||"",i.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xe(i);case 8:return i===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function be(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Re(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Qe(n){var i=Re(n)?"checked":"value",l=Object.getOwnPropertyDescriptor(n.constructor.prototype,i
vendor: 40,089 bytes, lines 6-7
6),d=""+n[i];if(!n.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,y=l.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return p.call(this)},set:function(S){d=""+S,y.call(this,S)}}),Object.defineProperty(n,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(S){d=""+S},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Yt(n){n._valueTracker||(n._valueTracker=Qe(n))}function Ar(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return n&&(d=Re(n)?n.checked?"true":"false":n.value),n=d,n!==l?(i.setValue(n),!0):!1}function Ht(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function ms(n,i){var l=i.checked;return Z({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??n._wrapperState.initialChecked})}function Jo(n,i){var l=i.defaultValue==null?"":i.defaultValue,d=i.checked!=null?i.checked:i.defaultChecked;l=be(i.value!=null?i.value:l),n._wrapperState={initialChecked:d,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function bi(n,i){i=i.checked,i!=null&&A(n,"checked",i,!1)}function ys(n,i){bi(n,i);var l=be(i.value),d=i.type;if(l!=null)d==="number"?(l===0&&n.value===""||n.value!=l)&&(n.value=""+l):n.value!==""+l&&(n.value=""+l);else if(d==="submit"||d==="reset"){n.removeAttribute("value");return}i.hasOwnProperty("value")?Nn(n,i.type,l):i.hasOwnProperty("defaultValue")&&Nn(n,i.type,be(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(n.defaultChecked=!!i.defaultChecked)}function Or(n,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var d=i.type;if(!(d!=="submit"&&d!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+n._wrapperState.initialValue,l||i===n.value||(n.value=i),n.defaultValue=i}l=n.name,l!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,l!==""&&(n.name=l)}function Nn(n,i,l){(i!=="number"||Ht(n.ownerDocument)!==n)&&(l==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+l&&(n.defaultValue=""+l))}var It=Array.isArray;function Xr(n,i,l,d){if(n=n.options,i){i={};for(var p=0;p<l.length;p++)i["$"+l[p]]=!0;for(l=0;l<n.length;l++)p=i.hasOwnProperty("$"+n[l].value),n[l].selected!==p&&(n[l].selected=p),p&&d&&(n[l].defaultSelected=!0)}else{for(l=""+be(l),i=null,p=0;p<n.length;p++){if(n[p].value===l){n[p].selected=!0,d&&(n[p].defaultSelected=!0);return}i!==null||n[p].disabled||(i=n[p])}i!==null&&(i.selected=!0)}}function vs(n,i){if(i.dangerouslySetInnerHTML!=null)throw Error(r(91));return Z({},i,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function Qo(n,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(r(92));if(It(l)){if(1<l.length)throw Error(r(93));l=l[0]}i=l}i==null&&(i=""),l=i}n._wrapperState={initialValue:be(l)}}function Si(n,i){var l=be(i.value),d=be(i.defaultValue);l!=null&&(l=""+l,l!==n.value&&(n.value=l),i.defaultValue==null&&n.defaultValue!==l&&(n.defaultValue=l)),d!=null&&(n.defaultValue=""+d)}function Ae(n){var i=n.textContent;i===n._wrapperState.initialValue&&i!==""&&i!==null&&(n.value=i)}function it(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Xt(n,i){return n==null||n==="http://www.w3.org/1999/xhtml"?it(i):n==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var ws,Kh=(function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,d,p){MSApp.execUnsafeLocalFunction(function(){return n(i,l,d,p)})}:n})(function(n,i){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=i;else{for(ws=ws||document.createElement("div"),ws.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=ws.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;i.firstChild;)n.appendChild(i.firstChild)}});function xi(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var Ei={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},A0=["Webkit","ms","Moz","O"];Object.keys(Ei).forEach(function(n){A0.forEach(function(i){i=i+n.charAt(0).toUpperCase()+n.substring(1),Ei[i]=Ei[n]})});function Gh(n,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||Ei.hasOwnProperty(n)&&Ei[n]?(""+i).trim():i+"px"}function Jh(n,i){n=n.style;for(var l in i)if(i.hasOwnProperty(l)){var d=l.indexOf("--")===0,p=Gh(l,i[l],d);l==="float"&&(l="cssFloat"),d?n.setProperty(l,p):n[l]=p}}var O0=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fc(n,i){if(i){if(O0[n]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(r(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(r(61))}if(i.style!=null&&typeof i.style!="object")throw Error(r(62))}}function pc(n,i){if(n.indexOf("-")===-1)return typeof i.is=="string";switch(n){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 gc=null;function mc(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var yc=null,_s=null,bs=null;function Qh(n){if(n=qi(n)){if(typeof yc!="function")throw Error(r(280));var i=n.stateNode;i&&(i=wa(i),yc(n.stateNode,n.type,i))}}function Yh(n){_s?bs?bs.push(n):bs=[n]:_s=n}function Xh(){if(_s){var n=_s,i=bs;if(bs=_s=null,Qh(n),i)for(n=0;n<i.length;n++)Qh(i[n])}}function Zh(n,i){return n(i)}function ef(){}var vc=!1;function tf(n,i,l){if(vc)return n(i,l);vc=!0;try{return Zh(n,i,l)}finally{vc=!1,(_s!==null||bs!==null)&&(ef(),Xh())}}function ki(n,i){var l=n.stateNode;if(l===null)return null;var d=wa(l);if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var wc=!1;if(u)try{var Ri={};Object.defineProperty(Ri,"passive",{get:function(){wc=!0}}),window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{wc=!1}function I0(n,i,l,d,p,y,S,C,L){var H=Array.prototype.slice.call(arguments,3);try{i.apply(l,H)}catch(Q){this.onError(Q)}}var Ci=!1,Yo=null,Xo=!1,_c=null,L0={onError:function(n){Ci=!0,Yo=n}};function j0(n,i,l,d,p,y,S,C,L){Ci=!1,Yo=null,I0.apply(L0,arguments)}function N0(n,i,l,d,p,y,S,C,L){if(j0.apply(this,arguments),Ci){if(Ci){var H=Yo;Ci=!1,Yo=null}else throw Error(r(198));Xo||(Xo=!0,_c=H)}}function Mn(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function rf(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function nf(n){if(Mn(n)!==n)throw Error(r(188))}function M0(n){var i=n.alternate;if(!i){if(i=Mn(n),i===null)throw Error(r(188));return i!==n?null:n}for(var l=n,d=i;;){var p=l.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){l=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===l)return nf(p),n;if(y===d)return nf(p),i;y=y.sibling}throw Error(r(188))}if(l.return!==d.return)l=p,d=y;else{for(var S=!1,C=p.child;C;){if(C===l){S=!0,l=p,d=y;break}if(C===d){S=!0,d=p,l=y;break}C=C.sibling}if(!S){for(C=y.child;C;){if(C===l){S=!0,l=y,d=p;break}if(C===d){S=!0,d=y,l=p;break}C=C.sibling}if(!S)throw Error(r(189))}}if(l.alternate!==d)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:i}function sf(n){return n=M0(n),n!==null?of(n):null}function of(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var i=of(n);if(i!==null)return i;n=n.sibling}return null}var af=t.unstable_scheduleCallback,lf=t.unstable_cancelCallback,$0=t.unstable_shouldYield,D0=t.unstable_requestPaint,Ve=t.unstable_now,U0=t.unstable_getCurrentPriorityLevel,bc=t.unstable_ImmediatePriority,cf=t.unstable_UserBlockingPriority,Zo=t.unstable_NormalPriority,F0=t.unstable_LowPriority,uf=t.unstable_IdlePriority,ea=null,mr=null;function B0(n){if(mr&&typeof mr.onCommitFiberRoot=="function")try{mr.onCommitFiberRoot(ea,n,void 0,(n.current.flags&128)===128)}catch{}}var Zt=Math.clz32?Math.clz32:W0,z0=Math.log,H0=Math.LN2;function W0(n){return n>>>=0,n===0?32:31-(z0(n)/H0|0)|0}var ta=64,ra=4194304;function Ti(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function na(n,i){var l=n.pendingLanes;if(l===0)return 0;var d=0,p=n.suspendedLanes,y=n.pingedLanes,S=l&268435455;if(S!==0){var C=S&~p;C!==0?d=Ti(C):(y&=S,y!==0&&(d=Ti(y)))}else S=l&~p,S!==0?d=Ti(S):y!==0&&(d=Ti(y));if(d===0)return 0;if(i!==0&&i!==d&&(i&p)===0&&(p=d&-d,y=i&-i,p>=y||p===16&&(y&4194240)!==0))return i;if((d&4)!==0&&(d|=l&16),i=n.entangledLanes,i!==0)for(n=n.entanglements,i&=d;0<i;)l=31-Zt(i),p=1<<l,d|=n[l],i&=~p;return d}function V0(n,i){switch(n){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function q0(n,i){for(var l=n.suspendedLanes,d=n.pingedLanes,p=n.expirationTimes,y=n.pendingLanes;0<y;){var S=31-Zt(y),C=1<<S,L=p[S];L===-1?((C&l)===0||(C&d)!==0)&&(p[S]=V0(C,i)):L<=i&&(n.expiredLanes|=C),y&=~C}}function Sc(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function df(){var n=ta;return ta<<=1,(ta&4194240)===0&&(ta=64),n}function xc(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Pi(n,i,l){n.pendingLanes|=i,i!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,i=31-Zt(i),n[i]=l}function K0(n,i){var l=n.pendingLanes&~i;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=i,n.mutableReadLanes&=i,n.entangledLanes&=i,i=n.entanglements;var d=n.eventTimes;for(n=n.expirationTimes;0<l;){var p=31-Zt(l),y=1<<p;i[p]=0,d[p]=-1,n[p]=-1,l&=~y}}function Ec(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var d=31-Zt(l),p=1<<d;p&i|n[d]&i&&(n[d]|=i),l&=~p}}var Pe=0;function hf(n){return n&=-n,1<n?4<n?(n&268435455)!==0?16:536870912:4:1}var ff,kc,pf,gf,mf,Rc=!1,sa=[],Zr=null,en=null,tn=null,Ai=new Map,Oi=new Map,rn=[],G0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function yf(n,i){switch(n){case"focusin":case"focusout":Zr=null;break;case"dragenter":case"dragleave":en=null;break;case"mouseover":case"mouseout":tn=null;break;case"pointerover":case"pointerout":Ai.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oi.delete(i.pointerId)}}function Ii(n,i,l,d,p,y){return n===null||n.nativeEvent!==y?(n={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:y,targetContainers:[p]},i!==null&&(i=qi(i),i!==null&&kc(i)),n):(n.eventSystemFlags|=d,i=n.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),n)}function J0(n,i,l,d,p){switch(i){case"focusin":return Zr=Ii(Zr,n,i,l,d,p),!0;case"dragenter":return en=Ii(en,n,i,l,d,p),!0;case"mouseover":return tn=Ii(tn,n,i,l,d,p),!0;case"pointerover":var y=p.pointerId;return Ai.set(y,Ii(Ai.get(y)||null,n,i,l,d,p)),!0;case"gotpointercapture":return y=p.pointerId,Oi.set(y,Ii(Oi.get(y)||null,n,i,l,d,p)),!0}return!1}function vf(n){var i=$n(n.target);if(i!==null){var l=Mn(i);if(l!==null){if(i=l.tag,i===13){if(i=rf(l),i!==null){n.blockedOn=i,mf(n.priority,function(){pf(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function ia(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=Tc(n.domEventName,n.eventSystemFlags,i[0],n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);gc=d,l.target.dispatchEvent(d),gc=null}else return i=qi(l),i!==null&&kc(i),n.blockedOn=l,!1;i.shift()}return!0}function wf(n,i,l){ia(n)&&l.delete(i)}function Q0(){Rc=!1,Zr!==null&&ia(Zr)&&(Zr=null),en!==null&&ia(en)&&(en=null),tn!==null&&ia(tn)&&(tn=null),Ai.forEach(wf),Oi.forEach(wf)}function Li(n,i){n.blockedOn===i&&(n.blockedOn=null,Rc||(Rc=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Q0)))}function ji(n){function i(p){return Li(p,n)}if(0<sa.length){Li(sa[0],n);for(var l=1;l<sa.length;l++){var d=sa[l];d.blockedOn===n&&(d.blockedOn=null)}}for(Zr!==null&&Li(Zr,n),en!==null&&Li(en,n),tn!==null&&Li(tn,n),Ai.forEach(i),Oi.forEach(i),l=0;l<rn.length;l++)d=rn[l],d.blockedOn===n&&(d.blockedOn=null);for(;0<rn.length&&(l=rn[0],l.blockedOn===null);)vf(l),l.blockedOn===null&&rn.shift()}var Ss=I.ReactCurrentBatchConfig,oa=!0;function Y0(n,i,l,d){var p=Pe,y=Ss.transition;Ss.transition=null;try{Pe=1,Cc(n,i,l,d)}finally{Pe=p,Ss.transition=y}}function X0(n,i,l,d){var p=Pe,y=Ss.transition;Ss.transition=null;try{Pe=4,Cc(n,i,l,d)}finally{Pe=p,Ss.transition=y}}function Cc(n,i,l,d){if(oa){var p=Tc(n,i,l,d);if(p===null)Vc(n,i,d,aa,l),yf(n,d);else if(J0(p,n,i,l,d))d.stopPropagation();else if(yf(n,d),i&4&&-1<G0.indexOf(n)){for(;p!==null;){var y=qi(p);if(y!==null&&ff(y),y=Tc(n,i,l,d),y===null&&Vc(n,i,d,aa,l),y===p)break;p=y}p!==null&&d.stopPropagation()}else Vc(n,i,d,null,l)}}var aa=null;function Tc(n,i,l,d){if(aa=null,n=mc(d),n=$n(n),n!==null)if(i=Mn(n),i===null)n=null;else if(l=i.tag,l===13){if(n=rf(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null);return aa=n,null}function _f(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(U0()){case bc:return 1;case cf:return 4;case Zo:case F0:return 16;case uf:return 536870912;default:return 16}default:return 16}}var nn=null,Pc=null,la=null;function bf(){if(la)return la;var n,i=Pc,l=i.length,d,p="value"in nn?nn.value:nn.textContent,y=p.length;for(n=0;n<l&&i[n]===p[n];n++);var S=l-n;for(d=1;d<=S&&i[l-d]===p[y-d];d++);return la=p.slice(n,1<d?1-d:void 0)}function ca(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function ua(){return!0}function Sf(){return!1}function Lt(n){function i(l,d,p,y,S){this._reactName=l,this._targetInst=p,this.type=d,this.nativeEvent=y,this.target=S,this.currentTarget=null;for(var C in n)n.hasOwnProperty(C)&&(l=n[C],this[C]=l?l(y):y[C]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?ua:Sf,this.isPropagationStopped=Sf,this}return Z(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ua)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ua)},persist:function(){},isPersistent:ua}),i}var xs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ac=Lt(xs),Ni=Z({},xs,{view:0,detail:0}),Z0=Lt(Ni),Oc,Ic,Mi,da=Z({},Ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jc,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Mi&&(Mi&&n.type==="mousemove"?(Oc=n.screenX-Mi.screenX,Ic=n.screenY-Mi.screenY):Ic=Oc=0,Mi=n),Oc)},movementY:function(n){return"movementY"in n?n.movementY:Ic}}),xf=Lt(da),e_=Z({},da,{dataTransfer:0}),t_=Lt(e_),r_=Z({},Ni,{relatedTarget:0}),Lc=Lt(r_),n_=Z({},xs,{animationName:0,elapsedTime:0,pseudoElement:0}),s_=Lt(n_),i_=Z({},xs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),o_=Lt(i_),a_=Z({},xs,{data:0}),Ef=Lt(a_),l_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},c_={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"},u_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function d_(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=u_[n])?!!i[n]:!1}function jc(){return d_}var h_=Z({},Ni,{key:function(n){if(n.key){var i=l_[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=ca(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?c_[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jc,charCode:function(n){return n.type==="keypress"?ca(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?ca(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),f_=Lt(h_),p_=Z({},da,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kf=Lt(p_),g_=Z({},Ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jc}),m_=Lt(g_),y_=Z({},xs,{propertyName:0,elapsedTime:0,pseudoElement:0}),v_=Lt(y_),w_=Z({},da,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),__=Lt(w_),b_=[9,13,27,32],Nc=u&&"CompositionEvent"in window,$i=null;u&&"documentMode"in document&&($i=document.documentMode);var S_=u&&"TextEvent"in window&&!$i,Rf=u&&(!Nc||$i&&8<$i&&11>=$i),Cf=" ",Tf=!1;function Pf(n,i){switch(n){case"keyup":return b_.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Af(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Es=!1;function x_(n,i){switch(n){case"compositionend":return Af(i);case"keypress":return i.which!==32?null:(Tf=!0,Cf);case"textInput":return n=i.data,n===Cf&&Tf?null:n;default:return null}}function E_(n,i){if(Es)return n==="compositionend"||!Nc&&Pf(n,i)?(n=bf(),la=Pc=nn=null,Es=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Rf&&i.locale!=="ko"?null:i.data;default:return null}}var k_={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 Of(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!k_[n.type]:i==="textarea"}function If(n,i,l,d){Yh(d),i=ma(i,"onChange"),0<i.length&&(l=new Ac("onChange","change",null,l,d),n.push({event:l,listeners:i}))}var Di=null,Ui=null;function R_(n){Qf(n,0)}function ha(n){var i=Ps(n);if(Ar(i))return n}function C_(n,i){if(n==="change")return i}var Lf=!1;if(u){var Mc;if(u){var $c="oninput"in document;if(!$c){var jf=document.createElement("div");jf.setAttribute("oninput","return;"),$c=typeof jf.oninput=="function"}Mc=$c}else Mc=!1;Lf=Mc&&(!document.documentMode||9<document.documentMode)}function Nf(){Di&&(Di.detachEvent("onpropertychange",Mf),Ui=Di=null)}function Mf(n){if(n.propertyName==="value"&&ha(Ui)){var i=[];If(i,Ui,n,mc(n)),tf(R_,i)}}function T_(n,i,l){n==="focusin"?(Nf(),Di=i,Ui=l,Di.attachEvent("onpropertychange",Mf)):n==="focusout"&&Nf()}function P_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return ha(Ui)}function A_(n,i){if(n==="click")return ha(i)}function O_(n,i){if(n==="input"||n==="change")return ha(i)}function I_(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var er=typeof Object.is=="function"?Object.is:I_;function Fi(n,i){if(er(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var p=l[d];if(!h.call(i,p)||!er(n[p],i[p]))return!1}return!0}function $f(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Df(n,i){var l=$f(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=i&&d>=i)return{node:l,offset:i-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=$f(l)}}function Uf(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Uf(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Ff(){for(var n=window,i=Ht();i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=Ht(n.document)}return i}function Dc(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}function L_(n){var i=Ff(),l=n.focusedElem,d=n.selectionRange;if(i!==l&&l&&l.ownerDocument&&Uf(l.ownerDocument.documentElement,l)){if(d!==null&&Dc(l)){if(i=d.start,n=d.end,n===void 0&&(n=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(n,l.value.length);else if(n=(i=l.ownerDocument||document)&&i.defaultView||window,n.getSelection){n=n.getSelection();var p=l.textContent.length,y=Math.min(d.start,p);d=d.end===void 0?y:Math.min(d.end,p),!n.extend&&y>d&&(p=d,d=y,y=p),p=Df(l,y);var S=Df(l,d);p&&S&&(n.rangeCount!==1||n.anchorNode!==p.node||n.anchorOffset!==p.offset||n.focusNode!==S.node||n.focusOffset!==S.offset)&&(i=i.createRange(),i.setStart(p.node,p.offset),n.removeAllRanges(),y>d?(n.addRange(i),n.extend(S.node,S.offset)):(i.setEnd(S.node,S.offset),n.addRange(i)))}}for(i=[],n=l;n=n.parentNode;)n.nodeType===1&&i.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)n=i[l],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var j_=u&&"documentMode"in document&&11>=document.documentMode,ks=null,Uc=null,Bi=null,Fc=!1;function Bf(n,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Fc||ks==null||ks!==Ht(d)||(d=ks,"selectionStart"in d&&Dc(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Bi&&Fi(Bi,d)||(Bi=d,d=ma(Uc,"onSelect"),0<d.length&&(i=new Ac("onSelect","select",null,i,l),n.push({event:i,listeners:d}),i.target=ks)))}function fa(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var Rs={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionend:fa("Transition","TransitionEnd")},Bc={},zf={};u&&(zf=document.createElement("div").style,"AnimationEvent"in window||(delete Rs.animationend.animation,delete Rs.animationiteration.animation,delete Rs.animationstart.animation),"TransitionEvent"in window||delete Rs.transitionend.transition);function pa(n){if(Bc[n])return Bc[n];if(!Rs[n])return n;var i=Rs[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in zf)return Bc[n]=i[l];return n}var Hf=pa("animationend"),Wf=pa("animationiteration"),Vf=pa("animationstart"),qf=pa("transitionend"),Kf=new Map,Gf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function sn(n,i){Kf.set(n,i),a(i,[n])}for(var zc=0;zc<Gf.length;zc++){var Hc=Gf[zc],N_=Hc.toLowerCase(),M_=Hc[0].toUpperCase()+Hc.slice(1);sn(N_,"on"+M_)}sn(Hf,"onAnimationEnd"),sn(Wf,"onAnimationIteration"),sn(Vf,"onAnimationStart"),sn("dblclick","onDoubleClick"),sn("focusin","onFocus"),sn("focusout","onBlur"),sn(qf,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zi="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(" "),$_=new Set("cancel close invalid load scroll toggle".split(" ").concat(zi));function Jf(n,i,l){var d=n.type||"unknown-event";n.currentTarget=l,N0(d,i,void 0,n),n.currentTarget=null}function Qf(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],p=d.event;d=d.listeners;e:{var y=void 0;if(i)for(var S=d.length-1;0<=S;S--){var C=d[S],L=C.instance,H=C.currentTarget;if(C=C.listener,L!==y&&p.isPropagationStopped())break e;Jf(p,C,H),y=L}else for(S=0;S<d.length;S++){if(C=d[S],L=C.instance,H=C.currentTarget,C=C.listener,L!==y&&p.isPropagationStopped())break e;Jf(p,C,H),y=L}}}if(Xo)throw n=_c,Xo=!1,_c=null,n}function Ne(n,i){var l=i[Yc];l===void 0&&(l=i[Yc]=new Set);var d=n+"__bubble";l.has(d)||(Yf(i,n,2,!1),l.add(d))}function Wc(n,i,l){var d=0;i&&(d|=4),Yf(l,n,d,i)}var ga="_reactListening"+Math.random().toString(36).slice(2);function Hi(n){if(!n[ga]){n[ga]=!0,s.forEach(function(l){l!=="selectionchange"&&($_.has(l)||Wc(l,!1,n),Wc(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[ga]||(i[ga]=!0,Wc("selectionchange",!1,i))}}function Yf(n,i,l,d){switch(_f(i)){case 1:var p=Y0;break;case 4:p=X0;break;default:p=Cc}l=p.bind(null,i,l,n),p=void 0,!wc||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?n.addEventListener(i,l,{capture:!0,passive:p}):n.addEventListener(i,l,!0):p!==void 0?n.addEventListener(i,l,{passive:p}):n.addEventListener(i,l,!1)}function Vc(n,i,l,d,p){var y=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var S=d.tag;if(S===3||S===4){var C=d.stateNode.containerInfo;if(C===p||C.nodeType===8&&C.parentNode===p)break;if(S===4)for(S=d.return;S!==null;){var L=S.tag;if((L===3||L===4)&&(L=S.stateNode.containerInfo,L===p||L.nodeType===8&&L.parentNode===p))return;S=S.return}for(;C!==null;){if(S=$n(C),S===null)return;if(L=S.tag,L===5||L===6){d=y=S;continue e}C=C.parentNode}}d=d.return}tf(function(){var H=y,Q=mc(l),X=[];e:{var J=Kf.get(n);if(J!==void 0){var re=Ac,se=n;switch(n){case"keypress":if(ca(l)===0)break e;case"keydown":case"keyup":re=f_;break;case"focusin":se="focus",re=Lc;break;case"focusout":se="blur",re=Lc;break;case"beforeblur":case"afterblur":re=Lc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=xf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=t_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=m_;break;case Hf:case Wf:case Vf:re=s_;break;case qf:re=v_;break;case"scroll":re=Z0;break;case"wheel":re=__;break;case"copy":case"cut":case"paste":re=o_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=kf}var oe=(i&4)!==0,qe=!oe&&n==="scroll",U=oe?J!==null?J+"Capture":null:J;oe=[];for(var N=H,B;N!==null;){B=N;var ee=B.stateNode;if(B.tag===5&&ee!==null&&(B=ee,U!==null&&(ee=ki(N,U),ee!=null&&oe.push(Wi(N,ee,B)))),qe)break;N=N.return}0<oe.length&&(J=new re(J,se,null,l,Q),X.push({event:J,listeners:oe}))}}if((i&7)===0){e:{if(J=n==="mouseover"||n==="pointerover",re=n==="mouseout"||n==="pointerout",J&&l!==gc&&(se=l.relatedTarget||l.fromElement)&&($n(se)||se[Ir]))break e;if((re||J)&&(J=Q.window===Q?Q:(J=Q.ownerDocument)?J.defaultView||J.parentWindow:window,re?(se=l.relatedTarget||l.toElement,re=H,se=se?$n(se):null,se!==null&&(qe=Mn(se),se!==qe||se.tag!==5&&se.tag!==6)&&(se=null)):(re=null,se=H),re!==se)){if(oe=xf,ee="onMouseLeave",U="onMouseEnter",N="mouse",(n==="pointerout"||n==="pointerover")&&(oe=kf,ee="onPointerLeave",U="onPointerEnter",N="pointer"),qe=re==null?J:Ps(re),B=se==null?J:Ps(se),J=new oe(ee,N+"leave",re,l,Q),J.target=qe,J.relatedTarget=B,ee=null,$n(Q)===H&&(oe=new oe(U,N+"enter",se,l,Q),oe.target=B,oe.relatedTarget=qe,ee=oe),qe=ee,re&&se)t:{for(oe=re,U=se,N=0,B=oe;B;B=Cs(B))N++;for(B=0,ee=U;ee;ee=Cs(ee))B++;for(;0<N-B;)oe=Cs(oe),N--;for(;0<B-N;)U=Cs(U),B--;for(;N--;){if(oe===U||U!==null&&oe===U.alternate)break t;oe=Cs(oe),U=Cs(U)}oe=null}else oe=null;re!==null&&Xf(X,J,re,oe,!1),se!==null&&qe!==null&&Xf(X,qe,se,oe,!0)}}e:{if(J=H?Ps(H):window,re=J.nodeName&&J.nodeName.toLowerCase(),re==="select"||re==="input"&&J.type==="file")var le=C_;else if(Of(J))if(Lf)le=O_;else{le=P_;var de=T_}else(re=J.nodeName)&&re.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(le=A_);if(le&&(le=le(n,H))){If(X,le,l,Q);break e}de&&de(n,J,H),n==="focusout"&&(de=J._wrapperState)&&de.controlled&&J.type==="number"&&Nn(J,"number",J.value)}switch(de=H?Ps(H):window,n){case"focusin":(Of(de)||de.contentEditable==="true")&&(ks=de,Uc=H,Bi=null);break;case"focusout":Bi=Uc=ks=null;break;case"mousedown":Fc=!0;break;case"contextmenu":case"mouseup":case"dragend":Fc=!1,Bf(X,l,Q);break;case"selectionchange":if(j_)break;case"keydown":case"keyup":Bf(X,l,Q)}var he;if(Nc)e:{switch(n){case"compositionstart":var ve="onCompositionStart";break e;case"compositionend":ve="onCompositionEnd";break e;case"compositionupdate":ve="onCompositionUpdate";break e}ve=void 0}else Es?Pf(n,l)&&(ve="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(ve="onCompositionStart");ve&&(Rf&&l.locale!=="ko"&&(Es||ve!=="onCompositionStart"?ve==="onCompositionEnd"&&Es&&(he=bf()):(nn=Q,Pc="value"in nn?nn.value:nn.textContent,Es=!0)),de=ma(H,ve),0<de.length&&(ve=new Ef(ve,n,null,l,Q),X.push({event:ve,listeners:de}),he?ve.data=he:(he=Af(l),he!==null&&(ve.data=he)))),(he=S_?x_(n,l):E_(n,l))&&(H=ma(H,"onBeforeInput"),0<H.length&&(Q=new Ef("onBeforeInput","beforeinput",null,l,Q),X.push({event:Q,listeners:H}),Q.data=he))}Qf(X,i)})}function Wi(n,i,l){return{instance:n,listener:i,currentTarget:l}}function ma(n,i){for(var l=i+"Capture",d=[];n!==null;){var p=n,y=p.stateNode;p.tag===5&&y!==null&&(p=y,y=ki(n,l),y!=null&&d.unshift(Wi(n,y,p)),y=ki(n,i),y!=null&&d.push(Wi(n,y,p))),n=n.return}return d}function Cs(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function Xf(n,i,l,d,p){for(var y=i._reactName,S=[];l!==null&&l!==d;){var C=l,L=C.alternate,H=C.stateNode;if(L!==null&&L===d)break;C.tag===5&&H!==null&&(C=H,p?(L=ki(l,y),L!=null&&S.unshift(Wi(l,L,C))):p||(L=ki(l,y),L!=null&&S.push(Wi(l,L,C)))),l=l.return}S.length!==0&&n.push({event:i,listeners:S})}var D_=/\r\n?/g,U_=/\u0000|\uFFFD/g;function Zf(n){return(typeof n=="string"?n:""+n).replace(D_,`
7`).replace(U_,"")}function ya(n,i,l){if(i=Zf(i),Zf(n)!==i&&l)throw Error(r(425))}function va(){}var qc=null,Kc=null;function Gc(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Jc=typeof setTimeout=="function"?setTimeout:void 0,F_=typeof clearTimeout=="function"?clearTimeout:void 0,ep=typeof Promise=="function"?Promise:void 0,B_=typeof queueMicrotask=="function"?queueMicrotask:typeof ep<"u"?function(n){return ep.resolve(null).then(n).catch(z_)}:Jc;function z_(n){setTimeout(function(){throw n})}function Qc(n,i){var l=i,d=0;do{var p=l.nextSibling;if(n.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"){if(d===0){n.removeChild(p),ji(i);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=p}while(l);ji(i)}function on(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return n}function tp(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return n;i--}else l==="/$"&&i++}n=n.previousSibling}return null}var Ts=Math.random().toString(36).slice(2),yr="__reactFiber$"+Ts,Vi="__reactProps$"+Ts,Ir="__reactContainer$"+Ts,Yc="__reactEvents$"+Ts,H_="__reactListeners$"+Ts,W_="__reactHandles$"+Ts;function $n(n){var i=n[yr];if(i)return i;for(var l=n.parentNode;l;){if(i=l[Ir]||l[yr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=tp(n);n!==null;){if(l=n[yr])return l;n=tp(n)}return i}n=l,l=n.parentNode}return null}function qi(n){return n=n[yr]||n[Ir],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Ps(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(r(33))}function wa(n){return n[Vi]||null}var Xc=[],As=-1;function an(n){return{current:n}}function Me(n){0>As||(n.current=Xc[As],Xc[As]=null,As--)}function Le(n,i){As++,Xc[As]=n.current,n.current=i}var ln={},dt=an(ln),_t=an(!1),Dn=ln;function Os(n,i){var l=n.type.contextTypes;if(!l)return ln;var d=n.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===i)return d.__reactInternalMemoizedMaskedChildContext;var p={},y;for(y in l)p[y]=i[y];return d&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=p),p}function bt(n){return n=n.childContextTypes,n!=null}function _a(){Me(_t),Me(dt)}function rp(n,i,l){if(dt.current!==ln)throw Error(r(168));Le(dt,i),Le(_t,l)}function np(n,i,l){var d=n.stateNode;if(i=i.childContextTypes,typeof d.getChildContext!="function")return l;d=d.getChildContext();for(var p in d)if(!(p in i))throw Error(r(108,Ee(n)||"Unknown",p));return Z({},l,d)}function ba(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ln,Dn=dt.current,Le(dt,n),Le(_t,_t.current),!0}function sp(n,i,l){var d=n.stateNode;if(!d)throw Error(r(169));l?(n=np(n,i,Dn),d.__reactInternalMemoizedMergedChildContext=n,Me(_t),Me(dt),Le(dt,n)):Me(_t),Le(_t,l)}var Lr=null,Sa=!1,Zc=!1;function ip(n){Lr===null?Lr=[n]:Lr.push(n)}function V_(n){Sa=!0,ip(n)}function cn(){if(!Zc&&Lr!==null){Zc=!0;var n=0,i=Pe;try{var l=Lr;for(Pe=1;n<l.length;n++){var d=l[n];do d=d(!0);while(d!==null)}Lr=null,Sa=!1}catch(p){throw Lr!==null&&(Lr=Lr.slice(n+1)),af(bc,cn),p}finally{Pe=i,Zc=!1}}return null}var Is=[],Ls=0,xa=null,Ea=0,Wt=[],Vt=0,Un=null,jr=1,Nr="";function Fn(n,i){Is[Ls++]=Ea,Is[Ls++]=xa,xa=n,Ea=i}function op(n,i,l){Wt[Vt++]=jr,Wt[Vt++]=Nr,Wt[Vt++]=Un,Un=n;var d=jr;n=Nr;var p=32-Zt(d)-1;d&=~(1<<p),l+=1;var y=32-Zt(i)+p;if(30<y){var S=p-p%5;y=(d&(1<<S)-1).toString(32),d>>=S,p-=S,jr=1<<32-Zt(i)+p|l<<p|d,Nr=y+n}else jr=1<<y|l<<p|d,Nr=n}function eu(n){n.return!==null&&(Fn(n,1),op(n,1,0))}function tu(n){for(;n===xa;)xa=Is[--Ls],Is[Ls]=null,Ea=Is[--Ls],Is[Ls]=null;for(;n===Un;)Un=Wt[--Vt],Wt[Vt]=null,Nr=Wt[--Vt],Wt[Vt]=null,jr=Wt[--Vt],Wt[Vt]=null}var jt=null,Nt=null,De=!1,tr=null;function ap(n,i){var l=Jt(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=n,i=n.deletions,i===null?(n.deletions=[l],n.flags|=16):i.push(l)}function lp(n,i){switch(n.tag){case 5:var l=n.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(n.stateNode=i,jt=n,Nt=on(i.firstChild),!0):!1;case 6:return i=n.pendingProps===""||i.nodeType!==3?null:i,i!==null?(n.stateNode=i,jt=n,Nt=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=Un!==null?{id:jr,overflow:Nr}:null,n.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Jt(18,null,null,0),l.stateNode=i,l.return=n,n.child=l,jt=n,Nt=null,!0):!1;default:return!1}}function ru(n){return(n.mode&1)!==0&&(n.flags&128)===0}function nu(n){if(De){var i=Nt;if(i){var l=i;
vendor: 4,309 bytes, line 7
7if(!lp(n,i)){if(ru(n))throw Error(r(418));i=on(l.nextSibling);var d=jt;i&&lp(n,i)?ap(d,l):(n.flags=n.flags&-4097|2,De=!1,jt=n)}}else{if(ru(n))throw Error(r(418));n.flags=n.flags&-4097|2,De=!1,jt=n}}}function cp(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;jt=n}function ka(n){if(n!==jt)return!1;if(!De)return cp(n),De=!0,!1;var i;if((i=n.tag!==3)&&!(i=n.tag!==5)&&(i=n.type,i=i!=="head"&&i!=="body"&&!Gc(n.type,n.memoizedProps)),i&&(i=Nt)){if(ru(n))throw up(),Error(r(418));for(;i;)ap(n,i),i=on(i.nextSibling)}if(cp(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));e:{for(n=n.nextSibling,i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"){if(i===0){Nt=on(n.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}n=n.nextSibling}Nt=null}}else Nt=jt?on(n.stateNode.nextSibling):null;return!0}function up(){for(var n=Nt;n;)n=on(n.nextSibling)}function js(){Nt=jt=null,De=!1}function su(n){tr===null?tr=[n]:tr.push(n)}var q_=I.ReactCurrentBatchConfig;function Ki(n,i,l){if(n=l.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(r(309));var d=l.stateNode}if(!d)throw Error(r(147,n));var p=d,y=""+n;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===y?i.ref:(i=function(S){var C=p.refs;S===null?delete C[y]:C[y]=S},i._stringRef=y,i)}if(typeof n!="string")throw Error(r(284));if(!l._owner)throw Error(r(290,n))}return n}function Ra(n,i){throw n=Object.prototype.toString.call(i),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n))}function dp(n){var i=n._init;return i(n._payload)}function hp(n){function i(U,N){if(n){var B=U.deletions;B===null?(U.deletions=[N],U.flags|=16):B.push(N)}}function l(U,N){if(!n)return null;for(;N!==null;)i(U,N),N=N.sibling;return null}function d(U,N){for(U=new Map;N!==null;)N.key!==null?U.set(N.key,N):U.set(N.index,N),N=N.sibling;return U}function p(U,N){return U=yn(U,N),U.index=0,U.sibling=null,U}function y(U,N,B){return U.index=B,n?(B=U.alternate,B!==null?(B=B.index,B<N?(U.flags|=2,N):B):(U.flags|=2,N)):(U.flags|=1048576,N)}function S(U){return n&&U.alternate===null&&(U.flags|=2),U}function C(U,N,B,ee){return N===null||N.tag!==6?(N=Ju(B,U.mode,ee),N.return=U,N):(N=p(N,B),N.return=U,N)}function L(U,N,B,ee){var le=B.type;return le===M?Q(U,N,B.props.children,ee,B.key):N!==null&&(N.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===pe&&dp(le)===N.type)?(ee=p(N,B.props),ee.ref=Ki(U,N,B),ee.return=U,ee):(ee=Qa(B.type,B.key,B.props,null,U.mode,ee),ee.ref=Ki(U,N,B),ee.return=U,ee)}function H(U,N,B,ee){return N===null||N.tag!==4||N.stateNode.containerInfo!==B.containerInfo||N.stateNode.implementation!==B.implementation?(N=Qu(B,U.mode,ee),N.return=U,N):(N=p(N,B.children||[]),N.return=U,N)}function Q(U,N,B,ee,le){return N===null||N.tag!==7?(N=Gn(B,U.mode,ee,le),N.return=U,N):(N=p(N,B),N.return=U,N)}function X(U,N,B){if(typeof N=="string"&&N!==""||typeof N=="number")return N=Ju(""+N,U.mode,B),N.return=U,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case $:return B=Qa(N.type,N.key,N.props,null,U.mode,B),B.ref=Ki(U,null,N),B.return=U,B;case F:return N=Qu(N,U.mode,B),N.return=U,N;case pe:var ee=N._init;return X(U,ee(N._payload),B)}if(It(N)||Y(N))return N=Gn(N,U.mode,B,null),N.return=U,N;Ra(U,N)}return null}function J(U,N,B,ee){var le=N!==null?N.key:null;if(typeof B=="string"&&B!==""||typeof B=="number")return le!==null?null:C(U,N,""+B,ee);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case $:return B.key===le?L(U,N,B,ee):null;case F:return B.key===le?H(U,N,B,ee):null;case pe:return le=B._init,J(U,N,le(B._payload),ee)}if(It(B)||Y(B))return le!==null?null:Q(U,N,B,ee,null);Ra(U,B)}return null}function re(U,N,B,ee,le){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return U=U.get(B)||null,C(N,U,""+ee,le);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case $:return U=U.get(ee.key===null?B:ee.key)||null,L(N,U,ee,le);case F:return U=U.get(ee.key===null?B:ee.key)||null,H(N,U,ee,le);case pe:var de=ee._init;return re(U,N,B,de(ee._payload),le)}if(It(ee)||Y(ee))return U=U.get(B)||null,Q(N,U,ee,le,null);Ra(N,ee)}return null}function se(U,N,B,ee){for(var le=null,de=null,he=N,ve=N=0,nt=null;he!==null&&ve<B.length;ve++){he.index>
vendor: 22,305 bytes, lines 7-9
7ve?(nt=he,he=null):nt=he.sibling;var Ce=J(U,he,B[ve],ee);if(Ce===null){he===null&&(he=nt);break}n&&he&&Ce.alternate===null&&i(U,he),N=y(Ce,N,ve),de===null?le=Ce:de.sibling=Ce,de=Ce,he=nt}if(ve===B.length)return l(U,he),De&&Fn(U,ve),le;if(he===null){for(;ve<B.length;ve++)he=X(U,B[ve],ee),he!==null&&(N=y(he,N,ve),de===null?le=he:de.sibling=he,de=he);return De&&Fn(U,ve),le}for(he=d(U,he);ve<B.length;ve++)nt=re(he,U,ve,B[ve],ee),nt!==null&&(n&&nt.alternate!==null&&he.delete(nt.key===null?ve:nt.key),N=y(nt,N,ve),de===null?le=nt:de.sibling=nt,de=nt);return n&&he.forEach(function(vn){return i(U,vn)}),De&&Fn(U,ve),le}function oe(U,N,B,ee){var le=Y(B);if(typeof le!="function")throw Error(r(150));if(B=le.call(B),B==null)throw Error(r(151));for(var de=le=null,he=N,ve=N=0,nt=null,Ce=B.next();he!==null&&!Ce.done;ve++,Ce=B.next()){he.index>ve?(nt=he,he=null):nt=he.sibling;var vn=J(U,he,Ce.value,ee);if(vn===null){he===null&&(he=nt);break}n&&he&&vn.alternate===null&&i(U,he),N=y(vn,N,ve),de===null?le=vn:de.sibling=vn,de=vn,he=nt}if(Ce.done)return l(U,he),De&&Fn(U,ve),le;if(he===null){for(;!Ce.done;ve++,Ce=B.next())Ce=X(U,Ce.value,ee),Ce!==null&&(N=y(Ce,N,ve),de===null?le=Ce:de.sibling=Ce,de=Ce);return De&&Fn(U,ve),le}for(he=d(U,he);!Ce.done;ve++,Ce=B.next())Ce=re(he,U,ve,Ce.value,ee),Ce!==null&&(n&&Ce.alternate!==null&&he.delete(Ce.key===null?ve:Ce.key),N=y(Ce,N,ve),de===null?le=Ce:de.sibling=Ce,de=Ce);return n&&he.forEach(function(kb){return i(U,kb)}),De&&Fn(U,ve),le}function qe(U,N,B,ee){if(typeof B=="object"&&B!==null&&B.type===M&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case $:e:{for(var le=B.key,de=N;de!==null;){if(de.key===le){if(le=B.type,le===M){if(de.tag===7){l(U,de.sibling),N=p(de,B.props.children),N.return=U,U=N;break e}}else if(de.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===pe&&dp(le)===de.type){l(U,de.sibling),N=p(de,B.props),N.ref=Ki(U,de,B),N.return=U,U=N;break e}l(U,de);break}else i(U,de);de=de.sibling}B.type===M?(N=Gn(B.props.children,U.mode,ee,B.key),N.return=U,U=N):(ee=Qa(B.type,B.key,B.props,null,U.mode,ee),ee.ref=Ki(U,N,B),ee.return=U,U=ee)}return S(U);case F:e:{for(de=B.key;N!==null;){if(N.key===de)if(N.tag===4&&N.stateNode.containerInfo===B.containerInfo&&N.stateNode.implementation===B.implementation){l(U,N.sibling),N=p(N,B.children||[]),N.return=U,U=N;break e}else{l(U,N);break}else i(U,N);N=N.sibling}N=Qu(B,U.mode,ee),N.return=U,U=N}return S(U);case pe:return de=B._init,qe(U,N,de(B._payload),ee)}if(It(B))return se(U,N,B,ee);if(Y(B))return oe(U,N,B,ee);Ra(U,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,N!==null&&N.tag===6?(l(U,N.sibling),N=p(N,B),N.return=U,U=N):(l(U,N),N=Ju(B,U.mode,ee),N.return=U,U=N),S(U)):l(U,N)}return qe}var Ns=hp(!0),fp=hp(!1),Ca=an(null),Ta=null,Ms=null,iu=null;function ou(){iu=Ms=Ta=null}function au(n){var i=Ca.current;Me(Ca),n._currentValue=i}function lu(n,i,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),n===l)break;n=n.return}}function $s(n,i){Ta=n,iu=Ms=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&i)!==0&&(St=!0),n.firstContext=null)}function qt(n){var i=n._currentValue;if(iu!==n)if(n={context:n,memoizedValue:i,next:null},Ms===null){if(Ta===null)throw Error(r(308));Ms=n,Ta.dependencies={lanes:0,firstContext:n}}else Ms=Ms.next=n;return i}var Bn=null;function cu(n){Bn===null?Bn=[n]:Bn.push(n)}function pp(n,i,l,d){var p=i.interleaved;return p===null?(l.next=l,cu(i)):(l.next=p.next,p.next=l),i.interleaved=l,Mr(n,d)}function Mr(n,i){n.lanes|=i;var l=n.alternate;for(l!==null&&(l.lanes|=i),l=n,n=n.return;n!==null;)n.childLanes|=i,l=n.alternate,l!==null&&(l.childLanes|=i),l=n,n=n.return;return l.tag===3?l.stateNode:null}var un=!1;function uu(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gp(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function $r(n,i){return{eventTime:n,lane:i,tag:0,payload:null,callback:null,next:null}}function dn(n,i,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(ke&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,Mr(n,l)}return p=d.interleaved,p===null?(i.next=i,cu(d)):(i.next=p.next,p.next=i),d.interleaved=i,Mr(n,l)}function Pa(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,Ec(n,l)}}function mp(n,i){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var p=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var S={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};y===null?p=y=S:y=y.next=S,l=l.next}while(l!==null);y===null?p=y=i:y=y.next=i}else p=y=i;l={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:d.shared,effects:d.effects},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}function Aa(n,i,l,d){var p=n.updateQueue;un=!1;var y=p.firstBaseUpdate,S=p.lastBaseUpdate,C=p.shared.pending;if(C!==null){p.shared.pending=null;var L=C,H=L.next;L.next=null,S===null?y=H:S.next=H,S=L;var Q=n.alternate;Q!==null&&(Q=Q.updateQueue,C=Q.lastBaseUpdate,C!==S&&(C===null?Q.firstBaseUpdate=H:C.next=H,Q.lastBaseUpdate=L))}if(y!==null){var X=p.baseState;S=0,Q=H=L=null,C=y;do{var J=C.lane,re=C.eventTime;if((d&J)===J){Q!==null&&(Q=Q.next={eventTime:re,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var se=n,oe=C;switch(J=i,re=l,oe.tag){case 1:if(se=oe.payload,typeof se=="function"){X=se.call(re,X,J);break e}X=se;break e;case 3:se.flags=se.flags&-65537|128;case 0:if(se=oe.payload,J=typeof se=="function"?se.call(re,X,J):se,J==null)break e;X=Z({},X,J);break e;case 2:un=!0}}C.callback!==null&&C.lane!==0&&(n.flags|=64,J=p.effects,J===null?p.effects=[C]:J.push(C))}else re={eventTime:re,lane:J,tag:C.tag,payload:C.payload,callback:C.callback,next:null},Q===null?(H=Q=re,L=X):Q=Q.next=re,S|=J;if(C=C.next,C===null){if(C=p.shared.pending,C===null)break;J=C,C=J.next,J.next=null,p.lastBaseUpdate=J,p.shared.pending=null}}while(!0);if(Q===null&&(L=X),p.baseState=L,p.firstBaseUpdate=H,p.lastBaseUpdate=Q,i=p.shared.interleaved,i!==null){p=i;do S|=p.lane,p=p.next;while(p!==i)}else y===null&&(p.shared.lanes=0);Wn|=S,n.lanes=S,n.memoizedState=X}}function yp(n,i,l){if(n=i.effects,i.effects=null,n!==null)for(i=0;i<n.length;i++){var d=n[i],p=d.callback;if(p!==null){if(d.callback=null,d=l,typeof p!="function")throw Error(r(191,p));p.call(d)}}}var Gi={},vr=an(Gi),Ji=an(Gi),Qi=an(Gi);function zn(n){if(n===Gi)throw Error(r(174));return n}function du(n,i){switch(Le(Qi,i),Le(Ji,n),Le(vr,Gi),n=i.nodeType,n){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:Xt(null,"");break;default:n=n===8?i.parentNode:i,i=n.namespaceURI||null,n=n.tagName,i=Xt(i,n)}Me(vr),Le(vr,i)}function Ds(){Me(vr),Me(Ji),Me(Qi)}function vp(n){zn(Qi.current);var i=zn(vr.current),l=Xt(i,n.type);i!==l&&(Le(Ji,n),Le(vr,l))}function hu(n){Ji.current===n&&(Me(vr),Me(Ji))}var Fe=an(0);function Oa(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var fu=[];function pu(){for(var n=0;n<fu.length;n++)fu[n]._workInProgressVersionPrimary=null;fu.length=0}var Ia=I.ReactCurrentDispatcher,gu=I.ReactCurrentBatchConfig,Hn=0,Be=null,Ye=null,tt=null,La=!1,Yi=!1,Xi=0,K_=0;function ht(){throw Error(r(321))}function mu(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!er(n[l],i[l]))return!1;return!0}function yu(n,i,l,d,p,y){if(Hn=y,Be=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Ia.current=n===null||n.memoizedState===null?Y_:X_,n=l(d,p),Yi){y=0;do{if(Yi=!1,Xi=0,25<=y)throw Error(r(301));y+=1,tt=Ye=null,i.updateQueue=null,Ia.current=Z_,n=l(d,p)}while(Yi)}if(Ia.current=Ma,i=Ye!==null&&Ye.next!==null,Hn=0,tt=Ye=Be=null,La=!1,i)throw Error(r(300));return n}function vu(){var n=Xi!==0;return Xi=0,n}function wr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?Be.memoizedState=tt=n:tt=tt.next=n,tt}function Kt(){if(Ye===null){var n=Be.alternate;n=n!==null?n.memoizedState:null}else n=Ye.next;var i=tt===null?Be.memoizedState:tt.next;if(i!==null)tt=i,Ye=n;else{if(n===null)throw Error(r(310));Ye=n,n={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},tt===null?Be.memoizedState=tt=n:tt=tt.next=n}return tt}function Zi(n,i){return typeof i=="function"?i(n):i}function wu(n){var i=Kt(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var d=Ye,p=d.baseQueue,y=l.pending;if(y!==null){if(p!==null){var S=p.next;p.next=y.next,y.next=S}d.baseQueue=p=y,l.pending=null}if(p!==null){y=p.next,d=d.baseState;var C=S=null,L=null,H=y;do{var Q=H.lane;if((Hn&Q)===Q)L!==null&&(L=L.next={lane:0,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),d=H.hasEagerState?H.eagerState:n(d,H.action);else{var X={lane:Q,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null};L===null?(C=L=X,S=d):L=L.next=X,Be.lanes|=Q,Wn|=Q}H=H.next}while(H!==null&&H!==y);L===null?S=d:L.next=C,er(d,i.memoizedState)||(St=!0),i.memoizedState=d,i.baseState=S,i.baseQueue=L,l.lastRenderedState=d}if(n=l.interleaved,n!==null){p=n;do y=p.lane,Be.lanes|=y,Wn|=y,p=p.next;while(p!==n)}else p===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function _u(n){var i=Kt(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var d=l.dispatch,p=l.pending,y=i.memoizedState;if(p!==null){l.pending=null;var S=p=p.next;do y=n(y,S.action),S=S.next;while(S!==p);er(y,i.memoizedState)||(St=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),l.lastRenderedState=y}return[y,d]}function wp(){}function _p(n,i){var l=Be,d=Kt(),p=i(),y=!er(d.memoizedState,p);if(y&&(d.memoizedState=p,St=!0),d=d.queue,bu(xp.bind(null,l,d,n),[n]),d.getSnapshot!==i||y||tt!==null&&tt.memoizedState.tag&1){if(l.flags|=2048,eo(9,Sp.bind(null,l,d,p,i),void 0,null),rt===null)throw Error(r(349));(Hn&30)!==0||bp(l,i,p)}return p}function bp(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Be.updateQueue,i===null?(i={lastEffect:null,stores:null},Be.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function Sp(n,i,l,d){i.value=l,i.getSnapshot=d,Ep(i)&&kp(n)}function xp(n,i,l){return l(function(){Ep(i)&&kp(n)})}function Ep(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!er(n,l)}catch{return!0}}function kp(n){var i=Mr(n,1);i!==null&&ir(i,n,1,-1)}function Rp(n){var i=wr();return typeof n=="function"&&(n=n()),i.memoizedState=i.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Zi,lastRenderedState:n},i.queue=n,n=n.dispatch=Q_.bind(null,Be,n),[i.memoizedState,n]}function eo(n,i,l,d){return n={tag:n,create:i,destroy:l,deps:d,next:null},i=Be.updateQueue,i===null?(i={lastEffect:null,stores:null},Be.updateQueue=i,i.lastEffect=n.next=n):(l=i.lastEffect,l===null?i.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,i.lastEffect=n)),n}function Cp(){return Kt().memoizedState}function ja(n,i,l,d){var p=wr();Be.flags|=n,p.memoizedState=eo(1|i,l,void 0,d===void 0?null:d)}function Na(n,i,l,d){var p=Kt();d=d===void 0?null:d;var y=void 0;if(Ye!==null){var S=Ye.memoizedState;if(y=S.destroy,d!==null&&mu(d,S.deps)){p.memoizedState=eo(i,l,y,d);return}}Be.flags|=n,p.memoizedState=eo(1|i,l,y,d)}function Tp(n,i){return ja(8390656,8,n,i)}function bu(n,i){return Na(2048,8,n,i)}function Pp(n,i){return Na(4,2,n,i)}function Ap(n,i){return Na(4,4,n,i)}function Op(n,i){if(typeof i=="function")return n=n(),i(n),function(){i(null)};if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Ip(n,i,l){return l=l!=null?l.concat([n]):null,Na(4,4,Op.bind(null,i,n),l)}function Su(){}function Lp(n,i){var l=Kt();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&mu(i,d[1])?d[0]:(l.memoizedState=[n,i],n)}function jp(n,i){var l=Kt();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&mu(i,d[1])?d[0]:(n=n(),l.memoizedState=[n,i],n)}function Np(n,i,l){return(Hn&21)===0?(n.baseState&&(n.baseState=!1,St=!0),n.memoizedState=l):(er(l,i)||(l=df(),Be.lanes|=l,Wn|=l,n.baseState=!0),i)}function G_(n,i){var l=Pe;Pe=l!==0&&4>l?l:4,n(!0);var d=gu.transition;gu.transition={};try{n(!1),i()}finally{Pe=l,gu.transition=d}}function Mp(){return Kt().memoizedState}function J_(n,i,l){var d=gn(n);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},$p(n))Dp(i,l);else if(l=pp(n,i,l,d),l!==null){var p=yt();ir(l,n,d,p),Up(l,i,d)}}function Q_(n,i,l){var d=gn(n),p={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if($p(n))Dp(i,p);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var S=i.lastRenderedState,C=y(S,l);if(p.hasEagerState=!0,p.eagerState=C,er(C,S)){var L=i.interleaved;L===null?(p.next=p,cu(i)):(p.next=L.next,L.next=p),i.interleaved=p;return}}catch{}l=pp(n,i,p,d),l!==null&&(p=yt(),ir(l,n,d,p),Up(l,i,d))}}function $p(n){var i=n.alternate;return n===Be||i!==null&&i===Be}function Dp(n,i){Yi=La=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Up(n,i,l){if((l&4194240)!==0){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,Ec(n,l)}}var Ma={readContext:qt,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useInsertionEffect:ht,useLayoutEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useMutableSource:ht,useSyncExternalStore:ht,useId:ht,unstable_isNewReconciler:!1},Y_={readContext:qt,useCallback:function(n,i){return wr().memoizedState=[n,i===void 0?null:i],n},useContext:qt,useEffect:Tp,useImperativeHandle:function(n,i,l){return l=l!=null?l.concat([n]):null,ja(4194308,4,Op.bind(null,i,n),l)},useLayoutEffect:function(n,i){return ja(4194308,4,n,i)},useInsertionEffect:function(n,i){return ja(4,2,n,i)},useMemo:function(n,i){var l=wr();return i=i===void 0?null:i,n=n(),l.memoizedState=[n,i],n},useReducer:function(n,i,l){var d=wr();return i=l!==void 0?l(i):i,d.memoizedState=d.baseState=i,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:i},d.queue=n,n=n.dispatch=J_.bind(null,Be,n),[d.memoizedState,n]},useRef:function(n){var i=wr();return n={current:n},i.memoizedState=n},useState:Rp,useDebugValue:Su,useDeferredValue:function(n){return wr().memoizedState=n},useTransition:function(){var n=Rp(!1),i=n[0];return n=G_.bind(null,n[1]),wr().memoizedState=n,[i,n]},useMutableSource:function(){},useSyncExternalStore:function(n,i,l){var d=Be,p=wr();if(De){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),rt===null)throw Error(r(349));(Hn&30)!==0||bp(d,i,l)}p.memoizedState=l;var y={value:l,getSnapshot:i};return p.queue=y,Tp(xp.bind(null,d,y,n),[n]),d.flags|=2048,eo(9,Sp.bind(null,d,y,l,i),void 0,null),l},useId:function(){var n=wr(),i=rt.identifierPrefix;if(De){var l=Nr,d=jr;l=(d&~(1<<32-Zt(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=Xi++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=K_++,i=":"+i+"r"+l.toString(32)+":";return n.memoizedState=i},unstable_isNewReconciler:!1},X_={readContext:qt,useCallback:Lp,useContext:qt,useEffect:bu,useImperativeHandle:Ip,useInsertionEffect:Pp,useLayoutEffect:Ap,useMemo:jp,useReducer:wu,useRef:Cp,useState:function(){return wu(Zi)},useDebugValue:Su,useDeferredValue:function(n){var i=Kt();return Np(i,Ye.memoizedState,n)},useTransition:function(){var n=wu(Zi)[0],i=Kt().memoizedState;return[n,i]},useMutableSource:wp,useSyncExternalStore:_p,useId:Mp,unstable_isNewReconciler:!1},Z_={readContext:qt,useCallback:Lp,useContext:qt,useEffect:bu,useImperativeHandle:Ip,useInsertionEffect:Pp,useLayoutEffect:Ap,useMemo:jp,useReducer:_u,useRef:Cp,useState:function(){return _u(Zi)},useDebugValue:Su,useDeferredValue:function(n){var i=Kt();return Ye===null?i.memoizedState=n:Np(i,Ye.memoizedState,n)},useTransition:function(){var n=_u(Zi)[0],i=Kt().memoizedState;return[n,i]},useMutableSource:wp,useSyncExternalStore:_p,useId:Mp,unstable_isNewReconciler:!1};function rr(n,i){if(n&&n.defaultProps){i=Z({},i),n=n.defaultProps;for(var l in n)i[l]===void 0&&(i[l]=n[l]);return i}return i}function xu(n,i,l,d){i=n.memoizedState,l=l(d,i),l=l==null?i:Z({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var $a={isMounted:function(n){return(n=n._reactInternals)?Mn(n)===n:!1},enqueueSetState:function(n,i,l){n=n._reactInternals;var d=yt(),p=gn(n),y=$r(d,p);y.payload=i,l!=null&&(y.callback=l),i=dn(n,y,p),i!==null&&(ir(i,n,p,d),Pa(i,n,p))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var d=yt(),p=gn(n),y=$r(d,p);y.tag=1,y.payload=i,l!=null&&(y.callback=l),i=dn(n,y,p),i!==null&&(ir(i,n,p,d),Pa(i,n,p))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=yt(),d=gn(n),p=$r(l,d);p.tag=2,i!=null&&(p.callback=i),i=dn(n,p,d),i!==null&&(ir(i,n,d,l),Pa(i,n,d))}};function Fp(n,i,l,d,p,y,S){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,y,S):i.prototype&&i.prototype.isPureReactComponent?!Fi(l,d)||!Fi(p,y):!0}function Bp(n,i,l){var d=!1,p=ln,y=i.contextType;return typeof y=="object"&&y!==null?y=qt(y):(p=bt(i)?Dn:dt.current,d=i.contextTypes,y=(d=d!=null)?Os(n,p):ln),i=new i(l,y),n.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=$a,n.stateNode=i,i._reactInternals=n,d&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=p,n.__reactInternalMemoizedMaskedChildContext=y),i}function zp(n,i,l,d){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==n&&$a.enqueueReplaceState(i,i.state,null)}function Eu(n,i,l,d){var p=n.stateNode;p.props=l,p.state=n.memoizedState,p.refs={},uu(n);var y=i.contextType;typeof y=="object"&&y!==null?p.context=qt(y):(y=bt(i)?Dn:dt.current,p.context=Os(n,y)),p.state=n.memoizedState,y=i.getDerivedStateFromProps,typeof y=="function"&&(xu(n,i,y,l),p.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(i=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),i!==p.state&&$a.enqueueReplaceState(p,p.state,null),Aa(n,l,p,d),p.state=n.memoizedState),typeof p.componentDidMount=="function"&&(n.flags|=4194308)}function Us(n,i){try{var l="",d=i;do l+=fe(d),d=d.return;while(d);var p=l}catch(y){p=`
8Error generating stack: `+y.message+`
9`+y.stack}return{value:n,source:i,stack:p,digest:null}}function ku(n,i,l){return{value:n,source:null,stack:l??null,digest:i??null}}function Ru(n,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var eb=typeof WeakMap=="function"?WeakMap:Map;function Hp(n,i,l){l=$r(-1,l),l.tag=3,l.payload={element:null};var d=i.value;return l.callback=function(){Wa||(Wa=!0,Bu=d),Ru(n,i)},l}function Wp(n,i,l){l=$r(-1,l),l.tag=3;var d=n.type.getDerivedStateFromError;if(typeof d=="function"){var p=i.value;l.payload=function(){return d(p)},l.callback=function(){Ru(n,i)}}var y=n.stateNode;return y!==null&&typeof y.componentDidCatch=="function"&&(l.callback=function(){Ru(n,i),typeof d!="function"&&(fn===null?fn=new Set([this]):fn.add(this));var S=i.stack;this.componentDidCatch(i.value,{componentStack:S!==null?S:""})}),l}function Vp(n,i,l){var d=n.pingCache;if(d===null){d=n.pingCache=new eb;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(l)||(p.add(l),n=pb.bind(null,n,i,l),i.then(n,n))}function qp(n){do{var i;if((i=n.tag===13)&&(i=n.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return n;n=n.return}while(n!==null);return null}function Kp(n,i,l,d,p){return(n.mode&1)===0?(n===i?n.flags|=65536:(n.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=$r(-1,1),i.tag=2,dn(l,i,1))),l.lanes|=1),n):(n.flags|=65536,n.lanes=p,n)}var tb=I.ReactCurrentOwner,St=!1;function mt(n,i,l,d){i.child=n===null?fp(i,null,l,d):Ns(i,n.child,l,d)}function Gp(n,i,l,d,p){l=l.render;var y=i.ref;return $s(i,p),d=yu(n,i,l,d,y,p),l=vu(),n!==null&&!St?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~p,Dr(n,i,p)):(De&&l&&eu(i),i.flags|=1,mt(n,i,d,p),i.child)}function Jp(n,i,l,d,p){if(n===null){var y=l.type;return typeof y=="function"&&!Gu(y)&&y.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=y,Qp(n,i,y,d,p)):(n=Qa(l.type,null,d,i,i.mode,p),n.ref=i.ref,n.return=i,i.child=n)}if(y=n.child,(n.lanes&p)===0){var S=y.memoizedProps;if(l=l.compare,l=l!==null?l:Fi,l(S,d)&&n.ref===i.ref)return Dr(n,i,p)}return i.flags|=1,n=yn(y,d),n.ref=i.ref,n.return=i,i.child=n}function Qp(n,i,l,d,p){if(n!==null){var y=n.memoizedProps;if(Fi(y,d)&&n.ref===i.ref)if(St=!1,i.pendingProps=d=y,(n.lanes&p)!==0)(n.flags&131072)!==0&&(St=!0);else return i.lanes=n.lanes,Dr(n,i,p)}return Cu(n,i,l,d,p)}function Yp(n,i,l){var d=i.pendingProps,p=d.children,y=n!==null?n.memoizedState:null;if(d.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(Bs,Mt),Mt|=l;else{if((l&1073741824)===0)return n=y!==null?y.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:n,cachePool:null,transitions:null},i.updateQueue=null,Le(Bs,Mt),Mt|=n,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=y!==null?y.baseLanes:l,Le(Bs,Mt),Mt|=d}else y!==null?(d=y.baseLanes|l,i.memoizedState=null):d=l,Le(Bs,Mt),Mt|=d;return mt(n,i,p,l),i.child}function Xp(n,i){var l=i.ref;(n===null&&l!==null||n!==null&&n.ref!==l)&&(i.flags|=512,i.flags|=2097152)}
vendor: 4,521 bytes, line 9
9function Cu(n,i,l,d,p){var y=bt(l)?Dn:dt.current;return y=Os(i,y),$s(i,p),l=yu(n,i,l,d,y,p),d=vu(),n!==null&&!St?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~p,Dr(n,i,p)):(De&&d&&eu(i),i.flags|=1,mt(n,i,l,p),i.child)}function Zp(n,i,l,d,p){if(bt(l)){var y=!0;ba(i)}else y=!1;if($s(i,p),i.stateNode===null)Ua(n,i),Bp(i,l,d),Eu(i,l,d,p),d=!0;else if(n===null){var S=i.stateNode,C=i.memoizedProps;S.props=C;var L=S.context,H=l.contextType;typeof H=="object"&&H!==null?H=qt(H):(H=bt(l)?Dn:dt.current,H=Os(i,H));var Q=l.getDerivedStateFromProps,X=typeof Q=="function"||typeof S.getSnapshotBeforeUpdate=="function";X||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(C!==d||L!==H)&&zp(i,S,d,H),un=!1;var J=i.memoizedState;S.state=J,Aa(i,d,S,p),L=i.memoizedState,C!==d||J!==L||_t.current||un?(typeof Q=="function"&&(xu(i,l,Q,d),L=i.memoizedState),(C=un||Fp(i,l,C,d,J,L,H))?(X||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(i.flags|=4194308)):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=L),S.props=d,S.state=L,S.context=H,d=C):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{S=i.stateNode,gp(n,i),C=i.memoizedProps,H=i.type===i.elementType?C:rr(i.type,C),S.props=H,X=i.pendingProps,J=S.context,L=l.contextType,typeof L=="object"&&L!==null?L=qt(L):(L=bt(l)?Dn:dt.current,L=Os(i,L));var re=l.getDerivedStateFromProps;(Q=typeof re=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(C!==X||J!==L)&&zp(i,S,d,L),un=!1,J=i.memoizedState,S.state=J,Aa(i,d,S,p);var se=i.memoizedState;C!==X||J!==se||_t.current||un?(typeof re=="function"&&(xu(i,l,re,d),se=i.memoizedState),(H=un||Fp(i,l,H,d,J,se,L)||!1)?(Q||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(d,se,L),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(d,se,L)),typeof S.componentDidUpdate=="function"&&(i.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof S.componentDidUpdate!="function"||C===n.memoizedProps&&J===n.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||C===n.memoizedProps&&J===n.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=se),S.props=d,S.state=se,S.context=L,d=H):(typeof S.componentDidUpdate!="function"||C===n.memoizedProps&&J===n.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||C===n.memoizedProps&&J===n.memoizedState||(i.flags|=1024),d=!1)}return Tu(n,i,l,d,y,p)}function Tu(n,i,l,d,p,y){Xp(n,i);var S=(i.flags&128)!==0;if(!d&&!S)return p&&sp(i,l,!1),Dr(n,i,y);d=i.stateNode,tb.current=i;var C=S&&typeof l.getDerivedStateFromError!="function"?null:d.render();return i.flags|=1,n!==null&&S?(i.child=Ns(i,n.child,null,y),i.child=Ns(i,null,C,y)):mt(n,i,C,y),i.memoizedState=d.state,p&&sp(i,l,!0),i.child}function eg(n){var i=n.stateNode;i.pendingContext?rp(n,i.pendingContext,i.pendingContext!==i.context):i.context&&rp(n,i.context,!1),du(n,i.containerInfo)}function tg(n,i,l,d,p){return js(),su(p),i.flags|=256,mt(n,i,l,d),i.child}var Pu={dehydrated:null,treeContext:null,retryLane:0};function Au(n){return{baseLanes:n,cachePool:null,transitions:null}}function rg(n,i,l){var d=i.pendingProps,p=Fe.current,y=!1,S=(i.flags&128)!==0,C;if((C=S)||(C=n!==null&&n.memoizedState===null?!1:(p&2)!==0),C?(y=!0,i.flags&=-129):(n===null||n.memoizedState!==null)&&(p|=1),Le(Fe,p&1),n===null)return nu(i),n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((i.mode&1)===0?i.lanes=1:n.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(S=d.children,n=d.fallback,y?(d=i.mode,y=i.child,S={mode:"hidden",children:S},(d&1)===0&&y!==null?(y.childLanes=0,y.pendingProps=S):y=Ya(S,d,0,null),n=Gn(n,d,l,null),y.return=i,n.return=i,y.sibling=n,i.child=y,i.child.memoizedState=Au(l),i.memoizedState=Pu,n):Ou(i,S));if(p=n.memoizedState,p!==null&&(C=p.dehydrated,C!==null))return rb(n,i,S,d,C,p,l);if(y){y=d.fallback,S=i.mode,p=n.child,C=p.sibling;var L={mode:"hidden",children:d.children};return(S&1)===0&&i.child!==p?(d=i.child,d.childLanes=0,d.pendingProps=L,i.deleti
vendor: 5,796 bytes, line 9
9ons=null):(d=yn(p,L),d.subtreeFlags=p.subtreeFlags&14680064),C!==null?y=yn(C,y):(y=Gn(y,S,l,null),y.flags|=2),y.return=i,d.return=i,d.sibling=y,i.child=d,d=y,y=i.child,S=n.child.memoizedState,S=S===null?Au(l):{baseLanes:S.baseLanes|l,cachePool:null,transitions:S.transitions},y.memoizedState=S,y.childLanes=n.childLanes&~l,i.memoizedState=Pu,d}return y=n.child,n=y.sibling,d=yn(y,{mode:"visible",children:d.children}),(i.mode&1)===0&&(d.lanes=l),d.return=i,d.sibling=null,n!==null&&(l=i.deletions,l===null?(i.deletions=[n],i.flags|=16):l.push(n)),i.child=d,i.memoizedState=null,d}function Ou(n,i){return i=Ya({mode:"visible",children:i},n.mode,0,null),i.return=n,n.child=i}function Da(n,i,l,d){return d!==null&&su(d),Ns(i,n.child,null,l),n=Ou(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function rb(n,i,l,d,p,y,S){if(l)return i.flags&256?(i.flags&=-257,d=ku(Error(r(422))),Da(n,i,S,d)):i.memoizedState!==null?(i.child=n.child,i.flags|=128,null):(y=d.fallback,p=i.mode,d=Ya({mode:"visible",children:d.children},p,0,null),y=Gn(y,p,S,null),y.flags|=2,d.return=i,y.return=i,d.sibling=y,i.child=d,(i.mode&1)!==0&&Ns(i,n.child,null,S),i.child.memoizedState=Au(S),i.memoizedState=Pu,y);if((i.mode&1)===0)return Da(n,i,S,null);if(p.data==="$!"){if(d=p.nextSibling&&p.nextSibling.dataset,d)var C=d.dgst;return d=C,y=Error(r(419)),d=ku(y,d,void 0),Da(n,i,S,d)}if(C=(S&n.childLanes)!==0,St||C){if(d=rt,d!==null){switch(S&-S){case 4:p=2;break;case 16:p=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(d.suspendedLanes|S))!==0?0:p,p!==0&&p!==y.retryLane&&(y.retryLane=p,Mr(n,p),ir(d,n,p,-1))}return Ku(),d=ku(Error(r(421))),Da(n,i,S,d)}return p.data==="$?"?(i.flags|=128,i.child=n.child,i=gb.bind(null,n),p._reactRetry=i,null):(n=y.treeContext,Nt=on(p.nextSibling),jt=i,De=!0,tr=null,n!==null&&(Wt[Vt++]=jr,Wt[Vt++]=Nr,Wt[Vt++]=Un,jr=n.id,Nr=n.overflow,Un=i),i=Ou(i,d.children),i.flags|=4096,i)}function ng(n,i,l){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i),lu(n.return,i,l)}function Iu(n,i,l,d,p){var y=n.memoizedState;y===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:p}:(y.isBackwards=i,y.rendering=null,y.renderingStartTime=0,y.last=d,y.tail=l,y.tailMode=p)}function sg(n,i,l){var d=i.pendingProps,p=d.revealOrder,y=d.tail;if(mt(n,i,d.children,l),d=Fe.current,(d&2)!==0)d=d&1|2,i.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&ng(n,l,i);else if(n.tag===19)ng(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}d&=1}if(Le(Fe,d),(i.mode&1)===0)i.memoizedState=null;else switch(p){case"forwards":for(l=i.child,p=null;l!==null;)n=l.alternate,n!==null&&Oa(n)===null&&(p=l),l=l.sibling;l=p,l===null?(p=i.child,i.child=null):(p=l.sibling,l.sibling=null),Iu(i,!1,p,l,y);break;case"backwards":for(l=null,p=i.child,i.child=null;p!==null;){if(n=p.alternate,n!==null&&Oa(n)===null){i.child=p;break}n=p.sibling,p.sibling=l,l=p,p=n}Iu(i,!0,l,null,y);break;case"together":Iu(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Ua(n,i){(i.mode&1)===0&&n!==null&&(n.alternate=null,i.alternate=null,i.flags|=2)}function Dr(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),Wn|=i.lanes,(l&i.childLanes)===0)return null;if(n!==null&&i.child!==n.child)throw Error(r(153));if(i.child!==null){for(n=i.child,l=yn(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=yn(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function nb(n,i,l){switch(i.tag){case 3:eg(i),js();break;case 5:vp(i);break;case 1:bt(i.type)&&ba(i);break;case 4:du(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,p=i.memoizedProps.value;Le(Ca,d._currentValue),d._currentValue=p;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(Le(Fe,Fe.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?rg(n,i,l):(Le(Fe,Fe.current&1),n=Dr(n,i,l),n!==null?n.sibling:null);Le(Fe,Fe.current&1);break;case 19:if(d=(l&i.childLanes)!==0,(n.flags&128)!==0){if(d)return sg(n,i,l);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Le(Fe,Fe.current),d)break;return null;case 22:case 23:return i.lanes=0,Yp(n,i,l)}return Dr(n,i,l)}var ig,Lu,og,ag;ig=function(n,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)n.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Lu=function(){},og=function(n,i,l,d){var p=n.memoizedProps;if(p!==d){n=i.stateNode,zn(vr.current);var y=null;switch(l){case"input":p=ms(n,p),d=ms(n,d),y=[];break;case"select":p=Z({},p,{value:void 0}),d=Z({},d,{value:void 0}),y=[];break;case"textarea":p=vs(n,p),d=vs(n,d),y=[];break;default:typeof p.onClick!="function"&&typeof d.onClick=="function"&&(n.onclick=va)}fc(l,d);var S;l=null;for(H in p)if(!d.hasOwnProperty(H)&&p.hasOwnProperty(H)&&p[H]!=null)if(H==="style"){var C=p[H];for(S in C)C.hasOwnProperty(S)&&(l||(l={}),l[S]="")}else H!=="dangerouslySetInnerHTML"&&H!=="children"&&H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&H!=="autoFocus"&&(o.hasOwnProperty(H)?y||(y=[]):(y=y||[]).push(H,null));for(H in d){var L=d[H];if(C=p?.[H],d.hasOwnProperty(H)&&L!==C&&(L!=null||C!=null))if(H==="style")if(C){for(S 
vendor: 10,518 bytes, line 9
9in C)!C.hasOwnProperty(S)||L&&L.hasOwnProperty(S)||(l||(l={}),l[S]="");for(S in L)L.hasOwnProperty(S)&&C[S]!==L[S]&&(l||(l={}),l[S]=L[S])}else l||(y||(y=[]),y.push(H,l)),l=L;else H==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,C=C?C.__html:void 0,L!=null&&C!==L&&(y=y||[]).push(H,L)):H==="children"?typeof L!="string"&&typeof L!="number"||(y=y||[]).push(H,""+L):H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&(o.hasOwnProperty(H)?(L!=null&&H==="onScroll"&&Ne("scroll",n),y||C===L||(y=[])):(y=y||[]).push(H,L))}l&&(y=y||[]).push("style",l);var H=y;(i.updateQueue=H)&&(i.flags|=4)}},ag=function(n,i,l,d){l!==d&&(i.flags|=4)};function to(n,i){if(!De)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function ft(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(i)for(var p=n.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags&14680064,d|=p.flags&14680064,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)l|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=d,n.childLanes=l,i}function sb(n,i,l){var d=i.pendingProps;switch(tu(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(i),null;case 1:return bt(i.type)&&_a(),ft(i),null;case 3:return d=i.stateNode,Ds(),Me(_t),Me(dt),pu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(n===null||n.child===null)&&(ka(i)?i.flags|=4:n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,tr!==null&&(Wu(tr),tr=null))),Lu(n,i),ft(i),null;case 5:hu(i);var p=zn(Qi.current);if(l=i.type,n!==null&&i.stateNode!=null)og(n,i,l,d,p),n.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!d){if(i.stateNode===null)throw Error(r(166));return ft(i),null}if(n=zn(vr.current),ka(i)){d=i.stateNode,l=i.type;var y=i.memoizedProps;switch(d[yr]=i,d[Vi]=y,n=(i.mode&1)!==0,l){case"dialog":Ne("cancel",d),Ne("close",d);break;case"iframe":case"object":case"embed":Ne("load",d);break;case"video":case"audio":for(p=0;p<zi.length;p++)Ne(zi[p],d);break;case"source":Ne("error",d);break;case"img":case"image":case"link":Ne("error",d),Ne("load",d);break;case"details":Ne("toggle",d);break;case"input":Jo(d,y),Ne("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!y.multiple},Ne("invalid",d);break;case"textarea":Qo(d,y),Ne("invalid",d)}fc(l,y),p=null;for(var S in y)if(y.hasOwnProperty(S)){var C=y[S];S==="children"?typeof C=="string"?d.textContent!==C&&(y.suppressHydrationWarning!==!0&&ya(d.textContent,C,n),p=["children",C]):typeof C=="number"&&d.textContent!==""+C&&(y.suppressHydrationWarning!==!0&&ya(d.textContent,C,n),p=["children",""+C]):o.hasOwnProperty(S)&&C!=null&&S==="onScroll"&&Ne("scroll",d)}switch(l){case"input":Yt(d),Or(d,y,!0);break;case"textarea":Yt(d),Ae(d);break;case"select":case"option":break;default:typeof y.onClick=="function"&&(d.onclick=va)}d=p,i.updateQueue=d,d!==null&&(i.flags|=4)}else{S=p.nodeType===9?p:p.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=it(l)),n==="http://www.w3.org/1999/xhtml"?l==="script"?(n=S.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof d.is=="string"?n=S.createElement(l,{is:d.is}):(n=S.createElement(l),l==="select"&&(S=n,d.multiple?S.multiple=!0:d.size&&(S.size=d.size))):n=S.createElementNS(n,l),n[yr]=i,n[Vi]=d,ig(n,i,!1,!1),i.stateNode=n;e:{switch(S=pc(l,d),l){case"dialog":Ne("cancel",n),Ne("close",n),p=d;break;case"iframe":case"object":case"embed":Ne("load",n),p=d;break;case"video":case"audio":for(p=0;p<zi.length;p++)Ne(zi[p],n);p=d;break;case"source":Ne("error",n),p=d;break;case"img":case"image":case"link":Ne("error",n),Ne("load",n),p=d;break;case"details":Ne("toggle",n),p=d;break;case"input":Jo(n,d),p=ms(n,d),Ne("invalid",n);break;case"option":p=d;break;case"select":n._wrapperState={wasMultiple:!!d.multiple},p=Z({},d,{value:void 0}),Ne("invalid",n);break;case"textarea":Qo(n,d),p=vs(n,d),Ne("invalid",n);break;default:p=d}fc(l,p),C=p;for(y in C)if(C.hasOwnProperty(y)){var L=C[y];y==="style"?Jh(n,L):y==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&Kh(n,L)):y==="children"?typeof L=="string"?(l!=="textarea"||L!=="")&&xi(n,L):typeof L=="number"&&xi(n,""+L):y!=="suppressContentEditableWarning"&&y!=="suppressHydrationWarning"&&y!=="autoFocus"&&(o.hasOwnProperty(y)?L!=null&&y==="onScroll"&&Ne("scroll",n):L!=null&&A(n,y,L,S))}switch(l){case"input":Yt(n),Or(n,d,!1);break;case"textarea":Yt(n),Ae(n);break;case"option":d.value!=null&&n.setAttribute("value",""+be(d.value));break;case"select":n.multiple=!!d.multiple,y=d.value,y!=null?Xr(n,!!d.multiple,y,!1):d.defaultValue!=null&&Xr(n,!!d.multiple,d.defaultValue,!0);break;default:typeof p.onClick=="function"&&(n.onclick=va)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return ft(i),null;case 6:if(n&&i.stateNode!=null)ag(n,i,n.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(r(166));if(l=zn(Qi.current),zn(vr.current),ka(i)){if(d=i.stateNode,l=i.memoizedProps,d[yr]=i,(y=d.nodeValue!==l)&&(n=jt,n!==null))switch(n.tag){case 3:ya(d.nodeValue,l,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&ya(d.nodeValue,l,(n.mode&1)!==0)}y&&(i.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[yr]=i,i.stateNode=d}return ft(i),null;case 13:if(Me(Fe),d=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(De&&Nt!==null&&(i.mode&1)!==0&&(i.flags&128)===0)up(),js(),i.flags|=98560,y=!1;else if(y=ka(i),d!==null&&d.dehydrated!==null){if(n===null){if(!y)throw Error(r(318));if(y=i.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[yr]=i}else js(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ft(i),y=!1}else tr!==null&&(Wu(tr),tr=null),y=!0;if(!y)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(d=d!==null,d!==(n!==null&&n.memoizedState!==null)&&d&&(i.child.flags|=8192,(i.mode&1)!==0&&(n===null||(Fe.current&1)!==0?Xe===0&&(Xe=3):Ku())),i.updateQueue!==null&&(i.flags|=4),ft(i),null);case 4:return Ds(),Lu(n,i),n===null&&Hi(i.stateNode.containerInfo),ft(i),null;case 10:return au(i.type._context),ft(i),null;case 17:return bt(i.type)&&_a(),ft(i),null;case 19:if(Me(Fe),y=i.memoizedState,y===null)return ft(i),null;if(d=(i.flags&128)!==0,S=y.rendering,S===null)if(d)to(y,!1);else{if(Xe!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(S=Oa(n),S!==null){for(i.flags|=128,to(y,!1),d=S.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),i.subtreeFlags=0,d=l,l=i.child;l!==null;)y=l,n=d,y.flags&=14680066,S=y.alternate,S===null?(y.childLanes=0,y.lanes=n,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=S.childLanes,y.lanes=S.lanes,y.child=S.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=S.memoizedProps,y.memoizedState=S.memoizedState,y.updateQueue=S.updateQueue,y.type=S.type,n=S.dependencies,y.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),l=l.sibling;return Le(Fe,Fe.current&1|2),i.child}n=n.sibling}y.tail!==null&&Ve()>zs&&(i.flags|=128,d=!0,to(y,!1),i.lanes=4194304)}else{if(!d)if(n=Oa(S),n!==null){if(i.flags|=128,d=!0,l=n.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),to(y,!0),y.tail===null&&y.tailMode==="hidden"&&!S.alternate&&!De)return ft(i),null}else 2*Ve()-y.renderingStartTime>zs&&l!==1073741824&&(i.flags|=128,d=!0,to(y,!1),i.lanes=4194304);y.isBackwards?(S.sibling=i.child,i.child=S):(l=y.last,l!==null?l.sibling=S:i.child=S,y.last=S)}return y.tail!==null?(i=y.tail,y.rendering=i,y.tail=i.sibling,y.renderingStartTime=Ve(),i.sibling=null,l=Fe.current,Le(Fe,d?l&1|2:l&1),i):(ft(i),null);case 22:case 23:return qu(),d=i.memoizedState!==null,n!==null&&n.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(Mt&1073741824)!==0&&(ft(i),i.subtreeFlags&6&&(i.flags|=8192)):ft(i),null;case 24:return null;case 25:return null}throw Error(r(156,i.tag))}function ib(n,i){switch(tu(i),i.tag){case 1:return bt(i.type)&&_a(),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ds(),Me(_t),Me(dt),pu(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 5:return hu(i),null;case 13:if(Me(Fe),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(r(340));js()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return Me(Fe),null;case 4:return Ds(),null;case 10:return au(i.type._context),null;case 22:case 23:return qu(),null;case 24:return null;default:return null}}var Fa=!1,pt=!1,ob=typeof WeakSet=="function"?WeakSet:Set,ne=null;function Fs(n,i){var l=n.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){He(n,i,d)}else l.current=null}function ju(n,i,l){try{l()}catch(d){He(n,i,d)}}var lg=!1;function ab(n,i){if(qc=oa,n=Ff(),Dc(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var S=0,C=-1,L=-1,H=0,Q=0,X=n,J=null;t:for(;;){for(var re;X!==l||p!==0&&X.nodeType!==3||(C=S+p),X!==y||d!==0&&X.nodeType!==3||(L=S+d),X.nodeType===3&&(S+=X.nodeValue.length),(re=X.firstChild)!==null;)J=X,X=re;for(;;){if(X===n)break t;if(J===l&&++H===p&&(C=S),J===y&&++Q===d&&(L=S),(re=X.nextSibling)!==null)break;X=J,J=X.parentNode}X=re}l=C===-1||L===-1?null:{start:C,end:L}}else l=null}l=l||{start:0,end:0}}else l=null;for(Kc={focusedElem:n,selectionRange:l},oa=!1,ne=i;ne!==null;)if(i=ne,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,ne=n;else for(;ne!==null;){i=ne;try{var se=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(se!==null){var oe=se.memoizedProps,qe=se.memoizedState,U=i.stateNode,N=U.getSnapshotBeforeUpdate(i.elementType===i.type?oe:rr(i.type,oe),qe);U.__reactInternalSnapshotBeforeUpdate=N}break;case 3:var B=i.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;
vendor: 4,384 bytes, line 9
9case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ee){He(i,i.return,ee)}if(n=i.sibling,n!==null){n.return=i.return,ne=n;break}ne=i.return}return se=lg,lg=!1,se}function ro(n,i,l){var d=i.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var p=d=d.next;do{if((p.tag&n)===n){var y=p.destroy;p.destroy=void 0,y!==void 0&&ju(i,l,y)}p=p.next}while(p!==d)}}function Ba(n,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&n)===n){var d=l.create;l.destroy=d()}l=l.next}while(l!==i)}}function Nu(n){var i=n.ref;if(i!==null){var l=n.stateNode;n.tag,n=l,typeof i=="function"?i(n):i.current=n}}function cg(n){var i=n.alternate;i!==null&&(n.alternate=null,cg(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&(delete i[yr],delete i[Vi],delete i[Yc],delete i[H_],delete i[W_])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function ug(n){return n.tag===5||n.tag===3||n.tag===4}function dg(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||ug(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Mu(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(n,i):l.insertBefore(n,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(n,l)):(i=l,i.appendChild(n)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=va));else if(d!==4&&(n=n.child,n!==null))for(Mu(n,i,l),n=n.sibling;n!==null;)Mu(n,i,l),n=n.sibling}function $u(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(d!==4&&(n=n.child,n!==null))for($u(n,i,l),n=n.sibling;n!==null;)$u(n,i,l),n=n.sibling}var ot=null,nr=!1;function hn(n,i,l){for(l=l.child;l!==null;)hg(n,i,l),l=l.sibling}function hg(n,i,l){if(mr&&typeof mr.onCommitFiberUnmount=="function")try{mr.onCommitFiberUnmount(ea,l)}catch{}switch(l.tag){case 5:pt||Fs(l,i);case 6:var d=ot,p=nr;ot=null,hn(n,i,l),ot=d,nr=p,ot!==null&&(nr?(n=ot,l=l.stateNode,n.nodeType===8?n.parentNode.removeChild(l):n.removeChild(l)):ot.removeChild(l.stateNode));break;case 18:ot!==null&&(nr?(n=ot,l=l.stateNode,n.nodeType===8?Qc(n.parentNode,l):n.nodeType===1&&Qc(n,l),ji(n)):Qc(ot,l.stateNode));break;case 4:d=ot,p=nr,ot=l.stateNode.containerInfo,nr=!0,hn(n,i,l),ot=d,nr=p;break;case 0:case 11:case 14:case 15:if(!pt&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){p=d=d.next;do{var y=p,S=y.destroy;y=y.tag,S!==void 0&&((y&2)!==0||(y&4)!==0)&&ju(l,i,S),p=p.next}while(p!==d)}hn(n,i,l);break;case 1:if(!pt&&(Fs(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(C){He(l,i,C)}hn(n,i,l);break;case 21:hn(n,i,l);break;case 22:l.mode&1?(pt=(d=pt)||l.memoizedState!==null,hn(n,i,l),pt=d):hn(n,i,l);break;default:hn(n,i,l)}}function fg(n){var i=n.updateQueue;if(i!==null){n.updateQueue=null;var l=n.stateNode;l===null&&(l=n.stateNode=new ob),i.forEach(function(d){var p=mb.bind(null,n,d);l.has(d)||(l.add(d),d.then(p,p))})}}function sr(n,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];try{var y=n,S=i,C=S;e:for(;C!==null;){switch(C.tag){case 5:ot=C.stateNode,nr=!1;break e;case 3:ot=C.stateNode.containerInfo,nr=!0;break e;case 4:ot=C.stateNode.containerInfo,nr=!0;break e}C=C.return}if(ot===null)throw Error(r(160));hg(y,S,p),ot=null,nr=!1;var L=p.alternate;L!==null&&(L.return=null),p.return=null}catch(H){He(p,i,H)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)pg(i,n),i=i.sibling}function pg(n,i){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(sr(i,n),_r(n),d&4){try{ro(3,n,n.return),Ba(3,n)}catch(oe){He(n,n.return,oe)}try{ro(5,n,n.return)}catch(oe){He(n,n.return,oe)}}break;case 1:sr(i,n),_r(n),d&512&&l!==null&&Fs(l,l.return);break;case 5:if(sr(i,n),_r(n),d&512&&l!==null&&Fs(l,l.return),n.flags&32){var p=n.stateNode;try{xi(p,"")}catch(oe){He(n,n.return,oe)}}if(d&4&&(p=n.stateNode,p!=null)){var y=n.memoizedProps,S=l!==null?l.memoizedProps:y,C=n.type,L=n.updateQueue;if(n.updateQueue=null,L!==null)try{C==="input"&&y.type==="radio"&&y.name!=null&&bi(p,y),pc(C,S);
vendor: 12,013 bytes, line 9
9var H=pc(C,y);for(S=0;S<L.length;S+=2){var Q=L[S],X=L[S+1];Q==="style"?Jh(p,X):Q==="dangerouslySetInnerHTML"?Kh(p,X):Q==="children"?xi(p,X):A(p,Q,X,H)}switch(C){case"input":ys(p,y);break;case"textarea":Si(p,y);break;case"select":var J=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!y.multiple;var re=y.value;re!=null?Xr(p,!!y.multiple,re,!1):J!==!!y.multiple&&(y.defaultValue!=null?Xr(p,!!y.multiple,y.defaultValue,!0):Xr(p,!!y.multiple,y.multiple?[]:"",!1))}p[Vi]=y}catch(oe){He(n,n.return,oe)}}break;case 6:if(sr(i,n),_r(n),d&4){if(n.stateNode===null)throw Error(r(162));p=n.stateNode,y=n.memoizedProps;try{p.nodeValue=y}catch(oe){He(n,n.return,oe)}}break;case 3:if(sr(i,n),_r(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{ji(i.containerInfo)}catch(oe){He(n,n.return,oe)}break;case 4:sr(i,n),_r(n);break;case 13:sr(i,n),_r(n),p=n.child,p.flags&8192&&(y=p.memoizedState!==null,p.stateNode.isHidden=y,!y||p.alternate!==null&&p.alternate.memoizedState!==null||(Fu=Ve())),d&4&&fg(n);break;case 22:if(Q=l!==null&&l.memoizedState!==null,n.mode&1?(pt=(H=pt)||Q,sr(i,n),pt=H):sr(i,n),_r(n),d&8192){if(H=n.memoizedState!==null,(n.stateNode.isHidden=H)&&!Q&&(n.mode&1)!==0)for(ne=n,Q=n.child;Q!==null;){for(X=ne=Q;ne!==null;){switch(J=ne,re=J.child,J.tag){case 0:case 11:case 14:case 15:ro(4,J,J.return);break;case 1:Fs(J,J.return);var se=J.stateNode;if(typeof se.componentWillUnmount=="function"){d=J,l=J.return;try{i=d,se.props=i.memoizedProps,se.state=i.memoizedState,se.componentWillUnmount()}catch(oe){He(d,l,oe)}}break;case 5:Fs(J,J.return);break;case 22:if(J.memoizedState!==null){yg(X);continue}}re!==null?(re.return=J,ne=re):yg(X)}Q=Q.sibling}e:for(Q=null,X=n;;){if(X.tag===5){if(Q===null){Q=X;try{p=X.stateNode,H?(y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none"):(C=X.stateNode,L=X.memoizedProps.style,S=L!=null&&L.hasOwnProperty("display")?L.display:null,C.style.display=Gh("display",S))}catch(oe){He(n,n.return,oe)}}}else if(X.tag===6){if(Q===null)try{X.stateNode.nodeValue=H?"":X.memoizedProps}catch(oe){He(n,n.return,oe)}}else if((X.tag!==22&&X.tag!==23||X.memoizedState===null||X===n)&&X.child!==null){X.child.return=X,X=X.child;continue}if(X===n)break e;for(;X.sibling===null;){if(X.return===null||X.return===n)break e;Q===X&&(Q=null),X=X.return}Q===X&&(Q=null),X.sibling.return=X.return,X=X.sibling}}break;case 19:sr(i,n),_r(n),d&4&&fg(n);break;case 21:break;default:sr(i,n),_r(n)}}function _r(n){var i=n.flags;if(i&2){try{e:{for(var l=n.return;l!==null;){if(ug(l)){var d=l;break e}l=l.return}throw Error(r(160))}switch(d.tag){case 5:var p=d.stateNode;d.flags&32&&(xi(p,""),d.flags&=-33);var y=dg(n);$u(n,y,p);break;case 3:case 4:var S=d.stateNode.containerInfo,C=dg(n);Mu(n,C,S);break;default:throw Error(r(161))}}catch(L){He(n,n.return,L)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function lb(n,i,l){ne=n,gg(n)}function gg(n,i,l){for(var d=(n.mode&1)!==0;ne!==null;){var p=ne,y=p.child;if(p.tag===22&&d){var S=p.memoizedState!==null||Fa;if(!S){var C=p.alternate,L=C!==null&&C.memoizedState!==null||pt;C=Fa;var H=pt;if(Fa=S,(pt=L)&&!H)for(ne=p;ne!==null;)S=ne,L=S.child,S.tag===22&&S.memoizedState!==null?vg(p):L!==null?(L.return=S,ne=L):vg(p);for(;y!==null;)ne=y,gg(y),y=y.sibling;ne=p,Fa=C,pt=H}mg(n)}else(p.subtreeFlags&8772)!==0&&y!==null?(y.return=p,ne=y):mg(n)}}function mg(n){for(;ne!==null;){var i=ne;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:pt||Ba(5,i);break;case 1:var d=i.stateNode;if(i.flags&4&&!pt)if(l===null)d.componentDidMount();else{var p=i.elementType===i.type?l.memoizedProps:rr(i.type,l.memoizedProps);d.componentDidUpdate(p,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var y=i.updateQueue;y!==null&&yp(i,y,d);break;case 3:var S=i.updateQueue;if(S!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}yp(i,S,l)}break;case 5:var C=i.stateNode;if(l===null&&i.flags&4){l=C;var L=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&l.focus();break;case"img":L.src&&(l.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var H=i.alternate;if(H!==null){var Q=H.memoizedState;if(Q!==null){var X=Q.dehydrated;X!==null&&ji(X)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}pt||i.flags&512&&Nu(i)}catch(J){He(i,i.return,J)}}if(i===n){ne=null;break}if(l=i.sibling,l!==null){l.return=i.return,ne=l;break}ne=i.return}}function yg(n){for(;ne!==null;){var i=ne;if(i===n){ne=null;break}var l=i.sibling;if(l!==null){l.return=i.return,ne=l;break}ne=i.return}}function vg(n){for(;ne!==null;){var i=ne;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{Ba(4,i)}catch(L){He(i,l,L)}break;case 1:var d=i.stateNode;if(typeof d.componentDidMount=="function"){var p=i.return;try{d.componentDidMount()}catch(L){He(i,p,L)}}var y=i.return;try{Nu(i)}catch(L){He(i,y,L)}break;case 5:var S=i.return;try{Nu(i)}catch(L){He(i,S,L)}}}catch(L){He(i,i.return,L)}if(i===n){ne=null;break}var C=i.sibling;if(C!==null){C.return=i.return,ne=C;break}ne=i.return}}var cb=Math.ceil,za=I.ReactCurrentDispatcher,Du=I.ReactCurrentOwner,Gt=I.ReactCurrentBatchConfig,ke=0,rt=null,Ke=null,at=0,Mt=0,Bs=an(0),Xe=0,no=null,Wn=0,Ha=0,Uu=0,so=null,xt=null,Fu=0,zs=1/0,Ur=null,Wa=!1,Bu=null,fn=null,Va=!1,pn=null,qa=0,io=0,zu=null,Ka=-1,Ga=0;function yt(){return(ke&6)!==0?Ve():Ka!==-1?Ka:Ka=Ve()}function gn(n){return(n.mode&1)===0?1:(ke&2)!==0&&at!==0?at&-at:q_.transition!==null?(Ga===0&&(Ga=df()),Ga):(n=Pe,n!==0||(n=window.event,n=n===void 0?16:_f(n.type)),n)}function ir(n,i,l,d){if(50<io)throw io=0,zu=null,Error(r(185));Pi(n,l,d),((ke&2)===0||n!==rt)&&(n===rt&&((ke&2)===0&&(Ha|=l),Xe===4&&mn(n,at)),Et(n,d),l===1&&ke===0&&(i.mode&1)===0&&(zs=Ve()+500,Sa&&cn()))}function Et(n,i){var l=n.callbackNode;q0(n,i);var d=na(n,n===rt?at:0);if(d===0)l!==null&&lf(l),n.callbackNode=null,n.callbackPriority=0;else if(i=d&-d,n.callbackPriority!==i){if(l!=null&&lf(l),i===1)n.tag===0?V_(_g.bind(null,n)):ip(_g.bind(null,n)),B_(function(){(ke&6)===0&&cn()}),l=null;else{switch(hf(d)){case 1:l=bc;break;case 4:l=cf;break;case 16:l=Zo;break;case 536870912:l=uf;break;default:l=Zo}l=Tg(l,wg.bind(null,n))}n.callbackPriority=i,n.callbackNode=l}}function wg(n,i){if(Ka=-1,Ga=0,(ke&6)!==0)throw Error(r(327));var l=n.callbackNode;if(Hs()&&n.callbackNode!==l)return null;var d=na(n,n===rt?at:0);if(d===0)return null;if((d&30)!==0||(d&n.expiredLanes)!==0||i)i=Ja(n,d);else{i=d;var p=ke;ke|=2;var y=Sg();(rt!==n||at!==i)&&(Ur=null,zs=Ve()+500,qn(n,i));do try{hb();break}catch(C){bg(n,C)}while(!0);ou(),za.current=y,ke=p,Ke!==null?i=0:(rt=null,at=0,i=Xe)}if(i!==0){if(i===2&&(p=Sc(n),p!==0&&(d=p,i=Hu(n,p))),i===1)throw l=no,qn(n,0),mn(n,d),Et(n,Ve()),l;if(i===6)mn(n,d);else{if(p=n.current.alternate,(d&30)===0&&!ub(p)&&(i=Ja(n,d),i===2&&(y=Sc(n),y!==0&&(d=y,i=Hu(n,y))),i===1))throw l=no,qn(n,0),mn(n,d),Et(n,Ve()),l;switch(n.finishedWork=p,n.finishedLanes=d,i){case 0:case 1:throw Error(r(345));case 2:Kn(n,xt,Ur);break;case 3:if(mn(n,d),(d&130023424)===d&&(i=Fu+500-Ve(),10<i)){if(na(n,0)!==0)break;if(p=n.suspendedLanes,(p&d)!==d){yt(),n.pingedLanes|=n.suspendedLanes&p;break}n.timeoutHandle=Jc(Kn.bind(null,n,xt,Ur),i);break}Kn(n,xt,Ur);break;case 4:if(mn(n,d),(d&4194240)===d)break;for(i=n.eventTimes,p=-1;0<d;){var S=31-Zt(d);y=1<<S,S=i[S],S>p&&(p=S),d&=~y}if(d=p,d=Ve()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*cb(d/1960))-d,10<d){n.timeoutHandle=Jc(Kn.bind(null,n,xt,Ur),d);break}Kn(n,xt,Ur);break;case 5:Kn(n,xt,Ur);break;default:throw Error(r(329))}}}return Et(n,Ve()),n.callbackNode===l?wg.bind(null,n):null}function Hu(n,i){var l=so;return n.current.memoizedState.isDehydrated&&(qn(n,i).flags|=256),n=Ja(n,i),n!==2&&(i=xt,xt=l,i!==null&&Wu(i)),n}function Wu(n){xt===null?xt=n:xt.push.apply(xt,n)}function ub(n){for(var i=n;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var p=l[d],y=p.getSnapshot;p=p.value;try{if(!er(y(),p))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function mn(n,i){for(i&=~Uu,i&=~Ha,n.suspendedLanes|=i,n.pingedLanes&=~i,n=n.expirationTimes;0<i;){var l=31-Zt(i),d=1<<l;n[l]=-1,i&=~d}}function _g(n){if((ke&6)!==0)throw Error(r(327));Hs();var i=na(n,0);if((i&1)===0)return Et(n,Ve()),null;var l=Ja(n,i);if(n.tag!==0&&l===2){var d=Sc(n);d!==0&&(i=d,l=Hu(n,d))}if(l===1)throw l=no,qn(n,0),mn(n,i),Et(n,Ve()),l;if(l===6)throw Error(r(345));return n.finishedWork=n.current.alternate,n.finishedLanes=i,Kn(n,xt,Ur),Et(n,Ve()),null}function Vu(n,i){var l=ke;ke|=1;try{return n(i)}finally{ke=l,ke===0&&(zs=Ve()+500,Sa&&cn())}}function Vn(n){pn!==null&&pn.tag===0&&(ke&6)===0&&Hs();var i=ke;ke|=1;var l=Gt.transition,d=Pe;try{if(Gt.transition=null,Pe=1,n)return n()}finally{Pe=d,Gt.transition=l,ke=i,(ke&6)===0&&cn()}}function qu(){Mt=Bs.current,Me(Bs)}function qn(n,i){n.finishedWork=null,n.finishedLanes=0;var l=n.timeoutHandle;if(l!==-1&&(n.timeoutHandle=-1,F_(l)),Ke!==null)for(l=Ke.return;l!==null;){var d=l;switch(tu(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&_a();break;case 3:Ds(),Me(_t),Me(dt),pu();break;case 5:hu(d);break;case 4:Ds();break;case 13:Me(Fe);break;case 19:Me(Fe);break;case 10:au(d.type._context);break;case 22:case 23:qu()}l=l.return}if(rt=n,Ke=n=yn(n.current,null),at=Mt=i,Xe=0,no=null,Uu=Ha=Wn=0,xt=so=null,Bn!==null){for(i=0;i<Bn.length;i++)if(l=Bn[i],d=l.interleaved,d!==null){l.interleaved=null;var p=d.next,y=l.pending;if(y!==null){var S=y.next;y.next=p,d.next=S}l.pending=d}Bn=null}return n}function bg(n,i){do{var l=Ke;try{if(ou(),Ia.current=Ma,La){for(var d=Be.memoizedState;d!==null;){var p=d.queue;p!==null&&(p.pending=null),d=d.next}La=!1}if(Hn=0,tt=Ye=Be=null,Yi=!1,Xi=0,Du.current=null,l===null||l.return===null){Xe=1,no=i,Ke=null;break}e:{var y=n,S=l.return,C=l,L=i;if(i=at,C.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var H=L,Q=C,X=Q.tag;if((Q.mode&1)===0&&(X===0||X===11||X===15)){var J=Q.alternate;J?(Q.updateQueue=J.updateQueue,Q.memoizedState=J.memoizedState,Q.lanes=J.lanes):(Q.updateQueue=null,Q.memoizedState=null)}var re=qp(S);if(re!==null){re.flags&=-257,Kp(re,S,C,y,i),re.mode&1&&Vp(y,H,i),i=re,L=H;var se=i.updateQueue;if(se===null){var oe=new Set;oe.add(L),i.updateQueue=oe}else se.add(L);break e}else{if((i&1)===0){Vp(y,H,i),Ku();break e}L=Error(r(426))}}else if(De&&C.mode&1){var qe=qp(S);if(qe!==null){(qe.flags&65536)===0&&(qe.flags|=256),Kp(qe,S,C,y,i),su(Us(L,C));break e}}y=L=Us(L,C),Xe!==4&&(Xe=2),so===null?so=[y]:so.push(y),y=S;do{switch(y.tag){case 3:y.flags|=65536,i&=-i,y.lanes|=i;var U=Hp(y,L,i);mp(y,U);break e;case 1:C=L;var N=y.type,B=y.stateNode;if((y.flags&128)===0&&(typeof N.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(fn===null||!fn.has(B)))){y.flags|=65536,i&=-i,y.lanes|=i;var ee=Wp(y,C,i);mp(y,ee);break e}}y=y.return}while(y!==null)}Eg(l)}catch(le){i=le,Ke===l&&l!==null&&(Ke=l=l.return);continue}break}while(!0)}function Sg(){var n=za.current;return za.current=Ma,n===null?Ma:n}function Ku(){(Xe===0||Xe===3||Xe===2)&&(Xe=4),rt===null||(Wn&268435455)===0&&(Ha&268435455)===0||mn(rt,at)}function Ja(n,i){var l=ke;ke|=2;var d=Sg();(rt!==n||at!==i)&&(Ur=null,qn(n,i));do try{db();break}catch(p){bg(n,p)}while(!0);if(ou(),ke=l,za.current=d,Ke!==null)throw Error(r(261));return rt=null,at=0,Xe}function db(){for(;Ke!==null;)xg(Ke)}function hb(){for(;Ke!==null&&!$0();)xg(Ke)}function xg(n){var i=Cg(n.alternate,n,Mt);n.memoizedProps=n.pendingProps,i===null?Eg(n):Ke=i,Du.current=null}function Eg(n){var i=n;do{var l=i.alternate;if(n=i.return,(i.flags&32768)===0){if(l=sb(l,i,Mt),l!==null){Ke=l;return}}else{if(l=ib(l,i),l!==null){l.flags&=32767,Ke=l;return}
vendor: 5,661 bytes, line 9
9if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{Xe=6,Ke=null;return}}if(i=i.sibling,i!==null){Ke=i;return}Ke=i=n}while(i!==null);Xe===0&&(Xe=5)}function Kn(n,i,l){var d=Pe,p=Gt.transition;try{Gt.transition=null,Pe=1,fb(n,i,l,d)}finally{Gt.transition=p,Pe=d}return null}function fb(n,i,l,d){do Hs();while(pn!==null);if((ke&6)!==0)throw Error(r(327));l=n.finishedWork;var p=n.finishedLanes;if(l===null)return null;if(n.finishedWork=null,n.finishedLanes=0,l===n.current)throw Error(r(177));n.callbackNode=null,n.callbackPriority=0;var y=l.lanes|l.childLanes;if(K0(n,y),n===rt&&(Ke=rt=null,at=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Va||(Va=!0,Tg(Zo,function(){return Hs(),null})),y=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||y){y=Gt.transition,Gt.transition=null;var S=Pe;Pe=1;var C=ke;ke|=4,Du.current=null,ab(n,l),pg(l,n),L_(Kc),oa=!!qc,Kc=qc=null,n.current=l,lb(l),D0(),ke=C,Pe=S,Gt.transition=y}else n.current=l;if(Va&&(Va=!1,pn=n,qa=p),y=n.pendingLanes,y===0&&(fn=null),B0(l.stateNode),Et(n,Ve()),i!==null)for(d=n.onRecoverableError,l=0;l<i.length;l++)p=i[l],d(p.value,{componentStack:p.stack,digest:p.digest});if(Wa)throw Wa=!1,n=Bu,Bu=null,n;return(qa&1)!==0&&n.tag!==0&&Hs(),y=n.pendingLanes,(y&1)!==0?n===zu?io++:(io=0,zu=n):io=0,cn(),null}function Hs(){if(pn!==null){var n=hf(qa),i=Gt.transition,l=Pe;try{if(Gt.transition=null,Pe=16>n?16:n,pn===null)var d=!1;else{if(n=pn,pn=null,qa=0,(ke&6)!==0)throw Error(r(331));var p=ke;for(ke|=4,ne=n.current;ne!==null;){var y=ne,S=y.child;if((ne.flags&16)!==0){var C=y.deletions;if(C!==null){for(var L=0;L<C.length;L++){var H=C[L];for(ne=H;ne!==null;){var Q=ne;switch(Q.tag){case 0:case 11:case 15:ro(8,Q,y)}var X=Q.child;if(X!==null)X.return=Q,ne=X;else for(;ne!==null;){Q=ne;var J=Q.sibling,re=Q.return;if(cg(Q),Q===H){ne=null;break}if(J!==null){J.return=re,ne=J;break}ne=re}}}var se=y.alternate;if(se!==null){var oe=se.child;if(oe!==null){se.child=null;do{var qe=oe.sibling;oe.sibling=null,oe=qe}while(oe!==null)}}ne=y}}if((y.subtreeFlags&2064)!==0&&S!==null)S.return=y,ne=S;else e:for(;ne!==null;){if(y=ne,(y.flags&2048)!==0)switch(y.tag){case 0:case 11:case 15:ro(9,y,y.return)}var U=y.sibling;if(U!==null){U.return=y.return,ne=U;break e}ne=y.return}}var N=n.current;for(ne=N;ne!==null;){S=ne;var B=S.child;if((S.subtreeFlags&2064)!==0&&B!==null)B.return=S,ne=B;else e:for(S=N;ne!==null;){if(C=ne,(C.flags&2048)!==0)try{switch(C.tag){case 0:case 11:case 15:Ba(9,C)}}catch(le){He(C,C.return,le)}if(C===S){ne=null;break e}var ee=C.sibling;if(ee!==null){ee.return=C.return,ne=ee;break e}ne=C.return}}if(ke=p,cn(),mr&&typeof mr.onPostCommitFiberRoot=="function")try{mr.onPostCommitFiberRoot(ea,n)}catch{}d=!0}return d}finally{Pe=l,Gt.transition=i}}return!1}function kg(n,i,l){i=Us(l,i),i=Hp(n,i,1),n=dn(n,i,1),i=yt(),n!==null&&(Pi(n,1,i),Et(n,i))}function He(n,i,l){if(n.tag===3)kg(n,n,l);else for(;i!==null;){if(i.tag===3){kg(i,n,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(fn===null||!fn.has(d))){n=Us(l,n),n=Wp(i,n,1),i=dn(i,n,1),n=yt(),i!==null&&(Pi(i,1,n),Et(i,n));break}}i=i.return}}function pb(n,i,l){var d=n.pingCache;d!==null&&d.delete(i),i=yt(),n.pingedLanes|=n.suspendedLanes&l,rt===n&&(at&l)===l&&(Xe===4||Xe===3&&(at&130023424)===at&&500>Ve()-Fu?qn(n,0):Uu|=l),Et(n,i)}function Rg(n,i){i===0&&((n.mode&1)===0?i=1:(i=ra,ra<<=1,(ra&130023424)===0&&(ra=4194304)));var l=yt();n=Mr(n,i),n!==null&&(Pi(n,i,l),Et(n,l))}function gb(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),Rg(n,l)}function mb(n,i){var l=0;switch(n.tag){case 13:var d=n.stateNode,p=n.memoizedState;p!==null&&(l=p.retryLane);break;case 19:d=n.stateNode;break;default:throw Error(r(314))}d!==null&&d.delete(i),Rg(n,l)}var Cg;Cg=function(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps||_t.current)St=!0;else{if((n.lanes&l)===0&&(i.flags&128)===0)return St=!1,nb(n,i,l);St=(n.flags&131072)!==0}else St=!1,De&&(i.flags&1048576)!==0&&op(i,Ea,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;Ua(n,i),n=i.pendingProps;var p=Os(i,dt.current);$s(i,l),p=yu(null,i,d,n,p,l);var y=vu();return i.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,bt(d)?(y=!0,ba(i)):y=!1,i.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,uu(i),p.updater=$a,i.stateNode=p,p._reactInternals=i,Eu(i,d,n,l),i=Tu(null,i,d,!0,y,l)):(i.tag=0,De&&y&&eu(i),mt(null,i,p,l),i=i.child),i;case 16:d=i.elementType;e:{switch(Ua(n,i),n=i.pendingProps,p=d._init,d=p(d._payload),i.type=d,p=i.tag=vb(d),n=rr(d,n),p){case 0:i=Cu(null,i,d,n,l);break e;case 1:i=Zp(null,i,d,n,l);break e;case 11:i=Gp(null,i,d,n,l);break e;case 14:i=Jp(null,i,d,rr(d.type,n),l);break e}throw Error(r(306,d,""))}return i;case 0:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:rr(d,p),Cu(n,i,d,p,l);case 1:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:rr(d,p),Zp(n,i,d,p,l);case 3:e:{if(eg(i),n===null)throw Error(r(387));d=i.pendingProps,y=i.memoizedState,p=y.element,gp(n,i),Aa(i,d,null,l);var S=i.memoizedState;if(d=S.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){p=Us(Error(r(423)),i),i=tg(n,i,d,l,p);break e}else if(d!==p){p=Us(Error(r(424)),i),i=tg(n,i,d,l,p);break e}else for(Nt=on(i.stateNode.containerInfo.firstChild),jt=i,De=!0,tr=null,l=fp(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(js(),d===p){i=Dr(n,i,l);break e}mt(n,i,d,l)}i=i.child}return i;
vendor: 5,279 bytes, line 9
9case 5:return vp(i),n===null&&nu(i),d=i.type,p=i.pendingProps,y=n!==null?n.memoizedProps:null,S=p.children,Gc(d,p)?S=null:y!==null&&Gc(d,y)&&(i.flags|=32),Xp(n,i),mt(n,i,S,l),i.child;case 6:return n===null&&nu(i),null;case 13:return rg(n,i,l);case 4:return du(i,i.stateNode.containerInfo),d=i.pendingProps,n===null?i.child=Ns(i,null,d,l):mt(n,i,d,l),i.child;case 11:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:rr(d,p),Gp(n,i,d,p,l);case 7:return mt(n,i,i.pendingProps,l),i.child;case 8:return mt(n,i,i.pendingProps.children,l),i.child;case 12:return mt(n,i,i.pendingProps.children,l),i.child;case 10:e:{if(d=i.type._context,p=i.pendingProps,y=i.memoizedProps,S=p.value,Le(Ca,d._currentValue),d._currentValue=S,y!==null)if(er(y.value,S)){if(y.children===p.children&&!_t.current){i=Dr(n,i,l);break e}}else for(y=i.child,y!==null&&(y.return=i);y!==null;){var C=y.dependencies;if(C!==null){S=y.child;for(var L=C.firstContext;L!==null;){if(L.context===d){if(y.tag===1){L=$r(-1,l&-l),L.tag=2;var H=y.updateQueue;if(H!==null){H=H.shared;var Q=H.pending;Q===null?L.next=L:(L.next=Q.next,Q.next=L),H.pending=L}}y.lanes|=l,L=y.alternate,L!==null&&(L.lanes|=l),lu(y.return,l,i),C.lanes|=l;break}L=L.next}}else if(y.tag===10)S=y.type===i.type?null:y.child;else if(y.tag===18){if(S=y.return,S===null)throw Error(r(341));S.lanes|=l,C=S.alternate,C!==null&&(C.lanes|=l),lu(S,l,i),S=y.sibling}else S=y.child;if(S!==null)S.return=y;else for(S=y;S!==null;){if(S===i){S=null;break}if(y=S.sibling,y!==null){y.return=S.return,S=y;break}S=S.return}y=S}mt(n,i,p.children,l),i=i.child}return i;case 9:return p=i.type,d=i.pendingProps.children,$s(i,l),p=qt(p),d=d(p),i.flags|=1,mt(n,i,d,l),i.child;case 14:return d=i.type,p=rr(d,i.pendingProps),p=rr(d.type,p),Jp(n,i,d,p,l);case 15:return Qp(n,i,i.type,i.pendingProps,l);case 17:return d=i.type,p=i.pendingProps,p=i.elementType===d?p:rr(d,p),Ua(n,i),i.tag=1,bt(d)?(n=!0,ba(i)):n=!1,$s(i,l),Bp(i,d,p),Eu(i,d,p,l),Tu(null,i,d,!0,n,l);case 19:return sg(n,i,l);case 22:return Yp(n,i,l)}throw Error(r(156,i.tag))};function Tg(n,i){return af(n,i)}function yb(n,i,l,d){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(n,i,l,d){return new yb(n,i,l,d)}function Gu(n){return n=n.prototype,!(!n||!n.isReactComponent)}function vb(n){if(typeof n=="function")return Gu(n)?1:0;if(n!=null){if(n=n.$$typeof,n===G)return 11;if(n===we)return 14}return 2}function yn(n,i){var l=n.alternate;return l===null?(l=Jt(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&14680064,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l}function Qa(n,i,l,d,p,y){var S=2;if(d=n,typeof n=="function")Gu(n)&&(S=1);else if(typeof n=="string")S=5;else e:switch(n){case M:return Gn(l.children,p,y,i);case z:S=8,p|=8;break;case V:return n=Jt(12,l,i,p|2),n.elementType=V,n.lanes=y,n;case ae:return n=Jt(13,l,i,p),n.elementType=ae,n.lanes=y,n;case ce:return n=Jt(19,l,i,p),n.elementType=ce,n.lanes=y,n;case W:return Ya(l,p,y,i);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case K:S=10;break e;case te:S=9;break e;case G:S=11;break e;case we:S=14;break e;case pe:S=16,d=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return i=Jt(S,l,i,p),i.elementType=n,i.type=d,i.lanes=y,i}function Gn(n,i,l,d){return n=Jt(7,n,d,i),n.lanes=l,n}function Ya(n,i,l,d){return n=Jt(22,n,d,i),n.elementType=W,n.lanes=l,n.stateNode={isHidden:!1},n}function Ju(n,i,l){return n=Jt(6,n,null,i),n.lanes=l,n}function Qu(n,i,l){return i=Jt(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}function wb(n,i,l,d,p){this.tag=i,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xc(0),this.expirationTimes=xc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xc(0),this.identifierPrefix=d,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Yu(n,i,l,d,p,y,S,C,L){return n=new wb(n,i,l,C,L),i===1?(i=1,y===!0&&(i|=8)):i=0,y=Jt(3,null,null,i),n.current=y,y.stateNode=n,y.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},uu(y),n}function _b(n,i,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:F,key:d==null?null:""+d,children:n,containerInfo:i,implementation:l}}function Pg(n){if(!n)return ln;n=n._reactInternals;
vendor: 4,402 bytes, line 9
9e:{if(Mn(n)!==n||n.tag!==1)throw Error(r(170));var i=n;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(bt(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(r(171))}if(n.tag===1){var l=n.type;if(bt(l))return np(n,l,i)}return i}function Ag(n,i,l,d,p,y,S,C,L){return n=Yu(l,d,!0,n,p,y,S,C,L),n.context=Pg(null),l=n.current,d=yt(),p=gn(l),y=$r(d,p),y.callback=i??null,dn(l,y,p),n.current.lanes=p,Pi(n,p,d),Et(n,d),n}function Xa(n,i,l,d){var p=i.current,y=yt(),S=gn(p);return l=Pg(l),i.context===null?i.context=l:i.pendingContext=l,i=$r(y,S),i.payload={element:n},d=d===void 0?null:d,d!==null&&(i.callback=d),n=dn(p,i,S),n!==null&&(ir(n,p,S,y),Pa(n,p,S)),S}function Za(n){return n=n.current,n.child?(n.child.tag===5,n.child.stateNode):null}function Og(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function Xu(n,i){Og(n,i),(n=n.alternate)&&Og(n,i)}function bb(){return null}var Ig=typeof reportError=="function"?reportError:function(n){console.error(n)};function Zu(n){this._internalRoot=n}el.prototype.render=Zu.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(r(409));Xa(n,i,null,null)},el.prototype.unmount=Zu.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Vn(function(){Xa(null,n,null,null)}),i[Ir]=null}};function el(n){this._internalRoot=n}el.prototype.unstable_scheduleHydration=function(n){if(n){var i=gf();n={blockedOn:null,target:n,priority:i};for(var l=0;l<rn.length&&i!==0&&i<rn[l].priority;l++);rn.splice(l,0,n),l===0&&vf(n)}};function ed(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function tl(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function Lg(){}function Sb(n,i,l,d,p){if(p){if(typeof d=="function"){var y=d;d=function(){var H=Za(S);y.call(H)}}var S=Ag(i,d,n,0,null,!1,!1,"",Lg);return n._reactRootContainer=S,n[Ir]=S.current,Hi(n.nodeType===8?n.parentNode:n),Vn(),S}for(;p=n.lastChild;)n.removeChild(p);if(typeof d=="function"){var C=d;d=function(){var H=Za(L);C.call(H)}}var L=Yu(n,0,!1,null,null,!1,!1,"",Lg);return n._reactRootContainer=L,n[Ir]=L.current,Hi(n.nodeType===8?n.parentNode:n),Vn(function(){Xa(i,L,l,d)}),L}function rl(n,i,l,d,p){var y=l._reactRootContainer;if(y){var S=y;if(typeof p=="function"){var C=p;p=function(){var L=Za(S);C.call(L)}}Xa(i,S,n,p)}else S=Sb(l,i,n,p,d);return Za(S)}ff=function(n){switch(n.tag){case 3:var i=n.stateNode;if(i.current.memoizedState.isDehydrated){var l=Ti(i.pendingLanes);l!==0&&(Ec(i,l|1),Et(i,Ve()),(ke&6)===0&&(zs=Ve()+500,cn()))}break;case 13:Vn(function(){var d=Mr(n,1);if(d!==null){var p=yt();ir(d,n,1,p)}}),Xu(n,1)}},kc=function(n){if(n.tag===13){var i=Mr(n,134217728);if(i!==null){var l=yt();ir(i,n,134217728,l)}Xu(n,134217728)}},pf=function(n){if(n.tag===13){var i=gn(n),l=Mr(n,i);if(l!==null){var d=yt();ir(l,n,i,d)}Xu(n,i)}},gf=function(){return Pe},mf=function(n,i){var l=Pe;try{return Pe=n,i()}finally{Pe=l}},yc=function(n,i,l){switch(i){case"input":if(ys(n,l),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==n&&d.form===n.form){var p=wa(d);if(!p)throw Error(r(90));Ar(d),ys(d,p)}}}break;case"textarea":Si(n,l);break;case"select":i=l.value,i!=null&&Xr(n,!!l.multiple,i,!1)}},Zh=Vu,ef=Vn;var xb={usingClientEntryPoint:!1,Events:[qi,Ps,wa,Yh,Xh,Vu]},oo={findFiberByHostInstance:$n,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Eb={bundleType:oo.bundleType,version:oo.version,rendererPackageName:oo.rendererPackageName,rendererConfig:oo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=sf(n),n===null?null:n.stateNode},findFiberByHostInstance:oo.findFiberByHostInstance||bb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
9if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nl.isDisabled&&nl.supportsFiber)try{ea=nl.inject(Eb),mr=nl}catch{}}return kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xb,kt.createPortal=function(n,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ed(i))throw Error(r(200));return _b(n,i,null,l)},kt.createRoot=function(n,i){if(!ed(n))throw Error(r(299));var l=!1,d="",p=Ig;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(p=i.onRecoverableError)),i=Yu(n,1,!1,null,null,l,!1,d,p),n[Ir]=i.current,Hi(n.nodeType===8?n.parentNode:n),new Zu(i)},kt.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=sf(i),n=n===null?null:n.stateNode,n},kt.flushSync=function(n){return Vn(n)},kt.hydrate=function(n,i,l){if(!tl(i))throw Error(r(200));return rl(null,n,i,!0,l)},kt.hydrateRoot=function(n,i,l){if(!ed(n))throw Error(r(405));var d=l!=null&&l.hydratedSources||null,p=!1,y="",S=Ig;if(l!=null&&(l.unstable_strictMode===!0&&(p=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(S=l.onRecoverableError)),i=Ag(i,null,n,1,l??null,p,!1,y,S),n[Ir]=i.current,Hi(n),d)for(n=0;n<d.length;n++)l=d[n],p=l._getVersion,p=p(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,p]:i.mutableSourceEagerHydrationData.push(l,p);return new el(i)},kt.render=function(n,i,l){if(!tl(i))throw Error(r(200));return rl(null,n,i,!1,l)},kt.unmountComponentAtNode=function(n){if(!tl(n))throw Error(r(40));return n._reactRootContainer?(Vn(function(){rl(null,null,n,!1,function(){n._reactRootContainer=null,n[Ir]=null})}),!0):!1},kt.unstable_batchedUpdates=Vu,kt.unstable_renderSubtreeIntoContainer=function(n,i,l,d){if(!tl(l))throw Error(r(200));if(n==null||n._reactInternals===void 0)throw Error(r(38));return rl(n,i,l,!1,d)},kt.version="18.3.1-next-f1338f8080-20240426",kt}var Bg;function $y(){if(Bg)return nd.exports;Bg=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nd.exports=Ib(),nd.exports}var zg;function Lb(){if(zg)return sl;zg=1;var e=$y();return sl.createRoot=e.createRoot,sl.hydrateRoot=e.hydrateRoot,sl}var jb=Lb(),Nb="__TSS_CONTEXT",Ad=Symbol.for("TSS_SERVER_FUNCTION"),vj=Symbol.for("TSS_SERVER_FUNCTION_FACTORY"),Mb="application/x-tss-framed",Fr={JSON:0,CHUNK:1,END:2,ERROR:3},$b=/;\s*v=(\d+)/;function Db(e){const t=e.match($b);return t?parseInt(t[1],10):void 0}function Ub(e){const t=Db(e);if(t!==void 0&&t!==1)throw new Error(`Incompatible framed protocol version: server=${t}, client=1. Please ensure client and server are using compatible versions.`)}var Dy=()=>window.__TSS_START_OPTIONS__;const Uy=!1;function Eo(e){return e[e.length-1]}function Fb(e){return typeof e=="function"}function es(e,t){return Fb(e)?e(t):e}const Fy=Object.prototype.hasOwnProperty,Hg=Object.prototype.propertyIsEnumerable;function By(e){for(const t in e)if(Fy.call(e,t))return!0;return!1}const Bb=()=>Object.create(null),Jn=(e,t)=>ts(e,t,Bb);function ts(e,t,r=()=>({}),s=0){if(e===t)return e;if(s>500)return t;const o=t,a=qg(e)&&qg(o);if(!a&&!(Pl(e)&&Pl(o)))return o;const c=a?e:Wg(e);if(!c)return o;const u=a?o:Wg(o);if(!u)return o;const h=c.length,f=u.length,m=a?new Array(f):r();let g=0;for(let v=0;v<f;v++){const w=a?v:u[v],b=e[w],x=o[w];if(b===x){m[w]=b,(a?v<h:Fy.call(e,w))&&g++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){m[w]=x;continue}const _=ts(b,x,r,s+1);m[w]=_,_===b&&g++}return h===f&&g===h?e:m}function Wg(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!Hg.call(e,o))return!1;const r=Object.getOwnPropertySymbols(e);if(r.length===0)return t;const s=t;for(const o of r){if(!Hg.call(e,o))return!1;s.push(o)}return s}function Pl(e){if(!Vg(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!Vg(r)||!r.hasOwnProperty("isPrototypeOf"))}function Vg(e){return Object.prototype.toString.call(e)==="[object Object]"}function qg(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vt(e,t,r){if(e===t)return!0;
9if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,o=e.length;s<o;s++)if(!vt(e[s],t[s],r))return!1;return!0}if(Pl(e)&&Pl(t)){const s=r?.ignoreUndefined??!0;if(r?.partial){for(const c in t)if((!s||t[c]!==void 0)&&!vt(e[c],t[c],r))return!1;return!0}let o=0;if(!s)o=Object.keys(e).length;else for(const c in e)e[c]!==void 0&&o++;let a=0;for(const c in t)if((!s||t[c]!==void 0)&&(a++,a>o||!vt(e[c],t[c],r)))return!1;return o===a}return!1}function cs(e){let t,r;const s=new Promise((o,a)=>{t=o,r=a});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,t(o),e?.(o)},s.reject=o=>{s.status="rejected",r(o)},s}function zb(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function ko(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const Hb=/[\x00-\x1f\x7f"<>`{}]/g;function Wb(e){return e.replace(Hb,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function Kg(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,r=>{try{return decodeURI(r)}catch{return r}})}return Wb(t)}const Vb=["http:","https:","mailto:","tel:"];function Al(e,t){if(!e)return!1;try{const r=new URL(e);return!t.has(r.protocol)}catch{return!1}}const qb={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Kb=/[&><\u2028\u2029]/g;function Gb(e){return e.replace(Kb,t=>qb[t])}function lo(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let r=0,s="",o;for(;(o=t.exec(e))!==null;)s+=Kg(e.slice(r,o.index))+o[0],r=t.lastIndex;s=s+Kg(r?e.slice(r):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function Jb(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Qb(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Ot(){throw new Error("Invariant failed")}function Ro(e){const t=new Map;let r,s;const o=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,s&&(s.next=a,a.prev=s)):(a.next.prev=void 0,r=a.next,a.next=void 0,s&&(a.prev=s,s.next=a)),s=a)};return{get(a){const c=t.get(a);if(c)return o(c),c.value},set(a,c){if(t.size>=e&&r){const h=r;t.delete(h.key),h.next&&(r=h.next,h.next.prev=void 0),h===s&&(s=void 0)}const u=t.get(a);if(u)u.value=c,o(u);else{const h={key:a,value:c,prev:s};s&&(s.next=h),s=h,r||(r=h),t.set(a,h)}},clear(){t.clear(),r=void 0,s=void 0}}}const kn=4,zy=5;function Yb(e){const t=e.indexOf("{");if(t===-1)return null;const r=e.indexOf("}",t);return r===-1||t+1>=e.length?null:[t,r]}function Hy(e,t,r=new Uint16Array(6)){const s=e.indexOf("/",t),o=s===-1?e.length:s,a=e.substring(t,o);if(!a||!a.includes("$"))return r[0]=0,r[1]=t,r[2]=t,r[3]=o,r[4]=o,r[5]=o,r;if(a==="$"){const u=e.length;return r[0]=2,r[1]=t,r[2]=t,r[3]=u,r[4]=u,r[5]=u,r}if(a.charCodeAt(0)===36)return r[0]=1,r[1]=t,r[2]=t+1,r[3]=o,r[4]=o,r[5]=o,r;const c=Yb(a);if(c){const[u,h]=c,f=a.charCodeAt(u+1);if(f===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const m=u+3,g=h;if(m<g)return r[0]=3,r[1]=t+u,r[2]=t+m,r[3]=t+g,r[4]=t+h+1,r[5]=o,r}}else if(f===36){const m=u+1,g=u+2;return g===h?(r[0]=2,r[1]=t+u,r[2]=t+m,r[3]=t+g,r[4]=t+h+1,r[5]=e.length,r):(r[0]=1,r[1]=t+u,r[2]=t+g,r[3]=t+h,r[4]=t+h+1,r[5]=o,r)}}return r[0]=0,r[1]=t,r[2]=t,r[3]=o,r[4]=o,r[5]=o,r}function Kl(e,t,r,s,o,a,c){c?.(r);let u=s;{const h=r.fullPath??r.from,f=h.length,m=r.options?.caseSensitive??e,g=r.options?.params?.parse??r.options?.parseParams;for(;u<f;){const w=Hy(h,u,t);let b;const x=u,_=w[5];switch(u=_+1,a++,w[0]){case 0:{const E=h.substring(w[2],w[3]);if(m){const R=o.static?.get(E);if(R)b=R;else{o.static??=new Map;const A=rs(r.fullPath??r.from);A.parent=o,A.depth=a,b=A,o.static.set(E,A)}}else{const R=E.toLowerCase(),A=o.staticInsensitive?.get(R);if(A)b=A;else{o.staticInsensitive??=new Map;const I=rs(r.fullPath??r.from);I.parent=o,I.depth=a,b=I,o.staticInsensitive.set(R,I)}}break}case 1:{const E=h.substring(x,w[1]),R=h.substring(w[4],_),A=m&&!!(E||R),I=E?A?E:E.toLowerCase():void 0,$=R?A?R:R.toLowerCase():void 0,F=!g&&o.dynamic?.find(M=>!M.parse&&M.caseSensitive===A&&M.prefix===I&&M.suffix===$);if(F)b=F;else{const M=ad(1,r.fullPath??r.from,A,I,$);b=M,M.depth=a,M.parent=o,o.dynamic??=[],o.dynamic.push(M)}break}case 3:{const E=h.substring(x,w[1]),R=h.substring(w[4],_),A=m&&!!(E||R),I=E?A?E:E.toLowerCase():void 0,$=R?A?R:R.toLowerCase():void 0,F=!g&&o.optional?.find(M=>!M.parse&&M.caseSensitive===A&&M.prefix===I&&M.suffix===$);if(F)b=F;else{const M=ad(3,r.fullPath??r.from,A,I,$);
9b=M,M.parent=o,M.depth=a,o.optional??=[],o.optional.push(M)}break}case 2:{const E=h.substring(x,w[1]),R=h.substring(w[4],_),A=m&&!!(E||R),I=E?A?E:E.toLowerCase():void 0,$=R?A?R:R.toLowerCase():void 0,F=ad(2,r.fullPath??r.from,A,I,$);b=F,F.parent=o,F.depth=a,o.wildcard??=[],o.wildcard.push(F)}}o=b}if(g&&r.children&&!r.isRoot&&r.id&&r.id.charCodeAt(r.id.lastIndexOf("/")+1)===95){const w=rs(r.fullPath??r.from);w.kind=zy,w.parent=o,a++,w.depth=a,o.pathless??=[],o.pathless.push(w),o=w}const v=(r.path||!r.children)&&!r.isRoot;if(v&&h.endsWith("/")){const w=rs(r.fullPath??r.from);w.kind=kn,w.parent=o,a++,w.depth=a,o.index=w,o=w}o.parse=g??null,o.priority=r.options?.params?.priority??0,v&&!o.route&&(o.route=r,o.fullPath=r.fullPath??r.from)}if(r.children)for(const h of r.children)Kl(e,t,h,u,o,a,c)}function od(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function bn(e){if(e.pathless)for(const t of e.pathless)bn(t);if(e.static)for(const t of e.static.values())bn(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())bn(t);if(e.dynamic?.length){e.dynamic.sort(od);for(const t of e.dynamic)bn(t)}if(e.optional?.length){e.optional.sort(od);for(const t of e.optional)bn(t)}if(e.wildcard?.length){e.wildcard.sort(od);for(const t of e.wildcard)bn(t)}}function rs(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function ad(e,t,r,s,o){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:r,prefix:s,suffix:o}}function Xb(e,t){const r=rs("/"),s=new Uint16Array(6);for(const o of e)Kl(!1,s,o,1,r,0);bn(r),t.masksTree=r,t.flatCache=Ro(1e3)}function Zb(e,t){e||="/";const r=t.flatCache.get(e);if(r)return r;const s=fh(e,t.masksTree);return t.flatCache.set(e,s),s}function eS(e,t,r,s,o){e||="/",s||="/";const a=t?`case\0${e}`:e;let c=o.singleCache.get(a);return c||(c=rs("/"),Kl(t,new Uint16Array(6),{from:e},1,c,0),o.singleCache.set(a,c)),fh(s,c,r)}function tS(e,t,r=!1){const s=r?e:`nofuzz\0${e}`,o=t.matchCache.get(s);if(o!==void 0)return o;e||="/";let a;try{a=fh(e,t.segmentTree,r)}catch(c){if(c instanceof URIError)a=null;else throw c}return a&&(a.branch=Vy(a.route)),t.matchCache.set(s,a),a}function rS(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function nS(e,t=!1,r){const s=rs(e.fullPath),o=new Uint16Array(6),a={},c={};let u=0;return Kl(t,o,e,1,s,0,h=>{if(r?.(h,u),h.id in a&&Ot(),a[h.id]=h,u!==0&&h.path){const f=rS(h.fullPath);(!c[f]||h.fullPath.endsWith("/"))&&(c[f]=h)}u++}),bn(s),{processedTree:{segmentTree:s,singleCache:Ro(1e3),matchCache:Ro(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:c}}function fh(e,t,r=!1){const s=e.split("/"),o=iS(e,s,t,r);if(!o)return null;const[a]=Wy(e,s,o);return{route:o.node.route,rawParams:a}}function Wy(e,t,r){const s=sS(r.node);let o=null;const a=Object.create(null);let c=r.extract?.part??0,u=r.extract?.node??0,h=r.extract?.path??0,f=r.extract?.segment??0;for(;u<s.length;c++,u++,h++,f++){const m=s[u];if(m.kind===kn)break;if(m.kind===zy){f--,c--,h--;continue}const g=t[c],v=h;if(g&&(h+=g.length),m.kind===1){o??=r.node.fullPath.split("/");const w=o[f],b=m.prefix?.length??0;if(w.charCodeAt(b)===123){const x=m.suffix?.length??0,_=w.substring(b+2,w.length-x-1),E=g.substring(b,g.length-x);a[_]=decodeURIComponent(E)}else{const x=w.substring(1);a[x]=decodeURIComponent(g)}}else if(m.kind===3){if(r.skipped&1<<u){c--,h=v-1;continue}o??=r.node.fullPath.split("/");const w=o[f],b=m.prefix?.length??0,x=m.suffix?.length??0,_=w.substring(b+3,w.length-x-1),E=m.suffix||m.prefix?g.substring(b,g.length-x):g;E&&(a[_]=decodeURIComponent(E))}else if(m.kind===2){const w=m,b=e.substring(v+(w.prefix?.length??0),e.length-(w.suffix?.length??0)),x=decodeURIComponent(b);a["*"]=x,a._splat=x;break}}return r.rawParams&&Object.assign(a,r.rawParams),[a,{part:c,node:u,path:h,segment:f}]}function Vy(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function sS(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function iS(e,t,r,s){if(e==="/"&&r.index)return{node:r.index,skipped:0};const o=!Eo(t),a=o&&e!=="/",c=t.length-(o?1:0),u=[{node:r,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let h=null,f=null;for(;u.length;){const m=u.pop(),{node:g,index:v,skipped:w,depth:b,statics:x,dynamics:_,optionals:E}=m;let{extract:R,rawParams:A}=m;if(g.kind===2&&g.route&&!ol(f,m))continue;if(g.parse){if(!Gg(e,t,m))continue;A=m.rawParams,R=m.extract}s&&g.route&&g.kind!==kn&&ol(h,m)&&(h=m);const I=v===c;if(I&&(g.route&&(!a||g.kind===kn||g.kind===2)&&ol(f,m)&&(f=m),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const $=I?void 0:t[v];let F;if(I&&g.index){const M={node:g.index,index:v,skipped:w,depth:b+1,statics:x,dynamics:_,optionals:E,extract:R,rawParams:A};let z=!0;if(g.index.parse&&(Gg(e,t,M)||(z=!1)),z){if(!_&&!E&&!w&&oS(x,c))return M;ol(f,M)&&(f=M)}}if(g.wildcard)for(let M=g.wildcard.length-1;M>=0;M--){const z=g.wildcard[M],{prefix:V,suffix:K}=z;if(!(V&&(I||!(z.caseSensitive?$:F??=$.toLowerCase()).startsWith(V)))){if(K){if(I)continue;const te=t.slice(v).join("/").slice(-K.length);if((z.caseSensitive?te:te.toLowerCase())!==K)continue}u.push({node:z,index:c,skipped:w,depth:b+1,statics:x,dynamics:_,optionals:E,extract:R,rawParams:A})}}if(g.optional){const M=w|1<<b,z=b+1;for(let V=g.optional.length-1;V>=0;V--){const K=g.optional[V];u.push({node:K,index:v,skipped:M,depth:z,statics:x,dynamics:_,optionals:E,extract:R,rawParams:A})}if(!I)for(let V=g.optional.length-1;V>=0;V--){const K=g.optional[V],{prefix:te,suffix:G}=K;
9if(te||G){const ae=K.caseSensitive?$:F??=$.toLowerCase();if(te&&!ae.startsWith(te)||G&&!ae.endsWith(G))continue}u.push({node:K,index:v+1,skipped:w,depth:z,statics:x,dynamics:_,optionals:E+il(c,v),extract:R,rawParams:A})}}if(!I&&g.dynamic&&$)for(let M=g.dynamic.length-1;M>=0;M--){const z=g.dynamic[M],{prefix:V,suffix:K}=z;if(V||K){const te=z.caseSensitive?$:F??=$.toLowerCase();if(V&&!te.startsWith(V)||K&&!te.endsWith(K))continue}u.push({node:z,index:v+1,skipped:w,depth:b+1,statics:x,dynamics:_+il(c,v),optionals:E,extract:R,rawParams:A})}if(!I&&g.staticInsensitive){const M=g.staticInsensitive.get(F??=$.toLowerCase());M&&u.push({node:M,index:v+1,skipped:w,depth:b+1,statics:x+il(c,v),dynamics:_,optionals:E,extract:R,rawParams:A})}if(!I&&g.static){const M=g.static.get($);M&&u.push({node:M,index:v+1,skipped:w,depth:b+1,statics:x+il(c,v),dynamics:_,optionals:E,extract:R,rawParams:A})}if(g.pathless){const M=b+1;for(let z=g.pathless.length-1;z>=0;z--){const V=g.pathless[z];u.push({node:V,index:v,skipped:w,depth:M,statics:x,dynamics:_,optionals:E,extract:R,rawParams:A})}}}if(f)return f;if(s&&h){let m=h.index;for(let v=0;v<h.index;v++)m+=t[v].length;const g=m===e.length?"/":e.slice(m);return h.rawParams??=Object.create(null),h.rawParams["**"]=decodeURIComponent(g),h}return null}function il(e,t){return 2**(e-t-1)}function oS(e,t){return e===2**(t-1)-1}function Gg(e,t,r){let s,o;try{[s,o]=Wy(e,t,r)}catch{return null}if(r.rawParams=s,r.extract=o,!r.node.parse)return!0;try{if(r.node.parse(s)===!1)return null}catch{}return!0}function ol(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===kn)>(e.node.kind===kn)||t.node.kind===kn==(e.node.kind===kn)&&t.depth>e.depth))):!0}function Sl(e){return ph(e.filter(t=>t!==void 0).join("/"))}function ph(e){return e.replace(/\/{2,}/g,"/")}function qy(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Vr(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Ky(e){return Vr(qy(e))}function Ol(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function aS(e,t,r){return Ol(e,r)===Ol(t,r)}function lS({base:e,to:t,trailingSlash:r="never",cache:s}){const o=t.startsWith("/"),a=!o&&t===".";let c;if(s){c=o?t:a?e:e+"\0"+t;const f=s.get(c);if(f)return f}let u;if(a)u=e.split("/");else if(o)u=t.split("/");else{for(u=e.split("/");u.length>1&&Eo(u)==="";)u.pop();const f=t.split("/");for(let m=0,g=f.length;m<g;m++){const v=f[m];v===""?m?m===g-1&&u.push(v):u=[v]:v===".."?u.pop():v==="."||u.push(v)}}u.length>1&&(Eo(u)===""?r==="never"&&u.pop():r==="always"&&u.push(""));const h=ph(u.join("/"))||"/";return c&&s&&s.set(c,h),h}function cS(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),r=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(r,"g");return o=>o.replace(s,a=>t.get(a)??a)}function ld(e,t,r){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(o=>Qg(o,r)).join("/"):Qg(s,r)}function Jg({path:e,params:t,decoder:r,...s}){let o=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:o};const c=e.length;let u=0,h,f="";for(;u<c;){const m=u;h=Hy(e,m,h);const g=h[5];if(u=g+1,m===g)continue;const v=h[0];if(v===0){f+="/"+e.substring(m,g);continue}if(v===2){const w=t._splat;a._splat=w,a["*"]=w;const b=e.substring(m,h[1]),x=e.substring(h[4],g);if(!w){o=!0,(b||x)&&(f+="/"+b+x);continue}const _=ld("_splat",t,r);f+="/"+b+_+x;continue}if(v===1){const w=e.substring(h[2],h[3]);!o&&!(w in t)&&(o=!0),a[w]=t[w];const b=e.substring(m,h[1]),x=e.substring(h[4],g),_=ld(w,t,r)??"undefined";f+="/"+b+_+x;continue}if(v===3){const w=e.substring(h[2],h[3]),b=t[w];if(b==null)continue;a[w]=b;const x=e.substring(m,h[1]),_=e.substring(h[4],g),E=ld(w,t,r)??"";f+="/"+x+E+_;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:o}}function Qg(e,t){const r=encodeURIComponent(e);return t?.(r)??r}function Ho(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function st(e){return e?.isNotFound===!0}
9function Gy(e,t=String){const r=new URLSearchParams;for(const s in e){const o=e[s];o!==void 0&&r.set(s,t(o))}return r.toString()}function cd(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function uS(e){const t=new URLSearchParams(e),r=Object.create(null);for(const[s,o]of t.entries()){const a=r[s];a==null?r[s]=cd(o):Array.isArray(a)?a.push(cd(o)):r[s]=[a,cd(o)]}return r}const dS=fS(JSON.parse),hS=pS(JSON.stringify,JSON.parse);function fS(e){return t=>{t[0]==="?"&&(t=t.substring(1));const r=uS(t);for(const s in r){const o=r[s];if(typeof o=="string")try{r[s]=e(o)}catch{}}return r}}function pS(e,t){const r=typeof t=="function";function s(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(r&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const a=Gy(o,s);return a?`?${a}`:""}}const os="__root__";function Gl(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const r=new Response(null,{status:e.statusCode,headers:t});if(r.options=e,e.throw)throw r;return r}function Pt(e){return e instanceof Response&&!!e.options}function gS(e){if(e!==null&&typeof e=="object"&&e.isSerializedRedirect)return Gl(e)}const Od=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},mS=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Jl=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),as=(e,t,r=!0)=>{const s={...e.router.options.context??{}},o=r?t:t-1;for(let a=0;a<=o;a++){const c=e.matches[a];if(!c)continue;const u=e.router.getMatch(c.id);u&&Object.assign(s,u.__routeContext,u.__beforeLoadContext)}return s},Yg=(e,t)=>{if(!e.matches.length)return;const r=t.routeId,s=e.matches.findIndex(c=>c.routeId===e.router.routeTree.id),o=s>=0?s:0;let a=r?e.matches.findIndex(c=>c.routeId===r):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=o);for(let c=a;c>=0;c--){const u=e.matches[c];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return c}return r?a:o},Rn=(e,t,r)=>{if(!(!Pt(r)&&!st(r)))throw Pt(r)&&r.redirectHandled&&!r.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=r,e.updateMatch(t.id,s=>({...s,status:Pt(r)?"redirected":st(r)?"notFound":s.status==="pending"?"success":s.status,context:as(e,t.index),isFetching:!1,error:r})),st(r)&&!r.routeId&&(r.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Pt(r)&&(e.rendered=!0,r.options._fromLocation=e.location,r.redirectHandled=!0,r=e.router.resolveRedirect(r))),r},Jy=(e,t)=>{const r=e.router.getMatch(t);return!!(!r||r._nonReactive.dehydrated)},Xg=(e,t,r)=>{const s=as(e,r);e.updateMatch(t,o=>({...o,context:s}))},co=(e,t,r)=>{const{id:s,routeId:o}=e.matches[t],a=e.router.looseRoutesById[o];if(r instanceof Promise)throw r;e.firstBadMatchIndex??=t,Rn(e,e.router.getMatch(s),r);try{a.options.onError?.(r)}catch(c){r=c,Rn(e,e.router.getMatch(s),r)}e.updateMatch(s,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:r,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Pt(r)&&!st(r)&&(e.serialError??=r)},Qy=(e,t,r,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const o=r.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Jl(e,t)&&(r.options.loader||r.options.beforeLoad||Xy(r))&&typeof o=="number"&&o!==1/0&&(r.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{Od(e)},o);s._nonReactive.pendingTimeout=a}},yS=(e,t,r)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Qy(e,t,r,s);const o=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Rn(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},vS=(e,t,r,s)=>{const o=e.router.getMatch(t);let a=o._nonReactive.loadPromise;o._nonReactive.loadPromise=cs(()=>{a?.resolve(),a=void 0});const{paramsError:c,searchError:u}=o;c&&co(e,r,c),u&&co(e,r,u),Qy(e,t,s,o);const h=new AbortController;let f=!1;const m=()=>{f||(f=!0,e.updateMatch(t,I=>({...I,isFetching:"beforeLoad",fetchCount:I.fetchCount+1,abortController:h})))},g=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,I=>({...I,isFetching:!1}))};if(!s.options.beforeLoad){e.router.batch(()=>{m(),g()});return}o._nonReactive.beforeLoadPromise=cs();
9const v={...as(e,r,!1),...o.__routeContext},{search:w,params:b,cause:x}=o,_=Jl(e,t),E={search:w,abortController:h,params:b,preload:_,context:v,location:e.location,navigate:I=>e.router.navigate({...I,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:_?"preload":x,matches:e.matches,routeId:s.id,...e.router.options.additionalContext},R=I=>{if(I===void 0){e.router.batch(()=>{m(),g()});return}(Pt(I)||st(I))&&(m(),co(e,r,I)),e.router.batch(()=>{m(),e.updateMatch(t,$=>({...$,__beforeLoadContext:I})),g()})};let A;try{if(A=s.options.beforeLoad(E),ko(A))return m(),A.catch(I=>{co(e,r,I)}).then(R)}catch(I){m(),co(e,r,I)}R(A)},wS=(e,t)=>{const{id:r,routeId:s}=e.matches[t],o=e.router.looseRoutesById[s],a=()=>u(),c=()=>vS(e,r,t,o),u=()=>{if(Jy(e,r))return;const h=yS(e,r,o);return ko(h)?h.then(c):c()};return a()},_S=(e,t,r)=>{const s=e.router.getMatch(t);if(!s||!r.options.head&&!r.options.scripts&&!r.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([r.options.head?.(o),r.options.scripts?.(o),r.options.headers?.(o)]).then(([a,c,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:c,styles:a?.styles}))},Yy=(e,t,r,s,o)=>{const a=t[s-1],{params:c,loaderDeps:u,abortController:h,cause:f}=e.router.getMatch(r),m=as(e,s),g=Jl(e,r);return{params:c,deps:u,preload:!!g,parentMatchPromise:a,abortController:h,context:m,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":f,route:o,...e.router.options.additionalContext}},Zg=async(e,t,r,s,o)=>{try{const a=e.router.getMatch(r);try{(!(Uy??e.router.isServer)||a.ssr===!0)&&Co(o);const c=o.options.loader,u=typeof c=="function"?c:c?.handler,h=u?.(Yy(e,t,r,s,o)),f=!!u&&ko(h);if((f||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(r,g=>({...g,isFetching:"loader"})),u){const g=f?await h:h;Rn(e,e.router.getMatch(r),g),g!==void 0&&e.updateMatch(r,v=>({...v,loaderData:g}))}o._lazyPromise&&await o._lazyPromise;const m=a._nonReactive.minPendingPromise;m&&await m,o._componentsPromise&&await o._componentsPromise,e.updateMatch(r,g=>({...g,error:void 0,context:as(e,s),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(c){let u=c;if(u?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(r,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:as(e,s)}));return}const h=a._nonReactive.minPendingPromise;h&&await h,st(c)&&await o.options.notFoundComponent?.preload?.(),Rn(e,e.router.getMatch(r),c);try{o.options.onError?.(c)}catch(f){u=f,Rn(e,e.router.getMatch(r),f)}!Pt(u)&&!st(u)&&await Co(o,["errorComponent"]),e.updateMatch(r,f=>({...f,error:u,context:as(e,s),status:"error",isFetching:!1}))}}catch(a){const c=e.router.getMatch(r);c&&(c._nonReactive.loaderPromise=void 0),Rn(e,c,a)}},bS=async(e,t,r)=>{async function s(w,b,x,_,E){const R=Date.now()-b.updatedAt,A=w?E.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:E.options.staleTime??e.router.options.defaultStaleTime??0,I=E.options.shouldReload,$=typeof I=="function"?I(Yy(e,t,o,r,E)):I,{status:F,invalid:M}=_,z=R>=A&&(!!e.forceStaleReload||_.cause==="enter"||x!==void 0&&x!==_.id);c=F==="success"&&(M||($??z)),w&&E.options.preload===!1||(c&&!e.sync&&m?(u=!0,(async()=>{try{await Zg(e,t,o,r,E);const V=e.router.getMatch(o);V._nonReactive.loaderPromise?.resolve(),V._nonReactive.loadPromise?.resolve(),V._nonReactive.loaderPromise=void 0,V._nonReactive.loadPromise=void 0}catch(V){Pt(V)&&await e.router.navigate(V.options)}})()):F!=="success"||c?await Zg(e,t,o,r,E):Xg(e,o,r))}const{id:o,routeId:a}=e.matches[r];let c=!1,u=!1;const h=e.router.looseRoutesById[a],f=h.options.loader,m=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Jy(e,o)){if(!e.router.getMatch(o))return e.matches[r];Xg(e,o,r)}else{const w=e.router.getMatch(o),b=e.router.stores.matchesId.get()[r],x=(b&&e.router.stores.matchStores.get(b)||null)?.routeId===a?b:e.router.stores.matches.get().find(E=>E.routeId===a)?.id,_=Jl(e,o);if(w._nonReactive.loaderPromise){if(w.status==="success"&&!e.sync&&!w.preload&&m)return w;await w._nonReactive.loaderPromise;const E=e.router.getMatch(o),R=E._nonReactive.error||E.error;R&&Rn(e,E,R),E.status==="pending"&&await s(_,w,x,E,h)}else{const E=_&&!e.router.stores.matchStores.has(o),R=e.router.getMatch(o);R._nonReactive.loaderPromise=cs(),E!==R.preload&&e.updateMatch(o,A=>({...A,preload:E}
9)),await s(_,w,x,R,h)}}const g=e.router.getMatch(o);u||(g._nonReactive.loaderPromise?.resolve(),g._nonReactive.loadPromise?.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,u||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const v=u?g.isFetching:!1;return v!==g.isFetching||g.invalid!==!1?(e.updateMatch(o,w=>({...w,isFetching:v,invalid:!1})),e.router.getMatch(o)):g};async function em(e){const t=e,r=[];mS(t.router)&&Od(t);let s;for(let v=0;v<t.matches.length;v++){try{const w=wS(t,v);ko(w)&&await w}catch(w){if(Pt(w))throw w;if(st(w))s=w;else if(!t.preload)throw w;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const o=t.firstBadMatchIndex??t.matches.length,a=s&&!t.preload?Yg(t,s):void 0,c=s&&t.preload?0:a!==void 0?Math.min(a+1,o):o;let u,h;for(let v=0;v<c;v++)r.push(bS(t,r,v));try{await Promise.all(r)}catch{const v=await Promise.allSettled(r);for(const w of v){if(w.status!=="rejected")continue;const b=w.reason;if(Pt(b))throw b;st(b)?u??=b:h??=b}if(h!==void 0)throw h}const f=u??(s&&!t.preload?s:void 0);let m=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!f&&s&&t.preload)return t.matches;if(f){const v=Yg(t,f);v===void 0&&Ot();const w=t.matches[v],b=t.router.looseRoutesById[w.routeId],x=t.router.options?.defaultNotFoundComponent;!b.options.notFoundComponent&&x&&(b.options.notFoundComponent=x),f.routeId=w.routeId;const _=w.routeId===t.router.routeTree.id;t.updateMatch(w.id,E=>({...E,..._?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),m=v,await Co(b,["notFoundComponent"])}else if(!t.preload){const v=t.matches[0];v.globalNotFound||t.router.getMatch(v.id)?.globalNotFound&&t.updateMatch(v.id,w=>({...w,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const v=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Co(v,["errorComponent"])}for(let v=0;v<=m;v++){const{id:w,routeId:b}=t.matches[v],x=t.router.looseRoutesById[b];try{const _=_S(t,w,x);if(_){const E=await _;t.updateMatch(w,R=>({...R,...E}))}}catch(_){console.error(`Error executing head for route ${b}:`,_)}}const g=Od(t);if(ko(g)&&await g,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function tm(e,t){const r=t.map(s=>e.options[s]?.preload?.()).filter(Boolean);if(r.length!==0)return Promise.all(r)}function Co(e,t=xl){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(s=>{const{id:o,...a}=s.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const r=()=>e._componentsLoaded?void 0:t===xl?(()=>{if(e._componentsPromise===void 0){const s=tm(e,xl);s?e._componentsPromise=s.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():tm(e,t);return e._lazyPromise?e._lazyPromise.then(r):r()}function Xy(e){for(const t of xl)if(e.options[t]?.preload)return!0;return!1}const xl=["component","errorComponent","pendingComponent","notFoundComponent"];function SS(e){return{input:({url:t})=>{for(const r of e)t=Id(r,t);return t},output:({url:t})=>{for(let r=e.length-1;r>=0;r--)t=Zy(e[r],t);return t}}}function xS(e){const t=Ky(e.basepath),r=`/${t}`,s=e.caseSensitive?r:r.toLowerCase(),o=`${s}/`;return{input:({url:a})=>{const c=e.caseSensitive?a.pathname:a.pathname.toLowerCase();return c===s?a.pathname="/":c.startsWith(o)&&(a.pathname=a.pathname.slice(r.length)),a},output:({url:a})=>(a.pathname=Sl(["/",t,a.pathname]),a)}}function Id(e,t){const r=e?.input?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function Zy(e,t){const r=e?.output?.({url:t});if(r){if(typeof r=="string")return new URL(r);if(r instanceof URL)return r}return t}function ES(e,t){const{createMutableStore:r,createReadonlyStore:s,batch:o,init:a}=t,c=new Map,u=new Map,h=new Map,f=r(e.status),m=r(e.loadedAt),g=r(e.isLoading),v=r(e.isTransitioning),w=r(e.location),b=r(e.resolvedLocation),x=r(e.statusCode),_=r(e.redirect),E=r([]),R=r([]),A=r([]),I=s(()=>ud(c,E.get())),$=s(()=>ud(u,R.get())),F=s(()=>ud(h,A.get())),M=s(()=>E.get()[0]),z=s(()=>E.get().some(W=>c.get(W)?.get().status==="pending")),V=s(()=>({locationHref:w.get().href,resolvedLocationHref:b.get()?.href,status:f.get()})),K=s(()=>({status:f.get(),loadedAt:m.get(),isLoading:g.get(),isTransitioning:v.get(),matches:I.get(),location:w.get(),resolvedLocation:b.get(),statusCode:x.get(),redirect:_.get()})),te=Ro(64);function G(W){let D=te.get(W);return D||(D=s(()=>{const Y=E.get();for(const Z of Y){const j=c.get(Z);if(j&&j.routeId===W)return j.get()}}),te.set(W,D)),D}const ae={status:f,loadedAt:m,isLoading:g,isTransitioning:v,location:w,resolvedLocation:b,statusCode:x,redirect:_,matchesId:E,pendingIds:R,cachedIds:A,matches:I,pendingMatches:$,cachedMatches:F,firstId:M,hasPending:z,matchRouteDeps:V,matchStores:c,pendingMatchStores:u,cachedMatchStores:h,__store:K,getRouteMatchStore:G,setMatches:ce,setPending:we,setCached:pe};ce(e.matches),a?.(ae);function ce(W){dd(W,c,E,r,o)}function we(W){dd(W,u,R,r,o)}function pe(W){dd(W,h,A,r,o)}return ae}function ud(e,t){const r=[];for(const s of t){const o=e.get(s);o&&r.push(o.get())}return r}function dd(e,t,r,s,o){const a=e.map(u=>
9u.id),c=new Set(a);o(()=>{for(const u of t.keys())c.has(u)||t.delete(u);for(const u of e){const h=t.get(u.id);if(!h){const f=s(u);f.routeId=u.routeId,t.set(u.id,f);continue}h.routeId=u.routeId,h.get()!==u&&h.set(u)}Qb(r.get(),a)||r.set(a)})}var Tn="__TSR_index",rm="popstate",nm="beforeunload";function kS(e){let t=e.getLocation();const r=new Set,s=c=>{t=e.getLocation(),r.forEach(u=>u({location:t,action:c}))},o=c=>{e.notifyOnIndexChange??!0?s(c):t=e.getLocation()},a=async({task:c,navigateOpts:u,...h})=>{if(u?.ignoreBlocker??!1){c();return}const f=e.getBlockers?.()??[],m=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&f.length&&m)for(const g of f){const v=Il(h.path,h.state);if(await g.blockerFn({currentLocation:t,nextLocation:v,action:h.type})){e.onBlocked?.();return}}c()};return{get location(){return t},get length(){return e.getLength()},subscribers:r,subscribe:c=>(r.add(c),()=>{r.delete(c)}),push:(c,u,h)=>{const f=t.state[Tn];u=sm(f+1,u),a({task:()=>{e.pushState(c,u),s({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:c,state:u})},replace:(c,u,h)=>{const f=t.state[Tn];u=sm(f,u),a({task:()=>{e.replaceState(c,u),s({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:c,state:u})},go:(c,u)=>{a({task:()=>{e.go(c),o({type:"GO",index:c})},navigateOpts:u,type:"GO"})},back:c=>{a({task:()=>{e.back(c?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:c,type:"BACK"})},forward:c=>{a({task:()=>{e.forward(c?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:c,type:"FORWARD"})},canGoBack:()=>t.state[Tn]!==0,createHref:c=>e.createHref(c),block:c=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,c]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(f=>f!==c))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function sm(e,t){t||(t={});const r=gh();return{...t,key:r,__TSR_key:r,[Tn]:e}}function RS(e){const t=typeof document<"u"?window:void 0,r=t.history.pushState,s=t.history.replaceState;let o=[];const a=()=>o,c=z=>o=z,u=(z=>z),h=(()=>Il(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const z=gh();t.history.replaceState({[Tn]:0,key:z,__TSR_key:z},"")}let f=h(),m,g=!1,v=!1,w=!1,b=!1;const x=()=>f;let _,E;const R=()=>{_&&(M._ignoreSubscribers=!0,(_.isPush?t.history.pushState:t.history.replaceState)(_.state,"",_.href),M._ignoreSubscribers=!1,_=void 0,E=void 0,m=void 0)},A=(z,V,K)=>{const te=u(V);E||(m=f),f=Il(V,K),_={href:te,state:K,isPush:_?.isPush||z==="push"},E||(E=Promise.resolve().then(()=>R()))},I=z=>{f=h(),M.notify({type:z})},$=async()=>{if(v){v=!1;return}const z=h(),V=z.state[Tn]-f.state[Tn],K=V===1,te=V===-1,G=!K&&!te||g;g=!1;const ae=G?"GO":te?"BACK":"FORWARD",ce=G?{type:"GO",index:V}:{type:te?"BACK":"FORWARD"};if(w)w=!1;else{const we=a();if(typeof document<"u"&&we.length){for(const pe of we)if(await pe.blockerFn({currentLocation:f,nextLocation:z,action:ae})){v=!0,t.history.go(1),M.notify(ce);return}}}f=h(),M.notify(ce)},F=z=>{if(b){b=!1;return}let V=!1;const K=a();if(typeof document<"u"&&K.length)for(const te of K){const G=te.enableBeforeUnload??!0;if(G===!0){V=!0;break}if(typeof G=="function"&&G()===!0){V=!0;break}}if(V)return z.preventDefault(),z.returnValue=""},M=kS({getLocation:x,getLength:()=>t.history.length,pushState:(z,V)=>A("push",z,V),replaceState:(z,V)=>A("replace",z,V),back:z=>(z&&(w=!0),b=!0,t.history.back()),forward:z=>{z&&(w=!0),b=!0,t.history.forward()},go:z=>{g=!0,t.history.go(z)},createHref:z=>u(z),flush:R,destroy:()=>{t.history.pushState=r,t.history.replaceState=s,t.removeEventListener(nm,F,{capture:!0}),t.removeEventListener(rm,$)},onBlocked:()=>{m&&f!==m&&(f=m)},getBlockers:a,setBlockers:c,notifyOnIndexChange:!1});return t.addEventListener(nm,F,{capture:!0}),t.addEventListener(rm,$),t.history.pushState=function(...z){const V=r.apply(t.history,z);return M._ignoreSubscribers||I("PUSH"),V},t.history.replaceState=function(...z){const V=s.apply(t.history,z);return M._ignoreSubscribers||I("REPLACE"),V},M}function CS(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Il(e,t){const r=CS(e),s=r.indexOf("#"),o=r.indexOf("?"),a=gh();return{href:r,pathname:r.substring(0,s>0?o>0?Math.min(s,o):s:o>0?o:r.length),hash:s>-1?r.substring(s):"",search:o>-1?r.slice(o,s===-1?void 0:s):"",state:t||{[Tn]:0,key:a,__TSR_key:a}}}function gh(){return(Math.random()+1).toString(36).substring(7)}function TS(e){return e instanceof Error?{name:e.name,message:e.message}:{data:e}}function oi(e,t){const r=t,s=e;return{fromLocation:r,toLocation:s,pathChanged:r?.pathname!==s.pathname,hrefChanged:r?.href!==s.href,hashChanged:r?.hash!==s.hash}}const Ld=new WeakMap;var PS=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=r=>r(),this.update=r=>{const s=this.options,o=this.basepath??s?.basepath??"/",a=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...r},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=cS(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=RS()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let m;this.resolvePathCache=Ro(1e3),m=this.buildRouteTree(),this.setRoutes(m)}if(!this.stores&&this.latestLocation){const m=this.getStoreConfig(this);this.batch=m.batch,this.stores=ES(OS(this.latestLocation),m),zS(this)}let u=!1;
9const h=this.options.basepath??"/",f=this.options.rewrite;if(a||o!==h||c!==f){this.basepath=h;const m=[],g=Ky(h);g&&g!=="/"&&m.push(xS({basepath:h})),f&&m.push(f),this.rewrite=m.length===0?void 0:m.length===1?m[0]:SS(m),this.history&&this.updateLatestLocation(),u=!0}u&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=nS(this.routeTree,this.options.caseSensitive,(s,o)=>{s.init({originalIndex:o})});return this.options.routeMasks&&Xb(this.options.routeMasks,r.processedTree),r},this.subscribe=(r,s)=>{const o={eventType:r,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=r=>{this.subscribers.forEach(s=>{s.eventType===r.type&&s.fn(r)})},this.parseLocation=(r,s)=>{const o=({pathname:h,search:f,hash:m,href:g,state:v})=>
9{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const E=this.options.parseSearch(f),R=this.options.stringifySearch(E);return{href:h+R+m,publicHref:h+R+m,pathname:lo(h).path,external:!1,searchStr:R,search:Jn(s?.search,E),hash:lo(m.slice(1)).path,state:ts(s?.state,v)}}const w=new URL(g,this.origin),b=Id(this.rewrite,w),x=this.options.parseSearch(b.search),_=this.options.stringifySearch(x);return b.search=_,{href:b.href.replace(b.origin,""),publicHref:g,pathname:lo(b.pathname).path,external:!!this.rewrite&&b.origin!==this.origin,searchStr:_,search:Jn(s?.search,x),hash:lo(b.hash.slice(1)).path,state:ts(s?.state,v)}},a=o(r),{__tempLocation:c,__tempKey:u}=a.state;if(c&&(!u||u===this.tempLocationKey)){const h=o(c);return h.state.key=a.state.key,h.state.__TSR_key=a.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:a}}return a},this.resolvePathWithBase=(r,s)=>lS({base:r,to:s.includes("//")?ph(s):s,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(r,s,o)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:s},o):this.matchRoutesInternal(r,s),this.getMatchedRoutes=r=>IS({pathname:r,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=r=>{const s=this.getMatch(r);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(r=>{this.cancelMatch(r)}),this.stores.matchesId.get().forEach(r=>{if(this.stores.pendingMatchStores.has(r))return;const s=this.stores.matchStores.get(r)?.get();s&&(s.status==="pending"||s.isFetching==="loader")&&this.cancelMatch(r)})},this.buildLocation=r=>{const s=(a={})=>{const c=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(c);a.from;const h=a.unsafeRelative==="path"?c.pathname:a.from??u.fullPath,f=a.to?`${a.to}`:void 0,m=u.search,g=Object.assign(Object.create(null),u.params),v=f?.charCodeAt(0)===47?"/":this.resolvePathWithBase(h,"."),w=f?this.resolvePathWithBase(v,f):v,b=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?g:Object.assign(g,es(a.params,g)),x=this.routesByPath[Vr(w)];let _;if(x)_=this.getRouteBranch(x);else if(w.includes("$"))_=[];else{const te=this.getMatchedRoutes(w);_=te.matchedRoutes,this.options.notFoundRoute&&(!te.foundRoute||te.foundRoute.path!=="/"&&te.routeParams["**"])&&(_=[..._,this.options.notFoundRoute])}if(_.length&&By(b))for(const te of _){const G=te.options.params?.stringify??te.options.stringifyParams;if(G)try{Object.assign(b,G(b))}catch{}}const E=r.leaveParams?w:lo(Jg({path:w,params:b,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let R=m;if(r._includeValidateSearch&&this.options.search?.strict){const te={};_.forEach(G=>{if(G.options.validateSearch)try{Object.assign(te,El(G.options.validateSearch,{...te,...R}))}catch{}}),R=te}R=LS({search:R,dest:a,destRoutes:_,_includeValidateSearch:r._includeValidateSearch}),R=Jn(m,R);const A=this.options.stringifySearch(R),I=a.hash===!0?c.hash:a.hash?es(a.hash,c.hash):void 0,$=I?`#${I}`:"";let F=a.state===!0?c.state:a.state?es(a.state,c.state):{};F=ts(c.state,F);const M=`${E}${A}${$}`;let z,V,K=!1;if(this.rewrite){const te=new URL(M,this.origin),G=Zy(this.rewrite,te);z=te.href.replace(te.origin,""),G.origin!==this.origin?(V=G.href,K=!0):V=G.pathname+G.search+G.hash}else z=Jb(M),V=z;return{publicHref:V,href:z,pathname:E,search:R,searchStr:A,state:F,hash:I??"",external:K,unmaskOnReload:a.unmaskOnReload}},o=(a={},c)=>{const u=s(a);let h=c?s(c):void 0;if(!h){const f=Object.create(null);if(this.options.routeMasks){const m=Zb(u.pathname,this.processedTree);if(m){Object.assign(f,m.rawParams);const{from:g,params:v,...w}=m.route,b=v===!1||v===null?Object.create(null):(v??!0)===!0?f:Object.assign(f,es(v,f));c={from:r.from,...w,params:b},h=s(c)}}}return h&&(u.maskedLocation=h),u};return r.mask?o(r,{from:r.from,...r.mask}):o(r)},this.commitLocation=async({viewTransition:r,ignoreBlocker:s,...o})=>{let a;const c=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(g=>{o.state[g]=this.latestLocation.state[g]});const m=vt(o.state,this.latestLocation.state);return f.forEach(g=>{delete o.state[g]}),m},u=Vr(this.latestLocation.href)===Vr(o.href);let h=this.commitLocationPromise;if(this.commitLocationPromise=cs(()=>{h?.resolve(),h=void 0}),u&&c())this.load();else{let{maskedLocation:f,hashScrollIntoView:m,...g}=o;f&&(g={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=r,a=o.replace?"REPLACE":"PUSH",this.history[a==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:s})}return this._scroll.next=o.resetScroll??!0,this.history.subscribers.size||this.load(a?{action:{type:a}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:r,resetScroll:s,hashScrollIntoView:o,viewTransition:a,ignoreBlocker:c,href:u,...h}={})=>
9{if(u){const g=this.history.location.state.__TSR_index,v=Il(u,{__TSR_index:r?g:g+1}),w=new URL(v.pathname,this.origin);h.to=Id(this.rewrite,w).pathname,h.search=this.options.parseSearch(v.search),h.hash=v.hash.slice(1)}const f=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=f;const m=this.commitLocation({...f,viewTransition:a,replace:r,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:c});return queueMicrotask(()=>{this.pendingBuiltLocation===f&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:r,reloadDocument:s,href:o,publicHref:a,...c})=>{let u=!1;if(o)try{new URL(`${o}`),u=!0}catch{}if(u&&!s&&(s=!0),s){if(r!==void 0||!o){const f=this.buildLocation({to:r,...c});o=o??f.publicHref,a=a??f.publicHref}const h=!u&&a?a:o;if(Al(h,this.protocolAllowlist))return;if(!c.ignoreBlocker){const f=this.history.getBlockers?.()??[];for(const m of f)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}c.replace?window.location.replace(h):window.location.href=h;return}return this.buildAndCommitLocation({...c,href:o,to:r,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const r=this.matchRoutes(this.latestLocation),s=this.stores.cachedMatches.get().filter(o=>!r.some(a=>a.id===o.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(r),this.stores.setCached(s)})},this.load=async r=>{const s=r?.action?.type;let o,a,c;const u=this.stores.resolvedLocation.get()??this.stores.location.get();for(c=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad(),s?Ld.set(this.latestLocation,s):Ld.delete(this.latestLocation);const m=this.latestLocation,g=oi(m,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...g}),this.emit({type:"onBeforeLoad",...g}),await em({router:this,sync:r?.sync,forceStaleReload:u.href===m.href,matches:this.stores.pendingMatches.get(),location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=null,w=null,b=null,x=null;this.batch(()=>{const _=this.stores.pendingMatches.get(),E=_.length,R=this.stores.matches.get();v=E?R.filter($=>!this.stores.pendingMatchStores.has($.id)):null;const A=new Set;for(const $ of this.stores.pendingMatchStores.values())$.routeId&&A.add($.routeId);const I=new Set;for(const $ of this.stores.matchStores.values())$.routeId&&I.add($.routeId);w=E?R.filter($=>!A.has($.routeId)):null,b=E?_.filter($=>!I.has($.routeId)):null,x=E?_.filter($=>I.has($.routeId)):R,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),E&&(this.stores.setMatches(_),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...v.filter($=>$.status!=="error"&&$.status!=="notFound"&&$.status!=="redirected")]),this.clearExpiredCache())});for(const[_,E]of[[w,"onLeave"],[b,"onEnter"],[x,"onStay"]])if(_)for(const R of _)this.looseRoutesById[R.routeId].options[E]?.(R)})})}})}catch(m){Pt(m)?(o=m,this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):st(m)&&(a=m);const g=o?o.status:a?404:this.stores.matches.get().some(v=>v.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(g),this.stores.redirect.set(o)})}this.latestLoadPromise===c&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=c,await c;this.latestLoadPromise&&c!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.stores.matches.get().some(f=>f.status==="error")&&(h=500),h!==void 0&&this.stores.statusCode.set(h)},this.startViewTransition=r=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,c=this.stores.resolvedLocation.get(),u=typeof s.types=="function"?s.types(oi(a,c)):s.types;if(u===!1){r();return}o={update:r,types:u}}else o=r;document.startViewTransition(o)}else r()},this.updateMatch=(r,s)=>{this.startTransition(()=>
9{const o=this.stores.pendingMatchStores.get(r);if(o){o.set(s);return}const a=this.stores.matchStores.get(r);if(a){a.set(s);return}const c=this.stores.cachedMatchStores.get(r);if(c){const u=s(c.get());u.status==="redirected"?this.stores.cachedMatchStores.delete(r)&&this.stores.cachedIds.set(h=>h.filter(f=>f!==r)):c.set(u)}})},this.getMatch=r=>this.stores.cachedMatchStores.get(r)?.get()??this.stores.pendingMatchStores.get(r)?.get()??this.stores.matchStores.get(r)?.get(),this.invalidate=r=>{const s=o=>r?.filter?.(o)??!0?{...o,invalid:!0,...r?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(s)),this.stores.setCached(this.stores.cachedMatches.get().map(s)),this.stores.setPending(this.stores.pendingMatches.get().map(s))}),this.shouldViewTransition=!1,this.load({sync:r?.sync})},this.getParsedLocationHref=r=>r.publicHref||"/",this.resolveRedirect=r=>{const s=r.headers.get("Location");if(!r.options.href||r.options._builtLocation){const o=r.options._builtLocation??this.buildLocation(r.options),a=this.getParsedLocationHref(o);r.options.href=a,r.headers.set("Location",a)}else if(s)try{const o=new URL(s);if(this.origin&&o.origin===this.origin){const a=o.pathname+o.search+o.hash;r.options.href=a,r.headers.set("Location",a)}}catch{}if(r.options.href&&!r.options._builtLocation&&Al(r.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return r.headers.get("Location")||r.headers.set("Location",r.options.href),r},this.clearCache=r=>{const s=r?.filter;s!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(o=>!s(o))):this.stores.setCached([])},this.clearExpiredCache=()=>{const r=Date.now(),s=o=>{const a=this.looseRoutesById[o.routeId];if(!a.options.loader)return!0;const c=(o.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return o.status==="error"?!0:r-o.updatedAt>=c};this.clearCache({filter:s})},this.loadRouteChunk=Co,this.preloadRoute=async r=>{const s=r._builtLocation??this.buildLocation(r);let o=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:r});const a=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),c=new Set([...a,...this.stores.cachedIds.get()]),u=o.filter(h=>!c.has(h.id));if(u.length){const h=this.stores.cachedMatches.get();this.stores.setCached([...h,...u])}try{return o=await em({router:this,matches:o,location:s,preload:!0,updateMatch:(h,f)=>{a.has(h)?o=o.map(m=>m.id===h?f(m):m):this.updateMatch(h,f)}}),o}catch(h){if(Pt(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:s});st(h)||console.error(h);return}},this.matchRoute=(r,s)=>{const o={...r,to:r.to?this.resolvePathWithBase(r.from||"",r.to):void 0,params:r.params||{},leaveParams:!0},a=this.buildLocation(o);if(s?.pending&&this.stores.status.get()!=="pending")return!1;const c=(s?.pending===void 0?!this.stores.isLoading.get():s.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),u=eS(a.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!u||r.params&&!vt(u.rawParams,r.params,{partial:!0})?!1:s?.includeSearch??!0?vt(c.search,a.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(r=>r.status==="notFound"||r.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??hS,parseSearch:e.parseSearch??dS,protocolAllowlist:e.protocolAllowlist??Vb}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:r}){this.routesById=e,this.routesByPath=t,this.processedTree=r;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Vy(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const r=this.getMatchedRoutes(e.pathname),{foundRoute:s,routeParam
9s:o}=r;let{matchedRoutes:a}=r,c=!1;(s?s.path!=="/"&&o["**"]:Vr(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const u=c?NS(this.options.notFoundMode,a):void 0,h=new Array(a.length),f=new Map;for(const m of this.stores.matchStores.values())m.routeId&&f.set(m.routeId,m.get());for(let m=0;m<a.length;m++){const g=a[m],v=h[m-1];let w,b,x;{const G=v?.search??e.search,ae=v?._strictSearch??void 0;try{const ce=El(g.options.validateSearch,{...G})??void 0;w={...G,...ce},b={...ae,...ce},x=void 0}catch(ce){let we=ce;if(ce instanceof Ll||(we=new Ll(ce.message,{cause:ce})),t?.throwOnError)throw we;w=G,b={},x=we}}const _=g.options.loaderDeps?.({search:w})??"",E=_?JSON.stringify(_):"",{interpolatedPath:R,usedParams:A}=Jg({path:g.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),I=g.id+R+E,$=this.getMatch(I),F=f.get(g.id),M=$?._strictParams??A;let z;if(!$)try{im(g,M)}catch(G){if(st(G)||Pt(G)?z=G:z=new AS(G.message,{cause:G}),t?.throwOnError)throw z}Object.assign(o,M);const V=F?"stay":"enter";let K;if($)K={...$,cause:V,params:F?.params??o,_strictParams:M,search:Jn(F?F.search:$.search,w),_strictSearch:b};else{const G=g.options.loader||g.options.beforeLoad||g.lazyFn||Xy(g)?"pending":"success";K={id:I,ssr:g.options.ssr,index:m,routeId:g.id,params:F?.params??o,_strictParams:M,pathname:R,updatedAt:Date.now(),search:F?Jn(F.search,w):w,_strictSearch:b,searchError:void 0,status:G,isFetching:!1,error:void 0,paramsError:z,__routeContext:void 0,_nonReactive:{loadPromise:cs()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:V,loaderDeps:F?ts(F.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}t?.preload||(K.globalNotFound=u===g.id),K.searchError=x;const te=this.getParentContext(v);
9K.context={...te,...K.__routeContext,...K.__beforeLoadContext},h[m]=K}for(let m=0;m<h.length;m++){const g=h[m],v=this.looseRoutesById[g.routeId],w=this.getMatch(g.id),b=f.get(g.routeId);if(g.params=b?Jn(b.params,o):o,!w){const x=h[m-1],_=this.getParentContext(x);if(v.options.context){const E={deps:g.loaderDeps,params:g.params,context:_??{},location:e,navigate:R=>this.navigate({...R,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:h,routeId:v.id};g.__routeContext=v.options.context(E)??void 0}g.context={..._,...g.__routeContext,...g.__beforeLoadContext}}}return h}matchRoutesLightweight(e){const t=Eo(this.stores.matchesId.get()),r=this.lightweightCache.get(e);if(r&&r[0]===t)return r[1];const{matchedRoutes:s,routeParams:o}=this.getMatchedRoutes(e.pathname),a=Eo(s),c={...e.search};for(const g of s)try{Object.assign(c,El(g.options.validateSearch,c))}catch{}const u=t&&this.stores.matchStores.get(t)?.get(),h=u&&u.routeId===a.id&&u.pathname===e.pathname;let f;if(h)f=u.params;else{const g=Object.assign(Object.create(null),o);for(const v of s)try{im(v,g)}catch{}f=g}const m={matchedRoutes:s,fullPath:a.fullPath,search:c,params:f};return this.lightweightCache.set(e,[t,m]),m}},Ll=class extends Error{},AS=class extends Error{};function OS(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function El(e,t){if(e==null)return{};if("~standard"in e){const r=e["~standard"].validate(t);if(r instanceof Promise)throw new Ll("Async validation not supported");if(r.issues)throw new Ll(JSON.stringify(r.issues,void 0,2),{cause:r});return r.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function IS({pathname:e,routesById:t,processedTree:r}){const s=Object.create(null),o=Vr(e);let a;const c=tS(o,r,!0);return c&&(a=c.route,Object.assign(s,c.rawParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:s,foundRoute:a}}function LS({search:e,dest:t,destRoutes:r,_includeValidateSearch:s}){return jS(r)(e,t,s??!1)}function jS(e){let t,r;const s=[];for(const a of e){const c=a.options;if("search"in c)c.search?.middlewares&&s.push(...c.search.middlewares);else if(c.preSearchFilters||c.postSearchFilters){const h=({search:f,next:m})=>{const g=m(c.preSearchFilters?c.preSearchFilters.reduce((v,w)=>w(v),f):f);return c.postSearchFilters?c.postSearchFilters.reduce((v,w)=>w(v),g):g};s.push(h)}const u=c.validateSearch;if(u){const h=({search:f,next:m,meta:g})=>{const v=m(f);if(r)try{const w=El(u,v);if(g&&w)for(const b in w)b in v||(g.defaulted||=new Map).set(b,w[b]);return{...v,...w}}catch{}return v};s.push(h)}}const o=(a,c,u)=>{if(a>=s.length){if(!t.search)return{};if(t.search===!0)return c;const f=es(t.search,c);return u&&(u.explicit=f),f}const h=(f,m)=>{if(m){const g=u||{};return{search:o(a+1,f,g),meta:g}}return o(a+1,f,u)};return s[a]({search:c,next:h,meta:u})};return function(c,u,h){return t=u,r=h,o(0,c)}}function NS(e,t){if(e!=="root")for(let r=t.length-1;r>=0;r--){const s=t[r];if(s.children)return s.id}return os}function im(e,t){const r=e.options.params?.parse??e.options.parseParams;if(r){const s=r(t);if(s===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,s)}}function MS(){try{return sessionStorage}catch{return}}const $S="tsr-scroll-restoration-v1_3",ev=MS();function DS(){try{return JSON.parse(ev?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}function US(){try{ev?.setItem($S,JSON.stringify(Ys))}catch{}}const Ys=DS(),om="data-scroll-restoration-id",FS=e=>e.state.__TSR_key||e.href;function BS(e){const t=e.getAttribute(om);if(t)return`[${om}="${t}"]`;let r="",s=e,o;for(;o=s.parentNode;){let a=1,c=s;for(;c=c.previousElementSibling;)a++;const u=`${s.localName}:nth-child(${a})`;r=r?`${u} > ${r}`:u,s=o}return r}let al=!1;const Xs="window";function jd(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function am(e){const t=[];for(const r of e){if(r===Xs)continue;const s=jd(r);s&&t.push(s)}return t}function zS(e,t){const r=e.options.scrollRestoration,s=e._scroll;r&&(s.restoring=!0);const o=e.options.getScrollRestorationKey||FS,a=new Map,c=(f,m,g)=>{const v=a.get(f)||{};v.scrollX=m,v.scrollY=g,a.set(f,v)},u=f=>{if(!(al||!s.restoring))if(f.target===document)c(Xs,scrollX,scrollY);else{const m=f.target;c(m,m.scrollLeft,m.scrollTop)}},h=f=>{if(!s.restoring)return;const m=Ys[f]||={};for(const[g,v]of a)g===Xs?m[Xs]=v:g.isConnected&&(m[BS(g)]=v)};r&&!s.restoration&&(s.restoration=!0,al=!1,history.scrollRestoration="manual",document.addEventListener("scroll",u,!0),e.subscribe("onBeforeLoad",f=>{f.fromLocation&&h(o(f.fromLocation)),a.clear()}),addEventListener("pagehide",()=>{h(o(e.stores.resolvedLocation.get()??e.stores.location.get())),US()})),!s.reset&&(s.reset=!0,e.subscribe("onRendered",f=>{const m=e.options.scrollRestorationBehavior,g=e.options.scrollToTopSelectors,v=s.next;let w;
9if(a.clear(),v||(s.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const b=o(f.toLocation),x=f.fromLocation&&o(f.fromLocation);if(s.restoring&&x&&x!==b){const _=Ys[x];if(_){let E=Ys[b];for(const R in _){if(R===Xs){if(v)continue}else{const A=jd(R);if(!A||v&&g&&(w??=am(g),w.includes(A)))continue}E||(E=Ys[b]={}),E[R]??=_[R]}}}al=!0;try{const _=f.toLocation.hash,E=f.toLocation.state.__hashScrollIntoViewOptions??!0;let R=!1;if(v){const A=Ld.get(f.toLocation),I=_&&E&&(A==="PUSH"||A==="REPLACE"),$=s.restoring?Ys[b]:void 0;if($)for(const F in $){const{scrollX:M,scrollY:z}=$[F];if(F===Xs){if(I)continue;scrollTo({top:z,left:M,behavior:m}),R=!0}else{const V=jd(F);V&&(V.scrollLeft=M,V.scrollTop=z)}}if(!R&&!_){const F={top:0,left:0,behavior:m};if(scrollTo(F),g){w??=am(g);for(const M of w)M.scrollTo(F)}}}!R&&_&&E&&document.getElementById(_)?.scrollIntoView(E)}finally{al=!1}}))}const Er=Symbol.for("TSR_DEFERRED_PROMISE");function HS(e,t){const r=e;return r[Er]||(r[Er]={status:"pending"},r.then(s=>{r[Er].status="success",r[Er].data=s}).catch(s=>{r[Er].status="error",r[Er].error={data:TS(s),__isServerError:!0}})),r}const WS="Error preloading route! ☝️";function tv(e,t){if(e)return typeof e=="string"?e:e[t]}function VS(e){return e?.scriptFormat??"module"}function qS(e,t,r){const s=KS(t),o=tv(r,"script")??s.crossOrigin;return{...VS(e)==="iife"?{rel:"preload",as:"script"}:{rel:"modulepreload"},href:s.href,...o?{crossOrigin:o}:{}}}function KS(e){return typeof e=="string"?{href:e,crossOrigin:void 0}:e}function ll(e,t){if(t.length===0)return;if(t.length===1){e.push(t[0]);return}const r=new Set;for(const s of t){const o=JSON.stringify(s);r.has(o)||(r.add(o),e.push(s))}}function GS(e){return typeof e=="string"?{href:e,crossOrigin:void 0}:e}var rv=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const r=this.options,s=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),s?this._path=os:this.parentRoute||Ot();let o=s?os:r?.path;o&&o!=="/"&&(o=qy(o));const a=r?.id||o;let c=s?os:Sl([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);o==="__root__"&&(o="/"),c!=="__root__"&&(c=Sl(["/",c]));const u=c==="__root__"?"/":Sl([this.parentRoute.fullPath,o]);this._path=o,this._id=c,this._fullPath=u,this._to=Vr(u)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Gl({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},JS=class extends rv{constructor(e){super(e)}},QS=(e=>(e[e.AggregateError=1]="AggregateError",e[e.ArrowFunction=2]="ArrowFunction",e[e.ErrorPrototypeStack=4]="ErrorPrototypeStack",e[e.ObjectAssign=8]="ObjectAssign",e[e.BigIntTypedArray=16]="BigIntTypedArray",e[e.RegExp=32]="RegExp",e))(QS||{}),Kr=Symbol.asyncIterator,nv=Symbol.hasInstance,ai=Symbol.isConcatSpreadable,Gr=Symbol.iterator,sv=Symbol.match,iv=Symbol.matchAll,ov=Symbol.replace,av=Symbol.search,lv=Symbol.species,cv=Symbol.split,uv=Symbol.toPrimitive,li=Symbol.toStringTag,dv=Symbol.unscopables,hv={[Kr]:0,[nv]:1,[ai]:2,[Gr]:3,[sv]:4,[iv]:5,[ov]:6,[av]:7,[lv]:8,[cv]:9,[uv]:10,[li]:11,[dv]:12},YS={0:Kr,1:nv,2:ai,3:Gr,4:sv,5:iv,6:ov,7:av,8:lv,9:cv,10:uv,11:li,12:dv},k=void 0,XS={2:!0,3:!1,1:k,0:null,4:-0,5:Number.POSITIVE_INFINITY,6:Number.NEGATIVE_INFINITY,7:Number.NaN},ZS={0:"Error",1:"EvalError",2:"RangeError",3:"ReferenceError",4:"SyntaxError",5:"TypeError",6:"URIError"},ex={0:Error,1:EvalError,2:RangeError,3:ReferenceError,4:SyntaxError,5:TypeError,6:URIError};function Te(e,t,r,s,o,a,c,u,h,f,m,g){return{t:e,i:t,s:r,c:s,m:o,p:a,e:c,a:u,f:h,b:f,o:m,l:g}}function In(e){return Te(2,k,e,k,k,k,k,k,k,k,k,k)}var fv=In(2),pv=In(3),tx=In(1),rx=In(0),nx=In(4),sx=In(5),ix=In(6),ox=In(7);function ax(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case`
10`:return"\\n";case"\r":return"\\r";case"\b":return"\\b";case"	":return"\\t";case"\f":return"\\f";case"<":return"\\x3C";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:return k}}function Ln(e){let t="",r=0,s;for(let o=0,a=e.length;o<a;o++)s=ax(e[o]),s&&(t+=e.slice(r,o)+s,r=o+1);return r===0?t=e:t+=e.slice(r),t}function lx(e){switch(e){case"\\\\":return"\\";case'\\"':return'"';case"\\n":return`
11`;case"\\r":return"\r";case"\\b":return"\b";case"\\t":return"	";case"\\f":return"\f";case"\\x3C":return"<";case"\\u2028":return"\u2028";case"\\u2029":return"\u2029";default:return e}}function jn(e){return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g,lx)}var cl="__SEROVAL_REFS__",gv=new Map,si=new Map;function mv(e){return gv.has(e)}function cx(e){return si.has(e)}function ux(e){if(mv(e))return gv.get(e);throw new Bx(e)}function dx(e){if(cx(e))return si.get(e);throw new zx(e)}typeof globalThis<"u"?Object.defineProperty(globalThis,cl,{value:si,configurable:!0,writable:!1,enumerable:!1}):typeof window<"u"?Object.defineProperty(window,cl,{value:si,configurable:!0,writable:!1,enumerable:!1}):typeof self<"u"?Object.defineProperty(self,cl,{value:si,configurable:!0,writable:!1,enumerable:!1}):typeof global<"u"&&Object.defineProperty(global,cl,{value:si,configurable:!0,writable:!1,enumerable:!1});function mh(e){return e instanceof EvalError?1:e instanceof RangeError?2:e instanceof ReferenceError?3:e instanceof SyntaxError?4:e instanceof TypeError?5:e instanceof URIError?6:0}function hx(e){let t=ZS[mh(e)];return e.name!==t?{name:e.name}:e.constructor.name!==t?{name:e.constructor.name}:{}}function yv(e,t){let r=hx(e),s=Object.getOwnPropertyNames(e);for(let o=0,a=s.length,c;o<a;o++)c=s[o],c!=="name"&&c!=="message"&&(c==="stack"?t&4&&(r=r||{},r[c]=e[c]):(r=r||{},r[c]=e[c]));return r}function vv(e){return Object.isFrozen(e)?3:Object.isSealed(e)?2:Object.isExtensible(e)?0:1}
11function fx(e){switch(e){case Number.POSITIVE_INFINITY:return sx;case Number.NEGATIVE_INFINITY:return ix}return e!==e?ox:Object.is(e,-0)?nx:Te(0,k,e,k,k,k,k,k,k,k,k,k)}function wv(e){return Te(1,k,Ln(e),k,k,k,k,k,k,k,k,k)}function px(e){return Te(3,k,""+e,k,k,k,k,k,k,k,k,k)}function gx(e){return Te(4,e,k,k,k,k,k,k,k,k,k,k)}function mx(e,t){let r=t.valueOf();return Te(5,e,r!==r?"":t.toISOString(),k,k,k,k,k,k,k,k,k)}function yx(e,t){return Te(6,e,k,Ln(t.source),t.flags,k,k,k,k,k,k,k)}function vx(e,t){return Te(17,e,hv[t],k,k,k,k,k,k,k,k,k)}function wx(e,t){return Te(18,e,Ln(ux(t)),k,k,k,k,k,k,k,k,k)}function _x(e,t,r){return Te(25,e,r,Ln(t),k,k,k,k,k,k,k,k)}function bx(e,t,r){return Te(9,e,k,k,k,k,k,r,k,k,vv(t),k)}function Sx(e,t){return Te(21,e,k,k,k,k,k,k,t,k,k,k)}function xx(e,t,r){return Te(15,e,k,t.constructor.name,k,k,k,k,r,t.byteOffset,k,t.length)}function Ex(e,t,r){return Te(16,e,k,t.constructor.name,k,k,k,k,r,t.byteOffset,k,t.byteLength)}function kx(e,t,r){return Te(20,e,k,k,k,k,k,k,r,t.byteOffset,k,t.byteLength)}function Rx(e,t,r){return Te(13,e,mh(t),k,Ln(t.message),r,k,k,k,k,k,k)}function Cx(e,t,r){return Te(14,e,mh(t),k,Ln(t.message),r,k,k,k,k,k,k)}function Tx(e,t){return Te(7,e,k,k,k,k,k,t,k,k,k,k)}function Px(e,t){return Te(28,k,k,k,k,k,k,[e,t],k,k,k,k)}function Ax(e,t){return Te(30,k,k,k,k,k,k,[e,t],k,k,k,k)}function Ox(e,t,r){return Te(31,e,k,k,k,k,k,r,t,k,k,k)}function Ix(e,t){return Te(32,e,k,k,k,k,k,k,t,k,k,k)}function Lx(e,t){return Te(33,e,k,k,k,k,k,k,t,k,k,k)}function jx(e,t){return Te(34,e,k,k,k,k,k,k,t,k,k,k)}function Nx(e,t,r,s){return Te(35,e,r,k,k,k,k,t,k,k,k,s)}var Mx={parsing:1,serialization:2,deserialization:3};function $x(e){return`Seroval Error (step: ${Mx[e]})`}var Dx=(e,t)=>$x(e),_v=class extends Error{constructor(e,t){super(Dx(e)),this.cause=t}},lm=class extends _v{constructor(e){super("parsing",e)}},Ux=class extends _v{constructor(e){super("deserialization",e)}};function Jr(e){return`Seroval Error (specific: ${e})`}var Ql=class extends Error{constructor(t){super(Jr(1)),this.value=t}},bv=class extends Error{constructor(e){super(Jr(2))}},Fx=class extends Error{constructor(t){super(Jr(3))}},Wo=class extends Error{constructor(e){super(Jr(4))}},Bx=class extends Error{constructor(e){super(Jr(5)),this.value=e}},zx=class extends Error{constructor(e){super(Jr(6))}},Hx=class extends Error{constructor(e){super(Jr(7))}},Qr=class extends Error{constructor(e){super(Jr(8))}},Wx=class extends Error{constructor(e){super(Jr(9))}},Vx=class{constructor(e,t){this.value=e,this.replacement=t}},Yl=()=>{let e={p:0,s:0,f:0};return e.p=new Promise((t,r)=>{e.s=t,e.f=r}),e},qx=(e,t)=>{e.s(t),e.p.s=1,e.p.v=t},Kx=(e,t)=>{e.f(t),e.p.s=2,e.p.v=t};Yl.toString();qx.toString();Kx.toString();var Gx=()=>{let e=[],t=[],r=!0,s=!1,o=0,a=(h,f,m)=>{for(m=0;m<o;m++)t[m]&&t[m][f](h)},c=(h,f,m,g)=>{for(f=0,m=e.length;f<m;f++)g=e[f],!r&&f===m-1?h[s?"return":"throw"](g):h.next(g)},u=(h,f)=>(r&&(f=o++,t[f]=h),c(h),()=>{r&&(t[f]=t[o],t[o--]=void 0)});return{__SEROVAL_STREAM__:!0,on:h=>u(h),next:h=>{r&&(e.push(h),a(h,"next"))},throw:h=>{r&&(e.push(h),a(h,"throw"),r=!1,s=!1,t.length=0)},return:h=>{r&&(e.push(h),a(h,"return"),r=!1,s=!0,t.length=0)}}},Jx=e=>t=>()=>{let r=0,s={[e]:()=>s,next:()=>{if(r>t.d)return{done:!0,value:void 0};let o=r++,a=t.v[o];if(o===t.t)throw a;return{done:o===t.d,value:a}}};return s},Qx=(e,t)=>r=>()=>{let s=0,o=-1,a=!1,c=[],u=[],h=(m=0,g=u.length)=>{for(;m<g;m++)u[m].s({done:!0,value:void 0})};r.on({next:m=>{let g=u.shift();g&&g.s({done:!1,value:m}),c.push(m)},throw:m=>{let g=u.shift();g&&g.f(m),h(),o=c.length,a=!0,c.push(m)},return:m=>{let g=u.shift();g&&g.s({done:!0,value:m}),h(),o=c.length,c.push(m)}});let f={[e]:()=>f,next:()=>{if(o===-1){let v=s++;if(v>=c.length){let w=t();return u.push(w),w.p}return{done:!1,value:c[v]}}if(s>o)return{done:!0,value:void 0};let m=s++,g=c[m];if(m!==o)return{done:!1,value:g};if(a)throw g;return{done:!0,value:g}}};return f},Sv=e=>{let t=atob(e),r=t.length,s=new Uint8Array(r);for(let o=0;o<r;o++)s[o]=t.charCodeAt(o);return s.buffer};Sv.toString();
11function Yx(e){return"__SEROVAL_SEQUENCE__"in e}function xv(e,t,r){return{__SEROVAL_SEQUENCE__:!0,v:e,t,d:r}}function Xx(e){let t=[],r=-1,s=-1,o=e[Gr]();for(;;)try{let a=o.next();if(t.push(a.value),a.done){s=t.length-1;break}}catch(a){r=t.length,t.push(a)}return xv(t,r,s)}var Zx=Jx(Gr);function eE(e){return Zx(e)}var tE={},rE={},nE={0:{},1:{},2:{},3:{},4:{},5:{}};function sE(e){return"__SEROVAL_STREAM__"in e}function hs(){return Gx()}function iE(e){let t=hs(),r=e[Kr]();async function s(){try{let o=await r.next();o.done?t.return(o.value):(t.next(o.value),await s())}catch(o){t.throw(o)}}return s().catch(()=>{}),t}var oE=Qx(Kr,Yl);function aE(e){return oE(e)}async function lE(e){try{return[1,await e]}catch(t){return[0,t]}}function cE(e,t){return{plugins:t.plugins,mode:e,marked:new Set,features:63^(t.disabledFeatures||0),refs:t.refs||new Map,depthLimit:t.depthLimit||1e3}}function kl(e,t){e.marked.add(t)}function uE(e,t){let r=e.refs.size;return e.refs.set(t,r),r}function Xl(e,t){let r=e.refs.get(t);return r!=null?(kl(e,r),{type:1,value:gx(r)}):{type:0,value:uE(e,t)}}function yh(e,t){let r=Xl(e,t);return r.type===1?r:mv(t)?{type:2,value:wx(r.value,t)}:r}function ns(e,t){let r=yh(e,t);if(r.type!==0)return r.value;if(t in hv)return vx(r.value,t);throw new Ql(t)}function Zl(e,t){let r=Xl(e,nE[t]);return r.type===1?r.value:Te(26,r.value,t,k,k,k,k,k,k,k,k,k)}function dE(e){let t=Xl(e,tE);return t.type===1?t.value:Te(27,t.value,k,k,k,k,k,k,ns(e,Gr),k,k,k)}function hE(e){let t=Xl(e,rE);return t.type===1?t.value:Te(29,t.value,k,k,k,k,k,[Zl(e,1),ns(e,Kr)],k,k,k,k)}function fE(e,t,r,s){return Te(r?11:10,e,k,k,k,s,k,k,k,k,vv(t),k)}function pE(e,t,r,s){return Te(8,t,k,k,k,k,{k:r,v:s},k,Zl(e,0),k,k,k)}function gE(e,t,r){let s=new Uint8Array(r),o="";for(let a=0,c=s.length;a<c;a++)o+=String.fromCharCode(s[a]);return Te(19,t,Ln(btoa(o)),k,k,k,k,k,Zl(e,5),k,k,k)}function mE(e,t){return{base:cE(e,t),child:void 0}}var yE=class{constructor(e,t){this._p=e,this.depth=t}parse(e){return Ze(this._p,this.depth,e)}};async function vE(e,t,r){let s=[];for(let o=0,a=r.length;o<a;o++)o in r?s[o]=await Ze(e,t,r[o]):s[o]=0;return s}async function wE(e,t,r,s){return bx(r,s,await vE(e,t,s))}async function vh(e,t,r){let s=Object.entries(r),o=[],a=[];for(let c=0,u=s.length;c<u;c++)o.push(Ln(s[c][0])),a.push(await Ze(e,t,s[c][1]));return Gr in r&&(o.push(ns(e.base,Gr)),a.push(Px(dE(e.base),await Ze(e,t,Xx(r))))),Kr in r&&(o.push(ns(e.base,Kr)),a.push(Ax(hE(e.base),await Ze(e,t,iE(r))))),li in r&&(o.push(ns(e.base,li)),a.push(wv(r[li]))),ai in r&&(o.push(ns(e.base,ai)),a.push(r[ai]?fv:pv)),{k:o,v:a}}async function hd(e,t,r,s,o){return fE(r,s,o,await vh(e,t,s))}async function _E(e,t,r,s){return Sx(r,await Ze(e,t,s.valueOf()))}async function bE(e,t,r,s){return xx(r,s,await Ze(e,t,s.buffer))}async function SE(e,t,r,s){return Ex(r,s,await Ze(e,t,s.buffer))}async function xE(e,t,r,s){return kx(r,s,await Ze(e,t,s.buffer))}async function cm(e,t,r,s){let o=yv(s,e.base.features);return Rx(r,s,o?await vh(e,t,o):k)}async function EE(e,t,r,s){let o=yv(s,e.base.features);return Cx(r,s,o?await vh(e,t,o):k)}async function kE(e,t,r,s){let o=[],a=[];for(let[c,u]of s.entries())o.push(await Ze(e,t,c)),a.push(await Ze(e,t,u));return pE(e.base,r,o,a)}async function RE(e,t,r,s){let o=[];for(let a of s.keys())o.push(await Ze(e,t,a));return Tx(r,o)}async function Ev(e,t,r,s){let o=e.base.plugins;if(o)for(let a=0,c=o.length;a<c;a++){let u=o[a];if(u.parse.async&&u.test(s))return _x(r,u.tag,await u.parse.async(s,new yE(e,t),{id:r}))}return k}async function CE(e,t,r,s){let[o,a]=await lE(s);return Te(12,r,o,k,k,k,k,k,await Ze(e,t,a),k,k,k)}function TE(e,t,r,s,o){let a=[],c=r.on({next:u=>{kl(this.base,t),Ze(this,e,u).then(h=>{a.push(Ix(t,h))},h=>{o(h),c()})},throw:u=>{kl(this.base,t),Ze(this,e,u).then(h=>{a.push(Lx(t,h)),s(a),c()},h=>{o(h),c()})},return:u=>{kl(this.base,t),Ze(this,e,u).then(h=>{a.push(jx(t,h)),s(a),c()},h=>{o(h),c()})}})}async function PE(e,t,r,s){return Ox(r,Zl(e.base,4),await new Promise(TE.bind(e,t,r,s)))}async function AE(e,t,r,s){let o=[];for(let a=0,c=s.v.length;a<c;a++)o[a]=await Ze(e,t,s.v[a]);return Nx(r,o,s.t,s.d)}async function OE(e,t,r,s){if(Array.isArray(s))return wE(e,t,r,s);if(sE(s))return PE(e,t,r,s);if(Yx(s))return AE(e,t,r,s);let o=s.constructor;if(o===Vx)return Ze(e,t,s.replacement);let a=await Ev(e,t,r,s);if(a)return a;switch(o){case Object:return hd(e,t,r,s,!1);case k:return hd(e,t,r,s,!0);case Date:return mx(r,s);case Error:case EvalError:case RangeError:case ReferenceError:case SyntaxError:case TypeError:case URIError:return cm(e,t,r,s);case Number:case Boolean:case String:case BigInt:return _E(e,t,r,s);case ArrayBuffer:return gE(e.base,r,s);case Int8Array:case Int16Array:case Int32Array:case Uint8Array:case Uint16Array:case Uint32Array:case Uint8ClampedArray:case Float32Array:case Float64Array:return bE(e,t,r,s);case DataView:return xE(e,t,r,s);case Map:return kE(e,t,r,s);case Set:return RE(e,t,r,s)}if(o===Promise||s instanceof Promise)return CE(e,t,r,s);let c=e.base.features;if(c&32&&o===RegExp)return yx(r,s);if(c&16)switch(o){case BigInt64Array:case BigUint64Array:return SE(e,t,r,s)}if(c&1&&typeof AggregateError<"u"&&(o===AggregateError||s instanceof AggregateError))return EE(e,t,r,s);if(s instanceof Error)return cm(e,t,r,s);if(Gr in s||Kr in s)return hd(e,t,r,s,!!o);throw new Ql(s)}
11async function IE(e,t,r){let s=yh(e.base,r);if(s.type!==0)return s.value;let o=await Ev(e,t,s.value,r);if(o)return o;throw new Ql(r)}async function Ze(e,t,r){switch(typeof r){case"boolean":return r?fv:pv;case"undefined":return tx;case"string":return wv(r);case"number":return fx(r);case"bigint":return px(r);case"object":{if(r){let s=yh(e.base,r);return s.type===0?await OE(e,t+1,s.value,r):s.value}return rx}case"symbol":return ns(e.base,r);case"function":return IE(e,t,r);default:throw new Ql(r)}}async function LE(e,t){try{return await Ze(e,0,t)}catch(r){throw r instanceof lm?r:new lm(r)}}var jE=(e=>(e[e.Vanilla=1]="Vanilla",e[e.Cross=2]="Cross",e))(jE||{});function kv(e,t){for(let r=0,s=t.length;r<s;r++){let o=t[r];e.has(o)||(e.add(o),o.extends&&kv(e,o.extends))}}function Rv(e){if(e){let t=new Set;return kv(t,e),[...t]}}function NE(e){switch(e){case"Int8Array":return Int8Array;case"Int16Array":return Int16Array;case"Int32Array":return Int32Array;case"Uint8Array":return Uint8Array;case"Uint16Array":return Uint16Array;case"Uint32Array":return Uint32Array;case"Uint8ClampedArray":return Uint8ClampedArray;case"Float32Array":return Float32Array;case"Float64Array":return Float64Array;case"BigInt64Array":return BigInt64Array;case"BigUint64Array":return BigUint64Array;default:throw new Hx(e)}}var ME=1e6,$E=1e4,DE=2e4;function Cv(e,t){switch(t){case 3:return Object.freeze(e);case 1:return Object.preventExtensions(e);case 2:return Object.seal(e);default:return e}}var UE=1e3;function FE(e,t){var r;let s=t.refs||new Map;return"types"in s||Object.assign(s,{types:new Map}),{mode:e,plugins:t.plugins,refs:s,features:(r=t.features)!=null?r:63^(t.disabledFeatures||0),depthLimit:t.depthLimit||UE}}function BE(e){return{mode:2,base:FE(2,e),child:k}}var zE=class{constructor(e,t){this._p=e,this.depth=t}deserialize(e){return Ie(this._p,this.depth,e)}};function Tv(e,t){if(t<0||!Number.isFinite(t)||!Number.isInteger(t))throw new Qr({t:4,i:t});if(e.refs.has(t))throw new Error("Conflicted ref id: "+t)}function HE(e,t,r){return Tv(e.base,t),e.state.marked.has(t)&&e.base.refs.set(t,r),r}function WE(e,t,r){return Tv(e.base,t),e.base.refs.set(t,r),r}function et(e,t,r){return e.mode===1?HE(e,t,r):WE(e,t,r)}function Nd(e,t,r){if(Object.hasOwn(t,r))return t[r];throw new Qr(e)}function VE(e,t){return et(e,t.i,dx(jn(t.s)))}function qE(e,t,r){let s=r.a,o=s.length,a=et(e,r.i,new Array(o));for(let c=0,u;c<o;c++)u=s[c],u&&(a[c]=Ie(e,t,u));return Cv(a,r.o),a}function KE(e){switch(e){case"constructor":case"__proto__":case"prototype":case"__defineGetter__":case"__defineSetter__":case"__lookupGetter__":case"__lookupSetter__":return!1;default:return!0}}function GE(e){switch(e){case Kr:case ai:case li:case Gr:return!0;default:return!1}}function um(e,t,r){KE(t)?e[t]=r:Object.defineProperty(e,t,{value:r,configurable:!0,enumerable:!0,writable:!0})}function JE(e,t,r,s,o){if(typeof s=="string")um(r,jn(s),Ie(e,t,o));else{let a=Ie(e,t,s);switch(typeof a){case"string":um(r,a,Ie(e,t,o));break;case"symbol":GE(a)&&(r[a]=Ie(e,t,o));break;default:throw new Qr(s)}}}function Pv(e,t,r){e.base.refs.types.set(t,r)}function Vo(e,t,r,s){if(e.base.refs.types.get(r)!==s)throw new Qr(t)}function Av(e,t,r,s){let o=r.k;if(o.length>0)for(let a=0,c=r.v,u=o.length;a<u;a++)JE(e,t,s,o[a],c[a]);return s}function QE(e,t,r){let s=et(e,r.i,r.t===10?{}:Object.create(null));return Av(e,t,r.p,s),Cv(s,r.o),s}function YE(e,t){return et(e,t.i,new Date(t.s))}function XE(e,t){if(e.base.features&32){let r=jn(t.c);if(r.length>DE)throw new Qr(t);return et(e,t.i,new RegExp(r,t.m))}throw new bv(t)}function ZE(e,t,r){let s=et(e,r.i,new Set);for(let o=0,a=r.a,c=a.length;o<c;o++)s.add(Ie(e,t,a[o]));return s}function ek(e,t,r){let s=et(e,r.i,new Map);for(let o=0,a=r.e.k,c=r.e.v,u=a.length;o<u;o++)s.set(Ie(e,t,a[o]),Ie(e,t,c[o]));return s}function tk(e,t){if(t.s.length>ME)throw new Qr(t);return et(e,t.i,Sv(jn(t.s)))}function rk(e,t,r){var s;let o=NE(r.c),a=Ie(e,t,r.f),c=(s=r.b)!=null?s:0;if(c<0||c>a.byteLength)throw new Qr(r);return et(e,r.i,new o(a,c,r.l))}function nk(e,t,r){var s;let o=Ie(e,t,r.f),a=(s=r.b)!=null?s:0;if(a<0||a>o.byteLength)throw new Qr(r);return et(e,r.i,new DataView(o,a,r.l))}function Ov(e,t,r,s){if(r.p){let o=Av(e,t,r.p,{});Object.defineProperties(s,Object.getOwnPropertyDescriptors(o))}return s}function sk(e,t,r){let s=et(e,r.i,new AggregateError([],jn(r.m)));return Ov(e,t,r,s)}function ik(e,t,r){let s=Nd(r,ex,r.s),o=et(e,r.i,new s(jn(r.m)));return Ov(e,t,r,o)}function ok(e,t,r){let s=Yl(),o=et(e,r.i,s.p),a=Ie(e,t,r.f);return r.s?s.s(a):s.f(a),o}function ak(e,t,r){return et(e,r.i,Object(Ie(e,t,r.f)))}function lk(e,t,r){let s=e.base.plugins;if(s){let o=jn(r.c);for(let a=0,c=s.length;a<c;a++){let u=s[a];if(u.tag===o)return et(e,r.i,u.deserialize(r.s,new zE(e,t),{id:r.i}))}}throw new Fx(r.c)}function ck(e,t){let r=et(e,t.i,et(e,t.s,Yl()).p);return Pv(e,t.s,22),r}function uk(e,t,r){let s=e.base.refs.get(r.i);if(s)return Vo(e,r,r.i,22),s.s(Ie(e,t,r.a[1])),k;throw new Wo("Promise")}function dk(e,t,r){let s=e.base.refs.get(r.i);if(s)return Vo(e,r,r.i,22),s.f(Ie(e,t,r.a[1])),k;throw new Wo("Promise")}function hk(e,t,r){Ie(e,t,r.a[0]);let s=Ie(e,t,r.a[1]);return eE(s)}function fk(e,t,r){Ie(e,t,r.a[0]);let s=Ie(e,t,r.a[1]);return aE(s)}function pk(e,t,r){let s=et(e,r.i,hs());Pv(e,r.i,31);let o=r.a,a=o.length;if(a)for(let c=0;c<a;c++)Ie(e,t,o[c]);return s}function gk(e,t,r){let s=e.base.refs.get(r.i);
11if(s)return Vo(e,r,r.i,31),s.next(Ie(e,t,r.f)),k;throw new Wo("Stream")}function mk(e,t,r){let s=e.base.refs.get(r.i);if(s)return Vo(e,r,r.i,31),s.throw(Ie(e,t,r.f)),k;throw new Wo("Stream")}function yk(e,t,r){let s=e.base.refs.get(r.i);if(s)return Vo(e,r,r.i,31),s.return(Ie(e,t,r.f)),k;throw new Wo("Stream")}function vk(e,t,r){return Ie(e,t,r.f),k}function wk(e,t,r){return Ie(e,t,r.a[1]),k}function _k(e,t,r){let s=et(e,r.i,xv([],r.s,r.l));for(let o=0,a=r.a.length;o<a;o++)s.v[o]=Ie(e,t,r.a[o]);return s}function Ie(e,t,r){if(t>e.base.depthLimit)throw new Wx(e.base.depthLimit);switch(t+=1,r.t){case 2:return Nd(r,XS,r.s);case 0:return Number(r.s);case 1:return jn(String(r.s));case 3:if(String(r.s).length>$E)throw new Qr(r);return BigInt(r.s);case 4:return e.base.refs.get(r.i);case 18:return VE(e,r);case 9:return qE(e,t,r);case 10:case 11:return QE(e,t,r);case 5:return YE(e,r);case 6:return XE(e,r);case 7:return ZE(e,t,r);case 8:return ek(e,t,r);case 19:return tk(e,r);case 16:case 15:return rk(e,t,r);case 20:return nk(e,t,r);case 14:return sk(e,t,r);case 13:return ik(e,t,r);case 12:return ok(e,t,r);case 17:return Nd(r,YS,r.s);case 21:return ak(e,t,r);case 25:return lk(e,t,r);case 22:return ck(e,r);case 23:return uk(e,t,r);case 24:return dk(e,t,r);case 28:return hk(e,t,r);case 30:return fk(e,t,r);case 31:return pk(e,t,r);case 32:return gk(e,t,r);case 33:return mk(e,t,r);case 34:return yk(e,t,r);case 27:return vk(e,t,r);case 29:return wk(e,t,r);case 35:return _k(e,t,r);default:throw new bv(r)}}function bk(e,t){try{return Ie(e,0,t)}catch(r){throw new Ux(r)}}var Sk=()=>T;Sk.toString();function dm(e,t){let r=Rv(t.plugins),s=BE({plugins:r,refs:t.refs,features:t.features,disabledFeatures:t.disabledFeatures,depthLimit:t.depthLimit});return bk(s,e)}async function xk(e,t={}){let r=Rv(t.plugins),s=mE(1,{plugins:r,disabledFeatures:t.disabledFeatures});return{t:await LE(s,e),f:s.base.features,m:Array.from(s.base.marked)}}function Ek(e){return{tag:"$TSR/t/"+e.key,test:e.test,parse:{sync(t,r,s){return{v:r.parse(e.toSerializable(t))}},async async(t,r,s){return{v:await r.parse(e.toSerializable(t))}},stream(t,r,s){return{v:r.parse(e.toSerializable(t))}}},serialize:void 0,deserialize(t,r,s){return e.fromSerializable(r.deserialize(t.v))}}}var kk=class{constructor(e,t){this.stream=e,this.hint=t?.hint??"binary"}};const jl=globalThis.Buffer,Iv=!!jl&&typeof jl.from=="function";function Lv(e){if(e.length===0)return"";if(Iv)return jl.from(e).toString("base64");const t=32768,r=[];for(let s=0;s<e.length;s+=t){const o=e.subarray(s,s+t);r.push(String.fromCharCode.apply(null,o))}return btoa(r.join(""))}function jv(e){if(e.length===0)return new Uint8Array(0);if(Iv){const s=jl.from(e,"base64");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}const t=atob(e),r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r}const uo=Object.create(null),ho=Object.create(null),Rk=e=>new ReadableStream({start(t){e.on({next(r){try{t.enqueue(jv(r))}catch{}},throw(r){t.error(r)},return(){try{t.close()}catch{}}})}}),Ck=new TextEncoder,Tk=e=>new ReadableStream({start(t){e.on({next(r){try{typeof r=="string"?t.enqueue(Ck.encode(r)):t.enqueue(jv(r.$b64))}catch{}},throw(r){t.error(r)},return(){try{t.close()}catch{}}})}}),Pk="(s=>new ReadableStream({start(c){s.on({next(b){try{const d=atob(b),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}catch(_){}},throw(e){c.error(e)},return(){try{c.close()}catch(_){}}})}}))",Ak="(s=>{const e=new TextEncoder();return new ReadableStream({start(c){s.on({next(v){try{if(typeof v==='string'){c.enqueue(e.encode(v))}else{const d=atob(v.$b64),a=new Uint8Array(d.length);for(let i=0;i<d.length;i++)a[i]=d.charCodeAt(i);c.enqueue(a)}}catch(_){}},throw(x){c.error(x)},return(){try{c.close()}catch(_){}}})}})})";function hm(e){const t=hs(),r=e.getReader();return(async()=>{try{for(;;){const{done:s,value:o}=await r.read();if(s){t.return(void 0);break}t.next(Lv(o))}}catch(s){t.throw(s)}finally{r.releaseLock()}})(),t}function fm(e){const t=hs(),r=e.getReader(),s=new TextDecoder("utf-8",{fatal:!0});return(async()=>{try{for(;;){const{done:o,value:a}=await r.read();if(o){try{const c=s.decode();c.length>0&&t.next(c)}catch{}t.return(void 0);break}try{const c=s.decode(a,{stream:!0});c.length>0&&t.next(c)}catch{t.next({$b64:Lv(a)})}}}catch(o){t.throw(o)}finally{r.releaseLock()}})(),t}const Ok={tag:"tss/RawStream",extends:[{tag:"tss/RawStreamFactory",test(e){return e===uo},parse:{sync(e,t,r){return{}},async async(e,t,r){return{}},stream(e,t,r){return{}}},serialize(e,t,r){return Pk},deserialize(e,t,r){return uo}},{tag:"tss/RawStreamFactoryText",test(e){return e===ho},parse:{sync(e,t,r){return{}},async async(e,t,r){return{}},stream(e,t,r){return{}}},serialize(e,t,r){return Ak},deserialize(e,t,r){return ho}}],test(e){return e instanceof kk},parse:{sync(e,t,r){const s=e.hint==="text"?ho:uo;return{hint:t.parse(e.hint),factory:t.parse(s),stream:t.parse(hs())}},async async(e,t,r){const s=e.hint==="text"?ho:uo,o=e.hint==="text"?fm
11(e.stream):hm(e.stream);return{hint:await t.parse(e.hint),factory:await t.parse(s),stream:await t.parse(o)}},stream(e,t,r){const s=e.hint==="text"?ho:uo,o=e.hint==="text"?fm(e.stream):hm(e.stream);return{hint:t.parse(e.hint),factory:t.parse(s),stream:t.parse(o)}}},serialize(e,t,r){return"("+t.serialize(e.factory)+")("+t.serialize(e.stream)+")"},deserialize(e,t,r){const s=t.deserialize(e.stream);return t.deserialize(e.hint)==="text"?Tk(s):Rk(s)}};function Ik(e){return{tag:"tss/RawStream",test:()=>!1,parse:{},serialize(){throw new Error("RawStreamDeserializePlugin.serialize should not be called. Client only deserializes.")},deserialize(t,r,s){return e(typeof r?.deserialize=="function"?r.deserialize(t.streamId):t.streamId)}}}const Lk={tag:"$TSR/Error",test(e){return e instanceof Error},parse:{sync(e,t){return{message:t.parse(e.message)}},async async(e,t){return{message:await t.parse(e.message)}},stream(e,t){return{message:t.parse(e.message)}}},serialize(e,t){return"new Error("+t.serialize(e.message)+")"},deserialize(e,t){return new Error(t.deserialize(e.message))}};var Sn={},Nv=e=>new ReadableStream({start:t=>{e.on({next:r=>{try{t.enqueue(r)}catch{}},throw:r=>{t.error(r)},return:()=>{try{t.close()}catch{}}})}}),jk={tag:"seroval-plugins/web/ReadableStreamFactory",test(e){return e===Sn},parse:{sync(){return Sn},async async(){return await Promise.resolve(Sn)},stream(){return Sn}},serialize(){return Nv.toString()},deserialize(){return Sn}};function pm(e){let t=hs(),r=e.getReader();async function s(){try{let o=await r.read();o.done?t.return(o.value):(t.next(o.value),await s())}catch(o){t.throw(o)}}return s().catch(()=>{}),t}var Nk={tag:"seroval/plugins/web/ReadableStream",extends:[jk],test(e){return typeof ReadableStream>"u"?!1:e instanceof ReadableStream},parse:{sync(e,t){return{factory:t.parse(Sn),stream:t.parse(hs())}},async async(e,t){return{factory:await t.parse(Sn),stream:await t.parse(pm(e))}},stream(e,t){return{factory:t.parse(Sn),stream:t.parse(pm(e))}}},serialize(e,t){return"("+t.serialize(e.factory)+")("+t.serialize(e.stream)+")"},deserialize(e,t){let r=t.deserialize(e.stream);return Nv(r)}},Mk=Nk;const $k=[Lk,Ok,Mk];function Dk(){return[...Dy()?.serializationAdapters?.map(Ek)??[],...$k]}var gm=new TextDecoder,Uk=new Uint8Array(0),mm=16*1024*1024,ym=32*1024*1024,vm=1024,wm=1e5;function Fk(e){const t=new Map,r=new Map,s=new Set;let o=!1,a=null,c=0,u;const h=new ReadableStream({start(g){u=g},cancel(){o=!0;try{a?.cancel()}catch{}t.forEach(g=>{try{g.error(new Error("Framed response cancelled"))}catch{}}),t.clear(),r.clear(),s.clear()}});function f(g){const v=r.get(g);if(v)return v;if(s.has(g))return new ReadableStream({start(b){b.close()}});if(r.size>=vm)throw new Error(`Too many raw streams in framed response (max ${vm})`);const w=new ReadableStream({start(b){t.set(g,b)},cancel(){s.add(g),t.delete(g),r.delete(g)}});return r.set(g,w),w}function m(g){return f(g),t.get(g)}return(async()=>{const g=e.getReader();a=g;const v=[];let w=0;function b(){if(w<9)return null;const _=v[0];if(_.length>=9)return{type:_[0],streamId:(_[1]<<24|_[2]<<16|_[3]<<8|_[4])>>>0,length:(_[5]<<24|_[6]<<16|_[7]<<8|_[8])>>>0};const E=new Uint8Array(9);let R=0,A=9;for(let I=0;I<v.length&&A>0;I++){const $=v[I],F=Math.min($.length,A);E.set($.subarray(0,F),R),R+=F,A-=F}return{type:E[0],streamId:(E[1]<<24|E[2]<<16|E[3]<<8|E[4])>>>0,length:(E[5]<<24|E[6]<<16|E[7]<<8|E[8])>>>0}}function x(_){if(_===0)return Uk;const E=v[0];if(E&&E.length>=_){const $=E.subarray(0,_);return E.length===_?v.shift():v[0]=E.subarray(_),w-=_,$}const R=new Uint8Array(_);let A=0,I=_;for(;I>0&&v.length>0;){const $=v[0];if(!$)break;const F=Math.min($.length,I);R.set($.subarray(0,F),A),A+=F,I-=F,F===$.length?v.shift():v[0]=$.subarray(F)}return w-=_,R}try{for(;;){const{done:_,value:E}=await g.read();if(o||_)break;if(E){if(w+E.length>ym)throw new Error(`Framed response buffer exceeded ${ym} bytes`);for(v.push(E),w+=E.length;;){const R=b();if(!R)break;const{type:A,streamId:I,length:$}=R;if(A!==Fr.JSON&&A!==Fr.CHUNK&&A!==Fr.END&&A!==Fr.ERROR)throw new Error(`Unknown frame type: ${A}`);
11if(A===Fr.JSON){if(I!==0)throw new Error("Invalid JSON frame streamId (expected 0)")}else if(I===0)throw new Error("Invalid raw frame streamId (expected non-zero)");if($>mm)throw new Error(`Frame payload too large: ${$} bytes (max ${mm})`);const F=9+$;if(w<F)break;if(++c>wm)throw new Error(`Too many frames in framed response (max ${wm})`);x(9);const M=x($);switch(A){case Fr.JSON:try{u.enqueue(gm.decode(M))}catch{}break;case Fr.CHUNK:{const z=m(I);z&&z.enqueue(M);break}case Fr.END:{const z=m(I);if(s.add(I),z){try{z.close()}catch{}t.delete(I)}break}case Fr.ERROR:{const z=m(I);if(s.add(I),z){const V=gm.decode(M);z.error(new Error(V)),t.delete(I)}break}}}}}if(w!==0)throw new Error("Incomplete frame at end of framed response");try{u.close()}catch{}t.forEach(_=>{try{_.close()}catch{}}),t.clear()}catch(_){try{u.error(_)}catch{}t.forEach(E=>{try{E.error(_)}catch{}}),t.clear()}finally{try{g.releaseLock()}catch{}a=null}})(),{getOrCreateStream:f,jsonChunks:h}}var To=null;async function Md(e){e.length>0&&await Promise.allSettled(e)}var Bk=Object.prototype.hasOwnProperty;function Mv(e){for(const t in e)if(Bk.call(e,t))return!0;return!1}async function zk(e,t,r){To||(To=Dk());const s=t[0],o=s.fetch??r,a=s.data instanceof FormData?"formData":"payload",c=s.headers?new Headers(s.headers):new Headers;if(c.set("x-tsr-serverFn","true"),a==="payload"&&c.set("accept",`${Mb}, application/x-ndjson, application/json`),s.method==="GET"){if(a==="formData")throw new Error("FormData is not supported with GET requests");const h=await $v(s);if(h!==void 0){const f=Gy({payload:h});e.includes("?")?e+=`&${f}`:e+=`?${f}`}}let u;if(s.method==="POST"){const h=await Hk(s);h?.contentType&&c.set("content-type",h.contentType),u=h?.body}return await Wk(async()=>o(e,{method:s.method,headers:c,signal:s.signal,body:u}))}async function $v(e){let t=!1;const r={};if(e.data!==void 0&&(t=!0,r.data=e.data),e.context&&Mv(e.context)&&(t=!0,r.context=e.context),t)return Dv(r)}async function Dv(e){return JSON.stringify(await Promise.resolve(xk(e,{plugins:To})))}async function Hk(e){if(e.data instanceof FormData){let r;return e.context&&Mv(e.context)&&(r=await Dv(e.context)),r!==void 0&&e.data.set(Nb,r),{body:e.data}}const t=await $v(e);if(t)return{body:t,contentType:"application/json"}}async function Wk(e){let t;try{t=await e()}catch(s){if(s instanceof Response)t=s;else throw console.log(s),s}if(t.headers.get("x-tss-raw")==="true")return t;const r=t.headers.get("content-type");if(r||Ot(),t.headers.get("x-tss-serialized")){let s;if(r.includes("application/x-tss-framed")){if(Ub(r),!t.body)throw new Error("No response body for framed response");const{getOrCreateStream:o,jsonChunks:a}=Fk(t.body),c=[Ik(o),...To||[]],u=new Map;s=await Vk({jsonStream:a,onMessage:h=>dm(h,{refs:u,plugins:c}),onError(h,f){console.error(h,f)}})}else if(r.includes("application/json")){const o=await t.json(),a=[];s=dm(o,{plugins:To}),await Md(a)}if(s||Ot(),s instanceof Error)throw s;return s}if(r.includes("application/json")){const s=await t.json(),o=gS(s);if(o)throw o;if(st(s))throw s;return s}if(!t.ok)throw new Error(await t.text());return t}async function Vk({jsonStream:e,onMessage:t,onError:r}){const s=e.getReader(),{value:o,done:a}=await s.read();if(a||!o)throw new Error("Stream ended before first object");const c=JSON.parse(o);let u=!1;const h=(async()=>{try{for(;;){const{value:g,done:v}=await s.read();if(v)break;if(g)try{const w=[];try{t(JSON.parse(g))}finally{}await Md(w)}catch(w){r?.(`Invalid JSON: ${g}`,w)}}}catch(g){u||r?.("Stream processing error:",g)}})();let f;const m=[];try{f=t(c)}catch(g){throw u=!0,s.cancel().catch(()=>{}),g}return await Md(m),Promise.resolve(f).catch(()=>{u=!0,s.cancel().catch(()=>{})}),h.finally(()=>{try{s.releaseLock()}catch{}}),f}function qk(e){const t="/_serverFn/"+e;return Object.assign((...o)=>{const a=Dy()?.serverFns?.fetch;return zk(t,o,a??fetch)},{url:t,serverFnMeta:{id:e},[Ad]:!0})}var Kk={key:"$TSS/serverfn",test:e=>typeof e!="function"||!(Ad in e)?!1:!!e[Ad],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>qk(e)};function _m(e){return e.replaceAll("\0","/").replaceAll("�","/")}function Gk(e,t){e.id=t.i,e.__beforeLoadContext=t.b,e.loaderData=t.l,e.
11status=t.s,e.ssr=t.ssr,e.updatedAt=t.u,e.error=t.e,t.g!==void 0&&(e.globalNotFound=t.g)}async function Jk(e){window.$_TSR||Ot();const t=e.options.serializationAdapters;if(t?.length){const _=new Map;t.forEach(E=>{_.set(E.key,E.fromSerializable)}),window.$_TSR.t=_,window.$_TSR.buffer.forEach(E=>E())}window.$_TSR.initialized=!0,window.$_TSR.router||Ot();const r=window.$_TSR.router;r.matches.forEach(_=>{_.i=_m(_.i)}),r.lastMatchId&&(r.lastMatchId=_m(r.lastMatchId));const{manifest:s,dehydratedData:o,lastMatchId:a}=r;e.ssr={manifest:s};const c=document.querySelector('meta[property="csp-nonce"]')?.content;e.options.ssr={nonce:c},await e.options.hydrate?.(o);const u=e.matchRoutes(e.stores.location.get()),h=Promise.all(u.map(_=>e.loadRouteChunk(e.looseRoutesById[_.routeId])));function f(_){const E=e.looseRoutesById[_.routeId].options.pendingMinMs??e.options.defaultPendingMinMs;if(E){const R=cs();_._nonReactive.minPendingPromise=R,_._forcePending=!0,setTimeout(()=>{R.resolve(),e.updateMatch(_.id,A=>(A._nonReactive.minPendingPromise=void 0,{...A,_forcePending:void 0}))},E)}}function m(_){const E=e.looseRoutesById[_.routeId];E&&(E.options.ssr=_.ssr)}let g;u.forEach(_=>{const E=r.matches.find(R=>R.i===_.id);if(!E){_._nonReactive.dehydrated=!1,_.ssr=!1,m(_);return}Gk(_,E),m(_),_._nonReactive.dehydrated=_.ssr!==!1,(_.ssr==="data-only"||_.ssr===!1)&&g===void 0&&(g=_.index,f(_))}),e.stores.setMatches(u);const v=e.stores.matches.get(),w=e.stores.location.get();await Promise.all(v.map(async _=>{try{const E=e.looseRoutesById[_.routeId],R=v[_.index-1]?.context??e.options.context;if(E.options.context){const F={deps:_.loaderDeps,params:_.params,context:R??{},location:w,navigate:M=>e.navigate({...M,_fromLocation:w}),buildLocation:e.buildLocation,cause:_.cause,abortController:_.abortController,preload:!1,matches:u,routeId:E.id};_.__routeContext=E.options.context(F)??void 0}_.context={...R,..._.__routeContext,..._.__beforeLoadContext};const A={ssr:e.options.ssr,matches:v,match:_,params:_.params,loaderData:_.loaderData},I=await E.options.head?.(A),$=await E.options.scripts?.(A);_.meta=I?.meta,_.links=I?.links,_.headScripts=I?.scripts,_.styles=I?.styles,_.scripts=$}catch(E){if(st(E))_.error={isNotFound:!0},console.error(`NotFound error during hydration for routeId: ${_.routeId}`,E);else throw _.error=E,console.error(`Error during hydration for route ${_.routeId}:`,E),E}}));const b=u[u.length-1].id!==a;if(!u.some(_=>_.ssr===!1)&&!b)return u.forEach(_=>{_._nonReactive.dehydrated=void 0}),e.stores.resolvedLocation.set(e.stores.location.get()),h;const x=Promise.resolve().then(()=>e.load()).catch(_=>{console.error("Error during router hydration:",_)});if(b){const _=u[1];_||Ot(),f(_),_._displayPending=!0,_._nonReactive.displayPendingPromise=x,x.then(()=>{e.batch(()=>{e.stores.status.get()==="pending"&&(e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())),e.updateMatch(_.id,E=>({...E,_displayPending:void 0,displayPendingPromise:void 0}))})})}return h}var Nl=O.use,yo=typeof window<"u"?O.useLayoutEffect:O.useEffect;function fd(e){const t=O.useRef({value:e,prev:null}),r=t.current.value;return e!==r&&(t.current={value:e,prev:r}),t.current.prev}function Qk(e,t,r={},s={}){O.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([a])=>{t(a)},r);return o.observe(e.current),()=>{o.disconnect()}},[t,r,s.disabled,e])}function Yk(e){const t=O.useRef(null);return O.useImperativeHandle(e,()=>t.current,[]),t}function Xk({promise:e}){if(Nl)return Nl(e);const t=HS(e);if(t[Er].status==="pending")throw t;if(t[Er].status==="error")throw t[Er].error;return t[Er].data}function Zk(e){const t=P.jsx(eR,{...e});return e.fallback?P.jsx(O.Suspense,{fallback:e.fallback,children:t}):t}function eR(e){const t=Xk(e);return e.children(t)}function wh(e){const t=e.errorComponent??_h;return P.jsx(tR,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:r,reset:s})=>r?O.createElement(t,{error:r,reset:s}):e.children})}var tR=class extends O.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const r=e.getResetKey();return t.error&&t.resetKey!==r?{resetKey:r,error:null}:{resetKey:r}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function _h({error:e}){const[t,r]=O.useState(!1);return P.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[P.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),P.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r(s=>!s),children:t?"Hide Error":"Show Error"})]}),P.jsx("div",{style:{height:".25rem"}}),t?P.jsx("div",{children:P.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?P.jsx("code",{children:e.message}):null})}):null]})}function rR({children:e,fallback:t=null}){return bh()?P.jsx(fi.Fragment,{children:e}):P.jsx(fi.Fragment,{children:t})}function bh(){return fi.useSyncExternalStore(nR,()=>!0,()=>!1)}function nR(){return()=>{}}var Uv=O.createContext(null);function Je(e){return O.useContext(Uv)}var ec=O.createContext(void 0),sR=O.createContext(void 0),Ue=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(Ue||{});function iR({update:e,notify:t,unwatched:r}){return{link:s,unlink:o,propagate:a,checkDirty:c,shallowPropagate:u};function s(f,m,g){const v=m.depsTail;if(v!==void 0&&v.dep===f)return;const w=v!==void 0?v.nextDep:m.deps;if(w!==void 0&&w.dep===f){w.version=g,m.depsTail=w;return}const b=f.subsTail;if(b!==void 0&&b.version===g&&b.sub===m)return;const x=m.depsTail=f.subsTail={version:g,dep:f,sub:m,prevDep:v,nextDep:w,prevSub:b,nextSub:void 0};w!==void 0&&(w.prevDep=x),v!==void 0?v.nextDep=x:m.deps=x,b!==void 0?b.nextSub=x:f.subs=x}function o(f,m=f.sub){const g=f.dep,v=f.prevDep,w=f.nextDep,b=f.nextSub,x=f.prevSub;return w!==void 0?w.prevDep=v:m.depsTail=v,v!==void 0?v.nextDep=w:m.deps=w,b!==void 0?b.prevSub=x:g.subsTail=x,x!==void 0?x.nextSub=b:(g.subs=b)===void 0&&r(g),w}function a(f){let m=f.nextSub,g;e:do{const v=f.sub;let w=v.flags;if(w&60?w&12?w&4?!(w&48)&&h(f,v)?(v.flags=w|40,w&=1):w=0:v.flags=w&-9|32:w=0:v.flags=w|32,w&2&&t(v),w&1){const b=v.subs;if(b!==void 0){const x=(f=b).nextSub;x!==void 0&&(g={value:m,prev:g}
11,m=x);continue}}if((f=m)!==void 0){m=f.nextSub;continue}for(;g!==void 0;)if(f=g.value,g=g.prev,f!==void 0){m=f.nextSub;continue e}break}while(!0)}function c(f,m){let g,v=0,w=!1;e:do{const b=f.dep,x=b.flags;if(m.flags&16)w=!0;else if((x&17)===17){if(e(b)){const _=b.subs;_.nextSub!==void 0&&u(_),w=!0}}else if((x&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(g={value:f,prev:g}),f=b.deps,m=b,++v;continue}if(!w){const _=f.nextDep;if(_!==void 0){f=_;continue}}for(;v--;){const _=m.subs,E=_.nextSub!==void 0;if(E?(f=g.value,g=g.prev):f=_,w){if(e(m)){E&&u(_),m=f.sub;continue}w=!1}else m.flags&=-33;m=f.sub;const R=f.nextDep;if(R!==void 0){f=R;continue e}}return w}while(!0)}function u(f){do{const m=f.sub,g=m.flags;(g&48)===32&&(m.flags=g|16,(g&6)===2&&t(m))}while((f=f.nextSub)!==void 0)}function h(f,m){let g=m.depsTail;for(;g!==void 0;){if(g===f)return!0;g=g.prevDep}return!1}}function oR(e,t,r){const s=typeof e=="object",o=s?e:void 0;return{next:(s?e.next:e)?.bind(o),error:(s?e.error:t)?.bind(o),complete:(s?e.complete:r)?.bind(o)}}const $d=[];let Rl=0;const{link:bm,unlink:aR,propagate:lR,checkDirty:Fv,shallowPropagate:Sm}=iR({update(e){return e._update()},notify(e){$d[Dd++]=e,e.flags&=~Ue.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Ue.Mutable|Ue.Dirty,Ml(e))}});let ul=0,Dd=0,Sr,Ud=0;function Bv(e){try{++Ud,e()}finally{--Ud||zv()}}function Ml(e){const t=e.depsTail;let r=t!==void 0?t.nextDep:e.deps;for(;r!==void 0;)r=aR(r,e)}function zv(){if(!(Ud>0)){for(;ul<Dd;){const e=$d[ul];$d[ul++]=void 0,e.notify()}ul=0,Dd=0}}function xm(e,t){const r=typeof e=="function",s=e,o={_snapshot:r?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:r?Ue.None:Ue.Mutable,get(){return Sr!==void 0&&bm(o,Sr,Rl),o._snapshot},subscribe(a){const c=oR(a),u={current:!1},h=cR(()=>{o.get(),u.current?c.next?.(o._snapshot):u.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(a){const c=Sr,u=t?.compare??Object.is;if(r)Sr=o,++Rl,o.depsTail=void 0;else if(a===void 0)return!1;r&&(o.flags=Ue.Mutable|Ue.RecursedCheck);try{const h=o._snapshot,f=typeof a=="function"?a(h):a===void 0&&r?s(h):a;return h===void 0||!u(h,f)?(o._snapshot=f,!0):!1}finally{Sr=c,r&&(o.flags&=~Ue.RecursedCheck),Ml(o)}}};return r?(o.flags=Ue.Mutable|Ue.Dirty,o.get=function(){const a=o.flags;if(a&Ue.Dirty||a&Ue.Pending&&Fv(o.deps,o)){if(o._update()){const c=o.subs;c!==void 0&&Sm(c)}}else a&Ue.Pending&&(o.flags=a&~Ue.Pending);return Sr!==void 0&&bm(o,Sr,Rl),o._snapshot}):o.set=function(a){if(o._update(a)){const c=o.subs;c!==void 0&&(lR(c),Sm(c),zv())}},o}function cR(e){const t=()=>{const s=Sr;Sr=r,++Rl,r.depsTail=void 0,r.flags=Ue.Watching|Ue.RecursedCheck;try{return e()}finally{Sr=s,r.flags&=~Ue.RecursedCheck,Ml(r)}},r={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Ue.Watching|Ue.RecursedCheck,notify(){const s=this.flags;s&Ue.Dirty||s&Ue.Pending&&Fv(this.deps,this)?t():this.flags=Ue.Watching},stop(){this.flags=Ue.None,this.depsTail=void 0,Ml(this)}};return t(),r}var pd={exports:{}},gd={},md={exports:{}},yd={};var Em;function uR(){if(Em)return yd;Em=1;var e=zo();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,a=e.useLayoutEffect,c=e.useDebugValue;function u(g,v){var w=v(),b=s({inst:{value:w,getSnapshot:v}}),x=b[0].inst,_=b[1];return a(function(){x.value=w,x.getSnapshot=v,h(x)&&_({inst:x})},[g,w,v]),o(function(){return h(x)&&_({inst:x}),g(function(){h(x)&&_({inst:x})})},[g]),c(w),w}function h(g){var v=g.getSnapshot;g=g.value;try{var w=v();return!r(g,w)}catch{return!0}}function f(g,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return yd.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,yd}var km;function dR(){return km||(km=1,md.exports=uR()),md.exports}var Rm;function hR(){if(Rm)return gd;Rm=1;var e=zo(),t=dR();function r(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var s=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,c=e.useEffect,u=e.useMemo,h=e.useDebugValue;return gd.useSyncExternalStoreWithSelector=function(f,m,g,v,w){var b=a(null);if(b.current===null){var x={hasValue:!1,value:null};b.current=x}else x=b.current;b=u(function(){function E(F){if(!R){if(R=!0,A=F,F=v(F),w!==void 0&&x.hasValue){var M=x.value;if(w(M,F))return I=M}return I=F}if(M=I,s(A,F))return M;var z=v(F);return w!==void 0&&w(M,z)?(A=F,M):(A=F,I=z)}var R=!1,A,I,$=g===void 0?null:g;return[function(){return E(m())},$===null?void 0:function(){return E($())}]},[m,g,v,w]);var _=o(f,b[0],b[1]);return c(function(){x.hasValue=!0,x.value=_},[_]),h(_),_},gd}var Cm;function fR(){return Cm||(Cm=1,pd.exports=hR()),pd.exports}var pR=fR();function gR(e,t){return e===t}function ze(e,t,r=gR){const s=O.useCallback(c=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(c);return u},[e]),o=O.useCallback(()=>e?.get(),[e]);
11return pR.useSyncExternalStoreWithSelector(s,o,o,t,r)}var vd={get(){},subscribe(){return{unsubscribe(){}}}};function Hv(e,t){const r=O.useRef();return s=>{const o=e?.select?e.select(s):s;return e?.structuralSharing??t.options.defaultStructuralSharing?r.current=ts(r.current,o):o}}function fs(e){const t=Je(),r=O.useContext(e.from?sR:ec),s=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(r),o=Hv(e,t),a=ze(s??vd,c=>c?o(c):vd);if(a!==vd)return a;(e.shouldThrow??!0)&&Ot()}function Wv(e){return fs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Vv(e){const{select:t,...r}=e;return fs({...r,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function qv(e){return fs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const r=e.strict===!1?t.params:t._strictParams;return e.select?e.select(r):r}})}function Kv(e){return fs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Gv(e){const t=Je();return O.useCallback(r=>t.navigate({...r,from:r.from??e?.from}),[e?.from,t])}function Jv(e){return fs({...e,select:t=>e.select?e.select(t.context):t.context})}var tc=$y();const bj=My(tc);function mR(e,t){const r=Je(),s=Yk(t),{activeProps:o,inactiveProps:a,activeOptions:c,to:u,preload:h,preloadDelay:f,preloadIntentProximity:m,hashScrollIntoView:g,replace:v,startTransition:w,resetScroll:b,viewTransition:x,children:_,target:E,disabled:R,style:A,className:I,onClick:$,onBlur:F,onFocus:M,onMouseEnter:z,onMouseLeave:V,onTouchStart:K,ignoreBlocker:te,params:G,search:ae,hash:ce,state:we,mask:pe,reloadDocument:W,unsafeRelative:D,from:Y,_fromLocation:Z,...j}=e,q=bh(),me=O.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ye=ze(r.stores.location,Ae=>Ae,(Ae,it)=>Ae.href===it.href),fe=O.useMemo(()=>{const Ae={_fromLocation:ye,...me};return r.buildLocation(Ae)},[r,ye,me]),xe=fe.maskedLocation?fe.maskedLocation.publicHref:fe.publicHref,Ee=fe.maskedLocation?fe.maskedLocation.external:fe.external,be=O.useMemo(()=>SR(xe,Ee,r.history,R),[R,Ee,xe,r.history]),Re=O.useMemo(()=>{if(be?.external)return Al(be.href,r.protocolAllowlist)?void 0:be.href;if(!xR(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Al(u,r.protocolAllowlist)?void 0:u}catch{}},[u,be,r.protocolAllowlist]),Qe=O.useMemo(()=>{if(Re)return!1;if(c?.exact){if(!aS(ye.pathname,fe.pathname,r.basepath))return!1}else{const Ae=Ol(ye.pathname,r.basepath),it=Ol(fe.pathname,r.basepath);if(!(Ae.startsWith(it)&&(Ae.length===it.length||Ae[it.length]==="/")))return!1}return(c?.includeSearch??!0)&&!vt(ye.search,fe.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?q&&ye.hash===fe.hash:!0},[c?.exact,c?.explicitUndefined,c?.includeHash,c?.includeSearch,ye,Re,q,fe.hash,fe.pathname,fe.search,r.basepath]),Yt=Qe?es(o,{})??yR:wd,Ar=Qe?wd:es(a,{})??wd,Ht=[I,Yt.className,Ar.className].filter(Boolean).join(" "),ms=(A||Yt.style||Ar.style)&&{...A,...Yt.style,...Ar.style},[Jo,bi]=O.useState(!1),ys=O.useRef(!1),Or=e.reloadDocument||Re?!1:h??r.options.defaultPreload,Nn=f??r.options.defaultPreloadDelay??0,It=O.useCallback(()=>{r.preloadRoute({...me,_builtLocation:fe}).catch(Ae=>{console.warn(Ae),console.warn(WS)})},[r,me,fe]);Qk(s,O.useCallback(Ae=>{Ae?.isIntersecting&&It()},[It]),bR,{disabled:!!R||Or!=="viewport"}),O.useEffect(()=>{ys.current||!R&&Or==="render"&&(It(),ys.current=!0)},[R,It,Or]);const Xr=Ae=>{const it=Ae.currentTarget.getAttribute("target"),Xt=E!==void 0?E:it;if(!R&&!ER(Ae)&&!Ae.defaultPrevented&&(!Xt||Xt==="_self")&&Ae.button===0){Ae.preventDefault(),tc.flushSync(()=>{bi(!0)});const ws=r.subscribe("onResolved",()=>{ws(),bi(!1)});r.navigate({...me,replace:v,resetScroll:b,hashScrollIntoView:g,startTransition:w,viewTransition:x,ignoreBlocker:te})}};if(Re)return{...j,ref:s,href:Re,..._&&{children:_},...E&&{target:E},...R&&{disabled:R},...A&&{style:A},...I&&{className:I},...$&&{onClick:$},...F&&{onBlur:F},...M&&{onFocus:M},...z&&{onMouseEnter:z},...V&&{onMouseLeave:V},...K&&{onTouchStart:K}};const vs=Ae=>{if(R||Or!=="intent")return;
11if(!Nn){It();return}const it=Ae.currentTarget;if(fo.has(it))return;const Xt=setTimeout(()=>{fo.delete(it),It()},Nn);fo.set(it,Xt)},Qo=Ae=>{R||Or!=="intent"||It()},Si=Ae=>{if(R||!Or||!Nn)return;const it=Ae.currentTarget,Xt=fo.get(it);Xt&&(clearTimeout(Xt),fo.delete(it))};return{...j,...Yt,...Ar,href:be?.href,ref:s,onClick:Ws([$,Xr]),onBlur:Ws([F,Si]),onFocus:Ws([M,vs]),onMouseEnter:Ws([z,vs]),onMouseLeave:Ws([V,Si]),onTouchStart:Ws([K,Qo]),disabled:!!R,target:E,...ms&&{style:ms},...Ht&&{className:Ht},...R&&vR,...Qe&&wR,...q&&Jo&&_R}}var wd={},yR={className:"active"},vR={role:"link","aria-disabled":!0},wR={"data-status":"active","aria-current":"page"},_R={"data-transitioning":"transitioning"},fo=new WeakMap,bR={rootMargin:"100px"},Ws=e=>t=>{for(const r of e)if(r){if(t.defaultPrevented)return;r(t)}};function SR(e,t,r,s){if(!s)return t?{href:e,external:!0}:{href:r.createHref(e)||"/",external:!1}}function xR(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Sh=O.forwardRef((e,t)=>{const{_asChild:r,...s}=e,{type:o,...a}=mR(s,t),c=typeof s.children=="function"?s.children({isActive:a["data-status"]==="active"}):s.children;if(!r){const{disabled:u,...h}=a;return O.createElement("a",h,c)}return O.createElement(r,a,c)});function ER(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var kR=class extends rv{constructor(t){super(t),this.useMatch=r=>fs({select:r?.select,from:this.id,structuralSharing:r?.structuralSharing}),this.useRouteContext=r=>Jv({...r,from:this.id}),this.useSearch=r=>Kv({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useParams=r=>qv({select:r?.select,structuralSharing:r?.structuralSharing,from:this.id}),this.useLoaderDeps=r=>Vv({...r,from:this.id}),this.useLoaderData=r=>Wv({...r,from:this.id}),this.useNavigate=()=>Gv({from:this.fullPath}),this.Link=fi.forwardRef((r,s)=>P.jsx(Sh,{ref:s,from:this.fullPath,...r}))}};function RR(e){return new kR(e)}function CR(){return e=>PR(e)}var TR=class extends JS{constructor(e){super(e),this.useMatch=t=>fs({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Jv({...t,from:this.id}),this.useSearch=t=>Kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>qv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Vv({...t,from:this.id}),this.useLoaderData=t=>Wv({...t,from:this.id}),this.useNavigate=()=>Gv({from:this.fullPath}),this.Link=fi.forwardRef((t,r)=>P.jsx(Sh,{ref:r,from:this.fullPath,...t}))}};function PR(e){return new TR(e)}function pr(e){return new AR(e,{silent:!0}).createRoute}var AR=class{constructor(e,t){this.path=e,this.createRoute=r=>{const s=RR(r);return s.isRoot=!1,s},this.silent=t?.silent}};function gr(e,t){let r,s,o,a;const c=()=>(r||(r=e().then(h=>{r=void 0,s=h[t]}).catch(h=>{if(o=h,zb(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const f=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(f)||(sessionStorage.setItem(f,"1"),a=!0)}})),r),u=function(f){if(a)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!s)if(Nl)Nl(c());else throw c();return O.createElement(s,f)};return u.preload=c,u}function OR(e){const t=Je(),r=`not-found-${ze(t.stores.location,s=>s.pathname)}-${ze(t.stores.status,s=>s)}`;return P.jsx(wh,{getResetKey:()=>r,onCatch:(s,o)=>{if(st(s))e.onCatch?.(s,o);else throw s},errorComponent:({error:s})=>{if(st(s))return e.fallback?.(s);throw s},children:e.children})}function IR(){return P.jsx("p",{children:"Not Found"})}function Zs(e){return P.jsx(P.Fragment,{children:e.children})}function Qv(e,t,r){return t.options.notFoundComponent?P.jsx(t.options.notFoundComponent,{...r}):e.options.defaultNotFoundComponent?P.jsx(e.options.defaultNotFoundComponent,{...r}):P.jsx(IR,{})}function LR(e){return null}function jR(){return LR(Je()),null}var NR=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,MR=(e,t)=>e[0]===t[0]&&e[1]===t[1],Yv=O.memo(function({matchId:t}){const r=Je(),s=r.stores.matchStores.get(t);s||Ot();const o=ze(r.stores.loadedAt,c=>c),a=ze(s,c=>c,NR);return P.jsx($R,{router:r,matchId:t,resetKey:o,matchState:O.useMemo(()=>{const c=a.routeId,u=r.routesById[c].parentRoute?.id;return{routeId:c,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:u}},[a._displayPending,a.routeId,a.ssr,r.routesById])})});
11function $R({router:e,matchId:t,resetKey:r,matchState:s}){const o=e.routesById[s.routeId],a=o.options.pendingComponent??e.options.defaultPendingComponent,c=a?P.jsx(a,{}):null,u=o.options.errorComponent??e.options.defaultErrorComponent,h=o.options.onCatch??e.options.defaultOnCatch,f=o.isRoot?o.options.notFoundComponent??e.options.notFoundRoute?.options.component:o.options.notFoundComponent,m=s.ssr===!1||s.ssr==="data-only",g=(!o.isRoot||o.options.wrapInSuspense||m)&&(o.options.wrapInSuspense??a??(o.options.errorComponent?.preload||m))?O.Suspense:Zs,v=u?wh:Zs,w=f?OR:Zs;return P.jsxs(o.isRoot?o.options.shellComponent??Zs:Zs,{children:[P.jsx(ec.Provider,{value:t,children:P.jsx(g,{fallback:c,children:P.jsx(v,{getResetKey:()=>r,errorComponent:u||_h,onCatch:(b,x)=>{if(st(b))throw b.routeId??=s.routeId,b;h?.(b,x)},children:P.jsx(w,{fallback:b=>{if(b.routeId??=s.routeId,!f||b.routeId&&b.routeId!==s.routeId||!b.routeId&&!o.isRoot)throw b;return O.createElement(f,b)},children:m||s._displayPending?P.jsx(rR,{fallback:c,children:P.jsx(Tm,{matchId:t})}):P.jsx(Tm,{matchId:t})})})})}),s.parentRouteId===os?P.jsxs(P.Fragment,{children:[P.jsx(DR,{}),e.options.scrollRestoration&&Uy?P.jsx(jR,{}):null]}):null]})}function DR(){const e=Je(),t=O.useRef();return yo(()=>{const r=e.stores.resolvedLocation.get(),s=t.current;r&&(!s||s.href!==r.href)&&e.emit({type:"onRendered",...oi(e.stores.location.get(),s??r)}),t.current=r},[ze(e.stores.resolvedLocation,r=>r?.state.__TSR_key),e]),null}var Tm=O.memo(function({matchId:t}){const r=Je(),s=(m,g)=>r.getMatch(m.id)?._nonReactive[g]??m._nonReactive[g],o=r.stores.matchStores.get(t);o||Ot();const a=ze(o,m=>m),c=a.routeId,u=r.routesById[c],h=O.useMemo(()=>{const m=(r.routesById[c].options.remountDeps??r.options.defaultRemountDeps)?.({routeId:c,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return m?JSON.stringify(m):void 0},[c,a.loaderDeps,a._strictParams,a._strictSearch,r.options.defaultRemountDeps,r.routesById]),f=O.useMemo(()=>{const m=u.options.component??r.options.defaultComponent;return m?P.jsx(m,{},h):P.jsx(Xv,{})},[h,u.options.component,r.options.defaultComponent]);if(a._displayPending)throw s(a,"displayPendingPromise");if(a._forcePending)throw s(a,"minPendingPromise");if(a.status==="pending"){const m=u.options.pendingMinMs??r.options.defaultPendingMinMs;if(m){const g=r.getMatch(a.id);if(g&&!g._nonReactive.minPendingPromise){const v=cs();g._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),g._nonReactive.minPendingPromise=void 0},m)}}throw s(a,"loadPromise")}if(a.status==="notFound")return st(a.error)||Ot(),Qv(r,u,a.error);if(a.status==="redirected")throw Pt(a.error)||Ot(),s(a,"loadPromise");if(a.status==="error")throw a.error;return f}),Xv=O.memo(function(){const t=Je(),r=O.useContext(ec);let s,o=!1,a;{const f=r?t.stores.matchStores.get(r):void 0;[s,o]=ze(f,m=>[m?.routeId,m?.globalNotFound??!1],MR),a=ze(t.stores.matchesId,m=>m[m.findIndex(g=>g===r)+1])}const c=s?t.routesById[s]:void 0,u=t.options.defaultPendingComponent?P.jsx(t.options.defaultPendingComponent,{}):null;if(o)return c||Ot(),Qv(t,c,void 0);if(!a)return null;const h=P.jsx(Yv,{matchId:a});return s===os?P.jsx(O.Suspense,{fallback:u,children:h}):h});function UR(){const e=Je(),t=O.useRef({router:e,mounted:!1}),[r,s]=O.useState(!1),o=ze(e.stores.isLoading,g=>g),a=ze(e.stores.hasPending,g=>g),c=fd(o),u=o||r||a,h=fd(u),f=o||a,m=fd(f);return e.startTransition=g=>{s(!0),O.startTransition(()=>{g(),s(!1)})},O.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Vr(e.latestLocation.publicHref)!==Vr(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),yo(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),yo(()=>{c&&!o&&e.emit({type:"onLoad",...oi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[c,e,o]),yo(()=>{m&&!f&&e.emit({type:"onBeforeRouteMount",...oi(e.stores.location.get(),e.stores.resolvedLocation.get())})},[f,m,e]),yo(()=>
11{if(h&&!u){const g=oi(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...g}),Bv(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[u,h,e]),null}function FR(){const e=Je(),t=e.routesById[os].options.pendingComponent??e.options.defaultPendingComponent,r=t?P.jsx(t,{}):null,s=P.jsxs(typeof document<"u"&&e.ssr?Zs:O.Suspense,{fallback:r,children:[P.jsx(UR,{}),P.jsx(BR,{})]});return e.options.InnerWrap?P.jsx(e.options.InnerWrap,{children:s}):s}function BR(){const e=Je(),t=ze(e.stores.firstId,o=>o),r=ze(e.stores.loadedAt,o=>o),s=t?P.jsx(Yv,{matchId:t}):null;return P.jsx(ec.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:P.jsx(wh,{getResetKey:()=>r,errorComponent:_h,onCatch:void 0,children:s})})}var zR=e=>({createMutableStore:xm,createReadonlyStore:xm,batch:Bv}),HR=e=>new WR(e),WR=class extends PS{constructor(e){super(e,zR)}};function VR({router:e,children:t,...r}){By(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});const s=P.jsx(Uv.Provider,{value:e,children:t});return e.options.Wrap?P.jsx(e.options.Wrap,{children:s}):s}function qR({router:e,...t}){return P.jsx(VR,{router:e,...t,children:P.jsx(FR,{})})}function rc(e){const t=Je({warn:e?.router===void 0}),r=e?.router||t;return ze(r.stores.__store,Hv(e,r))}function Pm(e,t){if(t)for(const[r,s]of Object.entries(t))r!=="suppressHydrationWarning"&&s!==void 0&&s!==!1&&e.setAttribute(r,typeof s=="boolean"?"":String(s))}function Zv(e){const{attrs:t,children:r,nonce:s,preventScriptHoist:o}=e;switch(e.tag){case"title":return P.jsx("title",{...t,suppressHydrationWarning:!0,children:r});case"meta":return P.jsx("meta",{...t,suppressHydrationWarning:!0});case"link":return P.jsx("link",{...t,precedence:t?.precedence??(t?.rel==="stylesheet"?"default":void 0),nonce:s,suppressHydrationWarning:!0});case"style":return e.inlineCss,P.jsx("style",{...t,dangerouslySetInnerHTML:{__html:r},nonce:s});case"script":return P.jsx(KR,{attrs:t,preventScriptHoist:o,children:r});default:return null}}function KR({attrs:e,children:t,preventScriptHoist:r}){Je();const s=bh(),o=typeof e?.type=="string"&&e.type!==""&&e.type!=="text/javascript"&&e.type!=="module";if(O.useEffect(()=>{if(!o){if(e?.src){const a=(()=>{try{const u=document.baseURI||window.location.href;return new URL(e.src,u).href}catch{return e.src}})();for(const u of document.querySelectorAll("script[src]"))if(u.src===a)return;const c=document.createElement("script");return Pm(c,e),document.head.appendChild(c),()=>c.remove()}if(typeof t=="string"){const a=typeof e?.type=="string"?e.type:"text/javascript",c=typeof e?.nonce=="string"?e.nonce:void 0;for(const h of document.querySelectorAll("script:not([src])")){if(!(h instanceof HTMLScriptElement))continue;const f=h.getAttribute("type")??"text/javascript",m=h.getAttribute("nonce")??void 0;if(h.textContent===t&&f===a&&m===c)return}const u=document.createElement("script");return u.textContent=t,Pm(u,e),document.head.appendChild(u),()=>u.remove()}}},[e,t,o]),o&&typeof t=="string")return P.jsx("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:t}});if(!s){if(e?.src)return P.jsx("script",{...e,suppressHydrationWarning:!0});if(typeof t=="string")return P.jsx("script",{...e,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0})}return null}var GR=e=>{const t=Je(),r=t.options.ssr?.nonce,s=ze(t.stores.matches,g=>g.map(v=>v.meta).filter(v=>v!==void 0),vt),o=O.useMemo(()=>{const g=[],v={};let w;for(let b=s.length-1;b>=0;b--){const x=s[b];for(let _=x.length-1;_>=0;_--){const E=x[_];if(E)if(E.title)w||(w={tag:"title",children:E.title});else if("script:ld+json"in E)try{const R=JSON.stringify(E["script:ld+json"]);g.push({tag:"script",attrs:{type:"application/ld+json"},children:Gb(R)})}catch{}else{const R=E.name??E.property;if(R){if(v[R])continue;v[R]=!0}g.push({tag:"meta",attrs:{...E,nonce:r}})}}}return w&&g.push(w),r&&g.push({tag:"meta",attrs:{property:"csp-nonce",content:r}}),g.reverse(),g},[s,r]),a=ze(t.stores.matches,g=>g.flatMap(v=>v.links??[]).filter(v=>v!==void 0).map(v=>({tag:"link",attrs:{...v,nonce:r}})),vt),c=ze(t.stores.matches,g=>{const v=t.ssr?.manifest,w=[];return v&&(g.forEach(b=>{v.routes[b.routeId]?.css?.forEach(x=>{const _=GS(x);w.push({tag:"link",attrs:{rel:"stylesheet",..._,crossOrigin:tv(e,"stylesheet")??_.crossOrigin,suppressHydrationWarning:!0,nonce:r}})})}),v.inlineStyle&&w.push({tag:"style",attrs:{...v.inlineStyle.attrs,nonce:r},children:v.inlineStyle.children,inlineCss:!0})),w},vt),u=ze(t.stores.matches,g=>{const v=[],w=t.ssr?.manifest;return w&&g.forEach(b=>{w.routes[b.routeId]?.preloads?.forEach(x=>{v.push({tag:"link",attrs:{...qS(w,x,e),nonce:r}})})}),v},vt),h=ze(t.stores.matches,g=>g.flatMap(v=>v.styles??[]).filter(v=>v!==void 0).map(({children:v,...w})=>({tag:"style",attrs:{...w,nonce:r},children:v})),vt),f=ze(t.stores.matches,g=>g.flatMap(v=>v.headScripts??[]).filter(v=>v!==void 0).map(({children:v,...w})=>({tag:"script",attrs:{...w,nonce:r},children:v})),vt),m=[];return ll(m,o),m.push(...u),ll(m,a),m.push(...c),ll(m,h),ll(m,f),m};function JR(e){const t=GR(e.assetCrossOrigin),r=Je().options.ssr?.nonce;return P.jsx(P.Fragment,{children:t.map(s=>O.createElement(Zv,{...s,key:`tsr-meta-${JSON.stringify(s)}`,nonce:r}))})}var QR=()=>{const e=Je(),t=e.options.ssr?.nonce,r=a=>{const c=[],u=e.ssr?.manifest;if(!u)return[];for(const h of a){const f=u.routes[h.routeId]?.scripts;if(f)for(const m of f)c.push({tag:"script",attrs:{...m.attrs,nonce:t},children:m.children,...typeof m.attrs?.src=="string"?{preventScriptHoist:!0}:{}})}return c},s=a=>a.map(c=>
11c.scripts).flat(1).filter(Boolean).map(({children:c,...u})=>({tag:"script",attrs:{...u,suppressHydrationWarning:!0,nonce:t},children:c})),o=ze(e.stores.matches,r,vt);return YR(e,ze(e.stores.matches,s,vt),o)};function YR(e,t,r){const s=[...t,...r];return P.jsx(P.Fragment,{children:s.map((o,a)=>O.createElement(Zv,{...o,key:`tsr-scripts-${o.tag}-${a}`}))})}var Cn=(e,t)=>{const r={type:"request",...t||e},s=o=>Cn({},Object.assign(r,{validator:o,inputValidator:o}));return{options:r,middleware:o=>Cn({},Object.assign(r,{middleware:o})),validator:s,inputValidator:s,client:o=>Cn({},Object.assign(r,{client:o})),server:o=>Cn({},Object.assign(r,{server:o}))}};function ew(e,t){for(let r=0,s=t.length;r<s;r++){const o=t[r];e.has(o)||(e.add(o),o.extends&&ew(e,o.extends))}}var XR=e=>({getOptions:async()=>{const t=await e();if(t.serializationAdapters){const r=new Set;ew(r,t.serializationAdapters),t.serializationAdapters=Array.from(r)}return t},createMiddleware:Cn});function ZR(e,t,r,s){function o(a){return a instanceof r?a:new r(function(c){c(a)})}return new(r||(r=Promise))(function(a,c){function u(m){try{f(s.next(m))}catch(g){c(g)}}function h(m){try{f(s.throw(m))}catch(g){c(g)}}function f(m){m.done?a(m.value):o(m.value).then(u,h)}f((s=s.apply(e,t||[])).next())})}const e1=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class xh extends Error{constructor(t,r="FunctionsError",s){super(t),this.name=r,this.context=s}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class t1 extends xh{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Am extends xh{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Om extends xh{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Fd;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Fd||(Fd={}));class r1{constructor(t,{headers:r={},customFetch:s,region:o=Fd.Any}={}){this.url=t,this.headers=r,this.region=o,this.fetch=e1(s)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return ZR(this,arguments,void 0,function*(r,s={}){var o;let a,c;try{const{headers:u,method:h,body:f,signal:m,timeout:g}=s;let v={},{region:w}=s;w||(w=this.region);const b=new URL(`${this.url}/${r}`);w&&w!=="any"&&(v["x-region"]=w,b.searchParams.set("forceFunctionRegion",w));let x;f&&(u&&!Object.prototype.hasOwnProperty.call(u,"Content-Type")||!u)?typeof Blob<"u"&&f instanceof Blob||f instanceof ArrayBuffer?(v["Content-Type"]="application/octet-stream",x=f):typeof f=="string"?(v["Content-Type"]="text/plain",x=f):typeof FormData<"u"&&f instanceof FormData?x=f:(v["Content-Type"]="application/json",x=JSON.stringify(f)):f&&typeof f!="string"&&!(typeof Blob<"u"&&f instanceof Blob)&&!(f instanceof ArrayBuffer)&&!(typeof FormData<"u"&&f instanceof FormData)?x=JSON.stringify(f):x=f;let _=m;g&&(c=new AbortController,a=setTimeout(()=>c.abort(),g),m?(_=c.signal,m.addEventListener("abort",()=>c.abort())):_=c.signal);const E=yield this.fetch(b.toString(),{method:h||"POST",headers:Object.assign(Object.assign(Object.assign({},v),this.headers),u),body:x,signal:_}).catch($=>{throw new t1($)}),R=E.headers.get("x-relay-error");if(R&&R==="true")throw new Am(E);if(!E.ok)throw new Om(E);let A=((o=E.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),I;return A==="application/json"?I=yield E.json():A==="application/octet-stream"||A==="application/pdf"?I=yield E.blob():A==="text/event-stream"?I=E:A==="multipart/form-data"?I=yield E.formData():I=yield E.text(),{data:I,error:null,response:E}}catch(u){return{data:null,error:u,response:u instanceof Om||u instanceof Am?u.context:void 0}}finally{a&&clearTimeout(a)}})}}const tw=3,Im=e=>Math.min(1e3*2**e,3e4),n1=[520,503],rw=["GET","HEAD","OPTIONS"];
11var s1=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Lm(e,t){return new Promise(r=>{if(t?.aborted){r();return}const s=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e);function o(){clearTimeout(s),r()}t?.addEventListener("abort",o)})}function i1(e,t,r,s){return!(!s||r>=tw||!rw.includes(e)||!n1.includes(t))}var o1=class{constructor(e){var t,r,s,o,a;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(s=e.shouldStripNulls)!==null&&s!==void 0?s:!1,this.urlLengthLimit=(o=e.urlLengthLimit)!==null&&o!==void 0?o:8e3,this.retryEnabled=(a=e.retry)!==null&&a!==void 0?a:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const c=this.headers.get("Accept");c==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!c||c==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const s=this.fetch;let a=(async()=>{let c=0;for(;;){const f=new Headers(r.headers);c>0&&f.set("X-Retry-Count",String(c));let m;try{m=await s(r.url.toString(),{method:r.method,headers:f,body:JSON.stringify(r.body,(g,v)=>typeof v=="bigint"?v.toString():v),signal:r.signal})}catch(g){if(g?.name==="AbortError"||g?.code==="ABORT_ERR"||!rw.includes(r.method))throw g;if(r.retryEnabled&&c<tw){const v=Im(c);c++,await Lm(v,r.signal);continue}throw g}if(i1(r.method,m.status,c,r.retryEnabled)){var u,h;const g=(u=(h=m.headers)===null||h===void 0?void 0:h.get("Retry-After"))!==null&&u!==void 0?u:null,v=g!==null?Math.max(0,parseInt(g,10)||0)*1e3:Im(c);await m.text(),c++,await Lm(v,r.signal);continue}return await r.processResponse(m)}})();return this.shouldThrowOnError||(a=a.catch(c=>{var u;let h="",f="",m="";const g=c?.cause;if(g){var v,w,b,x;const R=(v=g?.message)!==null&&v!==void 0?v:"",A=(w=g?.code)!==null&&w!==void 0?w:"";h=`${(b=c?.name)!==null&&b!==void 0?b:"FetchError"}: ${c?.message}`,h+=`
12
13Caused by: ${(x=g?.name)!==null&&x!==void 0?x:"Error"}: ${R}`,A&&(h+=` (${A})`),g?.stack&&(h+=`
14${g.stack}`)}else{var _;h=(_=c?.stack)!==null&&_!==void 0?_:""}const E=this.url.toString().length;return c?.name==="AbortError"||c?.code==="ABORT_ERR"?(m="",f="Request was aborted (timeout or manual cancellation)",E>this.urlLengthLimit&&(f+=`. Note: Your request URL is ${E} 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.`)):(g?.name==="HeadersOverflowError"||g?.code==="UND_ERR_HEADERS_OVERFLOW")&&(m="",f="HTTP headers exceeded server limits (typically 16KB)",E>this.urlLengthLimit&&(f+=`. Your request URL is ${E} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(u=c?.name)!==null&&u!==void 0?u:"FetchError"}: ${c?.message}`,details:h,hint:f,code:m},data:null,count:null,status:0,statusText:""}}
14)),a.then(e,t)}async processResponse(e){var t=this;let r=null,s=null,o=null,a=e.status,c=e.statusText;if(e.ok){var u,h;if(t.method!=="HEAD"){var f;const v=await e.text();v===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((f=t.headers.get("Accept"))===null||f===void 0)&&f.includes("application/vnd.pgrst.plan+text"))?s=v:s=JSON.parse(v))}const m=(u=t.headers.get("Prefer"))===null||u===void 0?void 0:u.match(/count=(exact|planned|estimated)/),g=(h=e.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");m&&g&&g.length>1&&(o=parseInt(g[1])),t.isMaybeSingle&&Array.isArray(s)&&(s.length>1?(r={code:"PGRST116",details:`Results contain ${s.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},s=null,o=null,a=406,c="Not Acceptable"):s.length===1?s=s[0]:s=null)}else{const m=await e.text();try{r=JSON.parse(m),Array.isArray(r)&&e.status===404&&(s=[],r=null,a=200,c="OK")}catch{e.status===404&&m===""?(a=204,c="No Content"):r={message:m}}if(r&&t.shouldThrowOnError)throw new s1(r)}return{success:r===null,error:r,data:s,count:o,status:a,statusText:c}}returns(){return this}overrideTypes(){return this}},a1=class extends o1{select(e){let t=!1;const r=(e??"*").split("").map(s=>/\s/.test(s)&&!t?"":(s==='"'&&(t=!t),s)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:s,referencedTable:o=s}={}){const a=o?`${o}.order`:"order",c=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${c?`${c},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:s=r}={}){const o=typeof s>"u"?"offset":`${s}.offset`,a=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:s=!1,wal:o=!1,format:a="text"}={}){var c;const u=[e?"analyze":null,t?"verbose":null,r?"settings":null,s?"buffers":null,o?"wal":null].filter(Boolean).join("|"),h=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${h}"; options=${u};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const jm=new RegExp("[,()]");var ei=class extends a1{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(s=>typeof s=="string"&&jm.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(s=>typeof s=="string"&&jm.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:s}={}){let o="";s==="plain"?o="pl":s==="phrase"?o="ph":s==="websearch"&&(o="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${o}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([t,r])=>
14r!==void 0).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const s=r?`${r}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},l1=class{constructor(e,{headers:t={},schema:r,fetch:s,urlLengthLimit:o=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=s,this.urlLengthLimit=o,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:s}=t??{},o=r?"HEAD":"GET";let a=!1;const c=(e??"*").split("").map(f=>/\s/.test(f)&&!a?"":(f==='"'&&(a=!a),f)).join(""),{url:u,headers:h}=this.cloneRequestState();return u.searchParams.set("select",c),s&&h.append("Prefer",`count=${s}`),new ei({method:o,url:u,headers:h,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var s;const o="POST",{url:a,headers:c}=this.cloneRequestState();if(t&&c.append("Prefer",`count=${t}`),r||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((h,f)=>h.concat(Object.keys(f)),[]);if(u.length>0){const h=[...new Set(u)].map(f=>`"${f}"`);a.searchParams.set("columns",h.join(","))}}return new ei({method:o,url:a,headers:c,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:s,defaultToNull:o=!0}={}){var a;const c="POST",{url:u,headers:h}=this.cloneRequestState();if(h.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&u.searchParams.set("on_conflict",t),s&&h.append("Prefer",`count=${s}`),o||h.append("Prefer","missing=default"),Array.isArray(e)){const f=e.reduce((m,g)=>m.concat(Object.keys(g)),[]);if(f.length>0){const m=[...new Set(f)].map(g=>`"${g}"`);u.searchParams.set("columns",m.join(","))}}return new ei({method:c,url:u,headers:h,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;const s="PATCH",{url:o,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new ei({method:s,url:o,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const r="DELETE",{url:s,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new ei({method:r,url:s,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Po(e){"@babel/helpers - typeof";return Po=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Po(e)}function c1(e,t){if(Po(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var s=r.call(e,t);if(Po(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function u1(e){var t=c1(e,"string");return Po(t)=="symbol"?t:t+""}function d1(e,t,r){return(t=u1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,s)}return r}function dl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nm(Object(r),!0).forEach(function(s){d1(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nm(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}var h1=class nw{constructor(t,{headers:r={},schema:s,fetch:o,timeout:a,urlLengthLimit:c=8e3,retry:u}={}){this.url=t,this.headers=new Headers(r),this.schemaName=s,this.urlLengthLimit=c;const h=o??globalThis.fetch;a!==void 0&&a>0?this.fetch=(f,m)=>{const g=new AbortController,v=setTimeout(()=>g.abort(),a),w=m?.signal;if(w){if(w.aborted)return clearTimeout(v),h(f,m);const b=()=>{clearTimeout(v),g.abort()};return w.addEventListener("abort",b,{once:!0}),h(f,dl(dl({},m),{},{signal:g.signal})).finally(()=>{clearTimeout(v),w.removeEventListener("abort",b)})}return h(f,dl(dl({},m),{},{signal:g.signal})).finally(()=>clearTimeout(v))}:this.fetch=h,this.retry=u}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new l1(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new nw(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,r={}
14,{head:s=!1,get:o=!1,count:a}={}){var c;let u;const h=new URL(`${this.url}/rpc/${t}`);let f;const m=w=>w!==null&&typeof w=="object"&&(!Array.isArray(w)||w.some(m)),g=s&&Object.values(r).some(m);g?(u="POST",f=r):s||o?(u=s?"HEAD":"GET",Object.entries(r).filter(([w,b])=>b!==void 0).map(([w,b])=>[w,Array.isArray(b)?`{${b.join(",")}}`:`${b}`]).forEach(([w,b])=>{h.searchParams.append(w,b)})):(u="POST",f=r);const v=new Headers(this.headers);return g?v.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&v.set("Prefer",`count=${a}`),new ei({method:u,url:h,headers:v,schema:this.schemaName,body:f,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class f1{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const s=r.versions;if(s&&s.node){const o=s.node,a=parseInt(o.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
15import ws from "ws"
16new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
17
18Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const p1="2.104.1",g1=`realtime-js/${p1}`,m1="1.0.0",sw="2.0.0",y1=sw,v1=1e4,w1=100,xn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},iw={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Bd={connecting:"connecting",closing:"closing",closed:"closed"};class _1{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let s=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(s))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,s;const o=(s=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&s!==void 0?s:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(t){var r,s;const o=(s=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&s!==void 0?s:{},c=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,c)}_encodeUserBroadcastPush(t,r,s){var o,a;const c=t.topic,u=(o=t.ref)!==null&&o!==void 0?o:"",h=(a=t.join_ref)!==null&&a!==void 0?a:"",f=t.payload.event,m=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},g=Object.keys(m).length===0?"":JSON.stringify(m);if(h.length>255)throw new Error(`joinRef length ${h.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`ref length ${u.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`topic length ${c.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`userEvent length ${f.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`metadata length ${g.length} exceeds maximum of 255`);const v=this.USER_BROADCAST_PUSH_META_LENGTH+h.length+u.length+c.length+f.length+g.length,w=new ArrayBuffer(this.HEADER_LENGTH+v);let b=new DataView(w),x=0;b.setUint8(x++,this.KINDS.userBroadcastPush),b.setUint8(x++,h.length),b.setUint8(x++,u.length),b.setUint8(x++,c.length),b.setUint8(x++,f.length),b.setUint8(x++,g.length),b.setUint8(x++,r),Array.from(h,E=>
18b.setUint8(x++,E.charCodeAt(0))),Array.from(u,E=>b.setUint8(x++,E.charCodeAt(0))),Array.from(c,E=>b.setUint8(x++,E.charCodeAt(0))),Array.from(f,E=>b.setUint8(x++,E.charCodeAt(0))),Array.from(g,E=>b.setUint8(x++,E.charCodeAt(0)));var _=new Uint8Array(w.byteLength+s.byteLength);return _.set(new Uint8Array(w),0),_.set(new Uint8Array(s),w.byteLength),_.buffer}decode(t,r){if(this._isArrayBuffer(t)){let s=this._binaryDecode(t);return r(s)}if(typeof t=="string"){const s=JSON.parse(t),[o,a,c,u,h]=s;return r({join_ref:o,ref:a,topic:c,event:u,payload:h})}return r({})}_binaryDecode(t){const r=new DataView(t),s=r.getUint8(0),o=new TextDecoder;if(s===this.KINDS.userBroadcast)return this._decodeUserBroadcast(t,r,o)}_decodeUserBroadcast(t,r,s){const o=r.getUint8(1),a=r.getUint8(2),c=r.getUint8(3),u=r.getUint8(4);let h=this.HEADER_LENGTH+4;const f=s.decode(t.slice(h,h+o));h=h+o;const m=s.decode(t.slice(h,h+a));h=h+a;const g=s.decode(t.slice(h,h+c));h=h+c;const v=t.slice(h,t.byteLength),w=u===this.JSON_ENCODING?JSON.parse(s.decode(v)):v,b={type:this.BROADCAST_EVENT,event:m,payload:w};return c>0&&(b.meta=JSON.parse(g)),{join_ref:null,ref:null,topic:f,event:this.BROADCAST_EVENT,payload:b}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t?.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([s])=>r.includes(s)))}}var je;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(je||(je={}));const Mm=(e,t,r={})=>{var s;const o=(s=r.skipTypes)!==null&&s!==void 0?s:[];return t?Object.keys(t).reduce((a,c)=>(a[c]=b1(c,e,t,o),a),{}):{}},b1=(e,t,r,s)=>{const o=t.find(u=>u.name===e),a=o?.type,c=r[e];return a&&!s.includes(a)?ow(a,c):zd(c)},ow=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return k1(t,r)}switch(e){case je.bool:return S1(t);case je.float4:case je.float8:case je.int2:case je.int4:case je.int8:case je.numeric:case je.oid:return x1(t);case je.json:case je.jsonb:return E1(t);case je.timestamp:return R1(t);case je.abstime:case je.date:case je.daterange:case je.int4range:case je.int8range:case je.money:case je.reltime:case je.text:case je.time:case je.timestamptz:case je.timetz:case je.tsrange:case je.tstzrange:return zd(t);default:return zd(t)}},zd=e=>e,S1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},x1=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},E1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},k1=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,s=e[r];if(e[0]==="{"&&s==="}"){let a;const c=e.slice(1,r);try{a=JSON.parse("["+c+"]")}catch{a=c?c.split(","):[]}return a.map(u=>ow(t,u))}return e},R1=e=>typeof e=="string"?e.replace(" ","T"):e,aw=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var _o=e=>typeof e=="function"?e:function(){return e},C1=typeof self<"u"?self:null,ti=typeof window<"u"?window:null,xr=C1||ti||globalThis,T1="2.0.0",P1=1e4,A1=1e3,kr={connecting:0,open:1,closing:2,closed:3},Rt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},zr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Hd={longpoll:"longpoll",websocket:"websocket"},O1={complete:4},Wd="base64url.bearer.phx.",hl=class{constructor(e,t,r,s){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=s,this.timeoutTimer=null,this.recHo
vendor: 8,700 bytes, line 18
18oks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},lw=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},I1=class{constructor(e,t,r){this.state=Rt.closed,this.topic=e,this.params=_o(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new hl(this,zr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new lw(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Rt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this.joinPush.receive("error",s=>{this.state=Rt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Rt.closed,this.socket.remove(this)}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=Rt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new hl(this,zr.leave,_o({}),this.timeout).send(),this.state=Rt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(zr.reply,(s,o)=>{this.trigger(this.replyEventName(o),s)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Rt.closed,this.bindings=[]}onClose(e){this.on(zr.close,e)}onError(e){return this.on(zr.error,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>!(r.event===e&&(typeof t>"u"||t===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new hl(this,e,function(){return t},r);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Rt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(zr.close,"leave")},r=new hl(this,zr.leave,_o({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,s){return this.topic!==e?!1:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:s}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Rt.joining,this.joinPush.resend(e))}trigger(e,t,r,s){let o=this.onMessage(e,t,r,s);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let a=this.bindings.filter(c=>c.event===e&&this.filterBindings(c,t,r));for(let c=0;c<a.length;c++)a[c].callback(o,r,s||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Rt.closed}isErrored(){return this.state===Rt.errored}isJoined(){return this.state===Rt.joined}isJoining(){return this.state===Rt.joining}isLeaving(){return this.state===Rt.leaving}},$l=class{static request(e,t,r,s,o,a,c){if(xr.XDomainRequest){let u=new xr.XDomainRequest;return this.xdomainRequest(u,e,t,s,o,a,c)}else if(xr.XMLHttpRequest){let u=new xr.XMLHttpRequest;return this.xhrRequest(u,e,t,r,s,o,a,c)}else{if(xr.fetch&&xr.AbortController)return this.fetchRequest(e,t,r,s,o,a,c);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,r,s,o,a,c){let u={method:e,headers:r,body:s},h=null;return o&&(h=new AbortController,setTimeout(()=>h.abort(),o),u.signal=h.signal),xr.fetch(t,u).then(f=>f.text()).then(f=>this.parseJSON(f)).then(f=>c&&c(f)).catch(f=>{f.name==="AbortError"&&a?a():c&&c(null)}),h}static xdomainRequest(e,t,r,s,o,a,c){return e.timeout=o,e.open(t,r),e.onload=()=>{let u=this.parseJSON(e.responseText);c&&c(u)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(s),e}static xhrRequest(e,t,r,s,o,a,c,u){e.open(t,r,!0),e.timeout=a;for(let[h,f]of Object.entries(s))e.setRequestHeader(h,f);return e.onerror=()=>u&&u(null),e.onreadystatechange=()=>{if(e.readyState===O1.complete&&u){let h=this.parseJSON(e.responseText);u(h)}},c&&(e.ontimeout=c),e.send(o),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let o=t?`${t}[${s}]`:s,a=e[s];typeof a=="object"?r.push(this.serialize(a,o)):r.push(encodeURIComponent(o)+"="+encodeURIComponent(a))}return r.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},L1=e=>{let t="",r=new Uint8Array(e),s=r.byteLength;for(let o=0;o<s;o++)t+=String.fromCharCode(r[o]);return btoa(t)},Vs=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Wd)&&(this.authToken=atob(t[1].slice(Wd.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=kr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Hd.websocket),"$1/"+Hd.longpoll)}endpointURL(){return $l.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=kr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===kr.open||this.readyState===kr.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:r,token:s,messages:o}=t;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=s}else r=0;switch(r){case 200:o.forEach(a=>{setTimeout(()=>this.onmessage({data:a}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=kr.open,this.onopen({}),this.poll();break;
18case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(e){typeof e!="string"&&(e=L1(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
19`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,r){for(let o of this.reqs)o.abort();this.readyState=kr.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s)}ajax(e,t,r,s,o){let a,c=()=>{this.reqs.delete(a),s()};a=$l.request(e,this.endpointURL(),t,r,this.timeout,c,u=>{this.reqs.delete(a),this.isActive()&&o(u)}),this.reqs.add(a)}},j1=class vo{constructor(t,r={}){let s=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(s.state,o=>{let{onJoin:a,onLeave:c,onSync:u}=this.caller;this.joinRef=this.channel.joinRef(),this.state=vo.syncState(this.state,o,a,c),this.pendingDiffs.forEach(h=>{this.state=vo.syncDiff(this.state,h,a,c)}),this.pendingDiffs=[],u()}),this.channel.on(s.diff,o=>{let{onJoin:a,onLeave:c,onSync:u}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=vo.syncDiff(this.state,o,a,c),u())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return vo.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,r,s,o){let a=this.clone(t),c={},u={};return this.map(a,(h,f)=>{r[h]||(u[h]=f)}),this.map(r,(h,f)=>{let m=a[h];if(m){let g=f.metas.map(x=>x.phx_ref),v=m.metas.map(x=>x.phx_ref),w=f.metas.filter(x=>v.indexOf(x.phx_ref)<0),b=m.metas.filter(x=>g.indexOf(x.phx_ref)<0);w.length>0&&(c[h]=f,c[h].metas=w),b.length>0&&(u[h]=this.clone(m),u[h].metas=b)}else c[h]=f}),this.syncDiff(a,{joins:c,leaves:u},s,o)}static syncDiff(t,r,s,o){let{joins:a,leaves:c}=this.clone(r);return s||(s=function(){}),o||(o=function(){}),this.map(a,(u,h)=>{let f=t[u];if(t[u]=this.clone(h),f){let m=t[u].metas.map(v=>v.phx_ref),g=f.metas.filter(v=>m.indexOf(v.phx_ref)<0);t[u].metas.unshift(...g)}s(u,f,h)}),this.map(c,(u,h)=>{let f=t[u];if(!f)return;let m=h.metas.map(g=>g.phx_ref);f.metas=f.metas.filter(g=>m.indexOf(g.phx_ref)<0),o(u,f,h),f.metas.length===0&&delete t[u]}),t}static list(t,r){return r||(r=function(s,o){return o}),this.map(t,(s,o)=>r(s,o))}static map(t,r){return Object.getOwnPropertyNames(t).map(s=>r(s,t[s]))}static clone(t){return JSON.parse(JSON.stringify(t))}},fl={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,s,o,a,c]=JSON.parse(e);return t({join_ref:r,ref:s,topic:o,event:a,payload:c})}},binaryEncode(e){let{join_ref:t,ref:r,event:s,topic:o,payload:a}=e,c=this.META_LENGTH+t.length+r.length+o.length+s.length,u=new ArrayBuffer(this.HEADER_LENGTH+c),h=new DataView(u),f=0;h.setUint8(f++,this.KINDS.push),h.setUint8(f++,t.length),h.setUint8(f++,r.length),h.setUint8(f++,o.length),h.setUint8(f++,s.length),Array.from(t,g=>h.setUint8(f++,g.charCodeAt(0))),Array.from(r,g=>h.setUint8(f++,g.charCodeAt(0))),Array.from(o,g=>h.setUint8(f++,g.charCodeAt(0))),Array.from(s,g=>h.setUint8(f++,g.charCodeAt(0)));var m=new Uint8Array(u.byteLength+a.byteLength);return m.set(new Uint8Array(u),0),m.set(new Uint8Array(a),u.byteLength),m.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);
19case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,r){let s=t.getUint8(1),o=t.getUint8(2),a=t.getUint8(3),c=this.HEADER_LENGTH+this.META_LENGTH-1,u=r.decode(e.slice(c,c+s));c=c+s;let h=r.decode(e.slice(c,c+o));c=c+o;let f=r.decode(e.slice(c,c+a));c=c+a;let m=e.slice(c,e.byteLength);return{join_ref:u,ref:null,topic:h,event:f,payload:m}},decodeReply(e,t,r){let s=t.getUint8(1),o=t.getUint8(2),a=t.getUint8(3),c=t.getUint8(4),u=this.HEADER_LENGTH+this.META_LENGTH,h=r.decode(e.slice(u,u+s));u=u+s;let f=r.decode(e.slice(u,u+o));u=u+o;let m=r.decode(e.slice(u,u+a));u=u+a;let g=r.decode(e.slice(u,u+c));u=u+c;let v=e.slice(u,e.byteLength),w={status:g,response:v};return{join_ref:h,ref:f,topic:m,event:zr.reply,payload:w}},decodeBroadcast(e,t,r){let s=t.getUint8(1),o=t.getUint8(2),a=this.HEADER_LENGTH+2,c=r.decode(e.slice(a,a+s));a=a+s;let u=r.decode(e.slice(a,a+o));a=a+o;let h=e.slice(a,e.byteLength);return{join_ref:null,ref:null,topic:c,event:u,payload:h}}},N1=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||P1,this.transport=t.transport||xr.WebSocket||Vs,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||xr&&xr.sessionStorage,this.establishedConnections=0,this.defaultEncoder=fl.encode.bind(fl),this.defaultDecoder=fl.decode.bind(fl),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Vs?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;ti&&ti.addEventListener&&(ti.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),r=this.connectClock)}),ti.addEventListener("pageshow",s=>{r===this.connectClock&&(r=null,this.connect())}),ti.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,o,a)=>{console.log(`${s}: ${o}`,a)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=_o(t.params||{}),this.endPoint=`${e}/${Hd.websocket}`,this.vsn=t.vsn||T1,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new lw(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Vs}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=$l.appendParams($l.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=_o(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Vs?this.connectWithF
vendor: 4,313 bytes, line 19
19allback(Vs,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let s=this.onMessage(o=>{o.ref===t&&(this.off([s]),e(Date.now()-r))});return!0}transportName(e){return e===Vs?"LongPoll":e.name}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Wd}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let r=!1,s=!0,o,a,c=this.transportName(e),u=h=>{this.log("transport",`falling back to ${c}...`,h),this.off([o,a]),s=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${c}`))return u("memorized");this.fallbackTimer=setTimeout(u,t),a=this.onError(h=>{this.log("transport","error",h),s&&!r&&(clearTimeout(this.fallbackTimer),u(h))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!s){let h=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${h}`,"true"),this.log("transport",`established ${h} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(u,t),this.ping(h=>{this.log("transport","connected to primary after",h),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),A1,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();const s=this.conn;this.waitForBufferDone(s,()=>{t?s.close(t,r||""):s.close(),this.waitForSocketClosed(s,()=>{this.conn===s&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){if(r===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r)}waitForSocketClosed(e,t,r=1){if(r===5||e.readyState===kr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError()}
19triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(zr.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case kr.connecting:return"connecting";case kr.open:return"open";case kr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([r])=>e.indexOf(r)===-1)}channel(e,t={}){let r=new I1(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:s,ref:o,join_ref:a}=e;this.log("push",`${t} ${r} (${a}, ${o})`,s)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:s,payload:o,ref:a,join_ref:c}=t;if(a&&a===this.pendingHeartbeatRef){const u=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(o.status==="ok"?"ok":"error",u)}catch(h){this.log("error","error in heartbeat callback",h)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${o.status||""} ${r} ${s} ${a&&"("+a+")"||""}`.trim(),o);for(let u=0;u<this.channels.length;u++){const h=this.channels[u];h.isMember(r,s,o,c)&&h.trigger(s,o,a,c)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,s])=>{try{s(...t)}catch(o){this.log("error",`error in ${e} callback`,o)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r.isJoined()||r.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class bo{constructor(t,r){const s=$1(r);this.presence=new j1(t.getChannel(),s),this.presence.onJoin((o,a,c)=>{const u=bo.onJoinPayload(o,a,c);t.getChannel().trigger("presence",u)}),this.presence.onLeave((o,a,c)=>{const u=bo.onLeavePayload(o,a,c);t.getChannel().trigger("presence",u)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return bo.transformState(this.presence.state)}static transformState(t){return t=M1(t),Object.getOwnPropertyNames(t).reduce((r,s)=>{const o=t[s];return r[s]=Cl(o),r},{})}static onJoinPayload(t,r,s){const o=$m(r),a=Cl(s);return{event:"join",key:t,currentPresences:o,newPresences:a}}static onLeavePayload(t,r,s){const o=$m(r),a=Cl(s);return{event:"leave",key:t,currentPresences:o,leftPresences:a}}}function Cl(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function M1(e){return JSON.parse(JSON.stringify(e))}function $1(e){return e?.events&&{events:e.events}}function $m(e){return e?.metas?Cl(e):[]}var Dm;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Dm||(Dm={}));class D1{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new bo(this.channel.channelAdapter,r)}}class U1{constructor(t,r,s){const o=F1(s);this.channel=t.getSocket().channel(r,o),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,r){return this.channel.on(t,r)}off(t,r){this.channel.off(t,r)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,r,s){let o;try{o=this.channel.push(t,r,s)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>w1){const a=this.channel.pushBuffer.shift();a.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload())}return o}updateJoinPayload(t){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),t)}canPush(){return this.socket.isConnected()&&this.state===xn.joined}isJoined(){return this.state===xn.joined}isJoining(){return this.state===xn.joining}isClosed(){return this.state===xn.closed}isLeaving(){return this.state===xn.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function F1(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var Um;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Um||(Um={}));var ii;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ii||(ii={}));var Hr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Hr||(Hr={}));class So{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,r={config:{}},s){var o,a;if(this.topic=t,this.params=r,this.socket=s,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1}
19,r.config),this.channelAdapter=new U1(this.socket.socketAdapter,t,this.params),this.presence=new D1(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=aw(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((a=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||a===void 0)&&a.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,r=this.timeout){var s,o,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:c,presence:u,private:h}}=this.params,f=(o=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(w=>w.filter))!==null&&o!==void 0?o:[],m=!!this.bindings[ii.PRESENCE]&&this.bindings[ii.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,g={},v={broadcast:c,presence:Object.assign(Object.assign({},u),{enabled:m}),postgres_changes:f,private:h};this.socket.accessTokenValue&&(g.access_token=this.socket.accessTokenValue),this._onError(w=>{t?.(Hr.CHANNEL_ERROR,w)}),this._onClose(()=>t?.(Hr.CLOSED)),this.updateJoinPayload(Object.assign({config:v},g)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:w})=>{if(this.socket._isManualToken()||this.socket.setAuth(),w===void 0){t?.(Hr.SUBSCRIBED);return}this._updatePostgresBindings(w,t)}).receive("error",w=>{this.state=xn.errored,t?.(Hr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(w).join(", ")||"error")))}).receive("timeout",()=>{t?.(Hr.TIMED_OUT)})}return this}_updatePostgresBindings(t,r){var s;const o=this.bindings.postgres_changes,a=(s=o?.length)!==null&&s!==void 0?s:0,c=[];for(let u=0;u<a;u++){const h=o[u],{filter:{event:f,schema:m,table:g,filter:v}}=h,w=t&&t[u];if(w&&w.event===f&&So.isFilterValueEqual(w.schema,m)&&So.isFilterValueEqual(w.table,g)&&So.isFilterValueEqual(w.filter,v))c.push(Object.assign(Object.assign({},h),{id:w.id}));else{this.unsubscribe(),this.state=xn.errored,r?.(Hr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=c,this.state!=xn.errored&&r&&r(Hr.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,s){const o=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),a=t===ii.PRESENCE||t===ii.POSTGRES_CHANGES;if(o&&a)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,r,s)}async httpSend(t,r,s={}){var o;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(o=s.timeout)!==null&&o!==void 0?o:this.timeout);if(u.status===202)return{success:!0};let h=u.statusText;try{const f=await u.json();h=f.error||f.message||h}catch{}return Promise.reject(new Error(h))}async send(t,r={}){var s,o;if(!this.channelAdapter.canPush()&&t.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:a,payload:c}=t,u={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(u.Authorization=`Bearer ${this.socket.accessTokenValue}`);const h={method:"POST",headers:u,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:c,private:this.private}]})};try{const f=await this._fetchWithTimeout(this.broadcastEndpointURL,h,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);return await((o=f.body)===null||o===void 0?void 0:o.cancel()),f.ok?"ok":"error"}catch(f){return f.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var c,u,h;const f=this.channelAdapter.push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((h=(u=(c=this.params)===null||c===void 0?void 0:c.config)===null||u===void 0?void 0:u.broadcast)===null||h===void 0)&&h.ack)&&a("ok"),f.receive("ok",()=>a("ok")),f.receive("error",()=>a("error")),f.receive("timeout",()=>a("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,r,s){const o=new AbortController,a=setTimeout(()=>o.abort(),s),c=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:o.signal}));return clearTimeout(a),c}_on(t,r,s){const o=t.toLocaleLowerCase(),a=this.channelAdapter.on(t,s),c={type:o,filter:r,callback:s,ref:a};return this.bindings[o]?this.bindings[o].push(c):this.bindings[o]=[c],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,r,s)=>{var o,a,c,u,h,f,m;const g=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(g,s))return!1;const v=(o=this.bindings[g])===null||o===void 0?void 0:o.find(w=>w.ref===t.ref);if(!v)return!0;if(["broadcast","presence","postgres_changes"].includes(g))if("id"in v){const w=v.id,b=(a=v.filter)===null||a===void 0?void 0:a.event;return w&&((c=r.ids)===null||c===void 0?void 0:c.includes(w))&&(b==="*"||b?.toLocaleLowerCase()===((u=r.data)===null||u===void 0?void 0:u.type.toLocaleLowerCase()))}else{const w=(f=(h=v?.filter)===null||h===void 0?void 0:h.event)===null||f===void 0?void 0:f.toLocaleLowerCase();return w==="*"||w===((m=r?.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return v.type.toLocaleLowerCase()===g})}_notThisChannelEvent(t,r){const{close:s,error:o,leave:a,join:c}=iw;return r&&[s,o,a,c].includes(t)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,r,s)=>{if(typeof r=="object"&&"ids"in r){const o=r.data,{schema:a,table:c,commit_timestamp:u,type:h,errors:f}=o;return Object.assign(Object.assign({},{schema:a,table:c,commit_timestamp:u,eventType:h,new:{},old:{},errors:f}),this._getPayloadRecords(o))}return r})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in t.bindings)for(const s of t.bindings[r])this._on(s.type,s.filter,s.callback)}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=Mm(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=Mm(t.columns,t.old_record)),r}}class B1{constructor(t,r){this.socket=new N1(t,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,r,s,o=1e4){return new Promise(a=>{setTimeout(()=>a("timeout"),o),this.socket.disconnect(()=>{t(),a("ok")},r,s)})}push(t){this.socket.push(t)}log(t,r,s){this.socket.log(t,r,s)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Bd.connecting}isDisconnecting(){return this.socket.connectionState()==Bd.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const z1={HEARTBEAT_INTERVAL:25e3},H1=[1e3,2e3,5e3,1e4],W1=1e4,V1=`
20  addEventListener("message", (e) => {
21    if (e.data.event === "start") {
22      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
23    }
24  });`;class q1{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,r){var s;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
24,this.ref=0,this.serializer=new _1,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=a=>a?(...c)=>a(...c):(...c)=>fetch(...c),!(!((s=r?.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const o=this._initializeOptions(r);this.socketAdapter=new B1(t,o),this.httpEndpoint=aw(t),this.fetch=this._resolveFetch(r?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const r=t.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._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,r){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,r)}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&t.teardown(),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=this.channels.map(async s=>{const o=await s.unsubscribe();return s.teardown(),o}),r=await Promise.all(t);return this.disconnect(),r}log(t,r,s){this.socketAdapter.log(t,r,s)}connectionState(){return this.socketAdapter.connectionState()||Bd.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,r={config:{}}){const s=`realtime:${t}`,o=this.getChannels().find(a=>a.topic===s);if(o)return o;{const a=new So(`realtime:${t}`,r,this);return this.channels.push(a),a}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}async _performAuth(t=null){let r,s=!1;if(t)r=t,s=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),r=this.accessTokenValue}else r=this.accessTokenValue;s?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(o=>{const a={access_token:r,version:g1};r&&o.updateJoinPayload(a),o.joinedOnce&&o.channelAdapter.isJoined()&&o.channelAdapter.push(iw.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(r,s)=>{r=="sent"&&this._setAuthSafely(),t&&t(r,s)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},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)}_workerObjectUrl(t){let r;if(t)r=t;else{const s=new Blob([V1],{type:"application/javascript"});r=URL.createObjectURL(s)}return r}_initializeOptions(t){var r,s,o,a,c,u,h,f,m;this.worker=(r=t?.worker)!==null&&r!==void 0?r:!1,this.accessToken=(s=t?.accessToken)!==null&&s!==void 0?s:null;const g={};g.timeout=(o=t?.timeout)!==null&&o!==void 0?o:v1,g.heartbeatIntervalMs=(a=t?.heartbeatIntervalMs)!==null&&a!==void 0?a:z1.HEARTBEAT_INTERVAL,g.transport=(c=t?.transport)!==null&&c!==void 0?c:f1.getWebSocketConstructor(),g.params=t?.params,g.logger=t?.logger,g.heartbeatCallback=this._wrapHeartbeatCallback(t?.heartbeatCallback),g.reconnectAfterMs=(u=t?.reconnectAfterMs)!==null&&u!==void 0?u:(x=>H1[x-1]||W1);let v,w;const b=(h=t?.vsn)!==null&&h!==void 0?h:y1;switch(b){case m1:v=(x,_)=>_(JSON.stringify(x)),w=(x,_)=>_(JSON.parse(x));break;case sw:v=this.serializer.encode.bind(this.serializer),w=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${g.vsn}`)}if(g.vsn=b,g.encode=(f=t?.encode)!==null&&f!==void 0?f:v,g.decode=(m=t?.decode)!==null&&m!==void 0?m:w,g.beforeReconnect=this._reconnectAuth.bind(this),(t?.logLevel||t?.log_level)&&(this.logLevel=t.logLevel||t.log_level,g.params=Object.assign(Object.assign({},g.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t?.workerUrl,g.autoSendHeartbeat=!this.worker}return g}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
37var Ao=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function K1(e,t,r){const s=new URL(t,e);if(r)for(const[o,a]of Object.entries(r))a!==void 0&&s.searchParams.set(o,a);return s.toString()}async function G1(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function J1(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:s,query:o,body:a,headers:c}){const u=K1(e.baseUrl,s,o),h=await G1(e.auth),f=await t(u,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...h,...c},body:a?JSON.stringify(a):void 0}),m=await f.text(),g=(f.headers.get("content-type")||"").includes("application/json"),v=g&&m?JSON.parse(m):m;if(!f.ok){const w=g?v:void 0,b=w?.error;throw new Ao(b?.message??`Request failed with status ${f.status}`,{status:f.status,icebergType:b?.type,icebergCode:b?.code,details:w})}return{status:f.status,headers:f.headers,data:v}}}}function pl(e){return e.join("�")}var Q1=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:pl(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(s=>({namespace:s}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${pl(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${pl(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${pl(e.namespace)}`}),!0}catch(t){if(t instanceof Ao&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Ao&&r.status===409)return;throw r}}};function qs(e){return e.join("�")}var Y1=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${qs(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${qs(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${qs(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${qs(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${qs(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${qs(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Ao&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Ao&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},X1=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=J1({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new Q1(this.client,t),this.tableOps=new Y1(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
37async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function Oo(e){"@babel/helpers - typeof";return Oo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oo(e)}function Z1(e,t){if(Oo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var s=r.call(e,t);if(Oo(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eC(e){var t=Z1(e,"string");return Oo(t)=="symbol"?t:t+""}function tC(e,t,r){return(t=eC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,s)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fm(Object(r),!0).forEach(function(s){tC(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fm(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}var nc=class extends Error{constructor(e,t="storage",r,s){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=s}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function sc(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Vd=class extends nc{constructor(e,t,r,s="storage"){super(e,s,t,r),this.name=s==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return ge({},super.toJSON())}},cw=class extends nc{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function Eh(e,t,r){const s=ge({},e),o=t.toLowerCase();for(const a of Object.keys(s))a.toLowerCase()===o&&delete s[a];return s[o]=r,s}function rC(e){const t={};for(const[r,s]of Object.entries(e))t[r.toLowerCase()]=s;return t}const nC=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),sC=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},qd=e=>{if(Array.isArray(e))return e.map(r=>qd(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,s])=>{const o=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));t[o]=qd(s)}),t},iC=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Bm=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},oC=async(e,t,r,s)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const o=e;let a=parseInt(o.status,10);Number.isFinite(a)||(a=500),o.json().then(c=>{const u=c?.statusCode||c?.code||a+"";t(new Vd(Bm(c),a,u,s))}).catch(()=>{const c=a+"";t(new Vd(o.statusText||`HTTP ${a} error`,a,c,s))})}else t(new cw(Bm(e),e,s))},aC=(e,t,r,s)=>{const o={method:e,headers:t?.headers||{}};if(e==="GET"||e==="HEAD"||!s)return ge(ge({},o),r);if(sC(s)){var a;const c=t?.headers||{};let u;for(const[h,f]of Object.entries(c))h.toLowerCase()==="content-type"&&(u=f);o.headers=Eh(c,"Content-Type",(a=u)!==null&&a!==void 0?a:"application/json"),o.body=JSON.stringify(s)}else o.body=s;return t?.duplex&&(o.duplex=t.duplex),ge(ge({},o),r)};async function po(e,t,r,s,o,a,c){return new Promise((u,h)=>{e(r,aC(t,s,o,a)).then(f=>{if(!f.ok)throw f;if(s?.noResolveJson)return f;if(c==="vectors"){const m=f.headers.get("content-type");if(f.headers.get("content-length")==="0"||f.status===204)return{};if(!m||!m.includes("application/json"))return{}}return f.json()}).then(f=>u(f)).catch(f=>oC(f,h,s,c))})}function uw(e="storage"){return{get:async(t,r,s,o)=>po(t,"GET",r,s,o,void 0,e),post:async(t,r,s,o,a)=>po(t,"POST",r,o,a,s,e),put:async(t,r,s,o,a)=>po(t,"PUT",r,o,a,s,e),head:async(t,r,s,o)=>po(t,"HEAD",r,ge(ge({},s),{},{noResolveJson:!0}),o,void 0,e),remove:async(t,r,s,o,a)=>po(t,"DELETE",r,o,a,s,e)}}const lC=uw("storage"),{get:Io,post:ar,put:Kd,head:cC,remove:kh}=lC,Ut=uw("vectors");var vi=class{constructor(e,t={},r,s="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=rC(t),this.fetch=nC(r),this.namespace=s}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Eh(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(sc(r))return{data:null,error:r};throw r}}},uC=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(sc(t))return{data:null,error:t};throw t}}};let dw;dw=Symbol.toStringTag;var dC=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[dw]="BlobDownloadBuilder",this.promise=null}asStream(){return new uC(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(sc(t))return{data:null,error:t};throw t}}};const hC={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},zm={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var fC=class extends vi{constructor(e,t={},r,s){super(e,t,s,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,s){var o=this;return o.handleOperation(async()=>{let a;const c=ge(ge({},zm),s);let u=ge(ge({},o.headers),e==="POST"&&{"x-upsert":String(c.upsert)});const h=c.metadata;if(typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",c.cacheControl),h&&a.append("metadata",o.encodeMetadata(h)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",c.cacheControl),h&&!a.has("metadata")&&a.append("metadata",o.encodeMetadata(h))):(a=r,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType,h&&(u["x-metadata"]=o.toBase64(o.encodeMetadata(h))),(typeof ReadableStream<"u"&&a 
37instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!c.duplex&&(c.duplex="half")),s?.headers)for(const[v,w]of Object.entries(s.headers))u=Eh(u,v,w);const f=o._removeEmptyFolders(t),m=o._getFinalPath(f),g=await(e=="PUT"?Kd:ar)(o.fetch,`${o.url}/object/${m}`,a,ge({headers:u},c?.duplex?{duplex:c.duplex}:{}));return{path:f,id:g.Id,fullPath:g.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,s){var o=this;const a=o._removeEmptyFolders(e),c=o._getFinalPath(a),u=new URL(o.url+`/object/upload/sign/${c}`);return u.searchParams.set("token",t),o.handleOperation(async()=>{let h;const f=ge(ge({},zm),s),m=ge(ge({},o.headers),{"x-upsert":String(f.upsert)});return typeof Blob<"u"&&r instanceof Blob?(h=new FormData,h.append("cacheControl",f.cacheControl),h.append("",r)):typeof FormData<"u"&&r instanceof FormData?(h=r,h.append("cacheControl",f.cacheControl)):(h=r,m["cache-control"]=`max-age=${f.cacheControl}`,m["content-type"]=f.contentType),{path:a,fullPath:(await Kd(o.fetch,u.toString(),h,{headers:m})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e);const o=ge({},r.headers);t?.upsert&&(o["x-upsert"]="true");const a=await ar(r.fetch,`${r.url}/object/upload/sign/${s}`,{},{headers:o}),c=new URL(r.url+a.url),u=c.searchParams.get("token");if(!u)throw new nc("No token returned by API");return{signedUrl:c.toString(),path:e,token:u}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var s=this;return s.handleOperation(async()=>await ar(s.fetch,`${s.url}/object/move`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,de
37stinationBucket:r?.destinationBucket},{headers:s.headers}))}async copy(e,t,r){var s=this;return s.handleOperation(async()=>({path:(await ar(s.fetch,`${s.url}/object/copy`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r?.destinationBucket},{headers:s.headers})).Key}))}async createSignedUrl(e,t,r){var s=this;return s.handleOperation(async()=>{let o=s._getFinalPath(e);const a=typeof r?.transform=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let c=await ar(s.fetch,`${s.url}/object/sign/${o}`,ge({expiresIn:t},a?{transform:r.transform}:{}),{headers:s.headers});const u=new URLSearchParams;r?.download&&u.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&u.set("cacheNonce",String(r.cacheNonce));const h=u.toString();return{signedUrl:encodeURI(`${s.url}${c.signedURL}${h?`&${h}`:""}`)}})}async createSignedUrls(e,t,r){var s=this;return s.handleOperation(async()=>{const o=await ar(s.fetch,`${s.url}/object/sign/${s.bucketId}`,{expiresIn:t,paths:e},{headers:s.headers}),a=new URLSearchParams;r?.download&&a.set("download",r.download===!0?"":r.download),r?.cacheNonce!=null&&a.set("cacheNonce",String(r.cacheNonce));const c=a.toString();return o.map(u=>ge(ge({},u),{},{signedUrl:u.signedURL?encodeURI(`${s.url}${u.signedURL}${c?`&${c}`:""}`):null}))})}download(e,t,r){const s=typeof t?.transform=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",o=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(o,t.transform),t?.cacheNonce!=null&&o.set("cacheNonce",String(t.cacheNonce));const a=o.toString(),c=this._getFinalPath(e),u=()=>Io(this.fetch,`${this.url}/${s}/${c}${a?`?${a}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new dC(u,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>qd(await Io(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await cC(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(o){if(t.shouldThrowOnError)throw o;if(sc(o)){var s;const a=o instanceof Vd?o.status:o instanceof cw?(s=o.originalError)===null||s===void 0?void 0:s.status:void 0;if(a!==void 0&&[400,404].includes(a))return{data:!1,error:o}}throw o}}getPublicUrl(e,t){const r=this._getFinalPath(e),s=new URLSearchParams;t?.download&&s.set("download",t.download===!0?"":t.download),t?.transform&&this.applyTransformOptsToQuery(s,t.transform),t?.cacheNonce!=null&&s.set("cacheNonce",String(t.cacheNonce));const o=s.toString(),a=typeof t?.transform=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}`)+(o?`?${o}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await kh(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var s=this;return s.handleOperation(async()=>{const o=ge(ge(ge({},hC),t),{},{prefix:e||""});return await ar(s.fetch,`${s.url}/object/list/${s.bucketId}`,o,{headers:s.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const s=ge({},e);return await ar(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,s,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const pC="2.104.1",qo={"X-Client-Info":`storage-js/${pC}`};var gC=class extends vi{constructor(e,t={},r,s){const o=new URL(e);s?.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const a=o.href.replace(/\/$/,""),c=ge(ge({},qo),t);super(a,c,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await Io(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Io(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await ar(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await Kd(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await ar(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await kh(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},mC=class extends vi{constructor(e,t={},r){const s=e.replace(/\/$/,""),o=ge(ge({},qo),t);super(s,o,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await ar(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>
37{const r=new URLSearchParams;e?.limit!==void 0&&r.set("limit",e.limit.toString()),e?.offset!==void 0&&r.set("offset",e.offset.toString()),e?.sortColumn&&r.set("sortColumn",e.sortColumn),e?.sortOrder&&r.set("sortOrder",e.sortOrder),e?.search&&r.set("search",e.search);const s=r.toString(),o=s?`${t.url}/bucket?${s}`:`${t.url}/bucket`;return await Io(t.fetch,o,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await kh(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!iC(e))throw new nc("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 X1({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),s=this.shouldThrowOnError;return new Proxy(r,{get(o,a){const c=o[a];return typeof c!="function"?c:async(...u)=>{try{return{data:await c.apply(o,u),error:null}}catch(h){if(s)throw h;return{data:null,error:h}}}}})}},yC=class extends vi{constructor(e,t={},r){const s=e.replace(/\/$/,""),o=ge(ge({},qo),{},{"Content-Type":"application/json"},t);super(s,o,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await Ut.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await Ut.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},vC=class extends vi{constructor(e,t={},r){const s=e.replace(/\/$/,""),o=ge(ge({},qo),{},{"Content-Type":"application/json"},t);super(s,o,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},wC=class extends vi{constructor(e,t={},r){const s=e.replace(/\/$/,""),o=ge(ge({},qo),{},{"Content-Type":"application/json"},t);super(s,o,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ut.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},_C=class extends wC{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new bC(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},bC=class extends yC{constructor(e,t,r,s){super(e,t,s),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,ge(ge({},e),{},{vectorBucketName:r.vectorBucketName}))}
37async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,ge(ge({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new SC(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},SC=class extends vC{constructor(e,t,r,s,o){super(e,t,o),this.vectorBucketName=r,this.indexName=s}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,ge(ge({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,ge(ge({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,ge(ge({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,ge(ge({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,ge(ge({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},xC=class extends gC{constructor(e,t={},r,s){super(e,t,r,s)}from(e){return new fC(this.url,this.headers,e,this.fetch)}get vectors(){return new _C(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new mC(this.url+"/iceberg",this.headers,this.fetch)}};function ic(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(r[s[o]]=e[s[o]]);return r}const hw="2.104.1",ri=30*1e3,Gd=3,_d=Gd*ri,EC="http://localhost:9999",kC="supabase.auth.token",RC={"X-Client-Info":`gotrue-js/${hw}`},Jd="X-Supabase-Api-Version",fw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},CC=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,TC=600*1e3;class Lo extends Error{constructor(t,r,s){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=s}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function ie(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class PC extends Lo{constructor(t,r,s){super(t,r,s),this.name="AuthApiError",this.status=r,this.code=s}}function AC(e){return ie(e)&&e.name==="AuthApiError"}class Zn extends Lo{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Yr extends Lo{constructor(t,r,s,o){super(t,s,o),this.name=r,this.status=s}}class $t extends Yr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function gl(e){return ie(e)&&e.name==="AuthSessionMissingError"}class Ks extends Yr{constructor(){super("Auth session or user missing","AuthInvalidToken
37ResponseError",500,void 0)}}class ml extends Yr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class yl extends Yr{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function OC(e){return ie(e)&&e.name==="AuthImplicitGrantRedirectError"}class Hm extends Yr{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class IC extends Yr{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 Qd extends Yr{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function bd(e){return ie(e)&&e.name==="AuthRetryableFetchError"}class Wm extends Yr{constructor(t,r,s){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Yd extends Yr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Dl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Vm=` 	
38\r=`.split(""),LC=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Vm.length;t+=1)e[Vm[t].charCodeAt(0)]=-2;for(let t=0;t<Dl.length;t+=1)e[Dl[t].charCodeAt(0)]=t;return e})();function qm(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;r(Dl[s]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;r(Dl[s]),t.queuedBits-=6}}function pw(e,t,r){const s=LC[e];if(s>-1)for(t.queue=t.queue<<6|s,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Km(e){const t=[],r=c=>{t.push(String.fromCodePoint(c))},s={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},a=c=>{MC(c,s,r)};for(let c=0;c<e.length;c+=1)pw(e.charCodeAt(c),o,a);return t.join("")}function jC(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function NC(e,t){for(let r=0;r<e.length;r+=1){let s=e.charCodeAt(r);if(s>55295&&s<=56319){const o=(s-55296)*1024&65535;s=(e.charCodeAt(r+1)-56320&65535|o)+65536,r+=1}jC(s,t)}}function MC(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let s=1;s<6;s+=1)if((e>>7-s&1)===0){t.utf8seq=s;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function ci(e){const t=[],r={queue:0,queuedBits:0},s=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)pw(e.charCodeAt(o),r,s);return new Uint8Array(t)}function $C(e){const t=[];return NC(e,r=>t.push(r)),new Uint8Array(t)}function ss(e){const t=[],r={queue:0,queuedBits:0},s=o=>{t.push(o)};return e.forEach(o=>qm(o,r,s)),qm(null,r,s),t.join("")}function DC(e){return Math.round(Date.now()/1e3)+e}function UC(){return Symbol("auth-callback")}const ct=()=>typeof window<"u"&&typeof document<"u",Qn={tested:!1,writable:!1},gw=()=>{if(!ct())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Qn.tested)return Qn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Qn.tested=!0,Qn.writable=!0}catch{Qn.tested=!0,Qn.writable=!1}return Qn.writable};function FC(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEac
38h((o,a)=>{t[a]=o})}catch{}return r.searchParams.forEach((s,o)=>{t[o]=s}),t}const mw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),BC=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",ni=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},Yn=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},lt=async(e,t)=>{await e.removeItem(t)};class oc{constructor(){this.promise=new oc.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}oc.promiseConstructor=Promise;function vl(e){const t=e.split(".");if(t.length!==3)throw new Yd("Invalid JWT structure");for(let s=0;s<t.length;s++)if(!CC.test(t[s]))throw new Yd("JWT not in base64url format");return{header:JSON.parse(Km(t[0])),payload:JSON.parse(Km(t[1])),signature:ci(t[2]),raw:{header:t[0],payload:t[1]}}}async function zC(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function HC(e,t){return new Promise((s,o)=>{(async()=>{for(let a=0;a<1/0;a++)try{const c=await e(a);if(!t(a,null,c)){s(c);return}}catch(c){if(!t(a,c)){o(c);return}}})()})}function WC(e){return("0"+e.toString(16)).substr(-2)}function VC(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=r.length;let o="";for(let a=0;a<56;a++)o+=r.charAt(Math.floor(Math.random()*s));return o}return crypto.getRandomValues(t),Array.from(t,WC).join("")}async function qC(e){const r=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",r),o=new Uint8Array(s);return Array.from(o).map(a=>String.fromCharCode(a)).join("")}async function KC(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await qC(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Gs(e,t,r=!1){const s=VC();let o=s;r&&(o+="/recovery"),await ni(e,`${t}-code-verifier`,o);const a=await KC(s);return[a,s===a?"plain":"s256"]}const GC=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function JC(e){const t=e.headers.get(Jd);if(!t||!t.match(GC))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function QC(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function YC(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const XC=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Js(e){if(!XC.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Sd(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function ZC(e,t){return new Proxy(e,{get:(r,s,o)=>{if(s==="__isInsecureUserWarningProxy")return!0;if(typeof s=="symbol"){const a=s.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,s,o)}return!t.value&&typeof s=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,s,o)}})}function Gm(e){return JSON.parse(JSON.stringify(e))}const Xn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),eT=[502,503,504,520,521,522,523,524,530];async function Jm(e){var t;if(!BC(e))throw new Qd(Xn(e),0);if(eT.includes(e.status))throw new Qd(Xn(e),e.status);let r;try{r=await e.json()}catch(a){throw new Zn(Xn(a),a)}let s;const o=JC(e);if(o&&o.getTime()>=fw["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?s=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(s=r.error_code),s){if(s==="weak_password")throw new Wm(Xn(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(s==="session_not_found")throw new $t}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,c)=>a&&typeof c=="string",!0))throw new Wm(Xn(r),e.status,r.weak_password.reasons);throw new PC(Xn(r),e.status||500,s)}const tT=(e,t,r,s)=>{const o={method:e,headers:t?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),o.body=JSON.stringify(s),Object.assign(Object.assign({},o),r))};async function ue(e,t,r,s){var o;const a=Object.assign({},s?.headers);a[Jd]||(a[Jd]=fw["2024-01-01"].name),s?.jwt&&(a.Authorization=`Bearer ${s.jwt}`);const c=(o=s?.query)!==null&&o!==void 0?o:{};s?.redirectTo&&(c.redirect_to=s.redirectTo);const u=Object.keys(c).length?"?"+new URLSearchParams(c).toString():"",h=await rT(e,t,r+u,{headers:a,noResolveJson:s?.noResolveJson},{},s?.body);return s?.xform?s?.xform(h):{data:Object.assign({},h),error:null}}async function rT(e,t,r,s,o,a){const c=tT(t,s,o,a);let u;
38try{u=await e(r,Object.assign({},c))}catch(h){throw console.error(h),new Qd(Xn(h),0)}if(u.ok||await Jm(u),s?.noResolveJson)return u;try{return await u.json()}catch(h){await Jm(h)}}function or(e){var t;let r=null;iT(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=DC(e.expires_in)));const s=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:s},error:null}}function Qm(e){const t=or(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,s)=>r&&typeof s=="string",!0)&&(t.data.weak_password=e.weak_password),t}function En(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function nT(e){return{data:e,error:null}}function sT(e){const{action_link:t,email_otp:r,hashed_token:s,redirect_to:o,verification_type:a}=e,c=ic(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),u={action_link:t,email_otp:r,hashed_token:s,redirect_to:o,verification_type:a},h=Object.assign({},c);return{data:{properties:u,user:h},error:null}}function Ym(e){return e}function iT(e){return e.access_token&&e.refresh_token&&e.expires_in}const xd=["global","local","others"];class oT{constructor({url:t="",headers:r={},fetch:s}){this.url=t,this.headers=r,this.fetch=mw(s),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(t,r=xd[0]){if(xd.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${xd.join(", ")}`);try{return await ue(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(s){if(ie(s))return{data:null,error:s};throw s}}async inviteUserByEmail(t,r={}){try{return await ue(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:En})}catch(s){if(ie(s))return{data:{user:null},error:s};throw s}}async generateLink(t){try{const{options:r}=t,s=ic(t,["options"]),o=Object.assign(Object.assign({},s),r);return"newEmail"in s&&(o.new_email=s?.newEmail,delete o.newEmail),await ue(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:sT,redirectTo:r?.redirectTo})}catch(r){if(ie(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await ue(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:En})}catch(r){if(ie(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,s,o,a,c,u,h;try{const f={nextPage:null,lastPage:0,total:0},m=await ue(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(r=t?.page)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:"",per_page:(a=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&a!==void 0?a:""},xform:Ym});if(m.error)throw m.error;const g=await m.json(),v=(c=m.headers.get("x-total-count"))!==null&&c!==void 0?c:0,w=(h=(u=m.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&h!==void 0?h:[];return w.length>0&&(w.forEach(b=>{const x=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(b.split(";")[1].split("=")[1]);f[`${_}Page`]=x}),f.total=parseInt(v)),{data:Object.assign(Object.assign({},g),f),error:null}}catch(f){if(ie(f))return{data:{users:[]},error:f};throw f}}async getUserById(t){Js(t);try{return await ue(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:En}
38)}catch(r){if(ie(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Js(t);try{return await ue(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:En})}catch(s){if(ie(s))return{data:{user:null},error:s};throw s}}async deleteUser(t,r=!1){Js(t);try{return await ue(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:En})}catch(s){if(ie(s))return{data:{user:null},error:s};throw s}}async _listFactors(t){Js(t.userId);try{const{data:r,error:s}=await ue(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:r,error:s}}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Js(t.userId),Js(t.id);try{return{data:await ue(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,s,o,a,c,u,h;try{const f={nextPage:null,lastPage:0,total:0},m=await ue(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(r=t?.page)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:"",per_page:(a=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&a!==void 0?a:""},xform:Ym});if(m.error)throw m.error;const g=await m.json(),v=(c=m.headers.get("x-total-count"))!==null&&c!==void 0?c:0,w=(h=(u=m.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&h!==void 0?h:[];return w.length>0&&(w.forEach(b=>{const x=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(b.split(";")[1].split("=")[1]);f[`${_}Page`]=x}),f.total=parseInt(v)),{data:Object.assign(Object.assign({},g),f),error:null}}catch(f){if(ie(f))return{data:{clients:[]},error:f};throw f}}async _createOAuthClient(t){try{return await ue(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await ue(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await ue(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(ie(s))return{data:null,error:s};throw s}}async _deleteOAuthClient(t){try{return await ue(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await ue(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _listCustomProviders(t){try{const r={};return t?.type&&(r.type=t.type),await ue(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:s=>{var o;return{data:{providers:(o=s?.providers)!==null&&o!==void 0?o:[]},error:null}}})}catch(r){if(ie(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await ue(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await ue(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await ue(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:r,headers:this.headers,xform:s=>({data:s,error:null})})}catch(s){if(ie(s))return{data:null,error:s};throw s}}async _deleteCustomProvider(t){try{return await ue(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ie(r))return{data:null,error:r};throw r}}}function Xm(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const br={debug:!!(globalThis&&gw()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};
38class yw extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class Zm extends yw{}async function aT(e,t,r){br.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const s=new globalThis.AbortController;let o;t>0&&(o=setTimeout(()=>{s.abort(),br.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async a=>{if(a){clearTimeout(o),br.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,a.name);try{return await r()}finally{br.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,a.name)}}else{if(t===0)throw br.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Zm(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(br.debug)try{const c=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(c,null,"  "))}catch(c){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",c)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(o),await r()}})}catch(a){if(t>0&&clearTimeout(o),a?.name==="AbortError"&&t>0){if(s.signal.aborted)return br.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async c=>{if(c){br.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,c.name);try{return await r()}finally{br.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,c.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw br.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new Zm(`Lock "${e}" was released because another request stole it`)}throw a}}function lT(){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 vw(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function cT(e){return parseInt(e,16)}function uT(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,s=>s.toString(16).padStart(2,"0")).join("")}function dT(e){var t;const{chainId:r,domain:s,expirationTime:o,issuedAt:a=new Date,nonce:c,notBefore:u,requestId:h,resources:f,scheme:m,uri:g,version:v}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!s)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(c&&c.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${c}`);if(!g)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(v!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${v}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
39`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const w=vw(e.address),b=m?`${m}://${s}`:s,x=e.statement?`${e.statement}
40`:"",_=`${b} wants you to sign in with your Ethereum account:
41${w}
42
43${x}`;let E=`URI: ${g}
44Version: ${v}
45Chain ID: ${r}${c?`
46Nonce: ${c}`:""}
47Issued At: ${a.toISOString()}`;
47if(o&&(E+=`
48Expiration Time: ${o.toISOString()}`),u&&(E+=`
49Not Before: ${u.toISOString()}`),h&&(E+=`
50Request ID: ${h}`),f){let R=`
51Resources:`;for(const A of f){if(!A||typeof A!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${A}`);R+=`
52- ${A}`}E+=R}return`${_}
53${E}`}class Ge extends Error{constructor({message:t,code:r,cause:s,name:o}){var a;super(t,{cause:s}),this.__isWebAuthnError=!0,this.name=(a=o??(s instanceof Error?s.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}}class Ul extends Ge{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function hT({error:e,options:t}){var r,s,o;const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ge({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Ge({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((s=a.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Ge({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=a.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new Ge({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Ge({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ge({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return a.pubKeyCredParams.filter(u=>u.type==="public-key").length===0?new Ge({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ge({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const c=window.location.hostname;if(ww(c)){if(a.rp.id!==c)return new Ge({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ge({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new Ge({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Ge({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ge({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function fT({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Ge({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ge({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if(ww(s)){if(r.rpId!==s)return new Ge({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ge({message:`${window.location.hostname}
53 is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ge({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Ge({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class pT{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const gT=new pT;function mT(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:s}=e,o=ic(e,["challenge","user","excludeCredentials"]),a=ci(t).buffer,c=Object.assign(Object.assign({},r),{id:ci(r.id).buffer}),u=Object.assign(Object.assign({},o),{challenge:a,user:c});if(s&&s.length>0){u.excludeCredentials=new Array(s.length);for(let h=0;h<s.length;h++){const f=s[h];u.excludeCredentials[h]=Object.assign(Object.assign({},f),{id:ci(f.id).buffer,type:f.type||"public-key",transports:f.transports})}}return u}function yT(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,s=ic(e,["challenge","allowCredentials"]),o=ci(t).buffer,a=Object.assign(Object.assign({},s),{challenge:o});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];a.allowCredentials[c]=Object.assign(Object.assign({},u),{id:ci(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function vT(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:ss(new Uint8Array(e.response.attestationObject)),clientDataJSON:ss(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function wT(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,s=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:ss(new Uint8Array(o.authenticatorData)),clientDataJSON:ss(new Uint8Array(o.clientDataJSON)),signature:ss(new Uint8Array(o.signature)),userHandle:o.userHandle?ss(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:s,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function ww(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function ey(){var e,t;return!!(ct()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.get)=="function")}async function _T(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ul("Browser returned unexpected credential type",t)}:{data:null,error:new Ul("Empty credential response",t)}}catch(t){return{data:null,error:hT({error:t,options:e})}}}async function bT(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ul("Browser returned unexpected credential type",t)}:{data:null,error:new Ul("Empty credential response",t)}}
53catch(t){return{data:null,error:fT({error:t,options:e})}}}const ST={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},xT={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Fl(...e){const t=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),r=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),s={};for(const o of e)if(o)for(const a in o){const c=o[a];if(c!==void 0)if(Array.isArray(c))s[a]=c;else if(r(c))s[a]=c;else if(t(c)){const u=s[a];t(u)?s[a]=Fl(u,c):s[a]=Fl(c)}else s[a]=c}return s}function ET(e,t){return Fl(ST,e,t||{})}function kT(e,t){return Fl(xT,e,t||{})}class RT{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:s,signal:o},a){var c;try{const{data:u,error:h}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!u)return{data:null,error:h};const f=o??gT.createNewAbortSignal();if(u.webauthn.type==="create"){const{user:m}=u.webauthn.credential_options.publicKey;if(!m.name){const g=s;if(g)m.name=`${m.id}:${g}`;else{const w=(await this.client.getUser()).data.user,b=((c=w?.user_metadata)===null||c===void 0?void 0:c.name)||w?.email||w?.id||"User";m.name=`${m.id}:${b}`}}m.displayName||(m.displayName=m.name)}switch(u.webauthn.type){case"create":{const m=ET(u.webauthn.credential_options.publicKey,a?.create),{data:g,error:v}=await _T({publicKey:m,signal:f});return g?{data:{factorId:t,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:g}},error:null}:{data:null,error:v}}case"request":{const m=kT(u.webauthn.credential_options.publicKey,a?.request),{data:g,error:v}=await bT(Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:m,signal:f}));return g?{data:{factorId:t,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:g}},error:null}:{data:null,error:v}}}}catch(u){return ie(u)?{data:null,error:u}:{data:null,error:new Zn("Unexpected error in challenge",u)}}}async _verify({challengeId:t,factorId:r,webauthn:s}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:s})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},a){if(!r)return{data:null,error:new Lo("rpId is required for WebAuthn authentication")};try{if(!ey())return{data:null,error:new Zn("Browser does not support WebAuthn",null)};const{data:c,error:u}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:s},signal:o},{request:a});if(!c)return{data:null,error:u};const{webauthn:h}=c;return this._verify({factorId:t,challengeId:c.challengeId,webauthn:{type:h.type,rpId:r,rpOrigins:s,credential_response:h.credential_response}})}catch(c){return ie(c)?{data:null,error:c}:{data:null,error:new Zn("Unexpected error in authenticate",c)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},a){if(!r)return{data:null,error:new Lo("rpId is required for WebAuthn registration")};try{if(!ey())return{data:null,error:new Zn("Browser does not support WebAuthn",null)};const{data:c,error:u}=await this._enroll({friendlyName:t});if(!c)return await this.client.mfa.listFactors().then(m=>{var g;return(g=m.data)===null||g===void 0?void 0:g.all.find(v=>v.factor_type==="webauthn"&&v.friendly_name===t&&v.status!=="unverified")}).then(m=>m?this.client.mfa.unenroll({factorId:m?.id}):void 0),{data:null,error:u};const{data:h,error:f}=await this._challenge({factorId:c.id,friendlyName:c.friendly_name,webauthn:{rpId:r,rpOrigins:s},signal:o},{create:a});return h?this._verify({factorId:c.id,challengeId:h.challengeId,webauthn:{rpId:r,rpOrigins:s,type:h.webauthn.type,credential_response:h.webauthn.credential_response}}):{data:null,error:f}}catch(c){return ie(c)?{data:null,error:c}:{data:null,error:new Zn("Unexpected error in register",c)}}}}lT();const CT={url:EC,storageKey:kC,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:RC,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function ty(e,t,r){return await r()}const Qs={};class jo{get jwks(){var t,r;return(r=(t=Qs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Qs[this.storageKey]=Object.assign(Object.assign({},Qs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Qs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Qs[this.storageKey]=Object.assign(Object.assign({},Qs[this.storageKey]),{cachedAt:t})}constructor(t){var r,s,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const a=Object.assign(Object.assign({},CT),t);if(this.storageKey=a.storageKey,this.instanceID=(r=jo.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,jo.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!a.debug,typeof a.debug=="function"&&(this.logger=a.debug),this.instanceID>0&&ct()){const c=`${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(c),this.logDebugMessages&&console.trace(c)}if(this.persistSession=a.persistSession,this.autoRefreshToken=a.autoRefreshToken,this.admin=new oT({url:a.url,headers:a.headers,fetch:a.fetch}),this.url=a.url,this.headers=a.headers,this.fetch=mw(a.fetch),this.lock=a.lock||ty,this.detectSessionInUrl=a.detectSessionInUrl,this.flowType=a.flowType,this.hasCustomAuthorizationHeader=a.hasCustomAuthorizationHeader,this.throwOnError=a.throwOnError,this.lockAcquireTimeout=a.lockAcquireTimeout,a.lock?this.lock=a.lock:this.persistSession&&ct()&&(!((s=globalThis?.navigator)===null||s===void 0)&&s.locks)?this.lock=aT:this.lock=ty,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 RT(this)}
53,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(a.storage?this.storage=a.storage:gw()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Xm(this.memoryStorage)),a.userStorage&&(this.userStorage=a.userStorage)):(this.memoryStorage={},this.storage=Xm(this.memoryStorage)),ct()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(c){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",c)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async c=>{this._debug("received broadcast notification from other tab or client",c);try{await this._notifyAllSubscribers(c.data.event,c.data.session,!1)}catch(u){this._debug("#broadcastChannel","error",u)}})}a.skipAutoInitialize||this.initialize().catch(c=>{this._debug("#initialize()","error",c)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${hw}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},s="none";if(ct()&&(r=FC(window.location.href),this._isImplicitGrantCallback(r)?s="implicit":await this._isPKCECallback(r)&&(s="pkce")),ct()&&this.detectSessionInUrl&&s!=="none"){const{data:o,error:a}=await this._getSessionFromURL(r,s);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),OC(a)){const h=(t=a.details)===null||t===void 0?void 0:t.code;if(h==="identity_already_exists"||h==="identity_not_found"||h==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:c,redirectType:u}=o;return this._debug("#_initialize()","detected session in URL",c,"redirect type",u),await this._saveSession(c),setTimeout(async()=>{u==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",c):await this._notifyAllSubscribers("SIGNED_IN",c)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return ie(r)?this._returnResult({error:r}):this._returnResult({error:new Zn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,s,o;try{const a=await ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(r=t?.options)===null||r===void 0?void 0:r.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(o=t?.options)===null||o===void 0?void 0:o.captchaToken}},xform:or}),{data:c,error:u}=a;if(u||!c)return this._returnResult({data:{user:null,session:null},error:u});const h=c.session,f=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:f,session:h},error:null})}catch(a){if(ie(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(t){var r,s,o;try{let a;if("email"in t){const{email:m,password:g,options:v}=t;let w=null,b=null;this.flowType==="pkce"&&([w,b]=await Gs(this.storage,this.storageKey)),a=await ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:v?.emailRedirectTo,body:{email:m,password:g,data:(r=v?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:v?.captchaToken},code_challenge:w,code_challenge_method:b},xform:or})}else if("phone"in t){const{phone:m,password:g,options:v}=t;a=await ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:m,password:g,data:(s=v?.data)!==null&&s!==void 0?s:{},channel:(o=v?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:v?.captchaToken}},xform:or})}else throw new ml("You must provide either an email or phone number and a password");const{data:c,error:u}=a;if(u||!c)return await lt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:u});const h=c.session,f=c.user;return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:f,session:h},error:null})}catch(a){if(await lt(this.storage,`${this.storageKey}-code-verifier`),ie(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(t){try{let r;if("email"in t){const{email:a,password:c,options:u}=t;r=await ue(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:c,gotrue_meta_security:{captcha_token:u?.captchaToken}},xform:Qm})}else if("phone"in t){const{phone:a,password:c,options:u}=t;r=await ue(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:c,gotrue_meta_security:{captcha_token:u?.captchaToken}},xform:Qm})}else throw new ml("You must provide either an email or phone number and a password");const{data:s,error:o}=r;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!s||!s.session||!s.user){const a=new Ks;return this._returnResult({data:{user:null,session:null},error:a})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:o})}catch(r){if(ie(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,s,o,a;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(a=t.o
53ptions)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,s,o,a,c,u,h,f,m,g,v;let w,b;if("message"in t)w=t.message,b=t.signature;else{const{chain:x,wallet:_,statement:E,options:R}=t;let A;if(ct())if(typeof _=="object")A=_;else{const V=window;if("ethereum"in V&&typeof V.ethereum=="object"&&"request"in V.ethereum&&typeof V.ethereum.request=="function")A=V.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 _!="object"||!R?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");A=_}const I=new URL((r=R?.url)!==null&&r!==void 0?r:window.location.href),$=await A.request({method:"eth_requestAccounts"}).then(V=>V).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!$||$.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const F=vw($[0]);let M=(s=R?.signInWithEthereum)===null||s===void 0?void 0:s.chainId;if(!M){const V=await A.request({method:"eth_chainId"});M=cT(V)}const z={domain:I.host,address:F,statement:E,uri:I.href,version:"1",chainId:M,nonce:(o=R?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(c=(a=R?.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&c!==void 0?c:new Date,expirationTime:(u=R?.signInWithEthereum)===null||u===void 0?void 0:u.expirationTime,notBefore:(h=R?.signInWithEthereum)===null||h===void 0?void 0:h.notBefore,requestId:(f=R?.signInWithEthereum)===null||f===void 0?void 0:f.requestId,resources:(m=R?.signInWithEthereum)===null||m===void 0?void 0:m.resources};w=dT(z),b=await A.request({method:"personal_sign",params:[uT(w),F]})}try{const{data:x,error:_}=await ue(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:w,signature:b},!((g=t.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(v=t.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:or});if(_)throw _;if(!x||!x.session||!x.user){const E=new Ks;return this._returnResult({data:{user:null,session:null},error:E})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:_})}catch(x){if(ie(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async signInWithSolana(t){var r,s,o,a,c,u,h,f,m,g,v,w;let b,x;if("message"in t)b=t.message,x=t.signature;else{const{chain:_,wallet:E,statement:R,options:A}=t;let I;if(ct())if(typeof E=="object")I=E;else{const F=window;if("solana"in F&&typeof F.solana=="object"&&("signIn"in F.solana&&typeof F.solana.signIn=="function"||"signMessage"in F.solana&&typeof F.solana.signMessage=="function"))I=F.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 E!="object"||!A?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");I=E}const $=new URL((r=A?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in I&&I.signIn){const F=await I.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},A?.signInWithSolana),{version:"1",domain:$.host,uri:$.href}),R?{statement:R}:null));let M;if(Array.isArray(F)&&F[0]&&typeof F[0]=="object")M=F[0];else if(F&&typeof F=="object"&&"signedMessage"in F&&"signature"in F)M=F;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in M&&"signature"in M&&(typeof M.signedMessage=="string"||M.signedMessage instanceof Uint8Array)&&M.signature instanceof Uint8Array)b=typeof M.signedMessage=="string"?M.signedMessage:new TextDecoder().decode(M.signedMessage),x=M.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in I)||typeof I.signMessage!="function"||!("publicKey"in I)||typeof I!="object"||!I.publicKey||!("toBase58"in I.publicKey)||typeof I.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");b=[`${$.host} wants you to sign in with your Solana account:`,I.publicKey.toBase58(),...R?["",R,""]:[""],"Version: 1",`URI: ${$.href}`,`Issued At: ${(o=(s=A?.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((a=A?.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${A.signInWithSolana.notBefore}
53`]:[],...!((c=A?.signInWithSolana)===null||c===void 0)&&c.expirationTime?[`Expiration Time: ${A.signInWithSolana.expirationTime}`]:[],...!((u=A?.signInWithSolana)===null||u===void 0)&&u.chainId?[`Chain ID: ${A.signInWithSolana.chainId}`]:[],...!((h=A?.signInWithSolana)===null||h===void 0)&&h.nonce?[`Nonce: ${A.signInWithSolana.nonce}`]:[],...!((f=A?.signInWithSolana)===null||f===void 0)&&f.requestId?[`Request ID: ${A.signInWithSolana.requestId}`]:[],...!((g=(m=A?.signInWithSolana)===null||m===void 0?void 0:m.resources)===null||g===void 0)&&g.length?["Resources",...A.signInWithSolana.resources.map(M=>`- ${M}`)]:[]].join(`
54`);const F=await I.signMessage(new TextEncoder().encode(b),"utf8");if(!F||!(F instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");x=F}}try{const{data:_,error:E}=await ue(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:b,signature:ss(x)},!((v=t.options)===null||v===void 0)&&v.captchaToken?{gotrue_meta_security:{captcha_token:(w=t.options)===null||w===void 0?void 0:w.captchaToken}}:null),xform:or});if(E)throw E;if(!_||!_.session||!_.user){const R=new Ks;return this._returnResult({data:{user:null,session:null},error:R})}return _.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),this._returnResult({data:Object.assign({},_),error:E})}catch(_){if(ie(_))return this._returnResult({data:{user:null,session:null},error:_});throw _}}async _exchangeCodeForSession(t){const r=await Yn(this.storage,`${this.storageKey}-code-verifier`),[s,o]=(r??"").split("/");try{if(!s&&this.flowType==="pkce")throw new IC;const{data:a,error:c}=await ue(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:s},xform:or});if(await lt(this.storage,`${this.storageKey}-code-verifier`),c)throw c;if(!a||!a.session||!a.user){const u=new Ks;return this._returnResult({data:{user:null,session:null,redirectType:null},error:u})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers(o==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:o??null}),error:c})}catch(a){if(await lt(this.storage,`${this.storageKey}-code-verifier`),ie(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(t){try{const{options:r,provider:s,token:o,access_token:a,nonce:c}=t,u=await ue(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:o,access_token:a,nonce:c,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:or}),{data:h,error:f}=u;if(f)return this._returnResult({data:{user:null,session:null},error:f});if(!h||!h.session||!h.user){const m=new Ks;return this._returnResult({data:{user:null,session:null},error:m})}return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("SIGNED_IN",h.session)),this._returnResult({data:h,error:f})}catch(r){if(ie(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,s,o,a,c;try{if("email"in t){const{email:u,options:h}=t;let f=null,m=null;this.flowType==="pkce"&&([f,m]=await Gs(this.storage,this.storageKey));const{error:g}=await ue(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:u,data:(r=h?.data)!==null&&r!==void 0?r:{},create_user:(s=h?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:f,code_challenge_method:m},redirectTo:h?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:g})}if("phone"in t){const{phone:u,options:h}=t,{data:f,error:m}=await ue(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:u,data:(o=h?.data)!==null&&o!==void 0?o:{},create_user:(a=h?.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:h?.captchaToken},channel:(c=h?.channel)!==null&&c!==void 0?c:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:f?.message_id},error:m})}throw new ml("You must provide either an email or phone number.")}catch(u){if(await lt(this.storage,`${this.storageKey}-code-verifier`),ie(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async verifyOtp(t){var r,s;try{let o,a;"options"in t&&(o=(r=t.options)===null||r===void 0?void 0:r.redirectTo,a=(s=t.options)===null||s===void 0?void 0:s.captchaToken);const{data:c,error:u}=await ue(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:a}}),redirectTo:o,xform:or});if(u)throw u;if(!c)throw new Error("An error occurred on token verification.");const h=c.session,f=c.user;return h?.access_token&&(await this._saveSession(h),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",h)),this._returnResult({data:{user:f,session:h},error:null})}catch(o){if(ie(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(t){var r,s,o,a,c;try{let u=null,h=null;this.flowType==="pkce"&&([u,h]=await Gs(this.storage,this.storageKey));const f=await ue(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&s!==void 0?s:void 0}
54),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:u,code_challenge_method:h}),headers:this.headers,xform:nT});return!((a=f.data)===null||a===void 0)&&a.url&&ct()&&!(!((c=t.options)===null||c===void 0)&&c.skipBrowserRedirect)&&window.location.assign(f.data.url),this._returnResult(f)}catch(u){if(await lt(this.storage,`${this.storageKey}-code-verifier`),ie(u))return this._returnResult({data:null,error:u});throw u}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:s}=t;if(s)throw s;if(!r)throw new $t;const{error:o}=await ue(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(t){if(ie(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:s,type:o,options:a}=t,{error:c}=await ue(this.fetch,"POST",r,{headers:this.headers,body:{email:s,type:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},redirectTo:a?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:c})}else if("phone"in t){const{phone:s,type:o,options:a}=t,{data:c,error:u}=await ue(this.fetch,"POST",r,{headers:this.headers,body:{phone:s,type:o,gotrue_meta_security:{captcha_token:a?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:c?.message_id},error:u})}throw new ml("You must provide either an email or phone number and a type")}catch(r){if(ie(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(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await s,await r()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=r();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await Yn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const s=t.expires_at?t.expires_at*1e3-Date.now()<_d:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",t.expires_at),!s){if(this.userStorage){const c=await Yn(this.userStorage,this.storageKey+"-user");c?.user?t.user=c.user:t.user=Sd()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const c={value:this.suppressGetSessionWarning};t.user=ZC(t.user,c),c.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:o,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await ue(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:En}
54):await this._useSession(async r=>{var s,o,a;const{data:c,error:u}=r;if(u)throw u;return!(!((s=c.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new $t}:await ue(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(o=c.session)===null||o===void 0?void 0:o.access_token)!==null&&a!==void 0?a:void 0,xform:En})})}catch(r){if(ie(r))return gl(r)&&(await this._removeSession(),await lt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async s=>{const{data:o,error:a}=s;if(a)throw a;if(!o.session)throw new $t;const c=o.session;let u=null,h=null;this.flowType==="pkce"&&t.email!=null&&([u,h]=await Gs(this.storage,this.storageKey));const{data:f,error:m}=await ue(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:u,code_challenge_method:h}),jwt:c.access_token,xform:En});if(m)throw m;return c.user=f.user,await this._saveSession(c),await this._notifyAllSubscribers("USER_UPDATED",c),this._returnResult({data:{user:c.user},error:null})})}catch(s){if(await lt(this.storage,`${this.storageKey}-code-verifier`),ie(s))return this._returnResult({data:{user:null},error:s});throw s}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new $t;const r=Date.now()/1e3;let s=r,o=!0,a=null;const{payload:c}=vl(t.access_token);if(c.exp&&(s=c.exp,o=s<=r),o){const{data:u,error:h}=await this._callRefreshToken(t.refresh_token);if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!u)return{data:{user:null,session:null},error:null};a=u}else{const{data:u,error:h}=await this._getUser(t.access_token);if(h)return this._returnResult({data:{user:null,session:null},error:h});a={access_token:t.access_token,refresh_token:t.refresh_token,user:u.user,token_type:"bearer",expires_in:s-r,expires_at:s},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(ie(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var s;if(!t){const{data:c,error:u}=r;if(u)throw u;t=(s=c.session)!==null&&s!==void 0?s:void 0}if(!t?.refresh_token)throw new $t;const{data:o,error:a}=await this._callRefreshToken(t.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(ie(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){var s;try{if(!ct())throw new yl("No browser detected.");if(t.error||t.error_description||t.error_code)throw new yl(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Hm("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new yl("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Hm("No code detected.");const{data:A,error:I}=await this._exchangeCodeForSession(t.code);if(I)throw I;const $=new URL(window.location.href);return $.searchParams.delete("code"),window.history.replaceState(window.history.state,"",$.toString()),{data:{session:A.session,redirectType:(s=A.redirectType)!==null&&s!==void 0?s:null},error:null}}const{provider_token:o,provider_refresh_token:a,access_token:c,refresh_token:u,expires_in:h,expires_at:f,token_type:m}=t;if(!c||!h||!u||!m)throw new yl("No session defined in URL");const g=Math.round(Date.now()/1e3),v=parseInt(h);let w=g+v;f&&(w=parseInt(f));const b=w-g;
54b*1e3<=ri&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${b}s, should have been closer to ${v}s`);const x=w-v;g-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,w,g):g-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,w,g);const{data:_,error:E}=await this._getUser(c);if(E)throw E;const R={provider_token:o,provider_refresh_token:a,access_token:c,expires_in:v,expires_at:w,refresh_token:u,token_type:m,user:_.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:R,redirectType:t.type},error:null})}catch(o){if(ie(o))return this._returnResult({data:{session:null,redirectType:null},error:o});throw o}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await Yn(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var s;const{data:o,error:a}=r;if(a&&!gl(a))return this._returnResult({error:a});const c=(s=o.session)===null||s===void 0?void 0:s.access_token;if(c){const{error:u}=await this.admin.signOut(c,t);if(u&&!(AC(u)&&(u.status===404||u.status===401||u.status===403)||gl(u)))return this._returnResult({error:u})}return t!=="others"&&(await this._removeSession(),await lt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=UC(),s={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,s),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:s}}}async _emitInitialSession(t){return await this._useSession(async r=>{var s,o;try{const{data:{session:a},error:c}=r;if(c)throw c;await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",t,"session",a)}catch(a){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",a),gl(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(t,r={}){let s=null,o=null;this.flowType==="pkce"&&([s,o]=await Gs(this.storage,this.storageKey,!0));try{return await ue(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:s,code_challenge_method:o,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(await lt(this.storage,`${this.storageKey}-code-verifier`),ie(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var t;try{const{data:r,error:s}=await this.getUser();if(s)throw s;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(ie(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:s,error:o}=await this._useSession(async a=>{var c,u,h,f,m;const{data:g,error:v}=a;if(v)throw v;const w=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(c=t.options)===null||c===void 0?void 0:c.redirectTo,scopes:(u=t.options)===null||u===void 0?void 0:u.scopes,queryParams:(h=t.options)===null||h===void 0?void 0:h.queryParams,skipBrowserRedirect:!0});return await ue(this.fetch,"GET",w,{headers:this.headers,jwt:(m=(f=g.session)===null||f===void 0?void 0:f.access_token)!==null&&m!==void 0?m:void 0})});if(o)throw o;return ct()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(s?.url),this._returnResult({data:{provider:t.provider,url:s?.url},error:null})}catch(s){if(ie(s))return this._returnResult({data:{provider:t.provider,url:null},error:s});throw s}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var s;try{const{error:o,data:{session:a}}=r;if(o)throw o;const{options:c,provider:u,token:h,access_token:f,nonce:m}
54=t,g=await ue(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(s=a?.access_token)!==null&&s!==void 0?s:void 0,body:{provider:u,id_token:h,access_token:f,nonce:m,link_identity:!0,gotrue_meta_security:{captcha_token:c?.captchaToken}},xform:or}),{data:v,error:w}=g;return w?this._returnResult({data:{user:null,session:null},error:w}):!v||!v.session||!v.user?this._returnResult({data:{user:null,session:null},error:new Ks}):(v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("USER_UPDATED",v.session)),this._returnResult({data:v,error:w}))}catch(o){if(await lt(this.storage,`${this.storageKey}-code-verifier`),ie(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var s,o;const{data:a,error:c}=r;if(c)throw c;return await ue(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0})})}catch(r){if(ie(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const s=Date.now();return await HC(async o=>(o>0&&await zC(200*Math.pow(2,o-1)),this._debug(r,"refreshing attempt",o),await ue(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:or})),(o,a)=>{const c=200*Math.pow(2,o);return a&&bd(a)&&Date.now()+c-s<ri})}catch(s){if(this._debug(r,"error",s),ie(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const s=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",s),ct()&&!r.skipBrowserRedirect&&window.location.assign(s),{data:{provider:t,url:s},error:null}}async _recoverAndRefresh(){var t,r;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const o=await Yn(this.storage,this.storageKey);if(o&&this.userStorage){let c=await Yn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!c&&(c={user:o.user},await ni(this.userStorage,this.storageKey+"-user",c)),o.user=(t=c?.user)!==null&&t!==void 0?t:Sd()}else if(o&&!o.user&&!o.user){const c=await Yn(this.storage,this.storageKey+"-user");c&&c?.user?(o.user=c.user,await lt(this.storage,this.storageKey+"-user"),await ni(this.storage,this.storageKey,o)):o.user=Sd()}if(this._debug(s,"session from storage",o),!this._isValidSession(o)){this._debug(s,"session is not valid"),o!==null&&await this._removeSession();return}const a=((r=o.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<_d;if(this._debug(s,`session has${a?"":" not"} expired with margin of ${_d}s`),a){if(this.autoRefreshToken&&o.refresh_token){const{error:c}=await this._callRefreshToken(o.refresh_token);c&&(console.error(c),bd(c)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",c),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:c,error:u}=await this._getUser(o.access_token);!u&&c?.user?(o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(c){console.error("Error getting user data:",c),this._debug(s,"error getting user data, skipping SIGNED_IN notification",c)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(s,"error",o),console.error(o);return}finally{this._debug(s,"end")}}async _callRefreshToken(t){var r,s;if(!t)throw new $t;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new oc;const{data:a,error:c}=await this._refreshAccessToken(t);if(c)throw c;if(!a.session)throw new $t;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const u={data:a.session,error:null};return this.refreshingDeferred.resolve(u),u}catch(a){if(this._debug(o,"error",a),ie(a)){const c={data:null,error:a};return bd(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(c),c}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(a),a}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,r,s=!0){const o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",r,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:t,session:r});const a=[],c=Array.from(this.stateChangeEmitters.values()).map(async u=>{try{await u.callback(t,r)}catch(h){a.push(h)}});if(await Promise.all(c),a.length>0){for(let u=0;u<a.length;u+=1)console.error(a[u]);throw a[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await lt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),s=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&r.user&&await ni(this.userStorage,this.storageKey+"-user",{user:r.user});const o=Object.assign({},r);delete o.user;const a=Gm(o);await ni(this.storage,this.storageKey,a)}else{const o=Gm(r);await ni(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await lt(this.storage,this.storageKey),await lt(this.storage,this.storageKey+"-code-verifier"),await lt(this.storage,this.storageKey+"-user"),this.userStorage&&await lt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ct()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}
54catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ri);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);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 t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);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 t=Date.now();try{return await this._useSession(async r=>{const{data:{session:s}}=r;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((s.expires_at*1e3-t)/ri);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${ri}ms, refresh threshold is ${Gd} ticks`),o<=Gd&&await this._callRefreshToken(s.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof yw)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ct()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,s){const o=[`provider=${encodeURIComponent(r)}`];if(s?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s?.scopes&&o.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[a,c]=await Gs(this.storage,this.storageKey),u=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(c)}`});o.push(u.toString())}if(s?.queryParams){const a=new URLSearchParams(s.queryParams);o.push(a.toString())}return s?.skipBrowserRedirect&&o.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var s;const{data:o,error:a}=r;return a?this._returnResult({data:null,error:a}):await ue(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(s=o?.session)===null||s===void 0?void 0:s.access_token})})}catch(r){if(ie(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var s,o;const{data:a,error:c}=r;if(c)return this._returnResult({data:null,error:c});const u=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:h,error:f}=await ue(this.fetch,"POST",`${this.url}/factors`,{body:u,headers:this.headers,jwt:(s=a?.session)===null||s===void 0?void 0:s.access_token});return f?this._returnResult({data:null,error:f}):(t.factorType==="totp"&&h.type==="totp"&&(!((o=h?.totp)===null||o===void 0)&&o.qr_code)&&(h.totp.qr_code=`data:image/svg+xml;utf-8,${h.totp.qr_code}`),this._returnResult({data:h,error:null}))})}catch(r){if(ie(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var s;const{data:o,error:a}=r;if(a)return this._returnResult({data:null,error:a});const c=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?vT(t.webauthn.credential_response):wT(t.webauthn.credential_response)})}:{code:t.code}),{data:u,error:h}=await ue(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:c,headers:this.headers,jwt:(s=o?.session)===null||s===void 0?void 0:s.access_token});return h?this._returnResult({data:null,error:h}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+u.expires_in},u)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",u),this._returnResult({data:u,error:h}))})}catch(r){if(ie(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var s;const{data:o,error:a}=r;if(a)return this._returnResult({data:null,error:a});const c=await ue(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=o?.session)===null||s===void 0?void 0:s.access_token});if(c.error)return c;const{data:u}=c;if(u.type!=="webauthn")return{data:u,error:null};switch(u.webauthn.type){case"create":return{data:Object.assign(Object.assign({},u),{webauthn:Object.assign(Object.assign({},u.webauthn),{credential_options:Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:mT(u.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},u),{webauthn:Object.assign(Object.assign({},u.webauthn),{credential_options:Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:yT(u.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(ie(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:s}=await this._challenge({factorId:t.factorId});return s?this._returnResult({data:null,error:s}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:s}=await this.getUser();if(s)return{data:null,error:s};const o={all:[],phone:[],totp:[],webauthn:[]};for(const a of(t=r?.factors)!==null&&t!==void 0?t:[])o.all.push(a),a.status==="verified"&&o[a.factor_type].push(a);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,s,o,a;if(t)try{const{payload:w}=vl(t);let b=null;w.aal&&(b=w.aal);let x=b;const{data:{user:_},error:E}=await this.getUser(t);if(E)return this._returnResult({data:null,error:E});((s=(r=_?.factors)===null||r===void 0?void 0:r.filter(I=>I.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(x="aal2");const A=w.amr||[];return{data:{currentLevel:b,nextLevel:x,currentAuthenticationMethods:A},error:null}}catch(w){if(ie(w))return this._returnResult({data:null,error:w});throw w}const{data:{session:c},error:u}
54=await this.getSession();if(u)return this._returnResult({data:null,error:u});if(!c)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:h}=vl(c.access_token);let f=null;h.aal&&(f=h.aal);let m=f;((a=(o=c.user.factors)===null||o===void 0?void 0:o.filter(w=>w.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(m="aal2");const v=h.amr||[];return{data:{currentLevel:f,nextLevel:m,currentAuthenticationMethods:v},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;return o?this._returnResult({data:null,error:o}):s?await ue(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:s.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new $t})})}catch(r){if(ie(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async s=>{const{data:{session:o},error:a}=s;if(a)return this._returnResult({data:null,error:a});if(!o)return this._returnResult({data:null,error:new $t});const c=await ue(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:u=>({data:u,error:null})});return c.data&&c.data.redirect_url&&ct()&&!r?.skipBrowserRedirect&&window.location.assign(c.data.redirect_url),c})}catch(s){if(ie(s))return this._returnResult({data:null,error:s});throw s}}async _denyAuthorization(t,r){try{return await this._useSession(async s=>{const{data:{session:o},error:a}=s;
54if(a)return this._returnResult({data:null,error:a});if(!o)return this._returnResult({data:null,error:new $t});const c=await ue(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:u=>({data:u,error:null})});return c.data&&c.data.redirect_url&&ct()&&!r?.skipBrowserRedirect&&window.location.assign(c.data.redirect_url),c})}catch(s){if(ie(s))return this._returnResult({data:null,error:s});throw s}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:s}=t;return s?this._returnResult({data:null,error:s}):r?await ue(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new $t})})}catch(t){if(ie(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;return o?this._returnResult({data:null,error:o}):s?(await ue(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new $t})})}catch(r){if(ie(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let s=r.keys.find(u=>u.kid===t);if(s)return s;const o=Date.now();if(s=this.jwks.keys.find(u=>u.kid===t),s&&this.jwks_cached_at+TC>o)return s;const{data:a,error:c}=await ue(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(c)throw c;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=o,s=a.keys.find(u=>u.kid===t),!s)?null:s}async getClaims(t,r={}){try{let s=t;if(!s){const{data:w,error:b}
54=await this.getSession();if(b||!w.session)return this._returnResult({data:null,error:b});s=w.session.access_token}const{header:o,payload:a,signature:c,raw:{header:u,payload:h}}=vl(s);r?.allowExpired||QC(a.exp);const f=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!f){const{error:w}=await this.getUser(s);if(w)throw w;return{data:{claims:a,header:o,signature:c},error:null}}const m=YC(o.alg),g=await crypto.subtle.importKey("jwk",f,m,!0,["verify"]);if(!await crypto.subtle.verify(m,g,c,$C(`${u}.${h}`)))throw new Yd("Invalid JWT signature");return{data:{claims:a,header:o,signature:c},error:null}}catch(s){if(ie(s))return this._returnResult({data:null,error:s});throw s}}}jo.nextInstanceID={};const TT=jo,PT="2.104.1";let wo="";typeof Deno<"u"?wo="deno":typeof document<"u"?wo="web":typeof navigator<"u"&&navigator.product==="ReactNative"?wo="react-native":wo="node";const AT={"X-Client-Info":`supabase-js-${wo}/${PT}`},OT={headers:AT},IT={schema:"public"},LT={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},jT={};function No(e){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(e)}function NT(e,t){if(No(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var s=r.call(e,t);if(No(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function MT(e){var t=NT(e,"string");return No(t)=="symbol"?t:t+""}function $T(e,t,r){return(t=MT(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ry(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,s)}return r}function We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ry(Object(r),!0).forEach(function(s){$T(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ry(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}const DT=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),UT=()=>Headers,FT=(e,t,r)=>{const s=DT(r),o=UT();return async(a,c)=>{var u;const h=(u=await t())!==null&&u!==void 0?u:e;let f=new o(c?.headers);return f.has("apikey")||f.set("apikey",e),f.has("Authorization")||f.set("Authorization",`Bearer ${h}`),s(a,We(We({},c),{},{headers:f}))}};function BT(e){return e.endsWith("/")?e:e+"/"}function zT(e,t){var r,s;const{db:o,auth:a,realtime:c,global:u}=e,{db:h,auth:f,realtime:m,global:g}=t,v={db:We(We({},h),o),auth:We(We({},f),a),realtime:We(We({},m),c),storage:{},global:We(We(We({},g),u),{},{headers:We(We({},(r=g?.headers)!==null&&r!==void 0?r:{}),(s=u?.headers)!==null&&s!==void 0?s:{})}),accessToken:async()=>""};return e.accessToken?v.accessToken=e.accessToken:delete v.accessToken,v}function HT(e){const t=e?.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(BT(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var WT=class extends TT{constructor(e){super(e)}},VT=class{constructor(e,t,r){var s,o;this.supabaseUrl=e,this.supabaseKey=t;const a=HT(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const c=`sb-${a.hostname.split(".")[0]}-auth-token`,u={db:IT,realtime:jT,auth:We(We({},LT),{},{storageKey:c}),global:OT},h=zT(r??{},u);if(this.storageKey=(s=h.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(o=h.global.headers)!==null&&o!==void 0?o:{},h.accessToken)this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(m,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}});else{var f;this.auth=this._initSupabaseAuthClient((f=h.auth)!==null&&f!==void 0?f:{},this.headers,h.global.fetch)}this.fetch=FT(t,this._getAccessToken.bind(this),h.global.fetch),this.realtime=this._initRealtimeClient(We({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},h.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(m=>this.realtime.setAuth(m)).catch(m=>console.warn("Failed to set initial Realtime auth token:",m)),this.rest=new h1(new URL("rest/v1",a).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch,timeout:h.db.timeout,urlLengthLimit:h.db.urlLengthLimit}),this.storage=new xC(this.storageUrl.href,this.headers,this.fetch,r?.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new r1(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
54channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:s}=await e.auth.getSession();return(t=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,userStorage:o,storageKey:a,flowType:c,lock:u,debug:h,throwOnError:f},m,g){const v={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new WT({url:this.authUrl.href,headers:We(We({},v),m),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,userStorage:o,flowType:c,lock:u,debug:h,throwOnError:f,fetch:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(w=>w.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new q1(this.realtimeUrl.href,We(We({},e),{},{params:We(We({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t?.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const _w=(e,t,r)=>new VT(e,t,r);function qT(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}qT()&&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 KT=location.origin + "/supabase",ny="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imhid3B3eHlwdmtuY3l2dnVlcWtmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODM0ODA3ODAsImV4cCI6MjA5OTA1Njc4MH0.EobqTstpDfZAkM_3b3hkx_1ycMusd5BugnvCzcujxhE";function GT(e){return e.startsWith("sb_publishable_")||e.startsWith("sb_secret_")}function JT(e){return(t,r)=>{const s=new Headers(typeof Request<"u"&&t instanceof Request?t.headers:void 0);return r?.headers&&new Headers(r.headers).forEach((o,a)=>s.set(a,o)),GT(e)&&s.get("Authorization")===`Bearer ${e}`&&s.delete("Authorization"),s.set("apikey",e),fetch(t,{...r,headers:s})}}const qr=_w(KT,ny,{global:{fetch:JT(ny)},auth:{storage:typeof window<"u"?window.localStorage:void 0,persistSession:typeof window<"u",autoRefreshToken:typeof window<"u"}}),QT=Cn({type:"function"}).client(async({next:e})=>{const{data:t}=await qr.auth.getSession(),r=t.session?.access_token;return e({headers:r?{Authorization:`Bearer ${r}`}:{}})}),YT=Cn({type:"request"}),XT=Cn({type:"request"}),sy=XR(()=>({functionMiddleware:[QT],requestMiddleware:[XT,YT]}));var Ko=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ZT=class extends Ko{#e;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Rh=new ZT,eP={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},tP=class{#e=eP;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},is=new tP;function rP(e){setTimeout(e,0)}var nP=typeof window>"u"||"Deno"in globalThis;function Ct(){}function sP(e,t){return typeof e=="function"?e(t):e}function Xd(e){return typeof e=="number"&&e>=0&&e!==1/0}function bw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pn(e,t){return typeof e=="function"?e(t):e}function Dt(e,t){return typeof e=="function"?e(t):e}function iy(e,t){const{type:r="all",exact:s,fetchStatus:o,predicate:a,queryKey:c,stale:u}=e;if(c){if(s){if(t.queryHash!==Ch(c,t.options))return!1}else if(!$o(t.queryKey,c))return!1}if(r!=="all"){const h=t.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||o&&o!==t.state.fetchStatus||a&&!a(t))}function oy(e,t){const{exact:r,status:s,predicate:o,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(Mo(t.options.mutationKey)!==Mo(a))return!1}else if(!$o(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||o&&!o(t))}function Ch(e,t){return(t?.queryKeyHashFn||Mo)(e)}function Mo(e){return JSON.stringify(e,(t,r)=>eh(r)?Object.keys(r).sort().reduce((s,o)=>(s[o]=r[o],s),{}):r)}function $o(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>$o(e[r],t[r])):!1}var iP=Object.prototype.hasOwnProperty;function Sw(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=ay(e)&&ay(t);if(!s&&!(eh(e)&&eh(t)))return t;const a=(s?e:Object.keys(e)).length,c=s?t:Object.keys(t),u=c.length,h=s?new Array(u):{};let f=0;for(let m=0;m<u;m++){const g=s?m:c[m],v=e[g],w=t[g];if(v===w){h[g]=v,(s?m<a:iP.call(e,g))&&f++;continue}if(v===null||w===null||typeof v!="object"||typeof w!="object"){h[g]=w;continue}const b=Sw(v,w,r+1);h[g]=b,b===v&&f++}return a===u&&f===a?e:h}function Zd(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function ay(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function eh(e){if(!ly(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!ly(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ly(e){return Object.prototype.toString.call(e)==="[object Object]"}function oP(e){return new Promise(t=>{is.setTimeout(t,e)})}function th(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Sw(e,t):t}function aP(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function lP(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var Th=Symbol();function xw(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Th?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ew(e,t){return typeof e=="function"?e(...t):!!e}function cP(e,t,r){let s=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),s||(s=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var Do=(()=>{let e=()=>nP;return{isServer(){return e()},setIsServer(t){e=t}}})();function rh(){let e,t;const r=new Promise((o,a)=>{e=o,t=a});r.status="pending",r.catch(()=>{});function s(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},r.reject=o=>{s({status:"rejected",reason:o}),t(o)},r}var uP=rP;function dP(){let e=[],t=0,r=u=>{u()},s=u=>{u()},o=uP;const a=u=>{t?e.push(u):o(()=>{r(u)})},c=()=>{const u=e;e=[],u.length&&o(()=>{s(()=>{u.forEach(h=>{r(h)})})})};return{batch:u=>{let h;t++;try{h=u()}finally{t--,t||c()}return h},batchCalls:u=>(...h)=>{a(()=>{u(...h)})},schedule:a,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{o=u}}}var ut=dP(),hP=class extends Ko{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}
54setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},Bl=new hP;function fP(e){return Math.min(1e3*2**e,3e4)}function kw(e){return(e??"online")==="online"?Bl.isOnline():!0}var nh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Rw(e){let t=!1,r=0,s;const o=rh(),a=()=>o.status!=="pending",c=x=>{if(!a()){const _=new nh(x);v(_),e.onCancel?.(_)}},u=()=>{t=!0},h=()=>{t=!1},f=()=>Rh.isFocused()&&(e.networkMode==="always"||Bl.isOnline())&&e.canRun(),m=()=>kw(e.networkMode)&&e.canRun(),g=x=>{a()||(s?.(),o.resolve(x))},v=x=>{a()||(s?.(),o.reject(x))},w=()=>new Promise(x=>{s=_=>{(a()||f())&&x(_)},e.onPause?.()}).then(()=>{s=void 0,a()||e.onContinue?.()}),b=()=>{if(a())return;let x;const _=r===0?e.initialPromise:void 0;try{x=_??e.fn()}catch(E){x=Promise.reject(E)}Promise.resolve(x).then(g).catch(E=>{if(a())return;const R=e.retry??(Do.isServer()?0:3),A=e.retryDelay??fP,I=typeof A=="function"?A(r,E):A,$=R===!0||typeof R=="number"&&r<R||typeof R=="function"&&R(r,E);if(t||!$){v(E);return}r++,e.onFail?.(r,E),oP(I).then(()=>f()?void 0:w()).then(()=>{t?v(E):b()})})};return{promise:o,status:()=>o.status,cancel:c,continue:()=>(s?.(),o),cancelRetry:u,continueRetry:h,canStart:m,start:()=>(m()?b():w().then(b),o)}}var Cw=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xd(this.gcTime)&&(this.#e=is.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Do.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(is.clearTimeout(this.#e),this.#e=void 0)}};function pP(e){return{onFetch:(t,r)=>{const s=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],c=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},h=0;const f=async()=>{let m=!1;const g=b=>{cP(b,()=>t.signal,()=>m=!0)},v=xw(t.options,t.fetchOptions),w=async(b,x,_)=>{if(m)return Promise.reject();if(x==null&&b.pages.length)return Promise.resolve(b);const R=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:x,direction:_?"backward":"forward",meta:t.options.meta};return g(F),F})(),A=await v(R),{maxPages:I}=t.options,$=_?lP:aP;return{pages:$(b.pages,A,I),pageParams:$(b.pageParams,x,I)}};if(o&&a.length){const b=o==="backward",x=b?Tw:sh,_={pages:a,pageParams:c},E=x(s,_);u=await w(_,E,b)}else{const b=e??a.length;do{const x=h===0?c[0]??s.initialPageParam:sh(s,u);if(h>0&&x==null)break;u=await w(u,x),h++}while(h<b)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=f}}}function sh(e,{pages:t,pageParams:r}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}function Tw(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function xj(e,t){return t?sh(e,t)!=null:!1}function Ej(e,t){return!t||!e.getPreviousPageParam?!1:Tw(e,t)!=null}var gP=class extends Cw{#e;#t;#r;#n;#i;#s;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=uy(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=uy(this.options);t.data!==void 0&&(this.setState(cy(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const r=th(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(Ct).catch(Ct):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Dt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Th||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdate
vendor: 32,294 bytes, line 54
54Count>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Pn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!bw(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#o||this.#u()?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,r.signal)})},o=()=>{const h=xw(this.options,t),m=(()=>{const g={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#o=!1,this.options.persister?this.options.persister(h,m,this):h(m)},c=(()=>{const h={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return s(h),h})();(this.#e==="infinite"?pP(this.options.pages):this.options.behavior)?.onFetch(c,this),this.#r=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#l({type:"fetch",meta:c.fetchOptions?.meta}),this.#s=Rw({initialPromise:t?.initialPromise,fn:c.fetchFn,onCancel:h=>{h instanceof nh&&h.revert&&this.setState({...this.#r,fetchStatus:"idle"}),r.abort()},onFail:(h,f)=>{this.#l({type:"failed",failureCount:h,error:f})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const h=await this.#s.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof nh){if(h.silent)return this.#s.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Pw(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...cy(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#r=e.manual?s:void 0,s;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Pw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cy(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function uy(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var mP=class extends Ko{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=rh(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#r=void 0;#n=void 0;#i;#s;#a;#o;#u;#l;#p;#d;#h;#c;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),dy(this.#t,this.options)?this.#f():this.updateResult(),this.#w())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ih(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ih(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#b(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Zd(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&hy(this.#t,r,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#t!==r||Dt(this.options.enabled,this.#t)!==Dt(t.enabled,this.#t)||Pn(this.options.staleTime,this.#t)!==Pn(t.staleTime,this.#t))&&this.#m();const o=this.#y();s&&(this.#t!==r||Dt(this.options.enabled,this.#t)!==Dt(t.enabled,this.#t)||o!==this.#c)&&this.#v(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return vP(this,r)&&(this.#n=r,this.#s=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){this.#g.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#f(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ct)),t}#m(){this.#_();const e=Pn(this.options.staleTime,this.#t);if(Do.isServer()||this.#n.isStale||!Xd(e))return;const r=bw(this.#n.dataUpdatedAt,e)+1;this.#d=is.setTimeout(()=>{this.#n.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#b(),this.#c=e,!(Do.isServer()||Dt(this.options.enabled,this.#t)===!1||!Xd(this.#c)||this.#c===0)&&(this.#h=is.setInterval(()=>{(this.options.refetchIntervalInBackground||Rh.isFocused())&&this.#f()},this.#c))}#w(){this.#m(),this.#v(this.#y())}#_(){this.#d!==void 0&&(is.clearTimeout(this.#d),this.#d=void 0)}#b(){this.#h!==void 0&&(is.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){const r=this.#t,s=this.options,o=this.#n,a=this.#i,c=this.#s,h=e!==r?e.state:this.#r,{state:f}=e;let m={...f},g=!1,v;if(t._optimisticResults){const z=this.hasListeners(),V=!z&&dy(e,t),K=z&&hy(e,r,t,s);(V||K)&&(m={...m,...Pw(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:w,errorUpdatedAt:b,status:x}=m;v=m.data;let _=!1;if(t.placeholderData!==void 0&&v===void 0&&x==="pending"){let z;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(z=o.data,_=!0):z=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,z!==void 0&&(x="success",v=th(o?.data,z,t),g=!0)}if(t.select&&v!==void 0&&!_)if(o&&v===a?.data&&t.select===this.#u)v=this.#l;else try{this.#u=t.select,v=t.select(v),v=th(o?.data,v,t),this.#l=v,this.#o=null}catch(z){this.#o=z}this.#o&&(w=this.#o,v=this.#l,b=Date.now(),x="error");const E=m.fetchStatus==="fetching",R=x==="pending",A=x==="error",I=R&&E,$=v!==void 0,M={status:x,fetchStatus:m.fetchStatus,isPending:R,isSuccess:x==="success",isError:A,isInitialLoading:I,isLoading:I,data:v,dataUpdatedAt:m.dataUpdatedAt,error:w,errorUpdatedAt:b,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:E,isRefetching:E&&!R,isLoadingError:A&&!$,isPaused:m.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:A&&$,isStale:Ph(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Dt(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const z=M.data!==void 0,V=M.status==="error"&&!z,K=ae=>{V?ae.reject(M.error):z&&ae.resolve(M.data)},te=()=>{const ae=this.#a=M.promise=rh();K(ae)},G=this.#a;switch(G.status){case"pending":e.queryHash===r.queryHash&&K(G);break;case"fulfilled":(V||M.data!==G.value)&&te();break;case"rejected":(!V||M.error!==G.reason)&&te();break}}return M}updateResult(){const e=this.#n,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#s=this.options,this.#i.data!==void 0&&(this.#p=this.#t),Zd(t,e))return;this.#n=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#g.size)return!0;const a=new Set(o??this.#g);return this.options.throwOnError&&a.add("error"),Object.keys(this.#n).some(c=>{const u=c;return this.#n[u]!==e[u]&&a.has(u)})};this.#x({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#r=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#w()}#x(e){ut.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function yP(e,t){return Dt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Dt(t.retryOnMount,e)===!1)}function dy(e,t){return yP(e,t)||e.state.data!==void 0&&ih(e,t,t.refetchOnMount)}function ih(e,t,r){if(Dt(t.enabled,e)!==!1&&Pn(t.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&Ph(e,t)}return!1}function hy(e,t,r,s){return(e!==t||Dt(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ph(e,r)}function Ph(e,t){return Dt(t.enabled,e)!==!1&&e.isStaleByTime(Pn(t.staleTime,e))}function vP(e,t){return!Zd(e.getCurrentResult(),t)}var wP=class extends Cw{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||_P(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=Rw({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(a,c)=>{this.#i({type:"failed",failureCount:a,error:c})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});const s=this.state.status==="pending",o=!this.#n.canStart();try{if(s)t();else{this.#i({type:"pending",variables:e,isPaused:o}),this.#r.config.onMutate&&await this.#r.config.onMutate(e,this,r);const c=await this.options.onMutate?.(e,r);c!==this.state.context&&this.#i({type:"pending",context:c,variables:e,isPaused:o})}const a=await this.#n.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#i({type:"success",data:a}),a}catch(a){try{await this.#r.config.onError?.(a,e,this.state.context,this,r)}catch(c){Promise.reject(c)}try{await this.options.onError?.(a,e,this.state.context,r)}catch(c){Promise.reject(c)}try{await this.#r.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,r)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,r)}catch(c){Promise.reject(c)}throw this.#i({type:"error",error:a}),a}finally{this.#r.runNext(this)}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ut.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function _P(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bP=class extends Ko{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,r){const s=new wP({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:r});return this.add(s),s}add(e){this.#e.add(e);const t=wl(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=wl(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=wl(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=wl(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ut.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>oy(t,r))}findAll(e={}){return this.getAll().filter(t=>oy(e,t))}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ut.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ct))))}};function wl(e){return e.options.scope?.id}var SP=class extends Ko{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const s=t.queryKey,o=t.queryHash??Ch(s,t);let a=this.get(o);return a||(a=new gP({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>iy(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>iy(e,r)):t}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},xP=class{#e;#t;#r;#n;#i;#s;#a;#o;constructor(e={}){this.#e=e.queryCache||new SP,this.#t=e.mutationCache||new bP,this.#r=e.defaultOptions||{},this.#n=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=Rh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Bl.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Pn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const s=r.data;return[t,s]})}setQueryData(e,t,r){const s=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(s.queryHash)?.state.data,c=sP(t,a);if(c!==void 0)return this.#e.build(this,s).setData(c,{...r,manual:!0})}setQueriesData(e,t,r){return ut.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;ut.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return ut.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},s=ut.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(s).then(Ct).catch(Ct)}invalidateQueries(e,t={}){return ut.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},s=ut.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let a=o.fetch(void 0,r);return r.throwOnError||(a=a.catch(Ct)),o.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(Ct)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Pn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ct).catch(Ct)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ct).catch(Ct)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Bl.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#n.set(Mo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#n.values()],r={};return t.forEach(s=>{$o(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,t){this.#i.set(Mo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],r={};return t.forEach(s=>{$o(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ch(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Th&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Aw=O.createContext(void 0),EP=e=>{const t=O.useContext(Aw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},kP=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),P.jsx(Aw.Provider,{value:e,children:t})),Ow=O.createContext(!1),RP=()=>O.useContext(Ow);Ow.Provider;function CP(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var TP=O.createContext(CP()),PP=()=>O.useContext(TP),AP=(e,t,r)=>{const s=r?.state.error&&typeof e.throwOnError=="function"?Ew(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},OP=e=>{O.useEffect(()=>{e.clearReset()},[e])},IP=({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||Ew(r,[e.error,s])),LP=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>r(s(...o)):r(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},jP=(e,t)=>e.isLoading&&e.isFetching&&!t,NP=(e,t)=>e?.suspense&&t.isPending,fy=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function MP(e,t,r){const s=RP(),o=PP(),a=EP(),c=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const u=a.getQueryCache().get(c.queryHash);c._optimisticResults=s?"isRestoring":"optimistic",LP(c),AP(c,o,u),OP(o);const h=!a.getQueryCache().get(c.queryHash),[f]=O.useState(()=>new t(a,c)),m=f.getOptimisticResult(c),g=!s&&e.subscribed!==!1;if(O.useSyncExternalStore(O.useCallback(v=>{const w=g?f.subscribe(ut.batchCalls(v)):Ct;return f.updateResult(),w},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),O.useEffect(()=>{f.setOptions(c)},[c,f]),NP(c,m))throw fy(c,f,o);if(IP({result:m,errorResetBoundary:o,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw m.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(c,m),c.experimental_prefetchInRender&&!Do.isServer()&&jP(m,s)&&(h?fy(c,f,o):u?.promise)?.catch(Ct).finally(()=>{f.updateResult()}),c.notifyOnChangeProps?m:f.trackResult(m)}function An(e,t){return MP(e,mP)}const $P="modulepreload",DP=function(e){return"/"+e},py={},Qt=function(t,r,s){let o=Promise.resolve();if(r&&r.length>0){let h=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=c?.nonce||c?.getAttribute("nonce");o=h(r.map(f=>{if(f=DP(f),f in py)return;py[f]=!0;const m=f.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":$P,m||(v.as="script"),v.crossOrigin="",v.href=f,u&&v.setAttribute("nonce",u),document.head.appendChild(v),m)return new Promise((w,b)=>{v.addEventListener("load",w),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return o.then(c=>{for(const u of c||[])u.status==="rejected"&&a(u.reason);return t().catch(a)})};function Wr(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}function gy(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Iw(...e){return t=>{let r=!1;const s=e.map(o=>{const a=gy(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<s.length;o++){const a=s[o];typeof a=="function"?a():gy(e[o],null)}}}}function ps(...e){return O.useCallback(Iw(...e),e)}function kj(e,t){const r=O.createContext(t),s=a=>{const{children:c,...u}=a,h=O.useMemo(()=>u,Object.values(u));return P.jsx(r.Provider,{value:h,children:c})};s.displayName=e+"Provider";function o(a){const c=O.useContext(r);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[s,o]}function Lw(e,t=[]){let r=[];function s(a,c){const u=O.createContext(c),h=r.length;r=[...r,c];const f=g=>{const{scope:v,children:w,...b}=g,x=v?.[e]?.[h]||u,_=O.useMemo(()=>b,Object.values(b));return P.jsx(x.Provider,{value:_,children:w})};f.displayName=a+"Provider";function m(g,v){const w=v?.[e]?.[h]||u,b=O.useContext(w);if(b)return b;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${a}\``)}return[f,m]}const o=()=>{const a=r.map(c=>O.createContext(c));return function(u){const h=u?.[e]||a;return O.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return o.scopeName=e,[s,UP(o,...t)]}function UP(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=s.reduce((u,{useScope:h,scopeName:f})=>{const g=h(a)[`__scope${f}`];return{...u,...g}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}function jw(e){const t=FP(e),r=O.forwardRef((s,o)=>{const{children:a,...c}=s,u=O.Children.toArray(a),h=u.find(zP);if(h){const f=h.props.children,m=u.map(g=>g===h?O.Children.count(f)>1?O.Children.only(null):O.isValidElement(f)?f.props.children:null:g);return P.jsx(t,{...c,ref:o,children:O.isValidElement(f)?O.cloneElement(f,void 0,m):null})}return P.jsx(t,{...c,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}var Rj=jw("Slot");function FP(e){const t=O.forwardRef((r,s)=>{const{children:o,...a}=r;if(O.isValidElement(o)){const c=WP(o),u=HP(a,o.props);return o.type!==O.Fragment&&(u.ref=s?Iw(s,c):c),O.cloneElement(o,u)}return O.Children.count(o)>1?O.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nw=Symbol("radix.slottable");function BP(e){const t=({children:r})=>P.jsx(P.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Nw,t}function zP(e){return O.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Nw}function HP(e,t){const r={...t};for(const s in t){const o=e[s],a=t[s];/^on[A-Z]/.test(s)?o&&a?r[s]=(...u)=>{const h=a(...u);return o(...u),h}:o&&(r[s]=o):s==="style"?r[s]={...o,...a}:s==="className"&&(r[s]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function WP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var VP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gs=VP.reduce((e,t)=>{const r=jw(`Primitive.${t}`),s=O.forwardRef((o,a)=>{const{asChild:c,...u}=o,h=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(h,{...u,ref:a})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function qP(e,t){e&&tc.flushSync(()=>e.dispatchEvent(t))}function ac(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...r)=>t.current?.(...r),[])}function KP(e,t=globalThis?.document){const r=ac(e);O.useEffect(()=>{const s=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[r,t])}var GP="DismissableLayer",oh="dismissableLayer.update",JP="dismissableLayer.pointerDownOutside",QP="dismissableLayer.focusOutside",my,Mw=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ah=O.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:u,...h}=e,f=O.useContext(Mw),[m,g]=O.useState(null),v=m?.ownerDocument??globalThis?.document,[,w]=O.useState({}),b=ps(t,M=>g(M)),x=Array.from(f.layers),[_]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=x.indexOf(_),R=m?x.indexOf(m):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,I=R>=E,$=XP(M=>{const z=M.target,V=[...f.branches].some(K=>K.contains(z));!I||V||(o?.(M),c?.(M),M.defaultPrevented||u?.())},v),F=ZP(M=>{const z=M.target;[...f.branches].some(K=>K.contains(z))||(a?.(M),c?.(M),M.defaultPrevented||u?.())},v);return KP(M=>{R===f.layers.size-1&&(s?.(M),!M.defaultPrevented&&u&&(M.preventDefault(),u()))},v),O.useEffect(()=>{if(m)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(my=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),yy(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=my)}},[m,v,r,f]),O.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),yy())},[m,f]),O.useEffect(()=>{const M=()=>w({});return document.addEventListener(oh,M),()=>document.removeEventListener(oh,M)},[]),P.jsx(gs.div,{...h,ref:b,style:{pointerEvents:A?I?"auto":"none":void 0,...e.style},onFocusCapture:Wr(e.onFocusCapture,F.onFocusCapture),onBlurCapture:Wr(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:Wr(e.onPointerDownCapture,$.onPointerDownCapture)})});Ah.displayName=GP;var YP="DismissableLayerBranch",$w=O.forwardRef((e,t)=>{const r=O.useContext(Mw),s=O.useRef(null),o=ps(t,s);return O.useEffect(()=>{const a=s.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),P.jsx(gs.div,{...e,ref:o})});$w.displayName=YP;function XP(e,t=globalThis?.document){const r=ac(e),s=O.useRef(!1),o=O.useRef(()=>{});return O.useEffect(()=>{const a=u=>{if(u.target&&!s.current){let h=function(){Dw(JP,r,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);s.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>s.current=!0}}function ZP(e,t=globalThis?.document){const r=ac(e),s=O.useRef(!1);return O.useEffect(()=>{const o=a=>{a.target&&!s.current&&Dw(QP,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function yy(){const e=new CustomEvent(oh);document.dispatchEvent(e)}function Dw(e,t,r,{discrete:s}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),s?qP(o,a):o.dispatchEvent(a)}var Cj=Ah,Tj=$w,Uo=globalThis?.document?O.useLayoutEffect:()=>{};const Uw=["top","right","bottom","left"],vy=["start","end"],wy=Uw.reduce((e,t)=>
vendor: 4,342 bytes, line 54
54e.concat(t,t+"-"+vy[0],t+"-"+vy[1]),[]),ur=Math.min,gt=Math.max,zl=Math.round,_l=Math.floor,Cr=e=>({x:e,y:e}),eA={left:"right",right:"left",bottom:"top",top:"bottom"},tA={start:"end",end:"start"};function ah(e,t,r){return gt(e,ur(t,r))}function dr(e,t){return typeof e=="function"?e(t):e}function Bt(e){return e.split("-")[0]}function cr(e){return e.split("-")[1]}function Oh(e){return e==="x"?"y":"x"}function Ih(e){return e==="y"?"height":"width"}const rA=new Set(["top","bottom"]);function lr(e){return rA.has(Bt(e))?"y":"x"}function Lh(e){return Oh(lr(e))}function Fw(e,t,r){r===void 0&&(r=!1);const s=cr(e),o=Lh(e),a=Ih(o);let c=o==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(c=Wl(c)),[c,Wl(c)]}function nA(e){const t=Wl(e);return[Hl(e),t,Hl(t)]}function Hl(e){return e.replace(/start|end/g,t=>tA[t])}const _y=["left","right"],by=["right","left"],sA=["top","bottom"],iA=["bottom","top"];function oA(e,t,r){switch(e){case"top":case"bottom":return r?t?by:_y:t?_y:by;case"left":case"right":return t?sA:iA;default:return[]}}function aA(e,t,r,s){const o=cr(e);let a=oA(Bt(e),r==="start",s);return o&&(a=a.map(c=>c+"-"+o),t&&(a=a.concat(a.map(Hl)))),a}function Wl(e){return e.replace(/left|right|bottom|top/g,t=>eA[t])}function lA(e){return{top:0,right:0,bottom:0,left:0,...e}}function jh(e){return typeof e!="number"?lA(e):{top:e,right:e,bottom:e,left:e}}function pi(e){const{x:t,y:r,width:s,height:o}=e;return{width:s,height:o,top:r,left:t,right:t+s,bottom:r+o,x:t,y:r}}function Sy(e,t,r){let{reference:s,floating:o}=e;const a=lr(t),c=Lh(t),u=Ih(c),h=Bt(t),f=a==="y",m=s.x+s.width/2-o.width/2,g=s.y+s.height/2-o.height/2,v=s[u]/2-o[u]/2;let w;switch(h){case"top":w={x:m,y:s.y-o.height};break;case"bottom":w={x:m,y:s.y+s.height};break;case"right":w={x:s.x+s.width,y:g};break;case"left":w={x:s.x-o.width,y:g};break;default:w={x:s.x,y:s.y}}switch(cr(t)){case"start":w[c]-=v*(r&&f?-1:1);break;case"end":w[c]+=v*(r&&f?-1:1);break}return w}const cA=async(e,t,r)=>{const{placement:s="bottom",strategy:o="absolute",middleware:a=[],platform:c}=r,u=a.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let f=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=Sy(f,s,h),v=s,w={},b=0;for(let x=0;x<u.length;x++){const{name:_,fn:E}=u[x],{x:R,y:A,data:I,reset:$}=await E({x:m,y:g,initialPlacement:s,placement:v,strategy:o,middlewareData:w,rects:f,platform:c,elements:{reference:e,floating:t}});m=R??m,g=A??g,w={...w,[_]:{...w[_],...I}},$&&b<=50&&(b++,typeof $=="object"&&($.placement&&(v=$.placement),$.rects&&(f=$.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):$.rects),{x:m,y:g}=Sy(f,v,h)),x=-1)}return{x:m,y:g,placement:v,strategy:o,middlewareData:w}};async function gi(e,t){var r;t===void 0&&(t={});const{x:s,y:o,platform:a,rects:c,elements:u,strategy:h}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:v=!1,padding:w=0}=dr(t,e),b=jh(w),_=u[v?g==="floating"?"reference":"floating":g],E=pi(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(_)))==null||r?_:_.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:f,rootBoundary:m,strategy:h})),R=g==="floating"?{x:s,y:o,width:c.floating.width,height:c.floating.height}:c.reference,A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),I=await(a.isElement==null?void 0:a.isElement(A))?await(a.getScale==null?void 0:a.getScale(A))||{x:1,y:1}:{x:1,y:1},$=pi(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:A,strategy:h}):R);return{top:(E.top-$.top+b.top)/I.y,bottom:($.bottom-E.bottom+b.bottom)/I.y,left:(E.left-$.left+b.left)/I.x,right:($.right-E.right+b.right)/I.x}}const uA=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:s,placement:o,rects:a,platform:c,elements:u,middlewareData:h}=t,{element:f,padding:m=0}=dr(e,t)||{};if(f==null)return{};const g=jh(m),v={x:r,y:s},w=Lh(o),b=Ih(w),x=await c.getDimensions(f),_=w==="y",E=_?"top":"left",R=_?"bottom":"right",A=_?"clientHeight":"clientWidth",I=a.reference[b]+a.reference[w]-v[w]-a.floating[b],$=v[w]-a.reference[w],F=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f));let M=F?F[A]:0;
54(!M||!await(c.isElement==null?void 0:c.isElement(F)))&&(M=u.floating[A]||a.floating[b]);const z=I/2-$/2,V=M/2-x[b]/2-1,K=ur(g[E],V),te=ur(g[R],V),G=K,ae=M-x[b]-te,ce=M/2-x[b]/2+z,we=ah(G,ce,ae),pe=!h.arrow&&cr(o)!=null&&ce!==we&&a.reference[b]/2-(ce<G?K:te)-x[b]/2<0,W=pe?ce<G?ce-G:ce-ae:0;return{[w]:v[w]+W,data:{[w]:we,centerOffset:ce-we-W,...pe&&{alignmentOffset:W}},reset:pe}}});function dA(e,t,r){return(e?[...r.filter(o=>cr(o)===e),...r.filter(o=>cr(o)!==e)]:r.filter(o=>Bt(o)===o)).filter(o=>e?cr(o)===e||(t?Hl(o)!==o:!1):!0)}const hA=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,s,o;const{rects:a,middlewareData:c,placement:u,platform:h,elements:f}=t,{crossAxis:m=!1,alignment:g,allowedPlacements:v=wy,autoAlignment:w=!0,...b}=dr(e,t),x=g!==void 0||v===wy?dA(g||null,w,v):v,_=await gi(t,b),E=((r=c.autoPlacement)==null?void 0:r.index)||0,R=x[E];if(R==null)return{};const A=Fw(R,a,await(h.isRTL==null?void 0:h.isRTL(f.floating)));if(u!==R)return{reset:{placement:x[0]}};const I=[_[Bt(R)],_[A[0]],_[A[1]]],$=[...((s=c.autoPlacement)==null?void 0:s.overflows)||[],{placement:R,overflows:I}],F=x[E+1];if(F)return{data:{index:E+1,overflows:$},reset:{placement:F}};const M=$.map(K=>{const te=cr(K.placement);return[K.placement,te&&m?K.overflows.slice(0,2).reduce((G,ae)=>G+ae,0):K.overflows[0],K.overflows]}).sort((K,te)=>K[1]-te[1]),V=((o=M.filter(K=>K[2].slice(0,cr(K[0])?2:3).every(te=>te<=0))[0])==null?void 0:o[0])||M[0][0];return V!==u?{data:{index:E+1,overflows:$},reset:{placement:V}}:{}}}},fA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,s;const{placement:o,middlewareData:a,rects:c,initialPlacement:u,platform:h,elements:f}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:x=!0,..._}=dr(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const E=Bt(o),R=lr(u),A=Bt(u)===u,I=await(h.isRTL==null?void 0:h.isRTL(f.floating)),$=v||(A||!x?[Wl(u)]:nA(u)),F=b!=="none";!v&&F&&$.push(...aA(u,x,b,I));const M=[u,...$],z=await gi(t,_),V=[];let K=((s=a.flip)==null?void 0:s.overflows)||[];if(m&&V.push(z[E]),g){const ce=Fw(o,c,I);V.push(z[ce[0]],z[ce[1]])}if(K=[...K,{placement:o,overflows:V}],!V.every(ce=>ce<=0)){var te,G;const ce=(((te=a.flip)==null?void 0:te.index)||0)+1,we=M[ce];if(we&&(!(g==="alignment"?R!==lr(we):!1)||K.every(D=>D.overflows[0]>0&&lr(D.placement)===R)))return{data:{index:ce,overflows:K},reset:{placement:we}};let pe=(G=K.filter(W=>W.overflows[0]<=0).sort((W,D)=>W.overflows[1]-D.overflows[1])[0])==null?void 0:G.placement;if(!pe)switch(w){case"bestFit":{var ae;const W=(ae=K.filter(D=>{if(F){const Y=lr(D.placement);return Y===R||Y==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Y=>Y>0).reduce((Y,Z)=>Y+Z,0)]).sort((D,Y)=>D[1]-Y[1])[0])==null?void 0:ae[0];W&&(pe=W);break}case"initialPlacement":pe=u;break}if(o!==pe)return{reset:{placement:pe}}}return{}}}};function xy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ey(e){return Uw.some(t=>e[t]>=0)}const pA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:s="referenceHidden",...o}=dr(e,t);switch(s){case"referenceHidden":{const a=await gi(t,{...o,elementContext:"reference"}),c=xy(a,r.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ey(c)}}}case"escaped":{const a=await gi(t,{...o,altBoundary:!0}),c=xy(a,r.floating);return{data:{escapedOffsets:c,escaped:Ey(c)}}}default:return{}}}}};function Bw(e){const t=ur(...e.map(a=>a.left)),r=ur(...e.map(a=>a.top)),s=gt(...e.map(a=>a.right)),o=gt(...e.map(a=>a.bottom));return{x:t,y:r,width:s-t,height:o-r}}function gA(e){const t=e.slice().sort((o,a)=>o.y-a.y),r=[];let s=null;for(let o=0;o<t.length;o++){const a=t[o];!s||a.y-s.y>s.height/2?r.push([a]):r[r.length-1].push(a),s=a}return r.map(o=>pi(Bw(o)))}const mA=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:s,rects:o,platform:a,strategy:c}=t,{padding:u=2,x:h,y:f}=dr(e,t),m=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(s.reference))||[]),g=gA(m),v=pi(Bw(m)),w=jh(u);function b(){if(g.length===2&&g[0].left>g[1].right&&h!=null&&f!=null)return g.find(_=>h>_.left-w.left&&h<_.right+w.right&&f>_.top-w.top&&f<_.bottom+w.bottom)||v;if(g.length>=2){if(lr(r)==="y"){const K=g[0],te=g[g.length-1],G=Bt(r)==="top",ae=K.top,ce=te.bottom,we=G?K.left:te.left,pe=G?K.right:te.right,W=pe-we,D=ce-ae;return{top:ae,bottom:ce,left:we,right:pe,width:W,height:D,x:we,y:ae}}const _=Bt(r)==="left",E=gt(...g.map(K=>K.right)),R=ur(...g.map(K=>K.left)),A=g.filter(K=>_?K.left===R:K.right===E),I=A[0].top,$=A[A.length-1].bottom,F=R,M=E,z=M-F,V=$-I;return{top:I,bottom:$,left:F,right:M,width:z,height:V,x:F,y:I}}return v}const x=await a.getElementRects({reference:{getBoundingClientRect:b},floating:s.floating,strategy:c});return o.reference.x!==x.reference.x||o.reference.y!==x.reference.y||o.reference.width!==x.reference.width||o.reference.height!==x.reference.height?{reset:{rects:x}}:{}}
vendor: 5,212 bytes, line 54
54}},zw=new Set(["left","top"]);async function yA(e,t){const{placement:r,platform:s,elements:o}=e,a=await(s.isRTL==null?void 0:s.isRTL(o.floating)),c=Bt(r),u=cr(r),h=lr(r)==="y",f=zw.has(c)?-1:1,m=a&&h?-1:1,g=dr(t,e);let{mainAxis:v,crossAxis:w,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof b=="number"&&(w=u==="end"?b*-1:b),h?{x:w*m,y:v*f}:{x:v*f,y:w*m}}const vA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,s;const{x:o,y:a,placement:c,middlewareData:u}=t,h=await yA(t,e);return c===((r=u.offset)==null?void 0:r.placement)&&(s=u.arrow)!=null&&s.alignmentOffset?{}:{x:o+h.x,y:a+h.y,data:{...h,placement:c}}}}},wA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:s,placement:o}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:_=>{let{x:E,y:R}=_;return{x:E,y:R}}},...h}=dr(e,t),f={x:r,y:s},m=await gi(t,h),g=lr(Bt(o)),v=Oh(g);let w=f[v],b=f[g];if(a){const _=v==="y"?"top":"left",E=v==="y"?"bottom":"right",R=w+m[_],A=w-m[E];w=ah(R,w,A)}if(c){const _=g==="y"?"top":"left",E=g==="y"?"bottom":"right",R=b+m[_],A=b-m[E];b=ah(R,b,A)}const x=u.fn({...t,[v]:w,[g]:b});return{...x,data:{x:x.x-r,y:x.y-s,enabled:{[v]:a,[g]:c}}}}}},_A=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:s,placement:o,rects:a,middlewareData:c}=t,{offset:u=0,mainAxis:h=!0,crossAxis:f=!0}=dr(e,t),m={x:r,y:s},g=lr(o),v=Oh(g);let w=m[v],b=m[g];const x=dr(u,t),_=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(h){const A=v==="y"?"height":"width",I=a.reference[v]-a.floating[A]+_.mainAxis,$=a.reference[v]+a.reference[A]-_.mainAxis;w<I?w=I:w>$&&(w=$)}if(f){var E,R;const A=v==="y"?"width":"height",I=zw.has(Bt(o)),$=a.reference[g]-a.floating[A]+(I&&((E=c.offset)==null?void 0:E[g])||0)+(I?0:_.crossAxis),F=a.reference[g]+a.reference[A]+(I?0:((R=c.offset)==null?void 0:R[g])||0)-(I?_.crossAxis:0);b<$?b=$:b>F&&(b=F)}return{[v]:w,[g]:b}}}},bA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,s;const{placement:o,rects:a,platform:c,elements:u}=t,{apply:h=()=>{},...f}=dr(e,t),m=await gi(t,f),g=Bt(o),v=cr(o),w=lr(o)==="y",{width:b,height:x}=a.floating;let _,E;g==="top"||g==="bottom"?(_=g,E=v===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(E=g,_=v==="end"?"top":"bottom");const R=x-m.top-m.bottom,A=b-m.left-m.right,I=ur(x-m[_],R),$=ur(b-m[E],A),F=!t.middlewareData.shift;let M=I,z=$;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(z=A),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(M=R),F&&!v){const K=gt(m.left,0),te=gt(m.right,0),G=gt(m.top,0),ae=gt(m.bottom,0);w?z=b-2*(K!==0||te!==0?K+te:gt(m.left,m.right)):M=x-2*(G!==0||ae!==0?G+ae:gt(m.top,m.bottom))}await h({...t,availableWidth:z,availableHeight:M});const V=await c.getDimensions(u.floating);return b!==V.width||x!==V.height?{reset:{rects:!0}}:{}}}};function lc(){return typeof window<"u"}function wi(e){return Hw(e)?(e.nodeName||"").toLowerCase():"#document"}function Ft(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pr(e){var t;return(t=(Hw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hw(e){return lc()?e instanceof Node||e instanceof Ft(e).Node:!1}function hr(e){return lc()?e instanceof Element||e instanceof Ft(e).Element:!1}function Tr(e){return lc()?e instanceof HTMLElement||e instanceof Ft(e).HTMLElement:!1}function ky(e){return!lc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ft(e).ShadowRoot}const SA=new Set(["inline","contents"]);function Go(e){const{overflow:t,overflowX:r,overflowY:s,display:o}=fr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+r)&&!SA.has(o)}const xA=new Set(["table","td","th"]);function EA(e){return xA.has(wi(e))}const kA=[":popover-open",":modal"];function cc(e){return kA.some(t=>{try{return e.matches(t)}catch{return!1}})}const RA=["transform","translate","scale","rotate","perspective"],CA=["transform","translate","scale","rotate","perspective","filter"],TA=["paint","layout","strict","content"];function Nh(e){const t=Mh(),r=hr(e)?fr(e):e;return RA.some(s=>r[s]?r[s]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||CA.some(s=>(r.willChange||"").includes(s))||TA.some(s=>(r.contain||"").includes(s))}function PA(e){let t=On(e);for(;Tr(t)&&!mi(t);){if(Nh(t))return t;if(cc(t))return null;t=On(t)}return null}function Mh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const AA=new Set(["html","body","#document"]);function mi(e){return AA.has(wi(e))}function fr(e){return Ft(e).getComputedStyle(e)}function uc(e){return hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function On(e){if(wi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ky(e)&&e.host||Pr(e);return ky(t)?t.host:t}function Ww(e){const t=On(e);return mi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tr(t)&&Go(t)?t:Ww(t)}function Fo(e,t,r){var s;
vendor: 4,900 bytes, line 54
54t===void 0&&(t=[]),r===void 0&&(r=!0);const o=Ww(e),a=o===((s=e.ownerDocument)==null?void 0:s.body),c=Ft(o);if(a){const u=lh(c);return t.concat(c,c.visualViewport||[],Go(o)?o:[],u&&r?Fo(u):[])}return t.concat(o,Fo(o,[],r))}function lh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vw(e){const t=fr(e);let r=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Tr(e),a=o?e.offsetWidth:r,c=o?e.offsetHeight:s,u=zl(r)!==a||zl(s)!==c;return u&&(r=a,s=c),{width:r,height:s,$:u}}function $h(e){return hr(e)?e:e.contextElement}function ui(e){const t=$h(e);if(!Tr(t))return Cr(1);const r=t.getBoundingClientRect(),{width:s,height:o,$:a}=Vw(t);let c=(a?zl(r.width):r.width)/s,u=(a?zl(r.height):r.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const OA=Cr(0);function qw(e){const t=Ft(e);return!Mh()||!t.visualViewport?OA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function IA(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ft(e)?!1:t}function us(e,t,r,s){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=$h(e);let c=Cr(1);t&&(s?hr(s)&&(c=ui(s)):c=ui(e));const u=IA(a,r,s)?qw(a):Cr(0);let h=(o.left+u.x)/c.x,f=(o.top+u.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(a){const v=Ft(a),w=s&&hr(s)?Ft(s):s;let b=v,x=lh(b);for(;x&&s&&w!==b;){const _=ui(x),E=x.getBoundingClientRect(),R=fr(x),A=E.left+(x.clientLeft+parseFloat(R.paddingLeft))*_.x,I=E.top+(x.clientTop+parseFloat(R.paddingTop))*_.y;h*=_.x,f*=_.y,m*=_.x,g*=_.y,h+=A,f+=I,b=Ft(x),x=lh(b)}}return pi({width:m,height:g,x:h,y:f})}function Dh(e,t){const r=uc(e).scrollLeft;return t?t.left+r:us(Pr(e)).left+r}function Kw(e,t,r){r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=s.left+t.scrollLeft-(r?0:Dh(e,s)),a=s.top+t.scrollTop;return{x:o,y:a}}function LA(e){let{elements:t,rect:r,offsetParent:s,strategy:o}=e;const a=o==="fixed",c=Pr(s),u=t?cc(t.floating):!1;if(s===c||u&&a)return r;let h={scrollLeft:0,scrollTop:0},f=Cr(1);const m=Cr(0),g=Tr(s);if((g||!g&&!a)&&((wi(s)!=="body"||Go(c))&&(h=uc(s)),Tr(s))){const w=us(s);f=ui(s),m.x=w.x+s.clientLeft,m.y=w.y+s.clientTop}const v=c&&!g&&!a?Kw(c,h,!0):Cr(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-h.scrollLeft*f.x+m.x+v.x,y:r.y*f.y-h.scrollTop*f.y+m.y+v.y}}function jA(e){return Array.from(e.getClientRects())}function NA(e){const t=Pr(e),r=uc(e),s=e.ownerDocument.body,o=gt(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),a=gt(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-r.scrollLeft+Dh(e);const u=-r.scrollTop;return fr(s).direction==="rtl"&&(c+=gt(t.clientWidth,s.clientWidth)-o),{width:o,height:a,x:c,y:u}}function MA(e,t){const r=Ft(e),s=Pr(e),o=r.visualViewport;let a=s.clientWidth,c=s.clientHeight,u=0,h=0;if(o){a=o.width,c=o.height;const f=Mh();(!f||f&&t==="fixed")&&(u=o.offsetLeft,h=o.offsetTop)}return{width:a,height:c,x:u,y:h}}const $A=new Set(["absolute","fixed"]);function DA(e,t){const r=us(e,!0,t==="fixed"),s=r.top+e.clientTop,o=r.left+e.clientLeft,a=Tr(e)?ui(e):Cr(1),c=e.clientWidth*a.x,u=e.clientHeight*a.y,h=o*a.x,f=s*a.y;return{width:c,height:u,x:h,y:f}}function Ry(e,t,r){let s;if(t==="viewport")s=MA(e,r);else if(t==="document")s=NA(Pr(e));else if(hr(t))s=DA(t,r);else{const o=qw(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return pi(s)}function Gw(e,t){const r=On(e);return r===t||!hr(r)||mi(r)?!1:fr(r).position==="fixed"||Gw(r,t)}function UA(e,t){const r=t.get(e);if(r)return r;let s=Fo(e,[],!1).filter(u=>hr(u)&&wi(u)!=="body"),o=null;const a=fr(e).position==="fixed";let c=a?On(e):e;for(;hr(c)&&!mi(c);){const u=fr(c),h=Nh(c);!h&&u.position==="fixed"&&(o=null),(a?!h&&!o:!h&&u.position==="static"&&!!o&&$A.has(o.position)||Go(c)&&!h&&Gw(e,c))?s=s.filter(m=>m!==c):o=u,c=On(c)}return t.set(e,s),s}function FA(e){let{element:t,boundary:r,rootBoundary:s,strategy:o}=e;const c=[...r==="clippingAncestors"?cc(t)?[]:UA(t,this._c):[].concat(r),s],u=c[0],h=c.reduce((f,m)=>{const g=Ry(t,m,o);return f.top=gt(g.top,f.top),f.right=ur(g.right,f.right),f.bottom=ur(g.bottom,f.bottom),f.left=gt(g.left,f.left),f},Ry(t,u,o));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function BA(e){const{width:t,height:r}=Vw(e);return{width:t,height:r}}function zA(e,t,r){const s=Tr(t),o=Pr(t),a=r==="fixed",c=us(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const h=Cr(0);function f(){h.x=Dh(o)}if(s||!s&&!a)if((wi(t)!=="body"||Go(o))&&(u=uc(t)),s){const w=us(t,!0,a,t);h.x=w.x+t.clientLeft,h.y=w.y+t.clientTop}else o&&f();a&&!s&&o&&f();const m=o&&!s&&!a?Kw(o,u):Cr(0),g=c.left+u.scrollLeft-h.x-m.x,v=c.top+u.scrollTop-h.y-m.y;return{x:g,y:v,width:c.width,height:c.height}}function Ed(e){return fr(e).position==="static"}function Cy(e,t){if(!Tr(e)||fr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Pr(e)===r&&(r=r.ownerDocument.body),r}function Jw(e,t){const r=Ft(e);
vendor: 10,261 bytes, line 54
54if(cc(e))return r;if(!Tr(e)){let o=On(e);for(;o&&!mi(o);){if(hr(o)&&!Ed(o))return o;o=On(o)}return r}let s=Cy(e,t);for(;s&&EA(s)&&Ed(s);)s=Cy(s,t);return s&&mi(s)&&Ed(s)&&!Nh(s)?r:s||PA(e)||r}const HA=async function(e){const t=this.getOffsetParent||Jw,r=this.getDimensions,s=await r(e.floating);return{reference:zA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function WA(e){return fr(e).direction==="rtl"}const VA={convertOffsetParentRelativeRectToViewportRelativeRect:LA,getDocumentElement:Pr,getClippingRect:FA,getOffsetParent:Jw,getElementRects:HA,getClientRects:jA,getDimensions:BA,getScale:ui,isElement:hr,isRTL:WA};function Qw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qA(e,t){let r=null,s;const o=Pr(e);function a(){var u;clearTimeout(s),(u=r)==null||u.disconnect(),r=null}function c(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),a();const f=e.getBoundingClientRect(),{left:m,top:g,width:v,height:w}=f;if(u||t(),!v||!w)return;const b=_l(g),x=_l(o.clientWidth-(m+v)),_=_l(o.clientHeight-(g+w)),E=_l(m),A={rootMargin:-b+"px "+-x+"px "+-_+"px "+-E+"px",threshold:gt(0,ur(1,h))||1};let I=!0;function $(F){const M=F[0].intersectionRatio;if(M!==h){if(!I)return c();M?c(!1,M):s=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!Qw(f,e.getBoundingClientRect())&&c(),I=!1}try{r=new IntersectionObserver($,{...A,root:o.ownerDocument})}catch{r=new IntersectionObserver($,A)}r.observe(e)}return c(!0),a}function KA(e,t,r,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,f=$h(e),m=o||a?[...f?Fo(f):[],...Fo(t)]:[];m.forEach(E=>{o&&E.addEventListener("scroll",r,{passive:!0}),a&&E.addEventListener("resize",r)});const g=f&&u?qA(f,r):null;let v=-1,w=null;c&&(w=new ResizeObserver(E=>{let[R]=E;R&&R.target===f&&w&&(w.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(t)})),r()}),f&&!h&&w.observe(f),w.observe(t));let b,x=h?us(e):null;h&&_();function _(){const E=us(e);x&&!Qw(x,E)&&r(),x=E,b=requestAnimationFrame(_)}return r(),()=>{var E;m.forEach(R=>{o&&R.removeEventListener("scroll",r),a&&R.removeEventListener("resize",r)}),g?.(),(E=w)==null||E.disconnect(),w=null,h&&cancelAnimationFrame(b)}}const GA=vA,Pj=hA,JA=wA,QA=fA,YA=bA,XA=pA,Ty=uA,Aj=mA,ZA=_A,eO=(e,t,r)=>{const s=new Map,o={platform:VA,...r},a={...o.platform,_c:s};return cA(e,t,{...o,platform:a})};var tO=typeof document<"u",rO=function(){},Tl=tO?O.useLayoutEffect:rO;function Vl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(s=r;s--!==0;)if(!Vl(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){const a=o[s];if(!(a==="_owner"&&e.$$typeof)&&!Vl(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Yw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Py(e,t){const r=Yw(e);return Math.round(t*r)/r}function kd(e){const t=O.useRef(e);return Tl(()=>{t.current=e}),t}function nO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:s=[],platform:o,elements:{reference:a,floating:c}={},transform:u=!0,whileElementsMounted:h,open:f}=e,[m,g]=O.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,w]=O.useState(s);Vl(v,s)||w(s);const[b,x]=O.useState(null),[_,E]=O.useState(null),R=O.useCallback(D=>{D!==F.current&&(F.current=D,x(D))},[]),A=O.useCallback(D=>{D!==M.current&&(M.current=D,E(D))},[]),I=a||b,$=c||_,F=O.useRef(null),M=O.useRef(null),z=O.useRef(m),V=h!=null,K=kd(h),te=kd(o),G=kd(f),ae=O.useCallback(()=>{if(!F.current||!M.current)return;const D={placement:t,strategy:r,middleware:v};te.current&&(D.platform=te.current),eO(F.current,M.current,D).then(Y=>{const Z={...Y,isPositioned:G.current!==!1};ce.current&&!Vl(z.current,Z)&&(z.current=Z,tc.flushSync(()=>{g(Z)}))})},[v,t,r,te,G]);Tl(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(D=>({...D,isPositioned:!1})))},[f]);const ce=O.useRef(!1);Tl(()=>(ce.current=!0,()=>{ce.current=!1}),[]),Tl(()=>{if(I&&(F.current=I),$&&(M.current=$),I&&$){if(K.current)return K.current(I,$,ae);ae()}},[I,$,ae,K,V]);const we=O.useMemo(()=>({reference:F,floating:M,setReference:R,setFloating:A}),[R,A]),pe=O.useMemo(()=>({reference:I,floating:$}),[I,$]),W=O.useMemo(()=>{const D={position:r,left:0,top:0};if(!pe.floating)return D;const Y=Py(pe.floating,m.x),Z=Py(pe.floating,m.y);return u?{...D,transform:"translate("+Y+"px, "+Z+"px)",...Yw(pe.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Y,top:Z}},[r,u,pe.floating,m.x,m.y]);return O.useMemo(()=>({...m,update:ae,refs:we,elements:pe,floatingStyles:W}),[m,ae,we,pe,W])}const sO=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:o}=typeof e=="function"?e(r):e;return s&&t(s)?s.current!=null?Ty({element:s.current,padding:o}).fn(r):{}:s?Ty({element:s,padding:o}).fn(r):{}}}},iO=(e,t)=>({...GA(e),options:[e,t]}),oO=(e,t)=>({...JA(e),options:[e,t]}),aO=(e,t)=>({...ZA(e),options:[e,t]}),lO=(e,t)=>({...QA(e),options:[e,t]}),cO=(e,t)=>({...YA(e),options:[e,t]}),uO=(e,t)=>({...XA(e),options:[e,t]}),dO=(e,t)=>({...sO(e),options:[e,t]});var hO="Arrow",Xw=O.forwardRef((e,t)=>{const{children:r,width:s=10,height:o=5,...a}=e;return P.jsx(gs.svg,{...a,ref:t,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xw.displayName=hO;var fO=Xw;function pO(e){const[t,r]=O.useState(void 0);return Uo(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let c,u;if("borderBoxSize"in a){const h=a.borderBoxSize,f=Array.isArray(h)?h[0]:h;c=f.inlineSize,u=f.blockSize}else c=e.offsetWidth,u=e.offsetHeight;r({width:c,height:u})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else r(void 0)},[e]),t}var Uh="Popper",[Zw,e0]=Lw(Uh),[gO,t0]=Zw(Uh),r0=e=>{const{__scopePopper:t,children:r}=e,[s,o]=O.useState(null);return P.jsx(gO,{scope:t,anchor:s,onAnchorChange:o,children:r})};r0.displayName=Uh;var n0="PopperAnchor",s0=O.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:s,...o}=e,a=t0(n0,r),c=O.useRef(null),u=ps(t,c);return O.useEffect(()=>{a.onAnchorChange(s?.current||c.current)}),s?null:P.jsx(gs.div,{...o,ref:u})});s0.displayName=n0;var Fh="PopperContent",[mO,yO]=Zw(Fh),i0=O.forwardRef((e,t)=>{const{__scopePopper:r,side:s="bottom",sideOffset:o=0,align:a="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:w="optimized",onPlaced:b,...x}=e,_=t0(Fh,r),[E,R]=O.useState(null),A=ps(t,Ee=>R(Ee)),[I,$]=O.useState(null),F=pO(I),M=F?.width??0,z=F?.height??0,V=s+(a!=="center"?"-"+a:""),K=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},te=Array.isArray(f)?f:[f],G=te.length>0,ae={padding:K,boundary:te.filter(wO),altBoundary:G},{refs:ce,floatingStyles:we,placement:pe,isPositioned:W,middlewareData:D}=nO({strategy:"fixed",placement:V,whileElementsMounted:(...Ee)=>KA(...Ee,{animationFrame:w==="always"}),elements:{reference:_.anchor},middleware:[iO({mainAxis:o+z,alignmentAxis:c}),h&&oO({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?aO():void 0,...ae}),h&&lO({...ae}),cO({...ae,apply:({elements:Ee,rects:be,availableWidth:Re,availableHeight:Qe})=>{const{width:Yt,height:Ar}=be.reference,Ht=Ee.floating.style;Ht.setProperty("--radix-popper-available-width",`${Re}px`),Ht.setProperty("--radix-popper-available-height",`${Qe}px`),Ht.setProperty("--radix-popper-anchor-width",`${Yt}px`),Ht.setProperty("--radix-popper-anchor-height",`${Ar}px`)}}),I&&dO({element:I,padding:u}),_O({arrowWidth:M,arrowHeight:z}),v&&uO({strategy:"referenceHidden",...ae})]}),[Y,Z]=l0(pe),j=ac(b);Uo(()=>{W&&j?.()},[W,j]);const q=D.arrow?.x,me=D.arrow?.y,ye=D.arrow?.centerOffset!==0,[fe,xe]=O.useState();return Uo(()=>{E&&xe(window.getComputedStyle(E).zIndex)},[E]),P.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...we,transform:W?we.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:P.jsx(mO,{scope:r,placedSide:Y,onArrowChange:$,arrowX:q,arrowY:me,shouldHideArrow:ye,children:P.jsx(gs.div,{"data-side":Y,"data-align":Z,...x,ref:A,style:{...x.style,animation:W?void 0:"none"}})})})});i0.displayName=Fh;var o0="PopperArrow",vO={top:"bottom",right:"left",bottom:"top",left:"right"},a0=O.forwardRef(function(t,r){const{__scopePopper:s,...o}=t,a=yO(o0,s),c=vO[a.placedSide];return P.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:P.jsx(fO,{...o,ref:r,style:{...o.style,display:"block"}})})});a0.displayName=o0;function wO(e){return e!==null}var _O=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:s,middlewareData:o}=t,c=o.arrow?.centerOffset!==0,u=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[f,m]=l0(r),g={start:"0%",center:"50%",end:"100%"}[m],v=(o.arrow?.x??0)+u/2,w=(o.arrow?.y??0)+h/2;let b="",x="";return f==="bottom"?(b=c?g:`${v}px`,x=`${-h}px`):f==="top"?(b=c?g:`${v}px`,x=`${s.floating.height+h}px`):f==="right"?(b=`${-h}px`,x=c?g:`${w}px`):f==="left"&&(b=`${s.floating.width+h}px`,x=c?g:`${w}px`),{data:{x:b,y:x}}}});function l0(e){const[t,r="center"]=e.split("-");return[t,r]}var Oj=r0,bO=s0,SO=i0,xO=a0;function EO(e,t){return O.useReducer((r,s)=>t[r][s]??r,e)}
vendor: 4,223 bytes, line 54
54var c0=e=>{const{present:t,children:r}=e,s=kO(t),o=typeof r=="function"?r({present:s.isPresent}):O.Children.only(r),a=ps(s.ref,RO(o));return typeof r=="function"||s.isPresent?O.cloneElement(o,{ref:a}):null};c0.displayName="Presence";function kO(e){const[t,r]=O.useState(),s=O.useRef(null),o=O.useRef(e),a=O.useRef("none"),c=e?"mounted":"unmounted",[u,h]=EO(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{const f=bl(s.current);a.current=u==="mounted"?f:"none"},[u]),Uo(()=>{const f=s.current,m=o.current;if(m!==e){const v=a.current,w=bl(f);e?h("MOUNT"):w==="none"||f?.display==="none"?h("UNMOUNT"):h(m&&v!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),Uo(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,g=w=>{const x=bl(s.current).includes(w.animationName);if(w.target===t&&x&&(h("ANIMATION_END"),!o.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},v=w=>{w.target===t&&(a.current=bl(s.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:O.useCallback(f=>{s.current=f?getComputedStyle(f):null,r(f)},[])}}function bl(e){return e?.animationName||"none"}function RO(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var CO=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),TO="VisuallyHidden",u0=O.forwardRef((e,t)=>P.jsx(gs.span,{...e,ref:t,style:{...CO,...e.style}}));u0.displayName=TO;var PO=u0,[dc]=Lw("Tooltip",[e0]),Bh=e0(),d0="TooltipProvider",AO=700,Ay="tooltip.open",[OO,h0]=dc(d0),f0=e=>{const{__scopeTooltip:t,delayDuration:r=AO,skipDelayDuration:s=300,disableHoverableContent:o=!1,children:a}=e,c=O.useRef(!0),u=O.useRef(!1),h=O.useRef(0);return O.useEffect(()=>{const f=h.current;return()=>window.clearTimeout(f)},[]),P.jsx(OO,{scope:t,isOpenDelayedRef:c,delayDuration:r,onOpen:O.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:O.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,s)},[s]),isPointerInTransitRef:u,onPointerInTransitChange:O.useCallback(f=>{u.current=f},[]),disableHoverableContent:o,children:a})};f0.displayName=d0;var p0="Tooltip",[Ij,hc]=dc(p0),ch="TooltipTrigger",IO=O.forwardRef((e,t)=>{const{__scopeTooltip:r,...s}=e,o=hc(ch,r),a=h0(ch,r),c=Bh(r),u=O.useRef(null),h=ps(t,u,o.onTriggerChange),f=O.useRef(!1),m=O.useRef(!1),g=O.useCallback(()=>f.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),P.jsx(bO,{asChild:!0,...c,children:P.jsx(gs.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...s,ref:h,onPointerMove:Wr(e.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:Wr(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:Wr(e.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Wr(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:Wr(e.onBlur,o.onClose),onClick:Wr(e.onClick,o.onClose)})})});IO.displayName=ch;var LO="TooltipPortal",[Lj,jO]=dc(LO,{forceMount:void 0}),yi="TooltipContent",g0=O.forwardRef((e,t)=>{const r=jO(yi,e.__scopeTooltip),{forceMount:s=r.forceMount,side:o="top",...a}=e,c=hc(yi,e.__scopeTooltip);return P.jsx(c0,{present:s||c.open,children:c.disableHoverableContent?P.jsx(m0,{side:o,...a,ref:t}):P.jsx(NO,{side:o,...a,ref:t})})}),NO=O.forwardRef((e,t)=>
vendor: 4,745 bytes, line 54
54{const r=hc(yi,e.__scopeTooltip),s=h0(yi,e.__scopeTooltip),o=O.useRef(null),a=ps(t,o),[c,u]=O.useState(null),{trigger:h,onClose:f}=r,m=o.current,{onPointerInTransitChange:g}=s,v=O.useCallback(()=>{u(null),g(!1)},[g]),w=O.useCallback((b,x)=>{const _=b.currentTarget,E={x:b.clientX,y:b.clientY},R=FO(E,_.getBoundingClientRect()),A=BO(E,R),I=zO(x.getBoundingClientRect()),$=WO([...A,...I]);u($),g(!0)},[g]);return O.useEffect(()=>()=>v(),[v]),O.useEffect(()=>{if(h&&m){const b=_=>w(_,m),x=_=>w(_,h);return h.addEventListener("pointerleave",b),m.addEventListener("pointerleave",x),()=>{h.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",x)}}},[h,m,w,v]),O.useEffect(()=>{if(c){const b=x=>{const _=x.target,E={x:x.clientX,y:x.clientY},R=h?.contains(_)||m?.contains(_),A=!HO(E,c);R?v():A&&(v(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[h,m,c,f,v]),P.jsx(m0,{...e,ref:a})}),[MO,$O]=dc(p0,{isInside:!1}),DO=BP("TooltipContent"),m0=O.forwardRef((e,t)=>{const{__scopeTooltip:r,children:s,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=e,h=hc(yi,r),f=Bh(r),{onClose:m}=h;return O.useEffect(()=>(document.addEventListener(Ay,m),()=>document.removeEventListener(Ay,m)),[m]),O.useEffect(()=>{if(h.trigger){const g=v=>{v.target?.contains(h.trigger)&&m()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[h.trigger,m]),P.jsx(Ah,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:m,children:P.jsxs(SO,{"data-state":h.stateAttribute,...f,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(DO,{children:s}),P.jsx(MO,{scope:r,isInside:!0,children:P.jsx(PO,{id:h.contentId,role:"tooltip",children:o||s})})]})})});g0.displayName=yi;var y0="TooltipArrow",UO=O.forwardRef((e,t)=>{const{__scopeTooltip:r,...s}=e,o=Bh(r);return $O(y0,r).isInside?null:P.jsx(xO,{...o,...s,ref:t})});UO.displayName=y0;function FO(e,t){const r=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,s,o,a)){case a:return"left";case o:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function BO(e,t,r=5){const s=[];switch(t){case"top":s.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":s.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":s.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":s.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return s}function zO(e){const{top:t,right:r,bottom:s,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:s},{x:o,y:s}]}function HO(e,t){const{x:r,y:s}=e;let o=!1;for(let a=0,c=t.length-1;a<t.length;c=a++){const u=t[a],h=t[c],f=u.x,m=u.y,g=h.x,v=h.y;m>s!=v>s&&r<(g-f)*(s-m)/(v-m)+f&&(o=!o)}return o}function WO(e){const t=e.slice();return t.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),VO(t)}function VO(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const o=e[s];for(;t.length>=2;){const a=t[t.length-1],c=t[t.length-2];if((a.x-c.x)*(o.y-c.y)>=(a.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let s=e.length-1;s>=0;s--){const o=e[s];for(;r.length>=2;){const a=r[r.length-1],c=r[r.length-2];if((a.x-c.x)*(o.y-c.y)>=(a.y-c.y)*(o.x-c.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var qO=f0,v0=g0;function w0(e){var t,r,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=w0(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function KO(){for(var e,t,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=w0(e))&&(s&&(s+=" "),s+=t);return s}const zh="-",GO=e=>{const t=QO(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const u=c.split(zh);return u[0]===""&&u.length!==1&&u.shift(),_0(u,t)||JO(c)},getConflictingClassGroupIds:(c,u)=>{const h=r[c]||[];return u&&s[c]?[...h,...s[c]]:h}}},_0=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?_0(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const a=e.join(zh);return t.validators.find(({validator:c}
vendor: 5,339 bytes, line 54
54)=>c(a))?.classGroupId},Oy=/^\[(.+)\]$/,JO=e=>{if(Oy.test(e)){const t=Oy.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},QO=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return XO(Object.entries(e.classGroups),r).forEach(([a,c])=>{uh(c,s,a,t)}),s},uh=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:Iy(t,o);a.classGroupId=r;return}if(typeof o=="function"){if(YO(o)){uh(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([a,c])=>{uh(c,Iy(t,a),r,s)})})},Iy=(e,t)=>{let r=e;return t.split(zh).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},YO=e=>e.isThemeGetter,XO=(e,t)=>t?e.map(([r,s])=>{const o=s.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([c,u])=>[t+c,u])):a);return[r,o]}):e,ZO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const o=(a,c)=>{r.set(a,c),t++,t>e&&(t=0,s=r,r=new Map)};return{get(a){let c=r.get(a);if(c!==void 0)return c;if((c=s.get(a))!==void 0)return o(a,c),c},set(a,c){r.has(a)?r.set(a,c):o(a,c)}}},b0="!",eI=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],a=t.length,c=u=>{const h=[];let f=0,m=0,g;for(let _=0;_<u.length;_++){let E=u[_];if(f===0){if(E===o&&(s||u.slice(_,_+a)===t)){h.push(u.slice(m,_)),m=_+a;continue}if(E==="/"){g=_;continue}}E==="["?f++:E==="]"&&f--}const v=h.length===0?u:u.substring(m),w=v.startsWith(b0),b=w?v.substring(1):v,x=g&&g>m?g-m:void 0;return{modifiers:h,hasImportantModifier:w,baseClassName:b,maybePostfixModifierPosition:x}};return r?u=>r({className:u,parseClassName:c}):c},tI=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(s=>{s[0]==="["?(t.push(...r.sort(),s),r=[]):r.push(s)}),t.push(...r.sort()),t},rI=e=>({cache:ZO(e.cacheSize),parseClassName:eI(e),...GO(e)}),nI=/\s+/,sI=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,a=[],c=e.trim().split(nI);let u="";for(let h=c.length-1;h>=0;h-=1){const f=c[h],{modifiers:m,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:w}=r(f);let b=!!w,x=s(b?v.substring(0,w):v);if(!x){if(!b){u=f+(u.length>0?" "+u:u);continue}if(x=s(v),!x){u=f+(u.length>0?" "+u:u);continue}b=!1}const _=tI(m).join(":"),E=g?_+b0:_,R=E+x;if(a.includes(R))continue;a.push(R);const A=o(x,b);for(let I=0;I<A.length;++I){const $=A[I];a.push(E+$)}u=f+(u.length>0?" "+u:u)}return u};function iI(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=S0(t))&&(s&&(s+=" "),s+=r);return s}const S0=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=S0(e[s]))&&(r&&(r+=" "),r+=t);return r};function oI(e,...t){let r,s,o,a=c;function c(h){const f=t.reduce((m,g)=>g(m),e());return r=rI(f),s=r.cache.get,o=r.cache.set,a=u,u(h)}function u(h){const f=s(h);if(f)return f;const m=sI(h,r);return o(h,m),m}return function(){return a(iI.apply(null,arguments))}}const $e=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},x0=/^\[(?:([a-z-]+):)?(.+)\]$/i,aI=/^\d+\/\d+$/,lI=new Set(["px","full","screen"]),cI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,hI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Br=e=>di(e)||lI.has(e)||aI.test(e),wn=e=>_i(e,"length",bI),di=e=>!!e&&!Number.isNaN(Number(e)),Rd=e=>_i(e,"number",di),go=e=>!!e&&Number.isInteger(Number(e)),pI=e=>e.endsWith("%")&&di(e.slice(0,-1)),_e=e=>x0.test(e),_n=e=>cI.test(e),gI=new Set(["length","size","percentage"]),mI=e=>_i(e,gI,E0),yI=e=>_i(e,"position",E0),vI=new Set(["image","url"]),wI=e=>_i(e,vI,xI),_I=e=>_i(e,"",SI),mo=()=>!0,_i=(e,t,r)=>{const s=x0.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},bI=e=>uI.test(e)&&!dI.test(e),E0=()=>!1,SI=e=>hI.test(e),xI=e=>fI.test(e),EI=()=>{const e=$e("colors"),t=$e("spacing"),r=$e("blur"),s=$e("brightness"),o=$e("borderColor"),a=$e("borderRadius"),c=$e("borderSpacing"),u=$e("borderWidth"),h=$e("contrast"),f=$e("grayscale"),m=$e("hueRotate"),g=$e("invert"),v=$e("gap"),w=$e("gradientColorStops"),b=$e("gradientColorStopPositions"),x=$e("inset"),_=$e("margin"),E=$e("opacity"),R=$e("padding"),A=$e("saturate"),I=$e("scale"),$=$e("sepia"),F=$e("skew"),M=$e("space"),z=$e("translate"),V=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",_e,t],G=()=>[_e,t],ae=()=>["",Br,wn],ce=()=>["auto",di,_e],we=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],pe=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",_e],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[di,_e];return{cacheSize:500,separator:":",theme:{colors:[mo],spacing:[Br,wn],blur:["none","",_n,_e],brightness:j(),borderColor:[e],borderRadius:["n
54one","","full",_n,_e],borderSpacing:G(),borderWidth:ae(),contrast:j(),grayscale:Y(),hueRotate:j(),invert:Y(),gap:G(),gradientColorStops:[e],gradientColorStopPositions:[pI,wn],inset:te(),margin:te(),opacity:j(),padding:G(),saturate:j(),scale:j(),sepia:Y(),skew:j(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",_e]}],container:["container"],columns:[{columns:[_n]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...we(),_e]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",go,_e]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",_e]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",go,_e]}],"grid-cols":[{"grid-cols":[mo]}],"col-start-end":[{col:["auto",{span:["full",go,_e]},_e]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[mo]}],"row-start-end":[{row:["auto",{span:[go,_e]},_e]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",_e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",_e]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",_e,t]}],"min-w":[{"min-w":[_e,t,"min","max","fit"]}],"max-w":[{"max-w":[_e,t,"none","full","min","max","fit","prose",{screen:[_n]},_n]}],h:[{h:[_e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[_e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[_e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_n,wn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Rd]}],"font-family":[{font:[mo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",_e]}],"line-clamp":[{"line-clamp":["none",di,Rd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Br,_e]}],"list-image":[{"list-image":["none",_e]}],"list-style-type":[{list:["none","disc","decimal",_e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Br,wn]}],"underline-offset":[{"underline-offset":["auto",Br,_e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",_e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...we(),yI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}
vendor: 5,184 bytes, line 54
54],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...pe(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:pe()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...pe()]}],"outline-offset":[{"outline-offset":[Br,_e]}],"outline-w":[{outline:[Br,wn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[Br,wn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_n,_I]}],"shadow-color":[{shadow:[mo]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[h]}],"drop-shadow":[{"drop-shadow":["","none",_n,_e]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[g]}],saturate:[{saturate:[A]}],sepia:[{sepia:[$]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[h]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",_e]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",_e]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",_e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[I]}],"scale-x":[{"scale-x":[I]}],"scale-y":[{"scale-y":[I]}],rotate:[{rotate:[go,_e]}],"translate-x":[{"translate-x":[z]}],"translate-y":[{"translate-y":[z]}],"skew-x":[{"skew-x":[F]}],"skew-y":[{"skew-y":[F]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",_e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",_e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
54],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",_e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Br,wn,Rd]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},kI=oI(EI);function RI(...e){return kI(KO(e))}const CI=qO,TI=O.forwardRef(({className:e,sideOffset:t=4,...r},s)=>P.jsx(v0,{ref:s,sideOffset:t,className:RI("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));TI.displayName=v0.displayName;function PI({children:e,fallback:t=null}){const[r,s]=O.useState(!1);return O.useEffect(()=>{s(!0)},[]),P.jsx(P.Fragment,{children:r?e:t})}function AI(e,t){try{if(typeof window>"u")return;const r=window.__LOVABLE_REPORT_ERROR__;if(typeof r=="function"){r(e,t);return}console.error("[lovable-error]",t??{},e)}catch{}}function OI(e){return/^(https?:)?\/\//i.test(e)||/^(mailto:|tel:|#)/i.test(e)}function k0(e){const[t,...r]=e.split("#"),s=r.join("#"),[o,...a]=t.split("?"),c=a.join("?"),u=c?Object.fromEntries(new URLSearchParams(c).entries()):void 0;return{to:o||"/",...u?{search:u}:{},...s?{hash:s}:{}}}const Tt=O.forwardRef(function({to:t,replace:r,state:s,onClick:o,...a},c){const u=Je();return OI(t)?P.jsx("a",{ref:c,href:t,onClick:o,...a}):P.jsx("a",{ref:c,href:t,onClick:h=>{o?.(h),!h.defaultPrevented&&(h.button!==0||h.metaKey||h.ctrlKey||h.shiftKey||h.altKey||a.target==="_blank"||(h.preventDefault(),u.navigate({...k0(t),replace:r})))},...a})});function II(){const e=Je();return(t,r)=>{if(typeof t=="number"){typeof window<"u"&&window.history.go(t);return}e.navigate({...k0(t),replace:r?.replace})}}function jj(){return rc({select:e=>e.location})}O.forwardRef(function({className:t,activeClassName:r,to:s,...o},a){const u=rc({select:h=>h.location.pathname})===s;
54return P.jsx(Tt,{ref:a,to:s,className:[t,u?r:void 0].filter(Boolean).join(" "),...o})});const LI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),R0=(...e)=>e.filter((t,r,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===r).join(" ").trim();var jI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const NI=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:o="",children:a,iconNode:c,...u},h)=>O.createElement("svg",{ref:h,...jI,width:t,height:t,stroke:e,strokeWidth:s?Number(r)*24/Number(t):r,className:R0("lucide",o),...u},[...c.map(([f,m])=>O.createElement(f,m)),...Array.isArray(a)?a:[a]]));const Hh=(e,t)=>{const r=O.forwardRef(({className:s,...o},a)=>O.createElement(NI,{ref:a,iconNode:t,className:R0(`lucide-${LI(e)}`,s),...o}));return r.displayName=`${e}`,r};const MI=Hh("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);const $I=Hh("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const Ly=Hh("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function DI(){const{data:e}=An({queryKey:["crypto-prices"],queryFn:UI,refetchInterval:6e4,staleTime:3e4}),t=e??FI;return P.jsx("div",{className:"hidden md:flex items-center gap-3",children:t.map(r=>{const s=r.price_change_percentage_24h>=0;return P.jsxs("span",{className:"flex items-center gap-1 text-xs font-sans whitespace-nowrap",children:[P.jsx("span",{className:"font-heading font-semibold uppercase",children:r.symbol}),P.jsxs("span",{className:"font-bold",children:["$",r.current_price.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})]}),P.jsxs("span",{className:s?"text-crypto-up":"text-crypto-down",children:[s?"▲":"▼",Math.abs(r.price_change_percentage_24h).toFixed(1),"%"]})]},r.id)})})}async function UI(){const e=await fetch("https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=bitcoin,ethereum,binancecoin&order=market_cap_desc");if(!e.ok)throw new Error("Failed to fetch prices");return e.json()}const FI=[{id:"bitcoin",symbol:"BTC",name:"Bitcoin",current_price:0,price_change_percentage_24h:0},{id:"ethereum",symbol:"ETH",name:"Ethereum",current_price:0,price_change_percentage_24h:0},{id:"binancecoin",symbol:"BNB",name:"BNB",current_price:0,price_change_percentage_24h:0}],BI="https://hashtelegraph.com",zI=new Set(["hashtelegraph.com","www.hashtelegraph.com"]),HI=/^\/(?:search|login|admin|preview|review)(?:\/|$|\?)/;function At(e){if(!e||e.startsWith("#")||e.startsWith("mailto:")||e.startsWith("tel:"))return e;const t=/^https?:\/\//i.test(e),r=e.startsWith("/")&&!e.startsWith("//");if(!t&&!r)return e;const s=new URL(e,BI);return t&&!zI.has(s.hostname)||s.pathname==="/"||s.pathname.endsWith("/")||HI.test(s.pathname)||(s.pathname.split("/").pop()||"").includes(".")?e:(s.pathname=`${s.pathname}/`,t?s.toString():`${s.pathname}${s.search}${s.hash}`)}function ls(e){return At(`/${e}`)}function dh(e){return At(`/tag/${e}`)}function Nj(e){return e.replace(/\bhref=(['"])(https?:\/\/(?:www\.)?hashtelegraph\.com\/[^'"]*|\/(?!\/)[^'"]*)\1/gi,(t,r,s)=>`href=${r}${At(s)}${r}`)}const WI=[{label:"Новости",url:"/novosti",is_external:!1,children:[]},{label:"Статьи",url:"/statji",is_external:!1,children:[]},{label:"Глоссарий",url:"/glossary",is_external:!1,children:[]}],VI=()=>P.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:P.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),qI=()=>
54P.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:P.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),KI=[{label:"Telegram",href:"https://t.me/hashtelegraph",icon:VI},{label:"Twitter",href:"https://twitter.com/hashtelegraph",icon:qI}];function GI(){const[e,t]=O.useState(!1),[r,s]=O.useState(!1),[o,a]=O.useState(""),[c,u]=O.useState(""),[h,f]=O.useState(!1),[m,g]=O.useState(!1),[v,w]=O.useState(-1),[b,x]=O.useState(null),_=II(),E=O.useRef(null),R=O.useRef(null),A=O.useRef(null);O.useEffect(()=>{h&&(g(!0),x(null))},[h]);const I=()=>{if(b)return;const W=R.current;if(!W)return;const D=W.getBoundingClientRect();x({top:D.top,right:window.innerWidth-D.right})},$=()=>{I(),f(!1)},F=W=>{W.target!==W.currentTarget||W.propertyName!=="opacity"||h||(g(!1),w(-1),x(null))};O.useEffect(()=>{if(!r&&!h)return;const W=D=>{const Y=D.target,Z=E.current?.contains(Y),j=R.current?.contains(Y),q=A.current?.contains(Y);if(!Z){h&&I(),s(!1),a(""),f(!1);return}h&&!j&&!q&&$()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[r,h]),O.useEffect(()=>{if(!h)return;let W=!1,D=0;const Y=()=>{W||(W=!0,D=requestAnimationFrame(()=>{$()}))},Z=j=>{R.current?.contains(j.target)||Y()};return window.addEventListener("scroll",Y,{passive:!0,capture:!0}),window.addEventListener("touchmove",Z,{passive:!0,capture:!0}),window.addEventListener("wheel",Y,{passive:!0,capture:!0}),()=>{cancelAnimationFrame(D),window.removeEventListener("scroll",Y,{capture:!0}),window.removeEventListener("touchmove",Z,{capture:!0}),window.removeEventListener("wheel",Y,{capture:!0})}},[h]),O.useEffect(()=>{const W=setTimeout(()=>u(o.trim()),200);return()=>clearTimeout(W)}
54,[o]);const{data:M}=An({queryKey:["menu-items"],queryFn:async()=>{const{data:W}=await qr.from("menu_items").select("*").order("sort_order");return W??[]},staleTime:6e4}),{data:z=[]}=An({queryKey:["search-suggestions",c],queryFn:async()=>{if(c.length<2)return[];const{data:W,error:D}=await qr.rpc("search_articles",{query_text:c,limit_count:6});return D?(console.error("suggestions error",D),[]):W??[]},enabled:r&&c.length>=2,staleTime:3e4});O.useEffect(()=>{w(-1)},[z]);const K=!M||M.length===0?WI:M.filter(D=>!D.parent_id).sort((D,Y)=>D.sort_order-Y.sort_order).map(D=>({...D,children:M.filter(Y=>Y.parent_id===D.id).sort((Y,Z)=>Y.sort_order-Z.sort_order)})),te=O.useRef(!1),G=()=>{te.current=!0,s(!1),a(""),f(!1),setTimeout(()=>{te.current=!1},350)},ae=(W,D)=>{W.preventDefault(),W.stopPropagation(),te.current=!0,f(!1),_(ls(D)),G()},ce=()=>{o.trim()&&(te.current=!0,f(!1),_(`/search?q=${encodeURIComponent(o.trim())}`),G())},we=W=>{if(W.preventDefault(),v>=0&&z[v]){_(ls(z[v].slug)),G();return}ce()},pe=W=>{!h||z.length===0||(W.key==="ArrowDown"?(W.preventDefault(),w(D=>(D+1)%z.length)):W.key==="ArrowUp"?(W.preventDefault(),w(D=>D<=0?z.length-1:D-1)):W.key==="Escape"&&f(!1))};return P.jsxs("header",{className:"bg-header text-header-foreground",children:[P.jsx("nav",{className:"bg-header-nav text-header-nav-foreground",children:P.jsxs("div",{className:"container flex items-center justify-between h-11",children:[P.jsx("div",{className:"hidden md:flex items-center gap-0 flex-1",children:K.map(W=>W.is_external?P.jsx("a",{href:W.url,target:"_blank",rel:"noopener noreferrer",className:"font-heading text-sm uppercase tracking-wider px-4 py-2 hover:bg-accent transition-colors",children:W.label},W.url):P.jsxs("div",{className:"relative group",children:[P.jsx(Tt,{to:At(W.url),className:"font-heading text-sm uppercase tracking-wider px-4 py-2 hover:bg-accent transition-colors inline-block",children:W.label}),W.children&&W.children.length>0&&P.jsx("div",{className:"absolute top-full left-0 hidden group-hover:block z-50",children:P.jsx("div",{className:"bg-header-nav border border-border/20 shadow-lg min-w-[160px]",children:W.children.map(D=>D.is_external?P.jsx("a",{href:D.url,target:"_blank",rel:"noopener noreferrer",className:"block px-4 py-2 font-heading text-sm uppercase tracking-wider hover:bg-accent transition-colors",children:D.label},D.url):P.jsx(Tt,{to:At(D.url),className:"block px-4 py-2 font-heading text-sm uppercase tracking-wider hover:bg-accent transition-colors",children:D.label},D.url))})})]},W.url))}),P.jsxs("div",{ref:E,className:"flex items-center gap-4 ml-auto",children:[P.jsx("div",{className:`transition-all duration-300 ${r?"opacity-0 pointer-events-none w-0 overflow-hidden":"opacity-100"}`,children:P.jsx(DI,{})}),KI.map(W=>P.jsx("a",{href:W.href,target:"_blank",rel:"noopener noreferrer","aria-label":W.label,className:`hidden md:inline-flex items-center hover:text-accent transition-all duration-300 ${r?"opacity-0 pointer-events-none w-0 overflow-hidden":"opacity-100"}`,children:P.jsx(W.icon,{})},W.label)),P.jsxs("div",{className:`relative overflow-visible transition-all duration-300 ease-out ${r?"w-48 md:w-64 opacity-100":"w-0 opacity-0 overflow-hidden"}`,children:[P.jsx("form",{onSubmit:we,children:P.jsx("input",{type:"text",value:o,onChange:W=>{a(W.target.value),f(!0)},onFocus:()=>f(!0),onKeyDown:pe,placeholder:"Поиск...",className:"w-full bg-transparent border-b border-header-nav-foreground
54/30 pb-1 text-sm outline-none placeholder:text-header-nav-foreground/50 font-sans",autoFocus:r,ref:W=>{A.current=W,W&&r&&W.focus()},"aria-autocomplete":"list","aria-expanded":h&&z.length>0,role:"combobox"})}),r&&m&&c.length>=2&&z.length>0&&P.jsxs("ul",{ref:R,role:"listbox",onTransitionEnd:F,style:b?{position:"fixed",top:b.top,right:b.right}:void 0,className:`${b?"":"absolute right-0 top-full mt-2"} w-72 md:w-80 bg-popover text-popover-foreground border border-border shadow-lg rounded-sm z-50 overflow-hidden transition-all duration-200 ease-out ${h?"opacity-100 translate-y-0 pointer-events-auto":"opacity-0 -translate-y-1 pointer-events-none"}`,children:[z.map((W,D)=>{const Y=W.published_at?new Date(W.published_at).toLocaleDateString("ru-RU",{day:"numeric",month:"short",year:"numeric"}):null,Z=W.excerpt?.trim()||null;return P.jsx("li",{role:"option","aria-selected":D===v,children:P.jsxs(Tt,{to:ls(W.slug),onMouseDown:j=>ae(j,W.slug),onClick:j=>j.preventDefault(),onMouseEnter:()=>{te.current||!h||w(D)},className:`block px-3 py-2 transition-colors ${D===v?"bg-accent/15":"hover:bg-muted"}`,children:[P.jsx("div",{className:`text-sm font-sans line-clamp-2 leading-snug ${D===v?"text-accent":""}`,children:W.title}),(Y||Z)&&P.jsxs("div",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground font-sans",children:[Y&&P.jsx("time",{className:"shrink-0",children:Y}),Y&&Z&&P.jsx("span",{className:"opacity-50",children:"·"}),Z&&P.jsx("span",{className:"line-clamp-1",children:Z})]})]})},W.id)}),P.jsx("li",{className:"border-t border-border",children:P.jsxs("button",{type:"button",onMouseEnter:()=>w(-1),onClick:W=>{W.preventDefault(),ce()},className:"w-full text-left px-3 py-2 text-xs font-sans text-muted-foreground hover:bg-muted transition-colors",children:["Все результаты по «",c,"» →"]})})]})]}),P.jsx("button",{className:"hover:text-accent transition-colors shrink-0",onClick:()=>{r?G():s(!0)},"aria-label":r?"Закрыть поиск":"Открыть поиск",children:r?P.jsx(Ly,{className:"h-4 w-4"}):P.jsx($I,{className:"h-4 w-4"})}),P.jsx("button",{className:"md:hidden hover:text-accent transition-colors",onClick:()=>t(!e),"aria-label":e?"Закрыть меню":"Открыть меню",children:e?P.jsx(Ly,{className:"h-5 w-5"}):P.jsx(MI,{className:"h-5 w-5"})})]})]})}),e&&P.jsx("nav",{className:"md:hidden bg-header-nav text-header-nav-foreground border-t border-border/20 pb-4",children:P.jsx("div",{className:"container flex flex-col gap-0 pt-2",children:K.map(W=>P.jsx("div",{children:W.is_external?P.jsx("a",{href:W.url,target:"_blank",rel:"noopener noreferrer",className:"block py-2 font-heading text-sm uppercase tracking-wider hover:text-accent",onClick:()=>t(!1),children:W.label}):P.jsxs(P.Fragment,{children:[P.jsx(Tt,{to:At(W.url),className:"block py-2 font-heading text-sm uppercase tracking-wider hover:text-accent",onClick:()=>t(!1),children:W.label}),W.children?.map(D=>D.is_external?P.jsx("a",{href:D.url,target:"_blank",rel:"noopener noreferrer",className:"block py-1.5 pl-4 font-heading text-sm uppercase tracking-wider text-header-nav-foreground
54/70 hover:text-accent",onClick:()=>t(!1),children:D.label},D.url):P.jsx(Tt,{to:At(D.url),className:"block py-1.5 pl-4 font-heading text-sm uppercase tracking-wider text-header-nav-foreground/70 hover:text-accent",onClick:()=>t(!1),children:D.label},D.url))]})},W.url))})})]})}const JI="featured_tag_short_names";function QI(){return An({queryKey:["featured-tag-short-names"],queryFn:async()=>{const{data:e}=await qr.from("site_settings").select("value").eq("key",JI).maybeSingle();try{const t=JSON.parse(e?.value??"{}");return typeof t=="object"&&t!==null?t:{}}catch{return{}}},staleTime:6e4})}function YI(){const{data:e}=An({queryKey:["featured-tags"],queryFn:async()=>{const{data:o}=await qr.from("featured_tags").select("id, tag_id, sort_order, tags(id, name, slug)").order("sort_order");return o??[]},staleTime:6e4}),{data:t}=An({queryKey:["tags"],queryFn:async()=>{const{data:o}=await qr.from("tags").select("*").order("name");return o??[]},enabled:e!==void 0&&e.length===0}),{data:r={}}=QI(),s=e&&e.length>0?e.map(o=>o.tags).filter(Boolean):t??[];return P.jsx("div",{className:"bg-secondary border-b border-border overflow-x-auto",children:P.jsxs("div",{className:"container flex items-center gap-4 h-10",children:[P.jsx("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:s.map((o,a)=>{const c=r[o.id]||o.name;return P.jsxs(Tt,{to:dh(o.slug),title:o.name,className:`text-xs font-sans font-semibold uppercase tracking-wider text-muted-foreground hover:text-accent transition-colors whitespace-nowrap ${a>=2?"hidden sm:inline":""}`,children:["#",c]},o.id)})}),P.jsx("a",{href:"https://t.me/hashtelegraph",target:"_blank",rel:"noopener noreferrer",className:"text-xs font-sans font-semibold text-muted-foreground hover:text-accent transition-colors whitespace-nowrap ml-auto shrink-0",children:"✈ @hashtelegraph"})]})})}function XI(){return P.jsx("footer",{className:"bg-background text-foreground py-10 mt-12 border-t border-border",children:P.jsx("div",{className:"container",children:P.jsxs("div",{className:"flex flex-col items-center text-center gap-6",children:[P.jsxs(Tt,{to:"/",className:"font-heading text-2xl font-bold uppercase tracking-wider",children:[P.jsx("span",{className:"text-accent",children:"#"})," Hash Telegraph"]}),P.jsxs("div",{className:"flex items-center gap-4",children:[P.jsx("a",{href:"https://t.me/hashtelegraph",target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 rounded-full bg-primary text-primary-foreground flex items-center justify-center hover:bg-accent transition-colors",children:P.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:P.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})}),P.jsx("a",{href:"https://twitter.com/hashtelegraph",target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 rounded-full bg-primary text-primary-foreground flex items-center justify-center hover:bg-accent transition-colors",children:P.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:P.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})]}),P.jsxs("nav",{className:"flex items-center gap-6",children:[P.jsx(Tt,{to:ls("novosti"),className:"font-heading text-sm uppercase tracking-wider hover:text-accent transition-colors",children:"Новости"}),P.jsx(Tt,{to:ls("statji"),className:"font-heading text-sm uppercase tracking-wider hover:text-accent transition-colors",children:"Статьи"}
54),P.jsx(Tt,{to:ls("glossary"),className:"font-heading text-sm uppercase tracking-wider hover:text-accent transition-colors",children:"Глоссарий"})]}),P.jsxs("p",{className:"text-xs text-muted-foreground font-sans",children:["© ",new Date().getFullYear()," HashTelegraph. Все права защищены."]})]})})})}function ZI(){const{data:e,isLoading:t}=An({queryKey:["site-setting","hot_topic_tag_slug"],queryFn:async()=>{const{data:u}=await qr.from("site_settings").select("value").eq("key","hot_topic_tag_slug").maybeSingle();return u?.value??""},staleTime:3e5,gcTime:18e5,retry:1}),{data:r,isLoading:s}=An({queryKey:["hot-topic",e],enabled:!!e,staleTime:5*6e4,gcTime:30*6e4,retry:1,queryFn:async()=>{const u=qr.from("tags").select("id, name, slug").eq("slug",e).maybeSingle(),h=qr.from("articles").select("id, title, slug, article_tags!inner(tags!inner(slug))").eq("article_tags.tags.slug",e).eq("status","published").order("published_at",{ascending:!1}).limit(3),[{data:f,error:m},{data:g,error:v}]=await Promise.all([u,h]);return m&&console.warn("[HotTopic] tag query error",m),v&&console.warn("[HotTopic] articles query error",v),f?{tag:f,articles:g??[]}:null}}),o="flex flex-col justify-center gap-1 min-h-[133px]";if(t||e&&s)return P.jsxs("div",{className:o,"aria-hidden":!0,children:[P.jsx("div",{className:"h-[10px] w-32 bg-muted/60 rounded mb-1 animate-pulse"}),P.jsx("div",{className:"space-y-1.5",children:[0,1,2].map(u=>P.jsxs("div",{className:"space-y-1",children:[P.jsx("div",{className:"h-[14px] w-full bg-muted/60 rounded animate-pulse"}),P.jsx("div",{className:"h-[14px] w-4/6 bg-muted/60 rounded animate-pulse"})]},u))})]});if(!e)return P.jsx("div",{className:o,"aria-hidden":!0});const a=r?.tag,c=r?.articles??[];return a?P.jsxs("div",{className:o,children:[P.jsxs(Tt,{to:dh(a.slug),className:"font-heading text-[10px] uppercase tracking-[0.2em] text-muted-foreground hover:text-accent transition-colors",children:["Горячая тема: ",P.jsxs("span",{className:"text-accent",children:["#",a.name]})]}),c.length>0&&P.jsx("div",{className:"space-y-1.5",children:c.map(u=>P.jsx(Tt,{to:ls(u.slug),className:"block",children:P.jsx("h4",{className:"font-heading text-sm font-bold leading-tight hover:text-accent transition-colors line-clamp-2 uppercase",children:u.title})},u.id))})]}):P.jsx("div",{className:o,children:P.jsxs(Tt,{to:dh(e),className:"font-heading text-xs uppercase tracking-wider text-muted-foreground hover:text-accent transition-colors",children:["Горячая тема: #",e," →"]})})}const eL="/assets/logo-illustration-D81AqZxa.png",tL="/assets/index-aku7S1rz.css",Bo=45591750,rL=["hashtelegraph.com","www.hashtelegraph.com"];let hh=null;function C0(){return window.__htInitialPV}function nL(){return typeof window>"u"?!1:rL.includes(window.location.hostname)&&!!C0()}function sL(){return hh||(C0()?.url??null)}const iL=20,oL=15e3,aL=3e3,xo=[];let ql=!1,Wh=!1,Cd=!1,hi=null,jy=!1;function T0(){return window.ym}function lL(){return!!window.__htInitialSent}function Td(){ql||(ql=!0,hi&&clearTimeout(hi),hi=null,Vh())}function cL(){if(!ql){if(lL())return Td();jy||(jy=!0,window.addEventListener("ht:initial-pv-sent",Td,{once:!0})),hi||(hi=setTimeout(()=>{hi=null,Wh=!0,Td()},oL))}}function Vh(){if(!ql||Cd)return;const e=T0();if(!e)return;if(Wh){for(;xo.length;){const a=xo.shift();e(Bo,"hit",a.url,{title:a.title,referer:a.referer})}return}const t=xo.shift();if(!t)return;Cd=!0;let r=!1;const s=()=>{r||(r=!0,clearTimeout(o),Cd=!1,Vh())},o=setTimeout(s,aL);e(Bo,"hit",t.url,{title:t.title,referer:t.referer,callback:s})}function uL(e,t){const r=sL();return r===e||(hh=e,!nL())||!T0()||xo.length>=iL&&!Wh?!1:(xo.push({url:e,title:t,referer:r??document.referrer}),cL(),Vh(),!0)}function Mj(e){const t=e.stableMs??250;let r=e.initialSlug,s=null,o=null;const a=()=>{o&&clearTimeout(o),o=null,s=null};return{onVisible(c){if(c===r){a();return}c!==s&&(a(),s=c,o=setTimeout(()=>{o=null,s=null,r=c,e.commit(c)},t))},get committed(){return r},dispose:a}}const dL=O.lazy(()=>Qt(()=>import("./RootClientIsland-YDs1FgN_.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));function hL(){O.useEffect(()=>{if(typeof window>"u")return;const e=window.location.hostname,t=e.startsWith("id-preview--")&&e.endsWith(".lovable.app"),r=e.endsWith(".lovableproject.com")||e.endsWith(".sandbox.lovable.dev");
54if(!t&&!r||document.querySelector('meta[name="robots"]'))return;const s=document.createElement("meta");s.name="robots",s.content="noindex, nofollow",document.head.appendChild(s)},[])}function fL(){O.useEffect(()=>{const e=window.location.hostname,t=["hashtelegraph.com","www.hashtelegraph.com","localhost","127.0.0.1"],r=e.startsWith("id-preview--")&&e.endsWith(".lovable.app"),s=e.endsWith(".lovableproject.com")||e.endsWith(".sandbox.lovable.dev");if(!t.includes(e)&&!r&&!s){window.location.replace(`https://hashtelegraph.com${window.location.pathname}${window.location.search}${window.location.hash}`);return}if(!r&&!s&&window.top!==window.self){try{window.top&&(window.top.location.href=`https://hashtelegraph.com${window.location.pathname}`)}catch{document.documentElement.style.display="none"}return}},[])}const pL=`(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
55m[i].l=1*new Date();
56for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
57k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
58(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
59if (location.hostname === "hashtelegraph.com" || location.hostname === "www.hashtelegraph.com") {
60  window.__htInitialPV = {url: location.href, title: document.title, referrer: document.referrer};
61  ym(${Bo}, "init", {defer:true,clickmap:true,trackLinks:true,accurateTrackBounce:true,webvisor:true,ecommerce:"dataLayer"});
62  ym(${Bo}, "hit", window.__htInitialPV.url, {title: window.__htInitialPV.title, referer: window.__htInitialPV.referrer, callback: function(){ window.__htInitialSent = true; window.dispatchEvent(new Event("ht:initial-pv-sent")); }});
63}`;function gL(){const e=rc({select:r=>r.location.href}),t=O.useRef(!0);O.useEffect(()=>{if(t.current){t.current=!1;return}const r=setTimeout(()=>{uL(window.location.href,document.title)},50);return()=>clearTimeout(r)},[e])}const zt=CR()({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"},{name:"author",content:"HashTelegraph"},{title:"Hash Telegraph — криптовалюты, ИИ и технологии"},{name:"description",content:"Hash Telegraph пишет о криптовалютах, искусственном интеллекте и технологиях, которые меняют мир. Первое в истории СМИ, рецензируемое искусственным интеллектом."}
63,{name:"google-site-verification",content:"2AzUdbnzmpIgCCX7yqbElgc6W2IszUzEbe0KEjVbhos"},{name:"yandex-verification",content:"9cf493302a74837f"},{property:"og:type",content:"website"},{property:"og:site_name",content:"HashTelegraph"},{property:"og:locale",content:"ru_RU"},{property:"og:title",content:"Hash Telegraph — криптовалюты, ИИ и технологии"},{property:"og:description",content:"Hash Telegraph пишет о криптовалютах, искусственном интеллекте и технологиях, которые меняют мир. Первое в истории СМИ, рецензируемое искусственным интеллектом."},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:site",content:"@hashtelegraph"}],links:[{rel:"stylesheet",href:tL},{rel:"preconnect",href:"https://fonts.googleapis.com"},{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"},{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,400&family=Open+Sans:wght@400;600;700&family=Oswald:wght@400;500;600;700&display=swap"},{rel:"icon",href:"/favicon.png?v=2",type:"image/png",sizes:"32x32"},{rel:"alternate",type:"application/rss+xml",title:"HashTelegraph — RSS",href:"https://hashtelegraph.com/rss.xml"}]}),component:mL,errorComponent:wL,notFoundComponent:_L});function qh({children:e}){return P.jsxs("html",{lang:"ru",children:[P.jsxs("head",{children:[P.jsx(JR,{}),P.jsx("script",{dangerouslySetInnerHTML:{__html:pL}})]}),P.jsxs("body",{children:[e,P.jsx("noscript",{children:P.jsx("div",{children:P.jsx("img",{src:`https://mc.yandex.ru/watch/${Bo}`,style:{position:"absolute",left:"-9999px"},alt:""})})}),P.jsx(QR,{})]})]})}function mL(){return hL(),fL(),gL(),P.jsx(qh,{children:P.jsx(vL,{children:P.jsx(yL,{children:P.jsx(Xv,{})})})})}function yL({children:e}){const t=rc({select:a=>a.location.pathname});if(/^(\/admin|\/login|\/preview|\/review)(\/|$)/.test(t))return P.jsx(P.Fragment,{children:e});const o=t==="/"?"h1":"span";return P.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[P.jsx(GI,{}),P.jsx(YI,{}),P.jsx("div",{className:"bg-background",children:P.jsxs("div",{className:"container py-3 flex flex-col md:flex-row md:items-center gap-3 md:gap-6",children:[P.jsxs(Sh,{to:"/",className:"shrink-0 flex flex-col items-center gap-1.5 min-h-[60px] md:min-h-[80px] justify-center",children:[P.jsx("img",{src:eL,alt:"HashTelegraph — Liberté, AI, Blockchain",width:1920,height:235,className:"h-12 md:h-16 w-auto",decoding:"async"}),P.jsx(o,{className:"font-heading text-[7px] md:text-[9px] uppercase tracking-[0.45em] md:tracking-[0.55em] text-muted-foreground w-full text-center",children:"Криптовалюты, Искусственный интеллект, Экономика"})]}),P.jsx("div",{className:"md:border-l md:border-border md:pl-6 flex-1 min-w-0",children:P.jsx(ZI,{})})]})}),P.jsx("main",{className:"flex-1 min-h-[80vh]",children:e}),P.jsx(XI,{})]})}function vL({children:e}){const{queryClient:t}=zt.useRouteContext();return P.jsx(kP,{client:t,children:P.jsx(CI,{children:P.jsx(PI,{fallback:e,children:P.jsx(O.Suspense,{fallback:e,children:P.jsx(dL,{children:e})})})})})}function wL({error:e}){console.error(e);const t=Je();return O.useEffect(()=>{AI(e,{boundary:"tanstack_root_error_component"})},[e]),P.jsx(qh,{children:P.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:P.jsxs("div",{style:{maxWidth:480,textAlign:"center"},children:[P.jsx("h1",{style:{fontSize:22,margin:"0 0 12px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Что-то пошло не так"}),P.jsx("p",{style:{margin:"0 0 24px",opacity:.8},children:"Страница не смогла отрендериться. Попробуйте обновить или вернуться на главную."}),P.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"center",flexWrap:"wrap"},children:[P.jsx("button",{type:"button",onClick:()=>
63t.invalidate(),style:{padding:"10px 18px",border:"1px solid currentColor",background:"transparent",cursor:"pointer",textTransform:"uppercase",letterSpacing:"0.08em"},children:"Попробовать снова"}),P.jsx("a",{href:"/",style:{padding:"10px 18px",border:"1px solid currentColor",textDecoration:"none",color:"inherit",textTransform:"uppercase",letterSpacing:"0.08em"},children:"На главную"})]})]})})})}function _L(){return P.jsx(qh,{children:P.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:P.jsxs("div",{style:{textAlign:"center"},children:[P.jsx("h1",{style:{fontSize:40,margin:"0 0 8px"},children:"404"}),P.jsx("p",{style:{margin:"0 0 16px",opacity:.7},children:"Страница не найдена"}),P.jsx("a",{href:"/",style:{textDecoration:"underline"},children:"На главную"})]})})})}const bL=()=>Qt(()=>import("./search-CXEd7Puq.js"),[]),SL=pr("/search")({head:()=>({meta:[{title:"Поиск — HashTelegraph"},{name:"robots",content:"noindex, nofollow"}]}),component:gr(bL,"component")}),xL=()=>Qt(()=>import("./login-CXEd7Puq.js"),[]),EL=pr("/login")({head:()=>({meta:[{title:"Вход — HashTelegraph"},{name:"robots",content:"noindex, nofollow"}]}),component:gr(xL,"component")});function $j(e){return e}function Dj(e){return e??""}const Oe="https://hashtelegraph.com",kL="https://hashtelegraph.com/og-fallback-v2.jpg",RL="Hash Telegraph пишет о криптовалютах, искусственном интеллекте и технологиях, которые меняют мир. Первое в истории СМИ, рецензируемое искусственным интеллектом.",Rr="Криптовалюты, искусственный интеллект и технологии, которые меняют мир.";function ds(e){const t=[],r=[],s=[],o=e.description||RL,a=e.canonical?At(e.canonical):void 0,c=e.ogType||"website",u=e.ogImage||void 0,h=u?.startsWith("/")?`${Oe}${u}`:u||kL;if(t.push({title:e.title}),t.push({name:"description",content:o}),t.push({property:"og:title",content:e.title}),t.push({property:"og:description",content:o}),t.push({property:"og:type",content:c}),t.push({property:"og:image",content:h}),t.push({name:"twitter:card",content:"summary_large_image"}),t.push({name:"twitter:title",content:e.title}),t.push({name:"twitter:description",content:o}),t.push({name:"twitter:image",content:h}),a&&(t.push({property:"og:url",content:a}),r.push({rel:"canonical",href:a})),e.noindex&&t.push({name:"robots",content:"noindex, nofollow, noarchive"}),e.article){const f=e.article;f.publishedTime&&t.push({property:"article:published_time",content:f.publishedTime}),f.modifiedTime&&t.push({property:"article:modified_time",content:f.modifiedTime}),f.author&&t.push({property:"article:author",content:f.author}),f.section&&t.push({property:"article:section",content:f.section}),f.tags?.forEach((m,g)=>{t.push({property:`article:tag:${g}`,content:m})})}if(e.jsonLd){const f=Array.isArray(e.jsonLd)?e.jsonLd:[e.jsonLd];for(const m of f)s.push({type:"application/ld+json",children:JSON.stringify(m)})}return{meta:t,links:r,scripts:s}}const CL=()=>Qt(()=>import("./_-DtqBFgK5.js"),[]),TL=pr("/$")({head:()=>ds({title:"Страница не найдена — HashTelegraph",description:"Запрашиваемая страница не найдена. Возможно, она была удалена или адрес введён неверно. Перейдите на главную HashTelegraph.",noindex:!0}),loader:()=>{throw Ho()},component:gr(CL,"component")}),PL=11;function AL(e){return{id:e.id,title:e.title,slug:e.slug,excerpt:e.excerpt??null,featured_image:e.featured_image??null,published_at:e.published_at??null,category_name:e.article_categories?.[0]?.categories?.name??null,category_slug:e.article_categories?.[0]?.categories?.slug??null}}var P0={};function OL(e){return e.startsWith("sb_publishable_")||e.startsWith("sb_secret_")}function IL(e){return(t,r)=>{const s=new Headers(typeof Request<"u"&&t instanceof Request?t.headers:void 0);
63return r?.headers&&new Headers(r.headers).forEach((o,a)=>s.set(a,o)),OL(e)&&s.get("Authorization")===`Bearer ${e}`&&s.delete("Authorization"),s.set("apikey",e),fetch(t,{...r,headers:s})}}const LL=typeof process<"u"&&P0?.SUPABASE_URL||location.origin + "/supabase",Ny=typeof process<"u"&&P0?.SUPABASE_PUBLISHABLE_KEY||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imhid3B3eHlwdmtuY3l2dnVlcWtmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODM0ODA3ODAsImV4cCI6MjA5OTA1Njc4MH0.EobqTstpDfZAkM_3b3hkx_1ycMusd5BugnvCzcujxhE",wt=_w(LL,Ny,{global:{fetch:IL(Ny)},auth:{storage:void 0,storageKey:"hashtelegraph-ssr-anon",persistSession:!1,autoRefreshToken:!1,detectSessionInUrl:!1}}),jL=()=>Qt(()=>import("./index-CZugjLlr.js"),__vite__mapDeps([13,14,15,16,6,17,18,19])),NL={"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":`${Oe}/#website`,name:"Hash Telegraph",url:Oe,description:"Hash Telegraph пишет о криптовалютах, искусственном интеллекте и технологиях, которые меняют мир. Первое в истории СМИ, рецензируемое искусственным интеллектом.",publisher:{"@id":`${Oe}/#organization`},potentialAction:{"@type":"SearchAction",target:`${Oe}/?s={search_term_string}`,"query-input":"required name=search_term_string"}},{"@type":"Organization","@id":`${Oe}/#organization`,name:"HashTelegraph",url:Oe,logo:{"@type":"ImageObject",url:`${Oe}/favicon.png`},sameAs:["https://t.me/hashtelegraph"]}]},ML=pr("/")({loader:async()=>{const{data:e}=await wt.from("service_snippets").select("link_slug"),t=(e??[]).map(c=>c.link_slug);let r=wt.from("articles").select(`id, title, slug, excerpt, featured_image, published_at,
64         article_categories(categories(name, slug))`,{count:"exact"}).eq("status","published").order("published_at",{ascending:!1}).limit(PL);for(const c of t)r=r.neq("slug",c);const{data:s,count:o}=await r,a=(s??[]).map(AL);return{articles:a,total:o??a.length,snippetSlugs:t}},head:()=>ds({title:"Hash Telegraph — криптовалюты, ИИ и технологии",description:"Hash Telegraph пишет о криптовалютах, искусственном интеллекте и технологиях, которые меняют мир. Первое в истории СМИ, рецензируемое искусственным интеллектом.",canonical:`${Oe}/`,jsonLd:NL}),component:gr(jL,"component")}),$L=()=>Qt(()=>import("./index-uIAhIImT.js"),__vite__mapDeps([20,21,15,22,23,17,18,19,24,14,16,6,25])),DL=pr("/$slug/")({loader:async({params:e})=>{const t=e.slug,[r,s,o]=await Promise.all([wt.from("categories").select("id, name, slug, parent_id").eq("slug",t).maybeSingle(),wt.from("articles").select(`*,
65           authors(name, slug, avatar_url),
66           article_categories(categories(name, slug)),
67           article_tags(tags(name, slug))`).eq("slug",t).eq("status","published").maybeSingle(),wt.from("article_slug_aliases").select("article_id, articles!inner(slug)").eq("old_slug",t).maybeSingle()]);if(r.data){const{data:a}=await wt.from("categories").select("id").eq("parent_id",r.data.id),c=[r.data.id,...(a??[]).map(m=>m.id)],{data:u}=await wt.rpc("get_category_articles",{p_category_ids:c,p_limit:15,p_offset:0}),h=(u??[]).map(m=>({id:m.id,title:m.title,slug:m.slug,excerpt:m.excerpt,featured_image:m.featured_image,published_at:m.published_at})),f=u&&u.length>0?Number(u[0].total_count):0;return{kind:"category",category:r.data,categoryIds:c,articles:h,total:f}}if(s.data){const a=s.data;return{kind:"article",article:{...a,author:a.authors??null,categories:(a.article_categories??[]).map(c=>c.categories).filter(Boolean),tags:(a.article_tags??[]).map(c=>c.tags).filter(Boolean)}}}throw o.data&&o.data.articles?.slug?Gl({to:"/$slug/",params:{slug:o.data.articles.slug},statusCode:301}):Ho()},head:({loaderData:e})=>{if(!e)return{};if(e.kind==="category"){const h=e.category,f=At(`${Oe}/${h.slug}`),m=[{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Главная",item:Oe},{"@type":"ListItem",position:2,name:h.name,item:f}]},{"@context":"https://schema.org","@type":"CollectionPage",name:`${h.name} — HashTelegraph`,description:`Материалы раздела ${h.name} на Hash Telegraph. ${Rr}`,url:f,isPartOf:{"@type":"WebSite",name:"HashTelegraph",url:Oe},...e.articles.length>0?{mainEntity:{"@type":"ItemList",itemListElement:e.articles.map((g,v)=>({"@type":"ListItem",position:v+1,url:At(`${Oe}/${g.slug}`),name:g.title}))}}:{}}];return ds({title:`${h.name} — HashTelegraph`,description:`Материалы раздела ${h.name} на Hash Telegraph. ${Rr}`,canonical:f,jsonLd:m})}const t=e.article,r=At(`${Oe}/${t.slug}`),s=t.categories[0],o=t.tags.map(h=>
67h.name),a={"@type":"NewsArticle",headline:t.title,description:t.excerpt||"",image:t.featured_image||void 0,datePublished:t.published_at,dateModified:t.updated_at,url:r,mainEntityOfPage:{"@type":"WebPage","@id":r},author:t.author?{"@type":"Person",name:t.author.name}:{"@type":"Organization",name:"HashTelegraph"},publisher:{"@type":"Organization",name:"HashTelegraph",url:Oe},articleSection:s?.name,keywords:o.join(", ")},u={"@type":"BreadcrumbList",itemListElement:[{name:"Главная",item:`${Oe}/`},...s?[{name:s.name,item:At(`${Oe}/${s.slug}`)}]:[],{name:t.title,item:r}].map((h,f)=>({"@type":"ListItem",position:f+1,name:h.name,item:h.item}))};return ds({title:`${t.seo_title||t.title} — HashTelegraph`,description:t.meta_description||t.excerpt||t.title,canonical:r,ogType:"article",ogImage:t.featured_image||void 0,article:{publishedTime:t.published_at,modifiedTime:t.updated_at,author:t.author?.name,section:s?.name,tags:o},jsonLd:{"@context":"https://schema.org","@graph":[a,u]}})},component:gr($L,"component")}),UL=()=>Qt(()=>import("./_slug-DSAuiE5U.js"),__vite__mapDeps([26,14,15,16,6])),FL=30,BL=pr("/tag/$slug")({loader:async({params:e})=>{const t=e.slug,r=Array.from(new Set([t,encodeURIComponent(t).toLowerCase()])),{data:s}=await wt.from("tags").select("id, name, slug").in("slug",r).limit(1).maybeSingle();if(!s)throw Ho();const{data:o}=await wt.from("articles").select("id, title, slug, excerpt, featured_image, published_at, article_tags!inner(tag_id)").eq("article_tags.tag_id",s.id).eq("status","published").order("published_at",{ascending:!1,nullsFirst:!1}).range(0,FL-1),a=(o??[]).map(c=>({id:c.id,title:c.title,slug:c.slug,excerpt:c.excerpt,featured_image:c.featured_image,published_at:c.published_at}));return{tag:s,articles:a}},head:({loaderData:e,params:t})=>{if(!e)return{};const{tag:r,articles:s}=e,o=`${Oe}/tag/${t.slug}/`,a={"@context":"https://schema.org","@type":"CollectionPage",name:r?.name?`#${r.name} — HashTelegraph`:"Тег — HashTelegraph",description:r?.name?`Материалы по теме #${r.name} на Hash Telegraph. ${Rr}`:`Материалы по теме на Hash Telegraph. ${Rr}`,url:o,isPartOf:{"@type":"WebSite",name:"HashTelegraph",url:Oe},...s.length>0?{mainEntity:{"@type":"ItemList",itemListElement:s.map((c,u)=>({"@type":"ListItem",position:u+1,url:`${Oe}/${c.slug}`,name:c.title}))}}:{}};return ds({title:`${r?.name?`#${r.name}`:"Тег"} — HashTelegraph`,description:r?.name?`Материалы по теме #${r.name} на Hash Telegraph. ${Rr}`:`Материалы по теме на Hash Telegraph. ${Rr}`,canonical:o,jsonLd:a})},component:gr(UL,"component")}),zL=()=>Qt(()=>import("./_slug-B8RS0q_P.js"),__vite__mapDeps([27,14,15,16,6])),HL=30,WL=pr("/statji/$slug")({loader:async({params:e})=>{const{data:t}=await wt.from("authors").select("id, name, slug, avatar_url").eq("slug",e.slug).maybeSingle();if(!t){const{data:s}=await wt.from("author_slug_aliases").select("authors:author_id(slug)").eq("old_slug",e.slug).maybeSingle(),o=s?.authors?.slug;throw o&&o!==e.slug?Gl({to:"/statji/$slug/",params:{slug:o},statusCode:301}):Ho()}const{data:r}=await wt.from("articles").select("id, title, slug, excerpt, featured_image, published_at").eq("author_id",t.id).eq("status","published").is("deleted_at",null).order("published_at",{ascending:!1,nullsFirst:!1}).range(0,HL-1);return{author:t,articles:r??[]}},head:({loaderData:e,params:t})=>{if(!e)return{};const{author:r,articles:s}=e,o=`${Oe}/statji/${t.slug}/`,a={"@context":"https://schema.org","@type":"CollectionPage",name:`${r.name} — все материалы`,description:`Все материалы автора ${r.name} на Hash Telegraph. ${Rr}`,url:o,about:{"@type":"Person",name:r.name},isPartOf:{"@type":"WebSite",name:"HashTelegraph",url:Oe},...s.length>0?{mainEntity:{"@type":"ItemList",itemListElement:s.map((c,u)=>({"@type":"ListItem",position:u+1,url:`${Oe}/${c.slug}/`,name:c.title}))}}:{}};return ds({title:`${r.name} — все материалы — HashTelegraph`,description:`Все материалы автора ${r.name} на Hash Telegraph. ${Rr}`,canonical:o,jsonLd:a})},component:gr(zL,"component")}),VL=()=>Qt(()=>import("./review._token-D6WZ4RgZ.js"),[]),qL=pr("/review/$token")({head:()=>({meta:[{title:"Ревью материала — HashTelegraph"},{name:"robots",content:"noindex, nofollow"}]}),component:gr(VL,"component")}),KL=()=>Qt(()=>import("./preview._id-D6WZ4RgZ.js"),[]),GL=pr("/preview/$id")({head:()=>({meta:[{title:"Предпросмотр — HashTelegraph"},{name:"robots",content:"noindex, nofollow"}]}),component:gr(KL,"component")}),JL=()=>Qt(()=>import("./admin._-C6VI8aQh.js"),[]),QL=pr("/admin/$")({head:()=>({meta:[{title:"Админка — HashTelegraph"},{name:"robots",content:"noindex, nofollow"}]}),component:gr(JL,"component")}),YL=()=>Qt(()=>import("./_subslug-D2VbfzMm.js"),__vite__mapDeps([28,24,14,15,16,6,25])),XL=pr("/$slug/$subslug")({loader:async({params:e})=>{const{data:t}=await wt.from("categories").select("id, name, slug, parent_id").eq("slug",e.subslug).maybeSingle();if(!t)throw Ho();const{data:r}=await wt.from("categories").select("id").eq("parent_id",t.id),s=[t.id,...(r??[]).map(u=>u.id)],{data:o}=await wt.rpc("get_category_articles",{p_category_ids:s,p_limit:15,p_offset:0}),a=(o??[]).map(u=>({id:u.id,title:u.title,slug:u.slug,excerpt:u.excerpt,featured_image:u.featured_image,published_at:u.published_at})),c=o&&o.length>0?Number(o[0].total_count):0;return{category:t,articles:a,total:c,categoryIds:s,parentSlug:e.slug}},head:({loaderData:e})=>
67{if(!e)return{};const{category:t,articles:r,parentSlug:s}=e,o=At(`${Oe}/${s}/${t.slug}`),a=[{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Главная",item:Oe},{"@type":"ListItem",position:2,name:t.name,item:o}]},{"@context":"https://schema.org","@type":"CollectionPage",name:`${t.name} — HashTelegraph`,description:`Материалы раздела ${t.name} на Hash Telegraph. ${Rr}`,url:o,isPartOf:{"@type":"WebSite",name:"HashTelegraph",url:Oe},...r.length>0?{mainEntity:{"@type":"ItemList",itemListElement:r.map((c,u)=>({"@type":"ListItem",position:u+1,url:At(`${Oe}/${c.slug}`),name:c.title}))}}:{}}];return ds({title:`${t.name} — HashTelegraph`,description:`Материалы раздела ${t.name} на Hash Telegraph. ${Rr}`,canonical:o,jsonLd:a})},component:gr(YL,"component")}),ZL=SL.update({id:"/search",path:"/search",getParentRoute:()=>zt}),ej=EL.update({id:"/login",path:"/login",getParentRoute:()=>zt}),tj=TL.update({id:"/$",path:"/$",getParentRoute:()=>zt}),rj=ML.update({id:"/",path:"/",getParentRoute:()=>zt}),nj=DL.update({id:"/$slug/",path:"/$slug/",getParentRoute:()=>zt}),sj=BL.update({id:"/tag/$slug",path:"/tag/$slug",getParentRoute:()=>zt}),ij=WL.update({id:"/statji/$slug",path:"/statji/$slug",getParentRoute:()=>zt}),oj=qL.update({id:"/review/$token",path:"/review/$token",getParentRoute:()=>zt}),aj=GL.update({id:"/preview/$id",path:"/preview/$id",getParentRoute:()=>zt}),lj=QL.update({id:"/admin/$",path:"/admin/$",getParentRoute:()=>zt}),cj=XL.update({id:"/$slug/$subslug",path:"/$slug/$subslug",getParentRoute:()=>zt}),uj={IndexRoute:rj,SplatRoute:tj,LoginRoute:ej,SearchRoute:ZL,SlugSubslugRoute:cj,AdminSplatRoute:lj,PreviewIdRoute:aj,ReviewTokenRoute:oj,StatjiSlugRoute:ij,TagSlugRoute:sj,SlugIndexRoute:nj},dj=zt._addFileChildren(uj);function hj(){const e=new xP({defaultOptions:{queries:{staleTime:6e4}}});return HR({routeTree:dj,context:{queryClient:e},defaultPreload:"intent",scrollRestoration:!0,trailingSlash:"preserve"})}async function fj(){const e=await hj();let t;if(sy){const r=await sy.getOptions();r.serializationAdapters=r.serializationAdapters??[],window.__TSS_START_OPTIONS__=r,t=r.serializationAdapters,e.options.defaultSsr=r.defaultSsr}else t=[],window.__TSS_START_OPTIONS__={serializationAdapters:t};return t.push(Kk),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:"",serializationAdapters:t}),e.stores.matchesId.get().length||await Jk(e),e}var pj=fj;async function gj(){const e=await pj();return window.$_TSR?.h(),e}var Pd;function mj(){return Pd||(Pd=gj()),P.jsx(Zk,{promise:Pd,children:e=>P.jsx(qR,{router:e})})}O.startTransition(()=>{jb.hydrateRoot(document,P.jsx(O.StrictMode,{children:P.jsx(mj,{})}))});export{EP as $,XL as A,Tj as B,PI as C,yj as D,Ej as E,xj as F,MP as G,jj as H,PL as I,GI as J,eL as K,Tt as L,ZI as M,XI as N,jb as O,c0 as P,mP as Q,Cj as R,$I as S,YI as T,Dj as U,u0 as V,Nj as W,Ly as X,At as Y,MI as Z,Qt as _,gs as a,zo as a0,bj as a1,QA as a2,JA as a3,GA as a4,Ty as a5,YA as a6,Pj as a7,XA as a8,Aj as a9,pO as aA,kj as aB,eO as aa,Oj as ab,bO as ac,e0 as ad,jw as ae,Ah as af,SO as ag,xO as ah,gS as ai,vj as aj,Dy as ak,Pt as al,Cn as am,qk as an,My as ao,KO as ap,Rj as aq,CO as ar,Ko as as,Zd as at,Mo as au,_P as av,ut as aw,Ct as ax,Ew as ay,BP as az,ps as b,Wr as c,Lw as d,tc as e,qP as f,Uo as g,RI as h,rc as i,P as j,An as k,ls as l,ML as m,AL as n,Mj as o,fi as p,uL as q,O as r,qr as s,dh as t,ac as u,DL as v,$j as w,BL as x,Hh as y,WL 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.